@knaw-huc/panoptes-react-blocks 0.0.1
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/LICENSE +21 -0
- package/README.md +666 -0
- package/dist/components/blocks/external-link/index.d.ts +8 -0
- package/dist/components/blocks/json/JsonBlockRenderer.d.ts +5 -0
- package/dist/components/blocks/json/index.d.ts +18 -0
- package/dist/components/blocks/json/schemaSelectors.d.ts +7 -0
- package/dist/components/blocks/label/index.d.ts +8 -0
- package/dist/components/blocks/link/index.d.ts +13 -0
- package/dist/components/blocks/map/index.d.ts +17 -0
- package/dist/components/blocks/markdown/index.d.ts +8 -0
- package/dist/components/blocks/screen/FormColumn.d.ts +7 -0
- package/dist/components/blocks/screen/FormElement.d.ts +7 -0
- package/dist/components/blocks/screen/FormRow.d.ts +7 -0
- package/dist/components/blocks/screen/ScreenActions.d.ts +1 -0
- package/dist/components/blocks/screen/ScreenForm.d.ts +1 -0
- package/dist/components/blocks/screen/ScreenLinks.d.ts +1 -0
- package/dist/components/blocks/screen/ScreenRenderer.d.ts +1 -0
- package/dist/components/blocks/screen/ScreenSidebar.d.ts +6 -0
- package/dist/components/blocks/screen/ScreenTabs.d.ts +1 -0
- package/dist/components/blocks/screen/context/ItemDataContext.d.ts +7 -0
- package/dist/components/blocks/screen/context/ScreenContext.d.ts +16 -0
- package/dist/components/blocks/screen/hooks/index.d.ts +3 -0
- package/dist/components/blocks/screen/hooks/useElementState.d.ts +8 -0
- package/dist/components/blocks/screen/hooks/useItemData.d.ts +1 -0
- package/dist/components/blocks/screen/hooks/useScreenContext.d.ts +2 -0
- package/dist/components/blocks/screen/hooks/useScreenState.d.ts +3 -0
- package/dist/components/blocks/screen/index.d.ts +6 -0
- package/dist/components/blocks/screen/schema/binding.d.ts +8 -0
- package/dist/components/blocks/screen/schema/index.d.ts +3 -0
- package/dist/components/blocks/screen/schema/types.d.ts +100 -0
- package/dist/components/blocks/toggle/index.d.ts +8 -0
- package/dist/components/ghostline/Ghostline.d.ts +1 -0
- package/dist/index.cjs +37 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +37518 -0
- package/dist/panoptes-react-blocks.css +1 -0
- package/package.json +57 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),Se=require("react"),Mt=require("@knaw-huc/panoptes-react"),Ig=require("@tanstack/react-router");function Sg(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Gn=Sg(Se),Rg="_empty_401nn_1",Lg="_link_401nn_6",Vn={empty:Rg,link:Lg};function wg({block:t}){const{value:e}=t;return e?O.jsx("a",{className:Vn.link,href:e,target:"_blank noreferrer noopener",children:e}):O.jsx("span",{className:Vn.empty,children:"—"})}const kg=Se.createContext(null),Ja={didCatch:!1,error:null};class ed extends Se.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ja}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,i,r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];(n=(i=this.props).onReset)===null||n===void 0||n.call(i,{args:s,reason:"imperative-api"}),this.setState(Ja)}}componentDidCatch(e,n){var i,r;(i=(r=this.props).onError)===null||i===void 0||i.call(r,e,n)}componentDidUpdate(e,n){const{didCatch:i}=this.state,{resetKeys:r}=this.props;if(i&&n.error!==null&&Og(e.resetKeys,r)){var s,a;(s=(a=this.props).onReset)===null||s===void 0||s.call(a,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(Ja)}}render(){const{children:e,fallbackRender:n,FallbackComponent:i,fallback:r}=this.props,{didCatch:s,error:a}=this.state;let o=e;if(s){const u={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(u);else if(i)o=Se.createElement(i,u);else if(r!==void 0)o=r;else throw a}return Se.createElement(kg.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}function Og(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,i)=>!Object.is(n,e[i]))}function td(t,e,n){const r=e.split(".").reduce((s,a)=>s&&s[a],t);return r===void 0?n:r}const Ng=(t,e)=>td(t,`${e}.hidden`,!1),Dg="_container_1lf6f_1",Pg="_line_1lf6f_7",Nl={container:Dg,line:Pg};function Cu(){return O.jsx("div",{className:Nl.container,children:O.jsx("div",{className:Nl.line})})}const Mg="_root_1wbnq_1",vg="_list_1wbnq_5",Fg="_item_1wbnq_12",Bg="_label_1wbnq_16",Ug="_value_1wbnq_24",Hg="_empty_1wbnq_77",zg="_text_1wbnq_82",Yg="_array_1wbnq_95",Gg="_arrayItem_1wbnq_101",It={root:Mg,list:vg,item:Fg,label:Bg,value:Ug,empty:Hg,text:zg,array:Yg,arrayItem:Gg},jg=t=>t.type==="json",Wg=t=>t.replace(/_/g," ").replace(/([a-z])([A-Z][a-z])/g,"$1 $2").toLowerCase().replace(/^\w/,e=>e.toUpperCase()),nd={omit(t,e){try{return t?Ng(t,e):!1}catch{return!1}},childSchema(t,e){return t??void 0}},Xg=({label:t})=>O.jsx("dt",{className:It.label,children:Wg(t)}),Vg=({value:t})=>{const{translateFn:e}=Mt.usePanoptes();if(t===null||t==="")return O.jsx("span",{className:It.empty,"aria-label":e?e("panoptes.noValue"):"No value",children:"—"});switch(typeof t){case"boolean":return O.jsx(O.Fragment,{children:t?e?e("panoptes.yes"):"Yes":e?e("panoptes.no"):"No"});case"number":return O.jsx(O.Fragment,{children:t});case"string":return O.jsx("pre",{className:It.text,children:t});default:return O.jsx("pre",{className:It.text,children:String(t)})}},Kg=({config:t,value:e,model:n})=>{const i=Mt.useBlock(t);if(!i)return null;const r={...t,value:e,model:n};return O.jsx(Se.Suspense,{fallback:O.jsx(Cu,{}),children:O.jsx(i,{block:r})})},qg=({propKey:t,value:e,schema:n,model:i,path:r})=>{const s=td(n,t),a=nd.childSchema(n,t);return s?.type?O.jsx(ed,{fallback:O.jsx(Qs,{value:e,schema:a,path:r}),children:O.jsx(Kg,{config:s,value:e,model:i})}):O.jsx(Qs,{value:e,schema:a,path:r})},Qs=({value:t,schema:e,path:n})=>{if(t===null||typeof t!="object")return O.jsx(Vg,{value:t});if(Array.isArray(t))return t.length===0?O.jsx("span",{className:It.empty,children:"—"}):O.jsx("ol",{className:It.array,children:t.map((r,s)=>O.jsx("li",{className:It.arrayItem,children:O.jsx(Qs,{value:r,schema:e,path:`${n}[${s}]`})},`${n}[${s}]`))});const i=Object.entries(t);return i.length===0?O.jsx("span",{className:It.empty,children:"—"}):O.jsx("dl",{className:It.list,children:i.map(([r,s])=>{if(nd.omit(e,r))return null;const a=`${n}.${r}`;return O.jsxs("div",{className:It.item,children:[O.jsx(Xg,{label:r}),O.jsx("dd",{className:It.value,children:O.jsx(qg,{propKey:r,value:s,schema:e,model:t,path:a})})]},a)})})},$g=({block:t})=>{const e=t;return jg(e)?O.jsx("div",{className:It.root,children:O.jsx(Qs,{value:e.value,schema:e.config,path:"$"})}):(console.error("JsonBlockRenderer used with non-JSON block:",t),null)},Zg=({block:t})=>O.jsx($g,{block:t});function Qg({block:t}){const{value:e}=t;return e?O.jsx("span",{children:e}):O.jsx("span",{className:Vn.empty,children:"—"})}function Jg({block:t}){const e=Ig.useRouter(),{value:n,config:i,model:r}=t;if(!n||!i||!i.url)return O.jsx("span",{className:Vn.empty,children:"—"});const s=e.buildLocation({to:i.url,params:r}).href;return O.jsx("a",{className:Vn.link,href:s,children:n})}const at={ADD:"add",REMOVE:"remove"},er={PROPERTYCHANGE:"propertychange"},ue={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class _a{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function em(t,e,n){let i,r;n=n||pn;let s=0,a=t.length,o=!1;for(;s<a;)i=s+(a-s>>1),r=+n(t[i],e),r<0?s=i+1:(a=i,o=!r);return o?s:~s}function pn(t,e){return t>e?1:t<e?-1:0}function tm(t,e){return t<e?1:t>e?-1:0}function Au(t,e,n){if(t[0]<=e)return 0;const i=t.length;if(e<=t[i-1])return i-1;if(typeof n=="function"){for(let r=1;r<i;++r){const s=t[r];if(s===e)return r;if(s<e)return n(e,t[r-1],s)>0?r-1:r}return i-1}if(n>0){for(let r=1;r<i;++r)if(t[r]<e)return r-1;return i-1}if(n<0){for(let r=1;r<i;++r)if(t[r]<=e)return r;return i-1}for(let r=1;r<i;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return i-1}function nm(t,e,n){for(;e<n;){const i=t[e];t[e]=t[n],t[n]=i,++e,--n}}function Iu(t,e){const n=Array.isArray(e)?e:[e],i=n.length;for(let r=0;r<i;r++)t[t.length]=n[r]}function qn(t,e){const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function im(t,e,n){const i=e||pn;return t.every(function(r,s){if(s===0)return!0;const a=i(t[s-1],r);return!(a>0||a===0)})}function qr(){return!0}function Ea(){return!1}function $r(){}function id(t){let e,n,i;return function(){const r=Array.prototype.slice.call(arguments);return(!n||this!==i||!qn(r,n))&&(i=this,n=r,e=t.apply(this,arguments)),e}}function rm(t){function e(){let n;try{n=t()}catch(i){return Promise.reject(i)}return n instanceof Promise?n:Promise.resolve(n)}return e()}function ds(t){for(const e in t)delete t[e]}function tr(t){let e;for(e in t)return!1;return!e}class bn{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Ta extends _a{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,n){if(!e||!n)return;const i=this.listeners_||(this.listeners_={}),r=i[e]||(i[e]=[]);r.includes(n)||r.push(n)}dispatchEvent(e){const n=typeof e=="string",i=n?e:e.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=n?new bn(e):e;s.target||(s.target=this.eventTarget_||this);const a=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});i in a||(a[i]=0,o[i]=0),++a[i];let u;for(let l=0,c=r.length;l<c;++l)if("handleEvent"in r[l]?u=r[l].handleEvent(s):u=r[l].call(this,s),u===!1||s.propagationStopped){u=!1;break}if(--a[i]===0){let l=o[i];for(delete o[i];l--;)this.removeEventListener(i,$r);delete a[i]}return u}disposeInternal(){this.listeners_&&ds(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,n){if(!this.listeners_)return;const i=this.listeners_[e];if(!i)return;const r=i.indexOf(n);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[r]=$r,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}function pe(t,e,n,i,r){if(r){const a=n;n=function(o){return t.removeEventListener(e,n),a.call(i??this,o)}}else i&&i!==t&&(n=n.bind(i));const s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function Js(t,e,n,i){return pe(t,e,n,i,!0)}function we(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),ds(t))}class fs extends Ta{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ue.CHANGE)}getRevision(){return this.revision_}onInternal(e,n){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=pe(this,e[s],n);return r}return pe(this,e,n)}onceInternal(e,n){let i;if(Array.isArray(e)){const r=e.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=Js(this,e[s],n)}else i=Js(this,e,n);return n.ol_key=i,i}unInternal(e,n){const i=n.ol_key;if(i)sm(i);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],n);else this.removeEventListener(e,n)}}fs.prototype.on;fs.prototype.once;fs.prototype.un;function sm(t){if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)we(t[e]);else we(t)}function me(){throw new Error("Unimplemented abstract method.")}let am=0;function _e(t){return t.ol_uid||(t.ol_uid=String(++am))}class Dl extends bn{constructor(e,n,i){super(e),this.key=n,this.oldValue=i}}class tn extends fs{constructor(e){super(),this.on,this.once,this.un,_e(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let n;return this.values_&&this.values_.hasOwnProperty(e)&&(n=this.values_[e]),n}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,n){let i;i=`change:${e}`,this.hasListener(i)&&this.dispatchEvent(new Dl(i,e,n)),i=er.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Dl(i,e,n))}addChangeListener(e,n){this.addEventListener(`change:${e}`,n)}removeChangeListener(e,n){this.removeEventListener(`change:${e}`,n)}set(e,n,i){const r=this.values_||(this.values_={});if(i)r[e]=n;else{const s=r[e];r[e]=n,s!==n&&this.notify(e,s)}}setProperties(e,n){for(const i in e)this.set(i,e[i],n)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,n){if(this.values_&&e in this.values_){const i=this.values_[e];delete this.values_[e],tr(this.values_)&&(this.values_=null),n||this.notify(e,i)}}}const Pl={LENGTH:"length"};class ws extends bn{constructor(e,n,i){super(e),this.element=n,this.index=i}}class kt extends tn{constructor(e,n){if(super(),this.on,this.once,this.un,n=n||{},this.unique_=!!n.unique,this.array_=e??[],this.unique_)for(let i=1,r=this.array_.length;i<r;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let n=0,i=e.length;n<i;++n)this.push(e[n]);return this}forEach(e){const n=this.array_;for(let i=0,r=n.length;i<r;++i)e(n[i],i,n)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Pl.LENGTH)}insertAt(e,n){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n),this.array_.splice(e,0,n),this.updateLength_(),this.dispatchEvent(new ws(at.ADD,n,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){const n=this.getLength();return this.insertAt(n,e),this.getLength()}remove(e){const n=this.array_;for(let i=0,r=n.length;i<r;++i)if(n[i]===e)return this.removeAt(i)}removeAt(e){if(e<0||e>=this.getLength())return;const n=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new ws(at.REMOVE,n,e)),n}setAt(e,n){const i=this.getLength();if(e>=i){this.insertAt(e,n);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n,e);const r=this.array_[e];this.array_[e]=n,this.dispatchEvent(new ws(at.REMOVE,r,e)),this.dispatchEvent(new ws(at.ADD,n,e))}updateLength_(){this.set(Pl.LENGTH,this.array_.length)}assertUnique_(e,n){const i=this.array_;for(let r=0,s=i.length;r<s;++r)if(i[r]===e&&r!==n)throw new Error("Duplicate item added to a unique collection")}}class Ui extends bn{constructor(e,n,i){super(e),this.map=n,this.frameState=i!==void 0?i:null}}class Dn extends Ui{constructor(e,n,i,r,s,a){super(e,n,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0?r:!1,this.activePointers=a}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const Ne={SINGLECLICK:"singleclick",CLICK:ue.CLICK,DBLCLICK:ue.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},pi=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",om=pi.includes("safari")&&!pi.includes("chrom");om&&(pi.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(pi));const um=pi.includes("webkit")&&!pi.includes("edge"),rd=pi.includes("macintosh"),lm=typeof devicePixelRatio<"u"?devicePixelRatio:1,Ot=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,sd=typeof Image<"u"&&Image.prototype.decode,ad=(function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t})(),Wo={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class cm extends Ta{constructor(e,n){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=n===void 0?1:n,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=pe(i,Wo.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=pe(i,Wo.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(ue.TOUCHMOVE,this.boundHandleTouchMove_,ad?{passive:!1}:!1)}emulateClick_(e){let n=new Dn(Ne.CLICK,this.map_,e);this.dispatchEvent(n),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,n=new Dn(Ne.DBLCLICK,this.map_,e),this.dispatchEvent(n)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new Dn(Ne.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const n=e,i=n.pointerId;if(n.type==Ne.POINTERUP||n.type==Ne.POINTERCANCEL){delete this.trackedTouches_[i];for(const r in this.trackedTouches_)if(this.trackedTouches_[r].target!==n.target){delete this.trackedTouches_[r];break}}else(n.type==Ne.POINTERDOWN||n.type==Ne.POINTERMOVE)&&(this.trackedTouches_[i]=n);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const n=new Dn(Ne.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(n),this.emulateClicks_&&!n.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(we),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const n=new Dn(Ne.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(n),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(pe(i,Ne.POINTERMOVE,this.handlePointerMove_,this),pe(i,Ne.POINTERUP,this.handlePointerUp_,this),pe(this.element_,Ne.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(pe(this.element_.getRootNode(),Ne.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const n=new Dn(Ne.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(n)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const n=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Dn(Ne.POINTERMOVE,this.map_,e,n))}handleTouchMove_(e){const n=this.originalPointerMoveEvent_;(!n||n.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(we(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ue.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(we(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(we),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Pn={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ve={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},J={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function be(t,e){if(!t)throw new Error(e)}const ea=1/0;class hm{constructor(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,ds(this.queuedElements_)}dequeue(){const e=this.elements_,n=this.priorities_,i=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));const r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(e){be(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const n=this.priorityFunction_(e);return n!=ea?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const n=this.elements_,i=this.priorities_,r=n.length,s=n[e],a=i[e],o=e;for(;e<r>>1;){const u=this.getLeftChildIndex_(e),l=this.getRightChildIndex_(e),c=l<r&&i[l]<i[u]?l:u;n[e]=n[c],i[e]=i[c],e=c}n[e]=s,i[e]=a,this.siftDown_(o,e)}siftDown_(e,n){const i=this.elements_,r=this.priorities_,s=i[n],a=r[n];for(;n>e;){const o=this.getParentIndex_(n);if(r[o]>a)i[n]=i[o],r[n]=r[o],n=o;else break}i[n]=s,r[n]=a}reprioritize(){const e=this.priorityFunction_,n=this.elements_,i=this.priorities_;let r=0;const s=n.length;let a,o,u;for(o=0;o<s;++o)a=n[o],u=e(a),u==ea?delete this.queuedElements_[this.keyFunction_(a)]:(i[r]=u,n[r++]=a);n.length=r,i.length=r,this.heapify_()}}class dm extends hm{constructor(e,n){super(i=>e.apply(null,i),i=>i[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=n,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const n=super.enqueue(e);return n&&e[0].addEventListener(ue.CHANGE,this.boundHandleTileChange_),n}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const n=e.target,i=n.getState();if(i===J.LOADED||i===J.ERROR||i===J.EMPTY){i!==J.ERROR&&n.removeEventListener(ue.CHANGE,this.boundHandleTileChange_);const r=n.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,n){let i=0;for(;this.tilesLoading_<e&&i<n&&this.getCount()>0;){const r=this.dequeue()[0],s=r.getKey();r.getState()===J.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,r.load())}}}function fm(t,e,n,i,r){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return ea;const s=t.viewState.center,a=i[0]-s[0],o=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(a*a+o*o)/r}const Ke={ANIMATING:0,INTERACTING:1},Ft={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function ke(t,e,n){return Math.min(Math.max(t,e),n)}function gm(t,e,n,i,r,s){const a=r-n,o=s-i;if(a!==0||o!==0){const u=((t-n)*a+(e-i)*o)/(a*a+o*o);u>1?(n=r,i=s):u>0&&(n+=a*u,i+=o*u)}return Vi(t,e,n,i)}function Vi(t,e,n,i){const r=n-t,s=i-e;return r*r+s*s}function mm(t){const e=t.length;for(let i=0;i<e;i++){let r=i,s=Math.abs(t[i][i]);for(let o=i+1;o<e;o++){const u=Math.abs(t[o][i]);u>s&&(s=u,r=o)}if(s===0)return null;const a=t[r];t[r]=t[i],t[i]=a;for(let o=i+1;o<e;o++){const u=-t[o][i]/t[i][i];for(let l=i;l<e+1;l++)i==l?t[o][l]=0:t[o][l]+=u*t[i][l]}}const n=new Array(e);for(let i=e-1;i>=0;i--){n[i]=t[i][e]/t[i][i];for(let r=i-1;r>=0;r--)t[r][e]-=t[r][i]*n[i]}return n}function Ml(t){return t*180/Math.PI}function jn(t){return t*Math.PI/180}function Ki(t,e){const n=t%e;return n*e<0?n+e:n}function St(t,e,n){return t+n*(e-t)}function ba(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function ks(t,e){return Math.floor(ba(t,e))}function Os(t,e){return Math.ceil(ba(t,e))}function Xo(t,e,n){if(t>=e&&t<n)return t;const i=n-e;return((t-e)%i+i)%i+e}function vl(t,e,n){return(function(i,r,s,a,o){if(!i)return;if(!r&&!e)return i;const u=e?0:s[0]*r,l=e?0:s[1]*r,c=o?o[0]:0,h=o?o[1]:0;let f=t[0]+u/2+c,g=t[2]-u/2+c,m=t[1]+l/2+h,p=t[3]-l/2+h;f>g&&(f=(g+f)/2,g=f),m>p&&(m=(p+m)/2,p=m);let _=ke(i[0],f,g),E=ke(i[1],m,p);if(a&&n&&r){const y=30*r;_+=-y*Math.log(1+Math.max(0,f-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-g)/y),E+=-y*Math.log(1+Math.max(0,m-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-p)/y)}return[_,E]})}function pm(t){return t}const ze={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Fl(t){const e=vt();for(let n=0,i=t.length;n<i;++n)Br(e,t[n]);return e}function Su(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function od(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function ud(t,e,n){let i,r;return e<t[0]?i=t[0]-e:t[2]<e?i=e-t[2]:i=0,n<t[1]?r=t[1]-n:t[3]<n?r=n-t[3]:r=0,i*i+r*r}function nr(t,e){return ld(t,e[0],e[1])}function kr(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ld(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function Vo(t,e){const n=t[0],i=t[1],r=t[2],s=t[3],a=e[0],o=e[1];let u=ze.UNKNOWN;return a<n?u=u|ze.LEFT:a>r&&(u=u|ze.RIGHT),o<i?u=u|ze.BELOW:o>s&&(u=u|ze.ABOVE),u===ze.UNKNOWN&&(u=ze.INTERSECTING),u}function vt(){return[1/0,1/0,-1/0,-1/0]}function Kn(t,e,n,i,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=i,r):[t,e,n,i]}function ya(t){return Kn(1/0,1/0,-1/0,-1/0,t)}function cd(t,e){const n=t[0],i=t[1];return Kn(n,i,n,i,e)}function Ru(t,e,n,i,r){const s=ya(r);return hd(s,t,e,n,i)}function Zr(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function _m(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function Br(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function hd(t,e,n,i,r){for(;n<i;n+=r)Em(t,e[n],e[n+1]);return t}function Em(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function dd(t,e){let n;return n=e(xa(t)),n||(n=e(Ca(t)),n)||(n=e(Aa(t)),n)||(n=e(Ci(t)),n)?n:!1}function Ko(t){let e=0;return gs(t)||(e=xe(t)*nt(t)),e}function xa(t){return[t[0],t[1]]}function Ca(t){return[t[2],t[1]]}function _i(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Tm(t,e){let n;if(e==="bottom-left")n=xa(t);else if(e==="bottom-right")n=Ca(t);else if(e==="top-left")n=Ci(t);else if(e==="top-right")n=Aa(t);else throw new Error("Invalid corner");return n}function qo(t,e,n,i,r){const[s,a,o,u,l,c,h,f]=fd(t,e,n,i);return Kn(Math.min(s,o,l,h),Math.min(a,u,c,f),Math.max(s,o,l,h),Math.max(a,u,c,f),r)}function fd(t,e,n,i){const r=e*i[0]/2,s=e*i[1]/2,a=Math.cos(n),o=Math.sin(n),u=r*a,l=r*o,c=s*a,h=s*o,f=t[0],g=t[1];return[f-u+h,g-l-c,f-u-h,g-l+c,f+u-h,g+l+c,f+u+h,g+l-c,f-u+h,g-l-c]}function nt(t){return t[3]-t[1]}function gi(t,e,n){const i=n||vt();return lt(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):ya(i),i}function Ci(t){return[t[0],t[3]]}function Aa(t){return[t[2],t[3]]}function xe(t){return t[2]-t[0]}function lt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function gs(t){return t[2]<t[0]||t[3]<t[1]}function bm(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function ym(t,e,n){let i=!1;const r=Vo(t,e),s=Vo(t,n);if(r===ze.INTERSECTING||s===ze.INTERSECTING)i=!0;else{const a=t[0],o=t[1],u=t[2],l=t[3],c=e[0],h=e[1],f=n[0],g=n[1],m=(g-h)/(f-c);let p,_;s&ze.ABOVE&&!(r&ze.ABOVE)&&(p=f-(g-l)/m,i=p>=a&&p<=u),!i&&s&ze.RIGHT&&!(r&ze.RIGHT)&&(_=g-(f-u)*m,i=_>=o&&_<=l),!i&&s&ze.BELOW&&!(r&ze.BELOW)&&(p=f-(g-o)/m,i=p>=a&&p<=u),!i&&s&ze.LEFT&&!(r&ze.LEFT)&&(_=g-(f-a)*m,i=_>=o&&_<=l)}return i}function gd(t,e){const n=e.getExtent(),i=_i(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){const r=xe(n),a=Math.floor((i[0]-n[0])/r)*r;t[0]-=a,t[2]-=a}return t}function md(t,e,n){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];gd(t,e);const r=xe(i);if(xe(t)>r&&!n)return[[i[0],t[1],i[2],t[3]]];if(t[0]<i[0])return[[t[0]+r,t[1],i[2],t[3]],[i[0],t[1],t[2],t[3]]];if(t[2]>i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-r,t[3]]]}return[t]}function xm(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function ta(t,e){let n=!0;for(let i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function Lu(t,e){const n=Math.cos(e),i=Math.sin(e),r=t[0]*n-t[1]*i,s=t[1]*n+t[0]*i;return t[0]=r,t[1]=s,t}function Cm(t,e){return t[0]*=e,t[1]*=e,t}function pd(t,e){if(e.canWrapX()){const n=xe(e.getExtent()),i=Am(t,e,n);i&&(t[0]-=i*n)}return t}function Am(t,e,n){const i=e.getExtent();let r=0;return e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])&&(n=n||xe(i),r=Math.floor((t[0]-i[0])/n)),r}function Im(t,e,n){const i=Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])),r=[(e[0]-t[0])/i,(e[1]-t[1])/i],s=[-r[1],r[0]],a=Math.sqrt((n[0]-t[0])*(n[0]-t[0])+(n[1]-t[1])*(n[1]-t[1])),o=[(n[0]-t[0])/a,(n[1]-t[1])/a];let u=i===0||a===0?0:Math.acos(ke(o[0]*r[0]+o[1]*r[1],-1,1));return u=Math.max(u,1e-5),o[0]*s[0]+o[1]*s[1]>0?u:Math.PI*2-u}function _d(t){return Math.pow(t,3)}function ur(t){return 1-_d(1-t)}function Sm(t){return 3*t*t-2*t*t*t}function Rm(t){return t}const Lm=63710088e-1;function Bl(t,e,n){n=n||Lm;const i=jn(t[1]),r=jn(e[1]),s=(r-i)/2,a=jn(e[0]-t[0])/2,o=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(r);return 2*n*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}function Ed(...t){console.warn(...t)}const wu={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ku{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||wu[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const ms=6378137,ji=Math.PI*ms,wm=[-ji,-ji,ji,ji],km=[-180,-85,180,85],Ns=ms*Math.log(Math.tan(Math.PI/2));class ki extends ku{constructor(e){super({code:e,units:"m",extent:wm,global:!0,worldExtent:km,getPointResolution:function(n,i){return n/Math.cosh(i[1]/ms)}})}}const Ul=[new ki("EPSG:3857"),new ki("EPSG:102100"),new ki("EPSG:102113"),new ki("EPSG:900913"),new ki("http://www.opengis.net/def/crs/EPSG/0/3857"),new ki("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Om(t,e,n,i){const r=t.length;n=n>1?n:2,i=i??n,e===void 0&&(n>2?e=t.slice():e=new Array(r));for(let s=0;s<r;s+=i){e[s]=ji*t[s]/180;let a=ms*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>Ns?a=Ns:a<-Ns&&(a=-Ns),e[s+1]=a}return e}function Nm(t,e,n,i){const r=t.length;n=n>1?n:2,i=i??n,e===void 0&&(n>2?e=t.slice():e=new Array(r));for(let s=0;s<r;s+=i)e[s]=180*t[s]/ji,e[s+1]=360*Math.atan(Math.exp(t[s+1]/ms))/Math.PI-90;return e}const Dm=6378137,Hl=[-180,-90,180,90],Pm=Math.PI*Dm/180;class ni extends ku{constructor(e,n){super({code:e,units:"degrees",extent:Hl,axisOrientation:n,global:!0,metersPerUnit:Pm,worldExtent:Hl})}}const zl=[new ni("CRS:84"),new ni("EPSG:4326","neu"),new ni("urn:ogc:def:crs:OGC:1.3:CRS84"),new ni("urn:ogc:def:crs:OGC:2:84"),new ni("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ni("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ni("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let $o={};function Mm(t){return $o[t]||$o[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function vm(t,e){$o[t]=e}let qi={};function Qr(t,e,n){const i=t.getCode(),r=e.getCode();i in qi||(qi[i]={}),qi[i][r]=n}function eo(t,e){return t in qi&&e in qi[t]?qi[t][e]:null}const na=.9996,Pt=.00669438,Ia=Pt*Pt,Sa=Ia*Pt,li=Pt/(1-Pt),Yl=Math.sqrt(1-Pt),ir=(1-Yl)/(1+Yl),Td=ir*ir,Ou=Td*ir,Nu=Ou*ir,bd=Nu*ir,yd=1-Pt/4-3*Ia/64-5*Sa/256,Fm=3*Pt/8+3*Ia/32+45*Sa/1024,Bm=15*Ia/256+45*Sa/1024,Um=35*Sa/3072,Hm=3/2*ir-27/32*Ou+269/512*bd,zm=21/16*Td-55/32*Nu,Ym=151/96*Ou-417/128*bd,Gm=1097/512*Nu,ia=6378137;function jm(t,e,n){const i=t-5e5,a=(n.north?e:e-1e7)/na/(ia*yd),o=a+Hm*Math.sin(2*a)+zm*Math.sin(4*a)+Ym*Math.sin(6*a)+Gm*Math.sin(8*a),u=Math.sin(o),l=u*u,c=Math.cos(o),h=u/c,f=h*h,g=f*f,m=1-Pt*l,p=Math.sqrt(1-Pt*l),_=ia/p,E=(1-Pt)/m,y=li*c**2,C=y*y,S=i/(_*na),w=S*S,L=w*S,B=L*S,v=B*S,N=v*S,R=o-h/E*(w/2-B/24*(5+3*f+10*y-4*C-9*li))+N/720*(61+90*f+298*y+45*g-252*li-3*C);let H=(S-L/6*(1+2*f+y)+v/120*(5-2*y+28*f-3*C+8*li+24*g))/c;return H=Xo(H+jn(xd(n.number)),-Math.PI,Math.PI),[Ml(H),Ml(R)]}const Gl=-80,jl=84,Wm=-180,Xm=180;function Vm(t,e,n){t=Xo(t,Wm,Xm),e<Gl?e=Gl:e>jl&&(e=jl);const i=jn(e),r=Math.sin(i),s=Math.cos(i),a=r/s,o=a*a,u=o*o,l=jn(t),c=xd(n.number),h=jn(c),f=ia/Math.sqrt(1-Pt*r**2),g=li*s**2,m=s*Xo(l-h,-Math.PI,Math.PI),p=m*m,_=p*m,E=_*m,y=E*m,C=y*m,S=ia*(yd*i-Fm*Math.sin(2*i)+Bm*Math.sin(4*i)-Um*Math.sin(6*i)),w=na*f*(m+_/6*(1-o+g)+y/120*(5-18*o+u+72*g-58*li))+5e5;let L=na*(S+f*a*(p/2+E/24*(5-o+9*g+4*g**2)+C/720*(61-58*o+u+600*g-330*li)));return n.north||(L+=1e7),[w,L]}function xd(t){return(t-1)*6-180+3}const Km=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Cd(t){let e=0;for(const r of Km){const s=t.match(r);if(s){e=parseInt(s[1]);break}}if(!e)return null;let n=0,i=!1;return e>32700&&e<32761?n=e-32700:e>32600&&e<32661&&(i=!0,n=e-32600),n?{number:n,north:i}:null}function Wl(t,e){return function(n,i,r,s){const a=n.length;r=r>1?r:2,s=s??r,i||(r>2?i=n.slice():i=new Array(a));for(let o=0;o<a;o+=s){const u=n[o],l=n[o+1],c=t(u,l,e);i[o]=c[0],i[o+1]=c[1]}return i}}function qm(t){return Cd(t)?new ku({code:t,units:"m"}):null}function $m(t){const e=Cd(t.getCode());return e?{forward:Wl(Vm,e),inverse:Wl(jm,e)}:null}const Zm=[$m],Qm=[qm];let Zo=!0;function Ad(t){Zo=!1}function Du(t,e){if(e!==void 0){for(let n=0,i=t.length;n<i;++n)e[n]=t[n];e=e}else e=t.slice();return e}function Qo(t){vm(t.getCode(),t),Qr(t,t,Du)}function Jm(t){t.forEach(Qo)}function ht(t){if(typeof t!="string")return t;const e=Mm(t);if(e)return e;for(const n of Qm){const i=n(t);if(i)return i}return null}function Xl(t,e,n,i){t=ht(t);let r;const s=t.getPointResolutionFunc();if(s)r=s(e,n);else{const a=t.getUnits();if(a=="degrees"&&!i||i=="degrees")r=e;else{const o=Mu(t,ht("EPSG:4326"));if(!o&&a!=="degrees")r=e*t.getMetersPerUnit();else{let l=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];l=o(l,l,2);const c=Bl(l.slice(0,2),l.slice(2,4)),h=Bl(l.slice(4,6),l.slice(6,8));r=(c+h)/2}const u=t.getMetersPerUnit();u!==void 0&&(r/=u)}}return r}function Vl(t){Jm(t),t.forEach(function(e){t.forEach(function(n){e!==n&&Qr(e,n,Du)})})}function ep(t,e,n,i){t.forEach(function(r){e.forEach(function(s){Qr(r,s,n),Qr(s,r,i)})})}function Pu(t,e){return t?typeof t=="string"?ht(t):t:ht(e)}function tp(t){return(function(e,n,i,r){const s=e.length;i=i!==void 0?i:2,r=r??i,n=n!==void 0?n:new Array(s);for(let a=0;a<s;a+=r){const o=t(e.slice(a,a+i)),u=o.length;for(let l=0,c=r;l<c;++l)n[a+l]=l>=u?e[a+l]:o[l]}return n})}function np(t,e){return Ad(),vu(t,"EPSG:4326","EPSG:3857")}function Xs(t,e){if(t===e)return!0;const n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Mu(t,e)===Du)&&n}function Mu(t,e){const n=t.getCode(),i=e.getCode();let r=eo(n,i);if(r)return r;let s=null,a=null;for(const u of Zm)s||(s=u(t)),a||(a=u(e));if(!s&&!a)return null;const o="EPSG:4326";if(a)if(s)r=to(s.inverse,a.forward);else{const u=eo(n,o);u&&(r=to(u,a.forward))}else{const u=eo(o,i);u&&(r=to(s.inverse,u))}return r&&(Qo(t),Qo(e),Qr(t,e,r)),r}function to(t,e){return function(n,i,r,s){return i=t(n,i,r,s),e(i,i,r,s)}}function ra(t,e){const n=ht(t),i=ht(e);return Mu(n,i)}function vu(t,e,n){const i=ra(e,n);if(!i){const r=ht(e).getCode(),s=ht(n).getCode();throw new Error(`No transform available between ${r} and ${s}`)}return i(t,void 0,t.length)}function Jo(t,e){return t}function dn(t,e){return Zo&&!ta(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Zo=!1,Ed("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Id(t,e){return t}function Un(t,e){return t}function ip(){Vl(Ul),Vl(zl),ep(zl,Ul,Om,Nm)}ip();new Array(6);function Ht(){return[1,0,0,1,0,0]}function rp(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Ye(t,e){const n=e[0],i=e[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function Tn(t,e,n,i,r,s,a,o){const u=Math.sin(s),l=Math.cos(s);return t[0]=i*l,t[1]=r*u,t[2]=-i*u,t[3]=r*l,t[4]=a*i*l-o*i*u+e,t[5]=a*r*u+o*r*l+n,t}function Sd(t,e){const n=sp(e);be(n!==0,"Transformation matrix cannot be inverted");const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5];return t[0]=a/n,t[1]=-r/n,t[2]=-s/n,t[3]=i/n,t[4]=(s*u-a*o)/n,t[5]=-(i*u-r*o)/n,t}function sp(t){return t[0]*t[3]-t[1]*t[2]}const ap=[1e5,1e5,1e5,1e5,2,2];function op(t){return"matrix("+t.join(", ")+")"}function eu(t){return t.substring(7,t.length-1).split(",").map(parseFloat)}function up(t,e){const n=eu(t),i=eu(e);for(let r=0;r<6;++r)if(Math.round((n[r]-i[r])*ap[r])!==0)return!1;return!0}function Wn(t,e,n,i,r,s,a){s=s||[],a=a||2;let o=0;for(let u=e;u<n;u+=i){const l=t[u],c=t[u+1];s[o++]=r[0]*l+r[2]*c+r[4],s[o++]=r[1]*l+r[3]*c+r[5];for(let h=2;h<a;h++)s[o++]=t[u+h]}return s&&s.length!=o&&(s.length=o),s}function Rd(t,e,n,i,r,s,a){a=a||[];const o=Math.cos(r),u=Math.sin(r),l=s[0],c=s[1];let h=0;for(let f=e;f<n;f+=i){const g=t[f]-l,m=t[f+1]-c;a[h++]=l+g*o-m*u,a[h++]=c+g*u+m*o;for(let p=f+2;p<f+i;++p)a[h++]=t[p]}return a&&a.length!=h&&(a.length=h),a}function lp(t,e,n,i,r,s,a,o){o=o||[];const u=a[0],l=a[1];let c=0;for(let h=e;h<n;h+=i){const f=t[h]-u,g=t[h+1]-l;o[c++]=u+r*f,o[c++]=l+s*g;for(let m=h+2;m<h+i;++m)o[c++]=t[m]}return o&&o.length!=c&&(o.length=c),o}function cp(t,e,n,i,r,s,a){a=a||[];let o=0;for(let u=e;u<n;u+=i){a[o++]=t[u]+r,a[o++]=t[u+1]+s;for(let l=u+2;l<u+i;++l)a[o++]=t[l]}return a&&a.length!=o&&(a.length=o),a}const Kl=Ht(),hp=[NaN,NaN];class dp extends tn{constructor(){super(),this.extent_=vt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=id((e,n,i)=>{if(!i)return this.getSimplifiedGeometry(n);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(n)})}simplifyTransformed(e,n){return this.simplifyTransformedInternal(this.getRevision(),e,n)}clone(){return me()}closestPointXY(e,n,i,r){return me()}containsXY(e,n){return this.closestPointXY(e,n,hp,Number.MIN_VALUE)===0}getClosestPoint(e,n){return n=n||[NaN,NaN],this.closestPointXY(e[0],e[1],n,1/0),n}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return me()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const n=this.computeExtent(this.extent_);(isNaN(n[0])||isNaN(n[1]))&&ya(n),this.extentRevision_=this.getRevision()}return bm(this.extent_,e)}rotate(e,n){me()}scale(e,n,i){me()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return me()}getType(){return me()}applyTransform(e){me()}intersectsExtent(e){return me()}translate(e,n){me()}transform(e,n){const i=ht(e),r=i.getUnits()=="tile-pixels"?function(s,a,o){const u=i.getExtent(),l=i.getWorldExtent(),c=nt(l)/nt(u);Tn(Kl,l[0],l[3],c,-c,0,0,0);const h=Wn(s,0,s.length,o,Kl,a),f=ra(i,n);return f?f(h,h,o):h}:ra(i,n);return this.applyTransform(r),this}}class Fu extends dp{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return Ru(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return me()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length<this.flatCoordinates.length?n:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,n){this.stride=ql(e),this.layout=e,this.flatCoordinates=n}setCoordinates(e,n){me()}setLayout(e,n,i){let r;if(e)r=ql(e);else{for(let s=0;s<i;++s){if(n.length===0){this.layout="XY",this.stride=2;return}n=n[0]}r=n.length,e=fp(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,n){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Rd(i,0,i.length,r,e,n,i),this.changed()}}scale(e,n,i){n===void 0&&(n=e),i||(i=_i(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();lp(r,0,r.length,s,e,n,i,r),this.changed()}}translate(e,n){const i=this.getFlatCoordinates();if(i){const r=this.getStride();cp(i,0,i.length,r,e,n,i),this.changed()}}}function fp(t){let e;return t==2?e="XY":t==3?e="XYZ":t==4&&(e="XYZM"),e}function ql(t){let e;return t=="XY"?e=2:t=="XYZ"||t=="XYM"?e=3:t=="XYZM"&&(e=4),e}function gp(t,e,n){const i=t.getFlatCoordinates();if(!i)return null;const r=t.getStride();return Wn(i,0,i.length,r,e,n)}function Ld(t,e,n,i){let r=0;const s=t[n-i],a=t[n-i+1];let o=0,u=0;for(;e<n;e+=i){const l=t[e]-s,c=t[e+1]-a;r+=u*l-o*c,o=l,u=c}return r/2}function mp(t,e,n,i){let r=0;for(let s=0,a=n.length;s<a;++s){const o=n[s];r+=Ld(t,e,o,i),e=o}return r}function $l(t,e,n,i,r,s,a){const o=t[e],u=t[e+1],l=t[n]-o,c=t[n+1]-u;let h;if(l===0&&c===0)h=e;else{const f=((r-o)*l+(s-u)*c)/(l*l+c*c);if(f>1)h=n;else if(f>0){for(let g=0;g<i;++g)a[g]=St(t[e+g],t[n+g],f);a.length=i;return}else h=e}for(let f=0;f<i;++f)a[f]=t[h+f];a.length=i}function wd(t,e,n,i,r){let s=t[e],a=t[e+1];for(e+=i;e<n;e+=i){const o=t[e],u=t[e+1],l=Vi(s,a,o,u);l>r&&(r=l),s=o,a=u}return r}function pp(t,e,n,i,r){for(let s=0,a=n.length;s<a;++s){const o=n[s];r=wd(t,e,o,i,r),e=o}return r}function kd(t,e,n,i,r,s,a,o,u,l,c){if(e==n)return l;let h,f;if(r===0){if(f=Vi(a,o,t[e],t[e+1]),f<l){for(h=0;h<i;++h)u[h]=t[e+h];return u.length=i,f}return l}c=c||[NaN,NaN];let g=e+i;for(;g<n;)if($l(t,g-i,g,i,a,o,c),f=Vi(a,o,c[0],c[1]),f<l){for(l=f,h=0;h<i;++h)u[h]=c[h];u.length=i,g+=i}else g+=i*Math.max((Math.sqrt(f)-Math.sqrt(l))/r|0,1);if($l(t,n-i,e,i,a,o,c),f=Vi(a,o,c[0],c[1]),f<l){for(l=f,h=0;h<i;++h)u[h]=c[h];u.length=i}return l}function _p(t,e,n,i,r,s,a,o,u,l,c){c=c||[NaN,NaN];for(let h=0,f=n.length;h<f;++h){const g=n[h];l=kd(t,e,g,i,r,s,a,o,u,l,c),e=g}return l}function Ep(t,e,n,i){for(let r=0,s=n.length;r<s;++r)t[e++]=n[r];return e}function Od(t,e,n,i){for(let r=0,s=n.length;r<s;++r){const a=n[r];for(let o=0;o<i;++o)t[e++]=a[o]}return e}function Tp(t,e,n,i,r){r=r||[];let s=0;for(let a=0,o=n.length;a<o;++a){const u=Od(t,e,n[a],i);r[s++]=u,e=u}return r.length=s,r}function Wi(t,e,n,i,r){r=r!==void 0?r:[];let s=0;for(let a=e;a<n;a+=i)r[s++]=t.slice(a,a+i);return r.length=s,r}function sa(t,e,n,i,r){r=r!==void 0?r:[];let s=0;for(let a=0,o=n.length;a<o;++a){const u=n[a];r[s++]=Wi(t,e,u,i,r[s]),e=u}return r.length=s,r}function Zl(t,e,n,i,r){r=r!==void 0?r:[];let s=0;for(let a=0,o=n.length;a<o;++a){const u=n[a];r[s++]=u.length===1&&u[0]===e?[]:sa(t,e,u,i,r[s]),e=u[u.length-1]}return r.length=s,r}function Bu(t,e,n,i,r,s,a){const o=(n-e)/i;if(o<3){for(;e<n;e+=i)s[a++]=t[e],s[a++]=t[e+1];return a}const u=new Array(o);u[0]=1,u[o-1]=1;const l=[e,n-i];let c=0;for(;l.length>0;){const h=l.pop(),f=l.pop();let g=0;const m=t[f],p=t[f+1],_=t[h],E=t[h+1];for(let y=f+i;y<h;y+=i){const C=t[y],S=t[y+1],w=gm(C,S,m,p,_,E);w>g&&(c=y,g=w)}g>r&&(u[(c-e)/i]=1,f+i<c&&l.push(f,c),c+i<h&&l.push(c,h))}for(let h=0;h<o;++h)u[h]&&(s[a++]=t[e+h*i],s[a++]=t[e+h*i+1]);return a}function bp(t,e,n,i,r,s,a,o){for(let u=0,l=n.length;u<l;++u){const c=n[u];a=Bu(t,e,c,i,r,s,a),o.push(a),e=c}return a}function oi(t,e){return e*Math.round(t/e)}function yp(t,e,n,i,r,s,a){if(e==n)return a;let o=oi(t[e],r),u=oi(t[e+1],r);e+=i,s[a++]=o,s[a++]=u;let l,c;do if(l=oi(t[e],r),c=oi(t[e+1],r),e+=i,e==n)return s[a++]=l,s[a++]=c,a;while(l==o&&c==u);for(;e<n;){const h=oi(t[e],r),f=oi(t[e+1],r);if(e+=i,h==l&&f==c)continue;const g=l-o,m=c-u,p=h-o,_=f-u;if(g*_==m*p&&(g<0&&p<g||g==p||g>0&&p>g)&&(m<0&&_<m||m==_||m>0&&_>m)){l=h,c=f;continue}s[a++]=l,s[a++]=c,o=l,u=c,l=h,c=f}return s[a++]=l,s[a++]=c,a}function Nd(t,e,n,i,r,s,a,o){for(let u=0,l=n.length;u<l;++u){const c=n[u];a=yp(t,e,c,i,r,s,a),o.push(a),e=c}return a}class Jr extends Fu{constructor(e,n){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}clone(){return new Jr(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,n,i,r){return r<ud(this.getExtent(),e,n)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),kd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,n,i,r))}getArea(){return Ld(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Wi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const n=[];return n.length=Bu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new Jr(n,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Od(this.flatCoordinates,0,e,this.stride),this.changed()}}class Ra extends Fu{constructor(e,n){super(),this.setCoordinates(e,n)}clone(){const e=new Ra(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,i,r){const s=this.flatCoordinates,a=Vi(e,n,s[0],s[1]);if(a<r){const o=this.stride;for(let u=0;u<o;++u)i[u]=s[u];return i.length=o,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return cd(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return ld(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,n){this.setLayout(n,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ep(this.flatCoordinates,0,e,this.stride),this.changed()}}function xp(t,e,n,i,r){return!dd(r,function(a){return!ci(t,e,n,i,a[0],a[1])})}function ci(t,e,n,i,r,s){let a=0,o=t[n-i],u=t[n-i+1];for(;e<n;e+=i){const l=t[e],c=t[e+1];u<=s?c>s&&(l-o)*(s-u)-(r-o)*(c-u)>0&&a++:c<=s&&(l-o)*(s-u)-(r-o)*(c-u)<0&&a--,o=l,u=c}return a!==0}function Dd(t,e,n,i,r,s){if(n.length===0||!ci(t,e,n[0],i,r,s))return!1;for(let a=1,o=n.length;a<o;++a)if(ci(t,n[a-1],n[a],i,r,s))return!1;return!0}function Uu(t,e,n,i,r,s,a){let o,u,l,c,h,f,g;const m=r[s+1],p=[];for(let y=0,C=n.length;y<C;++y){const S=n[y];for(c=t[S-i],f=t[S-i+1],o=e;o<S;o+=i)h=t[o],g=t[o+1],(m<=f&&g<=m||f<=m&&m<=g)&&(l=(m-f)/(g-f)*(h-c)+c,p.push(l)),c=h,f=g}let _=NaN,E=-1/0;for(p.sort(pn),c=p[0],o=1,u=p.length;o<u;++o){h=p[o];const y=Math.abs(h-c);y>E&&(l=(c+h)/2,Dd(t,e,n,i,l,m)&&(_=l,E=y)),c=h}return isNaN(_)&&(_=r[s]),a?(a.push(_,m,E),a):[_,m,E]}function Cp(t,e,n,i,r){let s=[];for(let a=0,o=n.length;a<o;++a){const u=n[a];s=Uu(t,e,u,i,r,2*a,s),e=u[u.length-1]}return s}function Ap(t,e,n,i,r){let s;for(e+=i;e<n;e+=i)if(s=r(t.slice(e-i,e),t.slice(e,e+i)),s)return s;return!1}function Pd(t,e,n,i,r,s){return s=s??hd(vt(),t,e,n,i),lt(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Ap(t,e,n,i,function(a,o){return ym(r,a,o)}):!1}function Md(t,e,n,i,r){return!!(Pd(t,e,n,i,r)||ci(t,e,n,i,r[0],r[1])||ci(t,e,n,i,r[0],r[3])||ci(t,e,n,i,r[2],r[1])||ci(t,e,n,i,r[2],r[3]))}function Ip(t,e,n,i,r){if(!Md(t,e,n[0],i,r))return!1;if(n.length===1)return!0;for(let s=1,a=n.length;s<a;++s)if(xp(t,n[s-1],n[s],i,r)&&!Pd(t,n[s-1],n[s],i,r))return!1;return!0}function Sp(t,e,n,i){for(;e<n-i;){for(let r=0;r<i;++r){const s=t[e+r];t[e+r]=t[n-i+r],t[n-i+r]=s}e+=i,n-=i}}function Hu(t,e,n,i){let r=0,s=t[n-i],a=t[n-i+1];for(;e<n;e+=i){const o=t[e],u=t[e+1];r+=(o-s)*(u+a),s=o,a=u}return r===0?void 0:r>0}function Rp(t,e,n,i,r){r=r!==void 0?r:!1;for(let s=0,a=n.length;s<a;++s){const o=n[s],u=Hu(t,e,o,i);if(s===0){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=o}return!0}function Ql(t,e,n,i,r){r=r!==void 0?r:!1;for(let s=0,a=n.length;s<a;++s){const o=n[s],u=Hu(t,e,o,i);(s===0?r&&u||!r&&!u:r&&!u||!r&&u)&&Sp(t,e,o,i),e=o}return e}function Lp(t,e){const n=[];let i=0,r=0,s;for(let a=0,o=e.length;a<o;++a){const u=e[a],l=Hu(t,i,u,2);if(s===void 0&&(s=l),l===s)n.push(e.slice(r,a+1));else{if(n.length===0)continue;n[n.length-1].push(e[r])}r=a+1,i=u}return n}class es extends Fu{constructor(e,n,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,n!==void 0&&i?(this.setFlatCoordinates(n,e),this.ends_=i):this.setCoordinates(e,n)}appendLinearRing(e){this.flatCoordinates?Iu(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new es(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,n,i,r){return r<ud(this.getExtent(),e,n)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(pp(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),_p(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,n,i,r))}containsXY(e,n){return Dd(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,n)}getArea(){return mp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let n;return e!==void 0?(n=this.getOrientedFlatCoordinates().slice(),Ql(n,0,this.ends_,this.stride,e)):n=this.flatCoordinates,sa(n,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=_i(this.getExtent());this.flatInteriorPoint_=Uu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Ra(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new Jr(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,n=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let a=0,o=i.length;a<o;++a){const u=i[a],l=new Jr(n.slice(s,u),e);r.push(l),s=u}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Rp(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Ql(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const n=[],i=[];return n.length=Nd(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),n,0,i),new es(n,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Ip(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Tp(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Jl(t){if(gs(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],n=t[1],i=t[2],r=t[3],s=[e,n,e,r,i,r,i,n,e,n];return new es(s,"XY",[s.length])}function zu(t,e,n,i){const r=xe(e)/n[0],s=nt(e)/n[1];return i?Math.min(t,Math.max(r,s)):Math.min(t,Math.min(r,s))}function Yu(t,e,n){let i=Math.min(t,e);const r=50;return i*=Math.log(1+r*Math.max(0,t/e-1))/r+1,n&&(i=Math.max(i,n),i/=Math.log(1+r*Math.max(0,n/t-1))/r+1),ke(i,n/2,e*2)}function wp(t,e,n,i){return e=e!==void 0?e:!0,(function(r,s,a,o){if(r!==void 0){const u=t[0],l=t[t.length-1],c=n?zu(u,n,a,i):u;if(o)return e?Yu(r,c,l):ke(r,l,c);const h=Math.min(c,r),f=Math.floor(Au(t,h,s));return t[f]>c&&f<t.length-1?t[f+1]:t[f]}})}function kp(t,e,n,i,r,s){return i=i!==void 0?i:!0,n=n!==void 0?n:0,(function(a,o,u,l){if(a!==void 0){const c=r?zu(e,r,u,s):e;if(l)return i?Yu(a,c,n):ke(a,n,c);const h=1e-9,f=Math.ceil(Math.log(e/c)/Math.log(t)-h),g=-o*(.5-h)+.5,m=Math.min(c,a),p=Math.floor(Math.log(e/m)/Math.log(t)+g),_=Math.max(f,p),E=e/Math.pow(t,_);return ke(E,n,c)}})}function ec(t,e,n,i,r){return n=n!==void 0?n:!0,(function(s,a,o,u){if(s!==void 0){const l=i?zu(t,i,o,r):t;return!n||!u?ke(s,e,l):Yu(s,l,e)}})}function Gu(t){if(t!==void 0)return 0}function tc(t){if(t!==void 0)return t}function Op(t){const e=2*Math.PI/t;return(function(n,i){if(i)return n;if(n!==void 0)return n=Math.floor(n/e+.5)*e,n})}function Np(t){const e=jn(5);return(function(n,i){return i||n===void 0?n:Math.abs(n)<=e?0:n})}const Dp=42,ju=256,no=0;class Zt extends tn{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Pu(e.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&Ad(),e.center&&(e.center=dn(e.center,this.projection_)),e.extent&&(e.extent=Un(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const n=Object.assign({},e);for(const o in Ft)delete n[o];this.setProperties(n,!0);const i=Mp(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const r=Pp(e),s=i.constraint,a=vp(e);this.constraints_={center:r,resolution:s,rotation:a},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let n=this.padding_;this.padding_=e;const i=this.getCenterInternal();if(i){const r=e||[0,0,0,0];n=n||[0,0,0,0];const s=this.getResolution(),a=s/2*(r[3]-n[3]+n[1]-r[1]),o=s/2*(r[0]-n[0]+n[2]-r[2]);this.setCenterInternal([i[0]+a,i[1]-o])}}getUpdatedOptions_(e){const n=this.getProperties();return n.resolution!==void 0?n.resolution=this.getResolution():n.zoom=this.getZoom(),n.center=this.getCenterInternal(),n.rotation=this.getRotation(),Object.assign({},n,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const n=new Array(arguments.length);for(let i=0;i<n.length;++i){let r=arguments[i];r.center&&(r=Object.assign({},r),r.center=dn(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=dn(r.anchor,this.getProjection())),n[i]=r}this.animateInternal.apply(this,n)}animateInternal(e){let n=arguments.length,i;n>1&&typeof arguments[n-1]=="function"&&(i=arguments[n-1],--n);let r=0;for(;r<n&&!this.isDef();++r){const c=arguments[r];c.center&&this.setCenterInternal(c.center),c.zoom!==void 0?this.setZoom(c.zoom):c.resolution&&this.setResolution(c.resolution),c.rotation!==void 0&&this.setRotation(c.rotation)}if(r===n){i&&Ds(i,!0);return}let s=Date.now(),a=this.targetCenter_.slice(),o=this.targetResolution_,u=this.targetRotation_;const l=[];for(;r<n;++r){const c=arguments[r],h={start:s,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||Sm,callback:i};if(c.center&&(h.sourceCenter=a,h.targetCenter=c.center.slice(),a=h.targetCenter),c.zoom!==void 0?(h.sourceResolution=o,h.targetResolution=this.getResolutionForZoom(c.zoom),o=h.targetResolution):c.resolution&&(h.sourceResolution=o,h.targetResolution=c.resolution,o=h.targetResolution),c.rotation!==void 0){h.sourceRotation=u;const f=Ki(c.rotation-u+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=u+f,u=h.targetRotation}Fp(h)?h.complete=!0:s+=h.duration,l.push(h)}this.animations_.push(l),this.setHint(Ke.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Ke.ANIMATING]>0}getInteracting(){return this.hints_[Ke.INTERACTING]>0}cancelAnimations(){this.setHint(Ke.ANIMATING,-this.hints_[Ke.ANIMATING]);let e;for(let n=0,i=this.animations_.length;n<i;++n){const r=this.animations_[n];if(r[0].callback&&Ds(r[0].callback,!1),!e)for(let s=0,a=r.length;s<a;++s){const o=r[s];if(!o.complete){e=o.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let n=!1;for(let i=this.animations_.length-1;i>=0;--i){const r=this.animations_[i];let s=!0;for(let a=0,o=r.length;a<o;++a){const u=r[a];if(u.complete)continue;const l=e-u.start;let c=u.duration>0?l/u.duration:1;c>=1?(u.complete=!0,c=1):s=!1;const h=u.easing(c);if(u.sourceCenter){const f=u.sourceCenter[0],g=u.sourceCenter[1],m=u.targetCenter[0],p=u.targetCenter[1];this.nextCenter_=u.targetCenter;const _=f+h*(m-f),E=g+h*(p-g);this.targetCenter_=[_,E]}if(u.sourceResolution&&u.targetResolution){const f=h===1?u.targetResolution:u.sourceResolution+h*(u.targetResolution-u.sourceResolution);if(u.anchor){const g=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(f,0,g,!0);this.targetCenter_=this.calculateCenterZoom(m,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=f,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){const f=h===1?Ki(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+h*(u.targetRotation-u.sourceRotation);if(u.anchor){const g=this.constraints_.rotation(f,!0);this.targetCenter_=this.calculateCenterRotate(g,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=f}if(this.applyTargetState_(!0),n=!0,!u.complete)break}if(s){this.animations_[i]=null,this.setHint(Ke.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const a=r[0].callback;a&&Ds(a,!0)}}this.animations_=this.animations_.filter(Boolean),n&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,n){let i;const r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-n[0],r[1]-n[1]],Lu(i,e-this.getRotation()),xm(i,n)),i}calculateCenterZoom(e,n){let i;const r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){const a=n[0]-e*(n[0]-r[0])/s,o=n[1]-e*(n[1]-r[1])/s;i=[a,o]}return i}getViewportSize_(e){const n=this.viewportSize_;if(e){const i=n[0],r=n[1];return[Math.abs(i*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e))]}return n}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&Jo(e,this.getProjection())}getCenterInternal(){return this.get(Ft.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const n=this.calculateExtentInternal(e);return Id(n,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const n=this.getCenterInternal();be(n,"The view center is not defined");const i=this.getResolution();be(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return be(r!==void 0,"The view rotation is not defined"),qo(n,i,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(Ft.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,n){return this.getResolutionForExtentInternal(Un(e,this.getProjection()),n)}getResolutionForExtentInternal(e,n){n=n||this.getViewportSizeMinusPadding_();const i=xe(e)/n[0],r=nt(e)/n[1];return Math.max(i,r)}getResolutionForValueFunction(e){e=e||2;const n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(n/i)/Math.log(e);return(function(s){return n/Math.pow(e,s*r)})}getRotation(){return this.get(Ft.ROTATION)}getValueForResolutionFunction(e){const n=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/n;return(function(a){return Math.log(i/a)/n/s})}getViewportSizeMinusPadding_(e){let n=this.getViewportSize_(e);const i=this.padding_;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n}getState(){const e=this.getProjection(),n=this.getResolution(),i=this.getRotation();let r=this.getCenterInternal();const s=this.padding_;if(s){const a=this.getViewportSizeMinusPadding_();r=io(r,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[0]],n,i)}return{center:r.slice(0),projection:e!==void 0?e:null,resolution:n,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e;const n=this.getResolution();return n!==void 0&&(e=this.getZoomForResolution(n)),e}getZoomForResolution(e){let n=this.minZoom_||0,i,r;if(this.resolutions_){const s=Au(this.resolutions_,e,1);n=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(i/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const n=ke(Math.floor(e),0,this.resolutions_.length-2),i=this.resolutions_[n]/this.resolutions_[n+1];return this.resolutions_[n]/Math.pow(i,ke(e-n,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,n){let i;if(be(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){be(!gs(e),"Cannot fit empty extent provided as `geometry`");const r=Un(e,this.getProjection());i=Jl(r)}else if(e.getType()==="Circle"){const r=Un(e.getExtent(),this.getProjection());i=Jl(r),i.rotate(this.getRotation(),_i(r))}else i=e;this.fitInternal(i,n)}rotatedExtentForGeometry(e){const n=this.getRotation(),i=Math.cos(n),r=Math.sin(-n),s=e.getFlatCoordinates(),a=e.getStride();let o=1/0,u=1/0,l=-1/0,c=-1/0;for(let h=0,f=s.length;h<f;h+=a){const g=s[h]*i-s[h+1]*r,m=s[h]*r+s[h+1]*i;o=Math.min(o,g),u=Math.min(u,m),l=Math.max(l,g),c=Math.max(c,m)}return[o,u,l,c]}fitInternal(e,n){n=n||{};let i=n.size;i||(i=this.getViewportSizeMinusPadding_());const r=n.padding!==void 0?n.padding:[0,0,0,0],s=n.nearest!==void 0?n.nearest:!1;let a;n.minResolution!==void 0?a=n.minResolution:n.maxZoom!==void 0?a=this.getResolutionForZoom(n.maxZoom):a=0;const o=this.rotatedExtentForGeometry(e);let u=this.getResolutionForExtentInternal(o,[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);u=isNaN(u)?a:Math.max(u,a),u=this.getConstrainedResolution(u,s?0:1);const l=this.getRotation(),c=Math.sin(l),h=Math.cos(l),f=_i(o);f[0]+=(r[1]-r[3])/2*u,f[1]+=(r[0]-r[2])/2*u;const g=f[0]*h-f[1]*c,m=f[1]*h+f[0]*c,p=this.getConstrainedCenter([g,m],u),_=n.callback?n.callback:$r;n.duration!==void 0?this.animateInternal({resolution:u,center:p,duration:n.duration,easing:n.easing},_):(this.targetResolution_=u,this.targetCenter_=p,this.applyTargetState_(!1,!0),Ds(_,!0))}centerOn(e,n,i){this.centerOnInternal(dn(e,this.getProjection()),n,i)}centerOnInternal(e,n,i){this.setCenterInternal(io(e,n,i,this.getResolution(),this.getRotation()))}calculateCenterShift(e,n,i,r){let s;const a=this.padding_;if(a&&e){const o=this.getViewportSizeMinusPadding_(-i),u=io(e,r,[o[0]/2+a[3],o[1]/2+a[0]],n,i);s=[e[0]-u[0],e[1]-u[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const n=Jo(this.targetCenter_,this.getProjection());this.setCenter([n[0]+e[0],n[1]+e[1]])}adjustCenterInternal(e){const n=this.targetCenter_;this.setCenterInternal([n[0]+e[0],n[1]+e[1]])}adjustResolution(e,n){n=n&&dn(n,this.getProjection()),this.adjustResolutionInternal(e,n)}adjustResolutionInternal(e,n){const i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*e,0,r,i);n&&(this.targetCenter_=this.calculateCenterZoom(s,n)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,n){this.adjustResolution(Math.pow(this.zoomFactor_,-e),n)}adjustRotation(e,n){n&&(n=dn(n,this.getProjection())),this.adjustRotationInternal(e,n)}adjustRotationInternal(e,n){const i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,i);n&&(this.targetCenter_=this.calculateCenterRotate(r,n)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&dn(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,n){return this.hints_[e]+=n,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,n){const i=this.getAnimating()||this.getInteracting()||n,r=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,0,s,i),o=this.constraints_.center(this.targetCenter_,a,s,i,this.calculateCenterShift(this.targetCenter_,a,r,s));this.get(Ft.ROTATION)!==r&&this.set(Ft.ROTATION,r),this.get(Ft.RESOLUTION)!==a&&(this.set(Ft.RESOLUTION,a),this.set("zoom",this.getZoom(),!0)),(!o||!this.get(Ft.CENTER)||!ta(this.get(Ft.CENTER),o))&&this.set(Ft.CENTER,o),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,n,i){e=e!==void 0?e:200;const r=n||0,s=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,r,a),u=this.constraints_.center(this.targetCenter_,o,a,!1,this.calculateCenterShift(this.targetCenter_,o,s,a));if(e===0&&!this.cancelAnchor_){this.targetResolution_=o,this.targetRotation_=s,this.targetCenter_=u,this.applyTargetState_();return}i=i||(e===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==o||this.getRotation()!==s||!this.getCenterInternal()||!ta(this.getCenterInternal(),u))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:u,resolution:o,duration:e,easing:ur,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Ke.INTERACTING,1)}endInteraction(e,n,i){i=i&&dn(i,this.getProjection()),this.endInteractionInternal(e,n,i)}endInteractionInternal(e,n,i){this.getInteracting()&&(this.setHint(Ke.INTERACTING,-1),this.resolveConstraints(e,n,i))}getConstrainedCenter(e,n){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,n||this.getResolution(),i)}getConstrainedZoom(e,n){const i=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(i,n))}getConstrainedResolution(e,n){n=n||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,n,i)}}function Ds(t,e){setTimeout(function(){t(e)},0)}function Pp(t){if(t.extent!==void 0){const n=t.smoothExtentConstraint!==void 0?t.smoothExtentConstraint:!0;return vl(t.extent,t.constrainOnlyCenter,n)}const e=Pu(t.projection,"EPSG:3857");if(t.multiWorld!==!0&&e.isGlobal()){const n=e.getExtent().slice();return n[0]=-1/0,n[2]=1/0,vl(n,!1,!1)}return pm}function Mp(t){let e,n,i,a=t.minZoom!==void 0?t.minZoom:no,o=t.maxZoom!==void 0?t.maxZoom:28;const u=t.zoomFactor!==void 0?t.zoomFactor:2,l=t.multiWorld!==void 0?t.multiWorld:!1,c=t.smoothResolutionConstraint!==void 0?t.smoothResolutionConstraint:!0,h=t.showFullExtent!==void 0?t.showFullExtent:!1,f=Pu(t.projection,"EPSG:3857"),g=f.getExtent();let m=t.constrainOnlyCenter,p=t.extent;if(!l&&!p&&f.isGlobal()&&(m=!1,p=g),t.resolutions!==void 0){const _=t.resolutions;n=_[a],i=_[o]!==void 0?_[o]:_[_.length-1],t.constrainResolution?e=wp(_,c,!m&&p,h):e=ec(n,i,c,!m&&p,h)}else{const E=(g?Math.max(xe(g),nt(g)):360*wu.degrees/f.getMetersPerUnit())/ju/Math.pow(2,no),y=E/Math.pow(2,28-no);n=t.maxResolution,n!==void 0?a=0:n=E/Math.pow(u,a),i=t.minResolution,i===void 0&&(t.maxZoom!==void 0?t.maxResolution!==void 0?i=n/Math.pow(u,o):i=E/Math.pow(u,o):i=y),o=a+Math.floor(Math.log(n/i)/Math.log(u)),i=n/Math.pow(u,o-a),t.constrainResolution?e=kp(u,n,i,c,!m&&p,h):e=ec(n,i,c,!m&&p,h)}return{constraint:e,maxResolution:n,minResolution:i,minZoom:a,zoomFactor:u}}function vp(t){if(t.enableRotation!==void 0?t.enableRotation:!0){const n=t.constrainRotation;return n===void 0||n===!0?Np():n===!1?tc:typeof n=="number"?Op(n):tc}return Gu}function Fp(t){return!(t.sourceCenter&&t.targetCenter&&!ta(t.sourceCenter,t.targetCenter)||t.sourceResolution!==t.targetResolution||t.sourceRotation!==t.targetRotation)}function io(t,e,n,i,r){const s=Math.cos(-r);let a=Math.sin(-r),o=t[0]*s-t[1]*a,u=t[1]*s+t[0]*a;o+=(e[0]/2-n[0])*i,u+=(n[1]-e[1]/2)*i,a=-a;const l=o*s-u*a,c=u*s+o*a;return[l,c]}const Ps="ol-hidden",La="ol-unselectable",Wu="ol-control",nc="ol-collapsed",Bp=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(""),"i"),ic=["style","variant","weight","size","lineHeight","family"],tu={normal:400,bold:700},nu=function(t){const e=t.match(Bp);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let i=0,r=ic.length;i<r;++i){const s=e[i+1];s!==void 0&&(n[ic[i]]=typeof s=="string"?s.trim():s)}return isNaN(Number(n.weight))&&n.weight in tu&&(n.weight=tu[n.weight]),n.families=n.family.split(/,\s?/).map(i=>i.trim().replace(/^['"]|['"]$/g,"")),n};function ve(t,e,n,i){let r;return n&&n.length?r=n.shift():Ot?r=new class extends OffscreenCanvas{style={}}(t??300,e??150):r=document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",i)}let ro;function aa(){return ro||(ro=ve(1,1)),ro}function wa(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function rc(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function Up(t){for(;t.lastChild;)t.lastChild.remove()}function Hp(t,e){const n=t.childNodes;for(let i=0;;++i){const r=n[i],s=e[i];if(!r&&!s)break;if(r!==s){if(!r){t.appendChild(s);continue}if(!s){t.removeChild(r),--i;continue}t.insertBefore(s,r)}}}function vd(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){const n=this.childNodes.indexOf(e);if(n===-1)throw new Error("Node to remove was not found");return this.childNodes.splice(n,1),e},insertBefore:function(e,n){const i=this.childNodes.indexOf(n);if(i===-1)throw new Error("Reference node not found");return this.childNodes.splice(i,0,e),e},style:{}},{get(e,n,i){return n==="firstElementChild"?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,n,i)}})}function Hn(t){return typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas}class Xu extends tn{constructor(e){super();const n=e.element;n&&!e.target&&!n.style.pointerEvents&&(n.style.pointerEvents="auto"),this.element=n||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let n=0,i=this.listenerKeys.length;n<i;++n)we(this.listenerKeys[n]);if(this.listenerKeys.length=0,this.map_=e,e){const n=this.target_??e.getOverlayContainerStopEvent();this.element&&n.appendChild(this.element),this.render!==$r&&this.listenerKeys.push(pe(e,Pn.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}class zp extends Xu{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;const n=e.className!==void 0?e.className:"ol-attribution",i=e.tipLabel!==void 0?e.tipLabel:"Attributions",r=e.expandClassName!==void 0?e.expandClassName:n+"-expand",s=e.collapseLabel!==void 0?e.collapseLabel:"›",a=e.collapseClassName!==void 0?e.collapseClassName:n+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=a):this.collapseLabel_=s;const o=e.label!==void 0?e.label:"i";typeof o=="string"?(this.label_=document.createElement("span"),this.label_.textContent=o,this.label_.className=r):this.label_=o;const u=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(u),this.toggleButton_.addEventListener(ue.CLICK,this.handleClick_.bind(this),!1);const l=n+" "+La+" "+Wu+(this.collapsed_&&this.collapsible_?" "+nc:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=l,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const n=this.getMap().getAllLayers(),i=new Set(n.flatMap(r=>r.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(r=>i.add(r)):i.add(this.attributions_)),!this.overrideCollapsible_){const r=!n.some(s=>s.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(r)}return Array.from(i)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=await Promise.all(this.collectSourceAttributions_(e).map(r=>rm(()=>r))),i=n.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!qn(n,this.renderedAttributions_)){Up(this.ulElement_);for(let r=0,s=n.length;r<s;++r){const a=document.createElement("li");a.innerHTML=n[r],this.ulElement_.appendChild(a)}this.renderedAttributions_=n}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(nc),this.collapsed_?rc(this.collapseLabel_,this.label_):rc(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}class Yp extends Xu{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target});const n=e.className!==void 0?e.className:"ol-rotate",i=e.label!==void 0?e.label:"⇧",r=e.compassClassName!==void 0?e.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=r,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(r));const s=e.tipLabel?e.tipLabel:"Reset rotation",a=document.createElement("button");a.className=n+"-reset",a.setAttribute("type","button"),a.title=s,a.appendChild(this.label_),a.addEventListener(ue.CLICK,this.handleClick_.bind(this),!1);const o=n+" "+La+" "+Wu,u=this.element;u.className=o,u.appendChild(a),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration!==void 0?e.duration:250,this.autoHide_=e.autoHide!==void 0?e.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Ps)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const n=this.getMap().getView();if(!n)return;const i=n.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?n.animate({rotation:0,duration:this.duration_,easing:ur}):n.setRotation(0))}render(e){const n=e.frameState;if(!n)return;const i=n.viewState.rotation;if(i!=this.rotation_){const r="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains(Ps);!s&&i===0?this.element.classList.add(Ps):s&&i!==0&&this.element.classList.remove(Ps)}this.label_.style.transform=r}this.rotation_=i}}class Gp extends Xu{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const n=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,r=e.zoomInClassName!==void 0?e.zoomInClassName:n+"-in",s=e.zoomOutClassName!==void 0?e.zoomOutClassName:n+"-out",a=e.zoomInLabel!==void 0?e.zoomInLabel:"+",o=e.zoomOutLabel!==void 0?e.zoomOutLabel:"–",u=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",l=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=r,c.setAttribute("type","button"),c.title=u,c.appendChild(typeof a=="string"?document.createTextNode(a):a),c.addEventListener(ue.CLICK,this.handleClick_.bind(this,i),!1);const h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof o=="string"?document.createTextNode(o):o),h.addEventListener(ue.CLICK,this.handleClick_.bind(this,-i),!1);const f=n+" "+La+" "+Wu,g=this.element;g.className=f,g.appendChild(c),g.appendChild(h),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,n){n.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const r=i.getZoom();if(r!==void 0){const s=i.getConstrainedZoom(r+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:ur})):i.setZoom(s)}}}function jp(t){t=t||{};const e=new kt;return(t.zoom===void 0||t.zoom)&&e.push(new Gp(t.zoomOptions)),(t.rotate===void 0||t.rotate)&&e.push(new Yp(t.rotateOptions)),(t.attribution===void 0||t.attribution)&&e.push(new zp(t.attributionOptions)),e}class Wp{constructor(e,n,i){this.decay_=e,this.minVelocity_=n,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,n){this.points_.push(e,n,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]<e)return!1;let i=n-3;for(;i>0&&this.points_[i+2]>e;)i-=3;const r=this.points_[n+2]-this.points_[i+2];if(r<1e3/60)return!1;const s=this.points_[n]-this.points_[i],a=this.points_[n+1]-this.points_[i+1];return this.angle_=Math.atan2(a,s),this.initialVelocity_=Math.sqrt(s*s+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const sc={ACTIVE:"active"};class ps extends tn{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(sc.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(sc.ACTIVE,e)}setMap(e){this.map_=e}}function Xp(t,e,n){const i=t.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:Rm,center:t.getConstrainedCenter(r)})}}function Vu(t,e,n,i){const r=t.getZoom();if(r===void 0)return;const s=t.getConstrainedZoom(r+e),a=t.getResolutionForZoom(s);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:n,duration:i!==void 0?i:250,easing:ur})}class Vp extends ps{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let n=!1;if(e.type==Ne.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,a=i.shiftKey?-this.delta_:this.delta_,o=r.getView();Vu(o,a,s,this.duration_),i.preventDefault(),n=!0}return!n}}function iu(t){const e=arguments;return function(n){let i=!0;for(let r=0,s=e.length;r<s&&(i=i&&e[r](n),!!i);++r);return i}}const Kp=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},qp=function(t){const e=t.map.getTargetElement(),n=e.getRootNode(),i=t.map.getOwnerDocument().activeElement;return n instanceof ShadowRoot?n.host.contains(i):e.contains(i)},Fd=function(t){const e=t.map.getTargetElement(),n=e.getRootNode();return(n instanceof ShadowRoot?n.host:e).hasAttribute("tabindex")?qp(t):!0},$p=qr,Bd=function(t){const e=t.originalEvent;return"pointerId"in e&&e.button==0&&!(um&&rd&&e.ctrlKey)},Ud=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Zp=function(t){const e=t.originalEvent;return rd?e.metaKey:e.ctrlKey},Qp=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Hd=function(t){const e=t.originalEvent,n=e.target.tagName;return n!=="INPUT"&&n!=="SELECT"&&n!=="TEXTAREA"&&!e.target.isContentEditable},so=function(t){const e=t.originalEvent;return"pointerId"in e&&e.pointerType=="mouse"},Jp=function(t){const e=t.originalEvent;return"pointerId"in e&&e.isPrimary&&e.button===0};class _s extends ps{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let n=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==Ne.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==Ne.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==Ne.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,n=this.stopDown(i)}else e.type==Ne.POINTERMOVE&&this.handleMoveEvent(e);return!n}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function Ku(t){const e=t.length;let n=0,i=0;for(let r=0;r<e;r++)n+=t[r].clientX,i+=t[r].clientY;return{clientX:n/e,clientY:i/e}}class e_ extends _s{constructor(e){super({stopDown:Ea}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const n=e.condition?e.condition:iu(Ud,Jp);this.condition_=e.onFocusOnly?iu(Fd,n):n,this.noKinetic_=!1}handleDragEvent(e){const n=e.map;this.panning_||(this.panning_=!0,n.getView().beginInteraction());const i=this.targetPointers,r=n.getEventPixel(Ku(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){const s=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],o=e.map.getView();Cm(s,o.getResolution()),Lu(s,o.getRotation()),o.adjustCenterInternal(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=i.length,e.originalEvent.preventDefault()}handleUpEvent(e){const n=e.map,i=n.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const r=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),a=i.getCenterInternal(),o=n.getPixelFromCoordinateInternal(a),u=n.getCoordinateFromPixelInternal([o[0]-r*Math.cos(s),o[1]-r*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(u),duration:500,easing:ur})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class t_ extends _s{constructor(e){e=e||{},super({stopDown:Ea}),this.condition_=e.condition?e.condition:Kp,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!so(e))return;const n=e.map,i=n.getView();if(i.getConstraints().rotation===Gu)return;const r=n.getSize(),s=e.pixel,a=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){const o=a-this.lastAngle_;i.adjustRotationInternal(-o)}this.lastAngle_=a}handleUpEvent(e){return so(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return so(e)&&Bd(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class n_ extends _a{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,n=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(e[0],n[0])+i,r.top=Math.min(e[1],n[1])+i,r.width=Math.abs(n[0]-e[0])+i,r.height=Math.abs(n[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const n=this.element_.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,n){this.startPixel_=e,this.endPixel_=n,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const e=this.startPixel_,n=this.endPixel_,r=[e,[e[0],n[1]],n,[n[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new es([r])}getGeometry(){return this.geometry_}}const Oi={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Tr extends bn{constructor(e,n,i){super(e),this.coordinate=n,this.mapBrowserEvent=i}}class i_ extends _s{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new n_(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Bd,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,n,i){const r=i[0]-n[0],s=i[1]-n[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Tr(Oi.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;const n=this.boxEndCondition_(e,this.startPixel_,e.pixel);return n&&this.onBoxEnd(e),this.dispatchEvent(new Tr(n?Oi.BOXEND:Oi.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Tr(Oi.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Tr(Oi.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Tr(Oi.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class r_ extends i_{constructor(e){e=e||{};const n=e.condition?e.condition:Qp;super({condition:n,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const i=this.getMap().getView();let r=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(r),a=i.getResolutionForExtentInternal(s),o=i.getResolution()/a;r=r.clone(),r.scale(o*o)}i.fitInternal(r,{duration:this.duration_,easing:ur})}}const ii={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class s_ extends ps{constructor(e){super(),e=e||{},this.defaultCondition_=function(n){return Ud(n)&&Hd(n)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let n=!1;if(e.type==ue.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==ii.DOWN||r==ii.LEFT||r==ii.RIGHT||r==ii.UP)){const a=e.map.getView(),o=a.getResolution()*this.pixelDelta_;let u=0,l=0;r==ii.DOWN?l=-o:r==ii.LEFT?u=-o:r==ii.RIGHT?u=o:l=o;const c=[u,l];Lu(c,a.getRotation()),Xp(a,c,this.duration_),i.preventDefault(),n=!0}}return!n}}class a_ extends ps{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(n){return!Zp(n)&&Hd(n)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let n=!1;if(e.type==ue.KEYDOWN||e.type==ue.KEYPRESS){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==="+"||r==="-")){const s=e.map,a=r==="+"?this.delta_:-this.delta_,o=s.getView();Vu(o,a,void 0,this.duration_),i.preventDefault(),n=!0}}return!n}}const o_=40,u_=300;class l_ extends ps{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const n=e.condition?e.condition:$p;this.condition_=e.onFocusOnly?iu(Fd,n):n,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==ue.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let s=r.deltaY;switch(r.deltaMode){case WheelEvent.DOM_DELTA_LINE:s*=o_;break;case WheelEvent.DOM_DELTA_PAGE:s*=u_;break}if(s===0)return!1;this.lastDelta_=s;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const o=i.getView();if(this.mode_==="trackpad"&&!(o.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=a,!1;this.totalDelta_+=s;const u=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),u),!1}handleWheelZoom_(e){const n=e.getView();n.getAnimating()&&n.cancelAnimations();let i=-ke(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(n.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Vu(n,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}class c_ extends _s{constructor(e){e=e||{};const n=e;n.stopDown||(n.stopDown=Ea),super(n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let n=0;const i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){const u=s-this.lastAngle_;this.rotationDelta_+=u,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),n=u}this.lastAngle_=s;const a=e.map,o=a.getView();o.getConstraints().rotation!==Gu&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(Ku(this.targetPointers))),this.rotating_&&(a.render(),o.adjustRotationInternal(n,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const n=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1}}class h_ extends _s{constructor(e){e=e||{};const n=e;n.stopDown||(n.stopDown=Ea),super(n),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let n=1;const i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,a=i.clientY-r.clientY,o=Math.sqrt(s*s+a*a);this.lastDistance_!==void 0&&(n=this.lastDistance_/o),this.lastDistance_=o;const u=e.map,l=u.getView();n!=1&&(this.lastScaleDelta_=n),this.anchor_=u.getCoordinateFromPixelInternal(u.getEventPixel(Ku(this.targetPointers))),u.render(),l.adjustResolutionInternal(n,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const n=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1}}function d_(t){t=t||{};const e=new kt,n=new Wp(-.005,.05,100);return(t.altShiftDragRotate===void 0||t.altShiftDragRotate)&&e.push(new t_),(t.doubleClickZoom===void 0||t.doubleClickZoom)&&e.push(new Vp({delta:t.zoomDelta,duration:t.zoomDuration})),(t.dragPan===void 0||t.dragPan)&&e.push(new e_({onFocusOnly:t.onFocusOnly,kinetic:n})),(t.pinchRotate===void 0||t.pinchRotate)&&e.push(new c_),(t.pinchZoom===void 0||t.pinchZoom)&&e.push(new h_({duration:t.zoomDuration})),(t.keyboard===void 0||t.keyboard)&&(e.push(new s_),e.push(new a_({delta:t.zoomDelta,duration:t.zoomDuration}))),(t.mouseWheelZoom===void 0||t.mouseWheelZoom)&&e.push(new l_({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(t.shiftDragZoom===void 0||t.shiftDragZoom)&&e.push(new r_({duration:t.zoomDuration})),e}const ye={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class zd extends tn{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const n=Object.assign({},e);typeof e.properties=="object"&&(delete n.properties,Object.assign(n,e.properties)),n[ye.OPACITY]=e.opacity!==void 0?e.opacity:1,be(typeof n[ye.OPACITY]=="number","Layer opacity must be a number"),n[ye.VISIBLE]=e.visible!==void 0?e.visible:!0,n[ye.Z_INDEX]=e.zIndex,n[ye.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,n[ye.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,n[ye.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,n[ye.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=n.className!==void 0?n.className:"ol-layer",delete n.className,this.setProperties(n),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const n=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return n.opacity=ke(Math.round(this.getOpacity()*100)/100,0,1),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=i===void 0&&!n.managed?1/0:i,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.state_=n,n}getLayersArray(e){return me()}getLayerStatesArray(e){return me()}getExtent(){return this.get(ye.EXTENT)}getMaxResolution(){return this.get(ye.MAX_RESOLUTION)}getMinResolution(){return this.get(ye.MIN_RESOLUTION)}getMinZoom(){return this.get(ye.MIN_ZOOM)}getMaxZoom(){return this.get(ye.MAX_ZOOM)}getOpacity(){return this.get(ye.OPACITY)}getSourceState(){return me()}getVisible(){return this.get(ye.VISIBLE)}getZIndex(){return this.get(ye.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(ye.EXTENT,e)}setMaxResolution(e){this.set(ye.MAX_RESOLUTION,e)}setMinResolution(e){this.set(ye.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(ye.MAX_ZOOM,e)}setMinZoom(e){this.set(ye.MIN_ZOOM,e)}setOpacity(e){be(typeof e=="number","Layer opacity must be a number"),this.set(ye.OPACITY,e)}setVisible(e){this.set(ye.VISIBLE,e)}setZIndex(e){this.set(ye.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const In={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class Fn extends bn{constructor(e,n){super(e),this.layer=n}}const ao={LAYERS:"layers"};class lr extends zd{constructor(e){e=e||{};const n=Object.assign({},e);delete n.layers;let i=e.layers;super(n),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(ao.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new kt(i.slice(),{unique:!0}):be(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new kt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(we),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(pe(e,at.ADD,this.handleLayersAdd_,this),pe(e,at.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(we);ds(this.listenerKeys_);const n=e.getArray();for(let i=0,r=n.length;i<r;i++){const s=n[i];this.registerLayerListeners_(s),this.dispatchEvent(new Fn(In.ADDLAYER,s))}this.changed()}registerLayerListeners_(e){const n=[pe(e,er.PROPERTYCHANGE,this.handleLayerChange_,this),pe(e,ue.CHANGE,this.handleLayerChange_,this)];e instanceof lr&&n.push(pe(e,In.ADDLAYER,this.handleLayerGroupAdd_,this),pe(e,In.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[_e(e)]=n}handleLayerGroupAdd_(e){this.dispatchEvent(new Fn(In.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new Fn(In.REMOVELAYER,e.layer))}handleLayersAdd_(e){const n=e.element;this.registerLayerListeners_(n),this.dispatchEvent(new Fn(In.ADDLAYER,n)),this.changed()}handleLayersRemove_(e){const n=e.element,i=_e(n);this.listenerKeys_[i].forEach(we),delete this.listenerKeys_[i],this.dispatchEvent(new Fn(In.REMOVELAYER,n)),this.changed()}getLayers(){return this.get(ao.LAYERS)}setLayers(e){const n=this.getLayers();if(n){const i=n.getArray();for(let r=0,s=i.length;r<s;++r)this.dispatchEvent(new Fn(In.REMOVELAYER,i[r]))}this.set(ao.LAYERS,e)}getLayersArray(e){return e=e!==void 0?e:[],this.getLayers().forEach(function(n){n.getLayersArray(e)}),e}getLayerStatesArray(e){const n=e!==void 0?e:[],i=n.length;this.getLayers().forEach(function(a){a.getLayerStatesArray(n)});const r=this.getLayerState();let s=r.zIndex;!e&&r.zIndex===void 0&&(s=0);for(let a=i,o=n.length;a<o;a++){const u=n[a];u.opacity*=r.opacity,u.visible=u.visible&&r.visible,u.maxResolution=Math.min(u.maxResolution,r.maxResolution),u.minResolution=Math.max(u.minResolution,r.minResolution),u.minZoom=Math.max(u.minZoom,r.minZoom),u.maxZoom=Math.min(u.maxZoom,r.maxZoom),r.extent!==void 0&&(u.extent!==void 0?u.extent=gi(u.extent,r.extent):u.extent=r.extent),u.zIndex===void 0&&(u.zIndex=s)}return n}getSourceState(){return"ready"}}const Nt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class ka extends zd{constructor(e){const n=Object.assign({},e);delete n.source,super(n),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(ye.SOURCE,this.handleSourcePropertyChange_);const i=e.source?e.source:null;this.setSource(i)}getLayersArray(e){return e=e||[],e.push(this),e}getLayerStatesArray(e){return e=e||[],e.push(this.getLayerState()),e}getSource(){return this.get(ye.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(we(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=pe(e,ue.CHANGE,this.handleSourceChange_,this),e.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let n;const i=this.getMapInternal();!e&&i&&(e=i.getView()),e instanceof Zt?n={viewState:e.getState(),extent:e.calculateExtent()}:n=e,!n.layerStatesArray&&i&&(n.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let r;if(n.layerStatesArray){if(r=n.layerStatesArray.find(a=>a.layer===this),!r)return!1}else r=this.getLayerState();const s=this.getExtent();return qu(r,n.viewState)&&(!s||lt(s,n.extent))}getAttributions(e){if(!this.isVisible(e))return[];const n=this.getSource()?.getAttributions();if(!n)return[];const i=e instanceof Zt?e.getViewStateAndExtent():e;let r=n(i);return Array.isArray(r)||(r=[r]),r}render(e,n){const i=this.getRenderer();return i.prepareFrame(e)?(this.rendered=!0,i.renderFrame(e,n)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,n){}renderDeferred(e){const n=this.getRenderer();n&&n.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(ye.MAP,e)}getMapInternal(){return this.get(ye.MAP)}setMap(e){this.mapPrecomposeKey_&&(we(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(we(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=pe(e,Nt.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=pe(this,ue.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const n=e.frameState.layerStatesArray,i=this.getLayerState(!1);be(!n.some(r=>r.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(i)}setSource(e){this.set(ye.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function qu(t,e){if(!t.visible)return!1;const n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;const i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}function Yd(t,e,n=0,i=t.length-1,r=f_){for(;i>n;){if(i-n>600){const u=i-n+1,l=e-n+1,c=Math.log(u),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1),g=Math.max(n,Math.floor(e-l*h/u+f)),m=Math.min(i,Math.floor(e+(u-l)*h/u+f));Yd(t,e,g,m,r)}const s=t[e];let a=n,o=i;for(br(t,n,e),r(t[i],s)>0&&br(t,n,i);a<o;){for(br(t,a,o),a++,o--;r(t[a],s)<0;)a++;for(;r(t[o],s)>0;)o--}r(t[n],s)===0?br(t,n,o):(o++,br(t,o,i)),o<=e&&(n=o+1),e<=o&&(i=o-1)}}function br(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function f_(t,e){return t<e?-1:t>e?1:0}let Gd=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const i=[];if(!vs(e,n))return i;const r=this.toBBox,s=[];for(;n;){for(let a=0;a<n.children.length;a++){const o=n.children[a],u=n.leaf?r(o):o;vs(e,u)&&(n.leaf?i.push(o):uo(e,u)?this._all(o,i):s.push(o))}n=s.pop()}return i}collides(e){let n=this.data;if(!vs(e,n))return!1;const i=[];for(;n;){for(let r=0;r<n.children.length;r++){const s=n.children[r],a=n.leaf?this.toBBox(s):s;if(vs(e,a)){if(n.leaf||uo(e,a))return!0;i.push(s)}}n=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let n=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=Hi([]),this}remove(e,n){if(!e)return this;let i=this.data;const r=this.toBBox(e),s=[],a=[];let o,u,l;for(;i||s.length;){if(i||(i=s.pop(),u=s[s.length-1],o=a.pop(),l=!0),i.leaf){const c=g_(e,i.children,n);if(c!==-1)return i.children.splice(c,1),s.push(i),this._condense(s),this}!l&&!i.leaf&&uo(i,r)?(s.push(i),a.push(o),o=0,u=i,i=i.children[0]):u?(o++,i=u.children[o],l=!1):i=null}return this}toBBox(e){return e}compareMinX(e,n){return e.minX-n.minX}compareMinY(e,n){return e.minY-n.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,n){const i=[];for(;e;)e.leaf?n.push(...e.children):i.push(...e.children),e=i.pop();return n}_build(e,n,i,r){const s=i-n+1;let a=this._maxEntries,o;if(s<=a)return o=Hi(e.slice(n,i+1)),Ni(o,this.toBBox),o;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),o=Hi([]),o.leaf=!1,o.height=r;const u=Math.ceil(s/a),l=u*Math.ceil(Math.sqrt(a));ac(e,n,i,l,this.compareMinX);for(let c=n;c<=i;c+=l){const h=Math.min(c+l-1,i);ac(e,c,h,u,this.compareMinY);for(let f=c;f<=h;f+=u){const g=Math.min(f+u-1,h);o.children.push(this._build(e,f,g,r-1))}}return Ni(o,this.toBBox),o}_chooseSubtree(e,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let s=1/0,a=1/0,o;for(let u=0;u<n.children.length;u++){const l=n.children[u],c=oo(l),h=__(e,l)-c;h<a?(a=h,s=c<s?c:s,o=l):h===a&&c<s&&(s=c,o=l)}n=o||n.children[0]}return n}_insert(e,n,i){const r=i?e:this.toBBox(e),s=[],a=this._chooseSubtree(r,this.data,n,s);for(a.children.push(e),Nr(a,r);n>=0&&s[n].children.length>this._maxEntries;)this._split(s,n),n--;this._adjustParentBBoxes(r,s,n)}_split(e,n){const i=e[n],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);const a=this._chooseSplitIndex(i,s,r),o=Hi(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,Ni(i,this.toBBox),Ni(o,this.toBBox),n?e[n-1].children.push(o):this._splitRoot(i,o)}_splitRoot(e,n){this.data=Hi([e,n]),this.data.height=e.height+1,this.data.leaf=!1,Ni(this.data,this.toBBox)}_chooseSplitIndex(e,n,i){let r,s=1/0,a=1/0;for(let o=n;o<=i-n;o++){const u=Or(e,0,o,this.toBBox),l=Or(e,o,i,this.toBBox),c=E_(u,l),h=oo(u)+oo(l);c<s?(s=c,r=o,a=h<a?h:a):c===s&&h<a&&(a=h,r=o)}return r||i-n}_chooseSplitAxis(e,n,i){const r=e.leaf?this.compareMinX:m_,s=e.leaf?this.compareMinY:p_,a=this._allDistMargin(e,n,i,r),o=this._allDistMargin(e,n,i,s);a<o&&e.children.sort(r)}_allDistMargin(e,n,i,r){e.children.sort(r);const s=this.toBBox,a=Or(e,0,n,s),o=Or(e,i-n,i,s);let u=Ms(a)+Ms(o);for(let l=n;l<i-n;l++){const c=e.children[l];Nr(a,e.leaf?s(c):c),u+=Ms(a)}for(let l=i-n-1;l>=n;l--){const c=e.children[l];Nr(o,e.leaf?s(c):c),u+=Ms(o)}return u}_adjustParentBBoxes(e,n,i){for(let r=i;r>=0;r--)Nr(n[r],e)}_condense(e){for(let n=e.length-1,i;n>=0;n--)e[n].children.length===0?n>0?(i=e[n-1].children,i.splice(i.indexOf(e[n]),1)):this.clear():Ni(e[n],this.toBBox)}};function g_(t,e,n){if(!n)return e.indexOf(t);for(let i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function Ni(t,e){Or(t,0,t.children.length,e,t)}function Or(t,e,n,i,r){r||(r=Hi(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<n;s++){const a=t.children[s];Nr(r,t.leaf?i(a):a)}return r}function Nr(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function m_(t,e){return t.minX-e.minX}function p_(t,e){return t.minY-e.minY}function oo(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Ms(t){return t.maxX-t.minX+(t.maxY-t.minY)}function __(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function E_(t,e){const n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),s=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,s-i)}function uo(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function vs(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Hi(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ac(t,e,n,i,r){const s=[e,n];for(;s.length;){if(n=s.pop(),e=s.pop(),n-e<=i)continue;const a=e+Math.ceil((n-e)/i/2)*i;Yd(t,a,e,n,r),s.push(e,a,a,n)}}const $u=[NaN,NaN,NaN,0];let lo;function T_(){return lo||(lo=ve(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),lo}const b_=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,y_=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,x_=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,C_=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Fs(t,e){return t.endsWith("%")?Number(t.substring(0,t.length-1))/e:Number(t)}function Ur(t){throw new Error('failed to parse "'+t+'" as color')}function jd(t){if(t.toLowerCase().startsWith("rgb")){const s=t.match(y_)||t.match(b_)||t.match(x_);if(s){const a=s[4],o=100/255;return[ke(Fs(s[1],o)+.5|0,0,255),ke(Fs(s[2],o)+.5|0,0,255),ke(Fs(s[3],o)+.5|0,0,255),a!==void 0?ke(Fs(a,100),0,1):1]}Ur(t)}if(t.startsWith("#")){if(C_.test(t)){const s=t.substring(1),a=s.length<=4?1:2,o=[0,0,0,255];for(let u=0,l=s.length;u<l;u+=a){let c=parseInt(s.substring(u,u+a),16);a===1&&(c+=c<<4),o[u/a]=c}return o[3]=o[3]/255,o}Ur(t)}const e=T_();e.fillStyle="#abcdef";let n=e.fillStyle;e.fillStyle=t,e.fillStyle===n&&(e.fillStyle="#fedcba",n=e.fillStyle,e.fillStyle=t,e.fillStyle===n&&Ur(t));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return jd(i);e.clearRect(0,0,1,1),e.fillRect(0,0,1,1);const r=Array.from(e.getImageData(0,0,1,1).data);return r[3]=ba(r[3]/255,3),r}function A_(t){return typeof t=="string"?t:Qu(t)}const I_=1024,yr={};let co=0;function S_(t){if(t.length===4)return t;const e=t.slice();return e[3]=1,e}function ho(t){return t>.0031308?Math.pow(t,1/2.4)*269.025-14.025:t*3294.6}function fo(t){return t>.2068965?Math.pow(t,3):(t-4/29)*(108/841)}function go(t){return t>10.314724?Math.pow((t+14.025)/269.025,2.4):t/3294.6}function mo(t){return t>.0088564?Math.pow(t,1/3):t/(108/841)+4/29}function oc(t){const e=go(t[0]),n=go(t[1]),i=go(t[2]),r=mo(e*.222488403+n*.716873169+i*.06060791),s=500*(mo(e*.452247074+n*.399439023+i*.148375274)-r),a=200*(r-mo(e*.016863605+n*.117638439+i*.865350722)),o=Math.atan2(a,s)*(180/Math.PI);return[116*r-16,Math.sqrt(s*s+a*a),o<0?o+360:o,t[3]]}function R_(t){const e=(t[0]+16)/116,n=t[1],i=t[2]*Math.PI/180,r=fo(e),s=fo(e+n/500*Math.cos(i)),a=fo(e-n/200*Math.sin(i)),o=ho(s*3.021973625-r*1.617392459-a*.404875592),u=ho(s*-.943766287+r*1.916279586+a*.027607165),l=ho(s*.069407491-r*.22898585+a*1.159737864);return[ke(o+.5|0,0,255),ke(u+.5|0,0,255),ke(l+.5|0,0,255),t[3]]}function Zu(t){if(t==="none")return $u;if(yr.hasOwnProperty(t))return yr[t];if(co>=I_){let n=0;for(const i in yr)(n++&3)===0&&(delete yr[i],--co)}const e=jd(t);e.length!==4&&Ur(t);for(const n of e)isNaN(n)&&Ur(t);return yr[t]=e,++co,e}function Ei(t){return Array.isArray(t)?t:Zu(t)}function Qu(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let n=t[1];n!=(n|0)&&(n=n+.5|0);let i=t[2];i!=(i|0)&&(i=i+.5|0);const r=t[3]===void 0?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+i+","+r+")"}function uc(t){return t[0]>0&&t[1]>0}function L_(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function ct(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}let Ai=0;const et=1<<Ai++,de=1<<Ai++,ot=1<<Ai++,Ut=1<<Ai++,Ti=1<<Ai++,Dr=1<<Ai++,Bs=Math.pow(2,Ai)-1,Ju={[et]:"boolean",[de]:"number",[ot]:"string",[Ut]:"color",[Ti]:"number[]",[Dr]:"size"},w_=Object.keys(Ju).map(Number).sort(pn);function k_(t){return t in Ju}function Pr(t){const e=[];for(const n of w_)Mr(t,n)&&e.push(Ju[n]);return e.length===0?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function Mr(t,e){return(t&e)===e}function Sn(t,e){return t===e}class Be{constructor(e,n){if(!k_(e))throw new Error(`literal expressions must have a specific type, got ${Pr(e)}`);this.type=e,this.value=n}}class O_{constructor(e,n,...i){this.type=e,this.operator=n,this.args=i}}function Wd(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function Xe(t,e,n){switch(typeof t){case"boolean":{if(Sn(e,ot))return new Be(ot,t?"true":"false");if(!Mr(e,et))throw new Error(`got a boolean, but expected ${Pr(e)}`);return new Be(et,t)}case"number":{if(Sn(e,Dr))return new Be(Dr,ct(t));if(Sn(e,et))return new Be(et,!!t);if(Sn(e,ot))return new Be(ot,t.toString());if(!Mr(e,de))throw new Error(`got a number, but expected ${Pr(e)}`);return new Be(de,t)}case"string":{if(Sn(e,Ut))return new Be(Ut,Zu(t));if(Sn(e,et))return new Be(et,!!t);if(!Mr(e,ot))throw new Error(`got a string, but expected ${Pr(e)}`);return new Be(ot,t)}}if(!Array.isArray(t))throw new Error("expression must be an array or a primitive value");if(t.length===0)throw new Error("empty expression");if(typeof t[0]=="string")return Y_(t,e,n);for(const i of t)if(typeof i!="number")throw new Error("expected an array of numbers");if(Sn(e,Dr)){if(t.length!==2)throw new Error(`expected an array of two values for a size, got ${t.length}`);return new Be(Dr,t)}if(Sn(e,Ut)){if(t.length===3)return new Be(Ut,[...t,1]);if(t.length===4)return new Be(Ut,t);throw new Error(`expected an array of 3 or 4 values for a color, got ${t.length}`)}if(!Mr(e,Ti))throw new Error(`got an array of numbers, but expected ${Pr(e)}`);return new Be(Ti,t)}const F={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",LineMetric:"line-metric",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},N_={[F.Get]:ne(ae(1,1/0),lc),[F.Var]:ne(ae(1,1),D_),[F.Has]:ne(ae(1,1/0),lc),[F.Id]:ne(P_,Di),[F.Concat]:ne(ae(2,1/0),Ee(ot)),[F.GeometryType]:ne(M_,Di),[F.LineMetric]:ne(Di),[F.Resolution]:ne(po,Di),[F.Zoom]:ne(po,Di),[F.Time]:ne(po,Di),[F.Any]:ne(ae(2,1/0),Ee(et)),[F.All]:ne(ae(2,1/0),Ee(et)),[F.Not]:ne(ae(1,1),Ee(et)),[F.Equal]:ne(ae(2,2),Ee(Bs)),[F.NotEqual]:ne(ae(2,2),Ee(Bs)),[F.GreaterThan]:ne(ae(2,2),Ee(de)),[F.GreaterThanOrEqualTo]:ne(ae(2,2),Ee(de)),[F.LessThan]:ne(ae(2,2),Ee(de)),[F.LessThanOrEqualTo]:ne(ae(2,2),Ee(de)),[F.Multiply]:ne(ae(2,1/0),cc),[F.Coalesce]:ne(ae(2,1/0),cc),[F.Divide]:ne(ae(2,2),Ee(de)),[F.Add]:ne(ae(2,1/0),Ee(de)),[F.Subtract]:ne(ae(2,2),Ee(de)),[F.Clamp]:ne(ae(3,3),Ee(de)),[F.Mod]:ne(ae(2,2),Ee(de)),[F.Pow]:ne(ae(2,2),Ee(de)),[F.Abs]:ne(ae(1,1),Ee(de)),[F.Floor]:ne(ae(1,1),Ee(de)),[F.Ceil]:ne(ae(1,1),Ee(de)),[F.Round]:ne(ae(1,1),Ee(de)),[F.Sin]:ne(ae(1,1),Ee(de)),[F.Cos]:ne(ae(1,1),Ee(de)),[F.Atan]:ne(ae(1,2),Ee(de)),[F.Sqrt]:ne(ae(1,1),Ee(de)),[F.Match]:ne(ae(4,1/0),hc,F_),[F.Between]:ne(ae(3,3),Ee(de)),[F.Interpolate]:ne(ae(6,1/0),hc,B_),[F.Case]:ne(ae(3,1/0),v_,U_),[F.In]:ne(ae(2,2),H_),[F.Number]:ne(ae(1,1/0),Ee(Bs)),[F.String]:ne(ae(1,1/0),Ee(Bs)),[F.Array]:ne(ae(1,1/0),Ee(de)),[F.Color]:ne(ae(1,4),Ee(de)),[F.Band]:ne(ae(1,3),Ee(de)),[F.Palette]:ne(ae(2,2),z_),[F.ToString]:ne(ae(1,1),Ee(et|de|ot|Ut))};function lc(t,e,n){const i=t.length-1,r=new Array(i);for(let s=0;s<i;++s){const a=t[s+1];switch(typeof a){case"number":{r[s]=new Be(de,a);break}case"string":{r[s]=new Be(ot,a);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${a}`)}s===0&&n.properties.add(String(a))}return r}function D_(t,e,n){const i=t[1];if(typeof i!="string")throw new Error("expected a string argument for var operation");return n.variables.add(i),[new Be(ot,i)]}function P_(t,e,n){n.featureId=!0}function M_(t,e,n){n.geometryType=!0}function po(t,e,n){n.mapState=!0}function Di(t,e,n){const i=t[0];if(t.length!==1)throw new Error(`expected no arguments for ${i} operation`);return[]}function ae(t,e){return function(n,i,r){const s=n[0],a=n.length-1;if(t===e){if(a!==t){const o=t===1?"":"s";throw new Error(`expected ${t} argument${o} for ${s}, got ${a}`)}}else if(a<t||a>e){const o=e===1/0?`${t} or more`:`${t} to ${e}`;throw new Error(`expected ${o} arguments for ${s}, got ${a}`)}}}function cc(t,e,n){const i=t.length-1,r=new Array(i);for(let s=0;s<i;++s){const a=Xe(t[s+1],e,n);r[s]=a}return r}function Ee(t){return function(e,n,i){const r=e.length-1,s=new Array(r);for(let a=0;a<r;++a){const o=Xe(e[a+1],t,i);s[a]=o}return s}}function v_(t,e,n){const i=t[0],r=t.length-1;if(r%2===0)throw new Error(`expected an odd number of arguments for ${i}, got ${r} instead`)}function hc(t,e,n){const i=t[0],r=t.length-1;if(r%2===1)throw new Error(`expected an even number of arguments for operation ${i}, got ${r} instead`)}function F_(t,e,n){const i=t.length-1,r=ot|de|et,s=Xe(t[1],r,n),a=Xe(t[t.length-1],e,n),o=new Array(i-2);for(let u=0;u<i-2;u+=2){try{const l=Xe(t[u+2],s.type,n);o[u]=l}catch(l){throw new Error(`failed to parse argument ${u+1} of match expression: ${l.message}`)}try{const l=Xe(t[u+3],a.type,n);o[u+1]=l}catch(l){throw new Error(`failed to parse argument ${u+2} of match expression: ${l.message}`)}}return[s,...o,a]}function B_(t,e,n){const i=t[1];let r;switch(i[0]){case"linear":r=1;break;case"exponential":const u=i[1];if(typeof u!="number"||u<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(u)} instead`);r=u;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(i)}`)}const s=new Be(de,r);let a;try{a=Xe(t[2],de,n)}catch(u){throw new Error(`failed to parse argument 1 in interpolate expression: ${u.message}`)}const o=new Array(t.length-3);for(let u=0;u<o.length;u+=2){try{const l=Xe(t[u+3],de,n);o[u]=l}catch(l){throw new Error(`failed to parse argument ${u+2} for interpolate expression: ${l.message}`)}try{const l=Xe(t[u+4],e,n);o[u+1]=l}catch(l){throw new Error(`failed to parse argument ${u+3} for interpolate expression: ${l.message}`)}}return[s,a,...o]}function U_(t,e,n){const i=Xe(t[t.length-1],e,n),r=new Array(t.length-1);for(let s=0;s<r.length-1;s+=2){try{const a=Xe(t[s+1],et,n);r[s]=a}catch(a){throw new Error(`failed to parse argument ${s} of case expression: ${a.message}`)}try{const a=Xe(t[s+2],i.type,n);r[s+1]=a}catch(a){throw new Error(`failed to parse argument ${s+1} of case expression: ${a.message}`)}}return r[r.length-1]=i,r}function H_(t,e,n){let i=t[2];if(!Array.isArray(i))throw new Error('the second argument for the "in" operator must be an array');let r;if(typeof i[0]=="string"){if(i[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(i[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');i=i[1],r=ot}else r=de;const s=new Array(i.length);for(let o=0;o<s.length;o++)try{const u=Xe(i[o],r,n);s[o]=u}catch(u){throw new Error(`failed to parse haystack item ${o} for "in" expression: ${u.message}`)}return[Xe(t[1],r,n),...s]}function z_(t,e,n){let i;try{i=Xe(t[1],de,n)}catch(a){throw new Error(`failed to parse first argument in palette expression: ${a.message}`)}const r=t[2];if(!Array.isArray(r))throw new Error("the second argument of palette must be an array");const s=new Array(r.length);for(let a=0;a<s.length;a++){let o;try{o=Xe(r[a],Ut,n)}catch(u){throw new Error(`failed to parse color at index ${a} in palette expression: ${u.message}`)}if(!(o instanceof Be))throw new Error(`the palette color at index ${a} must be a literal value`);s[a]=o}return[i,...s]}function ne(...t){return function(e,n,i){const r=e[0];let s;for(let a=0;a<t.length;a++){const o=t[a](e,n,i);if(a==t.length-1){if(!o)throw new Error("expected last argument validator to return the parsed args");s=o}}return new O_(n,r,...s)}}function Y_(t,e,n){const i=t[0],r=N_[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(t,e,n)}function Xd(t){if(!t)return"";const e=t.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return Xd(t.getGeometries()[0]);default:return""}}function Vd(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function en(t,e,n){const i=Xe(t,e,n);return Yt(i)}function Yt(t,e){if(t instanceof Be){if(t.type===Ut&&typeof t.value=="string"){const i=Zu(t.value);return function(){return i}}return function(){return t.value}}const n=t.operator;switch(n){case F.Number:case F.String:case F.Coalesce:return G_(t);case F.Get:case F.Var:case F.Has:return j_(t);case F.Id:return i=>i.featureId;case F.GeometryType:return i=>i.geometryType;case F.Concat:{const i=t.args.map(r=>Yt(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case F.Resolution:return i=>i.resolution;case F.Any:case F.All:case F.Between:case F.In:case F.Not:return X_(t);case F.Equal:case F.NotEqual:case F.LessThan:case F.LessThanOrEqualTo:case F.GreaterThan:case F.GreaterThanOrEqualTo:return W_(t);case F.Multiply:case F.Divide:case F.Add:case F.Subtract:case F.Clamp:case F.Mod:case F.Pow:case F.Abs:case F.Floor:case F.Ceil:case F.Round:case F.Sin:case F.Cos:case F.Atan:case F.Sqrt:return V_(t);case F.Case:return K_(t);case F.Match:return q_(t);case F.Interpolate:return $_(t);case F.ToString:return Z_(t);default:throw new Error(`Unsupported operator ${n}`)}}function G_(t,e){const n=t.operator,i=t.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=Yt(t.args[s]);switch(n){case F.Coalesce:return s=>{for(let a=0;a<i;++a){const o=r[a](s);if(typeof o<"u"&&o!==null)return o}throw new Error("Expected one of the values to be non-null")};case F.Number:case F.String:return s=>{for(let a=0;a<i;++a){const o=r[a](s);if(typeof o===n)return o}throw new Error(`Expected one of the values to be a ${n}`)};default:throw new Error(`Unsupported assertion operator ${n}`)}}function j_(t,e){const i=t.args[0].value;switch(t.operator){case F.Get:return r=>{const s=t.args;let a=r.properties[i];for(let o=1,u=s.length;o<u;++o){const c=s[o].value;a=a[c]}return a};case F.Var:return r=>r.variables[i];case F.Has:return r=>{const s=t.args;if(!(i in r.properties))return!1;let a=r.properties[i];for(let o=1,u=s.length;o<u;++o){const c=s[o].value;if(!a||!Object.hasOwn(a,c))return!1;a=a[c]}return!0};default:throw new Error(`Unsupported accessor operator ${t.operator}`)}}function W_(t,e){const n=t.operator,i=Yt(t.args[0]),r=Yt(t.args[1]);switch(n){case F.Equal:return s=>i(s)===r(s);case F.NotEqual:return s=>i(s)!==r(s);case F.LessThan:return s=>i(s)<r(s);case F.LessThanOrEqualTo:return s=>i(s)<=r(s);case F.GreaterThan:return s=>i(s)>r(s);case F.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${n}`)}}function X_(t,e){const n=t.operator,i=t.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=Yt(t.args[s]);switch(n){case F.Any:return s=>{for(let a=0;a<i;++a)if(r[a](s))return!0;return!1};case F.All:return s=>{for(let a=0;a<i;++a)if(!r[a](s))return!1;return!0};case F.Between:return s=>{const a=r[0](s),o=r[1](s),u=r[2](s);return a>=o&&a<=u};case F.In:return s=>{const a=r[0](s);for(let o=1;o<i;++o)if(a===r[o](s))return!0;return!1};case F.Not:return s=>!r[0](s);default:throw new Error(`Unsupported logical operator ${n}`)}}function V_(t,e){const n=t.operator,i=t.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=Yt(t.args[s]);switch(n){case F.Multiply:return s=>{let a=1;for(let o=0;o<i;++o)a*=r[o](s);return a};case F.Divide:return s=>r[0](s)/r[1](s);case F.Add:return s=>{let a=0;for(let o=0;o<i;++o)a+=r[o](s);return a};case F.Subtract:return s=>r[0](s)-r[1](s);case F.Clamp:return s=>{const a=r[0](s),o=r[1](s);if(a<o)return o;const u=r[2](s);return a>u?u:a};case F.Mod:return s=>r[0](s)%r[1](s);case F.Pow:return s=>Math.pow(r[0](s),r[1](s));case F.Abs:return s=>Math.abs(r[0](s));case F.Floor:return s=>Math.floor(r[0](s));case F.Ceil:return s=>Math.ceil(r[0](s));case F.Round:return s=>Math.round(r[0](s));case F.Sin:return s=>Math.sin(r[0](s));case F.Cos:return s=>Math.cos(r[0](s));case F.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case F.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${n}`)}}function K_(t,e){const n=t.args.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=Yt(t.args[r]);return r=>{for(let s=0;s<n-1;s+=2)if(i[s](r))return i[s+1](r);return i[n-1](r)}}function q_(t,e){const n=t.args.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=Yt(t.args[r]);return r=>{const s=i[0](r);for(let a=1;a<n-1;a+=2)if(s===i[a](r))return i[a+1](r);return i[n-1](r)}}function $_(t,e){const n=t.args.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=Yt(t.args[r]);return r=>{const s=i[0](r),a=i[1](r);let o,u;for(let l=2;l<n;l+=2){const c=i[l](r);let h=i[l+1](r);const f=Array.isArray(h);if(f&&(h=S_(h)),c>=a)return l===2?h:f?Q_(s,a,o,u,c,h):vr(s,a,o,u,c,h);o=c,u=h}return u}}function Z_(t,e){const n=t.operator,i=t.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=Yt(t.args[s]);if(n===F.ToString)return s=>{const a=r[0](s);return t.args[0].type===Ut?Qu(a):a.toString()};throw new Error(`Unsupported convert operator ${n}`)}function vr(t,e,n,i,r,s){const a=r-n;if(a===0)return i;const o=e-n,u=t===1?o/a:(Math.pow(t,o)-1)/(Math.pow(t,a)-1);return i+u*(s-i)}function Q_(t,e,n,i,r,s){if(r-n===0)return i;const o=oc(i),u=oc(s);let l=u[2]-o[2];l>180?l-=360:l<-180&&(l+=360);const c=[vr(t,e,n,o[0],r,u[0]),vr(t,e,n,o[1],r,u[1]),o[2]+vr(t,e,n,0,r,l),vr(t,e,n,i[3],r,s[3])];return R_(c)}const re={IDLE:0,LOADING:1,LOADED:2,ERROR:3};function J_(t,e,n){const i=t;let r=!0,s=!1,a=!1;const o=[Js(i,ue.LOAD,function(){a=!0,s||e()})];return i.src&&sd?(s=!0,i.decode().then(function(){r&&e()}).catch(function(u){r&&(a?e():n())})):o.push(Js(i,ue.ERROR,n)),function(){r=!1,o.forEach(we)}}function e1(t,e){return new Promise((n,i)=>{function r(){a(),n(t)}function s(){a(),i(new Error("Image load error"))}function a(){t.removeEventListener("load",r),t.removeEventListener("error",s)}t.addEventListener("load",r),t.addEventListener("error",s)})}function t1(t,e){return e&&(t.src=e),t.src&&sd?new Promise((n,i)=>t.decode().then(()=>n(t)).catch(r=>t.complete&&t.width?n(t):i(r))):e1(t)}class n1{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const n in this.cache_){const i=this.cache_[n];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[n],delete this.patternCache_[n],--this.cacheSize_)}}}get(e,n){const i=_o(e,n);return i in this.cache_?this.cache_[i]:null}getPattern(e,n){const i=_o(e,n);return i in this.patternCache_?this.patternCache_[i]:null}set(e,n,i,r){const s=_o(e,n),a=s in this.cache_;this.cache_[s]=i,r&&(i.getImageState()===re.IDLE&&i.load(),i.getImageState()===re.LOADING?i.ready().then(()=>{this.patternCache_[s]=aa().createPattern(i.getImage(1),"repeat")}):this.patternCache_[s]=aa().createPattern(i.getImage(1),"repeat")),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function _o(t,e){const n=e?Ei(e):"null";return t+":"+n}const Dt=new n1;let xr=null;class Kd extends Ta{constructor(e,n,i,r,s){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i?.crossOrigin,this.referrerPolicy_=i?.referrerPolicy,this.canvas_={},this.color_=s,this.imageState_=r===void 0?re.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=n,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===re.LOADED){xr||(xr=ve(1,1,void 0,{willReadFrequently:!0})),xr.drawImage(this.image_,0,0);try{xr.getImageData(0,0,1,1),this.tainted_=!1}catch{xr=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(ue.CHANGE)}handleImageError_(){this.imageState_=re.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=re.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}setImage(e){this.image_=e}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],n=this.size_[1],i=ve(e,n);i.fillRect(0,0,e,n),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===re.IDLE){this.image_||this.initializeImage_(),this.imageState_=re.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&t1(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==re.LOADED)return;const n=this.image_,i=ve(Math.ceil(n.width*e),Math.ceil(n.height*e)),r=i.canvas;i.scale(e,e),i.drawImage(n,0,0),i.globalCompositeOperation="multiply",i.fillStyle=A_(this.color_),i.fillRect(0,0,r.width/e,r.height/e),i.globalCompositeOperation="destination-in",i.drawImage(n,0,0),this.canvas_[e]=r}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===re.LOADED||this.imageState_===re.ERROR)e();else{const n=()=>{(this.imageState_===re.LOADED||this.imageState_===re.ERROR)&&(this.removeEventListener(ue.CHANGE,n),e())};this.addEventListener(ue.CHANGE,n)}})),this.ready_}}function Hr(t,e,n,i,r,s){let a=e===void 0?void 0:Dt.get(e,r);return a||(a=new Kd(t,t&&"src"in t?t.src||void 0:e,n,i,r),Dt.set(e,r,a,s)),s&&a&&!Dt.getPattern(e,r)&&Dt.set(e,r,a,s),a}function Jt(t){return t?Array.isArray(t)?Qu(t):typeof t=="object"&&"src"in t?i1(t):t:null}function i1(t){if(!t.offset||!t.size)return Dt.getPattern(t.src,t.color);const e=t.src+":"+t.offset,n=Dt.getPattern(e,t.color);if(n)return n;const i=Dt.get(t.src,null);if(i.getImageState()!==re.LOADED)return null;const r=ve(t.size[0],t.size[1]);return r.drawImage(i.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),Hr(r.canvas,e,void 0,re.LOADED,t.color,!0),Dt.getPattern(e,t.color)}const qd="10px sans-serif",ut="#000",rr="round",_n=[],En=0,sr="round",ts=10,r1=0,ns="#000",is="center",oa="middle",hi=[0,0,0,0],rs=1,zi=new tn;let Cr=null,dc;const ru={},s1=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function a1(t,e,n){return`${t} ${e} 16px "${n}"`}const o1=(function(){let e,n;async function i(s){await n.ready;const a=await n.load(s);if(a.length===0)return!1;const o=nu(s),u=o.families[0].toLowerCase(),l=o.weight;return a.some(c=>{const h=c.family.replace(/^['"]|['"]$/g,"").toLowerCase(),f=tu[c.weight]||c.weight;return h===u&&c.style===o.style&&f==l})}async function r(){await n.ready;let s=!0;const a=zi.getProperties(),o=Object.keys(a).filter(u=>a[u]<100);for(let u=o.length-1;u>=0;--u){const l=o[u];let c=a[l];c<100&&(await i(l)?(ds(ru),zi.set(l,100)):(c+=10,zi.set(l,c,!0),c<100&&(s=!1)))}e=void 0,s||(e=setTimeout(r,100))}return async function(s){n||(n=Ot?self.fonts:document.fonts);const a=nu(s);if(!a)return;const o=a.families;let u=!1;for(const l of o){if(s1.has(l))continue;const c=a1(a.style,a.weight,l);zi.get(c)===void 0&&(zi.set(c,0,!0),u=!0)}u&&(clearTimeout(e),e=setTimeout(r,100))}})(),u1=(function(){let t;return function(e){let n=ru[e];if(n==null){if(Ot){const i=nu(e),r=$d(e,"Žg");n=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);ru[e]=n}return n}})();function $d(t,e){return Cr||(Cr=ve(1,1)),t!=dc&&(Cr.font=t,dc=Cr.font),Cr.measureText(e)}function Zd(t,e){return $d(t,e).width}function fc(t,e,n){if(e in n)return n[e];const i=e.split(`
|
|
2
|
+
`).reduce((r,s)=>Math.max(r,Zd(t,s)),0);return n[e]=i,i}function l1(t,e){const n=[],i=[],r=[];let s=0,a=0,o=0,u=0;for(let l=0,c=e.length;l<=c;l+=2){const h=e[l];if(h===`
|
|
3
|
+
`||l===c){s=Math.max(s,a),r.push(a),a=0,o+=u,u=0;continue}const f=e[l+1]||t.font,g=Zd(f,h);n.push(g),a+=g;const m=u1(f);i.push(m),u=Math.max(u,m)}return{width:s,height:o,widths:n,heights:i,lineWidths:r}}function c1(t,e,n,i,r,s,a,o,u,l,c){t.save(),n!==1&&(t.globalAlpha===void 0?t.globalAlpha=h=>h.globalAlpha*=n:t.globalAlpha*=n),e&&t.transform.apply(t,e),i.contextInstructions?(t.translate(u,l),t.scale(c[0],c[1]),h1(i,t)):c[0]<0||c[1]<0?(t.translate(u,l),t.scale(c[0],c[1]),t.drawImage(i,r,s,a,o,0,0,a,o)):t.drawImage(i,r,s,a,o,u,l,a*c[0],o*c[1]),t.restore()}function h1(t,e){const n=t.contextInstructions;for(let i=0,r=n.length;i<r;i+=2)Array.isArray(n[i+1])?e[n[i]].apply(e,n[i+1]):e[n[i]]=n[i+1]}class Oa{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=ct(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new Oa({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return me()}getImage(e){return me()}getHitDetectionImage(){return me()}getPixelRatio(e){return 1}getImageState(){return me()}getImageSize(){return me()}getOrigin(){return me()}getSize(){return me()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=ct(e)}listenImageChange(e){me()}load(){me()}unlistenImageChange(e){me()}ready(){return Promise.resolve()}}class Na extends Oa{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?re.LOADING:re.LOADED,this.imageState_===re.LOADING&&this.ready().then(()=>this.imageState_=re.LOADED),this.render()}clone(){const e=this.getScale(),n=new Na({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){const e=this.size_,n=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-n[0]/i[0],e[1]/2+n[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){const n=this.fill_?.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${n}`+Object.values(this.renderOptions_).join(",");let r=Dt.get(i,null)?.getImage(1);if(!r){const s=this.renderOptions_,a=Math.ceil(s.size*e),o=ve(a,a);this.draw_(s,o,e),r=o.canvas;const u=new Kd(r,void 0,null,re.LOADED,null);Dt.set(i,null,u),createImageBitmap(r).then(l=>{u.setImage(l)})}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,n,i){if(n===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return n;let r=this.radius,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const L=r;r=s,s=L}const a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,u=s*Math.sin(o),l=Math.sqrt(s*s-u*u),c=r-l,h=Math.sqrt(u*u+c*c),f=h/u;if(e==="miter"&&f<=i)return f*n;const g=n/2/f,m=n/2*(c/h),_=Math.sqrt((r+g)*(r+g)+m*m)-r;if(this.radius2_===void 0||e==="bevel")return _*2;const E=r*Math.sin(o),y=Math.sqrt(r*r-E*E),C=s-y,w=Math.sqrt(E*E+C*C)/E;if(w<=i){const L=w*n/2-s-r;return 2*Math.max(_,L)}return _*2}createRenderOptions(){let e=rr,n=sr,i=0,r=null,s=0,a,o=0;this.stroke_&&(a=Jt(this.stroke_.getColor()??ns),o=this.stroke_.getWidth()??rs,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,n=this.stroke_.getLineJoin()??sr,e=this.stroke_.getLineCap()??rr,i=this.stroke_.getMiterLimit()??ts);const u=this.calculateLineJoinSize_(n,o,i),l=Math.max(this.radius,this.radius2_||0),c=Math.ceil(2*l+u);return{strokeStyle:a,strokeWidth:o,size:c,lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:n,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,n,i){if(n.scale(i,i),n.translate(e.size/2,e.size/2),this.createPath_(n),this.fill_){let r=this.fill_.getColor();r===null&&(r=ut),n.fillStyle=Jt(r),n.fill()}e.strokeStyle&&(n.strokeStyle=e.strokeStyle,n.lineWidth=e.strokeWidth,e.lineDash&&(n.setLineDash(e.lineDash),n.lineDashOffset=e.lineDashOffset),n.lineCap=e.lineCap,n.lineJoin=e.lineJoin,n.miterLimit=e.miterLimit,n.stroke())}createHitDetectionCanvas_(e){let n;if(this.fill_){let i=this.fill_.getColor(),r=0;typeof i=="string"&&(i=Ei(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0&&(n=ve(e.size,e.size),this.drawHitDetectionCanvas_(e,n))}return n?n.canvas:this.getImage(1)}createPath_(e){let n=this.points_;const i=this.radius;if(n===1/0)e.arc(0,0,i,0,2*Math.PI);else{const r=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(n*=2);const s=this.angle_-Math.PI/2,a=2*Math.PI/n;for(let o=0;o<n;o++){const u=s+o*a,l=o%2===0?i:r;e.lineTo(l*Math.cos(u),l*Math.sin(u))}e.closePath()}}drawHitDetectionCanvas_(e,n){n.translate(e.size/2,e.size/2),this.createPath_(n),n.fillStyle=ut,n.fill(),e.strokeStyle&&(n.strokeStyle=e.strokeStyle,n.lineWidth=e.strokeWidth,e.lineDash&&(n.setLineDash(e.lineDash),n.lineDashOffset=e.lineDashOffset),n.lineJoin=e.lineJoin,n.miterLimit=e.miterLimit,n.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class Es extends Na{constructor(e){e=e||{radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode})}clone(){const e=this.getScale(),n=new Es({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}}class bi{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){const e=this.getColor();return new bi({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){if(e!==null&&typeof e=="object"&&"src"in e){const n=Hr(null,e.src,{crossOrigin:"anonymous"},void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));n.ready().then(()=>{this.patternImage_=null}),n.getImageState()===re.IDLE&&n.load(),n.getImageState()===re.LOADING&&(this.patternImage_=n)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?_e(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:Ei(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function gc(t,e,n,i){return n!==void 0&&i!==void 0?[n/t,i/e]:n!==void 0?n/t:i!==void 0?i/e:1}class Da extends Oa{constructor(e){e=e||{};const n=e.opacity!==void 0?e.opacity:1,i=e.rotation!==void 0?e.rotation:0,r=e.scale!==void 0?e.scale:1,s=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:n,rotation:i,scale:r,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:s,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null,this.referrerPolicy_=e.referrerPolicy;const a=e.img!==void 0?e.img:null;let o=e.src;be(!(o!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(o===void 0||o.length===0)&&a&&(o=a.src||_e(a)),be(o!==void 0&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),be(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let u;if(e.src!==void 0?u=re.IDLE:a!==void 0&&("complete"in a?a.complete?u=a.src?re.LOADED:re.IDLE:u=re.LOADING:u=re.LOADED),this.color_=e.color!==void 0?Ei(e.color):null,this.iconImage_=Hr(a,o,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},u,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,this.initialOptions_,e.width!==void 0||e.height!==void 0){let l,c;if(e.size)[l,c]=e.size;else{const h=this.getImage(1);if(h.width&&h.height)l=h.width,c=h.height;else if(h instanceof HTMLImageElement){this.initialOptions_=e;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(gc(g[0],g[1],e.width,e.height))};this.listenImageChange(f);return}}l!==void 0&&this.setScale(gc(l,c,e.width,e.height))}}clone(){let e,n,i;return this.initialOptions_?(n=this.initialOptions_.width,i=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new Da({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:e,width:n,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=r[0]),this.anchorYUnits_=="fraction"&&(e[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+r[1])}this.normalizedAnchor_=e}const n=this.getDisplacement(),i=this.getScaleArray();return[e[0]-n[0]/i[0],e[1]+n[1]/i[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}setColor(e){const n=e?Ei(e):null;if(this.color_===n||this.color_&&n&&this.color_.length===n.length&&this.color_.every((a,o)=>a===n[o]))return;this.color_=n;const i=this.getSrc(),r=i!==void 0?null:this.getHitDetectionImage(),s=i!==void 0?re.IDLE:this.iconImage_.getImageState();this.iconImage_=Hr(r,i,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},s,this.color_)}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){const n=this.getSize(),i=this.iconImage_.getSize();if(!n||!i)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=i[0]-n[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=i[1]-n[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(e){this.iconImage_=Hr(null,e,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},re.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==re.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){const e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==re.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(ue.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(ue.CHANGE,e)}ready(){return this.iconImage_.ready()}}class Ts{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.offset_=e.offset,this.width_=e.width}clone(){const e=this.getColor();return new Ts({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),offset:this.getOffset(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getOffset(){return this.offset_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setOffset(e){this.offset_=e}setWidth(e){this.width_=e}}class Xn{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=mc,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Xn({geometry:e??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(n){return n.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=mc,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function d1(t){let e;if(typeof t=="function")e=t;else{let n;Array.isArray(t)?n=t:(be(typeof t.getZIndex=="function","Expected an `Style` or an array of `Style`"),n=[t]),e=function(){return n}}return e}let Eo=null;function Qd(t,e){if(!Eo){const n=new bi({color:"rgba(255,255,255,0.4)"}),i=new Ts({color:"#3399CC",width:1.25});Eo=[new Xn({image:new Es({fill:n,stroke:i,radius:5}),fill:n,stroke:i})]}return Eo}function mc(t){return t.getGeometry()}const f1="#333";class el{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=ct(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new bi({color:f1}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new el({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof bi?this.getFill().clone():this.getFill(),stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=ct(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}function g1(t){return!0}function m1(t){const e=Wd(),n=p1(t,e),i=Vd();return function(r,s){if(i.properties=r.getPropertiesInternal(),i.resolution=s,e.featureId){const a=r.getId();a!==void 0?i.featureId=a:i.featureId=null}return e.geometryType&&(i.geometryType=Xd(r.getGeometry())),n(i)}}function pc(t){const e=Wd(),n=t.length,i=new Array(n);for(let a=0;a<n;++a)i[a]=su(t[a],e);const r=Vd(),s=new Array(n);return function(a,o){if(r.properties=a.getPropertiesInternal(),r.resolution=o,e.featureId){const l=a.getId();l!==void 0?r.featureId=l:r.featureId=null}let u=0;for(let l=0;l<n;++l){const c=i[l](r);c&&(s[u]=c,u+=1)}return s.length=u,s}}function p1(t,e){const n=t.length,i=new Array(n);for(let r=0;r<n;++r){const s=t[r],a="filter"in s?en(s.filter,et,e):g1;let o;if(Array.isArray(s.style)){const u=s.style.length;o=new Array(u);for(let l=0;l<u;++l)o[l]=su(s.style[l],e)}else o=[su(s.style,e)];i[r]={filter:a,styles:o}}return function(r){const s=[];let a=!1;for(let o=0;o<n;++o){const u=i[o].filter;if(u(r)&&!(t[o].else&&a)){a=!0;for(const l of i[o].styles){const c=l(r);c&&s.push(c)}}}return s}}function su(t,e){const n=ss(t,"",e),i=as(t,"",e),r=_1(t,e),s=E1(t,e),a=We(t,"z-index",e);if(!n&&!i&&!r&&!s&&!tr(t))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(t));const o=new Xn;return function(u){let l=!0;if(n){const c=n(u);c&&(l=!1),o.setFill(c)}if(i){const c=i(u);c&&(l=!1),o.setStroke(c)}if(r){const c=r(u);c&&(l=!1),o.setText(c)}if(s){const c=s(u);c&&(l=!1),o.setImage(c)}return a&&o.setZIndex(a(u)),l?null:o}}function ss(t,e,n){let i;if(e+"fill-pattern-src"in t)i=x1(t,e+"fill-",n);else{if(t[e+"fill-color"]==="none")return s=>null;i=Pa(t,e+"fill-color",n)}if(!i)return null;const r=new bi;return function(s){const a=i(s);return a===$u?null:(r.setColor(a),r)}}function as(t,e,n){const i=We(t,e+"stroke-width",n),r=Pa(t,e+"stroke-color",n);if(!i&&!r)return null;const s=gn(t,e+"stroke-line-cap",n),a=gn(t,e+"stroke-line-join",n),o=Jd(t,e+"stroke-line-dash",n),u=We(t,e+"stroke-line-dash-offset",n),l=We(t,e+"stroke-miter-limit",n),c=We(t,e+"stroke-offset",n),h=new Ts;return function(f){if(r){const g=r(f);if(g===$u)return null;h.setColor(g)}if(i&&h.setWidth(i(f)),s){const g=s(f);if(g!=="butt"&&g!=="round"&&g!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(g)}if(a){const g=a(f);if(g!=="bevel"&&g!=="round"&&g!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(g)}return o&&h.setLineDash(o(f)),u&&h.setLineDashOffset(u(f)),l&&h.setMiterLimit(l(f)),c&&h.setOffset(c(f)),h}}function _1(t,e){const n="text-",i=gn(t,n+"value",e);if(!i)return null;const r=ss(t,n,e),s=ss(t,n+"background-",e),a=as(t,n,e),o=as(t,n+"background-",e),u=gn(t,n+"font",e),l=We(t,n+"max-angle",e),c=We(t,n+"offset-x",e),h=We(t,n+"offset-y",e),f=$i(t,n+"overflow",e),g=gn(t,n+"placement",e),m=We(t,n+"repeat",e),p=Ma(t,n+"scale",e),_=$i(t,n+"rotate-with-view",e),E=We(t,n+"rotation",e),y=gn(t,n+"align",e),C=gn(t,n+"justify",e),S=gn(t,n+"baseline",e),w=$i(t,n+"keep-upright",e),L=Jd(t,n+"padding",e),B=va(t,n+"declutter-mode"),v=new el({declutterMode:B});return function(N){if(v.setText(i(N)),r&&v.setFill(r(N)),s&&v.setBackgroundFill(s(N)),a&&v.setStroke(a(N)),o&&v.setBackgroundStroke(o(N)),u&&v.setFont(u(N)),l&&v.setMaxAngle(l(N)),c&&v.setOffsetX(c(N)),h&&v.setOffsetY(h(N)),f&&v.setOverflow(f(N)),g){const R=g(N);if(R!=="point"&&R!=="line")throw new Error("Expected point or line for text-placement");v.setPlacement(R)}if(m&&v.setRepeat(m(N)),p&&v.setScale(p(N)),_&&v.setRotateWithView(_(N)),E&&v.setRotation(E(N)),y){const R=y(N);if(R!=="left"&&R!=="center"&&R!=="right"&&R!=="end"&&R!=="start")throw new Error("Expected left, right, center, start, or end for text-align");v.setTextAlign(R)}if(C){const R=C(N);if(R!=="left"&&R!=="right"&&R!=="center")throw new Error("Expected left, right, or center for text-justify");v.setJustify(R)}if(S){const R=S(N);if(R!=="bottom"&&R!=="top"&&R!=="middle"&&R!=="alphabetic"&&R!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");v.setTextBaseline(R)}return L&&v.setPadding(L(N)),w&&v.setKeepUpright(w(N)),v}}function E1(t,e){return"icon-src"in t?T1(t,e):"shape-points"in t?b1(t,e):"circle-radius"in t?y1(t,e):null}function T1(t,e){const n="icon-",i=n+"src",r=ef(t[i],i),s=ua(t,n+"anchor",e),a=Ma(t,n+"scale",e),o=We(t,n+"opacity",e),u=ua(t,n+"displacement",e),l=We(t,n+"rotation",e),c=$i(t,n+"rotate-with-view",e),h=Ec(t,n+"anchor-origin"),f=Tc(t,n+"anchor-x-units"),g=Tc(t,n+"anchor-y-units"),m=yn(t,n+"color");let p,_=null;m!==void 0&&(Array.isArray(m)&&m.length>0&&typeof m[0]=="string"?_=Pa(t,n+"color",e):p=tf(m,n+"color"));const E=A1(t,n+"cross-origin"),y=I1(t,n+"offset"),C=Ec(t,n+"offset-origin"),S=au(t,n+"width"),w=au(t,n+"height"),L=C1(t,n+"size"),B=va(t,n+"declutter-mode"),v={src:r,anchorOrigin:h,anchorXUnits:f,anchorYUnits:g,crossOrigin:E,offset:y,offsetOrigin:C,height:w,width:S,size:L,declutterMode:B};let N=null;return function(R){if(N)_&&N.setColor(_(R));else{const H=_?_(R):p;N=new Da(H!==void 0?Object.assign({},v,{color:H}):Object.assign({},v))}return o&&N.setOpacity(o(R)),u&&N.setDisplacement(u(R)),l&&N.setRotation(l(R)),c&&N.setRotateWithView(c(R)),a&&N.setScale(a(R)),s&&N.setAnchor(s(R)),N}}function b1(t,e){const n="shape-",i=n+"points",r=n+"radius",s=tl(t[i],i);if(!(r in t))throw new Error(`Expected a number for ${r}`);const a=We(t,r,e),o=typeof t[r]=="number"?t[r]:5,u=n+"radius2",l=We(t,u,e),c=typeof t[u]=="number"?t[u]:void 0,h=ss(t,n,e),f=as(t,n,e),g=Ma(t,n+"scale",e),m=ua(t,n+"displacement",e),p=We(t,n+"rotation",e),_=$i(t,n+"rotate-with-view",e),E=au(t,n+"angle"),y=va(t,n+"declutter-mode"),C=new Na({points:s,radius:o,radius2:c,angle:E,declutterMode:y});return function(S){return a&&C.setRadius(a(S)),l&&C.setRadius2(l(S)),h&&C.setFill(h(S)),f&&C.setStroke(f(S)),m&&C.setDisplacement(m(S)),p&&C.setRotation(p(S)),_&&C.setRotateWithView(_(S)),g&&C.setScale(g(S)),C}}function y1(t,e){const n="circle-",i=ss(t,n,e),r=as(t,n,e),s=We(t,n+"radius",e),a=Ma(t,n+"scale",e),o=ua(t,n+"displacement",e),u=We(t,n+"rotation",e),l=$i(t,n+"rotate-with-view",e),c=va(t,n+"declutter-mode"),h=new Es({radius:5,declutterMode:c});return function(f){return s&&h.setRadius(s(f)),i&&h.setFill(i(f)),r&&h.setStroke(r(f)),o&&h.setDisplacement(o(f)),u&&h.setRotation(u(f)),l&&h.setRotateWithView(l(f)),a&&h.setScale(a(f)),h}}function yn(t,e){if(!(e in t))return;const n=t[e];return n===void 0?void 0:n}function We(t,e,n){const i=yn(t,e);if(i===void 0)return;const r=en(i,de,n);return function(s){return tl(r(s),e)}}function gn(t,e,n){const i=yn(t,e);if(i===void 0)return null;const r=en(i,ot,n);return function(s){return ef(r(s),e)}}function x1(t,e,n){const i=gn(t,e+"pattern-src",n),r=_c(t,e+"pattern-offset",n),s=_c(t,e+"pattern-size",n),a=Pa(t,e+"color",n);return function(o){return{src:i(o),offset:r&&r(o),size:s&&s(o),color:a&&a(o)}}}function $i(t,e,n){const i=yn(t,e);if(i===void 0)return null;const r=en(i,et,n);return function(s){const a=r(s);if(typeof a!="boolean")throw new Error(`Expected a boolean for ${e}`);return a}}function Pa(t,e,n){const i=yn(t,e);if(i===void 0)return null;const r=en(i,Ut,n);return function(s){return tf(r(s),e)}}function Jd(t,e,n){const i=yn(t,e);if(i===void 0)return null;if(Array.isArray(i)&&(i.length===0||typeof i[0]!="string")){const s=i.map((a,o)=>{if(typeof a=="number")return()=>a;const u=en(a,de,n);return function(l){return tl(u(l),`${e}[${o}]`)}});return function(a){const o=new Array(s.length);for(let u=0;u<s.length;++u)o[u]=s[u](a);return o}}const r=en(i,Ti,n);return function(s){return bs(r(s),e)}}function ua(t,e,n){const i=yn(t,e);if(i===void 0)return null;const r=en(i,Ti,n);return function(s){const a=bs(r(s),e);if(a.length!==2)throw new Error(`Expected two numbers for ${e}`);return a}}function _c(t,e,n){const i=yn(t,e);if(i===void 0)return null;const r=en(i,Ti,n);return function(s){return nf(r(s),e)}}function Ma(t,e,n){const i=yn(t,e);if(i===void 0)return null;const r=en(i,Ti|de,n);return function(s){return S1(r(s),e)}}function au(t,e){const n=t[e];if(n!==void 0){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}}function C1(t,e){const n=t[e];if(n!==void 0){if(typeof n=="number")return ct(n);if(!Array.isArray(n))throw new Error(`Expected a number or size array for ${e}`);if(n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")throw new Error(`Expected a number or size array for ${e}`);return n}}function A1(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}}function Ec(t,e){const n=t[e];if(n!==void 0){if(n!=="bottom-left"&&n!=="bottom-right"&&n!=="top-left"&&n!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return n}}function Tc(t,e){const n=t[e];if(n!==void 0){if(n!=="pixels"&&n!=="fraction")throw new Error(`Expected pixels or fraction for ${e}`);return n}}function I1(t,e){const n=t[e];if(n!==void 0)return bs(n,e)}function va(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);if(n!=="declutter"&&n!=="obstacle"&&n!=="none")throw new Error(`Expected declutter, obstacle, or none for ${e}`);return n}}function bs(t,e){if(!Array.isArray(t))throw new Error(`Expected an array for ${e}`);const n=t.length;for(let i=0;i<n;++i)if(typeof t[i]!="number")throw new Error(`Expected an array of numbers for ${e}`);return t}function ef(t,e){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);return t}function tl(t,e){if(typeof t!="number")throw new Error(`Expected a number for ${e}`);return t}function tf(t,e){if(typeof t=="string")return t;const n=bs(t,e),i=n.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return n}function nf(t,e){const n=bs(t,e);if(n.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return n}function S1(t,e){return typeof t=="number"?t:nf(t,e)}const bc={RENDER_ORDER:"renderOrder"};class rf extends ka{constructor(e){e=e||{};const n=Object.assign({},e);delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,super(n),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(bc.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,n){const i=this.getDeclutter();i in e.declutter||(e.declutter[i]=new Gd(9)),this.getRenderer().renderDeclutter(e,n)}setRenderOrder(e){this.set(bc.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?Qd:e;const n=R1(e);this.styleFunction_=e===null?void 0:d1(n),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function R1(t){if(t===void 0)return Qd;if(!t)return null;if(typeof t=="function"||t instanceof Xn)return t;if(!Array.isArray(t))return pc([t]);if(t.length===0)return[];const e=t.length,n=t[0];if(n instanceof Xn){const r=new Array(e);for(let s=0;s<e;++s){const a=t[s];if(!(a instanceof Xn))throw new Error("Expected a list of style instances");r[s]=a}return r}if("style"in n){const r=new Array(e);for(let s=0;s<e;++s){const a=t[s];if(!("style"in a))throw new Error("Expected a list of rules with a style property");r[s]=a}return m1(r)}return pc(t)}class sf extends bn{constructor(e,n,i,r){super(e),this.inversePixelTransform=n,this.frameState=i,this.context=r}}class L1 extends _a{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,n){me()}calculateMatrices2D(e){const n=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Tn(i,e.size[0]/2,e.size[1]/2,1/n.resolution,-1/n.resolution,-n.rotation,-n.center[0],-n.center[1]),Sd(r,i)}forEachFeatureAtCoordinate(e,n,i,r,s,a,o,u){let l;const c=n.viewState;function h(S,w,L,B){return s.call(a,w,S?L:null,B)}const f=c.projection,g=pd(e.slice(),f),m=[[0,0]];if(f.canWrapX()&&r){const S=f.getExtent(),w=xe(S);m.push([-w,0],[w,0])}const p=n.layerStatesArray,_=p.length,E=[],y=[];for(let S=0;S<m.length;S++)for(let w=_-1;w>=0;--w){const L=p[w],B=L.layer;if(B.hasRenderer()&&qu(L,c)&&o.call(u,B)){const v=B.getRenderer(),N=B.getSource();if(v&&N){const R=N.getWrapX()?g:e,H=h.bind(null,L.managed);y[0]=R[0]+m[S][0],y[1]=R[1]+m[S][1],l=v.forEachFeatureAtCoordinate(y,n,i,H,E)}if(l)return l}}if(E.length===0)return;const C=1/E.length;return E.forEach((S,w)=>S.distanceSq+=w*C),E.sort((S,w)=>S.distanceSq-w.distanceSq),E.some(S=>l=S.callback(S.feature,S.layer,S.geometry)),l}hasFeatureAtCoordinate(e,n,i,r,s,a){return this.forEachFeatureAtCoordinate(e,n,i,r,qr,this,s,a)!==void 0}getMap(){return this.map_}renderFrame(e){me()}scheduleExpireIconCache(e){Dt.canExpireCache()&&e.postRenderFunctions.push(w1)}}function w1(t,e){Dt.expire()}class k1 extends L1{constructor(e){super(e),this.fontChangeListenerKey_=pe(zi,er.PROPERTYCHANGE,e.redrawText,e),this.element_=Ot?vd():document.createElement("div");const n=this.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",this.element_.className=La+" ol-layers";const i=e.getViewport();i&&i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,n){const i=this.getMap();if(i.hasListener(e)){const r=new sf(e,void 0,n);i.dispatchEvent(r)}}disposeInternal(){we(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Nt.PRECOMPOSE,e);const n=e.layerStatesArray.sort((l,c)=>l.zIndex-c.zIndex);n.some(l=>l.layer instanceof rf&&l.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let a=null;for(let l=0,c=n.length;l<c;++l){const h=n[l];e.layerIndex=l;const f=h.layer,g=f.getSourceState();if(!qu(h,r)||g!="ready"&&g!="undefined"){f.unrender();continue}const m=f.render(e,a);m&&(m!==a&&(this.children_.push(m),a=m),s.push(h))}this.declutter(e,s),Hp(this.element_,this.children_);const u=this.getMap().getTargetElement();if(Hn(u)){const l=u.getContext("2d");for(const c of this.children_){const h=c.firstElementChild||c,f=c.style.backgroundColor;if(f&&(!Hn(h)||h.width>0)&&(l.fillStyle=f,l.fillRect(0,0,u.width,u.height)),Hn(h)&&h.width>0){l.save();const g=c.style.opacity||h.style.opacity;l.globalAlpha=g===""?1:Number(g);const m=h.style.transform;if(m)l.transform(...eu(m));else{const p=parseFloat(h.style.width)/h.width,_=parseFloat(h.style.height)/h.height;l.transform(p,0,0,_,0,0)}l.drawImage(h,0,0),l.restore()}}}this.dispatchRenderEvent(Nt.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}declutter(e,n){if(e.declutter){for(let i=n.length-1;i>=0;--i){const r=n[i],s=r.layer;s.getDeclutter()&&s.renderDeclutter(e,r)}n.forEach(i=>i.layer.renderDeferred(e))}}}function af(t){if(t instanceof ka){t.setMapInternal(null);return}t instanceof lr&&t.getLayers().forEach(af)}function of(t,e){if(t instanceof ka){t.setMapInternal(e);return}if(t instanceof lr){const n=t.getLayers().getArray();for(let i=0,r=n.length;i<r;++i)of(n[i],e)}}let O1=class extends tn{constructor(e){super(),e=e||{},this.on,this.once,this.un;const n=N1(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:lm,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Ht(),this.pixelToCoordinateTransform_=Ht(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,Ot||(this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=n.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,Ot||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=n.controls||(Ot?new kt:jp()),this.interactions=n.interactions||(Ot?new kt:d_({onFocusOnly:!0})),this.overlays_=n.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new dm(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Ve.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Ve.VIEW,this.handleViewChanged_),this.addChangeListener(Ve.SIZE,this.handleSizeChanged_),this.addChangeListener(Ve.TARGET,this.handleTargetChanged_),this.setProperties(n.values);const i=this;e.view&&!(e.view instanceof Zt)&&e.view.then(function(r){i.setView(new Zt(r))}),this.controls.addEventListener(at.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(at.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(at.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(at.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(at.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(at.REMOVE,r=>{const s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){of(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const n=e.getId();n!==void 0&&(this.overlayIdIndex_[n.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,n,i){if(!this.frameState_||!this.renderer_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,a=i.layerFilter!==void 0?i.layerFilter:qr,o=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,o,n,null,a,null)}getFeaturesAtPixel(e,n){const i=[];return this.forEachFeatureAtPixel(e,function(r){i.push(r)},n),i}getAllLayers(){const e=[];function n(i){i.forEach(function(r){r instanceof lr?n(r.getLayers()):e.push(r)})}return n(this.getLayers()),e}hasFeatureAtPixel(e,n){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(e);n=n!==void 0?n:{};const r=n.layerFilter!==void 0?n.layerFilter:qr,s=n.hitTolerance!==void 0?n.hitTolerance:0,a=n.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,a,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],a=i.height/r[1],o="changedTouches"in e?e.changedTouches[0]:e;return[(o.clientX-i.left)/s,(o.clientY-i.top)/a]}getTarget(){return this.get(Ve.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Jo(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const n=this.frameState_;return n?Ye(n.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const n=this.overlayIdIndex_[e.toString()];return n!==void 0?n:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Ve.LAYERGROUP)}setLayers(e){const n=this.getLayerGroup();if(e instanceof kt){n.setLayers(e);return}const i=n.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let n=0,i=e.length;n<i;++n){const r=e[n];if(!r.visible)continue;const s=r.layer.getRenderer();if(s&&!s.ready)return!0;const a=r.layer.getSource();if(a&&a.loading)return!0}return!1}getPixelFromCoordinate(e){const n=dn(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(n)}getPixelFromCoordinateInternal(e){const n=this.frameState_;return n?Ye(n.coordinateToPixelTransform,e.slice(0,2)):null}getPixelRatio(){return this.pixelRatio_}setPixelRatio(e){this.pixelRatio_!==e&&(this.pixelRatio_=e,this.render())}getRenderer(){return this.renderer_}getSize(){return this.get(Ve.SIZE)}getView(){return this.get(Ve.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,n,i,r){return fm(this.frameState_,e,n,i,r)}handleBrowserEvent(e,n){n=n||e.type;const i=new Dn(n,this,e);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(e){if(!this.frameState_)return;const n=e.originalEvent,i=n.type;if(i===Wo.POINTERDOWN||i===ue.WHEEL||i===ue.KEYDOWN){const r=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():r,a=n.target,o=s instanceof ShadowRoot?s.host===a?s.host.ownerDocument:s:s===r?r.documentElement:s;if(this.overlayContainerStopEvent_.contains(a)||!o.contains(a))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const r=this.getInteractions().getArray().slice();for(let s=r.length-1;s>=0;s--){const a=r[s];if(a.getMap()!==this||!a.getActive()||!this.getTargetElement())continue;if(!a.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,n=this.tileQueue_;if(!n.isEmpty()){let r=this.maxTilesLoading_,s=r;if(e){const a=e.viewHints;if(a[Ke.ANIMATING]||a[Ke.INTERACTING]){const o=Date.now()-e.time>8;r=o?0:8,s=o?0:2}}n.getTilesLoading()<r&&(n.reprioritize(),n.loadMoreTiles(r,s))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Nt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Nt.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Ui(Pn.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Ui(Pn.LOADSTART,this,e))));const i=this.postRenderFunctions_;if(e)for(let r=0,s=i.length;r<s;++r)i[r](this,e);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let i=0,r=this.targetChangeHandlerKeys_.length;i<r;++i)we(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(ue.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ue.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!Hn(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.host),this.setSize(void 0)}const e=this.getTarget(),n=typeof e=="string"?document.getElementById(e):e;if(this.targetElement_=n,!n)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{if(Hn(n)||n.appendChild(this.viewport_),this.renderer_||(this.renderer_=new k1(this)),!Hn(n)){this.mapBrowserEventHandler_=new cm(this,this.moveTolerance_);for(const r in Ne)this.mapBrowserEventHandler_.addEventListener(Ne[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(ue.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(ue.WHEEL,this.boundHandleBrowserEvent_,ad?{passive:!1}:!1);let i;if(this.keyboardEventTarget_)i=this.keyboardEventTarget_;else{const r=n.getRootNode();i=r instanceof ShadowRoot?r.host:n}if(this.targetChangeHandlerKeys_=[pe(i,ue.KEYDOWN,this.handleBrowserEvent,this),pe(i,ue.KEYPRESS,this.handleBrowserEvent,this)],n instanceof HTMLElement){const r=n.getRootNode();r instanceof ShadowRoot&&this.resizeObserver_.observe(r.host),this.resizeObserver_?.observe(n)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(we(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(we(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=pe(e,er.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=pe(e,ue.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(we),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new Fn("addlayer",e)),this.layerGroupPropertyListenerKeys_=[pe(e,er.PROPERTYCHANGE,this.render,this),pe(e,ue.CHANGE,this.render,this),pe(e,"addlayer",this.handleLayerAdd_,this),pe(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;const e=this.frameState_.layerStatesArray;for(let n=0,i=e.length;n<i;++n){const r=e[n].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){af(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const n=this.getSize(),i=this.getView(),r=this.frameState_;let s=null;if(n!==void 0&&uc(n)&&i&&i.isDef()){const a=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),o=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:qo(o.center,o.resolution,o.rotation,n),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:o,viewHints:a,wantedTiles:{},mapId:_e(this),renderTargets:{}},o.nextCenter&&o.nextResolution){const u=isNaN(o.nextRotation)?o.rotation:o.nextRotation;s.nextExtent=qo(o.nextCenter,o.nextResolution,u,n)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),r&&(!this.previousExtent_||!gs(this.previousExtent_)&&!Zr(s.extent,this.previousExtent_))&&(this.dispatchEvent(new Ui(Pn.MOVESTART,this,r)),this.previousExtent_=ya(this.previousExtent_)),this.previousExtent_&&!s.viewHints[Ke.ANIMATING]&&!s.viewHints[Ke.INTERACTING]&&!Zr(s.extent,this.previousExtent_)&&(this.dispatchEvent(new Ui(Pn.MOVEEND,this,s)),od(s.extent,this.previousExtent_))),this.dispatchEvent(new Ui(Pn.POSTRENDER,this,s)),this.renderComplete_=(this.hasListener(Pn.LOADSTART)||this.hasListener(Pn.LOADEND)||this.hasListener(Nt.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const n=this.getLayerGroup();n&&this.handleLayerRemove_(new Fn("removelayer",n)),this.set(Ve.LAYERGROUP,e)}setSize(e){this.set(Ve.SIZE,e)}setTarget(e){this.set(Ve.TARGET,e)}setView(e){if(!e||e instanceof Zt){this.set(Ve.VIEW,e);return}this.set(Ve.VIEW,new Zt);const n=this;e.then(function(i){n.setView(new Zt(i))})}updateSize(){const e=this.getTargetElement();let n;if(e){let r,s;if(Hn(e)){const a=e.getContext("2d").getTransform();r=e.width/a.a,s=e.height/a.d}else{const a=getComputedStyle(e);r=e.offsetWidth-parseFloat(a.borderLeftWidth)-parseFloat(a.paddingLeft)-parseFloat(a.paddingRight)-parseFloat(a.borderRightWidth),s=e.offsetHeight-parseFloat(a.borderTopWidth)-parseFloat(a.paddingTop)-parseFloat(a.paddingBottom)-parseFloat(a.borderBottomWidth)}!isNaN(r)&&!isNaN(s)&&(n=[Math.max(0,r),Math.max(0,s)],!uc(n)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&Ed("No map visible because the map container's width or height are 0."))}const i=this.getSize();n&&(!i||!qn(n,i))&&(this.setSize(n),this.updateViewportSize_(n))}updateViewportSize_(e){const n=this.getView();n&&n.setViewportSize(e)}};function N1(t){let e=null;t.keyboardEventTarget!==void 0&&(e=typeof t.keyboardEventTarget=="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);const n={},i=t.layers&&typeof t.layers.getLayers=="function"?t.layers:new lr({layers:t.layers});n[Ve.LAYERGROUP]=i,n[Ve.TARGET]=t.target,n[Ve.VIEW]=t.view instanceof Zt?t.view:new Zt;let r;t.controls!==void 0&&(Array.isArray(t.controls)?r=new kt(t.controls.slice()):(be(typeof t.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=t.controls));let s;t.interactions!==void 0&&(Array.isArray(t.interactions)?s=new kt(t.interactions.slice()):(be(typeof t.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=t.interactions));let a;return t.overlays!==void 0?Array.isArray(t.overlays)?a=new kt(t.overlays.slice()):(be(typeof t.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),a=t.overlays):a=new kt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:a,values:n}}class nl extends Ta{constructor(e,n,i){super(),i=i||{},this.tileCoord=e,this.state=n,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(ue.CHANGE)}release(){this.setState(J.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==J.EMPTY){if(this.state!==J.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}}load(){me()}getAlpha(e,n){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=n,this.transitionStarts_[e]=i;else if(i===-1)return 1;const r=n-i+1e3/60;return r>=this.transition_?1:_d(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}function ou(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}const D1=new Error("disposed"),P1=[256,256];class yc extends nl{constructor(e){const n=J.IDLE;super(e.tileCoord,n,{transition:e.transition,interpolate:e.interpolate}),this.loader_=e.loader,this.data_=null,this.error_=null,this.size_=e.size||null,this.controller_=e.controller||null}getSize(){if(this.size_)return this.size_;const e=ou(this.data_);return e?[e.width,e.height]:P1}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==J.IDLE&&this.state!==J.ERROR)return;this.state=J.LOADING,this.changed();const e=this;this.loader_().then(function(n){e.data_=n,e.state=J.LOADED,e.changed()}).catch(function(n){e.error_=n,e.state=J.ERROR,e.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(D1),this.controller_=null),super.disposeInternal()}}class uf extends nl{constructor(e,n,i,r,s,a){super(e,n,a),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=i,this.key=i,this.image_,Ot?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=J.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=J.ERROR,this.unlistenImage_(),this.image_=M1(),this.changed()}handleImageLoad_(){if(Ot)this.state=J.LOADED;else{const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=J.LOADED:this.state=J.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==J.ERROR&&(this.state=J.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==J.IDLE&&(this.state=J.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=J_(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function M1(){const t=ve(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}class il{constructor(e,n,i,r){this.minX=e,this.maxX=n,this.minY=i,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function Pi(t,e,n,i,r){return r!==void 0?(r.minX=t,r.maxX=e,r.minY=n,r.maxY=i,r):new il(t,e,n,i)}let To;const Zi=[];function xc(t,e,n,i,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,r)),t.restore()}function bo(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function v1(){if(To===void 0){const t=ve(6,6,Zi);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",xc(t,4,5,4,0),xc(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;To=bo(e,0)||bo(e,4)||bo(e,8),wa(t),Zi.push(t.canvas)}return To}function Cc(t,e,n,i){const r=vu(n,e,t);let s=Xl(e,i,n);const a=e.getMetersPerUnit();a!==void 0&&(s*=a);const o=t.getMetersPerUnit();o!==void 0&&(s/=o);const u=t.getExtent();if(!u||nr(u,r)){const l=Xl(t,s,r)/s;isFinite(l)&&l>0&&(s/=l)}return s}function F1(t,e,n,i){const r=_i(n);let s=Cc(t,e,r,i);return(!isFinite(s)||s<=0)&&dd(n,function(a){return s=Cc(t,e,a,i),isFinite(s)&&s>0}),s}function B1(t,e,n,i,r,s,a,o,u,l,c,h,f,g){const m=ve(Math.round(n*t),Math.round(n*e),Zi);if(h||(m.imageSmoothingEnabled=!1),u.length===0)return m.canvas;m.scale(n,n);function p(w){return Math.round(w*n)/n}m.globalCompositeOperation="lighter";const _=vt();u.forEach(function(w,L,B){_m(_,w.extent)});let E;const y=n/i,C=(h?1:1+Math.pow(2,-24))/y;E=ve(Math.round(xe(_)*y),Math.round(nt(_)*y),Zi),h||(E.imageSmoothingEnabled=!1),u.forEach(function(w,L,B){if(w.image.width>0&&w.image.height>0){if(w.clipExtent){E.save();const U=(w.clipExtent[0]-_[0])*y,W=-(w.clipExtent[3]-_[3])*y,j=xe(w.clipExtent)*y,P=nt(w.clipExtent)*y;E.rect(h?U:Math.round(U),h?W:Math.round(W),h?j:Math.round(U+j)-Math.round(U),h?P:Math.round(W+P)-Math.round(W)),E.clip()}const v=(w.extent[0]-_[0])*y,N=-(w.extent[3]-_[3])*y,R=xe(w.extent)*y,H=nt(w.extent)*y;E.drawImage(w.image,l,l,w.image.width-2*l,w.image.height-2*l,h?v:Math.round(v),h?N:Math.round(N),h?R:Math.round(v+R)-Math.round(v),h?H:Math.round(N+H)-Math.round(N)),w.clipExtent&&E.restore()}});const S=Ci(a);return o.getTriangles().forEach(function(w,L,B){const v=w.source,N=w.target;let R=v[0][0],H=v[0][1],U=v[1][0],W=v[1][1],j=v[2][0],P=v[2][1];const K=p((N[0][0]-S[0])/s),q=p(-(N[0][1]-S[1])/s),$=p((N[1][0]-S[0])/s),Z=p(-(N[1][1]-S[1])/s),x=p((N[2][0]-S[0])/s),ie=p(-(N[2][1]-S[1])/s),se=R,I=H;R=0,H=0,U-=se,W-=I,j-=se,P-=I;const Ce=[[U,W,0,0,$-K],[j,P,0,0,x-K],[0,0,U,W,Z-q],[0,0,j,P,ie-q]],Y=mm(Ce);if(!Y)return;if(m.save(),m.beginPath(),v1()||!h){m.moveTo($,Z);const Re=4,Pe=K-$,je=q-Z;for(let Fe=0;Fe<Re;Fe++)m.lineTo($+p((Fe+1)*Pe/Re),Z+p(Fe*je/(Re-1))),Fe!=Re-1&&m.lineTo($+p((Fe+1)*Pe/Re),Z+p((Fe+1)*je/(Re-1)));m.lineTo(x,ie)}else m.moveTo($,Z),m.lineTo(K,q),m.lineTo(x,ie);m.clip(),m.transform(Y[0],Y[2],Y[1],Y[3],K,q),m.translate(_[0]-se,_[3]-I);let Te;if(E)Te=E.canvas,m.scale(C,-C);else{const Re=u[0],Pe=Re.extent;Te=Re.image,m.scale(xe(Pe)/Te.width,-nt(Pe)/Te.height)}m.drawImage(Te,0,0),m.restore()}),E&&(wa(E),Zi.push(E.canvas)),c&&(m.save(),m.globalCompositeOperation="source-over",m.strokeStyle="black",m.lineWidth=1,o.getTriangles().forEach(function(w,L,B){const v=w.target,N=(v[0][0]-S[0])/s,R=-(v[0][1]-S[1])/s,H=(v[1][0]-S[0])/s,U=-(v[1][1]-S[1])/s,W=(v[2][0]-S[0])/s,j=-(v[2][1]-S[1])/s;m.beginPath(),m.moveTo(H,U),m.lineTo(N,R),m.lineTo(W,j),m.closePath(),m.stroke()}),m.restore()),m.canvas}const U1=10,Ac=.25;class H1{constructor(e,n,i,r,s,a,o){this.sourceProj_=e,this.targetProj_=n;let u={};const l=o?tp(C=>Ye(o,vu(C,this.targetProj_,this.sourceProj_))):ra(this.targetProj_,this.sourceProj_);this.transformInv_=function(C){const S=C[0]+"/"+C[1];return u[S]||(u[S]=l(C)),u[S]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&xe(r)>=xe(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?xe(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?xe(this.targetProj_.getExtent()):null;const c=Ci(i),h=Aa(i),f=Ca(i),g=xa(i),m=this.transformInv_(c),p=this.transformInv_(h),_=this.transformInv_(f),E=this.transformInv_(g),y=U1+(a?Math.max(0,Math.ceil(Math.log2(Ko(i)/(a*a*256*256)))):0);if(this.addQuad_(c,h,f,g,m,p,_,E,y),this.wrapsXInSource_){let C=1/0;this.triangles_.forEach(function(S,w,L){C=Math.min(C,S.source[0][0],S.source[1][0],S.source[2][0])}),this.triangles_.forEach(S=>{if(Math.max(S.source[0][0],S.source[1][0],S.source[2][0])-C>this.sourceWorldWidth_/2){const w=[[S.source[0][0],S.source[0][1]],[S.source[1][0],S.source[1][1]],[S.source[2][0],S.source[2][1]]];w[0][0]-C>this.sourceWorldWidth_/2&&(w[0][0]-=this.sourceWorldWidth_),w[1][0]-C>this.sourceWorldWidth_/2&&(w[1][0]-=this.sourceWorldWidth_),w[2][0]-C>this.sourceWorldWidth_/2&&(w[2][0]-=this.sourceWorldWidth_);const L=Math.min(w[0][0],w[1][0],w[2][0]);Math.max(w[0][0],w[1][0],w[2][0])-L<this.sourceWorldWidth_/2&&(S.source=w)}})}u={}}addTriangle_(e,n,i,r,s,a){this.triangles_.push({source:[r,s,a],target:[e,n,i]})}addQuad_(e,n,i,r,s,a,o,u,l){const c=Fl([s,a,o,u]),h=this.sourceWorldWidth_?xe(c)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,g=this.sourceProj_.canWrapX()&&h>.5&&h<1;let m=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const _=Fl([e,n,i,r]);m=xe(_)/this.targetWorldWidth_>Ac||m}!g&&this.sourceProj_.isGlobal()&&h&&(m=h>Ac||m)}if(!m&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!lt(c,this.maxSourceExtent_))return;let p=0;if(!m&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(u[0])||!isFinite(u[1]))){if(l>0)m=!0;else if(p=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(u[0])||!isFinite(u[1])?1:0),p!=1&&p!=2&&p!=4&&p!=8)return}if(l>0){if(!m){const _=[(e[0]+i[0])/2,(e[1]+i[1])/2],E=this.transformInv_(_);let y;g?y=(Ki(s[0],f)+Ki(o[0],f))/2-Ki(E[0],f):y=(s[0]+o[0])/2-E[0];const C=(s[1]+o[1])/2-E[1];m=y*y+C*C>this.errorThresholdSquared_}if(m){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const _=[(n[0]+i[0])/2,(n[1]+i[1])/2],E=this.transformInv_(_),y=[(r[0]+e[0])/2,(r[1]+e[1])/2],C=this.transformInv_(y);this.addQuad_(e,n,_,y,s,a,E,C,l-1),this.addQuad_(y,_,i,r,C,E,o,u,l-1)}else{const _=[(e[0]+n[0])/2,(e[1]+n[1])/2],E=this.transformInv_(_),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],C=this.transformInv_(y);this.addQuad_(e,_,y,r,s,E,C,u,l-1),this.addQuad_(_,n,i,y,E,a,o,C,l-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(p&11)==0&&this.addTriangle_(e,i,r,s,o,u),(p&14)==0&&this.addTriangle_(e,i,n,s,o,a),p&&((p&13)==0&&this.addTriangle_(n,r,e,a,u,s),(p&7)==0&&this.addTriangle_(n,r,i,a,u,o))}calculateSourceExtent(){const e=vt();return this.triangles_.forEach(function(n,i,r){const s=n.source;Br(e,s[0]),Br(e,s[1]),Br(e,s[2])}),e}getTriangles(){return this.triangles_}}const z1=.5;class lf extends nl{constructor(e,n,i,r,s,a,o,u,l,c,h,f){super(s,J.IDLE,f),this.renderEdges_=h!==void 0?h:!1,this.pixelRatio_=o,this.gutter_=u,this.canvas_=null,this.sourceTileGrid_=n,this.targetTileGrid_=r,this.wrappedTileCoord_=a||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;const g=r.getTileCoordExtent(this.wrappedTileCoord_),m=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const _=m?gi(g,m):g;if(Ko(_)===0){this.state=J.EMPTY;return}const E=e.getExtent();E&&(p?p=gi(p,E):p=E);const y=r.getResolution(this.wrappedTileCoord_[0]),C=F1(e,i,_,y);if(!isFinite(C)||C<=0){this.state=J.EMPTY;return}const S=c!==void 0?c:z1;if(this.triangulation_=new H1(e,i,_,p,C*S,y),this.triangulation_.getTriangles().length===0){this.state=J.EMPTY;return}this.sourceZ_=n.getZForResolution(C);let w=this.triangulation_.calculateSourceExtent();if(p&&(e.canWrapX()?(w[1]=ke(w[1],p[1],p[3]),w[3]=ke(w[3],p[1],p[3])):w=gi(w,p)),!Ko(w))this.state=J.EMPTY;else{let L=0,B=0;e.canWrapX()&&(L=xe(E),B=Math.floor((w[0]-E[0])/L)),md(w.slice(),e,!0).forEach(N=>{const R=n.getTileRangeForExtentAndZ(N,this.sourceZ_);for(let H=R.minX;H<=R.maxX;H++)for(let U=R.minY;U<=R.maxY;U++){const W=B*L;this.sourceTiles_.push({getTile:()=>l(this.sourceZ_,H,U,o),offset:W})}++B}),this.sourceTiles_.length===0&&(this.state=J.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(n=>{const i=n.tile;if(i&&i.getState()==J.LOADED){const r=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);r[0]+=n.offset,r[2]+=n.offset;const s=this.clipExtent_?.slice();s&&(s[0]+=n.offset,s[2]+=n.offset),e.push({extent:r,clipExtent:s,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=J.ERROR;else{const n=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(n),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],a=this.targetTileGrid_.getResolution(n),o=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=B1(r,s,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,u,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=J.LOADED}this.changed()}load(){for(const e of this.sourceTiles_)e.tile=e.getTile();if(this.state==J.IDLE){this.state=J.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:n})=>{const i=n.getState();if(i==J.IDLE||i==J.LOADING){e++;const r=pe(n,ue.CHANGE,s=>{const a=n.getState();(a==J.LOADED||a==J.ERROR||a==J.EMPTY)&&(we(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:n},i,r){n.getState()==J.IDLE&&n.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(we),this.sourcesListenerKeys_=null}release(){this.canvas_&&(wa(this.canvas_.getContext("2d")),Zi.push(this.canvas_),this.canvas_=null),this.sourceTiles_.length=0,super.release()}}class Ic{constructor(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const e=this.pop();e instanceof _a&&e.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let n=this.oldest_;for(;n;)e(n.value_,n.key_,this),n=n.newer}get(e,n){const i=this.entries_[e];return be(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const n=this.entries_[e];return be(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let n=0,i;for(i=this.newest_;i;i=i.older)e[n++]=i.key_;return e}getValues(){const e=new Array(this.count_);let n=0,i;for(i=this.newest_;i;i=i.older)e[n++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){return this.entries_[e]?.value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,n){this.get(e),this.entries_[e].value_=n}set(e,n){be(!(e in this.entries_),"Tried to set a value for a key that is used already");const i={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}function la(t,e,n,i){return i!==void 0?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function Y1(t,e,n){return t+"/"+e+"/"+n}function Vs(t,e,n,i,r){return`${_e(t)},${e},${Y1(n,i,r)}`}function G1(t){return j1(t[0],t[1],t[2])}function j1(t,e,n){return(e<<t)+n}function W1(t,e){const n=t[0],i=t[1],r=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;const s=e.getFullTileRange(n);return s?s.containsXY(i,r):!0}class cf{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(aa(),{get:(e,n)=>{if(typeof aa()[n]=="function")return this.push_(n),this.pushMethodArgs_},set:(e,n,i)=>(this.push_(n,i),!0)})}push_(...e){const n=this.instructions_,i=this.zIndex+this.offset_;n[i]||(n[i]=[]),n[i].push(...e)}pushMethodArgs_=(...e)=>(this.push_(e),this);pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(n=>{for(let i=0,r=n.length;i<r;++i){const s=n[i];if(typeof s=="function"){s(e);continue}const a=n[++i];if(typeof e[s]=="function")e[s](...a);else{if(typeof a=="function"){e[s]=a(e);continue}e[s]=a}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const X1=5;class V1 extends fs{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=X1}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return me()}getData(e){return null}prepareFrame(e){return me()}renderFrame(e,n){return me()}forEachFeatureAtCoordinate(e,n,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const n=e.target;(n.getState()===re.LOADED||n.getState()===re.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let n=e.getState();return n!=re.LOADED&&n!=re.ERROR&&e.addEventListener(ue.CHANGE,this.boundHandleImageChange_),n==re.IDLE&&(e.load(),n=e.getState()),n==re.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const Sc=[];let Yi=null;function K1(){Yi=ve(1,1,void 0,{willReadFrequently:!0})}class hf extends V1{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Ht(),this.pixelTransform=Ht(),this.inversePixelTransform=Ht(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,n,i){Yi||K1(),Yi.clearRect(0,0,1,1);let r;try{Yi.drawImage(e,n,i,1,1,0,0,1,1),r=Yi.getImageData(0,0,1,1).data}catch{return Yi=null,null}return r}getBackground(e){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(e.viewState.resolution)),i||void 0}useContainer(e,n,i){const r=this.getLayer().getClassName();let s,a;if(e&&e.className===r&&(!i||e&&e.style.backgroundColor&&qn(Ei(e.style.backgroundColor),Ei(i)))){const o=e.firstElementChild;Hn(o)&&(a=o.getContext("2d"))}if(a&&up(a.canvas.style.transform,n)?(this.container=e,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=Ot?vd():document.createElement("div"),s.className=r;let o=s.style;o.position="absolute",o.width="100%",o.height="100%",a=ve();const u=a.canvas;s.appendChild(u),o=u.style,o.position="absolute",o.left="0",o.transformOrigin="top left",this.container=s,this.context=a}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(e,n,i){const r=Ci(i),s=Aa(i),a=Ca(i),o=xa(i);Ye(n.coordinateToPixelTransform,r),Ye(n.coordinateToPixelTransform,s),Ye(n.coordinateToPixelTransform,a),Ye(n.coordinateToPixelTransform,o);const u=this.inversePixelTransform;Ye(u,r),Ye(u,s),Ye(u,a),Ye(u,o),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(s[0]),Math.round(s[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.clip()}prepareContainer(e,n){const i=e.extent,r=e.viewState.resolution,s=e.viewState.rotation,a=e.pixelRatio,o=Math.round(xe(i)/r*a),u=Math.round(nt(i)/r*a);Tn(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/a,1/a,s,-o/2,-u/2),Sd(this.inversePixelTransform,this.pixelTransform);const l=op(this.pixelTransform);if(this.useContainer(n,l,this.getBackground(e)),!this.containerReused){const c=this.context.canvas;c.width!=o||c.height!=u?(c.width=o,c.height=u):this.context.clearRect(0,0,o,u),l!==c.style.transform&&(c.style.transform=l)}}dispatchRenderEvent_(e,n,i){const r=this.getLayer();if(r.hasListener(e)){const s=new sf(e,this.inversePixelTransform,i,n);r.dispatchEvent(s)}}preRender(e,n){this.frameState=n,!n.declutter&&this.dispatchRenderEvent_(Nt.PRERENDER,e,n)}postRender(e,n){n.declutter||this.dispatchRenderEvent_(Nt.POSTRENDER,e,n)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new cf),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Nt.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Nt.POSTRENDER,this.context,e))}getRenderTransform(e,n,i,r,s,a,o){const u=s/2,l=a/2,c=r/n,h=-c,f=-e[0]+o,g=-e[1];return Tn(this.tempTransform,u,l,c,h,-i,f,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function yo(t,e,n){if(!(n in t))return t[n]=new Set([e]),!0;const i=t[n],r=i.has(e);return r||i.add(e),!r}function q1(t,e,n){const i=t[n];return i?i.delete(e):!1}function Rc(t,e){const n=t.layerStatesArray[t.layerIndex];n.extent&&(e=gi(e,Un(n.extent,t.viewState.projection)));const i=n.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(t.viewState.projection).getExtent();r&&(e=gi(e,r))}return e}class $1 extends hf{constructor(e,n){super(e),n=n||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=vt(),this.tempTileRange_=new il(0,0,0,0),this.tempTileCoord_=la(0,0,0);const i=n.cacheSize!==void 0?n.cacheSize:512;this.tileCache_=new Ic(i),this.sourceTileCache_=null,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new Ic(512)),this.sourceTileCache_}getOrCreateTile(e,n,i,r){const s=this.tileCache_,o=this.getLayer().getSource(),u=Vs(o,o.getKey(),e,n,i);let l;if(s.containsKey(u))l=s.get(u);else{const c=r.viewState.projection,h=o.getProjection();if(l=o.getTile(e,n,i,r.pixelRatio,c,!h||Xs(h,c)?void 0:this.getSourceTileCache()),!l)return null;s.set(u,l)}return l}getTile(e,n,i,r){const s=this.getOrCreateTile(e,n,i,r);return s||null}getData(e){const n=this.frameState;if(!n)return null;const i=this.getLayer(),r=Ye(n.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!nr(s,r))return null;const a=n.viewState,o=i.getRenderSource(),u=o.getTileGridForProjection(a.projection),l=o.getTilePixelRatio(n.pixelRatio);for(let c=u.getZForResolution(a.resolution);c>=u.getMinZoom();--c){const h=u.getTileCoordForCoordAndZ(r,c),f=this.getTile(c,h[1],h[2],n);if(!f||f.getState()!==J.LOADED)continue;const g=u.getOrigin(c),m=ct(u.getTileSize(c)),p=u.getResolution(c);let _;if(f instanceof uf||f instanceof lf)_=f.getImage();else if(f instanceof yc){if(_=ou(f.getData()),!_)continue}else continue;const E=Math.floor(l*((r[0]-g[0])/p-h[1]*m[0])),y=Math.floor(l*((g[1]-r[1])/p-h[2]*m[1])),C=Math.round(l*o.getGutterForProjection(a.projection));return this.getImageData(_,E+C,y+C)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;const n=this.getLayer().getSource();if(!n)return!1;const i=n.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===n.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.clear())):this.renderedSourceRevision_=i,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(e,n,i,r,s){const a=e.viewState,o=this.getLayer(),u=o.getRenderSource(),l=u.getTileGridForProjection(a.projection),c=_e(u);c in e.wantedTiles||(e.wantedTiles[c]={});const h=e.wantedTiles[c],f=o.getMapInternal(),g=Math.max(i-s,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),f?f.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),u.zDirection)),m=a.rotation,p=m?fd(a.center,a.resolution,m,e.size):void 0;for(let _=i;_>=g;--_){const E=l.getTileRangeForExtentAndZ(n,_,this.tempTileRange_),y=l.getResolution(_);for(let C=E.minX;C<=E.maxX;++C)for(let S=E.minY;S<=E.maxY;++S){if(m&&!l.tileCoordIntersectsViewport([_,C,S],p))continue;const w=this.getTile(_,C,S,e);if(!w||!yo(r,w,_))continue;const B=w.getKey();if(h[B]=!0,w.getState()===J.IDLE&&!e.tileQueue.isKeyQueued(B)){const v=la(_,C,S,this.tempTileCoord_);e.tileQueue.enqueue([w,c,l.getTileCoordCenter(v),y])}}}}findStaleTile_(e,n){const i=this.tileCache_,r=e[0],s=e[1],a=e[2],o=this.getStaleKeys();for(let u=0;u<o.length;++u){const l=Vs(this.getLayer().getSource(),o[u],r,s,a);if(i.containsKey(l)){const c=i.peek(l);if(c.getState()===J.LOADED)return c.endTransition(_e(this)),yo(n,c,r),!0}}return!1}findAltTiles_(e,n,i,r){const s=e.getTileRangeForTileCoordAndZ(n,i,this.tempTileRange_);if(!s)return!1;let a=!0;const o=this.tileCache_,u=this.getLayer().getRenderSource(),l=u.getKey();for(let c=s.minX;c<=s.maxX;++c)for(let h=s.minY;h<=s.maxY;++h){const f=Vs(u,l,i,c,h);let g=!1;if(o.containsKey(f)){const m=o.peek(f);m.getState()===J.LOADED&&(yo(r,m,i),g=!0)}g||(a=!1)}return a}renderFrame(e,n){this.renderComplete=!0;const i=e.layerStatesArray[e.layerIndex],r=e.viewState,s=r.projection,a=r.resolution,o=r.center,u=e.pixelRatio,l=this.getLayer(),c=l.getSource(),h=c.getTileGridForProjection(s),f=h.getZForResolution(a,c.zDirection),g=h.getResolution(f),m=c.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==m&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=m):this.renderedSourceKey_=m;let p=e.extent;const _=c.getTilePixelRatio(u);this.prepareContainer(e,n);const E=this.context.canvas.width,y=this.context.canvas.height,C=i.extent&&Un(i.extent);C&&(p=gi(p,Un(i.extent)));const S=g*E/2/_,w=g*y/2/_,L=[o[0]-S,o[1]-w,o[0]+S,o[1]+w],B={};this.renderedTiles.length=0;const v=l.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){const $=h.getZForResolution(r.nextResolution,c.zDirection),Z=Rc(e,e.nextExtent);this.enqueueTiles(e,Z,$,B,v)}const N=Rc(e,p);if(this.enqueueTiles(e,N,f,B,0),v>0&&setTimeout(()=>{this.enqueueTiles(e,N,f-1,B,v-1)},0),!(f in B))return this.container;const R=_e(this),H=e.time;for(const $ of B[f]){const Z=$.getState();if(Z===J.EMPTY)continue;const x=$.tileCoord;if(Z===J.LOADED&&$.getAlpha(R,H)===1){$.endTransition(R);continue}if(Z!==J.ERROR&&(this.renderComplete=!1),this.findStaleTile_(x,B)){q1(B,$,f),e.animate=!0;continue}if(this.findAltTiles_(h,x,f+1,B))continue;const I=h.getMinZoom();for(let Ce=f-1;Ce>=I&&!this.findAltTiles_(h,x,Ce,B);--Ce);}const U=g/a*u/_,W=this.getRenderContext(e);Tn(this.tempTransform,E/2,y/2,U,U,0,-E/2,-y/2),i.extent&&this.clipUnrotated(W,e,C),c.getInterpolate()||(W.imageSmoothingEnabled=!1),this.preRender(W,e);const j=Object.keys(B).map(Number);j.sort(pn);let P;const K=[],q=[];for(let $=j.length-1;$>=0;--$){const Z=j[$],x=c.getTilePixelSize(Z,u,s),se=h.getResolution(Z)/g,I=x[0]*se*U,Ce=x[1]*se*U,Y=h.getTileCoordForCoordAndZ(Ci(L),Z),Te=h.getTileCoordExtent(Y),Re=Ye(this.tempTransform,[_*(Te[0]-L[0])/g,_*(L[3]-Te[3])/g]),Pe=_*c.getGutterForProjection(s);for(const je of B[Z]){if(je.getState()!==J.LOADED)continue;const Fe=je.tileCoord,Wt=Y[1]-Fe[1],Ri=Math.round(Re[0]-(Wt-1)*I),Qn=Y[2]-Fe[2],mr=Math.round(Re[1]-(Qn-1)*Ce),ft=Math.round(Re[0]-Wt*I),it=Math.round(Re[1]-Qn*Ce),gt=Ri-ft,Xt=mr-it,Jn=j.length===1;let Cn=!1;P=[ft,it,ft+gt,it,ft+gt,it+Xt,ft,it+Xt];for(let An=0,Li=K.length;An<Li;++An)if(!Jn&&Z<q[An]){const Ue=K[An];lt([ft,it,ft+gt,it+Xt],[Ue[0],Ue[3],Ue[4],Ue[7]])&&(Cn||(W.save(),Cn=!0),W.beginPath(),W.moveTo(P[0],P[1]),W.lineTo(P[2],P[3]),W.lineTo(P[4],P[5]),W.lineTo(P[6],P[7]),W.moveTo(Ue[6],Ue[7]),W.lineTo(Ue[4],Ue[5]),W.lineTo(Ue[2],Ue[3]),W.lineTo(Ue[0],Ue[1]),W.clip())}K.push(P),q.push(Z),this.drawTile(je,e,ft,it,gt,Xt,Pe,Jn),Cn&&W.restore(),this.renderedTiles.unshift(je),this.updateUsedTiles(e.usedTiles,c,je)}}if(this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Zr(this.renderedExtent_,L),this.renderedExtent_=L,this.renderedPixelRatio=u,this.postRender(this.context,e),i.extent&&W.restore(),W.imageSmoothingEnabled=!0,this.renderComplete){const $=(Z,x)=>{const ie=_e(c),se=x.wantedTiles[ie],I=se?Object.keys(se).length:0;this.updateCacheSize(I),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()};e.postRenderFunctions.push($)}return this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,n,i,r,s,a,o,u){let l;if(e instanceof yc){if(l=ou(e.getData()),!l)throw new Error("Rendering array data is not yet supported")}else l=this.getTileImage(e);if(!l)return;const c=this.getRenderContext(n),h=_e(this),f=n.layerStatesArray[n.layerIndex],g=f.opacity*(u?e.getAlpha(h,n.time):1),m=g!==c.globalAlpha;m&&(c.save(),c.globalAlpha=g),c.drawImage(l,o,o,l.width-2*o,l.height-2*o,i,r,s,a),m&&c.restore(),g!==f.opacity?n.animate=!0:u&&e.endTransition(h)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,n,i){const r=_e(n);r in e||(e[r]={}),e[r][i.getKey()]=!0}}const Us={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Z1 extends ka{constructor(e){e=e||{};const n=Object.assign({},e),i=e.cacheSize;delete e.cacheSize,delete n.preload,delete n.useInterimTilesOnError,super(n),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(e.preload!==void 0?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Us.PRELOAD)}setPreload(e){this.set(Us.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Us.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Us.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}class Q1 extends Z1{constructor(e){super(e)}createRenderer(){return new $1(this,{cacheSize:this.getCacheSize()})}}const Mi=[0,0,0],Rn=5;class df{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,be(im(this.resolutions_,(r,s)=>s-r),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let r=0,s=this.resolutions_.length-1;r<s;++r)if(!n)n=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,be(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Ci(i)),be(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,be(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:ju,be(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((r,s)=>{const a=new il(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){const o=this.getTileRangeForExtentAndZ(i,s);a.minX=Math.max(o.minX,a.minX),a.maxX=Math.min(o.maxX,a.maxX),a.minY=Math.max(o.minY,a.minY),a.maxY=Math.min(o.maxY,a.maxY)}return a}):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,n,i){const r=this.getTileRangeForExtentAndZ(e,n);for(let s=r.minX,a=r.maxX;s<=a;++s)for(let o=r.minY,u=r.maxY;o<=u;++o)i([n,s,o])}forEachTileCoordParentTileRange(e,n,i,r){let s,a,o,u=null,l=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):u=this.getTileCoordExtent(e,r);l>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),s=Pi(a,a,o,o,i)):s=this.getTileRangeForExtentAndZ(u,l,i),n(l,s))return!0;--l}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getOrigins(){return this.origins_}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,i){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const s=e[1]*2,a=e[2]*2;return Pi(s,s+1,a,a+1,n)}const r=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,i){if(n>this.maxZoom||n<this.minZoom)return null;const r=e[0],s=e[1],a=e[2];if(n===r)return Pi(s,a,s,a,i);if(this.zoomFactor_){const u=Math.pow(this.zoomFactor_,n-r),l=Math.floor(s*u),c=Math.floor(a*u);if(n<r)return Pi(l,l,c,c,i);const h=Math.floor(u*(s+1))-1,f=Math.floor(u*(a+1))-1;return Pi(l,h,c,f,i)}const o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,n,i)}getTileRangeForExtentAndZ(e,n,i){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,Mi);const r=Mi[1],s=Mi[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,Mi);const a=Mi[1],o=Mi[2];return Pi(r,a,s,o,i)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=ct(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*r[0]*i,n[1]-(e[2]+.5)*r[1]*i]}getTileCoordExtent(e,n){const i=this.getOrigin(e[0]),r=this.getResolution(e[0]),s=ct(this.getTileSize(e[0]),this.tmpSize_),a=i[0]+e[1]*s[0]*r,o=i[1]-(e[2]+1)*s[1]*r,u=a+s[0]*r,l=o+s[1]*r;return Kn(a,o,u,l,n)}getTileCoordForCoordAndResolution(e,n,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,i)}getTileCoordForXYAndResolution_(e,n,i,r,s){const a=this.getZForResolution(i),o=i/this.getResolution(a),u=this.getOrigin(a),l=ct(this.getTileSize(a),this.tmpSize_);let c=o*(e-u[0])/i/l[0],h=o*(u[1]-n)/i/l[1];return r?(c=Os(c,Rn)-1,h=Os(h,Rn)-1):(c=ks(c,Rn),h=ks(h,Rn)),la(a,c,h,s)}getTileCoordForXYAndZ_(e,n,i,r,s){const a=this.getOrigin(i),o=this.getResolution(i),u=ct(this.getTileSize(i),this.tmpSize_);let l=(e-a[0])/o/u[0],c=(a[1]-n)/o/u[1];return r?(l=Os(l,Rn)-1,c=Os(c,Rn)-1):(l=ks(l,Rn),c=ks(c,Rn)),la(i,l,c,s)}getTileCoordForCoordAndZ(e,n,i){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,i)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const i=Au(this.resolutions_,e,n||0);return ke(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return Md(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,i=new Array(n);for(let r=this.minZoom;r<n;++r)i[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=i}}function ff(t){let e=t.getDefaultTileGrid();return e||(e=nE(t),t.setDefaultTileGrid(e)),e}function J1(t,e,n){const i=e[0],r=t.getTileCoordCenter(e),s=rl(n);if(!nr(s,r)){const a=xe(s),o=Math.ceil((s[0]-r[0])/a);return r[0]+=a*o,t.getTileCoordForCoordAndZ(r,i)}return e}function eE(t,e,n,i){i=i!==void 0?i:"top-left";const r=gf(t,e,n);return new df({extent:t,origin:Tm(t,i),resolutions:r,tileSize:n})}function tE(t){const e=t||{},n=e.extent||ht("EPSG:3857").getExtent(),i={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:gf(n,e.maxZoom,e.tileSize,e.maxResolution)};return new df(i)}function gf(t,e,n,i){e=e!==void 0?e:Dp,n=ct(n!==void 0?n:ju);const r=nt(t),s=xe(t);i=i>0?i:Math.max(s/n[0],r/n[1]);const a=e+1,o=new Array(a);for(let u=0;u<a;++u)o[u]=i/Math.pow(2,u);return o}function nE(t,e,n,i){const r=rl(t);return eE(r,e,n,i)}function rl(t){t=ht(t);let e=t.getExtent();if(!e){const n=180*wu.degrees/t.getMetersPerUnit();e=Kn(-n,-n,n,n)}return e}const iE=/\{z\}/g,rE=/\{x\}/g,sE=/\{y\}/g,aE=/\{-y\}/g;function oE(t,e,n,i,r){return t.replace(iE,e.toString()).replace(rE,n.toString()).replace(sE,i.toString()).replace(aE,function(){if(r===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(r-i).toString()})}function uE(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const i=n[1].charCodeAt(0),r=n[2].charCodeAt(0);let s;for(s=i;s<=r;++s)e.push(t.replace(n[0],String.fromCharCode(s)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const i=parseInt(n[2],10);for(let r=parseInt(n[1],10);r<=i;r++)e.push(t.replace(n[0],r.toString()));return e}return e.push(t),e}function lE(t,e){return(function(n,i,r){if(!n)return;let s;const a=n[0];if(e){const o=e.getFullTileRange(a);o&&(s=o.getHeight()-1)}return oE(t,a,n[1],n[2],s)})}function cE(t,e){const n=t.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=lE(t[r],e);return hE(i)}function hE(t){return t.length===1?t[0]:(function(e,n,i){if(!e)return;const r=G1(e),s=Ki(r,t.length);return t[s](e,n,i)})}class mf extends tn{constructor(e){super(),this.projection=ht(e.projection),this.attributions_=Lc(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const n=this;this.viewPromise_=new Promise(function(i,r){n.viewResolver=i,n.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=Lc(e),this.changed()}setState(e){this.state_=e,this.changed()}}function Lc(t){return t?typeof t=="function"?t:(Array.isArray(t)||(t=[t]),e=>t):null}class dE extends mf{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&ct(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||_e(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,i,r,s,a){return me()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:ff(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(n),a=ct(r.getTileSize(e),this.tmpSize);return s==1?a:L_(a,s,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const i=n!==void 0?n:this.getProjection(),r=n!==void 0?this.getTileGridForProjection(i):this.tileGrid||this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=J1(r,e,i)),W1(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class fE extends bn{constructor(e,n){super(e),this.tile=n}}const xo={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class sl extends dE{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===sl.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,i=_e(n),r=n.getState();let s;r==J.LOADING?(this.tileLoadingKeys_[i]=!0,s=xo.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==J.ERROR?xo.TILELOADERROR:r==J.LOADED?xo.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new fE(s,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=uE(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
|
|
4
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(cE(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,i){}}class gE extends sl{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:mE,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass!==void 0?e.tileClass:uf,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!Xs(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||Xs(n,e)))return this.tileGrid;const i=_e(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=ff(e)),this.tileGridForProjection[i]}createTile_(e,n,i,r,s,a){const o=[e,n,i],u=this.getTileCoordForTileUrlFunction(o,s),l=u?this.tileUrlFunction(u,r,s):void 0,c=new this.tileClass(o,l!==void 0?J.IDLE:J.EMPTY,l!==void 0?l:"",{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return c.key=a,c.addEventListener(ue.CHANGE,this.handleTileChange.bind(this)),c}getTile(e,n,i,r,s,a){const o=this.getProjection();if(!o||!s||Xs(o,s))return this.getTileInternal(e,n,i,r,o||s);const u=[e,n,i],l=this.getKey(),c=this.getTileGridForProjection(o),h=this.getTileGridForProjection(s),f=this.getTileCoordForTileUrlFunction(u,s),g=new lf(o,c,s,h,u,f,this.getTilePixelRatio(r),this.getGutter(),(m,p,_,E)=>this.getTileInternal(m,p,_,E,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return g.key=l,g}getTileInternal(e,n,i,r,s,a){const o=this.getKey(),u=Vs(this,o,e,n,i);if(a&&a.containsKey(u))return a.get(u);const l=this.createTile_(e,n,i,r,s,o);return a?.set(u,l),l}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const i=ht(e);if(i){const r=_e(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=n)}}}function mE(t,e){if(Ot){const n=t.getCrossOrigin();let i="same-origin",r="same-origin";n==="anonymous"||n===""?(i="cors",r="omit"):n==="use-credentials"&&(i="cors",r="include");const s={mode:i,credentials:r,referrerPolicy:t.getReferrerPolicy()};fetch(e,s).then(a=>{if(!a.ok)throw new Error(`HTTP ${a.status}`);return a.blob()}).then(a=>createImageBitmap(a)).then(a=>{const o=t.getImage();o.width=a.width,o.height=a.height,o.getContext("2d").drawImage(a,0,0),a.close?.(),o.dispatchEvent(new Event("load"))}).catch(()=>{t.getImage().dispatchEvent(new Event("error"))});return}t.getImage().src=e}class pE extends gE{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",i=e.tileGrid!==void 0?e.tileGrid:tE({extent:rl(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const _E='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class wc extends pE{constructor(e){e=e||{};let n;e.attributions!==void 0?n=e.attributions:n=[_E];const i=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:n,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin!==void 0?e.crossOrigin:"anonymous",referrerPolicy:e.referrerPolicy||"origin-when-cross-origin",interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:i,wrapX:e.wrapX,zDirection:e.zDirection})}}class pf{drawCustom(e,n,i,r,s){}drawGeometry(e){}setStyle(e){}drawCircle(e,n,i){}drawFeature(e,n,i){}drawGeometryCollection(e,n,i){}drawLineString(e,n,i){}drawMultiLineString(e,n,i){}drawMultiPoint(e,n,i){}drawMultiPolygon(e,n,i){}drawPoint(e,n,i){}drawPolygon(e,n,i){}drawText(e,n,i){}setFillStrokeStyle(e,n){}setImageStyle(e,n){}setTextStyle(e,n){}}const Q={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Hs=[Q.FILL],zn=[Q.STROKE],di=[Q.BEGIN_PATH],kc=[Q.CLOSE_PATH];class ys extends pf{constructor(e,n,i,r){super(),this.tolerance=e,this.maxExtent=n,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){const n=this.pixelRatio;return n==1?e:e.map(function(i){return i*n})}appendFlatPointCoordinates(e,n){const i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let a=s.length;for(let o=0,u=e.length;o<u;o+=n)r[0]=e[o],r[1]=e[o+1],nr(i,r)&&(s[a++]=r[0],s[a++]=r[1]);return a}appendFlatLineCoordinates(e,n,i,r,s,a){const o=this.coordinates;let u=o.length;const l=this.getBufferedMaxExtent();a&&(n+=r);let c=e[n],h=e[n+1];const f=this.tmpCoordinate_;let g=!0,m,p,_;for(m=n+r;m<i;m+=r)f[0]=e[m],f[1]=e[m+1],_=Vo(l,f),_!==p?(g&&(o[u++]=c,o[u++]=h,g=!1),o[u++]=f[0],o[u++]=f[1]):_===ze.INTERSECTING?(o[u++]=f[0],o[u++]=f[1],g=!1):g=!0,c=f[0],h=f[1],p=_;return(s&&g||m===n+r)&&(o[u++]=c,o[u++]=h),u}drawCustomCoordinates_(e,n,i,r,s){for(let a=0,o=i.length;a<o;++a){const u=i[a],l=this.appendFlatLineCoordinates(e,n,u,r,!1,!1);s.push(l),n=u}return n}drawCustom(e,n,i,r,s){this.beginGeometry(e,n,s);const a=e.getType(),o=e.getStride(),u=this.coordinates.length;let l,c,h,f,g;switch(a){case"MultiPolygon":l=e.getOrientedFlatCoordinates(),f=[];const m=e.getEndss();g=0;for(let p=0,_=m.length;p<_;++p){const E=[];g=this.drawCustomCoordinates_(l,g,m[p],o,E),f.push(E)}this.instructions.push([Q.CUSTOM,u,f,e,i,Zl,s]),this.hitDetectionInstructions.push([Q.CUSTOM,u,f,e,r||i,Zl,s]);break;case"Polygon":case"MultiLineString":h=[],l=a=="Polygon"?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),g=this.drawCustomCoordinates_(l,0,e.getEnds(),o,h),this.instructions.push([Q.CUSTOM,u,h,e,i,sa,s]),this.hitDetectionInstructions.push([Q.CUSTOM,u,h,e,r||i,sa,s]);break;case"LineString":case"Circle":l=e.getFlatCoordinates(),c=this.appendFlatLineCoordinates(l,0,l.length,o,!1,!1),this.instructions.push([Q.CUSTOM,u,c,e,i,Wi,s]),this.hitDetectionInstructions.push([Q.CUSTOM,u,c,e,r||i,Wi,s]);break;case"MultiPoint":l=e.getFlatCoordinates(),c=this.appendFlatPointCoordinates(l,o),c>u&&(this.instructions.push([Q.CUSTOM,u,c,e,i,Wi,s]),this.hitDetectionInstructions.push([Q.CUSTOM,u,c,e,r||i,Wi,s]));break;case"Point":l=e.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),c=this.coordinates.length,this.instructions.push([Q.CUSTOM,u,c,e,i,void 0,s]),this.hitDetectionInstructions.push([Q.CUSTOM,u,c,e,r||i,void 0,s]);break}this.endGeometry(n)}beginGeometry(e,n,i){this.beginGeometryInstruction1_=[Q.BEGIN_GEOMETRY,n,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Q.BEGIN_GEOMETRY,n,0,e,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let n;const i=e.length;let r,s,a=-1;for(n=0;n<i;++n)r=e[n],s=r[0],s==Q.END_GEOMETRY?a=n:s==Q.BEGIN_GEOMETRY&&(r[2]=n,nm(this.hitDetectionInstructions,a,n),a=-1)}fillStyleToState(e,n={}){if(e){const i=e.getColor();n.fillPatternScale=i&&typeof i=="object"&&"src"in i?this.pixelRatio:1,n.fillStyle=Jt(i||ut)}else n.fillStyle=void 0;return n}strokeStyleToState(e,n={}){if(e){const i=e.getColor();n.strokeStyle=Jt(i||ns);const r=e.getLineCap();n.lineCap=r!==void 0?r:rr;const s=e.getLineDash();n.lineDash=s?s.slice():_n;const a=e.getLineDashOffset();n.lineDashOffset=a||En;const o=e.getLineJoin();n.lineJoin=o!==void 0?o:sr;const u=e.getWidth();n.lineWidth=u!==void 0?u:rs;const l=e.getMiterLimit();n.miterLimit=l!==void 0?l:ts;const c=e.getOffset();n.strokeOffset=c??r1,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0,n.strokeOffset=void 0;return n}setFillStrokeStyle(e,n){const i=this.state;this.fillStyleToState(e,i),this.strokeStyleToState(n,i)}createFill(e){const n=e.fillStyle,i=[Q.SET_FILL_STYLE,n];return typeof n!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[Q.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,n){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(this.instructions.push(n.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,n){const i=e.strokeStyle,r=e.lineCap,s=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,u=e.lineWidth,l=e.miterLimit,c=e.strokeOffset;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!qn(e.currentLineDash,s)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=u||e.currentMiterLimit!=l||e.currentStrokeOffset!=c)&&(n.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=s,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=u,e.currentMiterLimit=l,e.currentStrokeOffset=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const n=[Q.END_GEOMETRY,e];this.instructions.push(n),this.hitDetectionInstructions.push(n)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=od(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;Su(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class EE extends ys{constructor(e,n,i,r){super(e,n,i,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,n,i){if(!this.image_||this.maxExtent&&!nr(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,n,i);const r=e.getFlatCoordinates(),s=e.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(r,s);this.instructions.push([Q.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(n)}drawMultiPoint(e,n,i){if(!this.image_)return;this.beginGeometry(e,n,i);const r=e.getFlatCoordinates(),s=[];for(let u=0,l=r.length;u<l;u+=e.getStride())(!this.maxExtent||nr(this.maxExtent,r.slice(u,u+2)))&&s.push(r[u],r[u+1]);const a=this.coordinates.length,o=this.appendFlatPointCoordinates(s,2);this.instructions.push([Q.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(n)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,n){const i=e.getAnchor(),r=e.getSize(),s=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=n}}class TE extends ys{constructor(e,n,i,r){super(e,n,i,r)}drawFlatCoordinates_(e,n,i,r,s){const a=this.coordinates.length,o=this.appendFlatLineCoordinates(e,n,i,r,!1,!1);return this.instructions.push([Q.MOVE_TO_LINE_TO,a,o,s*this.pixelRatio]),this.hitDetectionInstructions.push([Q.MOVE_TO_LINE_TO,a,o,s]),i}drawLineString(e,n,i){const r=this.state,s=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(s===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,n,i),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,_n,En],di);const u=e.getFlatCoordinates(),l=e.getStride();this.drawFlatCoordinates_(u,0,u.length,l,o),this.hitDetectionInstructions.push(zn),this.endGeometry(n)}drawMultiLineString(e,n,i){const r=this.state,s=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(s===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,n,i),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,_n,En],di);const u=e.getEnds(),l=e.getFlatCoordinates(),c=e.getStride();let h=0;for(let f=0,g=u.length;f<g;++f)h=this.drawFlatCoordinates_(l,h,u[f],c,o);this.hitDetectionInstructions.push(zn),this.endGeometry(n)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(zn),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(zn),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(di)}}class Oc extends ys{constructor(e,n,i,r){super(e,n,i,r)}drawFlatCoordinatess_(e,n,i,r,s){const a=this.state,o=a.fillStyle!==void 0,u=a.strokeStyle!==void 0,l=i.length;this.instructions.push(di),this.hitDetectionInstructions.push(di);for(let c=0;c<l;++c){const h=i[c],f=this.coordinates.length,g=this.appendFlatLineCoordinates(e,n,h,r,!0,!u);this.instructions.push([Q.MOVE_TO_LINE_TO,f,g,s*this.pixelRatio,!0]),this.hitDetectionInstructions.push([Q.MOVE_TO_LINE_TO,f,g,s,!0]),u&&(this.instructions.push(kc),this.hitDetectionInstructions.push(kc)),n=h}return o&&(this.instructions.push(Hs),this.hitDetectionInstructions.push(Hs)),u&&(this.instructions.push(zn),this.hitDetectionInstructions.push(zn)),n}drawCircle(e,n,i){const r=this.state,s=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(s===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawCircle(e,n,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,n,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,ut]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,_n,En]);const u=e.getFlatCoordinates(),l=e.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(u,0,u.length,l,!1,!1);const h=[Q.CIRCLE,c,o];this.instructions.push(di,h),this.hitDetectionInstructions.push(di,h),r.fillStyle!==void 0&&(this.instructions.push(Hs),this.hitDetectionInstructions.push(Hs)),r.strokeStyle!==void 0&&(this.instructions.push(zn),this.hitDetectionInstructions.push(zn)),this.endGeometry(n)}drawPolygon(e,n,i){const r=this.state,s=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(s===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawPolygon(e,n,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,n,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,ut]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,_n,En]);const u=e.getEnds(),l=e.getOrientedFlatCoordinates(),c=e.getStride();this.drawFlatCoordinatess_(l,0,u,c,o),this.endGeometry(n)}drawMultiPolygon(e,n,i){const r=this.state,s=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(s===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawMultiPolygon(e,n,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,n,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,ut]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,_n,En]);const u=e.getEndss(),l=e.getOrientedFlatCoordinates(),c=e.getStride();let h=0;for(let f=0,g=u.length;f<g;++f)h=this.drawFlatCoordinatess_(l,h,u[f],c,o);this.endGeometry(n)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const e=this.tolerance;if(e!==0){const n=this.coordinates;for(let i=0,r=n.length;i<r;++i)n[i]=oi(n[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}handleStrokeOffset_(e){const n=this.state,i=n.fillStyle,r=n.strokeStyle,s=n.strokeOffset;return Math.abs(s)>0&&i!==void 0&&r!==void 0?(n.strokeStyle=void 0,n.strokeOffset=0,e(),n.fillStyle=void 0,n.strokeStyle=r,n.strokeOffset=s,e(),n.fillStyle=i,!0):!1}}function bE(t,e,n,i,r){const s=[];let a=n,o=0,u=e.slice(n,2);for(;o<t&&a+r<i;){const[l,c]=u.slice(-2),h=e[a+r],f=e[a+r+1],g=Math.sqrt((h-l)*(h-l)+(f-c)*(f-c));if(o+=g,o>=t){const m=(t-o+g)/g,p=St(l,h,m),_=St(c,f,m);u.push(p,_),s.push(u),u=[p,_],o==t&&(a+=r),o=0}else if(o<t)u.push(e[a+r],e[a+r+1]),a+=r;else{const m=g-o,p=St(l,h,m/g),_=St(c,f,m/g);u.push(p,_),s.push(u),u=[p,_],o=0,a+=r}}return o>0&&s.push(u),s}function yE(t,e,n,i,r){let s=n,a=n,o=0,u=0,l=n,c,h,f,g,m,p,_,E,y,C;for(h=n;h<i;h+=r){const S=e[h],w=e[h+1];m!==void 0&&(y=S-m,C=w-p,g=Math.sqrt(y*y+C*C),_!==void 0&&(u+=f,c=Math.acos((_*y+E*C)/(f*g)),c>t&&(u>o&&(o=u,s=l,a=h),u=0,l=h-r)),f=g,_=y,E=C),m=S,p=w}return u+=g,u>o?[l,h]:[s,a]}const ca={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class xE extends ys{constructor(e,n,i,r){super(e,n,i,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[ut]={fillStyle:ut},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,n,i){const r=this.textFillState_,s=this.textStrokeState_,a=this.textState_;if(this.text_===""||!a||!r&&!s)return;const o=this.coordinates;let u=o.length;const l=e.getType();let c=null,h=e.getStride();if(a.placement==="line"&&(l=="LineString"||l=="MultiLineString"||l=="Polygon"||l=="MultiPolygon")){if(!lt(this.maxExtent,e.getExtent()))return;let f;if(c=e.getFlatCoordinates(),l=="LineString")f=[c.length];else if(l=="MultiLineString")f=e.getEnds();else if(l=="Polygon")f=e.getEnds().slice(0,1);else if(l=="MultiPolygon"){const _=e.getEndss();f=[];for(let E=0,y=_.length;E<y;++E)f.push(_[E][0])}this.beginGeometry(e,n,i);const g=a.repeat,m=g?void 0:a.textAlign;let p=0;for(let _=0,E=f.length;_<E;++_){let y;g?y=bE(g*this.resolution,c,p,f[_],h):y=[c.slice(p,f[_])];for(let C=0,S=y.length;C<S;++C){const w=y[C];let L=0,B=w.length;if(m==null){const N=yE(a.maxAngle,w,0,w.length,2);L=N[0],B=N[1]}for(let N=L;N<B;N+=h)o.push(w[N],w[N+1]);const v=o.length;p=f[_],this.drawChars_(u,v),u=v}}this.endGeometry(n)}else{let f=a.overflow?null:[];switch(l){case"Point":case"MultiPoint":c=e.getFlatCoordinates();break;case"LineString":c=e.getFlatMidpoint();break;case"Circle":c=e.getCenter();break;case"MultiLineString":c=e.getFlatMidpoints(),h=2;break;case"Polygon":c=e.getFlatInteriorPoint(),a.overflow||f.push(c[2]/this.resolution),h=3;break;case"MultiPolygon":const S=e.getFlatInteriorPoints();c=[];for(let w=0,L=S.length;w<L;w+=3)a.overflow||f.push(S[w+2]/this.resolution),c.push(S[w],S[w+1]);if(c.length===0)return;h=2;break}const g=this.appendFlatPointCoordinates(c,h);if(g===u)return;if(f&&(g-u)/2!==c.length/h){let S=u/2;f=f.filter((w,L)=>{const B=o[(S+L)*2]===c[L*h]&&o[(S+L)*2+1]===c[L*h+1];return B||--S,B})}this.saveTextStates_();const m=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,p=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,n,i);let _=a.padding;if(_!=hi&&(a.scale[0]<0||a.scale[1]<0)){let S=a.padding[0],w=a.padding[1],L=a.padding[2],B=a.padding[3];a.scale[0]<0&&(w=-w,B=-B),a.scale[1]<0&&(S=-S,L=-L),_=[S,w,L,B]}const E=this.pixelRatio;this.instructions.push([Q.DRAW_IMAGE,u,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,_==hi?hi:_.map(function(S){return S*E}),m,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]);const y=1/E,C=m?m.slice(0):null;C&&(C[1]=ut),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,u,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,_,C,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?ut:this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]),this.endGeometry(n)}}saveTextStates_(){const e=this.textStrokeState_,n=this.textState_,i=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:n.font,textAlign:n.textAlign||is,justify:n.justify,textBaseline:n.textBaseline||oa,scale:n.scale});const a=this.fillKey_;i&&(a in this.fillStates||(this.fillStates[a]={fillStyle:i.fillStyle}))}drawChars_(e,n){const i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();const u=this.pixelRatio,l=ca[r.textBaseline],c=this.textOffsetY_*u,h=this.text_,f=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([Q.DRAW_CHARS,e,n,l,r.overflow,o,r.maxAngle,u,c,s,f*u,h,a,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([Q.DRAW_CHARS,e,n,l,r.overflow,o&&ut,r.maxAngle,u,c,s,f*u,h,a,1/u,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,n){let i,r,s;if(!e)this.text_="";else{const a=e.getFill();a?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Jt(a.getColor()||ut)):(r=null,this.textFillState_=r);const o=e.getStroke();if(!o)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const p=o.getLineDash(),_=o.getLineDashOffset(),E=o.getWidth(),y=o.getMiterLimit();s.lineCap=o.getLineCap()||rr,s.lineDash=p?p.slice():_n,s.lineDashOffset=_===void 0?En:_,s.lineJoin=o.getLineJoin()||sr,s.lineWidth=E===void 0?rs:E,s.miterLimit=y===void 0?ts:y,s.strokeStyle=Jt(o.getColor()||ns)}i=this.textState_;const u=e.getFont()||qd;o1(u);const l=e.getScaleArray();i.overflow=e.getOverflow(),i.font=u,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.repeat=e.getRepeat(),i.justify=e.getJustify(),i.textBaseline=e.getTextBaseline()||oa,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||hi,i.scale=l===void 0?[1,1]:l;const c=e.getOffsetX(),h=e.getOffsetY(),f=e.getRotateWithView(),g=e.getKeepUpright(),m=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=h===void 0?0:h,this.textRotateWithView_=f===void 0?!1:f,this.textKeepUpright_=g===void 0?!0:g,this.textRotation_=m===void 0?0:m,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:_e(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle=="string"?r.fillStyle:"|"+_e(r.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=n}}const CE={Circle:Oc,Default:ys,Image:EE,LineString:TE,Polygon:Oc,Text:xE};class AE{constructor(e,n,i,r){this.tolerance_=e,this.maxExtent_=n,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const n in this.buildersByZIndex_){e[n]=e[n]||{};const i=this.buildersByZIndex_[n];for(const r in i){const s=i[r].finish();e[n][r]=s}}return e}getBuilder(e,n){const i=e!==void 0?e.toString():"0";let r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[n];if(s===void 0){const a=CE[n];s=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[n]=s}return s}}function IE(t,e,n,i){let r=t[e],s=t[e+1],a=0;for(let o=e+i;o<n;o+=i){const u=t[o],l=t[o+1];a+=Math.sqrt((u-r)*(u-r)+(l-s)*(l-s)),r=u,s=l}return a}function SE(t,e,n,i,r,s){r=r??[],s=s??e;const a=t[0],o=t[1],u=t[t.length-4],l=t[t.length-3];let c,h,f,g,m,p,_,E,y=0;for(let C=0;C<t.length;C+=e){f=c,g=h,m=void 0,p=void 0,C+e<t.length&&(m=t[C+e],p=t[C+e+1]),i&&C===0&&(f=u,g=l),i&&C===t.length-2&&(m=a,p=o),c=t[C],h=t[C+1],[_,E]=Ks(c,h,f,g,m,p,n),r[y++]=_,r[y++]=E;for(let S=2;S<s;S++)r[y++]=t[C+S]}return r.length!=y&&(r.length=y),r}function Ks(t,e,n,i,r,s,a){let o,u;n!==void 0&&i!==void 0?(o=t-n,u=e-i):r!==void 0&&s!==void 0?(o=r-t,u=s-e):(o=1,u=0);const l=Math.hypot(o,u),c=o/l,h=u/l;if(o=-h,u=c,n===void 0||i===void 0)return[t+o*a,e+u*a];if(r===void 0||s===void 0)return[t+o*a,e+u*a];const f=Im([t,e],[n,i],[r,s]);if(Math.cos(f)>.998)return[t+c*a,e+h*a];const g=Math.cos(f/2),m=Math.sin(f/2),p=m*o+g*u,_=-g*o+m*u,E=p*(1/m),y=_*(1/m);return[t+E*a,e+y*a]}function RE(t,e,n,i,r,s,a,o,u,l,c,h,f=!0){let g=t[e],m=t[e+1],p=0,_=0,E=0,y=0;function C(){p=g,_=m,e+=i,g=t[e],m=t[e+1],y+=E,E=Math.sqrt((g-p)*(g-p)+(m-_)*(m-_))}do C();while(e<n-i&&y+E<s);let S=E===0?0:(s-y)/E;const w=St(p,g,S),L=St(_,m,S),B=e-i,v=y,N=s+o*u(l,r,c);for(;e<n-i&&y+E<N;)C();S=E===0?0:(N-y)/E;const R=St(p,g,S),H=St(_,m,S);let U=!1;if(f)if(h){const q=[w,L,R,H];Rd(q,0,4,2,h,q,q),U=q[0]>q[2]}else U=w>R;const W=Math.PI,j=[],P=B+i===e;e=B,E=0,y=v,g=t[e],m=t[e+1];let K;if(P){C(),K=Math.atan2(m-_,g-p),U&&(K+=K>0?-W:W);const q=(R+w)/2,$=(H+L)/2;return j[0]=[q,$,(N-s)/2,K,r],j}r=r.replace(/\n/g," ");for(let q=0,$=r.length;q<$;){C();let Z=Math.atan2(m-_,g-p);if(U&&(Z+=Z>0?-W:W),K!==void 0){let Y=Z-K;if(Y+=Y>W?-2*W:Y<-W?2*W:0,Math.abs(Y)>a)return null}K=Z;const x=q;let ie=0;for(;q<$;++q){const Y=U?$-q-1:q,Te=o*u(l,r[Y],c);if(e+i<n&&y+E<s+ie+Te/2)break;ie+=Te}if(q===x)continue;const se=U?r.substring($-x,$-q):r.substring(x,q);S=E===0?0:(s+ie/2-y)/E;const I=St(p,g,S),Ce=St(_,m,S);j.push([I,Ce,ie/2,Z,se]),s+=ie}return j}const vi=vt(),Ln=[],cn=[],hn=[],wn=[];function Nc(t){return t[3].declutterBox}const Dc=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]");function Co(t,e){return e==="start"?e=Dc.test(t)?"right":"left":e==="end"&&(e=Dc.test(t)?"left":"right"),ca[e]}function LE(t,e,n){return n>0&&t.push(`
|
|
5
|
+
`,""),t.push(e,""),t}function wE(t,e,n){return n%2===0&&(t+=e),t}class kE{constructor(e,n,i,r,s){this.overlaps=i,this.pixelRatio=n,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Ht(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new cf:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,n,i,r){const s=e+n+i+r;if(this.labels_[s])return this.labels_[s];const a=r?this.strokeStates[r]:null,o=i?this.fillStates[i]:null,u=this.textStates[n],l=this.pixelRatio,c=[u.scale[0]*l,u.scale[1]*l],h=u.justify?ca[u.justify]:Co(Array.isArray(e)?e[0]:e,u.textAlign||is),f=r&&a.lineWidth?a.lineWidth:0,g=Array.isArray(e)?e:String(e).split(`
|
|
6
|
+
`).reduce(LE,[]),{width:m,height:p,widths:_,heights:E,lineWidths:y}=l1(u,g),C=m+f,S=[],w=(C+2)*c[0],L=(p+f)*c[1],B={width:w<0?Math.floor(w):Math.ceil(w),height:L<0?Math.floor(L):Math.ceil(L),contextInstructions:S};(c[0]!=1||c[1]!=1)&&S.push("scale",c),r&&(S.push("strokeStyle",a.strokeStyle),S.push("lineWidth",f),S.push("lineCap",a.lineCap),S.push("lineJoin",a.lineJoin),S.push("miterLimit",a.miterLimit),S.push("setLineDash",[a.lineDash]),S.push("lineDashOffset",a.lineDashOffset)),i&&S.push("fillStyle",o.fillStyle),S.push("textBaseline","middle"),S.push("textAlign","center");const v=.5-h;let N=h*C+v*f;const R=[],H=[];let U=0,W=0,j=0,P=0,K;for(let q=0,$=g.length;q<$;q+=2){const Z=g[q];if(Z===`
|
|
7
|
+
`){W+=U,U=0,N=h*C+v*f,++P;continue}const x=g[q+1]||u.font;x!==K&&(r&&R.push("font",x),i&&H.push("font",x),K=x),U=Math.max(U,E[j]);const ie=[Z,N+v*_[j]+h*(_[j]-y[P]),.5*(f+U)+W];N+=_[j],r&&R.push("strokeText",ie),i&&H.push("fillText",ie),++j}return Array.prototype.push.apply(S,R),Array.prototype.push.apply(S,H),this.labels_[s]=B,B}replayTextBackground_(e,n,i,r,s,a,o){e.beginPath(),e.moveTo.apply(e,n),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,s),e.lineTo.apply(e,n),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,n,i,r,s,a,o,u,l,c,h,f,g,m,p,_){o*=f[0],u*=f[1];let E=i-o,y=r-u;const C=s+l>e?e-l:s,S=a+c>n?n-c:a,w=m[3]+C*f[0]+m[1],L=m[0]+S*f[1]+m[2],B=E-m[3],v=y-m[0];(p||h!==0)&&(Ln[0]=B,wn[0]=B,Ln[1]=v,cn[1]=v,cn[0]=B+w,hn[0]=cn[0],hn[1]=v+L,wn[1]=hn[1]);let N;return h!==0?(N=Tn(Ht(),i,r,1,1,h,-i,-r),Ye(N,Ln),Ye(N,cn),Ye(N,hn),Ye(N,wn),Kn(Math.min(Ln[0],cn[0],hn[0],wn[0]),Math.min(Ln[1],cn[1],hn[1],wn[1]),Math.max(Ln[0],cn[0],hn[0],wn[0]),Math.max(Ln[1],cn[1],hn[1],wn[1]),vi)):Kn(Math.min(B,B+w),Math.min(v,v+L),Math.max(B,B+w),Math.max(v,v+L),vi),g&&(E=Math.round(E),y=Math.round(y)),{drawImageX:E,drawImageY:y,drawImageW:C,drawImageH:S,originX:l,originY:c,declutterBox:{minX:vi[0],minY:vi[1],maxX:vi[2],maxY:vi[3],value:_},canvasTransform:N,scale:f}}replayImageOrLabel_(e,n,i,r,s,a,o){const u=!!(a||o),l=r.declutterBox,c=o?o[2]*r.scale[0]/2:0;return l.minX-c<=n[0]&&l.maxX+c>=0&&l.minY-c<=n[1]&&l.maxY+c>=0&&(u&&this.replayTextBackground_(e,Ln,cn,hn,wn,a,o),c1(e,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){const n=this.alignAndScaleFill_;if(n){const i=Ye(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(i[0]%r,i[1]%r),n!==1&&e.scale(n,n)}e.fill(),n&&e.restore()}setStrokeStyle_(e,n){e.strokeStyle=n[1],n[1]&&(e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.lineDashOffset=n[7],e.setLineDash(n[6]))}drawLabelWithPointPlacement_(e,n,i,r){const s=this.textStates[n],a=this.createLabel(e,n,r,i),o=this.strokeStates[i],u=this.pixelRatio,l=Co(Array.isArray(e)?e[0]:e,s.textAlign||is),c=ca[s.textBaseline||oa],h=o&&o.lineWidth?o.lineWidth:0,f=a.width/u-2*s.scale[0],g=l*f+2*(.5-l)*h,m=c*a.height/u+2*(.5-c)*h;return{label:a,anchorX:g,anchorY:m}}execute_(e,n,i,r,s,a,o,u){const l=this.zIndexContext_;let c;this.pixelCoordinates_&&qn(i,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Wn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),rp(this.renderedTransform_,i));let h=0;const f=r.length;let g=0,m,p,_,E,y,C,S,w,L,B,v,N,R,H,U,W,j=0,P=0;const K=this.coordinateCache_,q=this.viewRotation_,$=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,Z={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:q},x=this.instructions!=r||this.overlaps?0:200;let ie,se,I,Ce;for(;h<f;){const Y=r[h];switch(Y[0]){case Q.BEGIN_GEOMETRY:ie=Y[1],Ce=Y[3],ie.getGeometry()?o!==void 0&&!lt(o,Ce.getExtent())?h=Y[2]+1:++h:h=Y[2],l&&(l.zIndex=Y[4]);break;case Q.BEGIN_PATH:j>x&&(this.fill_(e),j=0),P>x&&(e.stroke(),P=0),!j&&!P&&(e.beginPath(),w=NaN,L=NaN),++h;break;case Q.CIRCLE:g=Y[1],E=Y[2]??0;const Re=c[g],Pe=c[g+1],je=c[g+2]-E,Fe=c[g+3]-E,Wt=je-Re,Ri=Fe-Pe,Qn=Math.sqrt(Wt*Wt+Ri*Ri);e.moveTo(Re+Qn,Pe),e.arc(Re,Pe,Qn,0,2*Math.PI,!0),++h;break;case Q.CLOSE_PATH:e.closePath(),++h;break;case Q.CUSTOM:g=Y[1],m=Y[2];const mr=Y[3],ft=Y[4],it=Y[5];Z.geometry=mr,Z.feature=ie,h in K||(K[h]=[]);const gt=K[h];it?it(c,g,m,2,gt):(gt[0]=c[g],gt[1]=c[g+1],gt.length=2),l&&(l.zIndex=Y[6]),ft(gt,Z),++h;break;case Q.DRAW_IMAGE:g=Y[1],m=Y[2],N=Y[3],p=Y[4],_=Y[5];let Xt=Y[6];const Jn=Y[7],Cn=Y[8],An=Y[9],Li=Y[10];let Ue=Y[11];const $a=Y[12];let wi=Y[13];S=Y[14]||"declutter";const M=Y[15];if(!N&&Y.length>=20){R=Y[19],H=Y[20],U=Y[21],W=Y[22];const bt=this.drawLabelWithPointPlacement_(R,H,U,W);N=bt.label,Y[3]=N;const ti=Y[23];p=(bt.anchorX-ti)*this.pixelRatio,Y[4]=p;const yt=Y[24];_=(bt.anchorY-yt)*this.pixelRatio,Y[5]=_,Xt=N.height,Y[6]=Xt,wi=N.width,Y[13]=wi}let V;Y.length>25&&(V=Y[25]);let te,le,ge;Y.length>17?(te=Y[16],le=Y[17],ge=Y[18]):(te=hi,le=null,ge=null),Li&&$?Ue+=q:!Li&&!$&&(Ue-=q);let mt=0;for(;g<m;g+=2){if(V&&V[mt++]<wi/this.pixelRatio)continue;const bt=this.calculateImageOrLabelDimensions_(N.width,N.height,c[g],c[g+1],wi,Xt,p,_,Cn,An,Ue,$a,s,te,!!le||!!ge,ie),ti=[e,n,N,bt,Jn,le,ge];if(u){let yt,Kt,xt;if(M){const Oe=m-g;if(!M[Oe]){M[Oe]={args:ti,declutterMode:S};continue}const Je=M[Oe];yt=Je.args,Kt=Je.declutterMode,delete M[Oe],xt=Nc(yt)}let on,un;if(yt&&(Kt!=="declutter"||!u.collides(xt))&&(on=!0),(S!=="declutter"||!u.collides(bt.declutterBox))&&(un=!0),Kt==="declutter"&&S==="declutter"){const Oe=on&&un;on=Oe,un=Oe}on&&(Kt!=="none"&&u.insert(xt),this.replayImageOrLabel_.apply(this,yt)),un&&(S!=="none"&&u.insert(bt.declutterBox),this.replayImageOrLabel_.apply(this,ti))}else this.replayImageOrLabel_.apply(this,ti)}++h;break;case Q.DRAW_CHARS:const Vt=Y[1],Et=Y[2],sn=Y[3],ei=Y[4];W=Y[5];const Qe=Y[6],an=Y[7],Tt=Y[8];U=Y[9];const Za=Y[10];R=Y[11],Array.isArray(R)&&(R=R.reduce(wE,"")),H=Y[12];const wl=[Y[13],Y[13]];S=Y[14]||"declutter";const Cg=Y[15],Qa=this.textStates[H],pr=Qa.font,_r=[Qa.scale[0]*an,Qa.scale[1]*an];let Er;pr in this.widths_?Er=this.widths_[pr]:(Er={},this.widths_[pr]=Er);const kl=IE(c,Vt,Et,2),Ol=Math.abs(_r[0])*fc(pr,R,Er);if(ei||Ol<=kl){const bt=this.textStates[H].textAlign,ti=(kl-Ol)*Co(R,bt),yt=RE(c,Vt,Et,2,R,ti,Qe,Math.abs(_r[0]),fc,pr,Er,$?0:this.viewRotation_,Cg);e:if(yt){const Kt=[];let xt,on,un,Oe,Je;if(U)for(xt=0,on=yt.length;xt<on;++xt){Je=yt[xt],un=Je[4],Oe=this.createLabel(un,H,"",U),p=Je[2]+(_r[0]<0?-Za:Za),_=sn*Oe.height+(.5-sn)*2*Za*_r[1]/_r[0]-Tt;const ln=this.calculateImageOrLabelDimensions_(Oe.width,Oe.height,Je[0],Je[1],Oe.width,Oe.height,p,_,0,0,Je[3],wl,!1,hi,!1,ie);if(u&&S==="declutter"&&u.collides(ln.declutterBox))break e;Kt.push([e,n,Oe,ln,1,null,null])}if(W)for(xt=0,on=yt.length;xt<on;++xt){Je=yt[xt],un=Je[4],Oe=this.createLabel(un,H,W,""),p=Je[2],_=sn*Oe.height-Tt;const ln=this.calculateImageOrLabelDimensions_(Oe.width,Oe.height,Je[0],Je[1],Oe.width,Oe.height,p,_,0,0,Je[3],wl,!1,hi,!1,ie);if(u&&S==="declutter"&&u.collides(ln.declutterBox))break e;Kt.push([e,n,Oe,ln,1,null,null])}u&&S!=="none"&&u.load(Kt.map(Nc));for(let ln=0,Ag=Kt.length;ln<Ag;++ln)this.replayImageOrLabel_.apply(this,Kt[ln])}}++h;break;case Q.END_GEOMETRY:if(a!==void 0){ie=Y[1];const bt=a(ie,Ce,S);if(bt)return bt}++h;break;case Q.FILL:x?j++:this.fill_(e),++h;break;case Q.MOVE_TO_LINE_TO:for(g=Y[1],m=Y[2],E=Y[3],y=Y[4]??!1,se=c[g],I=c[g+1],E&&(C=g,[se,I]=Ks(se,I,y?c[m-4]:void 0,y?c[m-3]:void 0,c[g+2],c[g+3],E)),e.moveTo(se,I),w=se+.5|0,L=I+.5|0,g+=2;g<m;g+=2)se=c[g],I=c[g+1],B=se+.5|0,v=I+.5|0,(g==m-2||B!==w||v!==L)&&(E&&(g==m-2?[se,I]=Ks(se,I,c[g-2],c[g-1],y?c[C+2]:void 0,y?c[C+3]:void 0,E):[se,I]=Ks(se,I,c[g-2],c[g-1],c[g+2],c[g+3],E)),e.lineTo(se,I),w=B,L=v);++h;break;case Q.SET_FILL_STYLE:this.alignAndScaleFill_=Y[2],j&&(this.fill_(e),j=0,P&&(e.stroke(),P=0)),e.fillStyle=Y[1],++h;break;case Q.SET_STROKE_STYLE:P&&(e.stroke(),P=0),this.setStrokeStyle_(e,Y),++h;break;case Q.STROKE:x?P++:e.stroke(),++h;break;default:++h;break}}j&&this.fill_(e),P&&e.stroke()}execute(e,n,i,r,s,a){this.viewRotation_=r,this.execute_(e,n,i,this.instructions,s,void 0,void 0,a)}executeHitDetection(e,n,i,r,s){return this.viewRotation_=i,this.execute_(e,[e.canvas.width,e.canvas.height],n,this.hitDetectionInstructions,!0,r,s)}}const ui=["Polygon","Circle","LineString","Image","Text","Default"],_f=["Image","Text"],OE=ui.filter(t=>!_f.includes(t));let Ef=!1,Tf=!1;function NE(){let t=0;const e=i=>{const r=ve(1,1,null,{willReadFrequently:i});let s=0;const a=performance.now();for(;performance.now()-a<50;++s)r.fillStyle=`rgba(255,0,${s%256},1)`,r.fillRect(0,0,1,1),r.getImageData(0,0,1,1);return t=s>t?s:t,s};Ef={[e(!0)]:!0,[e(!1)]:!1,[e(void 0)]:void 0}[t],Tf=!0}class DE{constructor(e,n,i,r,s,a,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=n,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Ht(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,o)}clip(e,n){const i=this.getClipCoords(n);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e,n){for(const i in e){let r=this.executorsByZIndex_[i];r===void 0&&(r={},this.executorsByZIndex_[i]=r);const s=e[i];for(const a in s){const o=s[a];r[a]=new kE(this.resolution_,this.pixelRatio_,this.overlaps_,o,n)}}}hasExecutors(e){for(const n in this.executorsByZIndex_){const i=this.executorsByZIndex_[n];for(let r=0,s=e.length;r<s;++r)if(e[r]in i)return!0}return!1}forEachFeatureAtCoordinate(e,n,i,r,s,a){Tf===!1&&NE(),r=Math.round(r);const o=r*2+1,u=Tn(this.hitDetectionTransform_,r+.5,r+.5,1/n,-1/n,-i,-e[0],-e[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=ve(o,o,null,{willReadFrequently:Ef}));const c=this.hitDetectionContext_;c.canvas.width!==o||c.canvas.height!==o?(c.canvas.width=o,c.canvas.height=o):l||c.clearRect(0,0,o,o);let h;this.renderBuffer_!==void 0&&(h=vt(),Br(h,e),Su(h,n*(this.renderBuffer_+r),h));const f=PE(r);let g;function m(w,L,B){const v=c.getImageData(0,0,o,o).data;for(let N=0,R=f.length;N<R;N++)if(v[f[N]]>0){if(!a||B==="none"||g!=="Image"&&g!=="Text"||a.includes(w)){const H=(f[N]-3)/4,U=r-H%o,W=r-(H/o|0),j=s(w,L,U*U+W*W);if(j)return j}c.clearRect(0,0,o,o);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(pn);let _,E,y,C,S;for(_=p.length-1;_>=0;--_){const w=p[_].toString();for(y=this.executorsByZIndex_[w],E=ui.length-1;E>=0;--E)if(g=ui[E],C=y[g],C!==void 0&&(S=C.executeHitDetection(c,u,i,m,h),S))return S}}getClipCoords(e){const n=this.maxExtent_;if(!n)return null;const i=n[0],r=n[1],s=n[2],a=n[3],o=[i,r,i,a,s,a,s,r];return Wn(o,0,8,2,e,o),o}isEmpty(){return tr(this.executorsByZIndex_)}execute(e,n,i,r,s,a,o){const u=Object.keys(this.executorsByZIndex_).map(Number);u.sort(o?tm:pn),a=a||ui;const l=ui.length;for(let c=0,h=u.length;c<h;++c){const f=u[c].toString(),g=this.executorsByZIndex_[f];for(let m=0,p=a.length;m<p;++m){const _=a[m],E=g[_];if(E!==void 0){const y=o===null?void 0:E.getZIndexContext(),C=y?y.getContext():e,S=this.maxExtent_&&_!=="Image"&&_!=="Text";if(S&&(C.save(),this.clip(C,i)),!y||_==="Text"||_==="Image"?E.execute(C,n,i,r,s,o):y.pushFunction(w=>E.execute(w,n,i,r,s,o)),S&&C.restore(),y){y.offset();const w=u[c]*l+ui.indexOf(_);this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(y)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,n=Object.keys(e).map(Number).sort(pn);for(let i=0,r=n.length;i<r;++i)e[n[i]].forEach(s=>{s.draw(this.renderedContext_),s.clear()}),e[n[i]].length=0}}const Ao={};function PE(t){if(Ao[t]!==void 0)return Ao[t];const e=t*2+1,n=t*t,i=new Array(n+1);for(let s=0;s<=t;++s)for(let a=0;a<=t;++a){const o=s*s+a*a;if(o>n)break;let u=i[o];u||(u=[],i[o]=u),u.push(((t+s)*e+(t+a))*4+3),s>0&&u.push(((t-s)*e+(t+a))*4+3),a>0&&(u.push(((t+s)*e+(t-a))*4+3),s>0&&u.push(((t-s)*e+(t-a))*4+3))}const r=[];for(let s=0,a=i.length;s<a;++s)i[s]&&r.push(...i[s]);return Ao[t]=r,r}class ME extends pf{constructor(e,n,i,r,s,a,o){super(),this.context_=e,this.pixelRatio_=n,this.extent_=i,this.transform_=r,this.transformRotation_=r?ba(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=a,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Ht()}drawImages_(e,n,i,r){if(!this.image_)return;const s=Wn(e,n,i,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.tmpLocalTransform_,u=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=u*this.imageOpacity_);let l=this.imageRotation_;this.transformRotation_===0&&(l-=this.viewRotation_),this.imageRotateWithView_&&(l+=this.viewRotation_);for(let c=0,h=s.length;c<h;c+=2){const f=s[c]-this.imageAnchorX_,g=s[c+1]-this.imageAnchorY_;if(l!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const m=f+this.imageAnchorX_,p=g+this.imageAnchorY_;Tn(o,m,p,1,1,l,-m,-p),a.save(),a.transform.apply(a,o),a.translate(m,p),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,f,g,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=u)}drawText_(e,n,i,r){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const s=Wn(e,n,i,r,this.transform_,this.pixelCoordinates_),a=this.context_;let o=this.textRotation_;for(this.transformRotation_===0&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);n<i;n+=r){const u=s[n]+this.textOffsetX_,l=s[n+1]+this.textOffsetY_;o!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(u-this.textOffsetX_,l-this.textOffsetY_),a.rotate(o),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,u,l),this.textFillState_&&a.fillText(this.text_,u,l))}}moveToLineTo_(e,n,i,r,s,a){const o=this.context_;let u=Wn(e,n,i,r,this.transform_,this.pixelCoordinates_);Math.abs(a)>0&&(u=SE(u,r,a,s,u)),o.moveTo(u[0],u[1]);let l=u.length;s&&(l-=2);for(let c=2;c<l;c+=2)o.lineTo(u[c],u[c+1]);return s&&o.closePath(),i}drawRings_(e,n,i,r,s){for(let a=0,o=i.length;a<o;++a)n=this.moveToLineTo_(e,n,i[a],r,!0,s);return n}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!lt(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const n=gp(e,this.transform_,this.pixelCoordinates_),i=n[2]-n[0],r=n[3]-n[1],s=Math.sqrt(i*i+r*r),a=this.context_;a.beginPath(),a.arc(n[0],n[1],s,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==""&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case"Point":this.drawPoint(e);break;case"LineString":this.drawLineString(e);break;case"Polygon":this.drawPolygon(e);break;case"MultiPoint":this.drawMultiPoint(e);break;case"MultiLineString":this.drawMultiLineString(e);break;case"MultiPolygon":this.drawMultiPolygon(e);break;case"GeometryCollection":this.drawGeometryCollection(e);break;case"Circle":this.drawCircle(e);break}}drawFeature(e,n){const i=n.getGeometryFunction()(e);i&&(this.setStyle(n),this.drawGeometry(i))}drawGeometryCollection(e){const n=e.getGeometriesArray();for(let i=0,r=n.length;i<r;++i)this.drawGeometry(n[i])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const n=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(n,0,n.length,i),this.text_!==""&&this.drawText_(n,0,n.length,i)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const n=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(n,0,n.length,i),this.text_!==""&&this.drawText_(n,0,n.length,i)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!lt(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const n=this.context_,i=e.getFlatCoordinates();n.beginPath(),this.moveToLineTo_(i,0,i.length,e.getStride(),!1,this.strokeState_.strokeOffset),n.stroke()}if(this.text_!==""){const n=e.getFlatMidpoint();this.drawText_(n,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const n=e.getExtent();if(lt(this.extent_,n)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,r=e.getFlatCoordinates();let s=0;const a=e.getEnds(),o=e.getStride();i.beginPath();for(let u=0,l=a.length;u<l;++u)s=this.moveToLineTo_(r,s,a[u],o,!1,this.strokeState_.strokeOffset);i.stroke()}if(this.text_!==""){const i=e.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!lt(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const n=this.context_;n.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride(),this.strokeState_?.strokeOffset),this.fillState_&&n.fill(),this.strokeState_&&n.stroke()}if(this.text_!==""){const n=e.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!lt(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const n=this.context_,i=e.getOrientedFlatCoordinates();let r=0;const s=e.getEndss(),a=e.getStride();n.beginPath();for(let o=0,u=s.length;o<u;++o){const l=s[o];r=this.drawRings_(i,r,l,a,this.strokeState_?.strokeOffset)}this.fillState_&&n.fill(),this.strokeState_&&n.stroke()}if(this.text_!==""){const n=e.getFlatInteriorPoints();this.drawText_(n,0,n.length,2)}}}setContextFillState_(e){const n=this.context_,i=this.contextFillState_;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=e.fillStyle,n.fillStyle=e.fillStyle):(n.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){const n=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=e.lineCap&&(i.lineCap=e.lineCap,n.lineCap=e.lineCap),qn(i.lineDash,e.lineDash)||n.setLineDash(i.lineDash=e.lineDash),i.lineDashOffset!=e.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset,n.lineDashOffset=e.lineDashOffset),i.lineJoin!=e.lineJoin&&(i.lineJoin=e.lineJoin,n.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=e.lineWidth,n.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=e.miterLimit,n.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=e.strokeStyle,n.strokeStyle=e.strokeStyle)):(n.lineCap=e.lineCap,n.setLineDash(e.lineDash),n.lineDashOffset=e.lineDashOffset,n.lineJoin=e.lineJoin,n.lineWidth=e.lineWidth,n.miterLimit=e.miterLimit,n.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){const n=this.context_,i=this.contextTextState_,r=e.textAlign?e.textAlign:is;i?(i.font!=e.font&&(i.font=e.font,n.font=e.font),i.textAlign!=r&&(i.textAlign=r,n.textAlign=r),i.textBaseline!=e.textBaseline&&(i.textBaseline=e.textBaseline,n.textBaseline=e.textBaseline)):(n.font=e.font,n.textAlign=r,n.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,n){if(!e)this.fillState_=null;else{const i=e.getColor();this.fillState_={fillStyle:Jt(i||ut)}}if(!n)this.strokeState_=null;else{const i=n.getColor(),r=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),o=n.getLineJoin(),u=n.getWidth(),l=n.getMiterLimit(),c=s||_n,h=n.getOffset();this.strokeState_={lineCap:r!==void 0?r:rr,lineDash:this.pixelRatio_===1?c:c.map(f=>f*this.pixelRatio_),lineDashOffset:(a||En)*this.pixelRatio_,lineJoin:o!==void 0?o:sr,lineWidth:(u!==void 0?u:rs)*this.pixelRatio_,miterLimit:l!==void 0?l:ts,strokeStyle:Jt(i||ns),strokeOffset:(h??0)*this.pixelRatio_}}}setImageStyle(e){let n;if(!e||!(n=e.getSize())){this.image_=null;return}const i=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),s=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*i,this.imageAnchorY_=r[1]*i,this.imageHeight_=n[1]*i,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();const a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/i,a[1]*this.pixelRatio_/i],this.imageWidth_=n[0]*i}setTextStyle(e){if(!e)this.text_="";else{const n=e.getFill();if(!n)this.textFillState_=null;else{const g=n.getColor();this.textFillState_={fillStyle:Jt(g||ut)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const g=i.getColor(),m=i.getLineCap(),p=i.getLineDash(),_=i.getLineDashOffset(),E=i.getLineJoin(),y=i.getWidth(),C=i.getMiterLimit();this.textStrokeState_={lineCap:m!==void 0?m:rr,lineDash:p||_n,lineDashOffset:_||En,lineJoin:E!==void 0?E:sr,lineWidth:y!==void 0?y:rs,miterLimit:C!==void 0?C:ts,strokeStyle:Jt(g||ns)}}const r=e.getFont(),s=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),u=e.getRotation(),l=e.getScaleArray(),c=e.getText(),h=e.getTextAlign(),f=e.getTextBaseline();this.textState_={font:r!==void 0?r:qd,textAlign:h!==void 0?h:is,textBaseline:f!==void 0?f:oa},this.text_=c!==void 0?Array.isArray(c)?c.reduce((g,m,p)=>g+=p%2?" ":m,""):c:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=a!==void 0?this.pixelRatio_*a:0,this.textRotateWithView_=o!==void 0?o:!1,this.textRotation_=u!==void 0?u:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}}}const Qt=.5;function vE(t,e,n,i,r,s,a,o,u){const l=r,c=t[0]*Qt,h=t[1]*Qt,f=ve(c,h);f.imageSmoothingEnabled=!1;const g=f.canvas,m=new ME(f,Qt,r,null,a,o,null),p=n.length,_=Math.floor((256*256*256-1)/p),E={};for(let C=1;C<=p;++C){const S=n[C-1],w=S.getStyleFunction()||i;if(!w)continue;let L=w(S,s);if(!L)continue;Array.isArray(L)||(L=[L]);const v=(C*_).toString(16).padStart(7,"#00000");for(let N=0,R=L.length;N<R;++N){const H=L[N],U=H.getGeometryFunction()(S);if(!U||!lt(l,U.getExtent()))continue;const W=H.clone(),j=W.getFill();j&&j.setColor(v);const P=W.getStroke();P&&(P.setColor(v),P.setLineDash(null)),W.setText(void 0);const K=H.getImage();if(K){const x=K.getImageSize();if(!x)continue;const ie=ve(x[0],x[1],void 0,{alpha:!1}),se=ie.canvas;ie.fillStyle=v,ie.fillRect(0,0,se.width,se.height),W.setImage(new Da({img:se,anchor:K.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:K.getOrigin(),opacity:1,size:K.getSize(),scale:K.getScale(),rotation:K.getRotation(),rotateWithView:K.getRotateWithView()}))}const q=W.getZIndex()||0;let $=E[q];$||($={},E[q]=$,$.Polygon=[],$.Circle=[],$.LineString=[],$.Point=[]);const Z=U.getType();if(Z==="GeometryCollection"){const x=U.getGeometriesArrayRecursive();for(let ie=0,se=x.length;ie<se;++ie){const I=x[ie];$[I.getType().replace("Multi","")].push(I,W)}}else $[Z.replace("Multi","")].push(U,W)}}const y=Object.keys(E).map(Number).sort(pn);for(let C=0,S=y.length;C<S;++C){const w=E[y[C]];for(const L in w){const B=w[L];for(let v=0,N=B.length;v<N;v+=2){m.setStyle(B[v+1]);for(let R=0,H=e.length;R<H;++R)m.setTransform(e[R]),m.drawGeometry(B[v])}}}return f.getImageData(0,0,g.width,g.height)}function FE(t,e,n){const i=[];if(n){const r=Math.floor(Math.round(t[0])*Qt),s=Math.floor(Math.round(t[1])*Qt),a=(ke(r,0,n.width-1)+ke(s,0,n.height-1)*n.width)*4,o=n.data[a],u=n.data[a+1],c=n.data[a+2]+256*(u+256*o),h=Math.floor((256*256*256-1)/e.length);c&&c%h===0&&i.push(e[c/h-1])}return i}const BE=.5,bf={Point:XE,LineString:GE,Polygon:KE,MultiPoint:VE,MultiLineString:jE,MultiPolygon:WE,GeometryCollection:YE,Circle:HE};function UE(t,e){return parseInt(_e(t),10)-parseInt(_e(e),10)}function Pc(t,e){const n=yf(t,e);return n*n}function yf(t,e){return BE*t/e}function HE(t,e,n,i,r){const s=n.getFill(),a=n.getStroke();if(s||a){const u=t.getBuilder(n.getZIndex(),"Circle");u.setFillStrokeStyle(s,a),u.drawCircle(e,i,r)}const o=n.getText();if(o&&o.getText()){const u=t.getBuilder(n.getZIndex(),"Text");u.setTextStyle(o),u.drawText(e,i)}}function Mc(t,e,n,i,r,s,a,o){const u=[],l=n.getImage();if(l){let f=!0;const g=l.getImageState();g==re.LOADED||g==re.ERROR?f=!1:g==re.IDLE&&l.load(),f&&u.push(l.ready())}const c=n.getFill();c&&c.loading()&&u.push(c.ready());const h=u.length>0;return h&&Promise.all(u).then(()=>r(null)),zE(t,e,n,i,s,a,o),h}function zE(t,e,n,i,r,s,a){const o=n.getGeometryFunction()(e);if(!o)return;const u=o.simplifyTransformed(i,r);if(n.getRenderer())xf(t,u,n,e,a);else{const c=bf[u.getType()];c(t,u,n,e,a,s)}}function xf(t,e,n,i,r){if(e.getType()=="GeometryCollection"){const a=e.getGeometries();for(let o=0,u=a.length;o<u;++o)xf(t,a[o],n,i,r);return}t.getBuilder(n.getZIndex(),"Default").drawCustom(e,i,n.getRenderer(),n.getHitDetectionRenderer(),r)}function YE(t,e,n,i,r,s){const a=e.getGeometriesArray();let o,u;for(o=0,u=a.length;o<u;++o){const l=bf[a[o].getType()];l(t,a[o],n,i,r,s)}}function GE(t,e,n,i,r){const s=n.getStroke();if(s){const o=t.getBuilder(n.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawLineString(e,i,r)}const a=n.getText();if(a&&a.getText()){const o=t.getBuilder(n.getZIndex(),"Text");o.setTextStyle(a),o.drawText(e,i,r)}}function jE(t,e,n,i,r){const s=n.getStroke();if(s){const o=t.getBuilder(n.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawMultiLineString(e,i,r)}const a=n.getText();if(a&&a.getText()){const o=t.getBuilder(n.getZIndex(),"Text");o.setTextStyle(a),o.drawText(e,i,r)}}function WE(t,e,n,i,r){const s=n.getFill(),a=n.getStroke();if(a||s){const u=t.getBuilder(n.getZIndex(),"Polygon");u.setFillStrokeStyle(s,a),u.drawMultiPolygon(e,i,r)}const o=n.getText();if(o&&o.getText()){const u=t.getBuilder(n.getZIndex(),"Text");u.setTextStyle(o),u.drawText(e,i,r)}}function XE(t,e,n,i,r,s){const a=n.getImage(),o=n.getText(),u=o&&o.getText(),l=s&&a&&u?{}:void 0;if(a){if(a.getImageState()!=re.LOADED)return;const c=t.getBuilder(n.getZIndex(),"Image");c.setImageStyle(a,l),c.drawPoint(e,i,r)}if(u){const c=t.getBuilder(n.getZIndex(),"Text");c.setTextStyle(o,l),c.drawText(e,i,r)}}function VE(t,e,n,i,r,s){const a=n.getImage(),o=a&&a.getOpacity()!==0,u=n.getText(),l=u&&u.getText(),c=s&&o&&l?{}:void 0;if(o){if(a.getImageState()!=re.LOADED)return;const h=t.getBuilder(n.getZIndex(),"Image");h.setImageStyle(a,c),h.drawMultiPoint(e,i,r)}if(l){const h=t.getBuilder(n.getZIndex(),"Text");h.setTextStyle(u,c),h.drawText(e,i,r)}}function KE(t,e,n,i,r){const s=n.getFill(),a=n.getStroke();if(s||a){const u=t.getBuilder(n.getZIndex(),"Polygon");u.setFillStrokeStyle(s,a),u.drawPolygon(e,i,r)}const o=n.getText();if(o&&o.getText()){const u=t.getBuilder(n.getZIndex(),"Text");u.setTextStyle(o),u.drawText(e,i,r)}}class qE extends hf{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipExtent_=null,this.extendX_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=vt(),this.wrappedRenderedExtent_=vt(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(e,n,i){const r=n.extent,s=n.viewState,a=s.center,o=s.resolution,u=s.projection,l=s.rotation,c=u.getExtent(),h=this.getLayer().getSource(),f=this.getLayer().getDeclutter(),g=n.pixelRatio,m=n.viewHints,p=!(m[Ke.ANIMATING]||m[Ke.INTERACTING]),_=this.context,E=Math.round(xe(r)/o*g),y=Math.round(nt(r)/o*g),C=h.getWrapX()&&u.canWrapX(),S=C?xe(c):null,w=C?Math.ceil((r[2]-c[2])/S)+(this.extendX_?2:1):1;let L=C?Math.floor((r[0]-c[0])/S)-(this.extendX_?1:0):0;do{let B=this.getRenderTransform(a,o,0,g,E,y,L*S);n.declutter&&(B=B.slice(0)),e.execute(_,[_.canvas.width,_.canvas.height],B,l,p,i===void 0?ui:i?_f:OE,i?f&&n.declutter[f]:void 0)}while(++L<w)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=ve(this.context.canvas.width,this.context.canvas.height,Sc))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){const e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,wa(this.context),Sc.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(e){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,e,!0)}renderDeferredInternal(e){this.replayGroup_&&(this.clipExtent_&&this.clipUnrotated(this.context,e,this.clipExtent_),this.replayGroup_.renderDeferred(),this.clipExtent_&&(this.context.restore(),this.clipExtent_=null),this.resetDrawContext_())}renderFrame(e,n){const i=e.layerStatesArray[e.layerIndex];this.opacity_=i.opacity;const r=e.viewState;this.prepareContainer(e,n);const s=this.context,a=this.replayGroup_;let o=a&&!a.isEmpty();if(!o&&!(this.getLayer().hasListener(Nt.PRERENDER)||this.getLayer().hasListener(Nt.POSTRENDER)))return this.container;this.setDrawContext_(),this.preRender(s,e),r.projection,this.clipExtent_=null;let u=!1;if(o&&i.extent&&this.clipping){const l=Un(i.extent);o=lt(l,e.extent),o&&!kr(l,e.extent)&&(e.declutter?this.clipExtent_=l:(this.clipUnrotated(s,e,l),u=!0))}return o&&this.renderWorlds(a,e,this.getLayer().getDeclutter()?!1:void 0),u&&s.restore(),this.postRender(s,e),this.renderedRotation_!==r.rotation&&(this.renderedRotation_=r.rotation,this.hitDetectionImageData_=null),e.declutter||this.resetDrawContext_(),this.container}getFeatures(e){return new Promise(n=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),r=this.renderedCenter_,s=this.renderedResolution_,a=this.renderedRotation_,o=this.renderedProjection_,u=this.wrappedRenderedExtent_,l=this.getLayer(),c=[],h=i[0]*Qt,f=i[1]*Qt;c.push(this.getRenderTransform(r,s,a,Qt,h,f,0).slice());const g=l.getSource(),m=o.getExtent();if(g.getWrapX()&&o.canWrapX()&&!kr(m,u)){let p=u[0];const _=xe(m);let E=0,y;for(;p<m[0];)--E,y=_*E,c.push(this.getRenderTransform(r,s,a,Qt,h,f,y).slice()),p+=_;for(E=0,p=u[2];p>m[2];)++E,y=_*E,c.push(this.getRenderTransform(r,s,a,Qt,h,f,y).slice()),p-=_}this.hitDetectionImageData_=vE(i,c,this.renderedFeatures_,l.getStyleFunction(),u,s,a,Pc(s,this.renderedPixelRatio_))}n(FE(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,n,i,r,s){if(!this.replayGroup_)return;const a=n.viewState.resolution,o=n.viewState.rotation,u=this.getLayer(),l={},c=function(f,g,m){const p=_e(f),_=l[p];if(_){if(_!==!0&&m<_.distanceSq){if(m===0)return l[p]=!0,s.splice(s.lastIndexOf(_),1),r(f,u,g);_.geometry=g,_.distanceSq=m}}else{if(m===0)return l[p]=!0,r(f,u,g);s.push(l[p]={feature:f,layer:u,geometry:g,distanceSq:m,callback:r})}},h=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,a,o,i,c,h?n.declutter?.[h]?.all().map(f=>f.value):null)}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const n=this.getLayer(),i=n.getSource();if(!i)return!1;const r=e.viewHints[Ke.ANIMATING],s=e.viewHints[Ke.INTERACTING],a=n.getUpdateWhileAnimating(),o=n.getUpdateWhileInteracting();if(this.ready&&!a&&r||!o&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const u=e.extent,l=e.viewState,c=l.projection,h=l.resolution,f=e.pixelRatio,g=n.getRevision(),m=n.getRenderBuffer();let p=n.getRenderOrder();p===void 0&&(p=UE);const _=l.center.slice(),E=Su(u,m*h),y=E.slice(),C=[E.slice()],S=c.getExtent(),w=i.getWrapX()&&c.canWrapX();if(this.extendX_=!1,w){const P=i.getExtent();P&&!gs(P)&&(this.extendX_=P[0]<S[0]||P[2]>S[2])}if(w&&(!kr(S,e.extent)||this.extendX_)){const P=xe(S),K=Math.max(xe(E)/2,P);let q=S[0],$=S[2];this.extendX_&&(q-=P,$+=P),E[0]=q-K,E[2]=$+K,pd(_,c);const Z=gd(C[0],c);Z[0]<S[0]&&Z[2]<S[2]?C.push([Z[0]+P,Z[1],Z[2]+P,Z[3]]):Z[0]>S[0]&&Z[2]>S[2]&&C.push([Z[0]-P,Z[1],Z[2]-P,Z[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedPixelRatio_===f&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&kr(this.wrappedRenderedExtent_,E))return qn(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const L=new AE(yf(h,f),E,h,f);let B;for(let P=0,K=C.length;P<K;++P)i.loadFeatures(C[P],h,c);const v=Pc(h,f);let N=!0;const R=(P,K)=>{let q;const $=P.getStyleFunction()||n.getStyleFunction();if($&&(q=$(P,h)),q){const Z=this.renderFeature(P,v,q,L,B,this.getLayer().getDeclutter(),K);N=N&&!Z}},H=Id(E),U=i.getFeaturesInExtent(H);p&&U.sort(p);for(let P=0,K=U.length;P<K;++P)R(U[P],P);this.renderedFeatures_=U,this.ready=N;const W=L.finish(),j=new DE(E,h,f,i.getOverlaps(),W,n.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=h,this.renderedRevision_=g,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=y,this.wrappedRenderedExtent_=E,this.renderedCenter_=_,this.renderedProjection_=c,this.renderedPixelRatio_=f,this.replayGroup_=j,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,n,i,r,s,a,o){if(!i)return!1;let u=!1;if(Array.isArray(i))for(let l=0,c=i.length;l<c;++l)u=Mc(r,e,i[l],n,this.boundHandleStyleImageChange_,s,a,o)||u;else u=Mc(r,e,i,n,this.boundHandleStyleImageChange_,s,a,o);return u}}class $E extends rf{constructor(e){super(e)}createRenderer(){return new qE(this)}}let ZE=!1;function QE(t,e,n,i,r,s,a){const o=new XMLHttpRequest;o.open("GET",typeof t=="function"?t(n,i,r):t,!0),e.getType()=="arraybuffer"&&(o.responseType="arraybuffer"),o.withCredentials=ZE,o.onload=function(u){if(!o.status||o.status>=200&&o.status<300){const l=e.getType();try{let c;l=="text"||l=="json"?c=o.responseText:l=="xml"?c=o.responseXML||o.responseText:l=="arraybuffer"&&(c=o.response),c?s(e.readFeatures(c,{extent:n,featureProjection:r}),e.readProjection(c)):a()}catch{a()}}else a()},o.onerror=a,o.send()}function vc(t,e){return function(n,i,r,s,a){QE(t,e,n,i,r,(o,u)=>{this.addFeatures(o),s!==void 0&&s(o)},()=>{this.changed(),a!==void 0&&a()})}}function JE(t,e){return[[-1/0,-1/0,1/0,1/0]]}class al extends tn{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const n=e;this.setGeometry(n)}else{const n=e;this.setProperties(n)}}clone(){const e=new al(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const n=this.getGeometry();n&&e.setGeometry(n.clone());const i=this.getStyle();return i&&e.setStyle(i),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(we(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=pe(e,ue.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?eT(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function eT(t){if(typeof t=="function")return t;let e;return Array.isArray(t)?e=t:(be(typeof t.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}function tT(t,e,n,i){const r=[];let s=vt();for(let a=0,o=n.length;a<o;++a){const u=n[a];s=Ru(t,e,u[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=u[u.length-1]}return r}function Fc(t,e,n,i,r,s,a){let o,u;const l=(n-e)/i;if(l===1)o=e;else if(l===2)o=e,u=r;else if(l!==0){let c=t[e],h=t[e+1],f=0;const g=[0];for(let _=e+i;_<n;_+=i){const E=t[_],y=t[_+1];f+=Math.sqrt((E-c)*(E-c)+(y-h)*(y-h)),g.push(f),c=E,h=y}const m=r*f,p=em(g,m);p<0?(u=(m-g[-p-2])/(g[-p-1]-g[-p-2]),o=e+(-p-2)*i):o=e+p*i}a=a>1?a:2,s=s||new Array(a);for(let c=0;c<a;++c)s[c]=o===void 0?NaN:u===void 0?t[o+c]:St(t[o+c],t[o+i+c],u);return s}const Bc=Ht();class Bt{constructor(e,n,i,r,s,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=n,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?cd(this.flatCoordinates_):Ru(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=_i(this.getExtent());this.flatInteriorPoints_=Uu(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=Lp(this.flatCoordinates_,this.ends_),n=tT(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=Cp(this.flatCoordinates_,0,e,2,n)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Fc(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let n=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const a=i[r],o=Fc(e,n,a,2,.5);Iu(this.flatMidpoints_,o),n=a}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,n){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=ht(e);const n=e.getExtent(),i=e.getWorldExtent();if(n&&i){const r=nt(i)/nt(n);Tn(Bc,i[0],i[3],r,-r,0,0,0),Wn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Bc,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new Bt(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=id((e,n)=>{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);const i=this.simplifiedGeometry_.getFlatCoordinates();let r;switch(this.type_){case"LineString":i.length=Bu(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=bp(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,r);break;case"Polygon":r=[],i.length=Nd(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,r);break}return r&&(this.simplifiedGeometry_=new Bt(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}Bt.prototype.getFlatCoordinates=Bt.prototype.getOrientedFlatCoordinates;class Uc{constructor(e){this.rbush_=new Gd(e),this.items_={}}insert(e,n){const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:n};this.rbush_.insert(i),this.items_[_e(n)]=i}load(e,n){const i=new Array(n.length);for(let r=0,s=n.length;r<s;r++){const a=e[r],o=n[r],u={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:o};i[r]=u,this.items_[_e(o)]=u}this.rbush_.load(i)}remove(e){const n=_e(e),i=this.items_[n];return delete this.items_[n],this.rbush_.remove(i)!==null}update(e,n){const i=this.items_[_e(n)],r=[i.minX,i.minY,i.maxX,i.maxY];Zr(r,e)||(this.remove(n),this.insert(e,n))}getAll(){return this.rbush_.all().map(function(n){return n.value})}getInExtent(e){const n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(n).map(function(r){return r.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,n){return this.forEach_(this.getInExtent(e),n)}forEach_(e,n){let i;for(let r=0,s=e.length;r<s;r++)if(i=n(e[r]),i)return i;return i}isEmpty(){return tr(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const n=this.rbush_.toJSON();return Kn(n.minX,n.minY,n.maxX,n.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const n in e.items_)this.items_[n]=e.items_[n]}}const Ct={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class kn extends bn{constructor(e,n,i){super(e),this.feature=n,this.features=i}}class nT extends mf{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=$r,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(be(this.format_,"`format` must be set when `url` is set"),this.loader_=vc(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:JE;const n=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=n?new Uc:null,this.loadedExtentsRtree_=new Uc,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,r;Array.isArray(e.features)?r=e.features:e.features&&(i=e.features,r=i.getArray()),!n&&i===void 0&&(i=new kt(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const n=_e(e);if(!this.addToIndex_(n,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(n,e);const i=e.getGeometry();if(i){const r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,e)}else this.nullGeometryFeatures_[n]=e;this.dispatchEvent(new kn(Ct.ADDFEATURE,e))}setupChangeEvents_(e,n){n instanceof Bt||(this.featureChangeKeys_[e]=[pe(n,ue.CHANGE,this.handleFeatureChange_,this),pe(n,er.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,n){let i=!0;if(n.getId()!==void 0){const r=String(n.getId());if(!(r in this.idIndex_))this.idIndex_[r]=n;else if(n instanceof Bt){const s=this.idIndex_[r];s instanceof Bt?Array.isArray(s)?s.push(n):this.idIndex_[r]=[s,n]:i=!1}else i=!1}return i&&(be(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=n),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const n=[],i=[],r=[];for(let s=0,a=e.length;s<a;s++){const o=e[s],u=_e(o);this.addToIndex_(u,o)&&i.push(o)}for(let s=0,a=i.length;s<a;s++){const o=i[s],u=_e(o);this.setupChangeEvents_(u,o);const l=o.getGeometry();if(l){const c=l.getExtent();n.push(c),r.push(o)}else this.nullGeometryFeatures_[u]=o}if(this.featuresRtree_&&this.featuresRtree_.load(n,r),this.hasListener(Ct.ADDFEATURE))for(let s=0,a=i.length;s<a;s++)this.dispatchEvent(new kn(Ct.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let n=!1;this.addEventListener(Ct.ADDFEATURE,function(i){n||(n=!0,e.push(i.feature),n=!1)}),this.addEventListener(Ct.REMOVEFEATURE,function(i){n||(n=!0,e.remove(i.feature),n=!1)}),e.addEventListener(at.ADD,i=>{n||(n=!0,this.addFeature(i.element),n=!1)}),e.addEventListener(at.REMOVE,i=>{n||(n=!0,this.removeFeature(i.element),n=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(we);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(i=>{this.removeFeatureInternal(i)});for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const n=new kn(Ct.CLEAR);this.dispatchEvent(n),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,n){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(r){const s=r.getGeometry();if(s instanceof Bt||s.intersectsCoordinate(e))return n(r)})}forEachFeatureInExtent(e,n){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,n);this.featuresCollection_&&this.featuresCollection_.forEach(n)}forEachFeatureIntersectingExtent(e,n){return this.forEachFeatureInExtent(e,function(i){const r=i.getGeometry();if(r instanceof Bt||r.intersectsExtent(e)){const s=n(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),tr(this.nullGeometryFeatures_)||Iu(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const n=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){n.push(i)}),n}getFeaturesInExtent(e,n){if(this.featuresRtree_){if(!(n&&n.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const r=md(e,n);return[].concat(...r.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,n){const i=e[0],r=e[1];let s=null;const a=[NaN,NaN];let o=1/0;const u=[-1/0,-1/0,1/0,1/0];return n=n||qr,this.featuresRtree_.forEachInExtent(u,function(l){if(n(l)){const c=l.getGeometry(),h=o;if(o=c instanceof Bt?0:c.closestPointXY(i,r,a,o),o<h){s=l;const f=Math.sqrt(o);u[0]=i-f,u[1]=r-f,u[2]=i+f,u[3]=r+f}}}),s}getExtent(e){return this.featuresRtree_?.getExtent(e)??null}getFeatureById(e){const n=this.idIndex_[e.toString()];return n!==void 0?n:null}getFeatureByUid(e){const n=this.uidIndex_[e];return n!==void 0?n:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const n=e.target,i=_e(n),r=n.getGeometry();if(!r)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(n),this.nullGeometryFeatures_[i]=n);else{const a=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(a,n)):this.featuresRtree_&&this.featuresRtree_.update(a,n)}const s=n.getId();if(s!==void 0){const a=s.toString();this.idIndex_[a]!==n&&(this.removeFromIdIndex_(n),this.idIndex_[a]=n)}else this.removeFromIdIndex_(n),this.uidIndex_[i]=n;this.changed(),this.dispatchEvent(new kn(Ct.CHANGEFEATURE,n))}hasFeature(e){const n=e.getId();return n!==void 0?n in this.idIndex_:_e(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&tr(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,n,i){const r=this.loadedExtentsRtree_,s=this.strategy_(e,n,i);for(let a=0,o=s.length;a<o;++a){const u=s[a];r.forEachInExtent(u,function(c){return kr(c.extent,u)})||(++this.loadingExtentsCount_,this.dispatchEvent(new kn(Ct.FEATURESLOADSTART)),this.loader_.call(this,u,n,i,c=>{--this.loadingExtentsCount_,this.dispatchEvent(new kn(Ct.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new kn(Ct.FEATURESLOADERROR))}),r.insert(u,{extent:u.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const n=this.loadedExtentsRtree_,i=n.forEachInExtent(e,function(r){if(Zr(r.extent,e))return r});i&&n.remove(i)}removeFeatures(e){let n=!1;for(let i=0,r=e.length;i<r;++i)n=this.removeFeatureInternal(e[i])||n;n&&this.changed()}removeFeature(e){if(!e)return;this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const n=_e(e);if(!(n in this.uidIndex_))return!1;n in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[n]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.featureChangeKeys_[n]?.forEach(we),delete this.featureChangeKeys_[n];const r=e.getId();if(r!==void 0){const s=r.toString(),a=this.idIndex_[s];a===e?delete this.idIndex_[s]:Array.isArray(a)&&(a.splice(a.indexOf(e),1),a.length===1&&(this.idIndex_[s]=a[0]))}return delete this.uidIndex_[n],this.hasListener(Ct.REMOVEFEATURE)&&this.dispatchEvent(new kn(Ct.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(const n in this.idIndex_)if(this.idIndex_[n]===e){delete this.idIndex_[n];break}}setLoader(e){this.loader_=e}setUrl(e){be(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(vc(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const iT="_map_7gdrs_1",rT="_empty_7gdrs_8",Hc={map:iT,empty:rT};function sT(t){return typeof t=="object"&&t!==null&&"longitude"in t&&"latitude"in t&&t.longitude&&t.latitude?[t.longitude,t.latitude]:null}const aT=new Xn({image:new Es({radius:7,fill:new bi({color:"#e53e3e"}),stroke:new Ts({color:"#fff",width:2})})});function oT({block:t}){const e=Se.useRef(null),n=Se.useRef(null),{value:i,config:r}=t,s=r?.zoom??12,a=i!=null?sT(i):null;return Se.useEffect(()=>{if(!e.current||!a)return;const o=np(a),u=new al({geometry:new Ra(o)});u.setStyle(aT);const l=new nT({features:[u]}),c=r?.tileUrl?new wc({url:r.tileUrl,attributions:"© OpenStreetMap contributors",crossOrigin:"anonymous"}):new wc({attributions:"© OpenStreetMap contributors",crossOrigin:"anonymous"}),h=new O1({target:e.current,layers:[new Q1({source:c}),new $E({source:l})],view:new Zt({center:o,zoom:s}),controls:[],interactions:[]});return n.current=h,()=>{h.setTarget(void 0),n.current=null}},[a,s,r?.tileUrl]),Se.useEffect(()=>{n.current&&n.current.getView().setZoom(s)},[s]),a?O.jsx("div",{ref:e,className:Hc.map}):O.jsx("span",{className:Hc.empty,children:"—"})}function zc(t){const e=[],n=String(t||"");let i=n.indexOf(","),r=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const a=n.slice(r,i).trim();(a||!s)&&e.push(a),r=i+1,i=n.indexOf(",",r)}return e}function Cf(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const uT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cT={};function Yc(t,e){return(cT.jsx?lT:uT).test(t)}const hT=/[ \t\n\f\r]/g;function dT(t){return typeof t=="object"?t.type==="text"?Gc(t.value):!1:Gc(t)}function Gc(t){return t.replace(hT,"")===""}class xs{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}xs.prototype.normal={};xs.prototype.property={};xs.prototype.space=void 0;function Af(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new xs(n,i,e)}function os(t){return t.toLowerCase()}class dt{constructor(e,n){this.attribute=n,this.property=e}}dt.prototype.attribute="";dt.prototype.booleanish=!1;dt.prototype.boolean=!1;dt.prototype.commaOrSpaceSeparated=!1;dt.prototype.commaSeparated=!1;dt.prototype.defined=!1;dt.prototype.mustUseProperty=!1;dt.prototype.number=!1;dt.prototype.overloadedBoolean=!1;dt.prototype.property="";dt.prototype.spaceSeparated=!1;dt.prototype.space=void 0;let fT=0;const oe=Ii(),Me=Ii(),uu=Ii(),X=Ii(),Ie=Ii(),Qi=Ii(),pt=Ii();function Ii(){return 2**++fT}const lu=Object.freeze(Object.defineProperty({__proto__:null,boolean:oe,booleanish:Me,commaOrSpaceSeparated:pt,commaSeparated:Qi,number:X,overloadedBoolean:uu,spaceSeparated:Ie},Symbol.toStringTag,{value:"Module"})),Io=Object.keys(lu);class ol extends dt{constructor(e,n,i,r){let s=-1;if(super(e,n),jc(this,"space",r),typeof i=="number")for(;++s<Io.length;){const a=Io[s];jc(this,Io[s],(i&lu[a])===lu[a])}}}ol.prototype.defined=!0;function jc(t,e,n){n&&(t[e]=n)}function cr(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const s=new ol(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),e[i]=s,n[os(i)]=i,n[os(s.attribute)]=i}return new xs(e,n,t.space)}const If=cr({properties:{ariaActiveDescendant:null,ariaAtomic:Me,ariaAutoComplete:null,ariaBusy:Me,ariaChecked:Me,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:Ie,ariaCurrent:null,ariaDescribedBy:Ie,ariaDetails:null,ariaDisabled:Me,ariaDropEffect:Ie,ariaErrorMessage:null,ariaExpanded:Me,ariaFlowTo:Ie,ariaGrabbed:Me,ariaHasPopup:null,ariaHidden:Me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ie,ariaLevel:X,ariaLive:null,ariaModal:Me,ariaMultiLine:Me,ariaMultiSelectable:Me,ariaOrientation:null,ariaOwns:Ie,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:Me,ariaReadOnly:Me,ariaRelevant:null,ariaRequired:Me,ariaRoleDescription:Ie,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:Me,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Sf(t,e){return e in t?t[e]:e}function Rf(t,e){return Sf(t,e.toLowerCase())}const gT=cr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qi,acceptCharset:Ie,accessKey:Ie,action:null,allow:null,allowFullScreen:oe,allowPaymentRequest:oe,allowUserMedia:oe,alt:null,as:null,async:oe,autoCapitalize:null,autoComplete:Ie,autoFocus:oe,autoPlay:oe,blocking:Ie,capture:null,charSet:null,checked:oe,cite:null,className:Ie,cols:X,colSpan:null,content:null,contentEditable:Me,controls:oe,controlsList:Ie,coords:X|Qi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oe,defer:oe,dir:null,dirName:null,disabled:oe,download:uu,draggable:Me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oe,formTarget:null,headers:Ie,height:X,hidden:uu,high:X,href:null,hrefLang:null,htmlFor:Ie,httpEquiv:Ie,id:null,imageSizes:null,imageSrcSet:null,inert:oe,inputMode:null,integrity:null,is:null,isMap:oe,itemId:null,itemProp:Ie,itemRef:Ie,itemScope:oe,itemType:Ie,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oe,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:oe,muted:oe,name:null,nonce:null,noModule:oe,noValidate:oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:oe,optimum:X,pattern:null,ping:Ie,placeholder:null,playsInline:oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oe,referrerPolicy:null,rel:Ie,required:oe,reversed:oe,rows:X,rowSpan:X,sandbox:Ie,scope:null,scoped:oe,seamless:oe,selected:oe,shadowRootClonable:oe,shadowRootDelegatesFocus:oe,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:Me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:oe,useMap:null,value:Me,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ie,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oe,declare:oe,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:oe,noHref:oe,noShade:oe,noWrap:oe,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:Me,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:oe,disableRemotePlayback:oe,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:Rf}),mT=cr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pt,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:Ie,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Qi,g2:Qi,glyphName:Qi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:X,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ie,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sf}),Lf=cr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),wf=cr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rf}),kf=cr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),pT={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},_T=/[A-Z]/g,Wc=/-[a-z]/g,ET=/^data[-\w.:]+$/i;function Fa(t,e){const n=os(e);let i=e,r=dt;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ET.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(Wc,bT);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!Wc.test(s)){let a=s.replace(_T,TT);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}r=ol}return new r(i,e)}function TT(t){return"-"+t.toLowerCase()}function bT(t){return t.charAt(1).toUpperCase()}const Cs=Af([If,gT,Lf,wf,kf],"html"),$n=Af([If,mT,Lf,wf,kf],"svg");function Xc(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Of(t){return t.join(" ").trim()}function Nf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fi={},So,Vc;function yT(){if(Vc)return So;Vc=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
8
|
+
`,l="/",c="*",h="",f="comment",g="declaration";function m(_,E){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];E=E||{};var y=1,C=1;function S(j){var P=j.match(e);P&&(y+=P.length);var K=j.lastIndexOf(u);C=~K?j.length-K:C+j.length}function w(){var j={line:y,column:C};return function(P){return P.position=new L(j),N(),P}}function L(j){this.start=j,this.end={line:y,column:C},this.source=E.source}L.prototype.content=_;function B(j){var P=new Error(E.source+":"+y+":"+C+": "+j);if(P.reason=j,P.filename=E.source,P.line=y,P.column=C,P.source=_,!E.silent)throw P}function v(j){var P=j.exec(_);if(P){var K=P[0];return S(K),_=_.slice(K.length),P}}function N(){v(n)}function R(j){var P;for(j=j||[];P=H();)P!==!1&&j.push(P);return j}function H(){var j=w();if(!(l!=_.charAt(0)||c!=_.charAt(1))){for(var P=2;h!=_.charAt(P)&&(c!=_.charAt(P)||l!=_.charAt(P+1));)++P;if(P+=2,h===_.charAt(P-1))return B("End of comment missing");var K=_.slice(2,P-2);return C+=2,S(K),_=_.slice(P),C+=2,j({type:f,comment:K})}}function U(){var j=w(),P=v(i);if(P){if(H(),!v(r))return B("property missing ':'");var K=v(s),q=j({type:g,property:p(P[0].replace(t,h)),value:K?p(K[0].replace(t,h)):h});return v(a),q}}function W(){var j=[];R(j);for(var P;P=U();)P!==!1&&(j.push(P),R(j));return j}return N(),W()}function p(_){return _?_.replace(o,h):h}return So=m,So}var Kc;function xT(){if(Kc)return Fi;Kc=1;var t=Fi&&Fi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=n;const e=t(yT());function n(i,r){let s=null;if(!i||typeof i!="string")return s;const a=(0,e.default)(i),o=typeof r=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:c}=u;o?r(l,c,u):c&&(s=s||{},s[l]=c)}),s}return Fi}var Ar={},qc;function CT(){if(qc)return Ar;qc=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(l){return!l||n.test(l)||t.test(l)},a=function(l,c){return c.toUpperCase()},o=function(l,c){return"".concat(c,"-")},u=function(l,c){return c===void 0&&(c={}),s(l)?l:(l=l.toLowerCase(),c.reactCompat?l=l.replace(r,o):l=l.replace(i,o),l.replace(e,a))};return Ar.camelCase=u,Ar}var Ir,$c;function AT(){if($c)return Ir;$c=1;var t=Ir&&Ir.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(xT()),n=CT();function i(r,s){var a={};return!r||typeof r!="string"||(0,e.default)(r,function(o,u){o&&u&&(a[(0,n.camelCase)(o,s)]=u)}),a}return i.default=i,Ir=i,Ir}var IT=AT();const ST=Nf(IT),Ba=Df("end"),nn=Df("start");function Df(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Pf(t){const e=nn(t),n=Ba(t);if(e&&n)return{start:e,end:n}}function zr(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Zc(t.position):"start"in t||"end"in t?Zc(t):"line"in t||"column"in t?cu(t):""}function cu(t){return Qc(t&&t.line)+":"+Qc(t&&t.column)}function Zc(t){return cu(t&&t.start)+"-"+cu(t&&t.end)}function Qc(t){return t&&typeof t=="number"?t:1}class $e extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?r=e:!s.cause&&e&&(a=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof i=="string"){const u=i.indexOf(":");u===-1?s.ruleId=i:(s.source=i.slice(0,u),s.ruleId=i.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=zr(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$e.prototype.file="";$e.prototype.name="";$e.prototype.reason="";$e.prototype.message="";$e.prototype.stack="";$e.prototype.column=void 0;$e.prototype.line=void 0;$e.prototype.ancestors=void 0;$e.prototype.cause=void 0;$e.prototype.fatal=void 0;$e.prototype.place=void 0;$e.prototype.ruleId=void 0;$e.prototype.source=void 0;const ul={}.hasOwnProperty,RT=new Map,LT=/[A-Z]/g,wT=new Set(["table","tbody","thead","tfoot","tr"]),kT=new Set(["td","th"]),Mf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function OT(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=UT(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=BT(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?$n:Cs,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=vf(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function vf(t,e,n){if(e.type==="element")return NT(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return DT(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return MT(t,e,n);if(e.type==="mdxjsEsm")return PT(t,e);if(e.type==="root")return vT(t,e,n);if(e.type==="text")return FT(t,e)}function NT(t,e,n){const i=t.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=$n,t.schema=r),t.ancestors.push(e);const s=Bf(t,e.tagName,!1),a=HT(t,e);let o=cl(t,e);return wT.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!dT(u):!0})),Ff(t,a,s,e),ll(a,o),t.ancestors.pop(),t.schema=i,t.create(e,s,a,n)}function DT(t,e){if(e.data&&e.data.estree&&t.evaluater){const i=e.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}us(t,e.position)}function PT(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);us(t,e.position)}function MT(t,e,n){const i=t.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=$n,t.schema=r),t.ancestors.push(e);const s=e.name===null?t.Fragment:Bf(t,e.name,!0),a=zT(t,e),o=cl(t,e);return Ff(t,a,s,e),ll(a,o),t.ancestors.pop(),t.schema=i,t.create(e,s,a,n)}function vT(t,e,n){const i={};return ll(i,cl(t,e)),t.create(e,t.Fragment,i,n)}function FT(t,e){return e.value}function Ff(t,e,n,i){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=i)}function ll(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function BT(t,e,n){return i;function i(r,s,a,o){const l=Array.isArray(a.children)?n:e;return o?l(s,a,o):l(s,a)}}function UT(t,e){return n;function n(i,r,s,a){const o=Array.isArray(s.children),u=nn(i);return e(r,s,a,o,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function HT(t,e){const n={};let i,r;for(r in e.properties)if(r!=="children"&&ul.call(e.properties,r)){const s=YT(t,r,e.properties[r]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&kT.has(e.tagName)?i=o:n[a]=o}}if(i){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function zT(t,e){const n={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const s=i.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else us(t,e.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const o=i.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else us(t,e.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function cl(t,e){const n=[];let i=-1;const r=t.passKeys?new Map:RT;for(;++i<e.children.length;){const s=e.children[i];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const l=r.get(u)||0;a=u+"-"+l,r.set(u,l+1)}}const o=vf(t,s,a);o!==void 0&&n.push(o)}return n}function YT(t,e,n){const i=Fa(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?Cf(n):Of(n)),i.property==="style"){let r=typeof n=="object"?n:GT(t,String(n));return t.stylePropertyNameCase==="css"&&(r=jT(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&i.space?pT[i.property]||i.property:i.attribute,n]}}function GT(t,e){try{return ST(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const i=n,r=new $e("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=Mf+"#cannot-parse-style-attribute",r}}function Bf(t,e,n){let i;if(!n)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let s=-1,a;for(;++s<r.length;){const o=Yc(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}i=a}else i=Yc(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return ul.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(i);us(t)}function us(t,e){const n=new $e("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Mf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jT(t){const e={};let n;for(n in t)ul.call(t,n)&&(e[WT(n)]=t[n]);return e}function WT(t){let e=t.replace(LT,XT);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function XT(t){return"-"+t.toLowerCase()}const Ro={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},VT={};function hl(t,e){const n=VT,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Uf(t,i,r)}function Uf(t,e,n){if(KT(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Jc(t.children,e,n)}return Array.isArray(t)?Jc(t,e,n):""}function Jc(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=Uf(t[r],e,n);return i.join("")}function KT(t){return!!(t&&typeof t=="object")}const eh=document.createElement("i");function dl(t){const e="&"+t+";";eh.innerHTML=e;const n=eh.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function _t(t,e,n,i){const r=t.length;let s=0,a;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)a=Array.from(i),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<i.length;)a=i.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function Rt(t,e){return t.length>0?(_t(t,t.length,0,e),t):e}const th={}.hasOwnProperty;function Hf(t){const e={};let n=-1;for(;++n<t.length;)qT(e,t[n]);return e}function qT(t,e){let n;for(n in e){const r=(th.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){th.call(r,a)||(r[a]=[]);const o=s[a];$T(r[a],Array.isArray(o)?o:o?[o]:[])}}}function $T(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);_t(t,0,0,i)}function zf(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function zt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const tt=Zn(/[A-Za-z]/),qe=Zn(/[\dA-Za-z]/),ZT=Zn(/[#-'*+\--9=?A-Z^-~]/);function ha(t){return t!==null&&(t<32||t===127)}const hu=Zn(/\d/),QT=Zn(/[\dA-Fa-f]/),JT=Zn(/[!-/:-@[-`{-~]/);function ee(t){return t!==null&&t<-2}function Ae(t){return t!==null&&(t<0||t===32)}function he(t){return t===-2||t===-1||t===32}const Ua=Zn(new RegExp("\\p{P}|\\p{S}","u")),yi=Zn(/\s/);function Zn(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function hr(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&qe(t.charCodeAt(n+1))&&qe(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),r=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(i,n),encodeURIComponent(a)),i=n+r+1,a=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}function fe(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return he(u)?(t.enter(n),o(u)):e(u)}function o(u){return he(u)&&s++<r?(t.consume(u),o):(t.exit(n),e(u))}}const eb={tokenize:tb};function tb(t){const e=t.attempt(this.parser.constructs.contentInitial,i,r);let n;return e;function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),fe(t,e,"linePrefix")}function r(o){return t.enter("paragraph"),s(o)}function s(o){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return ee(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const nb={tokenize:ib},nh={tokenize:rb};function ib(t){const e=this,n=[];let i=0,r,s,a;return o;function o(C){if(i<n.length){const S=n[i];return e.containerState=S[1],t.attempt(S[0].continuation,u,l)(C)}return l(C)}function u(C){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&y();const S=e.events.length;let w=S,L;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){L=e.events[w][1].end;break}E(i);let B=S;for(;B<e.events.length;)e.events[B][1].end={...L},B++;return _t(e.events,w+1,0,e.events.slice(S)),e.events.length=B,l(C)}return o(C)}function l(C){if(i===n.length){if(!r)return f(C);if(r.currentConstruct&&r.currentConstruct.concrete)return m(C);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(nh,c,h)(C)}function c(C){return r&&y(),E(i),f(C)}function h(C){return e.parser.lazy[e.now().line]=i!==n.length,a=e.now().offset,m(C)}function f(C){return e.containerState={},t.attempt(nh,g,m)(C)}function g(C){return i++,n.push([e.currentConstruct,e.containerState]),f(C)}function m(C){if(C===null){r&&y(),E(0),t.consume(C);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),p(C)}function p(C){if(C===null){_(t.exit("chunkFlow"),!0),E(0),t.consume(C);return}return ee(C)?(t.consume(C),_(t.exit("chunkFlow")),i=0,e.interrupt=void 0,o):(t.consume(C),p)}function _(C,S){const w=e.sliceStream(C);if(S&&w.push(null),C.previous=s,s&&(s.next=C),s=C,r.defineSkip(C.start),r.write(w),e.parser.lazy[C.start.line]){let L=r.events.length;for(;L--;)if(r.events[L][1].start.offset<a&&(!r.events[L][1].end||r.events[L][1].end.offset>a))return;const B=e.events.length;let v=B,N,R;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){if(N){R=e.events[v][1].end;break}N=!0}for(E(i),L=B;L<e.events.length;)e.events[L][1].end={...R},L++;_t(e.events,v+1,0,e.events.slice(B)),e.events.length=L}}function E(C){let S=n.length;for(;S-- >C;){const w=n[S];e.containerState=w[1],w[0].exit.call(e,t)}n.length=C}function y(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function rb(t,e,n){return fe(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ar(t){if(t===null||Ae(t)||yi(t))return 1;if(Ua(t))return 2}function Ha(t,e,n){const i=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!i.includes(s)&&(e=s(e,n),i.push(s))}return e}const du={name:"attention",resolveAll:sb,tokenize:ab};function sb(t,e){let n=-1,i,r,s,a,o,u,l,c;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const h={...t[i][1].end},f={...t[n][1].start};ih(h,-u),ih(f,u),a={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...t[i][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:f},s={type:u>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:u>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[i][1].end={...a.start},t[n][1].start={...o.end},l=[],t[i][1].end.offset-t[i][1].start.offset&&(l=Rt(l,[["enter",t[i][1],e],["exit",t[i][1],e]])),l=Rt(l,[["enter",r,e],["enter",a,e],["exit",a,e],["enter",s,e]]),l=Rt(l,Ha(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),l=Rt(l,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,l=Rt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,_t(t,i-1,n-i+3,l),n=i+l.length-c-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function ab(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=ar(i);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),o(u)}function o(u){if(u===s)return t.consume(u),o;const l=t.exit("attentionSequence"),c=ar(u),h=!c||c===2&&r||n.includes(u),f=!r||r===2&&c||n.includes(i);return l._open=!!(s===42?h:h&&(r||!f)),l._close=!!(s===42?f:f&&(c||!h)),e(u)}}function ih(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const ob={name:"autolink",tokenize:ub};function ub(t,e,n){let i=0;return r;function r(g){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(g),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(g){return tt(g)?(t.consume(g),a):g===64?n(g):l(g)}function a(g){return g===43||g===45||g===46||qe(g)?(i=1,o(g)):l(g)}function o(g){return g===58?(t.consume(g),i=0,u):(g===43||g===45||g===46||qe(g))&&i++<32?(t.consume(g),o):(i=0,l(g))}function u(g){return g===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(g),t.exit("autolinkMarker"),t.exit("autolink"),e):g===null||g===32||g===60||ha(g)?n(g):(t.consume(g),u)}function l(g){return g===64?(t.consume(g),c):ZT(g)?(t.consume(g),l):n(g)}function c(g){return qe(g)?h(g):n(g)}function h(g){return g===46?(t.consume(g),i=0,c):g===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(g),t.exit("autolinkMarker"),t.exit("autolink"),e):f(g)}function f(g){if((g===45||qe(g))&&i++<63){const m=g===45?f:h;return t.consume(g),m}return n(g)}}const As={partial:!0,tokenize:lb};function lb(t,e,n){return i;function i(s){return he(s)?fe(t,r,"linePrefix")(s):r(s)}function r(s){return s===null||ee(s)?e(s):n(s)}}const Yf={continuation:{tokenize:hb},exit:db,name:"blockQuote",tokenize:cb};function cb(t,e,n){const i=this;return r;function r(a){if(a===62){const o=i.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return he(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function hb(t,e,n){const i=this;return r;function r(a){return he(a)?fe(t,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(Yf,e,n)(a)}}function db(t){t.exit("blockQuote")}const Gf={name:"characterEscape",tokenize:fb};function fb(t,e,n){return i;function i(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),r}function r(s){return JT(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const jf={name:"characterReference",tokenize:gb};function gb(t,e,n){const i=this;let r=0,s,a;return o;function o(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),u}function u(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),s=31,a=qe,c(h))}function l(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=QT,c):(t.enter("characterReferenceValue"),s=7,a=hu,c(h))}function c(h){if(h===59&&r){const f=t.exit("characterReferenceValue");return a===qe&&!dl(i.sliceSerialize(f))?n(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(h)&&r++<s?(t.consume(h),c):n(h)}}const rh={partial:!0,tokenize:pb},sh={concrete:!0,name:"codeFenced",tokenize:mb};function mb(t,e,n){const i=this,r={partial:!0,tokenize:w};let s=0,a=0,o;return u;function u(L){return l(L)}function l(L){const B=i.events[i.events.length-1];return s=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,o=L,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(L)}function c(L){return L===o?(a++,t.consume(L),c):a<3?n(L):(t.exit("codeFencedFenceSequence"),he(L)?fe(t,h,"whitespace")(L):h(L))}function h(L){return L===null||ee(L)?(t.exit("codeFencedFence"),i.interrupt?e(L):t.check(rh,p,S)(L)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),f(L))}function f(L){return L===null||ee(L)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(L)):he(L)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),fe(t,g,"whitespace")(L)):L===96&&L===o?n(L):(t.consume(L),f)}function g(L){return L===null||ee(L)?h(L):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(L))}function m(L){return L===null||ee(L)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(L)):L===96&&L===o?n(L):(t.consume(L),m)}function p(L){return t.attempt(r,S,_)(L)}function _(L){return t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),E}function E(L){return s>0&&he(L)?fe(t,y,"linePrefix",s+1)(L):y(L)}function y(L){return L===null||ee(L)?t.check(rh,p,S)(L):(t.enter("codeFlowValue"),C(L))}function C(L){return L===null||ee(L)?(t.exit("codeFlowValue"),y(L)):(t.consume(L),C)}function S(L){return t.exit("codeFenced"),e(L)}function w(L,B,v){let N=0;return R;function R(P){return L.enter("lineEnding"),L.consume(P),L.exit("lineEnding"),H}function H(P){return L.enter("codeFencedFence"),he(P)?fe(L,U,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):U(P)}function U(P){return P===o?(L.enter("codeFencedFenceSequence"),W(P)):v(P)}function W(P){return P===o?(N++,L.consume(P),W):N>=a?(L.exit("codeFencedFenceSequence"),he(P)?fe(L,j,"whitespace")(P):j(P)):v(P)}function j(P){return P===null||ee(P)?(L.exit("codeFencedFence"),B(P)):v(P)}}}function pb(t,e,n){const i=this;return r;function r(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return i.parser.lazy[i.now().line]?n(a):e(a)}}const Lo={name:"codeIndented",tokenize:Eb},_b={partial:!0,tokenize:Tb};function Eb(t,e,n){const i=this;return r;function r(l){return t.enter("codeIndented"),fe(t,s,"linePrefix",5)(l)}function s(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(l):n(l)}function a(l){return l===null?u(l):ee(l)?t.attempt(_b,a,u)(l):(t.enter("codeFlowValue"),o(l))}function o(l){return l===null||ee(l)?(t.exit("codeFlowValue"),a(l)):(t.consume(l),o)}function u(l){return t.exit("codeIndented"),e(l)}}function Tb(t,e,n){const i=this;return r;function r(a){return i.parser.lazy[i.now().line]?n(a):ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),r):fe(t,s,"linePrefix",5)(a)}function s(a){const o=i.events[i.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):ee(a)?r(a):n(a)}}const bb={name:"codeText",previous:xb,resolve:yb,tokenize:Cb};function yb(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function xb(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Cb(t,e,n){let i=0,r,s;return a;function a(h){return t.enter("codeText"),t.enter("codeTextSequence"),o(h)}function o(h){return h===96?(t.consume(h),i++,o):(t.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),u):h===96?(s=t.enter("codeTextSequence"),r=0,c(h)):ee(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("codeTextData"),l(h))}function l(h){return h===null||h===32||h===96||ee(h)?(t.exit("codeTextData"),u(h)):(t.consume(h),l)}function c(h){return h===96?(t.consume(h),r++,c):r===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(h)):(s.type="codeTextData",l(h))}}class Ab{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&Sr(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Sr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Sr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Sr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Sr(this.left,n.reverse())}}}function Sr(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Wf(t){const e={};let n=-1,i,r,s,a,o,u,l;const c=new Ab(t);for(;++n<c.length;){for(;n in e;)n=e[n];if(i=c.get(n),n&&i[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=i[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,Ib(c,n)),n=e[n],l=!0);else if(i[1]._container){for(s=n,r=void 0;s--;)if(a=c.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(r&&(c.get(r)[1].type="lineEndingBlank"),a[1].type="lineEnding",r=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;r&&(i[1].end={...c.get(r)[1].start},o=c.slice(r,n),o.unshift(i),c.splice(r,n-r+1,o))}}return _t(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Ib(t,e){const n=t.get(e)[1],i=t.get(e)[2];let r=e-1;const s=[];let a=n._tokenizer;a||(a=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],l={};let c,h,f=-1,g=n,m=0,p=0;const _=[p];for(;g;){for(;t.get(++r)[1]!==g;);s.push(r),g._tokenizer||(c=i.sliceStream(g),g.next||c.push(null),h&&a.defineSkip(g.start),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(p=f+1,_.push(p),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(a.events=[],g?(g._tokenizer=void 0,g.previous=void 0):_.pop(),f=_.length;f--;){const E=o.slice(_[f],_[f+1]),y=s.pop();u.push([y,y+E.length-1]),t.splice(y,2,E)}for(u.reverse(),f=-1;++f<u.length;)l[m+u[f][0]]=m+u[f][1],m+=u[f][1]-u[f][0]-1;return l}const Sb={resolve:Lb,tokenize:wb},Rb={partial:!0,tokenize:kb};function Lb(t){return Wf(t),t}function wb(t,e){let n;return i;function i(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(o)}function r(o){return o===null?s(o):ee(o)?t.check(Rb,a,s)(o):(t.consume(o),r)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function kb(t,e,n){const i=this;return r;function r(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),fe(t,s,"linePrefix")}function s(a){if(a===null||ee(a))return n(a);const o=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(i.parser.constructs.flow,n,e)(a)}}function Xf(t,e,n,i,r,s,a,o,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return h;function h(E){return E===60?(t.enter(i),t.enter(r),t.enter(s),t.consume(E),t.exit(s),f):E===null||E===32||E===41||ha(E)?n(E):(t.enter(i),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),p(E))}function f(E){return E===62?(t.enter(s),t.consume(E),t.exit(s),t.exit(r),t.exit(i),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===62?(t.exit("chunkString"),t.exit(o),f(E)):E===null||E===60||ee(E)?n(E):(t.consume(E),E===92?m:g)}function m(E){return E===60||E===62||E===92?(t.consume(E),g):g(E)}function p(E){return!c&&(E===null||E===41||Ae(E))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(i),e(E)):c<l&&E===40?(t.consume(E),c++,p):E===41?(t.consume(E),c--,p):E===null||E===32||E===40||ha(E)?n(E):(t.consume(E),E===92?_:p)}function _(E){return E===40||E===41||E===92?(t.consume(E),p):p(E)}}function Vf(t,e,n,i,r,s){const a=this;let o=0,u;return l;function l(g){return t.enter(i),t.enter(r),t.consume(g),t.exit(r),t.enter(s),c}function c(g){return o>999||g===null||g===91||g===93&&!u||g===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(g):g===93?(t.exit(s),t.enter(r),t.consume(g),t.exit(r),t.exit(i),e):ee(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||ee(g)||o++>999?(t.exit("chunkString"),c(g)):(t.consume(g),u||(u=!he(g)),g===92?f:h)}function f(g){return g===91||g===92||g===93?(t.consume(g),o++,h):h(g)}}function Kf(t,e,n,i,r,s){let a;return o;function o(f){return f===34||f===39||f===40?(t.enter(i),t.enter(r),t.consume(f),t.exit(r),a=f===40?41:f,u):n(f)}function u(f){return f===a?(t.enter(r),t.consume(f),t.exit(r),t.exit(i),e):(t.enter(s),l(f))}function l(f){return f===a?(t.exit(s),u(a)):f===null?n(f):ee(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),fe(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===a||f===null||ee(f)?(t.exit("chunkString"),l(f)):(t.consume(f),f===92?h:c)}function h(f){return f===a||f===92?(t.consume(f),c):c(f)}}function Yr(t,e){let n;return i;function i(r){return ee(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):he(r)?fe(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}const Ob={name:"definition",tokenize:Db},Nb={partial:!0,tokenize:Pb};function Db(t,e,n){const i=this;let r;return s;function s(g){return t.enter("definition"),a(g)}function a(g){return Vf.call(i,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return r=zt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),u):n(g)}function u(g){return Ae(g)?Yr(t,l)(g):l(g)}function l(g){return Xf(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function c(g){return t.attempt(Nb,h,h)(g)}function h(g){return he(g)?fe(t,f,"whitespace")(g):f(g)}function f(g){return g===null||ee(g)?(t.exit("definition"),i.parser.defined.push(r),e(g)):n(g)}}function Pb(t,e,n){return i;function i(o){return Ae(o)?Yr(t,r)(o):n(o)}function r(o){return Kf(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return he(o)?fe(t,a,"whitespace")(o):a(o)}function a(o){return o===null||ee(o)?e(o):n(o)}}const Mb={name:"hardBreakEscape",tokenize:vb};function vb(t,e,n){return i;function i(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return ee(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const Fb={name:"headingAtx",resolve:Bb,tokenize:Ub};function Bb(t,e){let n=t.length-2,i=3,r,s;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},s={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},_t(t,i,n-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function Ub(t,e,n){let i=0;return r;function r(c){return t.enter("atxHeading"),s(c)}function s(c){return t.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&i++<6?(t.consume(c),a):c===null||Ae(c)?(t.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(t.enter("atxHeadingSequence"),u(c)):c===null||ee(c)?(t.exit("atxHeading"),e(c)):he(c)?fe(t,o,"whitespace")(c):(t.enter("atxHeadingText"),l(c))}function u(c){return c===35?(t.consume(c),u):(t.exit("atxHeadingSequence"),o(c))}function l(c){return c===null||c===35||Ae(c)?(t.exit("atxHeadingText"),o(c)):(t.consume(c),l)}}const Hb=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ah=["pre","script","style","textarea"],zb={concrete:!0,name:"htmlFlow",resolveTo:jb,tokenize:Wb},Yb={partial:!0,tokenize:Vb},Gb={partial:!0,tokenize:Xb};function jb(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Wb(t,e,n){const i=this;let r,s,a,o,u;return l;function l(I){return c(I)}function c(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),h}function h(I){return I===33?(t.consume(I),f):I===47?(t.consume(I),s=!0,p):I===63?(t.consume(I),r=3,i.interrupt?e:x):tt(I)?(t.consume(I),a=String.fromCharCode(I),_):n(I)}function f(I){return I===45?(t.consume(I),r=2,g):I===91?(t.consume(I),r=5,o=0,m):tt(I)?(t.consume(I),r=4,i.interrupt?e:x):n(I)}function g(I){return I===45?(t.consume(I),i.interrupt?e:x):n(I)}function m(I){const Ce="CDATA[";return I===Ce.charCodeAt(o++)?(t.consume(I),o===Ce.length?i.interrupt?e:U:m):n(I)}function p(I){return tt(I)?(t.consume(I),a=String.fromCharCode(I),_):n(I)}function _(I){if(I===null||I===47||I===62||Ae(I)){const Ce=I===47,Y=a.toLowerCase();return!Ce&&!s&&ah.includes(Y)?(r=1,i.interrupt?e(I):U(I)):Hb.includes(a.toLowerCase())?(r=6,Ce?(t.consume(I),E):i.interrupt?e(I):U(I)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(I):s?y(I):C(I))}return I===45||qe(I)?(t.consume(I),a+=String.fromCharCode(I),_):n(I)}function E(I){return I===62?(t.consume(I),i.interrupt?e:U):n(I)}function y(I){return he(I)?(t.consume(I),y):R(I)}function C(I){return I===47?(t.consume(I),R):I===58||I===95||tt(I)?(t.consume(I),S):he(I)?(t.consume(I),C):R(I)}function S(I){return I===45||I===46||I===58||I===95||qe(I)?(t.consume(I),S):w(I)}function w(I){return I===61?(t.consume(I),L):he(I)?(t.consume(I),w):C(I)}function L(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(t.consume(I),u=I,B):he(I)?(t.consume(I),L):v(I)}function B(I){return I===u?(t.consume(I),u=null,N):I===null||ee(I)?n(I):(t.consume(I),B)}function v(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Ae(I)?w(I):(t.consume(I),v)}function N(I){return I===47||I===62||he(I)?C(I):n(I)}function R(I){return I===62?(t.consume(I),H):n(I)}function H(I){return I===null||ee(I)?U(I):he(I)?(t.consume(I),H):n(I)}function U(I){return I===45&&r===2?(t.consume(I),K):I===60&&r===1?(t.consume(I),q):I===62&&r===4?(t.consume(I),ie):I===63&&r===3?(t.consume(I),x):I===93&&r===5?(t.consume(I),Z):ee(I)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(Yb,se,W)(I)):I===null||ee(I)?(t.exit("htmlFlowData"),W(I)):(t.consume(I),U)}function W(I){return t.check(Gb,j,se)(I)}function j(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),P}function P(I){return I===null||ee(I)?W(I):(t.enter("htmlFlowData"),U(I))}function K(I){return I===45?(t.consume(I),x):U(I)}function q(I){return I===47?(t.consume(I),a="",$):U(I)}function $(I){if(I===62){const Ce=a.toLowerCase();return ah.includes(Ce)?(t.consume(I),ie):U(I)}return tt(I)&&a.length<8?(t.consume(I),a+=String.fromCharCode(I),$):U(I)}function Z(I){return I===93?(t.consume(I),x):U(I)}function x(I){return I===62?(t.consume(I),ie):I===45&&r===2?(t.consume(I),x):U(I)}function ie(I){return I===null||ee(I)?(t.exit("htmlFlowData"),se(I)):(t.consume(I),ie)}function se(I){return t.exit("htmlFlow"),e(I)}}function Xb(t,e,n){const i=this;return r;function r(a){return ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return i.parser.lazy[i.now().line]?n(a):e(a)}}function Vb(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(As,e,n)}}const Kb={name:"htmlText",tokenize:qb};function qb(t,e,n){const i=this;let r,s,a;return o;function o(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),u}function u(x){return x===33?(t.consume(x),l):x===47?(t.consume(x),w):x===63?(t.consume(x),C):tt(x)?(t.consume(x),v):n(x)}function l(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),s=0,m):tt(x)?(t.consume(x),y):n(x)}function c(x){return x===45?(t.consume(x),g):n(x)}function h(x){return x===null?n(x):x===45?(t.consume(x),f):ee(x)?(a=h,q(x)):(t.consume(x),h)}function f(x){return x===45?(t.consume(x),g):h(x)}function g(x){return x===62?K(x):x===45?f(x):h(x)}function m(x){const ie="CDATA[";return x===ie.charCodeAt(s++)?(t.consume(x),s===ie.length?p:m):n(x)}function p(x){return x===null?n(x):x===93?(t.consume(x),_):ee(x)?(a=p,q(x)):(t.consume(x),p)}function _(x){return x===93?(t.consume(x),E):p(x)}function E(x){return x===62?K(x):x===93?(t.consume(x),E):p(x)}function y(x){return x===null||x===62?K(x):ee(x)?(a=y,q(x)):(t.consume(x),y)}function C(x){return x===null?n(x):x===63?(t.consume(x),S):ee(x)?(a=C,q(x)):(t.consume(x),C)}function S(x){return x===62?K(x):C(x)}function w(x){return tt(x)?(t.consume(x),L):n(x)}function L(x){return x===45||qe(x)?(t.consume(x),L):B(x)}function B(x){return ee(x)?(a=B,q(x)):he(x)?(t.consume(x),B):K(x)}function v(x){return x===45||qe(x)?(t.consume(x),v):x===47||x===62||Ae(x)?N(x):n(x)}function N(x){return x===47?(t.consume(x),K):x===58||x===95||tt(x)?(t.consume(x),R):ee(x)?(a=N,q(x)):he(x)?(t.consume(x),N):K(x)}function R(x){return x===45||x===46||x===58||x===95||qe(x)?(t.consume(x),R):H(x)}function H(x){return x===61?(t.consume(x),U):ee(x)?(a=H,q(x)):he(x)?(t.consume(x),H):N(x)}function U(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(t.consume(x),r=x,W):ee(x)?(a=U,q(x)):he(x)?(t.consume(x),U):(t.consume(x),j)}function W(x){return x===r?(t.consume(x),r=void 0,P):x===null?n(x):ee(x)?(a=W,q(x)):(t.consume(x),W)}function j(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||Ae(x)?N(x):(t.consume(x),j)}function P(x){return x===47||x===62||Ae(x)?N(x):n(x)}function K(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):n(x)}function q(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),$}function $(x){return he(x)?fe(t,Z,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):Z(x)}function Z(x){return t.enter("htmlTextData"),a(x)}}const fl={name:"labelEnd",resolveAll:Jb,resolveTo:ey,tokenize:ty},$b={tokenize:ny},Zb={tokenize:iy},Qb={tokenize:ry};function Jb(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&_t(t,0,t.length,n),t}function ey(t,e){let n=t.length,i=0,r,s,a,o;for(;n--;)if(r=t[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},c={type:"labelText",start:{...t[s+i+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",u,e],["enter",l,e]],o=Rt(o,t.slice(s+1,s+i+3)),o=Rt(o,[["enter",c,e]]),o=Rt(o,Ha(e.parser.constructs.insideSpan.null,t.slice(s+i+4,a-3),e)),o=Rt(o,[["exit",c,e],t[a-2],t[a-1],["exit",l,e]]),o=Rt(o,t.slice(a+1)),o=Rt(o,[["exit",u,e]]),_t(t,s,t.length,o),t}function ty(t,e,n){const i=this;let r=i.events.length,s,a;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return o;function o(f){return s?s._inactive?h(f):(a=i.parser.defined.includes(zt(i.sliceSerialize({start:s.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelEnd"),u):n(f)}function u(f){return f===40?t.attempt($b,c,a?c:h)(f):f===91?t.attempt(Zb,c,a?l:h)(f):a?c(f):h(f)}function l(f){return t.attempt(Qb,c,h)(f)}function c(f){return e(f)}function h(f){return s._balanced=!0,n(f)}}function ny(t,e,n){return i;function i(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),r}function r(h){return Ae(h)?Yr(t,s)(h):s(h)}function s(h){return h===41?c(h):Xf(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return Ae(h)?Yr(t,u)(h):c(h)}function o(h){return n(h)}function u(h){return h===34||h===39||h===40?Kf(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function l(h){return Ae(h)?Yr(t,c)(h):c(h)}function c(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):n(h)}}function iy(t,e,n){const i=this;return r;function r(o){return Vf.call(i,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return i.parser.defined.includes(zt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function ry(t,e,n){return i;function i(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),r}function r(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const sy={name:"labelStartImage",resolveAll:fl.resolveAll,tokenize:ay};function ay(t,e,n){const i=this;return r;function r(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):e(o)}}const oy={name:"labelStartLink",resolveAll:fl.resolveAll,tokenize:uy};function uy(t,e,n){const i=this;return r;function r(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):e(a)}}const wo={name:"lineEnding",tokenize:ly};function ly(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),fe(t,e,"linePrefix")}}const qs={name:"thematicBreak",tokenize:cy};function cy(t,e,n){let i=0,r;return s;function s(l){return t.enter("thematicBreak"),a(l)}function a(l){return r=l,o(l)}function o(l){return l===r?(t.enter("thematicBreakSequence"),u(l)):i>=3&&(l===null||ee(l))?(t.exit("thematicBreak"),e(l)):n(l)}function u(l){return l===r?(t.consume(l),i++,u):(t.exit("thematicBreakSequence"),he(l)?fe(t,o,"whitespace")(l):o(l))}}const st={continuation:{tokenize:gy},exit:py,name:"list",tokenize:fy},hy={partial:!0,tokenize:_y},dy={partial:!0,tokenize:my};function fy(t,e,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,a=0;return o;function o(g){const m=i.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||g===i.containerState.marker:hu(g)){if(i.containerState.type||(i.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),g===42||g===45?t.check(qs,n,l)(g):l(g);if(!i.interrupt||g===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(g)}return n(g)}function u(g){return hu(g)&&++a<10?(t.consume(g),u):(!i.interrupt||a<2)&&(i.containerState.marker?g===i.containerState.marker:g===41||g===46)?(t.exit("listItemValue"),l(g)):n(g)}function l(g){return t.enter("listItemMarker"),t.consume(g),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||g,t.check(As,i.interrupt?n:c,t.attempt(hy,f,h))}function c(g){return i.containerState.initialBlankLine=!0,s++,f(g)}function h(g){return he(g)?(t.enter("listItemPrefixWhitespace"),t.consume(g),t.exit("listItemPrefixWhitespace"),f):n(g)}function f(g){return i.containerState.size=s+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(g)}}function gy(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(As,r,s);function r(o){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,fe(t,e,"listItemIndent",i.containerState.size+1)(o)}function s(o){return i.containerState.furtherBlankLines||!he(o)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,a(o)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(dy,e,a)(o))}function a(o){return i.containerState._closeFlow=!0,i.interrupt=void 0,fe(t,t.attempt(st,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function my(t,e,n){const i=this;return fe(t,r,"listItemIndent",i.containerState.size+1);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===i.containerState.size?e(s):n(s)}}function py(t){t.exit(this.containerState.type)}function _y(t,e,n){const i=this;return fe(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const a=i.events[i.events.length-1];return!he(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const oh={name:"setextUnderline",resolveTo:Ey,tokenize:Ty};function Ey(t,e){let n=t.length,i,r,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",a,e]),t.splice(s+1,0,["exit",t[i][1],e]),t[i][1].end={...t[s][1].end}):t[i][1]=a,t.push(["exit",a,e]),t}function Ty(t,e,n){const i=this;let r;return s;function s(l){let c=i.events.length,h;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){h=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||h)?(t.enter("setextHeadingLine"),r=l,a(l)):n(l)}function a(l){return t.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===r?(t.consume(l),o):(t.exit("setextHeadingLineSequence"),he(l)?fe(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||ee(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const by={tokenize:yy};function yy(t){const e=this,n=t.attempt(As,i,t.attempt(this.parser.constructs.flowInitial,r,fe(t,t.attempt(this.parser.constructs.flow,r,t.attempt(Sb,r)),"linePrefix")));return n;function i(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const xy={resolveAll:$f()},Cy=qf("string"),Ay=qf("text");function qf(t){return{resolveAll:$f(t==="text"?Iy:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],s=n.attempt(r,a,o);return a;function a(c){return l(c)?s(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return l(c)?(n.exit("data"),s(c)):(n.consume(c),u)}function l(c){if(c===null)return!0;const h=r[c];let f=-1;if(h)for(;++f<h.length;){const g=h[f];if(!g.previous||g.previous.call(i,i.previous))return!0}return!1}}}function $f(t){return e;function e(n,i){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return t?t(n,i):n}}function Iy(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],r=e.sliceStream(i);let s=r.length,a=-1,o=0,u;for(;s--;){const l=r[s];if(typeof l=="string"){for(a=l.length;l.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(l===-2)u=!0,o++;else if(l!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const l={type:n===t.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:i.start._bufferIndex+a,_index:i.start._index+s,line:i.end.line,column:i.end.column-o,offset:i.end.offset-o},end:{...i.end}};i.end={...l.start},i.start.offset===i.end.offset?Object.assign(i,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const Sy={42:st,43:st,45:st,48:st,49:st,50:st,51:st,52:st,53:st,54:st,55:st,56:st,57:st,62:Yf},Ry={91:Ob},Ly={[-2]:Lo,[-1]:Lo,32:Lo},wy={35:Fb,42:qs,45:[oh,qs],60:zb,61:oh,95:qs,96:sh,126:sh},ky={38:jf,92:Gf},Oy={[-5]:wo,[-4]:wo,[-3]:wo,33:sy,38:jf,42:du,60:[ob,Kb],91:oy,92:[Mb,Gf],93:fl,95:du,96:bb},Ny={null:[du,xy]},Dy={null:[42,95]},Py={null:[]},My=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Dy,contentInitial:Ry,disable:Py,document:Sy,flow:wy,flowInitial:Ly,insideSpan:Ny,string:ky,text:Oy},Symbol.toStringTag,{value:"Module"}));function vy(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let a=[],o=[];const u={attempt:B(w),check:B(L),consume:y,enter:C,exit:S,interrupt:B(L,{interrupt:!0})},l={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:t,previous:null,sliceSerialize:f,sliceStream:g,write:h};let c=e.tokenize.call(l,u);return e.resolveAll&&s.push(e),l;function h(H){return a=Rt(a,H),_(),a[a.length-1]!==null?[]:(v(e,0),l.events=Ha(s,l.events,l),l.events)}function f(H,U){return By(g(H),U)}function g(H){return Fy(a,H)}function m(){const{_bufferIndex:H,_index:U,line:W,column:j,offset:P}=i;return{_bufferIndex:H,_index:U,line:W,column:j,offset:P}}function p(H){r[H.line]=H.column,R()}function _(){let H;for(;i._index<a.length;){const U=a[i._index];if(typeof U=="string")for(H=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===H&&i._bufferIndex<U.length;)E(U.charCodeAt(i._bufferIndex));else E(U)}}function E(H){c=c(H)}function y(H){ee(H)?(i.line++,i.column=1,i.offset+=H===-3?2:1,R()):H!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===a[i._index].length&&(i._bufferIndex=-1,i._index++)),l.previous=H}function C(H,U){const W=U||{};return W.type=H,W.start=m(),l.events.push(["enter",W,l]),o.push(W),W}function S(H){const U=o.pop();return U.end=m(),l.events.push(["exit",U,l]),U}function w(H,U){v(H,U.from)}function L(H,U){U.restore()}function B(H,U){return W;function W(j,P,K){let q,$,Z,x;return Array.isArray(j)?se(j):"tokenize"in j?se([j]):ie(j);function ie(Te){return Re;function Re(Pe){const je=Pe!==null&&Te[Pe],Fe=Pe!==null&&Te.null,Wt=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return se(Wt)(Pe)}}function se(Te){return q=Te,$=0,Te.length===0?K:I(Te[$])}function I(Te){return Re;function Re(Pe){return x=N(),Z=Te,Te.partial||(l.currentConstruct=Te),Te.name&&l.parser.constructs.disable.null.includes(Te.name)?Y():Te.tokenize.call(U?Object.assign(Object.create(l),U):l,u,Ce,Y)(Pe)}}function Ce(Te){return H(Z,x),P}function Y(Te){return x.restore(),++$<q.length?I(q[$]):K}}}function v(H,U){H.resolveAll&&!s.includes(H)&&s.push(H),H.resolve&&_t(l.events,U,l.events.length-U,H.resolve(l.events.slice(U),l)),H.resolveTo&&(l.events=H.resolveTo(l.events,l))}function N(){const H=m(),U=l.previous,W=l.currentConstruct,j=l.events.length,P=Array.from(o);return{from:j,restore:K};function K(){i=H,l.previous=U,l.currentConstruct=W,l.events.length=j,o=P,R()}}function R(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function Fy(t,e){const n=e.start._index,i=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex;let a;if(n===r)a=[t[n].slice(i,s)];else{if(a=t.slice(n,r),i>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(i):a.shift()}s>0&&a.push(t[r].slice(0,s))}return a}function By(t,e){let n=-1;const i=[];let r;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
9
|
+
`;break}case-3:{a=`\r
|
|
10
|
+
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&r)continue;a=" ";break}default:a=String.fromCharCode(s)}r=s===-2,i.push(a)}return i.join("")}function Uy(t){const i={constructs:Hf([My,...(t||{}).extensions||[]]),content:r(eb),defined:[],document:r(nb),flow:r(by),lazy:{},string:r(Cy),text:r(Ay)};return i;function r(s){return a;function a(o){return vy(i,s,o)}}}function Hy(t){for(;!Wf(t););return t}const uh=/[\0\t\n\r]/g;function zy(){let t=1,e="",n=!0,i;return r;function r(s,a,o){const u=[];let l,c,h,f,g;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,e="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(uh.lastIndex=h,l=uh.exec(s),f=l&&l.index!==void 0?l.index:s.length,g=s.charCodeAt(f),!l){e=s.slice(h);break}if(g===10&&h===f&&i)u.push(-3),i=void 0;else switch(i&&(u.push(-5),i=void 0),h<f&&(u.push(s.slice(h,f)),t+=f-h),g){case 0:{u.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,u.push(-2);t++<c;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:i=!0,t=1}h=f+1}return o&&(i&&u.push(-5),e&&u.push(e),u.push(null)),u}}const Yy=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Gy(t){return t.replace(Yy,jy)}function jy(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return zf(n.slice(s?2:1),s?16:10)}return dl(n)||t}const Zf={}.hasOwnProperty;function Wy(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),Xy(n)(Hy(Uy(n).document().write(zy()(t,e,!0))))}function Xy(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Jn),autolinkProtocol:N,autolinkEmail:N,atxHeading:s(ft),blockQuote:s(Fe),characterEscape:N,characterReference:N,codeFenced:s(Wt),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Wt,a),codeText:s(Ri,a),codeTextData:N,data:N,codeFlowValue:N,definition:s(Qn),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(mr),hardBreakEscape:s(it),hardBreakTrailing:s(it),htmlFlow:s(gt,a),htmlFlowData:N,htmlText:s(gt,a),htmlTextData:N,image:s(Xt),label:a,link:s(Jn),listItem:s(An),listItemValue:f,listOrdered:s(Cn,h),listUnordered:s(Cn),paragraph:s(Li),reference:I,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(ft),strong:s(Ue),thematicBreak:s(wi)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:je,autolinkProtocol:Pe,blockQuote:u(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:Te,characterReference:Re,codeFenced:u(_),codeFencedFence:p,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:u(E),codeText:u(P),codeTextData:R,data:R,definition:u(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(U),hardBreakTrailing:u(U),htmlFlow:u(W),htmlFlowData:R,htmlText:u(j),htmlTextData:R,image:u(q),label:Z,labelText:$,lineEnding:H,link:u(K),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Ce,resourceDestinationString:x,resourceTitleString:ie,resource:se,setextHeading:u(v),setextHeadingLineSequence:B,setextHeadingText:L,strong:u(),thematicBreak:u()}};Qf(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(M){let V={type:"root",children:[]};const te={stack:[V],tokenStack:[],config:e,enter:o,exit:l,buffer:a,resume:c,data:n},le=[];let ge=-1;for(;++ge<M.length;)if(M[ge][1].type==="listOrdered"||M[ge][1].type==="listUnordered")if(M[ge][0]==="enter")le.push(ge);else{const mt=le.pop();ge=r(M,mt,ge)}for(ge=-1;++ge<M.length;){const mt=e[M[ge][0]];Zf.call(mt,M[ge][1].type)&&mt[M[ge][1].type].call(Object.assign({sliceSerialize:M[ge][2].sliceSerialize},te),M[ge][1])}if(te.tokenStack.length>0){const mt=te.tokenStack[te.tokenStack.length-1];(mt[1]||lh).call(te,void 0,mt[0])}for(V.position={start:On(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:On(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;++ge<e.transforms.length;)V=e.transforms[ge](V)||V;return V}function r(M,V,te){let le=V-1,ge=-1,mt=!1,Vt,Et,sn,ei;for(;++le<=te;){const Qe=M[le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?ge++:ge--,ei=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Vt&&!ei&&!ge&&!sn&&(sn=le),ei=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ei=void 0}if(!ge&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||ge===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Vt){let an=le;for(Et=void 0;an--;){const Tt=M[an];if(Tt[1].type==="lineEnding"||Tt[1].type==="lineEndingBlank"){if(Tt[0]==="exit")continue;Et&&(M[Et][1].type="lineEndingBlank",mt=!0),Tt[1].type="lineEnding",Et=an}else if(!(Tt[1].type==="linePrefix"||Tt[1].type==="blockQuotePrefix"||Tt[1].type==="blockQuotePrefixWhitespace"||Tt[1].type==="blockQuoteMarker"||Tt[1].type==="listItemIndent"))break}sn&&(!Et||sn<Et)&&(Vt._spread=!0),Vt.end=Object.assign({},Et?M[Et][1].start:Qe[1].end),M.splice(Et||le,0,["exit",Vt,Qe[2]]),le++,te++}if(Qe[1].type==="listItemPrefix"){const an={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Vt=an,M.splice(le,0,["enter",an,Qe[2]]),le++,te++,sn=void 0,ei=!0}}}return M[V][1]._spread=mt,te}function s(M,V){return te;function te(le){o.call(this,M(le),le),V&&V.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(M,V,te){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([V,te||void 0]),M.position={start:On(V.start),end:void 0}}function u(M){return V;function V(te){M&&M.call(this,te),l.call(this,te)}}function l(M,V){const te=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==M.type&&(V?V.call(this,M,le[0]):(le[1]||lh).call(this,M,le[0]));else throw new Error("Cannot close `"+M.type+"` ("+zr({start:M.start,end:M.end})+"): it’s not open");te.position.end=On(M.end)}function c(){return hl(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(M){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function g(){const M=this.resume(),V=this.stack[this.stack.length-1];V.lang=M}function m(){const M=this.resume(),V=this.stack[this.stack.length-1];V.meta=M}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const M=this.resume(),V=this.stack[this.stack.length-1];V.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const M=this.resume(),V=this.stack[this.stack.length-1];V.value=M.replace(/(\r?\n|\r)$/g,"")}function y(M){const V=this.resume(),te=this.stack[this.stack.length-1];te.label=V,te.identifier=zt(this.sliceSerialize(M)).toLowerCase()}function C(){const M=this.resume(),V=this.stack[this.stack.length-1];V.title=M}function S(){const M=this.resume(),V=this.stack[this.stack.length-1];V.url=M}function w(M){const V=this.stack[this.stack.length-1];if(!V.depth){const te=this.sliceSerialize(M).length;V.depth=te}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function B(M){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function v(){this.data.setextHeadingSlurpLineEnding=void 0}function N(M){const te=this.stack[this.stack.length-1].children;let le=te[te.length-1];(!le||le.type!=="text")&&(le=$a(),le.position={start:On(M.start),end:void 0},te.push(le)),this.stack.push(le)}function R(M){const V=this.stack.pop();V.value+=this.sliceSerialize(M),V.position.end=On(M.end)}function H(M){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const te=V.children[V.children.length-1];te.position.end=On(M.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(V.type)&&(N.call(this,M),R.call(this,M))}function U(){this.data.atHardBreak=!0}function W(){const M=this.resume(),V=this.stack[this.stack.length-1];V.value=M}function j(){const M=this.resume(),V=this.stack[this.stack.length-1];V.value=M}function P(){const M=this.resume(),V=this.stack[this.stack.length-1];V.value=M}function K(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=V,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function q(){const M=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=V,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function $(M){const V=this.sliceSerialize(M),te=this.stack[this.stack.length-2];te.label=Gy(V),te.identifier=zt(V).toLowerCase()}function Z(){const M=this.stack[this.stack.length-1],V=this.resume(),te=this.stack[this.stack.length-1];if(this.data.inReference=!0,te.type==="link"){const le=M.children;te.children=le}else te.alt=V}function x(){const M=this.resume(),V=this.stack[this.stack.length-1];V.url=M}function ie(){const M=this.resume(),V=this.stack[this.stack.length-1];V.title=M}function se(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Ce(M){const V=this.resume(),te=this.stack[this.stack.length-1];te.label=V,te.identifier=zt(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function Y(M){this.data.characterReferenceType=M.type}function Te(M){const V=this.sliceSerialize(M),te=this.data.characterReferenceType;let le;te?(le=zf(V,te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=dl(V);const ge=this.stack[this.stack.length-1];ge.value+=le}function Re(M){const V=this.stack.pop();V.position.end=On(M.end)}function Pe(M){R.call(this,M);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(M)}function je(M){R.call(this,M);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(M)}function Fe(){return{type:"blockquote",children:[]}}function Wt(){return{type:"code",lang:null,meta:null,value:""}}function Ri(){return{type:"inlineCode",value:""}}function Qn(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mr(){return{type:"emphasis",children:[]}}function ft(){return{type:"heading",depth:0,children:[]}}function it(){return{type:"break"}}function gt(){return{type:"html",value:""}}function Xt(){return{type:"image",title:null,url:"",alt:null}}function Jn(){return{type:"link",title:null,url:"",children:[]}}function Cn(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function An(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function Li(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function $a(){return{type:"text",value:""}}function wi(){return{type:"thematicBreak"}}}function On(t){return{line:t.line,column:t.column,offset:t.offset}}function Qf(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?Qf(t,i):Vy(t,i)}}function Vy(t,e){let n;for(n in e)if(Zf.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function lh(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+zr({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+zr({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+zr({start:e.start,end:e.end})+") is still open")}function Ky(t){const e=this;e.parser=n;function n(i){return Wy(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function qy(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function $y(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
11
|
+
`}]}function Zy(t,e){const n=e.value?e.value+`
|
|
12
|
+
`:"",i={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function Qy(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Jy(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function ex(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=hr(i.toLowerCase()),s=t.footnoteOrder.indexOf(i);let a,o=t.footnoteCounts.get(i);o===void 0?(o=0,t.footnoteOrder.push(i),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(i,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,l),t.applyData(e,l)}function tx(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function nx(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Jf(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const a=r[r.length-1];return a&&a.type==="text"?a.value+=i:r.push({type:"text",value:i}),r}function ix(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return Jf(t,e);const r={src:hr(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)}function rx(t,e){const n={src:hr(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function sx(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function ax(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return Jf(t,e);const r={href:hr(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function ox(t,e){const n={href:hr(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function ux(t,e,n){const i=t.all(e),r=n?lx(n):e0(e),s={},a=[];if(typeof e.checked=="boolean"){const c=i[0];let h;c&&c.type==="element"&&c.tagName==="p"?h=c:(h={type:"element",tagName:"p",properties:{},children:[]},i.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<i.length;){const c=i[o];(r||o!==0||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
|
13
|
+
`}),c.type==="element"&&c.tagName==="p"&&!r?a.push(...c.children):a.push(c)}const u=i[i.length-1];u&&(r||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
14
|
+
`});const l={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,l),t.applyData(e,l)}function lx(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let i=-1;for(;!e&&++i<n.length;)e=e0(n[i])}return e}function e0(t){const e=t.spread;return e??t.children.length>1}function cx(t,e){const n={},i=t.all(e);let r=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++r<i.length;){const a=i[r];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function hx(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function dx(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function fx(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function gx(t,e){const n=t.all(e),i=n.shift(),r=[];if(i){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([i],!0)};t.patch(e.children[0],a),r.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=nn(e.children[1]),u=Ba(e.children[e.children.length-1]);o&&u&&(a.position={start:o,end:u}),r.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function mx(t,e,n){const i=n?n.children:void 0,s=(i?i.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let u=-1;const l=[];for(;++u<o;){const h=e.children[u],f={},g=a?a[u]:void 0;g&&(f.align=g);let m={type:"element",tagName:s,properties:f,children:[]};h&&(m.children=t.all(h),t.patch(h,m),m=t.applyData(h,m)),l.push(m)}const c={type:"element",tagName:"tr",properties:{},children:t.wrap(l,!0)};return t.patch(e,c),t.applyData(e,c)}function px(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const ch=9,hh=32;function _x(t){const e=String(t),n=/\r?\n|\r/g;let i=n.exec(e),r=0;const s=[];for(;i;)s.push(dh(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=n.exec(e);return s.push(dh(e.slice(r),r>0,!1)),s.join("")}function dh(t,e,n){let i=0,r=t.length;if(e){let s=t.codePointAt(i);for(;s===ch||s===hh;)i++,s=t.codePointAt(i)}if(n){let s=t.codePointAt(r-1);for(;s===ch||s===hh;)r--,s=t.codePointAt(r-1)}return r>i?t.slice(i,r):""}function Ex(t,e){const n={type:"text",value:_x(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Tx(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const bx={blockquote:qy,break:$y,code:Zy,delete:Qy,emphasis:Jy,footnoteReference:ex,heading:tx,html:nx,imageReference:ix,image:rx,inlineCode:sx,linkReference:ax,link:ox,listItem:ux,list:cx,paragraph:hx,root:dx,strong:fx,table:gx,tableCell:px,tableRow:mx,text:Ex,thematicBreak:Tx,toml:zs,yaml:zs,definition:zs,footnoteDefinition:zs};function zs(){}const t0=-1,za=0,Gr=1,da=2,gl=3,ml=4,pl=5,_l=6,n0=7,i0=8,fh=typeof self=="object"?self:globalThis,yx=(t,e)=>{const n=(r,s)=>(t.set(s,r),r),i=r=>{if(t.has(r))return t.get(r);const[s,a]=e[r];switch(s){case za:case t0:return n(a,r);case Gr:{const o=n([],r);for(const u of a)o.push(i(u));return o}case da:{const o=n({},r);for(const[u,l]of a)o[i(u)]=i(l);return o}case gl:return n(new Date(a),r);case ml:{const{source:o,flags:u}=a;return n(new RegExp(o,u),r)}case pl:{const o=n(new Map,r);for(const[u,l]of a)o.set(i(u),i(l));return o}case _l:{const o=n(new Set,r);for(const u of a)o.add(i(u));return o}case n0:{const{name:o,message:u}=a;return n(new fh[o](u),r)}case i0:return n(BigInt(a),r);case"BigInt":return n(Object(BigInt(a)),r);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new fh[s](a),r)};return i},gh=t=>yx(new Map,t)(0),Bi="",{toString:xx}={},{keys:Cx}=Object,Rr=t=>{const e=typeof t;if(e!=="object"||!t)return[za,e];const n=xx.call(t).slice(8,-1);switch(n){case"Array":return[Gr,Bi];case"Object":return[da,Bi];case"Date":return[gl,Bi];case"RegExp":return[ml,Bi];case"Map":return[pl,Bi];case"Set":return[_l,Bi];case"DataView":return[Gr,n]}return n.includes("Array")?[Gr,n]:n.includes("Error")?[n0,n]:[da,n]},Ys=([t,e])=>t===za&&(e==="function"||e==="symbol"),Ax=(t,e,n,i)=>{const r=(a,o)=>{const u=i.push(a)-1;return n.set(o,u),u},s=a=>{if(n.has(a))return n.get(a);let[o,u]=Rr(a);switch(o){case za:{let c=a;switch(u){case"bigint":o=i0,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return r([t0],a)}return r([o,c],a)}case Gr:{if(u){let f=a;return u==="DataView"?f=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(a)),r([u,[...f]],a)}const c=[],h=r([o,c],a);for(const f of a)c.push(s(f));return h}case da:{if(u)switch(u){case"BigInt":return r([u,a.toString()],a);case"Boolean":case"Number":case"String":return r([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const c=[],h=r([o,c],a);for(const f of Cx(a))(t||!Ys(Rr(a[f])))&&c.push([s(f),s(a[f])]);return h}case gl:return r([o,a.toISOString()],a);case ml:{const{source:c,flags:h}=a;return r([o,{source:c,flags:h}],a)}case pl:{const c=[],h=r([o,c],a);for(const[f,g]of a)(t||!(Ys(Rr(f))||Ys(Rr(g))))&&c.push([s(f),s(g)]);return h}case _l:{const c=[],h=r([o,c],a);for(const f of a)(t||!Ys(Rr(f)))&&c.push(s(f));return h}}const{message:l}=a;return r([o,{name:u,message:l}],a)};return s},mh=(t,{json:e,lossy:n}={})=>{const i=[];return Ax(!(e||n),!!e,new Map,i)(t),i},xi=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?gh(mh(t,e)):structuredClone(t):(t,e)=>gh(mh(t,e));function Ix(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Sx(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Rx(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Ix,i=t.options.footnoteBackLabel||Sx,r=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<t.footnoteOrder.length;){const l=t.footnoteById.get(t.footnoteOrder[u]);if(!l)continue;const c=t.all(l),h=String(l.identifier).toUpperCase(),f=hr(h.toLowerCase());let g=0;const m=[],p=t.footnoteCounts.get(h);for(;p!==void 0&&++g<=p;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(u,g);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+f+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(u,g),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const _=c[c.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const y=_.children[_.children.length-1];y&&y.type==="text"?y.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...m)}else c.push(...m);const E={type:"element",tagName:"li",properties:{id:e+"fn-"+f},children:t.wrap(c,!0)};t.patch(l,E),o.push(E)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...xi(a),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
|
|
15
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
|
|
16
|
+
`}]}}const Ya=(function(t){if(t==null)return Ox;if(typeof t=="function")return Ga(t);if(typeof t=="object")return Array.isArray(t)?Lx(t):wx(t);if(typeof t=="string")return kx(t);throw new Error("Expected function, string, or object as test")});function Lx(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Ya(t[n]);return Ga(i);function i(...r){let s=-1;for(;++s<e.length;)if(e[s].apply(this,r))return!0;return!1}}function wx(t){const e=t;return Ga(n);function n(i){const r=i;let s;for(s in t)if(r[s]!==e[s])return!1;return!0}}function kx(t){return Ga(e);function e(n){return n&&n.type===t}}function Ga(t){return e;function e(n,i,r){return!!(Nx(n)&&t.call(this,n,typeof i=="number"?i:void 0,r||void 0))}}function Ox(){return!0}function Nx(t){return t!==null&&typeof t=="object"&&"type"in t}const r0=[],Dx=!0,fu=!1,Px="skip";function s0(t,e,n,i){let r;typeof e=="function"&&typeof n!="function"?(i=n,n=e):r=e;const s=Ya(r),a=i?-1:1;o(t,void 0,[])();function o(u,l,c){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(g?"<"+g+">":""))+")"})}return f;function f(){let g=r0,m,p,_;if((!e||s(u,l,c[c.length-1]||void 0))&&(g=Mx(n(u,c)),g[0]===fu))return g;if("children"in u&&u.children){const E=u;if(E.children&&g[0]!==Px)for(p=(i?E.children.length:-1)+a,_=c.concat(E);p>-1&&p<E.children.length;){const y=E.children[p];if(m=o(y,p,_)(),m[0]===fu)return m;p=typeof m[1]=="number"?m[1]:p+a}}return g}}}function Mx(t){return Array.isArray(t)?t:typeof t=="number"?[Dx,t]:t==null?r0:[t]}function ja(t,e,n,i){let r,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,r=n):(s=e,a=n,r=i),s0(t,s,o,r);function o(u,l){const c=l[l.length-1],h=c?c.children.indexOf(u):void 0;return a(u,h,c)}}const gu={}.hasOwnProperty,vx={};function Fx(t,e){const n=e||vx,i=new Map,r=new Map,s=new Map,a={...bx,...n.handlers},o={all:l,applyData:Ux,definitionById:i,footnoteById:r,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:Bx,wrap:zx};return ja(t,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const h=c.type==="definition"?i:r,f=String(c.identifier).toUpperCase();h.has(f)||h.set(f,c)}}),o;function u(c,h){const f=c.type,g=o.handlers[f];if(gu.call(o.handlers,f)&&g)return g(o,c,h);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in c){const{children:p,..._}=c,E=xi(_);return E.children=o.all(c),E}return xi(c)}return(o.options.unknownHandler||Hx)(o,c,h)}function l(c){const h=[];if("children"in c){const f=c.children;let g=-1;for(;++g<f.length;){const m=o.one(f[g],c);if(m){if(g&&f[g-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ph(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=ph(p.value))}Array.isArray(m)?h.push(...m):h.push(m)}}}return h}}function Bx(t,e){t.position&&(e.position=Pf(t))}function Ux(t,e){let n=e;if(t&&t.data){const i=t.data.hName,r=t.data.hChildren,s=t.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const a="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,xi(s)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function Hx(t,e){const n=e.data||{},i="value"in e&&!(gu.call(n,"hProperties")||gu.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function zx(t,e){const n=[];let i=-1;for(e&&n.push({type:"text",value:`
|
|
17
|
+
`});++i<t.length;)i&&n.push({type:"text",value:`
|
|
18
|
+
`}),n.push(t[i]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
19
|
+
`}),n}function ph(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function _h(t,e){const n=Fx(t,e),i=n.one(t,void 0),r=Rx(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:`
|
|
20
|
+
`},r),s}function Yx(t,e){return t&&"run"in t?async function(n,i){const r=_h(n,{file:i,...e});await t.run(r,i)}:function(n,i){return _h(n,{file:i,...t||e})}}function Eh(t){if(t)throw t}var ko,Th;function Gx(){if(Th)return ko;Th=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},s=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var c=t.call(l,"constructor"),h=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!c&&!h)return!1;var f;for(f in l);return typeof f>"u"||t.call(l,f)},a=function(l,c){n&&c.name==="__proto__"?n(l,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):l[c.name]=c.newValue},o=function(l,c){if(c==="__proto__")if(t.call(l,c)){if(i)return i(l,c).value}else return;return l[c]};return ko=function u(){var l,c,h,f,g,m,p=arguments[0],_=1,E=arguments.length,y=!1;for(typeof p=="boolean"&&(y=p,p=arguments[1]||{},_=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});_<E;++_)if(l=arguments[_],l!=null)for(c in l)h=o(p,c),f=o(l,c),p!==f&&(y&&f&&(s(f)||(g=r(f)))?(g?(g=!1,m=h&&r(h)?h:[]):m=h&&s(h)?h:{},a(p,{name:c,newValue:u(y,m,f)})):typeof f<"u"&&a(p,{name:c,newValue:f}));return p},ko}var jx=Gx();const Oo=Nf(jx);function mu(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Wx(){const t=[],e={run:n,use:i};return e;function n(...r){let s=-1;const a=r.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...r);function o(u,...l){const c=t[++s];let h=-1;if(u){a(u);return}for(;++h<r.length;)(l[h]===null||l[h]===void 0)&&(l[h]=r[h]);r=l,c?Xx(c,o)(...l):a(null,...l)}}function i(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return t.push(r),e}}function Xx(t,e){let n;return i;function i(...a){const o=t.length>a.length;let u;o&&a.push(r);try{u=t.apply(this,a)}catch(l){const c=l;if(o&&n)throw c;return r(c)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,r):u instanceof Error?r(u):s(u))}function r(a,...o){n||(n=!0,e(a,...o))}function s(a){r(null,a)}}const qt={basename:Vx,dirname:Kx,extname:qx,join:$x,sep:"/"};function Vx(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Is(t);let n=0,i=-1,r=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":t.slice(n,i)}if(e===t)return"";let a=-1,o=e.length-1;for(;r--;)if(t.codePointAt(r)===47){if(s){n=r+1;break}}else a<0&&(s=!0,a=r+1),o>-1&&(t.codePointAt(r)===e.codePointAt(o--)?o<0&&(i=r):(o=-1,i=a));return n===i?i=a:i<0&&(i=t.length),t.slice(n,i)}function Kx(t){if(Is(t),t.length===0)return".";let e=-1,n=t.length,i;for(;--n;)if(t.codePointAt(n)===47){if(i){e=n;break}}else i||(i=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function qx(t){Is(t);let e=t.length,n=-1,i=0,r=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){i=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?r<0?r=e:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":t.slice(r,n)}function $x(...t){let e=-1,n;for(;++e<t.length;)Is(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Zx(n)}function Zx(t){Is(t);const e=t.codePointAt(0)===47;let n=Qx(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Qx(t,e){let n="",i=0,r=-1,s=0,a=-1,o,u;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(r===a-1||s===1))if(r!==a-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",i=0):(n=n.slice(0,u),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}}else if(n.length>0){n="",i=0,r=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+t.slice(r+1,a):n=t.slice(r+1,a),i=a-r-1;r=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function Is(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Jx={cwd:e2};function e2(){return"/"}function pu(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function t2(t){if(typeof t=="string")t=new URL(t);else if(!pu(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return n2(t)}function n2(t){if(t.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const i=e.codePointAt(n+2);if(i===70||i===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(e)}const No=["history","path","basename","stem","extname","dirname"];class a0{constructor(e){let n;e?pu(e)?n={path:e}:typeof e=="string"||i2(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Jx.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<No.length;){const s=No[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let r;for(r in n)No.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?qt.basename(this.path):void 0}set basename(e){Po(e,"basename"),Do(e,"basename"),this.path=qt.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?qt.dirname(this.path):void 0}set dirname(e){bh(this.basename,"dirname"),this.path=qt.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?qt.extname(this.path):void 0}set extname(e){if(Do(e,"extname"),bh(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=qt.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){pu(e)&&(e=t2(e)),Po(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?qt.basename(this.path,this.extname):void 0}set stem(e){Po(e,"stem"),Do(e,"stem"),this.path=qt.join(this.dirname||"",e+(this.extname||""))}fail(e,n,i){const r=this.message(e,n,i);throw r.fatal=!0,r}info(e,n,i){const r=this.message(e,n,i);return r.fatal=void 0,r}message(e,n,i){const r=new $e(e,n,i);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Do(t,e){if(t&&t.includes(qt.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+qt.sep+"`")}function Po(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function bh(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function i2(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const r2=(function(t){const i=this.constructor.prototype,r=i[t],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),s2={}.hasOwnProperty;class El extends r2{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Wx()}copy(){const e=new El;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];e.use(...i)}return e.data(Oo(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Fo("data",this.frozen),this.namespace[e]=n,this):s2.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Fo("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const r=n.call(e,...i);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=Gs(e),i=this.parser||this.Parser;return Mo("parse",i),i(String(n),n)}process(e,n){const i=this;return this.freeze(),Mo("process",this.parser||this.Parser),vo("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(s,a){const o=Gs(e),u=i.parse(o);i.run(u,o,function(c,h,f){if(c||!h||!f)return l(c);const g=h,m=i.stringify(g,f);u2(m)?f.value=m:f.result=m,l(c,f)});function l(c,h){c||!h?a(c):s?s(h):n(void 0,h)}}}processSync(e){let n=!1,i;return this.freeze(),Mo("processSync",this.parser||this.Parser),vo("processSync",this.compiler||this.Compiler),this.process(e,r),xh("processSync","process",n),i;function r(s,a){n=!0,Eh(s),i=a}}run(e,n,i){yh(e),this.freeze();const r=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(a,o){const u=Gs(n);r.run(e,u,l);function l(c,h,f){const g=h||e;c?o(c):a?a(g):i(void 0,g,f)}}}runSync(e,n){let i=!1,r;return this.run(e,n,s),xh("runSync","run",i),r;function s(a,o){Eh(a),r=o,i=!0}}stringify(e,n){this.freeze();const i=Gs(n),r=this.compiler||this.Compiler;return vo("stringify",r),yh(e),r(e,i)}use(e,...n){const i=this.attachers,r=this.namespace;if(Fo("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[c,...h]=l;u(c,h)}else a(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function a(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(l.plugins),l.settings&&(r.settings=Oo(!0,r.settings,l.settings))}function o(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){const h=l[c];s(h)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let h=-1,f=-1;for(;++h<i.length;)if(i[h][0]===l){f=h;break}if(f===-1)i.push([l,...c]);else if(c.length>0){let[g,...m]=c;const p=i[f][1];mu(p)&&mu(g)&&(g=Oo(!0,p,g)),i[f]=[l,g,...m]}}}}const a2=new El().freeze();function Mo(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function vo(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Fo(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function yh(t){if(!mu(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function xh(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Gs(t){return o2(t)?t:new a0(t)}function o2(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function u2(t){return typeof t=="string"||l2(t)}function l2(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const c2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ch=[],Ah={allowDangerousHtml:!0},h2=/^(https?|ircs?|mailto|xmpp)$/i,d2=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function f2(t){const e=g2(t),n=m2(t);return p2(e.runSync(e.parse(n),n),t)}function g2(t){const e=t.rehypePlugins||Ch,n=t.remarkPlugins||Ch,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Ah}:Ah;return a2().use(Ky).use(n).use(Yx,i).use(e)}function m2(t){const e=t.children||"",n=new a0;return typeof e=="string"&&(n.value=e),n}function p2(t,e){const n=e.allowedElements,i=e.allowElement,r=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||_2;for(const c of d2)Object.hasOwn(e,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+c2+c.id,void 0);return ja(t,l),OT(t,{Fragment:O.Fragment,components:r,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0});function l(c,h,f){if(c.type==="raw"&&f&&typeof h=="number")return a?f.children.splice(h,1):f.children[h]={type:"text",value:c.value},h;if(c.type==="element"){let g;for(g in Ro)if(Object.hasOwn(Ro,g)&&Object.hasOwn(c.properties,g)){const m=c.properties[g],p=Ro[g];(p===null||p.includes(c.tagName))&&(c.properties[g]=u(String(m||""),g,c))}}if(c.type==="element"){let g=n?!n.includes(c.tagName):s?s.includes(c.tagName):!1;if(!g&&i&&typeof h=="number"&&(g=!i(c,h,f)),g&&f&&typeof h=="number")return o&&c.children?f.children.splice(h,1,...c.children):f.children.splice(h,1),h}}}function _2(t){const e=t.indexOf(":"),n=t.indexOf("?"),i=t.indexOf("#"),r=t.indexOf("/");return e===-1||r!==-1&&e>r||n!==-1&&e>n||i!==-1&&e>i||h2.test(t.slice(0,e))?t:""}const Ih=/[#.]/g;function E2(t,e){const n=t||"",i={};let r=0,s,a;for(;r<n.length;){Ih.lastIndex=r;const o=Ih.exec(n),u=n.slice(r,o?o.index:n.length);u&&(s?s==="#"?i.id=u:Array.isArray(i.className)?i.className.push(u):i.className=[u]:a=u,r+=u.length),o&&(s=o[0],r++)}return{type:"element",tagName:a||e||"div",properties:i,children:[]}}function o0(t,e,n){const i=n?x2(n):void 0;function r(s,a,...o){let u;if(s==null){u={type:"root",children:[]};const l=a;o.unshift(l)}else{u=E2(s,e);const l=u.tagName.toLowerCase(),c=i?i.get(l):void 0;if(u.tagName=c||l,T2(a))o.unshift(a);else for(const[h,f]of Object.entries(a))b2(t,u.properties,h,f)}for(const l of o)_u(u.children,l);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return r}function T2(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const i of n){const r=e[i];if(r&&typeof r=="object"){if(!Array.isArray(r))return!0;const s=r;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function b2(t,e,n,i){const r=Fa(t,n);let s;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;s=i}else typeof i=="boolean"?s=i:typeof i=="string"?r.spaceSeparated?s=Xc(i):r.commaSeparated?s=zc(i):r.commaOrSpaceSeparated?s=Xc(zc(i).join(" ")):s=Sh(r,r.property,i):Array.isArray(i)?s=[...i]:s=r.property==="style"?y2(i):String(i);if(Array.isArray(s)){const a=[];for(const o of s)a.push(Sh(r,r.property,o));s=a}r.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[r.property]=s}}function _u(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)_u(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?_u(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Sh(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||os(n)===os(e)))return!0}return n}function y2(t){const e=[];for(const[n,i]of Object.entries(t))e.push([n,i].join(": "));return e.join("; ")}function x2(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const C2=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],A2=o0(Cs,"div"),I2=o0($n,"g",C2);function S2(t){const e=String(t),n=[];return{toOffset:r,toPoint:i};function i(s){if(typeof s=="number"&&s>-1&&s<=e.length){let a=0;for(;;){let o=n[a];if(o===void 0){const u=Rh(e,n[a-1]);o=u===-1?e.length+1:u+1,n[a]=o}if(o>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function r(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const o=n[n.length-1],u=Rh(e,o),l=u===-1?e.length+1:u+1;if(o===l)break;n.push(l)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function Rh(t,e){const n=t.indexOf("\r",e),i=t.indexOf(`
|
|
21
|
+
`,e);return i===-1?n:n===-1||n+1===i?i:n<i?n:i}const fi={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},u0={}.hasOwnProperty,R2=Object.prototype;function L2(t,e){const n=e||{};return Tl({file:n.file||void 0,location:!1,schema:n.space==="svg"?$n:Cs,verbose:n.verbose||!1},t)}function Tl(t,e){let n;switch(e.nodeName){case"#comment":{const i=e;return n={type:"comment",value:i.data},$s(t,i,n),n}case"#document":case"#document-fragment":{const i=e,r="mode"in i?i.mode==="quirks"||i.mode==="limited-quirks":!1;if(n={type:"root",children:l0(t,e.childNodes),data:{quirksMode:r}},t.file&&t.location){const s=String(t.file),a=S2(s),o=a.toPoint(0),u=a.toPoint(s.length);n.position={start:o,end:u}}return n}case"#documentType":{const i=e;return n={type:"doctype"},$s(t,i,n),n}case"#text":{const i=e;return n={type:"text",value:i.value},$s(t,i,n),n}default:return n=w2(t,e),n}}function l0(t,e){let n=-1;const i=[];for(;++n<e.length;){const r=Tl(t,e[n]);i.push(r)}return i}function w2(t,e){const n=t.schema;t.schema=e.namespaceURI===fi.svg?$n:Cs;let i=-1;const r={};for(;++i<e.attrs.length;){const o=e.attrs[i],u=(o.prefix?o.prefix+":":"")+o.name;u0.call(R2,u)||(r[u]=o.value)}const a=(t.schema.space==="svg"?I2:A2)(e.tagName,r,l0(t,e.childNodes));if($s(t,e,a),a.tagName==="template"){const o=e,u=o.sourceCodeLocation,l=u&&u.startTag&&Xi(u.startTag),c=u&&u.endTag&&Xi(u.endTag),h=Tl(t,o.content);l&&c&&t.file&&(h.position={start:l.end,end:c.start}),a.content=h}return t.schema=n,a}function $s(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const i=k2(t,n,e.sourceCodeLocation);i&&(t.location=!0,n.position=i)}}function k2(t,e,n){const i=Xi(n);if(e.type==="element"){const r=e.children[e.children.length-1];if(i&&!n.endTag&&r&&r.position&&r.position.end&&(i.end=Object.assign({},r.position.end)),t.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)u0.call(n.attrs,a)&&(s[Fa(t.schema,a).property]=Xi(n.attrs[a]));n.startTag;const o=Xi(n.startTag),u=n.endTag?Xi(n.endTag):void 0,l={opening:o};u&&(l.closing=u),l.properties=s,e.data={position:l}}}return i}function Xi(t){const e=Lh({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Lh({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Lh(t){return t.line&&t.column?t:void 0}const wh={}.hasOwnProperty;function c0(t,e){const n=e||{};function i(r,...s){let a=i.invalid;const o=i.handlers;if(r&&wh.call(r,t)){const u=String(r[t]);a=wh.call(o,u)?o[u]:i.unknown}if(a)return a.call(this,r,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const O2={},N2={}.hasOwnProperty,h0=c0("type",{handlers:{root:P2,element:U2,text:F2,comment:B2,doctype:v2}});function D2(t,e){const i=(e||O2).space;return h0(t,i==="svg"?$n:Cs)}function P2(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=bl(t.children,n,e),dr(t,n),n}function M2(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=bl(t.children,n,e),dr(t,n),n}function v2(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return dr(t,e),e}function F2(t){const e={nodeName:"#text",value:t.value,parentNode:null};return dr(t,e),e}function B2(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return dr(t,e),e}function U2(t,e){const n=e;let i=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=$n);const r=[];let s;if(t.properties){for(s in t.properties)if(s!=="children"&&N2.call(t.properties,s)){const u=H2(i,s,t.properties[s]);u&&r.push(u)}}const a=i.space,o={nodeName:t.tagName,tagName:t.tagName,attrs:r,namespaceURI:fi[a],childNodes:[],parentNode:null};return o.childNodes=bl(t.children,o,i),dr(t,o),t.tagName==="template"&&t.content&&(o.content=M2(t.content,i)),o}function H2(t,e,n){const i=Fa(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&i.boolean)return;Array.isArray(n)&&(n=i.commaSeparated?Cf(n):Of(n));const r={name:i.attribute,value:n===!0?"":String(n)};if(i.space&&i.space!=="html"&&i.space!=="svg"){const s=r.name.indexOf(":");s<0?r.prefix="":(r.name=r.name.slice(s+1),r.prefix=i.attribute.slice(0,s)),r.namespace=fi[i.space]}return r}function bl(t,e,n){let i=-1;const r=[];if(t)for(;++i<t.length;){const s=h0(t[i],n);s.parentNode=e,r.push(s)}return r}function dr(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const z2=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Y2=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Le="�";var T;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));const rt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function d0(t){return t>=55296&&t<=57343}function G2(t){return t>=56320&&t<=57343}function j2(t,e){return(t-55296)*1024+9216+e}function f0(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function g0(t){return t>=64976&&t<=65007||Y2.has(t)}var D;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(D||(D={}));const W2=65536;class X2{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=W2,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:i,col:r,offset:s}=this,a=r+n,o=s+n;return{code:e,startLine:i,endLine:i,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(G2(n))return this.pos++,this._addGap(),j2(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(D.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let i=0;i<e.length;i++)if((this.html.charCodeAt(this.pos+i)|32)!==e.charCodeAt(i))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const i=this.html.charCodeAt(n);return i===T.CARRIAGE_RETURN?T.LINE_FEED:i}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let e=this.html.charCodeAt(this.pos);return e===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):e===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,d0(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===T.LINE_FEED||e===T.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){f0(e)?this._err(D.controlCharacterInInputStream):g0(e)&&this._err(D.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ce;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(ce||(ce={}));function m0(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const V2=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),K2=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function q2(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=K2.get(t))!==null&&e!==void 0?e:t}var Ge;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Ge||(Ge={}));const $2=32;var Yn;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Yn||(Yn={}));function Eu(t){return t>=Ge.ZERO&&t<=Ge.NINE}function Z2(t){return t>=Ge.UPPER_A&&t<=Ge.UPPER_F||t>=Ge.LOWER_A&&t<=Ge.LOWER_F}function Q2(t){return t>=Ge.UPPER_A&&t<=Ge.UPPER_Z||t>=Ge.LOWER_A&&t<=Ge.LOWER_Z||Eu(t)}function J2(t){return t===Ge.EQUALS||Q2(t)}var He;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(He||(He={}));var mn;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(mn||(mn={}));class eC{constructor(e,n,i){this.decodeTree=e,this.emitCodePoint=n,this.errors=i,this.state=He.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=mn.Strict}startEntity(e){this.decodeMode=e,this.state=He.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case He.EntityStart:return e.charCodeAt(n)===Ge.NUM?(this.state=He.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=He.NamedEntity,this.stateNamedEntity(e,n));case He.NumericStart:return this.stateNumericStart(e,n);case He.NumericDecimal:return this.stateNumericDecimal(e,n);case He.NumericHex:return this.stateNumericHex(e,n);case He.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|$2)===Ge.LOWER_X?(this.state=He.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=He.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,i,r){if(n!==i){const s=i-n;this.result=this.result*Math.pow(r,s)+Number.parseInt(e.substr(n,s),r),this.consumed+=s}}stateNumericHex(e,n){const i=n;for(;n<e.length;){const r=e.charCodeAt(n);if(Eu(r)||Z2(r))n+=1;else return this.addToNumericResult(e,i,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,i,n,16),-1}stateNumericDecimal(e,n){const i=n;for(;n<e.length;){const r=e.charCodeAt(n);if(Eu(r))n+=1;else return this.addToNumericResult(e,i,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,i,n,10),-1}emitNumericEntity(e,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ge.SEMI)this.consumed+=1;else if(this.decodeMode===mn.Strict)return 0;return this.emitCodePoint(q2(this.result),this.consumed),this.errors&&(e!==Ge.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:i}=this;let r=i[this.treeIndex],s=(r&Yn.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=tC(i,r,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===mn.Attribute&&(s===0||J2(a))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],s=(r&Yn.VALUE_LENGTH)>>14,s!==0){if(a===Ge.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==mn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:i}=this,r=(i[n]&Yn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[e]&~Yn.VALUE_LENGTH:r[e+1],i),n===3&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case He.NamedEntity:return this.result!==0&&(this.decodeMode!==mn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case He.NumericDecimal:return this.emitNumericEntity(0,2);case He.NumericHex:return this.emitNumericEntity(0,3);case He.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case He.EntityStart:return 0}}}function tC(t,e,n,i){const r=(e&Yn.BRANCH_LENGTH)>>7,s=e&Yn.JUMP_TABLE;if(r===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=r?-1:t[n+u]-1}let a=n,o=a+r-1;for(;a<=o;){const u=a+o>>>1,l=t[u];if(l<i)a=u+1;else if(l>i)o=u-1;else return t[u+r]}return-1}var z;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(z||(z={}));var mi;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(mi||(mi={}));var Lt;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Lt||(Lt={}));var k;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(k||(k={}));var d;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(d||(d={}));const nC=new Map([[k.A,d.A],[k.ADDRESS,d.ADDRESS],[k.ANNOTATION_XML,d.ANNOTATION_XML],[k.APPLET,d.APPLET],[k.AREA,d.AREA],[k.ARTICLE,d.ARTICLE],[k.ASIDE,d.ASIDE],[k.B,d.B],[k.BASE,d.BASE],[k.BASEFONT,d.BASEFONT],[k.BGSOUND,d.BGSOUND],[k.BIG,d.BIG],[k.BLOCKQUOTE,d.BLOCKQUOTE],[k.BODY,d.BODY],[k.BR,d.BR],[k.BUTTON,d.BUTTON],[k.CAPTION,d.CAPTION],[k.CENTER,d.CENTER],[k.CODE,d.CODE],[k.COL,d.COL],[k.COLGROUP,d.COLGROUP],[k.DD,d.DD],[k.DESC,d.DESC],[k.DETAILS,d.DETAILS],[k.DIALOG,d.DIALOG],[k.DIR,d.DIR],[k.DIV,d.DIV],[k.DL,d.DL],[k.DT,d.DT],[k.EM,d.EM],[k.EMBED,d.EMBED],[k.FIELDSET,d.FIELDSET],[k.FIGCAPTION,d.FIGCAPTION],[k.FIGURE,d.FIGURE],[k.FONT,d.FONT],[k.FOOTER,d.FOOTER],[k.FOREIGN_OBJECT,d.FOREIGN_OBJECT],[k.FORM,d.FORM],[k.FRAME,d.FRAME],[k.FRAMESET,d.FRAMESET],[k.H1,d.H1],[k.H2,d.H2],[k.H3,d.H3],[k.H4,d.H4],[k.H5,d.H5],[k.H6,d.H6],[k.HEAD,d.HEAD],[k.HEADER,d.HEADER],[k.HGROUP,d.HGROUP],[k.HR,d.HR],[k.HTML,d.HTML],[k.I,d.I],[k.IMG,d.IMG],[k.IMAGE,d.IMAGE],[k.INPUT,d.INPUT],[k.IFRAME,d.IFRAME],[k.KEYGEN,d.KEYGEN],[k.LABEL,d.LABEL],[k.LI,d.LI],[k.LINK,d.LINK],[k.LISTING,d.LISTING],[k.MAIN,d.MAIN],[k.MALIGNMARK,d.MALIGNMARK],[k.MARQUEE,d.MARQUEE],[k.MATH,d.MATH],[k.MENU,d.MENU],[k.META,d.META],[k.MGLYPH,d.MGLYPH],[k.MI,d.MI],[k.MO,d.MO],[k.MN,d.MN],[k.MS,d.MS],[k.MTEXT,d.MTEXT],[k.NAV,d.NAV],[k.NOBR,d.NOBR],[k.NOFRAMES,d.NOFRAMES],[k.NOEMBED,d.NOEMBED],[k.NOSCRIPT,d.NOSCRIPT],[k.OBJECT,d.OBJECT],[k.OL,d.OL],[k.OPTGROUP,d.OPTGROUP],[k.OPTION,d.OPTION],[k.P,d.P],[k.PARAM,d.PARAM],[k.PLAINTEXT,d.PLAINTEXT],[k.PRE,d.PRE],[k.RB,d.RB],[k.RP,d.RP],[k.RT,d.RT],[k.RTC,d.RTC],[k.RUBY,d.RUBY],[k.S,d.S],[k.SCRIPT,d.SCRIPT],[k.SEARCH,d.SEARCH],[k.SECTION,d.SECTION],[k.SELECT,d.SELECT],[k.SOURCE,d.SOURCE],[k.SMALL,d.SMALL],[k.SPAN,d.SPAN],[k.STRIKE,d.STRIKE],[k.STRONG,d.STRONG],[k.STYLE,d.STYLE],[k.SUB,d.SUB],[k.SUMMARY,d.SUMMARY],[k.SUP,d.SUP],[k.TABLE,d.TABLE],[k.TBODY,d.TBODY],[k.TEMPLATE,d.TEMPLATE],[k.TEXTAREA,d.TEXTAREA],[k.TFOOT,d.TFOOT],[k.TD,d.TD],[k.TH,d.TH],[k.THEAD,d.THEAD],[k.TITLE,d.TITLE],[k.TR,d.TR],[k.TRACK,d.TRACK],[k.TT,d.TT],[k.U,d.U],[k.UL,d.UL],[k.SVG,d.SVG],[k.VAR,d.VAR],[k.WBR,d.WBR],[k.XMP,d.XMP]]);function fr(t){var e;return(e=nC.get(t))!==null&&e!==void 0?e:d.UNKNOWN}const G=d,iC={[z.HTML]:new Set([G.ADDRESS,G.APPLET,G.AREA,G.ARTICLE,G.ASIDE,G.BASE,G.BASEFONT,G.BGSOUND,G.BLOCKQUOTE,G.BODY,G.BR,G.BUTTON,G.CAPTION,G.CENTER,G.COL,G.COLGROUP,G.DD,G.DETAILS,G.DIR,G.DIV,G.DL,G.DT,G.EMBED,G.FIELDSET,G.FIGCAPTION,G.FIGURE,G.FOOTER,G.FORM,G.FRAME,G.FRAMESET,G.H1,G.H2,G.H3,G.H4,G.H5,G.H6,G.HEAD,G.HEADER,G.HGROUP,G.HR,G.HTML,G.IFRAME,G.IMG,G.INPUT,G.LI,G.LINK,G.LISTING,G.MAIN,G.MARQUEE,G.MENU,G.META,G.NAV,G.NOEMBED,G.NOFRAMES,G.NOSCRIPT,G.OBJECT,G.OL,G.P,G.PARAM,G.PLAINTEXT,G.PRE,G.SCRIPT,G.SECTION,G.SELECT,G.SOURCE,G.STYLE,G.SUMMARY,G.TABLE,G.TBODY,G.TD,G.TEMPLATE,G.TEXTAREA,G.TFOOT,G.TH,G.THEAD,G.TITLE,G.TR,G.TRACK,G.UL,G.WBR,G.XMP]),[z.MATHML]:new Set([G.MI,G.MO,G.MN,G.MS,G.MTEXT,G.ANNOTATION_XML]),[z.SVG]:new Set([G.TITLE,G.FOREIGN_OBJECT,G.DESC]),[z.XLINK]:new Set,[z.XML]:new Set,[z.XMLNS]:new Set},Tu=new Set([G.H1,G.H2,G.H3,G.H4,G.H5,G.H6]);k.STYLE,k.SCRIPT,k.XMP,k.IFRAME,k.NOEMBED,k.NOFRAMES,k.PLAINTEXT;var b;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(b||(b={}));const De={DATA:b.DATA,RCDATA:b.RCDATA,RAWTEXT:b.RAWTEXT,SCRIPT_DATA:b.SCRIPT_DATA,PLAINTEXT:b.PLAINTEXT,CDATA_SECTION:b.CDATA_SECTION};function rC(t){return t>=T.DIGIT_0&&t<=T.DIGIT_9}function Fr(t){return t>=T.LATIN_CAPITAL_A&&t<=T.LATIN_CAPITAL_Z}function sC(t){return t>=T.LATIN_SMALL_A&&t<=T.LATIN_SMALL_Z}function Mn(t){return sC(t)||Fr(t)}function kh(t){return Mn(t)||rC(t)}function js(t){return t+32}function p0(t){return t===T.SPACE||t===T.LINE_FEED||t===T.TABULATION||t===T.FORM_FEED}function Oh(t){return p0(t)||t===T.SOLIDUS||t===T.GREATER_THAN_SIGN}function aC(t){return t===T.NULL?D.nullCharacterReference:t>1114111?D.characterReferenceOutsideUnicodeRange:d0(t)?D.surrogateCharacterReference:g0(t)?D.noncharacterCharacterReference:f0(t)||t===T.CARRIAGE_RETURN?D.controlCharacterReference:null}class oC{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=b.DATA,this.returnState=b.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new X2(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new eC(V2,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(D.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(D.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=aC(i);r&&this._err(r,1)}}:void 0)}_err(e,n=0){var i,r;(r=(i=this.handler).onParseError)===null||r===void 0||r.call(i,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,i){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||i?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ce.START_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ce.END_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:ce.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:ce.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const i=this.currentToken;if(m0(i,this.currentAttr.name)===null){if(i.attrs.push(this.currentAttr),i.location&&this.currentLocation){const r=(e=(n=i.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);r[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(D.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=fr(e.tagName),e.type===ce.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(D.endTagWithAttributes),e.selfClosing&&this._err(D.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case ce.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ce.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ce.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ce.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=p0(e)?ce.WHITESPACE_CHARACTER:e===T.NULL?ce.NULL_CHARACTER:ce.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ce.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=b.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?mn.Attribute:mn.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===b.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===b.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===b.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case b.DATA:{this._stateData(e);break}case b.RCDATA:{this._stateRcdata(e);break}case b.RAWTEXT:{this._stateRawtext(e);break}case b.SCRIPT_DATA:{this._stateScriptData(e);break}case b.PLAINTEXT:{this._statePlaintext(e);break}case b.TAG_OPEN:{this._stateTagOpen(e);break}case b.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case b.TAG_NAME:{this._stateTagName(e);break}case b.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case b.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case b.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case b.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case b.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case b.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case b.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case b.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case b.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case b.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case b.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case b.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case b.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case b.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case b.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case b.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case b.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case b.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case b.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case b.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case b.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case b.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case b.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case b.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case b.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case b.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case b.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case b.BOGUS_COMMENT:{this._stateBogusComment(e);break}case b.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case b.COMMENT_START:{this._stateCommentStart(e);break}case b.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case b.COMMENT:{this._stateComment(e);break}case b.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case b.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case b.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case b.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case b.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case b.COMMENT_END:{this._stateCommentEnd(e);break}case b.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case b.DOCTYPE:{this._stateDoctype(e);break}case b.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case b.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case b.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case b.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case b.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case b.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case b.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case b.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case b.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case b.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case b.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case b.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case b.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case b.CDATA_SECTION:{this._stateCdataSection(e);break}case b.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case b.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case b.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case b.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case T.LESS_THAN_SIGN:{this.state=b.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitCodePoint(e);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case T.AMPERSAND:{this._startCharacterReference();break}case T.LESS_THAN_SIGN:{this.state=b.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Le);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case T.LESS_THAN_SIGN:{this.state=b.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Le);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case T.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Le);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Le);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Mn(e))this._createStartTagToken(),this.state=b.TAG_NAME,this._stateTagName(e);else switch(e){case T.EXCLAMATION_MARK:{this.state=b.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=b.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(D.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=b.BOGUS_COMMENT,this._stateBogusComment(e);break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=b.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Mn(e))this._createEndTagToken(),this.state=b.TAG_NAME,this._stateTagName(e);else switch(e){case T.GREATER_THAN_SIGN:{this._err(D.missingEndTagName),this.state=b.DATA;break}case T.EOF:{this._err(D.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(D.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=b.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=b.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=b.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.tagName+=Le;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Fr(e)?js(e):e)}}_stateRcdataLessThanSign(e){e===T.SOLIDUS?this.state=b.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=b.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Mn(e)?(this.state=b.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=b.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=b.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=b.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=b.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=b.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===T.SOLIDUS?this.state=b.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=b.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Mn(e)?(this.state=b.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=b.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=b.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case T.SOLIDUS:{this.state=b.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=b.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=b.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Mn(e)?(this.state=b.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=b.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=b.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===T.HYPHEN_MINUS?(this.state=b.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=b.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===T.HYPHEN_MINUS?(this.state=b.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=b.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case T.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Le);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case T.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_ESCAPED,this._emitChars(Le);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=b.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_ESCAPED,this._emitChars(Le);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===T.SOLIDUS?this.state=b.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Mn(e)?(this._emitChars("<"),this.state=b.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Mn(e)?(this.state=b.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(rt.SCRIPT,!1)&&Oh(this.preprocessor.peek(rt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<rt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case T.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this._emitChars(Le);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case T.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Le);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=b.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Le);break}case T.EOF:{this._err(D.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===T.SOLIDUS?(this.state=b.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(rt.SCRIPT,!1)&&Oh(this.preprocessor.peek(rt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<rt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=b.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this.state=b.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case T.EQUALS_SIGN:{this._err(D.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=b.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=b.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this._leaveAttrName(),this.state=b.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=b.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(D.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.name+=Le;break}default:this.currentAttr.name+=String.fromCodePoint(Fr(e)?js(e):e)}}_stateAfterAttributeName(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:{this.state=b.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=b.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=b.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{this.state=b.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=b.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingAttributeValue),this.state=b.DATA,this.emitCurrentTagToken();break}default:this.state=b.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case T.QUOTATION_MARK:{this.state=b.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Le;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case T.APOSTROPHE:{this.state=b.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Le;break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=b.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=b.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),this.currentAttr.value+=Le;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(D.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=b.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=b.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=b.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBetweenAttributes),this.state=b.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case T.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=b.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(D.eofInTag),this._emitEOFToken();break}default:this._err(D.unexpectedSolidusInTag),this.state=b.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentComment(n);break}case T.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Le;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(rt.DASH_DASH,!0)?(this._createCommentToken(rt.DASH_DASH.length+1),this.state=b.COMMENT_START):this._consumeSequenceIfMatch(rt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(rt.DOCTYPE.length+1),this.state=b.DOCTYPE):this._consumeSequenceIfMatch(rt.CDATA_START,!0)?this.inForeignNode?this.state=b.CDATA_SECTION:(this._err(D.cdataInHtmlContent),this._createCommentToken(rt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=b.BOGUS_COMMENT):this._ensureHibernation()||(this._err(D.incorrectlyOpenedComment),this._createCommentToken(2),this.state=b.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case T.HYPHEN_MINUS:{this.state=b.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=b.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=b.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=b.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptClosingOfEmptyComment),this.state=b.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=b.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=b.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{n.data+="<",this.state=b.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.data+=Le;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case T.EXCLAMATION_MARK:{n.data+="!",this.state=b.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=b.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===T.HYPHEN_MINUS?this.state=b.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=b.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===T.HYPHEN_MINUS?this.state=b.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=b.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==T.GREATER_THAN_SIGN&&e!==T.EOF&&this._err(D.nestedComment),this.state=b.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{this.state=b.COMMENT_END;break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=b.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentComment(n);break}case T.EXCLAMATION_MARK:{this.state=b.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{n.data+="-";break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=b.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case T.HYPHEN_MINUS:{n.data+="--!",this.state=b.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(D.incorrectlyClosedComment),this.state=b.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(D.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=b.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=b.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=b.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingWhitespaceBeforeDoctypeName),this.state=b.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Fr(e))this._createDoctypeToken(String.fromCharCode(js(e))),this.state=b.DOCTYPE_NAME;else switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:{this._err(D.unexpectedNullCharacter),this._createDoctypeToken(Le),this.state=b.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.EOF:{this._err(D.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=b.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=b.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentDoctype(n);break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.name+=Le;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Fr(e)?js(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(rt.PUBLIC,!1)?this.state=b.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(rt.SYSTEM,!1)?this.state=b.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(D.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=b.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case T.QUOTATION_MARK:{this.state=b.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Le;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case T.APOSTROPHE:{this.state=b.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.publicId+=Le;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=b.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentDoctype(n);break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.QUOTATION_MARK:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=b.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(D.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(D.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case T.QUOTATION_MARK:{this.state=b.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Le;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case T.APOSTROPHE:{this.state=b.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(D.unexpectedNullCharacter),n.systemId+=Le;break}case T.GREATER_THAN_SIGN:{this._err(D.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.EOF:{this._err(D.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(D.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=b.DATA;break}case T.NULL:{this._err(D.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case T.RIGHT_SQUARE_BRACKET:{this.state=b.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(D.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===T.RIGHT_SQUARE_BRACKET?this.state=b.CDATA_SECTION_END:(this._emitChars("]"),this.state=b.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case T.GREATER_THAN_SIGN:{this.state=b.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=b.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&kh(this.preprocessor.peek(1))?b.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){kh(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===T.SEMICOLON&&this._err(D.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const _0=new Set([d.DD,d.DT,d.LI,d.OPTGROUP,d.OPTION,d.P,d.RB,d.RP,d.RT,d.RTC]),Nh=new Set([..._0,d.CAPTION,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]),fa=new Set([d.APPLET,d.CAPTION,d.HTML,d.MARQUEE,d.OBJECT,d.TABLE,d.TD,d.TEMPLATE,d.TH]),uC=new Set([...fa,d.OL,d.UL]),lC=new Set([...fa,d.BUTTON]),Dh=new Set([d.ANNOTATION_XML,d.MI,d.MN,d.MO,d.MS,d.MTEXT]),Ph=new Set([d.DESC,d.FOREIGN_OBJECT,d.TITLE]),cC=new Set([d.TR,d.TEMPLATE,d.HTML]),hC=new Set([d.TBODY,d.TFOOT,d.THEAD,d.TEMPLATE,d.HTML]),dC=new Set([d.TABLE,d.TEMPLATE,d.HTML]),fC=new Set([d.TD,d.TH]);class gC{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,i){this.treeAdapter=n,this.handler=i,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=d.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===d.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===z.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const i=this._indexOf(e);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(e,n,i){const r=this._indexOf(e)+1;this.items.splice(r,0,n),this.tagIDs.splice(r,0,i),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==z.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const i=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(i,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Tu,z.HTML)}popUntilTableCellPopped(){this.popUntilPopped(fC,z.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let i=this.stackTop;i>=0;i--)if(e.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(e,n){const i=this._indexOfTagNames(e,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(dC,z.HTML)}clearBackToTableBodyContext(){this.clearBackTo(hC,z.HTML)}clearBackToTableRowContext(){this.clearBackTo(cC,z.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===d.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===d.HTML}hasInDynamicScope(e,n){for(let i=this.stackTop;i>=0;i--){const r=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case z.HTML:{if(r===e)return!0;if(n.has(r))return!1;break}case z.SVG:{if(Ph.has(r))return!1;break}case z.MATHML:{if(Dh.has(r))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,fa)}hasInListItemScope(e){return this.hasInDynamicScope(e,uC)}hasInButtonScope(e){return this.hasInDynamicScope(e,lC)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case z.HTML:{if(Tu.has(n))return!0;if(fa.has(n))return!1;break}case z.SVG:{if(Ph.has(n))return!1;break}case z.MATHML:{if(Dh.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===z.HTML)switch(this.tagIDs[n]){case e:return!0;case d.TABLE:case d.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===z.HTML)switch(this.tagIDs[e]){case d.TBODY:case d.THEAD:case d.TFOOT:return!0;case d.TABLE:case d.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===z.HTML)switch(this.tagIDs[n]){case e:return!0;case d.OPTION:case d.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&_0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Nh.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Nh.has(this.currentTagId);)this.pop()}}const Bo=3;var $t;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})($t||($t={}));const Mh={type:$t.Marker};class mC{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const i=[],r=n.length,s=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===$t.Marker)break;const{element:l}=u;if(this.treeAdapter.getTagName(l)===s&&this.treeAdapter.getNamespaceURI(l)===a){const c=this.treeAdapter.getAttrList(l);c.length===r&&i.push({idx:o,attrs:c})}}return i}_ensureNoahArkCondition(e){if(this.entries.length<Bo)return;const n=this.treeAdapter.getAttrList(e),i=this._getNoahArkConditionCandidates(e,n);if(i.length<Bo)return;const r=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<i.length;a++){const o=i[a];o.attrs.every(u=>r.get(u.name)===u.value)&&(s+=1,s>=Bo&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Mh)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:$t.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:$t.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(Mh);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(i=>i.type===$t.Marker||this.treeAdapter.getTagName(i.element)===e);return n&&n.type===$t.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===$t.Element&&n.element===e)}}const vn={createDocument(){return{nodeName:"#document",mode:Lt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const i=t.childNodes.indexOf(n);t.childNodes.splice(i,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,i){const r=t.childNodes.find(s=>s.nodeName==="#documentType");if(r)r.name=e,r.publicId=n,r.systemId=i;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:i,parentNode:null};vn.appendChild(t,s)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(vn.isTextNode(n)){n.value+=e;return}}vn.appendChild(t,vn.createTextNode(e))},insertTextBefore(t,e,n){const i=t.childNodes[t.childNodes.indexOf(n)-1];i&&vn.isTextNode(i)?i.value+=e:vn.insertBefore(t,vn.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(i=>i.name));for(let i=0;i<e.length;i++)n.has(e[i].name)||t.attrs.push(e[i])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},E0="html",pC="about:legacy-compat",_C="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",T0=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],EC=[...T0,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],TC=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),b0=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],bC=[...b0,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function vh(t,e){return e.some(n=>t.startsWith(n))}function yC(t){return t.name===E0&&t.publicId===null&&(t.systemId===null||t.systemId===pC)}function xC(t){if(t.name!==E0)return Lt.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===_C)return Lt.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),TC.has(n))return Lt.QUIRKS;let i=e===null?EC:T0;if(vh(n,i))return Lt.QUIRKS;if(i=e===null?b0:bC,vh(n,i))return Lt.LIMITED_QUIRKS}return Lt.NO_QUIRKS}const Fh={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},CC="definitionurl",AC="definitionURL",IC=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),SC=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:z.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:z.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:z.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:z.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:z.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:z.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:z.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:z.XML}],["xml:space",{prefix:"xml",name:"space",namespace:z.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:z.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:z.XMLNS}]]),RC=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),LC=new Set([d.B,d.BIG,d.BLOCKQUOTE,d.BODY,d.BR,d.CENTER,d.CODE,d.DD,d.DIV,d.DL,d.DT,d.EM,d.EMBED,d.H1,d.H2,d.H3,d.H4,d.H5,d.H6,d.HEAD,d.HR,d.I,d.IMG,d.LI,d.LISTING,d.MENU,d.META,d.NOBR,d.OL,d.P,d.PRE,d.RUBY,d.S,d.SMALL,d.SPAN,d.STRONG,d.STRIKE,d.SUB,d.SUP,d.TABLE,d.TT,d.U,d.UL,d.VAR]);function wC(t){const e=t.tagID;return e===d.FONT&&t.attrs.some(({name:i})=>i===mi.COLOR||i===mi.SIZE||i===mi.FACE)||LC.has(e)}function y0(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===CC){t.attrs[e].name=AC;break}}function x0(t){for(let e=0;e<t.attrs.length;e++){const n=IC.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function yl(t){for(let e=0;e<t.attrs.length;e++){const n=SC.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function kC(t){const e=RC.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=fr(t.tagName))}function OC(t,e){return e===z.MATHML&&(t===d.MI||t===d.MO||t===d.MN||t===d.MS||t===d.MTEXT)}function NC(t,e,n){if(e===z.MATHML&&t===d.ANNOTATION_XML){for(let i=0;i<n.length;i++)if(n[i].name===mi.ENCODING){const r=n[i].value.toLowerCase();return r===Fh.TEXT_HTML||r===Fh.APPLICATION_XML}}return e===z.SVG&&(t===d.FOREIGN_OBJECT||t===d.DESC||t===d.TITLE)}function DC(t,e,n,i){return(!i||i===z.HTML)&&NC(t,e,n)||(!i||i===z.MATHML)&&OC(t,e)}const PC="hidden",MC=8,vC=3;var A;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(A||(A={}));const FC={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},C0=new Set([d.TABLE,d.TBODY,d.TFOOT,d.THEAD,d.TR]),Bh={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:vn,onParseError:null};class Uh{constructor(e,n,i=null,r=null){this.fragmentContext=i,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=A.INITIAL,this.originalInsertionMode=A.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Bh,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new oC(this.options,this),this.activeFormattingElements=new mC(this.treeAdapter),this.fragmentContextID=i?fr(this.treeAdapter.getTagName(i)):d.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new gC(this.document,this.treeAdapter,this)}static parse(e,n){const i=new this(n);return i.tokenizer.write(e,!0),i.document}static getFragmentParser(e,n){const i={...Bh,...n};e??(e=i.treeAdapter.createElement(k.TEMPLATE,z.HTML,[]));const r=i.treeAdapter.createElement("documentmock",z.HTML,[]),s=new this(i,r,e);return s.fragmentContextID===d.TEMPLATE&&s.tmplInsertionModeStack.unshift(A.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,i){var r;if(!this.onParseError)return;const s=(r=e.location)!==null&&r!==void 0?r:FC,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:i?s.startLine:s.endLine,endCol:i?s.startCol:s.endCol,endOffset:i?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(e,n,i){var r,s;(s=(r=this.treeAdapter).onItemPush)===null||s===void 0||s.call(r,e),i&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var i,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(i=this.treeAdapter).onItemPop)===null||r===void 0||r.call(i,e,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(e,n){const i=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===z.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,z.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=A.TEXT}switchToPlaintextParsing(){this.insertionMode=A.TEXT,this.originalInsertionMode=A.IN_BODY,this.tokenizer.state=De.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===k.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==z.HTML))switch(this.fragmentContextID){case d.TITLE:case d.TEXTAREA:{this.tokenizer.state=De.RCDATA;break}case d.STYLE:case d.XMP:case d.IFRAME:case d.NOEMBED:case d.NOFRAMES:case d.NOSCRIPT:{this.tokenizer.state=De.RAWTEXT;break}case d.SCRIPT:{this.tokenizer.state=De.SCRIPT_DATA;break}case d.PLAINTEXT:{this.tokenizer.state=De.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",i=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,r),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,e)}}_appendElement(e,n){const i=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(i,e.location)}_insertElement(e,n){const i=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(i,e.location),this.openElements.push(i,e.tagID)}_insertFakeElement(e,n){const i=this.treeAdapter.createElement(e,z.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,z.HTML,e.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(k.HTML,z.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,d.HTML)}_appendCommentNode(e,n){const i=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_insertCharacters(e){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,e.chars,i):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(n),s=i?r.lastIndexOf(i):r.length,a=r[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:u,endCol:l,endOffset:c}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:u,endCol:l,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,n){for(let i=this.treeAdapter.getFirstChild(e);i;i=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const i=n.location,r=this.treeAdapter.getTagName(e),s=n.type===ce.END_TAG&&r===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,e.tagID===d.SVG&&this.treeAdapter.getTagName(n)===k.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===z.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===d.MGLYPH||e.tagID===d.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,z.HTML)}_processToken(e){switch(e.type){case ce.CHARACTER:{this.onCharacter(e);break}case ce.NULL_CHARACTER:{this.onNullCharacter(e);break}case ce.COMMENT:{this.onComment(e);break}case ce.DOCTYPE:{this.onDoctype(e);break}case ce.START_TAG:{this._processStartTag(e);break}case ce.END_TAG:{this.onEndTag(e);break}case ce.EOF:{this.onEof(e);break}case ce.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return DC(e,r,s,i)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===$t.Marker||this.openElements.contains(r.element)),i=n===-1?e-1:n-1;for(let r=i;r>=0;r--){const s=this.activeFormattingElements.entries[r];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=A.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(d.P),this.openElements.popUntilTagNamePopped(d.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case d.TR:{this.insertionMode=A.IN_ROW;return}case d.TBODY:case d.THEAD:case d.TFOOT:{this.insertionMode=A.IN_TABLE_BODY;return}case d.CAPTION:{this.insertionMode=A.IN_CAPTION;return}case d.COLGROUP:{this.insertionMode=A.IN_COLUMN_GROUP;return}case d.TABLE:{this.insertionMode=A.IN_TABLE;return}case d.BODY:{this.insertionMode=A.IN_BODY;return}case d.FRAMESET:{this.insertionMode=A.IN_FRAMESET;return}case d.SELECT:{this._resetInsertionModeForSelect(e);return}case d.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case d.HTML:{this.insertionMode=this.headElement?A.AFTER_HEAD:A.BEFORE_HEAD;return}case d.TD:case d.TH:{if(e>0){this.insertionMode=A.IN_CELL;return}break}case d.HEAD:{if(e>0){this.insertionMode=A.IN_HEAD;return}break}}this.insertionMode=A.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===d.TEMPLATE)break;if(i===d.TABLE){this.insertionMode=A.IN_SELECT_IN_TABLE;return}}this.insertionMode=A.IN_SELECT}_isElementCausesFosterParenting(e){return C0.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case d.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===z.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case d.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const i=this.treeAdapter.getNamespaceURI(e);return iC[i].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){fI(this,e);return}switch(this.insertionMode){case A.INITIAL:{Lr(this,e);break}case A.BEFORE_HTML:{jr(this,e);break}case A.BEFORE_HEAD:{Wr(this,e);break}case A.IN_HEAD:{Xr(this,e);break}case A.IN_HEAD_NO_SCRIPT:{Vr(this,e);break}case A.AFTER_HEAD:{Kr(this,e);break}case A.IN_BODY:case A.IN_CAPTION:case A.IN_CELL:case A.IN_TEMPLATE:{I0(this,e);break}case A.TEXT:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{Uo(this,e);break}case A.IN_TABLE_TEXT:{O0(this,e);break}case A.IN_COLUMN_GROUP:{ga(this,e);break}case A.AFTER_BODY:{ma(this,e);break}case A.AFTER_AFTER_BODY:{Zs(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){dI(this,e);return}switch(this.insertionMode){case A.INITIAL:{Lr(this,e);break}case A.BEFORE_HTML:{jr(this,e);break}case A.BEFORE_HEAD:{Wr(this,e);break}case A.IN_HEAD:{Xr(this,e);break}case A.IN_HEAD_NO_SCRIPT:{Vr(this,e);break}case A.AFTER_HEAD:{Kr(this,e);break}case A.TEXT:{this._insertCharacters(e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{Uo(this,e);break}case A.IN_COLUMN_GROUP:{ga(this,e);break}case A.AFTER_BODY:{ma(this,e);break}case A.AFTER_AFTER_BODY:{Zs(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){bu(this,e);return}switch(this.insertionMode){case A.INITIAL:case A.BEFORE_HTML:case A.BEFORE_HEAD:case A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:case A.IN_BODY:case A.IN_TABLE:case A.IN_CAPTION:case A.IN_COLUMN_GROUP:case A.IN_TABLE_BODY:case A.IN_ROW:case A.IN_CELL:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:case A.IN_TEMPLATE:case A.IN_FRAMESET:case A.AFTER_FRAMESET:{bu(this,e);break}case A.IN_TABLE_TEXT:{wr(this,e);break}case A.AFTER_BODY:{jC(this,e);break}case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{WC(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case A.INITIAL:{XC(this,e);break}case A.BEFORE_HEAD:case A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:{this._err(e,D.misplacedDoctype);break}case A.IN_TABLE_TEXT:{wr(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,D.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?gI(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case A.INITIAL:{Lr(this,e);break}case A.BEFORE_HTML:{VC(this,e);break}case A.BEFORE_HEAD:{qC(this,e);break}case A.IN_HEAD:{Gt(this,e);break}case A.IN_HEAD_NO_SCRIPT:{QC(this,e);break}case A.AFTER_HEAD:{eA(this,e);break}case A.IN_BODY:{Ze(this,e);break}case A.IN_TABLE:{or(this,e);break}case A.IN_TABLE_TEXT:{wr(this,e);break}case A.IN_CAPTION:{$A(this,e);break}case A.IN_COLUMN_GROUP:{Al(this,e);break}case A.IN_TABLE_BODY:{Va(this,e);break}case A.IN_ROW:{Ka(this,e);break}case A.IN_CELL:{JA(this,e);break}case A.IN_SELECT:{P0(this,e);break}case A.IN_SELECT_IN_TABLE:{tI(this,e);break}case A.IN_TEMPLATE:{iI(this,e);break}case A.AFTER_BODY:{sI(this,e);break}case A.IN_FRAMESET:{aI(this,e);break}case A.AFTER_FRAMESET:{uI(this,e);break}case A.AFTER_AFTER_BODY:{cI(this,e);break}case A.AFTER_AFTER_FRAMESET:{hI(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?mI(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case A.INITIAL:{Lr(this,e);break}case A.BEFORE_HTML:{KC(this,e);break}case A.BEFORE_HEAD:{$C(this,e);break}case A.IN_HEAD:{ZC(this,e);break}case A.IN_HEAD_NO_SCRIPT:{JC(this,e);break}case A.AFTER_HEAD:{tA(this,e);break}case A.IN_BODY:{Xa(this,e);break}case A.TEXT:{HA(this,e);break}case A.IN_TABLE:{ls(this,e);break}case A.IN_TABLE_TEXT:{wr(this,e);break}case A.IN_CAPTION:{ZA(this,e);break}case A.IN_COLUMN_GROUP:{QA(this,e);break}case A.IN_TABLE_BODY:{yu(this,e);break}case A.IN_ROW:{D0(this,e);break}case A.IN_CELL:{eI(this,e);break}case A.IN_SELECT:{M0(this,e);break}case A.IN_SELECT_IN_TABLE:{nI(this,e);break}case A.IN_TEMPLATE:{rI(this,e);break}case A.AFTER_BODY:{F0(this,e);break}case A.IN_FRAMESET:{oI(this,e);break}case A.AFTER_FRAMESET:{lI(this,e);break}case A.AFTER_AFTER_BODY:{Zs(this,e);break}}}onEof(e){switch(this.insertionMode){case A.INITIAL:{Lr(this,e);break}case A.BEFORE_HTML:{jr(this,e);break}case A.BEFORE_HEAD:{Wr(this,e);break}case A.IN_HEAD:{Xr(this,e);break}case A.IN_HEAD_NO_SCRIPT:{Vr(this,e);break}case A.AFTER_HEAD:{Kr(this,e);break}case A.IN_BODY:case A.IN_TABLE:case A.IN_CAPTION:case A.IN_COLUMN_GROUP:case A.IN_TABLE_BODY:case A.IN_ROW:case A.IN_CELL:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:{w0(this,e);break}case A.TEXT:{zA(this,e);break}case A.IN_TABLE_TEXT:{wr(this,e);break}case A.IN_TEMPLATE:{v0(this,e);break}case A.AFTER_BODY:case A.IN_FRAMESET:case A.AFTER_FRAMESET:case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{Cl(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===T.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case A.IN_HEAD:case A.IN_HEAD_NO_SCRIPT:case A.AFTER_HEAD:case A.TEXT:case A.IN_COLUMN_GROUP:case A.IN_SELECT:case A.IN_SELECT_IN_TABLE:case A.IN_FRAMESET:case A.AFTER_FRAMESET:{this._insertCharacters(e);break}case A.IN_BODY:case A.IN_CAPTION:case A.IN_CELL:case A.IN_TEMPLATE:case A.AFTER_BODY:case A.AFTER_AFTER_BODY:case A.AFTER_AFTER_FRAMESET:{A0(this,e);break}case A.IN_TABLE:case A.IN_TABLE_BODY:case A.IN_ROW:{Uo(this,e);break}case A.IN_TABLE_TEXT:{k0(this,e);break}}}}function BC(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):L0(t,e),n}function UC(t,e){let n=null,i=t.openElements.stackTop;for(;i>=0;i--){const r=t.openElements.items[i];if(r===e.element)break;t._isSpecialElement(r,t.openElements.tagIDs[i])&&(n=r)}return n||(t.openElements.shortenToLength(Math.max(i,0)),t.activeFormattingElements.removeEntry(e)),n}function HC(t,e,n){let i=e,r=t.openElements.getCommonAncestor(e);for(let s=0,a=r;a!==n;s++,a=r){r=t.openElements.getCommonAncestor(a);const o=t.activeFormattingElements.getElementEntry(a),u=o&&s>=vC;!o||u?(u&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(a)):(a=zC(t,o),i===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(i),t.treeAdapter.appendChild(a,i),i=a)}return i}function zC(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),i=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,i),e.element=i,i}function YC(t,e,n){const i=t.treeAdapter.getTagName(e),r=fr(i);if(t._isElementCausesFosterParenting(r))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);r===d.TEMPLATE&&s===z.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function GC(t,e,n){const i=t.treeAdapter.getNamespaceURI(n.element),{token:r}=n,s=t.treeAdapter.createElement(r.tagName,i,r.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,r),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,r.tagID)}function xl(t,e){for(let n=0;n<MC;n++){const i=BC(t,e);if(!i)break;const r=UC(t,i);if(!r)break;t.activeFormattingElements.bookmark=i;const s=HC(t,r,i.element),a=t.openElements.getCommonAncestor(i.element);t.treeAdapter.detachNode(s),a&&YC(t,a,s),GC(t,r,i)}}function bu(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function jC(t,e){t._appendCommentNode(e,t.openElements.items[0])}function WC(t,e){t._appendCommentNode(e,t.document)}function Cl(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let i=t.openElements.stackTop;i>=n;i--)t._setEndLocation(t.openElements.items[i],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const i=t.openElements.items[0],r=t.treeAdapter.getNodeSourceCodeLocation(i);if(r&&!r.endTag&&(t._setEndLocation(i,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&t._setEndLocation(s,e)}}}}function XC(t,e){t._setDocumentType(e);const n=e.forceQuirks?Lt.QUIRKS:xC(e);yC(e)||t._err(e,D.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=A.BEFORE_HTML}function Lr(t,e){t._err(e,D.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Lt.QUIRKS),t.insertionMode=A.BEFORE_HTML,t._processToken(e)}function VC(t,e){e.tagID===d.HTML?(t._insertElement(e,z.HTML),t.insertionMode=A.BEFORE_HEAD):jr(t,e)}function KC(t,e){const n=e.tagID;(n===d.HTML||n===d.HEAD||n===d.BODY||n===d.BR)&&jr(t,e)}function jr(t,e){t._insertFakeRootElement(),t.insertionMode=A.BEFORE_HEAD,t._processToken(e)}function qC(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.HEAD:{t._insertElement(e,z.HTML),t.headElement=t.openElements.current,t.insertionMode=A.IN_HEAD;break}default:Wr(t,e)}}function $C(t,e){const n=e.tagID;n===d.HEAD||n===d.BODY||n===d.HTML||n===d.BR?Wr(t,e):t._err(e,D.endTagWithoutMatchingOpenElement)}function Wr(t,e){t._insertFakeElement(k.HEAD,d.HEAD),t.headElement=t.openElements.current,t.insertionMode=A.IN_HEAD,t._processToken(e)}function Gt(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:{t._appendElement(e,z.HTML),e.ackSelfClosing=!0;break}case d.TITLE:{t._switchToTextParsing(e,De.RCDATA);break}case d.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,De.RAWTEXT):(t._insertElement(e,z.HTML),t.insertionMode=A.IN_HEAD_NO_SCRIPT);break}case d.NOFRAMES:case d.STYLE:{t._switchToTextParsing(e,De.RAWTEXT);break}case d.SCRIPT:{t._switchToTextParsing(e,De.SCRIPT_DATA);break}case d.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=A.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(A.IN_TEMPLATE);break}case d.HEAD:{t._err(e,D.misplacedStartTagForHeadElement);break}default:Xr(t,e)}}function ZC(t,e){switch(e.tagID){case d.HEAD:{t.openElements.pop(),t.insertionMode=A.AFTER_HEAD;break}case d.BODY:case d.BR:case d.HTML:{Xr(t,e);break}case d.TEMPLATE:{Si(t,e);break}default:t._err(e,D.endTagWithoutMatchingOpenElement)}}function Si(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==d.TEMPLATE&&t._err(e,D.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(d.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,D.endTagWithoutMatchingOpenElement)}function Xr(t,e){t.openElements.pop(),t.insertionMode=A.AFTER_HEAD,t._processToken(e)}function QC(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.BASEFONT:case d.BGSOUND:case d.HEAD:case d.LINK:case d.META:case d.NOFRAMES:case d.STYLE:{Gt(t,e);break}case d.NOSCRIPT:{t._err(e,D.nestedNoscriptInHead);break}default:Vr(t,e)}}function JC(t,e){switch(e.tagID){case d.NOSCRIPT:{t.openElements.pop(),t.insertionMode=A.IN_HEAD;break}case d.BR:{Vr(t,e);break}default:t._err(e,D.endTagWithoutMatchingOpenElement)}}function Vr(t,e){const n=e.type===ce.EOF?D.openElementsLeftAfterEof:D.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=A.IN_HEAD,t._processToken(e)}function eA(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.BODY:{t._insertElement(e,z.HTML),t.framesetOk=!1,t.insertionMode=A.IN_BODY;break}case d.FRAMESET:{t._insertElement(e,z.HTML),t.insertionMode=A.IN_FRAMESET;break}case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:case d.NOFRAMES:case d.SCRIPT:case d.STYLE:case d.TEMPLATE:case d.TITLE:{t._err(e,D.abandonedHeadElementChild),t.openElements.push(t.headElement,d.HEAD),Gt(t,e),t.openElements.remove(t.headElement);break}case d.HEAD:{t._err(e,D.misplacedStartTagForHeadElement);break}default:Kr(t,e)}}function tA(t,e){switch(e.tagID){case d.BODY:case d.HTML:case d.BR:{Kr(t,e);break}case d.TEMPLATE:{Si(t,e);break}default:t._err(e,D.endTagWithoutMatchingOpenElement)}}function Kr(t,e){t._insertFakeElement(k.BODY,d.BODY),t.insertionMode=A.IN_BODY,Wa(t,e)}function Wa(t,e){switch(e.type){case ce.CHARACTER:{I0(t,e);break}case ce.WHITESPACE_CHARACTER:{A0(t,e);break}case ce.COMMENT:{bu(t,e);break}case ce.START_TAG:{Ze(t,e);break}case ce.END_TAG:{Xa(t,e);break}case ce.EOF:{w0(t,e);break}}}function A0(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function I0(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function nA(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function iA(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function rA(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,z.HTML),t.insertionMode=A.IN_FRAMESET)}function sA(t,e){t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._insertElement(e,z.HTML)}function aA(t,e){t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Tu.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,z.HTML)}function oA(t,e){t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._insertElement(e,z.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function uA(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._insertElement(e,z.HTML),n||(t.formElement=t.openElements.current))}function lA(t,e){t.framesetOk=!1;const n=e.tagID;for(let i=t.openElements.stackTop;i>=0;i--){const r=t.openElements.tagIDs[i];if(n===d.LI&&r===d.LI||(n===d.DD||n===d.DT)&&(r===d.DD||r===d.DT)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r);break}if(r!==d.ADDRESS&&r!==d.DIV&&r!==d.P&&t._isSpecialElement(t.openElements.items[i],r))break}t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._insertElement(e,z.HTML)}function cA(t,e){t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._insertElement(e,z.HTML),t.tokenizer.state=De.PLAINTEXT}function hA(t,e){t.openElements.hasInScope(d.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(d.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,z.HTML),t.framesetOk=!1}function dA(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(k.A);n&&(xl(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,z.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function fA(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,z.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function gA(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(d.NOBR)&&(xl(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,z.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function mA(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,z.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function pA(t,e){t.treeAdapter.getDocumentMode(t.document)!==Lt.QUIRKS&&t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._insertElement(e,z.HTML),t.framesetOk=!1,t.insertionMode=A.IN_TABLE}function S0(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,z.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function R0(t){const e=m0(t,mi.TYPE);return e!=null&&e.toLowerCase()===PC}function _A(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,z.HTML),R0(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function EA(t,e){t._appendElement(e,z.HTML),e.ackSelfClosing=!0}function TA(t,e){t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._appendElement(e,z.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function bA(t,e){e.tagName=k.IMG,e.tagID=d.IMG,S0(t,e)}function yA(t,e){t._insertElement(e,z.HTML),t.skipNextNewLine=!0,t.tokenizer.state=De.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=A.TEXT}function xA(t,e){t.openElements.hasInButtonScope(d.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,De.RAWTEXT)}function CA(t,e){t.framesetOk=!1,t._switchToTextParsing(e,De.RAWTEXT)}function Hh(t,e){t._switchToTextParsing(e,De.RAWTEXT)}function AA(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,z.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===A.IN_TABLE||t.insertionMode===A.IN_CAPTION||t.insertionMode===A.IN_TABLE_BODY||t.insertionMode===A.IN_ROW||t.insertionMode===A.IN_CELL?A.IN_SELECT_IN_TABLE:A.IN_SELECT}function IA(t,e){t.openElements.currentTagId===d.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,z.HTML)}function SA(t,e){t.openElements.hasInScope(d.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,z.HTML)}function RA(t,e){t.openElements.hasInScope(d.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(d.RTC),t._insertElement(e,z.HTML)}function LA(t,e){t._reconstructActiveFormattingElements(),y0(e),yl(e),e.selfClosing?t._appendElement(e,z.MATHML):t._insertElement(e,z.MATHML),e.ackSelfClosing=!0}function wA(t,e){t._reconstructActiveFormattingElements(),x0(e),yl(e),e.selfClosing?t._appendElement(e,z.SVG):t._insertElement(e,z.SVG),e.ackSelfClosing=!0}function zh(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,z.HTML)}function Ze(t,e){switch(e.tagID){case d.I:case d.S:case d.B:case d.U:case d.EM:case d.TT:case d.BIG:case d.CODE:case d.FONT:case d.SMALL:case d.STRIKE:case d.STRONG:{fA(t,e);break}case d.A:{dA(t,e);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{aA(t,e);break}case d.P:case d.DL:case d.OL:case d.UL:case d.DIV:case d.DIR:case d.NAV:case d.MAIN:case d.MENU:case d.ASIDE:case d.CENTER:case d.FIGURE:case d.FOOTER:case d.HEADER:case d.HGROUP:case d.DIALOG:case d.DETAILS:case d.ADDRESS:case d.ARTICLE:case d.SEARCH:case d.SECTION:case d.SUMMARY:case d.FIELDSET:case d.BLOCKQUOTE:case d.FIGCAPTION:{sA(t,e);break}case d.LI:case d.DD:case d.DT:{lA(t,e);break}case d.BR:case d.IMG:case d.WBR:case d.AREA:case d.EMBED:case d.KEYGEN:{S0(t,e);break}case d.HR:{TA(t,e);break}case d.RB:case d.RTC:{SA(t,e);break}case d.RT:case d.RP:{RA(t,e);break}case d.PRE:case d.LISTING:{oA(t,e);break}case d.XMP:{xA(t,e);break}case d.SVG:{wA(t,e);break}case d.HTML:{nA(t,e);break}case d.BASE:case d.LINK:case d.META:case d.STYLE:case d.TITLE:case d.SCRIPT:case d.BGSOUND:case d.BASEFONT:case d.TEMPLATE:{Gt(t,e);break}case d.BODY:{iA(t,e);break}case d.FORM:{uA(t,e);break}case d.NOBR:{gA(t,e);break}case d.MATH:{LA(t,e);break}case d.TABLE:{pA(t,e);break}case d.INPUT:{_A(t,e);break}case d.PARAM:case d.TRACK:case d.SOURCE:{EA(t,e);break}case d.IMAGE:{bA(t,e);break}case d.BUTTON:{hA(t,e);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{mA(t,e);break}case d.IFRAME:{CA(t,e);break}case d.SELECT:{AA(t,e);break}case d.OPTION:case d.OPTGROUP:{IA(t,e);break}case d.NOEMBED:case d.NOFRAMES:{Hh(t,e);break}case d.FRAMESET:{rA(t,e);break}case d.TEXTAREA:{yA(t,e);break}case d.NOSCRIPT:{t.options.scriptingEnabled?Hh(t,e):zh(t,e);break}case d.PLAINTEXT:{cA(t,e);break}case d.COL:case d.TH:case d.TD:case d.TR:case d.HEAD:case d.FRAME:case d.TBODY:case d.TFOOT:case d.THEAD:case d.CAPTION:case d.COLGROUP:break;default:zh(t,e)}}function kA(t,e){if(t.openElements.hasInScope(d.BODY)&&(t.insertionMode=A.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function OA(t,e){t.openElements.hasInScope(d.BODY)&&(t.insertionMode=A.AFTER_BODY,F0(t,e))}function NA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function DA(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(d.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(d.FORM):n&&t.openElements.remove(n))}function PA(t){t.openElements.hasInButtonScope(d.P)||t._insertFakeElement(k.P,d.P),t._closePElement()}function MA(t){t.openElements.hasInListItemScope(d.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(d.LI),t.openElements.popUntilTagNamePopped(d.LI))}function vA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function FA(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function BA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function UA(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(k.BR,d.BR),t.openElements.pop(),t.framesetOk=!1}function L0(t,e){const n=e.tagName,i=e.tagID;for(let r=t.openElements.stackTop;r>0;r--){const s=t.openElements.items[r],a=t.openElements.tagIDs[r];if(i===a&&(i!==d.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.stackTop>=r&&t.openElements.shortenToLength(r);break}if(t._isSpecialElement(s,a))break}}function Xa(t,e){switch(e.tagID){case d.A:case d.B:case d.I:case d.S:case d.U:case d.EM:case d.TT:case d.BIG:case d.CODE:case d.FONT:case d.NOBR:case d.SMALL:case d.STRIKE:case d.STRONG:{xl(t,e);break}case d.P:{PA(t);break}case d.DL:case d.UL:case d.OL:case d.DIR:case d.DIV:case d.NAV:case d.PRE:case d.MAIN:case d.MENU:case d.ASIDE:case d.BUTTON:case d.CENTER:case d.FIGURE:case d.FOOTER:case d.HEADER:case d.HGROUP:case d.DIALOG:case d.ADDRESS:case d.ARTICLE:case d.DETAILS:case d.SEARCH:case d.SECTION:case d.SUMMARY:case d.LISTING:case d.FIELDSET:case d.BLOCKQUOTE:case d.FIGCAPTION:{NA(t,e);break}case d.LI:{MA(t);break}case d.DD:case d.DT:{vA(t,e);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{FA(t);break}case d.BR:{UA(t);break}case d.BODY:{kA(t,e);break}case d.HTML:{OA(t,e);break}case d.FORM:{DA(t);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{BA(t,e);break}case d.TEMPLATE:{Si(t,e);break}default:L0(t,e)}}function w0(t,e){t.tmplInsertionModeStack.length>0?v0(t,e):Cl(t,e)}function HA(t,e){var n;e.tagID===d.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function zA(t,e){t._err(e,D.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Uo(t,e){if(t.openElements.currentTagId!==void 0&&C0.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=A.IN_TABLE_TEXT,e.type){case ce.CHARACTER:{O0(t,e);break}case ce.WHITESPACE_CHARACTER:{k0(t,e);break}}else Ss(t,e)}function YA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,z.HTML),t.insertionMode=A.IN_CAPTION}function GA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,z.HTML),t.insertionMode=A.IN_COLUMN_GROUP}function jA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(k.COLGROUP,d.COLGROUP),t.insertionMode=A.IN_COLUMN_GROUP,Al(t,e)}function WA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,z.HTML),t.insertionMode=A.IN_TABLE_BODY}function XA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(k.TBODY,d.TBODY),t.insertionMode=A.IN_TABLE_BODY,Va(t,e)}function VA(t,e){t.openElements.hasInTableScope(d.TABLE)&&(t.openElements.popUntilTagNamePopped(d.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function KA(t,e){R0(e)?t._appendElement(e,z.HTML):Ss(t,e),e.ackSelfClosing=!0}function qA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,z.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function or(t,e){switch(e.tagID){case d.TD:case d.TH:case d.TR:{XA(t,e);break}case d.STYLE:case d.SCRIPT:case d.TEMPLATE:{Gt(t,e);break}case d.COL:{jA(t,e);break}case d.FORM:{qA(t,e);break}case d.TABLE:{VA(t,e);break}case d.TBODY:case d.TFOOT:case d.THEAD:{WA(t,e);break}case d.INPUT:{KA(t,e);break}case d.CAPTION:{YA(t,e);break}case d.COLGROUP:{GA(t,e);break}default:Ss(t,e)}}function ls(t,e){switch(e.tagID){case d.TABLE:{t.openElements.hasInTableScope(d.TABLE)&&(t.openElements.popUntilTagNamePopped(d.TABLE),t._resetInsertionMode());break}case d.TEMPLATE:{Si(t,e);break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TBODY:case d.TD:case d.TFOOT:case d.TH:case d.THEAD:case d.TR:break;default:Ss(t,e)}}function Ss(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Wa(t,e),t.fosterParentingEnabled=n}function k0(t,e){t.pendingCharacterTokens.push(e)}function O0(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function wr(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Ss(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const N0=new Set([d.CAPTION,d.COL,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]);function $A(t,e){const n=e.tagID;N0.has(n)?t.openElements.hasInTableScope(d.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(d.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_TABLE,or(t,e)):Ze(t,e)}function ZA(t,e){const n=e.tagID;switch(n){case d.CAPTION:case d.TABLE:{t.openElements.hasInTableScope(d.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(d.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_TABLE,n===d.TABLE&&ls(t,e));break}case d.BODY:case d.COL:case d.COLGROUP:case d.HTML:case d.TBODY:case d.TD:case d.TFOOT:case d.TH:case d.THEAD:case d.TR:break;default:Xa(t,e)}}function Al(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.COL:{t._appendElement(e,z.HTML),e.ackSelfClosing=!0;break}case d.TEMPLATE:{Gt(t,e);break}default:ga(t,e)}}function QA(t,e){switch(e.tagID){case d.COLGROUP:{t.openElements.currentTagId===d.COLGROUP&&(t.openElements.pop(),t.insertionMode=A.IN_TABLE);break}case d.TEMPLATE:{Si(t,e);break}case d.COL:break;default:ga(t,e)}}function ga(t,e){t.openElements.currentTagId===d.COLGROUP&&(t.openElements.pop(),t.insertionMode=A.IN_TABLE,t._processToken(e))}function Va(t,e){switch(e.tagID){case d.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,z.HTML),t.insertionMode=A.IN_ROW;break}case d.TH:case d.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(k.TR,d.TR),t.insertionMode=A.IN_ROW,Ka(t,e);break}case d.CAPTION:case d.COL:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE,or(t,e));break}default:or(t,e)}}function yu(t,e){const n=e.tagID;switch(e.tagID){case d.TBODY:case d.TFOOT:case d.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE);break}case d.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE,ls(t,e));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TD:case d.TH:case d.TR:break;default:ls(t,e)}}function Ka(t,e){switch(e.tagID){case d.TH:case d.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,z.HTML),t.insertionMode=A.IN_CELL,t.activeFormattingElements.insertMarker();break}case d.CAPTION:case d.COL:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:case d.TR:{t.openElements.hasInTableScope(d.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,Va(t,e));break}default:or(t,e)}}function D0(t,e){switch(e.tagID){case d.TR:{t.openElements.hasInTableScope(d.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY);break}case d.TABLE:{t.openElements.hasInTableScope(d.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,yu(t,e));break}case d.TBODY:case d.TFOOT:case d.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(d.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=A.IN_TABLE_BODY,yu(t,e));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TD:case d.TH:break;default:ls(t,e)}}function JA(t,e){const n=e.tagID;N0.has(n)?(t.openElements.hasInTableScope(d.TD)||t.openElements.hasInTableScope(d.TH))&&(t._closeTableCell(),Ka(t,e)):Ze(t,e)}function eI(t,e){const n=e.tagID;switch(n){case d.TD:case d.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=A.IN_ROW);break}case d.TABLE:case d.TBODY:case d.TFOOT:case d.THEAD:case d.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),D0(t,e));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:break;default:Xa(t,e)}}function P0(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.OPTION:{t.openElements.currentTagId===d.OPTION&&t.openElements.pop(),t._insertElement(e,z.HTML);break}case d.OPTGROUP:{t.openElements.currentTagId===d.OPTION&&t.openElements.pop(),t.openElements.currentTagId===d.OPTGROUP&&t.openElements.pop(),t._insertElement(e,z.HTML);break}case d.HR:{t.openElements.currentTagId===d.OPTION&&t.openElements.pop(),t.openElements.currentTagId===d.OPTGROUP&&t.openElements.pop(),t._appendElement(e,z.HTML),e.ackSelfClosing=!0;break}case d.INPUT:case d.KEYGEN:case d.TEXTAREA:case d.SELECT:{t.openElements.hasInSelectScope(d.SELECT)&&(t.openElements.popUntilTagNamePopped(d.SELECT),t._resetInsertionMode(),e.tagID!==d.SELECT&&t._processStartTag(e));break}case d.SCRIPT:case d.TEMPLATE:{Gt(t,e);break}}}function M0(t,e){switch(e.tagID){case d.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===d.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===d.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===d.OPTGROUP&&t.openElements.pop();break}case d.OPTION:{t.openElements.currentTagId===d.OPTION&&t.openElements.pop();break}case d.SELECT:{t.openElements.hasInSelectScope(d.SELECT)&&(t.openElements.popUntilTagNamePopped(d.SELECT),t._resetInsertionMode());break}case d.TEMPLATE:{Si(t,e);break}}}function tI(t,e){const n=e.tagID;n===d.CAPTION||n===d.TABLE||n===d.TBODY||n===d.TFOOT||n===d.THEAD||n===d.TR||n===d.TD||n===d.TH?(t.openElements.popUntilTagNamePopped(d.SELECT),t._resetInsertionMode(),t._processStartTag(e)):P0(t,e)}function nI(t,e){const n=e.tagID;n===d.CAPTION||n===d.TABLE||n===d.TBODY||n===d.TFOOT||n===d.THEAD||n===d.TR||n===d.TD||n===d.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(d.SELECT),t._resetInsertionMode(),t.onEndTag(e)):M0(t,e)}function iI(t,e){switch(e.tagID){case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:case d.NOFRAMES:case d.SCRIPT:case d.STYLE:case d.TEMPLATE:case d.TITLE:{Gt(t,e);break}case d.CAPTION:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:{t.tmplInsertionModeStack[0]=A.IN_TABLE,t.insertionMode=A.IN_TABLE,or(t,e);break}case d.COL:{t.tmplInsertionModeStack[0]=A.IN_COLUMN_GROUP,t.insertionMode=A.IN_COLUMN_GROUP,Al(t,e);break}case d.TR:{t.tmplInsertionModeStack[0]=A.IN_TABLE_BODY,t.insertionMode=A.IN_TABLE_BODY,Va(t,e);break}case d.TD:case d.TH:{t.tmplInsertionModeStack[0]=A.IN_ROW,t.insertionMode=A.IN_ROW,Ka(t,e);break}default:t.tmplInsertionModeStack[0]=A.IN_BODY,t.insertionMode=A.IN_BODY,Ze(t,e)}}function rI(t,e){e.tagID===d.TEMPLATE&&Si(t,e)}function v0(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(d.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Cl(t,e)}function sI(t,e){e.tagID===d.HTML?Ze(t,e):ma(t,e)}function F0(t,e){var n;if(e.tagID===d.HTML){if(t.fragmentContext||(t.insertionMode=A.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===d.HTML){t._setEndLocation(t.openElements.items[0],e);const i=t.openElements.items[1];i&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&t._setEndLocation(i,e)}}else ma(t,e)}function ma(t,e){t.insertionMode=A.IN_BODY,Wa(t,e)}function aI(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.FRAMESET:{t._insertElement(e,z.HTML);break}case d.FRAME:{t._appendElement(e,z.HTML),e.ackSelfClosing=!0;break}case d.NOFRAMES:{Gt(t,e);break}}}function oI(t,e){e.tagID===d.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==d.FRAMESET&&(t.insertionMode=A.AFTER_FRAMESET))}function uI(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.NOFRAMES:{Gt(t,e);break}}}function lI(t,e){e.tagID===d.HTML&&(t.insertionMode=A.AFTER_AFTER_FRAMESET)}function cI(t,e){e.tagID===d.HTML?Ze(t,e):Zs(t,e)}function Zs(t,e){t.insertionMode=A.IN_BODY,Wa(t,e)}function hI(t,e){switch(e.tagID){case d.HTML:{Ze(t,e);break}case d.NOFRAMES:{Gt(t,e);break}}}function dI(t,e){e.chars=Le,t._insertCharacters(e)}function fI(t,e){t._insertCharacters(e),t.framesetOk=!1}function B0(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==z.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function gI(t,e){if(wC(e))B0(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),i=t.treeAdapter.getNamespaceURI(n);i===z.MATHML?y0(e):i===z.SVG&&(kC(e),x0(e)),yl(e),e.selfClosing?t._appendElement(e,i):t._insertElement(e,i),e.ackSelfClosing=!0}}function mI(t,e){if(e.tagID===d.P||e.tagID===d.BR){B0(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const i=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(i)===z.HTML){t._endTagOutsideForeignContent(e);break}const r=t.treeAdapter.getTagName(i);if(r.toLowerCase()===e.tagName){e.tagName=r,t.openElements.shortenToLength(n);break}}}k.AREA,k.BASE,k.BASEFONT,k.BGSOUND,k.BR,k.COL,k.EMBED,k.FRAME,k.HR,k.IMG,k.INPUT,k.KEYGEN,k.LINK,k.META,k.PARAM,k.SOURCE,k.TRACK,k.WBR;const pI=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,_I=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Yh={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function U0(t,e){const n=RI(t),i=c0("type",{handlers:{root:EI,element:TI,text:bI,comment:z0,doctype:yI,raw:CI},unknown:AI}),r={parser:n?new Uh(Yh):Uh.getFragmentParser(void 0,Yh),handle(o){i(o,r)},stitches:!1,options:e||{}};i(t,r),gr(r,nn());const s=n?r.parser.document:r.parser.getFragment(),a=L2(s,{file:r.options.file});return r.stitches&&ja(a,"comment",function(o,u,l){const c=o;if(c.value.stitch&&l&&u!==void 0){const h=l.children;return h[u]=c.value.stitch,u}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function H0(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function EI(t,e){H0(t.children,e)}function TI(t,e){II(t,e),H0(t.children,e),SI(t,e)}function bI(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:ce.CHARACTER,chars:t.value,location:Rs(t)};gr(e,nn(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function yI(t,e){const n={type:ce.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Rs(t)};gr(e,nn(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function xI(t,e){e.stitches=!0;const n=LI(t);if("children"in t&&"children"in n){const i=U0({type:"root",children:t.children},e.options);n.children=i.children}z0({type:"comment",value:{stitch:n}},e)}function z0(t,e){const n=t.value,i={type:ce.COMMENT,data:n,location:Rs(t)};gr(e,nn(t)),e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken)}function CI(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,Y0(e,nn(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(pI,"<$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function AI(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))xI(n,e);else{let i="";throw _I.has(n.type)&&(i=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+i)}}function gr(t,e){Y0(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=De.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function Y0(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function II(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===De.PLAINTEXT)return;gr(e,nn(t));const i=e.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:fi.html;r===fi.html&&n==="svg"&&(r=fi.svg);const s=D2({...t,children:[]},{space:r===fi.svg?"svg":"html"}),a={type:ce.START_TAG,tagName:n,tagID:fr(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Rs(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function SI(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&z2.includes(n)||e.parser.tokenizer.state===De.PLAINTEXT)return;gr(e,Ba(t));const i={type:ce.END_TAG,tagName:n,tagID:fr(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Rs(t)};e.parser.currentToken=i,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===De.RCDATA||e.parser.tokenizer.state===De.RAWTEXT||e.parser.tokenizer.state===De.SCRIPT_DATA)&&(e.parser.tokenizer.state=De.DATA)}function RI(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Rs(t){const e=nn(t)||{line:void 0,column:void 0,offset:void 0},n=Ba(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function LI(t){return"children"in t?xi({...t,children:[]}):xi(t)}function wI(t){return function(e,n){return U0(e,{...t,file:n})}}const ri=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Gh={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...ri,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...ri],h2:[["className","sr-only"]],img:[...ri,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...ri,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...ri],table:[...ri],ul:[...ri,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Bn={}.hasOwnProperty;function kI(t,e){let n={type:"root",children:[]};const i={schema:e?{...Gh,...e}:Gh,stack:[]},r=G0(i,t);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function G0(t,e){if(e&&typeof e=="object"){const n=e;switch(typeof n.type=="string"?n.type:""){case"comment":return OI(t,n);case"doctype":return NI(t,n);case"element":return DI(t,n);case"root":return PI(t,n);case"text":return MI(t,n)}}}function OI(t,e){if(t.schema.allowComments){const n=typeof e.value=="string"?e.value:"",i=n.indexOf("-->"),s={type:"comment",value:i<0?n:n.slice(0,i)};return Ls(s,e),s}}function NI(t,e){if(t.schema.allowDoctypes){const n={type:"doctype"};return Ls(n,e),n}}function DI(t,e){const n=typeof e.tagName=="string"?e.tagName:"";t.stack.push(n);const i=j0(t,e.children),r=vI(t,e.properties);t.stack.pop();let s=!1;if(n&&n!=="*"&&(!t.schema.tagNames||t.schema.tagNames.includes(n))&&(s=!0,t.schema.ancestors&&Bn.call(t.schema.ancestors,n))){const o=t.schema.ancestors[n];let u=-1;for(s=!1;++u<o.length;)t.stack.includes(o[u])&&(s=!0)}if(!s)return t.schema.strip&&!t.schema.strip.includes(n)?i:void 0;const a={type:"element",tagName:n,properties:r,children:i};return Ls(a,e),a}function PI(t,e){const i={type:"root",children:j0(t,e.children)};return Ls(i,e),i}function MI(t,e){const i={type:"text",value:typeof e.value=="string"?e.value:""};return Ls(i,e),i}function j0(t,e){const n=[];if(Array.isArray(e)){const i=e;let r=-1;for(;++r<i.length;){const s=G0(t,i[r]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function vI(t,e){const n=t.stack[t.stack.length-1],i=t.schema.attributes,r=t.schema.required,s=i&&Bn.call(i,n)?i[n]:void 0,a=i&&Bn.call(i,"*")?i["*"]:void 0,o=e&&typeof e=="object"?e:{},u={};let l;for(l in o)if(Bn.call(o,l)){const c=o[l];let h=jh(t,Wh(s,l),l,c);h==null&&(h=jh(t,Wh(a,l),l,c)),h!=null&&(u[l]=h)}if(r&&Bn.call(r,n)){const c=r[n];for(l in c)Bn.call(c,l)&&!Bn.call(u,l)&&(u[l]=c[l])}return u}function jh(t,e,n,i){return e?Array.isArray(i)?FI(t,e,n,i):W0(t,e,n,i):void 0}function FI(t,e,n,i){let r=-1;const s=[];for(;++r<i.length;){const a=W0(t,e,n,i[r]);(typeof a=="number"||typeof a=="string")&&s.push(a)}return s}function W0(t,e,n,i){if(!(typeof i!="boolean"&&typeof i!="number"&&typeof i!="string")&&BI(t,n,i)){if(typeof e=="object"&&e.length>1){let r=!1,s=0;for(;++s<e.length;){const a=e[s];if(a&&typeof a=="object"&&"flags"in a){if(a.test(String(i))){r=!0;break}}else if(a===i){r=!0;break}}if(!r)return}return t.schema.clobber&&t.schema.clobberPrefix&&t.schema.clobber.includes(n)?t.schema.clobberPrefix+i:i}}function BI(t,e,n){const i=t.schema.protocols&&Bn.call(t.schema.protocols,e)?t.schema.protocols[e]:void 0;if(!i||i.length===0)return!0;const r=String(n),s=r.indexOf(":"),a=r.indexOf("?"),o=r.indexOf("#"),u=r.indexOf("/");if(s<0||u>-1&&s>u||a>-1&&s>a||o>-1&&s>o)return!0;let l=-1;for(;++l<i.length;){const c=i[l];if(s===c.length&&r.slice(0,c.length)===c)return!0}return!1}function Ls(t,e){const n=Pf(e);e.data&&(t.data=xi(e.data)),n&&(t.position=n)}function Wh(t,e){let n,i=-1;if(t)for(;++i<t.length;){const r=t[i],s=typeof r=="string"?r:r[0];if(s===e)return r;s==="data*"&&(n=r)}if(e.length>4&&e.slice(0,4).toLowerCase()==="data")return n}function UI(t){return function(e){return kI(e,t)}}function Xh(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(e);for(;r!==-1;)i++,r=n.indexOf(e,r+e.length);return i}function HI(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function zI(t,e,n){const r=Ya((n||{}).ignore||[]),s=YI(e);let a=-1;for(;++a<s.length;)s0(t,"text",o);function o(l,c){let h=-1,f;for(;++h<c.length;){const g=c[h],m=f?f.children:void 0;if(r(g,m?m.indexOf(g):void 0,f))return;f=g}if(f)return u(l,c)}function u(l,c){const h=c[c.length-1],f=s[a][0],g=s[a][1];let m=0;const _=h.children.indexOf(l);let E=!1,y=[];f.lastIndex=0;let C=f.exec(l.value);for(;C;){const S=C.index,w={index:C.index,input:C.input,stack:[...c,l]};let L=g(...C,w);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?f.lastIndex=S+1:(m!==S&&y.push({type:"text",value:l.value.slice(m,S)}),Array.isArray(L)?y.push(...L):L&&y.push(L),m=S+C[0].length,E=!0),!f.global)break;C=f.exec(l.value)}return E?(m<l.value.length&&y.push({type:"text",value:l.value.slice(m)}),h.children.splice(_,1,...y)):y=[l],_+y.length}}function YI(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let i=-1;for(;++i<n.length;){const r=n[i];e.push([GI(r[0]),jI(r[1])])}return e}function GI(t){return typeof t=="string"?new RegExp(HI(t),"g"):t}function jI(t){return typeof t=="function"?t:function(){return t}}const Ho="phrasing",zo=["autolink","link","image","label"];function WI(){return{transforms:[QI],enter:{literalAutolink:VI,literalAutolinkEmail:Yo,literalAutolinkHttp:Yo,literalAutolinkWww:Yo},exit:{literalAutolink:ZI,literalAutolinkEmail:$I,literalAutolinkHttp:KI,literalAutolinkWww:qI}}}function XI(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ho,notInConstruct:zo},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ho,notInConstruct:zo},{character:":",before:"[ps]",after:"\\/",inConstruct:Ho,notInConstruct:zo}]}}function VI(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Yo(t){this.config.enter.autolinkProtocol.call(this,t)}function KI(t){this.config.exit.autolinkProtocol.call(this,t)}function qI(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function $I(t){this.config.exit.autolinkEmail.call(this,t)}function ZI(t){this.exit(t)}function QI(t){zI(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,JI],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),eS]],{ignore:["link","linkReference"]})}function JI(t,e,n,i,r){let s="";if(!X0(r)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!tS(n)))return!1;const a=nS(n+i);if(!a[0])return!1;const o={type:"link",title:null,url:s+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function eS(t,e,n,i){return!X0(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function tS(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function nS(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],i=n.indexOf(")");const r=Xh(t,"(");let s=Xh(t,")");for(;i!==-1&&r>s;)t+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[t,n]}function X0(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||yi(n)||Ua(n))&&(!e||n!==47)}V0.peek=hS;function iS(){this.buffer()}function rS(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function sS(){this.buffer()}function aS(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function oS(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function uS(t){this.exit(t)}function lS(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function cS(t){this.exit(t)}function hS(){return"["}function V0(t,e,n,i){const r=n.createTracker(i);let s=r.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=r.move(n.safe(n.associationId(t),{after:"]",before:s})),o(),a(),s+=r.move("]"),s}function dS(){return{enter:{gfmFootnoteCallString:iS,gfmFootnoteCall:rS,gfmFootnoteDefinitionLabelString:sS,gfmFootnoteDefinition:aS},exit:{gfmFootnoteCallString:oS,gfmFootnoteCall:uS,gfmFootnoteDefinitionLabelString:lS,gfmFootnoteDefinition:cS}}}function fS(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:V0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,a){const o=s.createTracker(a);let u=o.move("[^");const l=s.enter("footnoteDefinition"),c=s.enter("label");return u+=o.move(s.safe(s.associationId(i),{before:u,after:"]"})),c(),u+=o.move("]:"),i.children&&i.children.length>0&&(o.shift(4),u+=o.move((e?`
|
|
22
|
+
`:" ")+s.indentLines(s.containerFlow(i,o.current()),e?K0:gS))),l(),u}}function gS(t,e,n){return e===0?t:K0(t,e,n)}function K0(t,e,n){return(n?"":" ")+t}const mS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];q0.peek=bS;function pS(){return{canContainEols:["delete"],enter:{strikethrough:ES},exit:{strikethrough:TS}}}function _S(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mS}],handlers:{delete:q0}}}function ES(t){this.enter({type:"delete",children:[]},t)}function TS(t){this.exit(t)}function q0(t,e,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let a=r.move("~~");return a+=n.containerPhrasing(t,{...r.current(),before:a,after:"~"}),a+=r.move("~~"),s(),a}function bS(){return"~"}function yS(t){return t.length}function xS(t,e){const n=e||{},i=(n.align||[]).concat(),r=n.stringLength||yS,s=[],a=[],o=[],u=[];let l=0,c=-1;for(;++c<t.length;){const p=[],_=[];let E=-1;for(t[c].length>l&&(l=t[c].length);++E<t[c].length;){const y=CS(t[c][E]);if(n.alignDelimiters!==!1){const C=r(y);_[E]=C,(u[E]===void 0||C>u[E])&&(u[E]=C)}p.push(y)}a[c]=p,o[c]=_}let h=-1;if(typeof i=="object"&&"length"in i)for(;++h<l;)s[h]=Vh(i[h]);else{const p=Vh(i);for(;++h<l;)s[h]=p}h=-1;const f=[],g=[];for(;++h<l;){const p=s[h];let _="",E="";p===99?(_=":",E=":"):p===108?_=":":p===114&&(E=":");let y=n.alignDelimiters===!1?1:Math.max(1,u[h]-_.length-E.length);const C=_+"-".repeat(y)+E;n.alignDelimiters!==!1&&(y=_.length+y+E.length,y>u[h]&&(u[h]=y),g[h]=y),f[h]=C}a.splice(1,0,f),o.splice(1,0,g),c=-1;const m=[];for(;++c<a.length;){const p=a[c],_=o[c];h=-1;const E=[];for(;++h<l;){const y=p[h]||"";let C="",S="";if(n.alignDelimiters!==!1){const w=u[h]-(_[h]||0),L=s[h];L===114?C=" ".repeat(w):L===99?w%2?(C=" ".repeat(w/2+.5),S=" ".repeat(w/2-.5)):(C=" ".repeat(w/2),S=C):S=" ".repeat(w)}n.delimiterStart!==!1&&!h&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||h)&&E.push(" "),n.alignDelimiters!==!1&&E.push(C),E.push(y),n.alignDelimiters!==!1&&E.push(S),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||h!==l-1)&&E.push("|")}m.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return m.join(`
|
|
23
|
+
`)}function CS(t){return t==null?"":String(t)}function Vh(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function AS(t,e,n,i){const r=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(t,s.current()),IS);return r(),a}function IS(t,e,n){return">"+(n?"":" ")+t}function SS(t,e){return Kh(t,e.inConstruct,!0)&&!Kh(t,e.notInConstruct,!1)}function Kh(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let i=-1;for(;++i<e.length;)if(t.includes(e[i]))return!0;return!1}function qh(t,e,n,i){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
|
|
24
|
+
`&&SS(n.stack,n.unsafe[r]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
25
|
+
`}function RS(t,e){const n=String(t);let i=n.indexOf(e),r=i,s=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===r?++s>a&&(a=s):s=1,r=i+e.length,i=n.indexOf(e,r);return a}function LS(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function wS(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function kS(t,e,n,i){const r=wS(n),s=t.value||"",a=r==="`"?"GraveAccent":"Tilde";if(LS(t,n)){const h=n.enter("codeIndented"),f=n.indentLines(s,OS);return h(),f}const o=n.createTracker(i),u=r.repeat(Math.max(RS(s,r)+1,3)),l=n.enter("codeFenced");let c=o.move(u);if(t.lang){const h=n.enter(`codeFencedLang${a}`);c+=o.move(n.safe(t.lang,{before:c,after:" ",encode:["`"],...o.current()})),h()}if(t.lang&&t.meta){const h=n.enter(`codeFencedMeta${a}`);c+=o.move(" "),c+=o.move(n.safe(t.meta,{before:c,after:`
|
|
26
|
+
`,encode:["`"],...o.current()})),h()}return c+=o.move(`
|
|
27
|
+
`),s&&(c+=o.move(s+`
|
|
28
|
+
`)),c+=o.move(u),l(),c}function OS(t,e,n){return(n?"":" ")+t}function Il(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function NS(t,e,n,i){const r=Il(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(i);let l=u.move("[");return l+=u.move(n.safe(n.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":`
|
|
29
|
+
`,...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+r),l+=u.move(n.safe(t.title,{before:l,after:r,...u.current()})),l+=u.move(r),o()),a(),l}function DS(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function cs(t){return"&#x"+t.toString(16).toUpperCase()+";"}function pa(t,e,n){const i=ar(t),r=ar(e);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}$0.peek=PS;function $0(t,e,n,i){const r=DS(n),s=n.enter("emphasis"),a=n.createTracker(i),o=a.move(r);let u=a.move(n.containerPhrasing(t,{after:r,before:o,...a.current()}));const l=u.charCodeAt(0),c=pa(i.before.charCodeAt(i.before.length-1),l,r);c.inside&&(u=cs(l)+u.slice(1));const h=u.charCodeAt(u.length-1),f=pa(i.after.charCodeAt(0),h,r);f.inside&&(u=u.slice(0,-1)+cs(h));const g=a.move(r);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},o+u+g}function PS(t,e,n){return n.options.emphasis||"*"}function MS(t,e){let n=!1;return ja(t,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,fu}),!!((!t.depth||t.depth<3)&&hl(t)&&(e.options.setext||n))}function vS(t,e,n,i){const r=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(i);if(MS(t,n)){const c=n.enter("headingSetext"),h=n.enter("phrasing"),f=n.containerPhrasing(t,{...s.current(),before:`
|
|
30
|
+
`,after:`
|
|
31
|
+
`});return h(),c(),f+`
|
|
32
|
+
`+(r===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
33
|
+
`))+1))}const a="#".repeat(r),o=n.enter("headingAtx"),u=n.enter("phrasing");s.move(a+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
|
|
34
|
+
`,...s.current()});return/^[\t ]/.test(l)&&(l=cs(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,n.options.closeAtx&&(l+=" "+a),u(),o(),l}Z0.peek=FS;function Z0(t){return t.value||""}function FS(){return"<"}Q0.peek=BS;function Q0(t,e,n,i){const r=Il(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(i);let l=u.move("![");return l+=u.move(n.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+r),l+=u.move(n.safe(t.title,{before:l,after:r,...u.current()})),l+=u.move(r),o()),l+=u.move(")"),a(),l}function BS(){return"!"}J0.peek=US;function J0(t,e,n,i){const r=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(i);let u=o.move("![");const l=n.safe(t.alt,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const c=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=c,s(),r==="full"||!l||l!==h?u+=o.move(h+"]"):r==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function US(){return"!"}eg.peek=HS;function eg(t,e,n){let i=t.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let u;if(a.atBreak)for(;u=o.exec(i);){let l=u.index;i.charCodeAt(l)===10&&i.charCodeAt(l-1)===13&&l--,i=i.slice(0,l)+" "+i.slice(u.index+1)}}return r+i+r}function HS(){return"`"}function tg(t,e){const n=hl(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}ng.peek=zS;function ng(t,e,n,i){const r=Il(n),s=r==='"'?"Quote":"Apostrophe",a=n.createTracker(i);let o,u;if(tg(t,n)){const c=n.stack;n.stack=[],o=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(t,{before:h,after:">",...a.current()})),h+=a.move(">"),o(),n.stack=c,h}o=n.enter("link"),u=n.enter("label");let l=a.move("[");return l+=a.move(n.containerPhrasing(t,{before:l,after:"](",...a.current()})),l+=a.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(n.safe(t.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(u=n.enter("destinationRaw"),l+=a.move(n.safe(t.url,{before:l,after:t.title?" ":")",...a.current()}))),u(),t.title&&(u=n.enter(`title${s}`),l+=a.move(" "+r),l+=a.move(n.safe(t.title,{before:l,after:r,...a.current()})),l+=a.move(r),u()),l+=a.move(")"),o(),l}function zS(t,e,n){return tg(t,n)?"<":"["}ig.peek=YS;function ig(t,e,n,i){const r=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(i);let u=o.move("[");const l=n.containerPhrasing(t,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const c=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=c,s(),r==="full"||!l||l!==h?u+=o.move(h+"]"):r==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function YS(){return"["}function Sl(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function GS(t){const e=Sl(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function jS(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function rg(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function WS(t,e,n,i){const r=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?jS(n):Sl(n);const o=t.ordered?a==="."?")":".":GS(n);let u=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const c=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),rg(n)===a&&c){let h=-1;for(;++h<t.children.length;){const f=t.children[h];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const l=n.containerFlow(t,i);return n.bulletLastUsed=a,n.bulletCurrent=s,r(),l}function XS(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function VS(t,e,n,i){const r=XS(n);let s=n.bulletCurrent||Sl(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(r==="tab"||r==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(i);o.move(s+" ".repeat(a-s.length)),o.shift(a);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,o.current()),c);return u(),l;function c(h,f,g){return f?(g?"":" ".repeat(a))+h:(g?s:s+" ".repeat(a-s.length))+h}}function KS(t,e,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,i);return s(),r(),a}const qS=Ya(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $S(t,e,n,i){return(t.children.some(function(a){return qS(a)})?n.containerPhrasing:n.containerFlow).call(n,t,i)}function ZS(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}sg.peek=QS;function sg(t,e,n,i){const r=ZS(n),s=n.enter("strong"),a=n.createTracker(i),o=a.move(r+r);let u=a.move(n.containerPhrasing(t,{after:r,before:o,...a.current()}));const l=u.charCodeAt(0),c=pa(i.before.charCodeAt(i.before.length-1),l,r);c.inside&&(u=cs(l)+u.slice(1));const h=u.charCodeAt(u.length-1),f=pa(i.after.charCodeAt(0),h,r);f.inside&&(u=u.slice(0,-1)+cs(h));const g=a.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:c.outside},o+u+g}function QS(t,e,n){return n.options.strong||"*"}function JS(t,e,n,i){return n.safe(t.value,i)}function eR(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function tR(t,e,n){const i=(rg(n)+(n.options.ruleSpaces?" ":"")).repeat(eR(n));return n.options.ruleSpaces?i.slice(0,-1):i}const ag={blockquote:AS,break:qh,code:kS,definition:NS,emphasis:$0,hardBreak:qh,heading:vS,html:Z0,image:Q0,imageReference:J0,inlineCode:eg,link:ng,linkReference:ig,list:WS,listItem:VS,paragraph:KS,root:$S,strong:sg,text:JS,thematicBreak:tR};function nR(){return{enter:{table:iR,tableData:$h,tableHeader:$h,tableRow:sR},exit:{codeText:aR,table:rR,tableData:Go,tableHeader:Go,tableRow:Go}}}function iR(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function rR(t){this.exit(t),this.data.inTable=void 0}function sR(t){this.enter({type:"tableRow",children:[]},t)}function Go(t){this.exit(t)}function $h(t){this.enter({type:"tableCell",children:[]},t)}function aR(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,oR));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function oR(t,e){return e==="|"?e:t}function uR(t){const e=t||{},n=e.tableCellPadding,i=e.tablePipeAlign,r=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
35
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:u,tableRow:o}};function a(g,m,p,_){return l(c(g,p,_),g.align)}function o(g,m,p,_){const E=h(g,p,_),y=l([E]);return y.slice(0,y.indexOf(`
|
|
36
|
+
`))}function u(g,m,p,_){const E=p.enter("tableCell"),y=p.enter("phrasing"),C=p.containerPhrasing(g,{..._,before:s,after:s});return y(),E(),C}function l(g,m){return xS(g,{align:m,alignDelimiters:i,padding:n,stringLength:r})}function c(g,m,p){const _=g.children;let E=-1;const y=[],C=m.enter("table");for(;++E<_.length;)y[E]=h(_[E],m,p);return C(),y}function h(g,m,p){const _=g.children;let E=-1;const y=[],C=m.enter("tableRow");for(;++E<_.length;)y[E]=u(_[E],g,m,p);return C(),y}function f(g,m,p){let _=ag.inlineCode(g,m,p);return p.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function lR(){return{exit:{taskListCheckValueChecked:Zh,taskListCheckValueUnchecked:Zh,paragraph:hR}}}function cR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dR}}}function Zh(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function hR(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const r=e.children;let s=-1,a;for(;++s<r.length;){const o=r[s];if(o.type==="paragraph"){a=o;break}}a===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(t)}function dR(t,e,n,i){const r=t.children[0],s=typeof t.checked=="boolean"&&r&&r.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",o=n.createTracker(i);s&&o.move(a);let u=ag.listItem(t,e,n,{...i,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+a}}function fR(){return[WI(),dS(),pS(),nR(),lR()]}function gR(t){return{extensions:[XI(),fS(t),_S(),uR(t),cR()]}}const mR={tokenize:yR,partial:!0},og={tokenize:xR,partial:!0},ug={tokenize:CR,partial:!0},lg={tokenize:AR,partial:!0},pR={tokenize:IR,partial:!0},cg={name:"wwwAutolink",tokenize:TR,previous:dg},hg={name:"protocolAutolink",tokenize:bR,previous:fg},xn={name:"emailAutolink",tokenize:ER,previous:gg},rn={};function _R(){return{text:rn}}let si=48;for(;si<123;)rn[si]=xn,si++,si===58?si=65:si===91&&(si=97);rn[43]=xn;rn[45]=xn;rn[46]=xn;rn[95]=xn;rn[72]=[xn,hg];rn[104]=[xn,hg];rn[87]=[xn,cg];rn[119]=[xn,cg];function ER(t,e,n){const i=this;let r,s;return a;function a(h){return!xu(h)||!gg.call(i,i.previous)||Rl(i.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(h))}function o(h){return xu(h)?(t.consume(h),o):h===64?(t.consume(h),u):n(h)}function u(h){return h===46?t.check(pR,c,l)(h):h===45||h===95||qe(h)?(s=!0,t.consume(h),u):c(h)}function l(h){return t.consume(h),r=!0,u}function c(h){return s&&r&&tt(i.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function TR(t,e,n){const i=this;return r;function r(a){return a!==87&&a!==119||!dg.call(i,i.previous)||Rl(i.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(mR,t.attempt(og,t.attempt(ug,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function bR(t,e,n){const i=this;let r="",s=!1;return a;function a(h){return(h===72||h===104)&&fg.call(i,i.previous)&&!Rl(i.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),r+=String.fromCodePoint(h),t.consume(h),o):n(h)}function o(h){if(tt(h)&&r.length<5)return r+=String.fromCodePoint(h),t.consume(h),o;if(h===58){const f=r.toLowerCase();if(f==="http"||f==="https")return t.consume(h),u}return n(h)}function u(h){return h===47?(t.consume(h),s?l:(s=!0,u)):n(h)}function l(h){return h===null||ha(h)||Ae(h)||yi(h)||Ua(h)?n(h):t.attempt(og,t.attempt(ug,c),n)(h)}function c(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function yR(t,e,n){let i=0;return r;function r(a){return(a===87||a===119)&&i<3?(i++,t.consume(a),r):a===46&&i===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function xR(t,e,n){let i,r,s;return a;function a(l){return l===46||l===95?t.check(lg,u,o)(l):l===null||Ae(l)||yi(l)||l!==45&&Ua(l)?u(l):(s=!0,t.consume(l),a)}function o(l){return l===95?i=!0:(r=i,i=void 0),t.consume(l),a}function u(l){return r||i||!s?n(l):e(l)}}function CR(t,e){let n=0,i=0;return r;function r(a){return a===40?(n++,t.consume(a),r):a===41&&i<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(lg,e,s)(a):a===null||Ae(a)||yi(a)?e(a):(t.consume(a),r)}function s(a){return a===41&&i++,t.consume(a),r}}function AR(t,e,n){return i;function i(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),i):o===38?(t.consume(o),s):o===93?(t.consume(o),r):o===60||o===null||Ae(o)||yi(o)?e(o):n(o)}function r(o){return o===null||o===40||o===91||Ae(o)||yi(o)?e(o):i(o)}function s(o){return tt(o)?a(o):n(o)}function a(o){return o===59?(t.consume(o),i):tt(o)?(t.consume(o),a):n(o)}}function IR(t,e,n){return i;function i(s){return t.consume(s),r}function r(s){return qe(s)?n(s):e(s)}}function dg(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ae(t)}function fg(t){return!tt(t)}function gg(t){return!(t===47||xu(t))}function xu(t){return t===43||t===45||t===46||t===95||qe(t)}function Rl(t){let e=t.length,n=!1;for(;e--;){const i=t[e][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const SR={tokenize:PR,partial:!0};function RR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OR,continuation:{tokenize:NR},exit:DR}},text:{91:{name:"gfmFootnoteCall",tokenize:kR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:LR,resolveTo:wR}}}}function LR(t,e,n){const i=this;let r=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let a;for(;r--;){const u=i.events[r][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const l=zt(i.sliceSerialize({start:a.end,end:i.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function wR(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[t[n+1],t[n+2],["enter",i,e],t[n+3],t[n+4],["enter",r,e],["exit",r,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(n,t.length-n+1,...o),t}function kR(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,a;return o;function o(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(h){if(s>999||h===93&&!a||h===null||h===91||Ae(h))return n(h);if(h===93){t.exit("chunkString");const f=t.exit("gfmFootnoteCallString");return r.includes(zt(i.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return Ae(h)||(a=!0),s++,t.consume(h),h===92?c:l}function c(h){return h===91||h===92||h===93?(t.consume(h),s++,l):l(h)}}function OR(t,e,n){const i=this,r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,a=0,o;return u;function u(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):n(m)}function c(m){if(a>999||m===93&&!o||m===null||m===91||Ae(m))return n(m);if(m===93){t.exit("chunkString");const p=t.exit("gfmFootnoteDefinitionLabelString");return s=zt(i.sliceSerialize(p)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return Ae(m)||(o=!0),a++,t.consume(m),m===92?h:c}function h(m){return m===91||m===92||m===93?(t.consume(m),a++,c):c(m)}function f(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),r.includes(s)||r.push(s),fe(t,g,"gfmFootnoteDefinitionWhitespace")):n(m)}function g(m){return e(m)}}function NR(t,e,n){return t.check(As,e,t.attempt(SR,e,n))}function DR(t){t.exit("gfmFootnoteDefinition")}function PR(t,e,n){const i=this;return fe(t,r,"gfmFootnoteDefinitionIndent",5);function r(s){const a=i.events[i.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function MR(t){let n=(t||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:r};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function r(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let l=u;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[u][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[u][1].end)},h={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[u][1].start)},f=[["enter",c,o],["enter",a[l][1],o],["exit",a[l][1],o],["enter",h,o]],g=o.parser.constructs.insideSpan.null;g&&_t(f,f.length,0,Ha(g,a.slice(l+1,u),o)),_t(f,f.length,0,[["exit",h,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",c,o]]),_t(a,l-1,u-l+3,f),u=l+f.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function s(a,o,u){const l=this.previous,c=this.events;let h=0;return f;function f(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(a.enter("strikethroughSequenceTemporary"),g(m))}function g(m){const p=ar(l);if(m===126)return h>1?u(m):(a.consume(m),h++,g);if(h<2&&!n)return u(m);const _=a.exit("strikethroughSequenceTemporary"),E=ar(m);return _._open=!E||E===2&&!!p,_._close=!p||p===2&&!!E,o(m)}}}class vR{constructor(){this.map=[]}add(e,n,i){FR(this,e,n,i)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];i.push(e.slice()),e.length=0;let r=i.pop();for(;r;){for(const s of r)e.push(s);r=i.pop()}this.map.length=0}}function FR(t,e,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r<t.map.length;){if(t.map[r][0]===e){t.map[r][1]+=n,t.map[r][2].push(...i);return}r+=1}t.map.push([e,n,i])}}function BR(t,e){let n=!1;const i=[];for(;e<t.length;){const r=t[e];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&i.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return i}function UR(){return{flow:{null:{name:"table",tokenize:HR,resolveAll:zR}}}}function HR(t,e,n){const i=this;let r=0,s=0,a;return o;function o(R){let H=i.events.length-1;for(;H>-1;){const j=i.events[H][1].type;if(j==="lineEnding"||j==="linePrefix")H--;else break}const U=H>-1?i.events[H][1].type:null,W=U==="tableHead"||U==="tableRow"?L:u;return W===L&&i.parser.lazy[i.now().line]?n(R):W(R)}function u(R){return t.enter("tableHead"),t.enter("tableRow"),l(R)}function l(R){return R===124||(a=!0,s+=1),c(R)}function c(R){return R===null?n(R):ee(R)?s>1?(s=0,i.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),g):n(R):he(R)?fe(t,c,"whitespace")(R):(s+=1,a&&(a=!1,r+=1),R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),a=!0,c):(t.enter("data"),h(R)))}function h(R){return R===null||R===124||Ae(R)?(t.exit("data"),c(R)):(t.consume(R),R===92?f:h)}function f(R){return R===92||R===124?(t.consume(R),h):h(R)}function g(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(t.enter("tableDelimiterRow"),a=!1,he(R)?fe(t,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?_(R):R===124?(a=!0,t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),p):w(R)}function p(R){return he(R)?fe(t,_,"whitespace")(R):_(R)}function _(R){return R===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),E):R===45?(s+=1,E(R)):R===null||ee(R)?S(R):w(R)}function E(R){return R===45?(t.enter("tableDelimiterFiller"),y(R)):w(R)}function y(R){return R===45?(t.consume(R),y):R===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),C):(t.exit("tableDelimiterFiller"),C(R))}function C(R){return he(R)?fe(t,S,"whitespace")(R):S(R)}function S(R){return R===124?m(R):R===null||ee(R)?!a||r!==s?w(R):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(R)):w(R)}function w(R){return n(R)}function L(R){return t.enter("tableRow"),B(R)}function B(R){return R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),B):R===null||ee(R)?(t.exit("tableRow"),e(R)):he(R)?fe(t,B,"whitespace")(R):(t.enter("data"),v(R))}function v(R){return R===null||R===124||Ae(R)?(t.exit("data"),B(R)):(t.consume(R),R===92?N:v)}function N(R){return R===92||R===124?(t.consume(R),v):v(R)}}function zR(t,e){let n=-1,i=!0,r=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,l,c,h;const f=new vR;for(;++n<t.length;){const g=t[n],m=g[1];g[0]==="enter"?m.type==="tableHead"?(o=!1,u!==0&&(Qh(f,e,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(i=!0,h=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",c,e]])),r=m.type==="tableDelimiterRow"?2:c?3:1):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(i=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=Ws(f,e,s,r,void 0,h),s=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(a[0]=a[1],h=Ws(f,e,s,r,void 0,h)),s=a,a=[s[1],n,0,0])):m.type==="tableHead"?(o=!0,u=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=n,s[1]!==0?(a[0]=a[1],h=Ws(f,e,s,r,n,h)):a[1]!==0&&(h=Ws(f,e,a,r,n,h)),r=0):r&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Qh(f,e,u,l,c),f.consume(e.events),n=-1;++n<e.events.length;){const g=e.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=BR(e.events,n))}return t}function Ws(t,e,n,i,r,s){const a=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Gi(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const u=Gi(e.events,n[1]);if(s={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const l=Gi(e.events,n[2]),c=Gi(e.events,n[3]),h={type:o,start:Object.assign({},l),end:Object.assign({},c)};if(t.add(n[2],0,[["enter",h,e]]),i!==2){const f=e.events[n[2]],g=e.events[n[3]];if(f[1].end=Object.assign({},g[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;t.add(m,p,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return r!==void 0&&(s.end=Object.assign({},Gi(e.events,r)),t.add(r,0,[["exit",s,e]]),s=void 0),s}function Qh(t,e,n,i,r){const s=[],a=Gi(e.events,n);r&&(r.end=Object.assign({},a),s.push(["exit",r,e])),i.end=Object.assign({},a),s.push(["exit",i,e]),t.add(n+1,0,s)}function Gi(t,e){const n=t[e],i=n[0]==="enter"?"start":"end";return n[1][i]}const YR={name:"tasklistCheck",tokenize:jR};function GR(){return{text:{91:YR}}}function jR(t,e,n){const i=this;return r;function r(u){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return Ae(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):n(u)}function o(u){return ee(u)?e(u):he(u)?t.check({tokenize:WR},e,n)(u):n(u)}}function WR(t,e,n){return fe(t,i,"whitespace");function i(r){return r===null?n(r):e(r)}}function XR(t){return Hf([_R(),RR(),MR(t),UR(),GR()])}const VR={};function KR(t){const e=this,n=t||VR,i=e.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(XR(n)),s.push(fR()),a.push(gR(n))}function qR({block:t}){const{value:e}=t;return!e||e===""?O.jsx("span",{className:Vn.empty,children:"—"}):O.jsx(f2,{remarkPlugins:[KR],rehypePlugins:[wI,UI],components:{a:({node:n,...i})=>O.jsx("a",{className:Vn.link,...i})},children:t.value})}const mg=/^\$data#\/(.+)$/,pg=/^\$itemData#\/(.+)$/;function _g(t){return mg.test(t)||pg.test(t)}function hs(t){const e=t.match(mg);if(e){const i=e[1];return{source:"data",path:i.split("/"),rawPath:i}}const n=t.match(pg);if(n){const i=n[1];return{source:"itemData",path:i.split("/"),rawPath:i}}throw new Error(`Invalid binding expression: ${t}. Expected format: $data#/path or $itemData#/path`)}function qa(t,e){let n=t;for(const i of e){if(n==null||typeof n!="object")return;n=n[i]}return n}function $R(){const{data:t}=jt();return{getValue:Se.useCallback(n=>{const{path:i}=hs(n);return qa(t,i)},[t])}}const Eg=Se.createContext(null);function ZR({item:t,children:e}){return O.jsx(Eg.Provider,{value:t,children:e})}function QR(){return Se.useContext(Eg)}const Tg=Se.createContext(null);function bg({screenDefinition:t,data:e,children:n}){const[i,r]=Se.useReducer((a,o)=>o,t.activeTabId||t.tabs?.[0]?.id||""),s=Se.useMemo(()=>({screenDefinition:t,data:e,activeTabId:i,setActiveTabId:r}),[t,e,i]);return O.jsx(Tg.Provider,{value:s,children:n})}function jt(){const t=Se.useContext(Tg);if(!t)throw new Error("useScreenContext must be used within a ScreenProvider");return t}function JR(t,e,n){const i=["screens",t];return e&&i.push(e),i.push(...n),i.join(".")}function yg(t,e){const{getValue:n}=$R(),i=QR(),{screenDefinition:r}=jt(),s=u=>{const l=hs(u);return l.source==="itemData"?qa(i,l.path):n(u)},a=typeof t.value=="string"&&_g(t.value)?JR(r.id,e,hs(t.value).path):void 0;return{value:Array.isArray(t.value)?t.value.map(s):typeof t.value=="object"&&t.value!==null?Object.fromEntries(Object.entries(t.value).map(([u,l])=>[u,s(l)])):s(t.value),hidden:t.hidden??!1,label:t.label??a,infoLabel:t.infoLabel??(a?`${a}.info`:void 0),config:t.config}}const eL="_tabs_1pbsc_1",tL="_tab_1pbsc_1",nL="_tabButton_1pbsc_13",iL="_tabActive_1pbsc_34",rL="_subnav_1pbsc_41",sL="_subitem_1pbsc_56",aL="_subitemButton_1pbsc_60",ai={tabs:eL,tab:tL,tabButton:nL,tabActive:iL,subnav:rL,subitem:sL,subitemButton:aL};function oL(){const{screenDefinition:t,activeTabId:e,setActiveTabId:n}=jt(),{translateFn:i}=Mt.usePanoptes(),r=a=>i?i(a):a,{tabs:s}=t;return!s||s.length<=1?null:O.jsx("ul",{className:ai.tabs,role:"tablist",children:s&&s.map(a=>{const o=a.id===e,u=a.operationList&&a.operationList.length>0,l=`screens.${t.id}.tabs.${a.id}`;return O.jsxs("li",{className:`${ai.tab} ${o?ai.tabActive:""}`,role:"presentation",children:[O.jsx("button",{role:"tab","aria-selected":o,"aria-controls":`panel-${a.id}`,onClick:()=>n(a.id),className:ai.tabButton,children:r(a.label??l)}),u&&o&&O.jsx("ul",{className:ai.subnav,children:a.operationList.map(c=>O.jsx("li",{className:ai.subitem,children:O.jsx("button",{className:ai.subitemButton,onClick:()=>{console.log("Load operation:",c.operation)},children:r(c.label??`${l}.${c.id}`)})},c.id))})]},a.id)})})}const uL="_element_1tp03_1",lL="_label_1tp03_7",cL="_info_1tp03_65",hL="_arrayInput_1tp03_104",dL="_arrayItem_1tp03_110",fL="_arrayItemFields_1tp03_120",gL="_arrayItemField_1tp03_120",wt={element:uL,label:lL,info:cL,arrayInput:hL,arrayItem:dL,arrayItemFields:fL,arrayItemField:gL},mL=t=>{if(Array.isArray(t))return"array";if(typeof t=="boolean")return"checkbox";if(typeof t=="number")return"number";if(typeof t=="string"){if(/^\d{4}-\d{2}-\d{2}/.test(t))return"date";if(t.includes(`
|
|
37
|
+
`))return"textarea"}return"text"},pL=(t,e,n)=>{const i={readOnly:!0,disabled:!0,"aria-label":n.label};switch(t){case"prose":return O.jsx("span",{className:"pr-4",children:String(e??"")});case"checkbox":return O.jsx("input",{type:"checkbox",checked:!!e,...i});case"number":return O.jsx("input",{type:"number",value:e??"",...i});case"date":return O.jsx("input",{type:"date",value:String(e??""),...i});case"textarea":return O.jsx("textarea",{value:String(e??""),...i});case"array":return O.jsx(TL,{value:e,element:n});case"select":{const s=(n.config?.options||[]).find(a=>a.value===String(e??""));return O.jsx("input",{type:"text",value:s?.label??String(e??""),...i})}default:return O.jsx("input",{type:"text",value:String(e??""),...i})}},_L=({element:t,groupId:e})=>{const{value:n,label:i,infoLabel:r}=yg(t,e),{translateFn:s}=Mt.usePanoptes(),a=c=>s?s(c):c,o=Mt.useBlock(t),u=jt();if(!o)return null;const l={...t,value:n,model:u.data};return O.jsxs("div",{className:wt.element,children:[i&&O.jsx("label",{className:wt.label,children:a(i)}),O.jsx(Se.Suspense,{fallback:O.jsx(Cu,{}),children:O.jsx(o,{block:l})}),r&&O.jsx("span",{className:wt.info,children:a(r)})]})},EL=({element:t,groupId:e})=>{const{translateFn:n}=Mt.usePanoptes(),{value:i,label:r,infoLabel:s}=yg(t,e),a=u=>n?n(u):u,o=t.type||mL(i);return O.jsxs("div",{className:wt.element,children:[r&&O.jsx("label",{className:wt.label,children:a(r)}),pL(o,i,t),s&&O.jsx("span",{className:wt.info,children:a(s)})]})};function Ll({element:t,groupId:e}){return t.hidden?null:O.jsx(ed,{fallback:O.jsx(EL,{element:t,groupId:e}),children:O.jsx(_L,{element:t,groupId:e})})}function Jh(t,e){return e?Object.values(e).every(n=>{const i=hs(n.value),r=qa(t,i.path);return r==null||String(r).trim()===""}):t==null||String(t).trim()===""}function TL({value:t,element:e}){const n=Array.isArray(t)?t:[],i=e.config?.itemTemplate;return n.length===0||n.every(r=>Jh(r,i))?null:i?O.jsx("div",{className:wt.arrayInput,children:n.map((r,s)=>O.jsx(ZR,{item:r,children:!Jh(r,i)&&O.jsx("div",{className:wt.arrayItem,children:O.jsx("div",{className:wt.arrayItemFields,children:Object.entries(i).map(([a,o])=>O.jsx("div",{className:wt.arrayItemField,children:O.jsx(Ll,{element:o},a)}))})})},s))}):O.jsx("div",{className:wt.arrayInput,children:n.map((r,s)=>O.jsx("div",{className:wt.arrayItem,children:O.jsx("input",{type:"text",value:String(r??""),readOnly:!0,disabled:!0})},s))})}const bL="_column_olkxy_1",yL={column:bL};function xL({column:t,groupId:e}){return!t.elements||t.elements.length===0?null:O.jsx("div",{className:yL.column,children:t.elements.map((n,i)=>O.jsx(Ll,{element:n,groupId:e},`element-${i}`))})}const CL="_row_9wvpn_1",AL="_header_9wvpn_10",IL="_label_9wvpn_14",SL="_group_9wvpn_20",RL="_footer_9wvpn_27",LL="_labelCollapsible_9wvpn_40",wL="_collapseToggle_9wvpn_44",kL="_chevron_9wvpn_65",OL="_chevronCollapsed_9wvpn_70",NL="_columns_9wvpn_74",DL="_elements_9wvpn_80",At={row:CL,header:AL,label:IL,group:SL,footer:RL,labelCollapsible:LL,collapseToggle:wL,chevron:kL,chevronCollapsed:OL,columns:NL,elements:DL};function xg({row:t,inheritedGroupId:e}){const{translateFn:n}=Mt.usePanoptes(),i=p=>n?n(p):p,{screenDefinition:r}=jt(),s=t.groupId??e,a=t.label??(t.groupId?`screens.${r.id}.${t.groupId}`:void 0),o=t.displayType||"row",u=t.rows&&t.rows.length>0,l=t.columns&&t.columns.length>0,c=t.elements&&t.elements.length>0,h=t.collapsible&&o==="group",[f,g]=Se.useState(h?t.defaultCollapsed??!1:!1),m=()=>{const p=[At.row];switch(o){case"header":p.push(At.header);break;case"group":p.push(At.group);break;case"footer":p.push(At.footer);break}return p.join(" ")};return O.jsxs("fieldset",{className:m(),"data-group-id":t.groupId,children:[a&&(h?O.jsx("legend",{className:`${At.label} ${At.labelCollapsible}`,children:O.jsxs("button",{type:"button",className:At.collapseToggle,onClick:()=>g(p=>!p),"aria-expanded":!f,children:[O.jsx("svg",{className:`${At.chevron} ${f?At.chevronCollapsed:""}`,viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:O.jsx("polyline",{points:"6 9 12 15 18 9"})}),i(a)]})}):O.jsx("legend",{className:At.label,children:i(a)})),!f&&O.jsxs(O.Fragment,{children:[u&&t.rows.map((p,_)=>O.jsx(xg,{row:p,inheritedGroupId:s},p.groupId||`row-${_}`)),!u&&l&&O.jsx("div",{className:At.columns,children:t.columns.map((p,_)=>O.jsx(xL,{column:p,groupId:s},`column-${_}`))}),!u&&!l&&c&&O.jsx("div",{className:At.elements,children:t.elements.map((p,_)=>O.jsx(Ll,{element:p,groupId:s},`element-${_}`))})]})]})}const PL="_form_1545m_1",ML={form:PL};function vL(){const{screenDefinition:t}=jt(),{form:e}=t;return!e||!e.rows?null:O.jsx("form",{className:ML.form,onSubmit:n=>n.preventDefault(),children:e.rows.map((n,i)=>O.jsx(xg,{row:n},n.groupId||`row-${i}`))})}const FL="_actions_1qmmo_1",BL="_button_1qmmo_7",UL="_confirmationOverlay_1qmmo_39",HL="_confirmationDialog_1qmmo_50",zL="_confirmationTitle_1qmmo_60",YL="_confirmationMessage_1qmmo_67",GL="_confirmationActions_1qmmo_74",jL="_confirmationCancel_1qmmo_80",WL="_confirmationOk_1qmmo_101",fn={actions:FL,button:BL,confirmationOverlay:UL,confirmationDialog:HL,confirmationTitle:zL,confirmationMessage:YL,confirmationActions:GL,confirmationCancel:jL,confirmationOk:WL};function XL(){const{screenDefinition:t}=jt(),{actions:e}=t;return!e||e.length===0?null:O.jsx("div",{className:fn.actions,children:e.map(n=>O.jsx(VL,{action:n},n.id))})}function VL({action:t}){const{screenDefinition:e,data:n}=jt(),{translateFn:i}=Mt.usePanoptes(),r=_=>i?i(_):_,[s,a]=Se.useState(!1),[o,u]=Se.useState(!1),l=Se.useCallback(async()=>{u(!0);try{console.log("Executing operation:",t.operation,"with data:",n)}finally{u(!1),a(!1)}},[t.operation,n]),c=t.confirmation.askConfirmation==="always",h=Se.useCallback(()=>{c?a(!0):l()},[c,l]),f=Se.useCallback(()=>{l()},[l]),g=Se.useCallback(()=>{a(!1)},[]),m=`screens.${e.id}.actions.${t.id}`,p=t.confirmation.labels;return O.jsxs(O.Fragment,{children:[O.jsx("button",{className:fn.button,onClick:h,disabled:o,"data-action-id":t.id,children:o?"...":r(t.label??m)}),s&&O.jsx("div",{className:fn.confirmationOverlay,children:O.jsxs("div",{className:fn.confirmationDialog,role:"dialog","aria-modal":"true",children:[O.jsx("h2",{className:fn.confirmationTitle,children:r(p?.title??`${m}.title`)}),O.jsx("p",{className:fn.confirmationMessage,children:r(p?.message??`${m}.message`)}),O.jsxs("div",{className:fn.confirmationActions,children:[O.jsx("button",{className:fn.confirmationCancel,onClick:g,children:r(p?.cancel??`${m}.cancel`)}),O.jsx("button",{className:fn.confirmationOk,onClick:f,children:r(p?.ok??`${m}.ok`)})]})]})})]})}const KL="_links_ski17_1",qL="_link_ski17_1",$L="_linkButton_ski17_14",jo={links:KL,link:qL,linkButton:$L};function ZL(){const{screenDefinition:t}=jt(),{translateFn:e}=Mt.usePanoptes(),n=r=>e?e(r):r,{links:i}=t;return!i||i.length===0?null:O.jsx("ul",{className:jo.links,children:i.map(r=>O.jsx("li",{className:jo.link,children:O.jsx("button",{className:jo.linkButton,onClick:()=>{r.operation?console.log("Execute link operation:",r.operation):r.href&&console.log("Navigate to:",r.href)},"data-link-id":r.id,children:n(r.label)})},r.id))})}const QL="_sidebar_2smuc_1",JL="_section_2smuc_11",ew="_divider_2smuc_19",tw="_item_2smuc_28",nw="_tooltip_2smuc_46",iw="_itemActive_2smuc_53",Ji={sidebar:QL,section:JL,divider:ew,item:tw,tooltip:nw,itemActive:iw};function rw({item:t,screenId:e,sectionId:n}){const{translateFn:i}=Mt.usePanoptes(),r=`screens.${e}.sidebar.${n}.${t.id}`,s=t.label??r,a=i?i(s):s,o=`${Ji.item}${t.active?` ${Ji.itemActive}`:""}`;return O.jsxs("button",{type:"button",className:o,title:a,children:["X",O.jsx("span",{className:Ji.tooltip,children:a})]})}function sw({sidebar:t}){const{screenDefinition:e}=jt();return O.jsx("aside",{className:Ji.sidebar,"data-sidebar-id":t.id,children:t.sections.map((n,i)=>O.jsxs("div",{className:Ji.section,children:[i>0&&O.jsx("hr",{className:Ji.divider}),n.items.map(r=>O.jsx(rw,{item:r,screenId:e.id,sectionId:n.id},r.id))]},n.id))})}const aw="_screen_1n4xy_1",ow="_header_1n4xy_11",uw="_links_1n4xy_23",lw="_tabs_1n4xy_28",cw="_body_1n4xy_32",hw="_bodyWithSidebar_1n4xy_36",dw="_content_1n4xy_44",fw="_actions_1n4xy_48",Nn={screen:aw,header:ow,links:uw,tabs:lw,body:cw,bodyWithSidebar:hw,content:dw,actions:fw};function gw(){const{screenDefinition:t}=jt(),{translateFn:e}=Mt.usePanoptes(),n=(u,l={})=>e?e(u,l):u,i=t.label??`screens.${t.id}`,r=t.tabs&&t.tabs.length>1,s=t.links&&t.links.length>0,a=t.actions&&t.actions.length>0,o=!!t.sidebar;return O.jsxs("div",{className:Nn.screen,"data-screen-id":t.id,children:[O.jsx("header",{className:Nn.header,children:O.jsx("h1",{children:n(i)})}),s&&O.jsx("nav",{className:Nn.links,children:O.jsx(ZL,{})}),r&&O.jsx("nav",{className:Nn.tabs,children:O.jsx(oL,{})}),O.jsxs("div",{className:o?Nn.bodyWithSidebar:Nn.body,style:o&&t.sidebar.width?{"--sidebar-width":t.sidebar.width}:void 0,children:[o&&O.jsx(sw,{sidebar:t.sidebar}),O.jsx("main",{className:Nn.content,children:O.jsx(vL,{})})]}),a&&O.jsx("footer",{className:Nn.actions,children:O.jsx(XL,{})})]})}const mw=({block:t})=>O.jsx(bg,{screenDefinition:t.config,data:t.value,children:O.jsx(gw,{})});function pw({title:t,titleId:e,...n},i){return Gn.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},n),t?Gn.createElement("title",{id:e},t):null,Gn.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const _w=Gn.forwardRef(pw);function Ew({title:t,titleId:e,...n},i){return Gn.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":e},n),t?Gn.createElement("title",{id:e},t):null,Gn.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Tw=Gn.forwardRef(Ew);function bw({block:t}){const{value:e}=t,{translateFn:n}=Mt.usePanoptes();return e==null?O.jsx("span",{className:Vn.empty,children:"—"}):O.jsx("span",{children:e?O.jsx(_w,{width:16,height:16,title:n?n("panoptes.yes"):"Yes"}):O.jsx(Tw,{width:16,height:16,title:n?n("panoptes.no"):"No"})})}exports.ExternalLinkBlockRenderer=wg;exports.GhostLine=Cu;exports.JsonBlockRenderer=Zg;exports.LabelBlockRenderer=Qg;exports.LinkBlockRenderer=Jg;exports.MapBlockRenderer=oT;exports.MarkdownBlockRenderer=qR;exports.ScreenBlockRenderer=mw;exports.ScreenProvider=bg;exports.ToggleBlockRenderer=bw;exports.getNestedValue=qa;exports.isBindingExpression=_g;exports.parseBinding=hs;
|