>=Q,W-=Q,p3=1<<32-Mu(v)+W|k<<W|V,f3=g+f}else p3=1<<g|k<<W|V,f3=f}function Uv(f){f.return!==null&&(Rc(f,1),ew(f,1,0))}function xv(f){for(;f===Rf;)Rf=n6[--k6],n6[k6]=null,If=n6[--k6],n6[k6]=null;for(;f===Kc;)Kc=yu[--wu],yu[wu]=null,f3=yu[--wu],yu[wu]=null,p3=yu[--wu],yu[wu]=null}function tw(f,v){var k=nu(5,null,null,0);k.elementType="DELETED",k.stateNode=v,k.return=f,v=f.deletions,v===null?(f.deletions=[k],f.flags|=16):v.push(k)}function Uy(f,v){switch(f.tag){case 5:var k=f.type;return v=v.nodeType!==1||k.toLowerCase()!==v.nodeName.toLowerCase()?null:v,v!==null?(f.stateNode=v,_2=f,$2=n4(v.firstChild),!0):!1;case 6:return v=f.pendingProps===""||v.nodeType!==3?null:v,v!==null?(f.stateNode=v,_2=f,$2=null,!0):!1;case 13:return v=v.nodeType!==8?null:v,v!==null?(k=Kc!==null?{id:p3,overflow:f3}:null,f.memoizedState={dehydrated:v,treeContext:k,retryLane:1073741824},k=nu(18,null,null,0),k.stateNode=v,k.return=f,f.child=k,_2=f,$2=null,!0):!1;default:return!1}}function jg(f){return(f.mode&1)!==0&&(f.flags&128)===0}function bg(f){if(el){var v=$2;if(v){var k=v;if(!Uy(f,v)){if(jg(f))throw Error(z1(418));v=n4(k.nextSibling);var V=_2;v&&Uy(f,v)?tw(V,k):(f.flags=f.flags&-4097|2,el=!1,_2=f)}}else{if(jg(f))throw Error(z1(418));f.flags=f.flags&-4097|2,el=!1,_2=f}}}function xy(f){for(f=f.return;f!==null&&f.tag!==5&&f.tag!==3&&f.tag!==13;)f=f.return;_2=f}function pf(f){if(f!==_2)return!1;if(!el)return xy(f),el=!0,!1;var v;if((v=f.tag!==3)&&!(v=f.tag!==5)&&(v=f.type,v=v!=="head"&&v!=="body"&&!Tg(f.type,f.memoizedProps)),v&&(v=$2)){if(jg(f))throw ln(),Error(z1(418));for(;v;)tw(f,v),v=n4(v.nextSibling)}if(xy(f),f.tag===13){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(z1(317));l:{f=f.nextSibling;for(v=0;f;){if(f.nodeType===8){var k=f.data;if(k==="/$"){if(v===0){$2=n4(f.nextSibling);break l}v--}else k!=="$"&&k!=="$!"&&k!=="$?"||v++}f=f.nextSibling}$2=null}}else $2=_2?n4(f.stateNode.nextSibling):null;return!0}function ln(){for(var f=$2;f;)f=n4(f.nextSibling)}function U6(){$2=_2=null,el=!1}function Pv(f){Hu===null?Hu=[f]:Hu.push(f)}function N8(f,v,k){if(f=k.ref,f!==null&&typeof f!=="function"&&typeof f!=="object"){if(k._owner){if(k=k._owner,k){if(k.tag!==1)throw Error(z1(309));var V=k.stateNode}if(!V)throw Error(z1(147,f));var W=V,g=""+f;if(v!==null&&v.ref!==null&&typeof v.ref==="function"&&v.ref._stringRef===g)return v.ref;return v=function(Q){var b=W.refs;Q===null?delete b[g]:b[g]=Q},v._stringRef=g,v}if(typeof f!=="string")throw Error(z1(284));if(!k._owner)throw Error(z1(290,f))}return f}function ff(f,v){throw f=Object.prototype.toString.call(v),Error(z1(31,f==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":f))}function Py(f){var v=f._init;return v(f._payload)}function un(f){function v(g1,f1){if(f){var o1=g1.deletions;o1===null?(g1.deletions=[f1],g1.flags|=16):o1.push(f1)}}function k(g1,f1){if(!f)return null;for(;f1!==null;)v(g1,f1),f1=f1.sibling;return null}function V(g1,f1){for(g1=new Map;f1!==null;)f1.key!==null?g1.set(f1.key,f1):g1.set(f1.index,f1),f1=f1.sibling;return g1}function W(g1,f1){return g1=s4(g1,f1),g1.index=0,g1.sibling=null,g1}function g(g1,f1,o1){if(g1.index=o1,!f)return g1.flags|=1048576,f1;if(o1=g1.alternate,o1!==null)return o1=o1.index,o1<f1?(g1.flags|=2,f1):o1;return g1.flags|=2,f1}function Q(g1){return f&&g1.alternate===null&&(g1.flags|=2),g1}function b(g1,f1,o1,I1){if(f1===null||f1.tag!==6)return f1=kg(o1,g1.mode,I1),f1.return=g1,f1;return f1=W(f1,o1),f1.return=g1,f1}function u1(g1,f1,o1,I1){var b1=o1.type;if(b1===v6)return U1(g1,f1,o1.props.children,I1,o1.key);if(f1!==null&&(f1.elementType===b1||typeof b1==="object"&&b1!==null&&b1.$$typeof===d4&&Py(b1)===f1.type))return I1=W(f1,o1.props),I1.ref=N8(g1,f1,o1),I1.return=g1,I1;return I1=sf(o1.type,o1.key,o1.props,null,g1.mode,I1),I1.ref=N8(g1,f1,o1),I1.return=g1,I1}function a1(g1,f1,o1,I1){if(f1===null||f1.tag!==4||f1.stateNode.containerInfo!==o1.containerInfo||f1.stateNode.implementation!==o1.implementation)return f1=Sg(o1,g1.mode,I1),f1.return=g1,f1;return f1=W(f1,o1.children||[]),f1.return=g1,f1}function U1(g1,f1,o1,I1,b1){if(f1===null||f1.tag!==7)return f1=Hc(o1,g1.mode,I1,b1),f1.return=g1,f1;return f1=W(f1,o1),f1.return=g1,f1}function q1(g1,f1,o1){if(typeof f1==="string"&&f1!==""||typeof f1==="number")return f1=kg(""+f1,g1.mode,o1),f1.return=g1,f1;if(typeof f1==="object"&&f1!==null){switch(f1.$$typeof){case bp:return o1=sf(f1.type,f1.key,f1.props,null,g1.mode,o1),o1.ref=N8(g1,null,f1),o1.return=g1,o1;case g6:return f1=Sg(f1,g1.mode,o1),f1.return=g1,f1;case d4:var I1=f1._init;return q1(g1,I1(f1._payload),o1)}if(x8(f1)||W8(f1))return f1=Hc(f1,g1.mode,o1,null),f1.return=g1,f1;ff(g1,f1)}return null}function F1(g1,f1,o1,I1){var b1=f1!==null?f1.key:null;if(typeof o1==="string"&&o1!==""||typeof o1==="number")return b1!==null?null:b(g1,f1,""+o1,I1);if(typeof o1==="object"&&o1!==null){switch(o1.$$typeof){case bp:return o1.key===b1?u1(g1,f1,o1,I1):null;case g6:return o1.key===b1?a1(g1,f1,o1,I1):null;case d4:return b1=o1._init,F1(g1,f1,b1(o1._payload),I1)}if(x8(o1)||W8(o1))return b1!==null?null:U1(g1,f1,o1,I1,null);ff(g1,o1)}return null}function x1(g1,f1,o1,I1,b1){if(typeof I1==="string"&&I1!==""||typeof I1==="number")return g1=g1.get(o1)||null,b(f1,g1,""+I1,b1);if(typeof I1==="object"&&I1!==null){switch(I1.$$typeof){case bp:return g1=g1.get(I1.key===null?o1:I1.key)||null,u1(f1,g1,I1,b1);case g6:return g1=g1.get(I1.key===null?o1:I1.key)||null,a1(f1,g1,I1,b1);case d4:var G=I1._init;return x1(g1,f1,o1,G(I1._payload),b1)}if(x8(I1)||W8(I1))return g1=g1.get(o1)||null,U1(f1,g1,I1,b1,null);ff(f1,I1)}return null}function J1(g1,f1,o1,I1){for(var b1=null,G=null,t=f1,r1=f1=0,N1=null;t!==null&&r1r1?(N1=t,t=null):N1=t.sibling;var P1=F1(g1,t,o1[r1],I1);if(P1===null){t===null&&(t=N1);break}f&&t&&P1.alternate===null&&v(g1,t),f1=g(P1,f1,r1),G===null?b1=P1:G.sibling=P1,G=P1,t=N1}if(r1===o1.length)return k(g1,t),el&&Rc(g1,r1),b1;if(t===null){for(;r1<o1.length;r1++)t=q1(g1,o1[r1],I1),t!==null&&(f1=g(t,f1,r1),G===null?b1=t:G.sibling=t,G=t);return el&&Rc(g1,r1),b1}for(t=V(g1,t);r1r1?(N1=t,t=null):N1=t.sibling;var ll=F1(g1,t,P1.value,I1);if(ll===null){t===null&&(t=N1);break}f&&t&&ll.alternate===null&&v(g1,t),f1=g(ll,f1,r1),G===null?b1=ll:G.sibling=ll,G=ll,t=N1}if(P1.done)return k(g1,t),el&&Rc(g1,r1),b1;if(t===null){for(;!P1.done;r1++,P1=o1.next())P1=q1(g1,P1.value,I1),P1!==null&&(f1=g(P1,f1,r1),G===null?b1=P1:G.sibling=P1,G=P1);return el&&Rc(g1,r1),b1}for(t=V(g1,t);!P1.done;r1++,P1=o1.next())P1=x1(t,g1,r1,P1.value,I1),P1!==null&&(f&&P1.alternate!==null&&t.delete(P1.key===null?r1:P1.key),f1=g(P1,f1,r1),G===null?b1=P1:G.sibling=P1,G=P1);return f&&t.forEach(function(cl){return v(g1,cl)}),el&&Rc(g1,r1),b1}function C1(g1,f1,o1,I1){if(typeof o1==="object"&&o1!==null&&o1.type===v6&&o1.key===null&&(o1=o1.props.children),typeof o1==="object"&&o1!==null){switch(o1.$$typeof){case bp:l:{for(var b1=o1.key,G=f1;G!==null;){if(G.key===b1){if(b1=o1.type,b1===v6){if(G.tag===7){k(g1,G.sibling),f1=W(G,o1.props.children),f1.return=g1,g1=f1;break l}}else if(G.elementType===b1||typeof b1==="object"&&b1!==null&&b1.$$typeof===d4&&Py(b1)===G.type){k(g1,G.sibling),f1=W(G,o1.props),f1.ref=N8(g1,G,o1),f1.return=g1,g1=f1;break l}k(g1,G);break}else v(g1,G);G=G.sibling}o1.type===v6?(f1=Hc(o1.props.children,g1.mode,I1,o1.key),f1.return=g1,g1=f1):(I1=sf(o1.type,o1.key,o1.props,null,g1.mode,I1),I1.ref=N8(g1,f1,o1),I1.return=g1,g1=I1)}return Q(g1);case g6:l:{for(G=o1.key;f1!==null;){if(f1.key===G)if(f1.tag===4&&f1.stateNode.containerInfo===o1.containerInfo&&f1.stateNode.implementation===o1.implementation){k(g1,f1.sibling),f1=W(f1,o1.children||[]),f1.return=g1,g1=f1;break l}else{k(g1,f1);break}else v(g1,f1);f1=f1.sibling}f1=Sg(o1,g1.mode,I1),f1.return=g1,g1=f1}return Q(g1);case d4:return G=o1._init,C1(g1,f1,G(o1._payload),I1)}if(x8(o1))return J1(g1,f1,o1,I1);if(W8(o1))return X1(g1,f1,o1,I1);ff(g1,o1)}return typeof o1==="string"&&o1!==""||typeof o1==="number"?(o1=""+o1,f1!==null&&f1.tag===6?(k(g1,f1.sibling),f1=W(f1,o1),f1.return=g1,g1=f1):(k(g1,f1),f1=kg(o1,g1.mode,I1),f1.return=g1,g1=f1),Q(g1)):k(g1,f1)}return C1}function Iv(){Rv=S6=Bf=null}function Yv(f){var v=Yf.current;$l(Yf),f._currentValue=v}function $g(f,v,k){for(;f!==null;){var V=f.alternate;if((f.childLanes&v)!==v?(f.childLanes|=v,V!==null&&(V.childLanes|=v)):V!==null&&(V.childLanes&v)!==v&&(V.childLanes|=v),f===k)break;f=f.return}}function V6(f,v){Bf=f,Rv=S6=null,f=f.dependencies,f!==null&&f.firstContext!==null&&((f.lanes&v)!==0&&(Q2=!0),f.firstContext=null)}function Su(f){var v=f._currentValue;if(Rv!==f)if(f={context:f,memoizedValue:v,next:null},S6===null){if(Bf===null)throw Error(z1(308));S6=f,Bf.dependencies={lanes:0,firstContext:f}}else S6=S6.next=f;return v}function Bv(f){Bc===null?Bc=[f]:Bc.push(f)}function rn(f,v,k,V){var W=v.interleaved;return W===null?(k.next=k,Bv(v)):(k.next=W.next,W.next=k),v.interleaved=k,v3(f,V)}function v3(f,v){f.lanes|=v;var k=f.alternate;k!==null&&(k.lanes|=v),k=f;for(f=f.return;f!==null;)f.childLanes|=v,k=f.alternate,k!==null&&(k.childLanes|=v),k=f,f=f.return;return k.tag===3?k.stateNode:null}function zv(f){f.updateQueue={baseState:f.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pn(f,v){f=f.updateQueue,v.updateQueue===f&&(v.updateQueue={baseState:f.baseState,firstBaseUpdate:f.firstBaseUpdate,lastBaseUpdate:f.lastBaseUpdate,shared:f.shared,effects:f.effects})}function d3(f,v){return{eventTime:f,lane:v,tag:0,payload:null,callback:null,next:null}}function k4(f,v,k){var V=f.updateQueue;if(V===null)return null;if(V=V.shared,(Cl&2)!==0){var W=V.pending;return W===null?v.next=v:(v.next=W.next,W.next=v),V.pending=v,v3(f,k)}return W=V.interleaved,W===null?(v.next=v,Bv(V)):(v.next=W.next,W.next=v),V.interleaved=v,v3(f,k)}function yf(f,v,k){if(v=v.updateQueue,v!==null&&(v=v.shared,(k&4194240)!==0)){var V=v.lanes;V&=f.pendingLanes,k|=V,v.lanes=k,Cv(f,k)}}function Ry(f,v){var{updateQueue:k,alternate:V}=f;if(V!==null&&(V=V.updateQueue,k===V)){var W=null,g=null;if(k=k.firstBaseUpdate,k!==null){do{var Q={eventTime:k.eventTime,lane:k.lane,tag:k.tag,payload:k.payload,callback:k.callback,next:null};g===null?W=g=Q:g=g.next=Q,k=k.next}while(k!==null);g===null?W=g=v:g=g.next=v}else W=g=v;k={baseState:V.baseState,firstBaseUpdate:W,lastBaseUpdate:g,shared:V.shared,effects:V.effects},f.updateQueue=k;return}f=k.lastBaseUpdate,f===null?k.firstBaseUpdate=v:f.next=v,k.lastBaseUpdate=v}function zf(f,v,k,V){var W=f.updateQueue;m4=!1;var{firstBaseUpdate:g,lastBaseUpdate:Q}=W,b=W.shared.pending;if(b!==null){W.shared.pending=null;var u1=b,a1=u1.next;u1.next=null,Q===null?g=a1:Q.next=a1,Q=u1;var U1=f.alternate;U1!==null&&(U1=U1.updateQueue,b=U1.lastBaseUpdate,b!==Q&&(b===null?U1.firstBaseUpdate=a1:b.next=a1,U1.lastBaseUpdate=u1))}if(g!==null){var q1=W.baseState;Q=0,U1=a1=u1=null,b=g;do{var{lane:F1,eventTime:x1}=b;if((V&F1)===F1){U1!==null&&(U1=U1.next={eventTime:x1,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});l:{var J1=f,X1=b;switch(F1=v,x1=k,X1.tag){case 1:if(J1=X1.payload,typeof J1==="function"){q1=J1.call(x1,q1,F1);break l}q1=J1;break l;case 3:J1.flags=J1.flags&-65537|128;case 0:if(J1=X1.payload,F1=typeof J1==="function"?J1.call(x1,q1,F1):J1,F1===null||F1===void 0)break l;q1=g0({},q1,F1);break l;case 2:m4=!0}}b.callback!==null&&b.lane!==0&&(f.flags|=64,F1=W.effects,F1===null?W.effects=[b]:F1.push(b))}else x1={eventTime:x1,lane:F1,tag:b.tag,payload:b.payload,callback:b.callback,next:null},U1===null?(a1=U1=x1,u1=q1):U1=U1.next=x1,Q|=F1;if(b=b.next,b===null)if(b=W.shared.pending,b===null)break;else F1=b,b=F1.next,F1.next=null,W.lastBaseUpdate=F1,W.shared.pending=null}while(1);if(U1===null&&(u1=q1),W.baseState=u1,W.firstBaseUpdate=a1,W.lastBaseUpdate=U1,v=W.shared.interleaved,v!==null){W=v;do Q|=W.lane,W=W.next;while(W!==v)}else g===null&&(W.shared.lanes=0);Zc|=Q,f.lanes=Q,f.memoizedState=q1}}function Iy(f,v,k){if(f=v.effects,v.effects=null,f!==null)for(v=0;v<f.length;v++){var V=f[v],W=V.callback;if(W!==null){if(V.callback=null,V=k,typeof W!=="function")throw Error(z1(191,W));W.call(V)}}}function zc(f){if(f===o9)throw Error(z1(174));return f}function Qv(f,v){switch(Dl(r9,v),Dl(c9,f),Dl(s5,o9),f=v.nodeType,f){case 9:case 11:v=(v=v.documentElement)?v.namespaceURI:Fg(null,"");break;default:f=f===8?v.parentNode:v,v=f.namespaceURI||null,f=f.tagName,v=Fg(v,f)}$l(s5),Dl(s5,v)}function P6(){$l(s5),$l(c9),$l(r9)}function fn(f){zc(r9.current);var v=zc(s5.current),k=Fg(v,f.type);v!==k&&(Dl(c9,f),Dl(s5,k))}function Hv(f){c9.current===f&&($l(s5),$l(c9))}function Qf(f){for(var v=f;v!==null;){if(v.tag===13){var k=v.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||k.data==="$?"||k.data==="$!"))return v}else if(v.tag===19&&v.memoizedProps.revealOrder!==void 0){if((v.flags&128)!==0)return v}else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}function Mv(){for(var f=0;f<ag.length;f++)ag[f]._workInProgressVersionPrimary=null;ag.length=0}function g2(){throw Error(z1(321))}function Kv(f,v){if(v===null)return!1;for(var k=0;k<v.length&&k<f.length;k++)if(!Ou(f[k],v[k]))return!1;return!0}function Ov(f,v,k,V,W,g){if(Oc=g,m0=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,wf.current=f===null||f.memoizedState===null?GW:XW,f=k(V,W),Z8){g=0;do{if(Z8=!1,p9=0,25k?k:4,f(!0);var V=og.transition;og.transition={};try{f(!1),v()}finally{Il=k,og.transition=V}}function Wn(){return Eu().memoizedState}function DW(f,v,k){var V=E4(f);if(k={lane:V,action:k,hasEagerState:!1,eagerState:null,next:null},Ln(f))An(v,k);else if(k=rn(f,v,k,V),k!==null){var W=V2();Ku(k,f,V,W),Vn(k,v,V)}}function TW(f,v,k){var V=E4(f),W={lane:V,action:k,hasEagerState:!1,eagerState:null,next:null};if(Ln(f))An(v,W);else{var g=f.alternate;if(f.lanes===0&&(g===null||g.lanes===0)&&(g=v.lastRenderedReducer,g!==null))try{var Q=v.lastRenderedState,b=g(Q,k);if(W.hasEagerState=!0,W.eagerState=b,Ou(b,Q)){var u1=v.interleaved;u1===null?(W.next=W,Bv(v)):(W.next=u1.next,u1.next=W),v.interleaved=W;return}}catch(a1){}finally{}k=rn(f,v,W,V),k!==null&&(W=V2(),Ku(k,f,V,W),Vn(k,v,V))}}function Ln(f){var v=f.alternate;return f===m0||v!==null&&v===m0}function An(f,v){Z8=Hf=!0;var k=f.pending;k===null?v.next=v:(v.next=k.next,k.next=v),f.pending=v}function Vn(f,v,k){if((k&4194240)!==0){var V=v.lanes;V&=f.pendingLanes,k|=V,v.lanes=k,Cv(f,k)}}function zu(f,v){if(f&&f.defaultProps){v=g0({},v),f=f.defaultProps;for(var k in f)v[k]===void 0&&(v[k]=f[k]);return v}return v}function _g(f,v,k,V){v=f.memoizedState,k=k(V,v),k=k===null||k===void 0?v:g0({},v,k),f.memoizedState=k,f.lanes===0&&(f.updateQueue.baseState=k)}function zy(f,v,k,V,W,g,Q){return f=f.stateNode,typeof f.shouldComponentUpdate==="function"?f.shouldComponentUpdate(V,g,Q):v.prototype&&v.prototype.isPureReactComponent?!e8(k,V)||!e8(W,g):!0}function Nn(f,v,k){var V=!1,W=W4,g=v.contextType;return typeof g==="object"&&g!==null?g=Su(g):(W=M2(v)?Mc:o2.current,V=v.contextTypes,g=(V=V!==null&&V!==void 0)?F6(f,W):W4),v=new v(k,g),f.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=ef,f.stateNode=v,v._reactInternals=f,V&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=W,f.__reactInternalMemoizedMaskedChildContext=g),v}function Qy(f,v,k,V){f=v.state,typeof v.componentWillReceiveProps==="function"&&v.componentWillReceiveProps(k,V),typeof v.UNSAFE_componentWillReceiveProps==="function"&&v.UNSAFE_componentWillReceiveProps(k,V),v.state!==f&&ef.enqueueReplaceState(v,v.state,null)}function ig(f,v,k,V){var W=f.stateNode;W.props=k,W.state=f.memoizedState,W.refs={},zv(f);var g=v.contextType;typeof g==="object"&&g!==null?W.context=Su(g):(g=M2(v)?Mc:o2.current,W.context=F6(f,g)),W.state=f.memoizedState,g=v.getDerivedStateFromProps,typeof g==="function"&&(_g(f,v,g,k),W.state=f.memoizedState),typeof v.getDerivedStateFromProps==="function"||typeof W.getSnapshotBeforeUpdate==="function"||typeof W.UNSAFE_componentWillMount!=="function"&&typeof W.componentWillMount!=="function"||(v=W.state,typeof W.componentWillMount==="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount==="function"&&W.UNSAFE_componentWillMount(),v!==W.state&&ef.enqueueReplaceState(W,W.state,null),zf(f,k,W,V),W.state=f.memoizedState),typeof W.componentDidMount==="function"&&(f.flags|=4194308)}function R6(f,v){try{var k="",V=v;do k+=LC(V),V=V.return;while(V);var W=k}catch(g){W=` Error generating stack: `+g.message+` `+g.stack}return{value:f,source:v,stack:W,digest:null}}function wg(f,v,k){return{value:f,source:null,stack:k!=null?k:null,digest:v!=null?v:null}}function eg(f,v){try{console.error(v.value)}catch(k){setTimeout(function(){throw k})}}function qn(f,v,k){k=d3(-1,k),k.tag=3,k.payload={element:null};var V=v.value;return k.callback=function(){Of||(Of=!0,gv=V),eg(f,v)},k}function Fn(f,v,k){k=d3(-1,k),k.tag=3;var V=f.type.getDerivedStateFromError;if(typeof V==="function"){var W=v.value;k.payload=function(){return V(W)},k.callback=function(){eg(f,v)}}var g=f.stateNode;return g!==null&&typeof g.componentDidCatch==="function"&&(k.callback=function(){eg(f,v),typeof V!=="function"&&(S4===null?S4=new Set([this]):S4.add(this));var Q=v.stack;this.componentDidCatch(v.value,{componentStack:Q!==null?Q:""})}),k}function Hy(f,v,k){var V=f.pingCache;if(V===null){V=f.pingCache=new jW;var W=new Set;V.set(v,W)}else W=V.get(v),W===void 0&&(W=new Set,V.set(v,W));W.has(k)||(W.add(k),f=mL.bind(null,f,v,k),v.then(f,f))}function My(f){do{var v;if(v=f.tag===13)v=f.memoizedState,v=v!==null?v.dehydrated!==null?!0:!1:!0;if(v)return f;f=f.return}while(f!==null);return null}function Ky(f,v,k,V,W){if((f.mode&1)===0)return f===v?f.flags|=65536:(f.flags|=128,k.flags|=131072,k.flags&=-52805,k.tag===1&&(k.alternate===null?k.tag=17:(v=d3(-1,1),v.tag=2,k4(k,v,1))),k.lanes|=1),f;return f.flags|=65536,f.lanes=W,f}function A2(f,v,k,V){v.child=f===null?cn(v,null,k,V):x6(v,f.child,k,V)}function Oy(f,v,k,V,W){k=k.render;var g=v.ref;if(V6(v,W),V=Ov(f,v,k,V,g,W),k=Zv(),f!==null&&!Q2)return v.updateQueue=f.updateQueue,v.flags&=-2053,f.lanes&=~W,a3(f,v,W);return el&&k&&Uv(v),v.flags|=1,A2(f,v,V,W),v.child}function Zy(f,v,k,V,W){if(f===null){var g=k.type;if(typeof g==="function"&&!iv(g)&&g.defaultProps===void 0&&k.compare===null&&k.defaultProps===void 0)return v.tag=15,v.type=g,Un(f,v,g,V,W);return f=sf(k.type,null,V,v,v.mode,W),f.ref=v.ref,f.return=v,v.child=f}if(g=f.child,(f.lanes&W)===0){var Q=g.memoizedProps;if(k=k.compare,k=k!==null?k:e8,k(Q,V)&&f.ref===v.ref)return a3(f,v,W)}return v.flags|=1,f=s4(g,V),f.ref=v.ref,f.return=v,v.child=f}function Un(f,v,k,V,W){if(f!==null){var g=f.memoizedProps;if(e8(g,V)&&f.ref===v.ref)if(Q2=!1,v.pendingProps=V=g,(f.lanes&W)!==0)(f.flags&131072)!==0&&(Q2=!0);else return v.lanes=f.lanes,a3(f,v,W)}return tg(f,v,k,V,W)}function xn(f,v,k){var V=v.pendingProps,W=V.children,g=f!==null?f.memoizedState:null;if(V.mode==="hidden")if((v.mode&1)===0)v.memoizedState={baseLanes:0,cachePool:null,transitions:null},Dl(s6,b2),b2|=k;else{if((k&1073741824)===0)return f=g!==null?g.baseLanes|k:k,v.lanes=v.childLanes=1073741824,v.memoizedState={baseLanes:f,cachePool:null,transitions:null},v.updateQueue=null,Dl(s6,b2),b2|=f,null;v.memoizedState={baseLanes:0,cachePool:null,transitions:null},V=g!==null?g.baseLanes:k,Dl(s6,b2),b2|=V}else g!==null?(V=g.baseLanes|k,v.memoizedState=null):V=k,Dl(s6,b2),b2|=V;return A2(f,v,W,k),v.child}function Pn(f,v){var k=v.ref;if(f===null&&k!==null||f!==null&&f.ref!==k)v.flags|=512,v.flags|=2097152}function tg(f,v,k,V,W){var g=M2(k)?Mc:o2.current;if(g=F6(v,g),V6(v,W),k=Ov(f,v,k,V,g,W),V=Zv(),f!==null&&!Q2)return v.updateQueue=f.updateQueue,v.flags&=-2053,f.lanes&=~W,a3(f,v,W);return el&&V&&Uv(v),v.flags|=1,A2(f,v,k,W),v.child}function Dy(f,v,k,V,W){if(M2(k)){var g=!0;Pf(v)}else g=!1;if(V6(v,W),v.stateNode===null)kf(f,v),Nn(v,k,V),ig(v,k,V,W),V=!0;else if(f===null){var{stateNode:Q,memoizedProps:b}=v;Q.props=b;var u1=Q.context,a1=k.contextType;typeof a1==="object"&&a1!==null?a1=Su(a1):(a1=M2(k)?Mc:o2.current,a1=F6(v,a1));var U1=k.getDerivedStateFromProps,q1=typeof U1==="function"||typeof Q.getSnapshotBeforeUpdate==="function";q1||typeof Q.UNSAFE_componentWillReceiveProps!=="function"&&typeof Q.componentWillReceiveProps!=="function"||(b!==V||u1!==a1)&&Qy(v,Q,V,a1),m4=!1;var F1=v.memoizedState;Q.state=F1,zf(v,V,Q,W),u1=v.memoizedState,b!==V||F1!==u1||H2.current||m4?(typeof U1==="function"&&(_g(v,k,U1,V),u1=v.memoizedState),(b=m4||zy(v,k,b,V,F1,u1,a1))?(q1||typeof Q.UNSAFE_componentWillMount!=="function"&&typeof Q.componentWillMount!=="function"||(typeof Q.componentWillMount==="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount==="function"&&Q.UNSAFE_componentWillMount()),typeof Q.componentDidMount==="function"&&(v.flags|=4194308)):(typeof Q.componentDidMount==="function"&&(v.flags|=4194308),v.memoizedProps=V,v.memoizedState=u1),Q.props=V,Q.state=u1,Q.context=a1,V=b):(typeof Q.componentDidMount==="function"&&(v.flags|=4194308),V=!1)}else{Q=v.stateNode,pn(f,v),b=v.memoizedProps,a1=v.type===v.elementType?b:zu(v.type,b),Q.props=a1,q1=v.pendingProps,F1=Q.context,u1=k.contextType,typeof u1==="object"&&u1!==null?u1=Su(u1):(u1=M2(k)?Mc:o2.current,u1=F6(v,u1));var x1=k.getDerivedStateFromProps;(U1=typeof x1==="function"||typeof Q.getSnapshotBeforeUpdate==="function")||typeof Q.UNSAFE_componentWillReceiveProps!=="function"&&typeof Q.componentWillReceiveProps!=="function"||(b!==q1||F1!==u1)&&Qy(v,Q,V,u1),m4=!1,F1=v.memoizedState,Q.state=F1,zf(v,V,Q,W);var J1=v.memoizedState;b!==q1||F1!==J1||H2.current||m4?(typeof x1==="function"&&(_g(v,k,x1,V),J1=v.memoizedState),(a1=m4||zy(v,k,a1,V,F1,J1,u1)||!1)?(U1||typeof Q.UNSAFE_componentWillUpdate!=="function"&&typeof Q.componentWillUpdate!=="function"||(typeof Q.componentWillUpdate==="function"&&Q.componentWillUpdate(V,J1,u1),typeof Q.UNSAFE_componentWillUpdate==="function"&&Q.UNSAFE_componentWillUpdate(V,J1,u1)),typeof Q.componentDidUpdate==="function"&&(v.flags|=4),typeof Q.getSnapshotBeforeUpdate==="function"&&(v.flags|=1024)):(typeof Q.componentDidUpdate!=="function"||b===f.memoizedProps&&F1===f.memoizedState||(v.flags|=4),typeof Q.getSnapshotBeforeUpdate!=="function"||b===f.memoizedProps&&F1===f.memoizedState||(v.flags|=1024),v.memoizedProps=V,v.memoizedState=J1),Q.props=V,Q.state=J1,Q.context=u1,V=a1):(typeof Q.componentDidUpdate!=="function"||b===f.memoizedProps&&F1===f.memoizedState||(v.flags|=4),typeof Q.getSnapshotBeforeUpdate!=="function"||b===f.memoizedProps&&F1===f.memoizedState||(v.flags|=1024),V=!1)}return lv(f,v,k,V,g,W)}function lv(f,v,k,V,W,g){Pn(f,v);var Q=(v.flags&128)!==0;if(!V&&!Q)return W&&Fy(v,k,!1),a3(f,v,g);V=v.stateNode,bW.current=v;var b=Q&&typeof k.getDerivedStateFromError!=="function"?null:V.render();return v.flags|=1,f!==null&&Q?(v.child=x6(v,f.child,null,g),v.child=x6(v,null,b,g)):A2(f,v,b,g),v.memoizedState=V.state,W&&Fy(v,k,!0),v.child}function Rn(f){var v=f.stateNode;v.pendingContext?qy(f,v.pendingContext,v.pendingContext!==v.context):v.context&&qy(f,v.context,!1),Qv(f,v.containerInfo)}function Ty(f,v,k,V,W){return U6(),Pv(W),v.flags|=256,A2(f,v,k,V),v.child}function cv(f){return{baseLanes:f,cachePool:null,transitions:null}}function In(f,v,k){var V=v.pendingProps,W=d0.current,g=!1,Q=(v.flags&128)!==0,b;if((b=Q)||(b=f!==null&&f.memoizedState===null?!1:(W&2)!==0),b)g=!0,v.flags&=-129;else if(f===null||f.memoizedState!==null)W|=1;if(Dl(d0,W&1),f===null){if(bg(v),f=v.memoizedState,f!==null&&(f=f.dehydrated,f!==null))return(v.mode&1)===0?v.lanes=1:f.data==="$!"?v.lanes=8:v.lanes=1073741824,null;return Q=V.children,f=V.fallback,g?(V=v.mode,g=v.child,Q={mode:"hidden",children:Q},(V&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=Q):g=ud(Q,V,0,null),f=Hc(f,V,k,null),g.return=v,f.return=v,g.sibling=f,v.child=g,v.child.memoizedState=cv(k),v.memoizedState=uv,f):Gv(v,Q)}if(W=f.memoizedState,W!==null&&(b=W.dehydrated,b!==null))return $W(f,v,Q,V,b,W,k);if(g){g=V.fallback,Q=v.mode,W=f.child,b=W.sibling;var u1={mode:"hidden",children:V.children};return(Q&1)===0&&v.child!==W?(V=v.child,V.childLanes=0,V.pendingProps=u1,v.deletions=null):(V=s4(W,u1),V.subtreeFlags=W.subtreeFlags&14680064),b!==null?g=s4(b,g):(g=Hc(g,Q,k,null),g.flags|=2),g.return=v,V.return=v,V.sibling=g,v.child=V,V=g,g=v.child,Q=f.child.memoizedState,Q=Q===null?cv(k):{baseLanes:Q.baseLanes|k,cachePool:null,transitions:Q.transitions},g.memoizedState=Q,g.childLanes=f.childLanes&~k,v.memoizedState=uv,V}return g=f.child,f=g.sibling,V=s4(g,{mode:"visible",children:V.children}),(v.mode&1)===0&&(V.lanes=k),V.return=v,V.sibling=null,f!==null&&(k=v.deletions,k===null?(v.deletions=[f],v.flags|=16):k.push(f)),v.child=V,v.memoizedState=null,V}function Gv(f,v){return v=ud({mode:"visible",children:v},f.mode,0,null),v.return=f,f.child=v}function df(f,v,k,V){return V!==null&&Pv(V),x6(v,f.child,null,k),f=Gv(v,v.pendingProps.children),f.flags|=2,v.memoizedState=null,f}function $W(f,v,k,V,W,g,Q){if(k){if(v.flags&256)return v.flags&=-257,V=wg(Error(z1(422))),df(f,v,Q,V);if(v.memoizedState!==null)return v.child=f.child,v.flags|=128,null;return g=V.fallback,W=v.mode,V=ud({mode:"visible",children:V.children},W,0,null),g=Hc(g,W,Q,null),g.flags|=2,V.return=v,g.return=v,V.sibling=g,v.child=V,(v.mode&1)!==0&&x6(v,f.child,null,Q),v.child.memoizedState=cv(Q),v.memoizedState=uv,g}if((v.mode&1)===0)return df(f,v,Q,null);if(W.data==="$!"){if(V=W.nextSibling&&W.nextSibling.dataset,V)var b=V.dgst;return V=b,g=Error(z1(419)),V=wg(g,V,void 0),df(f,v,Q,V)}if(b=(Q&f.childLanes)!==0,Q2||b){if(V=K0,V!==null){switch(Q&-Q){case 4:W=2;break;case 16:W=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:W=32;break;case 536870912:W=268435456;break;default:W=0}W=(W&(V.suspendedLanes|Q))!==0?0:W,W!==0&&W!==g.retryLane&&(g.retryLane=W,v3(f,W),Ku(V,f,W,-1))}return _v(),V=wg(Error(z1(421))),df(f,v,Q,V)}if(W.data==="$?")return v.flags|=128,v.child=f.child,v=gL.bind(null,f),W._reactRetry=v,null;return f=g.treeContext,$2=n4(W.nextSibling),_2=v,el=!0,Hu=null,f!==null&&(yu[wu++]=p3,yu[wu++]=f3,yu[wu++]=Kc,p3=f.id,f3=f.overflow,Kc=v),v=Gv(v,V.children),v.flags|=4096,v}function Gy(f,v,k){f.lanes|=v;var V=f.alternate;V!==null&&(V.lanes|=v),$g(f.return,v,k)}function ng(f,v,k,V,W){var g=f.memoizedState;g===null?f.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:V,tail:k,tailMode:W}:(g.isBackwards=v,g.rendering=null,g.renderingStartTime=0,g.last=V,g.tail=k,g.tailMode=W)}function Yn(f,v,k){var V=v.pendingProps,W=V.revealOrder,g=V.tail;if(A2(f,v,V.children,k),V=d0.current,(V&2)!==0)V=V&1|2,v.flags|=128;else{if(f!==null&&(f.flags&128)!==0)l:for(f=v.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&Gy(f,k,v);else if(f.tag===19)Gy(f,k,v);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===v)break l;for(;f.sibling===null;){if(f.return===null||f.return===v)break l;f=f.return}f.sibling.return=f.return,f=f.sibling}V&=1}if(Dl(d0,V),(v.mode&1)===0)v.memoizedState=null;else switch(W){case"forwards":k=v.child;for(W=null;k!==null;)f=k.alternate,f!==null&&Qf(f)===null&&(W=k),k=k.sibling;k=W,k===null?(W=v.child,v.child=null):(W=k.sibling,k.sibling=null),ng(v,!1,W,k,g);break;case"backwards":k=null,W=v.child;for(v.child=null;W!==null;){if(f=W.alternate,f!==null&&Qf(f)===null){v.child=W;break}f=W.sibling,W.sibling=k,k=W,W=f}ng(v,!0,k,null,g);break;case"together":ng(v,!1,null,null,void 0);break;default:v.memoizedState=null}return v.child}function kf(f,v){(v.mode&1)===0&&f!==null&&(f.alternate=null,v.alternate=null,v.flags|=2)}function a3(f,v,k){if(f!==null&&(v.dependencies=f.dependencies),Zc|=v.lanes,(k&v.childLanes)===0)return null;if(f!==null&&v.child!==f.child)throw Error(z1(153));if(v.child!==null){f=v.child,k=s4(f,f.pendingProps),v.child=k;for(k.return=v;f.sibling!==null;)f=f.sibling,k=k.sibling=s4(f,f.pendingProps),k.return=v;k.sibling=null}return v.child}function _W(f,v,k){switch(v.tag){case 3:Rn(v),U6();break;case 5:fn(v);break;case 1:M2(v.type)&&Pf(v);break;case 4:Qv(v,v.stateNode.containerInfo);break;case 10:var V=v.type._context,W=v.memoizedProps.value;Dl(Yf,V._currentValue),V._currentValue=W;break;case 13:if(V=v.memoizedState,V!==null){if(V.dehydrated!==null)return Dl(d0,d0.current&1),v.flags|=128,null;if((k&v.child.childLanes)!==0)return In(f,v,k);return Dl(d0,d0.current&1),f=a3(f,v,k),f!==null?f.sibling:null}Dl(d0,d0.current&1);break;case 19:if(V=(k&v.childLanes)!==0,(f.flags&128)!==0){if(V)return Yn(f,v,k);v.flags|=128}if(W=v.memoizedState,W!==null&&(W.rendering=null,W.tail=null,W.lastEffect=null),Dl(d0,d0.current),V)break;else return null;case 22:case 23:return v.lanes=0,xn(f,v,k)}return a3(f,v,k)}function q8(f,v){if(!el)switch(f.tailMode){case"hidden":v=f.tail;for(var k=null;v!==null;)v.alternate!==null&&(k=v),v=v.sibling;k===null?f.tail=null:k.sibling=null;break;case"collapsed":k=f.tail;for(var V=null;k!==null;)k.alternate!==null&&(V=k),k=k.sibling;V===null?v||f.tail===null?f.tail=null:f.tail.sibling=null:V.sibling=null}}function v2(f){var v=f.alternate!==null&&f.alternate.child===f.child,k=0,V=0;if(v)for(var W=f.child;W!==null;)k|=W.lanes|W.childLanes,V|=W.subtreeFlags&14680064,V|=W.flags&14680064,W.return=f,W=W.sibling;else for(W=f.child;W!==null;)k|=W.lanes|W.childLanes,V|=W.subtreeFlags,V|=W.flags,W.return=f,W=W.sibling;return f.subtreeFlags|=V,f.childLanes=k,v}function iW(f,v,k){var V=v.pendingProps;switch(xv(v),v.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return v2(v),null;case 1:return M2(v.type)&&xf(),v2(v),null;case 3:if(V=v.stateNode,P6(),$l(H2),$l(o2),Mv(),V.pendingContext&&(V.context=V.pendingContext,V.pendingContext=null),f===null||f.child===null)pf(v)?v.flags|=4:f===null||f.memoizedState.isDehydrated&&(v.flags&256)===0||(v.flags|=1024,Hu!==null&&(ov(Hu),Hu=null));return rv(f,v),v2(v),null;case 5:Hv(v);var W=zc(r9.current);if(k=v.type,f!==null&&v.stateNode!=null)zn(f,v,k,V,W),f.ref!==v.ref&&(v.flags|=512,v.flags|=2097152);else{if(!V){if(v.stateNode===null)throw Error(z1(166));return v2(v),null}if(f=zc(s5.current),pf(v)){V=v.stateNode,k=v.type;var g=v.memoizedProps;switch(V[S5]=v,V[u9]=g,f=(v.mode&1)!==0,k){case"dialog":bl("cancel",V),bl("close",V);break;case"iframe":case"object":case"embed":bl("load",V);break;case"video":case"audio":for(W=0;W<z8.length;W++)bl(z8[W],V);break;case"source":bl("error",V);break;case"img":case"image":case"link":bl("error",V),bl("load",V);break;case"details":bl("toggle",V);break;case"input":ly(V,g),bl("invalid",V);break;case"select":V._wrapperState={wasMultiple:!!g.multiple},bl("invalid",V);break;case"textarea":cy(V,g),bl("invalid",V)}Ug(k,g),W=null;for(var Q in g)if(g.hasOwnProperty(Q)){var b=g[Q];Q==="children"?typeof b==="string"?V.textContent!==b&&(g.suppressHydrationWarning!==!0&&rf(V.textContent,b,f),W=["children",b]):typeof b==="number"&&V.textContent!==""+b&&(g.suppressHydrationWarning!==!0&&rf(V.textContent,b,f),W=["children",""+b]):X8.hasOwnProperty(Q)&&b!=null&&Q==="onScroll"&&bl("scroll",V)}switch(k){case"input":$p(V),uy(V,g,!0);break;case"textarea":$p(V),ry(V);break;case"select":case"option":break;default:typeof g.onClick==="function"&&(V.onclick=Uf)}V=W,v.updateQueue=V,V!==null&&(v.flags|=4)}else{Q=W.nodeType===9?W:W.ownerDocument,f==="http://www.w3.org/1999/xhtml"&&(f=aw(k)),f==="http://www.w3.org/1999/xhtml"?k==="script"?(f=Q.createElement("div"),f.innerHTML="",f=f.removeChild(f.firstChild)):typeof V.is==="string"?f=Q.createElement(k,{is:V.is}):(f=Q.createElement(k),k==="select"&&(Q=f,V.multiple?Q.multiple=!0:V.size&&(Q.size=V.size))):f=Q.createElementNS(f,k),f[S5]=v,f[u9]=V,Bn(f,v,!1,!1),v.stateNode=f;l:{switch(Q=xg(k,V),k){case"dialog":bl("cancel",f),bl("close",f),W=V;break;case"iframe":case"object":case"embed":bl("load",f),W=V;break;case"video":case"audio":for(W=0;WI6&&(v.flags|=128,V=!0,q8(g,!1),v.lanes=4194304)}else{if(!V)if(f=Qf(Q),f!==null){if(v.flags|=128,V=!0,k=f.updateQueue,k!==null&&(v.updateQueue=k,v.flags|=4),q8(g,!0),g.tail===null&&g.tailMode==="hidden"&&!Q.alternate&&!el)return v2(v),null}else 2*y0()-g.renderingStartTime>I6&&k!==1073741824&&(v.flags|=128,V=!0,q8(g,!1),v.lanes=4194304);g.isBackwards?(Q.sibling=v.child,v.child=Q):(k=g.last,k!==null?k.sibling=Q:v.child=Q,g.last=Q)}if(g.tail!==null)return v=g.tail,g.rendering=v,g.tail=v.sibling,g.renderingStartTime=y0(),v.sibling=null,k=d0.current,Dl(d0,V?k&1|2:k&1),v;return v2(v),null;case 22:case 23:return $v(),V=v.memoizedState!==null,f!==null&&f.memoizedState!==null!==V&&(v.flags|=8192),V&&(v.mode&1)!==0?(b2&1073741824)!==0&&(v2(v),v.subtreeFlags&6&&(v.flags|=8192)):v2(v),null;case 24:return null;case 25:return null}throw Error(z1(156,v.tag))}function eW(f,v){switch(xv(v),v.tag){case 1:return M2(v.type)&&xf(),f=v.flags,f&65536?(v.flags=f&-65537|128,v):null;case 3:return P6(),$l(H2),$l(o2),Mv(),f=v.flags,(f&65536)!==0&&(f&128)===0?(v.flags=f&-65537|128,v):null;case 5:return Hv(v),null;case 13:if($l(d0),f=v.memoizedState,f!==null&&f.dehydrated!==null){if(v.alternate===null)throw Error(z1(340));U6()}return f=v.flags,f&65536?(v.flags=f&-65537|128,v):null;case 19:return $l(d0),null;case 4:return P6(),null;case 10:return Yv(v.type._context),null;case 22:case 23:return $v(),null;case 24:return null;default:return null}}function E6(f,v){var k=f.ref;if(k!==null)if(typeof k==="function")try{k(null)}catch(V){o0(f,v,V)}else k.current=null}function pv(f,v,k){try{k()}catch(V){o0(f,v,V)}}function lL(f,v){if(Zg=Nf,f=Zw(),Fv(f)){if("selectionStart"in f)var k={start:f.selectionStart,end:f.selectionEnd};else l:{k=(k=f.ownerDocument)&&k.defaultView||window;var V=k.getSelection&&k.getSelection();if(V&&V.rangeCount!==0){k=V.anchorNode;var{anchorOffset:W,focusNode:g}=V;V=V.focusOffset;try{k.nodeType,g.nodeType}catch(I1){k=null;break l}var Q=0,b=-1,u1=-1,a1=0,U1=0,q1=f,F1=null;u:for(;;){for(var x1;;){if(q1!==k||W!==0&&q1.nodeType!==3||(b=Q+W),q1!==g||V!==0&&q1.nodeType!==3||(u1=Q+V),q1.nodeType===3&&(Q+=q1.nodeValue.length),(x1=q1.firstChild)===null)break;F1=q1,q1=x1}for(;;){if(q1===f)break u;if(F1===k&&++a1===W&&(b=Q),F1===g&&++U1===V&&(u1=Q),(x1=q1.nextSibling)!==null)break;q1=F1,F1=q1.parentNode}q1=x1}k=b===-1||u1===-1?null:{start:b,end:u1}}else k=null}k=k||{start:0,end:0}}else k=null;Dg={focusedElem:f,selectionRange:k},Nf=!1;for($1=v;$1!==null;)if(v=$1,f=v.child,(v.subtreeFlags&1028)!==0&&f!==null)f.return=v,$1=f;else for(;$1!==null;){v=$1;try{var J1=v.alternate;if((v.flags&1024)!==0)switch(v.tag){case 0:case 11:case 15:break;case 1:if(J1!==null){var{memoizedProps:X1,memoizedState:C1}=J1,g1=v.stateNode,f1=g1.getSnapshotBeforeUpdate(v.elementType===v.type?X1:zu(v.type,X1),C1);g1.__reactInternalSnapshotBeforeUpdate=f1}break;case 3:var o1=v.stateNode.containerInfo;o1.nodeType===1?o1.textContent="":o1.nodeType===9&&o1.documentElement&&o1.removeChild(o1.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z1(163))}}catch(I1){o0(v,v.return,I1)}if(f=v.sibling,f!==null){f.return=v.return,$1=f;break}$1=v.return}return J1=Xy,Xy=!1,J1}function D8(f,v,k){var V=v.updateQueue;if(V=V!==null?V.lastEffect:null,V!==null){var W=V=V.next;do{if((W.tag&f)===f){var g=W.destroy;W.destroy=void 0,g!==void 0&&pv(v,k,g)}W=W.next}while(W!==V)}}function tf(f,v){if(v=v.updateQueue,v=v!==null?v.lastEffect:null,v!==null){var k=v=v.next;do{if((k.tag&f)===f){var V=k.create;k.destroy=V()}k=k.next}while(k!==v)}}function fv(f){var v=f.ref;if(v!==null){var k=f.stateNode;switch(f.tag){case 5:f=k;break;default:f=k}typeof v==="function"?v(f):v.current=f}}function Hn(f){var v=f.alternate;v!==null&&(f.alternate=null,Hn(v)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(v=f.stateNode,v!==null&&(delete v[S5],delete v[u9],delete v[Xg],delete v[QW],delete v[HW])),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Mn(f){return f.tag===5||f.tag===3||f.tag===4}function Jy(f){l:for(;;){for(;f.sibling===null;){if(f.return===null||Mn(f.return))return null;f=f.return}f.sibling.return=f.return;for(f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2)continue l;if(f.child===null||f.tag===4)continue l;else f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function dv(f,v,k){var V=f.tag;if(V===5||V===6)f=f.stateNode,v?k.nodeType===8?k.parentNode.insertBefore(f,v):k.insertBefore(f,v):(k.nodeType===8?(v=k.parentNode,v.insertBefore(f,k)):(v=k,v.appendChild(f)),k=k._reactRootContainer,k!==null&&k!==void 0||v.onclick!==null||(v.onclick=Uf));else if(V!==4&&(f=f.child,f!==null))for(dv(f,v,k),f=f.sibling;f!==null;)dv(f,v,k),f=f.sibling}function mv(f,v,k){var V=f.tag;if(V===5||V===6)f=f.stateNode,v?k.insertBefore(f,v):k.appendChild(f);else if(V!==4&&(f=f.child,f!==null))for(mv(f,v,k),f=f.sibling;f!==null;)mv(f,v,k),f=f.sibling}function f4(f,v,k){for(k=k.child;k!==null;)Kn(f,v,k),k=k.sibling}function Kn(f,v,k){if(E5&&typeof E5.onCommitFiberUnmount==="function")try{E5.onCommitFiberUnmount(Gf,k)}catch(b){}switch(k.tag){case 5:a2||E6(k,v);case 6:var V=_0,W=Qu;_0=null,f4(f,v,k),_0=V,Qu=W,_0!==null&&(Qu?(f=_0,k=k.stateNode,f.nodeType===8?f.parentNode.removeChild(k):f.removeChild(k)):_0.removeChild(k.stateNode));break;case 18:_0!==null&&(Qu?(f=_0,k=k.stateNode,f.nodeType===8?gg(f.parentNode,k):f.nodeType===1&&gg(f,k),_8(f)):gg(_0,k.stateNode));break;case 4:V=_0,W=Qu,_0=k.stateNode.containerInfo,Qu=!0,f4(f,v,k),_0=V,Qu=W;break;case 0:case 11:case 14:case 15:if(!a2&&(V=k.updateQueue,V!==null&&(V=V.lastEffect,V!==null))){W=V=V.next;do{var g=W,Q=g.destroy;g=g.tag,Q!==void 0&&((g&2)!==0?pv(k,v,Q):(g&4)!==0&&pv(k,v,Q)),W=W.next}while(W!==V)}f4(f,v,k);break;case 1:if(!a2&&(E6(k,v),V=k.stateNode,typeof V.componentWillUnmount==="function"))try{V.props=k.memoizedProps,V.state=k.memoizedState,V.componentWillUnmount()}catch(b){o0(k,v,b)}f4(f,v,k);break;case 21:f4(f,v,k);break;case 22:k.mode&1?(a2=(V=a2)||k.memoizedState!==null,f4(f,v,k),a2=V):f4(f,v,k);break;default:f4(f,v,k)}}function jy(f){var v=f.updateQueue;if(v!==null){f.updateQueue=null;var k=f.stateNode;k===null&&(k=f.stateNode=new tW),v.forEach(function(V){var W=vL.bind(null,f,V);k.has(V)||(k.add(V),V.then(W,W))})}}function Bu(f,v){var k=v.deletions;if(k!==null)for(var V=0;V<k.length;V++){var W=k[V];try{var g=f,Q=v,b=Q;l:for(;b!==null;){switch(b.tag){case 5:_0=b.stateNode,Qu=!1;break l;case 3:_0=b.stateNode.containerInfo,Qu=!0;break l;case 4:_0=b.stateNode.containerInfo,Qu=!0;break l}b=b.return}if(_0===null)throw Error(z1(160));Kn(g,Q,W),_0=null,Qu=!1;var u1=W.alternate;u1!==null&&(u1.return=null),W.return=null}catch(a1){o0(W,v,a1)}}if(v.subtreeFlags&12854)for(v=v.child;v!==null;)On(v,f),v=v.sibling}function On(f,v){var{alternate:k,flags:V}=f;switch(f.tag){case 0:case 11:case 14:case 15:if(Bu(v,f),n5(f),V&4){try{D8(3,f,f.return),tf(3,f)}catch(X1){o0(f,f.return,X1)}try{D8(5,f,f.return)}catch(X1){o0(f,f.return,X1)}}break;case 1:Bu(v,f),n5(f),V&512&&k!==null&&E6(k,k.return);break;case 5:if(Bu(v,f),n5(f),V&512&&k!==null&&E6(k,k.return),f.flags&32){var W=f.stateNode;try{J8(W,"")}catch(X1){o0(f,f.return,X1)}}if(V&4&&(W=f.stateNode,W!=null)){var g=f.memoizedProps,Q=k!==null?k.memoizedProps:g,b=f.type,u1=f.updateQueue;if(f.updateQueue=null,u1!==null)try{b==="input"&&g.type==="radio"&&g.name!=null&&gw(W,g),xg(b,Q);var a1=xg(b,g);for(Q=0;Q<u1.length;Q+=2){var U1=u1[Q],q1=u1[Q+1];U1==="style"?yw(W,q1):U1==="dangerouslySetInnerHTML"?ow(W,q1):U1==="children"?J8(W,q1):wv(W,U1,q1,a1)}switch(b){case"input":Vg(W,g);break;case"textarea":vw(W,g);break;case"select":var F1=W._wrapperState.wasMultiple;W._wrapperState.wasMultiple=!!g.multiple;var x1=g.value;x1!=null?C6(W,!!g.multiple,x1,!1):F1!==!!g.multiple&&(g.defaultValue!=null?C6(W,!!g.multiple,g.defaultValue,!0):C6(W,!!g.multiple,g.multiple?[]:"",!1))}W[u9]=g}catch(X1){o0(f,f.return,X1)}}break;case 6:if(Bu(v,f),n5(f),V&4){if(f.stateNode===null)throw Error(z1(162));W=f.stateNode,g=f.memoizedProps;try{W.nodeValue=g}catch(X1){o0(f,f.return,X1)}}break;case 3:if(Bu(v,f),n5(f),V&4&&k!==null&&k.memoizedState.isDehydrated)try{_8(v.containerInfo)}catch(X1){o0(f,f.return,X1)}break;case 4:Bu(v,f),n5(f);break;case 13:Bu(v,f),n5(f),W=f.child,W.flags&8192&&(g=W.memoizedState!==null,W.stateNode.isHidden=g,!g||W.alternate!==null&&W.alternate.memoizedState!==null||(jv=y0())),V&4&&jy(f);break;case 22:if(U1=k!==null&&k.memoizedState!==null,f.mode&1?(a2=(a1=a2)||U1,Bu(v,f),a2=a1):Bu(v,f),n5(f),V&8192){if(a1=f.memoizedState!==null,(f.stateNode.isHidden=a1)&&!U1&&(f.mode&1)!==0)for($1=f,U1=f.child;U1!==null;){for(q1=$1=U1;$1!==null;){switch(F1=$1,x1=F1.child,F1.tag){case 0:case 11:case 14:case 15:D8(4,F1,F1.return);break;case 1:E6(F1,F1.return);var J1=F1.stateNode;if(typeof J1.componentWillUnmount==="function"){V=F1,k=F1.return;try{v=V,J1.props=v.memoizedProps,J1.state=v.memoizedState,J1.componentWillUnmount()}catch(X1){o0(V,k,X1)}}break;case 5:E6(F1,F1.return);break;case 22:if(F1.memoizedState!==null){$y(q1);continue}}x1!==null?(x1.return=F1,$1=x1):$y(q1)}U1=U1.sibling}l:for(U1=null,q1=f;;){if(q1.tag===5){if(U1===null){U1=q1;try{W=q1.stateNode,a1?(g=W.style,typeof g.setProperty==="function"?g.setProperty("display","none","important"):g.display="none"):(b=q1.stateNode,u1=q1.memoizedProps.style,Q=u1!==void 0&&u1!==null&&u1.hasOwnProperty("display")?u1.display:null,b.style.display=hw("display",Q))}catch(X1){o0(f,f.return,X1)}}}else if(q1.tag===6){if(U1===null)try{q1.stateNode.nodeValue=a1?"":q1.memoizedProps}catch(X1){o0(f,f.return,X1)}}else if((q1.tag!==22&&q1.tag!==23||q1.memoizedState===null||q1===f)&&q1.child!==null){q1.child.return=q1,q1=q1.child;continue}if(q1===f)break l;for(;q1.sibling===null;){if(q1.return===null||q1.return===f)break l;U1===q1&&(U1=null),q1=q1.return}U1===q1&&(U1=null),q1.sibling.return=q1.return,q1=q1.sibling}}break;case 19:Bu(v,f),n5(f),V&4&&jy(f);break;case 21:break;default:Bu(v,f),n5(f)}}function n5(f){var v=f.flags;if(v&2){try{l:{for(var k=f.return;k!==null;){if(Mn(k)){var V=k;break l}k=k.return}throw Error(z1(160))}switch(V.tag){case 5:var W=V.stateNode;V.flags&32&&(J8(W,""),V.flags&=-33);var g=Jy(f);mv(f,g,W);break;case 3:case 4:var Q=V.stateNode.containerInfo,b=Jy(f);dv(f,b,Q);break;default:throw Error(z1(161))}}catch(u1){o0(f,f.return,u1)}f.flags&=-3}v&4096&&(f.flags&=-4097)}function uL(f,v,k){$1=f,Zn(f,v,k)}function Zn(f,v,k){for(var V=(f.mode&1)!==0;$1!==null;){var W=$1,g=W.child;if(W.tag===22&&V){var Q=W.memoizedState!==null||mf;if(!Q){var b=W.alternate,u1=b!==null&&b.memoizedState!==null||a2;b=mf;var a1=a2;if(mf=Q,(a2=u1)&&!a1)for($1=W;$1!==null;)Q=$1,u1=Q.child,Q.tag===22&&Q.memoizedState!==null?_y(W):u1!==null?(u1.return=Q,$1=u1):_y(W);for(;g!==null;)$1=g,Zn(g,v,k),g=g.sibling;$1=W,mf=b,a2=a1}by(f,v,k)}else(W.subtreeFlags&8772)!==0&&g!==null?(g.return=W,$1=g):by(f,v,k)}}function by(f){for(;$1!==null;){var v=$1;if((v.flags&8772)!==0){var k=v.alternate;try{if((v.flags&8772)!==0)switch(v.tag){case 0:case 11:case 15:a2||tf(5,v);break;case 1:var V=v.stateNode;if(v.flags&4&&!a2)if(k===null)V.componentDidMount();else{var W=v.elementType===v.type?k.memoizedProps:zu(v.type,k.memoizedProps);V.componentDidUpdate(W,k.memoizedState,V.__reactInternalSnapshotBeforeUpdate)}var g=v.updateQueue;g!==null&&Iy(v,g,V);break;case 3:var Q=v.updateQueue;if(Q!==null){if(k=null,v.child!==null)switch(v.child.tag){case 5:k=v.child.stateNode;break;case 1:k=v.child.stateNode}Iy(v,Q,k)}break;case 5:var b=v.stateNode;if(k===null&&v.flags&4){k=b;var u1=v.memoizedProps;switch(v.type){case"button":case"input":case"select":case"textarea":u1.autoFocus&&k.focus();break;case"img":u1.src&&(k.src=u1.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(v.memoizedState===null){var a1=v.alternate;if(a1!==null){var U1=a1.memoizedState;if(U1!==null){var q1=U1.dehydrated;q1!==null&&_8(q1)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z1(163))}a2||v.flags&512&&fv(v)}catch(F1){o0(v,v.return,F1)}}if(v===f){$1=null;break}if(k=v.sibling,k!==null){k.return=v.return,$1=k;break}$1=v.return}}function $y(f){for(;$1!==null;){var v=$1;if(v===f){$1=null;break}var k=v.sibling;if(k!==null){k.return=v.return,$1=k;break}$1=v.return}}function _y(f){for(;$1!==null;){var v=$1;try{switch(v.tag){case 0:case 11:case 15:var k=v.return;try{tf(4,v)}catch(u1){o0(v,k,u1)}break;case 1:var V=v.stateNode;if(typeof V.componentDidMount==="function"){var W=v.return;try{V.componentDidMount()}catch(u1){o0(v,W,u1)}}var g=v.return;try{fv(v)}catch(u1){o0(v,g,u1)}break;case 5:var Q=v.return;try{fv(v)}catch(u1){o0(v,Q,u1)}}}catch(u1){o0(v,v.return,u1)}if(v===f){$1=null;break}var b=v.sibling;if(b!==null){b.return=v.return,$1=b;break}$1=v.return}}function V2(){return(Cl&6)!==0?y0():Sf!==-1?Sf:Sf=y0()}function E4(f){if((f.mode&1)===0)return 1;if((Cl&2)!==0&&i0!==0)return i0&-i0;if(KW.transition!==null)return Ef===0&&(Ef=Nw()),Ef;if(f=Il,f!==0)return f;return f=window.event,f=f===void 0?16:Iw(f.type),f}function Ku(f,v,k,V){if(50<G8)throw G8=0,vv=null,Error(z1(185));if(g9(f,k,V),(Cl&2)===0||f!==K0)f===K0&&((Cl&2)===0&&(ld|=k),U0===4&&v4(f,i0)),K2(f,V),k===1&&Cl===0&&(v.mode&1)===0&&(I6=y0()+500,$f&&V4())}function K2(f,v){var k=f.callbackNode;ZC(f,v);var V=Vf(f,f===K0?i0:0);if(V===0)k!==null&&dy(k),f.callbackNode=null,f.callbackPriority=0;else if(v=V&-V,f.callbackPriority!==v){if(k!=null&&dy(k),v===1)f.tag===0?MW(iy.bind(null,f)):iw(iy.bind(null,f)),BW(function(){(Cl&6)===0&&V4()}),k=null;else{switch(qw(V)){case 1:k=sv;break;case 4:k=Aw;break;case 16:k=Af;break;case 536870912:k=Vw;break;default:k=Af}k=$n(k,Dn.bind(null,f))}f.callbackPriority=v,f.callbackNode=k}}function Dn(f,v){if(Sf=-1,Ef=0,(Cl&6)!==0)throw Error(z1(327));var k=f.callbackNode;if(N6()&&f.callbackNode!==k)return null;var V=Vf(f,f===K0?i0:0);if(V===0)return null;if((V&30)!==0||(V&f.expiredLanes)!==0||v)v=Df(f,V);else{v=V;var W=Cl;Cl|=2;var g=Gn();if(K0!==f||i0!==v)c3=null,I6=y0()+500,Qc(f,v);do try{fL();break}catch(b){Tn(f,b)}while(1);Iv(),Kf.current=g,Cl=W,W0!==null?v=0:(K0=null,i0=0,v=U0)}if(v!==0){if(v===2&&(W=Bg(f),W!==0&&(V=W,v=av(f,W))),v===1)throw k=m9,Qc(f,0),v4(f,V),K2(f,y0()),k;if(v===6)v4(f,V);else{if(W=f.current.alternate,(V&30)===0&&!rL(W)&&(v=Df(f,V),v===2&&(g=Bg(f),g!==0&&(V=g,v=av(f,g))),v===1))throw k=m9,Qc(f,0),v4(f,V),K2(f,y0()),k;switch(f.finishedWork=W,f.finishedLanes=V,v){case 0:case 1:throw Error(z1(345));case 2:Ic(f,z2,c3);break;case 3:if(v4(f,V),(V&130023424)===V&&(v=jv+500-y0(),10<v)){if(Vf(f,0)!==0)break;if(W=f.suspendedLanes,(W&V)!==V){V2(),f.pingedLanes|=f.suspendedLanes&W;break}f.timeoutHandle=Gg(Ic.bind(null,f,z2,c3),v);break}Ic(f,z2,c3);break;case 4:if(v4(f,V),(V&4194240)===V)break;v=f.eventTimes;for(W=-1;0<V;){var Q=31-Mu(V);g=1<W&&(W=Q),V&=~g}if(V=W,V=y0()-V,V=(120>V?120:480>V?480:1080>V?1080:1920>V?1920:3000>V?3000:4320>V?4320:1960*cL(V/1960))-V,10<V){f.timeoutHandle=Gg(Ic.bind(null,f,z2,c3),V);break}Ic(f,z2,c3);break;case 5:Ic(f,z2,c3);break;default:throw Error(z1(329))}}}return K2(f,y0()),f.callbackNode===k?Dn.bind(null,f):null}function av(f,v){var k=T8;return f.current.memoizedState.isDehydrated&&(Qc(f,v).flags|=256),f=Df(f,v),f!==2&&(v=z2,z2=k,v!==null&&ov(v)),f}function ov(f){z2===null?z2=f:z2.push.apply(z2,f)}function rL(f){for(var v=f;;){if(v.flags&16384){var k=v.updateQueue;if(k!==null&&(k=k.stores,k!==null))for(var V=0;V<k.length;V++){var W=k[V],g=W.getSnapshot;W=W.value;try{if(!Ou(g(),W))return!1}catch(Q){return!1}}}if(k=v.child,v.subtreeFlags&16384&&k!==null)k.return=v,v=k;else{if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function v4(f,v){v&=~Jv,v&=~ld,f.suspendedLanes|=v,f.pingedLanes&=~v;for(f=f.expirationTimes;0<v;){var k=31-Mu(v),V=1<<k;f[k]=-1,v&=~V}}function iy(f){if((Cl&6)!==0)throw Error(z1(327));N6();var v=Vf(f,0);if((v&1)===0)return K2(f,y0()),null;var k=Df(f,v);if(f.tag!==0&&k===2){var V=Bg(f);V!==0&&(v=V,k=av(f,V))}if(k===1)throw k=m9,Qc(f,0),v4(f,v),K2(f,y0()),k;if(k===6)throw Error(z1(345));return f.finishedWork=f.current.alternate,f.finishedLanes=v,Ic(f,z2,c3),K2(f,y0()),null}function bv(f,v){var k=Cl;Cl|=1;try{return f(v)}finally{Cl=k,Cl===0&&(I6=y0()+500,$f&&V4())}}function Dc(f){o4!==null&&o4.tag===0&&(Cl&6)===0&&N6();var v=Cl;Cl|=1;var k=ku.transition,V=Il;try{if(ku.transition=null,Il=1,f)return f()}finally{Il=V,ku.transition=k,Cl=v,(Cl&6)===0&&V4()}}function $v(){b2=s6.current,$l(s6)}function Qc(f,v){f.finishedWork=null,f.finishedLanes=0;var k=f.timeoutHandle;if(k!==-1&&(f.timeoutHandle=-1,YW(k)),W0!==null)for(k=W0.return;k!==null;){var V=k;switch(xv(V),V.tag){case 1:V=V.type.childContextTypes,V!==null&&V!==void 0&&xf();break;case 3:P6(),$l(H2),$l(o2),Mv();break;case 5:Hv(V);break;case 4:P6();break;case 13:$l(d0);break;case 19:$l(d0);break;case 10:Yv(V.type._context);break;case 22:case 23:$v()}k=k.return}if(K0=f,W0=f=s4(f.current,null),i0=b2=v,U0=0,m9=null,Jv=ld=Zc=0,z2=T8=null,Bc!==null){for(v=0;v<Bc.length;v++)if(k=Bc[v],V=k.interleaved,V!==null){k.interleaved=null;var W=V.next,g=k.pending;if(g!==null){var Q=g.next;g.next=W,V.next=Q}k.pending=V}Bc=null}return f}function Tn(f,v){do{var k=W0;try{if(Iv(),wf.current=Mf,Hf){for(var V=m0.memoizedState;V!==null;){var W=V.queue;W!==null&&(W.pending=null),V=V.next}Hf=!1}if(Oc=0,M0=F0=m0=null,Z8=!1,p9=0,Xv.current=null,k===null||k.return===null){U0=1,m9=v,W0=null;break}l:{var g=f,Q=k.return,b=k,u1=v;if(v=i0,b.flags|=32768,u1!==null&&typeof u1==="object"&&typeof u1.then==="function"){var a1=u1,U1=b,q1=U1.tag;if((U1.mode&1)===0&&(q1===0||q1===11||q1===15)){var F1=U1.alternate;F1?(U1.updateQueue=F1.updateQueue,U1.memoizedState=F1.memoizedState,U1.lanes=F1.lanes):(U1.updateQueue=null,U1.memoizedState=null)}var x1=My(Q);if(x1!==null){x1.flags&=-257,Ky(x1,Q,b,g,v),x1.mode&1&&Hy(g,a1,v),v=x1,u1=a1;var J1=v.updateQueue;if(J1===null){var X1=new Set;X1.add(u1),v.updateQueue=X1}else J1.add(u1);break l}else{if((v&1)===0){Hy(g,a1,v),_v();break l}u1=Error(z1(426))}}else if(el&&b.mode&1){var C1=My(Q);if(C1!==null){(C1.flags&65536)===0&&(C1.flags|=256),Ky(C1,Q,b,g,v),Pv(R6(u1,b));break l}}g=u1=R6(u1,b),U0!==4&&(U0=2),T8===null?T8=[g]:T8.push(g),g=Q;do{switch(g.tag){case 3:g.flags|=65536,v&=-v,g.lanes|=v;var g1=qn(g,u1,v);Ry(g,g1);break l;case 1:b=u1;var{type:f1,stateNode:o1}=g;if((g.flags&128)===0&&(typeof f1.getDerivedStateFromError==="function"||o1!==null&&typeof o1.componentDidCatch==="function"&&(S4===null||!S4.has(o1)))){g.flags|=65536,v&=-v,g.lanes|=v;var I1=Fn(g,b,v);Ry(g,I1);break l}}g=g.return}while(g!==null)}Jn(k)}catch(b1){v=b1,W0===k&&k!==null&&(W0=k=k.return);continue}break}while(1)}function Gn(){var f=Kf.current;return Kf.current=Mf,f===null?Mf:f}function _v(){if(U0===0||U0===3||U0===2)U0=4;K0===null||(Zc&268435455)===0&&(ld&268435455)===0||v4(K0,i0)}function Df(f,v){var k=Cl;Cl|=2;var V=Gn();if(K0!==f||i0!==v)c3=null,Qc(f,v);do try{pL();break}catch(W){Tn(f,W)}while(1);if(Iv(),Cl=k,Kf.current=V,W0!==null)throw Error(z1(261));return K0=null,i0=0,U0}function pL(){for(;W0!==null;)Xn(W0)}function fL(){for(;W0!==null&&!IC();)Xn(W0)}function Xn(f){var v=bn(f.alternate,f,b2);f.memoizedProps=f.pendingProps,v===null?Jn(f):W0=v,Xv.current=null}function Jn(f){var v=f;do{var k=v.alternate;if(f=v.return,(v.flags&32768)===0){if(k=iW(k,v,b2),k!==null){W0=k;return}}else{if(k=eW(k,v),k!==null){k.flags&=32767,W0=k;return}if(f!==null)f.flags|=32768,f.subtreeFlags=0,f.deletions=null;else{U0=6,W0=null;return}}if(v=v.sibling,v!==null){W0=v;return}W0=v=f}while(v!==null);U0===0&&(U0=5)}function Ic(f,v,k){var V=Il,W=ku.transition;try{ku.transition=null,Il=1,dL(f,v,k,V)}finally{ku.transition=W,Il=V}return null}function dL(f,v,k,V){do N6();while(o4!==null);if((Cl&6)!==0)throw Error(z1(327));k=f.finishedWork;var W=f.finishedLanes;if(k===null)return null;if(f.finishedWork=null,f.finishedLanes=0,k===f.current)throw Error(z1(177));f.callbackNode=null,f.callbackPriority=0;var g=k.lanes|k.childLanes;if(DC(f,g),f===K0&&(W0=K0=null,i0=0),(k.subtreeFlags&2064)===0&&(k.flags&2064)===0||gf||(gf=!0,$n(Af,function(){return N6(),null})),g=(k.flags&15990)!==0,(k.subtreeFlags&15990)!==0||g){g=ku.transition,ku.transition=null;var Q=Il;Il=1;var b=Cl;Cl|=4,Xv.current=null,lL(f,k),On(k,f),UW(Dg),Nf=!!Zg,Dg=Zg=null,f.current=k,uL(k,f,W),YC(),Cl=b,Il=Q,ku.transition=g}else f.current=k;if(gf&&(gf=!1,o4=f,Zf=W),g=f.pendingLanes,g===0&&(S4=null),QC(k.stateNode,V),K2(f,y0()),v!==null)for(V=f.onRecoverableError,k=0;kf?16:f,o4===null)var V=!1;else{if(f=o4,o4=null,Zf=0,(Cl&6)!==0)throw Error(z1(331));var W=Cl;Cl|=4;for($1=f.current;$1!==null;){var g=$1,Q=g.child;if(($1.flags&16)!==0){var b=g.deletions;if(b!==null){for(var u1=0;u1y0()-jv?Qc(f,0):Jv|=k),K2(f,v)}function jn(f,v){v===0&&((f.mode&1)===0?v=1:(v=ep,ep<<=1,(ep&130023424)===0&&(ep=4194304)));var k=V2();f=v3(f,v),f!==null&&(g9(f,v,k),K2(f,k))}function gL(f){var v=f.memoizedState,k=0;v!==null&&(k=v.retryLane),jn(f,k)}function vL(f,v){var k=0;switch(f.tag){case 13:var{stateNode:V,memoizedState:W}=f;W!==null&&(k=W.retryLane);break;case 19:V=f.stateNode;break;default:throw Error(z1(314))}V!==null&&V.delete(v),jn(f,k)}function $n(f,v){return Lw(f,v)}function aL(f,v,k,V){this.tag=f,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=v,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=V,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nu(f,v,k,V){return new aL(f,v,k,V)}function iv(f){return f=f.prototype,!(!f||!f.isReactComponent)}function oL(f){if(typeof f==="function")return iv(f)?1:0;if(f!==void 0&&f!==null){if(f=f.$$typeof,f===kv)return 11;if(f===Sv)return 14}return 2}function s4(f,v){var k=f.alternate;return k===null?(k=nu(f.tag,v,f.key,f.mode),k.elementType=f.elementType,k.type=f.type,k.stateNode=f.stateNode,k.alternate=f,f.alternate=k):(k.pendingProps=v,k.type=f.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=f.flags&14680064,k.childLanes=f.childLanes,k.lanes=f.lanes,k.child=f.child,k.memoizedProps=f.memoizedProps,k.memoizedState=f.memoizedState,k.updateQueue=f.updateQueue,v=f.dependencies,k.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},k.sibling=f.sibling,k.index=f.index,k.ref=f.ref,k}function sf(f,v,k,V,W,g){var Q=2;if(V=f,typeof f==="function")iv(f)&&(Q=1);else if(typeof f==="string")Q=5;else l:switch(f){case v6:return Hc(k.children,W,g,v);case nv:Q=8,W|=8;break;case sg:return f=nu(12,k,v,W|2),f.elementType=sg,f.lanes=g,f;case Cg:return f=nu(13,k,v,W),f.elementType=Cg,f.lanes=g,f;case Wg:return f=nu(19,k,v,W),f.elementType=Wg,f.lanes=g,f;case fw:return ud(k,W,g,v);default:if(typeof f==="object"&&f!==null)switch(f.$$typeof){case rw:Q=10;break l;case pw:Q=9;break l;case kv:Q=11;break l;case Sv:Q=14;break l;case d4:Q=16,V=null;break l}throw Error(z1(130,f==null?f:typeof f,""))}return v=nu(Q,k,v,W),v.elementType=f,v.type=V,v.lanes=g,v}function Hc(f,v,k,V){return f=nu(7,f,V,v),f.lanes=k,f}function ud(f,v,k,V){return f=nu(22,f,V,v),f.elementType=fw,f.lanes=k,f.stateNode={isHidden:!1},f}function kg(f,v,k){return f=nu(6,f,null,v),f.lanes=k,f}function Sg(f,v,k){return v=nu(4,f.children!==null?f.children:[],f.key,v),v.lanes=k,v.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},v}function hL(f,v,k,V,W){this.tag=v,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ug(0),this.expirationTimes=ug(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ug(0),this.identifierPrefix=V,this.onRecoverableError=W,this.mutableSourceEagerHydrationData=null}function ev(f,v,k,V,W,g,Q,b,u1){return f=new hL(f,v,k,b,u1),v===1?(v=1,g===!0&&(v|=8)):v=0,g=nu(3,null,null,v),f.current=g,g.stateNode=f,g.memoizedState={element:V,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},zv(g),f}function yL(f,v,k){var V=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g6,key:V==null?null:""+V,children:f,containerInfo:v,implementation:k}}function _n(f){if(!f)return W4;f=f._reactInternals;l:{if(Gc(f)!==f||f.tag!==1)throw Error(z1(170));var v=f;do{switch(v.tag){case 3:v=v.stateNode.context;break l;case 1:if(M2(v.type)){v=v.stateNode.__reactInternalMemoizedMergedChildContext;break l}}v=v.return}while(v!==null);throw Error(z1(171))}if(f.tag===1){var k=f.type;if(M2(k))return _w(f,k,v)}return v}function en(f,v,k,V,W,g,Q,b,u1){return f=ev(k,V,!0,f,W,g,Q,b,u1),f.context=_n(null),k=f.current,V=V2(),W=E4(k),g=d3(V,W),g.callback=v!==void 0&&v!==null?v:null,k4(k,g,W),f.current.lanes=W,g9(f,W,V),K2(f,V),f}function cd(f,v,k,V){var W=v.current,g=V2(),Q=E4(W);return k=_n(k),v.context===null?v.context=k:v.pendingContext=k,v=d3(g,Q),v.payload={element:f},V=V===void 0?null:V,V!==null&&(v.callback=V),f=k4(W,v,Q),f!==null&&(Ku(f,W,Q,g),yf(f,W,Q)),Q}function Tf(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return f.child.stateNode;default:return f.child.stateNode}}function ty(f,v){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var k=f.retryLane;f.retryLane=k!==0&&k<v?k:v}}function tv(f,v){ty(f,v),(f=f.alternate)&&ty(f,v)}function wL(){return null}function la(f){this._internalRoot=f}function rd(f){this._internalRoot=f}function ua(f){return!(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)}function pd(f){return!(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11&&(f.nodeType!==8||f.nodeValue!==" react-mount-point-unstable "))}function lw(){}function nL(f,v,k,V,W){if(W){if(typeof V==="function"){var g=V;V=function(){var a1=Tf(Q);g.call(a1)}}var Q=en(v,V,f,0,null,!1,!1,"",lw);return f._reactRootContainer=Q,f[g3]=Q.current,t8(f.nodeType===8?f.parentNode:f),Dc(),Q}for(;W=f.lastChild;)f.removeChild(W);if(typeof V==="function"){var b=V;V=function(){var a1=Tf(u1);b.call(a1)}}var u1=ev(f,0,!1,null,null,!1,!1,"",lw);return f._reactRootContainer=u1,f[g3]=u1.current,t8(f.nodeType===8?f.parentNode:f),Dc(function(){cd(v,u1,k,V)}),u1}function fd(f,v,k,V,W){var g=k._reactRootContainer;if(g){var Q=g;if(typeof W==="function"){var b=W;W=function(){var u1=Tf(Q);b.call(u1)}}cd(v,Q,f,W)}else Q=nL(k,v,f,W,V);return Tf(Q)}var uw,tl,cw,X8,m3,Eg,EC,ih,eh,e0,hv,o3,bp,g6,v6,nv,sg,rw,pw,kv,Cg,Wg,Sv,d4,fw,th,g0,im,em=!1,x8,_p,ow,Q8,NC,qC,Pg=null,Rg=null,W6=null,L6=null,lg=!1,Ig=!1,Pc,H8=!1,Wf=null,Lf=!1,Yg=null,UC,Lw,dy,IC,YC,y0,BC,sv,Aw,Af,zC,Vw,Gf=null,E5=null,Mu,HC,MC,ip=64,ep=4194304,Il=0,Fw,Wv,Uw,xw,Pw,zg=!1,tp,h4=null,y4=null,w4=null,b8,$8,g4,TC,A6,Nf=!0,qf=null,a4=null,Av=null,af=null,Y6,Vv,v9,bC,cg,rg,V8,Xf,ay,$C,_C,iC,pg,eC,tC,lW,uW,cW,oy,rW,pW,fW,mW,gW,vW,hy,aW,oW,hW,yW,wW,nW,kW,qv,M8=null,SW,Bw,yy,wy=!1,a6=!1,CW,K8=null,i8=null,Mw=!1,R8,I8,hf,Ou,xW,o6=null,Hg=null,O8=null,Mg=!1,h6,fg,Dw,Tw,Gw,Xw,Jw,jw,Cy,B8,Kg,Og,Y8,z8,PW,cf,RW,IW,Zg=null,Dg=null,Gg,YW,Vy,BW,B6,S5,u9,g3,Xg,QW,HW,Jg,w6=-1,W4,o2,H2,Mc,r3=null,$f=!1,vg=!1,n6,k6=0,Rf=null,If=0,yu,wu=0,Kc=null,p3=1,f3="",_2=null,$2=null,el=!1,Hu=null,KW,x6,cn,Yf,Bf=null,S6=null,Rv=null,Bc=null,m4=!1,o9,s5,c9,r9,d0,ag,wf,og,Oc=0,m0=null,F0=null,M0=null,Hf=!1,Z8=!1,p9=0,OW=0,Mf,GW,XW,JW,ef,jW,bW,Q2=!1,uv,Bn,rv,zn,Qn,mf=!1,a2=!1,tW,$1=null,Xy=!1,_0=null,Qu=!1,cL,Kf,Xv,ku,Cl=0,K0=null,W0=null,i0=0,b2=0,s6,U0=0,m9=null,Zc=0,ld=0,Jv=0,T8=null,z2=null,jv=0,I6=1/0,c3=null,Of=!1,gv=null,S4=null,gf=!1,o4=null,Zf=0,G8=0,vv=null,Sf=-1,Ef=0,bn,tn,kL,F8,SL,m6,lk,uk=function(f,v){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ua(v))throw Error(z1(200));return yL(f,v,null,k)},ck=function(f,v){if(!ua(f))throw Error(z1(299));var k=!1,V="",W=tn;return v!==null&&v!==void 0&&(v.unstable_strictMode===!0&&(k=!0),v.identifierPrefix!==void 0&&(V=v.identifierPrefix),v.onRecoverableError!==void 0&&(W=v.onRecoverableError)),v=ev(f,1,!1,null,null,k,!1,V,W),f[g3]=v.current,t8(f.nodeType===8?f.parentNode:f),new la(v)},rk=function(f){if(f==null)return null;if(f.nodeType===1)return f;var v=f._reactInternals;if(v===void 0){if(typeof f.render==="function")throw Error(z1(188));throw f=Object.keys(f).join(","),Error(z1(268,f))}return f=Cw(v),f=f===null?null:f.stateNode,f},pk=function(f){return Dc(f)},fk=function(f,v,k){if(!pd(v))throw Error(z1(200));return fd(null,f,v,!0,k)},dk=function(f,v,k){if(!ua(f))throw Error(z1(405));var V=k!=null&&k.hydratedSources||null,W=!1,g="",Q=tn;if(k!==null&&k!==void 0&&(k.unstable_strictMode===!0&&(W=!0),k.identifierPrefix!==void 0&&(g=k.identifierPrefix),k.onRecoverableError!==void 0&&(Q=k.onRecoverableError)),v=en(v,null,f,1,k!=null?k:null,W,!1,g,Q),f[g3]=v.current,t8(f),V)for(f=0;f{uw=r4(S8(),1),tl=r4(_h(),1);cw=new Set,X8={};m3=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eg=Object.prototype.hasOwnProperty,EC=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ih={},eh={};e0={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(f){e0[f]=new N2(f,0,!1,f,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(f){var v=f[0];e0[v]=new N2(v,1,!1,f[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(f){e0[f]=new N2(f,2,!1,f.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(f){e0[f]=new N2(f,2,!1,f,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(f){e0[f]=new N2(f,3,!1,f.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(f){e0[f]=new N2(f,3,!0,f,null,!1,!1)});["capture","download"].forEach(function(f){e0[f]=new N2(f,4,!1,f,null,!1,!1)});["cols","rows","size","span"].forEach(function(f){e0[f]=new N2(f,6,!1,f,null,!1,!1)});["rowSpan","start"].forEach(function(f){e0[f]=new N2(f,5,!1,f.toLowerCase(),null,!1,!1)});hv=/[\-:]([a-z])/g;"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(f){var v=f.replace(hv,yv);e0[v]=new N2(v,1,!1,f,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(f){var v=f.replace(hv,yv);e0[v]=new N2(v,1,!1,f,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(f){var v=f.replace(hv,yv);e0[v]=new N2(v,1,!1,f,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(f){e0[f]=new N2(f,1,!1,f.toLowerCase(),null,!1,!1)});e0.xlinkHref=new N2("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(f){e0[f]=new N2(f,1,!1,f.toLowerCase(),null,!0,!0)});o3=uw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,bp=Symbol.for("react.element"),g6=Symbol.for("react.portal"),v6=Symbol.for("react.fragment"),nv=Symbol.for("react.strict_mode"),sg=Symbol.for("react.profiler"),rw=Symbol.for("react.provider"),pw=Symbol.for("react.context"),kv=Symbol.for("react.forward_ref"),Cg=Symbol.for("react.suspense"),Wg=Symbol.for("react.suspense_list"),Sv=Symbol.for("react.memo"),d4=Symbol.for("react.lazy"),fw=Symbol.for("react.offscreen"),th=Symbol.iterator;g0=Object.assign;x8=Array.isArray;ow=function(f){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(v,k,V,W){MSApp.execUnsafeLocalFunction(function(){return f(v,k,V,W)})}:f}(function(f,v){if(f.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in f)f.innerHTML=v;else{_p=_p||document.createElement("div"),_p.innerHTML=""+v.valueOf().toString()+"";for(v=_p.firstChild;f.firstChild;)f.removeChild(f.firstChild);for(;v.firstChild;)f.appendChild(v.firstChild)}});Q8={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},NC=["Webkit","ms","Moz","O"];Object.keys(Q8).forEach(function(f){NC.forEach(function(v){v=v+f.charAt(0).toUpperCase()+f.substring(1),Q8[v]=Q8[f]})});qC=g0({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});if(m3)try{Pc={},Object.defineProperty(Pc,"passive",{get:function(){Ig=!0}}),window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch(f){Ig=!1}UC={onError:function(f){H8=!0,Wf=f}};Lw=tl.unstable_scheduleCallback,dy=tl.unstable_cancelCallback,IC=tl.unstable_shouldYield,YC=tl.unstable_requestPaint,y0=tl.unstable_now,BC=tl.unstable_getCurrentPriorityLevel,sv=tl.unstable_ImmediatePriority,Aw=tl.unstable_UserBlockingPriority,Af=tl.unstable_NormalPriority,zC=tl.unstable_LowPriority,Vw=tl.unstable_IdlePriority;Mu=Math.clz32?Math.clz32:KC,HC=Math.log,MC=Math.LN2;tp=[],b8=new Map,$8=new Map,g4=[],TC="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");A6=o3.ReactCurrentBatchConfig;Y6={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(f){return f.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vv=i2(Y6),v9=g0({},Y6,{view:0,detail:0}),bC=i2(v9),Xf=g0({},v9,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nv,button:0,buttons:0,relatedTarget:function(f){return f.relatedTarget===void 0?f.fromElement===f.srcElement?f.toElement:f.fromElement:f.relatedTarget},movementX:function(f){if("movementX"in f)return f.movementX;return f!==V8&&(V8&&f.type==="mousemove"?(cg=f.screenX-V8.screenX,rg=f.screenY-V8.screenY):rg=cg=0,V8=f),cg},movementY:function(f){return"movementY"in f?f.movementY:rg}}),ay=i2(Xf),$C=g0({},Xf,{dataTransfer:0}),_C=i2($C),iC=g0({},v9,{relatedTarget:0}),pg=i2(iC),eC=g0({},Y6,{animationName:0,elapsedTime:0,pseudoElement:0}),tC=i2(eC),lW=g0({},Y6,{clipboardData:function(f){return"clipboardData"in f?f.clipboardData:window.clipboardData}}),uW=i2(lW),cW=g0({},Y6,{data:0}),oy=i2(cW),rW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pW={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};mW=g0({},v9,{key:function(f){if(f.key){var v=rW[f.key]||f.key;if(v!=="Unidentified")return v}return f.type==="keypress"?(f=of(f),f===13?"Enter":String.fromCharCode(f)):f.type==="keydown"||f.type==="keyup"?pW[f.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nv,charCode:function(f){return f.type==="keypress"?of(f):0},keyCode:function(f){return f.type==="keydown"||f.type==="keyup"?f.keyCode:0},which:function(f){return f.type==="keypress"?of(f):f.type==="keydown"||f.type==="keyup"?f.keyCode:0}}),gW=i2(mW),vW=g0({},Xf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hy=i2(vW),aW=g0({},v9,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nv}),oW=i2(aW),hW=g0({},Y6,{propertyName:0,elapsedTime:0,pseudoElement:0}),yW=i2(hW),wW=g0({},Xf,{deltaX:function(f){return"deltaX"in f?f.deltaX:("wheelDeltaX"in f)?-f.wheelDeltaX:0},deltaY:function(f){return"deltaY"in f?f.deltaY:("wheelDeltaY"in f)?-f.wheelDeltaY:("wheelDelta"in f)?-f.wheelDelta:0},deltaZ:0,deltaMode:0}),nW=i2(wW),kW=[9,13,27,32],qv=m3&&"CompositionEvent"in window;m3&&"documentMode"in document&&(M8=document.documentMode);SW=m3&&"TextEvent"in window&&!M8,Bw=m3&&(!qv||M8&&8=M8),yy=String.fromCharCode(32);CW={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};if(m3){if(m3){if(I8="oninput"in document,!I8)hf=document.createElement("div"),hf.setAttribute("oninput","return;"),I8=typeof hf.oninput==="function";R8=I8}else R8=!1;Mw=R8&&(!document.documentMode||9=document.documentMode;h6={animationend:uf("Animation","AnimationEnd"),animationiteration:uf("Animation","AnimationIteration"),animationstart:uf("Animation","AnimationStart"),transitionend:uf("Transition","TransitionEnd")},fg={},Dw={};m3&&(Dw=document.createElement("div").style,("AnimationEvent"in window)||(delete h6.animationend.animation,delete h6.animationiteration.animation,delete h6.animationstart.animation),("TransitionEvent"in window)||delete h6.transitionend.transition);Tw=jf("animationend"),Gw=jf("animationiteration"),Xw=jf("animationstart"),Jw=jf("transitionend"),jw=new Map,Cy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");for(Y8=0;Y8<Cy.length;Y8++)B8=Cy[Y8],Kg=B8.toLowerCase(),Og=B8[0].toUpperCase()+B8.slice(1),L4(Kg,"on"+Og);L4(Tw,"onAnimationEnd");L4(Gw,"onAnimationIteration");L4(Xw,"onAnimationStart");L4("dblclick","onDoubleClick");L4("focusin","onFocus");L4("focusout","onBlur");L4(Jw,"onTransitionEnd");q6("onMouseEnter",["mouseout","mouseover"]);q6("onMouseLeave",["mouseout","mouseover"]);q6("onPointerEnter",["pointerout","pointerover"]);q6("onPointerLeave",["pointerout","pointerover"]);Tc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Tc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Tc("onBeforeInput",["compositionend","keypress","textInput","paste"]);Tc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Tc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Tc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));z8="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),PW=new Set("cancel close invalid load scroll toggle".split(" ").concat(z8));cf="_reactListening"+Math.random().toString(36).slice(2);RW=/\r\n?/g,IW=/\u0000|\uFFFD/g;Gg=typeof setTimeout==="function"?setTimeout:void 0,YW=typeof clearTimeout==="function"?clearTimeout:void 0,Vy=typeof Promise==="function"?Promise:void 0,BW=typeof queueMicrotask==="function"?queueMicrotask:typeof Vy<"u"?function(f){return Vy.resolve(null).then(f).catch(zW)}:Gg;B6=Math.random().toString(36).slice(2),S5="__reactFiber$"+B6,u9="__reactProps$"+B6,g3="__reactContainer$"+B6,Xg="__reactEvents$"+B6,QW="__reactListeners$"+B6,HW="__reactHandles$"+B6;Jg=[];W4={},o2=A4(W4),H2=A4(!1),Mc=W4;n6=[],yu=[];KW=o3.ReactCurrentBatchConfig;x6=un(!0),cn=un(!1),Yf=A4(null);o9={},s5=A4(o9),c9=A4(o9),r9=A4(o9);d0=A4(0);ag=[];wf=o3.ReactCurrentDispatcher,og=o3.ReactCurrentBatchConfig;Mf={readContext:Su,useCallback:g2,useContext:g2,useEffect:g2,useImperativeHandle:g2,useInsertionEffect:g2,useLayoutEffect:g2,useMemo:g2,useReducer:g2,useRef:g2,useState:g2,useDebugValue:g2,useDeferredValue:g2,useTransition:g2,useMutableSource:g2,useSyncExternalStore:g2,useId:g2,unstable_isNewReconciler:!1},GW={readContext:Su,useCallback:function(f,v){return k5().memoizedState=[f,v===void 0?null:v],f},useContext:Su,useEffect:By,useImperativeHandle:function(f,v,k){return k=k!==null&&k!==void 0?k.concat([f]):null,nf(4194308,4,kn.bind(null,v,f),k)},useLayoutEffect:function(f,v){return nf(4194308,4,f,v)},useInsertionEffect:function(f,v){return nf(4,2,f,v)},useMemo:function(f,v){var k=k5();return v=v===void 0?null:v,f=f(),k.memoizedState=[f,v],f},useReducer:function(f,v,k){var V=k5();return v=k!==void 0?k(v):v,V.memoizedState=V.baseState=v,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:v},V.queue=f,f=f.dispatch=DW.bind(null,m0,f),[V.memoizedState,f]},useRef:function(f){var v=k5();return f={current:f},v.memoizedState=f},useState:Yy,useDebugValue:Tv,useDeferredValue:function(f){return k5().memoizedState=f},useTransition:function(){var f=Yy(!1),v=f[0];return f=ZW.bind(null,f[1]),k5().memoizedState=f,[v,f]},useMutableSource:function(){},useSyncExternalStore:function(f,v,k){var V=m0,W=k5();if(el){if(k===void 0)throw Error(z1(407));k=k()}else{if(k=v(),K0===null)throw Error(z1(349));(Oc&30)!==0||gn(V,v,k)}W.memoizedState=k;var g={value:k,getSnapshot:v};return W.queue=g,By(an.bind(null,V,g,f),[f]),V.flags|=2048,d9(9,vn.bind(null,V,g,k,v),void 0,null),k},useId:function(){var f=k5(),v=K0.identifierPrefix;if(el){var k=f3,V=p3;k=(V&~(1<<32-Mu(V)-1)).toString(32)+k,v=":"+v+"R"+k,k=p9++,0<k&&(v+="H"+k.toString(32)),v+=":"}else k=OW++,v=":"+v+"r"+k.toString(32)+":";return f.memoizedState=v},unstable_isNewReconciler:!1},XW={readContext:Su,useCallback:En,useContext:Su,useEffect:Dv,useImperativeHandle:Sn,useInsertionEffect:wn,useLayoutEffect:nn,useMemo:sn,useReducer:hg,useRef:yn,useState:function(){return hg(f9)},useDebugValue:Tv,useDeferredValue:function(f){var v=Eu();return Cn(v,F0.memoizedState,f)},useTransition:function(){var f=hg(f9)[0],v=Eu().memoizedState;return[f,v]},useMutableSource:dn,useSyncExternalStore:mn,useId:Wn,unstable_isNewReconciler:!1},JW={readContext:Su,useCallback:En,useContext:Su,useEffect:Dv,useImperativeHandle:Sn,useInsertionEffect:wn,useLayoutEffect:nn,useMemo:sn,useReducer:yg,useRef:yn,useState:function(){return yg(f9)},useDebugValue:Tv,useDeferredValue:function(f){var v=Eu();return F0===null?v.memoizedState=f:Cn(v,F0.memoizedState,f)},useTransition:function(){var f=yg(f9)[0],v=Eu().memoizedState;return[f,v]},useMutableSource:dn,useSyncExternalStore:mn,useId:Wn,unstable_isNewReconciler:!1};ef={isMounted:function(f){return(f=f._reactInternals)?Gc(f)===f:!1},enqueueSetState:function(f,v,k){f=f._reactInternals;var V=V2(),W=E4(f),g=d3(V,W);g.payload=v,k!==void 0&&k!==null&&(g.callback=k),v=k4(f,g,W),v!==null&&(Ku(v,f,W,V),yf(v,f,W))},enqueueReplaceState:function(f,v,k){f=f._reactInternals;var V=V2(),W=E4(f),g=d3(V,W);g.tag=1,g.payload=v,k!==void 0&&k!==null&&(g.callback=k),v=k4(f,g,W),v!==null&&(Ku(v,f,W,V),yf(v,f,W))},enqueueForceUpdate:function(f,v){f=f._reactInternals;var k=V2(),V=E4(f),W=d3(k,V);W.tag=2,v!==void 0&&v!==null&&(W.callback=v),v=k4(f,W,V),v!==null&&(Ku(v,f,V,k),yf(v,f,V))}};jW=typeof WeakMap==="function"?WeakMap:Map;bW=o3.ReactCurrentOwner;uv={dehydrated:null,treeContext:null,retryLane:0};Bn=function(f,v){for(var k=v.child;k!==null;){if(k.tag===5||k.tag===6)f.appendChild(k.stateNode);else if(k.tag!==4&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===v)break;for(;k.sibling===null;){if(k.return===null||k.return===v)return;k=k.return}k.sibling.return=k.return,k=k.sibling}};rv=function(){};zn=function(f,v,k,V){var W=f.memoizedProps;if(W!==V){f=v.stateNode,zc(s5.current);var g=null;switch(k){case"input":W=Ag(f,W),V=Ag(f,V),g=[];break;case"select":W=g0({},W,{value:void 0}),V=g0({},V,{value:void 0}),g=[];break;case"textarea":W=qg(f,W),V=qg(f,V),g=[];break;default:typeof W.onClick!=="function"&&typeof V.onClick==="function"&&(f.onclick=Uf)}Ug(k,V);var Q;k=null;for(a1 in W)if(!V.hasOwnProperty(a1)&&W.hasOwnProperty(a1)&&W[a1]!=null)if(a1==="style"){var b=W[a1];for(Q in b)b.hasOwnProperty(Q)&&(k||(k={}),k[Q]="")}else a1!=="dangerouslySetInnerHTML"&&a1!=="children"&&a1!=="suppressContentEditableWarning"&&a1!=="suppressHydrationWarning"&&a1!=="autoFocus"&&(X8.hasOwnProperty(a1)?g||(g=[]):(g=g||[]).push(a1,null));for(a1 in V){var u1=V[a1];if(b=W!=null?W[a1]:void 0,V.hasOwnProperty(a1)&&u1!==b&&(u1!=null||b!=null))if(a1==="style")if(b){for(Q in b)!b.hasOwnProperty(Q)||u1&&u1.hasOwnProperty(Q)||(k||(k={}),k[Q]="");for(Q in u1)u1.hasOwnProperty(Q)&&b[Q]!==u1[Q]&&(k||(k={}),k[Q]=u1[Q])}else k||(g||(g=[]),g.push(a1,k)),k=u1;else a1==="dangerouslySetInnerHTML"?(u1=u1?u1.__html:void 0,b=b?b.__html:void 0,u1!=null&&b!==u1&&(g=g||[]).push(a1,u1)):a1==="children"?typeof u1!=="string"&&typeof u1!=="number"||(g=g||[]).push(a1,""+u1):a1!=="suppressContentEditableWarning"&&a1!=="suppressHydrationWarning"&&(X8.hasOwnProperty(a1)?(u1!=null&&a1==="onScroll"&&bl("scroll",f),g||b===u1||(g=[])):(g=g||[]).push(a1,u1))}k&&(g=g||[]).push("style",k);var a1=g;if(v.updateQueue=a1)v.flags|=4}};Qn=function(f,v,k,V){k!==V&&(v.flags|=4)};tW=typeof WeakSet==="function"?WeakSet:Set;cL=Math.ceil,Kf=o3.ReactCurrentDispatcher,Xv=o3.ReactCurrentOwner,ku=o3.ReactCurrentBatchConfig,s6=A4(0);bn=function(f,v,k){if(f!==null)if(f.memoizedProps!==v.pendingProps||H2.current)Q2=!0;else{if((f.lanes&k)===0&&(v.flags&128)===0)return Q2=!1,_W(f,v,k);Q2=(f.flags&131072)!==0?!0:!1}else Q2=!1,el&&(v.flags&1048576)!==0&&ew(v,If,v.index);switch(v.lanes=0,v.tag){case 2:var V=v.type;kf(f,v),f=v.pendingProps;var W=F6(v,o2.current);V6(v,k),W=Ov(null,v,V,f,W,k);var g=Zv();return v.flags|=1,typeof W==="object"&&W!==null&&typeof W.render==="function"&&W.$$typeof===void 0?(v.tag=1,v.memoizedState=null,v.updateQueue=null,M2(V)?(g=!0,Pf(v)):g=!1,v.memoizedState=W.state!==null&&W.state!==void 0?W.state:null,zv(v),W.updater=ef,v.stateNode=W,W._reactInternals=v,ig(v,V,f,k),v=lv(null,v,V,!0,g,k)):(v.tag=0,el&&g&&Uv(v),A2(null,v,W,k),v=v.child),v;case 16:V=v.elementType;l:{switch(kf(f,v),f=v.pendingProps,W=V._init,V=W(V._payload),v.type=V,W=v.tag=oL(V),f=zu(V,f),W){case 0:v=tg(null,v,V,f,k);break l;case 1:v=Dy(null,v,V,f,k);break l;case 11:v=Oy(null,v,V,f,k);break l;case 14:v=Zy(null,v,V,zu(V.type,f),k);break l}throw Error(z1(306,V,""))}return v;case 0:return V=v.type,W=v.pendingProps,W=v.elementType===V?W:zu(V,W),tg(f,v,V,W,k);case 1:return V=v.type,W=v.pendingProps,W=v.elementType===V?W:zu(V,W),Dy(f,v,V,W,k);case 3:l:{if(Rn(v),f===null)throw Error(z1(387));V=v.pendingProps,g=v.memoizedState,W=g.element,pn(f,v),zf(v,V,null,k);var Q=v.memoizedState;if(V=Q.element,g.isDehydrated)if(g={element:V,isDehydrated:!1,cache:Q.cache,pendingSuspenseBoundaries:Q.pendingSuspenseBoundaries,transitions:Q.transitions},v.updateQueue.baseState=g,v.memoizedState=g,v.flags&256){W=R6(Error(z1(423)),v),v=Ty(f,v,V,k,W);break l}else if(V!==W){W=R6(Error(z1(424)),v),v=Ty(f,v,V,k,W);break l}else for($2=n4(v.stateNode.containerInfo.firstChild),_2=v,el=!0,Hu=null,k=cn(v,null,V,k),v.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(U6(),V===W){v=a3(f,v,k);break l}A2(f,v,V,k)}v=v.child}return v;case 5:return fn(v),f===null&&bg(v),V=v.type,W=v.pendingProps,g=f!==null?f.memoizedProps:null,Q=W.children,Tg(V,W)?Q=null:g!==null&&Tg(V,g)&&(v.flags|=32),Pn(f,v),A2(f,v,Q,k),v.child;case 6:return f===null&&bg(v),null;case 13:return In(f,v,k);case 4:return Qv(v,v.stateNode.containerInfo),V=v.pendingProps,f===null?v.child=x6(v,null,V,k):A2(f,v,V,k),v.child;case 11:return V=v.type,W=v.pendingProps,W=v.elementType===V?W:zu(V,W),Oy(f,v,V,W,k);case 7:return A2(f,v,v.pendingProps,k),v.child;case 8:return A2(f,v,v.pendingProps.children,k),v.child;case 12:return A2(f,v,v.pendingProps.children,k),v.child;case 10:l:{if(V=v.type._context,W=v.pendingProps,g=v.memoizedProps,Q=W.value,Dl(Yf,V._currentValue),V._currentValue=Q,g!==null)if(Ou(g.value,Q)){if(g.children===W.children&&!H2.current){v=a3(f,v,k);break l}}else for(g=v.child,g!==null&&(g.return=v);g!==null;){var b=g.dependencies;if(b!==null){Q=g.child;for(var u1=b.firstContext;u1!==null;){if(u1.context===V){if(g.tag===1){u1=d3(-1,k&-k),u1.tag=2;var a1=g.updateQueue;if(a1!==null){a1=a1.shared;var U1=a1.pending;U1===null?u1.next=u1:(u1.next=U1.next,U1.next=u1),a1.pending=u1}}g.lanes|=k,u1=g.alternate,u1!==null&&(u1.lanes|=k),$g(g.return,k,v),b.lanes|=k;break}u1=u1.next}}else if(g.tag===10)Q=g.type===v.type?null:g.child;else if(g.tag===18){if(Q=g.return,Q===null)throw Error(z1(341));Q.lanes|=k,b=Q.alternate,b!==null&&(b.lanes|=k),$g(Q,k,v),Q=g.sibling}else Q=g.child;if(Q!==null)Q.return=g;else for(Q=g;Q!==null;){if(Q===v){Q=null;break}if(g=Q.sibling,g!==null){g.return=Q.return,Q=g;break}Q=Q.return}g=Q}A2(f,v,W.children,k),v=v.child}return v;case 9:return W=v.type,V=v.pendingProps.children,V6(v,k),W=Su(W),V=V(W),v.flags|=1,A2(f,v,V,k),v.child;case 14:return V=v.type,W=zu(V,v.pendingProps),W=zu(V.type,W),Zy(f,v,V,W,k);case 15:return Un(f,v,v.type,v.pendingProps,k);case 17:return V=v.type,W=v.pendingProps,W=v.elementType===V?W:zu(V,W),kf(f,v),v.tag=1,M2(V)?(f=!0,Pf(v)):f=!1,V6(v,k),Nn(v,V,W),ig(v,V,W,k),lv(null,v,V,!0,f,k);case 19:return Yn(f,v,k);case 22:return xn(f,v,k)}throw Error(z1(156,v.tag))};tn=typeof reportError==="function"?reportError:function(f){console.error(f)};rd.prototype.render=la.prototype.render=function(f){var v=this._internalRoot;if(v===null)throw Error(z1(409));cd(f,v,null,null)};rd.prototype.unmount=la.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var v=f.containerInfo;Dc(function(){cd(null,f,null,null)}),v[g3]=null}};rd.prototype.unstable_scheduleHydration=function(f){if(f){var v=xw();f={blockedOn:null,target:f,priority:v};for(var k=0;k<g4.length&&v!==0&&v<g4[k].priority;k++);g4.splice(k,0,f),k===0&&Rw(f)}};Fw=function(f){switch(f.tag){case 3:var v=f.stateNode;if(v.current.memoizedState.isDehydrated){var k=P8(v.pendingLanes);k!==0&&(Cv(v,k|1),K2(v,y0()),(Cl&6)===0&&(I6=y0()+500,V4()))}break;case 13:Dc(function(){var V=v3(f,1);if(V!==null){var W=V2();Ku(V,f,1,W)}}),tv(f,1)}};Wv=function(f){if(f.tag===13){var v=v3(f,134217728);if(v!==null){var k=V2();Ku(v,f,134217728,k)}tv(f,134217728)}};Uw=function(f){if(f.tag===13){var v=E4(f),k=v3(f,v);if(k!==null){var V=V2();Ku(k,f,v,V)}tv(f,v)}};xw=function(){return Il};Pw=function(f,v){var k=Il;try{return Il=f,v()}finally{Il=k}};Rg=function(f,v,k){switch(v){case"input":if(Vg(f,k),v=k.name,k.type==="radio"&&v!=null){for(k=f;k.parentNode;)k=k.parentNode;k=k.querySelectorAll("input[name="+JSON.stringify(""+v)+'][type="radio"]');for(v=0;v<k.length;v++){var V=k[v];if(V!==f&&V.form===f.form){var W=bf(V);if(!W)throw Error(z1(90));mw(V),Vg(V,W)}}}break;case"textarea":vw(f,k);break;case"select":v=k.value,v!=null&&C6(f,!!k.multiple,v,!1)}};kw=bv;Sw=Dc;kL={usingClientEntryPoint:!1,Events:[a9,y6,bf,ww,nw,bv]},F8={findFiberByHostInstance:Yc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},SL={bundleType:F8.bundleType,version:F8.version,rendererPackageName:F8.rendererPackageName,rendererConfig:F8.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o3.ReactCurrentDispatcher,findHostInstanceByFiber:function(f){return f=Cw(f),f===null?null:f.stateNode},findFiberByHostInstance:F8.findFiberByHostInstance||wL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__{hk();function yk(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function")return;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yk)}catch(f){console.error(f)}}yk(),wk.exports=ca});var kk=n8((sL)=>{var h9=r4(nk(),1);sL.createRoot=h9.createRoot,sL.hydrateRoot=h9.hydrateRoot;var EL});var Sk=n8((ra,pa)=>{(function(f,v){typeof ra==="object"&&typeof pa<"u"?pa.exports=v():typeof define==="function"&&define.amd?define(v):(f=typeof globalThis<"u"?globalThis:f||self,f.maplibregl=v())})(ra,function(){var f={},v={};function k(W,g,Q){if(v[W]=Q,W!=="index")return;var b="var sharedModule = {}; ("+v.shared+")(sharedModule); ("+v.worker+")(sharedModule);",u1={};if(v.shared(u1),v.index(f,u1),typeof window<"u")f.setWorkerUrl(window.URL.createObjectURL(new Blob([b],{type:"text/javascript"})));return f}k("shared",["exports"],function(W){function g(l,c,p,d){return new(p||(p=Promise))(function(a,h){function y(S){try{C(d.next(S))}catch(L){h(L)}}function w(S){try{C(d.throw(S))}catch(L){h(L)}}function C(S){var L;S.done?a(S.value):(L=S.value,L instanceof p?L:new p(function(s){s(L)})).then(y,w)}C((d=d.apply(l,c||[])).next())})}function Q(l,c){this.x=l,this.y=c}function b(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var u1,a1;typeof SuppressedError=="function"&&SuppressedError,Q.prototype={clone(){return new Q(this.x,this.y)},add(l){return this.clone()._add(l)},sub(l){return this.clone()._sub(l)},multByPoint(l){return this.clone()._multByPoint(l)},divByPoint(l){return this.clone()._divByPoint(l)},mult(l){return this.clone()._mult(l)},div(l){return this.clone()._div(l)},rotate(l){return this.clone()._rotate(l)},rotateAround(l,c){return this.clone()._rotateAround(l,c)},matMult(l){return this.clone()._matMult(l)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(l){return this.x===l.x&&this.y===l.y},dist(l){return Math.sqrt(this.distSqr(l))},distSqr(l){let c=l.x-this.x,p=l.y-this.y;return c*c+p*p},angle(){return Math.atan2(this.y,this.x)},angleTo(l){return Math.atan2(this.y-l.y,this.x-l.x)},angleWith(l){return this.angleWithSep(l.x,l.y)},angleWithSep(l,c){return Math.atan2(this.x*c-this.y*l,this.x*l+this.y*c)},_matMult(l){let c=l[2]*this.x+l[3]*this.y;return this.x=l[0]*this.x+l[1]*this.y,this.y=c,this},_add(l){return this.x+=l.x,this.y+=l.y,this},_sub(l){return this.x-=l.x,this.y-=l.y,this},_mult(l){return this.x*=l,this.y*=l,this},_div(l){return this.x/=l,this.y/=l,this},_multByPoint(l){return this.x*=l.x,this.y*=l.y,this},_divByPoint(l){return this.x/=l.x,this.y/=l.y,this},_unit(){return this._div(this.mag()),this},_perp(){let l=this.y;return this.y=this.x,this.x=-l,this},_rotate(l){let c=Math.cos(l),p=Math.sin(l),d=p*this.x+c*this.y;return this.x=c*this.x-p*this.y,this.y=d,this},_rotateAround(l,c){let p=Math.cos(l),d=Math.sin(l),a=c.y+d*(this.x-c.x)+p*(this.y-c.y);return this.x=c.x+p*(this.x-c.x)-d*(this.y-c.y),this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Q},Q.convert=function(l){if(l instanceof Q)return l;if(Array.isArray(l))return new Q(+l[0],+l[1]);if(l.x!==void 0&&l.y!==void 0)return new Q(+l.x,+l.y);throw Error("Expected [x, y] or {x, y} point format")};var U1=function(){if(a1)return u1;function l(c,p,d,a){this.cx=3*c,this.bx=3*(d-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*p,this.by=3*(a-p)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=p,this.p2x=d,this.p2y=a}return a1=1,u1=l,l.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,p){if(p===void 0&&(p=0.000001),c1)return 1;for(var d=c,a=0;a<8;a++){var h=this.sampleCurveX(d)-c;if(Math.abs(h)<p)return d;var y=this.sampleCurveDerivativeX(d);if(Math.abs(y)<0.000001)break;d-=h/y}var w=0,C=1;for(d=c,a=0;a<20&&(h=this.sampleCurveX(d),!(Math.abs(h-c)h?w=d:C=d,d=0.5*(C-w)+w;return d},solve:function(c,p){return this.sampleCurveY(this.solveCurveX(c,p))}},u1}(),q1=b(U1);let F1,x1;function J1(){return F1!=null||(F1=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),F1}function X1(){if(x1==null&&(x1=!1,J1())){let c=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(c){for(let d=0;d<25;d++){let a=4*d;c.fillStyle=`rgb(${a},${a+1},${a+2})`,c.fillRect(d%5,Math.floor(d/5),1,1)}let p=c.getImageData(0,0,5,5).data;for(let d=0;d<100;d++)if(d%4!=3&&p[d]!==d){x1=!0;break}}}return x1||!1}var C1=0.000001,g1=typeof Float32Array4&&arguments[4]!==void 0?arguments[4]:"zyx",h=Math.PI/360;c*=h,d*=h,p*=h;var y=Math.sin(c),w=Math.cos(c),C=Math.sin(p),S=Math.cos(p),L=Math.sin(d),s=Math.cos(d);switch(a){case"xyz":l[0]=y*S*s+w*C*L,l[1]=w*C*s-y*S*L,l[2]=w*S*L+y*C*s,l[3]=w*S*s-y*C*L;break;case"xzy":l[0]=y*S*s-w*C*L,l[1]=w*C*s-y*S*L,l[2]=w*S*L+y*C*s,l[3]=w*S*s+y*C*L;break;case"yxz":l[0]=y*S*s+w*C*L,l[1]=w*C*s-y*S*L,l[2]=w*S*L-y*C*s,l[3]=w*S*s+y*C*L;break;case"yzx":l[0]=y*S*s+w*C*L,l[1]=w*C*s+y*S*L,l[2]=w*S*L-y*C*s,l[3]=w*S*s-y*C*L;break;case"zxy":l[0]=y*S*s-w*C*L,l[1]=w*C*s+y*S*L,l[2]=w*S*L+y*C*s,l[3]=w*S*s-y*C*L;break;case"zyx":l[0]=y*S*s-w*C*L,l[1]=w*C*s+y*S*L,l[2]=w*S*L-y*C*s,l[3]=w*S*s+y*C*L;break;default:throw Error("Unknown angle order "+a)}return l}function hl(){var l=new g1(2);return g1!=Float32Array&&(l[0]=0,l[1]=0),l}function Sl(l,c){var p=new g1(2);return p[0]=l,p[1]=c,p}I1(),P1=new g1(4),g1!=Float32Array&&(P1[0]=0,P1[1]=0,P1[2]=0,P1[3]=0),I1(),G(1,0,0),G(0,1,0),ol(),ol(),f1(),hl();let ul=8192;function O0(l,c,p){return c*(ul/(l.tileSize*Math.pow(2,p-l.tileID.overscaledZ)))}function l0(l){return l instanceof Error?l:Error(typeof l=="string"?l:String(l))}function O2(l,c){return(l%c+c)%c}function su(l,c,p){return l*(1-p)+c*p}function Zu(l){if(l=1)return 1;let c=l*l,p=c*l;return 4*(la.solve(h)}let W5=C5(0.25,0.1,0.25,1);function Z0(l,c,p){return Math.min(p,Math.max(c,l))}function Jc(l,c,p){let d=p-c,a=((l-c)%d+d)%d+c;return a===c?p:a}function h2(l,...c){for(let p of c)for(let d in p)l[d]=p[d];return l}let h3=1;function Du(l,c,p){let d={};for(let a in l)d[a]=c.call(this,l[a],a,l);return d}function Wl(l,c,p){let d={};for(let a in l)c.call(this,l[a],a,l)&&(d[a]=l[a]);return d}function vl(l){return Array.isArray(l)?l.map(vl):typeof l=="object"&&l?Du(l,vl):l}let L5={};function w0(l){L5[l]||(typeof console(c.y-l.y)*(p.x-l.x)}function L0(l){return typeof WorkerGlobalScope<"u"&&l!==void 0&&l instanceof WorkerGlobalScope}let Cu=null;function Q6(l){return typeof ImageBitmap"u")throw Error("VideoFrame not supported");let h=new VideoFrame(l,{timestamp:0});try{let y=h==null?void 0:h.format;if(!y||!y.startsWith("BGR")&&!y.startsWith("RGB"))throw Error(`Unrecognized format ${y}`);let w=y.startsWith("BGR"),C=new Uint8ClampedArray(d*a*4);if(yield h.copyTo(C,function(S,L,s,U,N){let R=4*Math.max(-L,0),P=(Math.max(0,s)-s)*U*4+R,B=4*U,H=Math.max(0,L),O=Math.max(0,s);return{rect:{x:H,y:O,width:Math.min(S.width,L+U)-H,height:Math.min(S.height,s+N)-O},layout:[{offset:P,stride:B}]}}(l,c,p,d,a)),w)for(let S=0;S{l.removeEventListener(c,p,d)}}}function Wu(l){return l*Math.PI/180}function Gu(l){return l/Math.PI*180}let jc={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},K6={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},bc="AbortError";class w3 extends Error{constructor(l=bc){super(l instanceof Error?l.message:l),this.name=bc,l instanceof Error&&l.stack&&(this.stack=l.stack)}}function O6(l){return l instanceof Error&&l.name===bc}function $c(l){if(l.aborted)throw new w3(l.reason)}let Xu={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Lu(l){return Xu.REGISTERED_PROTOCOLS[l.substring(0,l.indexOf("://"))]}let q2="global-dispatcher";class Ju extends Error{constructor(l,c,p,d){super(`AJAXError: ${c} (${l}): ${p}`),this.status=l,this.statusText=c,this.url=p,this.body=d}}let _c=()=>{var l;return L0(self)?(l=self.worker)===null||l===void 0?void 0:l.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href},A5=function(l,c){return g(this,void 0,void 0,function*(){var p,d;if(l.url.includes("://")&&!/^https?:|^file:/.test(l.url)){let a=Lu(l.url);if(a){let h=yield a(l,c);return h.data||l.type!=="arrayBuffer"?h:h2(h,{data:new ArrayBuffer(0)})}if(L0(self)&&((p=self.worker)===null||p===void 0?void 0:p.actor))return self.worker.actor.sendAsync({type:"GR",data:l,targetMapId:q2},c)}if(!((a)=>{var h;return a.startsWith("file:")||((h=_c())===null||h===void 0?void 0:h.startsWith("file:"))&&!/^\w+:/.test(a)})(l.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return function(a,h){return g(this,void 0,void 0,function*(){let y=new Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:_c(),referrerPolicy:a.referrerPolicy,signal:h.signal}),w,C;a.type!=="json"||y.headers.has("Accept")||y.headers.set("Accept","application/json");try{w=yield fetch(y)}catch(L){if(O6(L))throw L;throw new Ju(0,l0(L).message,a.url,new Blob)}if(!w.ok){let L=yield w.blob();throw new Ju(w.status,w.statusText,a.url,L)}C=a.type==="arrayBuffer"||a.type==="image"?w.arrayBuffer():a.type==="json"?w.json():w.text();let S=yield C;return $c(h.signal),{data:S,cacheControl:w.headers.get("Cache-Control"),expires:w.headers.get("Expires"),etag:w.headers.get("ETag")}})}(l,c);if(L0(self)&&((d=self.worker)===null||d===void 0?void 0:d.actor))return self.worker.actor.sendAsync({type:"GR",data:l,mustQueue:!0,targetMapId:q2},c)}return function(a,h){return new Promise((y,w)=>{var C;let S=new XMLHttpRequest;S.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(S.responseType="arraybuffer");for(let L in a.headers)S.setRequestHeader(L,a.headers[L]);a.type==="json"&&(S.responseType="text",((C=a.headers)===null||C===void 0?void 0:C.Accept)||S.setRequestHeader("Accept","application/json")),S.withCredentials=a.credentials==="include",S.onerror=()=>{w(Error(S.statusText))},S.onload=()=>{if(!h.signal.aborted)if((S.status>=200&&S.status{S.abort(),w(new w3(h.signal.reason))}),S.send(a.body)})}(l,c)})};function Z2(l){if(!l||l.indexOf("://"){this.off(l,c)}}}off(l,c){return V5(l,c,this._listeners),V5(l,c,this._oneTimeListeners),this}once(l,c){return c?(this._oneTimeListeners||(this._oneTimeListeners={}),n3(l,c,this._oneTimeListeners),this):new Promise((p)=>this.once(l,p))}fire(l,c){var p,d;typeof l=="string"&&(l=new k3(l,c||{}));let a=l.type;if(this.listens(a)){l.target=this;let h=((p=this._listeners)===null||p===void 0?void 0:p[a])?this._listeners[a].slice():[];for(let C of h)C.call(this,l);let y=((d=this._oneTimeListeners)===null||d===void 0?void 0:d[a])?this._oneTimeListeners[a].slice():[];for(let C of y)V5(a,C,this._oneTimeListeners),C.call(this,l);let w=this._eventedParent;w&&(h2(l,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),w.fire(l))}else l instanceof N5&&console.error(l.error);return this}listens(l){var c,p,d,a,h;return((p=(c=this._listeners)===null||c===void 0?void 0:c[l])===null||p===void 0?void 0:p.length)>0||((a=(d=this._oneTimeListeners)===null||d===void 0?void 0:d[l])===null||a===void 0?void 0:a.length)>0||((h=this._eventedParent)===null||h===void 0?void 0:h.listens(l))}setEventedParent(l,c){return this._eventedParent=l,this._eventedParentData=c,this}}var E1={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:0.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"{d in c&&(p[d]=c[d])}),p}function sl(l,c){if(Array.isArray(l)){if(!Array.isArray(c)||l.length!==c.length)return!1;for(let p=0;p<l.length;p++)if(!sl(l[p],c[p]))return!1;return!0}if(typeof l=="object"&&l!==null&&c!==null){if(typeof c!="object")return!1;if(Object.keys(l).length!==Object.keys(c).length)return!1;for(let p in l)if(!sl(l[p],c[p]))return!1;return!0}return l===c}function t0(l,c){l.push(c)}function q5(l,c,p){t0(p,{command:"addSource",args:[l,c[l]]})}function w9(l,c,p){t0(c,{command:"removeSource",args:[l]}),p[l]=!0}function n9(l,c,p,d){w9(l,p,d),q5(l,c,p)}function dd(l,c,p){let d;for(d in l[p])if(Object.prototype.hasOwnProperty.call(l[p],d)&&d!=="data"&&!sl(l[p][d],c[p][d]))return!1;for(d in c[p])if(Object.prototype.hasOwnProperty.call(c[p],d)&&d!=="data"&&!sl(l[p][d],c[p][d]))return!1;return!0}function ic(l,c,p,d,a,h){l=l||{},c=c||{};for(let y in l)Object.prototype.hasOwnProperty.call(l,y)&&(sl(l[y],c[y])||p.push({command:h,args:[d,y,c[y],a]}));for(let y in c)Object.prototype.hasOwnProperty.call(c,y)&&!Object.prototype.hasOwnProperty.call(l,y)&&(sl(l[y],c[y])||p.push({command:h,args:[d,y,c[y],a]}))}function T6(l){return l.id}function k9(l,c){return l[c.id]=c,l}class R1{constructor(l,c,p,d){this.message=(l?`${l}: `:"")+p,d&&(this.identifier=d),c!=null&&c.__line__&&(this.line=c.__line__)}}function ju(l,...c){for(let p of c)for(let d in p)l[d]=p[d];return l}class n0 extends Error{constructor(l,c){super(c),this.message=c,this.key=l}}class ec{constructor(l,c=[]){this.parent=l,this.bindings={};for(let[p,d]of c)this.bindings[p]=d}concat(l){return new ec(this,l)}get(l){if(this.bindings[l])return this.bindings[l];if(this.parent)return this.parent.get(l);throw Error(`${l} not found in scope.`)}has(l){return!!this.bindings[l]||!!this.parent&&this.parent.has(l)}}let bu={kind:"null"},H1={kind:"number"},rl={kind:"string"},al={kind:"boolean"},y2={kind:"color"},tc={kind:"projectionDefinition"},Au={kind:"object"},fl={kind:"value"},F4={kind:"collator"},U4={kind:"formatted"},lr={kind:"padding"},S3={kind:"colorArray"},x4={kind:"numberArray"},E3={kind:"resolvedImage"},P4={kind:"variableAnchorOffsetCollection"};function A0(l,c){return{kind:"array",itemType:l,N:c}}function Ll(l){if(l.kind==="array"){let c=Ll(l.itemType);return typeof l.N=="number"?`array`:l.itemType.kind==="value"?"array":`array`}return l.kind}let ur=[bu,H1,rl,al,y2,tc,U4,Au,A0(fl),lr,x4,S3,E3,P4];function s3(l,c){if(c.kind==="error")return null;if(l.kind==="array"){if(c.kind==="array"&&(c.N===0&&c.itemType.kind==="value"||!s3(l.itemType,c.itemType))&&(typeof l.N!="number"||l.N===c.N))return null}else{if(l.kind===c.kind)return null;if(l.kind==="value"){for(let p of ur)if(!s3(p,c))return null}}return`Expected ${Ll(l)} but found ${Ll(c)} instead.`}function R4(l,c){return c.some((p)=>p.kind===l.kind)}function F5(l,c){return c.some((p)=>p==="null"?l===null:p==="array"?Array.isArray(l):p==="object"?l&&!Array.isArray(l)&&typeof l=="object":p===typeof l)}function D2(l,c){return l.kind==="array"&&c.kind==="array"?l.itemType.kind===c.itemType.kind&&typeof l.N=="number":l.kind===c.kind}let S9=0.96422,U5=0.82521,cr=0.13793103448275862,Tl=0.20689655172413793,G6=3*Tl*Tl,X6=Tl*Tl*Tl,C3=Math.PI/180,J6=180/Math.PI;function j6(l){return(l%=360)<0&&(l+=360),l}function b6([l,c,p,d]){let a,h,y=pr((0.2225045*(l=rr(l))+0.7168786*(c=rr(c))+0.0606169*(p=rr(p)))/1);l===c&&c===p?a=h=y:(a=pr((0.4360747*l+0.3850649*c+0.1430804*p)/S9),h=pr((0.0139322*l+0.0971045*c+0.7141733*p)/U5));let w=116*y-16;return[w<0?0:w,500*(a-y),200*(y-h),d]}function rr(l){return lX6?Math.pow(l,0.3333333333333333):l/G6+cr}function $6([l,c,p,d]){let a=(l+16)/116,h=isNaN(c)?a:a+c/500,y=isNaN(p)?a:a-p/200;return a=1*i6(a),h=S9*i6(h),y=U5*i6(y),[_6(3.1338561*h-1.6168667*a-0.4906146*y),_6(-0.9787684*h+1.9161415*a+0.033454*y),_6(0.0719453*h-0.2289914*a+1.4052427*y),d]}function _6(l){return(l=l<=0.00304?12.92*l:1.055*Math.pow(l,0.4166666666666667)-0.055)1?1:l}function i6(l){return l>Tl?l*l*l:G6*(l-cr)}let md=Object.hasOwn||function(l,c){return Object.prototype.hasOwnProperty.call(l,c)};function I4(l,c){return md(l,c)?l[c]:void 0}function fr(l){return parseInt(l.padEnd(2,l),16)/255}function E9(l,c){return W3(c?l/100:l,0,1)}function W3(l,c,p){return Math.min(Math.max(c,l),p)}function e6(l){return!l.some(Number.isNaN)}let Y4={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Vu(l,c,p){return l+p*(c-l)}function x5(l,c,p){return l.map((d,a)=>Vu(d,c[a],p))}class ml{constructor(l,c,p,d=1,a=!0){this.r=l,this.g=c,this.b=p,this.a=d,a||(this.r*=d,this.g*=d,this.b*=d,d||this.overwriteGetter("rgb",[l,c,p,d]))}static parse(l){if(l instanceof ml)return l;if(typeof l!="string")return;let c=function(p){if((p=p.toLowerCase().trim())==="transparent")return[0,0,0,0];let d=I4(Y4,p);if(d){let[h,y,w]=d;return[h/255,y/255,w/255,1]}if(p.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(p)){let h=p.lengthMath.round(255*a)).join(",")},${d})`}static interpolate(l,c,p,d="rgb"){switch(d){case"rgb":{let[a,h,y,w]=x5(l.rgb,c.rgb,p);return new ml(a,h,y,w,!1)}case"hcl":{let[a,h,y,w]=l.hcl,[C,S,L,s]=c.hcl,U,N;if(isNaN(a)||isNaN(C))isNaN(a)?isNaN(C)?U=NaN:(U=C,y!==1&&y!==0||(N=S)):(U=a,L!==1&&L!==0||(N=h));else{let O=C-a;C>a&&O>180?O-=360:C180&&(O+=360),U=a+p*O}let[R,P,B,H]=function([O,M,Z,T]){return O=isNaN(O)?0:O*C3,$6([Z,Math.cos(O)*M,Math.sin(O)*M,T])}([U,N!=null?N:Vu(h,S,p),Vu(y,L,p),Vu(w,s,p)]);return new ml(R,P,B,H,!1)}case"lab":{let[a,h,y,w]=$6(x5(l.lab,c.lab,p));return new ml(a,h,y,w,!1)}}}}ml.black=new ml(0,0,0,1),ml.white=new ml(1,1,1,1),ml.transparent=new ml(0,0,0,0),ml.red=new ml(1,0,0,1);class B4{constructor(l,c,p){this.sensitivity=l?c?"variant":"case":c?"accent":"base",this.locale=p,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(l,c){return this.collator.compare(l,c)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let s9=["bottom","center","top"];class z4{constructor(l,c,p,d,a,h){this.text=l,this.image=c,this.scale=p,this.fontStack=d,this.textColor=a,this.verticalAlign=h}}class D0{constructor(l){this.sections=l}static fromString(l){return new D0([new z4(l,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((l)=>l.text.length!==0||l.image&&l.image.name.length!==0)}static factory(l){return l instanceof D0?l:D0.fromString(l)}toString(){return this.sections.length===0?"":this.sections.map((l)=>l.text).join("")}}class x0{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof x0)return l;if(typeof l=="number")return new x0([l,l,l,l]);if(Array.isArray(l)&&!(l.length4)){for(let c of l)if(typeof c!="number")return;switch(l.length){case 1:l=[l[0],l[0],l[0],l[0]];break;case 2:l=[l[0],l[1],l[0],l[1]];break;case 3:l=[l[0],l[1],l[2],l[1]]}return new x0(l)}}toString(){return JSON.stringify(this.values)}static interpolate(l,c,p){return new x0(x5(l.values,c.values,p))}}class Ml{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof Ml)return l;if(typeof l=="number")return new Ml([l]);if(Array.isArray(l)){for(let c of l)if(typeof c!="number")return;return new Ml(l)}}toString(){return JSON.stringify(this.values)}static interpolate(l,c,p){return new Ml(x5(l.values,c.values,p))}}class t1{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof t1)return l;if(typeof l=="string"){let p=ml.parse(l);if(!p)return;return new t1([p])}if(!Array.isArray(l))return;let c=[];for(let p of l){if(typeof p!="string")return;let d=ml.parse(p);if(!d)return;c.push(d)}return new t1(c)}toString(){return JSON.stringify(this.values)}static interpolate(l,c,p,d="rgb"){let a=[];if(l.values.length!=c.values.length)throw Error(`colorArray: Arrays have mismatched length (${l.values.length} vs. ${c.values.length}), cannot interpolate.`);for(let h=0;h<l.values.length;h++)a.push(ml.interpolate(l.values[h],c.values[h],p,d));return new t1(a)}}class Al extends Error{constructor(l){super(l),this.name="RuntimeError"}toJSON(){return this.message}}let $u=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class T0{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof T0)return l;if(Array.isArray(l)&&!(l.length<1)&&l.length%2==0){for(let c=0;c<l.length;c+=2){let p=l[c],d=l[c+1];if(typeof p!="string"||!$u.has(p))return;if(!Array.isArray(d)||d.length!==2||typeof d[0]!="number"||typeof d[1]!="number")return}return new T0(l)}}toString(){return JSON.stringify(this.values)}static interpolate(l,c,p){let d=l.values,a=c.values;if(d.length!==a.length)throw new Al(`Cannot interpolate values of different length. from: ${l.toString()}, to: ${c.toString()}`);let h=[];for(let y=0;y=0&&l=0&&c=0&&p=0&&d<=1?null:`Invalid rgba value [${[l,c,p,d].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof d=="number"?[l,c,p,d]:[l,c,p]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function _u(l){if(l===null||typeof l=="string"||typeof l=="boolean"||typeof l=="number"||l instanceof P0||l instanceof ml||l instanceof B4||l instanceof D0||l instanceof x0||l instanceof Ml||l instanceof t1||l instanceof T0||l instanceof w2)return!0;if(Array.isArray(l)){for(let c of l)if(!_u(c))return!1;return!0}if(typeof l=="object"){for(let c in l)if(!_u(l[c]))return!1;return!0}return!1}function _l(l){if(l===null)return bu;if(typeof l=="string")return rl;if(typeof l=="boolean")return al;if(typeof l=="number")return H1;if(l instanceof ml)return y2;if(l instanceof P0)return tc;if(l instanceof B4)return F4;if(l instanceof D0)return U4;if(l instanceof x0)return lr;if(l instanceof Ml)return x4;if(l instanceof t1)return S3;if(l instanceof T0)return P4;if(l instanceof w2)return E3;if(Array.isArray(l)){let c=l.length,p;for(let d of l){let a=_l(d);if(p){if(p===a)continue;p=fl;break}p=a}return A0(p||fl,c)}return Au}function iu(l){let c=typeof l;return l===null?"":c==="string"||c==="number"||c==="boolean"?String(l):l instanceof ml||l instanceof P0||l instanceof D0||l instanceof x0||l instanceof Ml||l instanceof t1||l instanceof T0||l instanceof w2?l.toString():JSON.stringify(l)}class e2{constructor(l,c){this.type=l,this.value=c}static parse(l,c){if(l.length!==2)return c.error(`'literal' expression requires exactly one argument, but found ${l.length-1} instead.`);if(!_u(l[1]))return c.error("invalid value");let p=l[1],d=_l(p),a=c.expectedType;return d.kind!=="array"||d.N!==0||!a||a.kind!=="array"||typeof a.N=="number"&&a.N!==0||(d=a),new e2(d,p)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let Q4={string:rl,number:H1,boolean:al,object:Au};class l2{constructor(l,c){this.type=l,this.args=c}static parse(l,c){if(l.length2){let C=l[1];if(typeof C!="string"||!(C in Q4)||C==="object")return c.error('The item type argument of "array" must be one of string, number, boolean',1);y=Q4[C],d++}else y=fl;if(l.length>3){if(l[2]!==null&&(typeof l[2]!="number"||l[2]<0||l[2]!==Math.floor(l[2])))return c.error('The length argument to "array" must be a positive integer literal',2);w=l[2],d++}p=A0(y,w)}else{if(!Q4[a])throw Error(`Types doesn't contain name = ${a}`);p=Q4[a]}let h=[];for(;d<l.length;d++){let y=c.parse(l[d],d,fl);if(!y)return null;h.push(y)}return new l2(p,h)}evaluate(l){for(let c=0;cl.outputDefined())}}let P5={"to-boolean":al,"to-color":y2,"to-number":H1,"to-string":rl};class Nu{constructor(l,c){this.type=l,this.args=c}static parse(l,c){if(l.length<2)return c.error("Expected at least one argument.");let p=l[0];if(!P5[p])throw Error(`Can't parse ${p} as it is not part of the known types`);if((p==="to-boolean"||p==="to-string")&&l.length!==2)return c.error("Expected one argument.");let d=P5[p],a=[];for(let h=1;h<l.length;h++){let y=c.parse(l[h],h,fl);if(!y)return null;a.push(y)}return new Nu(d,a)}evaluate(l){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(l));case"color":{let c,p;for(let d of this.args){if(c=d.evaluate(l),p=null,c instanceof ml)return c;if(typeof c=="string"){let a=l.parseColor(c);if(a)return a}else if(Array.isArray(c)&&(p=c.length4?`Invalid rgba value ${JSON.stringify(c)}: expected an array containing either three or four numeric values.`:L3(c[0],c[1],c[2],c[3]),!p))return new ml(c[0]/255,c[1]/255,c[2]/255,c[3])}throw new Al(p||`Could not parse color from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"padding":{let c;for(let p of this.args){c=p.evaluate(l);let d=x0.parse(c);if(d)return d}throw new Al(`Could not parse padding from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"numberArray":{let c;for(let p of this.args){c=p.evaluate(l);let d=Ml.parse(c);if(d)return d}throw new Al(`Could not parse numberArray from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"colorArray":{let c;for(let p of this.args){c=p.evaluate(l);let d=t1.parse(c);if(d)return d}throw new Al(`Could not parse colorArray from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"variableAnchorOffsetCollection":{let c;for(let p of this.args){c=p.evaluate(l);let d=T0.parse(c);if(d)return d}throw new Al(`Could not parse variableAnchorOffsetCollection from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"number":{let c=null;for(let p of this.args){if(c=p.evaluate(l),c===null)return 0;let d=Number(c);if(!isNaN(d))return d}throw new Al(`Could not convert ${JSON.stringify(c)} to number.`)}case"formatted":return D0.fromString(iu(this.args[0].evaluate(l)));case"resolvedImage":return w2.fromString(iu(this.args[0].evaluate(l)));case"projectionDefinition":return this.args[0].evaluate(l);default:return iu(this.args[0].evaluate(l))}}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every((l)=>l.outputDefined())}}let C9=["Unknown","Point","LineString","Polygon"];class dr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?C9[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(l){let c=this._parseColorCache.get(l);return c||(c=ml.parse(l),this._parseColorCache.set(l,c)),c}}class eu{constructor(l,c,p=[],d,a=new ec,h=[]){this.registry=l,this.path=p,this.key=p.map((y)=>`[${y}]`).join(""),this.scope=a,this.errors=h,this.expectedType=d,this._isConstant=c}parse(l,c,p,d,a={}){return c?this.concat(c,p,d)._parse(l,a):this._parse(l,a)}_parse(l,c){function p(d,a,h){return h==="assert"?new l2(a,[d]):h==="coerce"?new Nu(a,[d]):d}if(l!==null&&typeof l!="string"&&typeof l!="boolean"&&typeof l!="number"||(l=["literal",l]),Array.isArray(l)){if(l.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let d=l[0];if(typeof d!="string")return this.error(`Expression name must be a string, but found ${typeof d} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let a=this.registry[d];if(a){let h=a.parse(l,this);if(!h)return null;if(this.expectedType){let y=this.expectedType,w=h.type;if(y.kind!=="string"&&y.kind!=="number"&&y.kind!=="boolean"&&y.kind!=="object"&&y.kind!=="array"||w.kind!=="value"){if(y.kind==="projectionDefinition"&&["string","array"].includes(w.kind)||["color","formatted","resolvedImage"].includes(y.kind)&&["value","string"].includes(w.kind)||["padding","numberArray"].includes(y.kind)&&["value","number","array"].includes(w.kind)||y.kind==="colorArray"&&["value","string","array"].includes(w.kind)||y.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(w.kind))h=p(h,y,c.typeAnnotation||"coerce");else if(this.checkSubtype(y,w))return null}else h=p(h,y,c.typeAnnotation||"assert")}if(!(h instanceof e2)&&h.type.kind!=="resolvedImage"&&this._isConstant(h)){let y=new dr;try{h=new e2(h.type,h.evaluate(y))}catch(w){return this.error(w.message),null}}return h}return this.error(`Unknown expression "${d}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(l===void 0?"'undefined' value invalid. Use null instead.":typeof l=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof l} instead.`)}concat(l,c,p){let d=typeof l=="number"?this.path.concat(l):this.path,a=p?this.scope.concat(p):this.scope;return new eu(this.registry,this._isConstant,d,c||null,a,this.errors)}error(l,...c){let p=`${this.key}${c.map((d)=>`[${d}]`).join("")}`;this.errors.push(new n0(p,l))}checkSubtype(l,c){let p=s3(l,c);return p&&this.error(p),p}}class Nl{constructor(l,c){this.type=c.type,this.bindings=[].concat(l),this.result=c}evaluate(l){return this.result.evaluate(l)}eachChild(l){for(let c of this.bindings)l(c[1]);l(this.result)}static parse(l,c){if(l.length<4)return c.error(`Expected at least 3 arguments, but found ${l.length-1} instead.`);let p=[];for(let a=1;a<l.length-1;a+=2){let h=l[a];if(typeof h!="string")return c.error(`Expected string, but found ${typeof h} instead.`,a);if(/[^a-zA-Z0-9_]/.test(h))return c.error("Variable names must contain only alphanumeric characters or '_'.",a);let y=c.parse(l[a+1],a+1);if(!y)return null;p.push([h,y])}let d=c.parse(l[l.length-1],l.length-1,c.expectedType,p);return d?new Nl(p,d):null}outputDefined(){return this.result.outputDefined()}}class A3{constructor(l,c){this.type=c.type,this.name=l,this.boundExpression=c}static parse(l,c){if(l.length!==2||typeof l[1]!="string")return c.error("'var' expression requires exactly one string literal argument.");let p=l[1];return c.scope.has(p)?new A3(p,c.scope.get(p)):c.error(`Unknown variable "${p}". Make sure "${p}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(l){return this.boundExpression.evaluate(l)}eachChild(){}outputDefined(){return!1}}class wl{constructor(l,c,p){this.type=l,this.index=c,this.input=p}static parse(l,c){if(l.length!==3)return c.error(`Expected 2 arguments, but found ${l.length-1} instead.`);let p=c.parse(l[1],1,H1),d=c.parse(l[2],2,A0(c.expectedType||fl));return p&&d?new wl(d.type.itemType,p,d):null}evaluate(l){let c=this.index.evaluate(l),p=this.input.evaluate(l);if(c<0)throw new Al(`Array index out of bounds: ${c} =p.length)throw new Al(`Array index out of bounds: ${c} > ${p.length-1}.`);if(c!==Math.floor(c))throw new Al(`Array index must be an integer, but found ${c} instead.`);return p[c]}eachChild(l){l(this.index),l(this.input)}outputDefined(){return!1}}class pl{constructor(l,c){this.type=al,this.needle=l,this.haystack=c}static parse(l,c){if(l.length!==3)return c.error(`Expected 2 arguments, but found ${l.length-1} instead.`);let p=c.parse(l[1],1,fl),d=c.parse(l[2],2,fl);return p&&d?R4(p.type,[al,rl,H1,bu,fl])?new pl(p,d):c.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ll(p.type)} instead`):null}evaluate(l){let c=this.needle.evaluate(l),p=this.haystack.evaluate(l);if(!p)return!1;if(!F5(c,["boolean","string","number","null"]))throw new Al(`Expected first argument to be of type boolean, string, number or null, but found ${Ll(_l(c))} instead.`);if(!F5(p,["string","array"]))throw new Al(`Expected second argument to be of type array or string, but found ${Ll(_l(p))} instead.`);return p.indexOf(c)>=0}eachChild(l){l(this.needle),l(this.haystack)}outputDefined(){return!0}}class V3{constructor(l,c,p){this.type=H1,this.needle=l,this.haystack=c,this.fromIndex=p}static parse(l,c){if(l.length=5)return c.error(`Expected 2 or 3 arguments, but found ${l.length-1} instead.`);let p=c.parse(l[1],1,fl),d=c.parse(l[2],2,fl);if(!p||!d)return null;if(!R4(p.type,[al,rl,H1,bu,fl]))return c.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ll(p.type)} instead`);if(l.length===4){let a=c.parse(l[3],3,H1);return a?new V3(p,d,a):null}return new V3(p,d)}evaluate(l){let c=this.needle.evaluate(l),p=this.haystack.evaluate(l);if(!F5(c,["boolean","string","number","null"]))throw new Al(`Expected first argument to be of type boolean, string, number or null, but found ${Ll(_l(c))} instead.`);let d;if(this.fromIndex&&(d=this.fromIndex.evaluate(l)),F5(p,["string"])){let a=p.indexOf(c,d);return a===-1?-1:[...p.slice(0,a)].length}if(F5(p,["array"]))return p.indexOf(c,d);throw new Al(`Expected second argument to be of type array or string, but found ${Ll(_l(p))} instead.`)}eachChild(l){l(this.needle),l(this.haystack),this.fromIndex&&l(this.fromIndex)}outputDefined(){return!1}}class nl{constructor(l,c,p,d,a,h){this.inputType=l,this.type=c,this.input=p,this.cases=d,this.outputs=a,this.otherwise=h}static parse(l,c){if(l.length<5)return c.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if(l.length%2!=1)return c.error("Expected an even number of arguments.");let p,d;c.expectedType&&c.expectedType.kind!=="value"&&(d=c.expectedType);let a={},h=[];for(let C=2;CNumber.MAX_SAFE_INTEGER)return s.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof N=="number"&&Math.floor(N)!==N)return s.error("Numeric branch labels must be integer values.");if(p){if(s.checkSubtype(p,_l(N)))return null}else p=_l(N);if(a[String(N)]!==void 0)return s.error("Branch labels must be unique.");a[String(N)]=h.length}let U=c.parse(L,C,d);if(!U)return null;d=d||U.type,h.push(U)}let y=c.parse(l[1],1,fl);if(!y)return null;let w=c.parse(l[l.length-1],l.length-1,d);return w?y.type.kind!=="value"&&c.concat(1).checkSubtype(p,y.type)?null:new nl(p,d,y,a,h,w):null}evaluate(l){let c=this.input.evaluate(l);return(_l(c)===this.inputType&&this.outputs[this.cases[c]]||this.otherwise).evaluate(l)}eachChild(l){l(this.input),this.outputs.forEach(l),l(this.otherwise)}outputDefined(){return this.outputs.every((l)=>l.outputDefined())&&this.otherwise.outputDefined()}}class T2{constructor(l,c,p){this.type=l,this.branches=c,this.otherwise=p}static parse(l,c){if(l.length<4)return c.error(`Expected at least 3 arguments, but found only ${l.length-1}.`);if(l.length%2!=0)return c.error("Expected an odd number of arguments.");let p;c.expectedType&&c.expectedType.kind!=="value"&&(p=c.expectedType);let d=[];for(let h=1;hc.outputDefined())&&this.otherwise.outputDefined()}}class N3{constructor(l,c,p,d){this.type=l,this.input=c,this.beginIndex=p,this.endIndex=d}static parse(l,c){if(l.length=5)return c.error(`Expected 2 or 3 arguments, but found ${l.length-1} instead.`);let p=c.parse(l[1],1,fl),d=c.parse(l[2],2,H1);if(!p||!d)return null;if(!R4(p.type,[A0(fl),rl,fl]))return c.error(`Expected first argument to be of type array or string, but found ${Ll(p.type)} instead`);if(l.length===4){let a=c.parse(l[3],3,H1);return a?new N3(p.type,p,d,a):null}return new N3(p.type,p,d)}evaluate(l){let c=this.input.evaluate(l),p=this.beginIndex.evaluate(l),d;if(this.endIndex&&(d=this.endIndex.evaluate(l)),F5(c,["string"]))return[...c].slice(p,d).join("");if(F5(c,["array"]))return c.slice(p,d);throw new Al(`Expected first argument to be of type array or string, but found ${Ll(_l(c))} instead.`)}eachChild(l){l(this.input),l(this.beginIndex),this.endIndex&&l(this.endIndex)}outputDefined(){return!1}}function R5(l,c){let p=l.length-1,d,a,h=0,y=p,w=0;for(;h<=y;)if(w=Math.floor((h+y)/2),d=l[w],a=l[w+1],d<=c){if(w===p||cc))throw new Al("Input is not a number.");y=w-1}return 0}class q3{constructor(l,c,p){this.type=l,this.input=c,this.labels=[],this.outputs=[];for(let[d,a]of p)this.labels.push(d),this.outputs.push(a)}static parse(l,c){if(l.length-1<4)return c.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return c.error("Expected an even number of arguments.");let p=c.parse(l[1],1,H1);if(!p)return null;let d=[],a=null;c.expectedType&&c.expectedType.kind!=="value"&&(a=c.expectedType);for(let h=1;h=y)return c.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',C);let L=c.parse(w,S,a);if(!L)return null;a=a||L.type,d.push([y,L])}return new q3(a,p,d)}evaluate(l){let c=this.labels,p=this.outputs;if(c.length===1)return p[0].evaluate(l);let d=this.input.evaluate(l);if(d=c[a-1]?p[a-1].evaluate(l):p[R5(c,d)].evaluate(l)}eachChild(l){l(this.input);for(let c of this.outputs)l(c)}outputDefined(){return this.outputs.every((l)=>l.outputDefined())}}function t6(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var H4,W9,l7=function(){if(W9)return H4;function l(c,p,d,a){this.cx=3*c,this.bx=3*(d-c)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*p,this.by=3*(a-p)-this.cy,this.ay=1-this.cy-this.by,this.p1x=c,this.p1y=p,this.p2x=d,this.p2y=a}return W9=1,H4=l,l.prototype={sampleCurveX:function(c){return((this.ax*c+this.bx)*c+this.cx)*c},sampleCurveY:function(c){return((this.ay*c+this.by)*c+this.cy)*c},sampleCurveDerivativeX:function(c){return(3*this.ax*c+2*this.bx)*c+this.cx},solveCurveX:function(c,p){if(p===void 0&&(p=0.000001),c1)return 1;for(var d=c,a=0;a<8;a++){var h=this.sampleCurveX(d)-c;if(Math.abs(h)<p)return d;var y=this.sampleCurveDerivativeX(d);if(Math.abs(y)<0.000001)break;d-=h/y}var w=0,C=1;for(d=c,a=0;a<20&&(h=this.sampleCurveX(d),!(Math.abs(h-c)
h?w=d:C=d,d=0.5*(C-w)+w;return d},solve:function(c,p){return this.sampleCurveY(this.solveCurveX(c,p))}},H4}(),L9=t6(l7);class c0{constructor(l,c,p,d,a){this.type=l,this.operator=c,this.interpolation=p,this.input=d,this.labels=[],this.outputs=[];for(let[h,y]of a)this.labels.push(h),this.outputs.push(y)}static interpolationFactor(l,c,p,d){let a=0;if(l.name==="exponential")a=k0(c,l.base,p,d);else if(l.name==="linear")a=k0(c,1,p,d);else if(l.name==="cubic-bezier"){let h=l.controlPoints;a=new L9(h[0],h[1],h[2],h[3]).solve(k0(c,1,p,d))}return a}static parse(l,c){let[p,d,a,...h]=l;if(!Array.isArray(d)||d.length===0)return c.error("Expected an interpolation type expression.",1);if(d[0]==="linear")d={name:"linear"};else if(d[0]==="exponential"){let C=d[1];if(typeof C!="number")return c.error("Exponential interpolation requires a numeric base.",1,1);d={name:"exponential",base:C}}else{if(d[0]!=="cubic-bezier")return c.error(`Unknown interpolation type ${String(d[0])}`,1,0);{let C=d.slice(1);if(C.length!==4||C.some((S)=>typeof S!="number"||S1))return c.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);d={name:"cubic-bezier",controlPoints:C}}}if(l.length-1<4)return c.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return c.error("Expected an even number of arguments.");if(a=c.parse(a,2,H1),!a)return null;let y=[],w=null;p!=="interpolate-hcl"&&p!=="interpolate-lab"||c.expectedType==S3?c.expectedType&&c.expectedType.kind!=="value"&&(w=c.expectedType):w=y2;for(let C=0;C=S)return c.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',s);let N=c.parse(L,U,w);if(!N)return null;w=w||N.type,y.push([S,N])}return D2(w,H1)||D2(w,tc)||D2(w,y2)||D2(w,lr)||D2(w,x4)||D2(w,S3)||D2(w,P4)||D2(w,A0(H1))?new c0(w,p,d,a,y):c.error(`Type ${Ll(w)} is not interpolatable.`)}evaluate(l){let c=this.labels,p=this.outputs;if(c.length===1)return p[0].evaluate(l);let d=this.input.evaluate(l);if(d=c[a-1])return p[a-1].evaluate(l);let h=R5(c,d),y=c0.interpolationFactor(this.interpolation,d,c[h],c[h+1]),w=p[h].evaluate(l),C=p[h+1].evaluate(l);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Vu(w,C,y);case"color":return ml.interpolate(w,C,y);case"padding":return x0.interpolate(w,C,y);case"colorArray":return t1.interpolate(w,C,y);case"numberArray":return Ml.interpolate(w,C,y);case"variableAnchorOffsetCollection":return T0.interpolate(w,C,y);case"array":return x5(w,C,y);case"projectionDefinition":return P0.interpolate(w,C,y)}case"interpolate-hcl":switch(this.type.kind){case"color":return ml.interpolate(w,C,y,"hcl");case"colorArray":return t1.interpolate(w,C,y,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return ml.interpolate(w,C,y,"lab");case"colorArray":return t1.interpolate(w,C,y,"lab")}}}eachChild(l){l(this.input);for(let c of this.outputs)l(c)}outputDefined(){return this.outputs.every((l)=>l.outputDefined())}}function k0(l,c,p,d){let a=d-p,h=l-p;return a===0?0:c===1?h/a:(Math.pow(c,h)-1)/(Math.pow(c,a)-1)}let n2={color:ml.interpolate,number:Vu,padding:x0.interpolate,numberArray:Ml.interpolate,colorArray:t1.interpolate,variableAnchorOffsetCollection:T0.interpolate,array:x5};class M4{constructor(l,c){this.type=l,this.args=c}static parse(l,c){if(l.lengths3(d,y.type));return new M4(h?fl:p,a)}evaluate(l){let c,p=null,d=0;for(let a of this.args)if(d++,p=a.evaluate(l),p&&p instanceof w2&&!p.available&&(c||(c=p.name),p=null,d===this.args.length&&(p=c)),p!==null)break;return p}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every((l)=>l.outputDefined())}}function K4(l,c){return l==="=="||l==="!="?c.kind==="boolean"||c.kind==="string"||c.kind==="number"||c.kind==="null"||c.kind==="value":c.kind==="string"||c.kind==="number"||c.kind==="value"}function h0(l,c,p,d){return d.compare(c,p)===0}function I5(l,c,p){let d=l!=="=="&&l!=="!=";return class a{constructor(h,y,w){this.type=al,this.lhs=h,this.rhs=y,this.collator=w,this.hasUntypedArgument=h.type.kind==="value"||y.type.kind==="value"}static parse(h,y){if(h.length!==3&&h.length!==4)return y.error("Expected two or three arguments.");let w=h[0],C=y.parse(h[1],1,fl);if(!C)return null;if(!K4(w,C.type))return y.concat(1).error(`"${w}" comparisons are not supported for type '${Ll(C.type)}'.`);let S=y.parse(h[2],2,fl);if(!S)return null;if(!K4(w,S.type))return y.concat(2).error(`"${w}" comparisons are not supported for type '${Ll(S.type)}'.`);if(C.type.kind!==S.type.kind&&C.type.kind!=="value"&&S.type.kind!=="value")return y.error(`Cannot compare types '${Ll(C.type)}' and '${Ll(S.type)}'.`);d&&(C.type.kind==="value"&&S.type.kind!=="value"?C=new l2(S.type,[C]):C.type.kind!=="value"&&S.type.kind==="value"&&(S=new l2(C.type,[S])));let L=null;if(h.length===4){if(C.type.kind!=="string"&&S.type.kind!=="string"&&C.type.kind!=="value"&&S.type.kind!=="value")return y.error("Cannot use collator to compare non-string types.");if(L=y.parse(h[3],3,F4),!L)return null}return new a(C,S,L)}evaluate(h){let y=this.lhs.evaluate(h),w=this.rhs.evaluate(h);if(d&&this.hasUntypedArgument){let C=_l(y),S=_l(w);if(C.kind!==S.kind||C.kind!=="string"&&C.kind!=="number")throw new Al(`Expected arguments for "${l}" to be (string, string) or (number, number), but found (${C.kind}, ${S.kind}) instead.`)}if(this.collator&&!d&&this.hasUntypedArgument){let C=_l(y),S=_l(w);if(C.kind!=="string"||S.kind!=="string")return c(h,y,w)}return this.collator?p(h,y,w,this.collator.evaluate(h)):c(h,y,w)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}let u7=I5("==",function(l,c,p){return c===p},h0),A9=I5("!=",function(l,c,p){return c!==p},function(l,c,p,d){return!h0(0,c,p,d)}),V9=I5("<",function(l,c,p){return c<p},function(l,c,p,d){return d.compare(c,p)",function(l,c,p){return c>p},function(l,c,p,d){return d.compare(c,p)>0}),mr=I5("<=",function(l,c,p){return c<=p},function(l,c,p,d){return d.compare(c,p)=",function(l,c,p){return c>=p},function(l,c,p,d){return d.compare(c,p)>=0});class O4{constructor(l,c,p){this.type=F4,this.locale=p,this.caseSensitive=l,this.diacriticSensitive=c}static parse(l,c){if(l.length!==2)return c.error("Expected one argument.");let p=l[1];if(typeof p!="object"||Array.isArray(p))return c.error("Collator options argument must be an object.");let d=c.parse(p["case-sensitive"]!==void 0&&p["case-sensitive"],1,al);if(!d)return null;let a=c.parse(p["diacritic-sensitive"]!==void 0&&p["diacritic-sensitive"],1,al);if(!a)return null;let h=null;return p.locale&&(h=c.parse(p.locale,1,rl),!h)?null:new O4(d,a,h)}evaluate(l){return new B4(this.caseSensitive.evaluate(l),this.diacriticSensitive.evaluate(l),this.locale?this.locale.evaluate(l):null)}eachChild(l){l(this.caseSensitive),l(this.diacriticSensitive),this.locale&&l(this.locale)}outputDefined(){return!1}}class gr{constructor(l,c,p,d,a,h){this.type=rl,this.number=l,this.locale=c,this.currency=p,this.unit=d,this.minFractionDigits=a,this.maxFractionDigits=h}static parse(l,c){if(l.length!==3)return c.error("Expected two arguments.");let p=c.parse(l[1],1,H1);if(!p)return null;let d=l[2];if(typeof d!="object"||Array.isArray(d))return c.error("NumberFormat options argument must be an object.");let a=null;if(d.locale&&(a=c.parse(d.locale,1,rl),!a))return null;let h=null;if(d.currency&&(h=c.parse(d.currency,1,rl),!h))return null;let y=null;if(d.unit&&(y=c.parse(d.unit,1,rl),!y))return null;if(h&&y)return c.error("NumberFormat options `currency` and `unit` are mutually exclusive");let w=null;if(d["min-fraction-digits"]&&(w=c.parse(d["min-fraction-digits"],1,H1),!w))return null;let C=null;return d["max-fraction-digits"]&&(C=c.parse(d["max-fraction-digits"],1,H1),!C)?null:new gr(p,a,h,y,w,C)}evaluate(l){return new Intl.NumberFormat(this.locale?this.locale.evaluate(l):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(l):void 0,unit:this.unit?this.unit.evaluate(l):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(l):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(l):void 0}).format(this.number.evaluate(l))}eachChild(l){l(this.number),this.locale&&l(this.locale),this.currency&&l(this.currency),this.unit&&l(this.unit),this.minFractionDigits&&l(this.minFractionDigits),this.maxFractionDigits&&l(this.maxFractionDigits)}outputDefined(){return!1}}class Y5{constructor(l){this.type=U4,this.sections=l}static parse(l,c){if(l.length<2)return c.error("Expected at least one argument.");let p=l[1];if(!Array.isArray(p)&&typeof p=="object")return c.error("First argument must be an image or text section.");let d=[],a=!1;for(let h=1;h{let p=c.content.evaluate(l);return _l(p)===E3?new z4("",p,null,null,null,c.verticalAlign?c.verticalAlign.evaluate(l):null):new z4(iu(p),null,c.scale?c.scale.evaluate(l):null,c.font?c.font.evaluate(l).join(","):null,c.textColor?c.textColor.evaluate(l):null,c.verticalAlign?c.verticalAlign.evaluate(l):null)}))}eachChild(l){for(let c of this.sections)l(c.content),c.scale&&l(c.scale),c.font&&l(c.font),c.textColor&&l(c.textColor),c.verticalAlign&&l(c.verticalAlign)}outputDefined(){return!1}}class U3{constructor(l){this.type=E3,this.input=l}static parse(l,c){if(l.length!==2)return c.error("Expected two arguments.");let p=c.parse(l[1],1,rl);return p?new U3(p):c.error("No image name provided.")}evaluate(l){let c=this.input.evaluate(l),p=w2.fromString(c);return p&&l.availableImages&&(p.available=l.availableImages.indexOf(c)>-1),p}eachChild(l){l(this.input)}outputDefined(){return!1}}class k2{constructor(l){this.type=H1,this.input=l}static parse(l,c){if(l.length!==2)return c.error(`Expected 1 argument, but found ${l.length-1} instead.`);let p=c.parse(l[1],1);return p?p.type.kind!=="array"&&p.type.kind!=="string"&&p.type.kind!=="value"?c.error(`Expected argument of type string or array, but found ${Ll(p.type)} instead.`):new k2(p):null}evaluate(l){let c=this.input.evaluate(l);if(typeof c=="string")return[...c].length;if(Array.isArray(c))return c.length;throw new Al(`Expected value to be of type string or array, but found ${Ll(_l(c))} instead.`)}eachChild(l){l(this.input)}outputDefined(){return!1}}let F2=8192;function vr(l,c){let p=(180+l[0])/360,d=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l[1]*Math.PI/360)))/360,a=Math.pow(2,c.z);return[Math.round(p*a*F2),Math.round(d*a*F2)]}function r7(l,c){let p=Math.pow(2,c.z);return[(a=(l[0]/F2+c.x)/p,360*a-180),(d=(l[1]/F2+c.y)/p,360/Math.PI*Math.atan(Math.exp((180-360*d)*Math.PI/180))-90)];var d,a}function tu(l,c){l[0]=Math.min(l[0],c[0]),l[1]=Math.min(l[1],c[1]),l[2]=Math.max(l[2],c[0]),l[3]=Math.max(l[3],c[1])}function Z4(l,c){return!(l[0]=c[2]||l[1]=c[3])}function N9(l,c,p){let d=l[0]-c[0],a=l[1]-c[1],h=l[0]-p[0],y=l[1]-p[1];return d*y-h*a==0&&d*h<=0&&a*y<=0}function ar(l,c,p,d){return(a=[d[0]-p[0],d[1]-p[1]])[0]*(h=[c[0]-l[0],c[1]-l[1]])[1]-a[1]*h[0]!=0&&!(!U9(l,c,p,d)||!U9(p,d,l,c));var a,h}function gd(l,c,p){for(let d of p)for(let a=0;a<d.length-1;++a)if(ar(l,c,d[a],d[a+1]))return!0;return!1}function qu(l,c,p=!1){let d=!1;for(let w of c)for(let C=0;C(a=l)[1]!=(y=w[C+1])[1]>a[1]&&a[0]<(y[0]-h[0])*(a[1]-h[1])/(y[1]-h[1])+h[0]&&(d=!d)}var a,h,y;return d}function q9(l,c){for(let p of c)if(qu(l,p))return!0;return!1}function p7(l,c){for(let p of l)if(!qu(p,c))return!1;for(let p=0;p0&&w<0||y0}function or(l,c,p){let d=[];for(let a=0;a<l.length;a++){let h=[];for(let y=0;y<l[a].length;y++){let w=vr(l[a][y],p);tu(c,w),h.push(w)}d.push(h)}return d}function x9(l,c,p){let d=[];for(let a=0;a<l.length;a++){let h=or(l[a],c,p);d.push(h)}return d}function P9(l,c,p,d){if(l[0]
p[2]){let a=0.5*d,h=l[0]-p[0]>a?-d:p[0]-l[0]>a?d:0;h===0&&(h=l[0]-p[2]>a?-d:p[2]-l[0]>a?d:0),l[0]+=h}tu(c,l)}function R9(l,c,p,d){let a=Math.pow(2,d.z)*F2,h=[d.x*F2,d.y*F2],y=[];for(let w of l)for(let C of w){let S=[C.x+h[0],C.y+h[1]];P9(S,c,p,a),y.push(S)}return y}function I9(l,c,p,d){let a=Math.pow(2,d.z)*F2,h=[d.x*F2,d.y*F2],y=[];for(let C of l){let S=[];for(let L of C){let s=[L.x+h[0],L.y+h[1]];tu(c,s),S.push(s)}y.push(S)}if(c[2]-c[0]pd?1:0){if(this.data=l,this.length=this.data.length,this.compare=c,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}push(l){this.data.push(l),this._up(this.length++)}pop(){if(this.length===0)return;let l=this.data[0],c=this.data.pop();return--this.length>0&&(this.data[0]=c,this._down(0)),l}peek(){return this.data[0]}_up(l){let{data:c,compare:p}=this,d=c[l];for(;l>0;){let a=l-1>>1,h=c[a];if(p(d,h)>=0)break;c[l]=h,l=a}c[l]=d}_down(l){let{data:c,compare:p}=this,d=this.length>>1,a=c[l];for(;l<d;){let h=1+(l<<1),y=h+1;if(y<this.length&&p(c[y],c[h])=0)break;c[l]=c[h],l=h}c[l]=a}};function d7(l,c,p=0,d=l.length-1,a=vd){for(;d>p;){if(d-p>600){let C=d-p+1,S=c-p+1,L=Math.log(C),s=0.5*Math.exp(2*L/3),U=0.5*Math.sqrt(L*s*(C-s)/C)*(S-C/20&&x3(l,p,d);y<w;){for(x3(l,y,w),y++,w--;a(l[y],h)0;)w--}a(l[p],h)===0?x3(l,p,w):(w++,x3(l,w,d)),w<=c&&(p=w+1),c<=w&&(d=w-1)}}function x3(l,c,p){let d=l[c];l[c]=l[p],l[p]=d}function vd(l,c){return lc?1:0}function hr(l,c){if(l.length<=1)return[l];let p=[],d,a;for(let h of l){let y=od(h);y!==0&&(h.area=Math.abs(y),a===void 0&&(a=y<0),a===y1)for(let h=0;h<p.length;h++)p[h].length<=c||(d7(p[h],c,1,p[h].length-1,ad),p[h]=p[h].slice(0,c));return p}function ad(l,c){return c.area-l.area}function od(l){let c=0;for(let p,d,a=0,h=l.length,y=h-1;a<h;y=a++)p=l[a],d=l[y],c+=(d.x-p.x)*(p.y+d.y);return c}let D4=0.0033528106647474805,Y9=D4*(2-D4),B9=Math.PI/180;class yr{constructor(l){let c=6378.137*B9*1000,p=Math.cos(l*B9),d=1/(1-Y9*(1-p*p)),a=Math.sqrt(d);this.kx=c*a*p,this.ky=c*a*d*(1-Y9)}distance(l,c){let p=this.wrap(l[0]-c[0])*this.kx,d=(l[1]-c[1])*this.ky;return Math.sqrt(p*p+d*d)}pointOnLine(l,c){let p,d,a,h,y=1/0;for(let w=0;w1?(C=l[w+1][0],S=l[w+1][1]):U>0&&(C+=L/this.kx*U,S+=s/this.ky*U)),L=this.wrap(c[0]-C)*this.kx,s=(c[1]-S)*this.ky;let N=L*L+s*s;N<y&&(y=N,p=C,d=S,a=w,h=U)}return{point:[p,d],index:a,t:Math.max(0,Math.min(1,h))}}wrap(l){for(;l180;)l-=360;return l}}function z9(l,c){return c[0]-l[0]}function P3(l){return l[1]-l[0]+1}function t2(l,c){return l[1]>=l[0]&&l[1]l[1])return[null,null];let p=P3(l);if(c){if(p===2)return[l,null];let a=Math.floor(p/2);return[[l[0],l[0]+a],[l[0]+a,l[1]]]}if(p===1)return[l,null];let d=Math.floor(p/2)-1;return[[l[0],l[0]+d],[l[0]+d+1,l[1]]]}function g7(l,c){if(!t2(c,l.length))return[1/0,1/0,-1/0,-1/0];let p=[1/0,1/0,-1/0,-1/0];for(let d=c[0];d<=c[1];++d)tu(p,l[d]);return p}function wr(l){let c=[1/0,1/0,-1/0,-1/0];for(let p of l)for(let d of p)tu(c,d);return c}function v7(l){return l[0]!==-1/0&&l[1]!==-1/0&&l[2]!==1/0&&l[3]!==1/0}function a7(l,c,p){if(!v7(l)||!v7(c))return NaN;let d=0,a=0;return l[2]c[2]&&(d=l[0]-c[2]),l[1]>c[3]&&(a=l[1]-c[3]),l[3]<c[1]&&(a=c[1]-l[3]),p.distance([0,0],[d,a])}function z5(l,c,p){let d=p.pointOnLine(c,l);return p.distance(l,d.point)}function o7(l,c,p,d,a){let h=Math.min(z5(l,[p,d],a),z5(c,[p,d],a)),y=Math.min(z5(p,[l,c],a),z5(d,[l,c],a));return Math.min(h,y)}function Q9(l,c,p,d,a){if(!t2(c,l.length)||!t2(d,p.length))return 1/0;let h=1/0;for(let y=c[0];y<c[1];++y){let w=l[y],C=l[y+1];for(let S=d[0];S<d[1];++S){let L=p[S],s=p[S+1];if(ar(w,C,L,s))return 0;h=Math.min(h,o7(w,C,L,s,a))}}return h}function hd(l,c,p,d,a){if(!t2(c,l.length)||!t2(d,p.length))return NaN;let h=1/0;for(let y=c[0];y<=c[1];++y)for(let w=d[0];w<=d[1];++w)if(h=Math.min(h,a.distance(l[y],p[w])),h===0)return h;return h}function H9(l,c,p){if(qu(l,c,!0))return 0;let d=1/0;for(let a of c){let h=a[0],y=a[a.length-1];if(h!==y&&(d=Math.min(d,z5(l,[y,h],p)),d===0))return d;let w=p.pointOnLine(a,l);if(d=Math.min(d,p.distance(l,w.point)),d===0)return d}return d}function yd(l,c,p,d){if(!t2(c,l.length))return NaN;for(let h=c[0];h<=c[1];++h)if(qu(l[h],p,!0))return 0;let a=1/0;for(let h=c[0];h<c[1];++h){let y=l[h],w=l[h+1];for(let C of p)for(let S=0,L=C.length,s=L-1;S=d)return d;if(Z4(a,h)){if(h7(l,c))return 0}else if(h7(c,l))return 0;let y=1/0;for(let w of l)for(let C=0,S=w.length,L=S-1;C<S;L=C++){let s=w[L],U=w[C];for(let N of c)for(let R=0,P=N.length,B=P-1;R<P;B=R++){let H=N[B],O=N[R];if(ar(s,U,H,O))return 0;y=Math.min(y,o7(s,U,H,O,p))}}return y}function y7(l,c,p,d,a,h){if(!h)return;let y=a7(g7(d,h),a,p);y<c&&l.push([y,h,[0,0]])}function T4(l,c,p,d,a,h,y){if(!h||!y)return;let w=a7(g7(d,h),g7(a,y),p);w0;){let C=y.pop();if(C[0]>=h)continue;let S=C[1],L=c?50:100;if(P3(S)<=L){if(!t2(S,l.length))return NaN;if(c){let s=yd(l,S,p,d);if(isNaN(s)||s===0)return s;h=Math.min(h,s)}else for(let s=S[0];s0;){let C=w.pop();if(C[0]>=y)continue;let S=C[1],L=C[2],s=c?50:100,U=d?50:100;if(P3(S)<=s&&P3(L)<=U){if(!t2(S,l.length)&&t2(L,p.length))return NaN;let N;if(c&&d)N=Q9(l,S,p,L,a),y=Math.min(y,N);else if(c&&!d){let R=l.slice(S[0],S[1]+1);for(let P=L[0];P<=L[1];++P)if(N=z5(p[P],R,a),y=Math.min(y,N),y===0)return y}else if(!c&&d){let R=p.slice(L[0],L[1]+1);for(let P=S[0];P({type:"Polygon",coordinates:c})):l.type==="MultiLineString"?l.coordinates.map((c)=>({type:"LineString",coordinates:c})):l.type==="MultiPoint"?l.coordinates.map((c)=>({type:"Point",coordinates:c})):[l]}class l5{constructor(l,c){this.type=H1,this.geojson=l,this.geometries=c}static parse(l,c){if(l.length!==2)return c.error(`'distance' expression requires exactly one argument, but found ${l.length-1} instead.`);if(_u(l[1])){let p=l[1];if(p.type==="FeatureCollection")return new l5(p,p.features.map((d)=>nr(d.geometry)).flat());if(p.type==="Feature")return new l5(p,nr(p.geometry));if("type"in p&&"coordinates"in p)return new l5(p,nr(p))}return c.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(l){if(l.geometry()!=null&&l.canonicalID()!=null){if(l.geometryType()==="Point")return function(c,p){let d=c.geometry(),a=d.flat().map((w)=>r7([w.x,w.y],c.canonical));if(d.length===0)return NaN;let h=new yr(a[0][1]),y=1/0;for(let w of p){switch(w.type){case"Point":y=Math.min(y,X4(a,!1,[w.coordinates],!1,h,y));break;case"LineString":y=Math.min(y,X4(a,!1,w.coordinates,!0,h,y));break;case"Polygon":y=Math.min(y,G4(a,!1,w.coordinates,h,y))}if(y===0)return y}return y}(l,this.geometries);if(l.geometryType()==="LineString")return function(c,p){let d=c.geometry(),a=d.flat().map((w)=>r7([w.x,w.y],c.canonical));if(d.length===0)return NaN;let h=new yr(a[0][1]),y=1/0;for(let w of p){switch(w.type){case"Point":y=Math.min(y,X4(a,!0,[w.coordinates],!1,h,y));break;case"LineString":y=Math.min(y,X4(a,!0,w.coordinates,!0,h,y));break;case"Polygon":y=Math.min(y,G4(a,!0,w.coordinates,h,y))}if(y===0)return y}return y}(l,this.geometries);if(l.geometryType()==="Polygon")return function(c,p){let d=c.geometry();if(d.length===0||d[0].length===0)return NaN;let a=hr(d,0).map((w)=>w.map((C)=>C.map((S)=>r7([S.x,S.y],c.canonical)))),h=new yr(a[0][0][0][1]),y=1/0;for(let w of p)for(let C of a){switch(w.type){case"Point":y=Math.min(y,G4([w.coordinates],!1,C,h,y));break;case"LineString":y=Math.min(y,G4(w.coordinates,!0,C,h,y));break;case"Polygon":y=Math.min(y,El(C,w.coordinates,h,y))}if(y===0)return y}return y}(l,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class R3{constructor(l){this.type=fl,this.key=l}static parse(l,c){if(l.length!==2)return c.error(`Expected 1 argument, but found ${l.length-1} instead.`);let p=l[1];return p==null?c.error("Global state property must be defined."):typeof p!="string"?c.error(`Global state property must be string, but found ${typeof l[1]} instead.`):new R3(p)}evaluate(l){var c;let p=(c=l.globals)===null||c===void 0?void 0:c.globalState;return p&&Object.keys(p).length!==0?I4(p,this.key):null}eachChild(){}outputDefined(){return!1}}let Q5={"==":u7,"!=":A9,">":F3,"=":c7,"!Array.isArray(C)||C.length===l.length-1),w=null;for(let[C,S]of y){w=new eu(c.registry,J4,c.path,null,c.scope);let L=[],s=!1;for(let U=1;U<l.length;U++){let N=l[U],R=Array.isArray(C)?C[U-1]:C.type,P=w.parse(N,1+L.length,R);if(!P){s=!0;break}L.push(P)}if(!s)if(Array.isArray(C)&&C.length!==L.length)w.error(`Expected ${C.length} arguments, but found ${L.length} instead.`);else{for(let U=0;U{return s=L,Array.isArray(s)?`(${s.map(Ll).join(", ")})`:`(${Ll(s.type)}...)`;var s}).join(" | "),S=[];for(let L=1;L{p=c?p&&J4(d):p&&d instanceof e2}),!!p&&j4(l)&&b4(l,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function j4(l){if(l instanceof S2){if(l.name==="get"&&l.args.length===1)return!1;if(l.name==="feature-state")return!1;if(l.name==="has"&&l.args.length===1)return!1;if(l.name==="properties"||l.name==="geometry-type"||l.name==="id")return!1;if(/^filter-/.test(l.name))return!1}if(l instanceof B5)return!1;if(l instanceof l5)return!1;let c=!0;return l.eachChild((p)=>{c&&!j4(p)&&(c=!1)}),c}function I3(l){if(l instanceof S2&&l.name==="feature-state")return!1;let c=!0;return l.eachChild((p)=>{c&&!I3(p)&&(c=!1)}),c}function b4(l,c){if(l instanceof S2&&c.indexOf(l.name)>=0)return!1;let p=!0;return l.eachChild((d)=>{p&&!b4(d,c)&&(p=!1)}),p}function k7(l){return{result:"success",value:l}}function H5(l){return{result:"error",value:l}}function M5(l){return l["property-type"]==="data-driven"||l["property-type"]==="cross-faded-data-driven"}function S7(l){return!!l.expression&&l.expression.parameters.indexOf("zoom")>-1}function Sr(l){return!!l.expression&&l.expression.interpolated}function gl(l){return l instanceof Number?"number":l instanceof String?"string":l instanceof Boolean?"boolean":Array.isArray(l)?"array":l===null?"null":typeof l}function $4(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&_l(l)===Au}function M9(l){return l}function E7(l,c){let p=l.stops&&typeof l.stops[0][0]=="object",d=p||!(p||l.property!==void 0),a=l.type||(Sr(c)?"exponential":"interval"),h=function(L){switch(L.type){case"color":return ml.parse;case"padding":return x0.parse;case"numberArray":return Ml.parse;case"colorArray":return t1.parse;default:return null}}(c);if(h&&((l=ju({},l)).stops&&(l.stops=l.stops.map((L)=>[L[0],h(L[1])])),l.default=h(l.default?l.default:c.default)),l.colorSpace&&(y=l.colorSpace)!=="rgb"&&y!=="hcl"&&y!=="lab")throw Error(`Unknown color space: "${l.colorSpace}"`);var y;let w=function(L){switch(L){case"exponential":return s7;case"interval":return O9;case"categorical":return K9;case"identity":return Z9;default:throw Error(`Unknown function type "${L}"`)}}(a),C,S;if(a==="categorical"){C=Object.create(null);for(let L of l.stops)C[L[0]]=L[1];S=typeof l.stops[0][0]}if(p){let L={},s=[];for(let R=0;RR[0]),evaluate:({zoom:R},P)=>s7({stops:U,base:l.base},c,R).evaluate(R,P)}}if(d){let L=a==="exponential"?{name:"exponential",base:l.base!==void 0?l.base:1}:null;return{kind:"camera",interpolationType:L,interpolationFactor:c0.interpolationFactor.bind(void 0,L),zoomStops:l.stops.map((s)=>s[0]),evaluate:({zoom:s})=>w(l,c,s,C,S)}}return{kind:"source",evaluate(L,s){let U=s&&s.properties?s.properties[l.property]:void 0;return U===void 0?Y3(l.default,c.default):w(l,c,U,C,S)}}}function Y3(l,c,p){return l!==void 0?l:c!==void 0?c:p!==void 0?p:void 0}function K9(l,c,p,d,a){return Y3(typeof p===a?d[p]:void 0,l.default,c.default)}function O9(l,c,p){if(gl(p)!=="number")return Y3(l.default,c.default);let d=l.stops.length;if(d===1)return l.stops[0][1];if(p=l.stops[d-1][0])return l.stops[d-1][1];let a=R5(l.stops.map((h)=>h[0]),p);return l.stops[a][1]}function s7(l,c,p){let d=l.base!==void 0?l.base:1;if(gl(p)!=="number")return Y3(l.default,c.default);let a=l.stops.length;if(a===1)return l.stops[0][1];if(p=l.stops[a-1][0])return l.stops[a-1][1];let h=R5(l.stops.map((L)=>L[0]),p),y=function(L,s,U,N){let R=N-U,P=L-U;return R===0?0:s===1?P/R:(Math.pow(s,P)-1)/(Math.pow(s,R)-1)}(p,d,l.stops[h][0],l.stops[h+1][0]),w=l.stops[h][1],C=l.stops[h+1][1],S=n2[c.type]||M9;return typeof w.evaluate=="function"?{evaluate(...L){let s=w.evaluate.apply(void 0,L),U=C.evaluate.apply(void 0,L);if(s!==void 0&&U!==void 0)return S(s,U,y,l.colorSpace)}}:S(w,C,y,l.colorSpace)}function Z9(l,c,p){switch(c.type){case"color":p=ml.parse(p);break;case"formatted":p=D0.fromString(p.toString());break;case"resolvedImage":p=w2.fromString(p.toString());break;case"padding":p=x0.parse(p);break;case"colorArray":p=t1.parse(p);break;case"numberArray":p=Ml.parse(p);break;default:gl(p)===c.type||c.type==="enum"&&c.values[p]||(p=void 0)}return Y3(p,l.default,c.default)}S2.register(Q5,{error:[{kind:"error"},[rl],(l,[c])=>{throw new Al(c.evaluate(l))}],typeof:[rl,[fl],(l,[c])=>Ll(_l(c.evaluate(l)))],"to-rgba":[A0(H1,4),[y2],(l,[c])=>{let[p,d,a,h]=c.evaluate(l).rgb;return[255*p,255*d,255*a,h]}],rgb:[y2,[H1,H1,H1],w7],rgba:[y2,[H1,H1,H1,H1],w7],has:{type:al,overloads:[[[rl],(l,[c])=>n7(c.evaluate(l),l.properties())],[[rl,Au],(l,[c,p])=>n7(c.evaluate(l),p.evaluate(l))]]},get:{type:fl,overloads:[[[rl],(l,[c])=>kr(c.evaluate(l),l.properties())],[[rl,Au],(l,[c,p])=>kr(c.evaluate(l),p.evaluate(l))]]},"feature-state":[fl,[rl],(l,[c])=>kr(c.evaluate(l),l.featureState||{})],properties:[Au,[],(l)=>l.properties()],"geometry-type":[rl,[],(l)=>l.geometryType()],id:[fl,[],(l)=>l.id()],zoom:[H1,[],(l)=>l.globals.zoom],"heatmap-density":[H1,[],(l)=>l.globals.heatmapDensity||0],elevation:[H1,[],(l)=>l.globals.elevation||0],"line-progress":[H1,[],(l)=>l.globals.lineProgress||0],accumulated:[fl,[],(l)=>l.globals.accumulated===void 0?null:l.globals.accumulated],"+":[H1,u5(H1),(l,c)=>{let p=0;for(let d of c)p+=d.evaluate(l);return p}],"*":[H1,u5(H1),(l,c)=>{let p=1;for(let d of c)p*=d.evaluate(l);return p}],"-":{type:H1,overloads:[[[H1,H1],(l,[c,p])=>c.evaluate(l)-p.evaluate(l)],[[H1],(l,[c])=>-c.evaluate(l)]]},"/":[H1,[H1,H1],(l,[c,p])=>c.evaluate(l)/p.evaluate(l)],"%":[H1,[H1,H1],(l,[c,p])=>c.evaluate(l)%p.evaluate(l)],ln2:[H1,[],()=>Math.LN2],pi:[H1,[],()=>Math.PI],e:[H1,[],()=>Math.E],"^":[H1,[H1,H1],(l,[c,p])=>Math.pow(c.evaluate(l),p.evaluate(l))],sqrt:[H1,[H1],(l,[c])=>Math.sqrt(c.evaluate(l))],log10:[H1,[H1],(l,[c])=>Math.log(c.evaluate(l))/Math.LN10],ln:[H1,[H1],(l,[c])=>Math.log(c.evaluate(l))],log2:[H1,[H1],(l,[c])=>Math.log(c.evaluate(l))/Math.LN2],sin:[H1,[H1],(l,[c])=>Math.sin(c.evaluate(l))],cos:[H1,[H1],(l,[c])=>Math.cos(c.evaluate(l))],tan:[H1,[H1],(l,[c])=>Math.tan(c.evaluate(l))],asin:[H1,[H1],(l,[c])=>Math.asin(c.evaluate(l))],acos:[H1,[H1],(l,[c])=>Math.acos(c.evaluate(l))],atan:[H1,[H1],(l,[c])=>Math.atan(c.evaluate(l))],min:[H1,u5(H1),(l,c)=>Math.min(...c.map((p)=>p.evaluate(l)))],max:[H1,u5(H1),(l,c)=>Math.max(...c.map((p)=>p.evaluate(l)))],abs:[H1,[H1],(l,[c])=>Math.abs(c.evaluate(l))],round:[H1,[H1],(l,[c])=>{let p=c.evaluate(l);return pMath.floor(c.evaluate(l))],ceil:[H1,[H1],(l,[c])=>Math.ceil(c.evaluate(l))],"filter-==":[al,[rl,fl],(l,[c,p])=>l.properties()[c.value]===p.value],"filter-id-==":[al,[fl],(l,[c])=>l.id()===c.value],"filter-type-==":[al,[rl],(l,[c])=>l.geometryType()===c.value],"filter-{let d=l.properties()[c.value],a=p.value;return typeof d==typeof a&&d<a}],"filter-id-{let p=l.id(),d=c.value;return typeof p==typeof d&&p":[al,[rl,fl],(l,[c,p])=>{let d=l.properties()[c.value],a=p.value;return typeof d==typeof a&&d>a}],"filter-id->":[al,[fl],(l,[c])=>{let p=l.id(),d=c.value;return typeof p==typeof d&&p>d}],"filter-{let d=l.properties()[c.value],a=p.value;return typeof d==typeof a&&d<=a}],"filter-id-{let p=l.id(),d=c.value;return typeof p==typeof d&&p=":[al,[rl,fl],(l,[c,p])=>{let d=l.properties()[c.value],a=p.value;return typeof d==typeof a&&d>=a}],"filter-id->=":[al,[fl],(l,[c])=>{let p=l.id(),d=c.value;return typeof p==typeof d&&p>=d}],"filter-has":[al,[fl],(l,[c])=>(c.value in l.properties())],"filter-has-id":[al,[],(l)=>l.id()!==null&&l.id()!==void 0],"filter-type-in":[al,[A0(rl)],(l,[c])=>c.value.indexOf(l.geometryType())>=0],"filter-id-in":[al,[A0(fl)],(l,[c])=>c.value.indexOf(l.id())>=0],"filter-in-small":[al,[rl,A0(fl)],(l,[c,p])=>p.value.indexOf(l.properties()[c.value])>=0],"filter-in-large":[al,[rl,A0(fl)],(l,[c,p])=>function(d,a,h,y){for(;h>1;if(a[w]===d)return!0;a[w]>d?y=w-1:h=w+1}return!1}(l.properties()[c.value],p.value,0,p.value.length-1)],all:{type:al,overloads:[[[al,al],(l,[c,p])=>c.evaluate(l)&&p.evaluate(l)],[u5(al),(l,c)=>{for(let p of c)if(!p.evaluate(l))return!1;return!0}]]},any:{type:al,overloads:[[[al,al],(l,[c,p])=>c.evaluate(l)||p.evaluate(l)],[u5(al),(l,c)=>{for(let p of c)if(p.evaluate(l))return!0;return!1}]]},"!":[al,[al],(l,[c])=>!c.evaluate(l)],"is-supported-script":[al,[rl],(l,[c])=>{let p=l.globals&&l.globals.isSupportedScript;return!p||p(c.evaluate(l))}],upcase:[rl,[rl],(l,[c])=>c.evaluate(l).toUpperCase()],downcase:[rl,[rl],(l,[c])=>c.evaluate(l).toLowerCase()],concat:[rl,u5(fl),(l,c)=>c.map((p)=>iu(p.evaluate(l))).join("")],split:[A0(rl),[rl,rl],(l,[c,p])=>c.evaluate(l).split(p.evaluate(l))],join:[rl,[A0(rl),rl],(l,[c,p])=>c.evaluate(l).join(p.evaluate(l))],"resolved-locale":[rl,[F4],(l,[c])=>c.evaluate(l).resolvedLocale()]});class K5{constructor(l,c,p){this.expression=l,this._warningHistory={},this._evaluator=new dr,this._defaultValue=c?function(d){if(d.type==="color"&&$4(d.default))return new ml(0,0,0,0);switch(d.type){case"color":return ml.parse(d.default)||null;case"padding":return x0.parse(d.default)||null;case"numberArray":return Ml.parse(d.default)||null;case"colorArray":return t1.parse(d.default)||null;case"variableAnchorOffsetCollection":return T0.parse(d.default)||null;case"projectionDefinition":return P0.parse(d.default)||null;default:return d.default===void 0?null:d.default}}(c):null,this._enumValues=c&&c.type==="enum"?c.values:null,this._globalState=p}evaluateWithoutErrorHandling(l,c,p,d,a,h){return this._globalState&&(l=H3(l,this._globalState)),this._evaluator.globals=l,this._evaluator.feature=c,this._evaluator.featureState=p,this._evaluator.canonical=d,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=h,this.expression.evaluate(this._evaluator)}evaluate(l,c,p,d,a,h){this._globalState&&(l=H3(l,this._globalState)),this._evaluator.globals=l,this._evaluator.feature=c||null,this._evaluator.featureState=p||null,this._evaluator.canonical=d,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=h||null;try{let y=this.expression.evaluate(this._evaluator);if(y==null||typeof y=="number"&&y!=y)return this._defaultValue;if(this._enumValues&&!(y in this._enumValues))throw new Al(`Expected value to be one of ${Object.keys(this._enumValues).map((w)=>JSON.stringify(w)).join(", ")}, but found ${JSON.stringify(y)} instead.`);return y}catch(y){return this._warningHistory[y.message]||(this._warningHistory[y.message]=!0,typeof console0&&typeof l[0]=="string"&&l[0]in Q5}function B3(l,c,p){let d=new eu(Q5,J4,[],c?function(h){let y={color:y2,string:rl,number:H1,enum:rl,boolean:al,formatted:U4,padding:lr,numberArray:x4,colorArray:S3,projectionDefinition:tc,resolvedImage:E3,variableAnchorOffsetCollection:P4};return h.type==="array"?A0(y[h.value]||fl,h.length):y[h.type]}(c):void 0),a=d.parse(l,void 0,void 0,void 0,c&&c.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?k7(new K5(a,c,p)):H5(d.errors)}class z3{constructor(l,c,p){this.kind=l,this._styleExpression=c,this.isStateDependent=l!=="constant"&&!I3(c.expression),this.globalStateRefs=Q3(c.expression),this._globalState=p}evaluateWithoutErrorHandling(l,c,p,d,a,h){return this._globalState&&(l=H3(l,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(l,c,p,d,a,h)}evaluate(l,c,p,d,a,h){return this._globalState&&(l=H3(l,this._globalState)),this._styleExpression.evaluate(l,c,p,d,a,h)}}class i4{constructor(l,c,p,d,a){this.kind=l,this.zoomStops=p,this._styleExpression=c,this.isStateDependent=l!=="camera"&&!I3(c.expression),this.globalStateRefs=Q3(c.expression),this.interpolationType=d,this._globalState=a}evaluateWithoutErrorHandling(l,c,p,d,a,h){return this._globalState&&(l=H3(l,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(l,c,p,d,a,h)}evaluate(l,c,p,d,a,h){return this._globalState&&(l=H3(l,this._globalState)),this._styleExpression.evaluate(l,c,p,d,a,h)}interpolationFactor(l,c,p){return this.interpolationType?c0.interpolationFactor(this.interpolationType,l,c,p):0}}function C7(l,c,p){let d=B3(l,c,p);if(d.result==="error")return d;let a=d.value.expression,h=j4(a);if(!h&&!M5(c))return H5([new n0("","data expressions not supported")]);let y=b4(a,["zoom"]);if(!y&&!S7(c))return H5([new n0("","zoom expressions not supported")]);let w=O5(a);return w||y?w instanceof n0?H5([w]):w instanceof c0&&!Sr(c)?H5([new n0("",'"interpolate" expressions cannot be used with this property')]):k7(w?new i4(h?"camera":"composite",d.value,w.labels,w instanceof c0?w.interpolation:void 0,p):new z3(h?"constant":"source",d.value,p)):H5([new n0("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class e4{constructor(l,c){this._parameters=l,this._specification=c,ju(this,E7(this._parameters,this._specification))}static deserialize(l){return new e4(l._parameters,l._specification)}static serialize(l){return{_parameters:l._parameters,_specification:l._specification}}}function O5(l){let c=null;if(l instanceof Nl)c=O5(l.result);else if(l instanceof M4){for(let p of l.args)if(c=O5(p),c)break}else(l instanceof q3||l instanceof c0)&&l.input instanceof S2&&l.input.name==="zoom"&&(c=l);return c instanceof n0||l.eachChild((p)=>{let d=O5(p);d instanceof n0?c=d:!c&&d?c=new n0("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):c&&d&&c!==d&&(c=new n0("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),c}function Q3(l,c=new Set){return l instanceof R3&&c.add(l.key),l.eachChild((p)=>{Q3(p,c)}),c}function H3(l,c){let{zoom:p,heatmapDensity:d,elevation:a,lineProgress:h,isSupportedScript:y,accumulated:w}=l!=null?l:{};return{zoom:p,heatmapDensity:d,elevation:a,lineProgress:h,isSupportedScript:y,accumulated:w,globalState:c}}function W7(l){if(l===!0||l===!1)return!0;if(!Array.isArray(l)||l.length===0)return!1;switch(l[0]){case"has":return l.length>=2&&l[1]!=="$id"&&l[1]!=="$type";case"in":return l.length>=3&&(typeof l[1]!="string"||Array.isArray(l[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};W7(l)||(l=lc(l));let p=B3(l,wd,c);if(p.result==="error")throw Error(p.value.map((d)=>`${d.key}: ${d.message}`).join(", "));return{filter:(d,a,h)=>p.value.evaluate(d,a,{},h),needGeometry:L7(l),getGlobalStateRefs:()=>Q3(p.value.expression)}}function nd(l,c){return lc?1:0}function L7(l){if(!Array.isArray(l))return!1;if(l[0]==="within"||l[0]==="distance")return!0;for(let c=1;c<l.length;c++)if(L7(l[c]))return!0;return!1}function lc(l){if(!l)return!0;let c=l[0];return l.length<=1?c!=="any":c==="=="?A7(l[1],l[2],"=="):c==="!="?uc(A7(l[1],l[2],"==")):c===""||c==="="?A7(l[1],l[2],c):c==="any"?(p=l.slice(1),["any"].concat(p.map(lc))):c==="all"?["all"].concat(l.slice(1).map(lc)):c==="none"?["all"].concat(l.slice(1).map(lc).map(uc)):c==="in"?D9(l[1],l.slice(2)):c==="!in"?uc(D9(l[1],l.slice(2))):c==="has"?V7(l[1]):c!=="!has"||uc(V7(l[1]));var p}function A7(l,c,p){switch(l){case"$type":return[`filter-type-${p}`,c];case"$id":return[`filter-id-${p}`,c];default:return[`filter-${p}`,l,c]}}function D9(l,c){if(c.length===0)return!1;switch(l){case"$type":return["filter-type-in",["literal",c]];case"$id":return["filter-id-in",["literal",c]];default:return c.length>200&&!c.some((p)=>typeof p!=typeof c[0])?["filter-in-large",l,["literal",c.sort(nd)]]:["filter-in-small",l,["literal",c]]}}function V7(l){switch(l){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",l]}}function uc(l){return["!",l]}function Er(l){let c=typeof l;if(c==="number"||c==="boolean"||c==="string"||l==null)return JSON.stringify(l);if(Array.isArray(l)){let a="[";for(let h of l)a+=`${Er(h)},`;return`${a}]`}let p=Object.keys(l).sort(),d="{";for(let a=0;a<p.length;a++)d+=`${JSON.stringify(p[a])}:${Er(l[p[a]])},`;return`${d}}`}function kd(l){let c="";for(let p of Z6)c+=`/${Er(l[p])}`;return c}function T9(l){let c=l.value;return c?[new R1(l.key,c,"constants have been deprecated as of v8")]:[]}function il(l){return l instanceof Number||l instanceof String||l instanceof Boolean?l.valueOf():l}function Z5(l){if(Array.isArray(l))return l.map(Z5);if(l instanceof Object&&!(l instanceof Number||l instanceof String||l instanceof Boolean)){let c={};for(let p in l)c[p]=Z5(l[p]);return c}return il(l)}function u2(l){let{key:c,value:p}=l,d=l.valueSpec||{},a=l.objectElementValidators||{},h=l.style,y=l.styleSpec,w=l.validateSpec,C=[],S=gl(p);if(S!=="object")return[new R1(c,p,`object expected, ${S} found`)];for(let L in p){let s=L.split(".")[0],U=I4(d,s)||d["*"],N;if(I4(a,s))N=a[s];else if(I4(d,s)){if(p[L]===void 0)continue;N=w}else if(a["*"])N=a["*"];else{if(!d["*"]){C.push(new R1(c,p[L],`unknown property "${L}"`));continue}N=w}C=C.concat(N({key:(c?`${c}.`:c)+L,value:p[L],valueSpec:U,style:h,styleSpec:y,object:p,objectKey:L,validateSpec:w},p))}for(let L in d)a[L]||d[L].required&&d[L].default===void 0&&p[L]===void 0&&C.push(new R1(c,p,`missing required property "${L}"`));return C}function sr(l){let{value:c,valueSpec:p,style:d,styleSpec:a,key:h}=l,y=l.arrayElementValidator||l.validateSpec;if(gl(c)!=="array")return[new R1(h,c,`array expected, ${gl(c)} found`)];if(p.length&&c.length!==p.length)return[new R1(h,c,`array length ${p.length} expected, length ${c.length} found`)];let w={type:p.value,values:p.values};a.$version<7&&(w.function=p.function),gl(p.value)==="object"&&(w=p.value);let C=[];for(let S=0;S<c.length;S++)C=C.concat(y({array:c,arrayIndex:S,value:c[S],valueSpec:w,validateSpec:l.validateSpec,style:d,styleSpec:a,key:`${h}[${S}]`}));return C}function M3(l){let{key:c,value:p,valueSpec:d}=l,a=gl(p);return a==="number"&&p!=p&&(a="NaN"),a!=="number"?[new R1(c,p,`number expected, ${a} found`)]:("minimum"in d)&&pd.maximum?[new R1(c,p,`${p} is greater than the maximum value ${d.maximum}`)]:[]}function Cr(l){let c=l.valueSpec,p=il(l.value.type),d,a,h,y={},w=p!=="categorical"&&l.value.property===void 0,C=!w,S=gl(l.value.stops)==="array"&&gl(l.value.stops[0])==="array"&&gl(l.value.stops[0][0])==="object",L=u2({key:l.key,value:l.value,valueSpec:l.styleSpec.function,validateSpec:l.validateSpec,style:l.style,styleSpec:l.styleSpec,objectElementValidators:{stops:function(N){if(p==="identity")return[new R1(N.key,N.value,'identity function may not have a "stops" property')];let R=[],P=N.value;return R=R.concat(sr({key:N.key,value:P,valueSpec:N.valueSpec,validateSpec:N.validateSpec,style:N.style,styleSpec:N.styleSpec,arrayElementValidator:s})),gl(P)==="array"&&P.length===0&&R.push(new R1(N.key,P,"array must have at least one stop")),R},default:function(N){return N.validateSpec({key:N.key,value:N.value,valueSpec:c,validateSpec:N.validateSpec,style:N.style,styleSpec:N.styleSpec})}}});return p==="identity"&&w&&L.push(new R1(l.key,l.value,'missing required property "property"')),p==="identity"||l.value.stops||L.push(new R1(l.key,l.value,'missing required property "stops"')),p==="exponential"&&l.valueSpec.expression&&!Sr(l.valueSpec)&&L.push(new R1(l.key,l.value,"exponential functions not supported")),l.styleSpec.$version>=8&&(C&&!M5(l.valueSpec)?L.push(new R1(l.key,l.value,"property functions not supported")):w&&!S7(l.valueSpec)&&L.push(new R1(l.key,l.value,"zoom functions not supported"))),p!=="categorical"&&!S||l.value.property!==void 0||L.push(new R1(l.key,l.value,'"property" property is required')),L;function s(N){let R=[],P=N.value,B=N.key;if(gl(P)!=="array")return[new R1(B,P,`array expected, ${gl(P)} found`)];if(P.length!==2)return[new R1(B,P,`array length 2 expected, length ${P.length} found`)];if(S){if(gl(P[0])!=="object")return[new R1(B,P,`object expected, ${gl(P[0])} found`)];if(P[0].zoom===void 0)return[new R1(B,P,"object stop key must have zoom")];if(P[0].value===void 0)return[new R1(B,P,"object stop key must have value")];if(h&&h>il(P[0].zoom))return[new R1(B,P[0].zoom,"stop zoom values must appear in ascending order")];il(P[0].zoom)!==h&&(h=il(P[0].zoom),a=void 0,y={}),R=R.concat(u2({key:`${B}[0]`,value:P[0],valueSpec:{zoom:{}},validateSpec:N.validateSpec,style:N.style,styleSpec:N.styleSpec,objectElementValidators:{zoom:M3,value:U}}))}else R=R.concat(U({key:`${B}[0]`,value:P[0],validateSpec:N.validateSpec,style:N.style,styleSpec:N.styleSpec},P));return _4(Z5(P[1]))?R.concat([new R1(`${B}[1]`,P[1],"expressions are not allowed in function stops.")]):R.concat(N.validateSpec({key:`${B}[1]`,value:P[1],valueSpec:c,validateSpec:N.validateSpec,style:N.style,styleSpec:N.styleSpec}))}function U(N,R){let P=gl(N.value),B=il(N.value),H=N.value!==null?N.value:R;if(d){if(P!==d)return[new R1(N.key,H,`${P} stop domain type must match previous stop domain type ${d}`)]}else d=P;if(P!=="number"&&P!=="string"&&P!=="boolean")return[new R1(N.key,H,"stop domain value must be a number, string, or boolean")];if(P!=="number"&&p!=="categorical"){let O=`number expected, ${P} found`;return M5(c)&&p===void 0&&(O+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new R1(N.key,H,O)]}return p!=="categorical"||P!=="number"||isFinite(B)&&Math.floor(B)===B?p!=="categorical"&&P==="number"&&a!==void 0&&Bnew R1(`${l.key}${d.key}`,l.value,d.message));let p=c.value.expression||c.value._styleExpression.expression;if(l.expressionContext==="property"&&l.propertyKey==="text-font"&&!p.outputDefined())return[new R1(l.key,l.value,`Invalid data expression for "${l.propertyKey}". Output values must be contained as literals within the expression.`)];if(l.expressionContext==="property"&&l.propertyType==="layout"&&!I3(p))return[new R1(l.key,l.value,'"feature-state" data expressions are not supported with layout properties.')];if(l.expressionContext==="filter"&&!I3(p))return[new R1(l.key,l.value,'"feature-state" data expressions are not supported with filters.')];if(l.expressionContext&&l.expressionContext.indexOf("cluster")===0){if(!b4(p,["zoom","feature-state"]))return[new R1(l.key,l.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(l.expressionContext==="cluster-initial"&&!j4(p))return[new R1(l.key,l.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function cc(l){let{key:c,value:p}=l,d=gl(p);return d!=="string"?[new R1(c,p,`color expected, ${d} found`)]:ml.parse(String(p))?[]:[new R1(c,p,`color expected, "${p}" found`)]}function D5(l){let{key:c,value:p,valueSpec:d}=l,a=[];return Array.isArray(d.values)?d.values.indexOf(il(p))===-1&&a.push(new R1(c,p,`expected one of [${d.values.join(", ")}], ${JSON.stringify(p)} found`)):Object.keys(d.values).indexOf(il(p))===-1&&a.push(new R1(c,p,`expected one of [${Object.keys(d.values).join(", ")}], ${JSON.stringify(p)} found`)),a}function K3(l){return W7(Z5(l.value))?c5(ju({},l,{expressionContext:"filter",valueSpec:{value:"boolean"}})):G9(l)}function G9(l){let{value:c,key:p}=l;if(gl(c)!=="array")return[new R1(p,c,`array expected, ${gl(c)} found`)];let d=l.styleSpec,a,h=[];if(c.length<1)return[new R1(p,c,"filter array must have at least 1 element")];switch(h=h.concat(D5({key:`${p}[0]`,value:c[0],valueSpec:d.filter_operator,style:l.style,styleSpec:l.styleSpec})),il(c[0])){case"<":case"":case">=":c.length>=2&&il(c[1])==="$type"&&h.push(new R1(p,c,`"$type" cannot be use with operator "${c[0]}"`));case"==":case"!=":c.length!==3&&h.push(new R1(p,c,`filter array for operator "${c[0]}" must have 3 elements`));case"in":case"!in":c.length>=2&&(a=gl(c[1]),a!=="string"&&h.push(new R1(`${p}[1]`,c[1],`string expected, ${a} found`)));for(let y=2;y<c.length;y++)a=gl(c[y]),il(c[1])==="$type"?h=h.concat(D5({key:`${p}[${y}]`,value:c[y],valueSpec:d.geometry_type,style:l.style,styleSpec:l.styleSpec})):a!=="string"&&a!=="number"&&a!=="boolean"&&h.push(new R1(`${p}[${y}]`,c[y],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let y=1;y<c.length;y++)h=h.concat(G9({key:`${p}[${y}]`,value:c[y],style:l.style,styleSpec:l.styleSpec}));break;case"has":case"!has":a=gl(c[1]),c.length!==2?h.push(new R1(p,c,`filter array for "${c[0]}" operator must have 2 elements`)):a!=="string"&&h.push(new R1(`${p}[1]`,c[1],`string expected, ${a} found`))}return h}function X9(l,c){let{key:p,validateSpec:d,style:a,styleSpec:h,value:y,objectKey:w}=l,C=h[`${c}_${l.layerType}`];if(!C)return[];let S=w.match(/^(.*)-transition$/);if(c==="paint"&&S&&C[S[1]]&&C[S[1]].transition)return d({key:p,value:y,valueSpec:h.transition,style:a,styleSpec:h});let L=l.valueSpec||C[w];if(!L)return[new R1(p,y,`unknown property "${w}"`)];let s;if(gl(y)==="string"&&M5(L)&&!L.tokens&&(s=/^{([^}]+)}$/.exec(y)))return[new R1(p,y,`"${w}" does not support interpolation syntax Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(s[1])} }\`.`)];let U=[];return l.layerType==="symbol"&&w==="text-font"&&$4(Z5(y))&&il(y.type)==="identity"&&U.push(new R1(p,y,'"text-font" does not support identity functions')),U.concat(d({key:l.key,value:y,valueSpec:L,style:a,styleSpec:h,expressionContext:"property",propertyType:c,propertyKey:w}))}function J9(l){return X9(l,"paint")}function j9(l){return X9(l,"layout")}function b9(l){var c,p;let d=[],a=l.value,h=l.key,y=l.style,w=l.styleSpec;if(gl(a)!=="object")return[new R1(h,a,`object expected, ${gl(a)} found`)];a.type||a.ref||d.push(new R1(h,a,'either "type" or "ref" is required'));let C=il(a.type),S=il(a.ref);if(a.id){let L=il(a.id);for(let s=0;s{s in a&&d.push(new R1(h,a[s],`"${s}" is prohibited for ref layers`))}),y.layers.forEach((s)=>{il(s.id)===S&&(L=s)}),L?L.ref?d.push(new R1(h,a.ref,"ref cannot reference another ref layer")):C=il(L.type):d.push(new R1(h,a.ref,`ref layer "${S}" not found`))}else if(C!=="background")if(a.source){let L=y.sources&&y.sources[a.source],s=L&&il(L.type);L?s==="vector"&&C==="raster"?d.push(new R1(h,a.source,`layer "${a.id}" requires a raster source`)):s!=="raster-dem"&&C==="hillshade"||s!=="raster-dem"&&C==="color-relief"?d.push(new R1(h,a.source,`layer "${a.id}" requires a raster-dem source`)):s==="raster"&&C!=="raster"?d.push(new R1(h,a.source,`layer "${a.id}" requires a vector source`)):s!=="vector"||a["source-layer"]?s==="raster-dem"&&C!=="hillshade"&&C!=="color-relief"?d.push(new R1(h,a.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):C!=="line"||!a.paint||!a.paint["line-gradient"]||s==="geojson"&&L.lineMetrics||d.push(new R1(h,a,`layer "${a.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):d.push(new R1(h,a,`layer "${a.id}" must specify a "source-layer"`)):d.push(new R1(h,a.source,`source "${a.source}" not found`))}else d.push(new R1(h,a,'missing required property "source"'));return C==="raster"&&((c=a.paint)===null||c===void 0?void 0:c.resampling)&&((p=a.paint)===null||p===void 0?void 0:p["raster-resampling"])&&d.push(new R1(h,a.paint,`layer "${a.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),d=d.concat(u2({key:h,value:a,valueSpec:w.layer,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*":()=>[],type:()=>l.validateSpec({key:`${h}.type`,value:a.type,valueSpec:w.layer.type,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,object:a,objectKey:"type"}),filter:K3,layout:(L)=>u2({layer:a,key:L.key,value:L.value,style:L.style,styleSpec:L.styleSpec,validateSpec:L.validateSpec,objectElementValidators:{"*":(s)=>j9(ju({layerType:C},s))}}),paint:(L)=>u2({layer:a,key:L.key,value:L.value,style:L.style,styleSpec:L.styleSpec,validateSpec:L.validateSpec,objectElementValidators:{"*":(s)=>J9(ju({layerType:C},s))}})}})),d}function r5(l){let{value:c,key:p}=l,d=gl(c);return d!=="string"?[new R1(p,c,`string expected, ${d} found`)]:[]}let N7={promoteId:function({key:l,value:c}){if(gl(c)==="string")return r5({key:l,value:c});{let p=[];for(let d in c)p.push(...r5({key:`${l}.${d}`,value:c[d]}));return p}}};function q7(l){let{value:c,key:p,styleSpec:d,style:a,validateSpec:h}=l;if(!c.type)return[new R1(p,c,'"type" is required')];let y=il(c.type),w;switch(y){case"vector":case"raster":return w=u2({key:p,value:c,valueSpec:d[`source_${y.replace("-","_")}`],style:l.style,styleSpec:d,objectElementValidators:N7,validateSpec:h}),w;case"raster-dem":return w=function(C){var S;let L=(S=C.sourceName)!==null&&S!==void 0?S:"",s=C.value,U=C.styleSpec,N=U.source_raster_dem,R=C.style,P=[],B=gl(s);if(s===void 0)return P;if(B!=="object")return P.push(new R1("source_raster_dem",s,`object expected, ${B} found`)),P;let H=il(s.encoding)==="custom",O=["redFactor","greenFactor","blueFactor","baseShift"],M=C.value.encoding?`"${C.value.encoding}"`:"Default";for(let Z in s)!H&&O.includes(Z)?P.push(new R1(Z,s[Z],`In "${L}": "${Z}" is only valid when "encoding" is set to "custom". ${M} encoding found`)):N[Z]?P=P.concat(C.validateSpec({key:Z,value:s[Z],valueSpec:N[Z],validateSpec:C.validateSpec,style:R,styleSpec:U})):P.push(new R1(Z,s[Z],`unknown property "${Z}"`));return P}({sourceName:p,value:c,style:l.style,styleSpec:d,validateSpec:h}),w;case"geojson":if(w=u2({key:p,value:c,valueSpec:d.source_geojson,style:a,styleSpec:d,validateSpec:h,objectElementValidators:N7}),c.cluster)for(let C in c.clusterProperties){let[S,L]=c.clusterProperties[C],s=typeof S=="string"?[S,["accumulated"],["get",C]]:S;w.push(...c5({key:`${p}.${C}.map`,value:L,expressionContext:"cluster-map"})),w.push(...c5({key:`${p}.${C}.reduce`,value:s,expressionContext:"cluster-reduce"}))}return w;case"video":return u2({key:p,value:c,valueSpec:d.source_video,style:a,validateSpec:h,styleSpec:d});case"image":return u2({key:p,value:c,valueSpec:d.source_image,style:a,validateSpec:h,styleSpec:d});case"canvas":return[new R1(p,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return D5({key:`${p}.type`,value:c.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function rc(l){let{value:c,styleSpec:p}=l,d=p.light,a=l.style,h=[],y=gl(c);if(c===void 0)return h;if(y!=="object")return h=h.concat([new R1("light",c,`object expected, ${y} found`)]),h;for(let w in c){let C=w.match(/^(.*)-transition$/);h=h.concat(C&&d[C[1]]&&d[C[1]].transition?l.validateSpec({key:w,value:c[w],valueSpec:p.transition,validateSpec:l.validateSpec,style:a,styleSpec:p}):d[w]?l.validateSpec({key:w,value:c[w],valueSpec:d[w],validateSpec:l.validateSpec,style:a,styleSpec:p}):[new R1(w,c[w],`unknown property "${w}"`)])}return h}function $9(l){let{value:c,styleSpec:p}=l,d=p.sky,a=l.style,h=gl(c);if(c===void 0)return[];if(h!=="object")return[new R1("sky",c,`object expected, ${h} found`)];let y=[];for(let w in c)y=y.concat(d[w]?l.validateSpec({key:w,value:c[w],valueSpec:d[w],style:a,styleSpec:p}):[new R1(w,c[w],`unknown property "${w}"`)]);return y}function F7(l){let{value:c,styleSpec:p}=l,d=p.terrain,a=l.style,h=[],y=gl(c);if(c===void 0)return h;if(y!=="object")return h=h.concat([new R1("terrain",c,`object expected, ${y} found`)]),h;for(let w in c)h=h.concat(d[w]?l.validateSpec({key:w,value:c[w],valueSpec:d[w],validateSpec:l.validateSpec,style:a,styleSpec:p}):[new R1(w,c[w],`unknown property "${w}"`)]);return h}function U7(l){let c=[],p=l.value,d=l.key;if(Array.isArray(p)){let a=[],h=[];for(let y in p)p[y].id&&a.includes(p[y].id)&&c.push(new R1(d,p,`all the sprites' ids must be unique, but ${p[y].id} is duplicated`)),a.push(p[y].id),p[y].url&&h.includes(p[y].url)&&c.push(new R1(d,p,`all the sprites' URLs must be unique, but ${p[y].url} is duplicated`)),h.push(p[y].url),c=c.concat(u2({key:`${d}[${y}]`,value:p[y],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:l.validateSpec}));return c}return r5({key:d,value:p})}function _9(l){return Boolean(l)&&l.constructor===Object}function pc(l){return _9(l.value)?[]:[new R1(l.key,l.value,`object expected, ${gl(l.value)} found`)]}let x7={"*":()=>[],array:sr,boolean:function(l){let{value:c,key:p}=l,d=gl(c);return d!=="boolean"?[new R1(p,c,`boolean expected, ${d} found`)]:[]},number:M3,color:cc,constants:T9,enum:D5,filter:K3,function:Cr,layer:b9,object:u2,source:q7,light:rc,sky:$9,terrain:F7,projection:function(l){let{value:c,styleSpec:p}=l,d=p.projection,a=l.style,h=gl(c);if(c===void 0)return[];if(h!=="object")return[new R1("projection",c,`object expected, ${h} found`)];let y=[];for(let w in c)y=y.concat(d[w]?l.validateSpec({key:w,value:c[w],valueSpec:d[w],style:a,styleSpec:p}):[new R1(w,c[w],`unknown property "${w}"`)]);return y},projectionDefinition:function(l){let{key:c,value:p}=l;p=p instanceof String?p.valueOf():p;let d=gl(p);return d!=="array"||function(a){return Array.isArray(a)&&a.length===3&&typeof a[0]=="string"&&typeof a[1]=="string"&&typeof a[2]=="number"}(p)||function(a){return!!["interpolate","step","literal"].includes(a[0])}(p)?["array","string"].includes(d)?[]:[new R1(c,p,`projection expected, invalid type "${d}" found`)]:[new R1(c,p,`projection expected, invalid array ${JSON.stringify(p)} found`)]},string:r5,formatted:function(l){return r5(l).length===0?[]:c5(l)},resolvedImage:function(l){return r5(l).length===0?[]:c5(l)},padding:function(l){let{key:c,value:p}=l;if(gl(p)==="array"){if(p.length4)return[new R1(c,p,`padding requires 1 to 4 values; ${p.length} values found`)];let d={type:"number"},a=[];for(let h=0;h<p.length;h++)a=a.concat(l.validateSpec({key:`${c}[${h}]`,value:p[h],validateSpec:l.validateSpec,valueSpec:d}));return a}return M3({key:c,value:p,valueSpec:{}})},numberArray:function(l){let{key:c,value:p}=l;if(gl(p)==="array"){let d={type:"number"};if(p.length<1)return[new R1(c,p,"array length at least 1 expected, length 0 found")];let a=[];for(let h=0;h<p.length;h++)a=a.concat(l.validateSpec({key:`${c}[${h}]`,value:p[h],validateSpec:l.validateSpec,valueSpec:d}));return a}return M3({key:c,value:p,valueSpec:{}})},colorArray:function(l){let{key:c,value:p}=l;if(gl(p)==="array"){if(p.length<1)return[new R1(c,p,"array length at least 1 expected, length 0 found")];let d=[];for(let a=0;a<p.length;a++)d=d.concat(cc({key:`${c}[${a}]`,value:p[a]}));return d}return cc({key:c,value:p})},variableAnchorOffsetCollection:function(l){let{key:c,value:p}=l,d=gl(p),a=l.styleSpec;if(d!=="array"||p.length<1||p.length%2!=0)return[new R1(c,p,"variableAnchorOffsetCollection requires a non-empty array of even length")];let h=[];for(let y=0;y
[]}})),l.constants&&(p=p.concat(T9({key:"constants",value:l.constants}))),i9(p)}function G2(l){return function(c){return l(Object.assign({},c,{validateSpec:O3}))}}function i9(l){return[].concat(l).sort((c,p)=>c.line-p.line)}function X2(l){return function(...c){return i9(l.apply(this,c))}}U2.source=X2(G2(q7)),U2.sprite=X2(G2(U7)),U2.glyphs=X2(G2(Z3)),U2.light=X2(G2(rc)),U2.sky=X2(G2($9)),U2.terrain=X2(G2(F7)),U2.state=X2(G2(pc)),U2.layer=X2(G2(b9)),U2.filter=X2(G2(K3)),U2.paintProperty=X2(G2(J9)),U2.layoutProperty=X2(G2(j9));let Sd={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class P7{constructor(l,c){this._globalState=c,this.setValue(l)}evaluate(){var l;return(l=this._literalValue)!==null&&l!==void 0?l:this._compiledValue.evaluate({})}setValue(l){if(l==null||l==="visible"||l==="none")return this._literalValue=l==="none"?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);let c=B3(l,Sd,this._globalState);if(c.result==="error")throw this._literalValue="visible",this._compiledValue=void 0,Error(c.value.map((p)=>`${p.key}: ${p.message}`).join(", "));this._literalValue=void 0,this._compiledValue=c.value,this._globalStateRefs=Q3(c.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let fc=E1,lu=U2,c2=lu.light,D3=lu.sky,R7=lu.paintProperty,e9=lu.layoutProperty;function I7(l,c){let p=!1;if(c==null?void 0:c.length)for(let d of c)l.fire(new N5(Error(d.message))),p=!0;return p}class uu{constructor(l,c,p){let d=this.cells=[];if(l instanceof ArrayBuffer){this.arrayBuffer=l;let h=new Int32Array(this.arrayBuffer);l=h[0],this.d=(c=h[1])+2*(p=h[2]);for(let w=0;w<this.d*this.d;w++){let C=h[3+w],S=h[3+w+1];d.push(C===S?null:h.subarray(C,S))}let y=h[3+d.length+1];this.keys=h.subarray(h[3+d.length],y),this.bboxes=h.subarray(y),this.insert=this._insertReadonly}else{this.d=c+2*p;for(let h=0;h<this.d*this.d;h++)d.push([]);this.keys=[],this.bboxes=[]}this.n=c,this.extent=l,this.padding=p,this.scale=c/l,this.uid=0;let a=p/c*l;this.min=-a,this.max=l+a}insert(l,c,p,d,a){this._forEachCell(c,p,d,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(l),this.bboxes.push(c),this.bboxes.push(p),this.bboxes.push(d),this.bboxes.push(a)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(l,c,p,d,a,h){this.cells[a].push(h)}query(l,c,p,d,a){let h=this.min,y=this.max;if(l<=h&&c<=h&&y<=p&&y<=d&&!a)return[...this.keys];{let w=[];return this._forEachCell(l,c,p,d,this._queryCell,w,{},a),w}}_queryCell(l,c,p,d,a,h,y,w){let C=this.cells[a];if(C!==null){let S=this.keys,L=this.bboxes;for(let s of C)if(y[s]===void 0){let U=4*s;(w?w(L[U+0],L[U+1],L[U+2],L[U+3]):l<=L[U+2]&&c=L[U+0]&&d>=L[U+1])?(y[s]=!0,h.push(S[s])):y[s]=!1}}}_forEachCell(l,c,p,d,a,h,y,w){let C=this._convertToCellCoord(l),S=this._convertToCellCoord(c),L=this._convertToCellCoord(p),s=this._convertToCellCoord(d);for(let U=C;U<=L;U++)for(let N=S;N<=s;N++){let R=this.d*N+U;if((!w||w(this._convertFromCellCoord(U),this._convertFromCellCoord(N),this._convertFromCellCoord(U+1),this._convertFromCellCoord(N+1)))&&a.call(this,l,c,p,d,R,h,y,w))return}}_convertFromCellCoord(l){return(l-this.padding)/this.scale}_convertToCellCoord(l){return Math.max(0,Math.min(this.d-1,Math.floor(l*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let l=this.cells,c=3+this.cells.length+1+1,p=0;for(let h of this.cells)p+=h.length;let d=new Int32Array(c+p+this.keys.length+this.bboxes.length);d[0]=this.extent,d[1]=this.n,d[2]=this.padding;let a=c;for(let h=0;h<l.length;h++){let y=l[h];d[3+h]=a,d.set(y,a),a+=y.length}return d[3+l.length]=a,d.set(this.keys,a),a+=this.keys.length,d[3+l.length+1]=a,d.set(this.bboxes,a),a+=this.bboxes.length,d.buffer}static serialize(l,c){let p=l.toArrayBuffer();return c&&c.push(p),{buffer:p}}static deserialize(l){return new uu(l.buffer)}}let J2={};function O1(l,c,p={}){if(J2[l])throw Error(`${l} is already registered.`);Object.defineProperty(c,"_classRegistryKey",{value:l,writeable:!1}),J2[l]={klass:c,omit:p.omit||[],shallow:p.shallow||[]}}O1("Object",Object),O1("Set",Set),O1("TransferableGridIndex",uu),O1("Color",ml),O1("Error",Error),O1("AJAXError",Ju),O1("ResolvedImage",w2),O1("StylePropertyFunction",e4),O1("StyleExpression",K5,{omit:["_evaluator"]}),O1("ZoomDependentExpression",i4),O1("ZoomConstantExpression",z3),O1("CompoundExpression",S2,{omit:["_evaluate"]});for(let l in Q5)Q5[l]._classRegistryKey||O1(`Expression_${l}`,Q5[l]);function Y7(l){var c;return l&&typeof ArrayBufferp?(this.lastIntegerZoom=p+1,this.lastIntegerZoomTime=c):this.lastFloorZoom
{try{return new RegExp(`\\p{sc=${p}}`,"u").source}catch(d){return null}}).filter((p)=>p);return new RegExp(c.join("|"),"u")}let Vr=Q7(["Arab","Dupl","Mong","Ougr","Syrc"]);function Nr(l){return!Vr.test(String.fromCodePoint(l))}function H7(l){return!(p5(l)||(c=l,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(c))));var c}let M7=Q7(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function K7(l){return M7.test(String.fromCodePoint(l))}function O7(l,c){return!(!c&&K7(l)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(l)))}function Z7(l){for(let c of l)if(K7(c.codePointAt(0)))return!0;return!1}let ru=new class{constructor(){this.TIMEOUT=5000,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(l){this.pluginStatus=l.pluginStatus,this.pluginURL=l.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(l){if(ru.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=l.applyArabicShaping,this.processBidirectionalText=l.processBidirectionalText,this.processStyledBidirectionalText=l.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(l,c){return g(this,void 0,void 0,function*(){if(this.isParsed())return this.getState();if(l.pluginStatus!=="loading")return this.setState(l),l;let p=l.pluginURL,d=new Promise((h)=>{this.loadScriptResolve=h});c(p);let a=new Promise((h)=>setTimeout(()=>h(),this.TIMEOUT));if(yield Promise.race([d,a]),this.isParsed()){let h={pluginStatus:"loaded",pluginURL:p};return this.setState(h),h}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${p}`)})}};class ql{constructor(l,c){this.isSupportedScript=D7,this.zoom=l,c?(this.now=c.now||0,this.fadeDuration=c.fadeDuration||0,this.zoomHistory=c.zoomHistory||new Wr,this.transition=c.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Wr,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let l=this.zoom,c=l-Math.floor(l),p=this.crossFadingFactor();return l>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:c+(1-c)*p}:{fromScale:0.5,toScale:1,t:1-(1-p)*c}}}function D7(l){return function(c,p){for(let d of c)if(!O7(d.codePointAt(0),p))return!1;return!0}(l,ru.getRTLTextPluginStatus()==="loaded")}let qr="-transition";class G3{constructor(l,c,p){this.property=l,this.value=c,this.expression=function(d,a,h){if($4(d))return new e4(d,a);if(_4(d)){let y=C7(d,a,h);if(y.result==="error")throw Error(y.value.map((w)=>`${w.key}: ${w.message}`).join(", "));return y.value}{let y=d;return a.type==="color"&&typeof d=="string"?y=ml.parse(d):a.type!=="padding"||typeof d!="number"&&!Array.isArray(d)?a.type!=="numberArray"||typeof d!="number"&&!Array.isArray(d)?a.type!=="colorArray"||typeof d!="string"&&!Array.isArray(d)?a.type==="variableAnchorOffsetCollection"&&Array.isArray(d)?y=T0.parse(d):a.type==="projectionDefinition"&&typeof d=="string"&&(y=P0.parse(d)):y=t1.parse(d):y=Ml.parse(d):y=x0.parse(d),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>y}}}(c===void 0?l.specification.default:c,l.specification,p)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(l,c,p){return this.property.possiblyEvaluate(this,l,c,p)}}class Fr{constructor(l,c){this.property=l,this.value=new G3(l,void 0,c)}transitioned(l,c){return new gc(this.property,this.value,c,h2({},l.transition,this.transition),l.now)}untransitioned(){return new gc(this.property,this.value,null,{},0)}}class mc{constructor(l,c){this._properties=l,this._values=Object.create(l.defaultTransitionablePropertyValues),this._globalState=c}hasProperty(l){return l in this._properties.defaultTransitionablePropertyValues}getValue(l){return vl(this._values[l].value.value)}setValue(l,c){Object.hasOwn(this._values,l)||(this._values[l]=new Fr(this._values[l].property,this._globalState)),this._values[l].value=new G3(this._values[l].property,c===null?void 0:vl(c),this._globalState)}getTransition(l){return vl(this._values[l].transition)}setTransition(l,c){Object.hasOwn(this._values,l)||(this._values[l]=new Fr(this._values[l].property,this._globalState)),this._values[l].transition=vl(c)||void 0}serialize(){let l={};for(let c of Object.keys(this._values)){let p=this.getValue(c);p!==void 0&&(l[c]=p);let d=this.getTransition(c);d!==void 0&&(l[`${c}${qr}`]=d)}return l}transitioned(l,c){let p=new Ur(this._properties);for(let d of Object.keys(this._values))p._values[d]=this._values[d].transitioned(l,c._values[d]);return p}untransitioned(){let l=new Ur(this._properties);for(let c of Object.keys(this._values))l._values[c]=this._values[c].untransitioned();return l}}class gc{constructor(l,c,p,d,a){this.property=l,this.value=c,this.begin=a+d.delay||0,this.end=this.begin+d.duration||0,l.specification.transition&&(d.delay||d.duration)&&(this.prior=p)}possiblyEvaluate(l,c,p){let d=l.now||0,a=this.value.possiblyEvaluate(l,c,p),h=this.prior;if(h){if(d>this.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(dd.zoomHistory.lastIntegerZoom?{from:l,to:c}:{from:p,to:c}}interpolate(l){return l}}class xr{constructor(l){this.specification=l}possiblyEvaluate(l,c,p,d){if(l.value!==void 0){if(l.expression.kind==="constant"){let a=l.expression.evaluate(c,null,{},p,d);return this._calculate(a,a,a,c)}return this._calculate(l.expression.evaluate(new ql(Math.floor(c.zoom-1),c)),l.expression.evaluate(new ql(Math.floor(c.zoom),c)),l.expression.evaluate(new ql(Math.floor(c.zoom+1),c)),c)}}_calculate(l,c,p,d){return d.zoom>d.zoomHistory.lastIntegerZoom?{from:l,to:c}:{from:p,to:c}}interpolate(l){return l}}class G5{constructor(l){this.specification=l}possiblyEvaluate(l,c,p,d){return!!l.expression.evaluate(c,null,{},p,d)}interpolate(){return!1}}class V0{constructor(l){this.properties=l,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let c in l){let p=l[c];p.specification.overridable&&this.overridableProperties.push(c);let d=this.defaultPropertyValues[c]=new G3(p,void 0,void 0),a=this.defaultTransitionablePropertyValues[c]=new Fr(p,void 0);this.defaultTransitioningPropertyValues[c]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[c]=d.possiblyEvaluate({})}}}O1("DataDrivenProperty",_1),O1("DataConstantProperty",j1),O1("CrossFadedDataDrivenProperty",Fu),O1("CrossFadedProperty",xr),O1("ColorRampProperty",G5);let G7=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Pr=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";class r2 extends q4{constructor(l,c,p){if(super(),this.id=l.id,this.type=l.type,this._globalState=p,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(d,a){return new P7(d,a)}(this.visibility,p),l.type!=="custom"&&(this.metadata=l.metadata,this.minzoom=l.minzoom,this.maxzoom=l.maxzoom,l.type!=="background"&&(this.source=l.source,this.sourceLayer=l["source-layer"],this.filter=l.filter,this._featureFilter=t4(l.filter,p)),c.layout&&(this._unevaluatedLayout=new T7(c.layout,p)),c.paint)){this._transitionablePaint=new mc(c.paint,p);for(let d in l.paint)this.setPaintProperty(d,l.paint[d],{validate:!1});for(let d in l.layout)this.setLayoutProperty(d,l.layout[d],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new T5(c.paint)}}setFilter(l){this.filter=l,this._featureFilter=t4(l,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(l){var c;if(l==="visibility")return this.visibility;if((c=this._transitionablePaint)===null||c===void 0?void 0:c.hasProperty(l))throw Error(l+G7);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${l}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(l)}getLayoutAffectingGlobalStateRefs(){let l=new Set;for(let c of this._visibilityExpression.getGlobalStateRefs())l.add(c);if(this._unevaluatedLayout)for(let c in this._unevaluatedLayout._values){let p=this._unevaluatedLayout._values[c];for(let d of p.getGlobalStateRefs())l.add(d)}for(let c of this._featureFilter.getGlobalStateRefs())l.add(c);return l}getPaintAffectingGlobalStateRefs(){var l;let c=new globalThis.Map;if(this._transitionablePaint)for(let p in this._transitionablePaint._values){let d=this._transitionablePaint._values[p].value;for(let a of d.getGlobalStateRefs()){let h=(l=c.get(a))!==null&&l!==void 0?l:[];h.push({name:p,value:d.value}),c.set(a,h)}}return c}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(l,c,p={}){var d;if(l==="visibility")return this.visibility=c,this._visibilityExpression.setValue(c),void this.recalculateVisibility();((d=this._transitionablePaint)===null||d===void 0?void 0:d.hasProperty(l))?this.fire(new N5(Error(l+G7))):c!=null&&this._validate(e9,`layers.${this.id}.layout.${l}`,l,c,p)||this._unevaluatedLayout.setValue(l,c)}getPaintProperty(l){var c,p;if(l.endsWith(qr)){let d=l.slice(0,-11);if(d==="visibility"||((c=this._unevaluatedLayout)===null||c===void 0?void 0:c.hasProperty(d)))throw Error(l+Pr);return this._transitionablePaint.getTransition(d)}if(l==="visibility"||((p=this._unevaluatedLayout)===null||p===void 0?void 0:p.hasProperty(l)))throw Error(l+Pr);return this._transitionablePaint.getValue(l)}setPaintProperty(l,c,p={}){var d;if(l==="visibility"||((d=this._unevaluatedLayout)===null||d===void 0?void 0:d.hasProperty(l)))return this.fire(new N5(Error(l+Pr))),!1;if(c!=null&&this._validate(R7,`layers.${this.id}.paint.${l}`,l,c,p))return!1;if(l.endsWith(qr))return this._transitionablePaint.setTransition(l.slice(0,-11),c||void 0),!1;{let a=this._transitionablePaint._values[l],h=a.property.specification["property-type"]==="cross-faded-data-driven",y=a.value.isDataDriven(),w=a.value;this._transitionablePaint.setValue(l,c),this._handleSpecialPaintPropertyUpdate(l);let C=this._transitionablePaint._values[l].value;return C.isDataDriven()||y||h||this._handleOverridablePaintPropertyUpdate(l,w,C)}}_handleSpecialPaintPropertyUpdate(l){}_handleOverridablePaintPropertyUpdate(l,c,p){return!1}isHidden(l=this.minzoom,c=!1){return!!(this.minzoom&&l=this.maxzoom)||this._evaluatedVisibility==="none"}updateTransitions(l){this._transitioningPaint=this._transitionablePaint.transitioned(l,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(l,c){l.getCrossfadeParameters&&(this._crossfadeParameters=l.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(l,void 0,c)),this.paint=this._transitioningPaint.possiblyEvaluate(l,void 0,c)}serialize(){var l,c;let p={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:(l=this._unevaluatedLayout)===null||l===void 0?void 0:l.serialize(),paint:(c=this._transitionablePaint)===null||c===void 0?void 0:c.serialize()};return this.visibility&&(p.layout||(p.layout={}),p.layout.visibility=this.visibility),Wl(p,(d,a)=>!(d===void 0||a==="layout"&&!Object.keys(d).length||a==="paint"&&!Object.keys(d).length))}_validate(l,c,p,d,a={}){return(a==null?void 0:a.validate)!==!1&&I7(this,l.call(lu,{key:c,layerType:this.type,objectKey:p,value:d,styleSpec:E1,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let l in this.paint._values){let c=this.paint.get(l);if(c instanceof E2&&M5(c.property.specification)&&(c.value.kind==="source"||c.value.kind==="composite")&&c.value.isStateDependent)return!0}return!1}}let Rr;var t9={get paint(){return Rr=Rr||new V0({"raster-opacity":new j1(E1.paint_raster["raster-opacity"]),"raster-hue-rotate":new j1(E1.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new j1(E1.paint_raster["raster-brightness-min"]),"raster-brightness-max":new j1(E1.paint_raster["raster-brightness-max"]),"raster-saturation":new j1(E1.paint_raster["raster-saturation"]),"raster-contrast":new j1(E1.paint_raster["raster-contrast"]),resampling:new j1(E1.paint_raster.resampling),"raster-resampling":new j1(E1.paint_raster["raster-resampling"]),"raster-fade-duration":new j1(E1.paint_raster["raster-fade-duration"])})}};class lp extends r2{constructor(l,c){super(l,t9,c)}}let up={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class X5{constructor(l,c){this._structArray=l,this._pos1=c*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Yl{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(l,c){return l._trim(),c&&(l.isTransferred=!0,c.push(l.arrayBuffer)),{length:l.length,arrayBuffer:l.arrayBuffer}}static deserialize(l){let c=Object.create(this.prototype);return c.arrayBuffer=l.arrayBuffer,c.length=l.length,c.capacity=l.arrayBuffer.byteLength/c.bytesPerElement,c._refreshViews(),c}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(l){this.reserve(l),this.length=l}reserve(l){if(l>this.capacity){this.capacity=Math.max(l,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let c=this.uint8;this._refreshViews(),c&&this.uint8.set(c)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function xl(l,c=1){let p=0,d=0;return{members:l.map((a)=>{let h=up[a.type].BYTES_PER_ELEMENT,y=p=X7(p,Math.max(c,h)),w=a.components||1;return d=Math.max(d,h),p+=h*w,{name:a.name,type:a.type,components:w,offset:y}}),size:X7(p,Math.max(d,c)),alignment:c}}function X7(l,c){return Math.ceil(l/c)*c}class X3 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c){let p=this.length;return this.resize(p+1),this.emplace(p,l,c)}emplace(l,c,p){let d=2*l;return this.int16[d+0]=c,this.int16[d+1]=p,l}}X3.prototype.bytesPerElement=4,O1("StructArrayLayout2i4",X3);class vc extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c,p){let d=this.length;return this.resize(d+1),this.emplace(d,l,c,p)}emplace(l,c,p,d){let a=3*l;return this.int16[a+0]=c,this.int16[a+1]=p,this.int16[a+2]=d,l}}vc.prototype.bytesPerElement=6,O1("StructArrayLayout3i6",vc);class ac extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c,p,d){let a=this.length;return this.resize(a+1),this.emplace(a,l,c,p,d)}emplace(l,c,p,d,a){let h=4*l;return this.int16[h+0]=c,this.int16[h+1]=p,this.int16[h+2]=d,this.int16[h+3]=a,l}}ac.prototype.bytesPerElement=8,O1("StructArrayLayout4i8",ac);class oc extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h){let y=this.length;return this.resize(y+1),this.emplace(y,l,c,p,d,a,h)}emplace(l,c,p,d,a,h,y){let w=6*l;return this.int16[w+0]=c,this.int16[w+1]=p,this.int16[w+2]=d,this.int16[w+3]=a,this.int16[w+4]=h,this.int16[w+5]=y,l}}oc.prototype.bytesPerElement=12,O1("StructArrayLayout2i4i12",oc);class Ir extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h){let y=this.length;return this.resize(y+1),this.emplace(y,l,c,p,d,a,h)}emplace(l,c,p,d,a,h,y){let w=4*l,C=8*l;return this.int16[w+0]=c,this.int16[w+1]=p,this.uint8[C+4]=d,this.uint8[C+5]=a,this.uint8[C+6]=h,this.uint8[C+7]=y,l}}Ir.prototype.bytesPerElement=8,O1("StructArrayLayout2i4ub8",Ir);class J5 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,c){let p=this.length;return this.resize(p+1),this.emplace(p,l,c)}emplace(l,c,p){let d=2*l;return this.float32[d+0]=c,this.float32[d+1]=p,l}}J5.prototype.bytesPerElement=8,O1("StructArrayLayout2f8",J5);class pu extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h,y,w,C,S){let L=this.length;return this.resize(L+1),this.emplace(L,l,c,p,d,a,h,y,w,C,S)}emplace(l,c,p,d,a,h,y,w,C,S,L){let s=10*l;return this.uint16[s+0]=c,this.uint16[s+1]=p,this.uint16[s+2]=d,this.uint16[s+3]=a,this.uint16[s+4]=h,this.uint16[s+5]=y,this.uint16[s+6]=w,this.uint16[s+7]=C,this.uint16[s+8]=S,this.uint16[s+9]=L,l}}pu.prototype.bytesPerElement=20,O1("StructArrayLayout10ui20",pu);class hc extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h,y,w){let C=this.length;return this.resize(C+1),this.emplace(C,l,c,p,d,a,h,y,w)}emplace(l,c,p,d,a,h,y,w,C){let S=8*l;return this.uint16[S+0]=c,this.uint16[S+1]=p,this.uint16[S+2]=d,this.uint16[S+3]=a,this.uint16[S+4]=h,this.uint16[S+5]=y,this.uint16[S+6]=w,this.uint16[S+7]=C,l}}hc.prototype.bytesPerElement=16,O1("StructArrayLayout8ui16",hc);class J3 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h,y,w,C,S,L,s){let U=this.length;return this.resize(U+1),this.emplace(U,l,c,p,d,a,h,y,w,C,S,L,s)}emplace(l,c,p,d,a,h,y,w,C,S,L,s,U){let N=12*l;return this.int16[N+0]=c,this.int16[N+1]=p,this.int16[N+2]=d,this.int16[N+3]=a,this.uint16[N+4]=h,this.uint16[N+5]=y,this.uint16[N+6]=w,this.uint16[N+7]=C,this.int16[N+8]=S,this.int16[N+9]=L,this.int16[N+10]=s,this.int16[N+11]=U,l}}J3.prototype.bytesPerElement=24,O1("StructArrayLayout4i4ui4i24",J3);class yc extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,c,p){let d=this.length;return this.resize(d+1),this.emplace(d,l,c,p)}emplace(l,c,p,d){let a=3*l;return this.float32[a+0]=c,this.float32[a+1]=p,this.float32[a+2]=d,l}}yc.prototype.bytesPerElement=12,O1("StructArrayLayout3f12",yc);class j5 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(l){let c=this.length;return this.resize(c+1),this.emplace(c,l)}emplace(l,c){return this.uint32[1*l+0]=c,l}}j5.prototype.bytesPerElement=4,O1("StructArrayLayout1ul4",j5);class Yr extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h,y,w,C){let S=this.length;return this.resize(S+1),this.emplace(S,l,c,p,d,a,h,y,w,C)}emplace(l,c,p,d,a,h,y,w,C,S){let L=10*l,s=5*l;return this.int16[L+0]=c,this.int16[L+1]=p,this.int16[L+2]=d,this.int16[L+3]=a,this.int16[L+4]=h,this.int16[L+5]=y,this.uint32[s+3]=w,this.uint16[L+8]=C,this.uint16[L+9]=S,l}}Yr.prototype.bytesPerElement=20,O1("StructArrayLayout6i1ul2ui20",Yr);class b5 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h){let y=this.length;return this.resize(y+1),this.emplace(y,l,c,p,d,a,h)}emplace(l,c,p,d,a,h,y){let w=6*l;return this.int16[w+0]=c,this.int16[w+1]=p,this.int16[w+2]=d,this.int16[w+3]=a,this.int16[w+4]=h,this.int16[w+5]=y,l}}b5.prototype.bytesPerElement=12,O1("StructArrayLayout2i2i2i12",b5);class f5 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a){let h=this.length;return this.resize(h+1),this.emplace(h,l,c,p,d,a)}emplace(l,c,p,d,a,h){let y=4*l,w=8*l;return this.float32[y+0]=c,this.float32[y+1]=p,this.float32[y+2]=d,this.int16[w+6]=a,this.int16[w+7]=h,l}}f5.prototype.bytesPerElement=16,O1("StructArrayLayout2f1f2i16",f5);class Br extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h){let y=this.length;return this.resize(y+1),this.emplace(y,l,c,p,d,a,h)}emplace(l,c,p,d,a,h,y){let w=16*l,C=4*l,S=8*l;return this.uint8[w+0]=c,this.uint8[w+1]=p,this.float32[C+1]=d,this.float32[C+2]=a,this.int16[S+6]=h,this.int16[S+7]=y,l}}Br.prototype.bytesPerElement=16,O1("StructArrayLayout2ub2f2i16",Br);class j3 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,c,p){let d=this.length;return this.resize(d+1),this.emplace(d,l,c,p)}emplace(l,c,p,d){let a=3*l;return this.uint16[a+0]=c,this.uint16[a+1]=p,this.uint16[a+2]=d,l}}j3.prototype.bytesPerElement=6,O1("StructArrayLayout3ui6",j3);class d5 extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h,y,w,C,S,L,s,U,N,R,P,B){let H=this.length;return this.resize(H+1),this.emplace(H,l,c,p,d,a,h,y,w,C,S,L,s,U,N,R,P,B)}emplace(l,c,p,d,a,h,y,w,C,S,L,s,U,N,R,P,B,H){let O=24*l,M=12*l,Z=48*l;return this.int16[O+0]=c,this.int16[O+1]=p,this.uint16[O+2]=d,this.uint16[O+3]=a,this.uint32[M+2]=h,this.uint32[M+3]=y,this.uint32[M+4]=w,this.uint16[O+10]=C,this.uint16[O+11]=S,this.uint16[O+12]=L,this.float32[M+7]=s,this.float32[M+8]=U,this.uint8[Z+36]=N,this.uint8[Z+37]=R,this.uint8[Z+38]=P,this.uint32[M+10]=B,this.int16[O+22]=H,l}}d5.prototype.bytesPerElement=48,O1("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",d5);class zr extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,c,p,d,a,h,y,w,C,S,L,s,U,N,R,P,B,H,O,M,Z,T,j,d1,m1,v1,n1,w1){let S1=this.length;return this.resize(S1+1),this.emplace(S1,l,c,p,d,a,h,y,w,C,S,L,s,U,N,R,P,B,H,O,M,Z,T,j,d1,m1,v1,n1,w1)}emplace(l,c,p,d,a,h,y,w,C,S,L,s,U,N,R,P,B,H,O,M,Z,T,j,d1,m1,v1,n1,w1,S1){let y1=32*l,s1=16*l;return this.int16[y1+0]=c,this.int16[y1+1]=p,this.int16[y1+2]=d,this.int16[y1+3]=a,this.int16[y1+4]=h,this.int16[y1+5]=y,this.int16[y1+6]=w,this.int16[y1+7]=C,this.uint16[y1+8]=S,this.uint16[y1+9]=L,this.uint16[y1+10]=s,this.uint16[y1+11]=U,this.uint16[y1+12]=N,this.uint16[y1+13]=R,this.uint16[y1+14]=P,this.uint16[y1+15]=B,this.uint16[y1+16]=H,this.uint16[y1+17]=O,this.uint16[y1+18]=M,this.uint16[y1+19]=Z,this.uint16[y1+20]=T,this.uint16[y1+21]=j,this.uint16[y1+22]=d1,this.uint32[s1+12]=m1,this.float32[s1+13]=v1,this.float32[s1+14]=n1,this.uint16[y1+30]=w1,this.uint16[y1+31]=S1,l}}zr.prototype.bytesPerElement=64,O1("StructArrayLayout8i15ui1ul2f2ui64",zr);class wc extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l){let c=this.length;return this.resize(c+1),this.emplace(c,l)}emplace(l,c){return this.float32[1*l+0]=c,l}}wc.prototype.bytesPerElement=4,O1("StructArrayLayout1f4",wc);class nc extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,c,p){let d=this.length;return this.resize(d+1),this.emplace(d,l,c,p)}emplace(l,c,p,d){let a=3*l;return this.uint16[6*l+0]=c,this.float32[a+1]=p,this.float32[a+2]=d,l}}nc.prototype.bytesPerElement=12,O1("StructArrayLayout1ui2f12",nc);class Qr extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,c,p){let d=this.length;return this.resize(d+1),this.emplace(d,l,c,p)}emplace(l,c,p,d){let a=4*l;return this.uint32[2*l+0]=c,this.uint16[a+2]=p,this.uint16[a+3]=d,l}}Qr.prototype.bytesPerElement=8,O1("StructArrayLayout1ul2ui8",Qr);class u extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,c){let p=this.length;return this.resize(p+1),this.emplace(p,l,c)}emplace(l,c,p){let d=2*l;return this.uint16[d+0]=c,this.uint16[d+1]=p,l}}u.prototype.bytesPerElement=4,O1("StructArrayLayout2ui4",u);class r extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l){let c=this.length;return this.resize(c+1),this.emplace(c,l)}emplace(l,c){return this.uint16[1*l+0]=c,l}}r.prototype.bytesPerElement=2,O1("StructArrayLayout1ui2",r);class m extends Yl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,c,p,d){let a=this.length;return this.resize(a+1),this.emplace(a,l,c,p,d)}emplace(l,c,p,d,a){let h=4*l;return this.float32[h+0]=c,this.float32[h+1]=p,this.float32[h+2]=d,this.float32[h+3]=a,l}}m.prototype.bytesPerElement=16,O1("StructArrayLayout4f16",m);class o extends X5{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Q(this.anchorPointX,this.anchorPointY)}}o.prototype.size=20;class n extends Yr{get(l){return new o(this,l)}}O1("CollisionBoxArray",n);class E extends X5{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(l){this._structArray.uint8[this._pos1+37]=l}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(l){this._structArray.uint8[this._pos1+38]=l}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(l){this._structArray.uint32[this._pos4+10]=l}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}E.prototype.size=48;class A extends d5{get(l){return new E(this,l)}}O1("PlacedSymbolArray",A);class q extends X5{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(l){this._structArray.uint32[this._pos4+12]=l}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}q.prototype.size=64;class F extends zr{get(l){return new q(this,l)}}O1("SymbolInstanceArray",F);class x extends wc{getoffsetX(l){return this.float32[1*l+0]}}O1("GlyphOffsetArray",x);class I extends vc{getx(l){return this.int16[3*l+0]}gety(l){return this.int16[3*l+1]}gettileUnitDistanceFromAnchor(l){return this.int16[3*l+2]}}O1("SymbolLineVertexArray",I);class z extends X5{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}z.prototype.size=12;class Y extends nc{get(l){return new z(this,l)}}O1("TextAnchorOffsetArray",Y);class K extends X5{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}K.prototype.size=8;class D extends Qr{get(l){return new K(this,l)}}O1("FeatureIndexArray",D);class e extends X3{}class _ extends X3{}class X extends X3{}class c1 extends oc{}class $ extends Ir{}class i extends J5{}class l1 extends pu{}class J extends hc{}class p1 extends J3{}class k1 extends yc{}class h1 extends j5{}class L1 extends b5{}class A1 extends Br{}class D1 extends j3{}class T1 extends u{}let V1=xl([{name:"a_pos",components:2,type:"Int16"}],4),{members:Z1}=V1;class M1{constructor(l=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=l}prepareSegment(l,c,p,d){let a=this.segments[this.segments.length-1];return l>M1.MAX_VERTEX_ARRAY_LENGTH&&w0(`Max vertices per segment is ${M1.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${l}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${M1.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+l>M1.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==d?this.createNewSegment(c,p,d):a}createNewSegment(l,c,p){let d={vertexOffset:l.length,primitiveOffset:c.length,vertexLength:0,primitiveLength:0,vaos:{}};return p!==void 0&&(d.sortKey=p),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(d),d}getOrCreateLatestSegment(l,c,p){return this.prepareSegment(0,l,c,p)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let l of this.segments)for(let c in l.vaos)l.vaos[c].destroy()}static simpleSegment(l,c,p,d){return new M1([{vertexOffset:l,primitiveOffset:c,vertexLength:p,primitiveLength:d,vaos:{},sortKey:0}])}}function e1(l,c){return 256*(l=Z0(Math.floor(l),0,255))+Z0(Math.floor(c),0,255)}M1.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,O1("SegmentVector",M1);let Gl=xl([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Xl=xl([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var Bl,r0,R0,Pl={exports:{}},x2={exports:{}},v0={exports:{}},I0=function(){if(R0)return Pl.exports;R0=1;var l=(Bl||(Bl=1,x2.exports=function(p,d){var a,h,y,w,C,S,L,s;for(h=p.length-(a=3&p.length),y=d,C=3432918353,S=461845907,s=0;s<h;)L=255&p.charCodeAt(s)|(255&p.charCodeAt(++s))<<8|(255&p.charCodeAt(++s))<<16|(255&p.charCodeAt(++s))<>>16)*C&65535)<<16)&4294967295)<>>17))*S+(((L>>>16)*S&65535)<<16)&4294967295)<>>19))+((5*(y>>>16)&65535)<>>16)&65535)<<16);switch(L=0,a){case 3:L^=(255&p.charCodeAt(s+2))<<16;case 2:L^=(255&p.charCodeAt(s+1))<>>16)*C&65535)<<16)&4294967295)<>>17))*S+(((L>>>16)*S&65535)<>>16))+((2246822507*(y>>>16)&65535)<>>13))+((3266489909*(y>>>16)&65535)<>>16)>>>0}),x2.exports),c=(r0||(r0=1,v0.exports=function(p,d){for(var a,h=p.length,y=d^h,w=0;h>=4;)a=1540483477*(65535&(a=255&p.charCodeAt(w)|(255&p.charCodeAt(++w))<<8|(255&p.charCodeAt(++w))<<16|(255&p.charCodeAt(++w))<>>16)&65535)<>>16)&65535)<>>24))+((1540483477*(a>>>16)&65535)<<16)),h-=4,++w;switch(h){case 3:y^=(255&p.charCodeAt(w+2))<<16;case 2:y^=(255&p.charCodeAt(w+1))<>>16)&65535)<>>13))+((1540483477*(y>>>16)&65535)<>>15)>>>0}),v0.exports);return Pl.exports=l,Pl.exports.murmur3=l,Pl.exports.murmur2=c,Pl.exports}(),Y0=b(I0);class fu{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(l,c,p,d){this.ids.push($5(l)),this.positions.push(c,p,d)}getPositions(l){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let c=$5(l),p=0,d=this.ids.length-1;for(;p>1;this.ids[h]>=c?d=h:p=h+1}let a=[];for(;this.ids[p]===c;)a.push({index:this.positions[3*p],start:this.positions[3*p+1],end:this.positions[3*p+2]}),p++;return a}static serialize(l,c){let p=new Float64Array(l.ids),d=new Uint32Array(l.positions);return _5(p,d,0,p.length-1),c&&c.push(p.buffer,d.buffer),{ids:p,positions:d}}static deserialize(l){let c=new fu;return c.ids=l.ids,c.positions=l.positions,c.indexed=!0,c}}function $5(l){let c=+l;return!isNaN(c)&&c<=Number.MAX_SAFE_INTEGER?c:Y0(String(l))}function _5(l,c,p,d){for(;p>1],h=p-1,y=d+1;for(;;){do h++;while(l[h]a);if(h>=y)break;du(l,h,y),du(c,3*h,3*y),du(c,3*h+1,3*y+1),du(c,3*h+2,3*y+2)}y-p`u_${d}`),this.type=p}setUniform(l,c,p){l.set(p.constantOr(this.value))}getBinding(l,c,p){return this.type==="color"?new P2(l,c):new mu(l,c)}}class Kl{constructor(l,c){this.uniformNames=c.map((p)=>`u_${p}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(l,c){this.pixelRatioFrom=c.pixelRatio,this.pixelRatioTo=l.pixelRatio,this.patternFrom=c.tlbr,this.patternTo=l.tlbr}setConstantDashPositions(l,c){this.dashTo=[0,l.y,l.height,l.width],this.dashFrom=[0,c.y,c.height,c.width]}setUniform(l,c,p,d){let a=null;d==="u_pattern_to"?a=this.patternTo:d==="u_pattern_from"?a=this.patternFrom:d==="u_dasharray_to"?a=this.dashTo:d==="u_dasharray_from"?a=this.dashFrom:d==="u_pixel_ratio_to"?a=this.pixelRatioTo:d==="u_pixel_ratio_from"&&(a=this.pixelRatioFrom),a!==null&&l.set(a)}getBinding(l,c,p){return p.startsWith("u_pattern")||p.startsWith("u_dasharray_")?new m5(l,c):new mu(l,c)}}class zl{constructor(l,c,p,d){this.expression=l,this.type=p,this.maxValue=0,this.paintVertexAttributes=c.map((a)=>({name:`a_${a}`,type:"Float32",components:p==="color"?2:1,offset:0})),this.paintVertexArray=new d}populatePaintArray(l,c,p){let d=this.paintVertexArray.length,a=this.expression.evaluate(new ql(0,p),c,{},p.canonical,[],p.formattedSection);this.paintVertexArray.resize(l),this._setPaintValue(d,l,a)}updatePaintArray(l,c,p,d,a){let h=this.expression.evaluate(new ql(0,a),p,d);this._setPaintValue(l,c,h)}_setPaintValue(l,c,p){if(this.type==="color"){let d=v5(p);for(let a=l;a<c;a++)this.paintVertexArray.emplace(a,d[0],d[1])}else{for(let d=l;d`u_${y}_t`),this.type=p,this.useIntegerZoom=d,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=c.map((y)=>({name:`a_${y}`,type:"Float32",components:p==="color"?4:2,offset:0})),this.paintVertexArray=new h}populatePaintArray(l,c,p){let d=this.expression.evaluate(new ql(this.zoom,p),c,{},p.canonical,[],p.formattedSection),a=this.expression.evaluate(new ql(this.zoom+1,p),c,{},p.canonical,[],p.formattedSection),h=this.paintVertexArray.length;this.paintVertexArray.resize(l),this._setPaintValue(h,l,d,a)}updatePaintArray(l,c,p,d,a){let h=this.expression.evaluate(new ql(this.zoom,a),p,d),y=this.expression.evaluate(new ql(this.zoom+1,a),p,d);this._setPaintValue(l,c,h,y)}_setPaintValue(l,c,p,d){if(this.type==="color"){let a=v5(p),h=v5(d);for(let y=l;y<c;y++)this.paintVertexArray.emplace(y,a[0],a[1],h[0],h[1])}else{for(let a=l;a<c;a++)this.paintVertexArray.emplace(a,p,d);this.maxValue=Math.max(this.maxValue,Math.abs(p),Math.abs(d))}}upload(l){var c,p;((c=this.paintVertexArray)===null||c===void 0?void 0:c.arrayBuffer.byteLength)&&(((p=this.paintVertexBuffer)===null||p===void 0?void 0:p.buffer)?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=l.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(l,c){let p=this.useIntegerZoom?Math.floor(c.zoom):c.zoom,d=Z0(this.expression.interpolationFactor(p,this.zoom,this.zoom+1),0,1);l.set(d)}getBinding(l,c,p){return new mu(l,c)}}class Rl{constructor(l,c,p,d,a,h){this.expression=l,this.type=c,this.useIntegerZoom=p,this.zoom=d,this.layerId=h,this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a}populatePaintArray(l,c,p){let d=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(l),this.zoomOutPaintVertexArray.resize(l),this._setPaintValues(d,l,this.getPositionIds(c),p)}updatePaintArray(l,c,p,d,a){this._setPaintValues(l,c,this.getPositionIds(p),a)}_setPaintValues(l,c,p,d){let a=this.getPositions(d);if(!a||!p)return;let h=a[p.min],y=a[p.mid],w=a[p.max];if(h&&y&&w)for(let C=l;C`#define HAS_UNIFORM_${d}`))}return l}getBinderAttributes(){let l=[];for(let c in this.binders){let p=this.binders[c];if(p instanceof zl||p instanceof Ol)for(let d of p.paintVertexAttributes)l.push(d.name);else if(p instanceof Rl){let d=p.getVertexAttributes();for(let a of d)l.push(a.name)}}return l}getBinderUniforms(){let l=[];for(let c in this.binders){let p=this.binders[c];if(p instanceof R2||p instanceof Kl||p instanceof Ol)for(let d of p.uniformNames)l.push(d)}return l}getPaintVertexBuffers(){return this._buffers}getUniforms(l,c){let p=[];for(let d in this.binders){let a=this.binders[d];if(a instanceof R2||a instanceof Kl||a instanceof Ol){for(let h of a.uniformNames)if(c[h]){let y=a.getBinding(l,c[h],h);p.push({name:h,property:d,binding:y})}}}return p}setUniforms(l,c,p,d){for(let{name:a,property:h,binding:y}of c)this.binders[h].setUniform(y,d,p.get(h),a)}updatePaintBuffers(l){this._buffers=[];for(let c in this.binders){let p=this.binders[c];if(l&&p instanceof Rl){let d=l.fromScale===2?p.zoomInPaintVertexBuffer:p.zoomOutPaintVertexBuffer;d&&this._buffers.push(d)}else(p instanceof zl||p instanceof Ol)&&p.paintVertexBuffer&&this._buffers.push(p.paintVertexBuffer)}}upload(l){for(let c in this.binders){let p=this.binders[c];(p instanceof zl||p instanceof Ol||p instanceof Rl)&&p.upload(l)}this.updatePaintBuffers()}destroy(){for(let l in this.binders){let c=this.binders[l];(c instanceof zl||c instanceof Ol||c instanceof Rl)&&c.destroy()}}}class vu{constructor(l,c,p=()=>!0){this.programConfigurations={};for(let d of l)this.programConfigurations[d.id]=new kc(d,c,p);this.needsUpload=!1,this._featureMap=new fu,this._bufferOffset=0}populatePaintArrays(l,c,p,d){for(let a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(l,c,d);c.id!==void 0&&this._featureMap.add(c.id,p,this._bufferOffset,l),this._bufferOffset=l,this.needsUpload=!0}updatePaintArrays(l,c,p,d){for(let a of p)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(l,this._featureMap,c,a,d)||this.needsUpload}get(l){return this.programConfigurations[l]}upload(l){if(this.needsUpload){for(let c in this.programConfigurations)this.programConfigurations[c].upload(l);this.needsUpload=!1}}destroy(){for(let l in this.programConfigurations)this.programConfigurations[l].destroy()}}function J7(l,c){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[l]||[l.replace(`${c}-`,"").replace(/-/g,"_")]}function cp(l,c,p){let d={color:{source:J5,composite:m},number:{source:wc,composite:J5}},a=function(h){return{"line-pattern":{source:l1,composite:l1},"fill-pattern":{source:l1,composite:l1},"fill-extrusion-pattern":{source:l1,composite:l1},"line-dasharray":{source:J,composite:J}}[h]}(l);return(a==null?void 0:a[p])||d[c][p]}O1("ConstantBinder",R2),O1("CrossFadedConstantBinder",Kl),O1("SourceExpressionBinder",zl),O1("CrossFadedPatternBinder",gu),O1("CrossFadedDasharrayBinder",a5),O1("CompositeExpressionBinder",Ol),O1("ProgramConfiguration",kc,{omit:["_buffers"]}),O1("ProgramConfigurationSet",vu);let Uu=Math.pow(2,14)-1,j7=-Uu-1;function o5(l){let c=ul/l.extent,p=l.loadGeometry();for(let d of p)for(let a of d){let h=Math.round(a.x*c),y=Math.round(a.y*c);a.x=Z0(h,j7,Uu),a.y=Z0(y,j7,Uu),(ha.x+1||ya.y+1)&&w0("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return p}function h5(l,c){return{type:l.type,id:l.id,properties:l.properties,geometry:c?o5(l):[]}}let Hr=-32768;function rp(l,c,p,d,a){l.emplaceBack(Hr+8*c+d,Hr+8*p+a)}class b3{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((c)=>c.id),this.index=l.index,this.hasDependencies=!1,this.layoutVertexArray=new _,this.indexArray=new D1,this.segments=new M1,this.programConfigurations=new vu(l.layers,l.zoom),this.stateDependentLayerIds=this.layers.filter((c)=>c.isStateDependent()).map((c)=>c.id)}populate(l,c,p){let d=this.layers[0],a=[],h=null,y=!1,w=d.type==="heatmap";if(d.type==="circle"){let S=d;h=S.layout.get("circle-sort-key"),y=!h.isConstant(),w||(w=S.paint.get("circle-pitch-alignment")==="map")}let C=w?c.subdivisionGranularity.circle:1;for(let{feature:S,id:L,index:s,sourceLayerIndex:U}of l){let N=this.layers[0]._featureFilter.needGeometry,R=h5(S,N);if(!this.layers[0]._featureFilter.filter(new ql(this.zoom),R,p))continue;let P=y?h.evaluate(R,{},p):void 0,B={id:L,properties:S.properties,type:S.type,sourceLayerIndex:U,index:s,geometry:N?R.geometry:o5(S),patterns:{},sortKey:P};a.push(B)}y&&a.sort((S,L)=>S.sortKey-L.sortKey);for(let S of a){let{geometry:L,index:s,sourceLayerIndex:U}=S,N=l[s].feature;this.addFeature(S,L,s,p,C),c.featureIndex.insert(N,L,s,U,this.index)}}update(l,c,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,c,this.stateDependentLayers,{imagePositions:p})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,Z1),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(l,c,p,d,a=1){let h;switch(a){case 1:h=[0,7];break;case 3:h=[0,2,5,7];break;case 5:h=[0,1,3,4,6,7];break;case 7:h=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${a}; valid values are 1, 3, 5, 7.`)}let y=h.length;for(let w of c)for(let C of w){let{x:S,y:L}=C;if(S=ul||L=ul)continue;let s=this.segments.prepareSegment(y*y,this.layoutVertexArray,this.indexArray,l.sortKey),U=s.vertexLength;for(let N=0;N<y;N++)for(let R=0;R<y;R++)rp(this.layoutVertexArray,S,L,h[R],h[N]);for(let N=0;N<y-1;N++)for(let R=0;R1){if(sd(l,c))return!0;for(let d of c)if(Cd(d,l,p))return!0}for(let d of l)if(Cd(d,c,p))return!0;return!1}function sd(l,c){if(l.length===0||c.length===0)return!1;for(let p=0;p<l.length-1;p++){let d=l[p],a=l[p+1];for(let h=0;h<c.length-1;h++)if(Nk(d,a,c[h],c[h+1]))return!0}return!1}function Nk(l,c,p,d){return u0(l,p,d)!==u0(c,p,d)&&u0(l,c,p)!==u0(l,c,d)}function Cd(l,c,p){let d=p*p;if(c.length===1)return l.distSqr(c[0])<d;for(let a=1;a<c.length;a++)if(ga(l,c[a-1],c[a])<d)return!0;return!1}function ga(l,c,p){let d=c.distSqr(p);if(d===0)return l.distSqr(c);let a=((l.x-c.x)*(p.x-c.x)+(l.y-c.y)*(p.y-c.y))/d;return l.distSqr(a1?p:p.sub(c)._mult(a)._add(c))}function va(l,c){let p,d,a,h=!1;for(let y of l){p=y;for(let w=0,C=p.length-1;w
c.y!=a.y>c.y&&c.x<(a.x-d.x)*(c.y-d.y)/(a.y-d.y)+d.x&&(h=!h)}return h}function Mr(l,c){let p=!1;for(let d=0,a=l.length-1;dc.y!=y.y>c.y&&c.x<(y.x-h.x)*(c.y-h.y)/(y.y-h.y)+h.x&&(p=!p)}return p}function qk(l,c,p){let d=p[0],a=p[2];if(l.x<d.x&&c.xa.x&&c.x>a.x||l.y<d.y&&c.ya.y&&c.y>a.y)return!1;let h=u0(l,c,p[0]);return h!==u0(l,c,p[1])||h!==u0(l,c,p[2])||h!==u0(l,c,p[3])}function Kr(l,c,p){let d=c.paint.get(l).value;return d.kind==="constant"?d.value:p.programConfigurations.get(c.id).getMaxValue(l)}function fp(l){return Math.sqrt(l[0]*l[0]+l[1]*l[1])}function dp(l,c,p,d,a){if(!c[0]&&!c[1])return l;let h=Q.convert(c)._mult(a);p==="viewport"&&h._rotate(-d);let y=[];for(let w of l)y.push(w.sub(h));return y}function Fk(l){let c=[];for(let p=0;pWd(O,P,B,H))}(C,a,y,w),N=S),aa({queryGeometry:U,size:N,transform:a,unwrappedTileID:y,getElevation:w,pitchAlignment:s,pitchScale:L},d)}}class Ld extends b3{}let wa;O1("HeatmapBucket",Ld,{omit:["layers"]});var Yk={get paint(){return wa=wa||new V0({"heatmap-radius":new _1(E1.paint_heatmap["heatmap-radius"]),"heatmap-weight":new _1(E1.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new j1(E1.paint_heatmap["heatmap-intensity"]),"heatmap-color":new G5(E1.paint_heatmap["heatmap-color"]),"heatmap-opacity":new j1(E1.paint_heatmap["heatmap-opacity"])})}};function Ad(l,{width:c,height:p},d,a){if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==c*p*d)throw RangeError(`mismatched image size. expected: ${a.length} but got: ${c*p*d}`)}else a=new Uint8Array(c*p*d);return l.width=c,l.height=p,l.data=a,l}function na(l,{width:c,height:p},d){if(c===l.width&&p===l.height)return;let a=Ad({},{width:c,height:p},d);Vd(l,a,{x:0,y:0},{x:0,y:0},{width:Math.min(l.width,c),height:Math.min(l.height,p)},d),l.width=c,l.height=p,l.data=a.data}function Vd(l,c,p,d,a,h){if(a.width===0||a.height===0)return c;if(a.width>l.width||a.height>l.height||p.x>l.width-a.width||p.y>l.height-a.height)throw RangeError("out of range source coordinates for image copy");if(a.width>c.width||a.height>c.height||d.x>c.width-a.width||d.y>c.height-a.height)throw RangeError("out of range destination coordinates for image copy");let y=l.data,w=c.data;if(y===w)throw Error("srcData equals dstData, so image is already copied");for(let C=0;C<a.height;C++){let S=((p.y+C)*l.width+p.x)*h,L=((d.y+C)*c.width+d.x)*h;for(let s=0;s<a.width*h;s++)w[L+s]=y[S+s]}return c}class b7{constructor(l,c){Ad(this,l,1,c)}resize(l){na(this,l,1)}clone(){return new b7({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(l,c,p,d,a){Vd(l,c,p,d,a,1)}}class s2{constructor(l,c){Ad(this,l,4,c)}resize(l){na(this,l,4)}replace(l,c){c?this.data.set(l):this.data=l instanceof Uint8ClampedArray?new Uint8Array(l.buffer):l}clone(){return new s2({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(l,c,p,d,a){Vd(l,c,p,d,a,4)}setPixel(l,c,p){let d=4*(l*this.width+c);this.data[d+0]=Math.round(255*p.r/p.a),this.data[d+1]=Math.round(255*p.g/p.a),this.data[d+2]=Math.round(255*p.b/p.a),this.data[d+3]=Math.round(255*p.a)}}function ka(l){let c=new Uint8Array(l.length);for(let p=0;p{c[l.evaluationKey]=C;let S=l.expression.evaluate(c);a.setPixel(y/4/p,w/4,S)};if(l.clips)for(let y=0,w=0;y<d;++y,w+=4*p)for(let C=0,S=0;C<p;C++,S+=4){let L=C/(p-1),{start:s,end:U}=l.clips[y];h(w,S,s*(1-L)+U*L)}else for(let y=0,w=0;y<p;y++,w+=4)h(0,w,y/(p-1));return a}O1("AlphaImage",b7),O1("RGBAImage",s2);let Nd="big-fb";class Ea extends r2{createBucket(l){return new Ld(l)}constructor(l,c){super(l,Yk,c),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(l){l==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Sa({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Nd)&&this.heatmapFbos.delete(Nd)}queryRadius(l){return Kr("heatmap-radius",this,l)}queryIntersectsFeature({queryGeometry:l,feature:c,featureState:p,geometry:d,transform:a,pixelsToTileUnits:h,unwrappedTileID:y,getElevation:w}){return aa({queryGeometry:l,size:this.paint.get("heatmap-radius").evaluate(c,p)*h,transform:a,unwrappedTileID:y,getElevation:w},d)}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&!this.isHidden()}}let sa;var Bk={get paint(){return sa=sa||new V0({"hillshade-illumination-direction":new j1(E1.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new j1(E1.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new j1(E1.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new j1(E1.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new j1(E1.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new j1(E1.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new j1(E1.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new j1(E1.paint_hillshade["hillshade-method"]),resampling:new j1(E1.paint_hillshade.resampling)})}};class Ca extends r2{constructor(l,c){super(l,Bk,c),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let l=this.paint.get("hillshade-illumination-direction").values,c=this.paint.get("hillshade-illumination-altitude").values,p=this.paint.get("hillshade-highlight-color").values,d=this.paint.get("hillshade-shadow-color").values,a=Math.max(l.length,c.length,p.length,d.length);l=l.concat(Array(a-l.length).fill(l.at(-1))),c=c.concat(Array(a-c.length).fill(c.at(-1))),p=p.concat(Array(a-p.length).fill(p.at(-1))),d=d.concat(Array(a-d.length).fill(d.at(-1)));let h=c.map(Wu);return{directionRadians:l.map(Wu),altitudeRadians:h,shadowColor:d,highlightColor:p}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&!this.isHidden()}}let Wa;var zk={get paint(){return Wa=Wa||new V0({"color-relief-opacity":new j1(E1["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new G5(E1["paint_color-relief"]["color-relief-color"]),resampling:new j1(E1["paint_color-relief"].resampling)})}};function La(l){return"data"in l}class mp{constructor(l,c,p,d){this.context=l,this.format=p,this.texture=l.gl.createTexture(),this._ownedHandle=this.texture,this.update(c,d)}update(l,c,p){var d;let{width:a,height:h}=l,y=(((d=this.size)===null||d===void 0?void 0:d[0])!==a||this.size[1]!==h)&&!p,{context:w}=this,{gl:C}=w;this.useMipmap=Boolean(c==null?void 0:c.useMipmap),C.bindTexture(C.TEXTURE_2D,this.texture),w.pixelStoreUnpackFlipY.set(!1),w.pixelStoreUnpack.set(1);let S=this.format===C.RGBA&&(c==null?void 0:c.premultiply)!==!1;if(y)this.size=[a,h],La(l)?(w.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(l,S,a,h,C)):(w.pixelStoreUnpackPremultiplyAlpha.set(S),this._uploadDomImage(l,C));else{let{x:L,y:s}=p||{x:0,y:0};La(l)?(w.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(l,S,L,s,a,h,C)):(w.pixelStoreUnpackPremultiplyAlpha.set(S),this._updateDomImage(l,L,s,C))}this.useMipmap&&this.isSizePowerOfTwo()&&C.generateMipmap(C.TEXTURE_2D),w.pixelStoreUnpackFlipY.setDefault(),w.pixelStoreUnpack.setDefault(),w.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(l,c){c.texImage2D(c.TEXTURE_2D,0,this.format,this.format,c.UNSIGNED_BYTE,l)}_uploadRawData(l,c,p,d,a){let{data:h}=l;c&&h&&(h=ka(h)),a.texImage2D(a.TEXTURE_2D,0,this.format,p,d,0,this.format,a.UNSIGNED_BYTE,h)}_updateDomImage(l,c,p,d){d.texSubImage2D(d.TEXTURE_2D,0,c,p,d.RGBA,d.UNSIGNED_BYTE,l)}_updateRawData(l,c,p,d,a,h,y){let{data:w}=l;c&&w&&(w=ka(w)),y.texSubImage2D(y.TEXTURE_2D,0,p,d,a,h,y.RGBA,y.UNSIGNED_BYTE,w)}bind(l,c,p){let{context:d}=this,{gl:a}=d;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),a.bindTexture(a.TEXTURE_2D,this.texture),p!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(p=a.LINEAR),l!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,l),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,p||l),this.filter=l),c!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,c),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,c),this.wrap=c)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:l}=this.context;l.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class qd{constructor(l,c,p,d=1,a=1,h=1,y=0){if(this.uid=l,c.height!==c.width)throw RangeError("DEM tiles must be square");if(p&&!["mapbox","terrarium","custom"].includes(p))return void w0(`"${p}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=c.height;let w=this.dim=c.height-2;switch(this.data=new Uint32Array(c.data.buffer),p){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=0.00390625,this.baseShift=32768;break;case"custom":this.redFactor=d,this.greenFactor=a,this.blueFactor=h,this.baseShift=y;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=0.1,this.baseShift=1e4}for(let C=0;C<w;C++)this.data[this._idx(-1,C)]=this.data[this._idx(0,C)],this.data[this._idx(w,C)]=this.data[this._idx(w-1,C)],this.data[this._idx(C,-1)]=this.data[this._idx(C,0)],this.data[this._idx(C,w)]=this.data[this._idx(C,w-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(w,-1)]=this.data[this._idx(w-1,0)],this.data[this._idx(-1,w)]=this.data[this._idx(0,w-1)],this.data[this._idx(w,w)]=this.data[this._idx(w-1,w-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let C=0;C<w;C++)for(let S=0;Sthis.max&&(this.max=L),L<this.min&&(this.min=L)}}get(l,c){let p=new Uint8Array(this.data.buffer),d=4*this._idx(l,c);return this.unpack(p[d],p[d+1],p[d+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(l,c){if(l=this.dim+1||c=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${l}, y: ${c}, dim: ${this.dim}`);return(c+1)*this.stride+(l+1)}unpack(l,c,p){return l*this.redFactor+c*this.greenFactor+p*this.blueFactor-this.baseShift}pack(l){return Aa(l,this.getUnpackVector())}getPixels(){return new s2({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(l,c,p){if(this.dim!==l.dim)throw Error("dem dimension mismatch");let d=c*this.dim,a=c*this.dim+this.dim,h=p*this.dim,y=p*this.dim+this.dim;switch(c){case-1:d=a-1;break;case 1:a=d+1}switch(p){case-1:h=y-1;break;case 1:y=h+1}let w=-c*this.dim,C=-p*this.dim;for(let S=h;S<y;S++)for(let L=d;L<a;L++)this.data[this._idx(L,S)]=l.data[this._idx(L+w,S+C)]}}function Aa(l,c){let p=c[0],d=c[1],a=c[2],h=c[3],y=Math.min(p,d,a),w=Math.round((l+h)/y);return{r:Math.floor(w*y/p)%256,g:Math.floor(w*y/d)%256,b:Math.floor(w*y/a)%256}}O1("DEMData",qd);class Va extends r2{constructor(l,c){super(l,zk,c)}_createColorRamp(l){let c={elevationStops:[],colorStops:[]},p=this._transitionablePaint._values["color-relief-color"].value.expression;if(p instanceof z3&&p._styleExpression.expression instanceof c0){this.colorRampExpression=p;let h=p._styleExpression.expression;c.elevationStops=h.labels,c.colorStops=[];for(let y of c.elevationStops)c.colorStops.push(h.evaluate({globals:{elevation:y}}))}if(c.elevationStops.length<1&&(c.elevationStops=[0],c.colorStops=[ml.transparent]),c.elevationStops.length<2&&(c.elevationStops.push(c.elevationStops[0]+1),c.colorStops.push(c.colorStops[0])),c.elevationStops.length<=l)return c;let d={elevationStops:[],colorStops:[]},a=(c.elevationStops.length-1)/(l-1);for(let h=0;h<c.elevationStops.length-0.5;h+=a)d.elevationStops.push(c.elevationStops[Math.round(h)]),d.colorStops.push(c.colorStops[Math.round(h)]);return w0(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${l}, provided: ${c.elevationStops.length}`),d}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(l,c,p){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let d=this._createColorRamp(c),a=new s2({width:d.colorStops.length,height:1}),h=new s2({width:d.colorStops.length,height:1});for(let y=0;y<d.elevationStops.length;y++){let w=Aa(d.elevationStops[y],p);h.setPixel(0,y,new ml(w.r/255,w.g/255,w.b/255,1)),a.setPixel(0,y,d.colorStops[y])}return this.colorRampTextures={elevationTexture:new mp(l,h,l.gl.RGBA),colorTexture:new mp(l,a,l.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let Qk=xl([{name:"a_pos",components:2,type:"Int16"}],4),{members:Hk}=Qk;function gp(l,c,p){let d=p.patternDependencies,a=!1;for(let h of c){let y=h.paint.get(`${l}-pattern`);y.isConstant()||(a=!0);let w=y.constantOr(null);w&&(a=!0,d[w.to]=!0,d[w.from]=!0)}return a}function Fd(l,c,p,d,a){let{zoom:h}=d,y=a.patternDependencies;for(let w of c){let C=w.paint.get(`${l}-pattern`).value;if(C.kind!=="constant"){let S=C.evaluate({zoom:h-1},p,{},a.availableImages),L=C.evaluate({zoom:h},p,{},a.availableImages),s=C.evaluate({zoom:h+1},p,{},a.availableImages);S=(S==null?void 0:S.name)?S.name:S,L=(L==null?void 0:L.name)?L.name:L,s=(s==null?void 0:s.name)?s.name:s,y[S]=!0,y[L]=!0,y[s]=!0,p.patterns[w.id]={min:S,mid:L,max:s}}}return p}function Na(l,c,p,d,a){let h;if(a===function(y,w,C,S){let L=0;for(let s=w,U=C-S;s0)for(let y=c;y
=c;y-=d)h=xa(y/d|0,l[y],l[y+1],h);return h&&Or(h,h.next)&&(e7(h),h=h.next),h}function Sc(l,c){if(!l)return l;c||(c=l);let p,d=l;do if(p=!1,d.steiner||!Or(d,d.next)&&p0(d.prev,d,d.next)!==0)d=d.next;else{if(e7(d),d=c=d.prev,d===d.next)break;p=!0}while(p||d!==c);return c}function $7(l,c,p,d,a,h,y){if(!l)return;!y&&h&&function(C,S,L,s){let U=C;do U.z===0&&(U.z=Ud(U.x,U.y,S,L,s)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==C);U.prevZ.nextZ=null,U.prevZ=null,function(N){let R,P=1;do{let B,H=N;N=null;let O=null;for(R=0;H;){R++;let M=H,Z=0;for(let j=0;j
0||T>0&&M;)Z!==0&&(T===0||!M||H.z1)}(U)}(l,d,a,h);let w=l;for(;l.prev!==l.next;){let{prev:C,next:S}=l;if(h?Kk(l,d,a,h):Mk(l))c.push(C.i,l.i,S.i),e7(l),l=S.next,w=S.next;else if((l=S)===w){y?y===1?$7(l=Ok(Sc(l),c),c,p,d,a,h,2):y===2&&Zk(l,c,p,d,a,h):$7(Sc(l),c,p,d,a,h,1);break}}}function Mk(l){let c=l.prev,p=l,d=l.next;if(p0(c,p,d)>=0)return!1;let a=c.x,h=p.x,y=d.x,w=c.y,C=p.y,S=d.y,L=Math.min(a,h,y),s=Math.min(w,C,S),U=Math.max(a,h,y),N=Math.max(w,C,S),R=d.next;for(;R!==c;){if(R.x>=L&&R.x=s&&R.y=0)return!1;R=R.next}return!0}function Kk(l,c,p,d){let a=l.prev,h=l,y=l.next;if(p0(a,h,y)>=0)return!1;let w=a.x,C=h.x,S=y.x,L=a.y,s=h.y,U=y.y,N=Math.min(w,C,S),R=Math.min(L,s,U),P=Math.max(w,C,S),B=Math.max(L,s,U),H=Ud(N,R,c,p,d),O=Ud(P,B,c,p,d),M=l.prevZ,Z=l.nextZ;for(;M&&M.z>=H&&Z&&Z.z=N&&M.x=R&&M.y=0)return!1;if(M=M.prevZ,Z.x>=N&&Z.x=R&&Z.y=0)return!1;Z=Z.nextZ}for(;M&&M.z>=H;){if(M.x>=N&&M.x=R&&M.y=0)return!1;M=M.prevZ}for(;Z&&Z.z=N&&Z.x=R&&Z.y=0)return!1;Z=Z.nextZ}return!0}function Ok(l,c){let p=l;do{let d=p.prev,a=p.next.next;!Or(d,a)&&Fa(d,p,p.next,a)&&i7(d,a)&&i7(a,d)&&(c.push(d.i,p.i,a.i),e7(p),e7(p.next),p=l=a),p=p.next}while(p!==l);return Sc(p)}function Zk(l,c,p,d,a,h){let y=l;do{let w=y.next.next;for(;w!==y.prev;){if(y.i!==w.i&&Jk(y,w)){let C=Ua(y,w);return y=Sc(y,y.next),C=Sc(C,C.next),$7(y,c,p,d,a,h,0),void $7(C,c,p,d,a,h,0)}w=w.next}y=y.next}while(y!==l)}function Dk(l,c){let p=l.x-c.x;return p===0&&(p=l.y-c.y,p===0)&&(p=(l.next.y-l.y)/(l.next.x-l.x)-(c.next.y-c.y)/(c.next.x-c.x)),p}function Tk(l,c){let p=function(a,h){let y=h,w=a.x,C=a.y,S,L=-1/0;if(Or(a,y))return y;do{if(Or(a,y.next))return y.next;if(C=y.next.y&&y.next.y!==y.y){let P=y.x+(C-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(PL&&(L=P,S=y.x=y.x&&y.x>=U&&w!==y.x&&qa(C<N?w:L,C,U,N,C<N?L:w,C,y.x,y.y)){let P=Math.abs(C-y.y)/(w-y.x);i7(y,a)&&(PS.x||y.x===S.x&&Gk(S,y)))&&(S=y,R=P)}y=y.next}while(y!==s);return S}(l,c);if(!p)return c;let d=Ua(p,l);return Sc(d,d.next),Sc(p,p.next)}function Gk(l,c){return p0(l.prev,l,c.prev)<0&&p0(c.next,l,l.next)<0}function Ud(l,c,p,d,a){return(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-p)*a|0)|l<<8))|l<<4))|l<<2))|l<<1))|(c=1431655765&((c=858993459&((c=252645135&((c=16711935&((c=(c-d)*a|0)|c<<8))|c<<4))|c<<2))|c<<1))<<1}function Xk(l){let c=l,p=l;do(c.x<p.x||c.x===p.x&&c.y
=(l-y)*(h-w)&&(l-y)*(d-w)>=(p-y)*(c-w)&&(p-y)*(h-w)>=(a-y)*(d-w)}function _7(l,c,p,d,a,h,y,w){return!(l===y&&c===w)&&qa(l,c,p,d,a,h,y,w)}function Jk(l,c){return l.next.i!==c.i&&l.prev.i!==c.i&&!function(p,d){let a=p;do{if(a.i!==p.i&&a.next.i!==p.i&&a.i!==d.i&&a.next.i!==d.i&&Fa(a,a.next,p,d))return!0;a=a.next}while(a!==p);return!1}(l,c)&&(i7(l,c)&&i7(c,l)&&function(p,d){let a=p,h=!1,y=(p.x+d.x)/2,w=(p.y+d.y)/2;do a.y>w!=a.next.y>w&&a.next.y!==a.y&&y0&&p0(c.prev,c,c.next)>0)}function p0(l,c,p){return(c.y-l.y)*(p.x-c.x)-(c.x-l.x)*(p.y-c.y)}function Or(l,c){return l.x===c.x&&l.y===c.y}function Fa(l,c,p,d){let a=ap(p0(l,c,p)),h=ap(p0(l,c,d)),y=ap(p0(p,d,l)),w=ap(p0(p,d,c));return a!==h&&y!==w||!(a!==0||!vp(l,p,c))||!(h!==0||!vp(l,d,c))||!(y!==0||!vp(p,l,d))||!(w!==0||!vp(p,c,d))}function vp(l,c,p){return c.x=Math.min(l.x,p.x)&&c.y=Math.min(l.y,p.y)}function ap(l){return l>0?1:l<0?-1:0}function i7(l,c){return p0(l.prev,l,l.next)=0&&p0(l,l.prev,c)>=0:p0(l,c,l.prev)<0||p0(l,l.next,c)l)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=l,this._minGranularity=c}getGranularityForZoomLevel(l){return Math.max(Math.floor(this._baseZoomGranularity/(1<<l)),this._minGranularity,1)}}class t7{constructor(l){this.fill=l.fill,this.line=l.line,this.tile=l.tile,this.stencil=l.stencil,this.circle=l.circle}}t7.noSubdivision=new t7({fill:new Ec(0,0),line:new Ec(0,0),tile:new Ec(0,0),stencil:new Ec(0,0),circle:1}),O1("SubdivisionGranularityExpression",Ec),O1("SubdivisionGranularitySetting",t7);let Zr=-32768,l8=32767;class Pa{constructor(l,c){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=l,this._granularityCellSize=ul/l,this._canonical=c}_getKey(l,c){return(l+=32768)<<16|c+32768}_vertexToIndex(l,c){if(l<-32768||c32767||c>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let p=0|Math.round(l),d=0|Math.round(c),a=this._getKey(p,d);if(this._vertexDictionary.has(a))return this._vertexDictionary.get(a);let h=this._vertexBuffer.length/2;return this._vertexDictionary.set(a,h),this._vertexBuffer.push(p,d),h}_subdivideTrianglesScanline(l){if(this._granularity<2)return function(d,a){let h=[];for(let y=0;y0?(h.push(w),h.push(S),h.push(C)):(h.push(w),h.push(C),h.push(S))}return h}(this._vertexBuffer,l);let c=[],p=l.length;for(let d=0;d<p;d+=3){let a=[l[d+0],l[d+1],l[d+2]],h=[this._vertexBuffer[2*l[d+0]+0],this._vertexBuffer[2*l[d+0]+1],this._vertexBuffer[2*l[d+1]+0],this._vertexBuffer[2*l[d+1]+1],this._vertexBuffer[2*l[d+2]+0],this._vertexBuffer[2*l[d+2]+1]],y=1/0,w=1/0,C=-1/0,S=-1/0;for(let R=0;R<3;R++){let P=h[2*R],B=h[2*R+1];y=Math.min(y,P),C=Math.max(C,P),w=Math.min(w,B),S=Math.max(S,B)}if(y===C||w===S)continue;let L=Math.floor(y/this._granularityCellSize),s=Math.ceil(C/this._granularityCellSize),U=Math.floor(w/this._granularityCellSize),N=Math.ceil(S/this._granularityCellSize);if(L!==s||U!==N)for(let R=U;R<N;R++){let P=this._scanlineGenerateVertexRingForCellRow(R,h,a);jk(this._vertexBuffer,P,c)}else c.push(...a)}return c}_scanlineGenerateVertexRingForCellRow(l,c,p){let d=l*this._granularityCellSize,a=d+this._granularityCellSize,h=[];for(let y=0;y=1||Z<=0)||B&&(Ca)){L>=d&&L0&&h.push(this._vertexToIndex(w+N*M,C+R*M));let T=w+N*Math.max(M,0),j=w+N*Math.min(Z,1);P||this._generateIntraEdgeVertices(h,w,C,S,L,T,j),!B&&Z=d&&L<=a)&&h.push(p[(y+1)%3]),!B&&(L=a)&&this._generateInterEdgeVertices(h,w,C,S,L,s,U,j,d,a)}return h}_generateIntraEdgeVertices(l,c,p,d,a,h,y){let w=d-c,C=a-p,S=C===0,L=S?Math.min(c,d):Math.min(h,y),s=S?Math.max(c,d):Math.max(h,y),U=Math.floor(L/this._granularityCellSize)+1,N=Math.ceil(s/this._granularityCellSize)-1;if(S?c<d:h<y)for(let R=U;R=U;R--){let P=R*this._granularityCellSize;l.push(this._vertexToIndex(P,p+C*(P-c)/w))}}_generateInterEdgeVertices(l,c,p,d,a,h,y,w,C,S){let L=a-p,s=h-d,U=y-a,N=(C-a)/U,R=(S-a)/U,P=Math.min(N,R),B=Math.max(N,R),H=d+s*P,O=Math.floor(Math.min(H,w)/this._granularityCellSize)+1,M=Math.ceil(Math.max(H,w)/this._granularityCellSize)-1,Z=w=1||B<=0){let d1=p-y,m1=h+(c-h)*Math.min((C-y)/d1,(S-y)/d1);O=Math.floor(Math.min(m1,w)/this._granularityCellSize)+1,M=Math.ceil(Math.max(m1,w)/this._granularityCellSize)-1,Z=w0?S:C;if(Z)for(let d1=O;d1=O;d1--)l.push(this._vertexToIndex(d1*this._granularityCellSize,j))}_generateOutline(l){let c=[];for(let p of l){let d=sc(p,this._granularity,!0),a=this._pointArrayToIndices(d),h=[];for(let y=1;y<a.length;y++)h.push(a[y-1]),h.push(a[y]);c.push(h)}return c}_handlePoles(l){let c=!1,p=!1;this._canonical&&(this._canonical.y===0&&(c=!0),this._canonical.y===(1<<this._canonical.z)-1&&(p=!0)),(c||p)&&this._fillPoles(l,c,p)}_ensureNoPoleVertices(){let l=this._vertexBuffer;for(let c=0;ca!=(h===Zr)?(l.push(c),l.push(p),l.push(this._vertexToIndex(d,h)),l.push(p),l.push(this._vertexToIndex(a,h)),l.push(this._vertexToIndex(d,h))):(l.push(p),l.push(c),l.push(this._vertexToIndex(d,h)),l.push(this._vertexToIndex(a,h)),l.push(p),l.push(this._vertexToIndex(d,h)))}_fillPoles(l,c,p){let d=this._vertexBuffer,a=ul,h=l.length;for(let y=2;y<h;y+=3){let w=l[y-2],C=l[y-1],S=l[y],L=d[2*w],s=d[2*w+1],U=d[2*C],N=d[2*C+1],R=d[2*S],P=d[2*S+1];c&&(s===0&&N===0&&this._generatePoleQuad(l,w,C,L,U,Zr),N===0&&P===0&&this._generatePoleQuad(l,C,S,U,R,Zr),P===0&&s===0&&this._generatePoleQuad(l,S,w,R,L,Zr)),p&&(s===a&&N===a&&this._generatePoleQuad(l,w,C,L,U,l8),N===a&&P===a&&this._generatePoleQuad(l,C,S,U,R,l8),P===a&&s===a&&this._generatePoleQuad(l,S,w,R,L,l8))}}_initializeVertices(l){for(let c=0;c<l.length;c+=2)this._vertexToIndex(l[c],l[c+1])}subdividePolygonInternal(l,c){if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:p,holeIndices:d}=function(y){let w=[],C=[];for(let S of y)if(S.length!==0){S!==y[0]&&w.push(C.length/2);for(let L of S)C.push(L.x),C.push(L.y)}return{flattened:C,holeIndices:w}}(l),a;this._initializeVertices(p);try{let y=function(C,S,L=2){let s=S&&S.length,U=s?S[0]*L:C.length,N=Na(C,0,U,L,!0),R=[];if(!N||N.next===N.prev)return R;let P,B,H;if(s&&(N=function(O,M,Z,T){let j=[];for(let d1=0,m1=M.length;d1<m1;d1++){let v1=Na(O,M[d1]*T,d1<m1-1?M[d1+1]*T:O.length,T,!1);v1===v1.next&&(v1.steiner=!0),j.push(Xk(v1))}j.sort(Dk);for(let d1=0;d180*L){P=C[0],B=C[1];let O=P,M=B;for(let Z=L;Z<U;Z+=L){let T=C[Z],j=C[Z+1];T<P&&(P=T),jO&&(O=T),j>M&&(M=j)}H=Math.max(O-P,M-B),H=H!==0?32767/H:0}return $7(N,R,L,P,B,H,0),R}(p,d),w=this._convertIndices(p,y);a=this._subdivideTrianglesScanline(w)}catch(y){console.error(y)}let h=[];return c&&(h=this._generateOutline(l)),this._ensureNoPoleVertices(),this._handlePoles(a),{verticesFlattened:this._vertexBuffer,indicesTriangles:a,indicesLineList:h}}_convertIndices(l,c){let p=[];for(let d of c)p.push(this._vertexToIndex(l[2*d],l[2*d+1]));return p}_pointArrayToIndices(l){let c=[];for(let p of l)c.push(this._vertexToIndex(p.x,p.y));return c}}function Ra(l,c,p,d=!0){return new Pa(p,c).subdividePolygonInternal(l,d)}function sc(l,c,p=!1){if(!l||l.length<1)return[];if(l.length<2)return[];let d=l[0],a=l[l.length-1],h=p&&(d.x!==a.x||d.y!==a.y);if(c<2)return h?[...l,l[0]]:[...l];let y=Math.floor(ul/c),w=[];w.push(new Q(l[0].x,l[0].y));let C=l.length,S=h?C:C-1;for(let L=0;L<S;L++){let s=l[L],U=L0?(Math.floor(d1/y)+1)*y:(Math.ceil(d1/y)-1)*y,w1=Z>0?(Math.floor(m1/y)+1)*y:(Math.ceil(m1/y)-1)*y,S1=Math.abs(d1-n1),y1=Math.abs(m1-w1),s1=Math.abs(d1-P),K1=Math.abs(m1-B),B1=H?S1/T:Number.POSITIVE_INFINITY,Y1=O?y1/j:Number.POSITIVE_INFINITY;if((s1<=S1||!H)&&(K1<=y1||!O))break;if(B1<Y1&&H||!O){d1=n1,m1+=Z*B1;let Q1=new Q(d1,Math.round(m1));w[w.length-1].x===Q1.x&&w[w.length-1].y===Q1.y||w.push(Q1)}else{d1+=M*Y1,m1=w1;let Q1=new Q(Math.round(d1),m1);w[w.length-1].x===Q1.x&&w[w.length-1].y===Q1.y||w.push(Q1)}}let v1=new Q(P,B);w[w.length-1].x===v1.x&&w[w.length-1].y===v1.y||w.push(v1)}return w}function jk(l,c,p){if(c.length===0)throw Error("Subdivision vertex ring is empty.");let d=0,a=l[2*c[0]];for(let C=1;C<c.length;C++){let S=l[2*c[C]];S=0?y-1:h-1,S=(w+1)%h,L=l[2*c[C]],s=l[2*c[S]],U=l[2*c[y]],N=l[2*c[y]+1],R=l[2*c[w]+1],P=!1;if(L
s)P=!1;else{let B=R-N,H=-(l[2*c[w]]-U),O=N((s-U)*B+(l[2*c[S]+1]-N)*H)*O&&(P=!0)}if(P){let B=c[C],H=c[y],O=c[w];B!==H&&B!==O&&H!==O&&p.push(O,H,B),y--,y=h&&(w=0)}if(C===S)break}}function Ia(l,c,p,d,a,h,y,w,C){let S=a.length/2,L=y&&w&&C;if(S<M1.MAX_VERTEX_ARRAY_LENGTH){let s=c.prepareSegment(S,p,d),U=s.vertexLength;for(let P=0;P<h.length;P+=3)d.emplaceBack(U+h[P],U+h[P+1],U+h[P+2]);let N,R;s.vertexLength+=S,s.primitiveLength+=h.length/3,L&&(R=y.prepareSegment(S,p,w),N=R.vertexLength,R.vertexLength+=S);for(let P=0;P<a.length;P+=2)l(a[P],a[P+1]);if(L)for(let P of C){for(let B=1;B<P.length;B+=2)w.emplaceBack(N+P[B-1],N+P[B]);R.primitiveLength+=P.length/2}}else(function(s,U,N,R,P,B){let H=[];for(let j=0;j<R.length/2;j++)H.push(-1);let O={count:0},M=0,Z=s.getOrCreateLatestSegment(U,N),T=Z.vertexLength;for(let j=2;j<P.length;j+=3){let d1=P[j-2],m1=P[j-1],v1=P[j],n1=H[d1]<M,w1=H[m1]<M,S1=H[v1]M1.MAX_VERTEX_ARRAY_LENGTH&&(Z=s.createNewSegment(U,N),M=O.count,n1=!0,w1=!0,S1=!0,T=0);let y1=u8(H,R,B,O,d1,n1,Z),s1=u8(H,R,B,O,m1,w1,Z),K1=u8(H,R,B,O,v1,S1,Z);N.emplaceBack(T+y1-M,T+s1-M,T+K1-M),Z.primitiveLength++}})(c,p,d,a,h,l),L&&function(s,U,N,R,P,B){let H=[];for(let j=0;j<R.length/2;j++)H.push(-1);let O={count:0},M=0,Z=s.getOrCreateLatestSegment(U,N),T=Z.vertexLength;for(let j of P)for(let d1=1;d1<j.length;d1+=2){let m1=j[d1-1],v1=j[d1],n1=H[m1]<M,w1=H[v1]M1.MAX_VERTEX_ARRAY_LENGTH&&(Z=s.createNewSegment(U,N),M=O.count,n1=!0,w1=!0,T=0);let S1=u8(H,R,B,O,m1,n1,Z),y1=u8(H,R,B,O,v1,w1,Z);N.emplaceBack(T+S1-M,T+y1-M),Z.primitiveLength++}}(y,p,w,a,C,l),c.forceNewSegmentOnNextPrepare(),y==null||y.forceNewSegmentOnNextPrepare()}function u8(l,c,p,d,a,h,y){if(h){let w=d.count;return p(c[2*a],c[2*a+1]),l[a]=d.count,d.count++,y.vertexLength++,w}return l[a]}class op{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((c)=>c.id),this.index=l.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new X,this.indexArray=new D1,this.indexArray2=new T1,this.programConfigurations=new vu(l.layers,l.zoom),this.segments=new M1,this.segments2=new M1,this.stateDependentLayerIds=this.layers.filter((c)=>c.isStateDependent()).map((c)=>c.id)}populate(l,c,p){this.hasDependencies=gp("fill",this.layers,c);let d=this.layers[0].layout.get("fill-sort-key"),a=!d.isConstant(),h=[];for(let{feature:y,id:w,index:C,sourceLayerIndex:S}of l){let L=this.layers[0]._featureFilter.needGeometry,s=h5(y,L);if(!this.layers[0]._featureFilter.filter(new ql(this.zoom),s,p))continue;let U=a?d.evaluate(s,{},p,c.availableImages):void 0,N={id:w,properties:y.properties,type:y.type,sourceLayerIndex:S,index:C,geometry:L?s.geometry:o5(y),patterns:{},sortKey:U};h.push(N)}a&&h.sort((y,w)=>y.sortKey-w.sortKey);for(let y of h){let{geometry:w,index:C,sourceLayerIndex:S}=y;if(this.hasDependencies){let L=Fd("fill",this.layers,y,{zoom:this.zoom},c);this.patternFeatures.push(L)}else this.addFeature(y,w,C,p,{},c.subdivisionGranularity);c.featureIndex.insert(l[C].feature,w,C,S,this.index)}}update(l,c,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,c,this.stateDependentLayers,{imagePositions:p})}addFeatures(l,c,p){for(let d of this.patternFeatures)this.addFeature(d,d.geometry,d.index,c,p,l.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,Hk),this.indexBuffer=l.createIndexBuffer(this.indexArray),this.indexBuffer2=l.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(l,c,p,d,a,h){for(let y of hr(c,500)){let w=Ra(y,d,h.fill.getGranularityForZoomLevel(d.z)),C=this.layoutVertexArray;Ia((S,L)=>{C.emplaceBack(S,L)},this.segments,this.layoutVertexArray,this.indexArray,w.verticesFlattened,w.indicesTriangles,this.segments2,this.indexArray2,w.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,p,{imagePositions:a,canonical:d})}}let Ya,Ba;O1("FillBucket",op,{omit:["layers","patternFeatures"]});var bk={get paint(){return Ba=Ba||new V0({"fill-antialias":new j1(E1.paint_fill["fill-antialias"]),"fill-opacity":new _1(E1.paint_fill["fill-opacity"]),"fill-color":new _1(E1.paint_fill["fill-color"]),"fill-outline-color":new _1(E1.paint_fill["fill-outline-color"]),"fill-translate":new j1(E1.paint_fill["fill-translate"]),"fill-translate-anchor":new j1(E1.paint_fill["fill-translate-anchor"]),"fill-pattern":new Fu(E1.paint_fill["fill-pattern"])})},get layout(){return Ya=Ya||new V0({"fill-sort-key":new _1(E1.layout_fill["fill-sort-key"])})}};class za extends r2{constructor(l,c){super(l,bk,c)}recalculate(l,c){super.recalculate(l,c);let p=this.paint._values["fill-outline-color"];p.value.kind==="constant"&&p.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(l){return new op(l)}queryRadius(){return fp(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:l,geometry:c,transform:p,pixelsToTileUnits:d}){return ma(dp(l,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-p.bearingInRadians,d),c)}isTileClipped(){return!0}}let $k=xl([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),_k=xl([{name:"a_centroid",components:2,type:"Int16"}],4),{members:ik}=$k;class Dr{constructor(l,c,p,d,a){this.properties={},this.extent=p,this.type=0,this.id=void 0,this._pbf=l,this._geometry=-1,this._keys=d,this._values=a,l.readFields(ek,this,c)}loadGeometry(){let l=this._pbf;l.pos=this._geometry;let c=l.readVarint()+l.pos,p=[],d,a=1,h=0,y=0,w=0;for(;l.pos<c;){if(h>3}if(h--,a===1||a===2)y+=l.readSVarint(),w+=l.readSVarint(),a===1&&(d&&p.push(d),d=[]),d&&d.push(new Q(y,w));else{if(a!==7)throw Error(`unknown command ${a}`);d&&d.push(d[0].clone())}}return d&&p.push(d),p}bbox(){let l=this._pbf;l.pos=this._geometry;let c=l.readVarint()+l.pos,p=1,d=0,a=0,h=0,y=1/0,w=-1/0,C=1/0,S=-1/0;for(;l.pos<c;){if(d>3}if(d--,p===1||p===2)a+=l.readSVarint(),h+=l.readSVarint(),aw&&(w=a),hS&&(S=h);else if(p!==7)throw Error(`unknown command ${p}`)}return[y,C,w,S]}toGeoJSON(l,c,p){let d=this.extent*Math.pow(2,p),a=this.extent*l,h=this.extent*c,y=this.loadGeometry();function w(s){return[360*(s.x+a)/d-180,360/Math.PI*Math.atan(Math.exp((1-2*(s.y+h)/d)*Math.PI))-90]}function C(s){return s.map(w)}let S;if(this.type===1){let s=[];for(let N of y)s.push(N[0]);let U=C(s);S=s.length===1?{type:"Point",coordinates:U[0]}:{type:"MultiPoint",coordinates:U}}else if(this.type===2){let s=y.map(C);S=s.length===1?{type:"LineString",coordinates:s[0]}:{type:"MultiLineString",coordinates:s}}else{if(this.type!==3)throw Error("unknown feature type");{let s=Qa(y),U=[];for(let N of s)U.push(N.map(C));S=U.length===1?{type:"Polygon",coordinates:U[0]}:{type:"MultiPolygon",coordinates:U}}}let L={type:"Feature",geometry:S,properties:this.properties};return this.id!=null&&(L.id=this.id),L}}function ek(l,c,p){l===1?c.id=p.readVarint():l===2?function(d,a){let h=d.readVarint()+d.pos;for(;d.pos<h;){let y=a._keys[d.readVarint()],w=a._values[d.readVarint()];a.properties[y]=w}}(p,c):l===3?c.type=p.readVarint():l===4&&(c._geometry=p.pos)}function Qa(l){let c=l.length;if(c<=1)return[l];let p=[],d,a;for(let h=0;h<c;h++){let y=tk(l[h]);y!==0&&(a===void 0&&(a=y<0),a===y<0?(d&&p.push(d),d=[l[h]]):d&&d.push(l[h]))}return d&&p.push(d),p}function tk(l){let c=0;for(let p,d,a=0,h=l.length,y=h-1;a<h;y=a++)p=l[a],d=l[y],c+=(d.x-p.x)*(p.y+d.y);return c}Dr.types=["Unknown","Point","LineString","Polygon"];class Ha{constructor(l,c){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=l,this._keys=[],this._values=[],this._features=[],l.readFields(lS,this,c),this.length=this._features.length}feature(l){if(l=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[l];let c=this._pbf.readVarint()+this._pbf.pos;return new Dr(this._pbf,c,this.extent,this._keys,this._values)}}function lS(l,c,p){l===15?c.version=p.readVarint():l===1?c.name=p.readString():l===5?c.extent=p.readVarint():l===2?c._features.push(p.pos):l===3?c._keys.push(p.readString()):l===4&&c._values.push(function(d){let a=null,h=d.readVarint()+d.pos;for(;d.pos>3;a=y===1?d.readString():y===2?d.readFloat():y===3?d.readDouble():y===4?d.readVarint64():y===5?d.readVarint():y===6?d.readSVarint():y===7?d.readBoolean():null}if(a==null)throw Error("unknown feature value");return a}(p))}class Pd{constructor(l,c){this.layers=l.readFields(uS,{},c)}}function uS(l,c,p){if(l===3){let d=new Ha(p,p.readVarint()+p.pos);d.length&&(c[d.name]=d)}}let Rd=Math.pow(2,13);function c8(l,c,p,d,a,h,y,w){l.emplaceBack(c,p,2*Math.floor(d*Rd)+y,a*Rd*2,h*Rd*2,Math.round(w))}class hp{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map((c)=>c.id),this.index=l.index,this.hasDependencies=!1,this.layoutVertexArray=new c1,this.centroidVertexArray=new e,this.indexArray=new D1,this.programConfigurations=new vu(l.layers,l.zoom),this.segments=new M1,this.stateDependentLayerIds=this.layers.filter((c)=>c.isStateDependent()).map((c)=>c.id)}populate(l,c,p){this.features=[],this.hasDependencies=gp("fill-extrusion",this.layers,c);for(let{feature:d,id:a,index:h,sourceLayerIndex:y}of l){let w=this.layers[0]._featureFilter.needGeometry,C=h5(d,w);if(!this.layers[0]._featureFilter.filter(new ql(this.zoom),C,p))continue;let S={id:a,sourceLayerIndex:y,index:h,geometry:w?C.geometry:o5(d),properties:d.properties,type:d.type,patterns:{}};this.hasDependencies?this.features.push(Fd("fill-extrusion",this.layers,S,{zoom:this.zoom},c)):this.addFeature(S,S.geometry,h,p,{},c.subdivisionGranularity),c.featureIndex.insert(d,S.geometry,h,y,this.index,!0)}}addFeatures(l,c,p){for(let d of this.features){let{geometry:a}=d;this.addFeature(d,a,d.index,c,p,l.subdivisionGranularity)}}update(l,c,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,c,this.stateDependentLayers,{imagePositions:p})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,ik),this.centroidVertexBuffer=l.createVertexBuffer(this.centroidVertexArray,_k.members,!0),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(l,c,p,d,a,h){for(let y of hr(c,500)){let w={x:0,y:0,sampleCount:0},C=this.layoutVertexArray.length;this.processPolygon(w,d,l,y,h);let S=this.layoutVertexArray.length-C,L=Math.floor(w.x/w.sampleCount),s=Math.floor(w.y/w.sampleCount);for(let U=0;U<S;U++)this.centroidVertexArray.emplaceBack(L,s)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,p,{imagePositions:a,canonical:d})}processPolygon(l,c,p,d,a){if(d.length{c8(S,L,s,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,C.verticesFlattened,C.indicesTriangles)}_generateSideFaces(l,c){let p=0;for(let d=1;dM1.MAX_VERTEX_ARRAY_LENGTH&&(c.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let y=a.sub(h)._perp()._unit(),w=h.dist(a);p+w>32768&&(p=0),c8(this.layoutVertexArray,a.x,a.y,y.x,y.y,0,0,p),c8(this.layoutVertexArray,a.x,a.y,y.x,y.y,0,1,p),p+=w,c8(this.layoutVertexArray,h.x,h.y,y.x,y.y,0,0,p),c8(this.layoutVertexArray,h.x,h.y,y.x,y.y,0,1,p);let C=c.segment.vertexLength;this.indexArray.emplaceBack(C,C+2,C+1),this.indexArray.emplaceBack(C+1,C+2,C+3),c.segment.vertexLength+=4,c.segment.primitiveLength+=2}}}function cS(l,c){for(let p=0;p<c.length;p++){let d=c[p];p===c.length-1&&c[0].x===d.x&&c[0].y===d.y||(l.x+=d.x,l.y+=d.y,l.sampleCount++)}}function rS(l,c){return l.x===c.x&&(l.xul)||l.y===c.y&&(l.yul)}function Ma(l){return l.every((c)=>c.xc.x>ul)||l.every((c)=>c.yc.y>ul)}let Ka;O1("FillExtrusionBucket",hp,{omit:["layers","features"]});var pS={get paint(){return Ka=Ka||new V0({"fill-extrusion-opacity":new j1(E1["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new _1(E1["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new j1(E1["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new j1(E1["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Fu(E1["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new _1(E1["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new _1(E1["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new j1(E1["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Oa extends r2{constructor(l,c){super(l,pS,c)}createBucket(l){return new hp(l)}queryRadius(){return fp(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:l,feature:c,featureState:p,geometry:d,transform:a,pixelsToTileUnits:h,pixelPosMatrix:y}){let w=dp(l,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,h),C=this.paint.get("fill-extrusion-height").evaluate(c,p),S=this.paint.get("fill-extrusion-base").evaluate(c,p),L=function(U,N){let R=[];for(let P of U){let B=[P.x,P.y,0,1];cl(B,B,N),R.push(new Q(B[0]/B[3],B[1]/B[3]))}return R}(w,y),s=function(U,N,R,P){let B=[],H=[],O=P[8]*N,M=P[9]*N,Z=P[10]*N,T=P[11]*N,j=P[8]*R,d1=P[9]*R,m1=P[10]*R,v1=P[11]*R;for(let n1 of U){let w1=[],S1=[];for(let y1 of n1){let{x:s1,y:K1}=y1,B1=P[0]*s1+P[4]*K1+P[12],Y1=P[1]*s1+P[5]*K1+P[13],Q1=P[2]*s1+P[6]*K1+P[14],i1=P[3]*s1+P[7]*K1+P[15],Vl=Q1+Z,kl=i1+T,Ul=B1+j,Q0=Y1+d1,Jl=Q1+m1,f0=i1+v1,q0=new Q((B1+O)/kl,(Y1+M)/kl);q0.z=Vl/kl,w1.push(q0);let Hl=new Q(Ul/f0,Q0/f0);Hl.z=Jl/f0,S1.push(Hl)}B.push(w1),H.push(S1)}return[B,H]}(d,S,C,y);return function(U,N,R){let P=1/0;ma(R,N)&&(P=Za(R,N[0]));for(let B=0;B<N.length;B++){let H=N[B],O=U[B];for(let M=0;M<H.length-1;M++){let Z=H[M],T=[Z,H[M+1],O[M+1],O[M],Z];da(R,T)&&(P=Math.min(P,Za(R,T)))}}return P!==1/0&&P}(s[0],s[1],L)}}function r8(l,c){return l.x*c.x+l.y*c.y}function Za(l,c){if(l.length===1){let p=0,d=c[p++],a;for(;!a||d.equals(a);)if(a=c[p++],!a)return 1/0;for(;p>4;if(d!==1)throw Error(`Got v${d} data when expected v1.`);let a=Da[15&p];if(!a)throw Error("Unrecognized array type.");let[h]=new Uint16Array(l,2,1),[y]=new Uint32Array(l,4,1);return new yp(y,h,a,l)}constructor(l,c=64,p=Float64Array,d){if(isNaN(l)||l<0)throw Error(`Unpexpected numItems value: ${l}.`);this.numItems=+l,this.nodeSize=Math.min(Math.max(+c,2),65535),this.ArrayType=p,this.IndexArrayType=l<65536?Uint16Array:Uint32Array;let a=Da.indexOf(this.ArrayType),h=2*l*this.ArrayType.BYTES_PER_ELEMENT,y=l*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-y%8)%8;if(a>1;return this.ids[p]=p,this.coords[this._pos++]=l,this.coords[this._pos++]=c,p}finish(){let l=this._pos>>1;if(l!==this.numItems)throw Error(`Added ${l} items when expected ${this.numItems}.`);return Id(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(l,c,p,d){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:a,coords:h,nodeSize:y}=this,w=[0,a.length-1,0],C=[];for(;w.length;){let S=w.pop()||0,L=w.pop()||0,s=w.pop()||0;if(L-s<=y){for(let P=s;P=l&&B=c&&H>1,N=h[2*U],R=h[2*U+1];N>=l&&N=c&&R<=d&&C.push(a[U]),(S===0?l<=N:c=N:d>=R)&&(w.push(U+1),w.push(L),w.push(1-S))}return C}within(l,c,p){if(!this._finished)throw Error("Data not yet indexed - call index.finish().");let{ids:d,coords:a,nodeSize:h}=this,y=[0,d.length-1,0],w=[],C=p*p;for(;y.length;){let S=y.pop()||0,L=y.pop()||0,s=y.pop()||0;if(L-s<=h){for(let P=s;P<=L;P++)Ga(a[2*P],a[2*P+1],l,c)>1,N=a[2*U],R=a[2*U+1];Ga(N,R,l,c)<=C&&w.push(d[U]),(S===0?l-p<=N:c-p=N:c+p>=R)&&(y.push(U+1),y.push(L),y.push(1-S))}return w}}function Id(l,c,p,d,a,h){if(a-d>1;Ta(l,c,y,d,a,h),Id(l,c,p,d,y-1,1-h),Id(l,c,p,y+1,a,1-h)}function Ta(l,c,p,d,a,h){for(;a>d;){if(a-d>600){let S=a-d+1,L=p-d+1,s=Math.log(S),U=0.5*Math.exp(2*s/3),N=0.5*Math.sqrt(s*U*(S-U)/S)*(L-S/2y&&p8(l,c,d,a);w<C;){for(p8(l,c,w,C),w++,C--;c[2*w+h]y;)C--}c[2*d+h]===y?p8(l,c,d,C):(C++,p8(l,c,C,a)),C<=p&&(d=C+1),p>1),y,w=p-c,C=l[c],S=l[c+1],L=l[p],s=l[p+1];for(let U=c+3;Ua)y=U,a=N;else if(N===a){let R=Math.abs(U-h);Rd&&(y-c>3&&Bd(l,c,y,d),l[y+2]=a,p-y>3&&Bd(l,y,p,d))}function fS(l,c,p,d,a,h){let y=a-p,w=h-d;if(y!==0||w!==0){let C=((l-p)*y+(c-d)*w)/(y*y+w*w);C>1?(p=a,d=h):C>0&&(p+=y*C,d+=w*C)}return y=l-p,w=c-d,y*y+w*w}function N0(l,c,p,d){let a={type:c,geom:p},h={id:l==null?null:l,type:a.type,geometry:a.geom,tags:d,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(a.type){case"Point":case"MultiPoint":f8(h,a.geom);break;case"LineString":f8(h,a.geom.points);break;case"Polygon":f8(h,a.geom[0].points);break;case"MultiLineString":for(let y of a.geom)f8(h,y.points);break;case"MultiPolygon":for(let y of a.geom)f8(h,y[0].points)}return h}function zd(l){l.points.length>64&&(l.points=new Float64Array(l.points))}function f8(l,c){for(let p=0;p<c.length;p+=3)l.minX=Math.min(l.minX,c[p]),l.minY=Math.min(l.minY,c[p+1]),l.maxX=Math.max(l.maxX,c[p]),l.maxY=Math.max(l.maxY,c[p+1])}function Qd(l,c){let p=[];switch(l.type){case"FeatureCollection":for(let d=0;d<l.features.length;d++)wp(p,l.features[d],c,d);break;case"Feature":wp(p,l,c);break;default:wp(p,{geometry:l,properties:void 0},c)}return p}function wp(l,c,p,d){if(!c.geometry)return;if(c.geometry.type==="GeometryCollection")return void function(w,C,S,L,s){for(let U of S.geometries)wp(w,{id:C.id,geometry:U,properties:C.properties},L,s)}(l,c,c.geometry,p,d);if(!c.geometry.coordinates?.length)return;let h=function(w,C,S){return C.promoteId?w.properties?.[C.promoteId]:C.generateId?S||0:w.id}(c,p,d),y=Math.pow(p.tolerance/((1<<p.maxZoom)*p.extent),2);switch(c.geometry.type){case"Point":return void function(w,C,S,L){let s=[];s.push(Tr(S.coordinates[0]),Gr(S.coordinates[1]),0),w.push(N0(C,"Point",s,L))}(l,h,c.geometry,c.properties);case"MultiPoint":return void function(w,C,S,L){let s=[];for(let U of S.coordinates)s.push(Tr(U[0]),Gr(U[1]),0);w.push(N0(C,"MultiPoint",s,L))}(l,h,c.geometry,c.properties);case"LineString":return void function(w,C,S,L,s){let U={points:[]};Hd(S.coordinates,U,L,!1),w.push(N0(C,"LineString",U,s))}(l,h,c.geometry,y,c.properties);case"MultiLineString":return void function(w,C,S,L,s,U){if(s.lineMetrics)for(let N of S.coordinates){let R={points:[]};Hd(N,R,L,!1),w.push(N0(C,"LineString",R,U))}else{let N=[];Md(S.coordinates,N,L,!1),w.push(N0(C,"MultiLineString",N,U))}}(l,h,c.geometry,y,p,c.properties);case"Polygon":return void function(w,C,S,L,s){let U=[];Md(S.coordinates,U,L,!0),w.push(N0(C,"Polygon",U,s))}(l,h,c.geometry,y,c.properties);case"MultiPolygon":return void function(w,C,S,L,s){let U=[];for(let N of S.coordinates){let R=[];Md(N,R,L,!0),U.push(R)}w.push(N0(C,"MultiPolygon",U,s))}(l,h,c.geometry,y,c.properties);default:throw Error("Input data is not a valid GeoJSON object.")}}function Hd(l,c,p,d){let a,h,y=0;for(let C=0;C0&&(y+=d?(a*L-S*h)/2:Math.sqrt(Math.pow(S-a,2)+Math.pow(L-h,2))),a=S,h=L}let w=c.points.length-3;c.points[2]=1,p>0&&Bd(c.points,0,w,p),c.points[w+2]=1,zd(c),c.size=Math.abs(y),c.start=0,c.end=c.size}function Md(l,c,p,d){for(let a=0;a<l.length;a++){let h={points:[]};Hd(l[a],h,p,d),c.push(h)}}function Tr(l){return l/360+0.5}function Gr(l){let c=Math.sin(l*Math.PI/180),p=0.5-0.25*Math.log((1+c)/(1-c))/Math.PI;return p1?1:p}function np(l){let c={type:"Feature",geometry:dS(l),properties:l.tags};return l.id!=null&&(c.id=l.id),c}function dS(l){let{type:c,geometry:p}=l;switch(c){case"Point":return{type:c,coordinates:Xa(p[0],p[1])};case"MultiPoint":return{type:c,coordinates:kp(p)};case"LineString":return{type:c,coordinates:kp(p.points)};case"MultiLineString":case"Polygon":return{type:c,coordinates:p.map((d)=>kp(d.points))};case"MultiPolygon":return{type:c,coordinates:p.map((d)=>d.map((a)=>kp(a.points)))}}}function kp(l){let c=[];for(let p=0;p=(p/=c)&&y<d)return l;if(y
=d)return null;let C=[];for(let S of l){let L=a===X0.X?S.minX:S.minY,s=a===X0.X?S.maxX:S.maxY;if(L>=p&&s<d)C.push(S);else if(!(s
=d))switch(S.type){case"Point":case"MultiPoint":mS(S,C,p,d,a);continue;case"LineString":gS(S,C,p,d,a,w);continue;case"MultiLineString":vS(S,C,p,d,a);continue;case"Polygon":aS(S,C,p,d,a);continue;case"MultiPolygon":oS(S,C,p,d,a);continue}}return C.length?C:null}function mS(l,c,p,d,a){let h=[];(function(y,w,C,S,L){for(let s=0;s=C&&U1?N0(l.id,"MultiLineString",y,l.tags):N0(l.id,"LineString",y[0],l.tags))}function vS(l,c,p,d,a){let h=[];Kd(l.geometry,h,p,d,a,!1),h.length&&c.push(h.length!==1?N0(l.id,"MultiLineString",h,l.tags):N0(l.id,"LineString",h[0],l.tags))}function aS(l,c,p,d,a){let h=[];Kd(l.geometry,h,p,d,a,!0),h.length&&c.push(N0(l.id,"Polygon",h,l.tags))}function oS(l,c,p,d,a){let h=[];for(let y of l.geometry){let w=[];Kd(y,w,p,d,a,!0),w.length&&h.push(w)}h.length&&c.push(N0(l.id,"MultiPolygon",h,l.tags))}function ba(l,c,p,d,a,h,y){let w=$a(l),C=a===X0.X?hS:yS,S,L,s=l.start;for(let B=0;B<l.points.length-3;B+=3){let H=l.points[B],O=l.points[B+1],M=l.points[B+2],Z=l.points[B+3],T=l.points[B+4],j=a===X0.X?H:O,d1=a===X0.X?Z:T,m1=!1;y&&(S=Math.sqrt(Math.pow(H-Z,2)+Math.pow(O-T,2))),j
p&&(L=C(w,H,O,Z,T,p),y&&(w.start=s+S*L)):j>d?d1<d&&(L=C(w,H,O,Z,T,d),y&&(w.start=s+S*L)):Xr(w.points,H,O,M),d1
=p&&(L=C(w,H,O,Z,T,p),m1=!0),d1>d&&j=p&&P=3&&(w.points[U]!==w.points[0]||w.points[U+1]!==w.points[1])&&Xr(w.points,w.points[0],w.points[1],w.points[2]),w.points.length&&(zd(w),c.push(w))}function $a(l){return{points:[],size:l.size,start:l.start,end:l.end}}function Kd(l,c,p,d,a,h){for(let y of l)ba(y,c,p,d,a,h,!1)}function Xr(l,c,p,d){l.push(c,p,d)}function hS(l,c,p,d,a,h){let y=(h-c)/(d-c);return Xr(l.points,h,p+(a-p)*y,1),y}function yS(l,c,p,d,a,h){let y=(h-p)/(a-p);return Xr(l.points,c+(d-c)*y,h,1),y}function Od(l,c){let p=c.buffer/c.extent,d=l,a=i5(l,1,-1-p,p,X0.X,-1,2,c),h=i5(l,1,1-p,2+p,X0.X,-1,2,c);return a||h?(d=i5(l,1,-p,1+p,X0.X,-1,2,c)||[],a&&(d=_a(a,1).concat(d)),h&&(d=d.concat(_a(h,-1))),d):d}function _a(l,c){let p=[];for(let d of l)switch(d.type){case"Point":case"MultiPoint":{let a=wS(d.geometry,c);p.push(N0(d.id,d.type,a,d.tags));continue}case"LineString":{let a=Zd(d.geometry,c);p.push(N0(d.id,d.type,a,d.tags));continue}case"MultiLineString":case"Polygon":{let a=[];for(let h of d.geometry)a.push(Zd(h,c));p.push(N0(d.id,d.type,a,d.tags));continue}case"MultiPolygon":{let a=[];for(let h of d.geometry){let y=[];for(let w of h)y.push(Zd(w,c));a.push(y)}p.push(N0(d.id,d.type,a,d.tags));continue}}return p}function wS(l,c){let p=[];for(let d=0;d<l.length;d+=3)p.push(l[d]+c,l[d+1],l[d+2]);return p}function Zd(l,c){let p={points:[],size:l.size};l.start!==void 0&&(p.start=l.start,p.end=l.end);for(let d=0;d0||c.addOrUpdateProperties?.length>0;if(d){let h=l[0],y=Qd({type:"FeatureCollection",features:[{type:"Feature",id:h.id,geometry:c.newGeometry,properties:a?ia(h.tags,c):h.tags}]},p);return y=Od(y,p),y}if(a){let h=[];for(let y of l){let w={...y};w.tags=ia(w.tags,c),h.push(w)}return h}return l}function ia(l,c){if(c.removeAllProperties)return{};let p={...l||{}};if(c.removeProperties)for(let d of c.removeProperties)delete p[d];if(c.addOrUpdateProperties)for(let{key:d,value:a}of c.addOrUpdateProperties)p[d]=a;return p}(function(l){l[l.X=0]="X",l[l.Y=1]="Y"})(X0||(X0={}));let Dd={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:(l)=>l};class ea{constructor(l){this.options=Object.assign(Object.create(Dd),l),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(l){let c=[];for(let p of l){if(!p.geometry)continue;let[d,a]=p.geometry.coordinates,[h,y]=[Tr(d),Gr(a)];c.push({id:p.id,type:"Point",geometry:[h,y],tags:p.properties})}this.createIndex(c)}initialize(l){let c=[];for(let p of l)p.type==="Point"&&c.push(p);this.createIndex(c)}updateIndex(l,c,p){this.options=Object.assign(Object.create(Dd),p.clusterOptions),this.initialize(l)}createIndex(l){let{log:c,minZoom:p,maxZoom:d}=this.options;c&&console.time("total time");let a=`prepare ${l.length} points`;c&&console.time(a),this.points=l;let h=[];for(let w=0;w=p;w--){let C=Date.now();y=this.trees[w]=this.createTree(this.cluster(y,w)),c&&console.log("z%d: %d clusters in %dms",w,y.numItems,Date.now()-C)}c&&console.timeEnd("total time")}getClusters(l,c){return this.getClustersInternal(l,c).map((p)=>np(p))}getClustersInternal(l,c){let p=((l[0]+180)%360+360)%360-180,d=Math.max(-90,Math.min(90,l[1])),a=l[2]===180?180:((l[2]+180)%360+360)%360-180,h=Math.max(-90,Math.min(90,l[3]));if(l[2]-l[0]>=360)p=-180,a=180;else if(p>a){let L=this.getClustersInternal([p,d,180,h],c),s=this.getClustersInternal([-180,d,a,h],c);return L.concat(s)}let y=this.trees[this.limitZoom(c)],w=y.range(Tr(p),Gr(h),Tr(a),Gr(d)),C=y.flatData,S=[];for(let L of w){let s=this.stride*L;S.push(C[s+5]>1?kS(C,s,this.clusterProps):this.points[C[s+3]])}return S}getChildren(l){let c=this.getOriginId(l),p=this.getOriginZoom(l),d=Error("No cluster with the specified id: "+l),a=this.trees[p];if(!a)throw d;let h=a.flatData;if(c*this.stride>=h.length)throw d;let y=this.options.radius/(this.options.extent*Math.pow(2,p-1)),w=a.within(h[c*this.stride],h[c*this.stride+1],y),C=[];for(let S of w){let L=S*this.stride;h[L+4]===l&&C.push(h[L+5]>1?SS(h,L,this.clusterProps):np(this.points[h[L+3]]))}if(C.length===0)throw d;return C}getLeaves(l,c,p){let d=[];return this.appendLeaves(d,l,c=c||10,p=p||0,0),d}getTile(l,c,p){let d=this.trees[this.limitZoom(l)];if(!d)return null;let a=Math.pow(2,l),{extent:h,radius:y}=this.options,w=y/h,C=(p-w)/a,S=(p+1+w)/a,L={transformed:!0,features:[],source:null,x:c,y:p,z:l};return this.addTileFeatures(d.range((c-w)/a,C,(c+1+w)/a,S),d.flatData,c,p,a,L),c===0&&this.addTileFeatures(d.range(1-w/a,C,1,S),d.flatData,a,p,a,L),c===a-1&&this.addTileFeatures(d.range(0,C,w/a,S),d.flatData,-1,p,a,L),L}getClusterExpansionZoom(l){return this.getOriginZoom(l)}appendLeaves(l,c,p,d,a){let h=this.getChildren(c);for(let y of h){let w=y.properties;if(w?.cluster?a+w.point_count<=d?a+=w.point_count:a=this.appendLeaves(l,w.cluster_id,p,d,a):a<d?a++:l.push(y),l.length===p)break}return a}createTree(l){let c=new yp(l.length/this.stride|0,this.options.nodeSize,Float32Array);for(let p=0;p1,S,L,s;if(C)S=Td(c,w,this.clusterProps),L=c[w],s=c[w+1];else{let R=this.points[c[w+3]];S=R.tags,[L,s]=R.geometry}let U={type:1,geometry:[[Math.round(this.options.extent*(L*a-p)),Math.round(this.options.extent*(s*a-d))]],tags:S},N;N=C||this.options.generateId?c[w+3]:this.points[c[w+3]].id,N!==void 0&&(U.id=N),h.features.push(U)}}limitZoom(l){return Math.max(this.options.minZoom,Math.min(Math.floor(+l),this.options.maxZoom+1))}cluster(l,c){let{radius:p,extent:d,reduce:a,minPoints:h}=this.options,y=p/(d*Math.pow(2,c)),w=l.flatData,C=[],S=this.stride;for(let L=0;L<w.length;L+=S){if(w[L+2]c&&(P+=w[H+5])}if(P>R&&P>=h){let B,H=s*R,O=U*R,M=-1,Z=(L/S<<5)+(c+1)+this.points.length;for(let T of N){let j=T*S;if(w[j+2]<=c)continue;w[j+2]=c;let d1=w[j+5];H+=w[j]*d1,O+=w[j+1]*d1,w[j+4]=Z,a&&(B||(B=this.map(w,L,!0),M=this.clusterProps.length,this.clusterProps.push(B)),a(B,this.map(w,j)))}w[L+4]=Z,C.push(H/P,O/P,1/0,Z,-1,P),a&&C.push(M)}else{for(let B=0;B
1)for(let B of N){let H=B*S;if(!(w[H+2]<=c)){w[H+2]=c;for(let O=0;O>5}getOriginZoom(l){return(l-this.points.length)%32}map(l,c,p){if(l[c+5]>1){let h=this.clusterProps[l[c+6]];return p?Object.assign({},h):h}let d=this.points[l[c+3]].tags,a=this.options.map(d);return p&&a===d?Object.assign({},a):a}}function kS(l,c,p){return{id:l[c+3],type:"Point",tags:Td(l,c,p),geometry:[l[c],l[c+1]]}}function SS(l,c,p){return{type:"Feature",id:l[c+3],properties:Td(l,c,p),geometry:{type:"Point",coordinates:[Ja(l[c]),ja(l[c+1])]}}}function Td(l,c,p){let d=l[c+5],a=d>=1e4?`${Math.round(d/1000)}k`:d>=1000?Math.round(d/100)/10+"k":d,h=l[c+6],y=h===-1?{}:Object.assign({},p[h]);return Object.assign(y,{cluster:!0,cluster_id:l[c+3],point_count:d,point_count_abbreviated:a})}let Gd="geojsonvt_clip_start",Xd="geojsonvt_clip_end";function ta(l,c,p,d,a){let h=c===a.maxZoom?0:a.tolerance/((1<<c)*a.extent),y={transformed:!1,features:[],source:null,x:p,y:d,z:c,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:l.length};for(let w of l)ES(y,w,h,a);return y}function ES(l,c,p,d){switch(l.minX=Math.min(l.minX,c.minX),l.minY=Math.min(l.minY,c.minY),l.maxX=Math.max(l.maxX,c.maxX),l.maxY=Math.max(l.maxY,c.maxY),c.type){case"Point":case"MultiPoint":return void function(a,h){let y=[];for(let C=0;C<h.geometry.length;C+=3)y.push(h.geometry[C],h.geometry[C+1]),a.numPoints++,a.numSimplified++;if(!y.length)return;let w={type:1,tags:h.tags||null,geometry:y};h.id!==null&&(w.id=h.id),a.features.push(w)}(l,c);case"LineString":return void function(a,h,y,w){let C=[];if(Jd(C,h.geometry,a,y,!1,!1),!C.length)return;let S=h.tags||null;if(w.lineMetrics){S={};for(let s in h.tags)S[s]=h.tags[s];S[Gd]=h.geometry.start/h.geometry.size,S[Xd]=h.geometry.end/h.geometry.size}let L={type:2,tags:S,geometry:C};h.id!==null&&(L.id=h.id),a.features.push(L)}(l,c,p,d);case"MultiLineString":case"Polygon":return void function(a,h,y){let w=[];for(let S=0;S<h.geometry.length;S++)Jd(w,h.geometry[S],a,y,h.type==="Polygon",S===0);if(!w.length)return;let C={type:h.type==="Polygon"?3:2,tags:h.tags||null,geometry:w};h.id!==null&&(C.id=h.id),a.features.push(C)}(l,c,p);case"MultiPolygon":return void function(a,h,y){let w=[];for(let S=0;S<h.geometry.length;S++){let L=h.geometry[S];for(let s=0;s0&&c.size<(a?y:d))return void(p.numPoints+=c.points.length/3);let w=[];for(let C=0;Cy)&&(p.numSimplified++,w.push(c.points[C],c.points[C+1])),p.numPoints++;a&&function(C,S){let L=0;for(let s=0,U=C.length,N=U-2;s0===S)for(let s=0,U=C.length;s<U/2;s+=2){let N=C[s],R=C[s+1];C[s]=C[U-2-s],C[s+1]=C[U-1-s],C[U-2-s]=N,C[U-1-s]=R}}(w,h),l.push(w)}function lo(l,c){if(l.transformed)return l;let p=1<<l.z,d=l.x,a=l.y;for(let h of l.features)h.type===1?sS(h,c,p,d,a):CS(h,c,p,d,a);return l.transformed=!0,l}function sS(l,c,p,d,a){let h=l,y=l.geometry,w=[];for(let C=0;C<y.length;C+=2)w.push(uo(y[C],y[C+1],c,p,d,a));return h.geometry=w,h}function CS(l,c,p,d,a){let h=l,y=l.geometry,w=[];for(let C of y){let S=[];for(let L=0;L1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(c),p.debug>1&&console.timeEnd("invalidating");let[d,a,h]=[0,0,0],y=ta(l,d,a,h,p);y.source=l;let w=Sp(d,a,h);if(this.tiles[w]=y,this.tileCoords.push({z:d,x:a,y:h,id:w}),p.debug){let C=`z${d}`;this.stats[C]=(this.stats[C]||0)+1,this.total++}}getClusterExpansionZoom(l){return null}getChildren(l){return null}getLeaves(l,c,p){return null}getTile(l,c,p){let{extent:d,debug:a}=this.options,h=1<1&&console.log("drilling down to z%d-%d-%d",l,c,p);let w,C=l,S=c,L=p;for(;!w&&C>0;)C--,S>>=1,L>>=1,w=this.tiles[Sp(C,S,L)];return w?.source?(a>1&&(console.log("found parent tile z%d-%d-%d",C,S,L),console.time("drilling down")),this.splitTile(w.source,C,S,L,l,c,p),a>1&&console.timeEnd("drilling down"),this.tiles[y]?lo(this.tiles[y],d):null):null}splitTile(l,c,p,d,a,h,y){let w=[l,c,p,d],C=this.options,S=C.debug;for(;w.length;){d=w.pop(),p=w.pop(),c=w.pop(),l=w.pop();let L=1<1&&console.time("creation"),U=this.tiles[s]=ta(l,c,p,d,C),this.tileCoords.push({z:c,x:p,y:d,id:s}),S)){S>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",c,p,d,U.numFeatures,U.numPoints,U.numSimplified),console.timeEnd("creation"));let d1=`z${c}`;this.stats[d1]=(this.stats[d1]||0)+1,this.total++}if(U.source=l,a==null){if(c===C.indexMaxZoom||U.numPoints>d1||d!==y>>d1)continue}}if(U.source=null,!l.length)continue;S>1&&console.time("clipping");let N=0.5*C.buffer/C.extent,R=0.5-N,P=0.5+N,B=1+N,H=null,O=null,M=null,Z=null,T=i5(l,L,p-N,p+P,X0.X,U.minX,U.maxX,C),j=i5(l,L,p+R,p+B,X0.X,U.minX,U.maxX,C);T&&(H=i5(T,L,d-N,d+P,X0.Y,U.minY,U.maxY,C),O=i5(T,L,d+R,d+B,X0.Y,U.minY,U.maxY,C)),j&&(M=i5(j,L,d-N,d+P,X0.Y,U.minY,U.maxY,C),Z=i5(j,L,d+R,d+B,X0.Y,U.minY,U.maxY,C)),S>1&&console.timeEnd("clipping"),w.push(H||[],c+1,2*p,2*d),w.push(O||[],c+1,2*p,2*d+1),w.push(M||[],c+1,2*p+1,2*d),w.push(Z||[],c+1,2*p+1,2*d+1)}}invalidateTiles(l){if(!l.length)return;let c=this.options,{debug:p}=c,d=1/0,a=-1/0,h=1/0,y=-1/0;for(let S of l)d=Math.min(d,S.minX),a=Math.max(a,S.maxX),h=Math.min(h,S.minY),y=Math.max(y,S.maxY);let w=c.buffer/c.extent,C=new Set;for(let S in this.tiles){let L=this.tiles[S],s=1<<L.z,U=(L.x-w)/s,N=(L.x+1+w)/s,R=(L.y-w)/s,P=(L.y+1+w)/s;if(a=N||y=P)continue;let B=!1;for(let H of l)if(H.maxX>=U&&H.minX=R&&H.minY1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",L.z,L.x,L.y,L.numFeatures,L.numPoints,L.numSimplified);let H=`z${L.z}`;this.stats[H]=(this.stats[H]||0)-1,this.total--}delete this.tiles[S],C.add(S)}}C.size&&(this.tileCoords=this.tileCoords.filter((S)=>!C.has(S.id)))}}function Sp(l,c,p){return 32*((1<c.id),this.index=l.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let c of this.layers)this.gradients[c.id]={};this.layoutVertexArray=new $,this.layoutVertexArray2=new i,this.indexArray=new D1,this.programConfigurations=new vu(l.layers,l.zoom),this.segments=new M1,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((c)=>c.isStateDependent()).map((c)=>c.id)}populate(l,c,p){this.hasDependencies=gp("line",this.layers,c)||this.hasLineDasharray(this.layers);let d=this.layers[0].layout.get("line-sort-key"),a=!d.isConstant(),h=[];for(let{feature:y,id:w,index:C,sourceLayerIndex:S}of l){let L=this.layers[0]._featureFilter.needGeometry,s=h5(y,L);if(!this.layers[0]._featureFilter.filter(new ql(this.zoom),s,p))continue;let U=a?d.evaluate(s,{},p):void 0,N={id:w,properties:y.properties,type:y.type,sourceLayerIndex:S,index:C,geometry:L?s.geometry:o5(y),patterns:{},dashes:{},sortKey:U};h.push(N)}a&&h.sort((y,w)=>y.sortKey-w.sortKey);for(let y of h){let{geometry:w,index:C,sourceLayerIndex:S}=y;this.hasDependencies?(gp("line",this.layers,c)?Fd("line",this.layers,y,{zoom:this.zoom},c):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,y,this.zoom,c),this.patternFeatures.push(y)):this.addFeature(y,w,C,p,{},{},c.subdivisionGranularity),c.featureIndex.insert(l[C].feature,w,C,S,this.index)}}update(l,c,p,d){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,c,this.stateDependentLayers,{imagePositions:p,dashPositions:d})}addFeatures(l,c,p,d){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,c,p,d,l.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=l.createVertexBuffer(this.layoutVertexArray2,NS)),this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,AS),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(l){if(l.properties&&Object.hasOwn(l.properties,Gd)&&Object.hasOwn(l.properties,Xd))return{start:+l.properties[Gd],end:+l.properties[Xd]}}addFeature(l,c,p,d,a,h,y){let w=this.layers[0].layout,C=w.get("line-join").evaluate(l,{}),S=w.get("line-cap").evaluate(l,{}),L=w.get("line-miter-limit").evaluate(l,{}),s=w.get("line-round-limit").evaluate(l,{});this.lineClips=this.lineFeatureClips(l);for(let U of c)this.addLine(U,l,C,S,L,s,d,y);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,p,{imagePositions:a,dashPositions:h,canonical:d})}addLine(l,c,p,d,a,h,y,w){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,l=sc(l,y?w.line.getGranularityForZoomLevel(y.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let O=0;O=2&&l[S-1].equals(l[S-2]);)S--;let L=0;for(;L<S-1&&l[L].equals(l[L+1]);)L++;if(S<(C?3:2))return;p==="bevel"&&(a=1.05);let s=this.overscaling<=16?122880/(512*this.overscaling):0,U=this.segments.prepareSegment(10*S,this.layoutVertexArray,this.indexArray),N,R,P,B,H;this.e1=this.e2=-1,C&&(N=l[S-2],H=l[L].sub(N)._unit()._perp());for(let O=L;O<S;O++){if(P=O===S-1?C?l[L+1]:void 0:l[O+1],P&&l[O].equals(P))continue;H&&(B=H),N&&(R=N),N=l[O],H=P?P.sub(N)._unit()._perp():B,B||(B=H);let M=B.add(H);M.x===0&&M.y===0||M._unit();let Z=B.x*H.x+B.y*H.y,T=M.x*H.x+M.y*H.y,j=T!==0?1/T:1/0,d1=2*Math.sqrt(2-2*T),m1=T0;if(m1&&O>L){let S1=N.dist(R);if(S1>2*s){let y1=N.sub(N.sub(R)._mult(s/S1)._round());this.updateDistance(R,y1),this.addCurrentVertex(y1,B,0,0,U),R=y1}}let n1=R&&P,w1=n1?p:C?"butt":d;if(n1&&w1==="round"&&(j<h?w1="miter":ja&&(w1="bevel"),w1==="bevel"&&(j>2&&(w1="flipbevel"),j100)M=H.mult(-1);else{let S1=j*B.add(H).mag()/B.sub(H).mag();M._perp()._mult(S1*(v1?-1:1))}this.addCurrentVertex(N,M,0,0,U),this.addCurrentVertex(N,M.mult(-1),0,0,U)}else if(w1==="bevel"||w1==="fakeround"){let S1=-Math.sqrt(j*j-1),y1=v1?S1:0,s1=v1?0:S1;if(R&&this.addCurrentVertex(N,B,y1,s1,U),w1==="fakeround"){let K1=Math.round(180*d1/Math.PI/20);for(let B1=1;B1<K1;B1++){let Y1=B1/K1;if(Y1!==0.5){let i1=Y1-0.5;Y1+=Y1*i1*(Y1-1)*((1.0904+Z*(Z*(3.55645-1.43519*Z)-3.2452))*i1*i1+(0.848013+Z*(0.215638*Z-1.06021)))}let Q1=H.sub(B)._mult(Y1)._add(B)._unit()._mult(v1?-1:1);this.addHalfVertex(N,Q1.x,Q1.y,!1,v1,0,U)}}P&&this.addCurrentVertex(N,H,-y1,-s1,U)}else if(w1==="butt")this.addCurrentVertex(N,M,0,0,U);else if(w1==="square"){let S1=R?1:-1;this.addCurrentVertex(N,M,S1,S1,U)}else w1==="round"&&(R&&(this.addCurrentVertex(N,B,0,0,U),this.addCurrentVertex(N,B,1,1,U,!0)),P&&(this.addCurrentVertex(N,H,-1,-1,U,!0),this.addCurrentVertex(N,H,0,0,U)));if(m1&&O2*s){let y1=N.add(P.sub(N)._mult(s/S1)._round());this.updateDistance(N,y1),this.addCurrentVertex(y1,H,0,0,U),N=y1}}}}addCurrentVertex(l,c,p,d,a,h=!1){let y=c.y*d-c.x,w=-c.y-c.x*d;this.addHalfVertex(l,c.x+c.y*p,c.y-c.x*p,h,!1,p,a),this.addHalfVertex(l,y,w,h,!0,-d,a),this.distance>ro/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(l,c,p,d,a,h))}addHalfVertex({x:l,y:c},p,d,a,h,y,w){let C=0.5*(this.lineClips?this.scaledDistance*(ro-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((l<<1)+(a?1:0),(c<<1)+(h?1:0),Math.round(63*p)+128,Math.round(63*d)+128,1+(y===0?0:y<0?-1:1)|(63&C)<>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let S=w.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,S,this.e2),w.primitiveLength++),h?this.e2=S:this.e1=S}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(l,c){this.distance+=l.dist(c),this.updateScaledDistance()}hasLineDasharray(l){for(let c of l){let p=c.paint.get("line-dasharray");if(p&&!p.isConstant())return!0}return!1}addLineDashDependencies(l,c,p,d){for(let a of l){let h=a.paint.get("line-dasharray");if(!h||h.value.kind==="constant")continue;let y=a.layout.get("line-cap").evaluate(c,{})==="round",w={dasharray:h.value.evaluate({zoom:p-1},c,{}),round:y},C={dasharray:h.value.evaluate({zoom:p},c,{}),round:y},S={dasharray:h.value.evaluate({zoom:p+1},c,{}),round:y},L=`${w.dasharray.join(",")},${w.round}`,s=`${C.dasharray.join(",")},${C.round}`,U=`${S.dasharray.join(",")},${S.round}`;d.dashDependencies[L]=w,d.dashDependencies[s]=C,d.dashDependencies[U]=S,c.dashes[a.id]={min:L,mid:s,max:U}}}}let po,fo;O1("LineBucket",Ep,{omit:["layers","patternFeatures"]});var mo={get paint(){return fo=fo||new V0({"line-opacity":new _1(E1.paint_line["line-opacity"]),"line-color":new _1(E1.paint_line["line-color"]),"line-translate":new j1(E1.paint_line["line-translate"]),"line-translate-anchor":new j1(E1.paint_line["line-translate-anchor"]),"line-width":new _1(E1.paint_line["line-width"]),"line-gap-width":new _1(E1.paint_line["line-gap-width"]),"line-offset":new _1(E1.paint_line["line-offset"]),"line-blur":new _1(E1.paint_line["line-blur"]),"line-dasharray":new Fu(E1.paint_line["line-dasharray"]),"line-pattern":new Fu(E1.paint_line["line-pattern"]),"line-gradient":new G5(E1.paint_line["line-gradient"])})},get layout(){return po=po||new V0({"line-cap":new _1(E1.layout_line["line-cap"]),"line-join":new _1(E1.layout_line["line-join"]),"line-miter-limit":new _1(E1.layout_line["line-miter-limit"]),"line-round-limit":new _1(E1.layout_line["line-round-limit"]),"line-sort-key":new _1(E1.layout_line["line-sort-key"])})}};class go extends _1{possiblyEvaluate(l,c){return c=new ql(Math.floor(c.zoom),{now:c.now,fadeDuration:c.fadeDuration,zoomHistory:c.zoomHistory,transition:c.transition}),super.possiblyEvaluate(l,c)}evaluate(l,c,p,d){return c=h2({},c,{zoom:Math.floor(c.zoom)}),super.evaluate(l,c,p,d)}}let sp;class vo extends r2{constructor(l,c){super(l,mo,c),this.gradientVersion=0,sp||(sp=new go(mo.paint.properties["line-width"].specification),sp.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(l){if(l==="line-gradient"){let c=this.gradientExpression();this.stepInterpolant=!!function(p){return p._styleExpression!==void 0}(c)&&c._styleExpression.expression instanceof q3,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(l,c){super.recalculate(l,c),this.paint._values["line-floorwidth"]=sp.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,l)}createBucket(l){return new Ep(l)}queryRadius(l){let c=l,p=ao(Kr("line-width",this,c),Kr("line-gap-width",this,c)),d=Kr("line-offset",this,c);return p/2+Math.abs(d)+fp(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:l,feature:c,featureState:p,geometry:d,transform:a,pixelsToTileUnits:h}){let y=dp(l,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,h),w=h/2*ao(this.paint.get("line-width").evaluate(c,p),this.paint.get("line-gap-width").evaluate(c,p)),C=this.paint.get("line-offset").evaluate(c,p);return C&&(d=function(S,L){let s=[];for(let U of S){let N=Fk(U),R=[];for(let P=0;P=3){for(let N of U)if(Mr(S,N))return!0}if(Vk(S,U,s))return!0}return!1}(y,d,w)}isTileClipped(){return!0}}function ao(l,c){return c>0?c+2*l:l}let FS=xl([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),US=xl([{name:"a_projected_pos",components:3,type:"Float32"}],4);xl([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let xS=xl([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);xl([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let oo=xl([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),PS=xl([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function RS(l,c,p){let d=c.layout.get("text-transform").evaluate(p,{});return d==="uppercase"?l=l.toLocaleUpperCase():d==="lowercase"&&(l=l.toLocaleLowerCase()),ru.applyArabicShaping&&(l=ru.applyArabicShaping(l)),l}function IS(l,c,p){for(let d of l.sections)d.text=RS(d.text,c,p);return l}xl([{name:"triangle",components:3,type:"Uint16"}]),xl([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),xl([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),xl([{type:"Float32",name:"offsetX"}]),xl([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),xl([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var S0=24;let d8={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},YS={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},BS={40:!0};function ho(l,c,p,d,a,h){if("fontStack"in c){let y=p[c.fontStack],w=y==null?void 0:y[l];return w?w.metrics.advance*c.scale+a:0}{let y=d[c.imageName];return y?y.displaySize[0]*c.scale*S0/h+a:0}}function yo(l,c,p,d){let a=Math.pow(l-c,2);return d?l<c?a/2:2*a:a+Math.abs(p)*p}function zS(l,c,p){let d=0;return l===10&&(d-=1e4),p&&(d+=150),l!==40&&l!==65288||(d+=50),c!==41&&c!==65289||(d+=50),d}function wo(l,c,p,d,a,h){let y=null,w=yo(c,p,a,h);for(let C of d){let S=yo(c-C.x,p,a,h)+C.badness;SMath.max(l,this.sections[c].scale),0)}getMaxImageSize(l){let c=0,p=0;for(let d=0;dp))}addImageSection(l){let c=l.image?l.image.name:"";if(c.length===0)return void w0("Can't add FormattedSection with an empty image.");let p=this.getNextImageSectionCharCode();p?(this.text+=String.fromCharCode(p),this.sections.push({scale:1,verticalAlign:l.verticalAlign||"bottom",imageName:c}),this.sectionIndex.push(this.sections.length-1)):w0("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(l,c,p,d,a){let h=[],y=this.determineAverageLineWidth(l,c,p,d,a),w=this.hasZeroWidthSpaces(),C=0,S=0,L=this.text[Symbol.iterator](),s=L.next(),U=this.text[Symbol.iterator]();U.next();let N=U.next(),R=this.text[Symbol.iterator]();R.next(),R.next();let P=R.next();for(;!s.done;){let B=this.getSection(S),H=s.value.codePointAt(0);if(z7(H)||(C+=ho(H,B,p,d,l,a)),!N.done){let O=Ed(H),M=N.value.codePointAt(0);(YS[H]||O||("imageName"in B)||!P.done&&BS[M])&&h.push(wo(S+1,C,y,h,zS(H,M,O&&w),!1))}S++,s=L.next(),N=U.next(),P=R.next()}return no(wo(this.length(),C,y,h,0,!0))}determineAverageLineWidth(l,c,p,d,a){let h=0,y=0;for(let w of this.text){let C=this.getSection(y);h+=ho(w.codePointAt(0),C,p,d,l,a),y++}return h/Math.max(1,Math.ceil(h/c))}}let jd=4294967296,ko=1/jd,So=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class m8{constructor(l=new Uint8Array(16)){this.buf=ArrayBuffer.isView(l)?l:new Uint8Array(l),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(l,c,p=this.length){for(;this.pos
>3,h=this.pos;this.type=7&d,l(a,c,this),this.pos===h&&this.skip(d)}return c}readMessage(l,c){return this.readFields(l,c,this.readVarint()+this.pos)}readFixed32(){let l=this.dataView.getUint32(this.pos,!0);return this.pos+=4,l}readSFixed32(){let l=this.dataView.getInt32(this.pos,!0);return this.pos+=4,l}readFixed64(){let l=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*jd;return this.pos+=8,l}readSFixed64(){let l=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*jd;return this.pos+=8,l}readFloat(){let l=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,l}readDouble(){let l=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,l}readVarint(l){let c=this.buf,p,d;return d=c[this.pos++],p=127&d,d<128?p:(d=c[this.pos++],p|=(127&d)<<7,d<128?p:(d=c[this.pos++],p|=(127&d)<<14,d<128?p:(d=c[this.pos++],p|=(127&d)<<21,d<128?p:(d=c[this.pos],p|=(15&d)<>4,S<128)return jr(a,C,h);if(S=w[y.pos++],C|=(127&S)<<3,S<128)return jr(a,C,h);if(S=w[y.pos++],C|=(127&S)<<10,S<128)return jr(a,C,h);if(S=w[y.pos++],C|=(127&S)<<17,S<128)return jr(a,C,h);if(S=w[y.pos++],C|=(127&S)<<24,S<128)return jr(a,C,h);if(S=w[y.pos++],C|=(1&S)<<31,S=12&&So?So.decode(this.buf.subarray(c,l)):function(p,d,a){let h="",y=d;for(;y239?4:w>223?3:w>191?2:1;if(y+U>a)break;U===1?w<128&&(s=w):U===2?(C=p[y+1],(192&C)==128&&(s=(31&w)<<6|63&C,s<=127&&(s=null))):U===3?(C=p[y+1],S=p[y+2],(192&C)==128&&(192&S)==128&&(s=(15&w)<<12|(63&C)<<6|63&S,(s=55296&&s<=57343)&&(s=null))):U===4&&(C=p[y+1],S=p[y+2],L=p[y+3],(192&C)==128&&(192&S)==128&&(192&L)==128&&(s=(15&w)<<18|(63&C)<<12|(63&S)<<6|63&L,(s=1114112)&&(s=null))),s===null?(s=65533,U=1):s>65535&&(s-=65536,h+=String.fromCharCode(s>>>10&1023|55296),s=56320|1023&s),h+=String.fromCharCode(s),y+=U}return h}(this.buf,c,l)}readBytes(){let l=this.readVarint()+this.pos,c=this.buf.subarray(this.pos,l);return this.pos=l,c}readPackedVarint(l=[],c){let p=this.readPackedEnd();for(;this.pos<p;)l.push(this.readVarint(c));return l}readPackedSVarint(l=[]){let c=this.readPackedEnd();for(;this.pos<c;)l.push(this.readSVarint());return l}readPackedBoolean(l=[]){let c=this.readPackedEnd();for(;this.pos<c;)l.push(this.readBoolean());return l}readPackedFloat(l=[]){let c=this.readPackedEnd();for(;this.pos<c;)l.push(this.readFloat());return l}readPackedDouble(l=[]){let c=this.readPackedEnd();for(;this.pos<c;)l.push(this.readDouble());return l}readPackedFixed32(l=[]){let c=this.readPackedEnd();for(;this.pos<c;)l.push(this.readFixed32());return l}readPackedSFixed32(l=[]){let c=this.readPackedEnd();for(;this.pos<c;)l.push(this.readSFixed32());return l}readPackedFixed64(l=[]){let c=this.readPackedEnd();for(;this.pos<c;)l.push(this.readFixed64());return l}readPackedSFixed64(l=[]){let c=this.readPackedEnd();for(;this.pos127;);else if(c===2)this.pos=this.readVarint()+this.pos;else if(c===5)this.pos+=4;else{if(c!==1)throw Error(`Unimplemented type: ${c}`);this.pos+=8}}writeTag(l,c){this.writeVarint(l<<3|c)}realloc(l){let c=this.length||16;for(;c268435455||l=0?(d=c%4294967296|0,a=c/4294967296|0):(d=~(-c%4294967296),a=~(-c/4294967296),4294967295^d?d=d+1|0:(d=0,a=a+1|0)),c>=18446744073709552000||c>>=7,w.buf[w.pos++]=127&h|128,h>>>=7,w.buf[w.pos++]=127&h|128,h>>>=7,w.buf[w.pos++]=127&h|128,w.buf[w.pos]=127&(h>>>=7)}(d,0,p),function(h,y){let w=(7&h)<>>=3)?128:0),h&&(y.buf[y.pos++]=127&h|((h>>>=7)?128:0),h&&(y.buf[y.pos++]=127&h|((h>>>=7)?128:0),h&&(y.buf[y.pos++]=127&h|((h>>>=7)?128:0),h&&(y.buf[y.pos++]=127&h|((h>>>=7)?128:0),h&&(y.buf[y.pos++]=127&h)))))}(a,p)}(l,this):(this.realloc(4),this.buf[this.pos++]=127&l|(l>127?128:0),l>>=7)|(l>127?128:0),l>>=7)|(l>127?128:0),l>>7&127))))}writeSVarint(l){this.writeVarint(l<0?2*-l-1:2*l)}writeBoolean(l){this.writeVarint(+l)}writeString(l){l=String(l),this.realloc(4*l.length),this.pos++;let c=this.pos;this.pos=function(d,a,h){for(let y,w,C=0;C55295&&y56319||C+1===a.length?(d[h++]=239,d[h++]=191,d[h++]=189):w=y;continue}if(y<56320){d[h++]=239,d[h++]=191,d[h++]=189,w=y;continue}y=w-55296<<10|y-56320|65536,w=null}else w&&(d[h++]=239,d[h++]=191,d[h++]=189,w=null);y<128?d[h++]=y:(y>6|192:(y>12|224:(d[h++]=y>>18|240,d[h++]=y>>12&63|128),d[h++]=y>>6&63|128),d[h++]=63&y|128)}return h}(this.buf,l,this.pos);let p=this.pos-c;p>=128&&Eo(c,p,this),this.pos=c-1,this.writeVarint(p),this.pos+=p}writeFloat(l){this.realloc(4),this.dataView.setFloat32(this.pos,l,!0),this.pos+=4}writeDouble(l){this.realloc(8),this.dataView.setFloat64(this.pos,l,!0),this.pos+=8}writeBytes(l){let c=l.length;this.writeVarint(c),this.realloc(c);for(let p=0;p=128&&Eo(p,d,this),this.pos=p-1,this.writeVarint(d),this.pos+=d}writeMessage(l,c,p){this.writeTag(l,2),this.writeRawMessage(c,p)}writePackedVarint(l,c){c.length&&this.writeMessage(l,QS,c)}writePackedSVarint(l,c){c.length&&this.writeMessage(l,HS,c)}writePackedBoolean(l,c){c.length&&this.writeMessage(l,OS,c)}writePackedFloat(l,c){c.length&&this.writeMessage(l,MS,c)}writePackedDouble(l,c){c.length&&this.writeMessage(l,KS,c)}writePackedFixed32(l,c){c.length&&this.writeMessage(l,ZS,c)}writePackedSFixed32(l,c){c.length&&this.writeMessage(l,DS,c)}writePackedFixed64(l,c){c.length&&this.writeMessage(l,TS,c)}writePackedSFixed64(l,c){c.length&&this.writeMessage(l,GS,c)}writeBytesField(l,c){this.writeTag(l,2),this.writeBytes(c)}writeFixed32Field(l,c){this.writeTag(l,5),this.writeFixed32(c)}writeSFixed32Field(l,c){this.writeTag(l,5),this.writeSFixed32(c)}writeFixed64Field(l,c){this.writeTag(l,1),this.writeFixed64(c)}writeSFixed64Field(l,c){this.writeTag(l,1),this.writeSFixed64(c)}writeVarintField(l,c){this.writeTag(l,0),this.writeVarint(c)}writeSVarintField(l,c){this.writeTag(l,0),this.writeSVarint(c)}writeStringField(l,c){this.writeTag(l,2),this.writeString(c)}writeFloatField(l,c){this.writeTag(l,5),this.writeFloat(c)}writeDoubleField(l,c){this.writeTag(l,1),this.writeDouble(c)}writeBooleanField(l,c){this.writeVarintField(l,+c)}}function jr(l,c,p){return p?4294967296*c+(l>>>0):4294967296*(c>>>0)+(l>>>0)}function Eo(l,c,p){let d=c<=16383?1:c<=2097151?2:c=l;a--)p.buf[a+d]=p.buf[a]}function QS(l,c){for(let p=0;p<l.length;p++)c.writeVarint(l[p])}function HS(l,c){for(let p=0;p<l.length;p++)c.writeSVarint(l[p])}function MS(l,c){for(let p=0;p<l.length;p++)c.writeFloat(l[p])}function KS(l,c){for(let p=0;p<l.length;p++)c.writeDouble(l[p])}function OS(l,c){for(let p=0;p<l.length;p++)c.writeBoolean(l[p])}function ZS(l,c){for(let p=0;p<l.length;p++)c.writeFixed32(l[p])}function DS(l,c){for(let p=0;p<l.length;p++)c.writeSFixed32(l[p])}function TS(l,c){for(let p=0;p<l.length;p++)c.writeFixed64(l[p])}function GS(l,c){for(let p=0;pw.h-y.h);let d=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(c/0.95)),p),h:1/0}],a=0,h=0;for(let y of l)for(let w=d.length-1;w>=0;w--){let C=d[w];if(!(y.w>C.w||y.h>C.h)){if(y.x=C.x,y.y=C.y,h=Math.max(h,y.y+y.h),a=Math.max(a,y.x+y.w),y.w===C.w&&y.h===C.h){let S=d.pop();S&&wP.toCodeUnitIndex(d1));let j=O(P.toString(),H);for(let d1 of j){let m1=[...d1].map(()=>0);B.push(new Jr(d1,P.sections,m1))}}else if(M){B=[],H=H.map((v1)=>P.toCodeUnitIndex(v1));let j=0,d1=[];for(let v1 of P.text)d1.push(...Array(v1.length).fill(P.sectionIndex[j])),j++;let m1=M(P.text,d1,H);for(let v1 of m1){let n1=[],w1="";for(let S1 of v1[0])n1.push(v1[1][w1.length]),w1+=S1;B.push(new Jr(v1[0],P.sections,n1))}}else B=function(j,d1){let m1=[],v1=0;for(let n1 of d1)m1.push(j.substring(v1,n1)),v1=n1;return v1<j.length()&&m1.push(j.substring(v1,j.length())),m1}(P,H);let Z=[],T={positionedLines:Z,text:P.toString(),top:L[1],bottom:L[1],left:L[0],right:L[0],writingMode:s,iconsInText:!1,verticalizable:!1};return function(j,d1,m1,v1,n1,w1,S1,y1,s1,K1,B1,Y1){let Q1=0,i1=0,Vl=0,kl=0,Ul=y1==="right"?1:y1==="left"?0:0.5,Q0=S0/Y1,Jl=0;for(let Hl of n1){Hl.trim();let d2=Hl.getMaxScale(),j0={positionedGlyphs:[],lineOffset:0};j.positionedLines[Jl]=j0;let b0=j0.positionedGlyphs,C2=0;if(!Hl.length()){i1+=w1,++Jl;continue}let H0=bS(v1,Hl,Q0),W2=0;for(let s0 of Hl.text){let Zl=Hl.getSection(W2),a0=s0.codePointAt(0),jl=$S(s1,B1,a0),C0={glyph:a0,imageName:null,x:Q1,y:i1+-17,vertical:jl,scale:1,fontStack:"",sectionIndex:Hl.getSectionIndex(W2),metrics:null,rect:null},l3;if("fontStack"in Zl){if(l3=_S(Zl,a0,jl,H0,d1,m1),!l3)continue;C0.fontStack=Zl.fontStack}else{if(j.iconsInText=!0,Zl.scale*=Q0,l3=iS(Zl,jl,d2,H0,v1),!l3)continue;C2=Math.max(C2,l3.imageOffset),C0.imageName=Zl.imageName}let{rect:Pu,metrics:w8,baselineOffset:c4}=l3;C0.y+=c4,C0.scale=Zl.scale,C0.metrics=w8,C0.rect=Pu,b0.push(C0),jl?(j.verticalizable=!0,Q1+=("imageName"in Zl?w8.advance:S0)*Zl.scale+K1):Q1+=w8.advance*Zl.scale+K1,W2++}b0.length!==0&&(Vl=Math.max(Q1-K1,Vl),eS(b0,0,b0.length-1,Ul)),Q1=0,j0.lineOffset=Math.max(C2,(d2-1)*S0);let ou=w1*d2+C2;i1+=ou,kl=Math.max(ou,kl),++Jl}let{horizontalAlign:f0,verticalAlign:q0}=$d(S1);(function(Hl,d2,j0,b0,C2,H0,W2,ou,s0){let Zl=(d2-j0)*C2,a0=0;a0=H0!==W2?-ou*b0- -17:-b0*s0*W2+0.5*W2;for(let jl of Hl)for(let C0 of jl.positionedGlyphs)C0.x+=Zl,C0.y+=a0})(j.positionedLines,Ul,f0,q0,Vl,kl,w1,i1,n1.length),j.top+=-q0*i1,j.bottom=j.top+i1,j.left+=-f0*Vl,j.right=j.left+Vl}(T,c,p,d,B,y,w,C,s,S,U,R),!function(j){for(let d1 of j)if(d1.positionedGlyphs.length!==0)return!1;return!0}(Z)&&T}function $d(l){let c=0.5,p=0.5;switch(l){case"right":case"top-right":case"bottom-right":c=1;break;case"left":case"top-left":case"bottom-left":c=0}switch(l){case"bottom":case"bottom-right":case"bottom-left":p=1;break;case"top":case"top-right":case"top-left":p=0}return{horizontalAlign:c,verticalAlign:p}}function bS(l,c,p){let d=c.getMaxScale()*S0,{maxImageWidth:a,maxImageHeight:h}=c.getMaxImageSize(l),y=Math.max(d,h*p);return{verticalLineContentWidth:Math.max(d,a*p),horizontalLineContentHeight:y}}function Co(l){switch(l){case"top":return 0;case"center":return 0.5;default:return 1}}function $S(l,c,p){return!(l===W.ax.horizontal||!c&&!p5(p)||c&&(z7(p)||(d=p,/\p{sc=Arab}/u.test(String.fromCodePoint(d)))));var d}function _S(l,c,p,d,a,h){let y=h[l.fontStack],w=function(S,L,s,U){if(S==null?void 0:S.rect)return S;let N=L[s.fontStack],R=N==null?void 0:N[U];return R?{rect:null,metrics:R.metrics}:null}(y==null?void 0:y[c],a,l,c);if(w===null)return null;let C;if(p)C=d.verticalLineContentWidth-l.scale*S0;else{let S=Co(l.verticalAlign);C=(d.horizontalLineContentHeight-l.scale*S0)*S}return{rect:w.rect,metrics:w.metrics,baselineOffset:C}}function iS(l,c,p,d,a){let h=a[l.imageName];if(!h)return null;let{paddedRect:y,displaySize:w}=h,C={width:w[0],height:w[1],left:1,top:-3,advance:c?w[1]:w[0]},S;if(c)S=d.verticalLineContentWidth-w[1]*l.scale;else{let L=Co(l.verticalAlign);S=(d.horizontalLineContentHeight-w[1]*l.scale)*L}return{rect:y,metrics:C,baselineOffset:S,imageOffset:(c?w[0]:w[1])*l.scale-S0*p}}function eS(l,c,p,d){if(d===0)return;let a=l[p],h=(l[p].x+a.metrics.advance*a.scale)*d;for(let y=c;y<=p;y++)l[y].x-=h}function tS(l,c,p){let{horizontalAlign:d,verticalAlign:a}=$d(p),h=c[0]-l.displaySize[0]*d,y=c[1]-l.displaySize[1]*a;return{image:l,top:y,bottom:y+l.displaySize[1],left:h,right:h+l.displaySize[0]}}function Wo(l){var c,p;let{left:d,top:a}=l,h=l.right-d,y=l.bottom-a,w=(c=l.image.textFitWidth)!==null&&c!==void 0?c:"stretchOrShrink",C=(p=l.image.textFitHeight)!==null&&p!==void 0?p:"stretchOrShrink",S=(l.image.content[2]-l.image.content[0])/(l.image.content[3]-l.image.content[1]);if(C==="proportional"){if(w==="stretchOnly"&&h/y
S){let L=Math.ceil(h/S);a*=L/y,y=L}return{x1:d,y1:a,x2:d+h,y2:a+y}}function Lo(l,c,p,d,a,h){let y=l.image,w;if(y.content){let B=y.content,H=y.pixelRatio||1;w=[B[0]/H,B[1]/H,y.displaySize[0]-B[2]/H,y.displaySize[1]-B[3]/H]}let C=c.left*h,S=c.right*h,L,s,U,N;p==="width"||p==="both"?(N=a[0]+C-d[3],s=a[0]+S+d[1]):(N=a[0]+(C+S-y.displaySize[0])/2,s=N+y.displaySize[0]);let R=c.top*h,P=c.bottom*h;return p==="height"||p==="both"?(L=a[1]+R-d[0],U=a[1]+P+d[2]):(L=a[1]+(R+P-y.displaySize[1])/2,U=L+y.displaySize[1]),{image:y,top:L,right:s,bottom:U,left:N,collisionPadding:w}}O1("ImagePosition",Cp),O1("ImageAtlas",bd),W.ax=void 0,($3=W.ax||(W.ax={}))[$3.none=0]="none",$3[$3.horizontal=1]="horizontal",$3[$3.vertical=2]="vertical",$3[$3.horizontalOnly=3]="horizontalOnly";let e5=128,_3=32640;function Ao(l,c){let{expression:p}=c;if(p.kind==="constant")return{kind:"constant",layoutSize:p.evaluate(new ql(l+1))};if(p.kind==="source")return{kind:"source"};{let{zoomStops:d,interpolationType:a}=p,h=0;for(;h<d.length&&d[h]<=l;)h++;h=Math.max(0,h-1);let y=h;for(;y<d.length&&d[y]<l+1;)y++;y=Math.min(d.length-1,y);let w=d[h],C=d[y];return p.kind==="composite"?{kind:"composite",minZoom:w,maxZoom:C,interpolationType:a}:{kind:"camera",minZoom:w,maxZoom:C,minSize:p.evaluate(new ql(w)),maxSize:p.evaluate(new ql(C)),interpolationType:a}}}function _d(l,c,p){let d="never",a=l.get(c);return a?d=a:l.get(p)&&(d="always"),d}let lE=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Lp(l,c,p,d,a,h,y,w,C,S,L,s,U){let N=w?Math.min(_3,Math.round(w[0])):0,R=w?Math.min(_3,Math.round(w[1])):0;l.emplaceBack(c,p,Math.round(32*d),Math.round(32*a),h,y,(N<h.id),this.index=l.index,this.pixelRatio=l.pixelRatio,this.sourceLayerIndex=l.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let c=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ao(this.zoom,c["text-size"]),this.iconSizeData=Ao(this.zoom,c["icon-size"]);let p=this.layers[0].layout,d=p.get("symbol-sort-key"),a=p.get("symbol-z-order");this.canOverlap=_d(p,"text-overlap","text-allow-overlap")!=="never"||_d(p,"icon-overlap","icon-allow-overlap")!=="never"||p.get("text-ignore-placement")||p.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!d.isConstant(),this.sortFeaturesByY=(a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,p.get("symbol-placement")==="point"&&(this.writingModes=p.get("text-writing-mode").map((h)=>W.ax[h])),this.stateDependentLayerIds=this.layers.filter((h)=>h.isStateDependent()).map((h)=>h.id),this.sourceID=l.sourceID}createArrays(){this.text=new Ap(new vu(this.layers,this.zoom,(l)=>l.startsWith("text"))),this.icon=new Ap(new vu(this.layers,this.zoom,(l)=>l.startsWith("icon"))),this.glyphOffsetArray=new x,this.lineVertexArray=new I,this.symbolInstances=new F,this.textAnchorOffsets=new Y}calculateGlyphDependencies(l,c,p,d,a){for(let h of l)if(c[h.codePointAt(0)]=!0,(p||d)&&a){let y=d8[h];y&&(c[y.codePointAt(0)]=!0)}}populate(l,c,p){var d;let a=this.layers[0],h=a.layout,y=h.get("text-font"),w=h.get("text-field"),C=h.get("icon-image"),S=(w.value.kind!=="constant"||w.value.value instanceof D0&&!w.value.value.isEmpty()||w.value.value.toString().length>0)&&(y.value.kind!=="constant"||y.value.value.length>0),L=C.value.kind!=="constant"||!!C.value.value||Object.keys(C.parameters).length>0,s=h.get("symbol-sort-key");if(this.features=[],!S&&!L)return;let{iconDependencies:U,glyphDependencies:N,availableImages:R}=c,P=new ql(this.zoom);for(let{feature:B,id:H,index:O,sourceLayerIndex:M}of l){let Z=a._featureFilter.needGeometry,T=h5(B,Z);if(!a._featureFilter.filter(P,T,p))continue;let j,d1;if(Z||(T.geometry=o5(B)),S){let v1=a.getValueAndResolveTokens("text-field",T,p,R),n1=D0.factory(v1);this.hasRTLText||(this.hasRTLText=uE(n1)),(!this.hasRTLText||ru.getRTLTextPluginStatus()==="unavailable"||this.hasRTLText&&ru.isParsed())&&(j=IS(n1,a,T))}if(L){let v1=a.getValueAndResolveTokens("icon-image",T,p,R);d1=v1 instanceof w2?v1:w2.fromString(v1)}if(!j&&!d1)continue;let m1=this.sortFeaturesByKey?s.evaluate(T,{},p):void 0;if(this.features.push({id:H,text:j,icon:d1,index:O,sourceLayerIndex:M,geometry:T.geometry,properties:B.properties,type:Dr.types[B.type],sortKey:m1}),d1&&(U[d1.name]=!0),j){let v1=y.evaluate(T,{},p).join(","),n1=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=(d=this.writingModes)===null||d===void 0?void 0:d.includes(W.ax.vertical);for(let w1 of j.sections)if(w1.image)U[w1.image.name]=!0;else{let S1=Lr(j.toString()),y1=w1.fontStack||v1;N[y1]||(N[y1]={}),this.calculateGlyphDependencies(w1.text,N[y1],n1,this.allowVerticalPlacement,S1)}}}h.get("symbol-placement")==="line"&&(this.features=function(B){let H={},O={},M=[],Z=0;function T(v1){M.push(B[v1]),Z++}function j(v1,n1,w1){let S1=O[v1];return delete O[v1],O[n1]=S1,M[S1].geometry[0].pop(),M[S1].geometry[0]=M[S1].geometry[0].concat(w1[0]),S1}function d1(v1,n1,w1){let S1=H[n1];return delete H[n1],H[v1]=S1,M[S1].geometry[0].shift(),M[S1].geometry[0]=w1[0].concat(M[S1].geometry[0]),S1}function m1(v1,n1,w1){let S1=w1?n1[0][n1[0].length-1]:n1[0][0];return`${v1}:${S1.x}:${S1.y}`}for(let v1=0;v1v1.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((B,H)=>B.sortKey-H.sortKey)}update(l,c,p){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(l,c,this.layers,{imagePositions:p}),this.icon.programConfigurations.updatePaintArrays(l,c,this.layers,{imagePositions:p}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(l){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(l),this.iconCollisionBox.upload(l)),this.text.upload(l,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(l,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(l,c){let p=this.lineVertexArray.length;if(l.segment!==void 0){let d=l.dist(c[l.segment+1]),a=l.dist(c[l.segment]),h={};for(let y=l.segment+1;y<c.length;y++)h[y]={x:c[y].x,y:c[y].y,tileUnitDistanceFromAnchor:d},y=0;y--)h[y]={x:c[y].x,y:c[y].y,tileUnitDistanceFromAnchor:a},y>0&&(a+=c[y-1].dist(c[y]));for(let y=0;y<c.length;y++){let w=h[y];this.lineVertexArray.emplaceBack(w.x,w.y,w.tileUnitDistanceFromAnchor)}}return{lineStartIndex:p,lineLength:this.lineVertexArray.length-p}}addSymbols(l,c,p,d,a,h,y,w,C,S,L,s){let{indexArray:U,layoutVertexArray:N}=l,R=l.segments.prepareSegment(4*c.length,N,U,this.canOverlap?h.sortKey:void 0),P=this.glyphOffsetArray.length,B=R.vertexLength,H=this.allowVerticalPlacement&&y===W.ax.vertical?Math.PI/2:0,O=h.text&&h.text.sections;for(let M=0;M<c.length;M++){let{tl:Z,tr:T,bl:j,br:d1,tex:m1,pixelOffsetTL:v1,pixelOffsetBR:n1,minFontScaleX:w1,minFontScaleY:S1,glyphOffset:y1,isSDF:s1,sectionIndex:K1}=c[M],B1=R.vertexLength,Y1=y1[1];Lp(N,w.x,w.y,Z.x,Y1+Z.y,m1.x,m1.y,p,s1,v1.x,v1.y,w1,S1),Lp(N,w.x,w.y,T.x,Y1+T.y,m1.x+m1.w,m1.y,p,s1,n1.x,v1.y,w1,S1),Lp(N,w.x,w.y,j.x,Y1+j.y,m1.x,m1.y+m1.h,p,s1,v1.x,n1.y,w1,S1),Lp(N,w.x,w.y,d1.x,Y1+d1.y,m1.x+m1.w,m1.y+m1.h,p,s1,n1.x,n1.y,w1,S1),id(l.dynamicLayoutVertexArray,w,H),U.emplaceBack(B1,B1+2,B1+1),U.emplaceBack(B1+1,B1+2,B1+3),R.vertexLength+=4,R.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(y1[0]),M!==c.length-1&&K1===c[M+1].sectionIndex||l.programConfigurations.populatePaintArrays(N.length,h,h.index,{imagePositions:{},canonical:s,formattedSection:O==null?void 0:O[K1]})}l.placedSymbolArray.emplaceBack(w.x,w.y,P,this.glyphOffsetArray.length-P,B,C,S,w.segment,p?p[0]:0,p?p[1]:0,d[0],d[1],y,0,!1,0,L)}_addCollisionDebugVertex(l,c,p,d,a,h){return c.emplaceBack(0,0),l.emplaceBack(p.x,p.y,d,a,Math.round(h.x),Math.round(h.y))}addCollisionDebugVertices(l,c,p,d,a,h,y){let w=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),C=w.vertexLength,S=a.layoutVertexArray,L=a.collisionVertexArray,s=y.anchorX,U=y.anchorY;this._addCollisionDebugVertex(S,L,h,s,U,new Q(l,c)),this._addCollisionDebugVertex(S,L,h,s,U,new Q(p,c)),this._addCollisionDebugVertex(S,L,h,s,U,new Q(p,d)),this._addCollisionDebugVertex(S,L,h,s,U,new Q(l,d)),w.vertexLength+=4;let N=a.indexArray;N.emplaceBack(C,C+1),N.emplaceBack(C+1,C+2),N.emplaceBack(C+2,C+3),N.emplaceBack(C+3,C),w.primitiveLength+=4}addDebugCollisionBoxes(l,c,p,d){for(let a=l;a<c;a++){let h=this.collisionBoxArray.get(a);this.addCollisionDebugVertices(h.x1,h.y1,h.x2,h.y2,d?this.textCollisionBox:this.iconCollisionBox,h.anchorPoint,p)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Vp(L1,oo.members,T1),this.iconCollisionBox=new Vp(L1,oo.members,T1);for(let l=0;l<this.symbolInstances.length;l++){let c=this.symbolInstances.get(l);this.addDebugCollisionBoxes(c.textBoxStartIndex,c.textBoxEndIndex,c,!0),this.addDebugCollisionBoxes(c.verticalTextBoxStartIndex,c.verticalTextBoxEndIndex,c,!0),this.addDebugCollisionBoxes(c.iconBoxStartIndex,c.iconBoxEndIndex,c,!1),this.addDebugCollisionBoxes(c.verticalIconBoxStartIndex,c.verticalIconBoxEndIndex,c,!1)}}_deserializeCollisionBoxesForSymbol(l,c,p,d,a,h,y,w,C){let S={};for(let L=c;L<p;L++){let s=l.get(L);S.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},S.textFeatureIndex=s.featureIndex;break}for(let L=d;L<a;L++){let s=l.get(L);S.verticalTextBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},S.verticalTextFeatureIndex=s.featureIndex;break}for(let L=h;L<y;L++){let s=l.get(L);S.iconBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},S.iconFeatureIndex=s.featureIndex;break}for(let L=w;L<C;L++){let s=l.get(L);S.verticalIconBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},S.verticalIconFeatureIndex=s.featureIndex;break}return S}deserializeCollisionBoxes(l){this.collisionArrays=[];for(let c=0;c0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(l,c){let p=l.placedSymbolArray.get(c),d=p.vertexStartIndex+4*p.numGlyphs;for(let a=p.vertexStartIndex;a<d;a+=4)l.indexArray.emplaceBack(a,a+2,a+1),l.indexArray.emplaceBack(a+1,a+2,a+3)}getSortedSymbolIndexes(l){if(this.sortedAngle===l&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let c=Math.sin(l),p=Math.cos(l),d=[],a=[],h=[];for(let y=0;yd[y]-d[w]||a[w]-a[y]),h}addToSortKeyRanges(l,c){let p=this.sortKeyRanges[this.sortKeyRanges.length-1];(p==null?void 0:p.sortKey)===c?p.symbolInstanceEnd=l+1:this.sortKeyRanges.push({sortKey:c,symbolInstanceStart:l,symbolInstanceEnd:l+1})}sortFeatures(l){if(this.sortFeaturesByY&&this.sortedAngle!==l&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(l),this.sortedAngle=l,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let c of this.symbolInstanceIndexes){let p=this.symbolInstances.get(c);this.featureSortOrder.push(p.featureIndex);let d=[p.rightJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.leftJustifiedTextSymbolIndex];for(let a=0;a=0&&d.indexOf(h)===a&&this.addIndicesForPlacedSymbol(this.text,h)}p.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,p.verticalPlacedTextSymbolIndex),p.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.placedIconSymbolIndex),p.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Vo,No;O1("SymbolBucket",Cc,{omit:["layers","collisionBoxArray","features","compareText"]}),Cc.MAX_GLYPHS=65535,Cc.addDynamicAttributes=id;var ed={get paint(){return No=No||new V0({"icon-opacity":new _1(E1.paint_symbol["icon-opacity"]),"icon-color":new _1(E1.paint_symbol["icon-color"]),"icon-halo-color":new _1(E1.paint_symbol["icon-halo-color"]),"icon-halo-width":new _1(E1.paint_symbol["icon-halo-width"]),"icon-halo-blur":new _1(E1.paint_symbol["icon-halo-blur"]),"icon-translate":new j1(E1.paint_symbol["icon-translate"]),"icon-translate-anchor":new j1(E1.paint_symbol["icon-translate-anchor"]),"text-opacity":new _1(E1.paint_symbol["text-opacity"]),"text-color":new _1(E1.paint_symbol["text-color"],{runtimeType:y2,getOverride:(l)=>l.textColor,hasOverride:(l)=>!!l.textColor}),"text-halo-color":new _1(E1.paint_symbol["text-halo-color"]),"text-halo-width":new _1(E1.paint_symbol["text-halo-width"]),"text-halo-blur":new _1(E1.paint_symbol["text-halo-blur"]),"text-translate":new j1(E1.paint_symbol["text-translate"]),"text-translate-anchor":new j1(E1.paint_symbol["text-translate-anchor"])})},get layout(){return Vo=Vo||new V0({"symbol-placement":new j1(E1.layout_symbol["symbol-placement"]),"symbol-spacing":new j1(E1.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new j1(E1.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new _1(E1.layout_symbol["symbol-sort-key"]),"symbol-z-order":new j1(E1.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new j1(E1.layout_symbol["icon-allow-overlap"]),"icon-overlap":new j1(E1.layout_symbol["icon-overlap"]),"icon-ignore-placement":new j1(E1.layout_symbol["icon-ignore-placement"]),"icon-optional":new j1(E1.layout_symbol["icon-optional"]),"icon-rotation-alignment":new j1(E1.layout_symbol["icon-rotation-alignment"]),"icon-size":new _1(E1.layout_symbol["icon-size"]),"icon-text-fit":new j1(E1.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new j1(E1.layout_symbol["icon-text-fit-padding"]),"icon-image":new _1(E1.layout_symbol["icon-image"]),"icon-rotate":new _1(E1.layout_symbol["icon-rotate"]),"icon-padding":new _1(E1.layout_symbol["icon-padding"]),"icon-keep-upright":new j1(E1.layout_symbol["icon-keep-upright"]),"icon-offset":new _1(E1.layout_symbol["icon-offset"]),"icon-anchor":new _1(E1.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new j1(E1.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new j1(E1.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new j1(E1.layout_symbol["text-rotation-alignment"]),"text-field":new _1(E1.layout_symbol["text-field"]),"text-font":new _1(E1.layout_symbol["text-font"]),"text-size":new _1(E1.layout_symbol["text-size"]),"text-max-width":new _1(E1.layout_symbol["text-max-width"]),"text-line-height":new j1(E1.layout_symbol["text-line-height"]),"text-letter-spacing":new _1(E1.layout_symbol["text-letter-spacing"]),"text-justify":new _1(E1.layout_symbol["text-justify"]),"text-radial-offset":new _1(E1.layout_symbol["text-radial-offset"]),"text-variable-anchor":new j1(E1.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new _1(E1.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new _1(E1.layout_symbol["text-anchor"]),"text-max-angle":new j1(E1.layout_symbol["text-max-angle"]),"text-writing-mode":new j1(E1.layout_symbol["text-writing-mode"]),"text-rotate":new _1(E1.layout_symbol["text-rotate"]),"text-padding":new j1(E1.layout_symbol["text-padding"]),"text-keep-upright":new j1(E1.layout_symbol["text-keep-upright"]),"text-transform":new _1(E1.layout_symbol["text-transform"]),"text-offset":new _1(E1.layout_symbol["text-offset"]),"text-allow-overlap":new j1(E1.layout_symbol["text-allow-overlap"]),"text-overlap":new j1(E1.layout_symbol["text-overlap"]),"text-ignore-placement":new j1(E1.layout_symbol["text-ignore-placement"]),"text-optional":new j1(E1.layout_symbol["text-optional"])})}};class td{constructor(l){if(l.property.overrides===void 0)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=l.property.overrides?l.property.overrides.runtimeType:bu,this.defaultValue=l}evaluate(l){if(l.formattedSection){let c=this.defaultValue.property.overrides;if(c==null?void 0:c.hasOverride(l.formattedSection))return c.getOverride(l.formattedSection)}return l.feature&&l.featureState?this.defaultValue.evaluate(l.feature,l.featureState):this.defaultValue.property.specification.default}eachChild(l){this.defaultValue.isConstant()||l(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}O1("FormatSectionOverride",td,{omit:["defaultValue"]});class Np extends r2{constructor(l,c){super(l,ed,c)}recalculate(l,c){if(super.recalculate(l,c),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let p=this.layout.get("text-writing-mode");if(p){let d=[];for(let a of p)d.includes(a)||d.push(a);this.layout._values["text-writing-mode"]=d}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(l,c,p,d){let a=this.layout.get(l).evaluate(c,{},p,d),h=this._unevaluatedLayout._values[l];return h.isDataDriven()||_4(h.value)||!a?a:function(y,w){return w.replace(/{([^{}]+)}/g,(C,S)=>y&&(S in y)?String(y[S]):"")}(c.properties,a)}createBucket(l){return new Cc(l)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let l of ed.paint.overridableProperties){if(!Np.hasPaintOverride(this.layout,l))continue;let c=this.paint.get(l),p=new td(c),d=new K5(p,c.property.specification),a=null;a=c.value.kind==="constant"||c.value.kind==="source"?new z3("source",d):new i4("composite",d,c.value.zoomStops),this.paint._values[l]=new E2(c.property,a,c.parameters)}}_handleOverridablePaintPropertyUpdate(l,c,p){return!(!this.layout||c.isDataDriven()||p.isDataDriven())&&Np.hasPaintOverride(this.layout,l)}static hasPaintOverride(l,c){let p=l.get("text-field"),d=ed.paint.properties[c],a=!1,h=(y)=>{var w;for(let C of y)if((w=d.overrides)===null||w===void 0?void 0:w.hasOverride(C))return void(a=!0)};if(p.value.kind==="constant"&&p.value.value instanceof D0)h(p.value.value.sections);else if(p.value.kind==="source"||p.value.kind==="composite"){let y=(C)=>{a||(C instanceof e2&&_l(C.value)===U4?h(C.value.sections):C instanceof Y5?h(C.sections):C.eachChild(y))},w=p.value;w._styleExpression&&y(w._styleExpression.expression)}return a}}let qo;var cE={get paint(){return qo=qo||new V0({"background-color":new j1(E1.paint_background["background-color"]),"background-pattern":new xr(E1.paint_background["background-pattern"]),"background-opacity":new j1(E1.paint_background["background-opacity"])})}};class Fo extends r2{constructor(l,c){super(l,cE,c)}}class Uo extends r2{constructor(l,c){super(l,{},c),this.onAdd=(p)=>{this.implementation.onAdd&&this.implementation.onAdd(p,p.painter.context.gl)},this.onRemove=(p)=>{this.implementation.onRemove&&this.implementation.onRemove(p,p.painter.context.gl)},this.implementation=l}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}}class xo{constructor(l){this._methodToThrottle=l,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var l;this._triggered||(this._triggered=!0,(l=this._channel)===null||l===void 0||l.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let rE={once:!0},lm=6371008.8;class i3{constructor(l,c){if(isNaN(l)||isNaN(c))throw Error(`Invalid LngLat object: (${l}, ${c})`);if(this.lng=+l,this.lat=+c,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new i3(Jc(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(l){let c=Math.PI/180,p=this.lat*c,d=l.lat*c,a=Math.sin(p)*Math.sin(d)+Math.cos(p)*Math.cos(d)*Math.cos((l.lng-this.lng)*c);return lm*Math.acos(Math.min(a,1))}static convert(l){if(l instanceof i3)return l;if(Array.isArray(l)&&(l.length===2||l.length===3))return new i3(Number(l[0]),Number(l[1]));if(!Array.isArray(l)&&typeof l=="object"&&l!==null)return new i3(Number("lng"in l?l.lng:l.lon),Number(l.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let Po=2*Math.PI*lm;function Ro(l){return Po*Math.cos(l*Math.PI/180)}function Io(l){return(180+l)/360}function Yo(l){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+l*Math.PI/360)))/360}function Bo(l,c){return l/Ro(c)}function zo(l){return 360*l-180}function qp(l){return 360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90}function Qo(l,c){return l*Ro(qp(c))}class g8{constructor(l,c,p=0){this.x=+l,this.y=+c,this.z=+p}static fromLngLat(l,c=0){let p=i3.convert(l);return new g8(Io(p.lng),Yo(p.lat),Bo(c,p.lat))}toLngLat(){return new i3(zo(this.x),qp(this.y))}toAltitude(){return Qo(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Po*(l=qp(this.y),1/Math.cos(l*Math.PI/180));var l}}function Ho(l,c,p){var d=2*Math.PI*6378137/256/Math.pow(2,p);return[l*d-2*Math.PI*6378137/2,c*d-2*Math.PI*6378137/2]}class Fp{constructor(l,c,p){if(!function(d,a,h){return!(d25||h=Math.pow(2,d)||a=Math.pow(2,d))}(l,c,p))throw Error(`x=${c}, y=${p}, z=${l} outside of bounds. 0<=x<${Math.pow(2,l)}, 0<=y<${Math.pow(2,l)} 0<=z0;R--){let P=1<1?"@2x":"").replace(/{quadkey}/g,S).replace(/{bbox-epsg-3857}/g,d)}isChildOf(l){let c=this.z-l.z;return c>0&&l.x===this.x>>c&&l.y===this.y>>c}getTilePoint(l){let c=Math.pow(2,this.z);return new Q((l.x*c-this.x)*ul,(l.y*c-this.y)*ul)}toString(){return`${this.z}/${this.x}/${this.y}`}}class um{constructor(l,c){this.wrap=l,this.canonical=c,this.key=br(l,c.z,c.z,c.x,c.y)}}class I2{constructor(l,c,p,d,a){if(this.terrainRttPosMatrix32f=null,l= z; overscaledZ = ${l}; z = ${p}`);this.overscaledZ=l,this.wrap=c,this.canonical=new Fp(p,+d,+a),this.key=br(c,l,p,d,a)}clone(){return new I2(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(l){return this.overscaledZ===l.overscaledZ&&this.wrap===l.wrap&&this.canonical.equals(l.canonical)}scaledTo(l){if(l>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);let c=this.canonical.z-l;return l>this.canonical.z?new I2(l,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new I2(l,this.wrap,l,this.canonical.x>>c,this.canonical.y>>c)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(l,c){if(l>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);let p=this.canonical.z-l;return l>this.canonical.z?br(this.wrap*+c,l,this.canonical.z,this.canonical.x,this.canonical.y):br(this.wrap*+c,l,l,this.canonical.x>>p,this.canonical.y>>p)}isChildOf(l){if(l.wrap!==this.wrap)return!1;if(this.overscaledZ-l.overscaledZ0;let c=this.canonical.z-l.canonical.z;return!(c>c&&l.canonical.y===this.canonical.y>>c}children(l){if(this.overscaledZ>=l)return[new I2(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let c=this.canonical.z+1,p=2*this.canonical.x,d=2*this.canonical.y;return[new I2(c,this.wrap,c,p,d),new I2(c,this.wrap,c,p+1,d),new I2(c,this.wrap,c,p,d+1),new I2(c,this.wrap,c,p+1,d+1)]}isLessThan(l){return this.wrapl.wrap)&&(this.overscaledZl.overscaledZ)&&(this.canonical.xl.canonical.x)&&this.canonical.y=0&&l
=0&&c<p)return{tileID:this,x:l,y:c};let d=Math.floor(l/p),a=Math.floor(c/p),h=l-d*p,y=c-a*p,w=this.canonical.z,C=1<<w,S=this.canonical.y+a;if(S=C)return null;let L=this.canonical.x+d,s=this.wrap;return L=C&&(s+=Math.floor(L/C),L%=C),{tileID:new I2(this.overscaledZ,s,w,L,S),x:h,y}}}function br(l,c,p,d,a){(l*=2)<0&&(l=-1*l-1);let h=1<
this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(l){return this.expandBy(-l)}map(l){let c=new Wc;return c.extend(l(new Q(this.minX,this.minY))),c.extend(l(new Q(this.maxX,this.minY))),c.extend(l(new Q(this.minX,this.maxY))),c.extend(l(new Q(this.maxX,this.maxY))),c}static fromPoints(l){let c=new Wc;for(let p of l)c.extend(p);return c}contains(l){return l.x>=this.minX&&l.x=this.minY&&l.ythis.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(l){return!this.empty()&&!l.empty()&&l.minX>=this.minX&&l.maxX=this.minY&&l.maxY<=this.maxY}intersects(l){return!this.empty()&&!l.empty()&&l.minX=this.minX&&l.minY=this.minY}}class cm{constructor(l){this._stringToNumber={},this._numberToString=[];for(let c=0;c=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${l} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[l]}}class rm{constructor(l,c,p,d,a){this.type="Feature",this._vectorTileFeature=l,this._x=p,this._y=d,this._z=c,this.properties=l.properties,this.id=a}projectPoint(l,c,p,d){return[360*(l.x+c)/d-180,360/Math.PI*Math.atan(Math.exp((1-2*(l.y+p)/d)*Math.PI))-90]}projectLine(l,c,p,d){return l.map((a)=>this.projectPoint(a,c,p,d))}get geometry(){if(this._geometry)return this._geometry;let l=this._vectorTileFeature,c=l.extent*Math.pow(2,this._z),p=l.extent*this._x,d=l.extent*this._y,a=l.loadGeometry();switch(l.type){case 1:{let h=[];for(let w of a)h.push(w[0]);let y=this.projectLine(h,p,d,c);this._geometry=h.length===1?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y};break}case 2:{let h=a.map((y)=>this.projectLine(y,p,d,c));this._geometry=h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h};break}case 3:{let h=Qa(a),y=[];for(let w of h)y.push(w.map((C)=>this.projectLine(C,p,d,c)));this._geometry=y.length===1?{type:"Polygon",coordinates:y[0]}:{type:"MultiPolygon",coordinates:y};break}default:throw Error(`unknown feature type: ${l.type}`)}return this._geometry}set geometry(l){this._geometry=l}toJSON(){let l={geometry:this.geometry};for(let c in this)c!=="_geometry"&&c!=="_vectorTileFeature"&&c!=="_x"&&c!=="_y"&&c!=="_z"&&(l[c]=this[c]);return l}}class Lc{constructor(l,c,p){this._name=l,this.dataBuffer=c,typeof p=="number"?this._size=p:(this.nullabilityBuffer=p,this._size=p.size())}getValue(l){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(l)?null:this.getValueFromBuffer(l)}has(l){return this.nullabilityBuffer?.get(l)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class v8 extends Lc{}class Up extends v8{getValueFromBuffer(l){return this.dataBuffer[l]}}class xp extends v8{getValueFromBuffer(l){return this.dataBuffer[l]}}class pm extends Lc{constructor(l,c,p,d){super(l,c,d),this.delta=p}}class Pp extends pm{constructor(l,c,p,d){super(l,Int32Array.of(c),p,d)}getValueFromBuffer(l){return this.dataBuffer[0]+l*this.delta}}class Rp extends Lc{constructor(l,c,p,d){super(l,d?Int32Array.of(c):Uint32Array.of(c),p)}getValueFromBuffer(l){return this.dataBuffer[0]}}class Mo{constructor(l,c,p,d,a=4096){this._name=l,this._geometryVector=c,this._idVector=p,this._propertyVectors=d,this._extent=a}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(l){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((c)=>[c.name,c]))),this.propertyVectorsMap.get(l)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let l=[],c=this.geometryVector.getGeometries();for(let p=0;p<this.numFeatures;p++){let d;if(this.idVector){let y=this.idVector.getValue(p);d=this.containsMaxSafeIntegerValues(this.idVector)&&y!==null?Number(y):y}let a={coordinates:c[p],type:this.geometryVector.geometryType(p)},h={};for(let y of this.propertyVectors){if(!y)continue;let w=y.name,C=y.getValue(p);C!==null&&(h[w]=C)}l.push({id:d,geometry:a,properties:h})}return l}containsMaxSafeIntegerValues(l){return l instanceof Up||l instanceof Rp||l instanceof Pp||l instanceof xp}}class fm{constructor(l){this.value=l}get(){return this.value}set(l){this.value=l}increment(){return this.value++}add(l){this.value+=l}}var yl,e3;(function(l){l.NONE="NONE",l.DELTA="DELTA",l.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",l.RLE="RLE",l.MORTON="MORTON",l.PDE="PDE"})(yl||(yl={})),function(l){l.NONE="NONE",l.FAST_PFOR="FAST_PFOR",l.VARINT="VARINT",l.ALP="ALP"}(e3||(e3={}));let dm=new Uint32Array(33);dm[0]=0;for(let l=1;l>>32-l;let mm=dm,t5=256;function gm(l,c){return l-l%c}function pE(l){let c=l>>>0;return((255&c)<<24|(65280&c)<>>8&65280|c>>>24&255)>>>0}let vm=function(){if(!Number.isFinite(65536))return 65536;let l=gm(Math.floor(65536),t5);return l===0?t5:l}(),fE=3*vm/t5+vm|0;function Ko(){let l=new Uint8Array(fE);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:l,byteContainerI32:new Int32Array(l.buffer,l.byteOffset,l.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function dE(l,c,p,d,a){switch(a){case 1:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0;w[S++]=U>>>0&1,w[S++]=U>>>1&1,w[S++]=U>>>2&1,w[S++]=U>>>3&1,w[S++]=U>>>4&1,w[S++]=U>>>5&1,w[S++]=U>>>6&1,w[S++]=U>>>7&1,w[S++]=U>>>8&1,w[S++]=U>>>9&1,w[S++]=U>>>10&1,w[S++]=U>>>11&1,w[S++]=U>>>12&1,w[S++]=U>>>13&1,w[S++]=U>>>14&1,w[S++]=U>>>15&1,w[S++]=U>>>16&1,w[S++]=U>>>17&1,w[S++]=U>>>18&1,w[S++]=U>>>19&1,w[S++]=U>>>20&1,w[S++]=U>>>21&1,w[S++]=U>>>22&1,w[S++]=U>>>23&1,w[S++]=U>>>24&1,w[S++]=U>>>25&1,w[S++]=U>>>26&1,w[S++]=U>>>27&1,w[S++]=U>>>28&1,w[S++]=U>>>29&1,w[S++]=U>>>30&1,w[S++]=U>>>31&1}})(l,c,p,d);break;case 2:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0,N=h[L++]>>>0;w[S++]=U>>>0&3,w[S++]=U>>>2&3,w[S++]=U>>>4&3,w[S++]=U>>>6&3,w[S++]=U>>>8&3,w[S++]=U>>>10&3,w[S++]=U>>>12&3,w[S++]=U>>>14&3,w[S++]=U>>>16&3,w[S++]=U>>>18&3,w[S++]=U>>>20&3,w[S++]=U>>>22&3,w[S++]=U>>>24&3,w[S++]=U>>>26&3,w[S++]=U>>>28&3,w[S++]=U>>>30&3,w[S++]=N>>>0&3,w[S++]=N>>>2&3,w[S++]=N>>>4&3,w[S++]=N>>>6&3,w[S++]=N>>>8&3,w[S++]=N>>>10&3,w[S++]=N>>>12&3,w[S++]=N>>>14&3,w[S++]=N>>>16&3,w[S++]=N>>>18&3,w[S++]=N>>>20&3,w[S++]=N>>>22&3,w[S++]=N>>>24&3,w[S++]=N>>>26&3,w[S++]=N>>>28&3,w[S++]=N>>>30&3}})(l,c,p,d);break;case 3:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0,N=h[L++]>>>0,R=h[L++]>>>0;w[S++]=U>>>0&7,w[S++]=U>>>3&7,w[S++]=U>>>6&7,w[S++]=U>>>9&7,w[S++]=U>>>12&7,w[S++]=U>>>15&7,w[S++]=U>>>18&7,w[S++]=U>>>21&7,w[S++]=U>>>24&7,w[S++]=U>>>27&7,w[S++]=7&(U>>>30|(1&N)<>>1&7,w[S++]=N>>>4&7,w[S++]=N>>>7&7,w[S++]=N>>>10&7,w[S++]=N>>>13&7,w[S++]=N>>>16&7,w[S++]=N>>>19&7,w[S++]=N>>>22&7,w[S++]=N>>>25&7,w[S++]=N>>>28&7,w[S++]=7&(N>>>31|(3&R)<>>2&7,w[S++]=R>>>5&7,w[S++]=R>>>8&7,w[S++]=R>>>11&7,w[S++]=R>>>14&7,w[S++]=R>>>17&7,w[S++]=R>>>20&7,w[S++]=R>>>23&7,w[S++]=R>>>26&7,w[S++]=R>>>29&7}})(l,c,p,d);break;case 4:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0,N=h[L++]>>>0,R=h[L++]>>>0,P=h[L++]>>>0;w[S++]=U>>>0&15,w[S++]=U>>>4&15,w[S++]=U>>>8&15,w[S++]=U>>>12&15,w[S++]=U>>>16&15,w[S++]=U>>>20&15,w[S++]=U>>>24&15,w[S++]=U>>>28&15,w[S++]=N>>>0&15,w[S++]=N>>>4&15,w[S++]=N>>>8&15,w[S++]=N>>>12&15,w[S++]=N>>>16&15,w[S++]=N>>>20&15,w[S++]=N>>>24&15,w[S++]=N>>>28&15,w[S++]=R>>>0&15,w[S++]=R>>>4&15,w[S++]=R>>>8&15,w[S++]=R>>>12&15,w[S++]=R>>>16&15,w[S++]=R>>>20&15,w[S++]=R>>>24&15,w[S++]=R>>>28&15,w[S++]=P>>>0&15,w[S++]=P>>>4&15,w[S++]=P>>>8&15,w[S++]=P>>>12&15,w[S++]=P>>>16&15,w[S++]=P>>>20&15,w[S++]=P>>>24&15,w[S++]=P>>>28&15}})(l,c,p,d);break;case 5:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0,N=h[L++]>>>0,R=h[L++]>>>0,P=h[L++]>>>0,B=h[L++]>>>0;w[S++]=U>>>0&31,w[S++]=U>>>5&31,w[S++]=U>>>10&31,w[S++]=U>>>15&31,w[S++]=U>>>20&31,w[S++]=U>>>25&31,w[S++]=31&(U>>>30|(7&N)<>>3&31,w[S++]=N>>>8&31,w[S++]=N>>>13&31,w[S++]=N>>>18&31,w[S++]=N>>>23&31,w[S++]=31&(N>>>28|(1&R)<>>1&31,w[S++]=R>>>6&31,w[S++]=R>>>11&31,w[S++]=R>>>16&31,w[S++]=R>>>21&31,w[S++]=R>>>26&31,w[S++]=31&(R>>>31|(15&P)<>>4&31,w[S++]=P>>>9&31,w[S++]=P>>>14&31,w[S++]=P>>>19&31,w[S++]=P>>>24&31,w[S++]=31&(P>>>29|(3&B)<>>2&31,w[S++]=B>>>7&31,w[S++]=B>>>12&31,w[S++]=B>>>17&31,w[S++]=B>>>22&31,w[S++]=B>>>27&31}})(l,c,p,d);break;case 6:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0,N=h[L++]>>>0,R=h[L++]>>>0,P=h[L++]>>>0,B=h[L++]>>>0,H=h[L++]>>>0;w[S++]=U>>>0&63,w[S++]=U>>>6&63,w[S++]=U>>>12&63,w[S++]=U>>>18&63,w[S++]=U>>>24&63,w[S++]=63&(U>>>30|(15&N)<>>4&63,w[S++]=N>>>10&63,w[S++]=N>>>16&63,w[S++]=N>>>22&63,w[S++]=63&(N>>>28|(3&R)<>>2&63,w[S++]=R>>>8&63,w[S++]=R>>>14&63,w[S++]=R>>>20&63,w[S++]=R>>>26&63,w[S++]=P>>>0&63,w[S++]=P>>>6&63,w[S++]=P>>>12&63,w[S++]=P>>>18&63,w[S++]=P>>>24&63,w[S++]=63&(P>>>30|(15&B)<>>4&63,w[S++]=B>>>10&63,w[S++]=B>>>16&63,w[S++]=B>>>22&63,w[S++]=63&(B>>>28|(3&H)<>>2&63,w[S++]=H>>>8&63,w[S++]=H>>>14&63,w[S++]=H>>>20&63,w[S++]=H>>>26&63}})(l,c,p,d);break;case 7:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0,N=h[L++]>>>0,R=h[L++]>>>0,P=h[L++]>>>0,B=h[L++]>>>0,H=h[L++]>>>0,O=h[L++]>>>0;w[S++]=U>>>0&127,w[S++]=U>>>7&127,w[S++]=U>>>14&127,w[S++]=U>>>21&127,w[S++]=127&(U>>>28|(7&N)<>>3&127,w[S++]=N>>>10&127,w[S++]=N>>>17&127,w[S++]=N>>>24&127,w[S++]=127&(N>>>31|(63&R)<>>6&127,w[S++]=R>>>13&127,w[S++]=R>>>20&127,w[S++]=127&(R>>>27|(3&P)<>>2&127,w[S++]=P>>>9&127,w[S++]=P>>>16&127,w[S++]=P>>>23&127,w[S++]=127&(P>>>30|(31&B)<>>5&127,w[S++]=B>>>12&127,w[S++]=B>>>19&127,w[S++]=127&(B>>>26|(1&H)<>>1&127,w[S++]=H>>>8&127,w[S++]=H>>>15&127,w[S++]=H>>>22&127,w[S++]=127&(H>>>29|(15&O)<>>4&127,w[S++]=O>>>11&127,w[S++]=O>>>18&127,w[S++]=O>>>25&127}})(l,c,p,d);break;case 8:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0,N=h[L++]>>>0,R=h[L++]>>>0,P=h[L++]>>>0,B=h[L++]>>>0,H=h[L++]>>>0,O=h[L++]>>>0,M=h[L++]>>>0;w[S++]=U>>>0&255,w[S++]=U>>>8&255,w[S++]=U>>>16&255,w[S++]=U>>>24&255,w[S++]=N>>>0&255,w[S++]=N>>>8&255,w[S++]=N>>>16&255,w[S++]=N>>>24&255,w[S++]=R>>>0&255,w[S++]=R>>>8&255,w[S++]=R>>>16&255,w[S++]=R>>>24&255,w[S++]=P>>>0&255,w[S++]=P>>>8&255,w[S++]=P>>>16&255,w[S++]=P>>>24&255,w[S++]=B>>>0&255,w[S++]=B>>>8&255,w[S++]=B>>>16&255,w[S++]=B>>>24&255,w[S++]=H>>>0&255,w[S++]=H>>>8&255,w[S++]=H>>>16&255,w[S++]=H>>>24&255,w[S++]=O>>>0&255,w[S++]=O>>>8&255,w[S++]=O>>>16&255,w[S++]=O>>>24&255,w[S++]=M>>>0&255,w[S++]=M>>>8&255,w[S++]=M>>>16&255,w[S++]=M>>>24&255}})(l,c,p,d);break;case 16:(function(h,y,w,C){let S=C,L=y;for(let s=0;s>>0;w[S++]=65535&U,w[S++]=U>>>16&65535}})(l,c,p,d);break;default:(function(h,y,w,C,S){let L=mm[S]>>>0,s=y,U=0,N=h[s]>>>0,R=C;for(let P=0;P<8;P++){for(let B=0;B<32;B++)if(U+S>>U&L,U+=S,U===32&&(U=0,s++,B!==31&&(N=h[s]>>>0));else{let H=32-U,O=N>>>U;s++,N=h[s]>>>0;let M=S-H;w[R+B]=(O|(N&-1>>>32-M>>>0)<<H)&L,U=M}R+=32,U=0,P>>0)}})(l,c,p,d,a)}return c+(a<c)throw Error(`FastPFOR decode: byteContainer underflow at block=${d} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${p}, byteSize=${c})`);let a=l[p++],h=l[p++];if(a>32)throw Error(`FastPFOR decode: invalid bitWidth=${a} at block=${d} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:a,exceptionCount:h,bytePosIn:p}}function gE(l,c,p,d,a,h,y,w,C){let{maxBits:S,exceptionBitWidth:L,bytePosIn:s}=function(B,H,O,M,Z,T){if(O+1>H)throw Error(`FastPFOR decode: exception header underflow at block=${T} (need 1 byte for maxBits, bytePos=${O}, byteSize=${H})`);let j=B[O++];if(j32)throw Error(`FastPFOR decode: invalid maxBits=${j} at block=${T} (bitWidth=${M}, expected ${M}..32)`);let d1=j-M|0;if(d132)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${d1} at block=${T} (bitWidth=${M}, maxBits=${j})`);if(O+Z>H)throw Error(`FastPFOR decode: exception positions underflow at block=${T} (need=${Z}, have=${H-O})`);return{maxBits:j,exceptionBitWidth:d1,bytePosIn:O}}(a,h,y,p,d,C);if(y=s,L===1){let B=1<<p;for(let H=0;HP)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${L} (ptr=${R}, need ${d}, size=${P}) at block ${C}`);for(let B=0;B<d;B=B+1|0){let H=a[y++],O=0|U[R++];l[H+c|0]|=O<<p}return N[L]=R,y}function vE(l,c,p,d,a,h){let y=0|p,w=0|l[y];if(wl.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${w} at pageStart=${y} (expected > 0 and pageStart+whereMeta >>0,s=L+3>>>2,U=S+1,N=U+s;if(N>=l.length)throw Error(`FastPFOR decode: invalid byteSize=${L} (metaInts=${s}, pageStart=${y}, packedEnd=${S}, byteContainerStart=${U}) causes bitmapPos=${N} out of bounds (encoded.length=${l.length})`);let R=function(H,O,M,Z){Z.byteContainer.length>>2;if(3&T.byteOffset)for(let m1=0;m1<j;m1=m1+1|0){let v1=0|H[O+m1|0],n1=m1<>>8&255,T[n1+2|0]=v1>>>16&255,T[n1+3|0]=v1>>>24&255}else{let m1=Z.byteContainerI32;(!m1||m1.buffer!==T.buffer||m1.byteOffset!==T.byteOffset||m1.length>>2)),m1.set(H.subarray(O,O+j))}let d1=3&M;if(d1>0){let m1=0|H[O+j|0],v1=j<<2;for(let n1=0;n1>>(n1<<3)&255}return T}(l,U,L,h),P=L,B=function(H,O,M){let Z=0|H[O++],T=M.dataToBePacked;for(let j=2;j>>j-1&1))continue;if(O>=H.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${j}, streamWordIndex=${O}, needWords=1, availableWords=${H.length-O}, encodedWords=${H.length})`);let d1=H[O++]>>>0,m1=gm(d1+31,32),v1=d1*j+31>>>5;if(O+v1>H.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${j}, size=${d1}, streamWordIndex=${O}, needWords=${v1}, availableWords=${H.length-O}, encodedWords=${H.length})`);let n1=T[j];(!n1||n1.length<m1)&&(n1=T[j]=new Uint32Array(m1));let w1=0;for(;w1>>5)|0,M.exceptionSizes[j]=d1}return O}(l,N,h);return h.dataPointers.fill(0),function(H,O,M,Z,T,j,d1,m1,v1,n1){let w1=0|M,S1=0;for(let y1=0;y1<d1;y1=y1+1|0){let s1=mE(m1,v1,S1,y1);S1=s1.bytePosIn;let{bitWidth:K1,exceptionCount:B1}=s1,Y1=j+y1*t5|0;switch(K1){case 0:T.fill(0,Y1,Y1+t5);break;case 32:for(let Q1=0;Q10&&(S1=gE(T,Y1,K1,B1,m1,v1,S1,n1,y1))}if(w1!==Z)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${O}, packedStart=${M}, consumedPackedEnd=${w1}, expectedPackedEnd=${Z}, packedWords=${Z-M}, encoded.length=${H.length})`)}(l,y,C,S,c,0|d,a/t5|0,R,P,h),B}function aE(l,c,p,d,a){switch(a){case 2:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0;s[N++]=R>>>0&3,s[N++]=R>>>2&3,s[N++]=R>>>4&3,s[N++]=R>>>6&3,s[N++]=R>>>8&3,s[N++]=R>>>10&3,s[N++]=R>>>12&3,s[N++]=R>>>14&3,s[N++]=R>>>16&3,s[N++]=R>>>18&3,s[N++]=R>>>20&3,s[N++]=R>>>22&3,s[N++]=R>>>24&3,s[N++]=R>>>26&3,s[N++]=R>>>28&3,s[N++]=R>>>30&3,s[N++]=P>>>0&3,s[N++]=P>>>2&3,s[N++]=P>>>4&3,s[N++]=P>>>6&3,s[N++]=P>>>8&3,s[N++]=P>>>10&3,s[N++]=P>>>12&3,s[N++]=P>>>14&3,s[N++]=P>>>16&3,s[N++]=P>>>18&3,s[N++]=P>>>20&3,s[N++]=P>>>22&3,s[N++]=P>>>24&3,s[N++]=P>>>26&3,s[N++]=P>>>28&3,s[N]=P>>>30&3}(l,c,p,d);case 3:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0;s[N++]=R>>>0&7,s[N++]=R>>>3&7,s[N++]=R>>>6&7,s[N++]=R>>>9&7,s[N++]=R>>>12&7,s[N++]=R>>>15&7,s[N++]=R>>>18&7,s[N++]=R>>>21&7,s[N++]=R>>>24&7,s[N++]=R>>>27&7,s[N++]=7&(R>>>30|(1&P)<>>1&7,s[N++]=P>>>4&7,s[N++]=P>>>7&7,s[N++]=P>>>10&7,s[N++]=P>>>13&7,s[N++]=P>>>16&7,s[N++]=P>>>19&7,s[N++]=P>>>22&7,s[N++]=P>>>25&7,s[N++]=P>>>28&7,s[N++]=7&(P>>>31|(3&B)<>>2&7,s[N++]=B>>>5&7,s[N++]=B>>>8&7,s[N++]=B>>>11&7,s[N++]=B>>>14&7,s[N++]=B>>>17&7,s[N++]=B>>>20&7,s[N++]=B>>>23&7,s[N++]=B>>>26&7,s[N]=B>>>29&7}(l,c,p,d);case 4:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0;s[N++]=R>>>0&15,s[N++]=R>>>4&15,s[N++]=R>>>8&15,s[N++]=R>>>12&15,s[N++]=R>>>16&15,s[N++]=R>>>20&15,s[N++]=R>>>24&15,s[N++]=R>>>28&15,s[N++]=P>>>0&15,s[N++]=P>>>4&15,s[N++]=P>>>8&15,s[N++]=P>>>12&15,s[N++]=P>>>16&15,s[N++]=P>>>20&15,s[N++]=P>>>24&15,s[N++]=P>>>28&15,s[N++]=B>>>0&15,s[N++]=B>>>4&15,s[N++]=B>>>8&15,s[N++]=B>>>12&15,s[N++]=B>>>16&15,s[N++]=B>>>20&15,s[N++]=B>>>24&15,s[N++]=B>>>28&15,s[N++]=H>>>0&15,s[N++]=H>>>4&15,s[N++]=H>>>8&15,s[N++]=H>>>12&15,s[N++]=H>>>16&15,s[N++]=H>>>20&15,s[N++]=H>>>24&15,s[N]=H>>>28&15}(l,c,p,d);case 5:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0;s[N++]=R>>>0&31,s[N++]=R>>>5&31,s[N++]=R>>>10&31,s[N++]=R>>>15&31,s[N++]=R>>>20&31,s[N++]=R>>>25&31,s[N++]=31&(R>>>30|(7&P)<>>3&31,s[N++]=P>>>8&31,s[N++]=P>>>13&31,s[N++]=P>>>18&31,s[N++]=P>>>23&31,s[N++]=31&(P>>>28|(1&B)<>>1&31,s[N++]=B>>>6&31,s[N++]=B>>>11&31,s[N++]=B>>>16&31,s[N++]=B>>>21&31,s[N++]=B>>>26&31,s[N++]=31&(B>>>31|(15&H)<>>4&31,s[N++]=H>>>9&31,s[N++]=H>>>14&31,s[N++]=H>>>19&31,s[N++]=H>>>24&31,s[N++]=31&(H>>>29|(3&O)<>>2&31,s[N++]=O>>>7&31,s[N++]=O>>>12&31,s[N++]=O>>>17&31,s[N++]=O>>>22&31,s[N]=O>>>27&31}(l,c,p,d);case 6:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0;s[N++]=R>>>0&63,s[N++]=R>>>6&63,s[N++]=R>>>12&63,s[N++]=R>>>18&63,s[N++]=R>>>24&63,s[N++]=63&(R>>>30|(15&P)<>>4&63,s[N++]=P>>>10&63,s[N++]=P>>>16&63,s[N++]=P>>>22&63,s[N++]=63&(P>>>28|(3&B)<>>2&63,s[N++]=B>>>8&63,s[N++]=B>>>14&63,s[N++]=B>>>20&63,s[N++]=B>>>26&63,s[N++]=H>>>0&63,s[N++]=H>>>6&63,s[N++]=H>>>12&63,s[N++]=H>>>18&63,s[N++]=H>>>24&63,s[N++]=63&(H>>>30|(15&O)<>>4&63,s[N++]=O>>>10&63,s[N++]=O>>>16&63,s[N++]=O>>>22&63,s[N++]=63&(O>>>28|(3&M)<>>2&63,s[N++]=M>>>8&63,s[N++]=M>>>14&63,s[N++]=M>>>20&63,s[N]=M>>>26&63}(l,c,p,d);case 7:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0,Z=S[L+6]>>>0;s[N++]=R>>>0&127,s[N++]=R>>>7&127,s[N++]=R>>>14&127,s[N++]=R>>>21&127,s[N++]=127&(R>>>28|(7&P)<>>3&127,s[N++]=P>>>10&127,s[N++]=P>>>17&127,s[N++]=P>>>24&127,s[N++]=127&(P>>>31|(63&B)<>>6&127,s[N++]=B>>>13&127,s[N++]=B>>>20&127,s[N++]=127&(B>>>27|(3&H)<>>2&127,s[N++]=H>>>9&127,s[N++]=H>>>16&127,s[N++]=H>>>23&127,s[N++]=127&(H>>>30|(31&O)<>>5&127,s[N++]=O>>>12&127,s[N++]=O>>>19&127,s[N++]=127&(O>>>26|(1&M)<>>1&127,s[N++]=M>>>8&127,s[N++]=M>>>15&127,s[N++]=M>>>22&127,s[N++]=127&(M>>>29|(15&Z)<>>4&127,s[N++]=Z>>>11&127,s[N++]=Z>>>18&127,s[N]=Z>>>25&127}(l,c,p,d);case 8:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0,Z=S[L+6]>>>0,T=S[L+7]>>>0;s[N++]=R>>>0&255,s[N++]=R>>>8&255,s[N++]=R>>>16&255,s[N++]=R>>>24&255,s[N++]=P>>>0&255,s[N++]=P>>>8&255,s[N++]=P>>>16&255,s[N++]=P>>>24&255,s[N++]=B>>>0&255,s[N++]=B>>>8&255,s[N++]=B>>>16&255,s[N++]=B>>>24&255,s[N++]=H>>>0&255,s[N++]=H>>>8&255,s[N++]=H>>>16&255,s[N++]=H>>>24&255,s[N++]=O>>>0&255,s[N++]=O>>>8&255,s[N++]=O>>>16&255,s[N++]=O>>>24&255,s[N++]=M>>>0&255,s[N++]=M>>>8&255,s[N++]=M>>>16&255,s[N++]=M>>>24&255,s[N++]=Z>>>0&255,s[N++]=Z>>>8&255,s[N++]=Z>>>16&255,s[N++]=Z>>>24&255,s[N++]=T>>>0&255,s[N++]=T>>>8&255,s[N++]=T>>>16&255,s[N]=T>>>24&255}(l,c,p,d);case 9:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0,Z=S[L+6]>>>0,T=S[L+7]>>>0,j=S[L+8]>>>0;s[N++]=R>>>0&511,s[N++]=R>>>9&511,s[N++]=R>>>18&511,s[N++]=511&(R>>>27|(15&P)<>>4&511,s[N++]=P>>>13&511,s[N++]=P>>>22&511,s[N++]=511&(P>>>31|(255&B)<>>8&511,s[N++]=B>>>17&511,s[N++]=511&(B>>>26|(7&H)<>>3&511,s[N++]=H>>>12&511,s[N++]=H>>>21&511,s[N++]=511&(H>>>30|(127&O)<>>7&511,s[N++]=O>>>16&511,s[N++]=511&(O>>>25|(3&M)<>>2&511,s[N++]=M>>>11&511,s[N++]=M>>>20&511,s[N++]=511&(M>>>29|(63&Z)<>>6&511,s[N++]=Z>>>15&511,s[N++]=511&(Z>>>24|(1&T)<>>1&511,s[N++]=T>>>10&511,s[N++]=T>>>19&511,s[N++]=511&(T>>>28|(31&j)<>>5&511,s[N++]=j>>>14&511,s[N]=j>>>23&511}(l,c,p,d);case 10:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0,Z=S[L+6]>>>0,T=S[L+7]>>>0,j=S[L+8]>>>0,d1=S[L+9]>>>0;s[N++]=R>>>0&1023,s[N++]=R>>>10&1023,s[N++]=R>>>20&1023,s[N++]=1023&(R>>>30|(255&P)<>>8&1023,s[N++]=P>>>18&1023,s[N++]=1023&(P>>>28|(63&B)<>>6&1023,s[N++]=B>>>16&1023,s[N++]=1023&(B>>>26|(15&H)<>>4&1023,s[N++]=H>>>14&1023,s[N++]=1023&(H>>>24|(3&O)<>>2&1023,s[N++]=O>>>12&1023,s[N++]=O>>>22&1023,s[N++]=M>>>0&1023,s[N++]=M>>>10&1023,s[N++]=M>>>20&1023,s[N++]=1023&(M>>>30|(255&Z)<>>8&1023,s[N++]=Z>>>18&1023,s[N++]=1023&(Z>>>28|(63&T)<>>6&1023,s[N++]=T>>>16&1023,s[N++]=1023&(T>>>26|(15&j)<>>4&1023,s[N++]=j>>>14&1023,s[N++]=1023&(j>>>24|(3&d1)<>>2&1023,s[N++]=d1>>>12&1023,s[N]=d1>>>22&1023}(l,c,p,d);case 11:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0,Z=S[L+6]>>>0,T=S[L+7]>>>0,j=S[L+8]>>>0,d1=S[L+9]>>>0,m1=S[L+10]>>>0;s[N++]=R>>>0&2047,s[N++]=R>>>11&2047,s[N++]=2047&(R>>>22|(1&P)<>>1&2047,s[N++]=P>>>12&2047,s[N++]=2047&(P>>>23|(3&B)<>>2&2047,s[N++]=B>>>13&2047,s[N++]=2047&(B>>>24|(7&H)<>>3&2047,s[N++]=H>>>14&2047,s[N++]=2047&(H>>>25|(15&O)<>>4&2047,s[N++]=O>>>15&2047,s[N++]=2047&(O>>>26|(31&M)<>>5&2047,s[N++]=M>>>16&2047,s[N++]=2047&(M>>>27|(63&Z)<>>6&2047,s[N++]=Z>>>17&2047,s[N++]=2047&(Z>>>28|(127&T)<>>7&2047,s[N++]=T>>>18&2047,s[N++]=2047&(T>>>29|(255&j)<>>8&2047,s[N++]=j>>>19&2047,s[N++]=2047&(j>>>30|(511&d1)<>>9&2047,s[N++]=d1>>>20&2047,s[N++]=2047&(d1>>>31|(1023&m1)<>>10&2047,s[N]=m1>>>21&2047}(l,c,p,d);case 12:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0,Z=S[L+6]>>>0,T=S[L+7]>>>0,j=S[L+8]>>>0,d1=S[L+9]>>>0,m1=S[L+10]>>>0,v1=S[L+11]>>>0;s[N++]=R>>>0&4095,s[N++]=R>>>12&4095,s[N++]=4095&(R>>>24|(15&P)<>>4&4095,s[N++]=P>>>16&4095,s[N++]=4095&(P>>>28|(255&B)<>>8&4095,s[N++]=B>>>20&4095,s[N++]=H>>>0&4095,s[N++]=H>>>12&4095,s[N++]=4095&(H>>>24|(15&O)<>>4&4095,s[N++]=O>>>16&4095,s[N++]=4095&(O>>>28|(255&M)<>>8&4095,s[N++]=M>>>20&4095,s[N++]=Z>>>0&4095,s[N++]=Z>>>12&4095,s[N++]=4095&(Z>>>24|(15&T)<>>4&4095,s[N++]=T>>>16&4095,s[N++]=4095&(T>>>28|(255&j)<>>8&4095,s[N++]=j>>>20&4095,s[N++]=d1>>>0&4095,s[N++]=d1>>>12&4095,s[N++]=4095&(d1>>>24|(15&m1)<>>4&4095,s[N++]=m1>>>16&4095,s[N++]=4095&(m1>>>28|(255&v1)<>>8&4095,s[N]=v1>>>20&4095}(l,c,p,d);case 16:return void function(S,L,s,U){let N=U,R=S[L]>>>0,P=S[L+1]>>>0,B=S[L+2]>>>0,H=S[L+3]>>>0,O=S[L+4]>>>0,M=S[L+5]>>>0,Z=S[L+6]>>>0,T=S[L+7]>>>0,j=S[L+8]>>>0,d1=S[L+9]>>>0,m1=S[L+10]>>>0,v1=S[L+11]>>>0,n1=S[L+12]>>>0,w1=S[L+13]>>>0,S1=S[L+14]>>>0,y1=S[L+15]>>>0;s[N++]=R>>>0&65535,s[N++]=R>>>16&65535,s[N++]=P>>>0&65535,s[N++]=P>>>16&65535,s[N++]=B>>>0&65535,s[N++]=B>>>16&65535,s[N++]=H>>>0&65535,s[N++]=H>>>16&65535,s[N++]=O>>>0&65535,s[N++]=O>>>16&65535,s[N++]=M>>>0&65535,s[N++]=M>>>16&65535,s[N++]=Z>>>0&65535,s[N++]=Z>>>16&65535,s[N++]=T>>>0&65535,s[N++]=T>>>16&65535,s[N++]=j>>>0&65535,s[N++]=j>>>16&65535,s[N++]=d1>>>0&65535,s[N++]=d1>>>16&65535,s[N++]=m1>>>0&65535,s[N++]=m1>>>16&65535,s[N++]=v1>>>0&65535,s[N++]=v1>>>16&65535,s[N++]=n1>>>0&65535,s[N++]=n1>>>16&65535,s[N++]=w1>>>0&65535,s[N++]=w1>>>16&65535,s[N++]=S1>>>0&65535,s[N++]=S1>>>16&65535,s[N++]=y1>>>0&65535,s[N]=y1>>>16&65535}(l,c,p,d);case 32:for(let S=0;S>>0,y=c,w=0,C=l[y]>>>0;for(let S=0;S<32;S++)if(w+a>>w&h,w+=a,w===32&&(w=0,y++,S!==31&&(C=l[y]>>>0));else{let L=32-w,s=C>>>w;y++,C=l[y]>>>0,p[d+S]=(s|(C&mm[a-L]>>>0)<<L)&h,w=a-L}}function J0(l,c,p){let d=new Uint32Array(p),a=0,h=c.get();for(let y=0;y<d.length;y++){let w=l[h++],C=127&w;w<128||(w=l[h++],C|=(127&w)<<7,w<128||(w=l[h++],C|=(127&w)<<14,w<128||(w=l[h++],C|=(127&w)<<21,w<128||(w=l[h++],C|=(15&w)<<28)))),d[a++]=C}return c.set(h),d}function $r(l,c,p){let d=new BigUint64Array(p);for(let a=0;a<d.length;a++)d[a]=oE(l,c);return d}function oE(l,c){let p=0n,d=0,a=c.get();for(;a<l.length;){let h=l[a++];if(p|=BigInt(127&h)<=64)throw Error("Varint too long")}return c.set(a),p}function hE(l,c){let p,d;return d=l[c.get()],c.increment(),p=127&d,d<128?p:(d=l[c.get()],c.increment(),p|=(127&d)<<7,d<128?p:(d=l[c.get()],c.increment(),p|=(127&d)<<14,d<128?p:(d=l[c.get()],c.increment(),p|=(127&d)<<21,d<128?p:(d=l[c.get()],p|=(15&d)<>4,C>>0);if(C=h[y.get()],y.increment(),w|=(127&C)<<3,C>>0);if(C=h[y.get()],y.increment(),w|=(127&C)<<10,C>>0);if(C=h[y.get()],y.increment(),w|=(127&C)<<17,C>>0);if(C=h[y.get()],y.increment(),w|=(127&C)<<24,C>>0);if(C=h[y.get()],y.increment(),w|=(1&C)<<31,C>>0);throw Error("Expected varint not more than 10 bytes")}(p,l,c)))))}function Fl(l){return l>>>1^-(1&l)}function p2(l){return l>>1n^-(1n&l)}function _r(l){return l%2==1?(l+1)/-2:l/2}function am(l,c,p){if(p===void 0){p=0;for(let h=0;h<c;h++)p+=l[h]}let d=new Uint32Array(p),a=0;for(let h=0;h<c;h++){let y=l[h];d.fill(l[h+c],a,a+y),a+=y}return d}function om(l,c,p){if(p===void 0){p=0;for(let h=0;h<c;h++)p+=Number(l[h])}let d=new BigUint64Array(p),a=0;for(let h=0;h<c;h++){let y=Number(l[h]);d.fill(l[h+c],a,a+y),a+=y}return d}function Oo(l,c,p){let d=new Float64Array(p),a=0;for(let h=0;h=4)for(;d=4)for(;d=4)for(let d=l[0];p>4],w=null;switch(y){case B0.DATA:w={dictionaryType:Object.values(xu)[15&h]};break;case B0.OFFSET:w={offsetType:Object.values(Ac)[15&h]};break;case B0.LENGTH:w={lengthType:Object.values(Y2)[15&h]}}a.increment();let C=d[a.get()],S=Object.values(yl)[C>>5],L=Object.values(yl)[C>>2&7],s=Object.values(e3)[3&C];a.increment();let U=J0(d,a,2),N=U[0];return{physicalStreamType:y,logicalStreamType:w,logicalLevelTechnique1:S,logicalLevelTechnique2:L,physicalLevelTechnique:s,numValues:N,byteLength:U[1],decompressedCount:N}}(l,c);return p.logicalLevelTechnique1===yl.MORTON?function(d,a,h){let y=J0(a,h,2);return{physicalStreamType:d.physicalStreamType,logicalStreamType:d.logicalStreamType,logicalLevelTechnique1:d.logicalLevelTechnique1,logicalLevelTechnique2:d.logicalLevelTechnique2,physicalLevelTechnique:d.physicalLevelTechnique,numValues:d.numValues,byteLength:d.byteLength,decompressedCount:d.decompressedCount,numBits:y[0],coordinateShift:y[1]}}(p,l,c):yl.RLE!==p.logicalLevelTechnique1&&yl.RLE!==p.logicalLevelTechnique2||e3.NONE===p.physicalLevelTechnique?p:function(d,a,h){let y=J0(a,h,2);return{physicalStreamType:d.physicalStreamType,logicalStreamType:d.logicalStreamType,logicalLevelTechnique1:d.logicalLevelTechnique1,logicalLevelTechnique2:d.logicalLevelTechnique2,physicalLevelTechnique:d.physicalLevelTechnique,numValues:d.numValues,byteLength:d.byteLength,decompressedCount:y[1],runs:y[0],numRleValues:y[1]}}(p,l,c)}(function(l){l.PRESENT="PRESENT",l.DATA="DATA",l.OFFSET="OFFSET",l.LENGTH="LENGTH"})(B0||(B0={})),function(l){l.NONE="NONE",l.SINGLE="SINGLE",l.SHARED="SHARED",l.VERTEX="VERTEX",l.MORTON="MORTON",l.FSST="FSST"}(xu||(xu={})),function(l){l.VERTEX="VERTEX",l.INDEX="INDEX",l.STRING="STRING",l.KEY="KEY"}(Ac||(Ac={})),function(l){l.VAR_BINARY="VAR_BINARY",l.GEOMETRIES="GEOMETRIES",l.PARTS="PARTS",l.RINGS="RINGS",l.TRIANGLES="TRIANGLES",l.SYMBOL="SYMBOL",l.DICTIONARY="DICTIONARY"}(Y2||(Y2={})),function(l){l[l.FLAT=0]="FLAT",l[l.CONST=1]="CONST",l[l.SEQUENCE=2]="SEQUENCE",l[l.DICTIONARY=3]="DICTIONARY",l[l.FSST_DICTIONARY=4]="FSST_DICTIONARY"}(Ql||(Ql={}));class au{constructor(l,c){this.values=l,this._size=c}get(l){let c=Math.floor(l/8);return(this.values[c]>>l%8&1)==1}set(l,c){let p=Math.floor(l/8);this.values[p]=this.values[p]|(c?1:0)<>l%8&1}size(){return this._size}getBuffer(){return this.values}}function ir(l,c,p){if(!c)return l;let d=c.size(),a=new l.constructor(d),h=0;for(let y=0;y<d;y++)a[y]=c.get(y)?l[h++]:p;return a}function ym(l,c,p,d,a){return function(h,y,w,C){let S;switch(y.logicalLevelTechnique1){case yl.DELTA:if(y.logicalLevelTechnique2===yl.RLE){let L=y;if(!C)return function(s,U,N){let R=new Int32Array(N),P=0,B=0;for(let H=0;H<U;H++){let O=s[H],M=Fl(s[H+U]);for(let Z=0;Z<O;Z++)B+=M,R[P++]=B}return R}(h,L.runs,L.numRleValues);S=Zo(h=am(h,L.runs,L.numRleValues))}else S=Zo(h);break;case yl.RLE:S=function(L,s,U){if(U===void 0){U=0;for(let P=0;P<s;P++)U+=L[P]}let N=new Int32Array(U),R=0;for(let P=0;P<s;P++){let B=L[P],H=L[P+s];H=Fl(H),N.fill(H,R,R+B),R+=B}return N}(h,y.runs,y.numRleValues);break;case yl.MORTON:hm(h),S=new Int32Array(h);break;case yl.COMPONENTWISE_DELTA:S=function(L){if(L.length=4)for(;N<U-4;N+=4){let R=L[N+1],P=L[N+2],B=L[N+3];s[N]=Fl(L[N])+s[N-2],s[N+1]=Fl(R)+s[N-1],s[N+2]=Fl(P)+s[N],s[N+3]=Fl(B)+s[N+1]}for(;N!==L.length;N+=2)s[N]=Fl(L[N])+s[N-2],s[N+1]=Fl(L[N+1])+s[N-1];return s}(h);break;case yl.NONE:S=function(L){let s=new Int32Array(L.length);for(let U=0;U>>0;for(let U=1;U>>0;return s}(y.logicalLevelTechnique2===yl.RLE?am(h,y.runs,y.numRleValues):h);break;case yl.RLE:S=am(h,y.runs,y.numRleValues);break;case yl.MORTON:hm(h),S=h;break;case yl.COMPONENTWISE_DELTA:S=function(L){if(L.length>>0,s[1]=Fl(L[1])>>>0;for(let U=2;U>>0,s[U+1]=s[U-1]+Fl(L[U+1])>>>0;return s}(h);break;case yl.NONE:S=h;break;default:throw Error(`The specified Logical level technique is not supported: ${y.logicalLevelTechnique1}`)}return C?ir(S,C,0):S}(er(l,c,p),p,0,a)}function l4(l,c,p){return function(d,a){if(a.logicalLevelTechnique1===yl.DELTA&&a.logicalLevelTechnique2===yl.NONE)return function(h){let y=new Int32Array(h.length+1);y[0]=0,y[1]=Fl(h[0]);let w=y[1];for(let C=2;C!==y.length;++C)w+=Fl(h[C-1]),y[C]=y[C-1]+w;return new Uint32Array(y)}(d);if(a.logicalLevelTechnique1===yl.RLE&&a.logicalLevelTechnique2===yl.NONE)return function(h,y,w){let C=new Uint32Array(w+1);C[0]=0;let S=1,L=C[0];for(let s=0;s<y;s++){let U=h[s],N=h[s+y];for(let R=S;R<S+U;R++)C[R]=N+L,L=C[R];S+=U}return C}(d,a.runs,a.numRleValues);if(a.logicalLevelTechnique1===yl.NONE&&a.logicalLevelTechnique2===yl.NONE){(function(y){let w=0;for(let C=0;C<y.length;C++)y[C]+=w,w=y[C]})(d);let h=new Uint32Array(a.numValues+1);return h[0]=0,h.set(d,1),h}if(a.logicalLevelTechnique1===yl.DELTA&&a.logicalLevelTechnique2===yl.RLE){let h=function(y,w,C){let S=new Int32Array(C+1);S[0]=0;let L=1,s=S[0];for(let U=0;U<w;U++){let N=y[U],R=y[U+w];R=Fl(R);for(let P=L;P>>2,P=function(H,O){if(O<=H.encodedWords.length)return H.encodedWords;let M=new Uint32Array(Math.max(16,2*O));return H.encodedWords=M,M}(U,R);(function(H,O,M,Z){if(O<0||MH.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${O}, byteLength=${M}, bytes.length=${H.length})`);let T=Math.floor(M/4),j=M%4!=0,d1=j?T+1:T;if(Z.length<d1)throw RangeError(`decodeBigEndianInt32sInto: out.length=${Z.length} 0){let m1=H.byteOffset+O;if(3&m1)for(let v1=0;v1<T;v1++){let n1=O+4*v1;Z[v1]=H[n1]<<24|H[n1+1]<<16|H[n1+2]<<8|H[n1+3]}else{let v1=new Uint32Array(H.buffer,m1,T);for(let n1=0;n1<T;n1++)Z[n1]=0|pE(v1[n1])}}if(j){let m1=O+4*T,v1=M-4*T,n1=0;for(let w1=0;w1<v1;w1++)n1|=H[m1+w1]<0){let m1=0|H[Z];if(Z=Z+1|0,255&m1)throw Error(`FastPFOR decode: invalid alignedLength=${m1} (expected multiple of 256)`);if(T+m1>j.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${T}, alignedLength=${m1}, out.length=${j.length})`);Z=function(v1,n1,w1,S1,y1,s1){let K1=S1+gm(y1,t5),B1=S1,Y1=w1;for(;B1!==K1;){let Q1=Math.min(vm,K1-B1);Y1=vE(v1,n1,Y1,B1,Q1,s1),B1=B1+Q1|0}return Y1}(H,j,Z,T,m1,d1),T=T+m1|0}return function(m1,v1,n1,w1,S1,y1){if(y1===0)return v1;let s1=0,K1=v1,B1=v1+n1,Y1=S1,Q1=S1,i1=S1+y1,Vl=0,kl=0;for(;K1<B1&&Q1>>s1&255;if(s1+=8,K1+=s1>>>5,s1&=31,Vl|=(127&Ul)<28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${kl}, partial=${Vl}, decoded=${Q1-Y1}/${y1}, inPos=${K1}, inEnd=${B1})`)}if(Q1!==i1)throw Error(`FastPFOR VByte: truncated stream (decoded=${Q1-Y1}, expected=${y1}, consumedWords=${K1-v1}/${n1}, vbyteStart=${v1}, vbyteEnd=${B1})`)}(H,Z,H.length-Z|0,j,T,O-T|0),j}(P.subarray(0,R),S,U.decoderWorkspace);return s.add(L),B}(a,h,y,w,function(C=16){if(C= 0, got ${C}`);let S=Math.max(16,0|C);return{encodedWords:new Uint32Array(S),decoderWorkspace:Ko()}}(y>>>2))}(l,p.numValues,p.byteLength,c);case e3.VARINT:return J0(l,c,p.numValues);case e3.NONE:{let a=c.get();c.add(p.byteLength);let h=l.subarray(a,c.get());return new Uint32Array(h)}default:throw Error(`Specified physicalLevelTechnique ${d} is not supported (yet).`)}}function wm(l,c,p){let d=er(l,c,p);return d.length===1?d[0]:function(a){return a[1]}(d)}function Go(l,c,p){return function(d){if(d.length===2){let a=Fl(d[1]);return[a,a]}return[Fl(d[2]),Fl(d[3])]}(er(l,c,p))}function Xo(l,c,p){return function(d){if(d.length===2){let a=p2(d[1]);return[a,a]}return[p2(d[2]),p2(d[3])]}($r(l,c,p.numValues))}function Jo(l,c,p,d){return function(a,h,y){let w;switch(h.logicalLevelTechnique1){case yl.DELTA:w=function(C){let S=new BigUint64Array(C.length);S[0]=BigInt.asUintN(64,p2(C[0]));for(let L=1;L>1,c)-p}}function bo(l,c){let p=0;for(let d=0;d<c;d++)p|=(l&1<>d;return p}function tr(l,c,p,d,a,h,y){return l===t3.MORTON?function(w,C,S,L,s,U){let N=Array(s?L+1:L);for(let R=0;R<L;R++){let P=Sm(w[C[S+R]],U.numBits,U.coordinateShift);N[R]=new Q(P.x,P.y)}return s&&(N[N.length-1]=N[0]),N}(c,p,d,a,h,y):function(w,C,S,L,s){let U=Array(s?L+1:L);for(let N=0;N<2*L;N+=2){let R=2*C[S+N/2];U[N/2]=new Q(w[R],w[R+1])}return s&&(U[U.length-1]=U[0]),U}(c,p,d,a,h)}function l6(l,c,p,d){let a=Array(d?p+1:p);for(let h=0;h<2*p;h+=2)a[h/2]=new Q(l[c+h],l[c+h+1]);return d&&(a[a.length-1]=a[0]),a}(function(l){l[l.POINT=0]="POINT",l[l.LINESTRING=1]="LINESTRING",l[l.POLYGON=2]="POLYGON",l[l.MULTIPOINT=3]="MULTIPOINT",l[l.MULTILINESTRING=4]="MULTILINESTRING",l[l.MULTIPOLYGON=5]="MULTIPOLYGON"})(E0||(E0={})),function(l){l[l.POINT=0]="POINT",l[l.LINESTRING=1]="LINESTRING",l[l.POLYGON=2]="POLYGON"}(To||(To={})),function(l){l[l.MORTON=0]="MORTON",l[l.VEC_2=1]="VEC_2",l[l.VEC_3=2]="VEC_3"}(t3||(t3={}));class Em{constructor(l,c,p,d,a){this._vertexBufferType=l,this._topologyVector=c,this._vertexOffsets=p,this._vertexBuffer=d,this._mortonSettings=a}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(l){let c=this.vertexOffsets?2*this.vertexOffsets[l]:2*l;return[this.vertexBuffer[c],this.vertexBuffer[c+1]]}getVertex(l){if(this.vertexOffsets&&this.mortonSettings){let p=Sm(this.vertexBuffer[this.vertexOffsets[l]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[p.x,p.y]}let c=this.vertexOffsets?2*this.vertexOffsets[l]:2*l;return[this.vertexBuffer[c],this.vertexBuffer[c+1]]}getGeometries(){return function(l){let c=Array(l.numGeometries),p=1,d=1,a=1,h=0,y=0,w=0,C=l.mortonSettings,S=l.topologyVector,L=S.geometryOffsets,s=S.partOffsets,U=S.ringOffsets,N=l.vertexOffsets,R=!N||N.length===0,P=l.containsPolygonGeometry(),B=l.vertexBuffer;for(let H=0;H<l.numGeometries;H++)switch(l.geometryType(H)){case E0.POINT:{let O,M;if(R)O=B[y++],M=B[y++];else if(l.vertexBufferType===t3.MORTON){let Z=Sm(B[N[w++]],C.numBits,C.coordinateShift);O=Z.x,M=Z.y}else{let Z=2*N[w++];O=B[Z],M=B[Z+1]}c[h++]=[[new Q(O,M)]],L&&a++,s&&p++,U&&d++}break;case E0.MULTIPOINT:{let O=L[a]-L[a-1];a++;let M=Array(O);if(R)for(let Z=0;Z<O;Z++){let T=B[y++],j=B[y++];M[Z]=new Q(T,j)}else for(let Z=0;Z[Z]),p+=O,d+=O}break;case E0.LINESTRING:{let O,M;P?(O=U[d]-U[d-1],d++):O=s[p]-s[p-1],p++,R?(M=l6(B,y,O,!1),y+=2*O):(M=tr(l.vertexBufferType,B,N,w,O,!1,C),w+=O),c[h++]=[M],L&&a++}break;case E0.POLYGON:{let O=s[p]-s[p-1];p++;let M=Array(O-1),Z,T=U[d]-U[d-1];if(d++,R){Z=l6(B,y,T,!0),y+=2*T;for(let j=0;j<M.length;j++)T=U[d]-U[d-1],d++,M[j]=l6(B,y,T,!0),y+=2*T}else{Z=tr(l.vertexBufferType,B,N,w,T,!0,C),w+=T;for(let j=0;j<M.length;j++)T=U[d]-U[d-1],d++,M[j]=tr(l.vertexBufferType,B,N,w,T,!0,C),w+=T}c[h++]=[Z].concat(M),L&&a++}break;case E0.MULTILINESTRING:{let O=L[a]-L[a-1];a++;let M=Array(O);for(let Z=0;Z<O;Z++){let T;if(P?(T=U[d]-U[d-1],d++):T=s[p]-s[p-1],p++,R)M[Z]=l6(B,y,T,!1),y+=2*T;else{let j=tr(l.vertexBufferType,B,N,w,T,!1,C);M[Z]=j,w+=T}}c[h++]=M}break;case E0.MULTIPOLYGON:{let O=L[a]-L[a-1];a++;let M=Array(O);for(let Z=0;Z<O;Z++){let T=s[p]-s[p-1],j;p++;let d1=Array(T-1),m1=U[d]-U[d-1];d++,R?(j=l6(B,y,m1,!0),y+=2*m1):(j=tr(l.vertexBufferType,B,N,w,m1,!0,C),w+=m1);for(let v1=0;v1<d1.length;v1++){let n1=U[d]-U[d-1];d++,R?(d1[v1]=l6(B,y,n1,!0),y+=2*n1):(d1[v1]=tr(l.vertexBufferType,B,N,w,n1,!0,C),w+=n1)}M[Z]=[j].concat(d1)}c[h++]=M.flat()}break;default:throw Error("The specified geometry type is currently not supported.")}return c}(this)}get mortonSettings(){return this._mortonSettings}}class sm extends Em{constructor(l,c,p,d,a,h,y){super(p,d,a,h,y),this._numGeometries=l,this._geometryType=c}geometryType(l){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===E0.POLYGON||this._geometryType===E0.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class Cm extends Em{constructor(l,c,p,d,a,h){super(l,p,d,a,h),this._geometryTypes=c}geometryType(l){return this._geometryTypes[l]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let l=0;l<this.numGeometries;l++)if(this.geometryType(l)===E0.POLYGON||this.geometryType(l)===E0.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class Wm{constructor(l,c,p,d){this._triangleOffsets=l,this._indexBuffer=c,this._vertexBuffer=p,this._topologyVector=d}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let l=Array(this.numGeometries),c=this._topologyVector,p=c.partOffsets,d=c.ringOffsets,a=c.geometryOffsets,h=0,y=1,w=1,C=1;for(let S=0;S<this.numGeometries;S++)switch(this.geometryType(S)){case E0.POLYGON:{let L=p[y]-p[y-1];y++;let s=[];for(let U=0;U<L;U++){let N=d[w]-d[w-1];w++;let R=[];for(let P=0;P0&&R.push(R[0]),s.push(R)}l[S]=s,a&&C++}break;case E0.MULTIPOLYGON:{let L=a[C]-a[C-1];C++;let s=[];for(let U=0;U<L;U++){let N=p[y]-p[y-1];y++;for(let R=0;R<N;R++){let P=d[w]-d[w-1];w++;let B=[];for(let H=0;H
0&&B.push(B[0]),s.push(B)}}l[S]=s}}return l}[Symbol.iterator](){return null}}function $o(l,c,p,d,a,h){return new _o(l,c,p,d,a,h)}class _o extends Wm{constructor(l,c,p,d,a,h){super(p,d,a,h),this._numGeometries=l,this._geometryType=c}geometryType(l){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function io(l,c,p,d,a){return new eo(l,c,p,d,a)}class eo extends Wm{constructor(l,c,p,d,a){super(c,p,d,a),this._geometryTypes=l}geometryType(l){return this._geometryTypes[l]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function yE(l,c,p,d,a){let h=f2(l,p),y,w,C,S;if(Ip(h,d,l,p)===Ql.CONST){let O=wm(l,p,h),M,Z,T,j;for(let d1=0;d1<c-1;d1++){let m1=f2(l,p);switch(m1.physicalStreamType){case B0.LENGTH:switch(m1.logicalStreamType.lengthType){case Y2.GEOMETRIES:M=l4(l,p,m1);break;case Y2.PARTS:Z=l4(l,p,m1);break;case Y2.RINGS:T=l4(l,p,m1);break;case Y2.TRIANGLES:j=l4(l,p,m1)}break;case B0.OFFSET:switch(m1.logicalStreamType.offsetType){case Ac.VERTEX:y=B2(l,p,m1);break;case Ac.INDEX:S=B2(l,p,m1)}break;case B0.DATA:xu.VERTEX===m1.logicalStreamType.dictionaryType?w=ym(l,p,m1):(C={numBits:m1.numBits,coordinateShift:m1.coordinateShift},w=B2(l,p,m1))}}return S?M!==void 0||Z!==void 0?$o(d,O,j,S,w,{geometryOffsets:M,partOffsets:Z,ringOffsets:T}):$o(d,O,j,S,w):C===void 0?function(d1,m1,v1,n1,w1){return new sm(d1,m1,t3.VEC_2,v1,n1,w1)}(d,O,{geometryOffsets:M,partOffsets:Z,ringOffsets:T},y,w):function(d1,m1,v1,n1,w1,S1){return new sm(d1,m1,t3.MORTON,v1,n1,w1,S1)}(d,O,{geometryOffsets:M,partOffsets:Z,ringOffsets:T},y,w,C)}let L=B2(l,p,h),s,U,N,R,P,B,H;for(let O=0;O<c-1;O++){let M=f2(l,p);switch(M.physicalStreamType){case B0.LENGTH:switch(M.logicalStreamType.lengthType){case Y2.GEOMETRIES:s=B2(l,p,M);break;case Y2.PARTS:U=B2(l,p,M);break;case Y2.RINGS:N=B2(l,p,M);break;case Y2.TRIANGLES:R=l4(l,p,M)}break;case B0.OFFSET:switch(M.logicalStreamType.offsetType){case Ac.VERTEX:y=B2(l,p,M);break;case Ac.INDEX:S=B2(l,p,M)}break;case B0.DATA:xu.VERTEX===M.logicalStreamType.dictionaryType?w=ym(l,p,M):(C={numBits:M.numBits,coordinateShift:M.coordinateShift},w=B2(l,p,M))}}return s?(P=Lm(L,s,2),U&&N?(B=to(L,P,U,!1),H=function(O,M,Z,T){let j=new Uint32Array(Z[Z.length-1]+1),d1=0;j[0]=d1;let m1=1,v1=1,n1=0;for(let w1=0;w1<O.length;w1++){let S1=O[w1],y1=M[w1+1]-M[w1];if(S1!==0&&S1!==3)for(let s1=0;s1<y1;s1++){let K1=Z[m1]-Z[m1-1];m1++;for(let B1=0;B1<K1;B1++)d1=j[v1++]=d1+T[n1++]}else for(let s1=0;s1<y1;s1++)j[v1++]=++d1,m1++}return j}(L,P,B,N)):U&&(B=function(O,M,Z){let T=new Uint32Array(M[M.length-1]+1),j=0;T[0]=j;let d1=1,m1=0;for(let v1=0;v1<O.length;v1++){let n1=O[v1],w1=M[v1+1]-M[v1];if(n1===4||n1===1)for(let S1=0;S1<w1;S1++)j=T[d1++]=j+Z[m1++];else for(let S1=0;S1<w1;S1++)T[d1++]=++j}return T}(L,P,U))):U&&N?(B=Lm(L,U,1),H=to(L,B,N,!0)):U&&(B=Lm(L,U,0)),S&&!B?io(L,R,S,w):S?io(L,R,S,w,{geometryOffsets:P,partOffsets:B,ringOffsets:H}):C===void 0?function(O,M,Z,T){return new Cm(t3.VEC_2,O,M,Z,T)}(L,{geometryOffsets:P,partOffsets:B,ringOffsets:H},y,w):function(O,M,Z,T,j){return new Cm(t3.MORTON,O,M,Z,T,j)}(L,{geometryOffsets:P,partOffsets:B,ringOffsets:H},y,w,C)}function Lm(l,c,p){let d=new Uint32Array(l.length+1),a=0;d[0]=a;let h=0;for(let y=0;yp?c[h++]:1);return d}function to(l,c,p,d){let a=new Uint32Array(c[c.length-1]+1),h=0;a[0]=h;let y=1,w=0;for(let C=0;C<l.length;C++){let S=l[C],L=c[C+1]-c[C];if(S===5||S===2||d&&(S===4||S===1))for(let s=0;s<L;s++)h=a[y++]=h+p[w++];else for(let s=0;s<L;s++)a[y++]=++h}return a}class lh extends Lc{constructor(l,c,p){super(l,c.getBuffer(),p),this.dataVector=c}getValueFromBuffer(l){return this.dataVector.get(l)}}class uh extends v8{getValueFromBuffer(l){return this.dataBuffer[l]}}class Am extends Lc{constructor(l,c,p,d){super(l,d?BigInt64Array.of(c):BigUint64Array.of(c),p)}getValueFromBuffer(l){return this.dataBuffer[0]}}function a8(l,c,p,d,a){let h=function(y,w,C,S){let L=new Uint8Array(w),s=0,U=S.get()+C;for(;s=U);){let N=y[S.increment()];if(N<=127){let R=N+3,P=y[S.increment()],B=Math.min(s+R,w);L.fill(P,s,B),s=B}else{let R=256-N;for(let P=0;P<R&&s<w;P++)L[s++]=y[S.increment()]}}return S.set(U),L}(l,Math.ceil(c/8),p,d);return a?function(y,w,C){if(!C)return y;let S=C.size(),L=new au(y,w),s=new au(new Uint8Array(Math.ceil(S/8)),S),U=0;for(let N=0;N
=12?wE.decode(l.subarray(c,p)):function(d,a,h){let y="",w=a;for(;w239?4:C>223?3:C>191?2:1;if(w+N>h)break;N===1?C<128&&(U=C):N===2?(S=d[w+1],(192&S)==128&&(U=(31&C)<<6|63&S,U<=127&&(U=null))):N===3?(S=d[w+1],L=d[w+2],(192&S)==128&&(192&L)==128&&(U=(15&C)<<12|(63&S)<<6|63&L,(U=55296&&U<=57343)&&(U=null))):N===4&&(S=d[w+1],L=d[w+2],s=d[w+3],(192&S)==128&&(192&L)==128&&(192&s)==128&&(U=(15&C)<<18|(63&S)<<12|(63&L)<<6|63&s,(U=1114112)&&(U=null))),U===null?(U=65533,N=1):U>65535&&(U-=65536,y+=String.fromCharCode(U>>>10&1023|55296),U=56320|1023&U),y+=String.fromCharCode(U),w+=N}return y}(l,c,p)}class Yp extends Lc{constructor(l,c,p,d){super(l,p,d),this.offsetBuffer=c}}class Nm extends Yp{constructor(l,c,p,d){super(l,c,p,d??c.length-1)}getValueFromBuffer(l){return Vm(this.dataBuffer,this.offsetBuffer[l],this.offsetBuffer[l+1])}}class Vc extends Yp{constructor(l,c,p,d,a){super(l,p,d,a??c.length),this.indexBuffer=c,this.indexBuffer=c}getValueFromBuffer(l){let c=this.indexBuffer[l];return Vm(this.dataBuffer,this.offsetBuffer[c],this.offsetBuffer[c+1])}}class qm extends Yp{constructor(l,c,p,d,a,h,y){super(l,p,d,y),this.indexBuffer=c,this.symbolOffsetBuffer=a,this.symbolTableBuffer=h}getValueFromBuffer(l){this.decodedDictionary==null&&(this.symbolLengthBuffer==null&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=function(p,d,a){let h=[],y=Array(d.length).fill(0);for(let w=1;w<d.length;w++)y[w]=y[w-1]+d[w-1];for(let w=0;w<a.length;w++)if(a[w]===255)h.push(a[++w]);else{let C=d[a[w]],S=y[a[w]];for(let L=0;L<C;L++)h.push(p[S+L])}return new Uint8Array(h)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let c=this.indexBuffer[l];return Vm(this.decodedDictionary,this.offsetBuffer[c],this.offsetBuffer[c+1])}offsetToLengthBuffer(l){let c=new Uint32Array(l.length-1),p=l[0];for(let d=1;d<l.length;d++){let a=l[d];c[d-1]=a-p,p=a}return c}}function nE(l,c,p,d,a,h){return p.type==="scalarType"?function(y,w,C,S,L,s){let U=null;if(y===0)return null;if(s.nullable){let R=f2(w,C),P=R.numValues,B=C.get(),H=a8(w,P,R.byteLength,C);C.set(B+R.byteLength),U=new au(H,R.numValues)}let N=U??S;switch(L.physicalType){case 4:case 3:return function(R,P,B,H,O){let M=f2(R,P),Z=Ip(M,O,R,P),T=H.physicalType===3;if(Z===Ql.FLAT){let d1=o8(O)?O:void 0,m1=T?ym(R,P,M,0,d1):B2(R,P,M,0,d1);return new Up(B.name,m1,O)}if(Z===Ql.SEQUENCE){let d1=Go(R,P,M);return new Pp(B.name,d1[0],d1[1],M.numRleValues)}let j=T?function(d1,m1,v1){let n1=er(d1,m1,v1);return n1.length===1?Fl(n1[0]):function(w1){return Fl(w1[1])}(n1)}(R,P,M):wm(R,P,M);return new Rp(B.name,j,O,T)}(w,C,s,L,N);case 9:return function(R,P,B,H,O){let M=null,Z=null,T=null,j=null,d1=null,m1=O??null,v1=null,n1=null;for(let w1=0;w1<H;w1++){let S1=f2(P,B);switch(S1.physicalStreamType){case B0.PRESENT:{let y1=a8(P,S1.numValues,S1.byteLength,B),s1=new au(y1,S1.numValues);m1=O??s1;break}case B0.OFFSET:Z=B2(P,B,S1,0,m1);break;case B0.LENGTH:{let y1=l4(P,B,S1);Y2.DICTIONARY===S1.logicalStreamType.lengthType?M=y1:Y2.SYMBOL===S1.logicalStreamType.lengthType?j=y1:v1=y1;break}case B0.DATA:{let y1=P.subarray(B.get(),B.get()+S1.byteLength);B.add(S1.byteLength);let s1=S1.logicalStreamType.dictionaryType;xu.FSST===s1?d1=y1:xu.SINGLE===s1||xu.SHARED===s1?T=y1:xu.NONE===s1&&(n1=y1);break}}}return function(w1,S1,y1,s1,K1,B1,Y1){return S1?new qm(w1,y1,s1,K1,B1,S1,Y1):null}(R,d1,Z,M,T,j,m1)??function(w1,S1,y1,s1,K1){return S1?K1?new Vc(w1,y1,s1,S1,K1):new Vc(w1,y1,s1,S1):null}(R,T,Z,M,m1)??function(w1,S1,y1,s1,K1){if(!S1||!y1)return null;if(s1)return K1?new Vc(w1,s1,S1,y1,K1):new Vc(w1,s1,S1,y1);if(K1&&K1.size()!==S1.length-1){let B1=new Uint32Array(K1.size()),Y1=0;for(let Q1=0;Q1<K1.size();Q1++)B1[Q1]=K1.get(Q1)?Y1++:0;return new Vc(w1,B1,S1,y1,K1)}return K1?new Nm(w1,S1,y1,K1):new Nm(w1,S1,y1)}(R,v1,n1,Z,m1)}(s.name,w,C,s.nullable?y-1:y,U);case 0:return function(R,P,B,H,O){let M=f2(R,P),Z=M.numValues,T=P.get(),j=o8(O)?O:void 0,d1=a8(R,Z,M.byteLength,P,j);P.set(T+M.byteLength);let m1=new au(d1,Z);return new lh(B.name,m1,O)}(w,C,s,0,N);case 6:case 5:return function(R,P,B,H,O){let M=f2(R,P),Z=Ip(M,H,R,P,"int64"),T=O.physicalType===5;if(Z===Ql.FLAT){let d1=o8(H)?H:void 0,m1=T?function(v1,n1,w1,S1){return function(y1,s1,K1){let B1;switch(s1.logicalLevelTechnique1){case yl.DELTA:if(s1.logicalLevelTechnique2===yl.RLE){let Y1=s1;if(!K1)return function(Q1,i1,Vl){let kl=new BigInt64Array(Vl),Ul=0,Q0=0n;for(let Jl=0;Jl<i1;Jl++){let f0=Number(Q1[Jl]),q0=p2(Q1[Jl+i1]);for(let Hl=0;Hl<f0;Hl++)Q0+=q0,kl[Ul++]=Q0}return kl}(y1,Y1.runs,Y1.numRleValues);B1=Do(y1=om(y1,Y1.runs,Y1.numRleValues))}else B1=Do(y1);break;case yl.RLE:B1=function(Y1,Q1,i1){if(i1===void 0){i1=0;for(let Ul=0;Ul<Q1;Ul++)i1+=Number(Y1[Ul])}let Vl=new BigInt64Array(i1),kl=0;for(let Ul=0;Ul<Q1;Ul++){let Q0=Number(Y1[Ul]),Jl=Y1[Ul+Q1];Jl=p2(Jl),Vl.fill(Jl,kl,kl+Q0),kl+=Q0}return Vl}(y1,s1.runs,s1.numRleValues);break;case yl.NONE:B1=function(Y1){let Q1=new BigInt64Array(Y1.length);for(let i1=0;i1=10}function ph(l){return l===30}function kE(l){if(l.type==="scalarType"){let c=l.scalarType;if(c.type==="physicalType")switch(c.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if(c.type==="logicalType")return!1}else if(l.type==="complexType"){let c=l.complexType;if(c.type==="physicalType")switch(c.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",l),!1}function SE(l){return l.type==="complexType"&&l.complexType?.type==="physicalType"&&l.complexType.physicalType===0}let EE=new TextDecoder;function Fm(l,c){let p=J0(l,c,1)[0];if(p===0)return"";let d=c.get(),a=l.subarray(d,d+p);return c.add(p),EE.decode(a)}function fh(l,c){let p=J0(l,c,1)[0]>>>0;if(p30)throw Error(`Unsupported field type code ${p}. Supported: 10-29(scalars), 30(STRUCT)`);let d=ch(p);if(rh(p)&&(d.name=Fm(l,c)),ph(p)){let a=J0(l,c,1)[0]>>>0;d.complexType.children=Array(a);for(let h=0;h>>0,d=ch(p);if(!d)throw Error(`Unsupported column type code ${p}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(rh(p)?d.name=Fm(l,c):p>=0&&p>>0,h=d.complexType;h.children=Array(a);for(let y=0;y>>0,h=J0(l,c,1)[0]>>>0;d.columns=Array(h);for(let y=0;y<h;y++)d.columns[y]=sE(l,c);return p.featureTables.push(d),[p,a]}function WE(l,c,p,d,a,h,y=!1){let w=c.scalarType;if(!w||w.type!=="logicalType"||w.logicalType!==0)throw Error(`ID column must be a logical ID scalar type: ${d}`);let C=w.longID?6:4,S=typeof h=="number"?void 0:h,L=Ip(a,h,l,p,C===6?"int64":"int32");if(C===4)switch(L){case Ql.FLAT:{let s=B2(l,p,a,0,S);return new Up(d,s,h)}case Ql.SEQUENCE:{let s=Go(l,p,a);return new Pp(d,s[0],s[1],a.numRleValues)}case Ql.CONST:{let s=wm(l,p,a);return new Rp(d,s,h,!1)}}switch(L){case Ql.FLAT:{if(y){let U=function(N,R,P){let B=function(H,O,M){let Z=new Float64Array(M);for(let T=0;T=4)for(;T<Z-4;T+=4){let j=M[T+1],d1=M[T+2],m1=M[T+3];M[T]=_r(M[T])+M[T-1],M[T+1]=_r(j)+M[T],M[T+2]=_r(d1)+M[T+1],M[T+3]=_r(m1)+M[T+2]}for(;T!==M.length;++T)M[T]=_r(M[T])+M[T-1]}(H),H;case yl.RLE:return function(M,Z){return Oo(M,Z.runs,Z.numRleValues)}(H,O);case yl.NONE:return H;default:throw Error(`The specified Logical level technique is not supported: ${O.logicalLevelTechnique1}`)}}(B,P)}(l,p,a);return new xp(d,U,h)}let s=Jo(l,p,a,S);return new nm(d,s,h)}case Ql.SEQUENCE:{let s=Xo(l,p,a);return new km(d,s[0],s[1],a.numRleValues)}case Ql.CONST:{let s=jo(l,p,a);return new Am(d,s,h,!1)}}throw Error("Vector type not supported for id column.")}class dh{constructor(l,c){var p;switch(this._featureData=l,this.properties=this._featureData.properties||{},(p=this._featureData.geometry)===null||p===void 0?void 0:p.type){case E0.POINT:case E0.MULTIPOINT:this.type=1;break;case E0.LINESTRING:case E0.MULTILINESTRING:this.type=2;break;case E0.POLYGON:case E0.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=c,this.id=Number(this._featureData.id)}loadGeometry(){let l=[];for(let c of this._featureData.geometry.coordinates){let p=[];for(let d of c)p.push(new Q(d.x,d.y));l.push(p)}return l}}class mh{constructor(l){this.features=[],this.featureTable=l,this.name=l.name,this.extent=l.extent,this.version=2,this.features=l.getFeatures(),this.length=this.features.length}feature(l){return new dh(this.features[l],this.extent)}}class Um{constructor(l){this.layers={};let c=function(p,d,a=!0){let h=new fm(0),y=[];for(;h.get()>>0,S=h.get()+C;if(S>p.length)throw Error(`Block overruns tile: ${S} > ${p.length}`);if(J0(p,h,1)[0]>>>0!=1){h.set(S);continue}let[L,s]=CE(p,h),U=L.featureTables[0],N=null,R=null,P=[],B=0;for(let O of U.columns){let M=O.name;if((w=O).type==="scalarType"&&w.scalarType?.type==="logicalType"&&w.scalarType.logicalType===0){let Z=null;if(O.nullable){let j=f2(p,h),d1=h.get(),m1=a8(p,j.numValues,j.byteLength,h);h.set(d1+j.byteLength),Z=new au(m1,j.numValues)}let T=f2(p,h);B=Z?Z.size():T.decompressedCount,N=WE(p,O,h,M,T,Z??B,a)}else if(SE(O)){let Z=J0(p,h,1)[0];if(B===0){let T=h.get();B=f2(p,h).decompressedCount,h.set(T)}R=yE(p,Z,h,B)}else{let Z=kE(O)?J0(p,h,1)[0]:1;if(Z===0)continue;let T=nE(p,h,O,Z,B);if(T)if(Array.isArray(T))for(let j of T)P.push(j);else P.push(T)}}let H=new Mo(U.name,R,N,P,s);y.push(H),h.set(S)}var w;return y}(new Uint8Array(l));this.layers=c.reduce((p,d)=>Object.assign(Object.assign({},p),{[d.name]:new mh(d)}),{})}}class gh{constructor(l,c){this.feature=l,this.type=l.type,this.properties=l.tags?l.tags:{},this.extent=c,"id"in l&&(typeof l.id=="string"?this.id=parseInt(l.id,10):typeof l.id!="number"||isNaN(l.id)||(this.id=l.id))}loadGeometry(){let l=[],c=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let p of c){let d=[];for(let a of p)d.push(new Q(a[0],a[1]));l.push(d)}return l}}let h8="_geojsonTileLayer";function LE(l,c,p=""){c.writeVarintField(15,l.version||1),c.writeStringField(1,l.name||""),c.writeVarintField(5,l.extent||4096);let d={jsonPrefix:p,keys:[],values:[],keycache:{},valuecache:{}};for(let y=0;y<l.length;y++)d.feature=l.feature(y),c.writeMessage(2,AE,d);let a=d.keys;for(let y of a)c.writeStringField(3,y);let h=d.values;for(let y of h)c.writeMessage(4,qE,y)}function AE(l,c){if(!l.feature)return;let p=l.feature;p.id!==void 0&&c.writeVarintField(1,p.id),c.writeMessage(2,VE,l),c.writeVarintField(3,p.type),c.writeMessage(4,NE,p)}function VE(l,c){for(let p in l.feature?.properties){let d=l.feature.properties[p],a=l.keycache[p];if(d==null)continue;a===void 0&&(l.keys.push(p),a=l.keys.length-1,l.keycache[p]=a),c.writeVarint(a),typeof d!="string"&&typeof d!="boolean"&&typeof d!="number"&&(d=l.jsonPrefix+JSON.stringify(d));let h=typeof d+":"+d,y=l.valuecache[h];y===void 0&&(l.values.push(d),y=l.values.length-1,l.valuecache[h]=y),c.writeVarint(y)}}function xm(l,c){return(c<<3)+(7&l)}function vh(l){return l<>31}function NE(l,c){let p=l.loadGeometry(),d=l.type,a=0,h=0;for(let y of p){let w=1;d===1&&(w=y.length),c.writeVarint(xm(1,w));let C=d===3?y.length-1:y.length;for(let S=0;S<C;S++){S===1&&d!==1&&c.writeVarint(xm(2,C-1));let L=y[S].x-a,s=y[S].y-h;c.writeVarint(vh(L)),c.writeVarint(vh(s)),a+=L,h+=s}l.type===3&&c.writeVarint(xm(7,1))}}function qE(l,c){let p=typeof l;p==="string"?c.writeStringField(1,l):p==="boolean"?c.writeBooleanField(7,l):p==="number"&&(l%1!=0?c.writeDoubleField(3,l):l<0?c.writeSVarintField(6,l):c.writeVarintField(5,l))}class Pm{constructor(l,c){this.tileID=l,this.x=l.canonical.x,this.y=l.canonical.y,this.z=l.canonical.z,this.grid=new uu(ul,16,0),this.grid3D=new uu(ul,16,0),this.featureIndexArray=new D,this.promoteId=c}insert(l,c,p,d,a,h){let y=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(p,d,a);let w=h?this.grid3D:this.grid;for(let C of c){let S=[1/0,1/0,-1/0,-1/0];for(let L of C)S[0]=Math.min(S[0],L.x),S[1]=Math.min(S[1],L.y),S[2]=Math.max(S[2],L.x),S[3]=Math.max(S[3],L.y);S[0]<ul&&S[1]
=0&&S[3]>=0&&w.insert(y,S[0],S[1],S[2],S[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding!=="mlt"?new Pd(new m8(this.rawTileData)).layers:new Um(this.rawTileData).layers,this.sourceLayerCoder=new cm(this.vtLayers?Object.keys(this.vtLayers).sort():[h8])),this.vtLayers}query(l,c,p,d){this.loadVTLayers();let a=l.params,h=ul/l.tileSize/l.scale,y=t4(a.filter,a.globalState),w=l.queryGeometry,C=l.queryPadding*h,S=Wc.fromPoints(w),L=this.grid.query(S.minX-C,S.minY-C,S.maxX+C,S.maxY+C),s=Wc.fromPoints(l.cameraQueryGeometry).expandBy(C),U=this.grid3D.query(s.minX,s.minY,s.maxX,s.maxY,(P,B,H,O)=>function(M,Z,T,j,d1){for(let v1 of M)if(Z<=v1.x&&T=v1.x&&d1>=v1.y)return!0;let m1=[new Q(Z,T),new Q(Z,d1),new Q(j,d1),new Q(j,T)];if(M.length>2){for(let v1 of m1)if(Mr(M,v1))return!0}for(let v1=0;v1(H||(H=o5(O)),M.queryIntersectsFeature({queryGeometry:w,feature:O,featureState:Z,geometry:H,zoom:this.z,transform:l.transform,pixelsToTileUnits:h,pixelPosMatrix:l.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:l.getElevation})))}return N}loadMatchingFeature(l,c,p,d,a,h,y,w,C,S,L){let s=this.bucketLayerIDs[c];if(h&&!s.some((P)=>h.has(P)))return;let U=this.sourceLayerCoder.decode(p),N=this.vtLayers[U].feature(d);if(a.needGeometry){let P=h5(N,!0);if(!a.filter(new ql(this.tileID.overscaledZ),P,this.tileID.canonical))return}else if(!a.filter(new ql(this.tileID.overscaledZ),N))return;let R=this.getId(N,U);for(let P of s){if(h&&!h.has(P))continue;let B=w[P];if(!B)continue;let H={};R&&S&&(H=S.getState(B.sourceLayer||h8,R));let O=h2({},C[P]);O.paint=ah(O.paint,B.paint,N,H,y),O.layout=ah(O.layout,B.layout,N,H,y);let M=!L||L(N,B,H);if(!M)continue;let Z=new rm(N,this.z,this.x,this.y,R);Z.layer=O;let T=l[P];T===void 0&&(T=l[P]=[]),T.push({featureIndex:d,feature:Z,intersectionZ:M})}}lookupSymbolFeatures(l,c,p,d,a,h,y,w){let C={};this.loadVTLayers();let S=t4(a.filterSpec,a.globalState);for(let L of l)this.loadMatchingFeature(C,p,d,L,S,h,y,w,c);return C}hasLayer(l){for(let c of this.bucketLayerIDs)for(let p of c)if(l===p)return!0;return!1}getId(l,c){var p;let d=l.id;return this.promoteId&&(d=l.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[c]],typeof d=="boolean"&&(d=Number(d)),d===void 0&&((p=l.properties)===null||p===void 0?void 0:p.cluster)&&this.promoteId&&(d=Number(l.properties.cluster_id))),d}}function ah(l,c,p,d,a){return Du(l,(h,y)=>{let w=c instanceof T5?c.get(y):null;return(w==null?void 0:w.evaluate)?w.evaluate(p,d,a):w})}function FE(l,c){return c-l}function oh(l,c,p,d,a){let h=[];for(let y of l){let w;for(let C=0;C<y.length-1;C++){let S=y[C],L=y[C+1];S.x<c&&L.x<c||(S.x<c?S=new Q(c,S.y+(c-S.x)/(L.x-S.x)*(L.y-S.y))._round():L.x<c&&(L=new Q(c,S.y+(c-S.x)/(L.x-S.x)*(L.y-S.y))._round()),S.y<p&&L.y<p||(S.y<p?S=new Q(S.x+(p-S.y)/(L.y-S.y)*(L.x-S.x),p)._round():L.y
=d&&L.x>=d||(S.x>=d?S=new Q(d,S.y+(d-S.x)/(L.x-S.x)*(L.y-S.y))._round():L.x>=d&&(L=new Q(d,S.y+(d-S.x)/(L.x-S.x)*(L.y-S.y))._round()),S.y>=a&&L.y>=a||(S.y>=a?S=new Q(S.x+(a-S.y)/(L.y-S.y)*(L.x-S.x),a)._round():L.y>=a&&(L=new Q(S.x+(a-S.y)/(L.y-S.y)*(L.x-S.x),a)._round()),w&&S.equals(w[w.length-1])||(w=[S],h.push(w)),w.push(L)))))}}return h}function hh(l,c,p,d,a){switch(c){case 1:return function(h,y,w,C){let S=[];for(let L of h)for(let s of L){let U=C===0?s.x:s.y;U>=y&&U<=w&&S.push([s])}return S}(l,p,d,a);case 2:return yh(l,p,d,a,!1);case 3:return yh(l,p,d,a,!0)}return[]}function UE(l,c,p,d,a){let h=d===0?xE:PE,y=[],w=[];for(let L=0;L<l.length-1;L++){let s=l[L],U=l[L+1],N=d===0?s.x:s.y,R=d===0?U.x:U.y,P=!1;Nc&&y.push(h(s,U,c)):N>p?R<p&&y.push(h(s,U,p)):y.push(s),R=c&&(y.push(h(s,U,c)),P=!0),R>p&&N=c&&S0&&!y[0].equals(y[y.length-1])&&y.push(new Q(y[0].x,y[0].y)),y.length>0&&w.push(y),w}function yh(l,c,p,d,a){let h=[];for(let y of l){let w=UE(y,c,p,d,a);w.length>0&&h.push(...w)}return h}function xE(l,c,p){return new Q(p,l.y+(p-l.x)/(c.x-l.x)*(c.y-l.y))}function PE(l,c,p){return new Q(l.x+(p-l.y)/(c.y-l.y)*(c.x-l.x),p)}O1("FeatureIndex",Pm,{omit:["rawTileData","sourceLayerCoder"]});class u4 extends Q{constructor(l,c,p,d){super(l,c),this.angle=p,d!==void 0&&(this.segment=d)}clone(){return new u4(this.x,this.y,this.angle,this.segment)}}function wh(l,c,p,d,a){if(c.segment===void 0||p===0)return!0;let h=c,y=c.segment+1,w=0;for(;w>-p/2;){if(y--,y<0)return!1;w-=l[y].dist(h),h=l[y]}w+=l[y].dist(l[y+1]),y++;let C=[],S=0;for(;w
d;)S-=C.shift().angleDelta;if(S>a)return!1;y++,w+=L.dist(s)}return!0}function nh(l){let c=0;for(let p=0;p<l.length-1;p++)c+=l[p].dist(l[p+1]);return c}function kh(l,c,p){return l?0.6*c*p:0}function Sh(l,c){return Math.max(l?l.right-l.left:0,c?c.right-c.left:0)}function RE(l,c,p,d,a,h){let y=kh(p,a,h),w=Sh(p,d)*h,C=0,S=nh(l)/2;for(let L=0;LS){let R=(S-C)/N,P=n2.number(s.x,U.x,R),B=n2.number(s.y,U.y,R),H=new u4(P,B,U.angleTo(s),L);return H._round(),!y||wh(l,H,w,y,c)?H:void 0}C+=N}}function IE(l,c,p,d,a,h,y,w,C){let S=kh(d,h,y),L=Sh(d,a),s=L*y,U=l[0].x===0||l[0].x===C||l[0].y===0||l[0].y===C;return c-s<c/4&&(c=s+c/4),Eh(l,U?c/2*w%c:(L/2+2*h)*y*w%c,c,S,p,s,U,!1,C)}function Eh(l,c,p,d,a,h,y,w,C){let S=h/2,L=nh(l),s=0,U=c-p,N=[];for(let R=0;R<l.length-1;R++){let P=l[R],B=l[R+1],H=P.dist(B),O=B.angleTo(P);for(;U+p
=0&&Z=0&&T=0&&U+Ss1+K1[1]-K1[0],N=L.reduce(U,0),R=s.reduce(U,0),P=w-N,B=C-R,H=0,O=N,M=0,Z=R,T=0,j=P,d1=0,m1=B;if(h.content&&d){let s1=h.content,K1=s1[2]-s1[0],B1=s1[3]-s1[1];(h.textFitWidth||h.textFitHeight)&&(S=Wo(l)),H=Bp(L,0,s1[0]),M=Bp(s,0,s1[1]),O=Bp(L,s1[0],s1[2]),Z=Bp(s,s1[1],s1[3]),T=s1[0]-H,d1=s1[1]-M,j=K1-O,m1=B1-Z}let{x1:v1,y1:n1}=S,w1=S.x2-v1,S1=S.y2-n1,y1=(s1,K1,B1,Y1)=>{let Q1=zp(s1.stretch-H,O,w1,v1),i1=Qp(s1.fixed-T,j,s1.stretch,N),Vl=zp(K1.stretch-M,Z,S1,n1),kl=Qp(K1.fixed-d1,m1,K1.stretch,R),Ul=zp(B1.stretch-H,O,w1,v1),Q0=Qp(B1.fixed-T,j,B1.stretch,N),Jl=zp(Y1.stretch-M,Z,S1,n1),f0=Qp(Y1.fixed-d1,m1,Y1.stretch,R),q0=new Q(Q1,Vl),Hl=new Q(Ul,Vl),d2=new Q(Ul,Jl),j0=new Q(Q1,Jl),b0=new Q(i1/y,kl/y),C2=new Q(Q0/y,f0/y),H0=c*Math.PI/180;if(H0){let s0=Math.sin(H0),Zl=Math.cos(H0),a0=[Zl,-s0,s0,Zl];q0._matMult(a0),Hl._matMult(a0),j0._matMult(a0),d2._matMult(a0)}let W2=s1.stretch+s1.fixed,ou=K1.stretch+K1.fixed;return{tl:q0,tr:Hl,bl:j0,br:d2,tex:{x:h.paddedRect.x+1+W2,y:h.paddedRect.y+1+ou,w:B1.stretch+B1.fixed-W2,h:Y1.stretch+Y1.fixed-ou},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:b0,pixelOffsetBR:C2,minFontScaleX:j/y/w1,minFontScaleY:m1/y/S1,isSDF:p}};if(d&&(h.stretchX||h.stretchY)){let s1=Ch(L,P,N),K1=Ch(s,B,R);for(let B1=0;B1<s1.length-1;B1++){let Y1=s1[B1],Q1=s1[B1+1];for(let i1=0;i10&&(R=Math.max(10,R),this.circleDiameter=R)}else{let s=((L=h.image)===null||L===void 0?void 0:L.content)&&(h.image.textFitWidth||h.image.textFitHeight)?Wo(h):{x1:h.left,y1:h.top,x2:h.right,y2:h.bottom};s.y1=s.y1*y-w[0],s.y2=s.y2*y+w[2],s.x1=s.x1*y-w[3],s.x2=s.x2*y+w[1];let U=h.collisionPadding;if(U&&(s.x1-=U[0]*y,s.y1-=U[1]*y,s.x2+=U[2]*y,s.y2+=U[3]*y),S){let N=new Q(s.x1,s.y1),R=new Q(s.x2,s.y1),P=new Q(s.x1,s.y2),B=new Q(s.x2,s.y2),H=S*Math.PI/180;N._rotate(H),R._rotate(H),P._rotate(H),B._rotate(H),s.x1=Math.min(N.x,R.x,P.x,B.x),s.x2=Math.max(N.x,R.x,P.x,B.x),s.y1=Math.min(N.y,R.y,P.y,B.y),s.y2=Math.max(N.y,R.y,P.y,B.y)}l.emplaceBack(c.x,c.y,s.x1,s.y1,s.x2,s.y2,p,d,a)}this.boxEndIndex=l.length}}class Wh{constructor(l=[],c=(p,d)=>pd?1:0){if(this.data=l,this.length=this.data.length,this.compare=c,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}push(l){this.data.push(l),this._up(this.length++)}pop(){if(this.length===0)return;let l=this.data[0],c=this.data.pop();return--this.length>0&&(this.data[0]=c,this._down(0)),l}peek(){return this.data[0]}_up(l){let{data:c,compare:p}=this,d=c[l];for(;l>0;){let a=l-1>>1,h=c[a];if(p(d,h)>=0)break;c[l]=h,l=a}c[l]=d}_down(l){let{data:c,compare:p}=this,d=this.length>>1,a=c[l];for(;l<d;){let h=1+(l<<1),y=h+1;if(y<this.length&&p(c[y],c[h])=0)break;c[l]=c[h],l=h}c[l]=a}}function YE(l,c=1){let p=Wc.fromPoints(l[0]),d=Math.min(p.width(),p.height()),a=d/2,h=new Wh([],BE),{minX:y,minY:w,maxX:C,maxY:S}=p;if(d===0)return new Q(y,w);for(let U=y;U<C;U+=d)for(let N=w;N<S;N+=d)h.push(new Nc(U+a,N+a,a,l));let L=function(U){let N=0,R=0,P=0,B=U[0];for(let H=0,O=B.length,M=O-1;Hs.d||!s.d)&&(s=U),U.max-s.d0&&s.d-L.d<=c?L.p:s.p}function BE(l,c){return c.max-l.max}class Nc{constructor(l,c,p,d){this.p=new Q(l,c),this.h=p,this.d=function(a,h){let y=!1,w=1/0;for(let C of h)for(let S=0,L=C.length,s=L-1;Sa.y!=N.y>a.y&&a.x<(N.x-U.x)*(a.y-U.y)/(N.y-U.y)+U.x&&(y=!y),w=Math.min(w,ga(a,U,N))}return(y?1:-1)*Math.sqrt(w)}(this.p,d),this.max=this.d+this.h*Math.SQRT2}}var z0;W.aM=void 0,(z0=W.aM||(W.aM={}))[z0.center=1]="center",z0[z0.left=2]="left",z0[z0.right=3]="right",z0[z0.top=4]="top",z0[z0.bottom=5]="bottom",z0[z0["top-left"]=6]="top-left",z0[z0["top-right"]=7]="top-right",z0[z0["bottom-left"]=8]="bottom-left",z0[z0["bottom-right"]=9]="bottom-right";let Rm=Number.POSITIVE_INFINITY;function Lh(l,c){return c[1]!==Rm?function(p,d,a){let h=0,y=0;switch(d=Math.abs(d),a=Math.abs(a),p){case"top-right":case"top-left":case"top":y=a-7;break;case"bottom-right":case"bottom-left":case"bottom":y=7-a}switch(p){case"top-right":case"bottom-right":case"right":h=-d;break;case"top-left":case"bottom-left":case"left":h=d}return[h,y]}(l,c[0],c[1]):function(p,d){let a=0,h=0;d<0&&(d=0);let y=d/Math.SQRT2;switch(p){case"top-right":case"top-left":h=y-7;break;case"bottom-right":case"bottom-left":h=7-y;break;case"bottom":h=7-d;break;case"top":h=d-7}switch(p){case"top-right":case"bottom-right":a=-y;break;case"top-left":case"bottom-left":a=y;break;case"left":a=d;break;case"right":a=-d}return[a,h]}(l,c[0])}function Ah(l,c,p){var d;let a=l.layout,h=(d=a.get("text-variable-anchor-offset"))===null||d===void 0?void 0:d.evaluate(c,{},p);if(h){let w=h.values,C=[];for(let S=0;SU*S0);L.startsWith("top")?s[1]-=7:L.startsWith("bottom")&&(s[1]+=7),C[S+1]=s}return new T0(C)}let y=a.get("text-variable-anchor");if(y){let w;w=l._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[a.get("text-radial-offset").evaluate(c,{},p)*S0,Rm]:a.get("text-offset").evaluate(c,{},p).map((S)=>S*S0);let C=[];for(let S of y)C.push(S,Lh(S,w));return new T0(C)}return null}function Im(l){switch(l){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function zE(l,c,p,d,a,h,y,w,C,S,L,s){let U=h.textMaxSize.evaluate(c,{});U===void 0&&(U=y);let N=l.layers[0].layout,R=N.get("icon-offset").evaluate(c,{},L),P=Nh(p.horizontal),B=y/24,H=l.tilePixelRatio*B,O=l.tilePixelRatio*U/24,M=l.tilePixelRatio*w,Z=l.tilePixelRatio*N.get("symbol-spacing"),T=N.get("text-padding")*l.tilePixelRatio,j=function(B1,Y1,Q1,i1=1){let Vl=B1.get("icon-padding").evaluate(Y1,{},Q1),kl=Vl==null?void 0:Vl.values;return[kl[0]*i1,kl[1]*i1,kl[2]*i1,kl[3]*i1]}(N,c,L,l.tilePixelRatio),d1=N.get("text-max-angle")/180*Math.PI,m1=N.get("text-rotation-alignment")!=="viewport"&&N.get("symbol-placement")!=="point",v1=N.get("icon-rotation-alignment")==="map"&&N.get("symbol-placement")!=="point",n1=N.get("symbol-placement"),w1=Z/2,S1=N.get("icon-text-fit"),y1;d&&S1!=="none"&&(l.allowVerticalPlacement&&p.vertical&&(y1=Lo(d,p.vertical,S1,N.get("icon-text-fit-padding"),R,B)),P&&(d=Lo(d,P,S1,N.get("icon-text-fit-padding"),R,B)));let s1=L?s.line.getGranularityForZoomLevel(L.z):1,K1=(B1,Y1)=>{Y1.x=ul||Y1.y=ul||function(Q1,i1,Vl,kl,Ul,Q0,Jl,f0,q0,Hl,d2,j0,b0,C2,H0,W2,ou,s0,Zl,a0,jl,C0,l3,Pu,w8){let c4=Q1.addToLineVertexArray(i1,Vl),qc,u6,c6,r6,qh=0,Fh=0,Uh=0,xh=0,Ym=-1,Bm=-1,u3={},Ph=Y0("");if(Q1.allowVerticalPlacement&&kl.vertical){let $0=f0.layout.get("text-rotate").evaluate(jl,{},Pu)+90;c6=new y8(q0,i1,Hl,d2,j0,kl.vertical,b0,C2,H0,$0),Jl&&(r6=new y8(q0,i1,Hl,d2,j0,Jl,ou,s0,H0,$0))}if(Ul){let $0=f0.layout.get("icon-rotate").evaluate(jl,{}),j2=f0.layout.get("icon-text-fit")!=="none",Fc=sh(Ul,$0,l3,j2),Iu=Jl?sh(Jl,$0,l3,j2):void 0;u6=new y8(q0,i1,Hl,d2,j0,Ul,ou,s0,!1,$0),qh=4*Fc.length;let Uc=Q1.iconSizeData,y5=null;Uc.kind==="source"?(y5=[e5*f0.layout.get("icon-size").evaluate(jl,{})],y5[0]>_3&&w0(`${Q1.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):Uc.kind==="composite"&&(y5=[e5*C0.compositeIconSizes[0].evaluate(jl,{},Pu),e5*C0.compositeIconSizes[1].evaluate(jl,{},Pu)],(y5[0]>_3||y5[1]>_3)&&w0(`${Q1.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Q1.addSymbols(Q1.icon,Fc,y5,a0,Zl,jl,W.ax.none,i1,c4.lineStartIndex,c4.lineLength,-1,Pu),Ym=Q1.icon.placedSymbolArray.length-1,Iu&&(Fh=4*Iu.length,Q1.addSymbols(Q1.icon,Iu,y5,a0,Zl,jl,W.ax.vertical,i1,c4.lineStartIndex,c4.lineLength,-1,Pu),Bm=Q1.icon.placedSymbolArray.length-1)}let Rh=Object.keys(kl.horizontal);for(let $0 of Rh){let j2=kl.horizontal[$0];if(!qc){Ph=Y0(j2.text);let Iu=f0.layout.get("text-rotate").evaluate(jl,{},Pu);qc=new y8(q0,i1,Hl,d2,j0,j2,b0,C2,H0,Iu)}let Fc=j2.positionedLines.length===1;if(Uh+=Vh(Q1,i1,j2,Q0,f0,H0,jl,W2,c4,kl.vertical?W.ax.horizontal:W.ax.horizontalOnly,Fc?Rh:[$0],u3,Ym,C0,Pu),Fc)break}kl.vertical&&(xh+=Vh(Q1,i1,kl.vertical,Q0,f0,H0,jl,W2,c4,W.ax.vertical,["vertical"],u3,Bm,C0,Pu));let HE=qc?qc.boxStartIndex:Q1.collisionBoxArray.length,ME=qc?qc.boxEndIndex:Q1.collisionBoxArray.length,KE=c6?c6.boxStartIndex:Q1.collisionBoxArray.length,OE=c6?c6.boxEndIndex:Q1.collisionBoxArray.length,ZE=u6?u6.boxStartIndex:Q1.collisionBoxArray.length,DE=u6?u6.boxEndIndex:Q1.collisionBoxArray.length,TE=r6?r6.boxStartIndex:Q1.collisionBoxArray.length,GE=r6?r6.boxEndIndex:Q1.collisionBoxArray.length,Ru=-1,Hp=($0,j2)=>($0==null?void 0:$0.circleDiameter)?Math.max($0.circleDiameter,j2):j2;Ru=Hp(qc,Ru),Ru=Hp(c6,Ru),Ru=Hp(u6,Ru),Ru=Hp(r6,Ru);let Ih=Ru>-1?1:0;Ih&&(Ru*=w8/S0),Q1.glyphOffsetArray.length>=Cc.MAX_GLYPHS&&w0("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),jl.sortKey!==void 0&&Q1.addToSortKeyRanges(Q1.symbolInstances.length,jl.sortKey);let XE=Ah(f0,jl,Pu),[JE,jE]=function($0,j2){let Fc=$0.length,Iu=j2==null?void 0:j2.values;if((Iu==null?void 0:Iu.length)>0)for(let Uc=0;Uc=0?u3.right:-1,u3.center>=0?u3.center:-1,u3.left>=0?u3.left:-1,u3.vertical||-1,Ym,Bm,Ph,HE,ME,KE,OE,ZE,DE,TE,GE,Hl,Uh,xh,qh,Fh,Ih,0,b0,Ru,JE,jE)}(l,Y1,B1,p,d,a,y1,l.layers[0],l.collisionBoxArray,c.index,c.sourceLayerIndex,l.index,H,[T,T,T,T],m1,C,M,j,v1,R,c,h,S,L,y)};if(n1==="line")for(let B1 of oh(c.geometry,0,0,ul,ul)){let Y1=sc(B1,s1),Q1=IE(Y1,Z,d1,p.vertical||P,d,24,O,l.overscaling,ul);for(let i1 of Q1)P&&QE(l,P.text,w1,i1)||K1(Y1,i1)}else if(n1==="line-center"){for(let B1 of c.geometry)if(B1.length>1){let Y1=sc(B1,s1),Q1=RE(Y1,d1,p.vertical||P,d,24,O);Q1&&K1(Y1,Q1)}}else if(c.type==="Polygon")for(let B1 of hr(c.geometry,0)){let Y1=YE(B1,16);K1(sc(B1[0],s1,!0),new u4(Y1.x,Y1.y,0))}else if(c.type==="LineString")for(let B1 of c.geometry){let Y1=sc(B1,s1);K1(Y1,new u4(Y1[0].x,Y1[0].y,0))}else if(c.type==="Point")for(let B1 of c.geometry)for(let Y1 of B1)K1([Y1],new u4(Y1.x,Y1.y,0))}function Vh(l,c,p,d,a,h,y,w,C,S,L,s,U,N,R){let P=function(O,M,Z,T,j,d1,m1,v1){let n1=T.layout.get("text-rotate").evaluate(d1,{})*Math.PI/180,w1=[];for(let S1 of M.positionedLines)for(let y1 of S1.positionedGlyphs){if(!y1.rect)continue;let s1=y1.rect||{},K1=4,B1=!0,Y1=1,Q1=0,i1=(j||v1)&&y1.vertical,Vl=y1.metrics.advance*y1.scale/2;if(v1&&M.verticalizable&&(Q1=S1.lineOffset/2-(y1.imageName?-(S0-y1.metrics.width*y1.scale)/2:(y1.scale-1)*S0)),y1.imageName){let s0=m1[y1.imageName];B1=s0.sdf,Y1=s0.pixelRatio,K1=1/Y1}let kl=j?[y1.x+Vl,y1.y]:[0,0],Ul=j?[0,0]:[y1.x+Vl+Z[0],y1.y+Z[1]-Q1],Q0=[0,0];i1&&(Q0=Ul,Ul=[0,0]);let Jl=y1.metrics.isDoubleResolution?2:1,f0=(y1.metrics.left-K1)*y1.scale-Vl+Ul[0],q0=(-y1.metrics.top-K1)*y1.scale+Ul[1],Hl=f0+s1.w/Jl*y1.scale/Y1,d2=q0+s1.h/Jl*y1.scale/Y1,j0=new Q(f0,q0),b0=new Q(Hl,q0),C2=new Q(f0,d2),H0=new Q(Hl,d2);if(i1){let s0=new Q(-Vl,Vl- -17),Zl=-Math.PI/2,a0=12-Vl,jl=new Q(22-a0,-(y1.imageName?a0:0)),C0=new Q(...Q0);j0._rotateAround(Zl,s0)._add(jl)._add(C0),b0._rotateAround(Zl,s0)._add(jl)._add(C0),C2._rotateAround(Zl,s0)._add(jl)._add(C0),H0._rotateAround(Zl,s0)._add(jl)._add(C0)}if(n1){let s0=Math.sin(n1),Zl=Math.cos(n1),a0=[Zl,-s0,s0,Zl];j0._matMult(a0),b0._matMult(a0),C2._matMult(a0),H0._matMult(a0)}let W2=new Q(0,0),ou=new Q(0,0);w1.push({tl:j0,tr:b0,bl:C2,br:H0,tex:s1,writingMode:M.writingMode,glyphOffset:kl,sectionIndex:y1.sectionIndex,isSDF:B1,pixelOffsetTL:W2,pixelOffsetBR:ou,minFontScaleX:0,minFontScaleY:0})}return w1}(0,p,w,a,h,y,d,l.allowVerticalPlacement),B=l.textSizeData,H=null;B.kind==="source"?(H=[e5*a.layout.get("text-size").evaluate(y,{})],H[0]>_3&&w0(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):B.kind==="composite"&&(H=[e5*N.compositeTextSizes[0].evaluate(y,{},R),e5*N.compositeTextSizes[1].evaluate(y,{},R)],(H[0]>_3||H[1]>_3)&&w0(`${l.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),l.addSymbols(l.text,P,H,w,h,y,S,c,C.lineStartIndex,C.lineLength,U,R);for(let O of L)s[O]=l.text.placedSymbolArray.length-1;return 4*P.length}function Nh(l){for(let c in l)return l[c];return null}function QE(l,c,p,d){let a=l.compareText;if(c in a){let h=a[c];for(let y=h.length-1;y>=0;y--)if(d.dist(h[y])this.process()),this.subscription=N4(this.target,"message",(p)=>this.receive(p),!1),this.globalScope=L0(self)?l:window}registerMessageHandler(l,c){this.messageHandlers[l]=c}unregisterMessageHandler(l){delete this.messageHandlers[l]}sendAsync(l,c){return new Promise((p,d)=>{let a=Math.round(1000000000000000000*Math.random()).toString(36).substring(0,10),h=c?N4(c.signal,"abort",()=>{h==null||h.unsubscribe(),delete this.resolveRejects[a];let C={id:a,type:"",origin:location.origin,targetMapId:l.targetMapId,sourceMapId:this.mapId};this.target.postMessage(C)},rE):null;this.resolveRejects[a]={resolve:(C)=>{h==null||h.unsubscribe(),p(C)},reject:(C)=>{h==null||h.unsubscribe(),d(C)}};let y=[],w=Object.assign(Object.assign({},l),{id:a,sourceMapId:this.mapId,origin:location.origin,data:cu(l.data,y)});this.target.postMessage(w,{transfer:y})})}receive(l){let c=l.data,p=c.id,d=["file://","resource://android","null"],a=[c.origin,location.origin],h=c.origin===location.origin,y=a.some((w)=>d.includes(w));if((h||y)&&(!c.targetMapId||this.mapId===c.targetMapId)){if(c.type===""){delete this.tasks[p];let w=this.abortControllers[p];return delete this.abortControllers[p],void(w&&w.abort())}if(L0(self)||c.mustQueue)return this.tasks[p]=c,this.taskQueue.push(p),void this.invoker.trigger();this.processTask(p,c)}}process(){if(this.taskQueue.length===0)return;let l=this.taskQueue.shift(),c=this.tasks[l];delete this.tasks[l],this.taskQueue.length>0&&this.invoker.trigger(),c&&this.processTask(l,c)}processTask(l,c){return g(this,void 0,void 0,function*(){if(c.type===""){let a=this.resolveRejects[l];if(delete this.resolveRejects[l],!a)return;return void(c.error?a.reject(l0(dc(c.error))):a.resolve(dc(c.data)))}if(!this.messageHandlers[c.type])return void this.completeTask(l,Error(`Could not find a registered handler for ${c.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let p=dc(c.data),d=new AbortController;this.abortControllers[l]=d;try{let a=yield this.messageHandlers[c.type](c.sourceMapId,p,d);this.completeTask(l,null,a)}catch(a){this.completeTask(l,l0(a))}})}completeTask(l,c,p){let d=[];delete this.abortControllers[l];let a={id:l,type:"",sourceMapId:this.mapId,origin:location.origin,error:c?cu(c):null,data:cu(p,d)};this.target.postMessage(a,{transfer:d})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},W.O=function(){var l=new g1(16);return g1!=Float32Array&&(l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[11]=0,l[12]=0,l[13]=0,l[14]=0),l[0]=1,l[5]=1,l[10]=1,l[15]=1,l},W.P=Q,W.Q=function(l,c,p){var d,a,h,y,w,C,S,L,s,U,N,R,P=p[0],B=p[1],H=p[2];return c===l?(l[12]=c[0]*P+c[4]*B+c[8]*H+c[12],l[13]=c[1]*P+c[5]*B+c[9]*H+c[13],l[14]=c[2]*P+c[6]*B+c[10]*H+c[14],l[15]=c[3]*P+c[7]*B+c[11]*H+c[15]):(a=c[1],h=c[2],y=c[3],w=c[4],C=c[5],S=c[6],L=c[7],s=c[8],U=c[9],N=c[10],R=c[11],l[0]=d=c[0],l[1]=a,l[2]=h,l[3]=y,l[4]=w,l[5]=C,l[6]=S,l[7]=L,l[8]=s,l[9]=U,l[10]=N,l[11]=R,l[12]=d*P+w*B+s*H+c[12],l[13]=a*P+C*B+U*H+c[13],l[14]=h*P+S*B+N*H+c[14],l[15]=y*P+L*B+R*H+c[15]),l},W.R=s2,W.S=function(l,c,p){var d=p[0],a=p[1],h=p[2];return l[0]=c[0]*d,l[1]=c[1]*d,l[2]=c[2]*d,l[3]=c[3]*d,l[4]=c[4]*a,l[5]=c[5]*a,l[6]=c[6]*a,l[7]=c[7]*a,l[8]=c[8]*h,l[9]=c[9]*h,l[10]=c[10]*h,l[11]=c[11]*h,l[12]=c[12],l[13]=c[13],l[14]=c[14],l[15]=c[15],l},W.T=mp,W.U=function(l,c,p){var d=c[0],a=c[1],h=c[2],y=c[3],w=c[4],C=c[5],S=c[6],L=c[7],s=c[8],U=c[9],N=c[10],R=c[11],P=c[12],B=c[13],H=c[14],O=c[15],M=p[0],Z=p[1],T=p[2],j=p[3];return l[0]=M*d+Z*w+T*s+j*P,l[1]=M*a+Z*C+T*U+j*B,l[2]=M*h+Z*S+T*N+j*H,l[3]=M*y+Z*L+T*R+j*O,l[4]=(M=p[4])*d+(Z=p[5])*w+(T=p[6])*s+(j=p[7])*P,l[5]=M*a+Z*C+T*U+j*B,l[6]=M*h+Z*S+T*N+j*H,l[7]=M*y+Z*L+T*R+j*O,l[8]=(M=p[8])*d+(Z=p[9])*w+(T=p[10])*s+(j=p[11])*P,l[9]=M*a+Z*C+T*U+j*B,l[10]=M*h+Z*S+T*N+j*H,l[11]=M*y+Z*L+T*R+j*O,l[12]=(M=p[12])*d+(Z=p[13])*w+(T=p[14])*s+(j=p[15])*P,l[13]=M*a+Z*C+T*U+j*B,l[14]=M*h+Z*S+T*N+j*H,l[15]=M*y+Z*L+T*R+j*O,l},W.V=function(l,c){let p={};for(let d of c)d in l&&(p[d]=l[d]);return p},W.W=i3,W.X=Jc,W.Y=Yo,W.Z=Io,W._=g,W.a=w3,W.a$=function(l){var c=new g1(3);return c[0]=l[0],c[1]=l[1],c[2]=l[2],c},W.a0=J1,W.a1=X1,W.a2=M6,W.a3=I2,W.a4=zo,W.a5=qp,W.a6=ul,W.a7=g8,W.a8=Wc,W.a9=25,W.aA=function(l){var c=l[0],p=l[1];return Math.sqrt(c*c+p*p)},W.aB=function(l){return l[0]=0,l[1]=0,l},W.aC=function(l,c,p){return l[0]=c[0]*p,l[1]=c[1]*p,l},W.aD=id,W.aE=cl,W.aF=function(l,c,p,d){let a=c.y-l.y,h=c.x-l.x,y=d.y-p.y,w=d.x-p.x,C=y*h-w*a;if(C===0)return null;let S=(w*(l.y-p.y)-y*(l.x-p.x))/C;return new Q(l.x+S*h,l.y+S*a)},W.aG=oh,W.aH=da,W.aI=function(l){let c=1/0,p=1/0,d=-1/0,a=-1/0;for(let h of l)c=Math.min(c,h.x),p=Math.min(p,h.y),d=Math.max(d,h.x),a=Math.max(a,h.y);return[c,p,d,a]},W.aJ=S0,W.aK=O0,W.aL=function(l,c,p,d,a=!1){if(!p[0]&&!p[1])return[0,0];let h=a?d==="map"?-l.bearingInRadians:0:d==="viewport"?l.bearingInRadians:0;if(h){let y=Math.sin(h),w=Math.cos(h);p=[p[0]*w-p[1]*y,p[0]*y+p[1]*w]}return[a?p[0]:O0(c,p[0],l.zoom),a?p[1]:O0(c,p[1],l.zoom)]},W.aN=_d,W.aO=Im,W.aP=$d,W.aQ=(l)=>l.type==="symbol",W.aR=yp,W.aS=xl,W.aT=t7,W.aU=e,W.aV=M1,W.aW=D1,W.aX=Gu,W.aY=Qo,W.aZ=r1,W.a_=t,W.aa=Fp,W.ab=(l)=>{let c=window.document.createElement("video");return c.muted=!0,new Promise((p)=>{c.onloadstart=()=>{p(c)};for(let d of l){let a=window.document.createElement("source");Z2(d)||(c.crossOrigin="Anonymous"),a.src=d,c.appendChild(a)}})},W.ac=R1,W.ad=function(){return h3++},W.ae=n,W.af=Cc,W.ag=h8,W.ah=t4,W.ai=h5,W.aj=rm,W.ak=function(l){let c={};if(l.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(p,d,a,h)=>{let y=a||h;return c[d]=!y||y.toLowerCase(),""}),c["max-age"]){let p=parseInt(c["max-age"],10);isNaN(p)?delete c["max-age"]:c["max-age"]=p}return c},W.al=Z0,W.am=85.051129,W.an=Wu,W.ao=function(l){return Math.pow(2,l)},W.ap=o1,W.aq=Bo,W.ar=function(l){return Math.log(l)/Math.LN2},W.as=function(l){var c=l[0],p=l[1];return c*c+p*p},W.at=function(l){if(!l.length)return new Set;let c=Math.max(...l.map((C)=>C.canonical.z)),p=1/0,d=-1/0,a=1/0,h=-1/0,y=[];for(let C of l){let{x:S,y:L,z:s}=C.canonical,U=Math.pow(2,c-s),N=S*U,R=L*U;y.push({id:C,x:N,y:R}),N
Ti preghiamo di compilare il modulo sottostante e ti ricontatteremo il prima possibile
Ti piacerà anche





