!function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}function i(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var o,a=r(e),s=n(e),l=n(t);function c(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}
/**
     * @remix-run/router v1.19.2
     *
     * Copyright (c) Remix Software Inc.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE.md file in the root directory of this source tree.
     *
     * @license MIT
     */function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));const h="popstate";function d(e){return void 0===e&&(e={}),function(e,t,n,r){void 0===r&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,l=o.Pop,c=null,d=p();null==d&&(d=0,s.replaceState(u({},s.state,{idx:d}),""));function p(){return(s.state||{idx:null}).idx}function y(){l=o.Pop;let e=p(),t=null==e?null:e-d;d=e,c&&c({action:l,location:b.location,delta:t})}function _(e,t){l=o.Push;let r=g(b.location,e,t);n&&n(r,e),d=p()+1;let u=m(r,d),h=b.createHref(r);try{s.pushState(u,"",h)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(h)}a&&c&&c({action:l,location:b.location,delta:1})}function x(e,t){l=o.Replace;let r=g(b.location,e,t);n&&n(r,e),d=p();let i=m(r,d),u=b.createHref(r);s.replaceState(i,"",u),a&&c&&c({action:l,location:b.location,delta:0})}function w(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"==typeof e?e:v(e);return n=n.replace(/ $/,"%20"),f(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}let b={get action(){return l},get location(){return e(i,s)},listen(e){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(h,y),c=e,()=>{i.removeEventListener(h,y),c=null}},createHref:e=>t(i,e),createURL:w,encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:_,replace:x,go:e=>s.go(e)};return b}((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=y(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),g("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:v(t))}),(function(e,t){p("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function f(e,t){if(!1===e||null==e)throw new Error(t)}function p(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function m(e,t){return{usr:e.state,key:e.key,idx:t}}function g(e,t,n,r){return void 0===n&&(n=null),u({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?y(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function v(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function y(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var _;function x(e,t,n){return void 0===n&&(n="/"),function(e,t,n,r){let i="string"==typeof t?y(t):t,o=P(i.pathname||"/",n);if(null==o)return null;let a=w(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(a);let s=null;for(let e=0;null==s&&e<a.length;++e){let t=z(o);s=R(a[e],t,r)}return s}(e,t,n,!1)}function w(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let i=(e,i,o)=>{let a={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};a.relativePath.startsWith("/")&&(f(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let s=F([r,a.relativePath]),l=n.concat(a);e.children&&e.children.length>0&&(f(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),w(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:I(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of b(e.path))i(e,t,n);else i(e,t)})),t}function b(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return i?[o,""]:[o];let a=b(r.join("/")),s=[];return s.push(...a.map((e=>""===e?o:[o,e].join("/")))),i&&s.push(...a),s.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(_||(_={}));const E=/^:[\w-]+$/,k=3,T=2,M=1,S=10,C=-2,A=e=>"*"===e;function I(e,t){let n=e.split("/"),r=n.length;return n.some(A)&&(r+=C),t&&(r+=T),n.filter((e=>!A(e))).reduce(((e,t)=>e+(E.test(t)?k:""===t?M:S)),r)}function R(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let e=0;e<r.length;++e){let s=r[e],l=e===r.length-1,c="/"===o?t:t.slice(o.length)||"/",u=L({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},c),h=s.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=L({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!u)return null;Object.assign(i,u.params),a.push({params:i,pathname:F([o,u.pathname]),pathnameBase:j(F([o,u.pathnameBase])),route:h}),"/"!==u.pathnameBase&&(o=F([o,u.pathnameBase]))}return a}function L(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);p("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");let o=new RegExp(i,t?void 0:"i");return[o,r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1),l=r.reduce(((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=s[n]||"";a=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[n];return e[r]=i&&!l?void 0:(l||"").replace(/%2F/g,"/"),e}),{});return{params:l,pathname:o,pathnameBase:a,pattern:e}}function z(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return p(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function P(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function O(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function D(e,t){let n=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t?n.map(((e,t)=>t===n.length-1?e.pathname:e.pathnameBase)):n.map((e=>e.pathnameBase))}function B(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=y(e):(i=u({},e),f(!i.pathname||!i.pathname.includes("?"),O("?","pathname","search",i)),f(!i.pathname||!i.pathname.includes("#"),O("#","pathname","hash",i)),f(!i.search||!i.search.includes("#"),O("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?y(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:N(r),hash:V(i)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),h=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!h||(l.pathname+="/"),l}const F=e=>e.join("/").replace(/\/\/+/g,"/"),j=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",V=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";
/**
     * React Router v6.26.2
     *
     * Copyright (c) Remix Software Inc.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE.md file in the root directory of this source tree.
     *
     * @license MIT
     */
function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},U.apply(this,arguments)}const H=a.createContext(null),W=a.createContext(null),$=a.createContext(null),G=a.createContext(null),q=a.createContext({outlet:null,matches:[],isDataRoute:!1}),Z=a.createContext(null);function X(){return null!=a.useContext(G)}function Y(){return X()||f(!1),a.useContext(G).location}function K(e){a.useContext($).static||a.useLayoutEffect(e)}function J(){let{isDataRoute:e}=a.useContext(q);return e?function(){let{router:e}=function(e){let t=a.useContext(H);return t||f(!1),t}(oe.UseNavigateStable),t=se(ae.UseNavigateStable),n=a.useRef(!1);K((()=>{n.current=!0}));let r=a.useCallback((function(r,i){void 0===i&&(i={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,U({fromRouteId:t},i)))}),[e,t]);return r}():function(){X()||f(!1);let e=a.useContext(H),{basename:t,future:n,navigator:r}=a.useContext($),{matches:i}=a.useContext(q),{pathname:o}=Y(),s=JSON.stringify(D(i,n.v7_relativeSplatPath)),l=a.useRef(!1);K((()=>{l.current=!0}));let c=a.useCallback((function(n,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof n)return void r.go(n);let a=B(n,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(a.pathname="/"===a.pathname?t:F([t,a.pathname])),(i.replace?r.replace:r.push)(a,i.state,i)}),[t,r,s,o,e]);return c}()}function Q(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=a.useContext($),{matches:i}=a.useContext(q),{pathname:o}=Y(),s=JSON.stringify(D(i,r.v7_relativeSplatPath));return a.useMemo((()=>B(e,JSON.parse(s),o,"path"===n)),[e,s,o,n])}function ee(e,t){return function(e,t,n,r){X()||f(!1);let{navigator:i}=a.useContext($),{matches:s}=a.useContext(q),l=s[s.length-1],c=l?l.params:{};!l||l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let h,d=Y();if(t){var p;let e="string"==typeof t?y(t):t;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||f(!1),h=e}else h=d;let m=h.pathname||"/",g=m;if("/"!==u){let e=u.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=x(e,{pathname:g}),_=function(e,t,n,r){var i;void 0===t&&(t=[]);void 0===n&&(n=null);void 0===r&&(r=null);if(null==e){var o;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(o=r)&&o.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let s=e,l=null==(i=n)?void 0:i.errors;if(null!=l){let e=s.findIndex((e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id])));e>=0||f(!1),s=s.slice(0,Math.min(s.length,e+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<s.length;e++){let t=s[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){c=!0,s=u>=0?s.slice(0,u+1):[s[0]];break}}}return s.reduceRight(((e,r,i)=>{let o,h=!1,d=null,f=null;var p;n&&(o=l&&r.route.id?l[r.route.id]:void 0,d=r.route.errorElement||ne,c&&(u<0&&0===i?(p="route-fallback",!1||le[p]||(le[p]=!0),h=!0,f=null):u===i&&(h=!0,f=r.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,i+1)),g=()=>{let t;return t=o?d:h?f:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(ie,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===i)?a.createElement(re,{location:n.location,revalidation:n.revalidation,component:d,error:o,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()}),null)}(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:F([u,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:F([u,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),s,n,r);if(t&&_)return a.createElement(G.Provider,{value:{location:U({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:o.Pop}},_);return _}(e,t)}function te(){let e=function(){var e;let t=a.useContext(Z),n=function(e){let t=a.useContext(W);return t||f(!1),t}(ae.UseRouteError),r=se(ae.UseRouteError);if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:r},n):null,null)}const ne=a.createElement(te,null);class re extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(q.Provider,{value:this.props.routeContext},a.createElement(Z.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ie(e){let{routeContext:t,match:n,children:r}=e,i=a.useContext(H);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),a.createElement(q.Provider,{value:t},r)}var oe=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(oe||{}),ae=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ae||{});function se(e){let t=function(e){let t=a.useContext(q);return t||f(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||f(!1),n.route.id}const le={};function ce(e){f(!1)}function ue(e){let{basename:t="/",children:n=null,location:r,navigationType:i=o.Pop,navigator:s,static:l=!1,future:c}=e;X()&&f(!1);let u=t.replace(/^\/*/,"/"),h=a.useMemo((()=>({basename:u,navigator:s,static:l,future:U({v7_relativeSplatPath:!1},c)})),[u,c,s,l]);"string"==typeof r&&(r=y(r));let{pathname:d="/",search:p="",hash:m="",state:g=null,key:v="default"}=r,_=a.useMemo((()=>{let e=P(d,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:g,key:v},navigationType:i}}),[u,d,p,m,g,v,i]);return null==_?null:a.createElement($.Provider,{value:h},a.createElement(G.Provider,{children:n,value:_}))}function he(e){let{children:t,location:n}=e;return ee(de(t),n)}function de(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,r)=>{if(!a.isValidElement(e))return;let i=[...t,r];if(e.type===a.Fragment)return void n.push.apply(n,de(e.props.children,i));e.type!==ce&&f(!1),e.props.index&&e.props.children&&f(!1);let o={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(o.children=de(e.props.children,i)),n.push(o)})),n}
/**
     * React Router DOM v6.26.2
     *
     * Copyright (c) Remix Software Inc.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE.md file in the root directory of this source tree.
     *
     * @license MIT
     */function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe.apply(this,arguments)}new Promise((()=>{}));const pe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(yn){}const me=a.startTransition;function ge(e){let{basename:t,children:n,future:r,window:i}=e,o=a.useRef();null==o.current&&(o.current=d({window:i,v5Compat:!0}));let s=o.current,[l,c]=a.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},h=a.useCallback((e=>{u&&me?me((()=>c(e))):c(e)}),[c,u]);return a.useLayoutEffect((()=>s.listen(h)),[s,h]),a.createElement(ue,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const ve="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ye=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_e=a.forwardRef((function(e,t){let n,{onClick:r,relative:i,reloadDocument:o,replace:s,state:l,target:c,to:u,preventScrollReset:h,unstable_viewTransition:d}=e,p=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,pe),{basename:m}=a.useContext($),g=!1;if("string"==typeof u&&ye.test(u)&&(n=u,ve))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=P(t.pathname,m);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:g=!0}catch(e){}let y=function(e,t){let{relative:n}=void 0===t?{}:t;X()||f(!1);let{basename:r,navigator:i}=a.useContext($),{hash:o,pathname:s,search:l}=Q(e,{relative:n}),c=s;return"/"!==r&&(c="/"===s?r:F([r,s])),i.createHref({pathname:c,search:l,hash:o})}(u,{relative:i}),_=function(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=J(),u=Y(),h=Q(e,{relative:s});return a.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==r?r:v(u)===v(h);c(e,{replace:n,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:l})}}),[u,c,h,r,i,n,e,o,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:h,relative:i,unstable_viewTransition:d});return a.createElement("a",fe({},p,{href:n||y,onClick:g||o?r:function(e){r&&r(e),e.defaultPrevented||_(e)},ref:t,target:c}))}));var xe,we;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(xe||(xe={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(we||(we={}));var be="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ke,Te={exports:{}};
/*!
    	Copyright (c) 2018 Jed Watson.
    	Licensed under the MIT License (MIT), see
    	http://jedwatson.github.io/classnames
    */ke=Te,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)n.push(i);else if(Array.isArray(i)){if(i.length){var a=t.apply(null,i);a&&n.push(a)}}else if("object"===o){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){n.push(i.toString());continue}for(var s in i)e.call(i,s)&&i[s]&&n.push(s)}}}return n.join(" ")}ke.exports?(t.default=t,ke.exports=t):window.classNames=t}();var Me=Te.exports,Se={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,c),o=n-i<0,a=t.clone().add(r+(o?-1:1),c);return+(-(r+(n-i)/(o?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:c,y:h,w:l,d:s,D:d,h:a,m:o,s:i,ms:r,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},_="en",x={};x[_]=g;var w=function(e){return e instanceof T},b=function e(t,n,r){var i;if(!t)return _;if("string"==typeof t){var o=t.toLowerCase();x[o]&&(i=o),n&&(x[o]=n,i=o);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var s=t.name;x[s]=t,i=s}return!r&&i&&(_=i),i||!r&&_},E=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new T(n)},k=y;k.l=b,k.i=w,k.w=function(e,t){return E(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function g(e){this.$L=b(e.locale,null,!0),this.parse(e)}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(k.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return k},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=E(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return E(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<E(e)},v.$g=function(e,t,n){return k.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!k.u(t)||t,u=k.p(e),f=function(e,t){var i=k.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},p=function(e,t){return k.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case h:return r?f(1,0):f(31,11);case c:return r?f(1,g):f(0,g+1);case l:var _=this.$locale().weekStart||0,x=(m<_?m+7:m)-_;return f(r?v-x:v+(6-x),g);case s:case d:return p(y+"Hours",0);case a:return p(y+"Minutes",1);case o:return p(y+"Seconds",2);case i:return p(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,l=k.p(e),u="set"+(this.$u?"UTC":""),f=(n={},n[s]=u+"Date",n[d]=u+"Date",n[c]=u+"Month",n[h]=u+"FullYear",n[a]=u+"Hours",n[o]=u+"Minutes",n[i]=u+"Seconds",n[r]=u+"Milliseconds",n)[l],p=l===s?this.$D+(t-this.$W):t;if(l===c||l===h){var m=this.clone().set(d,1);m.$d[f](p),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[k.p(e)]()},v.add=function(r,u){var d,f=this;r=Number(r);var p=k.p(u),m=function(e){var t=E(f);return k.w(t.date(t.date()+Math.round(e*r)),f)};if(p===c)return this.set(c,this.$M+r);if(p===h)return this.set(h,this.$y+r);if(p===s)return m(1);if(p===l)return m(7);var g=(d={},d[o]=t,d[a]=n,d[i]=e,d)[p]||1,v=this.$d.getTime()+r*g;return k.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),o=this.$H,a=this.$m,s=this.$M,l=n.weekdays,c=n.months,u=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},h=function(e){return k.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:k.s(s+1,2,"0"),MMM:u(n.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:k.s(this.$D,2,"0"),d:String(this.$W),dd:u(n.weekdaysMin,this.$W,l,2),ddd:u(n.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:k.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:k.s(a,2,"0"),s:String(this.$s),ss:k.s(this.$s,2,"0"),SSS:k.s(this.$ms,3,"0"),Z:i};return r.replace(m,(function(e,t){return t||p[e]||i.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,d,f){var p,m=k.p(d),g=E(r),v=(g.utcOffset()-this.utcOffset())*t,y=this-g,_=k.m(this,g);return _=(p={},p[h]=_/12,p[c]=_,p[u]=_/3,p[l]=(y-v)/6048e5,p[s]=(y-v)/864e5,p[a]=y/n,p[o]=y/t,p[i]=y/e,p)[m]||y,f?_:k.a(_)},v.daysInMonth=function(){return this.endOf(c).$D},v.$locale=function(){return x[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=b(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return k.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),M=T.prototype;return E.prototype=M,[["$ms",r],["$s",i],["$m",o],["$H",a],["$W",s],["$M",c],["$y",h],["$D",d]].forEach((function(e){M[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),E.extend=function(e,t){return e.$i||(e(t,T,E),e.$i=!0),E},E.locale=b,E.isDayjs=w,E.unix=function(e){return E(1e3*e)},E.en=x[_],E.Ls=x,E.p={},E}()}(Se);var Ce=Se.exports,Ae=Object.defineProperty,Ie=(e,t,n)=>(((e,t,n)=>{t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let Re=new class{constructor(){Ie(this,"current",this.detect()),Ie(this,"handoffState","pending"),Ie(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},Le=(t,n)=>{Re.isServer?e.useEffect(t,n):e.useLayoutEffect(t,n)};function ze(t){let n=e.useRef(t);return Le((()=>{n.current=t}),[t]),n}function Pe(t,n){let[r,i]=e.useState(t),o=ze(t);return Le((()=>i(o.current)),[o,i,...n]),r}function Oe(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function De(){let e=[],t={addEventListener:(e,n,r,i)=>(e.addEventListener(n,r,i),t.add((()=>e.removeEventListener(n,r,i)))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add((()=>cancelAnimationFrame(n)))},nextFrame:(...e)=>t.requestAnimationFrame((()=>t.requestAnimationFrame(...e))),setTimeout(...e){let n=setTimeout(...e);return t.add((()=>clearTimeout(n)))},microTask(...e){let n={current:!0};return Oe((()=>{n.current&&e[0]()})),t.add((()=>{n.current=!1}))},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add((()=>{Object.assign(e.style,{[t]:r})}))},group(e){let t=De();return e(t),this.add((()=>t.dispose()))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Be(){let[t]=e.useState(De);return e.useEffect((()=>()=>t.dispose()),[t]),t}let Fe=function(e){let t=ze(e);return s.default.useCallback(((...e)=>t.current(...e)),[t])};function je(){let[t,n]=e.useState(Re.isHandoffComplete);return t&&!1===Re.isHandoffComplete&&n(!1),e.useEffect((()=>{!0!==t&&n(!0)}),[t]),e.useEffect((()=>Re.handoff()),[]),t}var Ne;let Ve=null!=(Ne=s.default.useId)?Ne:function(){let e=je(),[t,n]=s.default.useState(e?()=>Re.nextId():null);return Le((()=>{null===t&&n(Re.nextId())}),[t]),null!=t?""+t:void 0};function Ue(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ue),r}function He(e){return Re.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let We=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var $e=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))($e||{}),Ge=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ge||{}),qe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(qe||{});function Ze(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(We)).sort(((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER))))}var Xe=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Xe||{});function Ye(e,t=0){var n;return e!==(null==(n=He(e))?void 0:n.body)&&Ue(t,{0:()=>e.matches(We),1(){let t=e;for(;null!==t;){if(t.matches(We))return!0;t=t.parentElement}return!1}})}function Ke(e){let t=He(e);De().nextFrame((()=>{t&&!Ye(t.activeElement,0)&&Qe(e)}))}var Je=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Je||{});function Qe(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",(e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")}),!0),document.addEventListener("click",(e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")}),!0));let et=["textarea","input"].join(",");function tt(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function nt(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?n?tt(e):e:Ze(e);i.length>0&&a.length>1&&(a=a.filter((e=>!i.includes(e)))),r=null!=r?r:o.activeElement;let s,l=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,a.indexOf(r))-1;if(4&t)return Math.max(0,a.indexOf(r))+1;if(8&t)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=32&t?{preventScroll:!0}:{},h=0,d=a.length;do{if(h>=d||h+d<=0)return 0;let e=c+h;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}s=a[e],null==s||s.focus(u),h+=l}while(s!==o.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,et))&&n}(s)&&s.select(),2}function rt(t,n,r){let i=ze(n);e.useEffect((()=>{function e(e){i.current(e)}return document.addEventListener(t,e,r),()=>document.removeEventListener(t,e,r)}),[t,r])}function it(t,n,r=!0){let i=e.useRef(!1);function o(e,r){if(!i.current||e.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t),a=r(e);if(null!==a&&a.getRootNode().contains(a)){for(let t of o){if(null===t)continue;let n=t instanceof HTMLElement?t:t.current;if(null!=n&&n.contains(a)||e.composed&&e.composedPath().includes(n))return}return!Ye(a,Xe.Loose)&&-1!==a.tabIndex&&e.preventDefault(),n(e,a)}}e.useEffect((()=>{requestAnimationFrame((()=>{i.current=r}))}),[r]);let a=e.useRef(null);rt("mousedown",(e=>{var t,n;i.current&&(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),rt("click",(e=>{a.current&&(o(e,(()=>a.current)),a.current=null)}),!0),rt("blur",(e=>o(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}function ot(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function at(t,n){let[r,i]=e.useState((()=>ot(t)));return Le((()=>{i(ot(t))}),[t.type,t.as]),Le((()=>{r||n.current&&n.current instanceof HTMLButtonElement&&!n.current.hasAttribute("type")&&i("button")}),[r,n]),r}let st=Symbol();function lt(e,t=!0){return Object.assign(e,{[st]:t})}function ct(...t){let n=e.useRef(t);e.useEffect((()=>{n.current=t}),[t]);let r=Fe((e=>{for(let t of n.current)null!=t&&("function"==typeof t?t(e):t.current=e)}));return t.every((e=>null==e||(null==e?void 0:e[st])))?void 0:r}function ut({container:t,accept:n,walk:r,enabled:i=!0}){let o=e.useRef(n),a=e.useRef(r);e.useEffect((()=>{o.current=n,a.current=r}),[n,r]),Le((()=>{if(!t||!i)return;let e=He(t);if(!e)return;let n=o.current,r=a.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=e.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)r(l.currentNode)}),[t,i,o,a])}var ht=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ht||{});function dt(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}function ft(...e){return e.filter(Boolean).join(" ")}var pt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(pt||{}),mt=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(mt||{});function gt({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:a}){let s=yt(t,e);if(o)return vt(s,n,r,a);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=s;if(e)return vt(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return Ue(e?0:1,{0:()=>null,1:()=>vt({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return vt(s,n,r,a)}function vt(t,n={},r,i){let{as:o=r,children:a,refName:s="ref",...l}=wt(t,["unmount","static"]),c=void 0!==t.ref?{[s]:t.ref}:{},u="function"==typeof a?a(n):a;"className"in l&&l.className&&"function"==typeof l.className&&(l.className=l.className(n));let h={};if(n){let e=!1,t=[];for(let[r,i]of Object.entries(n))"boolean"==typeof i&&(e=!0),!0===i&&t.push(r);e&&(h["data-headlessui-state"]=t.join(" "))}if(o===e.Fragment&&Object.keys(xt(l)).length>0){if(!e.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map((e=>`  - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>`  - ${e}`)).join("\n")].join("\n"));let t=u.props,n="function"==typeof(null==t?void 0:t.className)?(...e)=>ft(null==t?void 0:t.className(...e),l.className):ft(null==t?void 0:t.className,l.className),r=n?{className:n}:{};return e.cloneElement(u,Object.assign({},yt(u.props,xt(wt(l,["ref"]))),h,c,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,c.ref),r))}return e.createElement(o,Object.assign({},wt(l,["ref"]),o!==e.Fragment&&c,o!==e.Fragment&&h),u)}function yt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function _t(t){var n;return Object.assign(e.forwardRef(t),{displayName:null!=(n=t.displayName)?n:t.name})}function xt(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function wt(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function bt(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}function Et(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Tt(n,kt(t,r),i);return n}function kt(e,t){return e?e+"["+t+"]":t}function Tt(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Tt(e,kt(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):Et(n,t,e)}function Mt(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}var St=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(St||{});let Ct=_t((function(e,t){let{features:n=1,...r}=e;return gt({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})})),At=e.createContext(null);At.displayName="OpenClosedContext";var It=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(It||{});function Rt(){return e.useContext(At)}function Lt({value:e,children:t}){return s.default.createElement(At.Provider,{value:e},t)}var zt=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(zt||{});function Pt(t,n,r){let[i,o]=e.useState(r),a=void 0!==t,s=e.useRef(a),l=e.useRef(!1),c=e.useRef(!1);return!a||s.current||l.current?!a&&s.current&&!c.current&&(c.current=!0,s.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(l.current=!0,s.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[a?t:i,Fe((e=>(a||o(e),null==n?void 0:n(e))))]}function Ot(t,n){let r=e.useRef([]),i=Fe(t);e.useEffect((()=>{let e=[...r.current];for(let[t,o]of n.entries())if(r.current[t]!==o){let t=i(n,e);return r.current=n,t}}),[i,...n])}function Dt(e){return[e.screenX,e.screenY]}function Bt(){let t=e.useRef([-1,-1]);return{wasMoved(e){let n=Dt(e);return(t.current[0]!==n[0]||t.current[1]!==n[1])&&(t.current=n,!0)},update(e){t.current=Dt(e)}}}function Ft(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function jt(){return Ft()||/Android/gi.test(window.navigator.userAgent)}var Nt=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Nt||{}),Vt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Vt||{}),Ut=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Ut||{}),Ht=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e))(Ht||{});function Wt(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=tt(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let $t={1(e){var t;return null!=(t=e.dataRef.current)&&t.disabled||1===e.comboboxState?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t;if(null!=(t=e.dataRef.current)&&t.disabled||0===e.comboboxState)return e;let n=e.activeOptionIndex;if(e.dataRef.current){let{isSelected:t}=e.dataRef.current,r=e.options.findIndex((e=>t(e.dataRef.current.value)));-1!==r&&(n=r)}return{...e,comboboxState:0,activeOptionIndex:n}},2(e,t){var n,r,i,o;if(null!=(n=e.dataRef.current)&&n.disabled||null!=(r=e.dataRef.current)&&r.optionsRef.current&&(null==(i=e.dataRef.current)||!i.optionsPropsRef.current.static)&&1===e.comboboxState)return e;let a=Wt(e);if(null===a.activeOptionIndex){let e=a.options.findIndex((e=>!e.dataRef.current.disabled));-1!==e&&(a.activeOptionIndex=e)}let s=dt(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...a,activeOptionIndex:s,activationTrigger:null!=(o=t.trigger)?o:1}},3:(e,t)=>{var n,r;let i={id:t.id,dataRef:t.dataRef},o=Wt(e,(e=>[...e,i]));null===e.activeOptionIndex&&null!=(n=e.dataRef.current)&&n.isSelected(t.dataRef.current.value)&&(o.activeOptionIndex=o.options.indexOf(i));let a={...e,...o,activationTrigger:1};return null!=(r=e.dataRef.current)&&r.__demoMode&&void 0===e.dataRef.current.value&&(a.activeOptionIndex=0),a},4:(e,t)=>{let n=Wt(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}},5:(e,t)=>({...e,labelId:t.id})},Gt=e.createContext(null);function qt(t){let n=e.useContext(Gt);if(null===n){let e=new Error(`<${t} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,qt),e}return n}Gt.displayName="ComboboxActionsContext";let Zt=e.createContext(null);function Xt(t){let n=e.useContext(Zt);if(null===n){let e=new Error(`<${t} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Xt),e}return n}function Yt(e,t){return Ue(t.type,$t,e,t)}Zt.displayName="ComboboxDataContext";let Kt=e.Fragment;let Jt=pt.RenderStrategy|pt.Static;let Qt=_t((function(t,n){let{value:r,defaultValue:i,onChange:o,form:a,name:l,by:c=((e,t)=>e===t),disabled:u=!1,__demoMode:h=!1,nullable:d=!1,multiple:f=!1,...p}=t,[m=(f?[]:void 0),g]=Pt(r,o,i),[v,y]=e.useReducer(Yt,{dataRef:e.createRef(),comboboxState:h?0:1,options:[],activeOptionIndex:null,activationTrigger:1,labelId:null}),_=e.useRef(!1),x=e.useRef({static:!1,hold:!1}),w=e.useRef(null),b=e.useRef(null),E=e.useRef(null),k=e.useRef(null),T=Fe("string"==typeof c?(e,t)=>{let n=c;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:c),M=e.useCallback((e=>Ue(S.mode,{1:()=>m.some((t=>T(t,e))),0:()=>T(m,e)})),[m]),S=e.useMemo((()=>({...v,optionsPropsRef:x,labelRef:w,inputRef:b,buttonRef:E,optionsRef:k,value:m,defaultValue:i,disabled:u,mode:f?1:0,get activeOptionIndex(){if(_.current&&null===v.activeOptionIndex&&v.options.length>0){let e=v.options.findIndex((e=>!e.dataRef.current.disabled));if(-1!==e)return e}return v.activeOptionIndex},compare:T,isSelected:M,nullable:d,__demoMode:h})),[m,i,u,f,d,h,v]),C=e.useRef(null!==S.activeOptionIndex?S.options[S.activeOptionIndex]:null);e.useEffect((()=>{let e=null!==S.activeOptionIndex?S.options[S.activeOptionIndex]:null;C.current!==e&&(C.current=e)})),Le((()=>{v.dataRef.current=S}),[S]),it([S.buttonRef,S.inputRef,S.optionsRef],(()=>F.closeCombobox()),0===S.comboboxState);let A=e.useMemo((()=>({open:0===S.comboboxState,disabled:u,activeIndex:S.activeOptionIndex,activeOption:null===S.activeOptionIndex?null:S.options[S.activeOptionIndex].dataRef.current.value,value:m})),[S,u,m]),I=Fe((e=>{let t=S.options.find((t=>t.id===e));t&&B(t.dataRef.current.value)})),R=Fe((()=>{if(null!==S.activeOptionIndex){let{dataRef:e,id:t}=S.options[S.activeOptionIndex];B(e.current.value),F.goToOption(ht.Specific,t)}})),L=Fe((()=>{y({type:0}),_.current=!0})),z=Fe((()=>{y({type:1}),_.current=!1})),P=Fe(((e,t,n)=>(_.current=!1,e===ht.Specific?y({type:2,focus:ht.Specific,id:t,trigger:n}):y({type:2,focus:e,trigger:n})))),O=Fe(((e,t)=>(y({type:3,id:e,dataRef:t}),()=>{var t;(null==(t=C.current)?void 0:t.id)===e&&(_.current=!0),y({type:4,id:e})}))),D=Fe((e=>(y({type:5,id:e}),()=>y({type:5,id:null})))),B=Fe((e=>Ue(S.mode,{0:()=>null==g?void 0:g(e),1(){let t=S.value.slice(),n=t.findIndex((t=>T(t,e)));return-1===n?t.push(e):t.splice(n,1),null==g?void 0:g(t)}}))),F=e.useMemo((()=>({onChange:B,registerOption:O,registerLabel:D,goToOption:P,closeCombobox:z,openCombobox:L,selectActiveOption:R,selectOption:I})),[]),j=null===n?{}:{ref:n},N=e.useRef(null),V=Be();return e.useEffect((()=>{N.current&&void 0!==i&&V.addEventListener(N.current,"reset",(()=>{B(i)}))}),[N,B]),s.default.createElement(Gt.Provider,{value:F},s.default.createElement(Zt.Provider,{value:S},s.default.createElement(Lt,{value:Ue(S.comboboxState,{0:It.Open,1:It.Closed})},null!=l&&null!=m&&Et({[l]:m}).map((([e,t],n)=>s.default.createElement(Ct,{features:St.Hidden,ref:0===n?e=>{var t;N.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...xt({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:a,name:e,value:t})}))),gt({ourProps:j,theirProps:p,slot:A,defaultTag:Kt,name:"Combobox"}))))})),en=_t((function(t,n){var r;let i=Xt("Combobox.Button"),o=qt("Combobox.Button"),a=ct(i.buttonRef,n),s=Ve(),{id:l=`headlessui-combobox-button-${s}`,...c}=t,u=Be(),h=Fe((e=>{switch(e.key){case zt.ArrowDown:return e.preventDefault(),e.stopPropagation(),1===i.comboboxState&&o.openCombobox(),u.nextFrame((()=>{var e;return null==(e=i.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case zt.ArrowUp:return e.preventDefault(),e.stopPropagation(),1===i.comboboxState&&(o.openCombobox(),u.nextFrame((()=>{i.value||o.goToOption(ht.Last)}))),u.nextFrame((()=>{var e;return null==(e=i.inputRef.current)?void 0:e.focus({preventScroll:!0})}));case zt.Escape:return 0!==i.comboboxState?void 0:(e.preventDefault(),i.optionsRef.current&&!i.optionsPropsRef.current.static&&e.stopPropagation(),o.closeCombobox(),u.nextFrame((()=>{var e;return null==(e=i.inputRef.current)?void 0:e.focus({preventScroll:!0})})));default:return}})),d=Fe((e=>{if(bt(e.currentTarget))return e.preventDefault();0===i.comboboxState?o.closeCombobox():(e.preventDefault(),o.openCombobox()),u.nextFrame((()=>{var e;return null==(e=i.inputRef.current)?void 0:e.focus({preventScroll:!0})}))})),f=Pe((()=>{if(i.labelId)return[i.labelId,l].join(" ")}),[i.labelId,l]),p=e.useMemo((()=>({open:0===i.comboboxState,disabled:i.disabled,value:i.value})),[i]);return gt({ourProps:{ref:a,id:l,type:at(t,i.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":null==(r=i.optionsRef.current)?void 0:r.id,"aria-expanded":i.disabled?void 0:0===i.comboboxState,"aria-labelledby":f,disabled:i.disabled,onClick:d,onKeyDown:h},theirProps:c,slot:p,defaultTag:"button",name:"Combobox.Button"})})),tn=_t((function(t,n){var r,i,o,a;let s=Ve(),{id:l=`headlessui-combobox-input-${s}`,onChange:c,displayValue:u,type:h="text",...d}=t,f=Xt("Combobox.Input"),p=qt("Combobox.Input"),m=ct(f.inputRef,n),g=e.useRef(!1),v=Be(),y=function(){var e;return"function"==typeof u&&void 0!==f.value?null!=(e=u(f.value))?e:"":"string"==typeof f.value?f.value:""}();Ot((([e,t],[n,r])=>{g.current||f.inputRef.current&&(0===r&&1===t||e!==n)&&(f.inputRef.current.value=e)}),[y,f.comboboxState]),Ot((([e],[t])=>{if(0===e&&1===t){let e=f.inputRef.current;if(!e)return;let t=e.value,{selectionStart:n,selectionEnd:r,selectionDirection:i}=e;e.value="",e.value=t,null!==i?e.setSelectionRange(n,r,i):e.setSelectionRange(n,r)}}),[f.comboboxState]);let _=e.useRef(!1),x=Fe((()=>{_.current=!0})),w=Fe((()=>{setTimeout((()=>{_.current=!1}))})),b=Fe((e=>{switch(g.current=!0,e.key){case zt.Backspace:case zt.Delete:if(0!==f.mode||!f.nullable)return;let t=e.currentTarget;v.requestAnimationFrame((()=>{""===t.value&&(p.onChange(null),f.optionsRef.current&&(f.optionsRef.current.scrollTop=0),p.goToOption(ht.Nothing))}));break;case zt.Enter:if(g.current=!1,0!==f.comboboxState||_.current)return;if(e.preventDefault(),e.stopPropagation(),null===f.activeOptionIndex)return void p.closeCombobox();p.selectActiveOption(),0===f.mode&&p.closeCombobox();break;case zt.ArrowDown:return g.current=!1,e.preventDefault(),e.stopPropagation(),Ue(f.comboboxState,{0:()=>{p.goToOption(ht.Next)},1:()=>{p.openCombobox()}});case zt.ArrowUp:return g.current=!1,e.preventDefault(),e.stopPropagation(),Ue(f.comboboxState,{0:()=>{p.goToOption(ht.Previous)},1:()=>{p.openCombobox(),v.nextFrame((()=>{f.value||p.goToOption(ht.Last)}))}});case zt.Home:if(e.shiftKey)break;return g.current=!1,e.preventDefault(),e.stopPropagation(),p.goToOption(ht.First);case zt.PageUp:return g.current=!1,e.preventDefault(),e.stopPropagation(),p.goToOption(ht.First);case zt.End:if(e.shiftKey)break;return g.current=!1,e.preventDefault(),e.stopPropagation(),p.goToOption(ht.Last);case zt.PageDown:return g.current=!1,e.preventDefault(),e.stopPropagation(),p.goToOption(ht.Last);case zt.Escape:return g.current=!1,0!==f.comboboxState?void 0:(e.preventDefault(),f.optionsRef.current&&!f.optionsPropsRef.current.static&&e.stopPropagation(),p.closeCombobox());case zt.Tab:if(g.current=!1,0!==f.comboboxState)return;0===f.mode&&p.selectActiveOption(),p.closeCombobox()}})),E=Fe((e=>{p.openCombobox(),null==c||c(e)})),k=Fe((()=>{g.current=!1})),T=Pe((()=>{if(f.labelId)return[f.labelId].join(" ")}),[f.labelId]),M=e.useMemo((()=>({open:0===f.comboboxState,disabled:f.disabled})),[f]);return gt({ourProps:{ref:m,id:l,role:"combobox",type:h,"aria-controls":null==(r=f.optionsRef.current)?void 0:r.id,"aria-expanded":f.disabled?void 0:0===f.comboboxState,"aria-activedescendant":null===f.activeOptionIndex||null==(i=f.options[f.activeOptionIndex])?void 0:i.id,"aria-labelledby":T,"aria-autocomplete":"list",defaultValue:null!=(a=null!=(o=t.defaultValue)?o:void 0!==f.defaultValue?null==u?void 0:u(f.defaultValue):null)?a:f.defaultValue,disabled:f.disabled,onCompositionStart:x,onCompositionEnd:w,onKeyDown:b,onChange:E,onBlur:k},theirProps:d,slot:M,defaultTag:"input",name:"Combobox.Input"})})),nn=_t((function(t,n){let r=Ve(),{id:i=`headlessui-combobox-label-${r}`,...o}=t,a=Xt("Combobox.Label"),s=qt("Combobox.Label"),l=ct(a.labelRef,n);Le((()=>s.registerLabel(i)),[i]);let c=Fe((()=>{var e;return null==(e=a.inputRef.current)?void 0:e.focus({preventScroll:!0})})),u=e.useMemo((()=>({open:0===a.comboboxState,disabled:a.disabled})),[a]);return gt({ourProps:{ref:l,id:i,onClick:c},theirProps:o,slot:u,defaultTag:"label",name:"Combobox.Label"})})),rn=_t((function(t,n){let r=Ve(),{id:i=`headlessui-combobox-options-${r}`,hold:o=!1,...a}=t,s=Xt("Combobox.Options"),l=ct(s.optionsRef,n),c=Rt(),u=null!==c?(c&It.Open)===It.Open:0===s.comboboxState;Le((()=>{var e;s.optionsPropsRef.current.static=null!=(e=t.static)&&e}),[s.optionsPropsRef,t.static]),Le((()=>{s.optionsPropsRef.current.hold=o}),[s.optionsPropsRef,o]),ut({container:s.optionsRef.current,enabled:0===s.comboboxState,accept:e=>"option"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=Pe((()=>{var e,t;return null!=(t=s.labelId)?t:null==(e=s.buttonRef.current)?void 0:e.id}),[s.labelId,s.buttonRef.current]),d=e.useMemo((()=>({open:0===s.comboboxState})),[s]);return gt({ourProps:{"aria-labelledby":h,role:"listbox","aria-multiselectable":1===s.mode||void 0,id:i,ref:l},theirProps:a,slot:d,defaultTag:"ul",features:Jt,visible:u,name:"Combobox.Options"})})),on=_t((function(t,n){var r,i;let o=Ve(),{id:a=`headlessui-combobox-option-${o}`,disabled:s=!1,value:l,...c}=t,u=Xt("Combobox.Option"),h=qt("Combobox.Option"),d=null!==u.activeOptionIndex&&u.options[u.activeOptionIndex].id===a,f=u.isSelected(l),p=e.useRef(null),m=ze({disabled:s,value:l,domRef:p,textValue:null==(i=null==(r=p.current)?void 0:r.textContent)?void 0:i.toLowerCase()}),g=ct(n,p),v=Fe((()=>h.selectOption(a)));Le((()=>h.registerOption(a,m)),[m,a]);let y=e.useRef(!u.__demoMode);Le((()=>{if(!u.__demoMode)return;let e=De();return e.requestAnimationFrame((()=>{y.current=!0})),e.dispose}),[]),Le((()=>{if(0!==u.comboboxState||!d||!y.current||0===u.activationTrigger)return;let e=De();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=p.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[p,d,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let _=Fe((e=>{if(s)return e.preventDefault();v(),0===u.mode&&h.closeCombobox(),jt()||requestAnimationFrame((()=>{var e;return null==(e=u.inputRef.current)?void 0:e.focus()}))})),x=Fe((()=>{if(s)return h.goToOption(ht.Nothing);h.goToOption(ht.Specific,a)})),w=Bt(),b=Fe((e=>w.update(e))),E=Fe((e=>{w.wasMoved(e)&&(s||d||h.goToOption(ht.Specific,a,0))})),k=Fe((e=>{w.wasMoved(e)&&(s||d&&(u.optionsPropsRef.current.hold||h.goToOption(ht.Nothing)))})),T=e.useMemo((()=>({active:d,selected:f,disabled:s})),[d,f,s]);return gt({ourProps:{id:a,ref:g,role:"option",tabIndex:!0===s?void 0:-1,"aria-disabled":!0===s||void 0,"aria-selected":f,disabled:void 0,onClick:_,onFocus:x,onPointerEnter:b,onMouseEnter:b,onPointerMove:E,onMouseMove:E,onPointerLeave:k,onMouseLeave:k},theirProps:c,slot:T,defaultTag:"li",name:"Combobox.Option"})})),an=Object.assign(Qt,{Input:tn,Button:en,Label:nn,Options:rn,Option:on});var sn=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(sn||{});function ln(){let t=e.useRef(0);return function(t,n,r){let i=ze(n);e.useEffect((()=>{function e(e){i.current(e)}return window.addEventListener(t,e,r),()=>window.removeEventListener(t,e,r)}),[t,r])}("keydown",(e=>{"Tab"===e.key&&(t.current=e.shiftKey?1:0)}),!0),t}function cn(){let t=e.useRef(!1);return Le((()=>(t.current=!0,()=>{t.current=!1})),[]),t}function un(...t){return e.useMemo((()=>He(...t)),[...t])}function hn(t,n,r,i){let o=ze(r);e.useEffect((()=>{function e(e){o.current(e)}return(t=null!=t?t:window).addEventListener(n,e,i),()=>t.removeEventListener(n,e,i)}),[t,n,i])}function dn(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}var fn=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(fn||{});let pn=_t((function(t,n){let r=e.useRef(null),i=ct(r,n),{initialFocus:o,containers:a,features:l=30,...c}=t;je()||(l=1);let u=un(r);!function({ownerDocument:t},n){let r=function(t=!0){let n=e.useRef(gn.slice());return Ot((([e],[t])=>{!0===t&&!1===e&&Oe((()=>{n.current.splice(0)})),!1===t&&!0===e&&(n.current=gn.slice())}),[t,gn,n]),Fe((()=>{var e;return null!=(e=n.current.find((e=>null!=e&&e.isConnected)))?e:null}))}(n);Ot((()=>{n||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&Qe(r())}),[n]);let i=e.useRef(!1);e.useEffect((()=>(i.current=!1,()=>{i.current=!0,Oe((()=>{i.current&&Qe(r())}))})),[])}({ownerDocument:u},Boolean(16&l));let h=function({ownerDocument:t,container:n,initialFocus:r},i){let o=e.useRef(null),a=cn();return Ot((()=>{if(!i)return;let e=n.current;e&&Oe((()=>{if(!a.current)return;let n=null==t?void 0:t.activeElement;if(null!=r&&r.current){if((null==r?void 0:r.current)===n)return void(o.current=n)}else if(e.contains(n))return void(o.current=n);null!=r&&r.current?Qe(r.current):nt(e,$e.First)===Ge.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=null==t?void 0:t.activeElement}))}),[i]),o}({ownerDocument:u,container:r,initialFocus:o},Boolean(2&l));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},i){let o=cn();hn(null==e?void 0:e.defaultView,"focus",(e=>{if(!i||!o.current)return;let a=dn(n);t.current instanceof HTMLElement&&a.add(t.current);let s=r.current;if(!s)return;let l=e.target;l&&l instanceof HTMLElement?vn(a,l)?(r.current=l,Qe(l)):(e.preventDefault(),e.stopPropagation(),Qe(s)):Qe(r.current)}),!0)}({ownerDocument:u,container:r,containers:a,previousActiveElement:h},Boolean(8&l));let d=ln(),f=Fe((e=>{let t=r.current;t&&Ue(d.current,{[sn.Forwards]:()=>{nt(t,$e.First,{skipElements:[e.relatedTarget]})},[sn.Backwards]:()=>{nt(t,$e.Last,{skipElements:[e.relatedTarget]})}})})),p=Be(),m=e.useRef(!1),g={ref:i,onKeyDown(e){"Tab"==e.key&&(m.current=!0,p.requestAnimationFrame((()=>{m.current=!1})))},onBlur(e){let t=dn(a);r.current instanceof HTMLElement&&t.add(r.current);let n=e.relatedTarget;n instanceof HTMLElement&&"true"!==n.dataset.headlessuiFocusGuard&&(vn(t,n)||(m.current?nt(r.current,Ue(d.current,{[sn.Forwards]:()=>$e.Next,[sn.Backwards]:()=>$e.Previous})|$e.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&Qe(e.target)))}};return s.default.createElement(s.default.Fragment,null,Boolean(4&l)&&s.default.createElement(Ct,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:St.Focusable}),gt({ourProps:g,theirProps:c,defaultTag:"div",name:"FocusTrap"}),Boolean(4&l)&&s.default.createElement(Ct,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:St.Focusable}))})),mn=Object.assign(pn,{features:fn}),gn=[];function vn(e,t){for(let n of e)if(n.contains(t))return!0;return!1}!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}((()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&gn[0]!==e.target&&(gn.unshift(e.target),gn=gn.filter((e=>null!=e&&e.isConnected)),gn.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})}));let yn=e.createContext(!1);function _n(){return e.useContext(yn)}function xn(e){return s.default.createElement(yn.Provider,{value:e.force},e.children)}let wn=e.Fragment;let bn=e.Fragment,En=e.createContext(null);let kn=_t((function(n,r){let i=n,o=e.useRef(null),a=ct(lt((e=>{o.current=e})),r),s=un(o),l=function(t){let n=_n(),r=e.useContext(En),i=un(t),[o,a]=e.useState((()=>{if(!n&&null!==r||Re.isServer)return null;let e=null==i?void 0:i.getElementById("headlessui-portal-root");if(e)return e;if(null===i)return null;let t=i.createElement("div");return t.setAttribute("id","headlessui-portal-root"),i.body.appendChild(t)}));return e.useEffect((()=>{null!==o&&(null!=i&&i.body.contains(o)||null==i||i.body.appendChild(o))}),[o,i]),e.useEffect((()=>{n||null!==r&&a(r.current)}),[r,a,n]),o}(o),[c]=e.useState((()=>{var e;return Re.isServer?null:null!=(e=null==s?void 0:s.createElement("div"))?e:null})),u=je(),h=e.useRef(!1);return Le((()=>{if(h.current=!1,l&&c)return l.contains(c)||(c.setAttribute("data-headlessui-portal",""),l.appendChild(c)),()=>{h.current=!0,Oe((()=>{var e;h.current&&(!l||!c||(c instanceof Node&&l.contains(c)&&l.removeChild(c),l.childNodes.length<=0&&(null==(e=l.parentElement)||e.removeChild(l))))}))}}),[l,c]),u&&l&&c?t.createPortal(gt({ourProps:{ref:a},theirProps:i,defaultTag:wn,name:"Portal"}),c):null})),Tn=_t((function(e,t){let{target:n,...r}=e,i={ref:ct(t)};return s.default.createElement(En.Provider,{value:n},gt({ourProps:i,theirProps:r,defaultTag:bn,name:"Popover.Group"}))})),Mn=Object.assign(kn,{Group:Tn}),Sn=e.createContext(null);function Cn(){let t=e.useContext(Sn);if(null===t){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Cn),e}return t}function An(){let[t,n]=e.useState([]);return[t.length>0?t.join(" "):void 0,e.useMemo((()=>function(t){let r=Fe((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=e.useMemo((()=>({register:r,slot:t.slot,name:t.name,props:t.props})),[r,t.slot,t.name,t.props]);return s.default.createElement(Sn.Provider,{value:i},t.children)}),[n])]}let In=_t((function(e,t){let n=Ve(),{id:r=`headlessui-description-${n}`,...i}=e,o=Cn(),a=ct(t);return Le((()=>o.register(r)),[r,o.register]),gt({ourProps:{ref:a,...o.props,id:r},theirProps:i,slot:o.slot||{},defaultTag:"p",name:o.name||"Description"})})),Rn=Object.assign(In,{}),Ln=e.createContext((()=>{}));Ln.displayName="StackContext";var zn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(zn||{});function Pn({children:t,onUpdate:n,type:r,element:i,enabled:o}){let a=e.useContext(Ln),l=Fe(((...e)=>{null==n||n(...e),a(...e)}));return Le((()=>{let e=void 0===o||!0===o;return e&&l(0,r,i),()=>{e&&l(1,r,i)}}),[l,r,i,o]),s.default.createElement(Ln.Provider,{value:l},t)}const On="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},{useState:Dn,useEffect:Bn,useLayoutEffect:Fn,useDebugValue:jn}=a;function Nn(e){const t=e.getSnapshot,n=e.value;try{const e=t();return!On(n,e)}catch{return!0}}const Vn=!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement)?function(e,t,n){return t()}:function(e,t,n){const r=t(),[{inst:i},o]=Dn({inst:{value:r,getSnapshot:t}});return Fn((()=>{i.value=r,i.getSnapshot=t,Nn(i)&&o({inst:i})}),[e,r,t]),Bn((()=>(Nn(i)&&o({inst:i}),e((()=>{Nn(i)&&o({inst:i})})))),[e]),jn(r),r},Un="useSyncExternalStore"in a?(e=>e.useSyncExternalStore)(a):Vn;function Hn(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=(null!=(n=t.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,i=r.clientWidth-r.offsetWidth,o=e-i;n.style(r,"paddingRight",`${o}px`)}}}function Wn(){if(!Ft())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:n,meta:r}){function i(e){return r.containers.flatMap((e=>e())).some((t=>t.contains(e)))}n.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let o=null;n.addEventListener(t,"click",(e=>{if(e.target instanceof HTMLElement)try{let n=e.target.closest("a");if(!n)return;let{hash:r}=new URL(n.href),a=t.querySelector(r);a&&!i(a)&&(o=a)}catch{}}),!0),n.addEventListener(t,"touchmove",(e=>{e.target instanceof HTMLElement&&!i(e.target)&&e.preventDefault()}),{passive:!1}),n.add((()=>{window.scrollTo(0,window.pageYOffset+e),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)}))}}}function $n(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Gn=function(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...i){let o=t[e].call(n,...i);o&&(n=o,r.forEach((e=>e())))}}}((()=>new Map),{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:De(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:$n(n)},i=[Wn(),Hn(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];i.forEach((({before:e})=>null==e?void 0:e(r))),i.forEach((({after:e})=>null==e?void 0:e(r)))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function qn(e,t,n){let r=function(e){return Un(e.subscribe,e.getSnapshot,e.getSnapshot)}(Gn),i=e?r.get(e):void 0,o=!!i&&i.count>0;return Le((()=>{if(e&&t)return Gn.dispatch("PUSH",e,n),()=>Gn.dispatch("POP",e,n)}),[t,e]),o}Gn.subscribe((()=>{let e=Gn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&Gn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&Gn.dispatch("TEARDOWN",n)}}));let Zn=new Map,Xn=new Map;function Yn(e,t=!0){Le((()=>{var n;if(!t)return;let r="function"==typeof e?e():e.current;if(!r)return;let i=null!=(n=Xn.get(r))?n:0;return Xn.set(r,i+1),0!==i||(Zn.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var e;if(!r)return;let t=null!=(e=Xn.get(r))?e:1;if(1===t?Xn.delete(r):Xn.set(r,t-1),1!==t)return;let n=Zn.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,Zn.delete(r))}}),[e,t])}var Kn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Kn||{}),Jn=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Jn||{});let Qn={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},er=e.createContext(null);function tr(t){let n=e.useContext(er);if(null===n){let e=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,tr),e}return n}function nr(e,t){return Ue(t.type,Qn,e,t)}er.displayName="DialogContext";let rr=pt.RenderStrategy|pt.Static;let ir=_t((function(t,n){let r=Ve(),{id:i=`headlessui-dialog-${r}`,open:o,onClose:a,initialFocus:l,__demoMode:c=!1,...u}=t,[h,d]=e.useState(0),f=Rt();void 0===o&&null!==f&&(o=(f&It.Open)===It.Open);let p=e.useRef(null),m=ct(p,n),g=e.useRef(null),v=un(p),y=t.hasOwnProperty("open")||null!==f,_=t.hasOwnProperty("onClose");if(!y&&!_)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!y)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!_)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof o)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if("function"!=typeof a)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let x=o?0:1,[w,b]=e.useReducer(nr,{titleId:null,descriptionId:null,panelRef:e.createRef()}),E=Fe((()=>a(!1))),k=Fe((e=>b({type:0,id:e}))),T=!!je()&&(!c&&0===x),M=h>1,S=null!==e.useContext(er),C=M?"parent":"leaf",A=null!==f&&(f&It.Closing)===It.Closing,I=!S&&!A&&T,R=e.useCallback((()=>{var e,t;return null!=(t=Array.from(null!=(e=null==v?void 0:v.querySelectorAll("body > *"))?e:[]).find((e=>"headlessui-portal-root"!==e.id&&(e.contains(g.current)&&e instanceof HTMLElement))))?t:null}),[g]);Yn(R,I);let L=!!M||T,z=e.useCallback((()=>{var e,t;return null!=(t=Array.from(null!=(e=null==v?void 0:v.querySelectorAll("[data-headlessui-portal]"))?e:[]).find((e=>e.contains(g.current)&&e instanceof HTMLElement)))?t:null}),[g]);Yn(z,L);let P=Fe((()=>{var e,t;return[...Array.from(null!=(e=null==v?void 0:v.querySelectorAll("html > *, body > *, [data-headlessui-portal]"))?e:[]).filter((e=>!(e===document.body||e===document.head||!(e instanceof HTMLElement)||e.contains(g.current)||w.panelRef.current&&e.contains(w.panelRef.current)))),null!=(t=w.panelRef.current)?t:p.current]}));it((()=>P()),E,!(!T||M));let O=!(M||0!==x);hn(null==v?void 0:v.defaultView,"keydown",(e=>{O&&(e.defaultPrevented||e.key===zt.Escape&&(e.preventDefault(),e.stopPropagation(),E()))})),function(e,t,n=(()=>[document.body])){qn(e,t,(e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}}))}(v,!(A||0!==x||S),P),e.useEffect((()=>{if(0!==x||!p.current)return;let e=new ResizeObserver((e=>{for(let t of e){let e=t.target.getBoundingClientRect();0===e.x&&0===e.y&&0===e.width&&0===e.height&&E()}}));return e.observe(p.current),()=>e.disconnect()}),[x,p,E]);let[D,B]=An(),F=e.useMemo((()=>[{dialogState:x,close:E,setTitleId:k},w]),[x,w,E,k]),j=e.useMemo((()=>({open:0===x})),[x]),N={ref:m,id:i,role:"dialog","aria-modal":0===x||void 0,"aria-labelledby":w.titleId,"aria-describedby":D};return s.default.createElement(Pn,{type:"Dialog",enabled:0===x,element:p,onUpdate:Fe(((e,t)=>{"Dialog"===t&&Ue(e,{[zn.Add]:()=>d((e=>e+1)),[zn.Remove]:()=>d((e=>e-1))})}))},s.default.createElement(xn,{force:!0},s.default.createElement(Mn,null,s.default.createElement(er.Provider,{value:F},s.default.createElement(Mn.Group,{target:p},s.default.createElement(xn,{force:!1},s.default.createElement(B,{slot:j,name:"Dialog.Description"},s.default.createElement(mn,{initialFocus:l,containers:P,features:T?Ue(C,{parent:mn.features.RestoreFocus,leaf:mn.features.All&~mn.features.FocusLock}):mn.features.None},gt({ourProps:N,theirProps:u,slot:j,defaultTag:"div",features:rr,visible:0===x,name:"Dialog"})))))))),s.default.createElement(Ct,{features:St.Hidden,ref:g}))})),or=_t((function(t,n){let r=Ve(),{id:i=`headlessui-dialog-backdrop-${r}`,...o}=t,[{dialogState:a},l]=tr("Dialog.Backdrop"),c=ct(n);e.useEffect((()=>{if(null===l.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[l.panelRef]);let u=e.useMemo((()=>({open:0===a})),[a]);return s.default.createElement(xn,{force:!0},s.default.createElement(Mn,null,gt({ourProps:{ref:c,id:i,"aria-hidden":!0},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Backdrop"})))})),ar=_t((function(t,n){let r=Ve(),{id:i=`headlessui-dialog-panel-${r}`,...o}=t,[{dialogState:a},s]=tr("Dialog.Panel"),l=ct(n,s.panelRef),c=e.useMemo((()=>({open:0===a})),[a]),u=Fe((e=>{e.stopPropagation()}));return gt({ourProps:{ref:l,id:i,onClick:u},theirProps:o,slot:c,defaultTag:"div",name:"Dialog.Panel"})})),sr=_t((function(t,n){let r=Ve(),{id:i=`headlessui-dialog-overlay-${r}`,...o}=t,[{dialogState:a,close:s}]=tr("Dialog.Overlay"),l=ct(n),c=Fe((e=>{if(e.target===e.currentTarget){if(bt(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),s()}}));return gt({ourProps:{ref:l,id:i,"aria-hidden":!0,onClick:c},theirProps:o,slot:e.useMemo((()=>({open:0===a})),[a]),defaultTag:"div",name:"Dialog.Overlay"})})),lr=_t((function(t,n){let r=Ve(),{id:i=`headlessui-dialog-title-${r}`,...o}=t,[{dialogState:a,setTitleId:s}]=tr("Dialog.Title"),l=ct(n);e.useEffect((()=>(s(i),()=>s(null))),[i,s]);let c=e.useMemo((()=>({open:0===a})),[a]);return gt({ourProps:{ref:l,id:i},theirProps:o,slot:c,defaultTag:"h2",name:"Dialog.Title"})}));var cr;Object.assign(ir,{Backdrop:or,Panel:ar,Overlay:sr,Title:lr,Description:Rn});let ur=null!=(cr=s.default.startTransition)?cr:function(e){e()};var hr=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(hr||{}),dr=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel",e))(dr||{});let fr={0:e=>({...e,disclosureState:Ue(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},4:e=>!0===e.linkedPanel?e:{...e,linkedPanel:!0},5:e=>!1===e.linkedPanel?e:{...e,linkedPanel:!1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},pr=e.createContext(null);function mr(t){let n=e.useContext(pr);if(null===n){let e=new Error(`<${t} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,mr),e}return n}pr.displayName="DisclosureContext";let gr=e.createContext(null);function vr(t){let n=e.useContext(gr);if(null===n){let e=new Error(`<${t} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,vr),e}return n}gr.displayName="DisclosureAPIContext";let yr=e.createContext(null);function _r(e,t){return Ue(t.type,fr,e,t)}yr.displayName="DisclosurePanelContext";let xr=e.Fragment;let wr=pt.RenderStrategy|pt.Static;let br=_t((function(t,n){let{defaultOpen:r=!1,...i}=t,o=e.useRef(null),a=ct(n,lt((e=>{o.current=e}),void 0===t.as||t.as===e.Fragment)),l=e.useRef(null),c=e.useRef(null),u=e.useReducer(_r,{disclosureState:r?0:1,linkedPanel:!1,buttonRef:c,panelRef:l,buttonId:null,panelId:null}),[{disclosureState:h,buttonId:d},f]=u,p=Fe((e=>{f({type:1});let t=He(o);if(!t||!d)return;let n=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(d):t.getElementById(d);null==n||n.focus()})),m=e.useMemo((()=>({close:p})),[p]),g=e.useMemo((()=>({open:0===h,close:p})),[h,p]),v={ref:a};return s.default.createElement(pr.Provider,{value:u},s.default.createElement(gr.Provider,{value:m},s.default.createElement(Lt,{value:Ue(h,{0:It.Open,1:It.Closed})},gt({ourProps:v,theirProps:i,slot:g,defaultTag:xr,name:"Disclosure"}))))})),Er=_t((function(t,n){let r=Ve(),{id:i=`headlessui-disclosure-button-${r}`,...o}=t,[a,s]=mr("Disclosure.Button"),l=e.useContext(yr),c=null!==l&&l===a.panelId,u=e.useRef(null),h=ct(u,n,c?null:a.buttonRef);e.useEffect((()=>{if(!c)return s({type:2,buttonId:i}),()=>{s({type:2,buttonId:null})}}),[i,s,c]);let d=Fe((e=>{var t;if(c){if(1===a.disclosureState)return;switch(e.key){case zt.Space:case zt.Enter:e.preventDefault(),e.stopPropagation(),s({type:0}),null==(t=a.buttonRef.current)||t.focus()}}else switch(e.key){case zt.Space:case zt.Enter:e.preventDefault(),e.stopPropagation(),s({type:0})}})),f=Fe((e=>{if(e.key===zt.Space)e.preventDefault()})),p=Fe((e=>{var n;bt(e.currentTarget)||t.disabled||(c?(s({type:0}),null==(n=a.buttonRef.current)||n.focus()):s({type:0}))})),m=e.useMemo((()=>({open:0===a.disclosureState})),[a]),g=at(t,u);return gt({ourProps:c?{ref:h,type:g,onKeyDown:d,onClick:p}:{ref:h,id:i,type:g,"aria-expanded":t.disabled?void 0:0===a.disclosureState,"aria-controls":a.linkedPanel?a.panelId:void 0,onKeyDown:d,onKeyUp:f,onClick:p},theirProps:o,slot:m,defaultTag:"button",name:"Disclosure.Button"})})),kr=_t((function(t,n){let r=Ve(),{id:i=`headlessui-disclosure-panel-${r}`,...o}=t,[a,l]=mr("Disclosure.Panel"),{close:c}=vr("Disclosure.Panel"),u=ct(n,a.panelRef,(e=>{ur((()=>l({type:e?4:5})))}));e.useEffect((()=>(l({type:3,panelId:i}),()=>{l({type:3,panelId:null})})),[i,l]);let h=Rt(),d=null!==h?(h&It.Open)===It.Open:0===a.disclosureState,f=e.useMemo((()=>({open:0===a.disclosureState,close:c})),[a,c]),p={ref:u,id:i};return s.default.createElement(yr.Provider,{value:a.panelId},gt({ourProps:p,theirProps:o,slot:f,defaultTag:"div",features:wr,visible:d,name:"Disclosure.Panel"}))}));Object.assign(br,{Button:Er,Panel:kr});var Tr=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Tr||{}),Mr=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Mr||{}),Sr=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Sr||{}),Cr=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(Cr||{});function Ar(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=tt(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let Ir={1:e=>e.dataRef.current.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.dataRef.current.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex((e=>n(e.dataRef.current.value)));return-1!==r&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||1===e.listboxState)return e;let r=Ar(e),i=dt(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},4:e=>e.dataRef.current.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=Ar(e,(e=>[...e,n]));return null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=Ar(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},Rr=e.createContext(null);function Lr(t){let n=e.useContext(Rr);if(null===n){let e=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Lr),e}return n}Rr.displayName="ListboxActionsContext";let zr=e.createContext(null);function Pr(t){let n=e.useContext(zr);if(null===n){let e=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Pr),e}return n}function Or(e,t){return Ue(t.type,Ir,e,t)}zr.displayName="ListboxDataContext";let Dr=e.Fragment;let Br=pt.RenderStrategy|pt.Static;let Fr=_t((function(t,n){let{value:r,defaultValue:i,form:o,name:a,onChange:l,by:c=((e,t)=>e===t),disabled:u=!1,horizontal:h=!1,multiple:d=!1,...f}=t;const p=h?"horizontal":"vertical";let m=ct(n),[g=(d?[]:void 0),v]=Pt(r,l,i),[y,_]=e.useReducer(Or,{dataRef:e.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),x=e.useRef({static:!1,hold:!1}),w=e.useRef(null),b=e.useRef(null),E=e.useRef(null),k=Fe("string"==typeof c?(e,t)=>{let n=c;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:c),T=e.useCallback((e=>Ue(M.mode,{1:()=>g.some((t=>k(t,e))),0:()=>k(g,e)})),[g]),M=e.useMemo((()=>({...y,value:g,disabled:u,mode:d?1:0,orientation:p,compare:k,isSelected:T,optionsPropsRef:x,labelRef:w,buttonRef:b,optionsRef:E})),[g,u,d,y]);Le((()=>{y.dataRef.current=M}),[M]),it([M.buttonRef,M.optionsRef],((e,t)=>{var n;_({type:1}),Ye(t,Xe.Loose)||(e.preventDefault(),null==(n=M.buttonRef.current)||n.focus())}),0===M.listboxState);let S=e.useMemo((()=>({open:0===M.listboxState,disabled:u,value:g})),[M,u,g]),C=Fe((e=>{let t=M.options.find((t=>t.id===e));t&&O(t.dataRef.current.value)})),A=Fe((()=>{if(null!==M.activeOptionIndex){let{dataRef:e,id:t}=M.options[M.activeOptionIndex];O(e.current.value),_({type:2,focus:ht.Specific,id:t})}})),I=Fe((()=>_({type:0}))),R=Fe((()=>_({type:1}))),L=Fe(((e,t,n)=>e===ht.Specific?_({type:2,focus:ht.Specific,id:t,trigger:n}):_({type:2,focus:e,trigger:n}))),z=Fe(((e,t)=>(_({type:5,id:e,dataRef:t}),()=>_({type:6,id:e})))),P=Fe((e=>(_({type:7,id:e}),()=>_({type:7,id:null})))),O=Fe((e=>Ue(M.mode,{0:()=>null==v?void 0:v(e),1(){let t=M.value.slice(),n=t.findIndex((t=>k(t,e)));return-1===n?t.push(e):t.splice(n,1),null==v?void 0:v(t)}}))),D=Fe((e=>_({type:3,value:e}))),B=Fe((()=>_({type:4}))),F=e.useMemo((()=>({onChange:O,registerOption:z,registerLabel:P,goToOption:L,closeListbox:R,openListbox:I,selectActiveOption:A,selectOption:C,search:D,clearSearch:B})),[]),j={ref:m},N=e.useRef(null),V=Be();return e.useEffect((()=>{N.current&&void 0!==i&&V.addEventListener(N.current,"reset",(()=>{O(i)}))}),[N,O]),s.default.createElement(Rr.Provider,{value:F},s.default.createElement(zr.Provider,{value:M},s.default.createElement(Lt,{value:Ue(M.listboxState,{0:It.Open,1:It.Closed})},null!=a&&null!=g&&Et({[a]:g}).map((([e,t],n)=>s.default.createElement(Ct,{features:St.Hidden,ref:0===n?e=>{var t;N.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...xt({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:e,value:t})}))),gt({ourProps:j,theirProps:f,slot:S,defaultTag:Dr,name:"Listbox"}))))})),jr=_t((function(t,n){var r;let i=Ve(),{id:o=`headlessui-listbox-button-${i}`,...a}=t,s=Pr("Listbox.Button"),l=Lr("Listbox.Button"),c=ct(s.buttonRef,n),u=Be(),h=Fe((e=>{switch(e.key){case zt.Space:case zt.Enter:case zt.ArrowDown:e.preventDefault(),l.openListbox(),u.nextFrame((()=>{s.value||l.goToOption(ht.First)}));break;case zt.ArrowUp:e.preventDefault(),l.openListbox(),u.nextFrame((()=>{s.value||l.goToOption(ht.Last)}))}})),d=Fe((e=>{if(e.key===zt.Space)e.preventDefault()})),f=Fe((e=>{if(bt(e.currentTarget))return e.preventDefault();0===s.listboxState?(l.closeListbox(),u.nextFrame((()=>{var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),l.openListbox())})),p=Pe((()=>{if(s.labelId)return[s.labelId,o].join(" ")}),[s.labelId,o]),m=e.useMemo((()=>({open:0===s.listboxState,disabled:s.disabled,value:s.value})),[s]);return gt({ourProps:{ref:c,id:o,type:at(t,s.buttonRef),"aria-haspopup":"listbox","aria-controls":null==(r=s.optionsRef.current)?void 0:r.id,"aria-expanded":s.disabled?void 0:0===s.listboxState,"aria-labelledby":p,disabled:s.disabled,onKeyDown:h,onKeyUp:d,onClick:f},theirProps:a,slot:m,defaultTag:"button",name:"Listbox.Button"})})),Nr=_t((function(t,n){let r=Ve(),{id:i=`headlessui-listbox-label-${r}`,...o}=t,a=Pr("Listbox.Label"),s=Lr("Listbox.Label"),l=ct(a.labelRef,n);Le((()=>s.registerLabel(i)),[i]);let c=Fe((()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})})),u=e.useMemo((()=>({open:0===a.listboxState,disabled:a.disabled})),[a]);return gt({ourProps:{ref:l,id:i,onClick:c},theirProps:o,slot:u,defaultTag:"label",name:"Listbox.Label"})})),Vr=_t((function(t,n){var r;let i=Ve(),{id:o=`headlessui-listbox-options-${i}`,...a}=t,s=Pr("Listbox.Options"),l=Lr("Listbox.Options"),c=ct(s.optionsRef,n),u=Be(),h=Be(),d=Rt(),f=null!==d?(d&It.Open)===It.Open:0===s.listboxState;e.useEffect((()=>{var e;let t=s.optionsRef.current;t&&0===s.listboxState&&t!==(null==(e=He(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[s.listboxState,s.optionsRef]);let p=Fe((e=>{switch(h.dispose(),e.key){case zt.Space:if(""!==s.searchQuery)return e.preventDefault(),e.stopPropagation(),l.search(e.key);case zt.Enter:if(e.preventDefault(),e.stopPropagation(),null!==s.activeOptionIndex){let{dataRef:e}=s.options[s.activeOptionIndex];l.onChange(e.current.value)}0===s.mode&&(l.closeListbox(),De().nextFrame((()=>{var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case Ue(s.orientation,{vertical:zt.ArrowDown,horizontal:zt.ArrowRight}):return e.preventDefault(),e.stopPropagation(),l.goToOption(ht.Next);case Ue(s.orientation,{vertical:zt.ArrowUp,horizontal:zt.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),l.goToOption(ht.Previous);case zt.Home:case zt.PageUp:return e.preventDefault(),e.stopPropagation(),l.goToOption(ht.First);case zt.End:case zt.PageDown:return e.preventDefault(),e.stopPropagation(),l.goToOption(ht.Last);case zt.Escape:return e.preventDefault(),e.stopPropagation(),l.closeListbox(),u.nextFrame((()=>{var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case zt.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(l.search(e.key),h.setTimeout((()=>l.clearSearch()),350))}})),m=Pe((()=>{var e,t,n;return null!=(n=null==(e=s.labelRef.current)?void 0:e.id)?n:null==(t=s.buttonRef.current)?void 0:t.id}),[s.labelRef.current,s.buttonRef.current]),g=e.useMemo((()=>({open:0===s.listboxState})),[s]);return gt({ourProps:{"aria-activedescendant":null===s.activeOptionIndex||null==(r=s.options[s.activeOptionIndex])?void 0:r.id,"aria-multiselectable":1===s.mode||void 0,"aria-labelledby":m,"aria-orientation":s.orientation,id:o,onKeyDown:p,role:"listbox",tabIndex:0,ref:c},theirProps:a,slot:g,defaultTag:"ul",features:Br,visible:f,name:"Listbox.Options"})})),Ur=_t((function(t,n){let r=Ve(),{id:i=`headlessui-listbox-option-${r}`,disabled:o=!1,value:a,...s}=t,l=Pr("Listbox.Option"),c=Lr("Listbox.Option"),u=null!==l.activeOptionIndex&&l.options[l.activeOptionIndex].id===i,h=l.isSelected(a),d=e.useRef(null),f=ze({disabled:o,value:a,domRef:d,get textValue(){var e,t;return null==(t=null==(e=d.current)?void 0:e.textContent)?void 0:t.toLowerCase()}}),p=ct(n,d);Le((()=>{if(0!==l.listboxState||!u||0===l.activationTrigger)return;let e=De();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=d.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[d,u,l.listboxState,l.activationTrigger,l.activeOptionIndex]),Le((()=>c.registerOption(i,f)),[f,i]);let m=Fe((e=>{if(o)return e.preventDefault();c.onChange(a),0===l.mode&&(c.closeListbox(),De().nextFrame((()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),g=Fe((()=>{if(o)return c.goToOption(ht.Nothing);c.goToOption(ht.Specific,i)})),v=Bt(),y=Fe((e=>v.update(e))),_=Fe((e=>{v.wasMoved(e)&&(o||u||c.goToOption(ht.Specific,i,0))})),x=Fe((e=>{v.wasMoved(e)&&(o||u&&c.goToOption(ht.Nothing))})),w=e.useMemo((()=>({active:u,selected:h,disabled:o})),[u,h,o]);return gt({ourProps:{id:i,ref:p,role:"option",tabIndex:!0===o?void 0:-1,"aria-disabled":!0===o||void 0,"aria-selected":h,disabled:void 0,onClick:m,onFocus:g,onPointerEnter:y,onMouseEnter:y,onPointerMove:_,onMouseMove:_,onPointerLeave:x,onMouseLeave:x},theirProps:s,slot:w,defaultTag:"li",name:"Listbox.Option"})}));Object.assign(Fr,{Button:jr,Label:Nr,Options:Vr,Option:Ur});var Hr=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hr||{}),Wr=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Wr||{}),$r=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))($r||{});function Gr(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=tt(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let qr={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Gr(e),i=dt(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Gr(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Gr(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Zr=e.createContext(null);function Xr(t){let n=e.useContext(Zr);if(null===n){let e=new Error(`<${t} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Xr),e}return n}function Yr(e,t){return Ue(t.type,qr,e,t)}Zr.displayName="MenuContext";let Kr=e.Fragment;let Jr=pt.RenderStrategy|pt.Static;let Qr=e.Fragment;let ei=_t((function(t,n){let r=e.useReducer(Yr,{menuState:1,buttonRef:e.createRef(),itemsRef:e.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:a},l]=r,c=ct(n);it([a,o],((e,t)=>{var n;l({type:1}),Ye(t,Xe.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===i);let u=Fe((()=>{l({type:1})})),h=e.useMemo((()=>({open:0===i,close:u})),[i,u]),d=t,f={ref:c};return s.default.createElement(Zr.Provider,{value:r},s.default.createElement(Lt,{value:Ue(i,{0:It.Open,1:It.Closed})},gt({ourProps:f,theirProps:d,slot:h,defaultTag:Kr,name:"Menu"})))})),ti=_t((function(t,n){var r;let i=Ve(),{id:o=`headlessui-menu-button-${i}`,...a}=t,[s,l]=Xr("Menu.Button"),c=ct(s.buttonRef,n),u=Be(),h=Fe((e=>{switch(e.key){case zt.Space:case zt.Enter:case zt.ArrowDown:e.preventDefault(),e.stopPropagation(),l({type:0}),u.nextFrame((()=>l({type:2,focus:ht.First})));break;case zt.ArrowUp:e.preventDefault(),e.stopPropagation(),l({type:0}),u.nextFrame((()=>l({type:2,focus:ht.Last})))}})),d=Fe((e=>{if(e.key===zt.Space)e.preventDefault()})),f=Fe((e=>{if(bt(e.currentTarget))return e.preventDefault();t.disabled||(0===s.menuState?(l({type:1}),u.nextFrame((()=>{var e;return null==(e=s.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),l({type:0})))})),p=e.useMemo((()=>({open:0===s.menuState})),[s]);return gt({ourProps:{ref:c,id:o,type:at(t,s.buttonRef),"aria-haspopup":"menu","aria-controls":null==(r=s.itemsRef.current)?void 0:r.id,"aria-expanded":t.disabled?void 0:0===s.menuState,onKeyDown:h,onKeyUp:d,onClick:f},theirProps:a,slot:p,defaultTag:"button",name:"Menu.Button"})})),ni=_t((function(t,n){var r,i;let o=Ve(),{id:a=`headlessui-menu-items-${o}`,...s}=t,[l,c]=Xr("Menu.Items"),u=ct(l.itemsRef,n),h=un(l.itemsRef),d=Be(),f=Rt(),p=null!==f?(f&It.Open)===It.Open:0===l.menuState;e.useEffect((()=>{let e=l.itemsRef.current;e&&0===l.menuState&&e!==(null==h?void 0:h.activeElement)&&e.focus({preventScroll:!0})}),[l.menuState,l.itemsRef,h]),ut({container:l.itemsRef.current,enabled:0===l.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let m=Fe((e=>{var t,n;switch(d.dispose(),e.key){case zt.Space:if(""!==l.searchQuery)return e.preventDefault(),e.stopPropagation(),c({type:3,value:e.key});case zt.Enter:if(e.preventDefault(),e.stopPropagation(),c({type:1}),null!==l.activeItemIndex){let{dataRef:e}=l.items[l.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}Ke(l.buttonRef.current);break;case zt.ArrowDown:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:ht.Next});case zt.ArrowUp:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:ht.Previous});case zt.Home:case zt.PageUp:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:ht.First});case zt.End:case zt.PageDown:return e.preventDefault(),e.stopPropagation(),c({type:2,focus:ht.Last});case zt.Escape:e.preventDefault(),e.stopPropagation(),c({type:1}),De().nextFrame((()=>{var e;return null==(e=l.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case zt.Tab:e.preventDefault(),e.stopPropagation(),c({type:1}),De().nextFrame((()=>{!function(e,t){nt(Ze(),t,{relativeTo:e})}(l.buttonRef.current,e.shiftKey?$e.Previous:$e.Next)}));break;default:1===e.key.length&&(c({type:3,value:e.key}),d.setTimeout((()=>c({type:4})),350))}})),g=Fe((e=>{if(e.key===zt.Space)e.preventDefault()})),v=e.useMemo((()=>({open:0===l.menuState})),[l]);return gt({ourProps:{"aria-activedescendant":null===l.activeItemIndex||null==(r=l.items[l.activeItemIndex])?void 0:r.id,"aria-labelledby":null==(i=l.buttonRef.current)?void 0:i.id,id:a,onKeyDown:m,onKeyUp:g,role:"menu",tabIndex:0,ref:u},theirProps:s,slot:v,defaultTag:"div",features:Jr,visible:p,name:"Menu.Items"})})),ri=_t((function(t,n){let r=Ve(),{id:i=`headlessui-menu-item-${r}`,disabled:o=!1,...a}=t,[s,l]=Xr("Menu.Item"),c=null!==s.activeItemIndex&&s.items[s.activeItemIndex].id===i,u=e.useRef(null),h=ct(n,u);Le((()=>{if(0!==s.menuState||!c||0===s.activationTrigger)return;let e=De();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=u.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[u,c,s.menuState,s.activationTrigger,s.activeItemIndex]);let d=e.useRef({disabled:o,domRef:u});Le((()=>{d.current.disabled=o}),[d,o]),Le((()=>{var e,t;d.current.textValue=null==(t=null==(e=u.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,u]),Le((()=>(l({type:5,id:i,dataRef:d}),()=>l({type:6,id:i}))),[d,i]);let f=Fe((()=>{l({type:1})})),p=Fe((e=>{if(o)return e.preventDefault();l({type:1}),Ke(s.buttonRef.current)})),m=Fe((()=>{if(o)return l({type:2,focus:ht.Nothing});l({type:2,focus:ht.Specific,id:i})})),g=Bt(),v=Fe((e=>g.update(e))),y=Fe((e=>{g.wasMoved(e)&&(o||c||l({type:2,focus:ht.Specific,id:i,trigger:0}))})),_=Fe((e=>{g.wasMoved(e)&&(o||c&&l({type:2,focus:ht.Nothing}))})),x=e.useMemo((()=>({active:c,disabled:o,close:f})),[c,o,f]);return gt({ourProps:{id:i,ref:h,role:"menuitem",tabIndex:!0===o?void 0:-1,"aria-disabled":!0===o||void 0,disabled:void 0,onClick:p,onFocus:m,onPointerEnter:v,onMouseEnter:v,onPointerMove:y,onMouseMove:y,onPointerLeave:_,onMouseLeave:_},theirProps:a,slot:x,defaultTag:Qr,name:"Menu.Item"})})),ii=Object.assign(ei,{Button:ti,Items:ni,Item:ri});var oi=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(oi||{}),ai=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(ai||{});let si={0:e=>({...e,popoverState:Ue(e.popoverState,{0:1,1:0})}),1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},li=e.createContext(null);function ci(t){let n=e.useContext(li);if(null===n){let e=new Error(`<${t} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,ci),e}return n}li.displayName="PopoverContext";let ui=e.createContext(null);function hi(t){let n=e.useContext(ui);if(null===n){let e=new Error(`<${t} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,hi),e}return n}ui.displayName="PopoverAPIContext";let di=e.createContext(null);function fi(){return e.useContext(di)}di.displayName="PopoverGroupContext";let pi=e.createContext(null);function mi(e,t){return Ue(t.type,si,e,t)}pi.displayName="PopoverPanelContext";let gi=pt.RenderStrategy|pt.Static;let vi=pt.RenderStrategy|pt.Static;let yi=_t((function(t,n){var r;let i=e.useRef(null),o=ct(n,lt((e=>{i.current=e}))),a=e.useRef([]),l=e.useReducer(mi,{popoverState:1,buttons:a,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:e.createRef(),afterPanelSentinel:e.createRef()}),[{popoverState:c,button:u,buttonId:h,panel:d,panelId:f,beforePanelSentinel:p,afterPanelSentinel:m},g]=l,v=un(null!=(r=i.current)?r:u),y=e.useMemo((()=>{if(!u||!d)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(u))^Number(null==e?void 0:e.contains(d)))return!0;let e=Ze(),t=e.indexOf(u),n=(t+e.length-1)%e.length,r=(t+1)%e.length,i=e[n],o=e[r];return!d.contains(i)&&!d.contains(o)}),[u,d]),_=ze(h),x=ze(f),w=e.useMemo((()=>({buttonId:_,panelId:x,close:()=>g({type:1})})),[_,x,g]),b=fi(),E=null==b?void 0:b.registerPopover,k=Fe((()=>{var e;return null!=(e=null==b?void 0:b.isFocusWithinPopoverGroup())?e:(null==v?void 0:v.activeElement)&&((null==u?void 0:u.contains(v.activeElement))||(null==d?void 0:d.contains(v.activeElement)))}));e.useEffect((()=>null==E?void 0:E(w)),[E,w]),hn(null==v?void 0:v.defaultView,"focus",(e=>{var t,n,r,i;0===c&&(k()||u&&d&&e.target!==window&&(null!=(n=null==(t=p.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(i=null==(r=m.current)?void 0:r.contains)&&i.call(r,e.target)||g({type:1})))}),!0),it([u,d],((e,t)=>{g({type:1}),Ye(t,Xe.Loose)||(e.preventDefault(),null==u||u.focus())}),0===c);let T=Fe((e=>{g({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:u:u;null==t||t.focus()})),M=e.useMemo((()=>({close:T,isPortalled:y})),[T,y]),S=e.useMemo((()=>({open:0===c,close:T})),[c,T]),C=t,A={ref:o};return s.default.createElement(pi.Provider,{value:null},s.default.createElement(li.Provider,{value:l},s.default.createElement(ui.Provider,{value:M},s.default.createElement(Lt,{value:Ue(c,{0:It.Open,1:It.Closed})},gt({ourProps:A,theirProps:C,slot:S,defaultTag:"div",name:"Popover"})))))})),_i=_t((function(t,n){let r=Ve(),{id:i=`headlessui-popover-button-${r}`,...o}=t,[a,l]=ci("Popover.Button"),{isPortalled:c}=hi("Popover.Button"),u=e.useRef(null),h=`headlessui-focus-sentinel-${Ve()}`,d=fi(),f=null==d?void 0:d.closeOthers,p=null!==e.useContext(pi);e.useEffect((()=>{if(!p)return l({type:3,buttonId:i}),()=>{l({type:3,buttonId:null})}}),[p,i,l]);let[m]=e.useState((()=>Symbol())),g=ct(u,n,p?null:e=>{if(e)a.buttons.current.push(m);else{let e=a.buttons.current.indexOf(m);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&l({type:2,button:e})}),v=ct(u,n),y=un(u),_=Fe((e=>{var t,n,r;if(p){if(1===a.popoverState)return;switch(e.key){case zt.Space:case zt.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),l({type:1}),null==(r=a.button)||r.focus()}}else switch(e.key){case zt.Space:case zt.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),l({type:0});break;case zt.Escape:if(0!==a.popoverState)return null==f?void 0:f(a.buttonId);if(!u.current||null!=y&&y.activeElement&&!u.current.contains(y.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1})}})),x=Fe((e=>{p||e.key===zt.Space&&e.preventDefault()})),w=Fe((e=>{var n,r;bt(e.currentTarget)||t.disabled||(p?(l({type:1}),null==(n=a.button)||n.focus()):(e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),l({type:0}),null==(r=a.button)||r.focus()))})),b=Fe((e=>{e.preventDefault(),e.stopPropagation()})),E=0===a.popoverState,k=e.useMemo((()=>({open:E})),[E]),T=at(t,u),M=p?{ref:v,type:T,onKeyDown:_,onClick:w}:{ref:g,id:a.buttonId,type:T,"aria-expanded":t.disabled?void 0:0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:_,onKeyUp:x,onClick:w,onMouseDown:b},S=ln(),C=Fe((()=>{let e=a.panel;e&&Ue(S.current,{[sn.Forwards]:()=>nt(e,$e.First),[sn.Backwards]:()=>nt(e,$e.Last)})===Ge.Error&&nt(Ze().filter((e=>"true"!==e.dataset.headlessuiFocusGuard)),Ue(S.current,{[sn.Forwards]:$e.Next,[sn.Backwards]:$e.Previous}),{relativeTo:a.button})}));return s.default.createElement(s.default.Fragment,null,gt({ourProps:M,theirProps:o,slot:k,defaultTag:"button",name:"Popover.Button"}),E&&!p&&c&&s.default.createElement(Ct,{id:h,features:St.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:C}))})),xi=_t((function(t,n){let r=Ve(),{id:i=`headlessui-popover-overlay-${r}`,...o}=t,[{popoverState:a},s]=ci("Popover.Overlay"),l=ct(n),c=Rt(),u=null!==c?(c&It.Open)===It.Open:0===a,h=Fe((e=>{if(bt(e.currentTarget))return e.preventDefault();s({type:1})}));return gt({ourProps:{ref:l,id:i,"aria-hidden":!0,onClick:h},theirProps:o,slot:e.useMemo((()=>({open:0===a})),[a]),defaultTag:"div",features:gi,visible:u,name:"Popover.Overlay"})})),wi=_t((function(t,n){let r=Ve(),{id:i=`headlessui-popover-panel-${r}`,focus:o=!1,...a}=t,[l,c]=ci("Popover.Panel"),{close:u,isPortalled:h}=hi("Popover.Panel"),d=`headlessui-focus-sentinel-before-${Ve()}`,f=`headlessui-focus-sentinel-after-${Ve()}`,p=e.useRef(null),m=ct(p,n,(e=>{c({type:4,panel:e})})),g=un(p);Le((()=>(c({type:5,panelId:i}),()=>{c({type:5,panelId:null})})),[i,c]);let v=Rt(),y=null!==v?(v&It.Open)===It.Open:0===l.popoverState,_=Fe((e=>{var t;if(e.key===zt.Escape){if(0!==l.popoverState||!p.current||null!=g&&g.activeElement&&!p.current.contains(g.activeElement))return;e.preventDefault(),e.stopPropagation(),c({type:1}),null==(t=l.button)||t.focus()}}));e.useEffect((()=>{var e;t.static||1===l.popoverState&&(null==(e=t.unmount)||e)&&c({type:4,panel:null})}),[l.popoverState,t.unmount,t.static,c]),e.useEffect((()=>{if(!o||0!==l.popoverState||!p.current)return;let e=null==g?void 0:g.activeElement;p.current.contains(e)||nt(p.current,$e.First)}),[o,p,l.popoverState]);let x=e.useMemo((()=>({open:0===l.popoverState,close:u})),[l,u]),w={ref:m,id:i,onKeyDown:_,onBlur:o&&0===l.popoverState?e=>{var t,n,r,i,o;let a=e.relatedTarget;a&&p.current&&(null!=(t=p.current)&&t.contains(a)||(c({type:1}),(null!=(r=null==(n=l.beforePanelSentinel.current)?void 0:n.contains)&&r.call(n,a)||null!=(o=null==(i=l.afterPanelSentinel.current)?void 0:i.contains)&&o.call(i,a))&&a.focus({preventScroll:!0})))}:void 0,tabIndex:-1},b=ln(),E=Fe((()=>{let e=p.current;e&&Ue(b.current,{[sn.Forwards]:()=>{var t;nt(e,$e.First)===Ge.Error&&(null==(t=l.afterPanelSentinel.current)||t.focus())},[sn.Backwards]:()=>{var e;null==(e=l.button)||e.focus({preventScroll:!0})}})})),k=Fe((()=>{let e=p.current;e&&Ue(b.current,{[sn.Forwards]:()=>{var e;if(!l.button)return;let t=Ze(),n=t.indexOf(l.button),r=t.slice(0,n+1),i=[...t.slice(n+1),...r];for(let t of i.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=l.panel)&&e.contains(t)){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}nt(i,$e.First,{sorted:!1})},[sn.Backwards]:()=>{var t;nt(e,$e.Previous)===Ge.Error&&(null==(t=l.button)||t.focus())}})}));return s.default.createElement(pi.Provider,{value:i},y&&h&&s.default.createElement(Ct,{id:d,ref:l.beforePanelSentinel,features:St.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:E}),gt({ourProps:w,theirProps:a,slot:x,defaultTag:"div",features:vi,visible:y,name:"Popover.Panel"}),y&&h&&s.default.createElement(Ct,{id:f,ref:l.afterPanelSentinel,features:St.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:k}))})),bi=_t((function(t,n){let r=e.useRef(null),i=ct(r,n),[o,a]=e.useState([]),l=Fe((e=>{a((t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t}))})),c=Fe((e=>(a((t=>[...t,e])),()=>l(e)))),u=Fe((()=>{var e;let t=He(r);if(!t)return!1;let n=t.activeElement;return!(null==(e=r.current)||!e.contains(n))||o.some((e=>{var r,i;return(null==(r=t.getElementById(e.buttonId.current))?void 0:r.contains(n))||(null==(i=t.getElementById(e.panelId.current))?void 0:i.contains(n))}))})),h=Fe((e=>{for(let t of o)t.buttonId.current!==e&&t.close()})),d=e.useMemo((()=>({registerPopover:c,unregisterPopover:l,isFocusWithinPopoverGroup:u,closeOthers:h})),[c,l,u,h]),f=e.useMemo((()=>({})),[]),p=t,m={ref:i};return s.default.createElement(di.Provider,{value:d},gt({ourProps:m,theirProps:p,slot:f,defaultTag:"div",name:"Popover.Group"}))}));function Ei(t=0){let[n,r]=e.useState(t),i=cn(),o=e.useCallback((e=>{i.current&&r((t=>t|e))}),[n,i]),a=e.useCallback((e=>Boolean(n&e)),[n]),s=e.useCallback((e=>{i.current&&r((t=>t&~e))}),[r,i]),l=e.useCallback((e=>{i.current&&r((t=>t^e))}),[r]);return{flags:n,addFlag:o,hasFlag:a,removeFlag:s,toggleFlag:l}}Object.assign(yi,{Button:_i,Overlay:xi,Panel:wi,Group:bi});let ki=e.createContext(null);function Ti(){let t=e.useContext(ki);if(null===t){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Ti),e}return t}function Mi(){let[t,n]=e.useState([]);return[t.length>0?t.join(" "):void 0,e.useMemo((()=>function(t){let r=Fe((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=e.useMemo((()=>({register:r,slot:t.slot,name:t.name,props:t.props})),[r,t.slot,t.name,t.props]);return s.default.createElement(ki.Provider,{value:i},t.children)}),[n])]}let Si=_t((function(e,t){let n=Ve(),{id:r=`headlessui-label-${n}`,passive:i=!1,...o}=e,a=Ti(),s=ct(t);Le((()=>a.register(r)),[r,a.register]);let l={ref:s,...a.props,id:r};return i&&("onClick"in l&&(delete l.htmlFor,delete l.onClick),"onClick"in o&&delete o.onClick),gt({ourProps:l,theirProps:o,slot:a.slot||{},defaultTag:"label",name:a.name||"Label"})})),Ci=Object.assign(Si,{});var Ai=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(Ai||{});let Ii={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:tt(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},Ri=e.createContext(null);function Li(t){let n=e.useContext(Ri);if(null===n){let e=new Error(`<${t} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Li),e}return n}Ri.displayName="RadioGroupDataContext";let zi=e.createContext(null);function Pi(t){let n=e.useContext(zi);if(null===n){let e=new Error(`<${t} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Pi),e}return n}function Oi(e,t){return Ue(t.type,Ii,e,t)}zi.displayName="RadioGroupActionsContext";var Di=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(Di||{});let Bi=_t((function(t,n){let r=Ve(),{id:i=`headlessui-radiogroup-${r}`,value:o,defaultValue:a,form:l,name:c,onChange:u,by:h=((e,t)=>e===t),disabled:d=!1,...f}=t,p=Fe("string"==typeof h?(e,t)=>{let n=h;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:h),[m,g]=e.useReducer(Oi,{options:[]}),v=m.options,[y,_]=Mi(),[x,w]=An(),b=e.useRef(null),E=ct(b,n),[k,T]=Pt(o,u,a),M=e.useMemo((()=>v.find((e=>!e.propsRef.current.disabled))),[v]),S=e.useMemo((()=>v.some((e=>p(e.propsRef.current.value,k)))),[v,k]),C=Fe((e=>{var t;if(d||p(e,k))return!1;let n=null==(t=v.find((t=>p(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==T||T(e),!0)}));ut({container:b.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let A=Fe((e=>{let t=b.current;if(!t)return;let n=He(t),r=v.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case zt.Enter:Mt(e.currentTarget);break;case zt.ArrowLeft:case zt.ArrowUp:if(e.preventDefault(),e.stopPropagation(),nt(r,$e.Previous|$e.WrapAround)===Ge.Success){let e=v.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&C(e.propsRef.current.value)}break;case zt.ArrowRight:case zt.ArrowDown:if(e.preventDefault(),e.stopPropagation(),nt(r,$e.Next|$e.WrapAround)===Ge.Success){let e=v.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&C(e.propsRef.current.value)}break;case zt.Space:{e.preventDefault(),e.stopPropagation();let t=v.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&C(t.propsRef.current.value)}}})),I=Fe((e=>(g({type:0,...e}),()=>g({type:1,id:e.id})))),R=e.useMemo((()=>({value:k,firstOption:M,containsCheckedOption:S,disabled:d,compare:p,...m})),[k,M,S,d,p,m]),L=e.useMemo((()=>({registerOption:I,change:C})),[I,C]),z={ref:E,id:i,role:"radiogroup","aria-labelledby":y,"aria-describedby":x,onKeyDown:A},P=e.useMemo((()=>({value:k})),[k]),O=e.useRef(null),D=Be();return e.useEffect((()=>{O.current&&void 0!==a&&D.addEventListener(O.current,"reset",(()=>{C(a)}))}),[O,C]),s.default.createElement(w,{name:"RadioGroup.Description"},s.default.createElement(_,{name:"RadioGroup.Label"},s.default.createElement(zi.Provider,{value:L},s.default.createElement(Ri.Provider,{value:R},null!=c&&null!=k&&Et({[c]:k}).map((([e,t],n)=>s.default.createElement(Ct,{features:St.Hidden,ref:0===n?e=>{var t;O.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...xt({key:e,as:"input",type:"radio",checked:null!=t,hidden:!0,readOnly:!0,form:l,name:e,value:t})}))),gt({ourProps:z,theirProps:f,slot:P,defaultTag:"div",name:"RadioGroup"})))))})),Fi=_t((function(t,n){var r;let i=Ve(),{id:o=`headlessui-radiogroup-option-${i}`,value:a,disabled:l=!1,...c}=t,u=e.useRef(null),h=ct(u,n),[d,f]=Mi(),[p,m]=An(),{addFlag:g,removeFlag:v,hasFlag:y}=Ei(1),_=ze({value:a,disabled:l}),x=Li("RadioGroup.Option"),w=Pi("RadioGroup.Option");Le((()=>w.registerOption({id:o,element:u,propsRef:_})),[o,w,u,t]);let b=Fe((e=>{var t;if(bt(e.currentTarget))return e.preventDefault();w.change(a)&&(g(2),null==(t=u.current)||t.focus())})),E=Fe((e=>{if(bt(e.currentTarget))return e.preventDefault();g(2)})),k=Fe((()=>v(2))),T=(null==(r=x.firstOption)?void 0:r.id)===o,M=x.disabled||l,S=x.compare(x.value,a),C={ref:h,id:o,role:"radio","aria-checked":S?"true":"false","aria-labelledby":d,"aria-describedby":p,"aria-disabled":!!M||void 0,tabIndex:M?-1:S||!x.containsCheckedOption&&T?0:-1,onClick:M?void 0:b,onFocus:M?void 0:E,onBlur:M?void 0:k},A=e.useMemo((()=>({checked:S,disabled:M,active:y(2)})),[S,M,y]);return s.default.createElement(m,{name:"RadioGroup.Description"},s.default.createElement(f,{name:"RadioGroup.Label"},gt({ourProps:C,theirProps:c,slot:A,defaultTag:"div",name:"RadioGroup.Option"})))})),ji=Object.assign(Bi,{Option:Fi,Label:Ci,Description:Rn}),Ni=e.createContext(null);Ni.displayName="GroupContext";let Vi=e.Fragment;let Ui=_t((function(t,n){let r=Ve(),{id:i=`headlessui-switch-${r}`,checked:o,defaultChecked:a=!1,onChange:l,name:c,value:u,form:h,...d}=t,f=e.useContext(Ni),p=e.useRef(null),m=ct(p,n,null===f?null:f.setSwitch),[g,v]=Pt(o,l,a),y=Fe((()=>null==v?void 0:v(!g))),_=Fe((e=>{if(bt(e.currentTarget))return e.preventDefault();e.preventDefault(),y()})),x=Fe((e=>{e.key===zt.Space?(e.preventDefault(),y()):e.key===zt.Enter&&Mt(e.currentTarget)})),w=Fe((e=>e.preventDefault())),b=e.useMemo((()=>({checked:g})),[g]),E={id:i,ref:m,role:"switch",type:at(t,p),tabIndex:0,"aria-checked":g,"aria-labelledby":null==f?void 0:f.labelledby,"aria-describedby":null==f?void 0:f.describedby,onClick:_,onKeyUp:x,onKeyPress:w},k=Be();return e.useEffect((()=>{var e;let t=null==(e=p.current)?void 0:e.closest("form");t&&void 0!==a&&k.addEventListener(t,"reset",(()=>{v(a)}))}),[p,v]),s.default.createElement(s.default.Fragment,null,null!=c&&g&&s.default.createElement(Ct,{features:St.Hidden,...xt({as:"input",type:"checkbox",hidden:!0,readOnly:!0,form:h,checked:g,name:c,value:u})}),gt({ourProps:E,theirProps:d,slot:b,defaultTag:"button",name:"Switch"}))})),Hi=function(t){var n;let[r,i]=e.useState(null),[o,a]=Mi(),[l,c]=An(),u=e.useMemo((()=>({switch:r,setSwitch:i,labelledby:o,describedby:l})),[r,i,o,l]),h=t;return s.default.createElement(c,{name:"Switch.Description"},s.default.createElement(a,{name:"Switch.Label",props:{htmlFor:null==(n=u.switch)?void 0:n.id,onClick(e){r&&("LABEL"===e.currentTarget.tagName&&e.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},s.default.createElement(Ni.Provider,{value:u},gt({ourProps:{},theirProps:h,defaultTag:Vi,name:"Switch.Group"}))))};function Wi({onFocus:t}){let[n,r]=e.useState(!0);return n?s.default.createElement(Ct,{as:"button",type:"button",features:St.Focusable,onFocus:e=>{e.preventDefault();let n,i=50;n=requestAnimationFrame((function e(){if(!(i--<=0))return t()?(r(!1),void cancelAnimationFrame(n)):void(n=requestAnimationFrame(e));n&&cancelAnimationFrame(n)}))}}):null}Object.assign(Ui,{Group:Hi,Label:Ci,Description:Rn});const $i=a.createContext(null);function Gi({children:e}){let t=a.useRef({groups:new Map,get(e,t){var n;let r=this.groups.get(e);r||(r=new Map,this.groups.set(e,r));let i=null!=(n=r.get(t))?n:0;return r.set(t,i+1),[Array.from(r.keys()).indexOf(t),function(){let e=r.get(t);e>1?r.set(t,e-1):r.delete(t)}]}});return a.createElement($i.Provider,{value:t},e)}function qi(e){let t=a.useContext($i);if(!t)throw new Error("You must wrap your component in a <StableCollection>");let n=function(){var e,t,n;let r=null!=(n=null==(t=null==(e=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)?void 0:e.ReactCurrentOwner)?void 0:t.current)?n:null;if(!r)return Symbol();let i=[],o=r;for(;o;)i.push(o.index),o=o.return;return"$."+i.join(".")}(),[r,i]=t.current.get(e,n);return a.useEffect((()=>i),[]),r}var Zi=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Zi||{}),Xi=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))(Xi||{}),Yi=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(Yi||{});let Ki={0(e,t){var n;let r=tt(e.tabs,(e=>e.current)),i=tt(e.panels,(e=>e.current)),o=r.filter((e=>{var t;return!(null!=(t=e.current)&&t.hasAttribute("disabled"))})),a={...e,tabs:r,panels:i};if(t.index<0||t.index>r.length-1){let n=Ue(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>Ue(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});return 0===o.length?a:{...a,selectedIndex:Ue(n,{0:()=>r.indexOf(o[0]),1:()=>r.indexOf(o[o.length-1])})}}let s=r.slice(0,t.index),l=[...r.slice(t.index),...s].find((e=>o.includes(e)));if(!l)return a;let c=null!=(n=r.indexOf(l))?n:e.selectedIndex;return-1===c&&(c=e.selectedIndex),{...a,selectedIndex:c}},1(e,t){var n;if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],i=tt([...e.tabs,t.tab],(e=>e.current)),o=null!=(n=i.indexOf(r))?n:e.selectedIndex;return-1===o&&(o=e.selectedIndex),{...e,tabs:i,selectedIndex:o}},2:(e,t)=>({...e,tabs:e.tabs.filter((e=>e!==t.tab))}),3:(e,t)=>e.panels.includes(t.panel)?e:{...e,panels:tt([...e.panels,t.panel],(e=>e.current))},4:(e,t)=>({...e,panels:e.panels.filter((e=>e!==t.panel))})},Ji=e.createContext(null);function Qi(t){let n=e.useContext(Ji);if(null===n){let e=new Error(`<${t} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,Qi),e}return n}Ji.displayName="TabsDataContext";let eo=e.createContext(null);function to(t){let n=e.useContext(eo);if(null===n){let e=new Error(`<${t} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,to),e}return n}function no(e,t){return Ue(t.type,Ki,e,t)}eo.displayName="TabsActionsContext";let ro=e.Fragment;let io=pt.RenderStrategy|pt.Static;let oo=_t((function(t,n){var r,i;let o=Ve(),{id:a=`headlessui-tabs-tab-${o}`,...s}=t,{orientation:l,activation:c,selectedIndex:u,tabs:h,panels:d}=Qi("Tab"),f=to("Tab"),p=Qi("Tab"),m=e.useRef(null),g=ct(m,n);Le((()=>f.registerTab(m)),[f,m]);let v=qi("tabs"),y=h.indexOf(m);-1===y&&(y=v);let _=y===u,x=Fe((e=>{var t;let n=e();if(n===Ge.Success&&"auto"===c){let e=null==(t=He(m))?void 0:t.activeElement,n=p.tabs.findIndex((t=>t.current===e));-1!==n&&f.change(n)}return n})),w=Fe((e=>{let t=h.map((e=>e.current)).filter(Boolean);if(e.key===zt.Space||e.key===zt.Enter)return e.preventDefault(),e.stopPropagation(),void f.change(y);switch(e.key){case zt.Home:case zt.PageUp:return e.preventDefault(),e.stopPropagation(),x((()=>nt(t,$e.First)));case zt.End:case zt.PageDown:return e.preventDefault(),e.stopPropagation(),x((()=>nt(t,$e.Last)))}return x((()=>Ue(l,{vertical:()=>e.key===zt.ArrowUp?nt(t,$e.Previous|$e.WrapAround):e.key===zt.ArrowDown?nt(t,$e.Next|$e.WrapAround):Ge.Error,horizontal:()=>e.key===zt.ArrowLeft?nt(t,$e.Previous|$e.WrapAround):e.key===zt.ArrowRight?nt(t,$e.Next|$e.WrapAround):Ge.Error})))===Ge.Success?e.preventDefault():void 0})),b=e.useRef(!1),E=Fe((()=>{var e;b.current||(b.current=!0,null==(e=m.current)||e.focus(),f.change(y),Oe((()=>{b.current=!1})))})),k=Fe((e=>{e.preventDefault()})),T=e.useMemo((()=>({selected:_})),[_]);return gt({ourProps:{ref:g,onKeyDown:w,onMouseDown:k,onClick:E,id:a,role:"tab",type:at(t,m),"aria-controls":null==(i=null==(r=d[y])?void 0:r.current)?void 0:i.id,"aria-selected":_,tabIndex:_?0:-1},theirProps:s,slot:T,defaultTag:"button",name:"Tabs.Tab"})})),ao=_t((function(t,n){let{defaultIndex:r=0,vertical:i=!1,manual:o=!1,onChange:a,selectedIndex:l=null,...c}=t;const u=i?"vertical":"horizontal",h=o?"manual":"auto";let d=null!==l,f=ct(n),[p,m]=e.useReducer(no,{selectedIndex:null!=l?l:r,tabs:[],panels:[]}),g=e.useMemo((()=>({selectedIndex:p.selectedIndex})),[p.selectedIndex]),v=ze(a||(()=>{})),y=ze(p.tabs),_=e.useMemo((()=>({orientation:u,activation:h,...p})),[u,h,p]),x=Fe((e=>(m({type:1,tab:e}),()=>m({type:2,tab:e})))),w=Fe((e=>(m({type:3,panel:e}),()=>m({type:4,panel:e})))),b=Fe((e=>{E.current!==e&&v.current(e),d||m({type:0,index:e})})),E=ze(d?t.selectedIndex:p.selectedIndex),k=e.useMemo((()=>({registerTab:x,registerPanel:w,change:b})),[]);Le((()=>{m({type:0,index:null!=l?l:r})}),[l]),Le((()=>{if(void 0===E.current||p.tabs.length<=0)return;let e=tt(p.tabs,(e=>e.current));e.some(((e,t)=>p.tabs[t]!==e))&&b(e.indexOf(p.tabs[E.current]))}));let T={ref:f};return s.default.createElement(Gi,null,s.default.createElement(eo.Provider,{value:k},s.default.createElement(Ji.Provider,{value:_},_.tabs.length<=0&&s.default.createElement(Wi,{onFocus:()=>{var e,t;for(let n of y.current)if(0===(null==(e=n.current)?void 0:e.tabIndex))return null==(t=n.current)||t.focus(),!0;return!1}}),gt({ourProps:T,theirProps:c,slot:g,defaultTag:ro,name:"Tabs"}))))})),so=_t((function(e,t){let{orientation:n,selectedIndex:r}=Qi("Tab.List");return gt({ourProps:{ref:ct(t),role:"tablist","aria-orientation":n},theirProps:e,slot:{selectedIndex:r},defaultTag:"div",name:"Tabs.List"})})),lo=_t((function(t,n){let{selectedIndex:r}=Qi("Tab.Panels");return gt({ourProps:{ref:ct(n)},theirProps:t,slot:e.useMemo((()=>({selectedIndex:r})),[r]),defaultTag:"div",name:"Tabs.Panels"})})),co=_t((function(t,n){var r,i,o,a;let l=Ve(),{id:c=`headlessui-tabs-panel-${l}`,tabIndex:u=0,...h}=t,{selectedIndex:d,tabs:f,panels:p}=Qi("Tab.Panel"),m=to("Tab.Panel"),g=e.useRef(null),v=ct(g,n);Le((()=>m.registerPanel(g)),[m,g]);let y=qi("panels"),_=p.indexOf(g);-1===_&&(_=y);let x=_===d,w=e.useMemo((()=>({selected:x})),[x]),b={ref:v,id:c,role:"tabpanel","aria-labelledby":null==(i=null==(r=f[_])?void 0:r.current)?void 0:i.id,tabIndex:x?u:-1};return x||null!=(o=h.unmount)&&!o||null!=(a=h.static)&&a?gt({ourProps:b,theirProps:h,slot:w,defaultTag:"div",features:io,visible:x,name:"Tabs.Panel"}):s.default.createElement(Ct,{as:"span",...b})}));function uo(e,...t){e&&t.length>0&&e.classList.add(...t)}function ho(e,...t){e&&t.length>0&&e.classList.remove(...t)}function fo(e,t,n,r){let i=n?"enter":"leave",o=De(),a=void 0!==r?function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let s=Ue(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Ue(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Ue(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return ho(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),uo(e,...s,...c),o.nextFrame((()=>{ho(e,...c),uo(e,...l),function(e,t){let n=De();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,a]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t})),s=o+a;if(0!==s){n.group((n=>{n.setTimeout((()=>{t(),n.dispose()}),s),n.addEventListener(e,"transitionrun",(e=>{e.target===e.currentTarget&&n.dispose()}))}));let r=n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t(),r())}))}else t();n.add((()=>t())),n.dispose}(e,(()=>(ho(e,...s),uo(e,...t.entered),a())))})),o.dispose}function po(e=""){return e.split(" ").filter((e=>e.trim().length>1))}Object.assign(oo,{Group:ao,List:so,Panels:lo,Panel:co});let mo=e.createContext(null);mo.displayName="TransitionContext";var go=(e=>(e.Visible="visible",e.Hidden="hidden",e))(go||{});let vo=e.createContext(null);function yo(e){return"children"in e?yo(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function _o(t,n){let r=ze(t),i=e.useRef([]),o=cn(),a=Be(),s=Fe(((e,t=mt.Hidden)=>{let n=i.current.findIndex((({el:t})=>t===e));-1!==n&&(Ue(t,{[mt.Unmount](){i.current.splice(n,1)},[mt.Hidden](){i.current[n].state="hidden"}}),a.microTask((()=>{var e;!yo(i)&&o.current&&(null==(e=r.current)||e.call(r))})))})),l=Fe((e=>{let t=i.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):i.current.push({el:e,state:"visible"}),()=>s(e,mt.Unmount)})),c=e.useRef([]),u=e.useRef(Promise.resolve()),h=e.useRef({enter:[],leave:[],idle:[]}),d=Fe(((e,t,r)=>{c.current.splice(0),n&&(n.chains.current[t]=n.chains.current[t].filter((([t])=>t!==e))),null==n||n.chains.current[t].push([e,new Promise((e=>{c.current.push(e)}))]),null==n||n.chains.current[t].push([e,new Promise((e=>{Promise.all(h.current[t].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===t?u.current=u.current.then((()=>null==n?void 0:n.wait.current)).then((()=>r(t))):r(t)})),f=Fe(((e,t,n)=>{Promise.all(h.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=c.current.shift())||e()})).then((()=>n(t)))}));return e.useMemo((()=>({children:i,register:l,unregister:s,onStart:d,onStop:f,wait:u,chains:h})),[l,s,i,d,f,h,u])}function xo(){}vo.displayName="NestingContext";let wo=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function bo(e){var t;let n={};for(let r of wo)n[r]=null!=(t=e[r])?t:xo;return n}let Eo=pt.RenderStrategy;let ko=_t((function(t,n){let{show:r,appear:i=!1,unmount:o,...a}=t,l=e.useRef(null),c=ct(l,n);je();let u=Rt();if(void 0===r&&null!==u&&(r=(u&It.Open)===It.Open),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[h,d]=e.useState(r?"visible":"hidden"),f=_o((()=>{d("hidden")})),[p,m]=e.useState(!0),g=e.useRef([r]);Le((()=>{!1!==p&&g.current[g.current.length-1]!==r&&(g.current.push(r),m(!1))}),[g,r]);let v=e.useMemo((()=>({show:r,appear:i,initial:p})),[r,i,p]);e.useEffect((()=>{if(r)d("visible");else if(yo(f)){let e=l.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")}),[r,f]);let y={unmount:o};return s.default.createElement(vo.Provider,{value:f},s.default.createElement(mo.Provider,{value:v},gt({ourProps:{...y,as:e.Fragment,children:s.default.createElement(To,{ref:c,...y,...a})},theirProps:{},defaultTag:e.Fragment,features:Eo,visible:"visible"===h,name:"Transition"})))})),To=_t((function(t,n){let{beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:h,leave:d,leaveFrom:f,leaveTo:p,...m}=t,g=e.useRef(null),v=ct(g,n),y=m.unmount?mt.Unmount:mt.Hidden,{show:_,appear:x,initial:w}=function(){let t=e.useContext(mo);if(null===t)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}(),[b,E]=e.useState(_?"visible":"hidden"),k=function(){let t=e.useContext(vo);if(null===t)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}(),{register:T,unregister:M}=k,S=e.useRef(null);e.useEffect((()=>T(g)),[T,g]),e.useEffect((()=>{if(y===mt.Hidden&&g.current)return _&&"visible"!==b?void E("visible"):Ue(b,{hidden:()=>M(g),visible:()=>T(g)})}),[b,g,T,M,_,y]);let C=ze({enter:po(l),enterFrom:po(c),enterTo:po(u),entered:po(h),leave:po(d),leaveFrom:po(f),leaveTo:po(p)}),A=function(t){let n=e.useRef(bo(t));return e.useEffect((()=>{n.current=bo(t)}),[t]),n}({beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:a}),I=je();e.useEffect((()=>{if(I&&"visible"===b&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[g,b,I]);let R=w&&!x,L=!I||R||S.current===_?"idle":_?"enter":"leave",z=Ei(0),P=Fe((e=>Ue(e,{enter:()=>{z.addFlag(It.Opening),A.current.beforeEnter()},leave:()=>{z.addFlag(It.Closing),A.current.beforeLeave()},idle:()=>{}}))),O=Fe((e=>Ue(e,{enter:()=>{z.removeFlag(It.Opening),A.current.afterEnter()},leave:()=>{z.removeFlag(It.Closing),A.current.afterLeave()},idle:()=>{}}))),D=_o((()=>{E("hidden"),M(g)}),k);(function({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=cn(),a=Be(),s=ze(t);Le((()=>{let t=De();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&o.current)return t.dispose(),r.current(s.current),t.add(fo(l,n.current,"enter"===s.current,(()=>{t.dispose(),i.current(s.current)}))),t.dispose}),[t])})({container:g,classes:C,direction:L,onStart:ze((e=>{D.onStart(g,e,P)})),onStop:ze((e=>{D.onStop(g,e,O),"leave"===e&&!yo(D)&&(E("hidden"),M(g))}))}),e.useEffect((()=>{R&&(y===mt.Hidden?S.current=null:S.current=_)}),[_,R,b]);let B=m,F={ref:v};return x&&_&&(B={...B,className:ft(m.className,...C.current.enter,...C.current.enterFrom)}),s.default.createElement(vo.Provider,{value:D},s.default.createElement(Lt,{value:Ue(b,{visible:It.Open,hidden:It.Closed})|z.flags},gt({ourProps:F,theirProps:B,defaultTag:"div",features:Eo,visible:"visible"===b,name:"Transition.Child"})))})),Mo=_t((function(t,n){let r=null!==e.useContext(mo),i=null!==Rt();return s.default.createElement(s.default.Fragment,null,!r&&i?s.default.createElement(ko,{ref:n,...t}):s.default.createElement(To,{ref:n,...t}))})),So=Object.assign(ko,{Child:Mo,Root:ko});a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10.394 2.08a1 1 0 00-.788 0l-7 3a1 1 0 000 1.84L5.25 8.051a.999.999 0 01.356-.257l4-1.714a1 1 0 11.788 1.838L7.667 9.088l1.94.831a1 1 0 00.787 0l7-3a1 1 0 000-1.838l-7-3zM3.31 9.397L5 10.12v4.102a8.969 8.969 0 00-1.05-.174 1 1 0 01-.89-.89 11.115 11.115 0 01.25-3.762zM9.3 16.573A9.026 9.026 0 007 14.935v-3.957l1.818.78a3 3 0 002.364 0l5.508-2.361a11.026 11.026 0 01.25 3.762 1 1 0 01-.89.89 8.968 8.968 0 00-5.35 2.524 1 1 0 01-1.4 0zM6 18a1 1 0 001-1v-2.065a8.935 8.935 0 00-2-.712V17a1 1 0 001 1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5 4a1 1 0 00-2 0v7.268a2 2 0 000 3.464V16a1 1 0 102 0v-1.268a2 2 0 000-3.464V4zM11 4a1 1 0 10-2 0v1.268a2 2 0 000 3.464V16a1 1 0 102 0V8.732a2 2 0 000-3.464V4zM16 3a1 1 0 011 1v7.268a2 2 0 010 3.464V16a1 1 0 11-2 0v-1.268a2 2 0 010-3.464V4a1 1 0 011-1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 13V5a2 2 0 00-2-2H4a2 2 0 00-2 2v8a2 2 0 002 2h3l3 3 3-3h3a2 2 0 002-2zM5 7a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1zm1 3a1 1 0 100 2h3a1 1 0 100-2H6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M4 3a2 2 0 100 4h12a2 2 0 100-4H4z"}),a.createElement("path",{fillRule:"evenodd",d:"M3 8h14v7a2 2 0 01-2 2H5a2 2 0 01-2-2V8zm5 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v3.586L7.707 9.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 10.586V7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm.707-10.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L9.414 11H13a1 1 0 100-2H9.414l1.293-1.293z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 1.414L10.586 9H7a1 1 0 100 2h3.586l-1.293 1.293a1 1 0 101.414 1.414l3-3a1 1 0 000-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13a1 1 0 102 0V9.414l1.293 1.293a1 1 0 001.414-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M16.707 10.293a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0l-6-6a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l4.293-4.293a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L7.414 9H15a1 1 0 110 2H7.414l2.293 2.293a1 1 0 010 1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3.293 9.707a1 1 0 010-1.414l6-6a1 1 0 011.414 0l6 6a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L4.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 110-2h4a1 1 0 011 1v4a1 1 0 11-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 112 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 110 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 110-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M14.243 5.757a6 6 0 10-.986 9.284 1 1 0 111.087 1.678A8 8 0 1118 10a3 3 0 01-4.8 2.401A4 4 0 1114 10a1 1 0 102 0c0-1.537-.586-3.07-1.757-4.243zM12 10a2 2 0 10-4 0 2 2 0 004 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6.707 4.879A3 3 0 018.828 4H15a3 3 0 013 3v6a3 3 0 01-3 3H8.828a3 3 0 01-2.12-.879l-4.415-4.414a1 1 0 010-1.414l4.414-4.414zm4 2.414a1 1 0 00-1.414 1.414L10.586 10l-1.293 1.293a1 1 0 101.414 1.414L12 11.414l1.293 1.293a1 1 0 001.414-1.414L13.414 10l1.293-1.293a1 1 0 00-1.414-1.414L12 8.586l-1.293-1.293z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M13.477 14.89A6 6 0 015.11 6.524l8.367 8.368zm1.414-1.414L6.524 5.11a6 6 0 018.367 8.367zM18 10a8 8 0 11-16 0 8 8 0 0116 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M7 2a1 1 0 00-.707 1.707L7 4.414v3.758a1 1 0 01-.293.707l-4 4C.817 14.769 2.156 18 4.828 18h10.343c2.673 0 4.012-3.231 2.122-5.121l-4-4A1 1 0 0113 8.172V4.414l.707-.707A1 1 0 0013 2H7zm2 6.172V4h2v4.172a3 3 0 00.879 2.12l1.027 1.028a4 4 0 00-2.171.102l-.47.156a4 4 0 01-2.53 0l-.563-.187a1.993 1.993 0 00-.114-.035l1.063-1.063A3 3 0 009 8.172z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zM10 18a3 3 0 01-3-3h6a3 3 0 01-3 3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9 4.804A7.968 7.968 0 005.5 4c-1.255 0-2.443.29-3.5.804v10A7.969 7.969 0 015.5 14c1.669 0 3.218.51 4.5 1.385A7.962 7.962 0 0114.5 14c1.255 0 2.443.29 3.5.804v-10A7.968 7.968 0 0014.5 4c-1.255 0-2.443.29-3.5.804V12a1 1 0 11-2 0V4.804z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 5a2 2 0 012-2h10a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V5zm11 1H6v8l4-2 4 2V6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5 4a2 2 0 012-2h6a2 2 0 012 2v14l-5-2.5L5 18V4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 6V5a3 3 0 013-3h2a3 3 0 013 3v1h2a2 2 0 012 2v3.57A22.952 22.952 0 0110 13a22.95 22.95 0 01-8-1.43V8a2 2 0 012-2h2zm2-1a1 1 0 011-1h2a1 1 0 011 1v1H8V5zm1 5a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1z",clipRule:"evenodd"}),a.createElement("path",{d:"M2 13.692V16a2 2 0 002 2h12a2 2 0 002-2v-2.308A24.974 24.974 0 0110 15c-2.796 0-5.487-.46-8-1.308z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 3a1 1 0 011-1h.01a1 1 0 010 2H7a1 1 0 01-1-1zm2 3a1 1 0 00-2 0v1a2 2 0 00-2 2v1a2 2 0 00-2 2v.683a3.7 3.7 0 011.055.485 1.704 1.704 0 001.89 0 3.704 3.704 0 014.11 0 1.704 1.704 0 001.89 0 3.704 3.704 0 014.11 0 1.704 1.704 0 001.89 0A3.7 3.7 0 0118 12.683V12a2 2 0 00-2-2V9a2 2 0 00-2-2V6a1 1 0 10-2 0v1h-1V6a1 1 0 10-2 0v1H8V6zm10 8.868a3.704 3.704 0 01-4.055-.036 1.704 1.704 0 00-1.89 0 3.704 3.704 0 01-4.11 0 1.704 1.704 0 00-1.89 0A3.704 3.704 0 012 14.868V17a1 1 0 001 1h14a1 1 0 001-1v-2.132zM9 3a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1zm3 0a1 1 0 011-1h.01a1 1 0 110 2H13a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V4a2 2 0 00-2-2H6zm1 2a1 1 0 000 2h6a1 1 0 100-2H7zm6 7a1 1 0 011 1v3a1 1 0 11-2 0v-3a1 1 0 011-1zm-3 3a1 1 0 100 2h.01a1 1 0 100-2H10zm-4 1a1 1 0 011-1h.01a1 1 0 110 2H7a1 1 0 01-1-1zm1-4a1 1 0 100 2h.01a1 1 0 100-2H7zm2 1a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1zm4-4a1 1 0 100 2h.01a1 1 0 100-2H13zM9 9a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1zM7 8a1 1 0 000 2h.01a1 1 0 000-2H7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-1.586a1 1 0 01-.707-.293l-1.121-1.121A2 2 0 0011.172 3H8.828a2 2 0 00-1.414.586L6.293 4.707A1 1 0 015.586 5H4zm6 9a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 00-2 2v4a2 2 0 002 2V6h10a2 2 0 00-2-2H4zm2 6a2 2 0 012-2h8a2 2 0 012 2v4a2 2 0 01-2 2H8a2 2 0 01-2-2v-4zm6 4a2 2 0 100-4 2 2 0 000 4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),a.createElement("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 3a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V5a2 2 0 00-2-2H5zm9 4a1 1 0 10-2 0v6a1 1 0 102 0V7zm-3 2a1 1 0 10-2 0v4a1 1 0 102 0V9zm-3 3a1 1 0 10-2 0v1a1 1 0 102 0v-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"}),a.createElement("path",{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h2a2 2 0 002-2V9a2 2 0 00-2-2h-1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 5v8a2 2 0 01-2 2h-5l-5 4v-4H4a2 2 0 01-2-2V5a2 2 0 012-2h12a2 2 0 012 2zM7 8H5v2h2V8zm2 0h2v2H9V8zm6 0h-2v2h2V8z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M15.707 4.293a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-5-5a1 1 0 011.414-1.414L10 8.586l4.293-4.293a1 1 0 011.414 0zm0 6a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-5-5a1 1 0 111.414-1.414L10 14.586l4.293-4.293a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M15.707 15.707a1 1 0 01-1.414 0l-5-5a1 1 0 010-1.414l5-5a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 010 1.414zm-6 0a1 1 0 01-1.414 0l-5-5a1 1 0 010-1.414l5-5a1 1 0 011.414 1.414L5.414 10l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10.293 15.707a1 1 0 010-1.414L14.586 10l-4.293-4.293a1 1 0 111.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z",clipRule:"evenodd"}),a.createElement("path",{fillRule:"evenodd",d:"M4.293 15.707a1 1 0 010-1.414L8.586 10 4.293 5.707a1 1 0 011.414-1.414l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4.293 15.707a1 1 0 010-1.414l5-5a1 1 0 011.414 0l5 5a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414 0zm0-6a1 1 0 010-1.414l5-5a1 1 0 011.414 0l5 5a1 1 0 01-1.414 1.414L10 5.414 5.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M13 7H7v6h6V7z"}),a.createElement("path",{fillRule:"evenodd",d:"M7 2a1 1 0 012 0v1h2V2a1 1 0 112 0v1h2a2 2 0 012 2v2h1a1 1 0 110 2h-1v2h1a1 1 0 110 2h-1v2a2 2 0 01-2 2h-2v1a1 1 0 11-2 0v-1H9v1a1 1 0 11-2 0v-1H5a2 2 0 01-2-2v-2H2a1 1 0 110-2h1V9H2a1 1 0 010-2h1V5a2 2 0 012-2h2V2zM5 5h10v10H5V5z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),a.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8 2a1 1 0 000 2h2a1 1 0 100-2H8z"}),a.createElement("path",{d:"M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),a.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm3 4a1 1 0 000 2h.01a1 1 0 100-2H7zm3 0a1 1 0 000 2h3a1 1 0 100-2h-3zm-3 4a1 1 0 100 2h.01a1 1 0 100-2H7zm3 0a1 1 0 100 2h3a1 1 0 100-2h-3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),a.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M2 9.5A3.5 3.5 0 005.5 13H9v2.586l-1.293-1.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 15.586V13h2.5a4.5 4.5 0 10-.616-8.958 4.002 4.002 0 10-7.753 1.977A3.5 3.5 0 002 9.5zm9 3.5H9V8a1 1 0 012 0v5z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13H5.5z"}),a.createElement("path",{d:"M9 13h2v5a1 1 0 11-2 0v-5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5.5 16a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 16h-8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 2a2 2 0 00-2 2v11a3 3 0 106 0V4a2 2 0 00-2-2H4zm1 14a1 1 0 100-2 1 1 0 000 2zm5-1.757l4.9-4.9a2 2 0 000-2.828L13.485 5.1a2 2 0 00-2.828 0L10 5.757v8.486zM16 18H9.071l6-6H16a2 2 0 012 2v2a2 2 0 01-2 2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M4 4a2 2 0 00-2 2v1h16V6a2 2 0 00-2-2H4z"}),a.createElement("path",{fillRule:"evenodd",d:"M18 9H2v5a2 2 0 002 2h12a2 2 0 002-2V9zM4 13a1 1 0 011-1h1a1 1 0 110 2H5a1 1 0 01-1-1zm5-1a1 1 0 100 2h1a1 1 0 100-2H9z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9.504 1.132a1 1 0 01.992 0l1.75 1a1 1 0 11-.992 1.736L10 3.152l-1.254.716a1 1 0 11-.992-1.736l1.75-1zM5.618 4.504a1 1 0 01-.372 1.364L5.016 6l.23.132a1 1 0 11-.992 1.736L4 7.723V8a1 1 0 01-2 0V6a.996.996 0 01.52-.878l1.734-.99a1 1 0 011.364.372zm8.764 0a1 1 0 011.364-.372l1.733.99A1.002 1.002 0 0118 6v2a1 1 0 11-2 0v-.277l-.254.145a1 1 0 11-.992-1.736l.23-.132-.23-.132a1 1 0 01-.372-1.364zm-7 4a1 1 0 011.364-.372L10 8.848l1.254-.716a1 1 0 11.992 1.736L11 10.58V12a1 1 0 11-2 0v-1.42l-1.246-.712a1 1 0 01-.372-1.364zM3 11a1 1 0 011 1v1.42l1.246.712a1 1 0 11-.992 1.736l-1.75-1A1 1 0 012 14v-2a1 1 0 011-1zm14 0a1 1 0 011 1v2a1 1 0 01-.504.868l-1.75 1a1 1 0 11-.992-1.736L16 13.42V12a1 1 0 011-1zm-9.618 5.504a1 1 0 011.364-.372l.254.145V16a1 1 0 112 0v.277l.254-.145a1 1 0 11.992 1.736l-1.735.992a.995.995 0 01-1.022 0l-1.735-.992a1 1 0 01-.372-1.364z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M11 17a1 1 0 001.447.894l4-2A1 1 0 0017 15V9.236a1 1 0 00-1.447-.894l-4 2a1 1 0 00-.553.894V17zM15.211 6.276a1 1 0 000-1.788l-4.764-2.382a1 1 0 00-.894 0L4.789 4.488a1 1 0 000 1.788l4.764 2.382a1 1 0 00.894 0l4.764-2.382zM4.447 8.342A1 1 0 003 9.236V15a1 1 0 00.553.894l4 2A1 1 0 009 17v-5.764a1 1 0 00-.553-.894l-4-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM7 4a1 1 0 000 2 1 1 0 011 1v1H7a1 1 0 000 2h1v3a3 3 0 106 0v-1a1 1 0 10-2 0v1a1 1 0 11-2 0v-3h3a1 1 0 100-2h-3V7a3 3 0 00-3-3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8.433 7.418c.155-.103.346-.196.567-.267v1.698a2.305 2.305 0 01-.567-.267C8.07 8.34 8 8.114 8 8c0-.114.07-.34.433-.582zM11 12.849v-1.698c.22.071.412.164.567.267.364.243.433.468.433.582 0 .114-.07.34-.433.582a2.305 2.305 0 01-.567.267z"}),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a1 1 0 10-2 0v.092a4.535 4.535 0 00-1.676.662C6.602 6.234 6 7.009 6 8c0 .99.602 1.765 1.324 2.246.48.32 1.054.545 1.676.662v1.941c-.391-.127-.68-.317-.843-.504a1 1 0 10-1.51 1.31c.562.649 1.413 1.076 2.353 1.253V15a1 1 0 102 0v-.092a4.535 4.535 0 001.676-.662C13.398 13.766 14 12.991 14 12c0-.99-.602-1.765-1.324-2.246A4.535 4.535 0 0011 9.092V7.151c.391.127.68.317.843.504a1 1 0 101.511-1.31c-.563-.649-1.413-1.076-2.354-1.253V5z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.736 6.979C9.208 6.193 9.696 6 10 6c.304 0 .792.193 1.264.979a1 1 0 001.715-1.029C12.279 4.784 11.232 4 10 4s-2.279.784-2.979 1.95c-.285.475-.507 1-.67 1.55H6a1 1 0 000 2h.013a9.358 9.358 0 000 1H6a1 1 0 100 2h.351c.163.55.385 1.075.67 1.55C7.721 15.216 8.768 16 10 16s2.279-.784 2.979-1.95a1 1 0 10-1.715-1.029c-.472.786-.96.979-1.264.979-.304 0-.792-.193-1.264-.979a4.265 4.265 0 01-.264-.521H10a1 1 0 100-2H8.017a7.36 7.36 0 010-1H10a1 1 0 100-2H8.472c.08-.185.167-.36.264-.521z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-14a3 3 0 00-3 3v2H7a1 1 0 000 2h1v1a1 1 0 01-1 1 1 1 0 100 2h6a1 1 0 100-2H9.83c.11-.313.17-.65.17-1v-1h1a1 1 0 100-2h-1V7a1 1 0 112 0 1 1 0 102 0 3 3 0 00-3-3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM7 5a1 1 0 100 2h1a2 2 0 011.732 1H7a1 1 0 100 2h2.732A2 2 0 018 11H7a1 1 0 00-.707 1.707l3 3a1 1 0 001.414-1.414l-1.483-1.484A4.008 4.008 0 0011.874 10H13a1 1 0 100-2h-1.126a3.976 3.976 0 00-.41-1H13a1 1 0 100-2H7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM7.858 5.485a1 1 0 00-1.715 1.03L7.633 9H7a1 1 0 100 2h1.834l.166.277V12H7a1 1 0 100 2h2v1a1 1 0 102 0v-1h2a1 1 0 100-2h-2v-.723l.166-.277H13a1 1 0 100-2h-.634l1.492-2.486a1 1 0 10-1.716-1.029L10.034 9h-.068L7.858 5.485z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6.672 1.911a1 1 0 10-1.932.518l.259.966a1 1 0 001.932-.518l-.26-.966zM2.429 4.74a1 1 0 10-.517 1.932l.966.259a1 1 0 00.517-1.932l-.966-.26zm8.814-.569a1 1 0 00-1.415-1.414l-.707.707a1 1 0 101.415 1.415l.707-.708zm-7.071 7.072l.707-.707A1 1 0 003.465 9.12l-.708.707a1 1 0 001.415 1.415zm3.2-5.171a1 1 0 00-1.3 1.3l4 10a1 1 0 001.823.075l1.38-2.759 3.018 3.02a1 1 0 001.414-1.415l-3.019-3.02 2.76-1.379a1 1 0 00-.076-1.822l-10-4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M3 12v3c0 1.657 3.134 3 7 3s7-1.343 7-3v-3c0 1.657-3.134 3-7 3s-7-1.343-7-3z"}),a.createElement("path",{d:"M3 7v3c0 1.657 3.134 3 7 3s7-1.343 7-3V7c0 1.657-3.134 3-7 3S3 8.657 3 7z"}),a.createElement("path",{d:"M17 5c0 1.657-3.134 3-7 3S3 6.657 3 5s3.134-3 7-3 7 1.343 7 3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 5a2 2 0 012-2h10a2 2 0 012 2v8a2 2 0 01-2 2h-2.22l.123.489.804.804A1 1 0 0113 18H7a1 1 0 01-.707-1.707l.804-.804L7.22 15H5a2 2 0 01-2-2V5zm5.771 7H5V5h10v7H8.771z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M7 2a2 2 0 00-2 2v12a2 2 0 002 2h6a2 2 0 002-2V4a2 2 0 00-2-2H7zm3 14a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V4a2 2 0 00-2-2H6zm4 14a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm5 6a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V8z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm5 6a1 1 0 10-2 0v3.586l-1.293-1.293a1 1 0 10-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 11.586V8z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9 2a2 2 0 00-2 2v8a2 2 0 002 2h6a2 2 0 002-2V6.414A2 2 0 0016.414 5L14 2.586A2 2 0 0012.586 2H9z"}),a.createElement("path",{d:"M3 8a2 2 0 012-2v10h8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm1 8a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm2 10a1 1 0 10-2 0v3a1 1 0 102 0v-3zm2-3a1 1 0 011 1v5a1 1 0 11-2 0v-5a1 1 0 011-1zm4-1a1 1 0 10-2 0v7a1 1 0 102 0V8z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2h-1.528A6 6 0 004 9.528V4z"}),a.createElement("path",{fillRule:"evenodd",d:"M8 10a4 4 0 00-3.446 6.032l-1.261 1.26a1 1 0 101.414 1.415l1.261-1.261A4 4 0 108 10zm-2 4a2 2 0 114 0 2 2 0 01-4 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M7 9a2 2 0 012-2h6a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9z"}),a.createElement("path",{d:"M5 3a2 2 0 00-2 2v6a2 2 0 002 2V5h8a2 2 0 00-2-2H5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM7 9a1 1 0 100-2 1 1 0 000 2zm7-1a1 1 0 11-2 0 1 1 0 012 0zm-.464 5.535a1 1 0 10-1.415-1.414 3 3 0 01-4.242 0 1 1 0 00-1.415 1.414 5 5 0 007.072 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM7 9a1 1 0 100-2 1 1 0 000 2zm7-1a1 1 0 11-2 0 1 1 0 012 0zm-7.536 5.879a1 1 0 001.415 0 3 3 0 014.242 0 1 1 0 001.415-1.415 5 5 0 00-7.072 0 1 1 0 000 1.415z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),a.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3.707 2.293a1 1 0 00-1.414 1.414l14 14a1 1 0 001.414-1.414l-1.473-1.473A10.014 10.014 0 0019.542 10C18.268 5.943 14.478 3 10 3a9.958 9.958 0 00-4.512 1.074l-1.78-1.781zm4.261 4.26l1.514 1.515a2.003 2.003 0 012.45 2.45l1.514 1.514a4 4 0 00-5.478-5.478z",clipRule:"evenodd"}),a.createElement("path",{d:"M12.454 16.697L9.75 13.992a4 4 0 01-3.742-3.741L2.335 6.578A9.98 9.98 0 00.458 10c1.274 4.057 5.065 7 9.542 7 .847 0 1.669-.105 2.454-.303z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"}),a.createElement("path",{fillRule:"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M4.555 5.168A1 1 0 003 6v8a1 1 0 001.555.832L10 11.202V14a1 1 0 001.555.832l6-4a1 1 0 000-1.664l-6-4A1 1 0 0010 6v2.798l-5.445-3.63z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm3 2h6v4H7V5zm8 8v2h1v-2h-1zm-2-2H7v4h6v-4zm2 0h1V9h-1v2zm1-4V5h-1v2h1zM5 5v2H4V5h1zm0 4H4v2h1V9zm-1 4h1v2H4v-2z",clipRule:"evenodd"}))}));const Co=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",clipRule:"evenodd"}))}));a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M6.625 2.655A9 9 0 0119 11a1 1 0 11-2 0 7 7 0 00-9.625-6.492 1 1 0 11-.75-1.853zM4.662 4.959A1 1 0 014.75 6.37 6.97 6.97 0 003 11a1 1 0 11-2 0 8.97 8.97 0 012.25-5.953 1 1 0 011.412-.088z",clipRule:"evenodd"}),a.createElement("path",{fillRule:"evenodd",d:"M5 11a5 5 0 1110 0 1 1 0 11-2 0 3 3 0 10-6 0c0 1.677-.345 3.276-.968 4.729a1 1 0 11-1.838-.789A9.964 9.964 0 005 11zm8.921 2.012a1 1 0 01.831 1.145 19.86 19.86 0 01-.545 2.436 1 1 0 11-1.92-.558c.207-.713.371-1.445.49-2.192a1 1 0 011.144-.83z",clipRule:"evenodd"}),a.createElement("path",{fillRule:"evenodd",d:"M10 10a1 1 0 011 1c0 2.236-.46 4.368-1.29 6.304a1 1 0 01-1.838-.789A13.952 13.952 0 009 11a1 1 0 011-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 6a3 3 0 013-3h10a1 1 0 01.8 1.6L14.25 8l2.55 3.4A1 1 0 0116 13H6a1 1 0 00-1 1v3a1 1 0 11-2 0V6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V8a2 2 0 00-2-2h-5L9 4H4zm7 5a1 1 0 10-2 0v1H8a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V9z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V8a2 2 0 00-2-2h-5L9 4H4zm7 5a1 1 0 10-2 0v1.586l-.293-.293a1 1 0 10-1.414 1.414l2 2 .002.002a.997.997 0 001.41 0l.002-.002 2-2a1 1 0 00-1.414-1.414l-.293.293V9z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M2 6a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1H8a3 3 0 00-3 3v1.5a1.5 1.5 0 01-3 0V6z",clipRule:"evenodd"}),a.createElement("path",{d:"M6 12a2 2 0 012-2h8a2 2 0 012 2v2a2 2 0 01-2 2H2h2a2 2 0 002-2v-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V8a2 2 0 00-2-2h-5L9 4H4zm4 6a1 1 0 100 2h4a1 1 0 100-2H8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 6a2 2 0 012-2h5l2 2h5a2 2 0 012 2v6a2 2 0 01-2 2H4a2 2 0 01-2-2V6z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 5a3 3 0 015-2.236A3 3 0 0114.83 6H16a2 2 0 110 4h-5V9a1 1 0 10-2 0v1H4a2 2 0 110-4h1.17C5.06 5.687 5 5.35 5 5zm4 1V5a1 1 0 10-1 1h1zm3 0a1 1 0 10-1-1v1h1z",clipRule:"evenodd"}),a.createElement("path",{d:"M9 11H3v5a2 2 0 002 2h4v-7zM11 18h4a2 2 0 002-2v-5h-6v7z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4.083 9h1.946c.089-1.546.383-2.97.837-4.118A6.004 6.004 0 004.083 9zM10 2a8 8 0 100 16 8 8 0 000-16zm0 2c-.076 0-.232.032-.465.262-.238.234-.497.623-.737 1.182-.389.907-.673 2.142-.766 3.556h3.936c-.093-1.414-.377-2.649-.766-3.556-.24-.56-.5-.948-.737-1.182C10.232 4.032 10.076 4 10 4zm3.971 5c-.089-1.546-.383-2.97-.837-4.118A6.004 6.004 0 0115.917 9h-1.946zm-2.003 2H8.032c.093 1.414.377 2.649.766 3.556.24.56.5.948.737 1.182.233.23.389.262.465.262.076 0 .232-.032.465-.262.238-.234.498-.623.737-1.182.389-.907.673-2.142.766-3.556zm1.166 4.118c.454-1.147.748-2.572.837-4.118h1.946a6.004 6.004 0 01-2.783 4.118zm-6.268 0C6.412 13.97 6.118 12.546 6.03 11H4.083a6.004 6.004 0 002.783 4.118z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM4.332 8.027a6.012 6.012 0 011.912-2.706C6.512 5.73 6.974 6 7.5 6A1.5 1.5 0 019 7.5V8a2 2 0 004 0 2 2 0 011.523-1.943A5.977 5.977 0 0116 10c0 .34-.028.675-.083 1H15a2 2 0 00-2 2v2.197A5.973 5.973 0 0110 16v-2a2 2 0 00-2-2 2 2 0 01-2-2 2 2 0 00-1.668-1.973z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9 3a1 1 0 012 0v5.5a.5.5 0 001 0V4a1 1 0 112 0v4.5a.5.5 0 001 0V6a1 1 0 112 0v5a7 7 0 11-14 0V9a1 1 0 012 0v2.5a.5.5 0 001 0V4a1 1 0 012 0v4.5a.5.5 0 001 0V3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9.243 3.03a1 1 0 01.727 1.213L9.53 6h2.94l.56-2.243a1 1 0 111.94.486L14.53 6H17a1 1 0 110 2h-2.97l-1 4H15a1 1 0 110 2h-2.47l-.56 2.242a1 1 0 11-1.94-.485L10.47 14H7.53l-.56 2.242a1 1 0 11-1.94-.485L5.47 14H3a1 1 0 110-2h2.97l1-4H5a1 1 0 110-2h2.47l.56-2.243a1 1 0 011.213-.727zM9.03 8l-1 4h2.938l1-4H9.031z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 2a1 1 0 00-1 1v1a1 1 0 002 0V3a1 1 0 00-1-1zM4 4h3a3 3 0 006 0h3a2 2 0 012 2v9a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zm2.5 7a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm2.45 4a2.5 2.5 0 10-4.9 0h4.9zM12 9a1 1 0 100 2h3a1 1 0 100-2h-3zm-1 4a1 1 0 011-1h2a1 1 0 110 2h-2a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8.707 7.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l2-2a1 1 0 00-1.414-1.414L11 7.586V3a1 1 0 10-2 0v4.586l-.293-.293z"}),a.createElement("path",{d:"M3 5a2 2 0 012-2h1a1 1 0 010 2H5v7h2l1 2h4l1-2h2V5h-1a1 1 0 110-2h1a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 3a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V5a2 2 0 00-2-2H5zm0 2h10v7h-2l-1 2H8l-1-2H5V5z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",clipRule:"evenodd"}))}));const Ao=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10.496 2.132a1 1 0 00-.992 0l-7 4A1 1 0 003 8v7a1 1 0 100 2h14a1 1 0 100-2V8a1 1 0 00.496-1.868l-7-4zM6 9a1 1 0 00-1 1v3a1 1 0 102 0v-3a1 1 0 00-1-1zm3 1a1 1 0 012 0v3a1 1 0 11-2 0v-3zm5-1a1 1 0 00-1 1v3a1 1 0 102 0v-3a1 1 0 00-1-1z",clipRule:"evenodd"}))}));a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z",clipRule:"evenodd"}))}));const Io=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z",clipRule:"evenodd"}))}));a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10 2a5 5 0 00-5 5v2a2 2 0 00-2 2v5a2 2 0 002 2h10a2 2 0 002-2v-5a2 2 0 00-2-2H7V7a3 3 0 015.905-.75 1 1 0 001.937-.5A5.002 5.002 0 0010 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 3a1 1 0 011 1v12a1 1 0 11-2 0V4a1 1 0 011-1zm7.707 3.293a1 1 0 010 1.414L9.414 9H17a1 1 0 110 2H9.414l1.293 1.293a1 1 0 01-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 3a1 1 0 00-1 1v12a1 1 0 102 0V4a1 1 0 00-1-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M2.94 6.412A2 2 0 002 8.108V16a2 2 0 002 2h12a2 2 0 002-2V8.108a2 2 0 00-.94-1.696l-6-3.75a2 2 0 00-2.12 0l-6 3.75zm2.615 2.423a1 1 0 10-1.11 1.664l5 3.333a1 1 0 001.11 0l5-3.333a1 1 0 00-1.11-1.664L10 11.798 5.555 8.835z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z"}),a.createElement("path",{d:"M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12 1.586l-4 4v12.828l4-4V1.586zM3.707 3.293A1 1 0 002 4v10a1 1 0 00.293.707L6 18.414V5.586L3.707 3.293zM17.707 5.293L14 1.586v12.828l2.293 2.293A1 1 0 0018 16V6a1 1 0 00-.293-.707z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM9 15a1 1 0 011-1h6a1 1 0 110 2h-6a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 7a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 13a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M7 4a3 3 0 016 0v4a3 3 0 11-6 0V4zm4 10.93A7.001 7.001 0 0017 8a1 1 0 10-2 0A5 5 0 015 8a1 1 0 00-2 0 7.001 7.001 0 006 6.93V17H6a1 1 0 100 2h8a1 1 0 100-2h-3v-2.07z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM7 9a1 1 0 000 2h6a1 1 0 100-2H7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M18 3a1 1 0 00-1.196-.98l-10 2A1 1 0 006 5v9.114A4.369 4.369 0 005 14c-1.657 0-3 .895-3 2s1.343 2 3 2 3-.895 3-2V7.82l8-1.6v5.894A4.37 4.37 0 0015 12c-1.657 0-3 .895-3 2s1.343 2 3 2 3-.895 3-2V3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h8a2 2 0 012 2v10a2 2 0 002 2H4a2 2 0 01-2-2V5zm3 1h6v4H5V6zm6 6H5v2h6v-2z",clipRule:"evenodd"}),a.createElement("path",{d:"M15 7h1a2 2 0 012 2v5.5a1.5 1.5 0 01-3 0V7z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h8a2 2 0 012 2v12a1 1 0 110 2h-3a1 1 0 01-1-1v-2a1 1 0 00-1-1H9a1 1 0 00-1 1v2a1 1 0 01-1 1H4a1 1 0 110-2V4zm3 1h2v2H7V5zm2 4H7v2h2V9zm2-4h2v2h-2V5zm2 4h-2v2h2V9z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"}),a.createElement("path",{fillRule:"evenodd",d:"M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M14.414 7l3.293-3.293a1 1 0 00-1.414-1.414L13 5.586V4a1 1 0 10-2 0v4.003a.996.996 0 00.617.921A.997.997 0 0012 9h4a1 1 0 100-2h-1.586z"}),a.createElement("path",{d:"M2 3a1 1 0 011-1h2.153a1 1 0 01.986.836l.74 4.435a1 1 0 01-.54 1.06l-1.548.773a11.037 11.037 0 006.105 6.105l.774-1.548a1 1 0 011.059-.54l4.435.74a1 1 0 01.836.986V17a1 1 0 01-1 1h-2C7.82 18 2 12.18 2 5V3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 3a1 1 0 011-1h2.153a1 1 0 01.986.836l.74 4.435a1 1 0 01-.54 1.06l-1.548.773a11.037 11.037 0 006.105 6.105l.774-1.548a1 1 0 011.059-.54l4.435.74a1 1 0 01.836.986V17a1 1 0 01-1 1h-2C7.82 18 2 12.18 2 5V3z"}),a.createElement("path",{d:"M16.707 3.293a1 1 0 010 1.414L15.414 6l1.293 1.293a1 1 0 01-1.414 1.414L14 7.414l-1.293 1.293a1 1 0 11-1.414-1.414L12.586 6l-1.293-1.293a1 1 0 011.414-1.414L14 4.586l1.293-1.293a1 1 0 011.414 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M17.924 2.617a.997.997 0 00-.215-.322l-.004-.004A.997.997 0 0017 2h-4a1 1 0 100 2h1.586l-3.293 3.293a1 1 0 001.414 1.414L16 5.414V7a1 1 0 102 0V3a.997.997 0 00-.076-.383z"}),a.createElement("path",{d:"M2 3a1 1 0 011-1h2.153a1 1 0 01.986.836l.74 4.435a1 1 0 01-.54 1.06l-1.548.773a11.037 11.037 0 006.105 6.105l.774-1.548a1 1 0 011.059-.54l4.435.74a1 1 0 01.836.986V17a1 1 0 01-1 1h-2C7.82 18 2 12.18 2 5V3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 3a1 1 0 011-1h2.153a1 1 0 01.986.836l.74 4.435a1 1 0 01-.54 1.06l-1.548.773a11.037 11.037 0 006.105 6.105l.774-1.548a1 1 0 011.059-.54l4.435.74a1 1 0 01.836.986V17a1 1 0 01-1 1h-2C7.82 18 2 12.18 2 5V3z"}))}));const Ro=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z",clipRule:"evenodd"}))}));a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11 4a1 1 0 10-2 0v4a1 1 0 102 0V7zm-3 1a1 1 0 10-2 0v3a1 1 0 102 0V8zM8 9a1 1 0 00-2 0v2a1 1 0 102 0V9z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 0l-2 2a1 1 0 101.414 1.414L8 10.414l1.293 1.293a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 4v3H4a2 2 0 00-2 2v3a2 2 0 002 2h1v2a2 2 0 002 2h6a2 2 0 002-2v-2h1a2 2 0 002-2V9a2 2 0 00-2-2h-1V4a2 2 0 00-2-2H7a2 2 0 00-2 2zm8 0H7v3h6V4zm0 8H7v4h6v-4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M10 3.5a1.5 1.5 0 013 0V4a1 1 0 001 1h3a1 1 0 011 1v3a1 1 0 01-1 1h-.5a1.5 1.5 0 000 3h.5a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1v-.5a1.5 1.5 0 00-3 0v.5a1 1 0 01-1 1H6a1 1 0 01-1-1v-3a1 1 0 00-1-1h-.5a1.5 1.5 0 010-3H4a1 1 0 001-1V6a1 1 0 011-1h3a1 1 0 001-1v-.5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 4a1 1 0 011-1h3a1 1 0 011 1v3a1 1 0 01-1 1H4a1 1 0 01-1-1V4zm2 2V5h1v1H5zM3 13a1 1 0 011-1h3a1 1 0 011 1v3a1 1 0 01-1 1H4a1 1 0 01-1-1v-3zm2 2v-1h1v1H5zM13 3a1 1 0 00-1 1v3a1 1 0 001 1h3a1 1 0 001-1V4a1 1 0 00-1-1h-3zm1 2v1h1V5h-1z",clipRule:"evenodd"}),a.createElement("path",{d:"M11 4a1 1 0 10-2 0v1a1 1 0 002 0V4zM10 7a1 1 0 011 1v1h2a1 1 0 110 2h-3a1 1 0 01-1-1V8a1 1 0 011-1zM16 9a1 1 0 100 2 1 1 0 000-2zM9 13a1 1 0 011-1h1a1 1 0 110 2v2a1 1 0 11-2 0v-3zM7 11a1 1 0 100-2H4a1 1 0 100 2h3zM17 13a1 1 0 01-1 1h-2a1 1 0 110-2h2a1 1 0 011 1zM16 17a1 1 0 100-2h-3a1 1 0 100 2h3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 2a2 2 0 00-2 2v14l3.5-2 3.5 2 3.5-2 3.5 2V4a2 2 0 00-2-2H5zm4.707 3.707a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L8.414 9H10a3 3 0 013 3v1a1 1 0 102 0v-1a5 5 0 00-5-5H8.414l1.293-1.293z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 2a2 2 0 00-2 2v14l3.5-2 3.5 2 3.5-2 3.5 2V4a2 2 0 00-2-2H5zm2.5 3a1.5 1.5 0 100 3 1.5 1.5 0 000-3zm6.207.293a1 1 0 00-1.414 0l-6 6a1 1 0 101.414 1.414l6-6a1 1 0 000-1.414zM12.5 10a1.5 1.5 0 100 3 1.5 1.5 0 000-3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M7.707 3.293a1 1 0 010 1.414L5.414 7H11a7 7 0 017 7v2a1 1 0 11-2 0v-2a5 5 0 00-5-5H5.414l2.293 2.293a1 1 0 11-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8.445 14.832A1 1 0 0010 14v-2.798l5.445 3.63A1 1 0 0017 14V6a1 1 0 00-1.555-.832L10 8.798V6a1 1 0 00-1.555-.832l-6 4a1 1 0 000 1.664l6 4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5 3a1 1 0 000 2c5.523 0 10 4.477 10 10a1 1 0 102 0C17 8.373 11.627 3 5 3z"}),a.createElement("path",{d:"M4 9a1 1 0 011-1 7 7 0 017 7 1 1 0 11-2 0 5 5 0 00-5-5 1 1 0 01-1-1zM3 15a2 2 0 114 0 2 2 0 01-4 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9.707 7.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L13 8.586V5h3a2 2 0 012 2v5a2 2 0 01-2 2H8a2 2 0 01-2-2V7a2 2 0 012-2h3v3.586L9.707 7.293zM11 3a1 1 0 112 0v2h-2V3z"}),a.createElement("path",{d:"M4 9a2 2 0 00-2 2v5a2 2 0 002 2h8a2 2 0 002-2H4V9z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M7.707 10.293a1 1 0 10-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 11.586V6h5a2 2 0 012 2v7a2 2 0 01-2 2H4a2 2 0 01-2-2V8a2 2 0 012-2h5v5.586l-1.293-1.293zM9 4a1 1 0 012 0v2H9V4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 2a1 1 0 011 1v1.323l3.954 1.582 1.599-.8a1 1 0 01.894 1.79l-1.233.616 1.738 5.42a1 1 0 01-.285 1.05A3.989 3.989 0 0115 15a3.989 3.989 0 01-2.667-1.019 1 1 0 01-.285-1.05l1.715-5.349L11 6.477V16h2a1 1 0 110 2H7a1 1 0 110-2h2V6.477L6.237 7.582l1.715 5.349a1 1 0 01-.285 1.05A3.989 3.989 0 015 15a3.989 3.989 0 01-2.667-1.019 1 1 0 01-.285-1.05l1.738-5.42-1.233-.617a1 1 0 01.894-1.788l1.599.799L9 4.323V3a1 1 0 011-1zm-5 8.274l-.818 2.552c.25.112.526.174.818.174.292 0 .569-.062.818-.174L5 10.274zm10 0l-.818 2.552c.25.112.526.174.818.174.292 0 .569-.062.818-.174L15 10.274z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5.5 2a3.5 3.5 0 101.665 6.58L8.585 10l-1.42 1.42a3.5 3.5 0 101.414 1.414l8.128-8.127a1 1 0 00-1.414-1.414L10 8.586l-1.42-1.42A3.5 3.5 0 005.5 2zM4 5.5a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm0 9a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0z",clipRule:"evenodd"}),a.createElement("path",{d:"M12.828 11.414a1 1 0 00-1.414 1.414l3.879 3.88a1 1 0 001.414-1.415l-3.879-3.879z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"}))}));const Lo=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"}))}));a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M15 8a3 3 0 10-2.977-2.63l-4.94 2.47a3 3 0 100 4.319l4.94 2.47a3 3 0 10.895-1.789l-4.94-2.47a3.027 3.027 0 000-.74l4.94-2.47C13.456 7.68 14.19 8 15 8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 1.944A11.954 11.954 0 012.166 5C2.056 5.649 2 6.319 2 7c0 5.225 3.34 9.67 8 11.317C14.66 16.67 18 12.225 18 7c0-.682-.057-1.35-.166-2.001A11.954 11.954 0 0110 1.944zM11 14a1 1 0 11-2 0 1 1 0 012 0zm0-7a1 1 0 10-2 0v3a1 1 0 102 0V7z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 2a4 4 0 00-4 4v1H5a1 1 0 00-.994.89l-1 9A1 1 0 004 18h12a1 1 0 00.994-1.11l-1-9A1 1 0 0015 7h-1V6a4 4 0 00-4-4zm2 5V6a2 2 0 10-4 0v1h4zm-6 3a1 1 0 112 0 1 1 0 01-2 0zm7-1a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M3 3a1 1 0 000 2h11a1 1 0 100-2H3zM3 7a1 1 0 000 2h5a1 1 0 000-2H3zM3 11a1 1 0 100 2h4a1 1 0 100-2H3zM13 16a1 1 0 102 0v-5.586l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 101.414 1.414L13 10.414V16z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M3 3a1 1 0 000 2h11a1 1 0 100-2H3zM3 7a1 1 0 000 2h7a1 1 0 100-2H3zM3 11a1 1 0 100 2h4a1 1 0 100-2H3zM15 8a1 1 0 10-2 0v5.586l-1.293-1.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L15 13.586V8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 3a1 1 0 00-1.447-.894L8.763 6H5a3 3 0 000 6h.28l1.771 5.316A1 1 0 008 18h1a1 1 0 001-1v-4.382l6.553 3.276A1 1 0 0018 15V3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M3.707 2.293a1 1 0 00-1.414 1.414l6.921 6.922c.05.062.105.118.168.167l6.91 6.911a1 1 0 001.415-1.414l-.675-.675a9.001 9.001 0 00-.668-11.982A1 1 0 1014.95 5.05a7.002 7.002 0 01.657 9.143l-1.435-1.435a5.002 5.002 0 00-.636-6.294A1 1 0 0012.12 7.88c.924.923 1.12 2.3.587 3.415l-1.992-1.992a.922.922 0 00-.018-.018l-6.99-6.991zM3.238 8.187a1 1 0 00-1.933-.516c-.8 3-.025 6.336 2.331 8.693a1 1 0 001.414-1.415 6.997 6.997 0 01-1.812-6.762zM7.4 11.5a1 1 0 10-1.73 1c.214.371.48.72.795 1.035a1 1 0 001.414-1.414c-.191-.191-.35-.4-.478-.622z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5.05 3.636a1 1 0 010 1.414 7 7 0 000 9.9 1 1 0 11-1.414 1.414 9 9 0 010-12.728 1 1 0 011.414 0zm9.9 0a1 1 0 011.414 0 9 9 0 010 12.728 1 1 0 11-1.414-1.414 7 7 0 000-9.9 1 1 0 010-1.414zM7.879 6.464a1 1 0 010 1.414 3 3 0 000 4.243 1 1 0 11-1.415 1.414 5 5 0 010-7.07 1 1 0 011.415 0zm4.242 0a1 1 0 011.415 0 5 5 0 010 7.072 1 1 0 01-1.415-1.415 3 3 0 000-4.242 1 1 0 010-1.415zM10 9a1 1 0 011 1v.01a1 1 0 11-2 0V10a1 1 0 011-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-2 0c0 .993-.241 1.929-.668 2.754l-1.524-1.525a3.997 3.997 0 00.078-2.183l1.562-1.562C15.802 8.249 16 9.1 16 10zm-5.165 3.913l1.58 1.58A5.98 5.98 0 0110 16a5.976 5.976 0 01-2.516-.552l1.562-1.562a4.006 4.006 0 001.789.027zm-4.677-2.796a4.002 4.002 0 01-.041-2.08l-.08.08-1.53-1.533A5.98 5.98 0 004 10c0 .954.223 1.856.619 2.657l1.54-1.54zm1.088-6.45A5.974 5.974 0 0110 4c.954 0 1.856.223 2.657.619l-1.54 1.54a4.002 4.002 0 00-2.346.033L7.246 4.668zM12 10a2 2 0 11-4 0 2 2 0 014 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8 5a1 1 0 100 2h5.586l-1.293 1.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L13.586 5H8zM12 15a1 1 0 100-2H6.414l1.293-1.293a1 1 0 10-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L6.414 15H12z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5 12a1 1 0 102 0V6.414l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L5 6.414V12zM15 8a1 1 0 10-2 0v5.586l-1.293-1.293a1 1 0 00-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L15 13.586V8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M5 4a3 3 0 00-3 3v6a3 3 0 003 3h10a3 3 0 003-3V7a3 3 0 00-3-3H5zm-1 9v-1h5v2H5a1 1 0 01-1-1zm7 1h4a1 1 0 001-1v-1h-5v2zm0-4h5V8h-5v2zM9 8H4v2h5V8z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M17.707 9.293a1 1 0 010 1.414l-7 7a1 1 0 01-1.414 0l-7-7A.997.997 0 012 10V5a3 3 0 013-3h5c.256 0 .512.098.707.293l7 7zM5 6a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm3.293 1.293a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 01-1.414-1.414L7.586 10 5.293 7.707a1 1 0 010-1.414zM11 12a1 1 0 100 2h3a1 1 0 100-2h-3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M18 9.5a1.5 1.5 0 11-3 0v-6a1.5 1.5 0 013 0v6zM14 9.667v-5.43a2 2 0 00-1.105-1.79l-.05-.025A4 4 0 0011.055 2H5.64a2 2 0 00-1.962 1.608l-1.2 6A2 2 0 004.44 12H8v4a2 2 0 002 2 1 1 0 001-1v-.667a4 4 0 01.8-2.4l1.4-1.866a4 4 0 00.8-2.4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 6a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 100 4v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2a2 2 0 100-4V6z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M7 2a1 1 0 011 1v1h3a1 1 0 110 2H9.578a18.87 18.87 0 01-1.724 4.78c.29.354.596.696.914 1.026a1 1 0 11-1.44 1.389c-.188-.196-.373-.396-.554-.6a19.098 19.098 0 01-3.107 3.567 1 1 0 01-1.334-1.49 17.087 17.087 0 003.13-3.733 18.992 18.992 0 01-1.487-2.494 1 1 0 111.79-.89c.234.47.489.928.764 1.372.417-.934.752-1.913.997-2.927H3a1 1 0 110-2h3V3a1 1 0 011-1zm6 6a1 1 0 01.894.553l2.991 5.982a.869.869 0 01.02.037l.99 1.98a1 1 0 11-1.79.895L15.383 16h-4.764l-.724 1.447a1 1 0 11-1.788-.894l.99-1.98.019-.038 2.99-5.982A1 1 0 0113 8zm-1.382 6h2.764L13 11.236 11.618 14z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12 13a1 1 0 100 2h5a1 1 0 001-1V9a1 1 0 10-2 0v2.586l-4.293-4.293a1 1 0 00-1.414 0L8 9.586 3.707 5.293a1 1 0 00-1.414 1.414l5 5a1 1 0 001.414 0L11 9.414 14.586 13H12z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M12 7a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0V8.414l-4.293 4.293a1 1 0 01-1.414 0L8 10.414l-4.293 4.293a1 1 0 01-1.414-1.414l5-5a1 1 0 011.414 0L11 10.586 14.586 7H12z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM15 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"}),a.createElement("path",{d:"M3 4a1 1 0 00-1 1v10a1 1 0 001 1h1.05a2.5 2.5 0 014.9 0H10a1 1 0 001-1V5a1 1 0 00-1-1H3zM14 7a1 1 0 00-1 1v6.05A2.5 2.5 0 0115.95 16H17a1 1 0 001-1v-5a1 1 0 00-.293-.707l-2-2A1 1 0 0015 7h-1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M8 9a3 3 0 100-6 3 3 0 000 6zM8 11a6 6 0 016 6H2a6 6 0 016-6zM16 7a1 1 0 10-2 0v1h-1a1 1 0 100 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2h-1V7z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M11 6a3 3 0 11-6 0 3 3 0 016 0zM14 17a6 6 0 00-12 0h12zM13 8a1 1 0 100 2h4a1 1 0 100-2h-4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4.649 3.084A1 1 0 015.163 4.4 13.95 13.95 0 004 10c0 1.993.416 3.886 1.164 5.6a1 1 0 01-1.832.8A15.95 15.95 0 012 10c0-2.274.475-4.44 1.332-6.4a1 1 0 011.317-.516zM12.96 7a3 3 0 00-2.342 1.126l-.328.41-.111-.279A2 2 0 008.323 7H8a1 1 0 000 2h.323l.532 1.33-1.035 1.295a1 1 0 01-.781.375H7a1 1 0 100 2h.039a3 3 0 002.342-1.126l.328-.41.111.279A2 2 0 0011.677 14H12a1 1 0 100-2h-.323l-.532-1.33 1.035-1.295A1 1 0 0112.961 9H13a1 1 0 100-2h-.039zm1.874-2.6a1 1 0 011.833-.8A15.95 15.95 0 0118 10c0 2.274-.475 4.44-1.332 6.4a1 1 0 11-1.832-.8A13.949 13.949 0 0016 10c0-1.993-.416-3.886-1.165-5.6z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 6a2 2 0 012-2h6a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V6zM14.553 7.106A1 1 0 0014 8v4a1 1 0 00.553.894l2 1A1 1 0 0018 13V7a1 1 0 00-1.447-.894l-2 1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M2 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1H3a1 1 0 01-1-1V4zM8 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1H9a1 1 0 01-1-1V4zM15 3a1 1 0 00-1 1v12a1 1 0 001 1h2a1 1 0 001-1V4a1 1 0 00-1-1h-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5 3a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2V5a2 2 0 00-2-2H5zM5 11a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2v-2a2 2 0 00-2-2H5zM11 5a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V5zM14 11a1 1 0 011 1v1h1a1 1 0 110 2h-1v1a1 1 0 11-2 0v-1h-1a1 1 0 110-2h1v-1a1 1 0 011-1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5 3a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2V5a2 2 0 00-2-2H5zM5 11a2 2 0 00-2 2v2a2 2 0 002 2h2a2 2 0 002-2v-2a2 2 0 00-2-2H5zM11 5a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V5zM11 13a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M3 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M17.778 8.222c-4.296-4.296-11.26-4.296-15.556 0A1 1 0 01.808 6.808c5.076-5.077 13.308-5.077 18.384 0a1 1 0 01-1.414 1.414zM14.95 11.05a7 7 0 00-9.9 0 1 1 0 01-1.414-1.414 9 9 0 0112.728 0 1 1 0 01-1.414 1.414zM12.12 13.88a3 3 0 00-4.242 0 1 1 0 01-1.415-1.415 5 5 0 017.072 0 1 1 0 01-1.415 1.415zM9 16a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1z",clipRule:"evenodd"}))}));const zo=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))}));const Po=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))}));function Oo({selected:t,setSelected:n,items:r,label:i,position:o="left"}){const a=Object.values(t).filter(Boolean).length;return s.default.createElement(ii,{as:"div",className:"filter-dropdown"},s.default.createElement(ii.Button,{className:"filter-button"},i,a>0&&` (${a})`,s.default.createElement(Co,{className:"h-5 w-5"})),s.default.createElement(So,{as:e.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95"},s.default.createElement(ii.Items,{className:Me("filter-items",{"filter-items--left":"left"===o,"filter-items--right":"right"===o})},r.sort(((e,t)=>{var n;return null===(n=e.text)||void 0===n?void 0:n.localeCompare(null==t?void 0:t.text)})).map((e=>s.default.createElement(ii.Item,{key:e.id},(({active:r})=>s.default.createElement("button",{type:"button",className:"filter-item",onClick:r=>{r.preventDefault(),r.stopPropagation(),n(Object.assign(Object.assign({},t),{[e.id]:!t[e.id]}))}},s.default.createElement("input",{type:"checkbox",checked:t[e.id],readOnly:!0,className:"filter-check"}),s.default.createElement("span",null,e.text)))))))))}a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M5 8a1 1 0 011-1h1V6a1 1 0 012 0v1h1a1 1 0 110 2H9v1a1 1 0 11-2 0V9H6a1 1 0 01-1-1z"}),a.createElement("path",{fillRule:"evenodd",d:"M2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8zm6-4a4 4 0 100 8 4 4 0 000-8z",clipRule:"evenodd"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"}),a.createElement("path",{fillRule:"evenodd",d:"M5 8a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z",clipRule:"evenodd"}))})),Oo.defaultProps={position:"left"};const Do="plinth.org.uk",Bo=e=>{var t,n,r;const i="timetospare-public/o/";if(!(null==e?void 0:e.includes("firebasestorage.googleapis.com"))||!(null==e?void 0:e.includes(i)))return e;return`https://cdn.timetospare.com/${null===(r=null===(n=null===(t=null==e?void 0:e.split(i))||void 0===t?void 0:t[1].split("?"))||void 0===n?void 0:n[0])||void 0===r?void 0:r.replace(/%2F/g,"/")}`};function Fo({className:e}){return s.default.createElement("div",{className:e},s.default.createElement(Ro,{className:"blank-image"}))}function jo({img:e,className:t}){const{src:n,alt:r}=e||{};return n?s.default.createElement("img",{src:Bo(n),alt:r||"",className:t}):s.default.createElement(Fo,{className:t})}Fo.defaultProps={className:void 0},jo.defaultProps={className:void 0};var No=["MO","TU","WE","TH","FR","SA","SU"],Vo=function(){function e(e,t){if(0===t)throw new Error("Can't create weekday with n == 0");this.weekday=e,this.n=t}return e.fromStr=function(t){return new e(No.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(e){return this.weekday===e.weekday&&this.n===e.n},e.prototype.toString=function(){var e=No[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e},e.prototype.getJsWeekday=function(){return 6===this.weekday?0:this.weekday+1},e}(),Uo=function(e){return null!=e},Ho=function(e){return"number"==typeof e},Wo=function(e){return"string"==typeof e&&No.includes(e)},$o=Array.isArray,Go=function(e,t){void 0===t&&(t=e),1===arguments.length&&(t=e,e=0);for(var n=[],r=e;r<t;r++)n.push(r);return n},qo=function(e,t){var n=0,r=[];if($o(e))for(;n<t;n++)r[n]=[].concat(e);else for(;n<t;n++)r[n]=e;return r};function Zo(e,t,n){void 0===n&&(n=" ");var r=String(e);return t>>=0,r.length>t?String(r):((t-=r.length)>n.length&&(n+=qo(n,t/n.length)),n.slice(0,t)+String(r))}var Xo=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},Yo=function(e,t){var n=e%t;return n*t<0?n+t:n},Ko=function(e,t){return{div:Math.floor(e/t),mod:Yo(e,t)}},Jo=function(e){return!Uo(e)||0===e.length},Qo=function(e){return!Jo(e)},ea=function(e,t){return Qo(e)&&-1!==e.indexOf(t)},ta=function(e,t,n,r,i,o){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),new Date(Date.UTC(e,t-1,n,r,i,o))},na=[31,28,31,30,31,30,31,31,30,31,30,31],ra=864e5,ia=9999,oa=ta(1970,1,1),aa=[6,0,1,2,3,4,5],sa=function(e){return e%4==0&&e%100!=0||e%400==0},la=function(e){return e instanceof Date},ca=function(e){return la(e)&&!isNaN(e.getTime())},ua=function(e){return 60*e.getTimezoneOffset()*1e3},ha=function(e){return n=oa,r=(t=e).getTime()-ua(t)-(n.getTime()-ua(n)),Math.round(r/ra);var t,n,r},da=function(e){return new Date(oa.getTime()+e*ra)},fa=function(e){var t=e.getUTCMonth();return 1===t&&sa(e.getUTCFullYear())?29:na[t]},pa=function(e){return aa[e.getUTCDay()]},ma=function(e,t){var n=ta(e,t+1,1);return[pa(n),fa(n)]},ga=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},va=function(e){return new Date(e.getTime())},ya=function(e){for(var t=[],n=0;n<e.length;n++)t.push(va(e[n]));return t},_a=function(e){e.sort((function(e,t){return e.getTime()-t.getTime()}))},xa=function(e,t){void 0===t&&(t=!0);var n=new Date(e);return[Zo(n.getUTCFullYear().toString(),4,"0"),Zo(n.getUTCMonth()+1,2,"0"),Zo(n.getUTCDate(),2,"0"),"T",Zo(n.getUTCHours(),2,"0"),Zo(n.getUTCMinutes(),2,"0"),Zo(n.getUTCSeconds(),2,"0"),t?"Z":""].join("")},wa=function(e){var t=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e);if(!t)throw new Error("Invalid UNTIL value: ".concat(e));return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))},ba=function(e,t){return e.toLocaleString("sv-SE",{timeZone:t}).replace(" ","T")+"Z"},Ea=function(){function e(e,t){this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=e,this.args=t,"between"===e?(this.maxDate=t.inc?t.before:new Date(t.before.getTime()-1),this.minDate=t.inc?t.after:new Date(t.after.getTime()+1)):"before"===e?this.maxDate=t.inc?t.dt:new Date(t.dt.getTime()-1):"after"===e&&(this.minDate=t.inc?t.dt:new Date(t.dt.getTime()+1))}return e.prototype.accept=function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if("between"===this.method){if(t)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!t||(this.add(e),!1);return this.add(e)},e.prototype.add=function(e){return this._result.push(e),!0},e.prototype.getValue=function(){var e=this._result;switch(this.method){case"all":case"between":return e;default:return e.length?e[e.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),ka=function(e,t){return ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ka(e,t)};function Ta(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ka(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ma=function(){return Ma=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ma.apply(this,arguments)};function Sa(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var Ca,Aa=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.iterator=r,i}return Ta(t,e),t.prototype.add=function(e){return!!this.iterator(e,this._result.length)&&(this._result.push(e),!0)},t}(Ea),Ia={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}},Ra=function(e,t){return-1!==e.indexOf(t)},La=function(e){return e.toString()},za=function(e,t,n){return"".concat(t," ").concat(n,", ").concat(e)},Pa=function(){function e(e,t,n,r){if(void 0===t&&(t=La),void 0===n&&(n=Ia),void 0===r&&(r=za),this.text=[],this.language=n||Ia,this.gettext=t,this.dateFormatter=r,this.rrule=e,this.options=e.options,this.origOptions=e.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),o=[].concat(this.options.bynmonthday);i.sort((function(e,t){return e-t})),o.sort((function(e,t){return t-e})),this.bymonthday=i.concat(o),this.bymonthday.length||(this.bymonthday=null)}if(Uo(this.origOptions.byweekday)){var a=$o(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],s=String(a);this.byweekday={allWeeks:a.filter((function(e){return!e.n})),someWeeks:a.filter((function(e){return Boolean(e.n)})),isWeekdays:-1!==s.indexOf("MO")&&-1!==s.indexOf("TU")&&-1!==s.indexOf("WE")&&-1!==s.indexOf("TH")&&-1!==s.indexOf("FR")&&-1===s.indexOf("SA")&&-1===s.indexOf("SU"),isEveryDay:-1!==s.indexOf("MO")&&-1!==s.indexOf("TU")&&-1!==s.indexOf("WE")&&-1!==s.indexOf("TH")&&-1!==s.indexOf("FR")&&-1!==s.indexOf("SA")&&-1!==s.indexOf("SU")};var l=function(e,t){return e.weekday-t.weekday};this.byweekday.allWeeks.sort(l),this.byweekday.someWeeks.sort(l),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return e.isFullyConvertible=function(t){if(!(t.options.freq in e.IMPLEMENTED))return!1;if(t.origOptions.until&&t.origOptions.count)return!1;for(var n in t.origOptions){if(Ra(["dtstart","wkst","freq"],n))return!0;if(!Ra(e.IMPLEMENTED[t.options.freq],n))return!1}return!0},e.prototype.isFullyConvertible=function(){return e.isFullyConvertible(this.rrule)},e.prototype.toString=function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[As.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var n=this.options.until;this.add(this.dateFormatter(n.getUTCFullYear(),this.language.monthNames[n.getUTCMonth()],n.getUTCDate()))}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")},e.prototype.HOURLY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))},e.prototype.MINUTELY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("minutes"):e("minute"))},e.prototype.DAILY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()},e.prototype.WEEKLY=function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(1===this.options.interval&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())},e.prototype.MONTHLY=function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()},e.prototype.YEARLY=function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))},e.prototype._bymonthday=function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))},e.prototype._byweekday=function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))},e.prototype._byhour=function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))},e.prototype._bymonth=function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))},e.prototype.nth=function(e){var t;e=parseInt(e.toString(),10);var n=this.gettext;if(-1===e)return n("last");var r=Math.abs(e);switch(r){case 1:case 21:case 31:t=r+n("st");break;case 2:case 22:t=r+n("nd");break;case 3:case 23:t=r+n("rd");break;default:t=r+n("th")}return e<0?t+" "+n("last"):t},e.prototype.monthtext=function(e){return this.language.monthNames[e-1]},e.prototype.weekdaytext=function(e){var t=Ho(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]},e.prototype.plural=function(e){return e%100!=1},e.prototype.add=function(e){return this.text.push(" "),this.text.push(e),this},e.prototype.list=function(e,t,n,r){var i=this;void 0===r&&(r=","),$o(e)||(e=[e]);t=t||function(e){return e.toString()};var o=function(e){return t&&t.call(i,e)};return n?function(e,t,n){for(var r="",i=0;i<e.length;i++)0!==i&&(i===e.length-1?r+=" "+n+" ":r+=t+" "),r+=e[i];return r}(e.map(o),r,n):e.map(o).join(r+" ")},e}(),Oa=function(){function e(e){this.done=!0,this.rules=e}return e.prototype.start=function(e){return this.text=e,this.done=!1,this.nextSymbol()},e.prototype.isDone=function(){return this.done&&null===this.symbol},e.prototype.nextSymbol=function(){var e,t;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in e=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===e||r[0].length>e[0].length)&&(e=r,t=n)}if(null!=e&&(this.text=this.text.substr(e[0].length),""===this.text&&(this.done=!0)),null==e)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===t);return this.symbol=t,this.value=e,!0},e.prototype.accept=function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)},e}();function Da(e,t){void 0===t&&(t=Ia);var n={},r=new Oa(t.tokens);return r.start(e)?(function(){r.expect("every");var e=r.acceptNumber();e&&(n.interval=parseInt(e[0],10));if(r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=As.DAILY,r.nextSymbol()&&(!function(){if(!r.accept("at"))return;do{var e=r.acceptNumber();if(!e)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(e[0],10)];r.accept("comma");){if(!(e=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(e[0],10))}}while(r.accept("comma")||r.accept("at"))}(),l());break;case"weekday(s)":n.freq=As.WEEKLY,n.byweekday=[As.MO,As.TU,As.WE,As.TH,As.FR],r.nextSymbol(),l();break;case"week(s)":n.freq=As.WEEKLY,r.nextSymbol()&&(i(),l());break;case"hour(s)":n.freq=As.HOURLY,r.nextSymbol()&&(i(),l());break;case"minute(s)":n.freq=As.MINUTELY,r.nextSymbol()&&(i(),l());break;case"month(s)":n.freq=As.MONTHLY,r.nextSymbol()&&(i(),l());break;case"year(s)":n.freq=As.YEARLY,r.nextSymbol()&&(i(),l());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=As.WEEKLY;var t=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[As[t]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var c=a();if(!c)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(As[c]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var e=s();if(!e)return;n.bymonthday=[e],r.nextSymbol();for(;r.accept("comma");){if(!(e=s()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(e),r.nextSymbol()}}(),l();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=As.YEARLY,n.bymonth=[o()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var u=o();if(!u)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(u),r.nextSymbol()}i(),l();break;default:throw new Error("Unknown symbol")}}(),n):null;function i(){var e=r.accept("on"),t=r.accept("the");if(e||t)do{var i=s(),l=a(),c=o();if(i)l?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(As[l].nth(i))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(i),r.accept("day(s)"));else if(l)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(As[l]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[As.MO,As.TU,As.WE,As.TH,As.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var u=r.acceptNumber();if(!u)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(u[0],10)];r.accept("comma");){if(!(u=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(u[0],10))}}else{if(!c)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(c)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function o(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function a(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function s(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var e=parseInt(r.value[1],10);if(e<-366||e>366)throw new Error("Nth out of range: "+e);return r.nextSymbol(),r.accept("last")?-e:e;default:return!1}}function l(){if("until"===r.symbol){var e=Date.parse(r.text);if(!e)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(e)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}function Ba(e){return e<Ca.HOURLY}!function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"}(Ca||(Ca={}));var Fa=function(e,t){return void 0===t&&(t=Ia),new As(Da(e,t)||void 0)},ja=["count","until","interval","byweekday","bymonthday","bymonth"];Pa.IMPLEMENTED=[],Pa.IMPLEMENTED[Ca.HOURLY]=ja,Pa.IMPLEMENTED[Ca.MINUTELY]=ja,Pa.IMPLEMENTED[Ca.DAILY]=["byhour"].concat(ja),Pa.IMPLEMENTED[Ca.WEEKLY]=ja,Pa.IMPLEMENTED[Ca.MONTHLY]=ja,Pa.IMPLEMENTED[Ca.YEARLY]=["byweekno","byyearday"].concat(ja);var Na=Pa.isFullyConvertible,Va=function(){function e(e,t,n,r){this.hour=e,this.minute=t,this.second=n,this.millisecond=r||0}return e.prototype.getHours=function(){return this.hour},e.prototype.getMinutes=function(){return this.minute},e.prototype.getSeconds=function(){return this.second},e.prototype.getMilliseconds=function(){return this.millisecond},e.prototype.getTime=function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond},e}(),Ua=function(e){function t(t,n,r,i,o,a,s){var l=e.call(this,i,o,a,s)||this;return l.year=t,l.month=n,l.day=r,l}return Ta(t,e),t.fromDate=function(e){return new this(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.valueOf()%1e3)},t.prototype.getWeekday=function(){return pa(new Date(this.getTime()))},t.prototype.getTime=function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()},t.prototype.getDay=function(){return this.day},t.prototype.getMonth=function(){return this.month},t.prototype.getYear=function(){return this.year},t.prototype.addYears=function(e){this.year+=e},t.prototype.addMonths=function(e){if(this.month+=e,this.month>12){var t=Math.floor(this.month/12),n=Yo(this.month,12);this.month=n,this.year+=t,0===this.month&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(e,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+7*e:this.day+=-(this.getWeekday()-t)+7*e,this.fixDay()},t.prototype.addDaily=function(e){this.day+=e,this.fixDay()},t.prototype.addHours=function(e,t,n){for(t&&(this.hour+=Math.floor((23-this.hour)/e)*e);;){this.hour+=e;var r=Ko(this.hour,24),i=r.div,o=r.mod;if(i&&(this.hour=o,this.addDaily(i)),Jo(n)||ea(n,this.hour))break}},t.prototype.addMinutes=function(e,t,n,r){for(t&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/e)*e);;){this.minute+=e;var i=Ko(this.minute,60),o=i.div,a=i.mod;if(o&&(this.minute=a,this.addHours(o,!1,n)),(Jo(n)||ea(n,this.hour))&&(Jo(r)||ea(r,this.minute)))break}},t.prototype.addSeconds=function(e,t,n,r,i){for(t&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/e)*e);;){this.second+=e;var o=Ko(this.second,60),a=o.div,s=o.mod;if(a&&(this.second=s,this.addMinutes(a,!1,n,r)),(Jo(n)||ea(n,this.hour))&&(Jo(r)||ea(r,this.minute))&&(Jo(i)||ea(i,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var e=ma(this.year,this.month-1)[1];if(!(this.day<=e))for(;this.day>e;){if(this.day-=e,++this.month,13===this.month&&(this.month=1,++this.year,this.year>ia))return;e=ma(this.year,this.month-1)[1]}}},t.prototype.add=function(e,t){var n=e.freq,r=e.interval,i=e.wkst,o=e.byhour,a=e.byminute,s=e.bysecond;switch(n){case Ca.YEARLY:return this.addYears(r);case Ca.MONTHLY:return this.addMonths(r);case Ca.WEEKLY:return this.addWeekly(r,i);case Ca.DAILY:return this.addDaily(r);case Ca.HOURLY:return this.addHours(r,t,o);case Ca.MINUTELY:return this.addMinutes(r,t,o,a);case Ca.SECONDLY:return this.addSeconds(r,t,o,a,s)}},t}(Va);function Ha(e){for(var t=[],n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];ea(Cs,i)||t.push(i),la(e[i])&&!ca(e[i])&&t.push(i)}if(t.length)throw new Error("Invalid options: "+t.join(", "));return Ma({},e)}function Wa(e){var t=Ma(Ma({},Ss),Ha(e));if(Uo(t.byeaster)&&(t.freq=As.YEARLY),!Uo(t.freq)||!As.FREQUENCIES[t.freq])throw new Error("Invalid frequency: ".concat(t.freq," ").concat(e.freq));if(t.dtstart||(t.dtstart=new Date((new Date).setMilliseconds(0))),Uo(t.wkst)?Ho(t.wkst)||(t.wkst=t.wkst.weekday):t.wkst=As.MO.weekday,Uo(t.bysetpos)){Ho(t.bysetpos)&&(t.bysetpos=[t.bysetpos]);for(var n=0;n<t.bysetpos.length;n++){if(0===(o=t.bysetpos[n])||!(o>=-366&&o<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(t.byweekno)||Qo(t.byweekno)||Qo(t.byyearday)||Boolean(t.bymonthday)||Qo(t.bymonthday)||Uo(t.byweekday)||Uo(t.byeaster)))switch(t.freq){case As.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case As.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case As.WEEKLY:t.byweekday=[pa(t.dtstart)]}if(Uo(t.bymonth)&&!$o(t.bymonth)&&(t.bymonth=[t.bymonth]),Uo(t.byyearday)&&!$o(t.byyearday)&&Ho(t.byyearday)&&(t.byyearday=[t.byyearday]),Uo(t.bymonthday))if($o(t.bymonthday)){var r=[],i=[];for(n=0;n<t.bymonthday.length;n++){var o;(o=t.bymonthday[n])>0?r.push(o):o<0&&i.push(o)}t.bymonthday=r,t.bynmonthday=i}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);else t.bymonthday=[],t.bynmonthday=[];if(Uo(t.byweekno)&&!$o(t.byweekno)&&(t.byweekno=[t.byweekno]),Uo(t.byweekday))if(Ho(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(Wo(t.byweekday))t.byweekday=[Vo.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof Vo)!t.byweekday.n||t.freq>As.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{var a=[],s=[];for(n=0;n<t.byweekday.length;n++){var l=t.byweekday[n];Ho(l)?a.push(l):Wo(l)?a.push(Vo.fromStr(l).weekday):!l.n||t.freq>As.MONTHLY?a.push(l.weekday):s.push([l.weekday,l.n])}t.byweekday=Qo(a)?a:null,t.bynweekday=Qo(s)?s:null}else t.bynweekday=null;return Uo(t.byhour)?Ho(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq<As.HOURLY?[t.dtstart.getUTCHours()]:null,Uo(t.byminute)?Ho(t.byminute)&&(t.byminute=[t.byminute]):t.byminute=t.freq<As.MINUTELY?[t.dtstart.getUTCMinutes()]:null,Uo(t.bysecond)?Ho(t.bysecond)&&(t.bysecond=[t.bysecond]):t.bysecond=t.freq<As.SECONDLY?[t.dtstart.getUTCSeconds()]:null,{parsedOptions:t}}function $a(e){var t=e.split("\n").map(qa).filter((function(e){return null!==e}));return Ma(Ma({},t[0]),t[1])}function Ga(e){var t={},n=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(e);if(!n)return t;var r=n[1],i=n[2];return r&&(t.tzid=r),t.dtstart=wa(i),t}function qa(e){if(!(e=e.replace(/^\s+|\s+$/,"")).length)return null;var t=/^([A-Z]+?)[:;]/.exec(e.toUpperCase());if(!t)return Za(e);var n=t[1];switch(n.toUpperCase()){case"RRULE":case"EXRULE":return Za(e);case"DTSTART":return Ga(e);default:throw new Error("Unsupported RFC prop ".concat(n," in ").concat(e))}}function Za(e){var t=Ga(e.replace(/^RRULE:/i,""));return e.replace(/^(?:RRULE|EXRULE):/i,"").split(";").forEach((function(n){var r=n.split("="),i=r[0],o=r[1];switch(i.toUpperCase()){case"FREQ":t.freq=Ca[o.toUpperCase()];break;case"WKST":t.wkst=Ms[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var a=function(e){if(-1!==e.indexOf(",")){return e.split(",").map(Xa)}return Xa(e)}(o),s=i.toLowerCase();t[s]=a;break;case"BYWEEKDAY":case"BYDAY":t.byweekday=function(e){var t=e.split(",");return t.map((function(e){if(2===e.length)return Ms[e];var t=e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!t||t.length<3)throw new SyntaxError("Invalid weekday string: ".concat(e));var n=Number(t[1]),r=t[2],i=Ms[r].weekday;return new Vo(i,n)}))}(o);break;case"DTSTART":case"TZID":var l=Ga(e);t.tzid=l.tzid,t.dtstart=l.dtstart;break;case"UNTIL":t.until=wa(o);break;case"BYEASTER":t.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+i+"'")}})),t}function Xa(e){return/^[+-]?\d+$/.test(e)?Number(e):e}var Ya=function(){function e(e,t){if(isNaN(e.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=e,this.tzid=t}return Object.defineProperty(e.prototype,"isUTC",{get:function(){return!this.tzid||"UTC"===this.tzid.toUpperCase()},enumerable:!1,configurable:!0}),e.prototype.toString=function(){var e=xa(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(e):";TZID=".concat(this.tzid,":").concat(e)},e.prototype.getTime=function(){return this.date.getTime()},e.prototype.rezonedDate=function(){return this.isUTC?this.date:function(e,t){var n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=new Date(ba(e,n)),i=new Date(ba(e,null!=t?t:"UTC")).getTime()-r.getTime();return new Date(e.getTime()-i)}(this.date,this.tzid)},e}();function Ka(e){for(var t,n=[],r="",i=Object.keys(e),o=Object.keys(Ss),a=0;a<i.length;a++)if("tzid"!==i[a]&&ea(o,i[a])){var s=i[a].toUpperCase(),l=e[i[a]],c="";if(Uo(l)&&(!$o(l)||l.length)){switch(s){case"FREQ":c=As.FREQUENCIES[e.freq];break;case"WKST":c=Ho(l)?new Vo(l).toString():l.toString();break;case"BYWEEKDAY":s="BYDAY",c=(t=l,$o(t)?t:[t]).map((function(e){return e instanceof Vo?e:$o(e)?new Vo(e[0],e[1]):new Vo(e)})).toString();break;case"DTSTART":r=Ja(l,e.tzid);break;case"UNTIL":c=xa(l,!e.tzid);break;default:if($o(l)){for(var u=[],h=0;h<l.length;h++)u[h]=String(l[h]);c=u.toString()}else c=String(l)}c&&n.push([s,c])}}var d=n.map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n.toString())})).join(";"),f="";return""!==d&&(f="RRULE:".concat(d)),[r,f].filter((function(e){return!!e})).join("\n")}function Ja(e,t){return e?"DTSTART"+new Ya(new Date(e),t).toString():""}function Qa(e,t){return Array.isArray(e)?!!Array.isArray(t)&&(e.length===t.length&&e.every((function(e,n){return e.getTime()===t[n].getTime()}))):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():e===t}var es=function(){function e(){this.all=!1,this.before=[],this.after=[],this.between=[]}return e.prototype._cacheAdd=function(e,t,n){t&&(t=t instanceof Date?va(t):ya(t)),"all"===e?this.all=t:(n._value=t,this[e].push(n))},e.prototype._cacheGet=function(e,t){var n=!1,r=t?Object.keys(t):[],i=function(e){for(var n=0;n<r.length;n++){var i=r[n];if(!Qa(t[i],e[i]))return!0}return!1},o=this[e];if("all"===e)n=this.all;else if($o(o))for(var a=0;a<o.length;a++){var s=o[a];if(!r.length||!i(s)){n=s._value;break}}if(!n&&this.all){var l=new Ea(e,t);for(a=0;a<this.all.length&&l.accept(this.all[a]);a++);n=l.getValue(),this._cacheAdd(e,n,t)}return $o(n)?ya(n):n instanceof Date?va(n):n},e}(),ts=Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa([],qo(1,31),!0),qo(2,28),!0),qo(3,31),!0),qo(4,30),!0),qo(5,31),!0),qo(6,30),!0),qo(7,31),!0),qo(8,31),!0),qo(9,30),!0),qo(10,31),!0),qo(11,30),!0),qo(12,31),!0),qo(1,7),!0),ns=Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa([],qo(1,31),!0),qo(2,29),!0),qo(3,31),!0),qo(4,30),!0),qo(5,31),!0),qo(6,30),!0),qo(7,31),!0),qo(8,31),!0),qo(9,30),!0),qo(10,31),!0),qo(11,30),!0),qo(12,31),!0),qo(1,7),!0),rs=Go(1,29),is=Go(1,30),os=Go(1,31),as=Go(1,32),ss=Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa([],as,!0),is,!0),as,!0),os,!0),as,!0),os,!0),as,!0),as,!0),os,!0),as,!0),os,!0),as,!0),as.slice(0,7),!0),ls=Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa([],as,!0),rs,!0),as,!0),os,!0),as,!0),os,!0),as,!0),as,!0),os,!0),as,!0),os,!0),as,!0),as.slice(0,7),!0),cs=Go(-28,0),us=Go(-29,0),hs=Go(-30,0),ds=Go(-31,0),fs=Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa([],ds,!0),us,!0),ds,!0),hs,!0),ds,!0),hs,!0),ds,!0),ds,!0),hs,!0),ds,!0),hs,!0),ds,!0),ds.slice(0,7),!0),ps=Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa(Sa([],ds,!0),cs,!0),ds,!0),hs,!0),ds,!0),hs,!0),ds,!0),ds,!0),hs,!0),ds,!0),hs,!0),ds,!0),ds.slice(0,7),!0),ms=[0,31,60,91,121,152,182,213,244,274,305,335,366],gs=[0,31,59,90,120,151,181,212,243,273,304,334,365],vs=function(){for(var e=[],t=0;t<55;t++)e=e.concat(Go(7));return e}();function ys(e,t){var n,r,i=ta(e,1,1),o=sa(e)?366:365,a=sa(e+1)?366:365,s=ha(i),l=pa(i),c=Ma(Ma({yearlen:o,nextyearlen:a,yearordinal:s,yearweekday:l},function(e){var t=sa(e)?366:365,n=ta(e,1,1),r=pa(n);if(365===t)return{mmask:ts,mdaymask:ls,nmdaymask:ps,wdaymask:vs.slice(r),mrange:gs};return{mmask:ns,mdaymask:ss,nmdaymask:fs,wdaymask:vs.slice(r),mrange:ms}}(e)),{wnomask:null});if(Jo(t.byweekno))return c;c.wnomask=qo(0,o+7);var u=n=Yo(7-l+t.wkst,7);u>=4?(u=0,r=c.yearlen+Yo(l-t.wkst,7)):r=o-u;for(var h=Math.floor(r/7),d=Yo(r,7),f=Math.floor(h+d/4),p=0;p<t.byweekno.length;p++){var m=t.byweekno[p];if(m<0&&(m+=f+1),m>0&&m<=f){var g=void 0;m>1?(g=u+7*(m-1),u!==n&&(g-=7-n)):g=u;for(var v=0;v<7&&(c.wnomask[g]=1,g++,c.wdaymask[g]!==t.wkst);v++);}}if(ea(t.byweekno,1)){g=u+7*f;if(u!==n&&(g-=7-n),g<o)for(p=0;p<7&&(c.wnomask[g]=1,g+=1,c.wdaymask[g]!==t.wkst);p++);}if(u){var y=void 0;if(ea(t.byweekno,-1))y=-1;else{var _=pa(ta(e-1,1,1)),x=Yo(7-_.valueOf()+t.wkst,7),w=sa(e-1)?366:365,b=void 0;x>=4?(x=0,b=w+Yo(_-t.wkst,7)):b=o-u,y=Math.floor(52+Yo(b,7)/4)}if(ea(t.byweekno,y))for(g=0;g<u;g++)c.wnomask[g]=1}return c}var _s=function(){function e(e){this.options=e}return e.prototype.rebuild=function(e,t){var n=this.options;if(e!==this.lastyear&&(this.yearinfo=ys(e,n)),Qo(n.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var r=this.yearinfo,i=r.yearlen,o=r.mrange,a=r.wdaymask;this.monthinfo=function(e,t,n,r,i,o){var a={lastyear:e,lastmonth:t,nwdaymask:[]},s=[];if(o.freq===As.YEARLY)if(Jo(o.bymonth))s=[[0,n]];else for(var l=0;l<o.bymonth.length;l++)t=o.bymonth[l],s.push(r.slice(t-1,t+1));else o.freq===As.MONTHLY&&(s=[r.slice(t-1,t+1)]);if(Jo(s))return a;for(a.nwdaymask=qo(0,n),l=0;l<s.length;l++)for(var c=s[l],u=c[0],h=c[1]-1,d=0;d<o.bynweekday.length;d++){var f=void 0,p=o.bynweekday[d],m=p[0],g=p[1];g<0?(f=h+7*(g+1),f-=Yo(i[f]-m,7)):(f=u+7*(g-1),f+=Yo(7-i[f]+m,7)),u<=f&&f<=h&&(a.nwdaymask[f]=1)}return a}(e,t,i,o,a,n)}Uo(n.byeaster)&&(this.eastermask=function(e,t){void 0===t&&(t=0);var n=e%19,r=Math.floor(e/100),i=e%100,o=Math.floor(r/4),a=r%4,s=Math.floor((r+8)/25),l=Math.floor((r-s+1)/3),c=Math.floor(19*n+r-o-l+15)%30,u=Math.floor(i/4),h=i%4,d=Math.floor(32+2*a+2*u-c-h)%7,f=Math.floor((n+11*c+22*d)/451),p=Math.floor((c+d-7*f+114)/31),m=(c+d-7*f+114)%31+1,g=Date.UTC(e,p-1,m+t),v=Date.UTC(e,0,1);return[Math.ceil((g-v)/864e5)]}(e,n.byeaster))},Object.defineProperty(e.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastmonth",{get:function(){return this.monthinfo?this.monthinfo.lastmonth:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearlen",{get:function(){return this.yearinfo.yearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yearordinal",{get:function(){return this.yearinfo.yearordinal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mrange",{get:function(){return this.yearinfo.mrange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wdaymask",{get:function(){return this.yearinfo.wdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mmask",{get:function(){return this.yearinfo.mmask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wnomask",{get:function(){return this.yearinfo.wnomask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nwdaymask",{get:function(){return this.monthinfo?this.monthinfo.nwdaymask:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextyearlen",{get:function(){return this.yearinfo.nextyearlen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mdaymask",{get:function(){return this.yearinfo.mdaymask},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nmdaymask",{get:function(){return this.yearinfo.nmdaymask},enumerable:!1,configurable:!0}),e.prototype.ydayset=function(){return[Go(this.yearlen),0,this.yearlen]},e.prototype.mdayset=function(e,t){for(var n=this.mrange[t-1],r=this.mrange[t],i=qo(null,this.yearlen),o=n;o<r;o++)i[o]=o;return[i,n,r]},e.prototype.wdayset=function(e,t,n){for(var r=qo(null,this.yearlen+7),i=ha(ta(e,t,n))-this.yearordinal,o=i,a=0;a<7&&(r[i]=i,++i,this.wdaymask[i]!==this.options.wkst);a++);return[r,o,i]},e.prototype.ddayset=function(e,t,n){var r=qo(null,this.yearlen),i=ha(ta(e,t,n))-this.yearordinal;return r[i]=i,[r,i,i+1]},e.prototype.htimeset=function(e,t,n,r){var i=this,o=[];return this.options.byminute.forEach((function(t){o=o.concat(i.mtimeset(e,t,n,r))})),_a(o),o},e.prototype.mtimeset=function(e,t,n,r){var i=this.options.bysecond.map((function(n){return new Va(e,t,n,r)}));return _a(i),i},e.prototype.stimeset=function(e,t,n,r){return[new Va(e,t,n,r)]},e.prototype.getdayset=function(e){switch(e){case Ca.YEARLY:return this.ydayset.bind(this);case Ca.MONTHLY:return this.mdayset.bind(this);case Ca.WEEKLY:return this.wdayset.bind(this);case Ca.DAILY:default:return this.ddayset.bind(this)}},e.prototype.gettimeset=function(e){switch(e){case Ca.HOURLY:return this.htimeset.bind(this);case Ca.MINUTELY:return this.mtimeset.bind(this);case Ca.SECONDLY:return this.stimeset.bind(this)}},e}();function xs(e,t,n,r,i,o){for(var a=[],s=0;s<e.length;s++){var l=void 0,c=void 0,u=e[s];u<0?(l=Math.floor(u/t.length),c=Yo(u,t.length)):(l=Math.floor((u-1)/t.length),c=Yo(u-1,t.length));for(var h=[],d=n;d<r;d++){var f=o[d];Uo(f)&&h.push(f)}var p=void 0;p=l<0?h.slice(l)[0]:h[l];var m=t[c],g=da(i.yearordinal+p),v=ga(g,m);ea(a,v)||a.push(v)}return _a(a),a}function ws(e,t){var n=t.dtstart,r=t.freq,i=t.interval,o=t.until,a=t.bysetpos,s=t.count;if(0===s||0===i)return ks(e);var l=Ua.fromDate(n),c=new _s(t);c.rebuild(l.year,l.month);for(var u=function(e,t,n){var r=n.freq,i=n.byhour,o=n.byminute,a=n.bysecond;if(Ba(r))return function(e){var t=e.dtstart.getTime()%1e3;if(!Ba(e.freq))return[];var n=[];return e.byhour.forEach((function(r){e.byminute.forEach((function(i){e.bysecond.forEach((function(e){n.push(new Va(r,i,e,t))}))}))})),n}(n);if(r>=As.HOURLY&&Qo(i)&&!ea(i,t.hour)||r>=As.MINUTELY&&Qo(o)&&!ea(o,t.minute)||r>=As.SECONDLY&&Qo(a)&&!ea(a,t.second))return[];return e.gettimeset(r)(t.hour,t.minute,t.second,t.millisecond)}(c,l,t);;){var h=c.getdayset(r)(l.year,l.month,l.day),d=h[0],f=h[1],p=h[2],m=Ts(d,f,p,c,t);if(Qo(a))for(var g=xs(a,u,f,p,c,d),v=0;v<g.length;v++){var y=g[v];if(o&&y>o)return ks(e);if(y>=n){var _=Es(y,t);if(!e.accept(_))return ks(e);if(s&&!--s)return ks(e)}}else for(v=f;v<p;v++){var x=d[v];if(Uo(x))for(var w=da(c.yearordinal+x),b=0;b<u.length;b++){var E=u[b];y=ga(w,E);if(o&&y>o)return ks(e);if(y>=n){_=Es(y,t);if(!e.accept(_))return ks(e);if(s&&!--s)return ks(e)}}}if(0===t.interval)return ks(e);if(l.add(t,m),l.year>ia)return ks(e);Ba(r)||(u=c.gettimeset(r)(l.hour,l.minute,l.second,0)),c.rebuild(l.year,l.month)}}function bs(e,t,n){var r=n.bymonth,i=n.byweekno,o=n.byweekday,a=n.byeaster,s=n.bymonthday,l=n.bynmonthday,c=n.byyearday;return Qo(r)&&!ea(r,e.mmask[t])||Qo(i)&&!e.wnomask[t]||Qo(o)&&!ea(o,e.wdaymask[t])||Qo(e.nwdaymask)&&!e.nwdaymask[t]||null!==a&&!ea(e.eastermask,t)||(Qo(s)||Qo(l))&&!ea(s,e.mdaymask[t])&&!ea(l,e.nmdaymask[t])||Qo(c)&&(t<e.yearlen&&!ea(c,t+1)&&!ea(c,-e.yearlen+t)||t>=e.yearlen&&!ea(c,t+1-e.yearlen)&&!ea(c,-e.nextyearlen+t-e.yearlen))}function Es(e,t){return new Ya(e,t.tzid).rezonedDate()}function ks(e){return e.getValue()}function Ts(e,t,n,r,i){for(var o=!1,a=t;a<n;a++){var s=e[a];(o=bs(r,s,i))&&(e[s]=null)}return o}var Ms={MO:new Vo(0),TU:new Vo(1),WE:new Vo(2),TH:new Vo(3),FR:new Vo(4),SA:new Vo(5),SU:new Vo(6)},Ss={freq:Ca.YEARLY,dtstart:null,interval:1,wkst:Ms.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Cs=Object.keys(Ss),As=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this._cache=t?null:new es,this.origOptions=Ha(e);var n=Wa(e).parsedOptions;this.options=n}return e.parseText=function(e,t){return Da(e,t)},e.fromText=function(e,t){return Fa(e,t)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(e){return ws(e,this.options)},e.prototype._cacheGet=function(e,t){return!!this._cache&&this._cache._cacheGet(e,t)},e.prototype._cacheAdd=function(e,t,n){if(this._cache)return this._cache._cacheAdd(e,t,n)},e.prototype.all=function(e){if(e)return this._iter(new Aa("all",{},e));var t=this._cacheGet("all");return!1===t&&(t=this._iter(new Ea("all",{})),this._cacheAdd("all",t)),t},e.prototype.between=function(e,t,n,r){if(void 0===n&&(n=!1),!ca(e)||!ca(t))throw new Error("Invalid date passed in to RRule.between");var i={before:t,after:e,inc:n};if(r)return this._iter(new Aa("between",i,r));var o=this._cacheGet("between",i);return!1===o&&(o=this._iter(new Ea("between",i)),this._cacheAdd("between",o,i)),o},e.prototype.before=function(e,t){if(void 0===t&&(t=!1),!ca(e))throw new Error("Invalid date passed in to RRule.before");var n={dt:e,inc:t},r=this._cacheGet("before",n);return!1===r&&(r=this._iter(new Ea("before",n)),this._cacheAdd("before",r,n)),r},e.prototype.after=function(e,t){if(void 0===t&&(t=!1),!ca(e))throw new Error("Invalid date passed in to RRule.after");var n={dt:e,inc:t},r=this._cacheGet("after",n);return!1===r&&(r=this._iter(new Ea("after",n)),this._cacheAdd("after",r,n)),r},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return Ka(this.origOptions)},e.prototype.toText=function(e,t,n){return function(e,t,n,r){return new Pa(e,t,n,r).toString()}(this,e,t,n)},e.prototype.isFullyConvertibleToText=function(){return Na(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=Ca.YEARLY,e.MONTHLY=Ca.MONTHLY,e.WEEKLY=Ca.WEEKLY,e.DAILY=Ca.DAILY,e.HOURLY=Ca.HOURLY,e.MINUTELY=Ca.MINUTELY,e.SECONDLY=Ca.SECONDLY,e.MO=Ms.MO,e.TU=Ms.TU,e.WE=Ms.WE,e.TH=Ms.TH,e.FR=Ms.FR,e.SA=Ms.SA,e.SU=Ms.SU,e.parseString=$a,e.optionsToString=Ka,e}();var Is={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null};function Rs(e,t){var n=[],r=[],i=[],o=[],a=Ga(e),s=a.dtstart,l=a.tzid,c=function(e,t){void 0===t&&(t=!1);if(e=e&&e.trim(),!e)throw new Error("Invalid empty string");if(!t)return e.split(/\s/);var n=e.split("\n"),r=0;for(;r<n.length;){var i=n[r]=n[r].replace(/\s+$/g,"");i?r>0&&" "===i[0]?(n[r-1]+=i.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}(e,t.unfold);return c.forEach((function(e){var t;if(e){var a=function(e){var t=function(e){if(-1===e.indexOf(":"))return{name:"RRULE",value:e};var t=Xo(e,":",1),n=t[0],r=t[1];return{name:n,value:r}}(e),n=t.name,r=t.value,i=n.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:r}}(e),s=a.name,c=a.parms,u=a.value;switch(s.toUpperCase()){case"RRULE":if(c.length)throw new Error("unsupported RRULE parm: ".concat(c.join(",")));n.push($a(e));break;case"RDATE":var h=(null!==(t=/RDATE(?:;TZID=([^:=]+))?/i.exec(e))&&void 0!==t?t:[])[1];h&&!l&&(l=h),r=r.concat(Ps(u,c));break;case"EXRULE":if(c.length)throw new Error("unsupported EXRULE parm: ".concat(c.join(",")));i.push($a(u));break;case"EXDATE":o=o.concat(Ps(u,c));break;case"DTSTART":break;default:throw new Error("unsupported property: "+s)}}})),{dtstart:s,tzid:l,rrulevals:n,rdatevals:r,exrulevals:i,exdatevals:o}}function Ls(e,t){return void 0===t&&(t={}),function(e,t){var n=Rs(e,t),r=n.rrulevals,i=n.rdatevals,o=n.exrulevals,a=n.exdatevals,s=n.dtstart,l=n.tzid,c=!1===t.cache;if(t.compatible&&(t.forceset=!0,t.unfold=!0),t.forceset||r.length>1||i.length||o.length||a.length){var u=new Ds(c);return u.dtstart(s),u.tzid(l||void 0),r.forEach((function(e){u.rrule(new As(zs(e,s,l),c))})),i.forEach((function(e){u.rdate(e)})),o.forEach((function(e){u.exrule(new As(zs(e,s,l),c))})),a.forEach((function(e){u.exdate(e)})),t.compatible&&t.dtstart&&u.rdate(s),u}var h=r[0]||{};return new As(zs(h,h.dtstart||t.dtstart||s,h.tzid||t.tzid||l),c)}(e,function(e){var t=[],n=Object.keys(e),r=Object.keys(Is);if(n.forEach((function(e){ea(r,e)||t.push(e)})),t.length)throw new Error("Invalid options: "+t.join(", "));return Ma(Ma({},Is),e)}(t))}function zs(e,t,n){return Ma(Ma({},e),{dtstart:t,tzid:n})}function Ps(e,t){return function(e){e.forEach((function(e){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(e))throw new Error("unsupported RDATE/EXDATE parm: "+e)}))}(t),e.split(",").map((function(e){return wa(e)}))}function Os(e){var t=this;return function(n){if(void 0!==n&&(t["_".concat(e)]=n),void 0!==t["_".concat(e)])return t["_".concat(e)];for(var r=0;r<t._rrule.length;r++){var i=t._rrule[r].origOptions[e];if(i)return i}}}var Ds=function(e){function t(t){void 0===t&&(t=!1);var n=e.call(this,{},t)||this;return n.dtstart=Os.apply(n,["dtstart"]),n.tzid=Os.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return Ta(t,e),t.prototype._iter=function(e){return function(e,t,n,r,i,o){var a={},s=e.accept;function l(e,t){n.forEach((function(n){n.between(e,t,!0).forEach((function(e){a[Number(e)]=!0}))}))}i.forEach((function(e){var t=new Ya(e,o).rezonedDate();a[Number(t)]=!0})),e.accept=function(e){var t=Number(e);return isNaN(t)?s.call(this,e):!(!a[t]&&(l(new Date(t-1),new Date(t+1)),!a[t]))||(a[t]=!0,s.call(this,e))},"between"===e.method&&(l(e.args.after,e.args.before),e.accept=function(e){var t=Number(e);return!!a[t]||(a[t]=!0,s.call(this,e))});for(var c=0;c<r.length;c++){var u=new Ya(r[c],o).rezonedDate();if(!e.accept(new Date(u.getTime())))break}t.forEach((function(t){ws(e,t.options)}));var h=e._result;switch(_a(h),e.method){case"all":case"between":return h;case"before":return h.length&&h[h.length-1]||null;default:return h.length&&h[0]||null}}(e,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(e){Bs(e,this._rrule)},t.prototype.exrule=function(e){Bs(e,this._exrule)},t.prototype.rdate=function(e){Fs(e,this._rdate)},t.prototype.exdate=function(e){Fs(e,this._exdate)},t.prototype.rrules=function(){return this._rrule.map((function(e){return Ls(e.toString())}))},t.prototype.exrules=function(){return this._exrule.map((function(e){return Ls(e.toString())}))},t.prototype.rdates=function(){return this._rdate.map((function(e){return new Date(e.getTime())}))},t.prototype.exdates=function(){return this._exdate.map((function(e){return new Date(e.getTime())}))},t.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(Ka({dtstart:this._dtstart}))),this._rrule.forEach((function(t){e=e.concat(t.toString().split("\n"))})),this._exrule.forEach((function(t){e=e.concat(t.toString().split("\n").map((function(e){return e.replace(/^RRULE:/,"EXRULE:")})).filter((function(e){return!/^DTSTART/.test(e)})))})),this._rdate.length&&e.push(js("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(js("EXDATE",this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join("\n")},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach((function(t){return e.rrule(t.clone())})),this._exrule.forEach((function(t){return e.exrule(t.clone())})),this._rdate.forEach((function(t){return e.rdate(new Date(t.getTime()))})),this._exdate.forEach((function(t){return e.exdate(new Date(t.getTime()))})),e},t}(As);function Bs(e,t){if(!(e instanceof As))throw new TypeError(String(e)+" is not RRule instance");ea(t.map(String),String(e))||t.push(e)}function Fs(e,t){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");ea(t.map(Number),Number(e))||(t.push(e),_a(t))}function js(e,t,n){var r=!n||"UTC"===n.toUpperCase(),i=r?"".concat(e,":"):"".concat(e,";TZID=").concat(n,":"),o=t.map((function(e){return xa(e.valueOf(),r)})).join(",");return"".concat(i).concat(o)}const Ns={MO:"Mon",TU:"Tue",WE:"Wed",TH:"Thu",FR:"Fri",SA:"Sat",SU:"Sun"},Vs=e=>{var t,n,r;if((null==e?void 0:e.recurrence)&&(null===(t=null==e?void 0:e.recurrence)||void 0===t?void 0:t.RRULE))try{const t=Ls(e.recurrence.RRULE,{forceset:!0});if(t){const e=t.valueOf()[1];let r="";if(e.includes("WEEKLY")){const n=t.dtstart();r=e.includes("INTERVAL=2")?`Alternate ${n.toLocaleString("en-GB",{weekday:"long"})}s`:`Every ${n.toLocaleString("en-GB",{weekday:"long"})}`}else{if(e.includes("MONTHLY"))return"Every Month";if(e.includes("BYDAY")){const t=null===(n=e.substring(e.search("BYDAY")+6))||void 0===n?void 0:n.split(",");r=5===t.length&&t.every((e=>{var t;return null===(t=["MO","TU","WE","TH","FR"])||void 0===t?void 0:t.includes(e)}))?"Every Weekday":2===t.length&&t.every((e=>{var t;return null===(t=["SA","SU"])||void 0===t?void 0:t.includes(e)}))?"Every Weekend":`${t.map((e=>Ns[e])).join(", ")}`}else e.includes("DAILY")&&(r="Every Day")}return r}return}catch(t){return e.recurrence.type}else{if(null===(r=null==e?void 0:e.recurrence)||void 0===r?void 0:r.dates){const t=e.recurrence.dates.map((e=>Ce(e,"YYYY-MM-DD").toDate()));return t.length>2?`${t.slice(0,2).map((e=>e.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"}))).join(", ")} and ${t.length-2} more`:t.map((e=>e.toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"}))).join(" & ")}if(e.start){const t=new Date(e.start);return`${null==t?void 0:t.toLocaleString("en-GB",{weekday:"short",day:"numeric",month:"short"})}`}}},Us=e=>{var t;return(null===(t=null==e?void 0:e.bookingDetails)||void 0===t?void 0:t.timeSlots)?"multiple time slots":`${Ce(null==e?void 0:e.start).format("H:mm")}-${Ce(null==e?void 0:e.end).format("H:mm")}`},Hs=e=>e?`£${String(e).slice(0,String(e).length-2)}.${String(e).slice(String(e).length-2)}`:"";function Ws({eventData:e,flatBottom:t,hoverClass:n,size:r,textClassName:i,orgData:o,showOrgChip:a,customLink:l,customCTA:c,className:u}){var h,d,f,p,m,g,v,y,_,x;const w=(null===(h=null==o?void 0:o.publicDetails)||void 0===h?void 0:h.logo)?{src:Bo(o.publicDetails.logo),alt:o.Name}:void 0;let b="height-regular";return"small"===r?b="height-small":"xs"===r&&(b="height-xs"),s.default.createElement("a",{href:l||`https://book.plinth.org.uk/e/${e._id}`,className:`event-card ${u||""} ${n||""} ${i||""}`,target:"_blank",rel:"noopener noreferrer"},s.default.createElement("div",{className:"event-card-image-container"},s.default.createElement(jo,{img:(null===(f=null===(d=e.bookingDetails)||void 0===d?void 0:d.images)||void 0===f?void 0:f[0])||w,className:`event-card-image ${b} ${t?"rounded-top":"rounded"}`}),c&&s.default.createElement("div",{className:"custom-cta-container"},c),a&&s.default.createElement("div",{className:"org-chip"},s.default.createElement("div",{className:"org-chip-name-container"},s.default.createElement(Ao,{className:"library-icon"}),s.default.createElement("div",{className:"org-chip-name"},null===(p=null==e?void 0:e.bookingDetails)||void 0===p?void 0:p.orgName)))),s.default.createElement("div",{className:`event-details ${i||""}`},s.default.createElement("div",{className:"event-details-header"},s.default.createElement("h5",{className:"event-name "+("small"===r||"xs"===r?"text-small":"text-regular")},`${null===(m=null==e?void 0:e.name)||void 0===m?void 0:m.text}`),s.default.createElement("p",{className:"event-recurrence "+("small"===r||"xs"===r?"text-small":"text-regular")},`${Vs(e)||""}, ${Us(e)}`)),(null==e?void 0:e.bookingDetails)&&((null==e?void 0:e.bookingDetails.free)||(null==e?void 0:e.bookingDetails.price))&&s.default.createElement("p",{className:"event-price "+("small"===r||"xs"===r?"text-small":"text-regular")},(null===(g=null==e?void 0:e.bookingDetails)||void 0===g?void 0:g.free)?"Free":`${(null===(v=null==e?void 0:e.bookingDetails)||void 0===v?void 0:v.complicated)?"Up to ":""}${Hs(null===(y=null==e?void 0:e.bookingDetails)||void 0===y?void 0:y.price)}`,s.default.createElement("span",{className:"font-light"},!(null===(_=null==e?void 0:e.bookingDetails)||void 0===_?void 0:_.free)&&("group"===(null===(x=null==e?void 0:e.bookingDetails)||void 0===x?void 0:x.unit)?" /group":" /person")))))}function $s({events:e,eventsLoading:t,onRemoveFilters:n,className:r}){return s.default.createElement("div",{className:r},s.default.createElement("div",{className:"list-view"},e.map((e=>s.default.createElement(Ws,{key:e._id,flatBottom:!0,hoverClass:"hover:shadow-lg border border-gray-200 bg-white overflow-hidden",textClassName:"px-2 pb-4",size:"small",eventData:e})))),!t&&0===e.length&&s.default.createElement("div",{className:"no-results"},s.default.createElement("h2",{className:"no-results-title"},"No results"),s.default.createElement("p",{className:"no-results-message"},"Try removing some of the filters"),s.default.createElement("button",{type:"button",onClick:n,className:"tts-button"},"Remove all filters")))}Ws.defaultProps={flatBottom:!1,small:!1,className:void 0,hoverClass:void 0,textClassName:void 0,showOrgChip:!1},$s.defaultProps={className:void 0};const Gs=a.createContext(null);function qs(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function Zs(e,t){const n=t.viewState||t;let r=!1;if("longitude"in n&&"latitude"in n){const t=e.center;e.center=new t.constructor(n.longitude,n.latitude),r=r||t!==e.center}if("zoom"in n){const t=e.zoom;e.zoom=n.zoom,r=r||t!==e.zoom}if("bearing"in n){const t=e.bearing;e.bearing=n.bearing,r=r||t!==e.bearing}if("pitch"in n){const t=e.pitch;e.pitch=n.pitch,r=r||t!==e.pitch}return n.padding&&!e.isPaddingEqual(n.padding)&&(r=!0,e.padding=n.padding),r}const Xs=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ys(e){if(!e)return null;if("string"==typeof e)return e;if("toJS"in e&&(e=e.toJS()),!e.layers)return e;const t={};for(const n of e.layers)t[n.id]=n;const n=e.layers.map((e=>{const n=t[e.ref];let r=null;if("interactive"in e&&(r={...e},delete r.interactive),n){r=r||{...e},delete r.ref;for(const e of Xs)e in n&&(r[e]=n[e])}return r||e}));return{...e,layers:n}}function Ks(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ks(e[n],t[n]))return!1;return!0}if(Array.isArray(t))return!1;if("object"==typeof e&&"object"==typeof t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!t.hasOwnProperty(r))return!1;if(!Ks(e[r],t[r]))return!1}return!0}return!1}const Js={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Qs={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},el={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},tl=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],nl=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class rl{constructor(e,t,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=e=>{const t=this.props[el[e.type]];t&&t(e)},this._onPointerEvent=e=>{"mousemove"!==e.type&&"mouseout"!==e.type||this._updateHover(e);const t=this.props[Js[e.type]];t&&(this.props.interactiveLayerIds&&"mouseover"!==e.type&&"mouseout"!==e.type&&(e.features=this._hoveredFeatures||this._queryRenderedFeatures(e.point)),t(e),delete e.features)},this._onCameraEvent=e=>{if(!this._internalUpdate){const t=this.props[Qs[e.type]];t&&t(e)}e.type in this._deferredEvents&&(this._deferredEvents[e.type]=!1)},this._MapClass=e,this.props=t,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(e){const t=this.props;this.props=e;const n=this._updateSettings(e,t);n&&this._createShadowTransform(this._map);const r=this._updateSize(e),i=this._updateViewState(e,!0);this._updateStyle(e,t),this._updateStyleComponents(e,t),this._updateHandlers(e,t),(n||r||i&&!this._map.isMoving())&&this.redraw()}static reuse(e,t){const n=rl.savedMaps.pop();if(!n)return null;const r=n.map,i=r.getContainer();for(t.className=i.className;i.childNodes.length>0;)t.appendChild(i.childNodes[0]);r._container=t;const o=r._resizeObserver;o&&(o.disconnect(),o.observe(t)),n.setProps({...e,styleDiffing:!1}),r.resize();const{initialViewState:a}=e;return a&&(a.bounds?r.fitBounds(a.bounds,{...a.fitBoundsOptions,duration:0}):n._updateViewState(a,!1)),r.isStyleLoaded()?r.fire("load"):r.once("styledata",(()=>r.fire("load"))),r._update(),n}_initialize(e){const{props:t}=this,n={...t,...t.initialViewState,accessToken:t.mapboxAccessToken||il()||null,container:e,style:Ys(t.mapStyle)},r=n.initialViewState||n.viewState||n;if(Object.assign(n,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),t.gl){const e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=e,t.gl)}const i=new this._MapClass(n);r.padding&&i.setPadding(r.padding),t.cursor&&(i.getCanvas().style.cursor=t.cursor),this._createShadowTransform(i);const o=i._render;i._render=e=>{this._inRender=!0,o.call(i,e),this._inRender=!1};const a=i._renderTaskQueue.run;i._renderTaskQueue.run=e=>{a.call(i._renderTaskQueue,e),this._onBeforeRepaint()},i.on("render",(()=>this._onAfterRepaint()));const s=i.fire;i.fire=this._fireEvent.bind(this,s),i.on("resize",(()=>{this._renderTransform.resize(i.transform.width,i.transform.height)})),i.on("styledata",(()=>this._updateStyleComponents(this.props,{}))),i.on("sourcedata",(()=>this._updateStyleComponents(this.props,{})));for(const e in Js)i.on(e,this._onPointerEvent);for(const e in Qs)i.on(e,this._onCameraEvent);for(const e in el)i.on(e,this._onEvent);this._map=i}recycle(){const e=this.map.getContainer().querySelector("[mapboxgl-children]");null==e||e.remove(),rl.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const e=this._map;!this._inRender&&e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}_createShadowTransform(e){const t=function(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}(e.transform);e.painter.transform=t,this._renderTransform=t}_updateSize(e){const{viewState:t}=e;if(t){const e=this._map;if(t.width!==e.transform.width||t.height!==e.transform.height)return e.resize(),!0}return!1}_updateViewState(e,t){if(this._internalUpdate)return!1;const n=this._map,r=this._renderTransform,{zoom:i,pitch:o,bearing:a}=r,s=n.isMoving();s&&(r.cameraElevationReference="sea");const l=Zs(r,{...qs(n.transform),...e});if(s&&(r.cameraElevationReference="ground"),l&&t){const e=this._deferredEvents;e.move=!0,e.zoom||(e.zoom=i!==r.zoom),e.rotate||(e.rotate=a!==r.bearing),e.pitch||(e.pitch=o!==r.pitch)}return s||Zs(n.transform,e),l}_updateSettings(e,t){const n=this._map;let r=!1;for(const i of tl)i in e&&!Ks(e[i],t[i])&&(r=!0,n[`set${i[0].toUpperCase()}${i.slice(1)}`](e[i]));return r}_updateStyle(e,t){if(e.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=e.cursor),e.mapStyle!==t.mapStyle){const t={diff:e.styleDiffing};return"localIdeographFontFamily"in e&&(t.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(Ys(e.mapStyle),t),!0}return!1}_updateStyleComponents(e,t){const n=this._map;let r=!1;return n.style.loaded()&&("light"in e&&!Ks(e.light,t.light)&&(r=!0,n.setLight(e.light)),"fog"in e&&!Ks(e.fog,t.fog)&&(r=!0,n.setFog(e.fog)),"terrain"in e&&!Ks(e.terrain,t.terrain)&&(e.terrain&&!n.getSource(e.terrain.source)||(r=!0,n.setTerrain(e.terrain)))),r}_updateHandlers(e,t){const n=this._map;let r=!1;for(const i of nl){const o=e[i];Ks(o,t[i])||(r=!0,o?n[i].enable(o):n[i].disable())}return r}_queryRenderedFeatures(e){const t=this._map,{interactiveLayerIds:n=[]}=this.props;try{return t.queryRenderedFeatures(e,{layers:n.filter(t.getLayer.bind(t))})}catch(e){return[]}}_updateHover(e){var t;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const n=e.type,r=(null===(t=this._hoveredFeatures)||void 0===t?void 0:t.length)>0,i=this._queryRenderedFeatures(e.point),o=i.length>0;!o&&r&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=i,o&&!r&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=n}else this._hoveredFeatures=null}_fireEvent(e,t,n){const r=this._map,i=r.transform,o="string"==typeof t?t:t.type;return"move"===o&&this._updateViewState(this.props,!1),o in Qs&&("object"==typeof t&&(t.viewState=qs(i)),this._map.isMoving())?(r.transform=this._renderTransform,e.call(r,t,n),r.transform=i,r):(e.call(r,t,n),r)}_onBeforeRepaint(){const e=this._map;this._internalUpdate=!0;for(const t in this._deferredEvents)this._deferredEvents[t]&&e.fire(t);this._internalUpdate=!1;const t=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=t}}}function il(){let e=null;if("undefined"!=typeof location){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||process.env.MapboxAccessToken}catch(e){}try{e=e||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch(e){}return e}rl.savedMaps=[];const ol=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function al(e,t){if(!e)return null;const n=e.map,r={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:n=>e.transform.locationPoint(t.LngLat.convert(n)),unproject:n=>e.transform.pointLocation(t.Point.convert(n)),queryTerrainElevation:(t,r)=>{const i=n.transform;n.transform=e.transform;const o=n.queryTerrainElevation(t,r);return n.transform=i,o}};for(const e of function(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))"_"!==r[0]&&"function"==typeof e[r]&&"fire"!==r&&"setEventedParent"!==r&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}(n))e in r||ol.includes(e)||(r[e]=n[e].bind(n));return r}const sl="undefined"!=typeof document?e.useLayoutEffect:e.useEffect,ll=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];const cl=a.createContext(null),ul={minZoom:0,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,mapStyle:{version:8,sources:{},layers:[]},styleDiffing:!0,projection:"mercator",renderWorldCopies:!0,onError:e=>console.error(e.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},hl=e.forwardRef(((t,n)=>{const r=e.useContext(Gs),[i,o]=e.useState(null),s=e.useRef(),{current:l}=e.useRef({mapLib:null,map:null});e.useEffect((()=>{const e=t.mapLib;let n,i=!0;return Promise.resolve(e||Promise.resolve().then((function(){return _x}))).then((e=>{if(i){if(e.Map||(e=e.default),!e||!e.Map)throw new Error("Invalid mapLib");if(function(e,t){for(const n of ll)n in t&&(e[n]=t[n]);t.RTLTextPlugin&&e.getRTLTextPluginStatus&&"unavailable"===e.getRTLTextPluginStatus()&&e.setRTLTextPlugin(t.RTLTextPlugin,(e=>{e&&console.error(e)}),!1)}(e,t),e.supported&&!e.supported(t))throw new Error("Map is not supported by this browser");t.reuseMaps&&(n=rl.reuse(t,s.current)),n||(n=new rl(e.Map,t,s.current)),l.map=al(n,e),l.mapLib=e,o(n),null==r||r.onMapMount(l.map,t.id)}})).catch((e=>{t.onError({type:"error",target:null,originalEvent:null,error:e})})),()=>{i=!1,n&&(null==r||r.onMapUnmount(t.id),t.reuseMaps?n.recycle():n.destroy())}}),[]),sl((()=>{i&&i.setProps(t)})),e.useImperativeHandle(n,(()=>l.map),[i]);const c=e.useMemo((()=>({position:"relative",width:"100%",height:"100%",...t.style})),[t.style]);return a.createElement("div",{id:t.id,ref:s,style:c},i&&a.createElement(cl.Provider,{value:l},a.createElement("div",{"mapboxgl-children":"",style:{height:"100%"}},t.children)))}));hl.displayName="Map",hl.defaultProps=ul;const dl=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function fl(e,t){if(!e||!t)return;const n=e.style;for(const e in t){const r=t[e];Number.isFinite(r)&&!dl.test(e)?n[e]=`${r}px`:n[e]=r}}function pl(n){const{map:r,mapLib:i}=e.useContext(cl),o=e.useRef({props:n});o.current.props=n;const s=e.useMemo((()=>{let e=!1;a.Children.forEach(n.children,(t=>{t&&(e=!0)}));const t={...n,element:e?document.createElement("div"):null},r=new i.Marker(t).setLngLat([n.longitude,n.latitude]);return r.getElement().addEventListener("click",(e=>{var t,n;null===(n=(t=o.current.props).onClick)||void 0===n||n.call(t,{type:"click",target:r,originalEvent:e})})),r.on("dragstart",(e=>{var t,n;const r=e;r.lngLat=s.getLngLat(),null===(n=(t=o.current.props).onDragStart)||void 0===n||n.call(t,r)})),r.on("drag",(e=>{var t,n;const r=e;r.lngLat=s.getLngLat(),null===(n=(t=o.current.props).onDrag)||void 0===n||n.call(t,r)})),r.on("dragend",(e=>{var t,n;const r=e;r.lngLat=s.getLngLat(),null===(n=(t=o.current.props).onDragEnd)||void 0===n||n.call(t,r)})),r}),[]);return e.useEffect((()=>(s.addTo(r.getMap()),()=>{s.remove()})),[]),e.useEffect((()=>{fl(s.getElement(),n.style)}),[n.style]),s.getLngLat().lng===n.longitude&&s.getLngLat().lat===n.latitude||s.setLngLat([n.longitude,n.latitude]),n.offset&&!function(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===o}(s.getOffset(),n.offset)&&s.setOffset(n.offset),s.isDraggable()!==n.draggable&&s.setDraggable(n.draggable),s.getRotation()!==n.rotation&&s.setRotation(n.rotation),s.getRotationAlignment()!==n.rotationAlignment&&s.setRotationAlignment(n.rotationAlignment),s.getPitchAlignment()!==n.pitchAlignment&&s.setPitchAlignment(n.pitchAlignment),s.getPopup()!==n.popup&&s.setPopup(n.popup),t.createPortal(n.children,s.getElement())}pl.defaultProps={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};var ml=a.memo(pl);function gl(e){return new Set(e?e.trim().split(/\s+/):[])}var vl=a.memo((function(n){const{map:r,mapLib:i}=e.useContext(cl),o=e.useMemo((()=>document.createElement("div")),[]),a=e.useRef({props:n});a.current.props=n;const s=e.useMemo((()=>{const e={...n},t=new i.Popup(e).setLngLat([n.longitude,n.latitude]);return t.once("open",(e=>{var t,n;null===(n=(t=a.current.props).onOpen)||void 0===n||n.call(t,e)})),t}),[]);if(e.useEffect((()=>{const e=e=>{var t,n;null===(n=(t=a.current.props).onClose)||void 0===n||n.call(t,e)};return s.on("close",e),s.setDOMContent(o).addTo(r.getMap()),()=>{s.off("close",e),s.isOpen()&&s.remove()}}),[]),e.useEffect((()=>{fl(s.getElement(),n.style)}),[n.style]),s.isOpen()&&(s.getLngLat().lng===n.longitude&&s.getLngLat().lat===n.latitude||s.setLngLat([n.longitude,n.latitude]),n.offset&&!Ks(s.options.offset,n.offset)&&s.setOffset(n.offset),s.options.anchor===n.anchor&&s.options.maxWidth===n.maxWidth||(s.options.anchor=n.anchor,s.setMaxWidth(n.maxWidth)),s.options.className!==n.className)){const e=gl(s.options.className),t=gl(n.className);for(const n of e)t.has(n)||s.removeClassName(n);for(const n of t)e.has(n)||s.addClassName(n);s.options.className=n.className}return t.createPortal(n.children,o)}));function yl(t,n,r,i){const o=e.useContext(cl),a=e.useMemo((()=>t(o)),[]);return e.useEffect((()=>{const e=i||r||n,t="function"==typeof n&&"function"==typeof r?n:null,s="function"==typeof r?r:"function"==typeof n?n:null,{map:l}=o;return l.hasControl(a)||(l.addControl(a,null==e?void 0:e.position),t&&t(o)),()=>{s&&s(o),l.hasControl(a)&&l.removeControl(a)}}),[]),a}a.memo((function(t){const n=yl((({mapLib:e})=>new e.AttributionControl(t)),{position:t.position});return e.useEffect((()=>{fl(n._container,t.style)}),[t.style]),null})),a.memo((function(t){const n=yl((({mapLib:e})=>new e.FullscreenControl({container:t.containerId&&document.getElementById(t.containerId)})),{position:t.position});return e.useEffect((()=>{fl(n._controlContainer,t.style)}),[t.style]),null}));const _l=e.forwardRef(((t,n)=>{const r=e.useRef({props:t}),i=yl((({mapLib:e})=>{const n=new e.GeolocateControl(t),i=n._setupUI;return n._setupUI=e=>{n._container.hasChildNodes()||i(e)},n.on("geolocate",(e=>{var t,n;null===(n=(t=r.current.props).onGeolocate)||void 0===n||n.call(t,e)})),n.on("error",(e=>{var t,n;null===(n=(t=r.current.props).onError)||void 0===n||n.call(t,e)})),n.on("outofmaxbounds",(e=>{var t,n;null===(n=(t=r.current.props).onOutOfMaxBounds)||void 0===n||n.call(t,e)})),n.on("trackuserlocationstart",(e=>{var t,n;null===(n=(t=r.current.props).onTrackUserLocationStart)||void 0===n||n.call(t,e)})),n.on("trackuserlocationend",(e=>{var t,n;null===(n=(t=r.current.props).onTrackUserLocationEnd)||void 0===n||n.call(t,e)})),n}),{position:t.position});return r.current.props=t,e.useImperativeHandle(n,(()=>({trigger:()=>i.trigger()})),[]),e.useEffect((()=>{fl(i._container,t.style)}),[t.style]),null}));_l.displayName="GeolocateControl",a.memo(_l);var xl=a.memo((function(t){const n=yl((({mapLib:e})=>new e.NavigationControl(t)),{position:t.position});return e.useEffect((()=>{fl(n._container,t.style)}),[t.style]),null}));function wl(t){const n=yl((({mapLib:e})=>new e.ScaleControl(t)),{position:t.position});return n.options.unit===t.unit&&n.options.maxWidth===t.maxWidth||(n.options.maxWidth=t.maxWidth,n.setUnit(t.unit)),e.useEffect((()=>{fl(n._container,t.style)}),[t.style]),null}function bl(e,t,n){if(null!==e)for(var r,i,o,a,s,l,c,u,h=0,d=0,f=e.type,p="FeatureCollection"===f,m="Feature"===f,g=p?e.features.length:1,v=0;v<g;v++){s=(u=!!(c=p?e.features[v].geometry:m?e.geometry:e)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var y=0;y<s;y++){var _=0,x=0;if(null!==(a=u?c.geometries[y]:c)){l=a.coordinates;var w=a.type;switch(h=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(l,d,v,_,x))return!1;d++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],d,v,_,x))return!1;d++,"MultiPoint"===w&&_++}"LineString"===w&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(i=0;i<l[r].length-h;i++){if(!1===t(l[r][i],d,v,_,x))return!1;d++}"MultiLineString"===w&&_++,"Polygon"===w&&x++}"Polygon"===w&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(x=0,i=0;i<l[r].length;i++){for(o=0;o<l[r][i].length-h;o++){if(!1===t(l[r][i][o],d,v,_,x))return!1;d++}x++}_++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===bl(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function El(e){var t=[1/0,1/0,-1/0,-1/0];return bl(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}wl.defaultProps={unit:"metric",maxWidth:100},a.memo(wl),El.default=El;const kl=(Tl="match",e=>null!==e&&"object"==typeof e&&Tl in e);var Tl;const Ml=e=>void 0!==e;function Sl({curr:e,next:t,prev:n,clipBy:r=3}){const i=e.text.split(" "),o=i.length;if(e.match||r>=o)return e.text;const a="...";return Ml(t)&&Ml(n)&&kl(n)&&kl(t)?o>2*r?[...i.slice(0,r),a,...i.slice(-r)].join(" "):e.text:Ml(t)&&kl(t)?[a,...i.slice(-r)].join(" "):Ml(n)&&kl(n)?[...i.slice(0,r),a].join(" "):e.text}const Cl=({terms:e,matchExactly:t=!1})=>{try{const n=/^([/~@;%#'])(.*?)\1([gimsuy]*)$/.exec(e);return n?new RegExp(n[2],n[3]):new RegExp((({terms:e,matchExactly:t=!1})=>{if("string"!=typeof e)throw new TypeError("Expected a string");const n=e.trim().replace(/[|\\{}()[\]^$+*?.-]/g,(e=>`\\${e}`));return`(${t?n:(e=>e.replace(/\s{2,}/g," ").split(" ").join("|"))(n)})`})({terms:e,matchExactly:t}),"ig")}catch{throw new TypeError("Expected terms to be either a string or a RegExp!")}};let Al=36,Il="";for(;Al--;)Il+=Al.toString(36);function Rl(e=11){let t="",n=e;for(;n--;)t+=Il[36*Math.random()|0];return t}const Ll=e=>e.length>0,zl=({onSelect:t,placeholder:n="Search for a postcode",defaultValue:r="",required:i=!0,className:o})=>{const[a,l]=e.useState(r),[u,h]=e.useState(""),[d,f]=e.useState([]),[p,m]=e.useState("");e.useEffect((()=>{l(r)}),[r]),e.useEffect((()=>{u?(e=>c(void 0,void 0,void 0,(function*(){if(e.length>8)throw new Error("Postcode Invalid");if(e){const t=yield fetch(`https://app.plinth.org.uk/api/postcode-autocomplete?postcode=${e}`),{postcodes:n}=yield t.json();return n}})))(u).then((e=>{const t=u.replace(" ",""),n=e.find((e=>e.id.replace(" ","").toLowerCase()===t.toLowerCase()));n&&l(n.id),f(e)})).catch((e=>{console.log({err:e}),h(""),f([]),m(e.message)})):m("")}),[u,t]);const g=()=>{h(""),l(""),m(""),f([])},v=()=>{l(""),h("")},y=p||a||u;return s.default.createElement("div",{className:`postcode-autocomplete ${o||""}`},s.default.createElement(an,{value:a,onChange:e=>{l((null==e?void 0:e.id)||""),h((null==e?void 0:e.id)||""),t((null==e?void 0:e.id)||"",e)}},(({open:e})=>s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:"postcode-input-container"},s.default.createElement(an.Input,{"aria-label":"Postcode search",required:i,className:"postcode-input",displayValue:e=>{var t,n;return(null===(t=null==e?void 0:e.toUpperCase)||void 0===t?void 0:t.call(e))||(null===(n=null==u?void 0:u.toUpperCase)||void 0===n?void 0:n.call(u))},onChange:e=>{h(e.target.value),l("")},type:"text",placeholder:n}),y&&s.default.createElement("button",{type:"button",onClick:g,className:"postcode-button"},s.default.createElement(zo,{className:"postcode-button-icon"})),!y&&s.default.createElement("button",{type:"button",className:"postcode-button",onClick:v},s.default.createElement(Lo,{className:"postcode-button-icon"}))),p&&s.default.createElement("p",{className:"postcode-error"},p),e&&d.length>0&&s.default.createElement(an.Options,{className:"postcode-options"},d.map((e=>s.default.createElement(an.Option,{value:e,key:e.id,className:"postcode-option"},(({active:t,selected:n})=>{const r=(({text:e,query:t,clipBy:n,matchExactly:r=!1})=>{const i="string"==typeof t?t.trim():t;if(""===i)return[{key:Rl(),text:e,match:!1}];const o=Cl({terms:t,matchExactly:r});return e.split(o).filter(Ll).map((e=>({key:Rl(),text:e,match:r?e.toLowerCase()===i.toLowerCase():o.test(e)}))).map(((e,t,r)=>({...e,..."number"==typeof n&&{text:Sl({curr:e,...t<r.length-1&&{next:r[t+1]},...t>0&&{prev:r[t-1]},clipBy:n})}})))})({text:e.id,query:u});return s.default.createElement("div",{className:`${t?"active":""} ${n?"selected":""}`},s.default.createElement("div",null,r.map((e=>s.default.createElement("span",{key:e.key,className:e.match?"font-bold":""},e.text)))),(null==e?void 0:e.names)&&s.default.createElement("span",{className:"postcode-option-names"},e.names.ward,", ",e.names.laua))})))))))))},Pl=({onLocationChange:t})=>{const[n,r]=e.useState(null),[i,o]=e.useState(!1);return s.default.createElement("div",{className:"user-locate"},s.default.createElement("div",{className:"location-options"},s.default.createElement(zl,{onSelect:(e,n)=>{const{coordinates:i}=n||{};i&&i.lat&&i.lon?(t({latitude:i.lat,longitude:i.lon}),r(null)):r("Unable to find location for the selected postcode")},placeholder:"Enter your postcode"}),s.default.createElement("button",{onClick:()=>{o(!0),r(null),"geolocation"in navigator?navigator.geolocation.getCurrentPosition((e=>{t({latitude:e.coords.latitude,longitude:e.coords.longitude}),o(!1)}),(e=>{r(`Geolocation error: ${e.message}`),o(!1)}),{enableHighAccuracy:!0,timeout:5e3,maximumAge:0}):(r("Geolocation is not supported by your browser"),o(!1))},disabled:i,className:"geolocation-button"},i?"Locating...":"Near Me")),n&&s.default.createElement("p",{className:"error-message"},n))};function Ol(e,t,n,r){const i=(n-e)*(Math.PI/180),o=(r-t)*(Math.PI/180),a=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e*(Math.PI/180))*Math.cos(n*(Math.PI/180))*Math.sin(o/2)*Math.sin(o/2);return 6371*(2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)))}const Dl=({venues:t,currentLocation:n,onVenueSelect:r})=>{const i=e.useMemo((()=>n?[...t].sort(((e,t)=>Ol(n.latitude,n.longitude,e.geopoint.lat,e.geopoint.lon)-Ol(n.latitude,n.longitude,t.geopoint.lat,t.geopoint.lon))):t.sort(((e,t)=>e.name.localeCompare(t.name)))),[t,n]);return s.default.createElement("div",{className:"inner-map-list"},i.map((e=>s.default.createElement("div",{role:"button",tabIndex:0,"aria-label":`View details for ${e.orgName} at ${e.name}`,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r(e))},key:e._id,className:"map-list-item",onClick:()=>r(e)},s.default.createElement("h3",null,e.orgName),s.default.createElement("p",null,e.name),n&&s.default.createElement("p",{className:"distance"},Ol(n.latitude,n.longitude,e.geopoint.lat,e.geopoint.lon).toFixed(1)," ","km")))))},Bl=()=>{const e=document.createElement("link");e.href="https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.css",e.rel="stylesheet",document.head.appendChild(e)},Fl="pk.eyJ1IjoidGltZXRvc3BhcmUiLCJhIjoiY20xYzk5Zm92MGpzazJsczZ6eHlrc3oxOCJ9.UMCE8pfy16oCOz12_pmjGw",jl=e=>{const t={};return e.forEach((e=>{var n,r;if(e.venue&&(null===(n=e.venue)||void 0===n?void 0:n._id)&&(null===(r=e.venue)||void 0===r?void 0:r.geopoint)){const n=e.venue._id;n in t?t[n].items.push(e):t[n]=Object.assign(Object.assign({},e.venue),{items:[e],orgName:e.orgName})}})),Object.values(t)},Nl=e=>El({type:"FeatureCollection",features:e.map((e=>{var t,n;return{type:"Feature",geometry:{type:"Point",coordinates:[null===(t=e.geopoint)||void 0===t?void 0:t.lon,null===(n=e.geopoint)||void 0===n?void 0:n.lat]}}}))}),Vl=e=>{const[t,n,r,i]=Nl(e);return{longitude:(t+r)/2,latitude:(n+i)/2,zoom:10,transitionDuration:1e3}};function Ul({items:t,renderPopup:n,hideLocationSearch:r,hideLocationTitle:i}){var o,a,l;const c=e.useRef(null),[u,h]=e.useState(null),d=e.useMemo((()=>jl(t)),[t]),[f,p]=e.useState(null);e.useEffect((()=>{Bl()}),[]);const m=e.useCallback((()=>{if(c.current&&d.length>0){const[e,t,n,r]=Nl(d);c.current.fitBounds([[e,t],[n,r]],{padding:40,duration:1e3})}}),[d]),g=e=>{p({latitude:e.geopoint.lat,longitude:e.geopoint.lon}),c.current&&(c.current.flyTo({center:[e.geopoint.lon,e.geopoint.lat],zoom:15,essential:!0,duration:400}),h(e))},v=d.length>0?Vl(d):void 0;return s.default.createElement("div",{className:"map-view-container"},s.default.createElement("div",{className:"map-list"},s.default.createElement(Dl,{venues:d,currentLocation:f,onVenueSelect:g})),s.default.createElement("div",{className:"map-container"},!r&&s.default.createElement("div",{className:"location-search"},s.default.createElement(Pl,{onLocationChange:e=>{p(e),c.current&&c.current.flyTo({center:[e.longitude,e.latitude],zoom:12,essential:!0,duration:400})}})),s.default.createElement(hl,{ref:c,onLoad:m,mapboxAccessToken:Fl,initialViewState:v,style:{width:"100%",height:"100%"},mapStyle:"mapbox://styles/mapbox/streets-v9"},d.map((e=>s.default.createElement(ml,{onClick:t=>{t.originalEvent.stopPropagation(),h(e)},key:e._id,longitude:e.geopoint.lon,latitude:e.geopoint.lat,anchor:"bottom"},s.default.createElement("div",{onMouseEnter:()=>h(e)},s.default.createElement(Io,{className:"location-marker"}))))),u&&s.default.createElement(vl,{anchor:"top",className:"map-popup",key:u._id,longitude:Number(null===(o=u.geopoint)||void 0===o?void 0:o.lon),latitude:Number(null===(a=u.geopoint)||void 0===a?void 0:a.lat),closeButton:!1},s.default.createElement("div",{className:"map-popup-container"},s.default.createElement("div",{className:"popup-header"},!i&&s.default.createElement("h3",{className:"map-popup-name"},u.name),s.default.createElement("button",{type:"button",className:"close-icon",onClick:()=>h(null)},s.default.createElement(Po,null))),null===(l=null==u?void 0:u.items)||void 0===l?void 0:l.map((e=>n(e))))),s.default.createElement(xl,{position:"bottom-right"}))),s.default.createElement("div",{className:"mobile-map-list"},s.default.createElement(Dl,{venues:d,currentLocation:f,onVenueSelect:g})))}const Hl=(e,t)=>{let n=Ce(t,"YYYY-MM-DD");if(e){const t=new Date(e),r=t.getHours(),i=t.getMinutes(),o=t.getSeconds();n=Ce().set("hour",r).set("minute",i).set("second",o||0)}return n.toDate()},Wl=(e,t)=>{var n,r;if(!(null===(n=e.recurrence)||void 0===n?void 0:n.RRULE))return(null===(r=null==e?void 0:e.recurrence)||void 0===r?void 0:r.dates)?e.recurrence.dates.filter((n=>{const r=Hl(e.start,n);return!t||r>=t.start&&r<=t.end})).map((t=>Hl(e.start,t))):[];{let n;try{n=Ls(e.recurrence.RRULE);return n.between(t.start,e.concluded?new Date(e.concluded):t.end).map((t=>((e,t)=>{if(t.start){const n=new Date(t.start),r=n.getHours(),i=n.getMinutes(),o=n.getSeconds();e.setHours(r,i,o||0)}return e})(t,e)))}catch(e){return console.warn(e),[]}}};function $l({selected:e,setSelected:t,plans:n}){return s.default.createElement(ji,{value:e,onChange:e=>t(e),className:"radio-group"},s.default.createElement(ji.Label,{className:"radio-label"}," View "),s.default.createElement("div",{className:"option-container"},n.map((t=>s.default.createElement(ji.Option,{key:t.name,value:t,className:({checked:n})=>Me("option",{checked:n||t.name===e.name})},(({active:e})=>s.default.createElement("span",{className:"radio-button"},s.default.createElement("span",{className:Me("radio-outer-ring",{"ring-2 ring-offset-2 ring-indigo-500":e}),"aria-hidden":"true"},s.default.createElement("span",{className:"radio-inner-ring"})),s.default.createElement(ji.Label,{as:"span",className:"radio-label-text"},t.icon,s.default.createElement("span",{className:"sr-only"},t.name)))))))))}const Gl=()=>{};let ql={},Zl={},Xl=null,Yl={mark:Gl,measure:Gl};try{"undefined"!=typeof window&&(ql=window),"undefined"!=typeof document&&(Zl=document),"undefined"!=typeof MutationObserver&&(Xl=MutationObserver),"undefined"!=typeof performance&&(Yl=performance)}catch(yn){}const{userAgent:Kl=""}=ql.navigator||{},Jl=ql,Ql=Zl,ec=Xl,tc=Yl;Jl.document;const nc=!!Ql.documentElement&&!!Ql.head&&"function"==typeof Ql.addEventListener&&"function"==typeof Ql.createElement,rc=~Kl.indexOf("MSIE")||~Kl.indexOf("Trident/");var ic="classic",oc="duotone",ac="sharp",sc="sharp-duotone",lc=[ic,oc,ac,sc],cc={fak:"kit","fa-kit":"kit"},uc={fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"},hc={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},dc=[1,2,3,4,5,6,7,8,9,10],fc=dc.concat([11,12,13,14,15,16,17,18,19,20]),pc={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},mc=[...Object.keys({classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]}),"solid","regular","light","thin","duotone","brands","2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",pc.GROUP,pc.SWAP_OPACITY,pc.PRIMARY,pc.SECONDARY].concat(dc.map((e=>"".concat(e,"x")))).concat(fc.map((e=>"w-".concat(e)))),gc={kit:"fak"},vc={"kit-duotone":"fakd"};const yc="___FONT_AWESOME___",_c=16,xc="fa",wc="svg-inline--fa",bc="data-fa-i2svg",Ec="data-fa-pseudo-element",kc="data-fa-pseudo-element-pending",Tc="data-prefix",Mc="data-icon",Sc="fontawesome-i2svg",Cc="async",Ac=["HTML","HEAD","STYLE","SCRIPT"],Ic=(()=>{try{return!0}catch(e){return!1}})(),Rc=[ic,ac,sc];function Lc(e){return new Proxy(e,{get:(e,t)=>t in e?e[t]:e[ic]})}const zc={...hc};zc[ic]={...hc[ic],...cc,...uc};const Pc=Lc(zc),Oc={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}};Oc[ic]={...Oc[ic],...gc,...vc};const Dc=Lc(Oc),Bc={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}};Bc[ic]={...Bc[ic],fak:"fa-kit"};const Fc=Lc(Bc),jc={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}};jc[ic]={...jc[ic],"fa-kit":"fak"};const Nc=Lc(jc),Vc=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,Uc="fa-layers-text",Hc=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;Lc({classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}});const Wc=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],$c=pc,Gc=new Set;Object.keys(Dc[ic]).map(Gc.add.bind(Gc)),Object.keys(Dc[ac]).map(Gc.add.bind(Gc)),Object.keys(Dc[sc]).map(Gc.add.bind(Gc));const qc=["kit",...mc],Zc=Jl.FontAwesomeConfig||{};if(Ql&&"function"==typeof Ql.querySelector){[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((e=>{let[t,n]=e;const r=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=Ql.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(t));null!=r&&(Zc[n]=r)}))}const Xc={styleDefault:"solid",familyDefault:"classic",cssPrefix:xc,replacementClass:wc,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Zc.familyPrefix&&(Zc.cssPrefix=Zc.familyPrefix);const Yc={...Xc,...Zc};Yc.autoReplaceSvg||(Yc.observeMutations=!1);const Kc={};Object.keys(Xc).forEach((e=>{Object.defineProperty(Kc,e,{enumerable:!0,set:function(t){Yc[e]=t,Jc.forEach((e=>e(Kc)))},get:function(){return Yc[e]}})})),Object.defineProperty(Kc,"familyPrefix",{enumerable:!0,set:function(e){Yc.cssPrefix=e,Jc.forEach((e=>e(Kc)))},get:function(){return Yc.cssPrefix}}),Jl.FontAwesomeConfig=Kc;const Jc=[];const Qc=_c,eu={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};const tu="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function nu(){let e=12,t="";for(;e-- >0;)t+=tu[62*Math.random()|0];return t}function ru(e){const t=[];for(let n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function iu(e){return e.classList?ru(e.classList):(e.getAttribute("class")||"").split(" ").filter((e=>e))}function ou(e){return"".concat(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function au(e){return Object.keys(e||{}).reduce(((t,n)=>t+"".concat(n,": ").concat(e[n].trim(),";")),"")}function su(e){return e.size!==eu.size||e.x!==eu.x||e.y!==eu.y||e.rotate!==eu.rotate||e.flipX||e.flipY}var lu=':root, :host {\n  --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";\n  --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";\n  --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro";\n  --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro";\n  --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n  --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n  --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";\n  --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n  overflow: visible;\n  box-sizing: content-box;\n}\n\n.svg-inline--fa {\n  display: var(--fa-display, inline-block);\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n  vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n  vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n  vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n  vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n  vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: var(--fa-pull-margin, 0.3em);\n  width: auto;\n}\n.svg-inline--fa.fa-li {\n  width: var(--fa-li-width, 2em);\n  top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n  width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  transform-origin: center center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: var(--fa-counter-background-color, #ff253a);\n  border-radius: var(--fa-counter-border-radius, 1em);\n  box-sizing: border-box;\n  color: var(--fa-inverse, #fff);\n  line-height: var(--fa-counter-line-height, 1);\n  max-width: var(--fa-counter-max-width, 5em);\n  min-width: var(--fa-counter-min-width, 1.5em);\n  overflow: hidden;\n  padding: var(--fa-counter-padding, 0.25em 0.5em);\n  right: var(--fa-right, 0);\n  text-overflow: ellipsis;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-counter-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: var(--fa-bottom, 0);\n  right: var(--fa-right, 0);\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: var(--fa-bottom, 0);\n  left: var(--fa-left, 0);\n  right: auto;\n  top: auto;\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  top: var(--fa-top, 0);\n  right: var(--fa-right, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: var(--fa-left, 0);\n  right: auto;\n  top: var(--fa-top, 0);\n  transform: scale(var(--fa-layers-scale, 0.25));\n  transform-origin: top left;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-2xs {\n  font-size: 0.625em;\n  line-height: 0.1em;\n  vertical-align: 0.225em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n  line-height: 0.0833333337em;\n  vertical-align: 0.125em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n  line-height: 0.0714285718em;\n  vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n  font-size: 1.25em;\n  line-height: 0.05em;\n  vertical-align: -0.075em;\n}\n\n.fa-xl {\n  font-size: 1.5em;\n  line-height: 0.0416666682em;\n  vertical-align: -0.125em;\n}\n\n.fa-2xl {\n  font-size: 2em;\n  line-height: 0.03125em;\n  vertical-align: -0.1875em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: var(--fa-li-margin, 2.5em);\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: calc(-1 * var(--fa-li-width, 2em));\n  position: absolute;\n  text-align: center;\n  width: var(--fa-li-width, 2em);\n  line-height: inherit;\n}\n\n.fa-border {\n  border-color: var(--fa-border-color, #eee);\n  border-radius: var(--fa-border-radius, 0.1em);\n  border-style: var(--fa-border-style, solid);\n  border-width: var(--fa-border-width, 0.08em);\n  padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n  float: left;\n  margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n  float: right;\n  margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n  animation-name: fa-beat;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n  animation-name: fa-bounce;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n  animation-name: fa-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n  animation-name: fa-beat-fade;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n  animation-name: fa-flip;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n  animation-name: fa-shake;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n  animation-name: fa-spin;\n  animation-delay: var(--fa-animation-delay, 0s);\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 2s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n  --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n  animation-name: fa-spin;\n  animation-direction: var(--fa-animation-direction, normal);\n  animation-duration: var(--fa-animation-duration, 1s);\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n  animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n    animation-delay: -1ms;\n    animation-duration: 1ms;\n    animation-iteration-count: 1;\n    transition-delay: 0s;\n    transition-duration: 0s;\n  }\n}\n@keyframes fa-beat {\n  0%, 90% {\n    transform: scale(1);\n  }\n  45% {\n    transform: scale(var(--fa-beat-scale, 1.25));\n  }\n}\n@keyframes fa-bounce {\n  0% {\n    transform: scale(1, 1) translateY(0);\n  }\n  10% {\n    transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n  }\n  30% {\n    transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n  }\n  50% {\n    transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n  }\n  57% {\n    transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n  }\n  64% {\n    transform: scale(1, 1) translateY(0);\n  }\n  100% {\n    transform: scale(1, 1) translateY(0);\n  }\n}\n@keyframes fa-fade {\n  50% {\n    opacity: var(--fa-fade-opacity, 0.4);\n  }\n}\n@keyframes fa-beat-fade {\n  0%, 100% {\n    opacity: var(--fa-beat-fade-opacity, 0.4);\n    transform: scale(1);\n  }\n  50% {\n    opacity: 1;\n    transform: scale(var(--fa-beat-fade-scale, 1.125));\n  }\n}\n@keyframes fa-flip {\n  50% {\n    transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n  }\n}\n@keyframes fa-shake {\n  0% {\n    transform: rotate(-15deg);\n  }\n  4% {\n    transform: rotate(15deg);\n  }\n  8%, 24% {\n    transform: rotate(-18deg);\n  }\n  12%, 28% {\n    transform: rotate(18deg);\n  }\n  16% {\n    transform: rotate(-22deg);\n  }\n  20% {\n    transform: rotate(22deg);\n  }\n  32% {\n    transform: rotate(-12deg);\n  }\n  36% {\n    transform: rotate(12deg);\n  }\n  40%, 100% {\n    transform: rotate(0deg);\n  }\n}\n@keyframes fa-spin {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n  transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n  transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n  transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n  display: inline-block;\n  vertical-align: middle;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n  z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n  color: var(--fa-inverse, #fff);\n}';function cu(){const e=xc,t=wc,n=Kc.cssPrefix,r=Kc.replacementClass;let i=lu;if(n!==e||r!==t){const o=new RegExp("\\.".concat(e,"\\-"),"g"),a=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");i=i.replace(o,".".concat(n,"-")).replace(a,"--".concat(n,"-")).replace(s,".".concat(r))}return i}let uu=!1;function hu(){Kc.autoAddCss&&!uu&&(!function(e){if(!e||!nc)return;const t=Ql.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const n=Ql.head.childNodes;let r=null;for(let e=n.length-1;e>-1;e--){const t=n[e],i=(t.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(i)>-1&&(r=t)}Ql.head.insertBefore(t,r)}(cu()),uu=!0)}var du={mixout:()=>({dom:{css:cu,insertCss:hu}}),hooks:()=>({beforeDOMElementCreation(){hu()},beforeI2svg(){hu()}})};const fu=Jl||{};fu[yc]||(fu[yc]={}),fu[yc].styles||(fu[yc].styles={}),fu[yc].hooks||(fu[yc].hooks={}),fu[yc].shims||(fu[yc].shims=[]);var pu=fu[yc];const mu=[],gu=function(){Ql.removeEventListener("DOMContentLoaded",gu),vu=1,mu.map((e=>e()))};let vu=!1;function yu(e){const{tag:t,attributes:n={},children:r=[]}=e;return"string"==typeof e?ou(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce(((t,n)=>t+"".concat(n,'="').concat(ou(e[n]),'" ')),"").trim()}(n),">").concat(r.map(yu).join(""),"</").concat(t,">")}function _u(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}nc&&(vu=(Ql.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Ql.readyState),vu||Ql.addEventListener("DOMContentLoaded",gu));var xu=function(e,t,n,r){var i,o,a,s=Object.keys(e),l=s.length,c=void 0!==r?function(e,t){return function(n,r,i,o){return e.call(t,n,r,i,o)}}(t,r):t;for(void 0===n?(i=1,a=e[s[0]]):(i=0,a=n);i<l;i++)a=c(a,e[o=s[i]],o,e);return a};function wu(e){const t=function(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const r=e.charCodeAt(n++);56320==(64512&r)?t.push(((1023&i)<<10)+(1023&r)+65536):(t.push(i),n--)}else t.push(i)}return t}(e);return 1===t.length?t[0].toString(16):null}function bu(e){return Object.keys(e).reduce(((t,n)=>{const r=e[n];return!!r.icon?t[r.iconName]=r.icon:t[n]=r,t}),{})}function Eu(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{skipHooks:r=!1}=n,i=bu(t);"function"!=typeof pu.hooks.addPack||r?pu.styles[e]={...pu.styles[e]||{},...i}:pu.hooks.addPack(e,bu(t)),"fas"===e&&Eu("fa",t)}const{styles:ku,shims:Tu}=pu,Mu={[ic]:Object.values(Fc[ic]),[ac]:Object.values(Fc[ac]),[sc]:Object.values(Fc[sc])};let Su=null,Cu={},Au={},Iu={},Ru={},Lu={};const zu={[ic]:Object.keys(Pc[ic]),[ac]:Object.keys(Pc[ac]),[sc]:Object.keys(Pc[sc])};function Pu(e,t){const n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r!==e||""===i||function(e){return~qc.indexOf(e)}(i)?null:i}const Ou=()=>{const e=e=>xu(ku,((t,n,r)=>(t[r]=xu(n,e,{}),t)),{});Cu=e(((e,t,n)=>{if(t[3]&&(e[t[3]]=n),t[2]){t[2].filter((e=>"number"==typeof e)).forEach((t=>{e[t.toString(16)]=n}))}return e})),Au=e(((e,t,n)=>{if(e[n]=n,t[2]){t[2].filter((e=>"string"==typeof e)).forEach((t=>{e[t]=n}))}return e})),Lu=e(((e,t,n)=>{const r=t[2];return e[n]=n,r.forEach((t=>{e[t]=n})),e}));const t="far"in ku||Kc.autoFetchSvg,n=xu(Tu,((e,n)=>{const r=n[0];let i=n[1];const o=n[2];return"far"!==i||t||(i="fas"),"string"==typeof r&&(e.names[r]={prefix:i,iconName:o}),"number"==typeof r&&(e.unicodes[r.toString(16)]={prefix:i,iconName:o}),e}),{names:{},unicodes:{}});Iu=n.names,Ru=n.unicodes,Su=Uu(Kc.styleDefault,{family:Kc.familyDefault})};var Du;function Bu(e,t){return(Cu[e]||{})[t]}function Fu(e,t){return(Lu[e]||{})[t]}function ju(e){return Iu[e]||{prefix:null,iconName:null}}function Nu(){return Su}Du=e=>{Su=Uu(e.styleDefault,{family:Kc.familyDefault})},Jc.push(Du),Ou();const Vu=()=>({prefix:null,iconName:null,rest:[]});function Uu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{family:n=ic}=t,r=Pc[n][e],i=Dc[n][e]||Dc[n][r],o=e in pu.styles?e:null;return i||o||null}const Hu={[ic]:Object.keys(Fc[ic]),[ac]:Object.keys(Fc[ac]),[sc]:Object.keys(Fc[sc])};function Wu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipLookups:n=!1}=t,r={[ic]:"".concat(Kc.cssPrefix,"-").concat(ic),[ac]:"".concat(Kc.cssPrefix,"-").concat(ac),[sc]:"".concat(Kc.cssPrefix,"-").concat(sc)};let i=null,o=ic;const a=lc.filter((e=>e!==oc));a.forEach((t=>{(e.includes(r[t])||e.some((e=>Hu[t].includes(e))))&&(o=t)}));const s=e.reduce(((e,t)=>{const s=Pu(Kc.cssPrefix,t);if(ku[t]?(t=Mu[o].includes(t)?Nc[o][t]:t,i=t,e.prefix=t):zu[o].indexOf(t)>-1?(i=t,e.prefix=Uu(t,{family:o})):s?e.iconName=s:t===Kc.replacementClass||a.some((e=>t===r[e]))||e.rest.push(t),!n&&e.prefix&&e.iconName){const t="fa"===i?ju(e.iconName):{},n=Fu(e.prefix,e.iconName);t.prefix&&(i=null),e.iconName=t.iconName||n||e.iconName,e.prefix=t.prefix||e.prefix,"far"!==e.prefix||ku.far||!ku.fas||Kc.autoFetchSvg||(e.prefix="fas")}return e}),Vu());return(e.includes("fa-brands")||e.includes("fab"))&&(s.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(s.prefix="fad"),s.prefix||o!==ac||!ku.fass&&!Kc.autoFetchSvg||(s.prefix="fass",s.iconName=Fu(s.prefix,s.iconName)||s.iconName),s.prefix||o!==sc||!ku.fasds&&!Kc.autoFetchSvg||(s.prefix="fasds",s.iconName=Fu(s.prefix,s.iconName)||s.iconName),"fa"!==s.prefix&&"fa"!==i||(s.prefix=Nu()||"fas"),s}let $u=[],Gu={};const qu={},Zu=Object.keys(qu);function Xu(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return(Gu[e]||[]).forEach((e=>{t=e.apply(null,[t,...r])})),t}function Yu(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(Gu[e]||[]).forEach((e=>{e.apply(null,n)}))}function Ku(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return qu[e]?qu[e].apply(null,t):void 0}function Ju(e){"fa"===e.prefix&&(e.prefix="fas");let{iconName:t}=e;const n=e.prefix||Nu();if(t)return t=Fu(n,t)||t,_u(Qu.definitions,n,t)||_u(pu.styles,n,t)}const Qu=new class{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.reduce(this._pullDefinitions,{});Object.keys(r).forEach((e=>{this.definitions[e]={...this.definitions[e]||{},...r[e]},Eu(e,r[e]);const t=Fc[ic][e];t&&Eu(t,r[e]),Ou()}))}reset(){this.definitions={}}_pullDefinitions(e,t){const n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map((t=>{const{prefix:r,iconName:i,icon:o}=n[t],a=o[2];e[r]||(e[r]={}),a.length>0&&a.forEach((t=>{"string"==typeof t&&(e[r][t]=o)})),e[r][i]=o})),e}},eh={i2svg:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nc?(Yu("beforeI2svg",e),Ku("pseudoElements2svg",e),Ku("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;var n;!1===Kc.autoReplaceSvg&&(Kc.autoReplaceSvg=!0),Kc.observeMutations=!0,n=()=>{rh({autoReplaceSvgRoot:t}),Yu("watch",e)},nc&&(vu?setTimeout(n,0):mu.push(n))}},th={icon:e=>{if(null===e)return null;if("object"==typeof e&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:Fu(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){const t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],n=Uu(e[0]);return{prefix:n,iconName:Fu(n,t)||t}}if("string"==typeof e&&(e.indexOf("".concat(Kc.cssPrefix,"-"))>-1||e.match(Vc))){const t=Wu(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||Nu(),iconName:Fu(t.prefix,t.iconName)||t.iconName}}if("string"==typeof e){const t=Nu();return{prefix:t,iconName:Fu(t,e)||e}}}},nh={noAuto:()=>{Kc.autoReplaceSvg=!1,Kc.observeMutations=!1,Yu("noAuto")},config:Kc,dom:eh,parse:th,library:Qu,findIconDefinition:Ju,toHtml:yu},rh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t=Ql}=e;(Object.keys(pu.styles).length>0||Kc.autoFetchSvg)&&nc&&Kc.autoReplaceSvg&&nh.dom.i2svg({node:t})};function ih(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map((e=>yu(e)))}}),Object.defineProperty(e,"node",{get:function(){if(!nc)return;const t=Ql.createElement("div");return t.innerHTML=e.html,t.children}}),e}function oh(e){const{icons:{main:t,mask:n},prefix:r,iconName:i,transform:o,symbol:a,title:s,maskId:l,titleId:c,extra:u,watchable:h=!1}=e,{width:d,height:f}=n.found?n:t,p="fak"===r,m=[Kc.replacementClass,i?"".concat(Kc.cssPrefix,"-").concat(i):""].filter((e=>-1===u.classes.indexOf(e))).filter((e=>""!==e||!!e)).concat(u.classes).join(" ");let g={children:[],attributes:{...u.attributes,"data-prefix":r,"data-icon":i,class:m,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(f)}};const v=p&&!~u.classes.indexOf("fa-fw")?{width:"".concat(d/f*16*.0625,"em")}:{};h&&(g.attributes[bc]=""),s&&(g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-".concat(c||nu())},children:[s]}),delete g.attributes.title);const y={...g,prefix:r,iconName:i,main:t,mask:n,maskId:l,transform:o,symbol:a,styles:{...v,...u.styles}},{children:_,attributes:x}=n.found&&t.found?Ku("generateAbstractMask",y)||{children:[],attributes:{}}:Ku("generateAbstractIcon",y)||{children:[],attributes:{}};return y.children=_,y.attributes=x,a?function(e){let{prefix:t,iconName:n,children:r,attributes:i,symbol:o}=e;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...i,id:!0===o?"".concat(t,"-").concat(Kc.cssPrefix,"-").concat(n):o},children:r}]}]}(y):function(e){let{children:t,main:n,mask:r,attributes:i,styles:o,transform:a}=e;if(su(a)&&n.found&&!r.found){const{width:e,height:t}=n,r={x:e/t/2,y:.5};i.style=au({...o,"transform-origin":"".concat(r.x+a.x/16,"em ").concat(r.y+a.y/16,"em")})}return[{tag:"svg",attributes:i,children:t}]}(y)}function ah(e){const{content:t,width:n,height:r,transform:i,title:o,extra:a,watchable:s=!1}=e,l={...a.attributes,...o?{title:o}:{},class:a.classes.join(" ")};s&&(l[bc]="");const c={...a.styles};su(i)&&(c.transform=function(e){let{transform:t,width:n=_c,height:r=_c,startCentered:i=!1}=e,o="";return o+=i&&rc?"translate(".concat(t.x/Qc-n/2,"em, ").concat(t.y/Qc-r/2,"em) "):i?"translate(calc(-50% + ".concat(t.x/Qc,"em), calc(-50% + ").concat(t.y/Qc,"em)) "):"translate(".concat(t.x/Qc,"em, ").concat(t.y/Qc,"em) "),o+="scale(".concat(t.size/Qc*(t.flipX?-1:1),", ").concat(t.size/Qc*(t.flipY?-1:1),") "),o+="rotate(".concat(t.rotate,"deg) "),o}({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);const u=au(c);u.length>0&&(l.style=u);const h=[];return h.push({tag:"span",attributes:l,children:[t]}),o&&h.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),h}const{styles:sh}=pu;function lh(e){const t=e[0],n=e[1],[r]=e.slice(4);let i=null;return i=Array.isArray(r)?{tag:"g",attributes:{class:"".concat(Kc.cssPrefix,"-").concat($c.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Kc.cssPrefix,"-").concat($c.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(Kc.cssPrefix,"-").concat($c.PRIMARY),fill:"currentColor",d:r[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:t,height:n,icon:i}}const ch={found:!1,width:512,height:512};function uh(e,t){let n=t;return"fa"===t&&null!==Kc.styleDefault&&(t=Nu()),new Promise(((r,i)=>{if("fa"===n){const n=ju(e)||{};e=n.iconName||e,t=n.prefix||t}if(e&&t&&sh[t]&&sh[t][e]){return r(lh(sh[t][e]))}!function(e,t){Ic||Kc.showMissingIcons||!e||console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}(e,t),r({...ch,icon:Kc.showMissingIcons&&e&&Ku("missingIconAbstract")||{}})}))}const hh=()=>{},dh=Kc.measurePerformance&&tc&&tc.mark&&tc.measure?tc:{mark:hh,measure:hh},fh='FA "6.6.0"',ph=e=>{dh.mark("".concat(fh," ").concat(e," ends")),dh.measure("".concat(fh," ").concat(e),"".concat(fh," ").concat(e," begins"),"".concat(fh," ").concat(e," ends"))};var mh={begin:e=>(dh.mark("".concat(fh," ").concat(e," begins")),()=>ph(e)),end:ph};const gh=()=>{};function vh(e){return"string"==typeof(e.getAttribute?e.getAttribute(bc):null)}function yh(e){return Ql.createElementNS("http://www.w3.org/2000/svg",e)}function _h(e){return Ql.createElement(e)}function xh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ceFn:n=("svg"===e.tag?yh:_h)}=t;if("string"==typeof e)return Ql.createTextNode(e);const r=n(e.tag);Object.keys(e.attributes||[]).forEach((function(t){r.setAttribute(t,e.attributes[t])}));return(e.children||[]).forEach((function(e){r.appendChild(xh(e,{ceFn:n}))})),r}const wh={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach((e=>{t.parentNode.insertBefore(xh(e),t)})),null===t.getAttribute(bc)&&Kc.keepOriginalSource){let e=Ql.createComment(function(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(e){const t=e[0],n=e[1];if(~iu(t).indexOf(Kc.replacementClass))return wh.replace(e);const r=new RegExp("".concat(Kc.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){const e=n[0].attributes.class.split(" ").reduce(((e,t)=>(t===Kc.replacementClass||t.match(r)?e.toSvg.push(t):e.toNode.push(t),e)),{toNode:[],toSvg:[]});n[0].attributes.class=e.toSvg.join(" "),0===e.toNode.length?t.removeAttribute("class"):t.setAttribute("class",e.toNode.join(" "))}const i=n.map((e=>yu(e))).join("\n");t.setAttribute(bc,""),t.innerHTML=i}};function bh(e){e()}function Eh(e,t){const n="function"==typeof t?t:gh;if(0===e.length)n();else{let t=bh;Kc.mutateApproach===Cc&&(t=Jl.requestAnimationFrame||bh),t((()=>{const t=!0===Kc.autoReplaceSvg?wh.replace:wh[Kc.autoReplaceSvg]||wh.replace,r=mh.begin("mutate");e.map(t),r(),n()}))}}let kh=!1;function Th(){kh=!0}function Mh(){kh=!1}let Sh=null;function Ch(e){if(!ec)return;if(!Kc.observeMutations)return;const{treeCallback:t=gh,nodeCallback:n=gh,pseudoElementsCallback:r=gh,observeMutationsRoot:i=Ql}=e;Sh=new ec((e=>{if(kh)return;const i=Nu();ru(e).forEach((e=>{if("childList"===e.type&&e.addedNodes.length>0&&!vh(e.addedNodes[0])&&(Kc.searchPseudoElements&&r(e.target),t(e.target)),"attributes"===e.type&&e.target.parentNode&&Kc.searchPseudoElements&&r(e.target.parentNode),"attributes"===e.type&&vh(e.target)&&~Wc.indexOf(e.attributeName))if("class"===e.attributeName&&function(e){const t=e.getAttribute?e.getAttribute(Tc):null,n=e.getAttribute?e.getAttribute(Mc):null;return t&&n}(e.target)){const{prefix:t,iconName:n}=Wu(iu(e.target));e.target.setAttribute(Tc,t||i),n&&e.target.setAttribute(Mc,n)}else(function(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(Kc.replacementClass)})(e.target)&&n(e.target)}))})),nc&&Sh.observe(i,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function Ah(e){const t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=void 0!==e.innerText?e.innerText.trim():"";let i=Wu(iu(e));return i.prefix||(i.prefix=Nu()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=(o=i.prefix,a=e.innerText,(Au[o]||{})[a]||Bu(i.prefix,wu(e.innerText)))),!i.iconName&&Kc.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i;var o,a}function Ih(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0};const{iconName:n,prefix:r,rest:i}=Ah(e),o=function(e){const t=ru(e.attributes).reduce(((e,t)=>("class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e)),{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return Kc.autoA11y&&(n?t["aria-labelledby"]="".concat(Kc.replacementClass,"-title-").concat(r||nu()):(t["aria-hidden"]="true",t.focusable="false")),t}(e),a=Xu("parseNodeAttributes",{},e);let s=t.styleParser?function(e){const t=e.getAttribute("style");let n=[];return t&&(n=t.split(";").reduce(((e,t)=>{const n=t.split(":"),r=n[0],i=n.slice(1);return r&&i.length>0&&(e[r]=i.join(":").trim()),e}),{})),n}(e):[];return{iconName:n,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:r,transform:eu,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:i,styles:s,attributes:o},...a}}const{styles:Rh}=pu;function Lh(e){const t="nest"===Kc.autoReplaceSvg?Ih(e,{styleParser:!1}):Ih(e);return~t.extra.classes.indexOf(Uc)?Ku("generateLayersText",e,t):Ku("generateSvgReplacementMutation",e,t)}let zh=new Set;function Ph(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!nc)return Promise.resolve();const n=Ql.documentElement.classList,r=e=>n.add("".concat(Sc,"-").concat(e)),i=e=>n.remove("".concat(Sc,"-").concat(e)),o=Kc.autoFetchSvg?zh:Rc.map((e=>"fa-".concat(e))).concat(Object.keys(Rh));o.includes("fa")||o.push("fa");const a=[".".concat(Uc,":not([").concat(bc,"])")].concat(o.map((e=>".".concat(e,":not([").concat(bc,"])")))).join(", ");if(0===a.length)return Promise.resolve();let s=[];try{s=ru(e.querySelectorAll(a))}catch(e){}if(!(s.length>0))return Promise.resolve();r("pending"),i("complete");const l=mh.begin("onTree"),c=s.reduce(((e,t)=>{try{const n=Lh(t);n&&e.push(n)}catch(e){Ic||"MissingIcon"===e.name&&console.error(e)}return e}),[]);return new Promise(((e,n)=>{Promise.all(c).then((n=>{Eh(n,(()=>{r("active"),r("complete"),i("pending"),"function"==typeof t&&t(),l(),e()}))})).catch((e=>{l(),n(e)}))}))}function Oh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Lh(e).then((e=>{e&&Eh([e],t)}))}Rc.map((e=>{zh.add("fa-".concat(e))})),Object.keys(Pc[ic]).map(zh.add.bind(zh)),Object.keys(Pc[ac]).map(zh.add.bind(zh)),Object.keys(Pc[sc]).map(zh.add.bind(zh)),zh=[...zh];const Dh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:n=eu,symbol:r=!1,mask:i=null,maskId:o=null,title:a=null,titleId:s=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:h,iconName:d,icon:f}=e;return ih({type:"icon",...e},(()=>(Yu("beforeDOMElementCreation",{iconDefinition:e,params:t}),Kc.autoA11y&&(a?c["aria-labelledby"]="".concat(Kc.replacementClass,"-title-").concat(s||nu()):(c["aria-hidden"]="true",c.focusable="false")),oh({icons:{main:lh(f),mask:i?lh(i.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:d,transform:{...eu,...n},symbol:r,title:a,maskId:o,titleId:s,extra:{attributes:c,styles:u,classes:l}}))))};var Bh={mixout(){return{icon:(e=Dh,function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(t||{}).icon?t:Ju(t||{});let{mask:i}=n;return i&&(i=(i||{}).icon?i:Ju(i||{})),e(r,{...n,mask:i})})};var e},hooks:()=>({mutationObserverCallbacks:e=>(e.treeCallback=Ph,e.nodeCallback=Oh,e)}),provides(e){e.i2svg=function(e){const{node:t=Ql,callback:n=(()=>{})}=e;return Ph(t,n)},e.generateSvgReplacementMutation=function(e,t){const{iconName:n,title:r,titleId:i,prefix:o,transform:a,symbol:s,mask:l,maskId:c,extra:u}=t;return new Promise(((t,h)=>{Promise.all([uh(n,o),l.iconName?uh(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then((l=>{let[h,d]=l;t([e,oh({icons:{main:h,mask:d},prefix:o,iconName:n,transform:a,symbol:s,maskId:c,title:r,titleId:i,extra:u,watchable:!0})])})).catch(h)}))},e.generateAbstractIcon=function(e){let{children:t,attributes:n,main:r,transform:i,styles:o}=e;const a=au(o);let s;return a.length>0&&(n.style=a),su(i)&&(s=Ku("generateAbstractTransformGrouping",{main:r,transform:i,containerWidth:r.width,iconWidth:r.width})),t.push(s||r.icon),{children:t,attributes:n}}}},Fh={mixout:()=>({layer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{classes:n=[]}=t;return ih({type:"layer"},(()=>{Yu("beforeDOMElementCreation",{assembler:e,params:t});let r=[];return e((e=>{Array.isArray(e)?e.map((e=>{r=r.concat(e.abstract)})):r=r.concat(e.abstract)})),[{tag:"span",attributes:{class:["".concat(Kc.cssPrefix,"-layers"),...n].join(" ")},children:r}]}))}})},jh={mixout:()=>({counter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{title:n=null,classes:r=[],attributes:i={},styles:o={}}=t;return ih({type:"counter",content:e},(()=>(Yu("beforeDOMElementCreation",{content:e,params:t}),function(e){const{content:t,title:n,extra:r}=e,i={...r.attributes,...n?{title:n}:{},class:r.classes.join(" ")},o=au(r.styles);o.length>0&&(i.style=o);const a=[];return a.push({tag:"span",attributes:i,children:[t]}),n&&a.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),a}({content:e.toString(),title:n,extra:{attributes:i,styles:o,classes:["".concat(Kc.cssPrefix,"-layers-counter"),...r]}}))))}})},Nh={mixout:()=>({text(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:n=eu,title:r=null,classes:i=[],attributes:o={},styles:a={}}=t;return ih({type:"text",content:e},(()=>(Yu("beforeDOMElementCreation",{content:e,params:t}),ah({content:e,transform:{...eu,...n},title:r,extra:{attributes:o,styles:a,classes:["".concat(Kc.cssPrefix,"-layers-text"),...i]}}))))}}),provides(e){e.generateLayersText=function(e,t){const{title:n,transform:r,extra:i}=t;let o=null,a=null;if(rc){const t=parseInt(getComputedStyle(e).fontSize,10),n=e.getBoundingClientRect();o=n.width/t,a=n.height/t}return Kc.autoA11y&&!n&&(i.attributes["aria-hidden"]="true"),Promise.resolve([e,ah({content:e.innerHTML,width:o,height:a,transform:r,title:n,extra:i,watchable:!0})])}}};const Vh=new RegExp('"',"ug"),Uh=[1105920,1112319],Hh={FontAwesome:{normal:"fas",400:"fas"},"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"},"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"},"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},Wh=Object.keys(Hh).reduce(((e,t)=>(e[t.toLowerCase()]=Hh[t],e)),{}),$h=Object.keys(Wh).reduce(((e,t)=>{const n=Wh[t];return e[t]=n[900]||[...Object.entries(n)][0][1],e}),{});function Gh(e,t){const n="".concat(kc).concat(t.replace(":","-"));return new Promise(((r,i)=>{if(null!==e.getAttribute(n))return r();const o=ru(e.children).filter((e=>e.getAttribute(Ec)===t))[0],a=Jl.getComputedStyle(e,t),s=a.getPropertyValue("font-family"),l=s.match(Hc),c=a.getPropertyValue("font-weight"),u=a.getPropertyValue("content");if(o&&!l)return e.removeChild(o),r();if(l&&"none"!==u&&""!==u){const u=a.getPropertyValue("content");let h=function(e,t){const n=e.replace(/^['"]|['"]$/g,"").toLowerCase(),r=parseInt(t),i=isNaN(r)?"normal":r;return(Wh[n]||{})[i]||$h[n]}(s,c);const{value:d,isSecondary:f}=function(e){const t=e.replace(Vh,""),n=function(e,t){const n=e.length;let r,i=e.charCodeAt(t);return i>=55296&&i<=56319&&n>t+1&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?1024*(i-55296)+r-56320+65536:i}(t,0),r=n>=Uh[0]&&n<=Uh[1],i=2===t.length&&t[0]===t[1];return{value:wu(i?t[0]:t),isSecondary:r||i}}(u),p=l[0].startsWith("FontAwesome");let m=Bu(h,d),g=m;if(p){const e=function(e){const t=Ru[e],n=Bu("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}(d);e.iconName&&e.prefix&&(m=e.iconName,h=e.prefix)}if(!m||f||o&&o.getAttribute(Tc)===h&&o.getAttribute(Mc)===g)r();else{e.setAttribute(n,g),o&&e.removeChild(o);const a={iconName:null,title:null,titleId:null,prefix:null,transform:eu,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},{extra:s}=a;s.attributes[Ec]=t,uh(m,h).then((i=>{const o=oh({...a,icons:{main:i,mask:Vu()},prefix:h,iconName:g,extra:s,watchable:!0}),l=Ql.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===t?e.insertBefore(l,e.firstChild):e.appendChild(l),l.outerHTML=o.map((e=>yu(e))).join("\n"),e.removeAttribute(n),r()})).catch(i)}}else r()}))}function qh(e){return Promise.all([Gh(e,"::before"),Gh(e,"::after")])}function Zh(e){return!(e.parentNode===document.head||~Ac.indexOf(e.tagName.toUpperCase())||e.getAttribute(Ec)||e.parentNode&&"svg"===e.parentNode.tagName)}function Xh(e){if(nc)return new Promise(((t,n)=>{const r=ru(e.querySelectorAll("*")).filter(Zh).map(qh),i=mh.begin("searchPseudoElements");Th(),Promise.all(r).then((()=>{i(),Mh(),t()})).catch((()=>{i(),Mh(),n()}))}))}var Yh={hooks:()=>({mutationObserverCallbacks:e=>(e.pseudoElementsCallback=Xh,e)}),provides(e){e.pseudoElements2svg=function(e){const{node:t=Ql}=e;Kc.searchPseudoElements&&Xh(t)}}};let Kh=!1;const Jh=e=>e.toLowerCase().split(" ").reduce(((e,t)=>{const n=t.toLowerCase().split("-"),r=n[0];let i=n.slice(1).join("-");if(r&&"h"===i)return e.flipX=!0,e;if(r&&"v"===i)return e.flipY=!0,e;if(i=parseFloat(i),isNaN(i))return e;switch(r){case"grow":e.size=e.size+i;break;case"shrink":e.size=e.size-i;break;case"left":e.x=e.x-i;break;case"right":e.x=e.x+i;break;case"up":e.y=e.y-i;break;case"down":e.y=e.y+i;break;case"rotate":e.rotate=e.rotate+i}return e}),{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0});var Qh={mixout:()=>({parse:{transform:e=>Jh(e)}}),hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-transform");return n&&(e.transform=Jh(n)),e}}),provides(e){e.generateAbstractTransformGrouping=function(e){let{main:t,transform:n,containerWidth:r,iconWidth:i}=e;const o={transform:"translate(".concat(r/2," 256)")},a="translate(".concat(32*n.x,", ").concat(32*n.y,") "),s="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),l="rotate(".concat(n.rotate," 0 0)"),c={transform:"".concat(a," ").concat(s," ").concat(l)},u={transform:"translate(".concat(i/2*-1," -256)")};return{tag:"g",attributes:{...o},children:[{tag:"g",attributes:{...c},children:[{tag:t.icon.tag,children:t.icon.children,attributes:{...t.icon.attributes,...u}}]}]}}}};const ed={x:0,y:0,width:"100%",height:"100%"};function td(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}var nd={hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-mask"),r=n?Wu(n.split(" ").map((e=>e.trim()))):Vu();return r.prefix||(r.prefix=Nu()),e.mask=r,e.maskId=t.getAttribute("data-fa-mask-id"),e}}),provides(e){e.generateAbstractMask=function(e){let{children:t,attributes:n,main:r,mask:i,maskId:o,transform:a}=e;const{width:s,icon:l}=r,{width:c,icon:u}=i,h=function(e){let{transform:t,containerWidth:n,iconWidth:r}=e;const i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(32*t.x,", ").concat(32*t.y,") "),a="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(o," ").concat(a," ").concat(s)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}({transform:a,containerWidth:c,iconWidth:s}),d={tag:"rect",attributes:{...ed,fill:"white"}},f=l.children?{children:l.children.map(td)}:{},p={tag:"g",attributes:{...h.inner},children:[td({tag:l.tag,attributes:{...l.attributes,...h.path},...f})]},m={tag:"g",attributes:{...h.outer},children:[p]},g="mask-".concat(o||nu()),v="clip-".concat(o||nu()),y={tag:"mask",attributes:{...ed,id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[d,m]},_={tag:"defs",children:[{tag:"clipPath",attributes:{id:v},children:(x=u,"g"===x.tag?x.children:[x])},y]};var x;return t.push(_,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(v,")"),mask:"url(#".concat(g,")"),...ed}}),{children:t,attributes:n}}}},rd={provides(e){let t=!1;Jl.matchMedia&&(t=Jl.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const e=[],n={fill:"currentColor"},r={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:{...n,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const i={...r,attributeName:"opacity"},o={tag:"circle",attributes:{...n,cx:"256",cy:"364",r:"28"},children:[]};return t||o.children.push({tag:"animate",attributes:{...r,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...i,values:"1;0;1;1;0;1;"}}),e.push(o),e.push({tag:"path",attributes:{...n,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:t?[]:[{tag:"animate",attributes:{...i,values:"1;0;0;0;0;1;"}}]}),t||e.push({tag:"path",attributes:{...n,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...i,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:e}}}},id={hooks:()=>({parseNodeAttributes(e,t){const n=t.getAttribute("data-fa-symbol"),r=null!==n&&(""===n||n);return e.symbol=r,e}})};!function(e,t){let{mixoutsTo:n}=t;$u=e,Gu={},Object.keys(qu).forEach((e=>{-1===Zu.indexOf(e)&&delete qu[e]})),$u.forEach((e=>{const t=e.mixout?e.mixout():{};if(Object.keys(t).forEach((e=>{"function"==typeof t[e]&&(n[e]=t[e]),"object"==typeof t[e]&&Object.keys(t[e]).forEach((r=>{n[e]||(n[e]={}),n[e][r]=t[e][r]}))})),e.hooks){const t=e.hooks();Object.keys(t).forEach((e=>{Gu[e]||(Gu[e]=[]),Gu[e].push(t[e])}))}e.provides&&e.provides(qu)}))}([du,Bh,Fh,jh,Nh,Yh,{mixout:()=>({dom:{unwatch(){Th(),Kh=!0}}}),hooks:()=>({bootstrap(){Ch(Xu("mutationObserverCallbacks",{}))},noAuto(){Sh&&Sh.disconnect()},watch(e){const{observeMutationsRoot:t}=e;Kh?Mh():Ch(Xu("mutationObserverCallbacks",{observeMutationsRoot:t}))}})},Qh,nd,rd,id],{mixoutsTo:nh});const od=nh.parse,ad=nh.icon;var sd={exports:{}};function ld(){}function cd(){}cd.resetWarningCache=ld;function ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ud(Object(n),!0).forEach((function(t){fd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ud(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dd(e){return dd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dd(e)}function fd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pd(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function md(e){return function(e){if(Array.isArray(e))return gd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return gd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vd(e){return t=e,(t-=0)==t?e:(e=e.replace(/[\-_\s]+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))).substr(0,1).toLowerCase()+e.substr(1);var t}sd.exports=function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:cd,resetWarningCache:ld};return n.PropTypes=n,n}();var yd=["style"];var _d=!1;try{_d=!0}catch(yn){}function xd(e){return e&&"object"===dd(e)&&e.prefix&&e.iconName&&e.icon?e:od.icon?od.icon(e):null===e?null:e&&"object"===dd(e)&&e.prefix&&e.iconName?e:Array.isArray(e)&&2===e.length?{prefix:e[0],iconName:e[1]}:"string"==typeof e?{prefix:"fas",iconName:e}:void 0}function wd(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?fd({},e,t):{}}var bd={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},Ed=s.default.forwardRef((function(e,t){var n=hd(hd({},bd),e),r=n.icon,i=n.mask,o=n.symbol,a=n.className,s=n.title,l=n.titleId,c=n.maskId,u=xd(r),h=wd("classes",[].concat(md(function(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,a=e.shake,s=e.flash,l=e.spin,c=e.spinPulse,u=e.spinReverse,h=e.pulse,d=e.fixedWidth,f=e.inverse,p=e.border,m=e.listItem,g=e.flip,v=e.size,y=e.rotation,_=e.pull,x=(fd(t={"fa-beat":n,"fa-fade":r,"fa-beat-fade":i,"fa-bounce":o,"fa-shake":a,"fa-flash":s,"fa-spin":l,"fa-spin-reverse":u,"fa-spin-pulse":c,"fa-pulse":h,"fa-fw":d,"fa-inverse":f,"fa-border":p,"fa-li":m,"fa-flip":!0===g,"fa-flip-horizontal":"horizontal"===g||"both"===g,"fa-flip-vertical":"vertical"===g||"both"===g},"fa-".concat(v),null!=v),fd(t,"fa-rotate-".concat(y),null!=y&&0!==y),fd(t,"fa-pull-".concat(_),null!=_),fd(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(x).map((function(e){return x[e]?e:null})).filter((function(e){return e}))}(n)),md((a||"").split(" ")))),d=wd("transform","string"==typeof n.transform?od.transform(n.transform):n.transform),f=wd("mask",xd(i)),p=ad(u,hd(hd(hd(hd({},h),d),f),{},{symbol:o,title:s,titleId:l,maskId:c}));if(!p)return function(){var e;!_d&&console&&"function"==typeof console.error&&(e=console).error.apply(e,arguments)}("Could not find icon",u),null;var m=p.abstract,g={ref:t};return Object.keys(n).forEach((function(e){bd.hasOwnProperty(e)||(g[e]=n[e])})),kd(m[0],g)}));Ed.displayName="FontAwesomeIcon",Ed.propTypes={beat:sd.exports.bool,border:sd.exports.bool,beatFade:sd.exports.bool,bounce:sd.exports.bool,className:sd.exports.string,fade:sd.exports.bool,flash:sd.exports.bool,mask:sd.exports.oneOfType([sd.exports.object,sd.exports.array,sd.exports.string]),maskId:sd.exports.string,fixedWidth:sd.exports.bool,inverse:sd.exports.bool,flip:sd.exports.oneOf([!0,!1,"horizontal","vertical","both"]),icon:sd.exports.oneOfType([sd.exports.object,sd.exports.array,sd.exports.string]),listItem:sd.exports.bool,pull:sd.exports.oneOf(["right","left"]),pulse:sd.exports.bool,rotation:sd.exports.oneOf([0,90,180,270]),shake:sd.exports.bool,size:sd.exports.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:sd.exports.bool,spinPulse:sd.exports.bool,spinReverse:sd.exports.bool,symbol:sd.exports.oneOfType([sd.exports.bool,sd.exports.string]),title:sd.exports.string,titleId:sd.exports.string,transform:sd.exports.oneOfType([sd.exports.string,sd.exports.object]),swapOpacity:sd.exports.bool};var kd=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof n)return n;var i=(n.children||[]).map((function(n){return e(t,n)})),o=Object.keys(n.attributes||{}).reduce((function(e,t){var r=n.attributes[t];switch(t){case"class":e.attrs.className=r,delete n.attributes.class;break;case"style":e.attrs.style=r.split(";").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n,r=t.indexOf(":"),i=vd(t.slice(0,r)),o=t.slice(r+1).trim();return i.startsWith("webkit")?e[(n=i,n.charAt(0).toUpperCase()+n.slice(1))]=o:e[i]=o,e}),{});break;default:0===t.indexOf("aria-")||0===t.indexOf("data-")?e.attrs[t.toLowerCase()]=r:e.attrs[vd(t)]=r}return e}),{attrs:{}}),a=r.style,s=void 0===a?{}:a,l=pd(r,yd);return o.attrs.style=hd(hd({},o.attrs.style),s),t.apply(void 0,[n.tag,hd(hd({},o.attrs),l)].concat(md(i)))}.bind(null,s.default.createElement);const Td={prefix:"fas",iconName:"calendar-days",icon:[448,512,["calendar-alt"],"f073","M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm64 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 400l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]},Md={prefix:"fas",iconName:"list",icon:[512,512,["list-squares"],"f03a","M40 48C26.7 48 16 58.7 16 72l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24L40 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 232l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z"]},Sd={prefix:"fas",iconName:"globe",icon:[512,512,[127760],"f0ac","M352 256c0 22.2-1.2 43.6-3.3 64l-185.3 0c-2.2-20.4-3.3-41.8-3.3-64s1.2-43.6 3.3-64l185.3 0c2.2 20.4 3.3 41.8 3.3 64zm28.8-64l123.1 0c5.3 20.5 8.1 41.9 8.1 64s-2.8 43.5-8.1 64l-123.1 0c2.1-20.6 3.2-42 3.2-64s-1.1-43.4-3.2-64zm112.6-32l-116.7 0c-10-63.9-29.8-117.4-55.3-151.6c78.3 20.7 142 77.5 171.9 151.6zm-149.1 0l-176.6 0c6.1-36.4 15.5-68.6 27-94.7c10.5-23.6 22.2-40.7 33.5-51.5C239.4 3.2 248.7 0 256 0s16.6 3.2 27.8 13.8c11.3 10.8 23 27.9 33.5 51.5c11.6 26 20.9 58.2 27 94.7zm-209 0L18.6 160C48.6 85.9 112.2 29.1 190.6 8.4C165.1 42.6 145.3 96.1 135.3 160zM8.1 192l123.1 0c-2.1 20.6-3.2 42-3.2 64s1.1 43.4 3.2 64L8.1 320C2.8 299.5 0 278.1 0 256s2.8-43.5 8.1-64zM194.7 446.6c-11.6-26-20.9-58.2-27-94.6l176.6 0c-6.1 36.4-15.5 68.6-27 94.6c-10.5 23.6-22.2 40.7-33.5 51.5C272.6 508.8 263.3 512 256 512s-16.6-3.2-27.8-13.8c-11.3-10.8-23-27.9-33.5-51.5zM135.3 352c10 63.9 29.8 117.4 55.3 151.6C112.2 482.9 48.6 426.1 18.6 352l116.7 0zm358.1 0c-30 74.1-93.6 130.9-171.9 151.6c25.5-34.2 45.2-87.7 55.3-151.6l116.7 0z"]},Cd={prefix:"fas",iconName:"tags",icon:[512,512,[],"f02c","M345 39.1L472.8 168.4c52.4 53 52.4 138.2 0 191.2L360.8 472.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L438.6 325.9c33.9-34.3 33.9-89.4 0-123.7L310.9 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM0 229.5L0 80C0 53.5 21.5 32 48 32l149.5 0c17 0 33.3 6.7 45.3 18.7l168 168c25 25 25 65.5 0 90.5L277.3 442.7c-25 25-65.5 25-90.5 0l-168-168C6.7 262.7 0 246.5 0 229.5zM144 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},Ad={prefix:"fas",iconName:"phone",icon:[512,512,[128222,128379],"f095","M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"]},Id={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},Rd={prefix:"fas",iconName:"comment",icon:[512,512,[128489,61669],"f075","M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"]},Ld={prefix:"fas",iconName:"envelope",icon:[512,512,[128386,9993,61443],"f0e0","M48 64C21.5 64 0 85.5 0 112c0 15.1 7.1 29.3 19.2 38.4L236.8 313.6c11.4 8.5 27 8.5 38.4 0L492.8 150.4c12.1-9.1 19.2-23.3 19.2-38.4c0-26.5-21.5-48-48-48L48 64zM0 176L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-208L294.4 339.2c-22.8 17.1-54 17.1-76.8 0L0 176z"]},zd={prefix:"fas",iconName:"location-dot",icon:[384,512,["map-marker-alt"],"f3c5","M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"]},Pd={prefix:"fas",iconName:"map",icon:[576,512,[128506,62072],"f279","M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z"]},Od=[{name:"List View",icon:s.default.createElement(Ed,{icon:Md})},{name:"Map View",icon:s.default.createElement(Ed,{icon:Pd})}],Dd=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"].map((e=>({id:e,text:`${e}(s)`})));function Bd({organisations:t,programme:n,events:r,loading:i,className:o}){const[a,l]=e.useState(Od[0]),[c,u]=e.useState({}),[h,d]=e.useState({}),f=t.map((({_id:e,Name:t})=>({id:e,text:t}))),{start:p,end:m}=n,g=(e=>{let t=e;if(Object.values(h).some((e=>e))){const e=t.filter((e=>h[e.managedBy]));t=e}if(Object.values(c).some((e=>e))){const e=t.filter((e=>{var t;if(null===(t=null==e?void 0:e.recurrence)||void 0===t?void 0:t.recurring){return Wl(e,{start:new Date(p),end:new Date(m)}).some((e=>{const t=Ce(e).format("dddd");return c[t]}))}const n=Ce(e.start).format("dddd");return c[n]}));t=e}return t})(r);return console.log({filteredEvents:g}),s.default.createElement("div",{className:Me("embeddable-event-details",o)},s.default.createElement("div",{className:"filter-row"},s.default.createElement("div",{className:"dropdown-row"},s.default.createElement($l,{selected:a,setSelected:l,plans:Od}),s.default.createElement(Oo,{label:"Organisations",items:f,selected:h,setSelected:d}),s.default.createElement(Oo,{label:"Weekday",items:Dd,selected:c,setSelected:u}))),s.default.createElement("div",{className:"content-container"},"List View"===a.name&&s.default.createElement($s,{events:g,eventsLoading:i,onRemoveFilters:()=>{u({}),d({})}}),"Map View"===a.name&&s.default.createElement(Ul,{items:g,renderPopup:e=>s.default.createElement(Ws,{className:"map-card",eventData:e,size:"small",showOrgChip:!0})})),s.default.createElement(_e,{to:"/directory"},"Directory"))}Bd.defaultProps={className:void 0};var Fd,jd={exports:{}};
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */function Nd(){return Fd||(Fd=1,function(e,t){e.exports=function(){const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:a,create:s}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),a||(a=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=b(Array.prototype.forEach),h=b(Array.prototype.pop),d=b(Array.prototype.push),f=b(String.prototype.toLowerCase),p=b(String.prototype.toString),m=b(String.prototype.match),g=b(String.prototype.replace),v=b(String.prototype.indexOf),y=b(String.prototype.trim),_=b(Object.prototype.hasOwnProperty),x=b(RegExp.prototype.test),w=E(TypeError);function b(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return l(e,t,r)}}function E(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function k(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function T(e){for(let t=0;t<e.length;t++)_(e,t)||(e[t]=null);return e}function M(t){const n=s(null);for(const[r,i]of e(t))_(t,r)&&(Array.isArray(i)?n[r]=T(i):i&&"object"==typeof i&&i.constructor===Object?n[r]=M(i):n[r]=i);return n}function S(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return b(n.get);if("function"==typeof n.value)return b(n.value)}e=r(e)}function n(){return null}return n}const C=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),A=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),I=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),L=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),z=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),P=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),D=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),B=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),j=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),N=a(/<%[\w\W]*|[\w\W]*%>/gm),V=a(/\${[\w\W]*}/gm),U=a(/^data-[\-\w.\u00B7-\uFFFF]/),H=a(/^aria-[\-\w]+$/),W=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q=a(/^html$/i),Z=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var X=Object.freeze({__proto__:null,MUSTACHE_EXPR:j,ERB_EXPR:N,TMPLIT_EXPR:V,DATA_ATTR:U,ARIA_ATTR:H,IS_ALLOWED_URI:W,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:G,DOCTYPE_NAME:q,CUSTOM_ELEMENT:Z});const Y={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.1.6",n.removed=[],!t||!t.document||t.document.nodeType!==Y.document)return n.isSupported=!1,n;let{document:r}=t;const i=r,a=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:b,Element:E,NodeFilter:T,NamedNodeMap:j=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:N,DOMParser:V,trustedTypes:U}=t,H=E.prototype,$=S(H,"cloneNode"),G=S(H,"remove"),Z=S(H,"nextSibling"),ee=S(H,"childNodes"),te=S(H,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let ne,re="";const{implementation:ie,createNodeIterator:oe,createDocumentFragment:ae,getElementsByTagName:se}=r,{importNode:le}=i;let ce={};n.isSupported="function"==typeof e&&"function"==typeof te&&ie&&void 0!==ie.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:he,TMPLIT_EXPR:de,DATA_ATTR:fe,ARIA_ATTR:pe,IS_SCRIPT_OR_DATA:me,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:ve}=X;let{IS_ALLOWED_URI:ye}=X,_e=null;const xe=k({},[...C,...A,...I,...L,...P]);let we=null;const be=k({},[...O,...D,...B,...F]);let Ee=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,Te=null,Me=!0,Se=!0,Ce=!1,Ae=!0,Ie=!1,Re=!0,Le=!1,ze=!1,Pe=!1,Oe=!1,De=!1,Be=!1,Fe=!0,je=!1;const Ne="user-content-";let Ve=!0,Ue=!1,He={},We=null;const $e=k({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const qe=k({},["audio","video","img","source","image","track"]);let Ze=null;const Xe=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml";let Qe=Je,et=!1,tt=null;const nt=k({},[Ye,Ke,Je],p);let rt=null;const it=["application/xhtml+xml","text/html"],ot="text/html";let at=null,st=null;const lt=r.createElement("form"),ct=function(e){return e instanceof RegExp||e instanceof Function},ut=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!st||st!==e){if(e&&"object"==typeof e||(e={}),e=M(e),rt=-1===it.indexOf(e.PARSER_MEDIA_TYPE)?ot:e.PARSER_MEDIA_TYPE,at="application/xhtml+xml"===rt?p:f,_e=_(e,"ALLOWED_TAGS")?k({},e.ALLOWED_TAGS,at):xe,we=_(e,"ALLOWED_ATTR")?k({},e.ALLOWED_ATTR,at):be,tt=_(e,"ALLOWED_NAMESPACES")?k({},e.ALLOWED_NAMESPACES,p):nt,Ze=_(e,"ADD_URI_SAFE_ATTR")?k(M(Xe),e.ADD_URI_SAFE_ATTR,at):Xe,Ge=_(e,"ADD_DATA_URI_TAGS")?k(M(qe),e.ADD_DATA_URI_TAGS,at):qe,We=_(e,"FORBID_CONTENTS")?k({},e.FORBID_CONTENTS,at):$e,ke=_(e,"FORBID_TAGS")?k({},e.FORBID_TAGS,at):{},Te=_(e,"FORBID_ATTR")?k({},e.FORBID_ATTR,at):{},He=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Me=!1!==e.ALLOW_ARIA_ATTR,Se=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,Re=!1!==e.SAFE_FOR_XML,Le=e.WHOLE_DOCUMENT||!1,Oe=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,Ve=!1!==e.KEEP_CONTENT,Ue=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||W,Qe=e.NAMESPACE||Je,Ee=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ct(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ee.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ct(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ee.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ee.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Se=!1),De&&(Oe=!0),He&&(_e=k({},P),we=[],!0===He.html&&(k(_e,C),k(we,O)),!0===He.svg&&(k(_e,A),k(we,D),k(we,F)),!0===He.svgFilters&&(k(_e,I),k(we,D),k(we,F)),!0===He.mathMl&&(k(_e,L),k(we,B),k(we,F))),e.ADD_TAGS&&(_e===xe&&(_e=M(_e)),k(_e,e.ADD_TAGS,at)),e.ADD_ATTR&&(we===be&&(we=M(we)),k(we,e.ADD_ATTR,at)),e.ADD_URI_SAFE_ATTR&&k(Ze,e.ADD_URI_SAFE_ATTR,at),e.FORBID_CONTENTS&&(We===$e&&(We=M(We)),k(We,e.FORBID_CONTENTS,at)),Ve&&(_e["#text"]=!0),Le&&k(_e,["html","head","body"]),_e.table&&(k(_e,["tbody"]),delete ke.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ne=e.TRUSTED_TYPES_POLICY,re=ne.createHTML("")}else void 0===ne&&(ne=J(U,a)),null!==ne&&"string"==typeof re&&(re=ne.createHTML(""));o&&o(e),st=e}},ht=k({},["mi","mo","mn","ms","mtext"]),dt=k({},["foreignobject","annotation-xml"]),ft=k({},["title","style","font","a","script"]),pt=k({},[...A,...I,...R]),mt=k({},[...L,...z]),gt=function(e){let t=te(e);t&&t.tagName||(t={namespaceURI:Qe,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Ke?t.namespaceURI===Je?"svg"===n:t.namespaceURI===Ye?"svg"===n&&("annotation-xml"===r||ht[r]):Boolean(pt[n]):e.namespaceURI===Ye?t.namespaceURI===Je?"math"===n:t.namespaceURI===Ke?"math"===n&&dt[r]:Boolean(mt[n]):e.namespaceURI===Je?!(t.namespaceURI===Ke&&!dt[r])&&!(t.namespaceURI===Ye&&!ht[r])&&!mt[n]&&(ft[n]||!pt[n]):!("application/xhtml+xml"!==rt||!tt[e.namespaceURI]))},vt=function(e){d(n.removed,{element:e});try{te(e).removeChild(e)}catch(t){G(e)}},yt=function(e,t){try{d(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!we[e])if(Oe||De)try{vt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(Pe)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===rt&&Qe===Je&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=ne?ne.createHTML(e):e;if(Qe===Je)try{t=(new V).parseFromString(i,rt)}catch(e){}if(!t||!t.documentElement){t=ie.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?re:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Qe===Je?se.call(t,Le?"html":"body")[0]:Le?t.documentElement:o},xt=function(e){return oe.call(e.ownerDocument||e,e,T.SHOW_ELEMENT|T.SHOW_COMMENT|T.SHOW_TEXT|T.SHOW_PROCESSING_INSTRUCTION|T.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof N&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof j)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},bt=function(e){return"function"==typeof b&&e instanceof b},Et=function(e,t,r){ce[e]&&u(ce[e],(e=>{e.call(n,t,r,st)}))},kt=function(e){let t=null;if(Et("beforeSanitizeElements",e,null),wt(e))return vt(e),!0;const r=at(e.nodeName);if(Et("uponSanitizeElement",e,{tagName:r,allowedTags:_e}),e.hasChildNodes()&&!bt(e.firstElementChild)&&x(/<[/\w]/g,e.innerHTML)&&x(/<[/\w]/g,e.textContent))return vt(e),!0;if(e.nodeType===Y.progressingInstruction)return vt(e),!0;if(Re&&e.nodeType===Y.comment&&x(/<[/\w]/g,e.data))return vt(e),!0;if(!_e[r]||ke[r]){if(!ke[r]&&Mt(r)){if(Ee.tagNameCheck instanceof RegExp&&x(Ee.tagNameCheck,r))return!1;if(Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(r))return!1}if(Ve&&!We[r]){const t=te(e)||e.parentNode,n=ee(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const i=$(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,Z(e))}}return vt(e),!0}return e instanceof E&&!gt(e)?(vt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!x(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&e.nodeType===Y.text&&(t=e.textContent,u([ue,he,de],(e=>{t=g(t,e," ")})),e.textContent!==t&&(d(n.removed,{element:e.cloneNode()}),e.textContent=t)),Et("afterSanitizeElements",e,null),!1):(vt(e),!0)},Tt=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in r||n in lt))return!1;if(Se&&!Te[t]&&x(fe,t));else if(Me&&x(pe,t));else if(!we[t]||Te[t]){if(!(Mt(e)&&(Ee.tagNameCheck instanceof RegExp&&x(Ee.tagNameCheck,e)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(e))&&(Ee.attributeNameCheck instanceof RegExp&&x(Ee.attributeNameCheck,t)||Ee.attributeNameCheck instanceof Function&&Ee.attributeNameCheck(t))||"is"===t&&Ee.allowCustomizedBuiltInElements&&(Ee.tagNameCheck instanceof RegExp&&x(Ee.tagNameCheck,n)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(n))))return!1}else if(Ze[t]);else if(x(ye,g(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Ge[e])if(Ce&&!x(me,g(n,ge,"")));else if(n)return!1;return!0},Mt=function(e){return"annotation-xml"!==e&&m(e,ve)},St=function(e){Et("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we};let i=t.length;for(;i--;){const o=t[i],{name:a,namespaceURI:s,value:l}=o,c=at(a);let d="value"===a?l:y(l);if(r.attrName=c,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,Et("uponSanitizeAttribute",e,r),d=r.attrValue,Re&&x(/((--!?|])>)|<\/(style|title)/i,d)){yt(a,e);continue}if(r.forceKeepAttr)continue;if(yt(a,e),!r.keepAttr)continue;if(!Ae&&x(/\/>/i,d)){yt(a,e);continue}Ie&&u([ue,he,de],(e=>{d=g(d,e," ")}));const f=at(e.nodeName);if(Tt(f,c,d)){if(!je||"id"!==c&&"name"!==c||(yt(a,e),d=Ne+d),ne&&"object"==typeof U&&"function"==typeof U.getAttributeType)if(s);else switch(U.getAttributeType(f,c)){case"TrustedHTML":d=ne.createHTML(d);break;case"TrustedScriptURL":d=ne.createScriptURL(d)}try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),wt(e)?vt(e):h(n.removed)}catch(e){}}}Et("afterSanitizeAttributes",e,null)},Ct=function e(t){let n=null;const r=xt(t);for(Et("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Et("uponSanitizeShadowNode",n,null),kt(n)||(n.content instanceof l&&e(n.content),St(n));Et("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,a=null,s=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!bt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported)return e;if(ze||ut(t),n.removed=[],"string"==typeof e&&(Ue=!1),Ue){if(e.nodeName){const t=at(e.nodeName);if(!_e[t]||ke[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof b)r=_t("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),o.nodeType===Y.element&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Oe&&!Ie&&!Le&&-1===e.indexOf("<"))return ne&&Be?ne.createHTML(e):e;if(r=_t(e),!r)return Oe?null:Be?re:""}r&&Pe&&vt(r.firstChild);const c=xt(Ue?e:r);for(;a=c.nextNode();)kt(a)||(a.content instanceof l&&Ct(a.content),St(a));if(Ue)return e;if(Oe){if(De)for(s=ae.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(we.shadowroot||we.shadowrootmode)&&(s=le.call(i,s,!0)),s}let h=Le?r.outerHTML:r.innerHTML;return Le&&_e["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(q,r.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+h),Ie&&u([ue,he,de],(e=>{h=g(h,e," ")})),ne&&Be?ne.createHTML(h):h},n.setConfig=function(){ut(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ze=!0},n.clearConfig=function(){st=null,ze=!1},n.isValidAttribute=function(e,t,n){st||ut({});const r=at(e),i=at(t);return Tt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(ce[e]=ce[e]||[],d(ce[e],t))},n.removeHook=function(e){if(ce[e])return h(ce[e])},n.removeHooks=function(e){ce[e]&&(ce[e]=[])},n.removeAllHooks=function(){ce={}},n}var ee=Q();return ee}()}(jd)),jd.exports}var Vd=window.DOMPurify||(window.DOMPurify=Nd().default||Nd());const Ud=()=>{const e=document.createElement("link");e.href="https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.css",e.rel="stylesheet",document.head.appendChild(e)},Hd="pk.eyJ1IjoidGltZXRvc3BhcmUiLCJhIjoiY20xYzk5Zm92MGpzazJsczZ6eHlrc3oxOCJ9.UMCE8pfy16oCOz12_pmjGw";function Wd({venue:t}){return e.useEffect((()=>{Ud()}),[]),s.default.createElement(hl,{style:{width:"100%",height:"500px"},mapboxAccessToken:Hd,initialViewState:{longitude:t.geopoint.lon,latitude:t.geopoint.lat,zoom:15},mapStyle:"mapbox://styles/mapbox/streets-v9"},s.default.createElement(ml,{key:t._id,longitude:t.geopoint.lon,latitude:t.geopoint.lat},s.default.createElement("div",null,s.default.createElement(Io,{className:"location-marker"}))))}const $d={"Health and Wellbeing":"#FF9999","Care Professionals and Organisation":"#99CCFF","Housing and Accommodation":"#99FF99","Financial Advice and Services":"#FFCC99"};function Gd({services:t,directory:n}){var r;const{id:i}=function(){let{matches:e}=a.useContext(q),t=e[e.length-1];return t?t.params:{}}(),o=t.find((e=>e._id===i)),[l,c]=e.useState([]),u=J(),h=Y();e.useEffect((()=>{o&&c([])}),[o]);if(!o)return s.default.createElement("div",null,"Service not found");const d=(null===(r=o.offering)||void 0===r?void 0:r.filter((e=>{var t,r;return null===(r=null===(t=null==n?void 0:n.options)||void 0===t?void 0:t.offering)||void 0===r?void 0:r.includes(e)})))||[];return s.default.createElement("div",{className:"service-details-page"},s.default.createElement("button",{onClick:()=>{var e;(null===(e=h.state)||void 0===e?void 0:e.from)?u(h.state.from):u("/")},className:"back-button"},s.default.createElement(Ed,{icon:Id})," Back to Directory"),s.default.createElement("h1",{className:"service-details-page-title"},o.name),s.default.createElement("p",{className:"service-org-name"},o.orgName),d.length>0&&s.default.createElement("div",{className:"service-categories"},s.default.createElement(Ed,{icon:Cd,className:"category-icon"}),d.map((e=>s.default.createElement("span",{key:e,className:"category-tag",style:{backgroundColor:$d[e]||"#CCCCCC"}},e)))),s.default.createElement("div",{className:"service-contact-info"},o.phone&&s.default.createElement("p",null,s.default.createElement(Ed,{icon:Ad,className:"contact-icon"})," ",o.phone),o.email&&s.default.createElement("p",null,s.default.createElement(Ed,{icon:Ld,className:"contact-icon"})," ",o.email),o.website&&s.default.createElement("p",null,s.default.createElement(Ed,{icon:Sd,className:"contact-icon"}),s.default.createElement("a",{href:o.website,target:"_blank",rel:"noopener noreferrer"},o.website))),o.venue&&s.default.createElement("div",{className:"service-address"},s.default.createElement(Ed,{icon:zd,className:"address-icon"})," ",o.venue.address),s.default.createElement("div",{className:"service-details-page-description",dangerouslySetInnerHTML:{__html:Vd.sanitize(o.description)}}),o.venue&&s.default.createElement(Wd,{venue:o.venue}),l.length>0&&s.default.createElement("div",{className:"service-events"},s.default.createElement("h2",null,s.default.createElement(Ed,{icon:Td,className:"events-icon"})," Bookable Sessions"),s.default.createElement("ul",null,l.map((e=>s.default.createElement("li",{key:e._id},e.name.text))))))}function qd({value:e,setValue:t}){return s.default.createElement("div",{className:"search-container"},s.default.createElement("div",{className:"search-input-wrapper"},s.default.createElement(Lo,{className:"search-icon"}),s.default.createElement("input",{type:"text",className:"search-input",placeholder:"Search for services and support...",value:e,onChange:e=>t(e.target.value)})))}const Zd=({itemsPerPage:e,totalItems:t,paginate:n,currentPage:r})=>{const i=[],o=Math.ceil(t/e);for(let e=1;e<=o;e++)i.push(e);const a=e=>s.default.createElement("li",{key:e,className:"page-item "+(r===e?"active":"")},s.default.createElement("button",{onClick:()=>n(e),className:"page-link"},e));return s.default.createElement("nav",null,s.default.createElement("ul",{className:"pagination"},(()=>{const e=[],t=s.default.createElement("li",{className:"page-item"},s.default.createElement("span",{className:"pagination-ellipsis"},"…"));return e.push(s.default.createElement("li",{key:"prev",className:"page-item "+(1===r?"disabled":"")},s.default.createElement("button",{onClick:()=>n(r-1),className:"page-link"},"Previous"))),o<=7?e.push(...i.map(a)):r<=3?e.push(...i.slice(0,5).map(a),t,a(o)):r>=o-2?e.push(a(1),t,...i.slice(o-5).map(a)):e.push(a(1),t,...i.slice(r-2,r+1).map(a),t,a(o)),e.push(s.default.createElement("li",{key:"next",className:"page-item "+(r===o?"disabled":"")},s.default.createElement("button",{onClick:()=>n(r+1),className:"page-link"},"Next"))),e})()))};function Xd(e,t){return e===t}function Yd(e,t){return t}function Kd(t,n,r){var i=r&&r.equalityFn||Xd,o=e.useReducer(Yd,t),a=o[0],s=o[1],l=function(t,n,r){var i=this,o=e.useRef(null),a=e.useRef(0),s=e.useRef(null),l=e.useRef([]),c=e.useRef(),u=e.useRef(),h=e.useRef(t),d=e.useRef(!0);h.current=t;var f="undefined"!=typeof window,p=!n&&0!==n&&f;if("function"!=typeof t)throw new TypeError("Expected a function");n=+n||0;var m=!!(r=r||{}).leading,g=!("trailing"in r)||!!r.trailing,v="maxWait"in r,y="debounceOnServer"in r&&!!r.debounceOnServer,_=v?Math.max(+r.maxWait||0,n):null;e.useEffect((function(){return d.current=!0,function(){d.current=!1}}),[]);var x=e.useMemo((function(){var e=function(e){var t=l.current,n=c.current;return l.current=c.current=null,a.current=e,u.current=h.current.apply(n,t)},t=function(e,t){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!d.current)return!1;var t=e-o.current;return!o.current||t>=n||t<0||v&&e-a.current>=_},x=function(t){return s.current=null,g&&l.current?e(t):(l.current=c.current=null,u.current)},w=function e(){var i=Date.now();if(r(i))return x(i);if(d.current){var s=n-(i-o.current),l=v?Math.min(s,_-(i-a.current)):s;t(e,l)}},b=function(){if(f||y){var h=Date.now(),p=r(h);if(l.current=[].slice.call(arguments),c.current=i,o.current=h,p){if(!s.current&&d.current)return a.current=o.current,t(w,n),m?e(o.current):u.current;if(v)return t(w,n),e(o.current)}return s.current||t(w,n),u.current}};return b.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,l.current=o.current=c.current=s.current=null},b.isPending=function(){return!!s.current},b.flush=function(){return s.current?x(Date.now()):u.current},b}),[m,v,n,_,g,p,f,y]);return x}(e.useCallback((function(e){return s(e)}),[s]),n,r),c=e.useRef(t);return i(c.current,t)||(l(t),c.current=t),i(a,t)&&l.cancel(),[a,l]}var Jd,Qd="vercel.ai.error",ef=Symbol.for(Qd),tf=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[Jd]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Qd)}static hasMarker(e,t){const n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}};Jd=ef;var nf=tf;function rf(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var of,af="AI_InvalidArgumentError",sf=`vercel.ai.error.${af}`,lf=Symbol.for(sf),cf=class extends nf{constructor({message:e,cause:t,argument:n}){super({name:af,message:e,cause:t}),this[of]=!0,this.argument=n}static isInstance(e){return nf.hasMarker(e,sf)}};of=lf;var uf,hf="AI_JSONParseError",df=`vercel.ai.error.${hf}`,ff=Symbol.for(df),pf=class extends nf{constructor({text:e,cause:t}){super({name:hf,message:`JSON parsing failed: Text: ${e}.\nError message: ${rf(t)}`,cause:t}),this[uf]=!0,this.text=e}static isInstance(e){return nf.hasMarker(e,df)}};uf=ff;var mf,gf="AI_TypeValidationError",vf=`vercel.ai.error.${gf}`,yf=Symbol.for(vf);mf=yf;var _f=class e extends nf{constructor({value:e,cause:t}){super({name:gf,message:`Type validation failed: Value: ${JSON.stringify(e)}.\nError message: ${rf(t)}`,cause:t}),this[mf]=!0,this.value=e}static isInstance(e){return nf.hasMarker(e,vf)}static wrap({value:t,cause:n}){return e.isInstance(n)&&n.value===t?n:new e({value:t,cause:n})}};var xf={exports:{}};const wf="undefined"!=typeof Buffer,bf=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Ef=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function kf(e,t,n){null==n&&null!==t&&"object"==typeof t&&(n=t,t=void 0),wf&&Buffer.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));const r=JSON.parse(e,t);if(null===r||"object"!=typeof r)return r;const i=n&&n.protoAction||"error",o=n&&n.constructorAction||"error";if("ignore"===i&&"ignore"===o)return r;if("ignore"!==i&&"ignore"!==o){if(!1===bf.test(e)&&!1===Ef.test(e))return r}else if("ignore"!==i&&"ignore"===o){if(!1===bf.test(e))return r}else if(!1===Ef.test(e))return r;return Tf(r,{protoAction:i,constructorAction:o,safe:n&&n.safe})}function Tf(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let i=[e];for(;i.length;){const e=i;i=[];for(const o of e){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(!0===r)return null;if("error"===t)throw new SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if("ignore"!==n&&Object.prototype.hasOwnProperty.call(o,"constructor")&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(!0===r)return null;if("error"===n)throw new SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(const e in o){const t=o[e];t&&"object"==typeof t&&i.push(t)}}}return e}function Mf(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return kf(e,t,n)}finally{Error.stackTraceLimit=r}}xf.exports=Mf,xf.exports.default=Mf,xf.exports.parse=Mf,xf.exports.safeParse=function(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return kf(e,t,{safe:!0})}catch(e){return null}finally{Error.stackTraceLimit=n}},xf.exports.scan=Tf;Object.defineProperty;Error;TransformStream;var Sf=(({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=((e,t=21)=>(n=t)=>{let r="",i=0|n;for(;i--;)r+=e[Math.random()*e.length|0];return r})(n,t);if(null==e)return i;if(n.includes(r))throw new cf({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return t=>`${e}${r}${i(t)}`})(),Cf=Symbol.for("vercel.ai.validator");function Af(e){return function(e){return"object"==typeof e&&null!==e&&Cf in e&&!0===e[Cf]&&"validate"in e}(e)?e:(t=e,n=e=>{const n=t.safeParse(e);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}},{[Cf]:!0,validate:n});var t,n}function If({text:e,schema:t}){try{const n=xf.exports.parse(e);if(null==t)return{success:!0,value:n,rawValue:n};const r=function({value:e,schema:t}){const n=Af(t);try{if(null==n.validate)return{success:!0,value:e};const t=n.validate(e);return t.success?t:{success:!1,error:_f.wrap({value:e,cause:t.error})}}catch(t){return{success:!1,error:_f.wrap({value:e,cause:t})}}}({value:n,schema:t});return r.success?{...r,rawValue:n}:r}catch(t){return{success:!1,error:pf.isInstance(t)?t:new pf({text:e,cause:t})}}}var Rf={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Lf={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},zf={code:"4",name:"assistant_message",parse:e=>{if(!(null!=e&&"object"==typeof e&&"id"in e&&"role"in e&&"content"in e&&"string"==typeof e.id&&"string"==typeof e.role&&"assistant"===e.role&&Array.isArray(e.content)&&e.content.every((e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value))))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},Pf={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},Of={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}};function Df(e){const t=["ROOT"];let n=-1,r=null;function i(e,i,o){switch(e){case'"':n=i,t.pop(),t.push(o),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=i,r=i,t.pop(),t.push(o),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(o),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=i,t.pop(),t.push(o),t.push("INSIDE_NUMBER");break;case"{":n=i,t.pop(),t.push(o),t.push("INSIDE_OBJECT_START");break;case"[":n=i,t.pop(),t.push(o),t.push("INSIDE_ARRAY_START")}}function o(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function a(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(let s=0;s<e.length;s++){const l=e[s];switch(t[t.length-1]){case"ROOT":i(l,s,"FINISH");break;case"INSIDE_OBJECT_START":switch(l){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=s,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":if('"'===l)t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"INSIDE_OBJECT_KEY":if('"'===l)t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break;case"INSIDE_OBJECT_AFTER_KEY":if(":"===l)t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break;case"INSIDE_OBJECT_BEFORE_VALUE":i(l,s,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":o(l,s);break;case"INSIDE_STRING":switch(l){case'"':t.pop(),n=s;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=s}break;case"INSIDE_ARRAY_START":if("]"===l)n=s,t.pop();else n=s,i(l,s,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_ARRAY_AFTER_VALUE":switch(l){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=s,t.pop();break;default:n=s}break;case"INSIDE_ARRAY_AFTER_COMMA":i(l,s,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),n=s;break;case"INSIDE_NUMBER":switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=s;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&a(l,s),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&o(l,s);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&o(l,s);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&a(l,s);break;default:t.pop()}break;case"INSIDE_LITERAL":{const i=e.substring(r,s+1);"false".startsWith(i)||"true".startsWith(i)||"null".startsWith(i)?n=s:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?o(l,s):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&a(l,s));break}}}let s=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--){switch(t[n]){case"INSIDE_STRING":s+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":s+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":s+="]";break;case"INSIDE_LITERAL":{const t=e.substring(r,e.length);"true".startsWith(t)?s+="true".slice(t.length):"false".startsWith(t)?s+="false".slice(t.length):"null".startsWith(t)&&(s+="null".slice(t.length))}}}return s}[Rf,Lf,zf,Pf,Of].map((e=>e.code));var Bf=[{code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},{code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},{code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},{code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},{code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},{code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},{code:"b",name:"tool_call_streaming_start",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName)throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},{code:"c",name:"tool_call_delta",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("argsTextDelta"in e)||"string"!=typeof e.argsTextDelta)throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},{code:"d",name:"finish_message",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:Number.NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},{code:"e",name:"finish_step",parse:e=>{if(null==e||"object"!=typeof e||!("finishReason"in e)||"string"!=typeof e.finishReason)throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:"number"==typeof e.usage.promptTokens?e.usage.promptTokens:Number.NaN,completionTokens:"number"==typeof e.usage.completionTokens?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&"boolean"==typeof e.isContinued&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},{code:"f",name:"start_step",parse:e=>{if(null==e||"object"!=typeof e||!("messageId"in e)||"string"!=typeof e.messageId)throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},{code:"g",name:"reasoning",parse:e=>{if("string"!=typeof e)throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},{code:"h",name:"source",parse:e=>{if(null==e||"object"!=typeof e)throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},{code:"i",name:"redacted_reasoning",parse:e=>{if(null==e||"object"!=typeof e||!("data"in e)||"string"!=typeof e.data)throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},{code:"j",name:"reasoning_signature",parse:e=>{if(null==e||"object"!=typeof e||!("signature"in e)||"string"!=typeof e.signature)throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}}],Ff=Object.fromEntries(Bf.map((e=>[e.code,e])));Object.fromEntries(Bf.map((e=>[e.name,e.code])));var jf=Bf.map((e=>e.code)),Nf=e=>{const t=e.indexOf(":");if(-1===t)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!jf.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,i=e.slice(t+1),o=JSON.parse(i);return Ff[r].parse(o)},Vf="\n".charCodeAt(0);function Uf(e,t){const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return e.length=0,n}async function Hf({stream:e,update:t,onToolCall:n,onFinish:r,generateId:i=Sf,getCurrentDate:o=(()=>new Date),lastMessage:a}){var s,l;const c="assistant"===(null==a?void 0:a.role);let u=c?1+(null!=(l=null==(s=a.toolInvocations)?void 0:s.reduce(((e,t)=>{var n;return Math.max(e,null!=(n=t.step)?n:0)}),0))?l:0):0;const h=c?structuredClone(a):{id:i(),createdAt:o(),role:"assistant",content:"",parts:[]};let d,f,p;function m(e,t){const n=h.parts.find((t=>"tool-invocation"===t.type&&t.toolInvocation.toolCallId===e));null!=n?n.toolInvocation=t:h.parts.push({type:"tool-invocation",toolInvocation:t})}const g=[];let v=c?null==a?void 0:a.annotations:void 0;const y={};let _={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},x="unknown";function w(){const e=[...g];(null==v?void 0:v.length)&&(h.annotations=v);const n={...structuredClone(h),revisionId:i()};t({message:n,data:e,replaceLastMessage:c})}await async function({stream:e,onTextPart:t,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:i,onSourcePart:o,onDataPart:a,onErrorPart:s,onToolCallStreamingStartPart:l,onToolCallDeltaPart:c,onToolCallPart:u,onToolResultPart:h,onMessageAnnotationsPart:d,onFinishMessagePart:f,onFinishStepPart:p,onStartStepPart:m}){const g=e.getReader(),v=new TextDecoder,y=[];let _=0;for(;;){const{value:e}=await g.read();if(e&&(y.push(e),_+=e.length,e[e.length-1]!==Vf))continue;if(0===y.length)break;const x=Uf(y,_);_=0;const w=v.decode(x,{stream:!0}).split("\n").filter((e=>""!==e)).map(Nf);for(const{type:e,value:g}of w)switch(e){case"text":await(null==t?void 0:t(g));break;case"reasoning":await(null==n?void 0:n(g));break;case"reasoning_signature":await(null==r?void 0:r(g));break;case"redacted_reasoning":await(null==i?void 0:i(g));break;case"source":await(null==o?void 0:o(g));break;case"data":await(null==a?void 0:a(g));break;case"error":await(null==s?void 0:s(g));break;case"message_annotations":await(null==d?void 0:d(g));break;case"tool_call_streaming_start":await(null==l?void 0:l(g));break;case"tool_call_delta":await(null==c?void 0:c(g));break;case"tool_call":await(null==u?void 0:u(g));break;case"tool_result":await(null==h?void 0:h(g));break;case"finish_message":await(null==f?void 0:f(g));break;case"finish_step":await(null==p?void 0:p(g));break;case"start_step":await(null==m?void 0:m(g));break;default:throw new Error(`Unknown stream part type: ${e}`)}}}({stream:e,onTextPart(e){null==d?(d={type:"text",text:e},h.parts.push(d)):d.text+=e,h.content+=e,w()},onReasoningPart(e){var t;null==p?(p={type:"text",text:e},null!=f&&f.details.push(p)):p.text+=e,null==f?(f={type:"reasoning",reasoning:e,details:[p]},h.parts.push(f)):f.reasoning+=e,h.reasoning=(null!=(t=h.reasoning)?t:"")+e,w()},onReasoningSignaturePart(e){null!=p&&(p.signature=e.signature)},onRedactedReasoningPart(e){null==f&&(f={type:"reasoning",reasoning:"",details:[]},h.parts.push(f)),f.details.push({type:"redacted",data:e.data}),p=void 0,w()},onSourcePart(e){h.parts.push({type:"source",source:e}),w()},onToolCallStreamingStartPart(e){null==h.toolInvocations&&(h.toolInvocations=[]),y[e.toolCallId]={text:"",step:u,toolName:e.toolName,index:h.toolInvocations.length};const t={state:"partial-call",step:u,toolCallId:e.toolCallId,toolName:e.toolName,args:void 0};h.toolInvocations.push(t),m(e.toolCallId,t),w()},onToolCallDeltaPart(e){const t=y[e.toolCallId];t.text+=e.argsTextDelta;const{value:n}=function(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=If({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=If({text:Df(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}(t.text),r={state:"partial-call",step:t.step,toolCallId:e.toolCallId,toolName:t.toolName,args:n};h.toolInvocations[t.index]=r,m(e.toolCallId,r),w()},async onToolCallPart(e){const t={state:"call",step:u,...e};if(null!=y[e.toolCallId]?h.toolInvocations[y[e.toolCallId].index]=t:(null==h.toolInvocations&&(h.toolInvocations=[]),h.toolInvocations.push(t)),m(e.toolCallId,t),w(),n){const t=await n({toolCall:e});if(null!=t){const n={state:"result",step:u,...e,result:t};h.toolInvocations[h.toolInvocations.length-1]=n,m(e.toolCallId,n),w()}}},onToolResultPart(e){const t=h.toolInvocations;if(null==t)throw new Error("tool_result must be preceded by a tool_call");const n=t.findIndex((t=>t.toolCallId===e.toolCallId));if(-1===n)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");const r={...t[n],state:"result",...e};t[n]=r,m(e.toolCallId,r),w()},onDataPart(e){g.push(...e),w()},onMessageAnnotationsPart(e){null==v?v=[...e]:v.push(...e),w()},onFinishStepPart(e){u+=1,d=e.isContinued?d:void 0,f=void 0,p=void 0},onStartStepPart(e){c||(h.id=e.messageId)},onFinishMessagePart(e){x=e.finishReason,null!=e.usage&&(_=function({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}(e.usage))},onErrorPart(e){throw new Error(e)}}),null==r||r({message:h,finishReason:x,usage:_})}async function Wf({stream:e,update:t,onFinish:n,getCurrentDate:r=(()=>new Date),generateId:i=Sf}){const o={type:"text",text:""},a={id:i(),createdAt:r(),role:"assistant",content:"",parts:[o]};await async function({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:e,value:r}=await n.read();if(e)break;await t(r)}}({stream:e,onTextPart:e=>{a.content+=e,o.text+=e,t({message:{...a},data:[],replaceLastMessage:!1})}}),null==n||n(a,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}var $f=()=>fetch;function Gf(e){return null==e?void 0:e.reduce(((e,t)=>{var n;return Math.max(e,null!=(n=t.step)?n:0)}),0)}function qf(e){var t;return null!=(t=e.parts)?t:[...e.toolInvocations?e.toolInvocations.map((e=>({type:"tool-invocation",toolInvocation:e}))):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function Zf(e){return e.map((e=>({...e,parts:qf(e)})))}function Xf(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e&&"object"!=typeof t)return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Xf(e[n],t[n]))return!1;return!0}const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){if(!r.includes(i))return!1;if(!Xf(e[i],t[i]))return!1}return!0}async function Yf(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map((async e=>{const{name:t,type:n}=e,r=await new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)}));return{name:t,contentType:n,url:r}})));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}function Kf(e){return"assistant"===e.role&&e.parts.filter((e=>"tool-invocation"===e.type)).every((e=>"result"in e.toolInvocation))}var Jf={exports:{}},Qf={},ep=s.default;var tp="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},np=ep.useState,rp=ep.useEffect,ip=ep.useLayoutEffect,op=ep.useDebugValue;function ap(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tp(e,n)}catch(e){return!0}}var sp="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=np({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return ip((function(){i.value=n,i.getSnapshot=t,ap(i)&&o({inst:i})}),[e,n,t]),rp((function(){return ap(i)&&o({inst:i}),e((function(){ap(i)&&o({inst:i})}))}),[e]),op(n),n};Qf.useSyncExternalStore=void 0!==ep.useSyncExternalStore?ep.useSyncExternalStore:sp,function(e){e.exports=Qf}(Jf);var lp=Object.prototype.hasOwnProperty;const cp=new WeakMap,up=()=>{},hp=up(),dp=Object,fp=e=>e===hp,pp=e=>"function"==typeof e,mp=(e,t)=>({...e,...t}),gp=e=>pp(e.then),vp={},yp={},_p="undefined",xp=typeof window!=_p,wp=typeof document!=_p,bp=xp&&"Deno"in window,Ep=(e,t)=>{const n=cp.get(e);return[()=>!fp(t)&&e.get(t)||vp,r=>{if(!fp(t)){const i=e.get(t);t in yp||(yp[t]=i),n[5](t,mp(i,r),i||vp)}},n[6],()=>!fp(t)&&t in yp?yp[t]:!fp(t)&&e.get(t)||vp]};let kp=!0;const[Tp,Mp]=xp&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[up,up],Sp={isOnline:()=>kp,isVisible:()=>{const e=wp&&document.visibilityState;return fp(e)||"hidden"!==e}},Cp={initFocus:e=>(wp&&document.addEventListener("visibilitychange",e),Tp("focus",e),()=>{wp&&document.removeEventListener("visibilitychange",e),Mp("focus",e)}),initReconnect:e=>{const t=()=>{kp=!0,e()},n=()=>{kp=!1};return Tp("online",t),Tp("offline",n),()=>{Mp("online",t),Mp("offline",n)}}},Ap=!s.default.useId,Ip=!xp||bp,Rp=e=>xp&&typeof window.requestAnimationFrame!=_p?window.requestAnimationFrame(e):setTimeout(e,1),Lp=Ip?e.useEffect:e.useLayoutEffect,zp="undefined"!=typeof navigator&&navigator.connection,Pp=!Ip&&zp&&(["slow-2g","2g"].includes(zp.effectiveType)||zp.saveData),Op=new WeakMap,Dp=(e,t)=>dp.prototype.toString.call(e)===`[object ${t}]`;let Bp=0;const Fp=e=>{const t=typeof e,n=Dp(e,"Date"),r=Dp(e,"RegExp"),i=Dp(e,"Object");let o,a;if(dp(e)!==e||n||r)o=n?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=Op.get(e),o)return o;if(o=++Bp+"~",Op.set(e,o),Array.isArray(e)){for(o="@",a=0;a<e.length;a++)o+=Fp(e[a])+",";Op.set(e,o)}if(i){o="#";const t=dp.keys(e).sort();for(;!fp(a=t.pop());)fp(e[a])||(o+=a+":"+Fp(e[a])+",");Op.set(e,o)}}return o},jp=e=>{if(pp(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Fp(e):"",t]};let Np=0;const Vp=()=>++Np;async function Up(...e){const[t,n,r,i]=e,o=mp({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let a=o.populateCache;const s=o.rollbackOnError;let l=o.optimisticData;const c=o.throwOnError;if(pp(n)){const e=n,r=[],i=t.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(u))}return u(n);async function u(n){const[i]=jp(n);if(!i)return;const[u,h]=Ep(t,i),[d,f,p,m]=cp.get(t),g=()=>{const e=d[i];return(pp(o.revalidate)?o.revalidate(u().data,n):!1!==o.revalidate)&&(delete p[i],delete m[i],e&&e[0])?e[0](2).then((()=>u().data)):u().data};if(e.length<3)return g();let v,y=r;const _=Vp();f[i]=[_,0];const x=!fp(l),w=u(),b=w.data,E=w._c,k=fp(E)?b:E;if(x&&(l=pp(l)?l(k,b):l,h({data:l,_c:k})),pp(y))try{y=y(k)}catch(e){v=e}if(y&&gp(y)){if(y=await y.catch((e=>{v=e})),_!==f[i][0]){if(v)throw v;return y}v&&x&&(e=>"function"==typeof s?s(e):!1!==s)(v)&&(a=!0,h({data:k,_c:hp}))}if(a&&!v)if(pp(a)){const e=a(y,k);h({data:e,error:hp,_c:hp})}else h({data:y,error:hp,_c:hp});if(f[i][1]=Vp(),Promise.resolve(g()).then((()=>{h({_c:hp})})),!v)return y;if(c)throw v}}const Hp=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Wp=(e,t)=>{if(!cp.has(e)){const n=mp(Cp,t),r=Object.create(null),i=Up.bind(hp,e);let o=up;const a=Object.create(null),s=(e,t)=>{const n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},l=(t,n,r)=>{e.set(t,n);const i=a[t];if(i)for(const e of i)e(n,r)},c=()=>{if(!cp.has(e)&&(cp.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,s]),!Ip)){const t=n.initFocus(setTimeout.bind(hp,Hp.bind(hp,r,0))),i=n.initReconnect(setTimeout.bind(hp,Hp.bind(hp,r,1)));o=()=>{t&&t(),i&&i(),cp.delete(e)}}};return c(),[e,i,c,o]}return[e,cp.get(e)[4]]},$p=function e(t,n){var r,i;if(t===n)return!0;if(t&&n&&(r=t.constructor)===n.constructor){if(r===Date)return t.getTime()===n.getTime();if(r===RegExp)return t.toString()===n.toString();if(r===Array){if((i=t.length)===n.length)for(;i--&&e(t[i],n[i]););return-1===i}if(!r||"object"==typeof t){for(r in i=0,t){if(lp.call(t,r)&&++i&&!lp.call(n,r))return!1;if(!(r in n)||!e(t[r],n[r]))return!1}return Object.keys(n).length===i}}return t!=t&&n!=n},[Gp,qp]=Wp(new Map),Zp=mp({onLoadingSlow:up,onSuccess:up,onError:up,onErrorRetry:(e,t,n,r,i)=>{const o=n.errorRetryCount,a=i.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!fp(o)&&a>o||setTimeout(r,s,i)},onDiscarded:up,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Pp?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Pp?5e3:3e3,compare:$p,isPaused:()=>!1,cache:Gp,mutate:qp,fallback:{}},Sp),Xp=(e,t)=>{const n=mp(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:a}=t;r&&o&&(n.use=r.concat(o)),i&&a&&(n.fallback=mp(i,a))}return n},Yp=e.createContext({}),Kp=xp&&window.__SWR_DEVTOOLS_USE__,Jp=Kp?window.__SWR_DEVTOOLS_USE__:[],Qp=Jp.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const[r]=jp(t),[,,,i]=cp.get(Gp);if(r.startsWith("$inf$"))return n(...e);const o=i[r];return fp(o)?n(...e):(delete i[r],o)}),r)));Kp&&(window.__SWR_DEVTOOLS_REACT__=s.default);const em=s.default.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})),e}}),tm={dedupe:!0};dp.defineProperty((t=>{const{value:n}=t,r=e.useContext(Yp),i=pp(n),o=e.useMemo((()=>i?n(r):n),[i,r,n]),a=e.useMemo((()=>i?o:Xp(r,o)),[i,r,o]),s=o&&o.provider,l=e.useRef(hp);s&&!l.current&&(l.current=Wp(s(a.cache||Gp),o));const c=l.current;return c&&(a.cache=c[0],a.mutate=c[1]),Lp((()=>{if(c)return c[2]&&c[2](),c[3]}),[]),e.createElement(Yp.Provider,mp(t,{value:a}))}),"defaultValue",{value:Zp});const nm=(rm=(t,n,r)=>{const{cache:i,compare:o,suspense:a,fallbackData:s,revalidateOnMount:l,revalidateIfStale:c,refreshInterval:u,refreshWhenHidden:h,refreshWhenOffline:d,keepPreviousData:f}=r,[p,m,g,v]=cp.get(i),[y,_]=jp(t),x=e.useRef(!1),w=e.useRef(!1),b=e.useRef(y),E=e.useRef(n),k=e.useRef(r),T=()=>k.current,M=()=>T().isVisible()&&T().isOnline(),[S,C,A,I]=Ep(i,y),R=e.useRef({}).current,L=fp(s)?fp(r.fallback)?hp:r.fallback[y]:s,z=(e,t)=>{for(const n in R){const r=n;if("data"===r){if(!o(e[r],t[r])){if(!fp(e[r]))return!1;if(!o(U,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},P=e.useMemo((()=>{const e=!!y&&!!n&&(fp(l)?!T().isPaused()&&!a&&!1!==c:l),t=t=>{const n=mp(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=S(),i=I(),o=t(r),s=r===i?o:t(i);let u=o;return[()=>{const e=t(S());return z(e,u)?(u.data=e.data,u.isLoading=e.isLoading,u.isValidating=e.isValidating,u.error=e.error,u):(u=e,e)},()=>s]}),[i,y]),O=Jf.exports.useSyncExternalStore(e.useCallback((e=>A(y,((t,n)=>{z(n,t)||e()}))),[i,y]),P[0],P[1]),D=!x.current,B=p[y]&&p[y].length>0,F=O.data,j=fp(F)?L&&gp(L)?em(L):L:F,N=O.error,V=e.useRef(j),U=f?fp(F)?fp(V.current)?j:V.current:F:j,H=!(B&&!fp(N))&&(D&&!fp(l)?l:!T().isPaused()&&(a?!fp(j)&&c:fp(j)||c)),W=!!(y&&n&&D&&H),$=fp(O.isValidating)?W:O.isValidating,G=fp(O.isLoading)?W:O.isLoading,q=e.useCallback((async e=>{const t=E.current;if(!y||!t||w.current||T().isPaused())return!1;let n,i,a=!0;const s=e||{},l=!g[y]||!s.dedupe,c=()=>Ap?!w.current&&y===b.current&&x.current:y===b.current,u={isValidating:!1,isLoading:!1},h=()=>{C(u)},d=()=>{const e=g[y];e&&e[1]===i&&delete g[y]},f={isValidating:!0};fp(S().data)&&(f.isLoading=!0);try{if(l&&(C(f),r.loadingTimeout&&fp(S().data)&&setTimeout((()=>{a&&c()&&T().onLoadingSlow(y,r)}),r.loadingTimeout),g[y]=[t(_),Vp()]),[n,i]=g[y],n=await n,l&&setTimeout(d,r.dedupingInterval),!g[y]||g[y][1]!==i)return l&&c()&&T().onDiscarded(y),!1;u.error=hp;const e=m[y];if(!fp(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return h(),l&&c()&&T().onDiscarded(y),!1;const s=S().data;u.data=o(s,n)?s:n,l&&c()&&T().onSuccess(n,y,r)}catch(e){d();const t=T(),{shouldRetryOnError:n}=t;t.isPaused()||(u.error=e,l&&c()&&(t.onError(e,y,t),(!0===n||pp(n)&&n(e))&&(T().revalidateOnFocus&&T().revalidateOnReconnect&&!M()||t.onErrorRetry(e,y,t,(e=>{const t=p[y];t&&t[0]&&t[0](3,e)}),{retryCount:(s.retryCount||0)+1,dedupe:!0}))))}return a=!1,h(),!0}),[y,i]),Z=e.useCallback(((...e)=>Up(i,b.current,...e)),[]);if(Lp((()=>{E.current=n,k.current=r,fp(F)||(V.current=F)})),Lp((()=>{if(!y)return;const e=q.bind(hp,tm);let t=0;if(T().revalidateOnFocus){const e=Date.now();t=e+T().focusThrottleInterval}const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(y,p,((n,r={})=>{if(0==n){const n=Date.now();T().revalidateOnFocus&&n>t&&M()&&(t=n+T().focusThrottleInterval,e())}else if(1==n)T().revalidateOnReconnect&&M()&&e();else{if(2==n)return q();if(3==n)return q(r)}}));return w.current=!1,b.current=y,x.current=!0,C({_k:_}),H&&(fp(j)||Ip?e():Rp(e)),()=>{w.current=!0,n()}}),[y]),Lp((()=>{let e;function t(){const t=pp(u)?u(S().data):u;t&&-1!==e&&(e=setTimeout(n,t))}function n(){S().error||!h&&!T().isVisible()||!d&&!T().isOnline()?t():q(tm).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[u,h,d,y]),e.useDebugValue(U),a&&fp(j)&&y){if(!Ap&&Ip)throw new Error("Fallback data is required when using Suspense in SSR.");E.current=n,k.current=r,w.current=!1;const e=v[y];if(!fp(e)){const t=Z(e);em(t)}if(!fp(N))throw N;{const e=q(tm);fp(U)||(e.status="fulfilled",e.value=!0),em(e)}}return{mutate:Z,get data(){return R.data=!0,U},get error(){return R.error=!0,N},get isValidating(){return R.isValidating=!0,$},get isLoading(){return R.isLoading=!0,G}}},function(...t){const n=mp(Zp,e.useContext(Yp)),[r,i,o]=(e=>pp(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(t),a=Xp(n,o);let s=rm;const{use:l}=a,c=(l||[]).concat(Qp);for(let e=c.length;e--;)s=c[e](s);return s(r,i||a.fetcher||null,a)});var rm;var im=function(e,t){if("function"!=typeof e)throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);const o=Date.now(),a=t-(o-r);a<=0?(r=o,e.apply(this,i)):n=setTimeout((()=>{r=Date.now(),e.apply(this,i)}),a)}};function om(e,t){return null!=t?im(e,t):e}function am(t){const[n,r]=e.useState(t);return e.useEffect((()=>{Xf(t,n)||r(t)}),[t,n]),n}var sm=function({api:t="/api/chat",id:n,initialMessages:r,initialInput:i="",sendExtraMessageFields:o,onToolCall:a,experimental_prepareRequestBody:s,maxSteps:l=1,streamProtocol:c="data",onResponse:u,onFinish:h,onError:d,credentials:f,headers:p,body:m,generateId:g=Sf,fetch:v,keepLastMessageOnError:y=!0,experimental_throttle:_}={}){const[x]=e.useState(g),w=null!=n?n:x,b="string"==typeof t?[t,w]:w,E=am(null!=r?r:[]),k=e.useMemo((()=>Zf(E)),[E]),{data:T,mutate:M}=nm([b,"messages"],null,{fallbackData:k}),S=e.useRef(T||[]);e.useEffect((()=>{S.current=T||[]}),[T]);const{data:C,mutate:A}=nm([b,"streamData"],null),I=e.useRef(C);e.useEffect((()=>{I.current=C}),[C]);const{data:R="ready",mutate:L}=nm([b,"status"],null),{data:z,mutate:P}=nm([b,"error"],null),O=e.useRef(null),D=e.useRef({credentials:f,headers:p,body:m});e.useEffect((()=>{D.current={credentials:f,headers:p,body:m}}),[f,p,m]);const B=e.useCallback((async e=>{var n,r;L("submitted"),P(void 0);const i=Zf(e.messages),f=i.length,p=Gf(null==(n=i[i.length-1])?void 0:n.toolInvocations);try{const n=new AbortController;O.current=n;const l=om(M,_),d=om(A,_),f=S.current;l(i,!1);const p=o?i:i.map((({role:e,content:t,experimental_attachments:n,data:r,annotations:i,toolInvocations:o,parts:a})=>({role:e,content:t,...void 0!==n&&{experimental_attachments:n},...void 0!==r&&{data:r},...void 0!==i&&{annotations:i},...void 0!==o&&{toolInvocations:o},...void 0!==a&&{parts:a}}))),m=I.current;await async function({api:e,body:t,streamProtocol:n="data",credentials:r,headers:i,abortController:o,restoreMessagesOnFailure:a,onResponse:s,onUpdate:l,onFinish:c,onToolCall:u,generateId:h,fetch:d=$f(),lastMessage:f}){var p,m;const g=await d(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...i},signal:null==(p=null==o?void 0:o())?void 0:p.signal,credentials:r}).catch((e=>{throw a(),e}));if(s)try{await s(g)}catch(e){throw e}if(!g.ok)throw a(),new Error(null!=(m=await g.text())?m:"Failed to fetch the chat response.");if(!g.body)throw new Error("The response body is empty.");switch(n){case"text":return void await Wf({stream:g.body,update:l,onFinish:c,generateId:h});case"data":return void await Hf({stream:g.body,update:l,lastMessage:f,onToolCall:u,onFinish({message:e,finishReason:t,usage:n}){c&&null!=e&&c(e,{usage:n,finishReason:t})},generateId:h});default:throw new Error(`Unknown stream protocol: ${n}`)}}({api:t,body:null!=(r=null==s?void 0:s({id:w,messages:i,requestData:e.data,requestBody:e.body}))?r:{id:w,messages:p,data:e.data,...D.current.body,...e.body},streamProtocol:c,credentials:D.current.credentials,headers:{...D.current.headers,...e.headers},abortController:()=>O.current,restoreMessagesOnFailure(){y||l(f,!1)},onResponse:u,onUpdate({message:e,data:t,replaceLastMessage:n}){L("streaming"),l([...n?i.slice(0,i.length-1):i,e],!1),(null==t?void 0:t.length)&&d([...null!=m?m:[],...t],!1)},onToolCall:a,onFinish:h,generateId:g,fetch:v,lastMessage:i[i.length-1]}),O.current=null,L("ready")}catch(e){if("AbortError"===e.name)return O.current=null,L("ready"),null;d&&e instanceof Error&&d(e),P(e),L("error")}const m=S.current;(function({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:n,messages:r}){var i;const o=r[r.length-1];return n>1&&null!=o&&(r.length>t||Gf(o.toolInvocations)!==e)&&Kf(o)&&!function(e){let t=!1;return e.parts.forEach((e=>{"text"===e.type&&(t=!0),"tool-invocation"===e.type&&(t=!1)})),t}(o)&&(null!=(i=Gf(o.toolInvocations))?i:0)<n})({originalMaxToolInvocationStep:p,originalMessageCount:f,maxSteps:l,messages:m})&&await B({messages:m})}),[M,L,t,D,u,h,d,P,A,I,c,o,s,a,l,S,O,g,v,y,_,w]),F=e.useCallback((async(e,{data:t,headers:n,body:r,experimental_attachments:i}={})=>{var o,a;const s=await Yf(i),l=S.current.concat({...e,id:null!=(o=e.id)?o:g(),createdAt:null!=(a=e.createdAt)?a:new Date,experimental_attachments:s.length>0?s:void 0,parts:qf(e)});return B({messages:l,headers:n,body:r,data:t})}),[B,g]),j=e.useCallback((async({data:e,headers:t,body:n}={})=>{const r=S.current;if(0===r.length)return null;const i=r[r.length-1];return B({messages:"assistant"===i.role?r.slice(0,-1):r,headers:t,body:n,data:e})}),[B]),N=e.useCallback((()=>{O.current&&(O.current.abort(),O.current=null)}),[]),V=e.useCallback((e=>{"function"==typeof e&&(e=e(S.current));const t=Zf(e);M(t,!1),S.current=t}),[M]),U=e.useCallback((e=>{"function"==typeof e&&(e=e(I.current)),A(e,!1),I.current=e}),[A]),[H,W]=e.useState(i),$=e.useCallback((async(e,t={},n)=>{var r;if(null==(r=null==e?void 0:e.preventDefault)||r.call(e),!H&&!t.allowEmptySubmit)return;n&&(D.current={...D.current,...n});const i=await Yf(t.experimental_attachments),o={messages:S.current.concat({id:g(),createdAt:new Date,role:"user",content:H,experimental_attachments:i.length>0?i:void 0,parts:[{type:"text",text:H}]}),headers:t.headers,body:t.body,data:t.data};B(o),W("")}),[H,g,B]),G=e.useCallback((({toolCallId:e,result:t})=>{const n=S.current;!function({messages:e,toolCallId:t,toolResult:n}){var r;const i=e[e.length-1],o=i.parts.find((e=>"tool-invocation"===e.type&&e.toolInvocation.toolCallId===t));if(null==o)return;const a={...o.toolInvocation,state:"result",result:n};o.toolInvocation=a,i.toolInvocations=null==(r=i.toolInvocations)?void 0:r.map((e=>e.toolCallId===t?a:e))}({messages:n,toolCallId:e,toolResult:t}),M(n,!1);Kf(n[n.length-1])&&B({messages:n})}),[M,B]);return{messages:null!=T?T:[],id:w,setMessages:V,data:C,setData:U,error:z,append:F,reload:j,stop:N,input:H,setInput:W,handleInputChange:e=>{W(e.target.value)},handleSubmit:$,isLoading:"submitted"===R||"streaming"===R,status:R,addToolResult:G}};a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M12 14l9-5-9-5-9 5 9 5z"}),a.createElement("path",{d:"M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 11l3-3m0 0l3 3m-3-3v8m0-13a9 9 0 110 18 9 9 0 010-18z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 17l-4 4m0 0l-4-4m4 4V3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16l-4-4m0 0l4-4m-4 4h18"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7l4-4m0 0l4 4m-4-4v18"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 5l7 7m0 0l-7 7m7-7H3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 13l-5 5m0 0l-5-5m5 5V6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 17l-5-5m0 0l5-5m-5 5h12"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5m0 0l-5 5m5-5H6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 11l5-5m0 0l5 5m-5-5v12"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10l7-7m0 0l7 7m-7-7v18"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M3 12l6.414 6.414a2 2 0 001.414.586H19a2 2 0 002-2V7a2 2 0 00-2-2h-8.172a2 2 0 00-1.414.586L3 12z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 4v12l-4-2-4 2V4M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 15.546c-.523 0-1.046.151-1.5.454a2.704 2.704 0 01-3 0 2.704 2.704 0 00-3 0 2.704 2.704 0 01-3 0 2.704 2.704 0 00-3 0 2.704 2.704 0 01-3 0 2.701 2.701 0 00-1.5-.454M9 6v2m3-2v2m3-2v2M9 3h.01M12 3h.01M15 3h.01M21 21v-7a2 2 0 00-2-2H5a2 2 0 00-2 2v7h18zm-3-9v-2a2 2 0 00-2-2H8a2 2 0 00-2 2v2h12z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 13l-7 7-7-7m14-8l-7 7-7-7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 5l7 7-7 7M5 5l7 7-7 7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 11l7-7 7 7M5 19l7-7 7 7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 10l-2 1m0 0l-2-1m2 1v2.5M20 7l-2 1m2-1l-2-1m2 1v2.5M14 4l-2-1-2 1M4 7l2-1M4 7l2 1M4 7v2.5M12 21l-2-1m2 1l2-1m-2 1v-2.5M6 18l-2-1v-2.5M18 18l2-1v-2.5"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 11V9a2 2 0 00-2-2m2 4v4a2 2 0 104 0v-1m-4-3H9m2 0h4m6 1a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.121 15.536c-1.171 1.952-3.07 1.952-4.242 0-1.172-1.953-1.172-5.119 0-7.072 1.171-1.952 3.07-1.952 4.242 0M8 10.5h4m-4 3h4m9-1.5a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 9a2 2 0 10-4 0v5a2 2 0 01-2 2h6m-6-4h4m8 0a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 8h6m-5 0a3 3 0 110 6H9l3 3m-3-6h6m6 1a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 8l3 5m0 0l3-5m-3 5v4m-3-5h6m-6 3h6m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.933 12.8a1 1 0 000-1.6L6.6 7.2A1 1 0 005 8v8a1 1 0 001.6.8l5.333-4zM19.933 12.8a1 1 0 000-1.6l-5.333-4A1 1 0 0013 8v8a1 1 0 001.6.8l5.333-4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 20h16a1 1 0 001-1V5a1 1 0 00-1-1H4a1 1 0 00-1 1v14a1 1 0 001 1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 16.121A3 3 0 1012.015 11L11 14H9c0 .768.293 1.536.879 2.121z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10v6m0 0l-3-3m3 3l3-3M3 17V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 13h6M3 17V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 11.5V14m0-2.5v-6a1.5 1.5 0 113 0m-3 6a1.5 1.5 0 00-3 0v2a7.5 7.5 0 0015 0v-5a1.5 1.5 0 00-3 0m-6-3V11m0-5.5v-1a1.5 1.5 0 013 0v1m0 0V11m0-5.5a1.5 1.5 0 013 0v3m0 0V11"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 4H6a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-2m-4-1v8m0 0l3-3m-3 3L9 8m-5 5h2.586a1 1 0 01.707.293l2.414 2.414a1 1 0 00.707.293h3.172a1 1 0 00.707-.293l2.414-2.414a1 1 0 01.707-.293H20"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 14v3m4-3v3m4-3v3M3 21h18M3 10h18M3 7l9-4 9 4M4 10h16v11H4V10z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 19v-8.93a2 2 0 01.89-1.664l7-4.666a2 2 0 012.22 0l7 4.666A2 2 0 0121 10.07V19M3 19a2 2 0 002 2h14a2 2 0 002-2M3 19l6.75-4.5M21 19l-6.75-4.5M3 10l6.75 4.5M21 10l-6.75 4.5m0 0l-1.14.76a2 2 0 01-2.22 0l-1.14-.76"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}))}));const lm=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"}))}));a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h8m-8 6h16"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16m-7 6h7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 8h16M4 16h16"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 12H6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 12H4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 3l-6 6m0 0V4m0 5h5M5 3a2 2 0 00-2 2v1c0 8.284 6.716 15 15 15h1a2 2 0 002-2v-3.28a1 1 0 00-.684-.948l-4.493-1.498a1 1 0 00-1.21.502l-1.13 2.257a11.042 11.042 0 01-5.516-5.517l2.257-1.128a1 1 0 00.502-1.21L9.228 3.683A1 1 0 008.279 3H5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 8l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2M5 3a2 2 0 00-2 2v1c0 8.284 6.716 15 15 15h1a2 2 0 002-2v-3.28a1 1 0 00-.684-.948l-4.493-1.498a1 1 0 00-1.21.502l-1.13 2.257a11.042 11.042 0 01-5.516-5.517l2.257-1.128a1 1 0 00.502-1.21L9.228 3.683A1 1 0 008.279 3H5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 3h5m0 0v5m0-5l-6 6M5 3a2 2 0 00-2 2v1c0 8.284 6.716 15 15 15h1a2 2 0 002-2v-3.28a1 1 0 00-.684-.948l-4.493-1.498a1 1 0 00-1.21.502l-1.13 2.257a11.042 11.042 0 01-5.516-5.517l2.257-1.128a1 1 0 00.502-1.21L9.228 3.683A1 1 0 008.279 3H5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 13v-1m4 1v-3m4 3V8M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 4a2 2 0 114 0v1a1 1 0 001 1h3a1 1 0 011 1v3a1 1 0 01-1 1h-1a2 2 0 100 4h1a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1v-1a2 2 0 10-4 0v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-3a1 1 0 00-1-1H4a2 2 0 110-4h1a1 1 0 001-1V7a1 1 0 011-1h3a1 1 0 001-1V4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 15v-1a4 4 0 00-4-4H8m0 0l3 3m-3-3l3-3m9 14V5a2 2 0 00-2-2H6a2 2 0 00-2 2v16l4-2 4 2 4-2 4 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 14l6-6m-5.5.5h.01m4.99 5h.01M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16l3.5-2 3.5 2 3.5-2 3.5 2zM10 8.5a.5.5 0 11-1 0 .5.5 0 011 0zm5 5a.5.5 0 11-1 0 .5.5 0 011 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12.066 11.2a1 1 0 000 1.6l5.334 4A1 1 0 0019 16V8a1 1 0 00-1.6-.8l-5.333 4zM4.066 11.2a1 1 0 000 1.6l5.334 4A1 1 0 0011 16V8a1 1 0 00-1.6-.8l-5.334 4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 5c7.18 0 13 5.82 13 13M6 11a7 7 0 017 7m-6 0a1 1 0 11-2 0 1 1 0 012 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-7a2 2 0 012-2h2m3-4H9a2 2 0 00-2 2v7a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-1m-1 4l-3 3m0 0l-3-3m3 3V3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.121 14.121L19 19m-7-7l7-7m-7 7l-2.879 2.879M12 12L9.121 9.121m0 5.758a3 3 0 10-4.243 4.243 3 3 0 004.243-4.243zm0-5.758a3 3 0 10-4.243-4.243 3 3 0 004.243 4.243z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16l2.879-2.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242zM21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 9l4-4 4 4m0 6l-4 4-4-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016zM12 9v2m0 4h.01"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636a9 9 0 010 12.728m0 0l-2.829-2.829m2.829 2.829L21 21M15.536 8.464a5 5 0 010 7.072m0 0l-2.829-2.829m-4.243 2.829a4.978 4.978 0 01-1.414-2.83m-1.414 5.658a9 9 0 01-2.167-9.238m7.824 2.167a1 1 0 111.414 1.414m-1.414-1.414L3 3m8.293 8.293l1.414 1.414"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.636 18.364a9 9 0 010-12.728m12.728 0a9 9 0 010 12.728m-9.9-2.829a5 5 0 010-7.07m7.072 0a5 5 0 010 7.07M13 12a1 1 0 11-2 0 1 1 0 012 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 17h8m0 0V9m0 8l-8-8-4 4-6-6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{d:"M9 17a2 2 0 11-4 0 2 2 0 014 0zM19 17a2 2 0 11-4 0 2 2 0 014 0z"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7a4 4 0 11-8 0 4 4 0 018 0zM9 14a6 6 0 00-6 6v1h12v-1a6 6 0 00-6-6zM21 12h-6"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.871 4A17.926 17.926 0 003 12c0 2.874.673 5.59 1.871 8m14.13 0a17.926 17.926 0 001.87-8c0-2.874-.673-5.59-1.87-8M9 9h1.246a1 1 0 01.961.725l1.586 5.55a1 1 0 00.961.725H15m1-7h-.08a2 2 0 00-1.519.698L9.6 15.302A2 2 0 018.08 16H8"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"}))}));const cm=a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"}))}));a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z",clipRule:"evenodd"}),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7"}))})),a.forwardRef((function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7"}))}));const um=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hm=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dm={};function fm(e,t){return((t||dm).jsx?hm:um).test(e)}const pm=/[ \t\n\f\r]/g;function mm(e){return""===e.replace(pm,"")}class gm{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function vm(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new gm(n,r,t)}function ym(e){return e.toLowerCase()}gm.prototype.property={},gm.prototype.normal={},gm.prototype.space=null;class _m{constructor(e,t){this.property=e,this.attribute=t}}_m.prototype.space=null,_m.prototype.boolean=!1,_m.prototype.booleanish=!1,_m.prototype.overloadedBoolean=!1,_m.prototype.number=!1,_m.prototype.commaSeparated=!1,_m.prototype.spaceSeparated=!1,_m.prototype.commaOrSpaceSeparated=!1,_m.prototype.mustUseProperty=!1,_m.prototype.defined=!1;let xm=0;const wm=Cm(),bm=Cm(),Em=Cm(),km=Cm(),Tm=Cm(),Mm=Cm(),Sm=Cm();function Cm(){return 2**++xm}var Am=Object.freeze({__proto__:null,boolean:wm,booleanish:bm,overloadedBoolean:Em,number:km,spaceSeparated:Tm,commaSeparated:Mm,commaOrSpaceSeparated:Sm});const Im=Object.keys(Am);class Rm extends _m{constructor(e,t,n,r){let i=-1;if(super(e,t),Lm(this,"space",r),"number"==typeof n)for(;++i<Im.length;){const e=Im[i];Lm(this,Im[i],(n&Am[e])===Am[e])}}}function Lm(e,t,n){n&&(e[t]=n)}Rm.prototype.defined=!0;const zm={}.hasOwnProperty;function Pm(e){const t={},n={};let r;for(r in e.properties)if(zm.call(e.properties,r)){const i=e.properties[r],o=new Rm(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[ym(r)]=r,n[ym(o.attribute)]=r}return new gm(t,n,e.space)}const Om=Pm({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Dm=Pm({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Bm(e,t){return t in e?e[t]:t}function Fm(e,t){return Bm(e,t.toLowerCase())}const jm=Pm({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Fm,properties:{xmlns:null,xmlnsXLink:null}}),Nm=Pm({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:bm,ariaAutoComplete:null,ariaBusy:bm,ariaChecked:bm,ariaColCount:km,ariaColIndex:km,ariaColSpan:km,ariaControls:Tm,ariaCurrent:null,ariaDescribedBy:Tm,ariaDetails:null,ariaDisabled:bm,ariaDropEffect:Tm,ariaErrorMessage:null,ariaExpanded:bm,ariaFlowTo:Tm,ariaGrabbed:bm,ariaHasPopup:null,ariaHidden:bm,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Tm,ariaLevel:km,ariaLive:null,ariaModal:bm,ariaMultiLine:bm,ariaMultiSelectable:bm,ariaOrientation:null,ariaOwns:Tm,ariaPlaceholder:null,ariaPosInSet:km,ariaPressed:bm,ariaReadOnly:bm,ariaRelevant:null,ariaRequired:bm,ariaRoleDescription:Tm,ariaRowCount:km,ariaRowIndex:km,ariaRowSpan:km,ariaSelected:bm,ariaSetSize:km,ariaSort:null,ariaValueMax:km,ariaValueMin:km,ariaValueNow:km,ariaValueText:null,role:null}}),Vm=Pm({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Fm,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Mm,acceptCharset:Tm,accessKey:Tm,action:null,allow:null,allowFullScreen:wm,allowPaymentRequest:wm,allowUserMedia:wm,alt:null,as:null,async:wm,autoCapitalize:null,autoComplete:Tm,autoFocus:wm,autoPlay:wm,blocking:Tm,capture:null,charSet:null,checked:wm,cite:null,className:Tm,cols:km,colSpan:null,content:null,contentEditable:bm,controls:wm,controlsList:Tm,coords:km|Mm,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wm,defer:wm,dir:null,dirName:null,disabled:wm,download:Em,draggable:bm,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wm,formTarget:null,headers:Tm,height:km,hidden:wm,high:km,href:null,hrefLang:null,htmlFor:Tm,httpEquiv:Tm,id:null,imageSizes:null,imageSrcSet:null,inert:wm,inputMode:null,integrity:null,is:null,isMap:wm,itemId:null,itemProp:Tm,itemRef:Tm,itemScope:wm,itemType:Tm,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wm,low:km,manifest:null,max:null,maxLength:km,media:null,method:null,min:null,minLength:km,multiple:wm,muted:wm,name:null,nonce:null,noModule:wm,noValidate:wm,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:wm,optimum:km,pattern:null,ping:Tm,placeholder:null,playsInline:wm,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wm,referrerPolicy:null,rel:Tm,required:wm,reversed:wm,rows:km,rowSpan:km,sandbox:Tm,scope:null,scoped:wm,seamless:wm,selected:wm,shadowRootClonable:wm,shadowRootDelegatesFocus:wm,shadowRootMode:null,shape:null,size:km,sizes:null,slot:null,span:km,spellCheck:bm,src:null,srcDoc:null,srcLang:null,srcSet:null,start:km,step:null,style:null,tabIndex:km,target:null,title:null,translate:null,type:null,typeMustMatch:wm,useMap:null,value:bm,width:km,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Tm,axis:null,background:null,bgColor:null,border:km,borderColor:null,bottomMargin:km,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wm,declare:wm,event:null,face:null,frame:null,frameBorder:null,hSpace:km,leftMargin:km,link:null,longDesc:null,lowSrc:null,marginHeight:km,marginWidth:km,noResize:wm,noHref:wm,noShade:wm,noWrap:wm,object:null,profile:null,prompt:null,rev:null,rightMargin:km,rules:null,scheme:null,scrolling:bm,standby:null,summary:null,text:null,topMargin:km,valueType:null,version:null,vAlign:null,vLink:null,vSpace:km,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:wm,disableRemotePlayback:wm,prefix:null,property:null,results:km,security:null,unselectable:null}}),Um=Pm({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:Bm,properties:{about:Sm,accentHeight:km,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:km,amplitude:km,arabicForm:null,ascent:km,attributeName:null,attributeType:null,azimuth:km,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:km,by:null,calcMode:null,capHeight:km,className:Tm,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:km,diffuseConstant:km,direction:null,display:null,dur:null,divisor:km,dominantBaseline:null,download:wm,dx:null,dy:null,edgeMode:null,editable:null,elevation:km,enableBackground:null,end:null,event:null,exponent:km,externalResourcesRequired:null,fill:null,fillOpacity:km,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Mm,g2:Mm,glyphName:Mm,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:km,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:km,horizOriginX:km,horizOriginY:km,id:null,ideographic:km,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:km,k:km,k1:km,k2:km,k3:km,k4:km,kernelMatrix:Sm,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:km,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:km,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:km,overlineThickness:km,paintOrder:null,panose1:null,path:null,pathLength:km,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Tm,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:km,pointsAtY:km,pointsAtZ:km,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Sm,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Sm,rev:Sm,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Sm,requiredFeatures:Sm,requiredFonts:Sm,requiredFormats:Sm,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:km,specularExponent:km,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:km,strikethroughThickness:km,string:null,stroke:null,strokeDashArray:Sm,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:km,strokeOpacity:km,strokeWidth:null,style:null,surfaceScale:km,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Sm,tabIndex:km,tableValues:null,target:null,targetX:km,targetY:km,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Sm,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:km,underlineThickness:km,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:km,values:null,vAlphabetic:km,vMathematical:km,vectorEffect:null,vHanging:km,vIdeographic:km,version:null,vertAdvY:km,vertOriginX:km,vertOriginY:km,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:km,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Hm=/^data[-\w.:]+$/i,Wm=/-[a-z]/g,$m=/[A-Z]/g;function Gm(e){return"-"+e.toLowerCase()}function qm(e){return e.charAt(1).toUpperCase()}const Zm={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Xm=vm([Dm,Om,jm,Nm,Vm],"html"),Ym=vm([Dm,Om,jm,Nm,Um],"svg");var Km={},Jm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Qm=/\n/g,eg=/^\s*/,tg=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ng=/^:\s*/,rg=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ig=/^[;\s]*/,og=/^\s+|\s+$/g,ag="";function sg(e){return e?e.replace(og,ag):ag}var lg=be&&be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Km,"__esModule",{value:!0});var cg=Km.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,ug.default)(e),i="function"==typeof t;return r.forEach((function(e){if("declaration"===e.type){var r=e.property,o=e.value;i?t(r,o,e):o&&((n=n||{})[r]=o)}})),n},ug=lg((function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(e){var t=e.match(Qm);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=~i?e.length-i:r+e.length}function o(){var e={line:n,column:r};return function(t){return t.position=new a(e),c(),t}}function a(e){this.start=e,this.end={line:n,column:r},this.source=t.source}function s(i){var o=new Error(t.source+":"+n+":"+r+": "+i);if(o.reason=i,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o}function l(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function c(){l(eg)}function u(e){var t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){var t=o();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;ag!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,ag===e.charAt(n-1))return s("End of comment missing");var a=e.slice(2,n-2);return r+=2,i(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function d(){var e=o(),t=l(tg);if(t){if(h(),!l(ng))return s("property missing ':'");var n=l(rg),r=e({type:"declaration",property:sg(t[0].replace(Jm,ag)),value:n?sg(n[0].replace(Jm,ag)):ag});return l(ig),r}}return a.prototype.content=e,c(),function(){var e,t=[];for(u(t);e=d();)!1!==e&&(t.push(e),u(t));return t}()}));var hg=cg.default||cg;const dg=pg("end"),fg=pg("start");function pg(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function mg(e){return e&&"object"==typeof e?"position"in e||"type"in e?vg(e.position):"start"in e||"end"in e?vg(e):"line"in e||"column"in e?gg(e):"":""}function gg(e){return yg(e&&e.line)+":"+yg(e&&e.column)}function vg(e){return gg(e&&e.start)+"-"+gg(e&&e.end)}function yg(e){return e&&"number"==typeof e?e:1}class _g extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=mg(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}_g.prototype.file="",_g.prototype.name="",_g.prototype.reason="",_g.prototype.message="",_g.prototype.stack="",_g.prototype.column=void 0,_g.prototype.line=void 0,_g.prototype.ancestors=void 0,_g.prototype.cause=void 0,_g.prototype.fatal=void 0,_g.prototype.place=void 0,_g.prototype.ruleId=void 0,_g.prototype.source=void 0;const xg={}.hasOwnProperty,wg=new Map,bg=/[A-Z]/g,Eg=/-([a-z])/g,kg=new Set(["table","tbody","thead","tfoot","tr"]),Tg=new Set(["td","th"]),Mg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Sg(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,i,o){const a=Array.isArray(i.children),s=fg(n);return t(r,i,o,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,i,o){const a=Array.isArray(i.children)?n:t;return o?a(r,i,o):a(r,i)}}(0,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?Ym:Xm,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},o=Cg(i,e,void 0);return o&&"string"!=typeof o?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Cg(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(i=Ym,e.schema=i);e.ancestors.push(t);const o=zg(e,t.tagName,!1),a=function(e,t){const n={};let r,i;for(i in t.properties)if("children"!==i&&xg.call(t.properties,i)){const o=Lg(e,i,t.properties[i]);if(o){const[i,a]=o;e.tableCellAlignToStyle&&"align"===i&&"string"==typeof a&&Tg.has(t.tagName)?r=a:n[i]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Rg(e,t);kg.has(t.tagName)&&(s=s.filter((function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&mm(t.value):mm(t));var t})));return Ag(e,a,o,t),Ig(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Pg(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let i=r;"svg"===t.name&&"html"===r.space&&(i=Ym,e.schema=i);e.ancestors.push(t);const o=null===t.name?e.Fragment:zg(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const i=t.expression;i.type;const o=i.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Pg(e,t.position);else{const i=r.name;let o;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,o=e.evaluater.evaluateExpression(t.expression)}else Pg(e,t.position);else o=null===r.value||r.value;n[i]=o}return n}(e,t),s=Rg(e,t);return Ag(e,a,o,t),Ig(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Pg(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Ig(r,Rg(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Ag(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ig(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Rg(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:wg;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const e="element"===o.type?o.tagName:"mdxJsxFlowElement"===o.type||"mdxJsxTextElement"===o.type?o.name:void 0;if(e){const t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}const s=Cg(e,o,a);void 0!==s&&n.push(s)}return n}function Lg(e,t,n){const r=function(e,t){const n=ym(t);let r=t,i=_m;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Hm.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Wm,qm);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Wm.test(e)){let n=e.replace($m,Gm);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=Rm}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{hg(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new _g("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Mg+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(Eg,Dg)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)xg.call(e,n)&&(t[Og(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Zm[r.property]||r.property:r.attribute,n]}}function zg(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,i=-1;for(;++i<e.length;){const t=fm(e[i])?{type:"Identifier",name:e[i]}:{type:"Literal",value:e[i]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(i&&"Literal"===t.type),optional:!1}:t}r=n}else r=fm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return xg.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Pg(e)}function Pg(e,t){const n=new _g("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Mg+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Og(e){let t=e.replace(bg,Bg);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Dg(e,t){return t.toUpperCase()}function Bg(e){return"-"+e.toLowerCase()}const Fg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var jg={exports:{}},Ng={},Vg=s.default,Ug=Symbol.for("react.element"),Hg=Symbol.for("react.fragment"),Wg=Object.prototype.hasOwnProperty,$g=Vg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gg={key:!0,ref:!0,__self:!0,__source:!0};function qg(e,t,n){var r,i={},o=null,a=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)Wg.call(t,r)&&!Gg.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:Ug,type:e,key:o,ref:a,props:i,_owner:$g.current}}Ng.Fragment=Hg,Ng.jsx=qg,Ng.jsxs=qg,function(e){e.exports=Ng}(jg);const Zg={};function Xg(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Yg(e.children,t,n)}return Array.isArray(e)?Yg(e,t,n):""}function Yg(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Xg(e[i],t,n);return r.join("")}const Kg=document.createElement("i");function Jg(e){const t="&"+e+";";Kg.innerHTML=t;const n=Kg.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function Qg(e,t,n,r){const i=e.length;let o,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ev(e,t){return e.length>0?(Qg(e,e.length,0,t),e):t}const tv={}.hasOwnProperty;function nv(e,t){let n;for(n in t){const r=(tv.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){tv.call(r,o)||(r[o]=[]);const e=i[o];rv(r[o],Array.isArray(e)?e:e?[e]:[])}}}function rv(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Qg(e,0,0,r)}function iv(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535==(65535&n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function ov(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const av=yv(/[A-Za-z]/),sv=yv(/[\dA-Za-z]/),lv=yv(/[#-'*+\--9=?A-Z^-~]/);function cv(e){return null!==e&&(e<32||127===e)}const uv=yv(/\d/),hv=yv(/[\dA-Fa-f]/),dv=yv(/[!-/:-@[-`{-~]/);function fv(e){return null!==e&&e<-2}function pv(e){return null!==e&&(e<0||32===e)}function mv(e){return-2===e||-1===e||32===e}const gv=yv(/\p{P}|\p{S}/u),vv=yv(/\s/);function yv(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function _v(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(37===o&&sv(e.charCodeAt(n+1))&&sv(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(a=String.fromCharCode(o,t),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xv(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return function(r){if(mv(r))return e.enter(n),a(r);return t(r)};function a(r){return mv(r)&&o++<i?(e.consume(r),a):(e.exit(n),t(r))}}const wv={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),xv(e,t,"linePrefix")}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,i(t)}function i(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):fv(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),i)}}};const bv={tokenize:function(e){const t=this,n=[];let r,i,o,a=0;return s;function s(r){if(a<n.length){const i=n[a];return t.containerState=i[1],e.attempt(i[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let i,o=n;for(;o--;)if("exit"===t.events[o][0]&&"chunkFlow"===t.events[o][1].type){i=t.events[o][1].end;break}v(a);let s=n;for(;s<t.events.length;)t.events[s][1].end=Object.assign({},i),s++;return Qg(t.events,o+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(i){if(a===n.length){if(!r)return d(i);if(r.currentConstruct&&r.currentConstruct.concrete)return p(i);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ev,u,h)(i)}function u(e){return r&&y(),v(a),d(e)}function h(e){return t.parser.lazy[t.now().line]=a!==n.length,o=t.now().offset,p(e)}function d(n){return t.containerState={},e.attempt(Ev,f,p)(n)}function f(e){return a++,n.push([t.currentConstruct,t.containerState]),d(e)}function p(n){return null===n?(r&&y(),v(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:r}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),v(0),void e.consume(n)):fv(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=i,i&&(i.next=e),i=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<o&&(!r.events[e][1].end||r.events[e][1].end.offset>o))return;const n=t.events.length;let i,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(i){s=t.events[l][1].end;break}i=!0}for(v(a),e=n;e<t.events.length;)t.events[e][1].end=Object.assign({},s),e++;Qg(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let i=n.length;for(;i-- >r;){const r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}},Ev={tokenize:function(e,t,n){return xv(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function kv(e){return null===e||pv(e)||vv(e)?1:gv(e)?2:void 0}function Tv(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Mv={name:"attention",tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=kv(r);let o;return function(t){return o=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===o)return e.consume(s),a;const l=e.exit("attentionSequence"),c=kv(s),u=!c||2===c&&i||n.includes(s),h=!i||2===i&&c||n.includes(r);return l._open=Boolean(42===o?u:u&&(i||!h)),l._close=Boolean(42===o?h:h&&(c||!u)),t(s)}},resolveAll:function(e,t){let n,r,i,o,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const h=Object.assign({},e[n][1].end),d=Object.assign({},e[u][1].start);Sv(h,-s),Sv(d,s),o={type:s>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[n][1].end)},a={type:s>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[u][1].start),end:d},i={type:s>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[u][1].start)},r={type:s>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[n][1].end=Object.assign({},o.start),e[u][1].start=Object.assign({},a.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=ev(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=ev(l,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),l=ev(l,Tv(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=ev(l,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=ev(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,Qg(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e}};function Sv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Cv={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return av(t)?(e.consume(t),o):64===t?n(t):l(t)}function o(e){return 43===e||45===e||46===e||sv(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||sv(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||cv(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):lv(t)?(e.consume(t),l):n(t)}function c(e){return sv(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):h(n)}function h(t){if((45===t||sv(t))&&r++<63){const n=45===t?h:u;return e.consume(t),n}return n(t)}}};const Av={tokenize:function(e,t,n){return function(t){return mv(t)?xv(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||fv(e)?t(e):n(e)}},partial:!0};const Iv={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return mv(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(mv(t))return xv(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return i(t)};function i(r){return e.attempt(Iv,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};const Rv={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return dv(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const Lv={name:"characterReference",tokenize:function(e,t,n){const r=this;let i,o,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,o=sv,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=hv,c):(e.enter("characterReferenceValue"),i=7,o=uv,c(t))}function c(s){if(59===s&&a){const i=e.exit("characterReferenceValue");return o!==sv||Jg(r.sliceSerialize(i))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return o(s)&&a++<i?(e.consume(s),c):n(s)}}};const zv={tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},Pv={name:"codeFenced",tokenize:function(e,t,n){const r=this,i={tokenize:function(e,t,n){let i=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),mv(t)?xv(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===o?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===o?(i++,e.consume(t),u):i>=s?(e.exit("codeFencedFenceSequence"),mv(t)?xv(e,h,"whitespace")(t):h(t)):n(t)}function h(r){return null===r||fv(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let o,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,o=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===o?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),mv(t)?xv(e,c,"whitespace")(t):c(t))}function c(n){return null===n||fv(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(zv,f,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||fv(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):mv(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xv(e,h,"whitespace")(t)):96===t&&t===o?n(t):(e.consume(t),u)}function h(t){return null===t||fv(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||fv(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===o?n(t):(e.consume(t),d)}function f(t){return e.attempt(i,y,p)(t)}function p(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&mv(t)?xv(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||fv(t)?e.check(zv,f,y)(t):(e.enter("codeFlowValue"),v(t))}function v(t){return null===t||fv(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),v)}function y(n){return e.exit("codeFenced"),t(n)}},concrete:!0};const Ov={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),xv(e,i,"linePrefix",5)(t)};function i(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return null===t?s(t):fv(t)?e.attempt(Dv,o,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||fv(t)?(e.exit("codeFlowValue"),o(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},Dv={tokenize:function(e,t,n){const r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):fv(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):xv(e,o,"linePrefix",5)(t)}function o(e){const o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):fv(e)?i(e):n(e)}},partial:!0};const Bv={name:"codeText",tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),o++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(i=e.enter("codeTextSequence"),r=0,c(t)):fv(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||fv(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(i.type="codeTextData",l(n))}},resolve:function(e){let t,n,r=e.length-4,i=3;if(!("lineEnding"!==e[i][1].type&&"space"!==e[i][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}t=i-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type}};class Fv{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&jv(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),jv(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jv(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);jv(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);jv(this.left,t.reverse())}}}function jv(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Nv(e){const t={};let n,r,i,o,a,s,l,c=-1;const u=new Fv(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,i=0,i<s.length&&"lineEndingBlank"===s[i][1].type&&(i+=2),i<s.length&&"content"===s[i][1].type))for(;++i<s.length&&"content"!==s[i][1].type;)"chunkText"===s[i][1].type&&(s[i][1]._isInFirstContentOfListItem=!0,i++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Vv(u,c)),c=t[c],l=!0);else if(n[1]._container){for(i=c,r=void 0;i--&&(o=u.get(i),"lineEnding"===o[1].type||"lineEndingBlank"===o[1].type);)"enter"===o[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=i);r&&(n[1].end=Object.assign({},u.get(r)[1].start),a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return Qg(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function Vv(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,l=[],c={};let u,h,d=-1,f=n,p=0,m=0;const g=[m];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),h&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++d<s.length;)"exit"===s[d][0]&&"enter"===s[d-1][0]&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(m=d+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const t=s.slice(g[d],g[d+1]),n=o.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),d=-1;++d<l.length;)c[p+l[d][0]]=p+l[d][1],p+=l[d][1]-l[d][0]-1;return c}const Uv={tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):fv(t)?e.check(Hv,o,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}},resolve:function(e){return Nv(e),e}},Hv={tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),xv(e,i,"linePrefix")};function i(i){if(null===i||fv(i))return n(i);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}},partial:!0};function Wv(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),h;if(null===t||32===t||41===t||cv(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t)};function h(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),h(t)):null===t||60===t||fv(t)?n(t):(e.consume(t),92===t?f:d)}function f(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function p(i){return u||null!==i&&41!==i&&!pv(i)?u<c&&40===i?(e.consume(i),u++,p):41===i?(e.consume(i),u--,p):null===i||32===i||40===i||cv(i)?n(i):(e.consume(i),92===i?m:p):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(i))}function m(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function $v(e,t,n,r,i,o){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),c};function c(h){return l>999||null===h||91===h||93===h&&!s||94===h&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):93===h?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):fv(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(t){return null===t||91===t||93===t||fv(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!mv(t)),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Gv(e,t,n,r,i,o){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),l(n))}function l(t){return t===a?(e.exit(o),s(a)):null===t?n(t):fv(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),xv(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||fv(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function qv(e,t){let n;return function r(i){if(fv(i))return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r;if(mv(i))return xv(e,r,n?"linePrefix":"lineSuffix")(i);return t(i)}}const Zv={name:"definition",tokenize:function(e,t,n){const r=this;let i;return function(t){return e.enter("definition"),function(t){return $v.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function o(t){return i=ov(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return pv(t)?qv(e,s)(t):s(t)}function s(t){return Wv(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(Xv,c,c)(t)}function c(t){return mv(t)?xv(e,u,"whitespace")(t):u(t)}function u(o){return null===o||fv(o)?(e.exit("definition"),r.parser.defined.push(i),t(o)):n(o)}}},Xv={tokenize:function(e,t,n){return function(t){return pv(t)?qv(e,r)(t):n(t)};function r(t){return Gv(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return mv(t)?xv(e,o,"whitespace")(t):o(t)}function o(e){return null===e||fv(e)?t(e):n(e)}},partial:!0};const Yv={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return fv(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Kv={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),i(t)}(t)};function i(t){return 35===t&&r++<6?(e.consume(t),i):null===t||pv(t)?(e.exit("atxHeadingSequence"),o(t)):n(t)}function o(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||fv(n)?(e.exit("atxHeading"),t(n)):mv(n)?xv(e,o,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),o(t))}function s(t){return null===t||35===t||pv(t)?(e.exit("atxHeadingText"),o(t)):(e.consume(t),s)}},resolve:function(e,t){let n,r,i=e.length-2,o=3;"whitespace"===e[o][1].type&&(o+=2);i-2>o&&"whitespace"===e[i][1].type&&(i-=2);"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4);i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},Qg(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e}};const Jv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Qv=["pre","script","style","textarea"],ey={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let i,o,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),o=!0,f):63===s?(e.consume(s),i=3,r.interrupt?t:P):av(s)?(e.consume(s),a=String.fromCharCode(s),p):n(s)}function u(o){return 45===o?(e.consume(o),i=2,h):91===o?(e.consume(o),i=5,s=0,d):av(o)?(e.consume(o),i=4,r.interrupt?t:P):n(o)}function h(i){return 45===i?(e.consume(i),r.interrupt?t:P):n(i)}function d(i){const o="CDATA[";return i===o.charCodeAt(s++)?(e.consume(i),6===s?r.interrupt?t:M:d):n(i)}function f(t){return av(t)?(e.consume(t),a=String.fromCharCode(t),p):n(t)}function p(s){if(null===s||47===s||62===s||pv(s)){const l=47===s,c=a.toLowerCase();return l||o||!Qv.includes(c)?Jv.includes(a.toLowerCase())?(i=6,l?(e.consume(s),m):r.interrupt?t(s):M(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):o?g(s):v(s)):(i=1,r.interrupt?t(s):M(s))}return 45===s||sv(s)?(e.consume(s),a+=String.fromCharCode(s),p):n(s)}function m(i){return 62===i?(e.consume(i),r.interrupt?t:M):n(i)}function g(t){return mv(t)?(e.consume(t),g):k(t)}function v(t){return 47===t?(e.consume(t),k):58===t||95===t||av(t)?(e.consume(t),y):mv(t)?(e.consume(t),v):k(t)}function y(t){return 45===t||46===t||58===t||95===t||sv(t)?(e.consume(t),y):_(t)}function _(t){return 61===t?(e.consume(t),x):mv(t)?(e.consume(t),_):v(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):mv(t)?(e.consume(t),x):b(t)}function w(t){return t===l?(e.consume(t),l=null,E):null===t||fv(t)?n(t):(e.consume(t),w)}function b(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||pv(t)?_(t):(e.consume(t),b)}function E(e){return 47===e||62===e||mv(e)?v(e):n(e)}function k(t){return 62===t?(e.consume(t),T):n(t)}function T(t){return null===t||fv(t)?M(t):mv(t)?(e.consume(t),T):n(t)}function M(t){return 45===t&&2===i?(e.consume(t),I):60===t&&1===i?(e.consume(t),R):62===t&&4===i?(e.consume(t),O):63===t&&3===i?(e.consume(t),P):93===t&&5===i?(e.consume(t),z):!fv(t)||6!==i&&7!==i?null===t||fv(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),M):(e.exit("htmlFlowData"),e.check(ty,D,S)(t))}function S(t){return e.check(ny,C,D)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return null===t||fv(t)?S(t):(e.enter("htmlFlowData"),M(t))}function I(t){return 45===t?(e.consume(t),P):M(t)}function R(t){return 47===t?(e.consume(t),a="",L):M(t)}function L(t){if(62===t){const n=a.toLowerCase();return Qv.includes(n)?(e.consume(t),O):M(t)}return av(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),L):M(t)}function z(t){return 93===t?(e.consume(t),P):M(t)}function P(t){return 62===t?(e.consume(t),O):45===t&&2===i?(e.consume(t),P):M(t)}function O(t){return null===t||fv(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),O)}function D(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},ty={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Av,t,n)}},partial:!0},ny={tokenize:function(e,t,n){const r=this;return function(t){if(fv(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i;return n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0};const ry={name:"htmlText",tokenize:function(e,t,n){const r=this;let i,o,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),y):av(t)?(e.consume(t),E):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),o=0,f):av(t)?(e.consume(t),v):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),h):fv(t)?(a=u,L(t)):(e.consume(t),u)}function h(t){return 45===t?(e.consume(t),d):u(t)}function d(e){return 62===e?R(e):45===e?h(e):u(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(o++)?(e.consume(t),6===o?p:f):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),m):fv(t)?(a=p,L(t)):(e.consume(t),p)}function m(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?R(t):93===t?(e.consume(t),g):p(t)}function v(t){return null===t||62===t?R(t):fv(t)?(a=v,L(t)):(e.consume(t),v)}function y(t){return null===t?n(t):63===t?(e.consume(t),_):fv(t)?(a=y,L(t)):(e.consume(t),y)}function _(e){return 62===e?R(e):y(e)}function x(t){return av(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||sv(t)?(e.consume(t),w):b(t)}function b(t){return fv(t)?(a=b,L(t)):mv(t)?(e.consume(t),b):R(t)}function E(t){return 45===t||sv(t)?(e.consume(t),E):47===t||62===t||pv(t)?k(t):n(t)}function k(t){return 47===t?(e.consume(t),R):58===t||95===t||av(t)?(e.consume(t),T):fv(t)?(a=k,L(t)):mv(t)?(e.consume(t),k):R(t)}function T(t){return 45===t||46===t||58===t||95===t||sv(t)?(e.consume(t),T):M(t)}function M(t){return 61===t?(e.consume(t),S):fv(t)?(a=M,L(t)):mv(t)?(e.consume(t),M):k(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),i=t,C):fv(t)?(a=S,L(t)):mv(t)?(e.consume(t),S):(e.consume(t),A)}function C(t){return t===i?(e.consume(t),i=void 0,I):null===t?n(t):fv(t)?(a=C,L(t)):(e.consume(t),C)}function A(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||pv(t)?k(t):(e.consume(t),A)}function I(e){return 47===e||62===e||pv(e)?k(e):n(e)}function R(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function L(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),z}function z(t){return mv(t)?xv(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),a(t)}}};const iy={name:"labelEnd",tokenize:function(e,t,n){const r=this;let i,o,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){i=r.events[a][1];break}return function(t){if(!i)return n(t);if(i._inactive)return u(t);return o=r.parser.defined.includes(ov(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(oy,c,o?c:u)(t):91===t?e.attempt(ay,c,o?l:u)(t):o?c(t):u(t)}function l(t){return e.attempt(sy,c,u)(t)}function c(e){return t(e)}function u(e){return i._balanced=!0,n(e)}},resolveTo:function(e,t){let n,r,i,o,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(i=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[r][1].start),end:Object.assign({},e[i][1].end)},u={type:"labelText",start:Object.assign({},e[r+s+2][1].end),end:Object.assign({},e[i-2][1].start)};return o=[["enter",l,t],["enter",c,t]],o=ev(o,e.slice(r+1,r+s+3)),o=ev(o,[["enter",u,t]]),o=ev(o,Tv(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),o=ev(o,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),o=ev(o,e.slice(i+1)),o=ev(o,[["exit",l,t]]),Qg(e,r,e.length,o),e},resolveAll:function(e){let t=-1;for(;++t<e.length;){const n=e[t][1];"labelImage"!==n.type&&"labelLink"!==n.type&&"labelEnd"!==n.type||(e.splice(t+1,"labelImage"===n.type?4:2),n.type="data",t++)}return e}},oy={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return pv(t)?qv(e,i)(t):i(t)}function i(t){return 41===t?c(t):Wv(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return pv(t)?qv(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?Gv(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return pv(t)?qv(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},ay={tokenize:function(e,t,n){const r=this;return function(t){return $v.call(r,e,i,o,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(ov(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},sy={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const ly={name:"labelStartImage",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:iy.resolveAll};const cy={name:"labelStartLink",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}},resolveAll:iy.resolveAll};const uy={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),xv(e,t,"linePrefix")}}};const hy={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,o(e)}(t)};function o(o){return o===r?(e.enter("thematicBreakSequence"),a(o)):i>=3&&(null===o||fv(o))?(e.exit("thematicBreak"),t(o)):n(o)}function a(t){return t===r?(e.consume(t),i++,a):(e.exit("thematicBreakSequence"),mv(t)?xv(e,o,"whitespace")(t):o(t))}}};const dy={name:"list",tokenize:function(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,a=0;return function(t){const i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:uv(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(hy,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return uv(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(Av,r.interrupt?n:c,e.attempt(fy,h,u))}function c(e){return r.containerState.initialBlankLine=!0,o++,h(e)}function u(t){return mv(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),h):n(t)}function h(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Av,i,o);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xv(e,t,"listItemIndent",r.containerState.size+1)(n)}function o(n){return r.containerState.furtherBlankLines||!mv(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(py,t,a)(n))}function a(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,xv(e,e.attempt(dy,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)}},fy={tokenize:function(e,t,n){const r=this;return xv(e,(function(e){const i=r.events[r.events.length-1];return!mv(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},py={tokenize:function(e,t,n){const r=this;return xv(e,(function(e){const i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0};const my={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let i;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),i=t,function(t){return e.enter("setextHeadingLineSequence"),o(t)}(t);return n(t)};function o(t){return t===i?(e.consume(t),o):(e.exit("setextHeadingLineSequence"),mv(t)?xv(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||fv(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);const a={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[i][1].end)):e[n][1]=a;return e.push(["exit",a,t]),e}};const gy={tokenize:function(e){const t=this,n=e.attempt(Av,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,xv(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Uv,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const vy={resolveAll:wy()},yy=xy("string"),_y=xy("text");function xy(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],i=t.attempt(r,o,a);return o;function o(e){return l(e)?i(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let i=-1;if(t)for(;++i<t.length;){const e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}},resolveAll:wy("text"===e?by:void 0)}}function wy(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function by(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],i=t.sliceStream(r);let o,a=i.length,s=-1,l=0;for(;a--;){const e=i[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)o=!0,l++;else if(-1!==e){a++;break}}if(l){const i={type:n===e.length||o||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+a,_bufferIndex:a?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},i.start),r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function Ey(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let a=[],s=[];const l={consume:function(e){fv(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,y()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=d(),c.events.push(["exit",t,c]),t},attempt:g((function(e,t){v(e,t.from)})),check:g(m),interrupt:g(m,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:h,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if("string"==typeof o)a=o;else switch(o){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&i)continue;a=" ";break;default:a=String.fromCharCode(o)}i=-2===o,r.push(a)}return r.join("")}(h(e),t)},now:d,defineSkip:function(e){i[e.line]=e.column,y()},write:function(e){if(a=ev(a,e),f(),null!==a[a.length-1])return[];return v(t,0),c.events=Tv(o,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function h(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}(a,e)}function d(){const{line:e,column:t,offset:n,_index:i,_bufferIndex:o}=r;return{line:e,column:t,offset:n,_index:i,_bufferIndex:o}}function f(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}function p(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,i,o){let a,u,h,f;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return p([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function p(e){return a=e,u=0,0===e.length?o:m(e[u])}function m(e){return function(n){f=function(){const e=d(),t=c.previous,n=c.currentConstruct,i=c.events.length,o=Array.from(s);return{restore:a,from:i};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=i,s=o,y()}}(),h=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return v();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,v)(n)}}function g(t){return e(h,f),i}function v(e){return f.restore(),++u<a.length?m(a[u]):o}}}function v(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&Qg(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}const ky={42:dy,43:dy,45:dy,48:dy,49:dy,50:dy,51:dy,52:dy,53:dy,54:dy,55:dy,56:dy,57:dy,62:Iv},Ty={91:Zv},My={[-2]:Ov,[-1]:Ov,32:Ov},Sy={35:Kv,42:hy,45:[my,hy],60:ey,61:my,95:hy,96:Pv,126:Pv},Cy={38:Lv,92:Rv},Ay={[-5]:uy,[-4]:uy,[-3]:uy,33:ly,38:Lv,42:Mv,60:[Cv,ry],91:cy,92:[Yv,Rv],93:iy,95:Mv,96:Bv},Iy={null:[Mv,vy]};var Ry=Object.freeze({__proto__:null,document:ky,contentInitial:Ty,flowInitial:My,flow:Sy,string:Cy,text:Ay,insideSpan:Iy,attentionMarkers:{null:[42,95]},disable:{null:[]}});function Ly(e){const t=function(e){const t={};let n=-1;for(;++n<e.length;)nv(t,e[n]);return t}([Ry,...(e||{}).extensions||[]]),n={defined:[],lazy:{},constructs:t,content:r(wv),document:r(bv),flow:r(gy),string:r(yy),text:r(_y)};return n;function r(e){return function(t){return Ey(n,e,t)}}}const zy=/[\0\t\n\r]/g;const Py=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Oy(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return iv(n.slice(t?2:1),t?16:10)}return Jg(n)||e}const Dy={}.hasOwnProperty;function By(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(te),autolinkProtocol:T,autolinkEmail:T,atxHeading:o(K),blockQuote:o(G),characterEscape:T,characterReference:T,codeFenced:o(q),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(q,a),codeText:o(Z,a),codeTextData:T,data:T,codeFlowValue:T,definition:o(X),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(Y),hardBreakEscape:o(J),hardBreakTrailing:o(J),htmlFlow:o(Q,a),htmlFlowData:T,htmlText:o(Q,a),htmlTextData:T,image:o(ee),label:a,link:o(te),listItem:o(re),listItemValue:d,listOrdered:o(ne,h),listUnordered:o(ne),paragraph:o(ie),reference:j,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(K),strong:o(oe),thematicBreak:o(se)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:$,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:U,characterReference:H,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:M,codeIndented:l(v),codeText:l(R),codeTextData:M,data:M,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(C),hardBreakTrailing:l(C),htmlFlow:l(A),htmlFlowData:M,htmlText:l(I),htmlTextData:M,image:l(z),label:O,labelText:P,lineEnding:S,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:N,resourceDestinationString:D,resourceTitleString:B,resource:F,setextHeading:l(k),setextHeadingLineSequence:E,setextHeadingText:b,strong:l(),thematicBreak:l()}};jy(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const o={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let h=-1;for(;++h<e.length;)if("listOrdered"===e[h][1].type||"listUnordered"===e[h][1].type)if("enter"===e[h][0])l.push(h);else{h=i(e,l.pop(),h)}for(h=-1;++h<e.length;){const n=t[e[h][0]];Dy.call(n,e[h][1].type)&&n[e[h][1].type].call(Object.assign({sliceSerialize:e[h][2].sliceSerialize},o),e[h][1])}if(o.tokenStack.length>0){const e=o.tokenStack[o.tokenStack.length-1];(e[1]||Vy).call(o,void 0,e[0])}for(r.position={start:Fy(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Fy(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},h=-1;++h<t.transforms.length;)r=t.transforms[h](r)||r;return r}function i(e,t,n){let r,i,o,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||o||(o=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(i=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}o&&(!i||o<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(s,0,["enter",i,t[2]]),s++,n++,o=void 0,a=!0}}}return e[t][1]._spread=c,n}function o(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n]),e.position={start:Fy(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+mg({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||Vy).call(this,e,r[0])}n.position.end=Fy(e.end)}function u(){return function(e,t){const n=t||Zg;return Xg(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function p(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function y(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ov(this.sliceSerialize(e)).toLowerCase()}function _(){const e=this.resume();this.stack[this.stack.length-1].title=e}function x(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:Fy(e.start),end:void 0},t.push(n)),this.stack.push(n)}function M(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Fy(e.end)}function S(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=Fy(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),M.call(this,e))}function C(){this.data.atHardBreak=!0}function A(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function R(){const e=this.resume();this.stack[this.stack.length-1].value=e}function L(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function z(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Py,Oy)}(t),n.identifier=ov(t).toLowerCase()}function O(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function D(){const e=this.resume();this.stack[this.stack.length-1].url=e}function B(){const e=this.resume();this.stack[this.stack.length-1].title=e}function F(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function N(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ov(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function V(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=iv(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=Jg(t)}this.stack[this.stack.length-1].value+=r}function H(e){this.stack.pop().position.end=Fy(e.end)}function W(e){M.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function $(e){M.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function q(){return{type:"code",lang:null,meta:null,value:""}}function Z(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Y(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function Q(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function ie(){return{type:"paragraph",children:[]}}function oe(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Nv(e););return e}(Ly(n).document().write(function(){let e,t=1,n="",r=!0;return function(i,o,a){const s=[];let l,c,u,h,d;for(i=n+("string"==typeof i?i.toString():new TextDecoder(o||void 0).decode(i)),u=0,n="",r&&(65279===i.charCodeAt(0)&&u++,r=void 0);u<i.length;){if(zy.lastIndex=u,l=zy.exec(i),h=l&&void 0!==l.index?l.index:i.length,d=i.charCodeAt(h),!l){n=i.slice(u);break}if(10===d&&u===h&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<h&&(s.push(i.slice(u,h)),t+=h-u),d){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=h+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function Fy(e){return{line:e.line,column:e.column,offset:e.offset}}function jy(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jy(e,r):Ny(e,r)}}function Ny(e,t){let n;for(n in t)if(Dy.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Vy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+mg({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mg({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+mg({start:t.start,end:t.end})+") is still open")}function Uy(e){const t=this;t.parser=function(n){return By(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hy(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&"text"===o.type?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push({type:"text",value:r}),i}function Wy(e){const t=e.spread;return null==t?e.children.length>1:t}const $y=9,Gy=32;function qy(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Zy(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Zy(t.slice(i),i>0,!1)),o.join("")}function Zy(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===$y||t===Gy;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===$y||t===Gy;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}const Xy={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=_v(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hy(e,t);const i={src:_v(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:_v(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hy(e,t);const i={href:_v(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:_v(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Wy(n[r])}return t}(n):Wy(t),o={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(i||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(i||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){const e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=fg(t.children[1]),a=dg(t.children[t.children.length-1]);o&&a&&(r.position={start:o,end:a}),i.push(r)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,a=o?o.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=o?o[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:qy(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Yy,yaml:Yy,definition:Yy,footnoteDefinition:Yy};function Yy(){}const Ky="object"==typeof self?self:globalThis,Jy=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case 0:case-1:return n(a,i);case 1:{const e=n([],i);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},i);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{const e=n(new Map,i);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,i);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new Ky[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Ky[o](a),i)};return r})(new Map,e)(0),Qy="",{toString:e_}={},{keys:t_}=Object,n_=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=e_.call(e).slice(8,-1);switch(n){case"Array":return[1,Qy];case"Object":return[2,Qy];case"Date":return[3,Qy];case"RegExp":return[4,Qy];case"Map":return[5,Qy];case"Set":return[6,Qy]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},r_=([e,t])=>0===e&&("function"===t||"symbol"===t),i_=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const i=(e,t)=>{const i=r.push(e)-1;return n.set(t,i),i},o=r=>{if(n.has(r))return n.get(r);let[a,s]=n_(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return i([-1],r)}return i([a,t],r)}case 1:{if(s)return i([s,[...r]],r);const e=[],t=i([a,e],r);for(const t of r)e.push(o(t));return t}case 2:{if(s)switch(s){case"BigInt":return i([s,r.toString()],r);case"Boolean":case"Number":case"String":return i([s,r.valueOf()],r)}if(t&&"toJSON"in r)return o(r.toJSON());const n=[],l=i([a,n],r);for(const t of t_(r))!e&&r_(n_(r[t]))||n.push([o(t),o(r[t])]);return l}case 3:return i([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return i([a,{source:e,flags:t}],r)}case 5:{const t=[],n=i([a,t],r);for(const[n,i]of r)(e||!r_(n_(n))&&!r_(n_(i)))&&t.push([o(n),o(i)]);return n}case 6:{const t=[],n=i([a,t],r);for(const n of r)!e&&r_(n_(n))||t.push(o(n));return n}}const{message:l}=r;return i([a,{name:s,message:l}],r)};return o})(!(t||n),!!t,new Map,r)(e),r};var o_="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Jy(i_(e,t)):structuredClone(e):(e,t)=>Jy(i_(e,t));function a_(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function s_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const l_=function(e){if(null==e)return u_;if("function"==typeof e)return c_(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=l_(e[n]);return c_(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return c_(n);function n(n){const r=n;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}(e);if("string"==typeof e)return function(e){return c_(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function c_(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function u_(){return!0}const h_=[],d_=!0,f_=!1,p_="skip";function m_(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;const o=l_(i),a=r?-1:1;!function e(i,s,l){const c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,h,d=h_;if((!t||o(i,s,l[l.length-1]||void 0))&&(d=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[d_,e];return null==e?h_:[e]}(n(i,l)),d[0]===f_))return d;if("children"in i&&i.children){const t=i;if(t.children&&d[0]!==p_)for(u=(r?t.children.length:-1)+a,h=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,h)(),c[0]===f_)return c;u="number"==typeof c[1]?c[1]:u+a}}return d}}(e,void 0,[])()}function g_(e,t,n,r){let i,o,a;"function"==typeof t&&"function"!=typeof n?(o=void 0,a=t,i=n):(o=t,a=n,i=r),m_(e,o,(function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)}),i)}const v_={}.hasOwnProperty,y_={};function __(e,t){e.position&&(t.position=function(e){const t=fg(e),n=dg(e);if(t&&n)return{start:t,end:n}}(e))}function x_(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&i&&Object.assign(n.properties,o_(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function w_(e,t){const n=t.data||{},r=!("value"in t)||v_.call(n,"hProperties")||v_.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function b_(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function E_(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function k_(e,t){const n=function(e,t){const n=t||y_,r=new Map,i=new Map,o=new Map,a={...Xy,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const i=s.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=E_(i.value)),!Array.isArray(i)&&"element"===i.type)){const e=i.children[0];e&&"text"===e.type&&(e.value=E_(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:x_,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(v_.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=o_(n);return r.children=s.all(e),r}return o_(e)}return(s.options.unknownHandler||w_)(s,e,t)},options:n,patch:__,wrap:b_};return g_(e,(function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}})),s}(e,t),r=n.one(e,void 0),i=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||a_,r=e.options.footnoteBackLabel||s_,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;const o=e.all(i),a=String(i.identifier).toUpperCase(),c=_v(a.toLowerCase());let u=0;const h=[],d=e.footnoteCounts.get(a);for(;void 0!==d&&++u<=d;){h.length>0&&h.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=o[o.length-1];if(f&&"element"===f.type&&"p"===f.tagName){const e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...h)}else o.push(...h);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(i,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...o_(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:"\n"},i),o}function T_(e,t){return e&&"run"in e?async function(n,r){const i=k_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return k_(n,{file:r,...e||t})}}function M_(e){if(e)throw e}var S_=Object.prototype.hasOwnProperty,C_=Object.prototype.toString,A_=Object.defineProperty,I_=Object.getOwnPropertyDescriptor,R_=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===C_.call(e)},L_=function(e){if(!e||"[object Object]"!==C_.call(e))return!1;var t,n=S_.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&S_.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||S_.call(e,t)},z_=function(e,t){A_&&"__proto__"===t.name?A_(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},P_=function(e,t){if("__proto__"===t){if(!S_.call(e,t))return;if(I_)return I_(e,t).value}return e[t]},O_=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=P_(s,n),s!==(i=P_(t,n))&&(u&&i&&(L_(i)||(o=R_(i)))?(o?(o=!1,a=r&&R_(r)?r:[]):a=r&&L_(r)?r:{},z_(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&z_(s,{name:n,newValue:i}));return s};function D_(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function B_(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function i(o,...a){const s=e[++n];let l=-1;if(o)r(o);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let a;r&&t.push(i);try{a=e.apply(this,t)}catch(e){if(r&&n)throw e;return i(e)}r||(a&&a.then&&"function"==typeof a.then?a.then(o,i):a instanceof Error?i(a):o(a))}function i(e,...r){n||(n=!0,t(e,...r))}function o(e){i(null,e)}}(s,i)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const F_={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');j_(e);let n,r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else a<0&&(n=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(i=o):(s=-1,i=a));r===i?i=a:i<0&&(i=e.length);return e.slice(r,i)},dirname:function(e){if(j_(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){j_(e);let t,n=e.length,r=-1,i=0,o=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?o<0?o=n:1!==a&&(a=1):o>-1&&(a=-1);else if(t){i=n+1;break}}if(o<0||r<0||0===a||1===a&&o===r-1&&o===i+1)return"";return e.slice(o,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)j_(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){j_(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,i="",o=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(i.length<2||2!==o||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2))if(i.length>2){if(r=i.lastIndexOf("/"),r!==i.length-1){r<0?(i="",o=0):(i=i.slice(0,r),o=i.length-1-i.lastIndexOf("/")),a=l,s=0;continue}}else if(i.length>0){i="",o=0,a=l,s=0;continue}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(a+1,l):i=e.slice(a+1,l),o=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return i}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function j_(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const N_={cwd:function(){return"/"}};function V_(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function U_(e){if("string"==typeof e)e=new URL(e);else if(!V_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const H_=["history","path","basename","stem","extname","dirname"];class W_{constructor(e){let t;t=e?V_(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":N_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<H_.length;){const e=H_[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)H_.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?F_.basename(this.path):void 0}set basename(e){G_(e,"basename"),$_(e,"basename"),this.path=F_.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?F_.dirname(this.path):void 0}set dirname(e){q_(this.basename,"dirname"),this.path=F_.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?F_.extname(this.path):void 0}set extname(e){if($_(e,"extname"),q_(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=F_.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){V_(e)&&(e=U_(e)),G_(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?F_.basename(this.path,this.extname):void 0}set stem(e){G_(e,"stem"),$_(e,"stem"),this.path=F_.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new _g(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function $_(e,t){if(e&&e.includes(F_.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+F_.sep+"`")}function G_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function q_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Z_=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},X_={}.hasOwnProperty;class Y_ extends Z_{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=B_()}copy(){const e=new Y_;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(O_(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(ex("data",this.frozen),this.namespace[e]=t,this):X_.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ex("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=rx(e),n=this.parser||this.Parser;return J_("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),J_("process",this.parser||this.Parser),Q_("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){const o=rx(e),a=n.parse(o);function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}n.run(a,o,(function(e,t,r){if(e||!t||!r)return s(e);const i=t,o=n.stringify(i,r);var a;"string"==typeof(a=o)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=o:r.result=o,s(e,r)}))}}processSync(e){let t,n=!1;return this.freeze(),J_("processSync",this.parser||this.Parser),Q_("processSync",this.compiler||this.Compiler),this.process(e,(function(e,r){n=!0,M_(e),t=r})),nx("processSync","process",n),t}run(e,t,n){tx(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,o){const a=rx(t);r.run(e,a,(function(t,r,a){const s=r||e;t?o(t):i?i(s):n(void 0,s,a)}))}}runSync(e,t){let n,r=!1;return this.run(e,t,(function(e,t){M_(e),n=t,r=!0})),nx("runSync","run",r),n}stringify(e,t){this.freeze();const n=rx(t),r=this.compiler||this.Compiler;return Q_("stringify",r),tx(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(ex("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):o(e)}return this;function i(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else o(e)}}function o(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=O_(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){i(e[t])}}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...o]=t;const a=n[i][1];D_(a)&&D_(r)&&(r=O_(!0,a,r)),n[i]=[e,r,...o]}}}}const K_=(new Y_).freeze();function J_(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Q_(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function ex(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tx(e){if(!D_(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function nx(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function rx(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new W_(e)}const ix=[],ox={allowDangerousHtml:!0},ax=/^(https?|ircs?|mailto|xmpp)$/i,sx=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function lx(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||ix,l=e.remarkPlugins||ix,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ox}:ox,u=e.skipHtml,h=e.unwrapDisallowed,d=e.urlTransform||cx,f=K_().use(Uy).use(l).use(T_,c).use(s),p=new W_;"string"==typeof r&&(p.value=r);for(const t of sx)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const m=f.parse(p);let g=f.runSync(m,p);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:"root"===g.type?g.children:[g]}),g_(g,(function(e,r,i){if("raw"===e.type&&i&&"number"==typeof r)return u?i.children.splice(r,1):i.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in Fg)if(Object.hasOwn(Fg,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Fg[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let o=t?!t.includes(e.tagName):!!a&&a.includes(e.tagName);if(!o&&n&&"number"==typeof r&&(o=!n(e,r,i)),o&&i&&"number"==typeof r)return h&&e.children?i.children.splice(r,1,...e.children):i.children.splice(r,1),r}})),Sg(g,{Fragment:jg.exports.Fragment,components:o,ignoreInvalidStyle:!0,jsx:jg.exports.jsx,jsxs:jg.exports.jsxs,passKeys:!0,passNode:!0})}function cx(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||ax.test(e.slice(0,t))?e:""}const ux=({services:t,programmeId:n,directoryId:r,onChangeView:i})=>{const{messages:o,handleSubmit:a,input:l,setInput:c}=sm({keepLastMessageOnError:!0,api:"https://app.plinth.org.uk/api/chat",body:{programmeId:n,directoryId:r}}),u=e.useRef(null),[h,d]=e.useState(!1);e.useEffect((()=>{h&&l&&(a({preventDefault:()=>{}}),d(!1))}),[h,l]),e.useEffect((()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)}),[o]);return console.log({messages:o}),s.default.createElement("div",{className:"ai-chat"},0===o.length&&s.default.createElement("div",{className:"chat-placeholder"},s.default.createElement("h2",null,"We have information about ",t.length," services."),s.default.createElement("div",{className:"tile-selector-container"},s.default.createElement("div",{className:"tile-option",onClick:()=>i("List"),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||i("List")}},s.default.createElement("div",{className:"tile-option-icon-wrapper"},s.default.createElement(cm,{className:"tile-option-icon"})),s.default.createElement("p",null,"View the list")),s.default.createElement("div",{className:"tile-option",onClick:()=>i("Map"),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||i("Map")}},s.default.createElement("div",{className:"tile-option-icon-wrapper"},s.default.createElement(lm,{className:"tile-option-icon"})),s.default.createElement("p",null,"View the map"))),s.default.createElement("div",{className:"divider-text"},"or"),s.default.createElement("div",{className:"suggested-questions-container"},s.default.createElement("strong",null,"Ask AI a question, e.g."),s.default.createElement("div",null,s.default.createElement("div",{className:"suggested-questions"},["What services are available for mental health support?","Can you list services that offer financial advice?","Are there any youth-focused services in the area?"].map((e=>s.default.createElement("div",{className:"suggested-question",onClick:()=>{c(e),d(!0)},role:"button",tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(c(e),d(!0))},"aria-label":`Ask about ${e}`},e))))))),s.default.createElement("div",{className:"chat-messages",ref:u},o.map(((e,t)=>{var n,r;return e.content?s.default.createElement("div",{key:t,className:`message ${e.role}`},s.default.createElement(lx,{components:{a:e=>{var t,n=
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["node"]);return s.default.createElement("a",Object.assign({target:"_blank",rel:"noopener noreferrer"},n,{href:(t=n.href,t&&t.startsWith("/service")?`${window.location.origin}${window.location.pathname}#${t}`:t)}))}}},e.content)):!o[t+1]&&e.toolInvocations.length>0?s.default.createElement("div",{key:t,className:`tool-use message ${e.role}`},s.default.createElement("p",{className:"tool-use-message"},"Searching for ",null===(r=null===(n=e.toolInvocations[0])||void 0===n?void 0:n.args)||void 0===r?void 0:r.naturalLanguageQuery,"...")):null}))),s.default.createElement("form",{onSubmit:a,className:"chat-input-form"},s.default.createElement("input",{type:"text",value:l,onChange:e=>c(e.target.value),placeholder:"Ask about services...",className:"chat-input"}),s.default.createElement("button",{type:"submit",className:"chat-submit"},"Send")))};Vd.addHook("afterSanitizeAttributes",(function(e){"target"in e&&e.setAttribute("target","_blank"),e.hasAttribute("target")||!e.hasAttribute("xlink:href")&&!e.hasAttribute("href")||e.setAttribute("xlink:show","new")}));const hx="https://book.plinth.org.uk",dx={"Health and Wellbeing":"#FF9999","Care Professionals and Organisation":"#99CCFF","Housing and Accommodation":"#99FF99","Financial Advice and Services":"#FFCC99"},fx=(e,t)=>{var n;const r=Vd.sanitize((e=>{const t=document.createElement("div");t.innerHTML=e;return(t.textContent||t.innerText||"").replace(/\n/g,"<br>")})(e.description),{ALLOWED_TAGS:["p","br"],ALLOWED_ATTR:[]}),i=(null===(n=e.offering)||void 0===n?void 0:n.filter((e=>{var n,r;return null===(r=null===(n=null==t?void 0:t.options)||void 0===n?void 0:n.offering)||void 0===r?void 0:r.includes(e)})))||[];return s.default.createElement("div",{key:e._id,className:"service-item"},s.default.createElement("div",{className:"service-item-content"},s.default.createElement("h3",{className:"service-name"},e.name),i.length>0&&s.default.createElement("div",{className:"service-categories"},s.default.createElement(Ed,{icon:Cd,className:"category-icon"}),i.map((e=>s.default.createElement("span",{key:e,className:"category-tag",style:{backgroundColor:dx[e]||"#CCCCCC"}},e)))),s.default.createElement("div",{className:"service-description clamped-description",dangerouslySetInnerHTML:{__html:r}})))};function px({services:t,loading:n,className:r,directoryId:i,programmeId:o,directory:a}){var l,u,h,d;const f=J(),p=Y(),m=new URLSearchParams(p.search),g=m.get("search")||"",v=parseInt(m.get("page")||"1",10),y=JSON.parse(m.get("categories")||"{}"),_=JSON.parse(m.get("aimedAt")||"{}"),[x,w]=e.useState(y),[b,E]=e.useState(_),[k,T]=e.useState(g),[M]=Kd(k,300),[S,C]=e.useState(v),A=Object.values(x).some((e=>e)),I=Object.values(b).some((e=>e)),[R,L]=e.useState([]),[z,P]=e.useState(!1),O=(null===(u=null===(l=null==a?void 0:a.options)||void 0===l?void 0:l.offering)||void 0===u?void 0:u.map((e=>({id:e,text:e}))))||[],D=(null===(d=null===(h=null==a?void 0:a.options)||void 0===h?void 0:h.aimedAt)||void 0===d?void 0:d.map((e=>({id:e,text:e}))))||[];e.useEffect((()=>{let e=!1;if(M||A||I){C(1);const t=()=>c(this,void 0,void 0,(function*(){P(!0);let t=`${hx}/api/directory/${i}/services?programmeId=${o}&q=${M}`;A&&(t+=`&categories=${encodeURIComponent(JSON.stringify(Object.keys(x).filter((e=>x[e]))))}`),I&&(t+=`&aimedAt=${encodeURIComponent(JSON.stringify(Object.keys(b).filter((e=>b[e]))))}`);try{const n=yield fetch(t);if(!e&&n.ok&&200===n.status){const e=yield n.json();L(e)}}catch(e){console.error("Error fetching services:",e)}finally{e||P(!1)}}));t()}else L([]);return()=>{e=!0}}),[M,i,o,x,b,A,I]);const B=k||A||I?R:t,F=10*S,j=F-10,N=B.slice(j,F),V=[{name:"List",icon:s.default.createElement(Ed,{icon:Md})},{name:"Map",icon:s.default.createElement(Ed,{icon:Pd})},{name:"Chat",icon:s.default.createElement(Ed,{icon:Rd})}],[U,H]=e.useState(V[2]);return e.useEffect((()=>{const e=new URLSearchParams;k&&e.set("search",k),1!==S&&e.set("page",S.toString()),Object.keys(x).length>0&&e.set("categories",JSON.stringify(x)),f(`${p.pathname}?${e.toString()}`,{replace:!0})}),[k,x,S,f,p.pathname]),s.default.createElement("div",{className:Me("embeddable-directory",r)},s.default.createElement("div",{className:"top-controls"},s.default.createElement("div",{className:"search-and-filters"},"Chat"!==U.name&&s.default.createElement(qd,{value:k,setValue:T}),s.default.createElement("div",{className:"filter-view-container"},"Chat"!==U.name?s.default.createElement("div",{className:"filter-buttons"},s.default.createElement(Oo,{label:"Categories",items:O,selected:x,setSelected:w}),s.default.createElement(Oo,{label:"Aimed at",position:"right",items:D,selected:b,setSelected:E})):s.default.createElement("div",null),s.default.createElement($l,{selected:U,setSelected:H,plans:V})))),s.default.createElement("div",{className:"content-container"},n?s.default.createElement("div",{className:"loading"},"Loading..."):s.default.createElement(s.default.Fragment,null,"List"===U.name&&s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:"service-list"},N.map(((t,n)=>s.default.createElement(e.Fragment,{key:t._id},((e,t)=>s.default.createElement("div",{key:e._id,className:"service-item"},s.default.createElement(_e,{to:`/service/${e._id}`,state:{from:p.pathname+p.search},className:"service-item",style:{textDecoration:"none",color:"inherit"}},s.default.createElement("div",{className:"service-item-content"},fx(e,t),s.default.createElement("div",{className:"service-contact-info"},e.phone&&s.default.createElement("p",null,s.default.createElement(Ed,{icon:Ad,className:"contact-icon"})," ",e.phone),e.email&&s.default.createElement("p",null,s.default.createElement(Ed,{icon:Ld,className:"contact-icon"})," ",e.email),e.website&&s.default.createElement("p",null,s.default.createElement(Ed,{icon:Sd,className:"contact-icon"})," ",e.website)),e.venue&&s.default.createElement("p",{className:"service-address"},s.default.createElement(Ed,{icon:zd,className:"address-icon"})," ",e.venue.address)))))(t,a),n<N.length-1&&s.default.createElement("hr",{className:"divider"}))))),s.default.createElement(Zd,{itemsPerPage:10,totalItems:B.length,paginate:e=>{C(e),window.scrollTo(0,0)},currentPage:S})),"Map"===U.name&&s.default.createElement(Ul,{items:B,renderPopup:e=>s.default.createElement("div",null,s.default.createElement(_e,{to:`/service/${e._id}`},s.default.createElement("h3",{className:"map-popup-name"},e.name)),s.default.createElement("div",{className:"service-description clamped-description",dangerouslySetInnerHTML:{__html:Vd.sanitize(e.description)}}))}),"Chat"===U.name&&s.default.createElement(ux,{services:B,programmeId:o,directoryId:i,onChangeView:e=>{var t;return H({name:e,icon:(null===(t=V.find((t=>t.name===e)))||void 0===t?void 0:t.icon)||s.default.createElement(s.default.Fragment,null)})}})),!n&&0===B.length&&s.default.createElement("div",{className:"no-results"},s.default.createElement("h2",{className:"no-results-title"},"No services found"),s.default.createElement("p",{className:"no-results-message"},"Try removing some of the filters"),s.default.createElement("button",{type:"button",onClick:()=>w({}),className:"tts-button"},"Remove all filters"))))}function mx({events:e,loading:t,signUpFormId:n,orgData:r,className:i}){return s.default.createElement("div",{className:Me("event-locator",i)},s.default.createElement("div",{className:"event-locator-content"},s.default.createElement("div",{className:"event-map-container"},s.default.createElement(Ul,{hideLocationTitle:!0,items:e.sort(((e,t)=>e.name.text.localeCompare(t.name.text))),renderPopup:e=>s.default.createElement(Ws,{customCTA:s.default.createElement("div",{className:"cta-wrapper"},s.default.createElement("a",{target:"_blank",className:"info-link",rel:"noopener noreferrer",href:`https://book.${Do}/e/${e._id}`},"Info"),s.default.createElement("a",{target:"_blank",className:"signup-link",rel:"noopener noreferrer",href:`https://book.${Do}/signup/${n}?tags=${encodeURIComponent(JSON.stringify(e.tags))}`},"Register")),orgData:r,className:"map-card",eventData:e,size:"xs"})}))))}px.defaultProps={className:void 0},mx.defaultProps={className:void 0};const gx="https://book.plinth.org.uk";function vx(){const[t,n]=e.useState(null),[r,i]=e.useState([]),[o,a]=e.useState([]),[l,u]=e.useState([]),[h,d]=e.useState(null),[f,p]=e.useState(!1),[m,g]=e.useState(void 0),[v,y]=e.useState(void 0),[_,x]=e.useState(void 0),[w,b]=e.useState(void 0),[E,k]=e.useState(void 0),[T,M]=e.useState(void 0);"undefined"!=typeof window&&console.log({document:document}),e.useEffect((()=>{const e=document.getElementById("plinth-directory");e&&(g(e.dataset.programmeId),y(e.dataset.directoryId),b(e.dataset.organisationId),k(e.dataset.signUpFormId),x(e.dataset.mode)),e&&console.log("dataset",e.dataset)}),[]),e.useEffect((()=>{let e=!1;var t,r;return m&&m.length>0?(t=m,r=v,c(void 0,void 0,void 0,(function*(){const e={method:"GET"},[n,i,o,a,s]=yield Promise.all([fetch(`${gx}/api/programme/${t}`,e).then((e=>e.json())),fetch(`${gx}/api/programme/${t}/events`,e).then((e=>e.json())),fetch(`${gx}/api/programme/${t}/organisations`,e).then((e=>e.json())),r?fetch(`${gx}/api/directory/${r}/services?programmeId=${t}`,e).then((e=>e.json())):Promise.resolve([]),r?fetch(`${gx}/api/directory/${r}`,e).then((e=>e.json())):Promise.resolve(null)]);return{programme:n,events:i,organisations:o,services:a,directory:s}}))).then((({programme:t,events:r,organisations:o,services:s,directory:l})=>{e||(n(t),a(r),i(o),u(s),d(l||null),p(!1))})).catch((t=>{console.log(t),M(t.message),e||p(!1)})):w&&w.length>0&&(e=>c(void 0,void 0,void 0,(function*(){const t={method:"GET"},[n,r]=yield Promise.all([fetch(`${gx}/api/org/${e}`,t).then((e=>e.json())),fetch(`${gx}/api/org/${e}/events?showAll=true&recurringOnly=true`,t).then((e=>e.json()))]);return console.log({eventsData:r}),{organisation:n,events:r}})))(w).then((({organisation:e,events:t})=>{console.log({organisation:e,events:t}),i([e]),a(t)})).catch((e=>{console.log(e),M(e.message)})),()=>{e=!0,p(!1)}}),[m,v,w]);return s.default.createElement(s.default.Fragment,null,(t||(null==o?void 0:o.length)>0)&&s.default.createElement(he,null,s.default.createElement(ce,{path:"/",element:(console.log("should render",{mode:_}),console.log({organisationId:w}),"directory"===_&&v&&m?s.default.createElement(px,{services:l,loading:f,directoryId:v,programmeId:m,directory:h}):"events"===_&&t?s.default.createElement(Bd,{programme:t,events:o,organisations:r,loading:f}):w&&w.length>0&&"org-events"===_&&E?(console.log("should render event locator"),s.default.createElement(mx,{events:o,loading:f,orgData:r[0],signUpFormId:E})):null)}),s.default.createElement(ce,{path:"/service/:id",element:s.default.createElement(Gd,{services:l,directory:h})})),!t&&!o.length&&s.default.createElement("p",null,"Loading"),T&&s.default.createElement("p",null,T))}document.addEventListener("DOMContentLoaded",(()=>{const e=document.getElementById("plinth-directory");e?l.default.render(s.default.createElement(s.default.StrictMode,null,s.default.createElement(ge,null,s.default.createElement(vx,null))),e):console.error("Container element 'plinth-directory' not found")}));var yx={exports:{}};!function(e,t){e.exports=function(){var e,t,n;function r(r,i){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",a={};e(a),n=i(a),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=i;else e=i}return r(["exports"],(function(e){var t="undefined"!=typeof self?self:{},n="2.15.0";let r;const i={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):e}catch(t){r=e}}return r},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!i.API_URL)return null;try{const e=new URL(i.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},o={supported:!1,testSupport:function(e){!l&&s&&(c?u(e):a=e)}};let a,s,l=!1,c=!1;function u(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s),e.isContextLost())return;o.supported=!0}catch(e){}e.deleteTexture(t),l=!0}t.document&&(s=t.document.createElement("img"),s.onload=function(){a&&u(a),a=null,c=!0},s.onerror=function(){l=!0,a=null},s.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const h="01";function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f=p;function p(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=r}p.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var o=this.sampleCurveDerivativeX(n);if(Math.abs(o)<1e-6)break;n-=i/o}var a=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?a=n:s=n,n=.5*(s-a)+a;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var m=d(f),g=v;function v(e,t){this.x=e,this.y=t}v.prototype={clone:function(){return new v(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=r,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-r*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},v.convert=function(e){return e instanceof v?e:Array.isArray(e)?new v(e[0],e[1]):e};var y=d(g);const _=Math.PI/180,x=180/Math.PI;function w(e){return e*_}function b(e){return e*x}const E=[[0,0],[1,0],[1,1],[0,1]];function k(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function T(e,t,n,r){const i=new m(e,t,n,r);return function(e){return i.solve(e)}}const M=T(.25,.1,.25,1);function S(e,t,n){return Math.min(n,Math.max(t,e))}function C(e,t,n){return(n=S((n-e)/(t-e),0,1))*n*(3-2*n)}function A(e,t,n){const r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function I(e,t,n){if(!e.length)return n(null,[]);let r=e.length;const i=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>{e&&(o=e),i[a]=t,0==--r&&n(o,i)}))}))}function R(e){const t=[];for(const n in e)t.push(e[n]);return t}function L(e,...t){for(const n of t)for(const t in n)e[t]=n[t];return e}let z=1;function P(){return z++}function O(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function D(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function B(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function F(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function j(e,t){return-1!==e.indexOf(t,e.length-t.length)}function N(e,t,n){const r={};for(const i in e)r[i]=t.call(n||this,e[i],i,e);return r}function V(e,t,n){const r={};for(const i in e)t.call(n||this,e[i],i,e)&&(r[i]=e[i]);return r}function U(e){return Array.isArray(e)?e.map(U):"object"==typeof e&&e?N(e,U):e}const H={};function W(e){H[e]||("undefined"!=typeof console&&console.warn(e),H[e]=!0)}function $(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function G(e){let t=0;for(let n,r,i=0,o=e.length,a=o-1;i<o;a=i++)n=e[i],r=e[a],t+=(r.x-n.x)*(n.y+r.y);return t}function q(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function Z(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,n,r,i)=>{const o=r||i;return t[n]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let X=null;function Y(e){if(null==X){const t=e.navigator?e.navigator.userAgent:null;X=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return X}function K(e){try{const n=t[e];return n.setItem("_mapbox_test_",1),n.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function J(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}const Q="mapbox-tiles";let ee,te,ne=500,re=50;function ie(){try{return t.caches}catch(e){}}function oe(){ie()&&!ee&&(ee=t.caches.open(Q))}function ae(e){const t=e.indexOf("?");if(t<0)return e;const n=function(e){const t=e.indexOf("?");return t>0?e.slice(t+1).split("&"):[]}(e),r=n.filter((e=>{const t=e.split("=");return"language"===t[0]||"worldview"===t[0]}));return r.length?`${e.slice(0,t)}?${r.join("&")}`:e.slice(0,t)}let se=1/0;const le={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(le);class ce extends Error{constructor(e,t,n){401===t&&xe(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const ue=q()?()=>self.worker&&self.worker.referrer:()=>("blob:"===t.location.protocol?t.parent:t).location.href,he=function(e,n){if(!(/^file:/.test(r=e.url)||/^file:/.test(ue())&&!/^\w+:/.test(r))){if(t.fetch&&t.Request&&t.AbortController&&t.Request.prototype.hasOwnProperty("signal"))return function(e,n){const r=new t.AbortController,i=new t.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:ue(),referrerPolicy:e.referrerPolicy,signal:r.signal});let o=!1,a=!1;const s=(l=i.url).indexOf("sku=")>0&&xe(l);var l;"json"===e.type&&i.headers.set("Accept","application/json");const c=(r,o,l)=>{if(a)return;if(r&&"SecurityError"!==r.message&&W(r.toString()),o&&l)return u(o);const c=Date.now();t.fetch(i).then((t=>{if(t.ok){const e=s?t.clone():null;return u(t,e,c)}return n(new ce(t.statusText,t.status,e.url))})).catch((t=>{"AbortError"!==t.name&&n(new Error(`${t.message} ${e.url}`))}))},u=(r,s,l)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{a||(s&&l&&function(e,n,r){if(oe(),!ee)return;const i={status:n.status,statusText:n.statusText,headers:new t.Headers};n.headers.forEach(((e,t)=>i.headers.set(t,e)));const o=Z(n.headers.get("Cache-Control")||"");if(o["no-store"])return;o["max-age"]&&i.headers.set("Expires",new Date(r+1e3*o["max-age"]).toUTCString());const a=i.headers.get("Expires");a&&(new Date(a).getTime()-r<42e4||function(e,t){if(void 0===te)try{new Response(new ReadableStream),te=!0}catch(e){te=!1}te?t(e.body):e.blob().then(t)}(n,(n=>{const r=new t.Response(n,i);oe(),ee&&ee.then((t=>t.put(ae(e.url),r))).catch((e=>W(e.message)))})))}(i,s,l),o=!0,n(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{a||n(new Error(e.message))}))};return s?function(e,t){if(oe(),!ee)return t(null);const n=ae(e.url);ee.then((e=>{e.match(n).then((r=>{const i=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),n=Z(e.headers.get("Cache-Control")||"");return t>Date.now()&&!n["no-cache"]}(r);e.delete(n),i&&e.put(n,r.clone()),t(null,r,i)})).catch(t)})).catch(t)}(i,c):c(null,null),{cancel:()=>{a=!0,o||r.abort()}}}(e,n);if(q()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,n,void 0,!0)}var r;return function(e,n){const r=new t.XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{n(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let t=r.response;if("json"===e.type)try{t=JSON.parse(r.response)}catch(e){return n(e)}n(null,t,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else n(new ce(r.statusText,r.status,e.url))},r.send(e.body),{cancel:()=>r.abort()}}(e,n)},de=function(e,t){return he(L(e,{type:"arrayBuffer"}),t)};function fe(e){const n=t.document.createElement("a");return n.href=e,n.protocol===t.document.location.protocol&&n.host===t.document.location.host}const pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let me,ge;me=[],ge=0;const ve=function(e,n){if(o.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),ge>=i.MAX_PARALLEL_IMAGE_REQUESTS){const t={requestParameters:e,callback:n,cancelled:!1,cancel(){this.cancelled=!0}};return me.push(t),t}ge++;let r=!1;const a=()=>{if(!r)for(r=!0,ge--;me.length&&ge<i.MAX_PARALLEL_IMAGE_REQUESTS;){const e=me.shift(),{requestParameters:t,callback:n,cancelled:r}=e;r||(e.cancel=ve(t,n).cancel)}},s=de(e,((e,r,i,o)=>{a(),e?n(e):r&&(t.createImageBitmap?function(e,n){const r=new t.Blob([new Uint8Array(e)],{type:"image/png"});t.createImageBitmap(r).then((e=>{n(null,e)})).catch((e=>{n(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(r,((e,t)=>n(e,t,i,o))):function(e,n){const r=new t.Image,i=t.URL;r.onload=()=>{n(null,r),i.revokeObjectURL(r.src),r.onload=null,t.requestAnimationFrame((()=>{r.src=pe}))},r.onerror=()=>n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const o=new t.Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?i.createObjectURL(o):pe}(r,((e,t)=>n(e,t,i,o))))}));return{cancel:()=>{s.cancel(),a()}}},ye="NO_ACCESS_TOKEN";function _e(e){return 0===e.indexOf("mapbox:")}function xe(e){return i.API_URL_REGEX.test(e)}function we(e){return i.API_CDN_URL_REGEX.test(e)}function be(e){return i.API_STYLE_REGEX.test(e)&&!Ee(e)}function Ee(e){return i.API_SPRITE_REGEX.test(e)}const ke=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Te(e){const t=e.match(ke);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Me(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const Se="mapbox.eventData";function Ce(e){if(!e)return null;const n=e.split(".");if(!n||3!==n.length)return null;try{return JSON.parse(decodeURIComponent(t.atob(n[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class Ae{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const n=Ce(i.ACCESS_TOKEN);let r="";return r=n&&n.u?t.btoa(encodeURIComponent(n.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):i.ACCESS_TOKEN||"",e?`${Se}.${e}:${r}`:`${Se}:${r}`}fetchEventData(){const e=K("localStorage"),n=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{const e=t.localStorage.getItem(n);e&&(this.eventData=JSON.parse(e));const i=t.localStorage.getItem(r);i&&(this.anonId=i)}catch(e){W("Unable to read from LocalStorage")}}saveEventData(){const e=K("localStorage"),n=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{t.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&t.localStorage.setItem(n,JSON.stringify(this.eventData))}catch(e){W("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,n,r){if(!i.EVENTS_URL)return;const o=Te(i.EVENTS_URL);o.params.push(`access_token=${r||i.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(e).toISOString()},s=t?L(a,t):a,l={url:Me(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=function(e,t){return he(L(e,{method:"POST"}),t)}(l,(e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(r)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const Ie=new class extends Ae{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){i.EVENTS_URL&&i.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>_e(e)||xe(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Ce(i.ACCESS_TOKEN),r=t?t.u:i.ACCESS_TOKEN;let o=r!==this.eventData.tokenU;B(this.anonId)||(this.anonId=O(),o=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(a),n=(a-this.eventData.lastSuccess)/864e5;o=o||n>=1||n<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:n,skuId:h,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=a,this.eventData.tokenU=r)}),e):this.processRequests()}},Re=Ie.postTurnstileEvent.bind(Ie),Le=new class extends Ae{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,n,r){this.skuToken=t,this.errorCb=r,i.EVENTS_URL&&(n||i.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},n):this.errorCb(new Error(ye)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:r}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),B(this.anonId)||(this.anonId=O()),this.postEvent(r,{sdkIdentifier:"mapbox-gl-js",sdkVersion:n,skuId:h,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e))}},ze=Le.postMapLoadEvent.bind(Le),Pe=new class extends Ae{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){i.EVENTS_URL&&(e||i.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:r,performanceData:i}=this.queue.shift(),o=function(e){const r=t.performance.getEntriesByType("resource"),i=t.performance.getEntriesByType("mark"),o=function(e){const t={};if(e)for(const n in e)if("other"!==n)for(const r of e[n]){const e=`${n}ResolveRangeMin`,i=`${n}ResolveRangeMax`,o=`${n}RequestCount`,a=`${n}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,r.startTime),t[i]=Math.max(t[i]||-1/0,r.responseEnd);const s=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==r.transferSize&&0===r.transferSize&&s(a),s(o)}return t}(function(e,t){const n={};if(e)for(const r of e){const e=t(r);void 0===n[e]&&(n[e]=[]),n[e].push(r)}return n}(r,Ve)),a=t.devicePixelRatio,s=t.navigator.connection||t.navigator.mozConnection||t.navigator.webkitConnection,l={counters:[],metadata:[],attributes:[]},c=(e,t,n)=>{null!=n&&e.push({name:t,value:n.toString()})};for(const e in o)c(l.counters,e,o[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(c(l.counters,"interactionRangeMin",e.interactionRange[0]),c(l.counters,"interactionRangeMax",e.interactionRange[1])),i)for(const e of Object.keys(je)){const t=je[e],n=i.find((e=>e.name===t));n&&c(l.counters,t,n.startTime)}return c(l.counters,"visibilityHidden",e.visibilityHidden),c(l.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(be(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(r)),c(l.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),c(l.attributes,"fogEnabled",e.fogEnabled?"true":"false"),c(l.attributes,"projection",e.projection),c(l.attributes,"zoom",e.zoom),c(l.metadata,"devicePixelRatio",a),c(l.metadata,"connectionEffectiveType",s?s.effectiveType:void 0),c(l.metadata,"navigatorUserAgent",t.navigator.userAgent),c(l.metadata,"screenWidth",t.screen.width),c(l.metadata,"screenHeight",t.screen.height),c(l.metadata,"windowWidth",t.innerWidth),c(l.metadata,"windowHeight",t.innerHeight),c(l.metadata,"mapWidth",e.width/a),c(l.metadata,"mapHeight",e.height/a),c(l.metadata,"webglRenderer",e.renderer),c(l.metadata,"webglVendor",e.vendor),c(l.metadata,"sdkVersion",n),c(l.metadata,"sdkIdentifier","mapbox-gl-js"),l}(i);for(const e of o.metadata);for(const e of o.counters);for(const e of o.attributes);this.postEvent(r,o,(()=>{}),e)}},Oe=Pe.postPerformanceEvent.bind(Pe),De=new class extends Ae{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,n,r){if(!i.API_URL||!i.SESSION_PATH)return;const o=Te(i.API_URL+i.SESSION_PATH);o.params.push(`sku=${t||""}`),o.params.push(`access_token=${r||i.ACCESS_TOKEN||""}`);const a={url:Me(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return he(L(e,{method:"GET"}),t)}(a,(e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(r)}))}getSessionAPI(e,t,n,r){this.skuToken=t,this.errorCb=r,i.SESSION_PATH&&i.API_URL&&(n||i.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},n):this.errorCb(new Error(ye)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:n}=this.queue.shift();t&&this.success[t]||this.getSession(n,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}},Be=De.getSessionAPI.bind(De),Fe=new Set,je={create:"create",load:"load",fullLoad:"fullLoad"},Ne={mark(e){t.performance.mark(e)},measure(e,n,r){t.performance.measure(e,n,r)}};function Ve(e){const t=e.name.split("?")[0];return we(t)&&t.includes("mapbox-gl.js")?"javascript":we(t)&&t.includes("mapbox-gl.css")?"css":function(e){return i.API_FONTS_REGEX.test(e)}(t)?"fontRange":Ee(t)?"sprite":be(t)?"style":function(e){return i.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}const Ue=t.performance;function He(e){const t=e?e.url.toString():void 0;return Ue.getEntriesByName(t)}let We,$e,Ge,qe;const Ze={now:()=>void 0!==Ge?Ge:t.performance.now(),setNow(e){Ge=e},restoreNow(){Ge=void 0},frame(e){const n=t.requestAnimationFrame(e);return{cancel:()=>t.cancelAnimationFrame(n)}},getImageData(e,n=0){const{width:r,height:i}=e;qe||(qe=t.document.createElement("canvas"));const o=qe.getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");return(r>qe.width||i>qe.height)&&(qe.width=r,qe.height=i),o.clearRect(-n,-n,r+2*n,i+2*n),o.drawImage(e,0,0,r,i),o.getImageData(-n,-n,r+2*n,i+2*n)},resolveURL:e=>(We||(We=t.document.createElement("a")),We.href=e,We.href),get devicePixelRatio(){return t.devicePixelRatio},get prefersReducedMotion(){return!!t.matchMedia&&(null==$e&&($e=t.matchMedia("(prefers-reduced-motion: reduce)")),$e.matches)}};function Xe(e,t,n){n[e]&&-1!==n[e].indexOf(t)||(n[e]=n[e]||[],n[e].push(t))}function Ye(e,t,n){if(n&&n[e]){const r=n[e].indexOf(t);-1!==r&&n[e].splice(r,1)}}class Ke{constructor(e,t={}){L(this,t),this.type=e}}class Je extends Ke{constructor(e,t={}){super("error",L({error:e},t))}}class Qe{on(e,t){return this._listeners=this._listeners||{},Xe(e,t,this._listeners),this}off(e,t){return Ye(e,t,this._listeners),Ye(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},Xe(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new Ke(e,t||{}));const n=e.type;if(this.listens(n)){e.target=this;const t=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const n of t)n.call(this,e);const r=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const t of r)Ye(n,t,this._oneTimeListeners),t.call(this,e);const i=this._eventedParent;i&&(L(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof Je&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var et=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"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":true,"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":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"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":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"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":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"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_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"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":true,"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"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":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"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":true,"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":false,"parameters":["zoom"]},"property-type":"data-constant"},"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":false,"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":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"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":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"requires":["fill-extrusion-edge-radius"],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function tt(e,...t){for(const n of t)for(const t in n)e[t]=n[t];return e}function nt(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function rt(e){if(Array.isArray(e))return e.map(rt);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const n in e)t[n]=rt(e[n]);return t}return nt(e)}class it extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}var ot=it;class at{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,n]of t)this.bindings[e]=n}concat(e){return new at(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var st=at;const lt={kind:"null"},ct={kind:"number"},ut={kind:"string"},ht={kind:"boolean"},dt={kind:"color"},ft={kind:"object"},pt={kind:"value"},mt={kind:"collator"},gt={kind:"formatted"},vt={kind:"resolvedImage"};function yt(e,t){return{kind:"array",itemType:e,N:t}}function _t(e){if("array"===e.kind){const t=_t(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const xt=[lt,ct,ut,ht,dt,gt,ft,yt(pt),vt];function wt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!wt(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of xt)if(!wt(e,t))return null}return`Expected ${_t(e)} but found ${_t(t)} instead.`}function bt(e,t){return t.some((t=>t.kind===e.kind))}function Et(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}var kt,Tt={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Mt(e){return(e=Math.round(e))<0?0:e>255?255:e}function St(e){return Mt("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Ct(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function At(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}try{kt={}.parseCSSColor=function(e){var t,n=e.replace(/ /g,"").toLowerCase();if(n in Tt)return Tt[n].slice();if("#"===n[0])return 4===n.length?(t=parseInt(n.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===n.length&&(t=parseInt(n.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var r=n.indexOf("("),i=n.indexOf(")");if(-1!==r&&i+1===n.length){var o=n.substr(0,r),a=n.substr(r+1,i-(r+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=Ct(a.pop());case"rgb":return 3!==a.length?null:[St(a[0]),St(a[1]),St(a[2]),s];case"hsla":if(4!==a.length)return null;s=Ct(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,c=Ct(a[1]),u=Ct(a[2]),h=u<=.5?u*(c+1):u+c-u*c,d=2*u-h;return[Mt(255*At(d,h,l+1/3)),Mt(255*At(d,h,l)),Mt(255*At(d,h,l-1/3)),s];default:return null}}return null}}catch(e){}class It{constructor(e,t,n,r=1){this.r=e,this.g=t,this.b=n,this.a=r}static parse(e){if(!e)return;if(e instanceof It)return e;if("string"!=typeof e)return;const t=kt(e);return t?new It(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,n,r]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(n)},${r})`}toArray(){const{r:e,g:t,b:n,a:r}=this;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*n/r,r]}toArray01(){const{r:e,g:t,b:n,a:r}=this;return 0===r?[0,0,0,0]:[e/r,t/r,n/r,r]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:n,a:r}=this;return[e,t,n,r]}}It.black=new It(0,0,0,1),It.white=new It(1,1,1,1),It.transparent=new It(0,0,0,0),It.red=new It(1,0,0,1),It.blue=new It(0,0,1,1);var Rt=It;class Lt{constructor(e,t,n){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class zt{constructor(e,t,n,r,i){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i}}class Pt{constructor(e){this.sections=e}static fromString(e){return new Pt([new zt(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Pt?e:Pt.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const n={};t.fontStack&&(n["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(n["font-scale"]=t.scale),t.textColor&&(n["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(n)}return e}}class Ot{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Ot({name:e,available:!1}):null}serialize(){return["image",this.name]}}function Dt(e,t,n,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[e,t,n,r]:[e,t,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Bt(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Rt)return!0;if(e instanceof Lt)return!0;if(e instanceof Pt)return!0;if(e instanceof Ot)return!0;if(Array.isArray(e)){for(const t of e)if(!Bt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Bt(e[t]))return!1;return!0}return!1}function Ft(e){if(null===e)return lt;if("string"==typeof e)return ut;if("boolean"==typeof e)return ht;if("number"==typeof e)return ct;if(e instanceof Rt)return dt;if(e instanceof Lt)return mt;if(e instanceof Pt)return gt;if(e instanceof Ot)return vt;if(Array.isArray(e)){const t=e.length;let n;for(const t of e){const e=Ft(t);if(n){if(n===e)continue;n=pt;break}n=e}return yt(n||pt,t)}return ft}function jt(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Rt||e instanceof Pt||e instanceof Ot?e.toString():JSON.stringify(e)}class Nt{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Bt(e[1]))return t.error("invalid value");const n=e[1];let r=Ft(n);const i=t.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new Nt(r,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Rt?["rgba"].concat(this.value.toArray()):this.value instanceof Pt?this.value.serialize():this.value}}var Vt=Nt,Ut=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};const Ht={string:ut,number:ct,boolean:ht,object:ft};class Wt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let n,r=1;const i=e[0];if("array"===i){let i,o;if(e.length>2){const n=e[1];if("string"!=typeof n||!(n in Ht)||"object"===n)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=Ht[n],r++}else i=pt;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],r++}n=yt(i,o)}else n=Ht[i];const o=[];for(;r<e.length;r++){const n=t.parse(e[r],r,pt);if(!n)return null;o.push(n)}return new Wt(n,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const n=this.args[t].evaluate(e);if(!wt(this.type,Ft(n)))return n;if(t===this.args.length-1)throw new Ut(`Expected value to be of type ${_t(this.type)}, but found ${_t(Ft(n))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const n=e.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){t.push(n.kind);const r=e.N;("number"==typeof r||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map((e=>e.serialize())))}}var $t=Wt;class Gt{constructor(e){this.type=gt,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&"object"==typeof n)return t.error("First argument must be an image or text section.");const r=[];let i=!1;for(let n=1;n<=e.length-1;++n){const o=e[n];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,ct),!e))return null;let n=null;if(o["text-font"]&&(n=t.parse(o["text-font"],1,yt(ut)),!n))return null;let a=null;if(o["text-color"]&&(a=t.parse(o["text-color"],1,dt),!a))return null;const s=r[r.length-1];s.scale=e,s.font=n,s.textColor=a}else{const o=t.parse(e[n],1,pt);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:o,scale:null,font:null,textColor:null})}}return new Gt(r)}evaluate(e){return new Pt(this.sections.map((t=>{const n=t.content.evaluate(e);return Ft(n)===vt?new zt("",n,null,null,null):new zt(jt(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const n={};t.scale&&(n["font-scale"]=t.scale.serialize()),t.font&&(n["text-font"]=t.font.serialize()),t.textColor&&(n["text-color"]=t.textColor.serialize()),e.push(n)}return e}}class qt{constructor(e){this.type=vt,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const n=t.parse(e[1],1,ut);return n?new qt(n):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),n=Ot.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Zt={"to-boolean":ht,"to-color":dt,"to-number":ct,"to-string":ut};class Xt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[0];if(("to-boolean"===n||"to-string"===n)&&2!==e.length)return t.error("Expected one argument.");const r=Zt[n],i=[];for(let n=1;n<e.length;n++){const r=t.parse(e[n],n,pt);if(!r)return null;i.push(r)}return new Xt(r,i)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,n;for(const r of this.args){if(t=r.evaluate(e),n=null,t instanceof Rt)return t;if("string"==typeof t){const n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Dt(t[0],t[1],t[2],t[3]),!n))return new Rt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ut(n||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const n of this.args){if(t=n.evaluate(e),null===t)return 0;const r=Number(t);if(!isNaN(r))return r}throw new Ut(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Pt.fromString(jt(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Ot.fromString(jt(this.args[0].evaluate(e))):jt(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Gt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new qt(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}var Yt=Xt;const Kt=["Unknown","Point","LineString","Polygon"];var Jt=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Kt[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:n,y:r}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*t-e[0])+this.featureDistanceData.bearing[1]*(r*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Rt.parse(e)),t}};class Qt{constructor(e,t,n,r){this.name=e,this.type=t,this._evaluate=n,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const n=e[0],r=Qt.definitions[n];if(!r)return t.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let s=null;for(const[r,o]of a){s=new Sn(t.registry,t.path,null,t.scope);const a=[];let l=!1;for(let t=1;t<e.length;t++){const n=e[t],i=Array.isArray(r)?r[t-1]:r.type,o=s.parse(n,1+a.length,i);if(!o){l=!0;break}a.push(o)}if(!l)if(Array.isArray(r)&&r.length!==a.length)s.error(`Expected ${r.length} arguments, but found ${a.length} instead.`);else{for(let e=0;e<a.length;e++){const t=Array.isArray(r)?r[e]:r.type,n=a[e];s.concat(e+1).checkSubtype(t,n.type)}if(0===s.errors.length)return new Qt(n,i,o,a)}}if(1===a.length)t.errors.push(...s.errors);else{const n=(a.length?a:o).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map(_t).join(", ")})`:`(${_t(t.type)}...)`;var t})).join(" | "),r=[];for(let n=1;n<e.length;n++){const i=t.parse(e[n],1+r.length);if(!i)return null;r.push(_t(i.type))}t.error(`Expected arguments of type ${n}, but found (${r.join(", ")}) instead.`)}return null}static register(e,t){Qt.definitions=t;for(const n in t)e[n]=Qt}}var en=Qt;class tn{constructor(e,t,n){this.type=mt,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const n=e[1];if("object"!=typeof n||Array.isArray(n))return t.error("Collator options argument must be an object.");const r=t.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,ht);if(!r)return null;const i=t.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,ht);if(!i)return null;let o=null;return n.locale&&(o=t.parse(n.locale,1,ut),!o)?null:new tn(r,i,o)}evaluate(e){return new Lt(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const nn=8192;function rn(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function on(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function an(e,t){const n=(180+e[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(n*i*nn),Math.round(r*i*nn)]}function sn(e,t,n){const r=e[0]-t[0],i=e[1]-t[1],o=e[0]-n[0],a=e[1]-n[1];return r*a-o*i==0&&r*o<=0&&i*a<=0}function ln(e,t){let n=!1;for(let a=0,s=t.length;a<s;a++){const s=t[a];for(let t=0,a=s.length;t<a-1;t++){if(sn(e,s[t],s[t+1]))return!1;(i=s[t])[1]>(r=e)[1]!=(o=s[t+1])[1]>r[1]&&r[0]<(o[0]-i[0])*(r[1]-i[1])/(o[1]-i[1])+i[0]&&(n=!n)}}var r,i,o;return n}function cn(e,t){for(let n=0;n<t.length;n++)if(ln(e,t[n]))return!0;return!1}function un(e,t,n,r){const i=r[0]-n[0],o=r[1]-n[1],a=(e[0]-n[0])*o-i*(e[1]-n[1]),s=(t[0]-n[0])*o-i*(t[1]-n[1]);return a>0&&s<0||a<0&&s>0}function hn(e,t,n){for(const c of n)for(let n=0;n<c.length-1;++n)if(0!=(s=[(a=c[n+1])[0]-(o=c[n])[0],a[1]-o[1]])[0]*(l=[(i=t)[0]-(r=e)[0],i[1]-r[1]])[1]-s[1]*l[0]&&un(r,i,o,a)&&un(o,a,r,i))return!0;var r,i,o,a,s,l;return!1}function dn(e,t){for(let n=0;n<e.length;++n)if(!ln(e[n],t))return!1;for(let n=0;n<e.length-1;++n)if(hn(e[n],e[n+1],t))return!1;return!0}function fn(e,t){for(let n=0;n<t.length;n++)if(dn(e,t[n]))return!0;return!1}function pn(e,t,n){const r=[];for(let i=0;i<e.length;i++){const o=[];for(let r=0;r<e[i].length;r++){const a=an(e[i][r],n);rn(t,a),o.push(a)}r.push(o)}return r}function mn(e,t,n){const r=[];for(let i=0;i<e.length;i++){const o=pn(e[i],t,n);r.push(o)}return r}function gn(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){const t=.5*r;let i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;0===i&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}rn(t,e)}function vn(e,t,n,r){const i=Math.pow(2,r.z)*nn,o=[r.x*nn,r.y*nn],a=[];if(!e)return a;for(const r of e)for(const e of r){const r=[e.x+o[0],e.y+o[1]];gn(r,t,n,i),a.push(r)}return a}function yn(e,t,n,r){const i=Math.pow(2,r.z)*nn,o=[r.x*nn,r.y*nn],a=[];if(!e)return a;for(const n of e){const e=[];for(const r of n){const n=[r.x+o[0],r.y+o[1]];rn(t,n),e.push(n)}a.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const r of e)gn(r,t,n,i)}var s;return a}class _n{constructor(e,t){this.type=ht,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Bt(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const n=t.features[e].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new _n(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new _n(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new _n(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=pn(t.coordinates,r,i),a=vn(e.geometry(),n,r,i);if(!on(n,r))return!1;for(const e of a)if(!ln(e,o))return!1}if("MultiPolygon"===t.type){const o=mn(t.coordinates,r,i),a=vn(e.geometry(),n,r,i);if(!on(n,r))return!1;for(const e of a)if(!cn(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(!i)return!1;if("Polygon"===t.type){const o=pn(t.coordinates,r,i),a=yn(e.geometry(),n,r,i);if(!on(n,r))return!1;for(const e of a)if(!dn(e,o))return!1}if("MultiPolygon"===t.type){const o=mn(t.coordinates,r,i),a=yn(e.geometry(),n,r,i);if(!on(n,r))return!1;for(const e of a)if(!fn(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var xn=_n;function wn(e){if(e instanceof en){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof xn)return!1;let t=!0;return e.eachChild((e=>{t&&!wn(e)&&(t=!1)})),t}function bn(e){if(e instanceof en&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!bn(e)&&(t=!1)})),t}function En(e,t){if(e instanceof en&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild((e=>{n&&!En(e,t)&&(n=!1)})),n}class kn{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const n=e[1];return t.scope.has(n)?new kn(n,t.scope.get(n)):t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var Tn=kn;class Mn{constructor(e,t=[],n,r=new st,i=[]){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=r,this.errors=i,this.expectedType=n}parse(e,t,n,r,i={}){return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}_parse(e,t){function n(e,t,n){return"assert"===n?new $t(t,[e]):"coerce"===n?new Yt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=e[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[r];if(i){let r=i.parse(e,this);if(!r)return null;if(this.expectedType){const e=this.expectedType,i=r.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==i.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(e,i))return null}else r=n(r,e,t.typeAnnotation||"coerce");else r=n(r,e,t.typeAnnotation||"assert")}if(!(r instanceof Vt)&&"resolvedImage"!==r.type.kind&&Cn(r)){const t=new Jt;try{r=new Vt(r.type,r.evaluate(t))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,n){const r="number"==typeof e?this.path.concat(e):this.path,i=n?this.scope.concat(n):this.scope;return new Mn(this.registry,r,t||null,i,this.errors)}error(e,...t){const n=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new ot(n,e))}checkSubtype(e,t){const n=wt(e,t);return n&&this.error(n),n}}var Sn=Mn;function Cn(e){if(e instanceof Tn)return Cn(e.boundExpression);if(e instanceof en&&"error"===e.name)return!1;if(e instanceof tn)return!1;if(e instanceof xn)return!1;const t=e instanceof Yt||e instanceof $t;let n=!0;return e.eachChild((e=>{n=t?n&&Cn(e):n&&e instanceof Vt})),!!n&&wn(e)&&En(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function An(e,t){const n=e.length-1;let r,i,o=0,a=n,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),r=e[s],i=e[s+1],r<=t){if(s===n||t<i)return s;o=s+1}else{if(!(r>t))throw new Ut("Input is not a number.");a=s-1}return 0}class In{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const n=t.parse(e[1],1,ct);if(!n)return null;const r=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let n=1;n<e.length;n+=2){const o=1===n?-1/0:e[n],a=e[n+1],s=n,l=n+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(r.length&&r[r.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(a,l,i);if(!c)return null;i=i||c.type,r.push([o,c])}return new In(i,n,r)}evaluate(e){const t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);const i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[An(t,r)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var Rn=In;function Ln(e,t,n){return e*(1-n)+t*n}var zn=Object.freeze({__proto__:null,array:function(e,t,n){return e.map(((e,r)=>Ln(e,t[r],n)))},color:function(e,t,n){return new Rt(Ln(e.r,t.r,n),Ln(e.g,t.g,n),Ln(e.b,t.b,n),Ln(e.a,t.a,n))},number:Ln});const Pn=.95047,On=1.08883,Dn=4/29,Bn=6/29,Fn=3*Bn*Bn,jn=Bn*Bn*Bn,Nn=Math.PI/180,Vn=180/Math.PI;function Un(e){return e>jn?Math.pow(e,1/3):e/Fn+Dn}function Hn(e){return e>Bn?e*e*e:Fn*(e-Dn)}function Wn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $n(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Gn(e){const t=$n(e.r),n=$n(e.g),r=$n(e.b),i=Un((.4124564*t+.3575761*n+.1804375*r)/Pn),o=Un((.2126729*t+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Un((.0193339*t+.119192*n+.9503041*r)/On)),alpha:e.a}}function qn(e){let t=(e.l+16)/116,n=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=1*Hn(t),n=Pn*Hn(n),r=On*Hn(r),new Rt(Wn(3.2404542*n-1.5371385*t-.4985314*r),Wn(-.969266*n+1.8760108*t+.041556*r),Wn(.0556434*n-.2040259*t+1.0572252*r),e.alpha)}function Zn(e,t,n){const r=t-e;return e+n*(r>180||r<-180?r-360*Math.round(r/360):r)}const Xn={forward:Gn,reverse:qn,interpolate:function(e,t,n){return{l:Ln(e.l,t.l,n),a:Ln(e.a,t.a,n),b:Ln(e.b,t.b,n),alpha:Ln(e.alpha,t.alpha,n)}}},Yn={forward:function(e){const{l:t,a:n,b:r}=Gn(e),i=Math.atan2(r,n)*Vn;return{h:i<0?i+360:i,c:Math.sqrt(n*n+r*r),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Nn,n=e.c;return qn({l:e.l,a:Math.cos(t)*n,b:Math.sin(t)*n,alpha:e.alpha})},interpolate:function(e,t,n){return{h:Zn(e.h,t.h,n),c:Ln(e.c,t.c,n),l:Ln(e.l,t.l,n),alpha:Ln(e.alpha,t.alpha,n)}}};var Kn=Object.freeze({__proto__:null,hcl:Yn,lab:Xn});class Jn{constructor(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if("exponential"===e.name)i=Qn(t,e.base,n,r);else if("linear"===e.name)i=Qn(t,1,n,r);else if("cubic-bezier"===e.name){const o=e.controlPoints;i=new m(o[0],o[1],o[2],o[3]).solve(Qn(t,1,n,r))}return i}static parse(e,t){let[n,r,i,...o]=e;if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const e=r[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:e}}else{if("cubic-bezier"!==r[0])return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);{const e=r.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,ct),!i)return null;const a=[];let s=null;"interpolate-hcl"===n||"interpolate-lab"===n?s=dt:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e<o.length;e+=2){const n=o[e],r=o[e+1],i=e+3,l=e+4;if("number"!=typeof n)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(a.length&&a[a.length-1][0]>=n)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=t.parse(r,l,s);if(!c)return null;s=s||c.type,a.push([n,c])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new Jn(s,n,r,i,a):t.error(`Type ${_t(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);const i=t.length;if(r>=t[i-1])return n[i-1].evaluate(e);const o=An(t,r),a=Jn.interpolationFactor(this.interpolation,r,t[o],t[o+1]),s=n[o].evaluate(e),l=n[o+1].evaluate(e);return"interpolate"===this.operator?zn[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?Yn.reverse(Yn.interpolate(Yn.forward(s),Yn.forward(l),a)):Xn.reverse(Xn.interpolate(Xn.forward(s),Xn.forward(l),a))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function Qn(e,t,n,r){const i=r-n,o=e-n;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}var er=Jn;class tr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let n=null;const r=t.expectedType;r&&"value"!==r.kind&&(n=r);const i=[];for(const r of e.slice(1)){const e=t.parse(r,1+i.length,n,void 0,{typeAnnotation:"omit"});if(!e)return null;n=n||e.type,i.push(e)}const o=r&&i.some((e=>wt(r,e.type)));return new tr(o?pt:n,i)}evaluate(e){let t,n=null,r=0;for(const i of this.args){if(r++,n=i.evaluate(e),n&&n instanceof Ot&&!n.available&&(t||(t=n),n=null,r===this.args.length))return t;if(null!==n)break}return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var nr=tr;class rr{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let r=1;r<e.length-1;r+=2){const i=e[r];if("string"!=typeof i)return t.error(`Expected string, but found ${typeof i} instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=t.parse(e[r+1],r+1);if(!o)return null;n.push([i,o])}const r=t.parse(e[e.length-1],e.length-1,t.expectedType,n);return r?new rr(n,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,n]of this.bindings)e.push(t,n.serialize());return e.push(this.result.serialize()),e}}var ir=rr;class or{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,ct),r=t.parse(e[2],2,yt(t.expectedType||pt));return n&&r?new or(r.type.itemType,n,r):null}evaluate(e){const t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new Ut(`Array index out of bounds: ${t} < 0.`);if(t>=n.length)throw new Ut(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new Ut(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var ar=or;class sr{constructor(e,t){this.type=ht,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,pt),r=t.parse(e[2],2,pt);return n&&r?bt(n.type,[ht,ut,ct,lt,pt])?new sr(n,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(n.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(null==n)return!1;if(!Et(t,["boolean","string","number","null"]))throw new Ut(`Expected first argument to be of type boolean, string, number or null, but found ${_t(Ft(t))} instead.`);if(!Et(n,["string","array"]))throw new Ut(`Expected second argument to be of type array or string, but found ${_t(Ft(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var lr=sr;class cr{constructor(e,t,n){this.type=ct,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,pt),r=t.parse(e[2],2,pt);if(!n||!r)return null;if(!bt(n.type,[ht,ut,ct,lt,pt]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(n.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,ct);return i?new cr(n,r,i):null}return new cr(n,r)}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Et(t,["boolean","string","number","null"]))throw new Ut(`Expected first argument to be of type boolean, string, number or null, but found ${_t(Ft(t))} instead.`);if(!Et(n,["string","array"]))throw new Ut(`Expected second argument to be of type array or string, but found ${_t(Ft(n))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(e);return n.indexOf(t,r)}return n.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var ur=cr;class hr{constructor(e,t,n,r,i,o){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let n,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const i={},o=[];for(let a=2;a<e.length-1;a+=2){let s=e[a];const l=e[a+1];Array.isArray(s)||(s=[s]);const c=t.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,Ft(e)))return null}else n=Ft(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=o.length}const u=t.parse(l,a,r);if(!u)return null;r=r||u.type,o.push(u)}const a=t.parse(e[1],1,pt);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,r);return s?"value"!==a.type.kind&&t.concat(1).checkSubtype(n,a.type)?null:new hr(n,r,a,i,o,s):null}evaluate(e){const t=this.input.evaluate(e);return(Ft(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),n=[],r={};for(const e of t){const t=r[this.cases[e]];void 0===t?(r[this.cases[e]]=n.length,n.push([this.cases[e],[e]])):n[t][1].push(e)}const i=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,r]of n)e.push(1===r.length?i(r[0]):r.map(i)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}var dr=hr;class fr{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const r=[];for(let i=1;i<e.length-1;i+=2){const o=t.parse(e[i],i,ht);if(!o)return null;const a=t.parse(e[i+1],i+1,n);if(!a)return null;r.push([o,a]),n=n||a.type}const i=t.parse(e[e.length-1],e.length-1,n);return i?new fr(n,r,i):null}evaluate(e){for(const[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var pr=fr;class mr{constructor(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,pt),r=t.parse(e[2],2,ct);if(!n||!r)return null;if(!bt(n.type,[yt(pt),ut,pt]))return t.error(`Expected first argument to be of type array or string, but found ${_t(n.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,ct);return i?new mr(n.type,n,r,i):null}return new mr(n.type,n,r)}evaluate(e){const t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!Et(t,["string","array"]))throw new Ut(`Expected first argument to be of type array or string, but found ${_t(Ft(t))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(e);return t.slice(n,r)}return t.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var gr=mr;function vr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function yr(e,t,n,r){return 0===r.compare(t,n)}function _r(e,t,n){const r="=="!==e&&"!="!==e;return class i{constructor(e,t,n){this.type=ht,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const n=e[0];let o=t.parse(e[1],1,pt);if(!o)return null;if(!vr(n,o.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${_t(o.type)}'.`);let a=t.parse(e[2],2,pt);if(!a)return null;if(!vr(n,a.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${_t(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${_t(o.type)}' and '${_t(a.type)}'.`);r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new $t(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new $t(o.type,[a])));let s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,mt),!s)return null}return new i(o,a,s)}evaluate(i){const o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){const t=Ft(o),n=Ft(a);if(t.kind!==n.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ut(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const e=Ft(o),n=Ft(a);if("string"!==e.kind||"string"!==n.kind)return t(i,o,a)}return this.collator?n(i,o,a,this.collator.evaluate(i)):t(i,o,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const xr=_r("==",(function(e,t,n){return t===n}),yr),wr=_r("!=",(function(e,t,n){return t!==n}),(function(e,t,n,r){return!yr(0,t,n,r)})),br=_r("<",(function(e,t,n){return t<n}),(function(e,t,n,r){return r.compare(t,n)<0})),Er=_r(">",(function(e,t,n){return t>n}),(function(e,t,n,r){return r.compare(t,n)>0})),kr=_r("<=",(function(e,t,n){return t<=n}),(function(e,t,n,r){return r.compare(t,n)<=0})),Tr=_r(">=",(function(e,t,n){return t>=n}),(function(e,t,n,r){return r.compare(t,n)>=0}));class Mr{constructor(e,t,n,r,i,o){this.type=ut,this.number=e,this.locale=t,this.currency=n,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const n=t.parse(e[1],1,ct);if(!n)return null;const r=e[2];if("object"!=typeof r||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let i=null;if(r.locale&&(i=t.parse(r.locale,1,ut),!i))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,ut),!o))return null;let a=null;if(r.unit&&(a=t.parse(r.unit,1,ut),!a))return null;let s=null;if(r["min-fraction-digits"]&&(s=t.parse(r["min-fraction-digits"],1,ct),!s))return null;let l=null;return r["max-fraction-digits"]&&(l=t.parse(r["max-fraction-digits"],1,ct),!l)?null:new Mr(n,i,o,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class Sr{constructor(e){this.type=ct,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=t.parse(e[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?t.error(`Expected argument of type string or array, but found ${_t(n.type)} instead.`):new Sr(n):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Ut(`Expected value to be of type string or array, but found ${_t(Ft(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Cr={"==":xr,"!=":wr,">":Er,"<":br,">=":Tr,"<=":kr,array:$t,at:ar,boolean:$t,case:pr,coalesce:nr,collator:tn,format:Gt,image:qt,in:lr,"index-of":ur,interpolate:er,"interpolate-hcl":er,"interpolate-lab":er,length:Sr,let:ir,literal:Vt,match:dr,number:$t,"number-format":Mr,object:$t,slice:gr,step:Rn,string:$t,"to-boolean":Yt,"to-color":Yt,"to-number":Yt,"to-string":Yt,var:Tn,within:xn};function Ar(e,[t,n,r,i]){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);const o=i?i.evaluate(e):1,a=Dt(t,n,r,o);if(a)throw new Ut(a);return new Rt(t/255*o,n/255*o,r/255*o,o)}function Ir(e,t){return e in t}function Rr(e,t){const n=t[e];return void 0===n?null:n}function Lr(e){return{type:e}}en.register(Cr,{error:[{kind:"error"},[ut],(e,[t])=>{throw new Ut(t.evaluate(e))}],typeof:[ut,[pt],(e,[t])=>_t(Ft(t.evaluate(e)))],"to-rgba":[yt(ct,4),[dt],(e,[t])=>t.evaluate(e).toArray()],rgb:[dt,[ct,ct,ct],Ar],rgba:[dt,[ct,ct,ct,ct],Ar],has:{type:ht,overloads:[[[ut],(e,[t])=>Ir(t.evaluate(e),e.properties())],[[ut,ft],(e,[t,n])=>Ir(t.evaluate(e),n.evaluate(e))]]},get:{type:pt,overloads:[[[ut],(e,[t])=>Rr(t.evaluate(e),e.properties())],[[ut,ft],(e,[t,n])=>Rr(t.evaluate(e),n.evaluate(e))]]},"feature-state":[pt,[ut],(e,[t])=>Rr(t.evaluate(e),e.featureState||{})],properties:[ft,[],e=>e.properties()],"geometry-type":[ut,[],e=>e.geometryType()],id:[pt,[],e=>e.id()],zoom:[ct,[],e=>e.globals.zoom],pitch:[ct,[],e=>e.globals.pitch||0],"distance-from-center":[ct,[],e=>e.distanceFromCenter()],"heatmap-density":[ct,[],e=>e.globals.heatmapDensity||0],"line-progress":[ct,[],e=>e.globals.lineProgress||0],"sky-radial-progress":[ct,[],e=>e.globals.skyRadialProgress||0],accumulated:[pt,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[ct,Lr(ct),(e,t)=>{let n=0;for(const r of t)n+=r.evaluate(e);return n}],"*":[ct,Lr(ct),(e,t)=>{let n=1;for(const r of t)n*=r.evaluate(e);return n}],"-":{type:ct,overloads:[[[ct,ct],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[ct],(e,[t])=>-t.evaluate(e)]]},"/":[ct,[ct,ct],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[ct,[ct,ct],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[ct,[],()=>Math.LN2],pi:[ct,[],()=>Math.PI],e:[ct,[],()=>Math.E],"^":[ct,[ct,ct],(e,[t,n])=>Math.pow(t.evaluate(e),n.evaluate(e))],sqrt:[ct,[ct],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[ct,[ct],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[ct,[ct],(e,[t])=>Math.log(t.evaluate(e))],log2:[ct,[ct],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[ct,[ct],(e,[t])=>Math.sin(t.evaluate(e))],cos:[ct,[ct],(e,[t])=>Math.cos(t.evaluate(e))],tan:[ct,[ct],(e,[t])=>Math.tan(t.evaluate(e))],asin:[ct,[ct],(e,[t])=>Math.asin(t.evaluate(e))],acos:[ct,[ct],(e,[t])=>Math.acos(t.evaluate(e))],atan:[ct,[ct],(e,[t])=>Math.atan(t.evaluate(e))],min:[ct,Lr(ct),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[ct,Lr(ct),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[ct,[ct],(e,[t])=>Math.abs(t.evaluate(e))],round:[ct,[ct],(e,[t])=>{const n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[ct,[ct],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[ct,[ct],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[ht,[ut,pt],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[ht,[pt],(e,[t])=>e.id()===t.value],"filter-type-==":[ht,[ut],(e,[t])=>e.geometryType()===t.value],"filter-<":[ht,[ut,pt],(e,[t,n])=>{const r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[ht,[pt],(e,[t])=>{const n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[ht,[ut,pt],(e,[t,n])=>{const r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[ht,[pt],(e,[t])=>{const n=e.id(),r=t.value;return typeof n==typeof r&&n>r}],"filter-<=":[ht,[ut,pt],(e,[t,n])=>{const r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[ht,[pt],(e,[t])=>{const n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[ht,[ut,pt],(e,[t,n])=>{const r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[ht,[pt],(e,[t])=>{const n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[ht,[pt],(e,[t])=>t.value in e.properties()],"filter-has-id":[ht,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ht,[yt(ut)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[ht,[yt(pt)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[ht,[ut,yt(pt)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[ht,[ut,yt(pt)],(e,[t,n])=>function(e,t,n,r){for(;n<=r;){const i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:ht,overloads:[[[ht,ht],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[Lr(ht),(e,t)=>{for(const n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:ht,overloads:[[[ht,ht],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[Lr(ht),(e,t)=>{for(const n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[ht,[ht],(e,[t])=>!t.evaluate(e)],"is-supported-script":[ht,[ut],(e,[t])=>{const n=e.globals&&e.globals.isSupportedScript;return!n||n(t.evaluate(e))}],upcase:[ut,[ut],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[ut,[ut],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[ut,Lr(pt),(e,t)=>t.map((t=>jt(t.evaluate(e)))).join("")],"resolved-locale":[ut,[mt],(e,[t])=>t.evaluate(e).resolvedLocale()]});var zr=Cr;function Pr(e){return{result:"success",value:e}}function Or(e){return{result:"error",value:e}}function Dr(e){return"data-driven"===e["property-type"]}function Br(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Fr(e){return!!e.expression&&e.expression.interpolated}function jr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Nr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Vr(e){return e}function Ur(e,t){const n="color"===t.type,r=e.stops&&"object"==typeof e.stops[0][0],i=r||!(r||void 0!==e.property),o=e.type||(Fr(t)?"exponential":"interval");if(n&&((e=tt({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Rt.parse(e[1])]))),e.default=Rt.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Kn[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let a,s,l;if("exponential"===o)a=Gr;else if("interval"===o)a=$r;else if("categorical"===o){a=Wr,s=Object.create(null);for(const t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=qr}if(r){const n={},r=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],o=i[0].zoom;void 0===n[o]&&(n[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},r.push(o)),n[o].stops.push([i[0].value,i[1]])}const i=[];for(const e of r)i.push([n[e].zoom,Ur(n[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:er.interpolationFactor.bind(void 0,o),zoomStops:i.map((e=>e[0])),evaluate:({zoom:n},r)=>Gr({stops:i,base:e.base},t,n).evaluate(n,r)}}if(i){const n="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:n,interpolationFactor:er.interpolationFactor.bind(void 0,n),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:n})=>a(e,t,n,s,l)}}return{kind:"source",evaluate(n,r){const i=r&&r.properties?r.properties[e.property]:void 0;return void 0===i?Hr(e.default,t.default):a(e,t,i,s,l)}}}function Hr(e,t,n){return void 0!==e?e:void 0!==t?t:void 0!==n?n:void 0}function Wr(e,t,n,r,i){return Hr(typeof n===i?r[n]:void 0,e.default,t.default)}function $r(e,t,n){if("number"!==jr(n))return Hr(e.default,t.default);const r=e.stops.length;if(1===r)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];const i=An(e.stops.map((e=>e[0])),n);return e.stops[i][1]}function Gr(e,t,n){const r=void 0!==e.base?e.base:1;if("number"!==jr(n))return Hr(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];const o=An(e.stops.map((e=>e[0])),n),a=function(e,t,n,r){const i=r-n,o=e-n;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}(n,r,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1];let c=zn[t.type]||Vr;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=Kn[e.colorSpace];c=(e,n)=>t.reverse(t.interpolate(t.forward(e),t.forward(n),a))}return"function"==typeof s.evaluate?{evaluate(...e){const t=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==n)return c(t,n,a)}}:c(s,l,a)}function qr(e,t,n){return"color"===t.type?n=Rt.parse(n):"formatted"===t.type?n=Pt.fromString(n.toString()):"resolvedImage"===t.type?n=Ot.fromString(n.toString()):jr(n)===t.type||"enum"===t.type&&t.values[n]||(n=void 0),Hr(n,e.default,t.default)}class Zr{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Jt,this._defaultValue=t?function(e){return"color"===e.type&&(Nr(e.default)||Array.isArray(e.default))?new Rt(0,0,0,0):"color"===e.type?Rt.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,n,r,i,o,a,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,o,a,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ut(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function Xr(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in zr}function Yr(e,t){const n=new Sn(zr,[],t?function(e){const t={color:dt,string:ut,number:ct,enum:ut,boolean:ht,formatted:gt,resolvedImage:vt};return"array"===e.type?yt(t[e.value]||pt,e.length):t[e.type]}(t):void 0),r=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?Pr(new Zr(r,t)):Or(n.errors)}class Kr{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!bn(t.expression)}evaluateWithoutErrorHandling(e,t,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,o)}evaluate(e,t,n,r,i,o){return this._styleExpression.evaluate(e,t,n,r,i,o)}}class Jr{constructor(e,t,n,r){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent="camera"!==e&&!bn(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,o)}evaluate(e,t,n,r,i,o){return this._styleExpression.evaluate(e,t,n,r,i,o)}interpolationFactor(e,t,n){return this.interpolationType?er.interpolationFactor(this.interpolationType,e,t,n):0}}function Qr(e,t){if("error"===(e=Yr(e,t)).result)return e;const n=e.value.expression,r=wn(n);if(!r&&!Dr(t))return Or([new ot("","data expressions not supported")]);const i=En(n,["zoom","pitch","distance-from-center"]);if(!i&&!Br(t))return Or([new ot("","zoom expressions not supported")]);const o=ti(n);return o||i?o instanceof ot?Or([o]):o instanceof er&&!Fr(t)?Or([new ot("",'"interpolate" expressions cannot be used with this property')]):Pr(o?new Jr(r?"camera":"composite",e.value,o.labels,o instanceof er?o.interpolation:void 0):new Kr(r?"constant":"source",e.value)):Or([new ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ei{constructor(e,t){this._parameters=e,this._specification=t,tt(this,Ur(this._parameters,this._specification))}static deserialize(e){return new ei(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ti(e){let t=null;if(e instanceof ir)t=ti(e.result);else if(e instanceof nr){for(const n of e.args)if(t=ti(n),t)break}else(e instanceof Rn||e instanceof er)&&e.input instanceof en&&"zoom"===e.input.name&&(t=e);return t instanceof ot||e.eachChild((e=>{const n=ti(e);n instanceof ot?t=n:!t&&n?t=new ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&n&&t!==n&&(t=new ot("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}class ni{constructor(e,t,n,r){this.message=(e?`${e}: `:"")+n,r&&(this.identifier=r),null!=t&&t.__line__&&(this.line=t.__line__)}}function ri(e){const t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},o=e.style,a=e.styleSpec;let s=[];const l=jr(n);if("object"!==l)return[new ni(t,n,`object expected, ${l} found`)];for(const e in n){const l=e.split(".")[0];let c;i[l]?c=i[l]:r[l]?c=Bi:i["*"]?c=i["*"]:r["*"]&&(c=Bi),c?s=s.concat(c({key:(t?`${t}.`:t)+e,value:n[e],valueSpec:r[l]||r["*"],style:o,styleSpec:a,object:n,objectKey:e},n)):s.push(new ni(t,n[e],`unknown property "${e}"`))}for(const e in r)i[e]||r[e].required&&void 0===r[e].default&&void 0===n[e]&&s.push(new ni(t,n,`missing required property "${e}"`));return s}function ii(e){const t=e.value,n=e.valueSpec,r=e.style,i=e.styleSpec,o=e.key,a=e.arrayElementValidator||Bi;if("array"!==jr(t))return[new ni(o,t,`array expected, ${jr(t)} found`)];if(n.length&&t.length!==n.length)return[new ni(o,t,`array length ${n.length} expected, length ${t.length} found`)];if(n["min-length"]&&t.length<n["min-length"])return[new ni(o,t,`array length at least ${n["min-length"]} expected, length ${t.length} found`)];let s={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum,function:void 0};i.$version<7&&(s.function=n.function),"object"===jr(n.value)&&(s=n.value);let l=[];for(let e=0;e<t.length;e++)l=l.concat(a({array:t,arrayIndex:e,value:t[e],valueSpec:s,style:r,styleSpec:i,key:`${o}[${e}]`}));return l}function oi(e){const t=e.key,n=e.value,r=e.valueSpec;let i=jr(n);if("number"===i&&n!=n&&(i="NaN"),"number"!==i)return[new ni(t,n,`number expected, ${i} found`)];if("minimum"in r){let i=r.minimum;if("array"===jr(r.minimum)&&(i=r.minimum[e.arrayIndex]),n<i)return[new ni(t,n,`${n} is less than the minimum value ${i}`)]}if("maximum"in r){let i=r.maximum;if("array"===jr(r.maximum)&&(i=r.maximum[e.arrayIndex]),n>i)return[new ni(t,n,`${n} is greater than the maximum value ${i}`)]}return[]}function ai(e){const t=e.valueSpec,n=nt(e.value.type);let r,i,o,a={};const s="categorical"!==n&&void 0===e.value.property,l=!s,c="array"===jr(e.value.stops)&&"array"===jr(e.value.stops[0])&&"object"===jr(e.value.stops[0][0]),u=ri({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===n)return[new ni(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const r=e.value;return t=t.concat(ii({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===jr(r)&&0===r.length&&t.push(new ni(e.key,r,"array must have at least one stop")),t},default:function(e){return Bi({key:e.key,value:e.value,valueSpec:t,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===n&&s&&u.push(new ni(e.key,e.value,'missing required property "property"')),"identity"===n||e.value.stops||u.push(new ni(e.key,e.value,'missing required property "stops"')),"exponential"===n&&e.valueSpec.expression&&!Fr(e.valueSpec)&&u.push(new ni(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Dr(e.valueSpec)?u.push(new ni(e.key,e.value,"property functions not supported")):s&&!Br(e.valueSpec)&&u.push(new ni(e.key,e.value,"zoom functions not supported"))),"categorical"!==n&&!c||void 0!==e.value.property||u.push(new ni(e.key,e.value,'"property" property is required')),u;function h(e){let n=[];const r=e.value,s=e.key;if("array"!==jr(r))return[new ni(s,r,`array expected, ${jr(r)} found`)];if(2!==r.length)return[new ni(s,r,`array length 2 expected, length ${r.length} found`)];if(c){if("object"!==jr(r[0]))return[new ni(s,r,`object expected, ${jr(r[0])} found`)];if(void 0===r[0].zoom)return[new ni(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new ni(s,r,"object stop key must have value")];const t=nt(r[0].zoom);if("number"!=typeof t)return[new ni(s,r[0].zoom,"stop zoom values must be numbers")];if(o&&o>t)return[new ni(s,r[0].zoom,"stop zoom values must appear in ascending order")];t!==o&&(o=t,i=void 0,a={}),n=n.concat(ri({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:oi,value:d}}))}else n=n.concat(d({key:`${s}[0]`,value:r[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},r));return Xr(rt(r[1]))?n.concat([new ni(`${s}[1]`,r[1],"expressions are not allowed in function stops.")]):n.concat(Bi({key:`${s}[1]`,value:r[1],valueSpec:t,style:e.style,styleSpec:e.styleSpec}))}function d(e,o){const s=jr(e.value),l=nt(e.value),c=null!==e.value?e.value:o;if(r){if(s!==r)return[new ni(e.key,c,`${s} stop domain type must match previous stop domain type ${r}`)]}else r=s;if("number"!==s&&"string"!==s&&"boolean"!==s&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new ni(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==n){let r=`number expected, ${s} found`;return Dr(t)&&void 0===n&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ni(e.key,c,r)]}return"categorical"!==n||"number"!==s||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==n&&"number"===s&&"number"==typeof l&&"number"==typeof i&&void 0!==i&&l<i?[new ni(e.key,c,"stop domain values must appear in ascending order")]:(i=l,"categorical"===n&&l in a?[new ni(e.key,c,"stop domain values must be unique")]:(a[l]=!0,[])):[new ni(e.key,c,`integer expected, found ${String(l)}`)]}}function si(e){const t=("property"===e.expressionContext?Qr:Yr)(rt(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new ni(`${e.key}${t.key}`,e.value,t.message)));const n=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!n.outputDefined())return[new ni(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!bn(n))return[new ni(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext)return li(n,e);if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!En(n,["zoom","feature-state"]))return[new ni(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!wn(n))return[new ni(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function li(e,t){const n=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const e of t.valueSpec.expression.parameters)n.delete(e);if(0===n.size)return[];const r=[];return e instanceof en&&n.has(e.name)?[new ni(t.key,t.value,`["${e.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(e.eachChild((e=>{r.push(...li(e,t))})),r)}function ci(e){const t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?-1===r.values.indexOf(nt(n))&&i.push(new ni(t,n,`expected one of [${r.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(r.values).indexOf(nt(n))&&i.push(new ni(t,n,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(n)} found`)),i}function ui(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!ui(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function hi(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ui(e)||(e=yi(e));const n=e;let r=!0;try{r=function(e){if(!pi(e))return e;let t=rt(e);return fi(t),t=di(t),t}(n)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(n,null,2)}\n        `)}const i=et[`filter_${t}`],o=Yr(r,i);let a=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(e,t,n)=>o.value.evaluate(e,t,{},n);let s=null,l=null;if(r!==n){const e=Yr(n,i);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(t,n,r,i,o)=>e.value.evaluate(t,n,{},r,void 0,void 0,i,o),l=!wn(e.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:vi(r),needFeature:!!l}}function di(e){if(!Array.isArray(e))return e;const t=function(e){if(mi.has(e[0]))for(let t=1;t<e.length;t++)if(pi(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>di(e)))}function fi(e){let t=!1;const n=[];if("case"===e[0]){for(let r=1;r<e.length-1;r+=2)t=t||pi(e[r]),n.push(e[r+1]);n.push(e[e.length-1])}else if("match"===e[0]){t=t||pi(e[1]);for(let t=2;t<e.length-1;t+=2)n.push(e[t+1]);n.push(e[e.length-1])}else if("step"===e[0]){t=t||pi(e[1]);for(let t=1;t<e.length-1;t+=2)n.push(e[t+1])}t&&(e.length=0,e.push("any",...n));for(let t=1;t<e.length;t++)fi(e[t])}function pi(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(pi(e[t]))return!0;return!1}const mi=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function gi(e,t){return e<t?-1:e>t?1:0}function vi(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t<e.length;t++)if(vi(e[t]))return!0;return!1}function yi(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?_i(e[1],e[2],"=="):"!="===t?bi(_i(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?_i(e[1],e[2],t):"any"===t?(n=e.slice(1),["any"].concat(n.map(yi))):"all"===t?["all"].concat(e.slice(1).map(yi)):"none"===t?["all"].concat(e.slice(1).map(yi).map(bi)):"in"===t?xi(e[1],e.slice(2)):"!in"===t?bi(xi(e[1],e.slice(2))):"has"===t?wi(e[1]):"!has"===t?bi(wi(e[1])):"within"!==t||e;var n}function _i(e,t,n){switch(e){case"$type":return[`filter-type-${n}`,t];case"$id":return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function xi(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(gi)]]:["filter-in-small",e,["literal",t]]}}function wi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function bi(e){return["!",e]}function Ei(e){return ui(rt(e.value))?si(tt({},e,{expressionContext:"filter",valueSpec:e.styleSpec[`filter_${e.layerType||"fill"}`]})):ki(e)}function ki(e){const t=e.value,n=e.key;if("array"!==jr(t))return[new ni(n,t,`array expected, ${jr(t)} found`)];const r=e.styleSpec;let i,o=[];if(t.length<1)return[new ni(n,t,"filter array must have at least 1 element")];switch(o=o.concat(ci({key:`${n}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),nt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===nt(t[1])&&o.push(new ni(n,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&o.push(new ni(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(i=jr(t[1]),"string"!==i&&o.push(new ni(`${n}[1]`,t[1],`string expected, ${i} found`)));for(let a=2;a<t.length;a++)i=jr(t[a]),"$type"===nt(t[1])?o=o.concat(ci({key:`${n}[${a}]`,value:t[a],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&o.push(new ni(`${n}[${a}]`,t[a],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let r=1;r<t.length;r++)o=o.concat(ki({key:`${n}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=jr(t[1]),2!==t.length?o.push(new ni(n,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==i&&o.push(new ni(`${n}[1]`,t[1],`string expected, ${i} found`));break;case"within":i=jr(t[1]),2!==t.length?o.push(new ni(n,t,`filter array for "${t[0]}" operator must have 2 elements`)):"object"!==i&&o.push(new ni(`${n}[1]`,t[1],`object expected, ${i} found`))}return o}function Ti(e,t){const n=e.key,r=e.style,i=e.styleSpec,o=e.value,a=e.objectKey,s=i[`${t}_${e.layerType}`];if(!s)return[];const l=a.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Bi({key:n,value:o,valueSpec:i.transition,style:r,styleSpec:i});const c=e.valueSpec||s[a];if(!c)return[new ni(n,o,`unknown property "${a}"`)];let u;if("string"===jr(o)&&Dr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o))){const e=`\`{ "type": "identity", "property": ${u?JSON.stringify(u[1]):'"_"'} }\``;return[new ni(n,o,`"${a}" does not support interpolation syntax\nUse an identity property function instead: ${e}.`)]}const h=[];return"symbol"===e.layerType&&("text-field"===a&&r&&!r.glyphs&&h.push(new ni(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Nr(rt(o))&&"identity"===nt(o.type)&&h.push(new ni(n,o,'"text-font" does not support identity functions'))),h.concat(Bi({key:e.key,value:o,valueSpec:c,style:r,styleSpec:i,expressionContext:"property",propertyType:t,propertyKey:a}))}function Mi(e){return Ti(e,"paint")}function Si(e){return Ti(e,"layout")}function Ci(e){let t=[];const n=e.value,r=e.key,i=e.style,o=e.styleSpec;n.type||n.ref||t.push(new ni(r,n,'either "type" or "ref" is required'));let a=nt(n.type);const s=nt(n.ref);if(n.id){const o=nt(n.id);for(let a=0;a<e.arrayIndex;a++){const e=i.layers[a];nt(e.id)===o&&t.push(new ni(r,n.id,`duplicate layer id "${n.id}", previously used at line ${e.id.__line__}`))}}if("ref"in n){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in n&&t.push(new ni(r,n[e],`"${e}" is prohibited for ref layers`))})),i.layers.forEach((t=>{nt(t.id)===s&&(e=t)})),e?e.ref?t.push(new ni(r,n.ref,"ref cannot reference another ref layer")):a=nt(e.type):"string"==typeof s&&t.push(new ni(r,n.ref,`ref layer "${s}" not found`))}else if("background"!==a&&"sky"!==a)if(n.source){const e=i.sources&&i.sources[n.source],o=e&&nt(e.type);e?"vector"===o&&"raster"===a?t.push(new ni(r,n.source,`layer "${n.id}" requires a raster source`)):"raster"===o&&"raster"!==a?t.push(new ni(r,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==o||n["source-layer"]?"raster-dem"===o&&"hillshade"!==a?t.push(new ni(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!n.paint||!n.paint["line-gradient"]&&!n.paint["line-trim-offset"]||"geojson"===o&&e.lineMetrics||t.push(new ni(r,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ni(r,n,`layer "${n.id}" must specify a "source-layer"`)):t.push(new ni(r,n.source,`source "${n.source}" not found`))}else t.push(new ni(r,n,'missing required property "source"'));return t=t.concat(ri({key:r,value:n,valueSpec:o.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Bi({key:`${r}.type`,value:n.type,valueSpec:o.layer.type,style:e.style,styleSpec:e.styleSpec,object:n,objectKey:"type"}),filter:e=>Ei(tt({layerType:a},e)),layout:e=>ri({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>Si(tt({layerType:a},e))}}),paint:e=>ri({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>Mi(tt({layerType:a},e))}})}})),t}function Ai(e){const t=e.value,n=e.key,r=jr(t);return"string"!==r?[new ni(n,t,`string expected, ${r} found`)]:[]}const Ii={promoteId:function({key:e,value:t}){if("string"===jr(t))return Ai({key:e,value:t});{const n=[];for(const r in t)n.push(...Ai({key:`${e}.${r}`,value:t[r]}));return n}}};function Ri(e){const t=e.value,n=e.key,r=e.styleSpec,i=e.style;if(!t.type)return[new ni(n,t,'"type" is required')];const o=nt(t.type);let a;switch(o){case"vector":case"raster":case"raster-dem":return a=ri({key:n,value:t,valueSpec:r[`source_${o.replace("-","_")}`],style:e.style,styleSpec:r,objectElementValidators:Ii}),a;case"geojson":if(a=ri({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,objectElementValidators:Ii}),t.cluster)for(const e in t.clusterProperties){const[r,i]=t.clusterProperties[e],o="string"==typeof r?[r,["accumulated"],["get",e]]:r;a.push(...si({key:`${n}.${e}.map`,value:i,expressionContext:"cluster-map"})),a.push(...si({key:`${n}.${e}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return ri({key:n,value:t,valueSpec:r.source_video,style:i,styleSpec:r});case"image":return ri({key:n,value:t,valueSpec:r.source_image,style:i,styleSpec:r});case"canvas":return[new ni(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ci({key:`${n}.type`,value:t.type,valueSpec:{values:Li(r)},style:i,styleSpec:r})}}function Li(e){return e.source.reduce(((t,n)=>{const r=e[n];return"enum"===r.type.type&&(t=t.concat(Object.keys(r.type.values))),t}),[])}function zi(e){const t=e.value,n=e.styleSpec,r=n.light,i=e.style;let o=[];const a=jr(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new ni("light",t,`object expected, ${a} found`)]),o;for(const e in t){const a=e.match(/^(.*)-transition$/);o=o.concat(a&&r[a[1]]&&r[a[1]].transition?Bi({key:e,value:t[e],valueSpec:n.transition,style:i,styleSpec:n}):r[e]?Bi({key:e,value:t[e],valueSpec:r[e],style:i,styleSpec:n}):[new ni(e,t[e],`unknown property "${e}"`)])}return o}function Pi(e){const t=e.value,n=e.key,r=e.style,i=e.styleSpec,o=i.terrain;let a=[];const s=jr(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new ni("terrain",t,`object expected, ${s} found`)]),a;for(const e in t){const n=e.match(/^(.*)-transition$/);a=a.concat(n&&o[n[1]]&&o[n[1]].transition?Bi({key:e,value:t[e],valueSpec:i.transition,style:r,styleSpec:i}):o[e]?Bi({key:e,value:t[e],valueSpec:o[e],style:r,styleSpec:i}):[new ni(e,t[e],`unknown property "${e}"`)])}if(t.source){const e=r.sources&&r.sources[t.source],i=e&&nt(e.type);e?"raster-dem"!==i&&a.push(new ni(n,t.source,`terrain cannot be used with a source of type ${String(i)}, it only be used with a "raster-dem" source type`)):a.push(new ni(n,t.source,`source "${t.source}" not found`))}else a.push(new ni(n,t,'terrain is missing required property "source"'));return a}function Oi(e){const t=e.value,n=e.style,r=e.styleSpec,i=r.fog;let o=[];const a=jr(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new ni("fog",t,`object expected, ${a} found`)]),o;for(const e in t){const a=e.match(/^(.*)-transition$/);o=o.concat(a&&i[a[1]]&&i[a[1]].transition?Bi({key:e,value:t[e],valueSpec:r.transition,style:n,styleSpec:r}):i[e]?Bi({key:e,value:t[e],valueSpec:i[e],style:n,styleSpec:r}):[new ni(e,t[e],`unknown property "${e}"`)])}return o}const Di={"*":()=>[],array:ii,boolean:function(e){const t=e.value,n=e.key,r=jr(t);return"boolean"!==r?[new ni(n,t,`boolean expected, ${r} found`)]:[]},number:oi,color:function(e){const t=e.key,n=e.value,r=jr(n);return"string"!==r?[new ni(t,n,`color expected, ${r} found`)]:null===kt(n)?[new ni(t,n,`color expected, "${n}" found`)]:[]},enum:ci,filter:Ei,function:ai,layer:Ci,object:ri,source:Ri,light:zi,terrain:Pi,fog:Oi,string:Ai,formatted:function(e){return 0===Ai(e).length?[]:si(e)},resolvedImage:function(e){return 0===Ai(e).length?[]:si(e)},projection:function(e){const t=e.value,n=e.styleSpec,r=n.projection,i=e.style;let o=[];const a=jr(t);if("object"===a)for(const e in t)o=o.concat(Bi({key:e,value:t[e],valueSpec:r[e],style:i,styleSpec:n}));else"string"!==a&&(o=o.concat([new ni("projection",t,`object or string expected, ${a} found`)]));return o}};function Bi(e){const t=e.value,n=e.valueSpec,r=e.styleSpec;return n.expression&&Nr(nt(t))?ai(e):n.expression&&Xr(rt(t))?si(e):n.type&&Di[n.type]?Di[n.type](e):ri(tt({},e,{valueSpec:n.type?r[n.type]:n}))}function Fi(e){const t=e.value,n=e.key,r=Ai(e);return r.length||(-1===t.indexOf("{fontstack}")&&r.push(new ni(n,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&r.push(new ni(n,t,'"glyphs" url must include a "{range}" token'))),r}function ji(e,t=et){return Ui(Bi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:Fi,"*":()=>[]}}))}const Ni=e=>Ui(Mi(e)),Vi=e=>Ui(Si(e));function Ui(e){return e.slice().sort(((e,t)=>e.line&&t.line?e.line-t.line:0))}function Hi(e,t){let n=!1;if(t&&t.length)for(const r of t)e.fire(new Je(new Error(r.message))),n=!0;return n}var Wi=Gi,$i=3;function Gi(e,t,n){var r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(n=i[2]);for(var o=0;o<this.d*this.d;o++){var a=i[$i+o],s=i[$i+o+1];r.push(a===s?null:i.subarray(a,s))}var l=i[$i+r.length+1];this.keys=i.subarray(i[$i+r.length],l),this.bboxes=i.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*n;for(var c=0;c<this.d*this.d;c++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=n,this.scale=t/e,this.uid=0;var u=n/t*e;this.min=-u,this.max=e+u}Gi.prototype.insert=function(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},Gi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Gi.prototype._insertCell=function(e,t,n,r,i,o){this.cells[i].push(o)},Gi.prototype.query=function(e,t,n,r,i){var o=this.min,a=this.max;if(e<=o&&t<=o&&a<=n&&a<=r&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,n,r,this._queryCell,s,{},i),s},Gi.prototype._queryCell=function(e,t,n,r,i,o,a,s){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===a[d]){var f=4*d;(s?s(u[f+0],u[f+1],u[f+2],u[f+3]):e<=u[f+2]&&t<=u[f+3]&&n>=u[f+0]&&r>=u[f+1])?(a[d]=!0,o.push(c[d])):a[d]=!1}}},Gi.prototype._forEachCell=function(e,t,n,r,i,o,a,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(n),h=this._convertToCellCoord(r),d=l;d<=u;d++)for(var f=c;f<=h;f++){var p=this.d*f+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&i.call(this,e,t,n,r,p,o,a,s))return}},Gi.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},Gi.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},Gi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=$i+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var i=new Int32Array(t+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=t,a=0;a<e.length;a++){var s=e[a];i[$i+a]=o,i.set(s,o),o+=s.length}return i[$i+e.length]=o,i.set(this.keys,o),i[$i+e.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var qi=d(Wi);const Zi={};function Xi(e,t,n={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Zi[t]={klass:e,omit:n.omit||[]}}Xi(Object,"Object"),qi.serialize=function(e,t){const n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}},qi.deserialize=function(e){return new qi(e.buffer)},Object.defineProperty(qi,"name",{value:"Grid"}),Xi(qi,"Grid"),Xi(Rt,"Color"),Xi(Error,"Error"),Xi(ce,"AJAXError"),Xi(Ot,"ResolvedImage"),Xi(ei,"StylePropertyFunction"),Xi(Zr,"StyleExpression",{omit:["_evaluator"]}),Xi(Jr,"ZoomDependentExpression"),Xi(Kr,"ZoomConstantExpression"),Xi(en,"CompoundExpression",{omit:["_evaluate"]});for(const e in zr)Zi[zr[e]._classRegistryKey]||Xi(zr[e],`Expression${e}`);function Yi(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Ki(e){return t.ImageBitmap&&e instanceof t.ImageBitmap}function Ji(e,n){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(Yi(e)||Ki(e))return n&&n.push(e),e;if(ArrayBuffer.isView(e)){const t=e;return n&&n.push(t.buffer),t}if(e instanceof t.ImageData)return n&&n.push(e.data.buffer),e;if(Array.isArray(e)){const t=[];for(const r of e)t.push(Ji(r,n));return t}if("object"==typeof e){const t=e.constructor,r=t._classRegistryKey;if(!r)throw new Error(`can't serialize object of unregistered class ${r}`);const i=t.serialize?t.serialize(e,n):{};if(!t.serialize){for(const t in e)e.hasOwnProperty(t)&&(Zi[r].omit.indexOf(t)>=0||(i[t]=Ji(e[t],n)));e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}throw new Error("can't serialize object of type "+typeof e)}function Qi(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Yi(e)||Ki(e)||ArrayBuffer.isView(e)||e instanceof t.ImageData)return e;if(Array.isArray(e))return e.map(Qi);if("object"==typeof e){const t=e.$name||"Object",{klass:n}=Zi[t];if(!n)throw new Error(`can't deserialize unregistered class ${t}`);if(n.deserialize)return n.deserialize(e);const r=Object.create(n.prototype);for(const t of Object.keys(e))"$name"!==t&&(r[t]=Qi(e[t]));return r}throw new Error("can't deserialize object of type "+typeof e)}const eo={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519};function to(e){for(const t of e)if(io(t.charCodeAt(0)))return!0;return!1}function no(e){for(const t of e)if(!ro(t.charCodeAt(0)))return!1;return!0}function ro(e){return!(eo.Arabic(e)||eo["Arabic Supplement"](e)||eo["Arabic Extended-A"](e)||eo["Arabic Presentation Forms-A"](e)||eo["Arabic Presentation Forms-B"](e))}function io(e){return!(746!==e&&747!==e&&(e<4352||!(eo["Bopomofo Extended"](e)||eo.Bopomofo(e)||eo["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||eo["CJK Compatibility Ideographs"](e)||eo["CJK Compatibility"](e)||eo["CJK Radicals Supplement"](e)||eo["CJK Strokes"](e)||!(!eo["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||eo["CJK Unified Ideographs Extension A"](e)||eo["CJK Unified Ideographs"](e)||eo["Enclosed CJK Letters and Months"](e)||eo["Hangul Compatibility Jamo"](e)||eo["Hangul Jamo Extended-A"](e)||eo["Hangul Jamo Extended-B"](e)||eo["Hangul Jamo"](e)||eo["Hangul Syllables"](e)||eo.Hiragana(e)||eo["Ideographic Description Characters"](e)||eo.Kanbun(e)||eo["Kangxi Radicals"](e)||eo["Katakana Phonetic Extensions"](e)||eo.Katakana(e)&&12540!==e||!(!eo["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!eo["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||eo["Unified Canadian Aboriginal Syllabics"](e)||eo["Unified Canadian Aboriginal Syllabics Extended"](e)||eo["Vertical Forms"](e)||eo["Yijing Hexagram Symbols"](e)||eo["Yi Syllables"](e)||eo["Yi Radicals"](e))))}function oo(e){return!(io(e)||function(e){return!!(eo["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||eo["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||eo["Letterlike Symbols"](e)||eo["Number Forms"](e)||eo["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||eo["Control Pictures"](e)&&9251!==e||eo["Optical Character Recognition"](e)||eo["Enclosed Alphanumerics"](e)||eo["Geometric Shapes"](e)||eo["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||eo["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||eo["CJK Symbols and Punctuation"](e)||eo.Katakana(e)||eo["Private Use Area"](e)||eo["CJK Compatibility Forms"](e)||eo["Small Form Variants"](e)||eo["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function ao(e){return e>=1424&&e<=2303||eo["Arabic Presentation Forms-A"](e)||eo["Arabic Presentation Forms-B"](e)}function so(e,t){return!(!t&&ao(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||eo.Khmer(e))}function lo(e){for(const t of e)if(ao(t.charCodeAt(0)))return!0;return!1}const co="deferred",uo="loading",ho="loaded";let fo=null,po="unavailable",mo=null;const go=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(po="error"),fo&&fo(e)};function vo(){yo.fire(new Ke("pluginStateChange",{pluginStatus:po,pluginURL:mo}))}const yo=new Qe,_o=function(){return po},xo=function(){if(po!==co||!mo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");po=uo,vo(),mo&&de({url:mo},(e=>{e?go(e):(po=ho,vo())}))},wo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>po===ho||null!=wo.applyArabicShaping,isLoading:()=>po===uo,setState(e){po=e.pluginStatus,mo=e.pluginURL},isParsed:()=>null!=wo.applyArabicShaping&&null!=wo.processBidirectionalText&&null!=wo.processStyledBidirectionalText,getPluginURL:()=>mo};class bo{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(e,t){for(const n of e)if(!so(n.charCodeAt(0),t))return!1;return!0}(e,wo.isLoaded())}}class Eo{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Nr(e))return new ei(e,t);if(Xr(e)){const n=Qr(e,t);if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return n.value}{let n=e;return"string"==typeof e&&"color"===t.type&&(n=Rt.parse(e)),{kind:"constant",evaluate:()=>n}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}}class ko{constructor(e){this.property=e,this.value=new Eo(e,void 0)}transitioned(e,t){return new Mo(this.property,this.value,t,L({},e.transition,this.transition),e.now)}untransitioned(){return new Mo(this.property,this.value,null,{},0)}}class To{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return U(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new ko(this._values[e].property)),this._values[e].value=new Eo(this._values[e].property,null===t?void 0:U(t))}getTransition(e){return U(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new ko(this._values[e].property)),this._values[e].transition=U(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const n=this.getValue(t);void 0!==n&&(e[t]=n);const r=this.getTransition(t);void 0!==r&&(e[`${t}-transition`]=r)}return e}transitioned(e,t){const n=new So(this._properties);for(const r of Object.keys(this._values))n._values[r]=this._values[r].transitioned(e,t._values[r]);return n}untransitioned(){const e=new So(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Mo{constructor(e,t,n,r,i){const o=r.delay||0,a=r.duration||0;i=i||0,this.property=e,this.value=t,this.begin=i+o,this.end=this.begin+a,e.specification.transition&&(r.delay||r.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){const r=e.now||0,i=this.value.possiblyEvaluate(e,t,n),o=this.prior;if(o){if(r>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return o.possiblyEvaluate(e,t,n);{const a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,n),i,k(a))}}return i}}class So{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,n){const r=new Io(this._properties);for(const i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Co{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return U(this._values[e].value)}setValue(e,t){this._values[e]=new Eo(this._values[e].property,null===t?void 0:U(t))}serialize(){const e={};for(const t of Object.keys(this._values)){const n=this.getValue(t);void 0!==n&&(e[t]=n)}return e}possiblyEvaluate(e,t,n){const r=new Io(this._properties);for(const i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}}class Ao{constructor(e,t,n){this.property=e,this.value=t,this.parameters=n}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,n,r){return this.property.evaluate(this.value,this.parameters,e,t,n,r)}}class Io{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ro{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,n){const r=zn[this.specification.type];return r?r(e,t,n):e}}class Lo{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,n,r){return new Ao(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},n,r)}:e.expression,t)}interpolate(e,t,n){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Ao(this,{kind:"constant",value:void 0},e.parameters);const r=zn[this.specification.type];return r?new Ao(this,{kind:"constant",value:r(e.value.value,t.value.value,n)},e.parameters):e}evaluate(e,t,n,r,i,o){return"constant"===e.kind?e.value:e.evaluate(t,n,r,i,o)}}class zo{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,r){return!!e.expression.evaluate(t,null,{},n,r)}interpolate(){return!1}}class Po{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new bo(0,{});for(const n in e){const r=e[n];r.specification.overridable&&this.overridableProperties.push(n);const i=this.defaultPropertyValues[n]=new Eo(r,void 0),o=this.defaultTransitionablePropertyValues[n]=new ko(r);this.defaultTransitioningPropertyValues[n]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=i.possiblyEvaluate(t)}}}function Oo(e,t){return 256*(e=S(Math.floor(e),0,255))+S(Math.floor(t),0,255)}Xi(Lo,"DataDrivenProperty"),Xi(Ro,"DataConstantProperty"),Xi(zo,"ColorRampProperty");const Do={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Bo{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Fo{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function jo(e,t=1){let n=0,r=0;return{members:e.map((e=>{const i=Do[e.type].BYTES_PER_ELEMENT,o=n=No(n,Math.max(t,i)),a=e.components||1;return r=Math.max(r,i),n+=i*a,{name:e.name,type:e.type,components:a,offset:o}})),size:No(n,Math.max(r,t)),alignment:t}}function No(e,t){return Math.ceil(e/t)*t}class Vo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const r=2*e;return this.int16[r+0]=t,this.int16[r+1]=n,e}}Vo.prototype.bytesPerElement=4,Xi(Vo,"StructArrayLayout2i4");class Uo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e}}Uo.prototype.bytesPerElement=6,Xi(Uo,"StructArrayLayout3i6");class Ho extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,e}}Ho.prototype.bytesPerElement=8,Xi(Ho,"StructArrayLayout4i8");class Wo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,o,a)}emplace(e,t,n,r,i,o,a,s){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=o,this.uint8[c+7]=a,this.float32[u+2]=s,e}}Wo.prototype.bytesPerElement=12,Xi(Wo,"StructArrayLayout2i4ub1f12");class $o extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,e}}$o.prototype.bytesPerElement=16,Xi($o,"StructArrayLayout4f16");class Go extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){const a=6*e,s=3*e;return this.uint16[a+0]=t,this.uint16[a+1]=n,this.uint16[a+2]=r,this.uint16[a+3]=i,this.float32[s+2]=o,e}}Go.prototype.bytesPerElement=12,Xi(Go,"StructArrayLayout4ui1f12");class qo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=n,this.uint16[o+2]=r,this.uint16[o+3]=i,e}}qo.prototype.bytesPerElement=8,Xi(qo,"StructArrayLayout4ui8");class Zo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e}}Zo.prototype.bytesPerElement=12,Xi(Zo,"StructArrayLayout6i12");class Xo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,n,r,i,o,a,s,l,c,u,h)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d){const f=12*e;return this.int16[f+0]=t,this.int16[f+1]=n,this.int16[f+2]=r,this.int16[f+3]=i,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=d,e}}Xo.prototype.bytesPerElement=24,Xi(Xo,"StructArrayLayout4i4ui4i24");class Yo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i,o)}emplace(e,t,n,r,i,o,a){const s=10*e,l=5*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.float32[l+2]=i,this.float32[l+3]=o,this.float32[l+4]=a,e}}Yo.prototype.bytesPerElement=20,Xi(Yo,"StructArrayLayout3i3f20");class Ko extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Ko.prototype.bytesPerElement=4,Xi(Ko,"StructArrayLayout1ul4");class Jo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,o,a,s,l,c,u,h,d)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d,f){const p=20*e,m=10*e;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.int16[p+4]=o,this.float32[m+3]=a,this.float32[m+4]=s,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[p+14]=u,this.uint32[m+8]=h,this.uint16[p+18]=d,this.uint16[p+19]=f,e}}Jo.prototype.bytesPerElement=40,Xi(Jo,"StructArrayLayout5i4f1i1ul2ui40");class Qo extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,r,i,o,a)}emplace(e,t,n,r,i,o,a,s){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.int16[l+2]=r,this.int16[l+4]=i,this.int16[l+5]=o,this.int16[l+6]=a,this.int16[l+7]=s,e}}Qo.prototype.bytesPerElement=16,Xi(Qo,"StructArrayLayout3i2i2i16");class ea extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){const a=4*e,s=8*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.int16[s+6]=i,this.int16[s+7]=o,e}}ea.prototype.bytesPerElement=16,Xi(ea,"StructArrayLayout2f1f2i16");class ta extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=12*e,a=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=n,this.float32[a+1]=r,this.float32[a+2]=i,e}}ta.prototype.bytesPerElement=12,Xi(ta,"StructArrayLayout2ub2f12");class na extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}}na.prototype.bytesPerElement=12,Xi(na,"StructArrayLayout3f12");class ra extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e}}ra.prototype.bytesPerElement=6,Xi(ra,"StructArrayLayout3ui6");class ia extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_,x){const w=this.length;return this.resize(w+1),this.emplace(w,e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_,x)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_,x,w){const b=30*e,E=15*e,k=60*e;return this.int16[b+0]=t,this.int16[b+1]=n,this.int16[b+2]=r,this.float32[E+2]=i,this.float32[E+3]=o,this.uint16[b+8]=a,this.uint16[b+9]=s,this.uint32[E+5]=l,this.uint32[E+6]=c,this.uint32[E+7]=u,this.uint16[b+16]=h,this.uint16[b+17]=d,this.uint16[b+18]=f,this.float32[E+10]=p,this.float32[E+11]=m,this.uint8[k+48]=g,this.uint8[k+49]=v,this.uint8[k+50]=y,this.uint32[E+13]=_,this.int16[b+28]=x,this.uint8[k+58]=w,e}}ia.prototype.bytesPerElement=60,Xi(ia,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class oa extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_,x,w,b,E,k,T,M,S,C,A){const I=this.length;return this.resize(I+1),this.emplace(I,e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_,x,w,b,E,k,T,M,S,C,A)}emplace(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_,x,w,b,E,k,T,M,S,C,A,I){const R=38*e,L=19*e;return this.int16[R+0]=t,this.int16[R+1]=n,this.int16[R+2]=r,this.float32[L+2]=i,this.float32[L+3]=o,this.int16[R+8]=a,this.int16[R+9]=s,this.int16[R+10]=l,this.int16[R+11]=c,this.int16[R+12]=u,this.int16[R+13]=h,this.uint16[R+14]=d,this.uint16[R+15]=f,this.uint16[R+16]=p,this.uint16[R+17]=m,this.uint16[R+18]=g,this.uint16[R+19]=v,this.uint16[R+20]=y,this.uint16[R+21]=_,this.uint16[R+22]=x,this.uint16[R+23]=w,this.uint16[R+24]=b,this.uint16[R+25]=E,this.uint16[R+26]=k,this.uint16[R+27]=T,this.uint16[R+28]=M,this.uint32[L+15]=S,this.float32[L+16]=C,this.float32[L+17]=A,this.float32[L+18]=I,e}}oa.prototype.bytesPerElement=76,Xi(oa,"StructArrayLayout3i2f6i15ui1ul3f76");class aa extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}aa.prototype.bytesPerElement=4,Xi(aa,"StructArrayLayout1f4");class sa extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i)}emplace(e,t,n,r,i,o){const a=5*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,this.float32[a+4]=o,e}}sa.prototype.bytesPerElement=20,Xi(sa,"StructArrayLayout5f20");class la extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=n,this.uint16[o+3]=r,this.uint16[o+4]=i,e}}la.prototype.bytesPerElement=12,Xi(la,"StructArrayLayout1ul3ui12");class ca extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,e}}ca.prototype.bytesPerElement=4,Xi(ca,"StructArrayLayout2ui4");class ua extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}ua.prototype.bytesPerElement=2,Xi(ua,"StructArrayLayout1ui2");class ha extends Fo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const r=2*e;return this.float32[r+0]=t,this.float32[r+1]=n,e}}ha.prototype.bytesPerElement=8,Xi(ha,"StructArrayLayout2f8");class da extends Bo{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}da.prototype.size=40;class fa extends Jo{get(e){return new da(this,e)}}Xi(fa,"CollisionBoxArray");class pa extends Bo{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}pa.prototype.size=60;class ma extends ia{get(e){return new pa(this,e)}}Xi(ma,"PlacedSymbolArray");class ga extends Bo{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}ga.prototype.size=76;class va extends oa{get(e){return new ga(this,e)}}Xi(va,"SymbolInstanceArray");class ya extends aa{getoffsetX(e){return this.float32[1*e+0]}}Xi(ya,"GlyphOffsetArray");class _a extends Vo{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Xi(_a,"SymbolLineVertexArray");class xa extends Bo{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]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}xa.prototype.size=12;class wa extends la{get(e){return new xa(this,e)}}Xi(wa,"FeatureIndexArray");class ba extends ca{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Xi(ba,"FillExtrusionCentroidArray");const Ea=jo([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),ka=jo([{name:"a_dash",components:4,type:"Uint16"}]);var Ta={exports:{}},Ma={exports:{}};Ma.exports=function(e,t){var n,r,i,o,a,s,l,c;for(r=e.length-(n=3&e.length),i=t,a=3432918353,s=461845907,c=0;c<r;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(o=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var Sa=Ma.exports,Ca={exports:{}};Ca.exports=function(e,t){for(var n,r=e.length,i=t^r,o=0;r>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var Aa=Sa,Ia=Ca.exports;Ta.exports=Aa,Ta.exports.murmur3=Aa,Ta.exports.murmur2=Ia;var Ra=d(Ta.exports);class La{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,n,r){this.ids.push(za(e)),this.positions.push(t,n,r)}getPositions(e){const t=za(e);let n=0,r=this.ids.length-1;for(;n<r;){const e=n+r>>1;this.ids[e]>=t?r=e:n=e+1}const i=[];for(;this.ids[n]===t;)i.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return i}static serialize(e,t){const n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return Pa(n,r,0,n.length-1),t&&t.push(n.buffer,r.buffer),{ids:n,positions:r}}static deserialize(e){const t=new La;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function za(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:Ra(String(e))}function Pa(e,t,n,r){for(;n<r;){const i=e[n+r>>1];let o=n-1,a=r+1;for(;;){do{o++}while(e[o]<i);do{a--}while(e[a]>i);if(o>=a)break;Oa(e,o,a),Oa(t,3*o,3*a),Oa(t,3*o+1,3*a+1),Oa(t,3*o+2,3*a+2)}a-n<r-a?(Pa(e,t,n,a),n=a+1):(Pa(e,t,a+1,r),r=a)}}function Oa(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}Xi(La,"FeaturePositionMap");class Da{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}}class Ba extends Da{constructor(e){super(e),this.current=0}set(e,t,n){this.fetchUniformLocation(e,t)&&this.current!==n&&(this.current=n,this.gl.uniform1f(this.location,n))}}class Fa extends Da{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]&&n[3]===this.current[3]||(this.current=n,this.gl.uniform4f(this.location,n[0],n[1],n[2],n[3])))}}class ja extends Da{constructor(e){super(e),this.current=Rt.transparent}set(e,t,n){this.fetchUniformLocation(e,t)&&(n.r===this.current.r&&n.g===this.current.g&&n.b===this.current.b&&n.a===this.current.a||(this.current=n,this.gl.uniform4f(this.location,n.r,n.g,n.b,n.a)))}}const Na=new Float32Array(16),Va=new Float32Array(9),Ua=new Float32Array(4);function Ha(e){return[Oo(255*e.r,255*e.g),Oo(255*e.b,255*e.a)]}class Wa{constructor(e,t,n){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=n}setUniform(e,t,n,r,i){t.set(e,i,r.constantOr(this.value))}getBinding(e,t){return"color"===this.type?new ja(e):new Ba(e)}}class $a{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,n,r,i){const o="u_pattern"===i||"u_dash"===i?this.pattern:"u_pixel_ratio"===i?this.pixelRatio:null;o&&t.set(e,i,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Fa(e):new Ba(e)}}class Ga{constructor(e,t,n,r){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===n?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(e,t,n,r,i,o){const a=this.paintVertexArray.length,s=this.expression.evaluate(new bo(0),t,{},i,r,o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,t,n,r,i){const o=this.expression.evaluate({zoom:0},n,r,void 0,i);this._setPaintValue(e,t,o)}_setPaintValue(e,t,n){if("color"===this.type){const r=Ha(n);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r[0],r[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class qa{constructor(e,t,n,r,i,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===n?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,n,r,i,o){const a=this.expression.evaluate(new bo(this.zoom),t,{},i,r,o),s=this.expression.evaluate(new bo(this.zoom+1),t,{},i,r,o),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,e,a,s)}updatePaintArray(e,t,n,r,i){const o=this.expression.evaluate({zoom:this.zoom},n,r,void 0,i),a=this.expression.evaluate({zoom:this.zoom+1},n,r,void 0,i);this._setPaintValue(e,t,o,a)}_setPaintValue(e,t,n,r){if("color"===this.type){const i=Ha(n),o=Ha(r);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1],o[0],o[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,n,r,i){const o=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,a=S(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(e,i,a)}getBinding(e,t){return new Ba(e)}}class Za{constructor(e,t,n,r,i){this.expression=e,this.layerId=i,this.paintVertexAttributes=("array"===n?ka:Ea).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new r}populatePaintArray(e,t,n){const r=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(r,e,t.patterns&&t.patterns[this.layerId],n)}updatePaintArray(e,t,n,r,i,o){this._setPaintValues(e,t,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,t,n,r){if(!r||!n)return;const i=r[n];if(!i)return;const{tl:o,br:a,pixelRatio:s}=i;for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,o[0],o[1],a[0],a[1],s)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Xa{constructor(e,t,n=(()=>!0)){this.binders={},this._buffers=[];const r=[];for(const i in e.paint._values){if(!n(i))continue;const o=e.paint.get(i);if(!(o instanceof Ao&&Dr(o.property.specification)))continue;const a=Ja(i,e.type),s=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,u="line-dasharray"===i||i.endsWith("pattern"),h="line-dasharray"===i&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==s.kind||h)if("source"===s.kind||h||u){const t=ts(i,l,"source");this.binders[i]=u?new Za(s,a,l,t,e.id):new Ga(s,a,l,t),r.push(`/a_${i}`)}else{const e=ts(i,l,"composite");this.binders[i]=new qa(s,a,l,c,t,e),r.push(`/z_${i}`)}else this.binders[i]=u?new $a(s.value,a):new Wa(s.value,a,l),r.push(`/u_${i}`)}this.cacheKey=r.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Ga||t instanceof qa?t.maxValue:0}populatePaintArrays(e,t,n,r,i,o){for(const a in this.binders){const s=this.binders[a];(s instanceof Ga||s instanceof qa||s instanceof Za)&&s.populatePaintArray(e,t,n,r,i,o)}}setConstantPatternPositions(e){for(const t in this.binders){const n=this.binders[t];n instanceof $a&&n.setConstantPatternPositions(e)}}updatePaintArrays(e,t,n,r,i,o){let a=!1;for(const s in e){const l=t.getPositions(s);for(const t of l){const l=n.feature(t.index);for(const n in this.binders){const c=this.binders[n];if((c instanceof Ga||c instanceof qa||c instanceof Za)&&!0===c.expression.isStateDependent){const u=r.paint.get(n);c.expression=u.value,c.updatePaintArray(t.start,t.end,l,e[s],i,o),a=!0}}}}return a}defines(){const e=[];for(const t in this.binders){const n=this.binders[t];(n instanceof Wa||n instanceof $a)&&e.push(...n.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const n=this.binders[t];if(n instanceof Ga||n instanceof qa||n instanceof Za)for(let t=0;t<n.paintVertexAttributes.length;t++)e.push(n.paintVertexAttributes[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const n=this.binders[t];if(n instanceof Wa||n instanceof $a||n instanceof qa)for(const t of n.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const n in this.binders){const r=this.binders[n];if(r instanceof Wa||r instanceof $a||r instanceof qa)for(const i of r.uniformNames)t.push({name:i,property:n,binding:r.getBinding(e,i)})}return t}setUniforms(e,t,n,r,i){for(const{name:t,property:o,binding:a}of n)this.binders[o].setUniform(e,a,i,r.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof Ga||t instanceof qa||t instanceof Za)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(const t in this.binders){const n=this.binders[t];(n instanceof Ga||n instanceof qa||n instanceof Za)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof Ga||t instanceof qa||t instanceof Za)&&t.destroy()}}}class Ya{constructor(e,t,n=(()=>!0)){this.programConfigurations={};for(const r of e)this.programConfigurations[r.id]=new Xa(r,t,n);this.needsUpload=!1,this._featureMap=new La,this._bufferOffset=0}populatePaintArrays(e,t,n,r,i,o,a){for(const n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(e,t,r,i,o,a);void 0!==t.id&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,r,i){for(const o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,r,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Ka={"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-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function Ja(e,t){return Ka[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const Qa={"line-pattern":{source:Go,composite:Go},"fill-pattern":{source:Go,composite:Go},"fill-extrusion-pattern":{source:Go,composite:Go},"line-dasharray":{source:qo,composite:qo}},es={color:{source:ha,composite:$o},number:{source:aa,composite:ha}};function ts(e,t,n){const r=Qa[e];return r&&r[n]||es[t][n]}Xi(Wa,"ConstantBinder"),Xi($a,"PatternConstantBinder"),Xi(Ga,"SourceExpressionBinder"),Xi(Za,"PatternCompositeBinder"),Xi(qa,"CompositeExpressionBinder"),Xi(Xa,"ProgramConfiguration",{omit:["_buffers"]}),Xi(Ya,"ProgramConfigurationSet");const ns="-transition";class rs extends Qe{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Co(t.layout)),t.paint)){this._transitionablePaint=new To(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Io(t.paint)}}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,n={}){null!=t&&this._validate(Vi,`layers.${this.id}.layout.${e}`,e,t,n)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return j(e,ns)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,n={}){if(null!=t&&this._validate(Ni,`layers.${this.id}.paint.${e}`,e,t,n))return!1;if(j(e,ns))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{const n=this._transitionablePaint._values[e],r=n.value.isDataDriven(),i=n.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const o=this._transitionablePaint._values[e].value,a=o.isDataDriven(),s=j(e,"pattern")||"line-dasharray"===e;return a||r||s||this._handleOverridablePaintPropertyUpdate(e,i,o)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={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:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),V(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,n,r,i={}){return(!i||!1!==i.validate)&&Hi(this,e.call(ji,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:et,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Ao&&Dr(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=hi(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const is=jo([{name:"a_pos",components:2,type:"Int16"}],4),os=jo([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class as{constructor(e=[]){this.segments=e}prepareSegment(e,t,n,r){let i=this.segments[this.segments.length-1];return e>as.MAX_VERTEX_ARRAY_LENGTH&&W(`Max vertices per segment is ${as.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>as.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,n,r){return new as([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])}}as.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xi(as,"SegmentVector");var ss=8192;class ls{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Ul?new Ul(e.lng,e.lat):Ul.convert(e),this}setSouthWest(e){return this._sw=e instanceof Ul?new Ul(e.lng,e.lat):Ul.convert(e),this}extend(e){const t=this._sw,n=this._ne;let r,i;if(e instanceof Ul)r=e,i=e;else{if(!(e instanceof ls))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(ls.convert(e)):this.extend(Ul.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(Ul.convert(e)):this;if(r=e._sw,i=e._ne,!r||!i)return this}return t||n?(t.lng=Math.min(r.lng,t.lng),t.lat=Math.min(r.lat,t.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)):(this._sw=new Ul(r.lng,r.lat),this._ne=new Ul(i.lng,i.lat)),this}getCenter(){return new Ul((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Ul(this.getWest(),this.getNorth())}getSouthEast(){return new Ul(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:n}=Ul.convert(e);let r=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&r}static convert(e){return!e||e instanceof ls?e:new ls(e)}}var cs=1e-6,us="undefined"!=typeof Float32Array?Float32Array:Array;function hs(){var e=new us(9);return us!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ds(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],f=n[1],p=n[2],m=n[3],g=n[4],v=n[5],y=n[6],_=n[7],x=n[8];return e[0]=d*r+f*a+p*c,e[1]=d*i+f*s+p*u,e[2]=d*o+f*l+p*h,e[3]=m*r+g*a+v*c,e[4]=m*i+g*s+v*u,e[5]=m*o+g*l+v*h,e[6]=y*r+_*a+x*c,e[7]=y*i+_*s+x*u,e[8]=y*o+_*l+x*h,e}function fs(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ps(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],v=t[15],y=n*s-r*a,_=n*l-i*a,x=n*c-o*a,w=r*l-i*s,b=r*c-o*s,E=i*c-o*l,k=u*m-h*p,T=u*g-d*p,M=u*v-f*p,S=h*g-d*m,C=h*v-f*m,A=d*v-f*g,I=y*A-_*C+x*S+w*M-b*T+E*k;return I?(e[0]=(s*A-l*C+c*S)*(I=1/I),e[1]=(i*C-r*A-o*S)*I,e[2]=(m*E-g*b+v*w)*I,e[3]=(d*b-h*E-f*w)*I,e[4]=(l*M-a*A-c*T)*I,e[5]=(n*A-i*M+o*T)*I,e[6]=(g*x-p*E-v*_)*I,e[7]=(u*E-d*x+f*_)*I,e[8]=(a*C-s*M+c*k)*I,e[9]=(r*M-n*C-o*k)*I,e[10]=(p*b-m*x+v*y)*I,e[11]=(h*x-u*b-f*y)*I,e[12]=(s*T-a*S-l*k)*I,e[13]=(n*S-r*T+i*k)*I,e[14]=(m*_-p*w-g*y)*I,e[15]=(u*w-h*_+d*y)*I,e):null}function ms(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],v=t[14],y=t[15],_=n[0],x=n[1],w=n[2],b=n[3];return e[0]=_*r+x*s+w*h+b*m,e[1]=_*i+x*l+w*d+b*g,e[2]=_*o+x*c+w*f+b*v,e[3]=_*a+x*u+w*p+b*y,e[4]=(_=n[4])*r+(x=n[5])*s+(w=n[6])*h+(b=n[7])*m,e[5]=_*i+x*l+w*d+b*g,e[6]=_*o+x*c+w*f+b*v,e[7]=_*a+x*u+w*p+b*y,e[8]=(_=n[8])*r+(x=n[9])*s+(w=n[10])*h+(b=n[11])*m,e[9]=_*i+x*l+w*d+b*g,e[10]=_*o+x*c+w*f+b*v,e[11]=_*a+x*u+w*p+b*y,e[12]=(_=n[12])*r+(x=n[13])*s+(w=n[14])*h+(b=n[15])*m,e[13]=_*i+x*l+w*d+b*g,e[14]=_*o+x*c+w*f+b*v,e[15]=_*a+x*u+w*p+b*y,e}function gs(e,t,n){var r,i,o,a,s,l,c,u,h,d,f,p,m=n[0],g=n[1],v=n[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*v+t[12],e[13]=t[1]*m+t[5]*g+t[9]*v+t[13],e[14]=t[2]*m+t[6]*g+t[10]*v+t[14],e[15]=t[3]*m+t[7]*g+t[11]*v+t[15]):(i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=r=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=r*m+s*g+h*v+t[12],e[13]=i*m+l*g+d*v+t[13],e[14]=o*m+c*g+f*v+t[14],e[15]=a*m+u*g+p*v+t[15]),e}function vs(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ys(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+u*r,e[6]=s*i+h*r,e[7]=l*i+d*r,e[8]=c*i-o*r,e[9]=u*i-a*r,e[10]=h*i-s*r,e[11]=d*i-l*r,e}function _s(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-u*r,e[2]=s*i-h*r,e[3]=l*i-d*r,e[8]=o*r+c*i,e[9]=a*r+u*i,e[10]=s*r+h*i,e[11]=l*r+d*i,e}function xs(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ws(e,t,n){var r,i,o,a=n[0],s=n[1],l=n[2],c=Math.hypot(a,s,l);return c<cs?null:(a*=c=1/c,s*=c,l*=c,r=Math.sin(t),i=Math.cos(t),e[0]=a*a*(o=1-i)+i,e[1]=s*a*o+l*r,e[2]=l*a*o-s*r,e[3]=0,e[4]=a*s*o-l*r,e[5]=s*s*o+i,e[6]=l*s*o+a*r,e[7]=0,e[8]=a*l*o+s*r,e[9]=s*l*o-a*r,e[10]=l*l*o+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var bs=ms;function Es(){var e=new us(3);return us!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ks(e){var t=new us(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ts(e){return Math.hypot(e[0],e[1],e[2])}function Ms(e,t,n){var r=new us(3);return r[0]=e,r[1]=t,r[2]=n,r}function Ss(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Cs(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function As(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function Is(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Rs(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function Ls(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function zs(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function Ps(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Os(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ds(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e}function Bs(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}function Fs(e,t,n){var r=n[0],i=n[1],o=n[2],a=t[0],s=t[1],l=t[2],c=i*l-o*s,u=o*a-r*l,h=r*s-i*a,d=i*h-o*u,f=o*c-r*h,p=r*u-i*c,m=2*n[3];return u*=m,h*=m,f*=2,p*=2,e[0]=a+(c*=m)+(d*=2),e[1]=s+u+f,e[2]=l+h+p,e}var js,Ns=Cs,Vs=As,Us=Ts;function Hs(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function Ws(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e}function $s(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}function Gs(){var e=new us(4);return us!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function qs(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Zs(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+a*s,e[1]=i*l+o*s,e[2]=o*l-i*s,e[3]=a*l-r*s,e}function Xs(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l-o*s,e[1]=i*l+a*s,e[2]=o*l+r*s,e[3]=a*l-i*s,e}Es(),js=new us(4),us!=Float32Array&&(js[0]=0,js[1]=0,js[2]=0,js[3]=0);var Ys=Ws;Es(),Ms(1,0,0),Ms(0,1,0),Gs(),Gs(),hs();const Ks=jo([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Js}=Ks,Qs=jo([{name:"a_pos_3",components:3,type:"Int16"}]);var el=jo([{name:"a_pos",type:"Int16",components:2}]);class tl{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,n){const r=Os(t,this.dir);if(Math.abs(r)<1e-6)return!1;const i=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/r;return n[0]=this.pos[0]+this.dir[0]*i,n[1]=this.pos[1]+this.dir[1]*i,n[2]=this.pos[2]+this.dir[2]*i,!0}closestPointOnSphere(e,t,n){if(function(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2];return Math.abs(n-o)<=cs*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=cs*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=cs*Math.max(1,Math.abs(i),Math.abs(s))}(this.pos,e)||0===t)return n[0]=n[1]=n[2]=0,!1;const[r,i,o]=this.dir,a=this.pos[0]-e[0],s=this.pos[1]-e[1],l=this.pos[2]-e[2],c=r*r+i*i+o*o,u=2*(a*r+s*i+l*o),h=u*u-4*c*(a*a+s*s+l*l-t*t);if(h<0){const e=Math.max(-u/2,0),c=a+r*e,h=s+i*e,d=l+o*e,f=Math.hypot(c,h,d);return n[0]=c*t/f,n[1]=h*t/f,n[2]=d*t/f,!1}{const e=(-u-Math.sqrt(h))/(2*c);if(e<0){const e=Math.hypot(a,s,l);return n[0]=a*t/e,n[1]=s*t/e,n[2]=l*t/e,!1}return n[0]=a+r*e,n[1]=s+i*e,n[2]=l+o*e,!0}}}class nl{constructor(e,t,n,r,i){this.TL=e,this.TR=t,this.BR=n,this.BL=r,this.horizon=i}static fromInvProjectionMatrix(e,t,n){const r=[-1,1,1],i=[1,1,1],o=[1,-1,1],a=[-1,-1,1],s=Bs(r,r,e),l=Bs(i,i,e),c=Bs(o,o,e),u=Bs(a,a,e);return new nl(s,l,c,u,t/n)}}class rl{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,t,n,r){const i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((n=>{const o=$s([],n,e),a=1/o[3]/t*i;return function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}(o,o,[a,a,r?1/o[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=Ps([],Ds([],Ns([],o[e[0]],o[e[1]]),Ns([],o[e[2]],o[e[1]]))),n=-Os(t,o[e[1]]);return t.concat(n)}));return new rl(o,a)}}class il{static fromPoints(e){const t=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const r of e)Is(t,t,r),Rs(n,n,r);return new il(t,n)}static applyTransform(e,t){const n=e.getCorners();for(let e=0;e<n.length;++e)Bs(n[e],n[e],t);return il.fromPoints(n)}constructor(e,t){this.min=e,this.max=t,this.center=Ls([],Ss([],this.min,this.max),.5)}quadrant(e){const t=[e%2==0,e<2],n=ks(this.min),r=ks(this.max);for(let e=0;e<t.length;e++)n[e]=t[e]?this.min[e]:this.center[e],r[e]=t[e]?this.center[e]:this.max[e];return r[2]=this.max[2],new il(n,r)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){const t=this.getCorners();let n=!0;for(let r=0;r<e.planes.length;r++){const i=e.planes[r];let o=0;for(let e=0;e<t.length;e++)o+=Os(i,t[e])+i[3]>=0;if(0===o)return 0;o!==t.length&&(n=!1)}if(n)return 2;for(let t=0;t<3;t++){let n=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;i<e.points.length;i++){const o=e.points[i][t]-this.min[t];n=Math.min(n,o),r=Math.max(r,o)}if(r<0||n>this.max[t]-this.min[t])return 0}return 1}}const ol=5,al=6,sl=ss/Math.PI/2,ll=16383,cl=64,ul=[cl,32,16],hl=-sl,dl=sl,fl=[new il([hl,hl,hl],[dl,dl,dl]),new il([hl,hl,hl],[0,0,dl]),new il([0,hl,hl],[dl,0,dl]),new il([hl,0,hl],[0,dl,dl]),new il([0,0,hl],[dl,dl,dl])];function pl(e){return e*sl/jl}function ml(e,t,n,r=!0){const i=Ls([],e._camera.position,e.worldSize),o=[t,n,1,1];$s(o,o,e.pixelMatrixInverse),Hs(o,o,1/o[3]);const a=Ps([],Ns([],o,i)),s=e.globeMatrix,l=[s[12],s[13],s[14]],c=Ns([],l,i),u=Ts(c),h=Ps([],c),d=e.worldSize/(2*Math.PI),f=Os(h,a),p=Math.asin(d/u);if(p<Math.acos(f)){if(!r)return null;const e=[],t=[];Ls(e,a,u/f),Ps(t,Ns(t,e,c)),Ps(a,Ss(a,c,Ls(a,t,Math.tan(p)*u)))}const m=[];new tl(i,a).closestPointOnSphere(l,d,m);const g=Ps([],J(s,0)),v=Ps([],J(s,1)),y=Ps([],J(s,2)),_=Os(g,m),x=Os(v,m),w=Os(y,m),E=b(Math.asin(-x/d));let k=b(Math.atan2(_,w));k=e.center.lng+function(e,t){const n=(t-e+180)%360-180;return n<-180?n+360:n}(e.center.lng,k);const T=Wl(k),M=S($l(E),0,1);return new Jl(T,M)}class gl{constructor(e,t,n){this.a=Ns([],e,n),this.b=Ns([],t,n),this.center=n;const r=Ps([],this.a),i=Ps([],this.b);this.angle=Math.acos(Os(r,i))}}function vl(e,t){if(0===e.angle)return null;let n;return n=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),n<0||n>1?null:function(e,t,n,r){const i=Math.sin(n);return e*(Math.sin((1-r)*n)/i)+t*(Math.sin(r*n)/i)}(e.a[t],e.b[t],e.angle,S(n,0,1))+e.center[t]}function yl(e){if(e.z<=1)return fl[e.z+2*e.y+e.x];const t=kl(El(e));return il.fromPoints(t)}function _l(e,t,n){return Ls(e,e,1-n),zs(e,e,t,n)}function xl(e,t){const n=zl(t.zoom);if(0===n)return yl(e);const r=El(e),i=kl(r),o=Wl(r.getWest())*t.worldSize,a=Wl(r.getEast())*t.worldSize,s=$l(r.getNorth())*t.worldSize,l=$l(r.getSouth())*t.worldSize,c=[o,s,0],u=[a,s,0],h=[o,l,0],d=[a,l,0],f=ps([],t.globeMatrix);return Bs(c,c,f),Bs(u,u,f),Bs(h,h,f),Bs(d,d,f),i[0]=_l(i[0],h,n),i[1]=_l(i[1],d,n),i[2]=_l(i[2],u,n),i[3]=_l(i[3],c,n),il.fromPoints(i)}function wl(e,t,n){for(const r of e)Bs(r,r,t),Ls(r,r,n)}function bl(e,t,n){const r=t/e.worldSize,i=e.globeMatrix;if(n.z<=1){const e=yl(n).getCorners();return wl(e,i,r),il.fromPoints(e)}const o=El(n),a=kl(o);wl(a,i,r);const s=Number.MAX_VALUE,l=[-s,-s,-s],c=[s,s,s];if(o.contains(e.center)){for(const e of a)Is(c,c,e),Rs(l,l,e);l[2]=0;const t=e.point,n=[t.x*r,t.y*r,0];return Is(c,c,n),Rs(l,l,n),new il(c,l)}const u=[i[12]*r,i[13]*r,i[14]*r],h=o.getCenter(),d=S(e.center.lat,-Yl,Yl),f=S(h.lat,-Yl,Yl),p=Wl(e.center.lng),m=$l(d);let g=p-Wl(h.lng);const v=m-$l(f);g>.5?g-=1:g<-.5&&(g+=1);let y=0;Math.abs(g)>Math.abs(v)?y=g>=0?1:3:(y=v>=0?0:2,zs(u,u,[i[4]*r,i[5]*r,i[6]*r],-Math.sin(w(v>=0?o.getSouth():o.getNorth()))*sl));const _=a[y],x=a[(y+1)%4],b=new gl(_,x,u),E=[vl(b,0)||_[0],vl(b,1)||_[1],vl(b,2)||_[2]],k=zl(e.zoom);if(k>0){const r=function({x:e,y:t,z:n},r,i,o,a){const s=1/(1<<n);let l=e*s,c=l+s,u=t*s,h=u+s,d=0;const f=(l+c)/2-o;return f>.5?d=-1:f<-.5&&(d=1),l=((l+d)*r-(o*=r))*i+o,c=((c+d)*r-o)*i+o,u=(u*r-(a*=r))*i+a,h=(h*r-a)*i+a,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(n,t,e._pixelsPerMercatorPixel,p,m);for(let e=0;e<a.length;e++)_l(a[e],r[e],k);const i=Ss([],r[y],r[(y+1)%4]);Ls(i,i,.5),_l(E,i,k)}for(const e of a)Is(c,c,e),Rs(l,l,e);return c[2]=Math.min(_[2],x[2]),Is(c,c,E),Rs(l,l,E),new il(c,l)}function El({x:e,y:t,z:n}){const r=1/(1<<n),i=new Ul(ql(e*r),Zl((t+1)*r)),o=new Ul(ql((e+1)*r),Zl(t*r));return new ls(i,o)}function kl(e){const t=w(e.getNorth()),n=w(e.getSouth()),r=Math.cos(t),i=Math.cos(n),o=Math.sin(t),a=Math.sin(n),s=e.getWest(),l=e.getEast();return[Tl(i,a,s),Tl(i,a,l),Tl(r,o,l),Tl(r,o,s)]}function Tl(e,t,n,r=sl){return n=w(n),[e*Math.sin(n)*r,-t*r,e*Math.cos(n)*r]}function Ml(e,t,n){return Tl(Math.cos(w(e)),Math.sin(w(e)),t,n)}function Sl(e,t,n,r){const i=1<<n.z,o=(e/ss+n.x)/i;return Ml(Zl((t/ss+n.y)/i),ql(o),r)}function Cl({min:e,max:t}){return ll/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const Al=new Float64Array(16);function Il(e){const t=Cl(e),n=xs(Al,[t,t,t]);return gs(n,n,((r=[])[0]=-(i=e.min)[0],r[1]=-i[1],r[2]=-i[2],r));var r,i}function Rl(e){const t=(r=e.min,(n=Al)[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n);var n,r;const i=1/Cl(e);return vs(t,t,[i,i,i])}function Ll(e,t,n,r,i){const o=function(e){const t=ss/(2*Math.PI);return e/(2*Math.PI)/t}(n),a=[e,t,-n/(2*Math.PI)],s=fs(new Float64Array(16));return gs(s,s,a),vs(s,s,[o,o,o]),ys(s,s,w(-i)),_s(s,s,w(-r)),s}function zl(e){return C(ol,al,e)}function Pl(e,t){const n=Ml(t.lat,t.lng),r=function(e){const t=Ml(e._center.lat,e._center.lng);let n=Ds([],Ms(0,1,0),t);const r=ws([],-e.angle,t);n=Bs(n,n,r),ws(r,-e._pitch,n);const i=Ps([],t);return Ls(i,i,pl(e.cameraToCenterDistance/e.pixelsPerMeter)),Bs(i,i,r),Ss([],t,i)}(e);return a=(i=Cs([],r,n))[0],s=i[1],l=i[2],c=(o=n)[0],u=o[1],h=o[2],f=(d=Math.sqrt(a*a+s*s+l*l)*Math.sqrt(c*c+u*u+h*h))&&Os(i,o)/d,Math.acos(Math.min(Math.max(f,-1),1));var i,o,a,s,l,c,u,h,d,f}function Ol(e,t){return Pl(e,t)>Math.PI/2*1.01}const Dl=w(85),Bl=Math.cos(Dl),Fl=Math.sin(Dl),jl=6371008.8,Nl=2*Math.PI*jl;class Vl{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Vl(A(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return jl*Math.acos(Math.min(i,1))}toBounds(e=0){const t=360*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return new ls(new Vl(this.lng-n,this.lat-t),new Vl(this.lng+n,this.lat+t))}toEcef(e){const t=pl(e);return Ml(this.lat,this.lng,sl+t)}static convert(e){if(e instanceof Vl)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Vl(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Vl(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}var Ul=Vl;function Hl(e){return Nl*Math.cos(e*Math.PI/180)}function Wl(e){return(180+e)/360}function $l(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Gl(e,t){return e/Hl(t)}function ql(e){return 360*e-180}function Zl(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function Xl(e,t){return e*Hl(Zl(t))}const Yl=85.051129;function Kl(e){return 1/Math.cos(e*Math.PI/180)}class Jl{constructor(e,t,n=0){this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e,t=0){const n=Ul.convert(e);return new Jl(Wl(n.lng),$l(n.lat),Gl(t,n.lat))}toLngLat(){return new Ul(ql(this.x),Zl(this.y))}toAltitude(){return Xl(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Nl*Kl(Zl(this.y))}}function Ql(e,t,n,r,i,o,a,s,l){const c=(t+r)/2,u=(n+i)/2,h=new y(c,u);s(h),function(e,t,n,r,i,o){const a=n-i,s=r-o;return Math.abs((r-t)*a-(n-e)*s)/Math.hypot(a,s)}(h.x,h.y,o.x,o.y,a.x,a.y)>=l?(Ql(e,t,n,c,u,o,h,s,l),Ql(e,c,u,r,i,h,a,s,l)):e.push(a)}function ec(e,t,n){let r=e[0],i=r.x,o=r.y;t(r);const a=[r];for(let s=1;s<e.length;s++){const l=e[s],{x:c,y:u}=l;t(l),Ql(a,i,o,c,u,r,l,t,n),i=c,o=u,r=l}return a}function tc(e,t,n,r){if(r(t,n)){const i=t.add(n)._mult(.5);tc(e,t,i,r),tc(e,i,n,r)}else e.push(n)}function nc(e,t){let n=e[0];const r=[n];for(let i=1;i<e.length;i++){const o=e[i];tc(r,n,o,t),n=o}return r}const rc=Math.pow(2,14)-1,ic=-rc-1;function oc(e,t){const n=Math.round(e.x*t),r=Math.round(e.y*t);return e.x=S(n,ic,rc),e.y=S(r,ic,rc),(n<e.x||n>e.x+1||r<e.y||r>e.y+1)&&W("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function ac(e,t,n){const r=e.loadGeometry(),i=e.extent,o=ss/i;if(t&&n&&n.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:a,x:s,y:l,projection:c}=n,u=e=>{const n=ql((t.x+e.x/i)/o),r=Zl((t.y+e.y/i)/o),u=c.project(n,r);e.x=(u.x*a-s)*i,e.y=(u.y*a-l)*i};for(let t=0;t<r.length;t++)if(1!==e.type)r[t]=ec(r[t],u,1);else{const e=[];for(const n of r[t])n.x<0||n.x>=i||n.y<0||n.y>=i||(u(n),e.push(n));r[t]=e}}for(const e of r)for(const t of e)oc(t,o);return r}function sc(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?ac(e):[]}}function lc(e,t,n,r,i){e.emplaceBack(2*t+(r+1)/2,2*n+(i+1)/2)}function cc(e,t,n){const r=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*r,n[1]*r,n[2]*r)}class uc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Vo,this.indexArray=new ra,this.segments=new as,this.programConfigurations=new Ya(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n,r){const i=this.layers[0],o=[];let a=null;"circle"===i.type&&(a=i.layout.get("circle-sort-key"));for(const{feature:t,id:i,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=sc(t,e);if(!this.layers[0]._featureFilter.filter(new bo(this.zoom),c,n))continue;const u=a?a.evaluate(c,{},n):void 0,h={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:ac(t,n,r),patterns:{},sortKey:u};o.push(h)}a&&o.sort(((e,t)=>e.sortKey-t.sortKey));let s=null;"globe"===r.projection.name&&(this.globeExtVertexArray=new Zo,s=r.projection);for(const r of o){const{geometry:i,index:o,sourceLayerIndex:a}=r,l=e[o].feature;this.addFeature(r,i,o,t.availableImages,n,s),t.featureIndex.insert(l,i,o,a,this.index)}}update(e,t,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,is.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,os.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,n,r,i,o){for(const n of t)for(const t of n){const n=t.x,r=t.y;if(n<0||n>=ss||r<0||r>=ss)continue;if(o){const e=o.projectTilePoint(n,r,i),t=o.upVector(i,n,r),a=this.globeExtVertexArray;cc(a,e,t),cc(a,e,t),cc(a,e,t),cc(a,e,t)}const a=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),s=a.vertexLength;lc(this.layoutVertexArray,n,r,-1,-1),lc(this.layoutVertexArray,n,r,1,-1),lc(this.layoutVertexArray,n,r,1,1),lc(this.layoutVertexArray,n,r,-1,1),this.indexArray.emplaceBack(s,s+1,s+2),this.indexArray.emplaceBack(s,s+2,s+3),a.vertexLength+=4,a.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},r,i)}}function hc(e,t){for(let n=0;n<e.length;n++)if(xc(t,e[n]))return!0;for(let n=0;n<t.length;n++)if(xc(e,t[n]))return!0;return!!mc(e,t)}function dc(e,t,n){return!!xc(e,t)||!!vc(t,e,n)}function fc(e,t){if(1===e.length)return _c(t,e[0]);for(let n=0;n<t.length;n++){const r=t[n];for(let t=0;t<r.length;t++)if(xc(e,r[t]))return!0}for(let n=0;n<e.length;n++)if(_c(t,e[n]))return!0;for(let n=0;n<t.length;n++)if(mc(e,t[n]))return!0;return!1}function pc(e,t,n){if(e.length>1){if(mc(e,t))return!0;for(let r=0;r<t.length;r++)if(vc(t[r],e,n))return!0}for(let r=0;r<e.length;r++)if(vc(e[r],t,n))return!0;return!1}function mc(e,t){if(0===e.length||0===t.length)return!1;for(let n=0;n<e.length-1;n++){const r=e[n],i=e[n+1];for(let e=0;e<t.length-1;e++)if(gc(r,i,t[e],t[e+1]))return!0}return!1}function gc(e,t,n,r){return $(e,n,r)!==$(t,n,r)&&$(e,t,n)!==$(e,t,r)}function vc(e,t,n){const r=n*n;if(1===t.length)return e.distSqr(t[0])<r;for(let n=1;n<t.length;n++)if(yc(e,t[n-1],t[n])<r)return!0;return!1}function yc(e,t,n){const r=t.distSqr(n);if(0===r)return e.distSqr(t);const i=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/r;return e.distSqr(i<0?t:i>1?n:n.sub(t)._mult(i)._add(t))}function _c(e,t){let n,r,i,o=!1;for(let a=0;a<e.length;a++){n=e[a];for(let e=0,a=n.length-1;e<n.length;a=e++)r=n[e],i=n[a],r.y>t.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(o=!o)}return o}function xc(e,t){let n=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){const o=e[r],a=e[i];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function wc(e,t,n,r,i){for(const o of e)if(t<=o.x&&n<=o.y&&r>=o.x&&i>=o.y)return!0;const o=[new y(t,n),new y(t,i),new y(r,i),new y(r,n)];if(e.length>2)for(const t of o)if(xc(e,t))return!0;for(let t=0;t<e.length-1;t++)if(bc(e[t],e[t+1],o))return!0;return!1}function bc(e,t,n){const r=n[0],i=n[2];if(e.x<r.x&&t.x<r.x||e.x>i.x&&t.x>i.x||e.y<r.y&&t.y<r.y||e.y>i.y&&t.y>i.y)return!1;const o=$(e,t,n[0]);return o!==$(e,t,n[1])||o!==$(e,t,n[2])||o!==$(e,t,n[3])}function Ec(e,t,n){const r=t.paint.get(e).value;return"constant"===r.kind?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function kc(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Tc(e,t,n,r,i){if(!t[0]&&!t[1])return e;const o=y.convert(t)._mult(i);"viewport"===n&&o._rotate(-r);const a=[];for(let t=0;t<e.length;t++)a.push(e[t].sub(o));return a}function Mc(e,t,n,r){const i=y.convert(e)._mult(r);return"viewport"===t&&i._rotate(-n),i}Xi(uc,"CircleBucket",{omit:["layers"]});const Sc=new Po({"circle-sort-key":new Lo(et.layout_circle["circle-sort-key"])});var Cc={paint:new Po({"circle-radius":new Lo(et.paint_circle["circle-radius"]),"circle-color":new Lo(et.paint_circle["circle-color"]),"circle-blur":new Lo(et.paint_circle["circle-blur"]),"circle-opacity":new Lo(et.paint_circle["circle-opacity"]),"circle-translate":new Ro(et.paint_circle["circle-translate"]),"circle-translate-anchor":new Ro(et.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ro(et.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ro(et.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Lo(et.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Lo(et.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Lo(et.paint_circle["circle-stroke-opacity"])}),layout:Sc};function Ac(e,t,n,r,i,o,a,s,l){if(o&&e.queryGeometry.isAboveHorizon)return!1;o&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,u=n.projection.upVectorScale(c,n.center.lat,n.worldSize).metersToTile;for(const h of t)for(const t of h){const h=t.add(s),d=i&&n.elevation?n.elevation.exaggeration()*i.getElevationAt(h.x,h.y,!0):0,f=n.projection.projectTilePoint(h.x,h.y,c);if(d>0){const e=n.projection.upVector(c,h.x,h.y);f.x+=e[0]*u*d,f.y+=e[1]*u*d,f.z+=e[2]*u*d}const p=o?h:Ic(f.x,f.y,f.z,r),m=o?e.tilespaceRays.map((e=>zc(e,d))):e.queryGeometry.screenGeometry,g=$s([],[f.x,f.y,f.z,1],r);if(!a&&o?l*=g[3]/n.cameraToCenterDistance:a&&!o&&(l*=n.cameraToCenterDistance/g[3]),o){const e=Zl((t.y/ss+c.y)/(1<<c.z));l/=n.projection.pixelsPerMeter(e,1)/Gl(1,e)}if(dc(m,p,l))return!0}return!1}function Ic(e,t,n,r){const i=$s([],[e,t,n,1],r);return new y(i[0]/i[3],i[1]/i[3])}const Rc=Ms(0,0,0),Lc=Ms(0,0,1);function zc(e,t){const n=Es();return Rc[2]=t,e.intersectsPlane(Rc,Lc,n),new y(n[0],n[1])}class Pc extends uc{}function Oc(e,{width:t,height:n},r,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*n*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(t*n*r);return e.width=t,e.height=n,e.data=i,e}function Dc(e,t,n){const{width:r,height:i}=t;r===e.width&&i===e.height||(Bc(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,i)},n),e.width=r,e.height=i,e.data=t.data)}function Bc(e,t,n,r,i,o){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,s=t.data;for(let l=0;l<i.height;l++){const c=((n.y+l)*e.width+n.x)*o,u=((r.y+l)*t.width+r.x)*o;for(let e=0;e<i.width*o;e++)s[u+e]=a[c+e]}return t}Xi(Pc,"HeatmapBucket",{omit:["layers"]});class Fc{constructor(e,t){Oc(this,e,1,t)}resize(e){Dc(this,new Fc(e),1)}clone(){return new Fc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){Bc(e,t,n,r,i,1)}}class jc{constructor(e,t){Oc(this,e,4,t)}resize(e){Dc(this,new jc(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new jc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){Bc(e,t,n,r,i,4)}}Xi(Fc,"AlphaImage"),Xi(jc,"RGBAImage");var Nc={paint:new Po({"heatmap-radius":new Lo(et.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Lo(et.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ro(et.paint_heatmap["heatmap-intensity"]),"heatmap-color":new zo(et.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ro(et.paint_heatmap["heatmap-opacity"])})};function Vc(e){const t={},n=e.resolution||256,r=e.clips?e.clips.length:1,i=e.image||new jc({width:n,height:r}),o=(n,r,o)=>{t[e.evaluationKey]=o;const a=e.expression.evaluate(t);i.data[n+r+0]=Math.floor(255*a.r/a.a),i.data[n+r+1]=Math.floor(255*a.g/a.a),i.data[n+r+2]=Math.floor(255*a.b/a.a),i.data[n+r+3]=Math.floor(255*a.a)};if(e.clips)for(let t=0,i=0;t<r;++t,i+=4*n)for(let r=0,a=0;r<n;r++,a+=4){const s=r/(n-1),{start:l,end:c}=e.clips[t];o(i,a,l*(1-s)+c*s)}else for(let e=0,t=0;e<n;e++,t+=4)o(0,t,e/(n-1));return i}var Uc={paint:new Po({"hillshade-illumination-direction":new Ro(et.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ro(et.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ro(et.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ro(et.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ro(et.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ro(et.paint_hillshade["hillshade-accent-color"])})};const Hc=jo([{name:"a_pos",components:2,type:"Int16"}],4),{members:Wc}=Hc;var $c={exports:{}};function Gc(e,t,n){n=n||2;var r,i,o,a,s,l,c,u=t&&t.length,h=u?t[0]*n:e.length,d=qc(e,0,h,n,!0),f=[];if(!d||d.next===d.prev)return f;if(u&&(d=function(e,t,n,r){var i,o,a,s=[];for(i=0,o=t.length;i<o;i++)(a=qc(e,t[i]*r,i<o-1?t[i+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(iu(a));for(s.sort(eu),i=0;i<s.length;i++)n=tu(s[i],n);return n}(e,t,d,n)),e.length>80*n){r=o=e[0],i=a=e[1];for(var p=n;p<h;p+=n)(s=e[p])<r&&(r=s),(l=e[p+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-r,a-i))?32767/c:0}return Xc(d,f,n,r,i,c,0),f}function qc(e,t,n,r,i){var o,a;if(i===vu(e,t,n,r)>0)for(o=t;o<n;o+=r)a=pu(o,e[o],e[o+1],a);else for(o=n-r;o>=t;o-=r)a=pu(o,e[o],e[o+1],a);return a&&lu(a,a.next)&&(mu(a),a=a.next),a}function Zc(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!lu(r,r.next)&&0!==su(r.prev,r,r.next))r=r.next;else{if(mu(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Xc(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{0===i.z&&(i.z=ru(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t<c&&(s++,r=r.nextZ);t++);for(l=c;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?Kc(e,r,i,o):Yc(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),mu(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Xc(e=Jc(Zc(e),t,n),t,n,r,i,o,2):2===a&&Qc(e,t,n,r,i,o):Xc(Zc(e),t,n,r,i,o,1);break}}}function Yc(e){var t=e.prev,n=e,r=e.next;if(su(t,n,r)>=0)return!1;for(var i=t.x,o=n.x,a=r.x,s=t.y,l=n.y,c=r.y,u=i<o?i<a?i:a:o<a?o:a,h=s<l?s<c?s:c:l<c?l:c,d=i>o?i>a?i:a:o>a?o:a,f=s>l?s>c?s:c:l>c?l:c,p=r.next;p!==t;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&ou(i,s,o,l,a,c,p.x,p.y)&&su(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Kc(e,t,n,r){var i=e.prev,o=e,a=e.next;if(su(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,c=a.x,u=i.y,h=o.y,d=a.y,f=s<l?s<c?s:c:l<c?l:c,p=u<h?u<d?u:d:h<d?h:d,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,v=ru(f,p,t,n,r),y=ru(m,g,t,n,r),_=e.prevZ,x=e.nextZ;_&&_.z>=v&&x&&x.z<=y;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&ou(s,u,l,h,c,d,_.x,_.y)&&su(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==i&&x!==a&&ou(s,u,l,h,c,d,x.x,x.y)&&su(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;_&&_.z>=v;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==i&&_!==a&&ou(s,u,l,h,c,d,_.x,_.y)&&su(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==i&&x!==a&&ou(s,u,l,h,c,d,x.x,x.y)&&su(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Jc(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!lu(i,o)&&cu(i,r,r.next,o)&&du(i,o)&&du(o,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),mu(r),mu(r.next),r=e=o),r=r.next}while(r!==e);return Zc(r)}function Qc(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&au(a,s)){var l=fu(a,s);return a=Zc(a,a.next),l=Zc(l,l.next),Xc(a,t,n,r,i,o,0),void Xc(l,t,n,r,i,o,0)}s=s.next}a=a.next}while(a!==e)}function eu(e,t){return e.x-t.x}function tu(e,t){var n=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==t);if(!n)return null;var l,c=n,u=n.x,h=n.y,d=1/0;r=n;do{i>=r.x&&r.x>=u&&i!==r.x&&ou(o<h?i:a,o,u,h,o<h?a:i,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(i-r.x),du(r,e)&&(l<d||l===d&&(r.x>n.x||r.x===n.x&&nu(n,r)))&&(n=r,d=l)),r=r.next}while(r!==c);return n}(e,t);if(!n)return t;var r=fu(n,e);return Zc(r,r.next),Zc(n,n.next)}function nu(e,t){return su(e.prev,e,t.prev)<0&&su(t.next,e,e.next)<0}function ru(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function iu(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function ou(e,t,n,r,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(r-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function au(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&cu(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(du(e,t)&&du(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(su(e.prev,e,t.prev)||su(e,t.prev,t))||lu(e,t)&&su(e.prev,e,e.next)>0&&su(t.prev,t,t.next)>0)}function su(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function lu(e,t){return e.x===t.x&&e.y===t.y}function cu(e,t,n,r){var i=hu(su(e,t,n)),o=hu(su(e,t,r)),a=hu(su(n,r,e)),s=hu(su(n,r,t));return i!==o&&a!==s||!(0!==i||!uu(e,n,t))||!(0!==o||!uu(e,r,t))||!(0!==a||!uu(n,e,r))||!(0!==s||!uu(n,t,r))}function uu(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function hu(e){return e>0?1:e<0?-1:0}function du(e,t){return su(e.prev,e,e.next)<0?su(e,t,e.next)>=0&&su(e,e.prev,t)>=0:su(e,t,e.prev)<0||su(e,e.next,t)<0}function fu(e,t){var n=new gu(e.i,e.x,e.y),r=new gu(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function pu(e,t,n,r){var i=new gu(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function mu(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function gu(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function vu(e,t,n,r){for(var i=0,o=t,a=n-r;o<n;o+=r)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}$c.exports=Gc,$c.exports.default=Gc,Gc.deviation=function(e,t,n,r){var i=t&&t.length,o=Math.abs(vu(e,0,i?t[0]*n:e.length,n));if(i)for(var a=0,s=t.length;a<s;a++)o-=Math.abs(vu(e,t[a]*n,a<s-1?t[a+1]*n:e.length,n));var l=0;for(a=0;a<r.length;a+=3){var c=r[a]*n,u=r[a+1]*n,h=r[a+2]*n;l+=Math.abs((e[c]-e[h])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[h+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Gc.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)n.vertices.push(e[i][o][a]);i>0&&n.holes.push(r+=e[i-1].length)}return n};var yu=d($c.exports);function _u(e,t,n,r,i){xu(e,t,n||0,r||e.length-1,i||bu)}function xu(e,t,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);xu(e,t,Math.max(n,Math.floor(t-a*l/o+c)),Math.min(r,Math.floor(t+(o-a)*l/o+c)),i)}var u=e[t],h=n,d=r;for(wu(e,n,t),i(e[r],u)>0&&wu(e,n,r);h<d;){for(wu(e,h,d),h++,d--;i(e[h],u)<0;)h++;for(;i(e[d],u)>0;)d--}0===i(e[n],u)?wu(e,n,d):wu(e,++d,r),d<=t&&(n=d+1),t<=d&&(r=d-1)}}function wu(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function bu(e,t){return e<t?-1:e>t?1:0}function Eu(e,t){const n=e.length;if(n<=1)return[e];const r=[];let i,o;for(let t=0;t<n;t++){const n=G(e[t]);0!==n&&(e[t].area=Math.abs(n),void 0===o&&(o=n<0),o===n<0?(i&&r.push(i),i=[e[t]]):i.push(e[t]))}if(i&&r.push(i),t>1)for(let e=0;e<r.length;e++)r[e].length<=t||(_u(r[e],t,1,r[e].length-1,ku),r[e]=r[e].slice(0,t));return r}function ku(e,t){return t.area-e.area}function Tu(e,t,n){const r=n.patternDependencies;let i=!1;for(const n of t){const t=n.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);const o=t.constantOr(null);o&&(i=!0,r[o]=!0)}return i}function Mu(e,t,n,r,i){const o=i.patternDependencies;for(const a of t){const t=a.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:r},n,{},i.availableImages);e=e&&e.name?e.name:e,o[e]=!0,n.patterns[a.id]=e}}return n}class Su{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Vo,this.indexArray=new ra,this.indexArray2=new ca,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new as,this.segments2=new as,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}populate(e,t,n,r){this.hasPattern=Tu("fill",this.layers,t);const i=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=sc(a,e);if(!this.layers[0]._featureFilter.filter(new bo(this.zoom),u,n))continue;const h=i?i.evaluate(u,{},n,t.availableImages):void 0,d={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:ac(a,n,r),patterns:{},sortKey:h};o.push(d)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const r of o){const{geometry:i,index:o,sourceLayerIndex:a}=r;if(this.hasPattern){const e=Mu("fill",this.layers,r,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(r,i,o,n,{},t.availableImages);t.featureIndex.insert(e[o].feature,i,o,a,this.index)}}update(e,t,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,r)}addFeatures(e,t,n,r,i){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Wc),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,t,n,r,i,o=[]){for(const e of Eu(t,500)){let t=0;for(const n of e)t+=n.length;const n=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),r=n.vertexLength,i=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(i.length/2);const n=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),r=n.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(r+t.length-1,r),i.push(t[0].x),i.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(r+e-1,r+e),i.push(t[e].x),i.push(t[e].y);n.vertexLength+=t.length,n.primitiveLength+=t.length}const a=yu(i,o);for(let e=0;e<a.length;e+=3)this.indexArray.emplaceBack(r+a[e],r+a[e+1],r+a[e+2]);n.vertexLength+=t,n.primitiveLength+=a.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,o,r)}}Xi(Su,"FillBucket",{omit:["layers","patternFeatures"]});const Cu=new Po({"fill-sort-key":new Lo(et.layout_fill["fill-sort-key"])});var Au={paint:new Po({"fill-antialias":new Ro(et.paint_fill["fill-antialias"]),"fill-opacity":new Lo(et.paint_fill["fill-opacity"]),"fill-color":new Lo(et.paint_fill["fill-color"]),"fill-outline-color":new Lo(et.paint_fill["fill-outline-color"]),"fill-translate":new Ro(et.paint_fill["fill-translate"]),"fill-translate-anchor":new Ro(et.paint_fill["fill-translate-anchor"]),"fill-pattern":new Lo(et.paint_fill["fill-pattern"])}),layout:Cu};const Iu=jo([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Ru=jo([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Lu=jo([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:zu}=Iu;var Pu={},Ou=g,Du=Bu;function Bu(e,t,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=i,e.readFields(Fu,this,t)}function Fu(e,t,n){1==e?t.id=n.readVarint():2==e?function(e,t){for(var n=e.readVarint()+e.pos;e.pos<n;){var r=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[r]=i}}(n,t):3==e?t.type=n.readVarint():4==e&&(t._geometry=n.pos)}function ju(e){for(var t,n,r=0,i=0,o=e.length,a=o-1;i<o;a=i++)r+=((n=e[a]).x-(t=e[i]).x)*(t.y+n.y);return r}Bu.types=["Unknown","Point","LineString","Polygon"],Bu.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,n=e.readVarint()+e.pos,r=1,i=0,o=0,a=0,s=[];e.pos<n;){if(i<=0){var l=e.readVarint();r=7&l,i=l>>3}if(i--,1===r||2===r)o+=e.readSVarint(),a+=e.readSVarint(),1===r&&(t&&s.push(t),t=[]),t.push(new Ou(o,a));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}}return t&&s.push(t),s},Bu.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(r<=0){var u=e.readVarint();n=7&u,r=u>>3}if(r--,1===n||2===n)(i+=e.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,l,s,c]},Bu.prototype.toGeoJSON=function(e,t,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Bu.types[this.type];function u(e){for(var t=0;t<e.length;t++){var n=e[t];e[t]=[360*(n.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(n.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<l.length;r++)h[r]=l[r][0];u(l=h);break;case 2:for(r=0;r<l.length;r++)u(l[r]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var n,r,i=[],o=0;o<t;o++){var a=ju(e[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[e[o]]):n.push(e[o]))}return n&&i.push(n),i}(l),r=0;r<l.length;r++)for(i=0;i<l[r].length;i++)u(l[r][i])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var Nu=Du,Vu=Uu;function Uu(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Hu,this,t),this.length=this._features.length}function Hu(e,t,n){15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){for(var t=null,n=e.readVarint()+e.pos;e.pos<n;){var r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(n))}Uu.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Nu(this._pbf,t,this.extent,this._keys,this._values)};var Wu=Vu;function $u(e,t,n){if(3===e){var r=new Wu(n,n.readVarint()+n.pos);r.length&&(t[r.name]=r)}}var Gu=Pu.VectorTile=function(e,t){this.layers=e.readFields($u,{},t)},qu=Pu.VectorTileFeature=Du;function Zu(e,t,n,r){const i=[],o=0===r?(e,t,n,r,i,o)=>{e.push(new y(o,n+(o-t)/(r-t)*(i-n)))}:(e,t,n,r,i,o)=>{e.push(new y(t+(o-n)/(i-n)*(r-t),o))};for(const a of e){const e=[];for(const i of a){if(i.length<=2)continue;const a=[];for(let e=0;e<i.length-1;e++){const s=i[e].x,l=i[e].y,c=i[e+1].x,u=i[e+1].y,h=0===r?s:l,d=0===r?c:u;h<t?d>t&&o(a,s,l,c,u,t):h>n?d<n&&o(a,s,l,c,u,n):a.push(i[e]),d<t&&h>=t&&o(a,s,l,c,u,t),d>n&&h<=n&&o(a,s,l,c,u,n)}let s=i[i.length-1];const l=0===r?s.x:s.y;l>=t&&l<=n&&a.push(s),a.length&&(s=a[a.length-1],a[0].x===s.x&&a[0].y===s.y||a.push(a[0]),e.push(a))}e.length&&i.push(e)}return i}Pu.VectorTileLayer=Vu;const Xu=qu.types,Yu=Math.pow(2,13);function Ku(e,t,n,r,i,o,a,s){e.emplaceBack((t<<1)+a,(n<<1)+o,(Math.floor(r*Yu)<<1)+i,Math.round(s))}function Ju(e,t,n){const r=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*r,n[1]*r,n[2]*r)}class Qu{constructor(){this.acc=new y(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new y(e.x,e.y),this.max=new y(e.x,e.y))}append(e,t){this.currentPolyCount.edges++,this.acc._add(e);const n=this.min,r=this.max;e.x<n.x?n.x=e.x:e.x>r.x&&(r.x=e.x),e.y<n.y?n.y=e.y:e.y>r.y&&(r.y=e.y),((0===e.x||e.x===ss)&&e.x===t.x)!=((0===e.y||e.y===ss)&&e.y===t.y)&&this.processBorderOverlap(e,t),t.x<0!=e.x<0&&this.addBorderIntersection(0,Ln(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>ss!=e.x>ss&&this.addBorderIntersection(1,Ln(t.y,e.y,(ss-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,Ln(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>ss!=e.y>ss&&this.addBorderIntersection(3,Ln(t.x,e.x,(ss-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[e];t<n[0]&&(n[0]=t),t>n[1]&&(n[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const n=0===e.x?0:1;this.addBorderIntersection(n,t.y),this.addBorderIntersection(n,e.y)}else{const n=0===e.y?2:3;this.addBorderIntersection(n,t.x),this.addBorderIntersection(n,e.x)}}centroid(){const e=this.polyCount.reduce(((e,t)=>e+t.edges),0);return 0!==e?this.acc.div(e)._round():new y(0,0)}span(){return new y(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0)}}class eh{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new Ho,this.centroidVertexArray=new ba,this.indexArray=new ra,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new as,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.enableTerrain=e.enableTerrain}populate(e,t,n,r){this.features=[],this.hasPattern=Tu("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(e){const t=Math.exp(Math.PI*(1-e.y/(1<<e.z)*2));return 80150034*t/(t*t+1)/ss/(1<<e.z)}(n),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:i,id:o,index:a,sourceLayerIndex:s}of e){const e=this.layers[0]._featureFilter.needGeometry,l=sc(i,e);if(!this.layers[0]._featureFilter.filter(new bo(this.zoom),l,n))continue;const c={id:o,sourceLayerIndex:s,index:a,geometry:e?l.geometry:ac(i,n,r),properties:i.properties,type:i.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(Mu("fill-extrusion",this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,a,n,{},t.availableImages,r),t.featureIndex.insert(i,c.geometry,a,s,this.index,u)}this.sortBorders()}addFeatures(e,t,n,r,i){for(const e of this.features){const{geometry:o}=e;this.addFeature(e,o,e.index,t,n,r,i)}this.sortBorders()}update(e,t,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zu),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,Lu.members,!0))),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Ru.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,n,r,i,o,a){const s=[new y(0,0),new y(ss,ss)],l=a.projection,c="globe"===l.name,u=this.enableTerrain&&!c?new Qu:null,h="Polygon"===Xu[e.type];c&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Zo);const d=Eu(t,500);for(let e=d.length-1;e>=0;e--){const t=d[e];(0===t.length||(f=t[0]).every((e=>e.x<=0))||f.every((e=>e.x>=ss))||f.every((e=>e.y<=0))||f.every((e=>e.y>=ss)))&&d.splice(e,1)}var f;let p;if(c)p=lh(d,s,r);else{p=[];for(const e of d)p.push({polygon:e,bounds:s})}const m=h?this.edgeRadius:0;for(const{polygon:e,bounds:t}of p){let n=0,i=0;for(const t of e)h&&!t[0].equals(t[t.length-1])&&t.push(t[0]),i+=h?t.length-1:t.length;const o=this.segments.prepareSegment((h?5:4)*i,this.layoutVertexArray,this.indexArray);if(h){const t=[],i=[];n=o.vertexLength;for(const n of e){let a,s;n.length&&n!==e[0]&&i.push(t.length/2),a=n[1].sub(n[0])._perp()._unit();for(let e=1;e<n.length;e++){const i=n[e],u=n[e===n.length-1?1:e+1];let{x:h,y:d}=i;if(m){s=u.sub(i)._perp()._unit();const e=a.add(s)._unit(),t=m*Math.min(4,1/(a.x*e.x+a.y*e.y));h+=t*e.x,d+=t*e.y,a=s}Ku(this.layoutVertexArray,h,d,0,0,1,1,0),o.vertexLength++,t.push(i.x,i.y),c&&Ju(this.layoutVertexExtArray,l.projectTilePoint(h,d,r),l.upVector(r,h,d))}}const a=yu(t,i);for(let e=0;e<a.length;e+=3)this.indexArray.emplaceBack(n+a[e],n+a[e+2],n+a[e+1]),o.primitiveLength++}for(const i of e){u&&i.length&&u.startRing(i[0]);let e,a,s,d=i.length>4&&oh(i[i.length-2],i[0],i[1]),f=m?nh(i[i.length-2],i[0],i[1],m):0;a=i[1].sub(i[0])._perp()._unit();let p=!0;for(let g=1,v=0;g<i.length;g++){let y=i[g-1],_=i[g];const x=i[g===i.length-1?1:g+1];if(u&&h&&u.currentPolyCount.top++,ih(_,y,t)){m&&(a=x.sub(_)._perp()._unit(),p=!p);continue}u&&u.append(_,y);const w=_.sub(y)._perp(),b=w.x/(Math.abs(w.x)+Math.abs(w.y)),E=w.y>0?1:0,k=y.dist(_);if(v+k>32768&&(v=0),m){s=x.sub(_)._perp()._unit();let e=rh(y,_,x,th(a,s),m);isNaN(e)&&(e=0);const t=_.sub(y)._unit();y=y.add(t.mult(f))._round(),_=_.add(t.mult(-e))._round(),f=e,a=s}const T=o.vertexLength,M=i.length>4&&oh(y,_,x);let S=ah(v,d,p);if(Ku(this.layoutVertexArray,y.x,y.y,b,E,0,0,S),Ku(this.layoutVertexArray,y.x,y.y,b,E,0,1,S),v+=k,S=ah(v,M,!p),d=M,Ku(this.layoutVertexArray,_.x,_.y,b,E,0,0,S),Ku(this.layoutVertexArray,_.x,_.y,b,E,0,1,S),o.vertexLength+=4,this.indexArray.emplaceBack(T+0,T+1,T+2),this.indexArray.emplaceBack(T+1,T+3,T+2),o.primitiveLength+=2,m){const r=n+(1===g?i.length-2:g-2),a=1===g?n:r+1;if(this.indexArray.emplaceBack(T+1,r,T+3),this.indexArray.emplaceBack(r,a,T+3),o.primitiveLength+=2,void 0===e&&(e=T),!ih(x,i[g],t)){const t=g===i.length-1?e:o.vertexLength;this.indexArray.emplaceBack(T+2,T+3,t),this.indexArray.emplaceBack(T+3,t+1,t),this.indexArray.emplaceBack(T+3,a,t+1),o.primitiveLength+=3}p=!p}if(c){const e=this.layoutVertexExtArray,t=l.projectTilePoint(y.x,y.y,r),n=l.projectTilePoint(_.x,_.y,r),i=l.upVector(r,y.x,y.y),o=l.upVector(r,_.x,_.y);Ju(e,t,i),Ju(e,t,i),Ju(e,n,o),Ju(e,n,o)}}h&&(n+=i.length-1)}}if(u&&u.polyCount.length>0){if(u.borders){u.vertexArrayOffset=this.centroidVertexArray.length;const e=u.borders,t=this.featuresOnBorder.push(u)-1;for(let n=0;n<4;n++)e[n][0]!==Number.MAX_VALUE&&this.borders[n].push(t)}this.encodeCentroid(u.borders?void 0:u.centroid(),u)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,o,r)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort(((t,n)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[n].borders[e][0]))}encodeCentroid(e,t,n=!0){let r,i;if(e)if(0!==e.y){const n=t.span()._mult(this.tileToMeter);r=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(n.x/10)),i=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(n.y/10))}else r=Math.ceil(7*(e.x+450)),i=0;else r=0,i=+n;let o=n?this.centroidVertexArray.length:t.vertexArrayOffset;for(const e of t.polyCount){n&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*e.edges+e.top);for(let t=0;t<e.top;t++)this.centroidVertexArray.emplace(o++,r,i);for(let t=0;t<2*e.edges;t++)this.centroidVertexArray.emplace(o++,0,i),this.centroidVertexArray.emplace(o++,r,i)}}}function th(e,t){const n=e.add(t)._unit();return e.x*n.x+e.y*n.y}function nh(e,t,n,r){const i=t.sub(e)._perp()._unit(),o=n.sub(t)._perp()._unit();return rh(e,t,n,th(i,o),r)}function rh(e,t,n,r,i){const o=Math.sqrt(1-r*r);return Math.min(e.dist(t)/3,t.dist(n)/3,i*o/r)}function ih(e,t,n){return e.x<n[0].x&&t.x<n[0].x||e.x>n[1].x&&t.x>n[1].x||e.y<n[0].y&&t.y<n[0].y||e.y>n[1].y&&t.y>n[1].y}function oh(e,t,n){if(e.x<0||e.x>=ss||t.x<0||t.x>=ss||n.x<0||n.x>=ss)return!1;const r=n.sub(t),i=r.perp(),o=e.sub(t);return(r.x*o.x+r.y*o.y)/Math.sqrt((r.x*r.x+r.y*r.y)*(o.x*o.x+o.y*o.y))>-.866&&i.x*o.x+i.y*o.y<0}function ah(e,t,n){const r=t?2|e:-3&e;return n?1|r:-2&r}function sh(){const e=Math.PI/32,t=Math.tan(e),n=jl;return n*Math.sqrt(1+2*t*t)-n}function lh(e,t,n){const r=1<<n.z,i=ql(n.x/r),o=ql((n.x+1)/r),a=Zl(n.y/r),s=Zl((n.y+1)/r);return function(e,t,n,r,i=0,o){const a=[];if(!e.length||!n||!r)return a;const s=(e,t)=>{for(const n of e)a.push({polygon:n,bounds:t})},l=Math.ceil(Math.log2(n)),c=Math.ceil(Math.log2(r)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=Zu(d,t[0].y-i,t[1].y+i,1),d=Zu(d,t[0].x-i,t[1].x+i,0),!d.length)return a;const f=[];for(h.length?f.push({polygons:d,bounds:t,depth:0}):s(d,t);f.length;){const e=f.pop(),t=e.depth,n=h[t],r=e.bounds[0],a=e.bounds[1],l=0===n?r.x:r.y,c=0===n?a.x:a.y,u=o?o(n,l,c):.5*(l+c),d=Zu(e.polygons,l-i,u+i,n),p=Zu(e.polygons,u-i,c+i,n);if(d.length){const e=[r,new y(0===n?u:a.x,1===n?u:a.y)];h.length>t+1?f.push({polygons:d,bounds:e,depth:t+1}):s(d,e)}if(p.length){const e=[new y(0===n?u:r.x,1===n?u:r.y),a];h.length>t+1?f.push({polygons:p,bounds:e,depth:t+1}):s(p,e)}}return a}(e,t,Math.ceil((o-i)/11.25),Math.ceil((a-s)/11.25),1,((e,t,i)=>{if(0===e)return.5*(t+i);{const e=Zl((n.y+t/ss)/r);return($l(.5*(Zl((n.y+i/ss)/r)+e))*r-n.y)*ss}}))}Xi(eh,"FillExtrusionBucket",{omit:["layers","features"]}),Xi(Qu,"PartMetadata");const ch=new Po({"fill-extrusion-edge-radius":new Ro(et["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var uh={paint:new Po({"fill-extrusion-opacity":new Ro(et["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Lo(et["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ro(et["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ro(et["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Lo(et["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Lo(et["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Lo(et["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ro(et["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Ro(et["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Ro(et["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-rounded-roof":new Ro(et["paint_fill-extrusion"]["fill-extrusion-rounded-roof"])}),layout:ch};function hh(e,t,n){var r=2*Math.PI*6378137/256/Math.pow(2,n);return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}class dh{constructor(e,t,n){this.z=e,this.x=t,this.y=n,this.key=mh(0,e,e,t,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const n=function(e,t,n){var r=hh(256*e,256*(t=Math.pow(2,n)-t-1),n),i=hh(256*(e+1),256*(t+1),n);return r[0]+","+r[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),r=function(e,t,n){let r,i="";for(let o=e;o>0;o--)r=1<<o-1,i+=(t&r?1:0)+(n&r?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",r).replace("{bbox-epsg-3857}",n)}toString(){return`${this.z}/${this.x}/${this.y}`}}class fh{constructor(e,t){this.wrap=e,this.canonical=t,this.key=mh(e,t.z,t.z,t.x,t.y)}}class ph{constructor(e,t,n,r,i){this.overscaledZ=e,this.wrap=t,this.canonical=new dh(n,+r,+i),this.key=0===t&&e===n?this.canonical.key:mh(t,e,n,r,i)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new ph(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ph(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return mh(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-e;return mh(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new ph(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new ph(t,this.wrap,t,n,r),new ph(t,this.wrap,t,n+1,r),new ph(t,this.wrap,t,n,r+1),new ph(t,this.wrap,t,n+1,r+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new ph(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ph(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new fh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function mh(e,t,n,r,i){const o=1<<Math.min(n,22);let a=o*(i%o)+r%o;return e&&n<22&&(a+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-n)))),16*(32*a+n)+(t-n)}Xi(dh,"CanonicalTileID"),Xi(ph,"OverscaledTileID",{omit:["projMatrix"]});class gh extends y{constructor(e,t,n){super(e,t),this.z=n}}function vh(e,t){return e.x*t.x+e.y*t.y}function yh(e,t){if(1===e.length){let n=0;const r=t[n++];let i;for(;!i||r.equals(i);)if(i=t[n++],!i)return 1/0;for(;n<t.length;n++){const o=t[n],a=e[0],s=i.sub(r),l=o.sub(r),c=a.sub(r),u=vh(s,s),h=vh(s,l),d=vh(l,l),f=vh(c,s),p=vh(c,l),m=u*d-h*h,g=(d*f-h*p)/m,v=(u*p-h*f)/m,y=r.z*(1-g-v)+i.z*g+o.z*v;if(isFinite(y))return y}return 1/0}{let e=1/0;for(const n of t)e=Math.min(e,n.z);return e}}function _h(e,t,n,r,i,o,a,s){const l=a*i.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?a*(o[0]/7-450):a*function(e,t,n){const r=Math.floor(t[0]/8),i=Math.floor(t[1]/8),o=10*(t[0]-8*r),a=10*(t[1]-8*i),s=e.getElevationAt(r,i,!0,!0),l=e.getMeterToDEM(n),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(a*l-1)),h=e.tileCoordToPixel(r,i),d=2*c+1,f=2*u+1,p=function(e,t,n,r,i){return[e.getElevationAtPixel(t,n,!0),e.getElevationAtPixel(t+i,n,!0),e.getElevationAtPixel(t,n+i,!0),e.getElevationAtPixel(t+r,n+i,!0)]}(e,h.x-c,h.y-u,d,f),m=Math.abs(p[0]-p[1]),g=Math.abs(p[2]-p[3]),v=Math.abs(p[0]-p[2])+Math.abs(p[1]-p[3]),y=Math.min(.25,.5*l*(m+g)/d),_=Math.min(.25,.5*l*v/f);return s+Math.max(y*o,_*a)}(i,o,s):l;return{base:l+(0===n)?-1:n,top:c?Math.max(u+r,l+n+2):l+r}}const xh=jo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:wh}=xh,bh=jo([{name:"a_packed",components:4,type:"Float32"}]),{members:Eh}=bh,kh=qu.types,Th=Math.cos(Math.PI/180*37.5);class Mh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Wo,this.layoutVertexArray2=new $o,this.indexArray=new ra,this.programConfigurations=new Ya(e.layers,e.zoom),this.segments=new as,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n,r){this.hasPattern=Tu("line",this.layers,t);const i=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:t,id:a,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=sc(t,e);if(!this.layers[0]._featureFilter.filter(new bo(this.zoom),c,n))continue;const u=i?i.evaluate(c,{},n):void 0,h={id:a,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:ac(t,n,r),patterns:{},sortKey:u};o.push(h)}i&&o.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:a,featureIndex:s}=t,l=this.addConstantDashes(a);for(const r of o){const{geometry:i,index:o,sourceLayerIndex:c}=r;if(l&&this.addFeatureDashes(r,a),this.hasPattern){const e=Mu("line",this.layers,r,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(r,i,o,n,a.positions,t.availableImages);s.insert(e[o].feature,i,o,c,this.index)}}addConstantDashes(e){let t=!1;for(const n of this.layers){const r=n.paint.get("line-dasharray").value,i=n.layout.get("line-cap").value;if("constant"!==r.kind||"constant"!==i.kind)t=!0;else{const t=i.value,n=r.value;if(!n)continue;e.addDash(n,t)}}return t}addFeatureDashes(e,t){const n=this.zoom;for(const r of this.layers){const i=r.paint.get("line-dasharray").value,o=r.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===o.kind)continue;let a,s;if("constant"===i.kind){if(a=i.value,!a)continue}else a=i.evaluate({zoom:n},e);s="constant"===o.kind?o.value:o.evaluate({zoom:n},e),t.addDash(a,s),e.patterns[r.id]=t.getKey(a,s)}}update(e,t,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,r)}addFeatures(e,t,n,r,i){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,n,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Eh)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wh),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,n,r,i,o){const a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),l=a.get("line-cap").evaluate(e,{}),c=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const n of t)this.addLine(n,e,s,l,c,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,i,o,r)}addLine(e,t,n,r,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===kh[t.type];let s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let l=0;for(;l<s-1&&e[l].equals(e[l+1]);)l++;if(s<(a?3:2))return;"bevel"===n&&(i=1.05);const c=this.overscaling<=16?15*ss/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let h,d,f,p,m;this.e1=this.e2=-1,a&&(h=e[s-2],m=e[l].sub(h)._unit()._perp());for(let t=l;t<s;t++){if(f=t===s-1?a?e[l+1]:void 0:e[t+1],f&&e[t].equals(f))continue;m&&(p=m),h&&(d=h),h=e[t],m=f?f.sub(h)._unit()._perp():p,p=p||m;let g=p.add(m);0===g.x&&0===g.y||g._unit();const v=p.x*m.x+p.y*m.y,y=g.x*m.x+g.y*m.y,_=0!==y?1/y:1/0,x=2*Math.sqrt(2-2*y),w=y<Th&&d&&f,b=p.x*m.y-p.y*m.x>0;if(w&&t>l){const e=h.dist(d);if(e>2*c){const t=h.sub(h.sub(d)._mult(c/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,p,0,0,u),d=t}}const E=d&&f;let k=E?n:a?"butt":r;if(E&&"round"===k&&(_<o?k="miter":_<=2&&(k="fakeround")),"miter"===k&&_>i&&(k="bevel"),"bevel"===k&&(_>2&&(k="flipbevel"),_<i&&(k="miter")),d&&this.updateDistance(d,h),"miter"===k)g._mult(_),this.addCurrentVertex(h,g,0,0,u);else if("flipbevel"===k){if(_>100)g=m.mult(-1);else{const e=_*p.add(m).mag()/p.sub(m).mag();g._perp()._mult(e*(b?-1:1))}this.addCurrentVertex(h,g,0,0,u),this.addCurrentVertex(h,g.mult(-1),0,0,u)}else if("bevel"===k||"fakeround"===k){const e=-Math.sqrt(_*_-1),t=b?e:0,n=b?0:e;if(d&&this.addCurrentVertex(h,p,t,n,u),"fakeround"===k){const e=Math.round(180*x/Math.PI/20);for(let t=1;t<e;t++){let n=t/e;if(.5!==n){const e=n-.5;n+=n*e*(n-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*e*e+(.848013+v*(.215638*v-1.06021)))}const r=m.sub(p)._mult(n)._add(p)._unit()._mult(b?-1:1);this.addHalfVertex(h,r.x,r.y,!1,b,0,u)}}f&&this.addCurrentVertex(h,m,-t,-n,u)}else if("butt"===k)this.addCurrentVertex(h,g,0,0,u);else if("square"===k){const e=d?1:-1;d||this.addCurrentVertex(h,g,e,e,u),this.addCurrentVertex(h,g,0,0,u),d&&this.addCurrentVertex(h,g,e,e,u)}else"round"===k&&(d&&(this.addCurrentVertex(h,p,0,0,u),this.addCurrentVertex(h,p,1,1,u,!0)),f&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(w&&t<s-1){const e=h.dist(f);if(e>2*c){const t=h.add(f.sub(h)._mult(c/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,m,0,0,u),h=t}}}}addCurrentVertex(e,t,n,r,i,o=!1){const a=t.y*r-t.x,s=-t.y-t.x*r;this.addHalfVertex(e,t.x+t.y*n,t.y-t.x*n,o,!1,n,i),this.addHalfVertex(e,a,s,o,!0,-r,i)}addHalfVertex({x:e,y:t},n,r,i,o,a,s){this.layoutVertexArray.emplaceBack((e<<1)+(i?1:0),(t<<1)+(o?1:0),Math.round(63*n)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}Xi(Mh,"LineBucket",{omit:["layers","patternFeatures"]});const Sh=new Po({"line-cap":new Lo(et.layout_line["line-cap"]),"line-join":new Lo(et.layout_line["line-join"]),"line-miter-limit":new Ro(et.layout_line["line-miter-limit"]),"line-round-limit":new Ro(et.layout_line["line-round-limit"]),"line-sort-key":new Lo(et.layout_line["line-sort-key"])});var Ch={paint:new Po({"line-opacity":new Lo(et.paint_line["line-opacity"]),"line-color":new Lo(et.paint_line["line-color"]),"line-translate":new Ro(et.paint_line["line-translate"]),"line-translate-anchor":new Ro(et.paint_line["line-translate-anchor"]),"line-width":new Lo(et.paint_line["line-width"]),"line-gap-width":new Lo(et.paint_line["line-gap-width"]),"line-offset":new Lo(et.paint_line["line-offset"]),"line-blur":new Lo(et.paint_line["line-blur"]),"line-dasharray":new Lo(et.paint_line["line-dasharray"]),"line-pattern":new Lo(et.paint_line["line-pattern"]),"line-gradient":new zo(et.paint_line["line-gradient"]),"line-trim-offset":new Ro(et.paint_line["line-trim-offset"])}),layout:Sh};const Ah=new class extends Lo{possiblyEvaluate(e,t){return t=new bo(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,r){return t=L({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,r)}}(Ch.paint.properties["line-width"].specification);function Ih(e,t){return t>0?t+2*e:e}Ah.useIntegerZoom=!0;const Rh=jo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Lh=jo([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),zh=jo([{name:"a_projected_pos",components:4,type:"Float32"}],4);jo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ph=jo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),Oh=jo([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);jo([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Dh=jo([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Bh=jo([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);jo([{name:"triangle",components:3,type:"Uint16"}]),jo([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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"},{type:"Uint8",name:"flipState"}]),jo([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),jo([{type:"Float32",name:"offsetX"}]),jo([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var Fh=24;const jh=128;function Nh(e,t){const{expression:n}=t;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new bo(e+1))};if("source"===n.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:r}=n;let i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let o=i;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const a=t[i],s=t[o];return"composite"===n.kind?{kind:"composite",minZoom:a,maxZoom:s,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:s,minSize:n.evaluate(new bo(a)),maxSize:n.evaluate(new bo(s)),interpolationType:r}}}function Vh(e,{uSize:t,uSizeT:n},{lowerSize:r,upperSize:i}){return"source"===e.kind?r/jh:"composite"===e.kind?Ln(r/jh,i/jh,n):t}function Uh(e,t){let n=0,r=0;if("constant"===e.kind)r=e.layoutSize;else if("source"!==e.kind){const{interpolationType:i,minZoom:o,maxZoom:a}=e,s=i?S(er.interpolationFactor(i,t,o,a),0,1):0;"camera"===e.kind?r=Ln(e.minSize,e.maxSize,s):n=s}return{uSizeT:n,uSize:r}}var Hh=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:jh,evaluateSizeForFeature:Vh,evaluateSizeForZoom:Uh,getSizeData:Nh});function Wh(e,t,n){return e.sections.forEach((e=>{e.text=function(e,t,n){const r=t.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),wo.applyArabicShaping&&(e=wo.applyArabicShaping(e)),e}(e.text,t,n)})),e}const $h={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂","←":"↑","→":"↓"};function Gh(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"｀"===e||"￣"===e||"︑"===e||"︒"===e}function qh(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}var Zh=Kh,Xh=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,c=l>>1,u=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},Yh=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*m};
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Kh(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Kh.Varint=0,Kh.Fixed64=1,Kh.Bytes=2,Kh.Fixed32=5;var Jh=4294967296,Qh=1/Jh,ed="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function td(e){return e.type===Kh.Bytes?e.readVarint()+e.pos:e.pos+1}function nd(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function rd(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function id(e,t){for(var n=0;n<e.length;n++)t.writeVarint(e[n])}function od(e,t){for(var n=0;n<e.length;n++)t.writeSVarint(e[n])}function ad(e,t){for(var n=0;n<e.length;n++)t.writeFloat(e[n])}function sd(e,t){for(var n=0;n<e.length;n++)t.writeDouble(e[n])}function ld(e,t){for(var n=0;n<e.length;n++)t.writeBoolean(e[n])}function cd(e,t){for(var n=0;n<e.length;n++)t.writeFixed32(e[n])}function ud(e,t){for(var n=0;n<e.length;n++)t.writeSFixed32(e[n])}function hd(e,t){for(var n=0;n<e.length;n++)t.writeFixed64(e[n])}function dd(e,t){for(var n=0;n<e.length;n++)t.writeSFixed64(e[n])}function fd(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function pd(e,t,n){e[n]=t,e[n+1]=t>>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function md(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Kh.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=fd(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=md(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=fd(this.buf,this.pos)+fd(this.buf,this.pos+4)*Jh;return this.pos+=8,e},readSFixed64:function(){var e=fd(this.buf,this.pos)+md(this.buf,this.pos+4)*Jh;return this.pos+=8,e},readFloat:function(){var e=Xh(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Xh(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return nd(e,r,t);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return nd(e,r,t);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return nd(e,r,t);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return nd(e,r,t);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return nd(e,r,t);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return nd(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&ed?function(e,t,n){return ed.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r="",i=t;i<n;){var o,a,s,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Kh.Bytes)return e.push(this.readVarint(t));var n=td(this);for(e=e||[];this.pos<n;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Kh.Bytes)return e.push(this.readSVarint());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Kh.Bytes)return e.push(this.readBoolean());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Kh.Bytes)return e.push(this.readFloat());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Kh.Bytes)return e.push(this.readDouble());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Kh.Bytes)return e.push(this.readFixed32());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Kh.Bytes)return e.push(this.readSFixed32());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Kh.Bytes)return e.push(this.readFixed64());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Kh.Bytes)return e.push(this.readSFixed64());var t=td(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Kh.Varint)for(;this.buf[this.pos++]>127;);else if(t===Kh.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Kh.Fixed32)this.pos+=4;else{if(t!==Kh.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var n=new Uint8Array(t);n.set(this.buf),this.buf=n,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),pd(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),pd(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),pd(this.buf,-1&e,this.pos),pd(this.buf,Math.floor(e*Qh),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),pd(this.buf,-1&e,this.pos),pd(this.buf,Math.floor(e*Qh),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,i,o=0;o<t.length;o++){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(e[n++]=239,e[n++]=191,e[n++]=189,i=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&rd(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),Yh(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Yh(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n<t;n++)this.buf[this.pos++]=e[n]},writeRawMessage:function(e,t){this.pos++;var n=this.pos;e(t,this);var r=this.pos-n;r>=128&&rd(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,Kh.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,id,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,od,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,ld,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,ad,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,sd,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,cd,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,ud,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,hd,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,dd,t)},writeBytesField:function(e,t){this.writeTag(e,Kh.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Kh.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Kh.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Kh.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Kh.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Kh.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Kh.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Kh.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Kh.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Kh.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var gd=d(Zh);const vd=3;function yd(e,t,n){t.glyphs=[],1===e&&n.readMessage(_d,t)}function _d(e,t,n){if(3===e){const{id:e,bitmap:r,width:i,height:o,left:a,top:s,advance:l}=n.readMessage(xd,{});t.glyphs.push({id:e,bitmap:new Fc({width:i+2*vd,height:o+2*vd},r),metrics:{width:i,height:o,left:a,top:s,advance:l}})}else 4===e?t.ascender=n.readSVarint():5===e&&(t.descender=n.readSVarint())}function xd(e,t,n){1===e?t.id=n.readVarint():2===e?t.bitmap=n.readBytes():3===e?t.width=n.readVarint():4===e?t.height=n.readVarint():5===e?t.left=n.readSVarint():6===e?t.top=n.readSVarint():7===e&&(t.advance=n.readVarint())}const wd=vd;function bd(e){let t=0,n=0;for(const r of e)t+=r.w*r.h,n=Math.max(n,r.w);e.sort(((e,t)=>t.h-e.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}];let i=0,o=0;for(const t of e)for(let e=r.length-1;e>=0;e--){const n=r[e];if(!(t.w>n.w||t.h>n.h)){if(t.x=n.x,t.y=n.y,o=Math.max(o,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===n.w&&t.h===n.h){const t=r.pop();e<r.length&&(r[e]=t)}else t.h===n.h?(n.x+=t.w,n.w-=t.w):t.w===n.w?(n.y+=t.h,n.h-=t.h):(r.push({x:n.x+t.w,y:n.y,w:n.w-t.w,h:t.h}),n.y+=t.h,n.h-=t.h);break}}return{w:i,h:o,fill:t/(i*o)||0}}const Ed=1;class kd{constructor(e,{pixelRatio:t,version:n,stretchX:r,stretchY:i,content:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=r,this.stretchY=i,this.content=o,this.version=n}get tl(){return[this.paddedRect.x+Ed,this.paddedRect.y+Ed]}get br(){return[this.paddedRect.x+this.paddedRect.w-Ed,this.paddedRect.y+this.paddedRect.h-Ed]}get displaySize(){return[(this.paddedRect.w-2*Ed)/this.pixelRatio,(this.paddedRect.h-2*Ed)/this.pixelRatio]}}class Td{constructor(e,t){const n={},r={};this.haveRenderCallbacks=[];const i=[];this.addImages(e,n,i),this.addImages(t,r,i);const{w:o,h:a}=bd(i),s=new jc({width:o||1,height:a||1});for(const t in e){const r=e[t],i=n[t].paddedRect;jc.copy(r.data,s,{x:0,y:0},{x:i.x+Ed,y:i.y+Ed},r.data)}for(const e in t){const n=t[e],i=r[e].paddedRect,o=i.x+Ed,a=i.y+Ed,l=n.data.width,c=n.data.height;jc.copy(n.data,s,{x:0,y:0},{x:o,y:a},n.data),jc.copy(n.data,s,{x:0,y:c-1},{x:o,y:a-1},{width:l,height:1}),jc.copy(n.data,s,{x:0,y:0},{x:o,y:a+c},{width:l,height:1}),jc.copy(n.data,s,{x:l-1,y:0},{x:o-1,y:a},{width:1,height:c}),jc.copy(n.data,s,{x:0,y:0},{x:o+l,y:a},{width:1,height:c})}this.image=s,this.iconPositions=n,this.patternPositions=r}addImages(e,t,n){for(const r in e){const i=e[r],o={x:0,y:0,w:i.data.width+2*Ed,h:i.data.height+2*Ed};n.push(o),t[r]=new kd(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(e,t){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((t=>e.hasImage(t))),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)}patchUpdatedImage(e,t,n){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[r,i]=e.tl;n.update(t.data,void 0,{x:r,y:i})}}Xi(kd,"ImagePosition"),Xi(Td,"ImageAtlas");const Md={horizontal:1,vertical:2,horizontalOnly:3},Sd=-17;class Cd{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const n=new Cd;return n.scale=e||1,n.fontStack=t,n}static forImage(e){const t=new Cd;return t.imageName=e,t}}class Ad{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const n=new Ad;for(let r=0;r<e.sections.length;r++){const i=e.sections[r];i.image?n.addImageSection(i):n.addTextSection(i,t)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(e){this.text=function(e,t){let n="";for(let r=0;r<e.length;r++){const i=e.charCodeAt(r+1)||null,o=e.charCodeAt(r-1)||null;n+=!t&&(i&&oo(i)&&!$h[e[r+1]]||o&&oo(o)&&!$h[e[r-1]])||!$h[e[r]]?e[r]:$h[e[r]]}return n}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&Rd[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&Rd[this.text.charCodeAt(n)];n--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const n=new Ad;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Cd.forText(e.scale,e.fontStack||t));const n=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(n)}addImageSection(e){const t=e.image?e.image.name:"";if(0===t.length)return void W("Can't add FormattedSection with an empty image.");const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(Cd.forImage(t)),this.sectionIndex.push(this.sections.length-1)):W("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Id(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p){const m=Ad.fromFeature(e,i);h===Md.vertical&&m.verticalizePunctuation(d);let g=[];const v=function(e,t,n,r,i,o){if(!e)return[];const a=[],s=function(e,t,n,r,i,o){let a=0;for(let n=0;n<e.length();n++){const s=e.getSection(n);a+=zd(e.getCharCode(n),s,r,i,t,o)}return a/Math.max(1,Math.ceil(a/n))}(e,t,n,r,i,o),l=e.text.indexOf("​")>=0;let c=0;for(let n=0;n<e.length();n++){const h=e.getSection(n),d=e.getCharCode(n);if(Rd[d]||(c+=zd(d,h,r,i,t,o)),n<e.length()-1){const t=!((u=d)<11904||!(eo["Bopomofo Extended"](u)||eo.Bopomofo(u)||eo["CJK Compatibility Forms"](u)||eo["CJK Compatibility Ideographs"](u)||eo["CJK Compatibility"](u)||eo["CJK Radicals Supplement"](u)||eo["CJK Strokes"](u)||eo["CJK Symbols and Punctuation"](u)||eo["CJK Unified Ideographs Extension A"](u)||eo["CJK Unified Ideographs"](u)||eo["Enclosed CJK Letters and Months"](u)||eo["Halfwidth and Fullwidth Forms"](u)||eo.Hiragana(u)||eo["Ideographic Description Characters"](u)||eo["Kangxi Radicals"](u)||eo["Katakana Phonetic Extensions"](u)||eo.Katakana(u)||eo["Vertical Forms"](u)||eo["Yi Radicals"](u)||eo["Yi Syllables"](u)));(Ld[d]||t||h.imageName)&&a.push(Dd(n+1,c,s,a,Od(d,e.getCharCode(n+1),t&&l),!1))}}var u;return Bd(Dd(e.length(),c,s,a,0,!0))}(m,c,o,t,r,f),{processBidirectionalText:y,processStyledBidirectionalText:_}=wo;if(y&&1===m.sections.length){const e=y(m.toString(),v);for(const t of e){const e=new Ad;e.text=t,e.sections=m.sections;for(let n=0;n<t.length;n++)e.sectionIndex.push(0);g.push(e)}}else if(_){const e=_(m.text,m.sectionIndex,v);for(const t of e){const e=new Ad;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=function(e,t){const n=[],r=e.text;let i=0;for(const r of t)n.push(e.substring(i,r)),i=r;return i<r.length&&n.push(e.substring(i,r.length)),n}(m,v);const x=[],w={positionedLines:x,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(e,t,n,r,i,o,a,s,l,c,u,h){let d=0,f=0,p=0;const m="right"===s?1:"left"===s?0:.5;let g=!1;for(const e of i){const n=e.getSections();for(const e of n){if(e.imageName)continue;const n=t[e.fontStack];if(n&&(g=void 0!==n.ascender&&void 0!==n.descender,!g))break}if(!g)break}let v=0;for(const a of i){a.trim();const i=a.getMaxScale(),s=(i-1)*Fh,_={positionedGlyphs:[],lineOffset:0};e.positionedLines[v]=_;const x=_.positionedGlyphs;let w=0;if(!a.length()){f+=o,++v;continue}let b=0,E=0;for(let o=0;o<a.length();o++){const s=a.getSection(o),p=a.getSectionIndex(o),m=a.getCharCode(o);let v=s.scale,_=null,k=null,T=null,M=Fh,S=0;const C=!(l===Md.horizontal||!u&&!io(m)||u&&(Rd[m]||(y=m,eo.Arabic(y)||eo["Arabic Supplement"](y)||eo["Arabic Extended-A"](y)||eo["Arabic Presentation Forms-A"](y)||eo["Arabic Presentation Forms-B"](y))));if(s.imageName){const t=r[s.imageName];if(!t)continue;T=s.imageName,e.iconsInText=e.iconsInText||!0,k=t.paddedRect;const n=t.displaySize;v=v*Fh/h,_={width:n[0],height:n[1],left:Ed,top:-wd,advance:C?n[1]:n[0],localGlyph:!1},S=g?-_.height*v:Sd+i*Fh-n[1]*v,M=_.advance;const o=(C?n[0]:n[1])*v-Fh*i;o>0&&o>w&&(w=o)}else{const e=n[s.fontStack];if(!e)continue;e[m]&&(k=e[m]);const r=t[s.fontStack];if(!r)continue;const o=r.glyphs[m];if(!o)continue;if(_=o.metrics,M=8203!==m?Fh:0,g){const e=void 0!==r.ascender?Math.abs(r.ascender):0,t=void 0!==r.descender?Math.abs(r.descender):0,n=(e+t)*v;b<n&&(b=n,E=(e-t)/2*v),S=-e*v}else S=Sd+(i-v)*Fh}C?(e.verticalizable=!0,x.push({glyph:m,imageName:T,x:d,y:f+S,vertical:C,scale:v,localGlyph:_.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:_,rect:k}),d+=M*v+c):(x.push({glyph:m,imageName:T,x:d,y:f+S,vertical:C,scale:v,localGlyph:_.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:_,rect:k}),d+=_.advance*v+c)}0!==x.length&&(p=Math.max(d-c,p),g?jd(x,m,w,E,o*i/2):jd(x,m,w,0,o/2)),d=0;const k=o*i+w;_.lineOffset=Math.max(w,s),f+=k,++v}var y;const _=f,{horizontalAlign:x,verticalAlign:w}=Fd(a);(function(e,t,n,r,i,o){const a=(t-n)*i,s=-o*r;for(const t of e)for(const e of t.positionedGlyphs)e.x+=a,e.y+=s})(e.positionedLines,m,x,w,p,_),e.top+=-w*_,e.bottom=e.top+_,e.left+=-x*p,e.right=e.left+p,e.hasBaseline=g}(w,t,n,r,g,a,s,l,h,c,d,p),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(x)&&w}const Rd={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ld={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function zd(e,t,n,r,i,o){if(t.imageName){const e=r[t.imageName];return e?e.displaySize[0]*t.scale*Fh/o+i:0}{const r=n[t.fontStack],o=r&&r.glyphs[e];return o?o.metrics.advance*t.scale+i:0}}function Pd(e,t,n,r){const i=Math.pow(e-t,2);return r?e<t?i/2:2*i:i+Math.abs(n)*n}function Od(e,t,n){let r=0;return 10===e&&(r-=1e4),n&&(r+=150),40!==e&&65288!==e||(r+=50),41!==t&&65289!==t||(r+=50),r}function Dd(e,t,n,r,i,o){let a=null,s=Pd(t,n,i,o);for(const e of r){const r=Pd(t-e.x,n,i,o)+e.badness;r<=s&&(a=e,s=r)}return{index:e,x:t,priorBreak:a,badness:s}}function Bd(e){return e?Bd(e.priorBreak).concat(e.index):[]}function Fd(e){let t=.5,n=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:t,verticalAlign:n}}function jd(e,t,n,r,i){if(!(t||n||r||i))return;const o=e.length-1,a=e[o],s=(a.x+a.metrics.advance*a.scale)*t;for(let t=0;t<=o;t++)e[t].x-=s,e[t].y+=n+r+i}function Nd(e,t,n){const{horizontalAlign:r,verticalAlign:i}=Fd(n),o=t[0]-e.displaySize[0]*r,a=t[1]-e.displaySize[1]*i;return{image:e,top:a,bottom:a+e.displaySize[1],left:o,right:o+e.displaySize[0]}}function Vd(e,t,n,r,i,o){const a=e.image;let s;if(a.content){const e=a.content,t=a.pixelRatio||1;s=[e[0]/t,e[1]/t,a.displaySize[0]-e[2]/t,a.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,h,d,f;"width"===n||"both"===n?(f=i[0]+l-r[3],h=i[0]+c+r[1]):(f=i[0]+(l+c-a.displaySize[0])/2,h=f+a.displaySize[0]);const p=t.top*o,m=t.bottom*o;return"height"===n||"both"===n?(u=i[1]+p-r[0],d=i[1]+m+r[2]):(u=i[1]+(p+m-a.displaySize[1])/2,d=u+a.displaySize[1]),{image:a,top:u,right:h,bottom:d,left:f,collisionPadding:s}}class Ud extends y{constructor(e,t,n,r,i){super(e,t),this.angle=r,this.z=n,void 0!==i&&(this.segment=i)}clone(){return new Ud(this.x,this.y,this.z,this.angle,this.segment)}}function Hd(e,t,n,r,i){if(void 0===t.segment)return!0;let o=t,a=t.segment+1,s=0;for(;s>-n/2;){if(a--,a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;const l=[];let c=0;for(;s<n/2;){const t=e[a],n=e[a+1];if(!n)return!1;let o=e[a-1].angleTo(t)-t.angleTo(n);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:o}),c+=o;s-l[0].distance>r;)c-=l.shift().angleDelta;if(c>i)return!1;a++,s+=t.dist(n)}return!0}function Wd(e){let t=0;for(let n=0;n<e.length-1;n++)t+=e[n].dist(e[n+1]);return t}function $d(e,t,n){return e?.6*t*n:0}function Gd(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function qd(e,t,n,r,i,o){const a=$d(n,i,o),s=Gd(n,r)*o;let l=0;const c=Wd(e)/2;for(let n=0;n<e.length-1;n++){const r=e[n],i=e[n+1],o=r.dist(i);if(l+o>c){const u=(c-l)/o,h=Ln(r.x,i.x,u),d=Ln(r.y,i.y,u),f=new Ud(h,d,0,i.angleTo(r),n);return!a||Hd(e,f,s,a,t)?f:void 0}l+=o}}function Zd(e,t,n,r,i,o,a,s,l){const c=$d(r,o,a),u=Gd(r,i),h=u*a,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),Xd(e,d?t/2*s%t:(u/2+2*o)*a*s%t,t,c,n,h,d,!1,l)}function Xd(e,t,n,r,i,o,a,s,l){const c=o/2,u=Wd(e);let h=0,d=t-n,f=[];for(let t=0;t<e.length-1;t++){const a=e[t],s=e[t+1],p=a.dist(s),m=s.angleTo(a);for(;d+n<h+p;){d+=n;const g=(d-h)/p,v=Ln(a.x,s.x,g),y=Ln(a.y,s.y,g);if(v>=0&&v<l&&y>=0&&y<l&&d-c>=0&&d+c<=u){const n=new Ud(v,y,0,m,t);n._round(),r&&!Hd(e,n,o,r,i)||f.push(n)}}h+=p}return s||f.length||a||(f=Xd(e,h/2,n,r,i,o,a,!0,l)),f}function Yd(e,t,n,r,i){const o=[];for(let a=0;a<e.length;a++){const s=e[a];let l;for(let e=0;e<s.length-1;e++){let a=s[e],c=s[e+1];a.x<t&&c.x<t||(a.x<t?a=new y(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x<t&&(c=new y(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y<n&&c.y<n||(a.y<n?a=new y(a.x+(n-a.y)/(c.y-a.y)*(c.x-a.x),n)._round():c.y<n&&(c=new y(a.x+(n-a.y)/(c.y-a.y)*(c.x-a.x),n)._round()),a.x>=r&&c.x>=r||(a.x>=r?a=new y(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x>=r&&(c=new y(r,a.y+(r-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y>=i&&c.y>=i||(a.y>=i?a=new y(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i)._round():c.y>=i&&(c=new y(a.x+(i-a.y)/(c.y-a.y)*(c.x-a.x),i)._round()),l&&a.equals(l[l.length-1])||(l=[a],o.push(l)),l.push(c)))))}}return o}Xi(Ud,"Anchor");const Kd=1e20;function Jd(e,t,n,r,i,o,a,s,l){for(let c=t;c<t+r;c++)Qd(e,n*o+c,o,i,a,s,l);for(let c=n;c<n+i;c++)Qd(e,c*o+t,1,r,a,s,l)}function Qd(e,t,n,r,i,o,a){o[0]=0,a[0]=-Kd,a[1]=Kd,i[0]=e[t];for(let s=1,l=0,c=0;s<r;s++){i[s]=e[t+s*n];const r=s*s;do{const e=o[l];c=(i[s]-i[e]+r-e*e)/(s-e)/2}while(c<=a[l]&&--l>-1);l++,o[l]=s,a[l]=c,a[l+1]=Kd}for(let s=0,l=0;s<r;s++){for(;a[l+1]<s;)l++;const r=o[l],c=s-r;e[t+s*n]=i[r]+c*c}}const ef=2,tf={none:0,ideographs:1,all:2};class nf{constructor(e,t,n){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=n,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,t){const n=[];for(const t in e)for(const r of e[t])n.push({stack:t,id:r});I(n,(({stack:e,id:t},n)=>{let r=this.entries[e];r||(r=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let i=r.glyphs[t];if(void 0!==i)return void n(null,{stack:e,id:t,glyph:i});if(i=this._tinySDF(r,e,t),i)return r.glyphs[t]=i,void n(null,{stack:e,id:t,glyph:i});const o=Math.floor(t/256);if(256*o>65535)return void n(new Error("glyphs > 65535 not supported"));if(r.ranges[o])return void n(null,{stack:e,id:t,glyph:i});let a=r.requests[o];a||(a=r.requests[o]=[],nf.loadGlyphRange(e,o,this.url,this.requestManager,((e,t)=>{if(t){r.ascender=t.ascender,r.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(r.glyphs[+e]=t.glyphs[+e]);r.ranges[o]=!0}for(const n of a)n(e,t);delete r.requests[o]}))),a.push(((r,i)=>{r?n(r):i&&n(null,{stack:e,id:t,glyph:i.glyphs[t]||null})}))}),((e,n)=>{if(e)t(e);else if(n){const e={};for(const{stack:t,id:r,glyph:i}of n)void 0===e[t]&&(e[t]={}),void 0===e[t].glyphs&&(e[t].glyphs={}),e[t].glyphs[r]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics},e[t].ascender=this.entries[t].ascender,e[t].descender=this.entries[t].descender;t(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==tf.none&&(this.localGlyphMode===tf.all?!!this.localFontFamily:!!this.localFontFamily&&(eo["CJK Unified Ideographs"](e)||eo["Hangul Syllables"](e)||eo.Hiragana(e)||eo.Katakana(e)||eo["CJK Symbols and Punctuation"](e)))}_tinySDF(e,t,n){const r=this.localFontFamily;if(!r||!this._doesCharSupportLocalGlyph(n))return;let i=e.tinySDF;if(!i){let n="400";/bold/i.test(t)?n="900":/medium/i.test(t)?n="500":/light/i.test(t)&&(n="200"),i=e.tinySDF=new nf.TinySDF({fontFamily:r,fontWeight:n,fontSize:24*ef,buffer:3*ef,radius:8*ef}),i.fontWeight=n}if(this.localGlyphs[i.fontWeight][n])return this.localGlyphs[i.fontWeight][n];const o=String.fromCharCode(n),{data:a,width:s,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:h,glyphTop:d,glyphAdvance:f}=i.draw(o);return this.localGlyphs[i.fontWeight][n]={id:n,bitmap:new Fc({width:s,height:l},a),metrics:{width:c/ef,height:u/ef,left:h/ef,top:d/ef-27,advance:f/ef,localGlyph:!0}}}}nf.loadGlyphRange=function(e,t,n,r,i){const o=256*t,a=o+255,s=r.transformRequest(r.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",`${o}-${a}`),le.Glyphs);de(s,((e,t)=>{if(e)i(e);else if(t){const e={},n=function(e){return new gd(e).readFields(yd,{})}(t);for(const t of n.glyphs)e[t.id]=t;i(null,{glyphs:e,ascender:n.ascender,descender:n.descender})}}))},nf.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:n=8,cutoff:r=.25,fontFamily:i="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}={}){this.buffer=t,this.cutoff=r,this.radius=n;const s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${e}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:o}=this.ctx.measureText(e),a=Math.ceil(n),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-i))),l=Math.min(this.size-this.buffer,a+Math.ceil(r)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),f={data:d,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return f;const{ctx:p,buffer:m,gridInner:g,gridOuter:v}=this;p.clearRect(m,m,s,l),p.fillText(e,m,m+a);const y=p.getImageData(m,m,s,l);v.fill(Kd,0,h),g.fill(0,0,h);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const n=y.data[4*(e*s+t)+3]/255;if(0===n)continue;const r=(e+m)*c+t+m;if(1===n)v[r]=0,g[r]=Kd;else{const e=.5-n;v[r]=e>0?e*e:0,g[r]=e<0?e*e:0}}Jd(v,0,0,c,u,c,this.f,this.v,this.z),Jd(g,m,m,s,l,c,this.f,this.v,this.z);for(let e=0;e<h;e++){const t=Math.sqrt(v[e])-Math.sqrt(g[e]);d[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return f}};const rf=Ed;function of(e,t,n,r){const i=[],o=e.image,a=o.pixelRatio,s=o.paddedRect.w-2*rf,l=o.paddedRect.h-2*rf,c=e.right-e.left,u=e.bottom-e.top,h=o.stretchX||[[0,s]],d=o.stretchY||[[0,l]],f=(e,t)=>e+t[1]-t[0],p=h.reduce(f,0),m=d.reduce(f,0),g=s-p,v=l-m;let _=0,x=p,w=0,b=m,E=0,k=g,T=0,M=v;if(o.content&&r){const e=o.content;_=af(h,0,e[0]),w=af(d,0,e[1]),x=af(h,e[0],e[2]),b=af(d,e[1],e[3]),E=e[0]-_,T=e[1]-w,k=e[2]-e[0]-x,M=e[3]-e[1]-b}const S=(r,i,s,l)=>{const h=lf(r.stretch-_,x,c,e.left),d=cf(r.fixed-E,k,r.stretch,p),f=lf(i.stretch-w,b,u,e.top),g=cf(i.fixed-T,M,i.stretch,m),v=lf(s.stretch-_,x,c,e.left),S=cf(s.fixed-E,k,s.stretch,p),C=lf(l.stretch-w,b,u,e.top),A=cf(l.fixed-T,M,l.stretch,m),I=new y(h,f),R=new y(v,f),L=new y(v,C),z=new y(h,C),P=new y(d/a,g/a),O=new y(S/a,A/a),D=t*Math.PI/180;if(D){const e=Math.sin(D),t=Math.cos(D),n=[t,-e,e,t];I._matMult(n),R._matMult(n),z._matMult(n),L._matMult(n)}const B=r.stretch+r.fixed,F=i.stretch+i.fixed;return{tl:I,tr:R,bl:z,br:L,tex:{x:o.paddedRect.x+rf+B,y:o.paddedRect.y+rf+F,w:s.stretch+s.fixed-B,h:l.stretch+l.fixed-F},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:P,pixelOffsetBR:O,minFontScaleX:k/a/c,minFontScaleY:M/a/u,isSDF:n}};if(r&&(o.stretchX||o.stretchY)){const e=sf(h,g,p),t=sf(d,v,m);for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1];for(let e=0;e<t.length-1;e++)i.push(S(r,t[e],o,t[e+1]))}}else i.push(S({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return i}function af(e,t,n){let r=0;for(const i of e)r+=Math.max(t,Math.min(n,i[1]))-Math.max(t,Math.min(n,i[0]));return r}function sf(e,t,n){const r=[{fixed:-rf,stretch:0}];for(const[t,n]of e){const e=r[r.length-1];r.push({fixed:t-e.stretch,stretch:e.stretch}),r.push({fixed:t-e.stretch,stretch:e.stretch+(n-t)})}return r.push({fixed:t+rf,stretch:n}),r}function lf(e,t,n,r){return e/t*n+r}function cf(e,t,n,r){return e-t*n/r}function uf(e,t,n,r){const i=t+e.positionedLines[r].lineOffset;return 0===r?n+i/2:n+(i+(t+e.positionedLines[r-1].lineOffset))/2}class hf{constructor(e=[],t=df){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,r=t[e];for(;e>0;){const i=e-1>>1,o=t[i];if(n(r,o)>=0)break;t[e]=o,e=i}t[e]=r}_down(e){const{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=1+(e<<1),o=t[r];const a=r+1;if(a<this.length&&n(t[a],o)<0&&(r=a,o=t[a]),n(o,i)>=0)break;t[e]=o,e=r}t[e]=i}}function df(e,t){return e<t?-1:e>t?1:0}function ff(e,t=1,n=!1){let r=1/0,i=1/0,o=-1/0,a=-1/0;const s=e[0];for(let e=0;e<s.length;e++){const t=s[e];(!e||t.x<r)&&(r=t.x),(!e||t.y<i)&&(i=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>a)&&(a=t.y)}const l=Math.min(o-r,a-i);let c=l/2;const u=new hf([],pf);if(0===l)return new y(r,i);for(let t=r;t<o;t+=l)for(let n=i;n<a;n+=l)u.push(new mf(t+c,n+c,c,e));let h=function(e){let t=0,n=0,r=0;const i=e[0];for(let e=0,o=i.length,a=o-1;e<o;a=e++){const o=i[e],s=i[a],l=o.x*s.y-s.x*o.y;n+=(o.x+s.x)*l,r+=(o.y+s.y)*l,t+=3*l}return new mf(n/t,r/t,0,e)}(e),d=u.length;for(;u.length;){const r=u.pop();(r.d>h.d||!h.d)&&(h=r,n&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,d)),r.max-h.d<=t||(c=r.h/2,u.push(new mf(r.p.x-c,r.p.y-c,c,e)),u.push(new mf(r.p.x+c,r.p.y-c,c,e)),u.push(new mf(r.p.x-c,r.p.y+c,c,e)),u.push(new mf(r.p.x+c,r.p.y+c,c,e)),d+=4)}return n&&(console.log(`num probes: ${d}`),console.log(`best distance: ${h.d}`)),h.p}function pf(e,t){return t.max-e.max}class mf{constructor(e,t,n,r){this.p=new y(e,t),this.h=n,this.d=function(e,t){let n=!1,r=1/0;for(let i=0;i<t.length;i++){const o=t[i];for(let t=0,i=o.length,a=i-1;t<i;a=t++){const i=o[t],s=o[a];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n),r=Math.min(r,yc(e,i,s))}}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}}const gf=7,vf=Number.POSITIVE_INFINITY,yf=Math.sqrt(2);function _f(e,[t,n]){let r=0,i=0;if(n===vf){t<0&&(t=0);const n=t/yf;switch(e){case"top-right":case"top-left":i=n-gf;break;case"bottom-right":case"bottom-left":i=-n+gf;break;case"bottom":i=-t+gf;break;case"top":i=t-gf}switch(e){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=t;break;case"right":r=-t}}else{switch(t=Math.abs(t),n=Math.abs(n),e){case"top-right":case"top-left":case"top":i=n-gf;break;case"bottom-right":case"bottom-left":case"bottom":i=-n+gf}switch(e){case"top-right":case"bottom-right":case"right":r=-t;break;case"top-left":case"bottom-left":case"left":r=t}}return[r,i]}function xf(e,t,n,r,i,o,a,s,l,c){e.createArrays(),e.tilePixelRatio=ss/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const u=e.layers[0].layout,h=e.layers[0]._unevaluatedLayout._values,d={};if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:n}=e.textSizeData;d.compositeTextSizes=[h["text-size"].possiblyEvaluate(new bo(t),s),h["text-size"].possiblyEvaluate(new bo(n),s)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:n}=e.iconSizeData;d.compositeIconSizes=[h["icon-size"].possiblyEvaluate(new bo(t),s),h["icon-size"].possiblyEvaluate(new bo(n),s)]}d.layoutTextSize=h["text-size"].possiblyEvaluate(new bo(l+1),s),d.layoutIconSize=h["icon-size"].possiblyEvaluate(new bo(l+1),s),d.textMaxSize=h["text-size"].possiblyEvaluate(new bo(18),s);const f="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),p=u.get("text-size");for(const o of e.features){const l=u.get("text-font").evaluate(o,{},s).join(","),h=p.evaluate(o,{},s),m=d.layoutTextSize.evaluate(o,{},s),g=(d.layoutIconSize.evaluate(o,{},s),{horizontal:{},vertical:void 0}),v=o.text;let y,_=[0,0];if(v){const r=v.toString(),a=u.get("text-letter-spacing").evaluate(o,{},s)*Fh,c=u.get("text-line-height").evaluate(o,{},s)*Fh,d=no(r)?a:0,p=u.get("text-anchor").evaluate(o,{},s),y=u.get("text-variable-anchor");if(!y){const e=u.get("text-radial-offset").evaluate(o,{},s);_=e?_f(p,[e*Fh,vf]):u.get("text-offset").evaluate(o,{},s).map((e=>e*Fh))}let x=f?"center":u.get("text-justify").evaluate(o,{},s);const w="point"===u.get("symbol-placement"),b=w?u.get("text-max-width").evaluate(o,{},s)*Fh:1/0,E=o=>{e.allowVerticalPlacement&&to(r)&&(g.vertical=Id(v,t,n,i,l,b,c,p,o,d,_,Md.vertical,!0,m,h))};if(!f&&y){const e="auto"===x?y.map((e=>wf(e))):[x];let r=!1;for(let o=0;o<e.length;o++){const a=e[o];if(!g.horizontal[a])if(r)g.horizontal[a]=g.horizontal[0];else{const e=Id(v,t,n,i,l,b,c,"center",a,d,_,Md.horizontal,!1,m,h);e&&(g.horizontal[a]=e,r=1===e.positionedLines.length)}}E("left")}else{if("auto"===x&&(x=wf(p)),w||u.get("text-writing-mode").indexOf("horizontal")>=0||!to(r)){const e=Id(v,t,n,i,l,b,c,p,x,d,_,Md.horizontal,!1,m,h);e&&(g.horizontal[x]=e)}E(w?"left":x)}}let x=!1;if(o.icon&&o.icon.name){const t=r[o.icon.name];t&&(y=Nd(i[o.icon.name],u.get("icon-offset").evaluate(o,{},s),u.get("icon-anchor").evaluate(o,{},s)),x=t.sdf,void 0===e.sdfIcons?e.sdfIcons=t.sdf:e.sdfIcons!==t.sdf&&W("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}const w=Mf(g.horizontal)||g.vertical;e.iconsInText||(e.iconsInText=!!w&&w.iconsInText),(w||y)&&bf(e,o,g,y,r,d,m,0,_,x,a,s,c)}o&&e.generateCollisionDebugBuffers(l,e.collisionBoxArray)}function wf(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function bf(e,t,n,r,i,o,a,s,l,c,u,h,d){let f=o.textMaxSize.evaluate(t,{},h);void 0===f&&(f=a);const p=e.layers[0].layout,m=p.get("icon-offset").evaluate(t,{},h),g=Mf(n.horizontal)||n.vertical,v="globe"===d.name,y=Fh,_=a/y,x=e.tilePixelRatio*f/y,b=(I=e.overscaling,e.zoom>18&&I>2&&(I>>=1),Math.max(ss/(512*I),1)*p.get("symbol-spacing")),E=p.get("text-padding")*e.tilePixelRatio,k=p.get("icon-padding")*e.tilePixelRatio,T=w(p.get("text-max-angle")),M="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),S="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),C=p.get("symbol-placement"),A=b/2;var I;const R=p.get("icon-text-fit");let L;r&&"none"!==R&&(e.allowVerticalPlacement&&n.vertical&&(L=Vd(r,n.vertical,R,p.get("icon-text-fit-padding"),m,_)),g&&(r=Vd(r,g,R,p.get("icon-text-fit-padding"),m,_)));const z=(a,s,f)=>{if(s.x<0||s.x>=ss||s.y<0||s.y>=ss)return;let p=null;if(v){const{x:e,y:t,z:n}=d.projectTilePoint(s.x,s.y,f);p={anchor:new Ud(e,t,n,0,void 0),up:d.upVector(f,s.x,s.y)}}!function(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_,x,w,b,E,k){const T=e.addToLineVertexArray(t,r);let M,S,C,A,I,R,L,z=0,P=0,O=0,D=0,B=-1,F=-1;const j={};let N=Ra("");const V=n?n.anchor:t;let U=0,H=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[U,H]=l.layout.get("text-offset").evaluate(x,{},k).map((e=>e*Fh)):(U=l.layout.get("text-radial-offset").evaluate(x,{},k)*Fh,H=vf),e.allowVerticalPlacement&&i.vertical){const e=i.vertical;if(p)R=Cf(e),s&&(L=Cf(s));else{const n=l.layout.get("text-rotate").evaluate(x,{},k)+90;C=Sf(c,V,t,u,h,d,e,f,n,m),s&&(A=Sf(c,V,t,u,h,d,s,v,n))}}if(o){const r=l.layout.get("icon-rotate").evaluate(x,{},k),i="none"!==l.layout.get("icon-text-fit"),a=of(o,r,b,i),f=s?of(s,r,b,i):void 0;S=Sf(c,V,t,u,h,d,o,v,r),z=4*a.length;const p=e.iconSizeData;let m=null;"source"===p.kind?(m=[jh*l.layout.get("icon-size").evaluate(x,{},k)],m[0]>kf&&W(`${e.layerIds[0]}: Value for "icon-size" is >= ${Ef}. Reduce your "icon-size".`)):"composite"===p.kind&&(m=[jh*w.compositeIconSizes[0].evaluate(x,{},k),jh*w.compositeIconSizes[1].evaluate(x,{},k)],(m[0]>kf||m[1]>kf)&&W(`${e.layerIds[0]}: Value for "icon-size" is >= ${Ef}. Reduce your "icon-size".`)),e.addSymbols(e.icon,a,m,_,y,x,!1,n,t,T.lineStartIndex,T.lineLength,-1,E,k),B=e.icon.placedSymbolArray.length-1,f&&(P=4*f.length,e.addSymbols(e.icon,f,m,_,y,x,Md.vertical,n,t,T.lineStartIndex,T.lineLength,-1,E,k),F=e.icon.placedSymbolArray.length-1)}for(const r in i.horizontal){const o=i.horizontal[r];M||(N=Ra(o.text),p?I=Cf(o):M=Sf(c,V,t,u,h,d,o,f,l.layout.get("text-rotate").evaluate(x,{},k),m));const s=1===o.positionedLines.length;if(O+=Tf(e,n,t,o,a,l,p,x,m,T,i.vertical?Md.horizontal:Md.horizontalOnly,s?Object.keys(i.horizontal):[r],j,B,w,E,k),s)break}i.vertical&&(D+=Tf(e,n,t,i.vertical,a,l,p,x,m,T,Md.vertical,["vertical"],j,F,w,E,k));let $=-1;const G=(e,t)=>e?Math.max(e,t):t;$=G(I,$),$=G(R,$),$=G(L,$);const q=$>-1?1:0;e.glyphOffsetArray.length>=sp.MAX_GLYPHS&&W("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(V.x,V.y,V.z,t.x,t.y,j.right>=0?j.right:-1,j.center>=0?j.center:-1,j.left>=0?j.left:-1,j.vertical>=0?j.vertical:-1,B,F,N,void 0!==M?M:e.collisionBoxArray.length,void 0!==M?M+1:e.collisionBoxArray.length,void 0!==C?C:e.collisionBoxArray.length,void 0!==C?C+1:e.collisionBoxArray.length,void 0!==S?S:e.collisionBoxArray.length,void 0!==S?S+1:e.collisionBoxArray.length,A||e.collisionBoxArray.length,A?A+1:e.collisionBoxArray.length,u,O,D,z,P,q,0,U,H,$)}(e,s,p,a,n,r,i,L,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,E,M,l,0,k,S,m,t,o,c,u,h)};if("line"===C)for(const i of Yd(t.geometry,0,0,ss,ss)){const t=Zd(i,b,T,n.vertical||g,r,y,x,e.overscaling,ss);for(const n of t)g&&Af(e,g.text,A,n)||z(i,n,h)}else if("line-center"===C){for(const e of t.geometry)if(e.length>1){const t=qd(e,T,n.vertical||g,r,y,x);t&&z(e,t,h)}}else if("Polygon"===t.type)for(const e of Eu(t.geometry,0)){const t=ff(e,16);z(e[0],new Ud(t.x,t.y,0,0,void 0),h)}else if("LineString"===t.type)for(const e of t.geometry)z(e,new Ud(e[0].x,e[0].y,0,0,void 0),h);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)z([t],new Ud(t.x,t.y,0,0,void 0),h)}const Ef=255,kf=Ef*jh;function Tf(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g){const v=function(e,t,n,r,i,o,a,s){const l=[];if(0===t.positionedLines.length)return l;const c=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(e){const t=e[0],n=e[1],r=t*n;return r>0?[t,-n]:r<0?[-t,n]:0===t?[n,t]:[n,-t]}(n);let h=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)h-=e.lineOffset;const d=t.positionedLines.length,f=h/d;let p=t.top-n[1];for(let e=0;e<d;++e){const r=t.positionedLines[e];p=uf(t,f,p,e);for(const e of r.positionedGlyphs){if(!e.rect)continue;const r=e.rect||{};let o=wd+1,h=!0,d=1,f=0;if(e.imageName){const t=a[e.imageName];if(!t)continue;if(t.sdf){W("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,d=t.pixelRatio,o=Ed/d}const m=(i||s)&&e.vertical,g=e.metrics.advance*e.scale/2,v=e.metrics,_=e.rect;if(null===_)continue;s&&t.verticalizable&&(f=e.imageName?g-e.metrics.width*e.scale/2:0);const x=i?[e.x+g,e.y]:[0,0];let w=[0,0],b=[0,0],E=!1;i||(m?(b=[e.x+g+u[0],e.y+u[1]-f],E=!0):w=[e.x+g+n[0],e.y+n[1]-f]);const k=_.w*e.scale/(d*(e.localGlyph?ef:1)),T=_.h*e.scale/(d*(e.localGlyph?ef:1));let M,S,C,A;if(m){const t=e.y-p,n=new y(-g,g-t),r=-Math.PI/2,i=new y(...b);M=new y(-g+w[0],w[1]),M._rotateAround(r,n)._add(i),M.x+=-t+g,M.y-=(v.left-o)*e.scale;const a=e.imageName?v.advance*e.scale:Fh*e.scale,s=String.fromCharCode(e.glyph);Gh(s)?M.x+=(1-o)*e.scale:qh(s)?M.x+=a-v.height*e.scale+(-o-1)*e.scale:M.x+=e.imageName||v.width+2*o===_.w&&v.height+2*o===_.h?(a-T)/2:(a-(v.height+2*o)*e.scale)/2,S=new y(M.x,M.y-k),C=new y(M.x+T,M.y),A=new y(M.x+T,M.y-k)}else{const t=(v.left-o)*e.scale-g+w[0],n=(-v.top-o)*e.scale+w[1],r=t+k,i=n+T;M=new y(t,n),S=new y(r,n),C=new y(t,i),A=new y(r,i)}if(c){let e;e=i?new y(0,0):E?new y(u[0],u[1]):new y(n[0],n[1]),M._rotateAround(c,e),S._rotateAround(c,e),C._rotateAround(c,e),A._rotateAround(c,e)}const I=new y(0,0),R=new y(0,0);l.push({tl:M,tr:S,bl:C,br:A,tex:r,writingMode:t.writingMode,glyphOffset:x,sectionIndex:e.sectionIndex,isSDF:h,pixelOffsetTL:I,pixelOffsetBR:R,minFontScaleX:0,minFontScaleY:0})}}return l}(0,r,l,o,a,s,i,e.allowVerticalPlacement),_=e.textSizeData;let x=null;"source"===_.kind?(x=[jh*o.layout.get("text-size").evaluate(s,{},g)],x[0]>kf&&W(`${e.layerIds[0]}: Value for "text-size" is >= ${Ef}. Reduce your "text-size".`)):"composite"===_.kind&&(x=[jh*p.compositeTextSizes[0].evaluate(s,{},g),jh*p.compositeTextSizes[1].evaluate(s,{},g)],(x[0]>kf||x[1]>kf)&&W(`${e.layerIds[0]}: Value for "text-size" is >= ${Ef}. Reduce your "text-size".`)),e.addSymbols(e.text,v,x,l,a,s,u,t,n,c.lineStartIndex,c.lineLength,f,m,g);for(const t of h)d[t]=e.text.placedSymbolArray.length-1;return 4*v.length}function Mf(e){for(const t in e)return e[t];return null}function Sf(e,t,n,r,i,o,a,s,l,c){let u=a.top,h=a.bottom,d=a.left,f=a.right;const p=a.collisionPadding;if(p&&(d-=p[0],u-=p[1],f+=p[2],h+=p[3]),l){const e=new y(d,u),t=new y(f,u),n=new y(d,h),r=new y(f,h),i=w(l);let o=new y(0,0);c&&(o=new y(c[0],c[1])),e._rotateAround(i,o),t._rotateAround(i,o),n._rotateAround(i,o),r._rotateAround(i,o),d=Math.min(e.x,t.x,n.x,r.x),f=Math.max(e.x,t.x,n.x,r.x),u=Math.min(e.y,t.y,n.y,r.y),h=Math.max(e.y,t.y,n.y,r.y)}return e.emplaceBack(t.x,t.y,t.z,n.x,n.y,d,u,f,h,s,r,i,o),e.length-1}function Cf(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function Af(e,t,n,r){const i=e.compareText;if(t in i){const e=i[t];for(let t=e.length-1;t>=0;t--)if(r.dist(e[t])<n)return!0}else i[t]=[];return i[t].push(r),!1}function If(e,t){const n=e.fovAboveCenter,r=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,i=(e._camera.position[2]*e.worldSize-r)/Math.cos(e._pitch),o=Math.sin(n)*i/Math.sin(Math.max(Math.PI/2-e._pitch-n,.01)),a=Math.sin(e._pitch)*o+i;return Math.min(1.01*a,i*(1/e._horizonShift))}function Rf(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const n=Math.pow(2,-e.z),r=e.x*n,i=(e.x+1)*n,o=e.y*n,a=(e.y+1)*n,s=ql(r),l=ql(i),c=Zl(o),u=Zl(a),h=t.project(s,c),d=t.project(l,c),f=t.project(l,u),p=t.project(s,u);let m=Math.min(h.x,d.x,f.x,p.x),g=Math.min(h.y,d.y,f.y,p.y),v=Math.max(h.x,d.x,f.x,p.x),y=Math.max(h.y,d.y,f.y,p.y);const _=n/16;function x(e,n,r,i,o,a){const s=(r+o)/2,l=(i+a)/2,c=t.project(ql(s),Zl(l)),u=Math.max(0,m-c.x,g-c.y,c.x-v,c.y-y);m=Math.min(m,c.x),v=Math.max(v,c.x),g=Math.min(g,c.y),y=Math.max(y,c.y),u>_&&(x(e,c,r,i,s,l),x(c,n,s,l,o,a))}x(h,d,r,o,i,o),x(d,f,i,o,i,a),x(f,p,i,a,r,a),x(p,h,r,a,r,o),m-=_,g-=_,v+=_,y+=_;const w=1/Math.max(v-m,y-g);return{scale:w,x:m*w,y:g*w,x2:v*w,y2:y*w,projection:t}}const Lf=fs(new Float32Array(16));class zf{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new Ul(0,0)}projectTilePoint(e,t,n){return{x:e,y:t,z:0}}locationPoint(e,t,n=!0){return e._coordinatePoint(e.locationCoordinate(t),n)}pixelsPerMeter(e,t){return Gl(1,e)*t}pixelSpaceConversion(e,t,n){return 1}farthestPixelDistance(e){return If(e,e.pixelsPerMeter)}pointCoordinate(e,t,n,r){const i=e.horizonLineFromTop(!1),o=new y(t,Math.max(i,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,r))}pointCoordinate3D(e,t,n){const r=new y(t,n);if(e.elevation)return e.elevation.pointCoordinate(r);{const t=this.pointCoordinate(e,r.x,r.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation)return!this.pointCoordinate3D(e,t.x,t.y);const n=e.horizonLineFromTop();return t.y<n}createInversionMatrix(e,t){return Lf}createTileMatrix(e,t,n){let r,i,o;const a=n.canonical,s=fs(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=Rf(a,this);r=1,i=l.x+n.wrap*l.scale,o=l.y,vs(s,s,[r/l.scale,r/l.scale,e.pixelsPerMeter/t])}else r=t/e.zoomScale(a.z),i=(a.x+Math.pow(2,a.z)*n.wrap)*r,o=a.y*r;return gs(s,s,[i,o,0]),vs(s,s,[r/ss,r/ss,1]),s}upVector(e,t,n){return[0,0,1]}upVectorScale(e,t,n){return{metersToTile:1}}}class Pf extends zf{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,n]=this.parallels=e.parallels||[29.5,45.5],r=Math.sin(w(t));this.n=(r+Math.sin(w(n)))/2,this.c=1+r*(2*this.n-r),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n:n,c:r,r0:i}=this,o=w(e-this.center[0]),a=w(t),s=Math.sqrt(r-2*n*Math.sin(a))/n;return{x:s*Math.sin(o*n),y:s*Math.cos(o*n)-i,z:0}}unproject(e,t){const{n:n,c:r,r0:i}=this,o=i+t;let a=Math.atan2(e,Math.abs(o))*Math.sign(o);o*n<0&&(a-=Math.PI*Math.sign(e)*Math.sign(o));const s=w(this.center[0])*n;a=A(a,-Math.PI-s,Math.PI-s);const l=S(b(a/n)+this.center[0],-180,180),c=Math.asin(S((r-(e*e+o*o)*n*n)/(2*n),-1,1)),u=S(b(c),-Yl,Yl);return new Ul(l,u)}}const Of=1.340264,Df=-.081106,Bf=893e-6,Ff=.003796,jf=Math.sqrt(3)/2;class Nf extends zf{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const n=Math.asin(jf*Math.sin(t)),r=n*n,i=r*r*r;return{x:.5*(e*Math.cos(n)/(jf*(Of+3*Df*r+i*(7*Bf+9*Ff*r)))/Math.PI+.5),y:1-.5*(n*(Of+Df*r+i*(Bf+Ff*r))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let n=t=(2*(1-t)-1)*Math.PI,r=n*n,i=r*r*r;for(let e,o,a,s=0;s<12&&(o=n*(Of+Df*r+i*(Bf+Ff*r))-t,a=Of+3*Df*r+i*(7*Bf+9*Ff*r),e=o/a,n=S(n-e,-Math.PI/3,Math.PI/3),r=n*n,i=r*r*r,!(Math.abs(e)<1e-12));++s);const o=jf*e*(Of+3*Df*r+i*(7*Bf+9*Ff*r))/Math.cos(n),a=Math.asin(Math.sin(n)/jf),s=S(180*o/Math.PI,-180,180),l=S(180*a/Math.PI,-Yl,Yl);return new Ul(s,l)}}class Vf extends zf{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const n=360*(e-.5),r=S(360*(.5-t),-Yl,Yl);return new Ul(n,r)}}const Uf=Math.PI/2;function Hf(e){return Math.tan((Uf+e)/2)}class Wf extends zf{constructor(e){super(e),this.center=e.center||[0,30];const[t,n]=this.parallels=e.parallels||[30,30];let r=w(t),i=w(n);this.southernCenter=r+i<0,this.southernCenter&&(r=-r,i=-i);const o=Math.cos(r),a=Hf(r);this.n=r===i?Math.sin(r):Math.log(o/Math.cos(i))/Math.log(Hf(i)/a),this.f=o*Math.pow(Hf(r),this.n)/this.n}project(e,t){t=w(t),this.southernCenter&&(t=-t),e=w(e-this.center[0]);const n=1e-6,{n:r,f:i}=this;i>0?t<-Uf+n&&(t=-Uf+n):t>Uf-n&&(t=Uf-n);const o=i/Math.pow(Hf(t),r);let a=o*Math.sin(r*e),s=i-o*Math.cos(r*e);return a=.5*(a/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:a,y:this.southernCenter?s:1-s,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:n,f:r}=this,i=r-t,o=Math.sign(i),a=Math.sign(n)*Math.sqrt(e*e+i*i);let s=Math.atan2(e,Math.abs(i))*o;i*n<0&&(s-=Math.PI*Math.sign(e)*o);const l=S(b(s/n)+this.center[0],-180,180),c=S(b(2*Math.atan(Math.pow(r/a,1/n))-Uf),-Yl,Yl);return new Ul(l,this.southernCenter?-c:c)}}class $f extends zf{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:Wl(e),y:$l(t),z:0}}unproject(e,t){const n=ql(e),r=Zl(t);return new Ul(n,r)}}const Gf=w(Yl);class qf extends zf{project(e,t){const n=(t=w(t))*t,r=n*n;return{x:.5*((e=w(e))*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let n=t=(2*(1-t)-1)*Math.PI,r=25,i=0,o=n*n;do{o=n*n;const e=o*o;i=(n*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),n=S(n-i,-Gf,Gf)}while(Math.abs(i)>1e-6&&--r>0);o=n*n;const a=S(b(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),s=b(n);return new Ul(a,s)}}const Zf=w(Yl);class Xf extends zf{project(e,t){t=w(t),e=w(e);const n=Math.cos(t),r=2/Math.PI,i=Math.acos(n*Math.cos(e/2)),o=Math.sin(i)/i,a=.5*(e*r+2*n*Math.sin(e/2)/o)||0,s=.5*(t+Math.sin(t)/o)||0;return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}}unproject(e,t){let n=e=(2*e-.5)*Math.PI,r=t=(2*(1-t)-1)*Math.PI,i=25;const o=1e-6;let a=0,s=0;do{const i=Math.cos(r),o=Math.sin(r),l=2*o*i,c=o*o,u=i*i,h=Math.cos(n/2),d=Math.sin(n/2),f=2*h*d,p=d*d,m=1-u*h*h,g=m?1/m:0,v=m?Math.acos(i*h)*Math.sqrt(1/m):0,y=.5*(2*v*i*d+2*n/Math.PI)-e,_=.5*(v*o+r)-t,x=.5*g*(u*p+v*i*h*c)+1/Math.PI,w=g*(f*l/4-v*o*d),b=.125*g*(l*d-v*o*u*f),E=.5*g*(c*h+v*p*i)+.5,k=w*b-E*x;a=(_*w-y*E)/k,s=(y*b-_*x)/k,n=S(n-a,-Math.PI,Math.PI),r=S(r-s,-Zf,Zf)}while((Math.abs(a)>o||Math.abs(s)>o)&&--i>0);return new Ul(b(n),b(r))}}class Yf extends zf{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(w(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:n,cosPhi:r}=this;return{x:w(e)*r*n+.5,y:-Math.sin(w(t))/r*n+.5,z:0}}unproject(e,t){const{scale:n,cosPhi:r}=this,i=-(t-.5)/n,o=S(b((e-.5)/n)/r,-180,180),a=Math.asin(S(i*r,-1,1)),s=S(b(a),-Yl,Yl);return new Ul(o,s)}}class Kf extends $f{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(e,t,n){const r=Sl(e,t,n);return Bs(r,r,Il(yl(n))),{x:r[0],y:r[1],z:r[2]}}locationPoint(e,t){const n=Ml(t.lat,t.lng),r=Ps([],n),i=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;zs(n,n,r,Gl(1,0)*ss*i);const o=fs(new Float64Array(16));return ms(o,e.pixelMatrix,e.globeMatrix),Bs(n,n,o),new y(n[0],n[1])}pixelsPerMeter(e,t){return Gl(1,0)*t}pixelSpaceConversion(e,t,n){const r=Gl(1,e)*t,i=Ln(Gl(1,45)*t,r,n);return this.pixelsPerMeter(e,t)/i}createTileMatrix(e,t,n){const r=Rl(yl(n.canonical));return ms(new Float64Array(16),e.globeMatrix,r)}createInversionMatrix(e,t){const{center:n}=e,r=Il(yl(t));return _s(r,r,w(n.lng)),ys(r,r,w(n.lat)),vs(r,r,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(r)}pointCoordinate(e,t,n,r){return ml(e,t,n,!0)||new Jl(0,0)}pointCoordinate3D(e,t,n){const r=this.pointCoordinate(e,t,n,0);return[r.x,r.y,r.z]}isPointAboveHorizon(e,t){return!ml(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const n=e.cameraToCenterDistance,r=e._centerAltitude*t,i=e._camera,o=e._camera.forward(),a=Ss([],Ls([],o,-n),[0,0,r]),s=e.worldSize/(2*Math.PI),l=[0,0,-s],c=e.width/e.height,u=Math.tan(e.fovAboveCenter),h=Ls([],i.up(),u),d=Ls([],i.right(),u*c),f=Ps([],Ss([],Ss([],o,h),d)),p=[];let m;if(new tl(a,f).closestPointOnSphere(l,s,p)){const t=Ss([],p,l),n=Ns([],t,a);m=Math.cos(e.fovAboveCenter)*Ts(n)}else{const e=Ns([],a,l),t=Ns([],l,a);Ps(t,t);const n=Ts(e)-s;m=Math.sqrt(n*(n+2*s));const r=Math.acos(m/(s+n))-Math.acos(Os(o,t));m*=Math.cos(r)}return 1.01*m}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=zl(e.zoom);if(n>0){const r=If(e,Gl(1,e.center.lat)*e.worldSize),i=e.worldSize/(2*Math.PI),o=Math.max(e.width,e.height)/e.worldSize*Math.PI;return Ln(t,r+i*(1-Math.cos(o)),Math.pow(n,10))}return t}upVector(e,t,n){return Sl(t,n,e,1)}upVectorScale(e){return{metersToTile:pl(Cl(yl(e)))}}}function Jf(e){const t=e.parallels,n=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new $f(e);case"equirectangular":return new Vf(e);case"naturalEarth":return new qf(e);case"equalEarth":return new Nf(e);case"winkelTripel":return new Xf(e);case"albers":return n?new Yf(e):new Pf(e);case"lambertConformalConic":return n?new Yf(e):new Wf(e);case"globe":return new Kf(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Qf=qu.types,ep=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function tp(e,t,n,r,i,o,a,s,l,c,u,h,d){const f=s?Math.min(kf,Math.round(s[0])):0,p=s?Math.min(kf,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(32*r),Math.round(32*i),o,a,(f<<1)+(l?1:0),p,16*c,16*u,256*h,256*d)}function np(e,t,n,r,i,o,a){e.emplaceBack(t,n,r,i,o,a)}function rp(e,t,n,r,i){e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i),e.emplaceBack(t,n,r,i)}function ip(e){for(const t of e.sections)if(lo(t.text))return!0;return!1}class op{constructor(e){this.layoutVertexArray=new Xo,this.indexArray=new ra,this.programConfigurations=e,this.segments=new as,this.dynamicLayoutVertexArray=new $o,this.opacityVertexArray=new Ko,this.placedSymbolArray=new ma,this.globeExtVertexArray=new Yo}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Rh.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,zh.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,ep,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Lh.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Xi(op,"SymbolBuffers");class ap{constructor(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new as,this.collisionVertexArray=new ta,this.collisionVertexArrayExt=new na}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Ph.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Oh.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Xi(ap,"CollisionBuffers");class sp{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=fs([]),this.placementViewportMatrix=fs([]);const t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Nh(this.zoom,t["text-size"]),this.iconSizeData=Nh(this.zoom,t["icon-size"]);const n=this.layers[0].layout,r=n.get("symbol-sort-key"),i=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==r.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map((e=>Md[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new op(new Ya(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new op(new Ya(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new ya,this.lineVertexArray=new _a,this.symbolInstances=new va}calculateGlyphDependencies(e,t,n,r,i){for(let n=0;n<e.length;n++)if(t[e.charCodeAt(n)]=!0,r&&i){const r=$h[e.charAt(n)];r&&(t[r.charCodeAt(0)]=!0)}}populate(e,t,n,r){const i=this.layers[0],o=i.layout,a="globe"===this.projection.name,s=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),u=("constant"!==l.value.kind||l.value.value instanceof Pt&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==s.value.kind||s.value.value.length>0),h="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,d=o.get("symbol-sort-key");if(this.features=[],!u&&!h)return;const f=t.iconDependencies,p=t.glyphDependencies,m=t.availableImages,g=new bo(this.zoom);for(const{feature:t,id:l,index:c,sourceLayerIndex:v}of e){const e=i._featureFilter.needGeometry,y=sc(t,e);if(!i._featureFilter.filter(g,y,n))continue;if(e||(y.geometry=ac(t,n,r)),a&&1!==t.type&&n.z<=5){const e=y.geometry,t=.98078528056,r=(e,r)=>Os(Sl(e.x,e.y,n,1),Sl(r.x,r.y,n,1))<t;for(let t=0;t<e.length;t++)e[t]=nc(e[t],r)}let _,x;if(u){const e=i.getValueAndResolveTokens("text-field",y,n,m),t=Pt.factory(e);ip(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===_o()||this.hasRTLText&&wo.isParsed())&&(_=Wh(t,i,y))}if(h){const e=i.getValueAndResolveTokens("icon-image",y,n,m);x=e instanceof Ot?e:Ot.fromString(e)}if(!_&&!x)continue;const w=this.sortFeaturesByKey?d.evaluate(y,{},n):void 0;if(this.features.push({id:l,text:_,icon:x,index:c,sourceLayerIndex:v,geometry:y.geometry,properties:t.properties,type:Qf[t.type],sortKey:w}),x&&(f[x.name]=!0),_){const e=s.evaluate(y,{},n).join(","),t="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Md.vertical)>=0;for(const n of _.sections)if(n.image)f[n.image.name]=!0;else{const r=to(_.toString()),i=n.fontStack||e,o=p[i]=p[i]||{};this.calculateGlyphDependencies(n.text,o,t,this.allowVerticalPlacement,r)}}}"line"===o.get("symbol-placement")&&(this.features=function(e){const t={},n={},r=[];let i=0;function o(t){r.push(e[t]),i++}function a(e,t,i){const o=n[e];return delete n[e],n[t]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function s(e,n,i){const o=t[n];return delete t[n],t[e]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function l(e,t,n){const r=n?t[0][t[0].length-1]:t[0][0];return`${e}:${r.x}:${r.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d){o(c);continue}const f=l(d,h),p=l(d,h,!0);if(f in n&&p in t&&n[f]!==t[p]){const e=s(f,p,h),i=a(f,p,r[e].geometry);delete t[f],delete n[p],n[l(d,r[i].geometry,!0)]=i,r[e].geometry=null}else f in n?a(f,p,h):p in t?s(f,p,h):(o(c),t[f]=i-1,n[p]=i-1)}return r.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,n,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,n,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,n,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Jf(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const n=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:n}of t)this.lineVertexArray.emplaceBack(e,n);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,t,n,r,i,o,a,s,l,c,u,h,d,f){const p=e.indexArray,m=e.layoutVertexArray,g=e.globeExtVertexArray,v=e.segments.prepareSegment(4*t.length,m,p,this.canOverlap?o.sortKey:void 0),y=this.glyphOffsetArray.length,_=v.vertexLength,x=this.allowVerticalPlacement&&a===Md.vertical?Math.PI/2:0,w=o.text&&o.text.sections;for(let r=0;r<t.length;r++){const{tl:i,tr:a,bl:c,br:u,tex:h,pixelOffsetTL:y,pixelOffsetBR:_,minFontScaleX:b,minFontScaleY:E,glyphOffset:k,isSDF:T,sectionIndex:M}=t[r],S=v.vertexLength,C=k[1];if(tp(m,l.x,l.y,i.x,C+i.y,h.x,h.y,n,T,y.x,y.y,b,E),tp(m,l.x,l.y,a.x,C+a.y,h.x+h.w,h.y,n,T,_.x,y.y,b,E),tp(m,l.x,l.y,c.x,C+c.y,h.x,h.y+h.h,n,T,y.x,_.y,b,E),tp(m,l.x,l.y,u.x,C+u.y,h.x+h.w,h.y+h.h,n,T,_.x,_.y,b,E),s){const{x:t,y:n,z:r}=s.anchor,[i,o,a]=s.up;np(g,t,n,r,i,o,a),np(g,t,n,r,i,o,a),np(g,t,n,r,i,o,a),np(g,t,n,r,i,o,a),rp(e.dynamicLayoutVertexArray,t,n,r,x)}else rp(e.dynamicLayoutVertexArray,l.x,l.y,l.z,x);p.emplaceBack(S,S+1,S+2),p.emplaceBack(S+1,S+2,S+3),v.vertexLength+=4,v.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(k[0]),r!==t.length-1&&M===t[r+1].sectionIndex||e.programConfigurations.populatePaintArrays(m.length,o,o.index,{},d,f,w&&w[M])}const b=s?s.anchor:l;e.placedSymbolArray.emplaceBack(b.x,b.y,b.z,l.x,l.y,y,this.glyphOffsetArray.length-y,_,c,u,l.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],a,0,!1,0,h,0)}_commitLayoutVertex(e,t,n,r,i,o,a){e.emplaceBack(t,n,r,i,o,Math.round(a.x),Math.round(a.y))}_addCollisionDebugVertices(e,t,n,r,i,o,a){const s=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=s.vertexLength,c=a.tileAnchorX,u=a.tileAnchorY;for(let e=0;e<4;e++)n.collisionVertexArray.emplaceBack(0,0,0,0);n.collisionVertexArrayExt.emplaceBack(t,-e.padding,-e.padding),n.collisionVertexArrayExt.emplaceBack(t,e.padding,-e.padding),n.collisionVertexArrayExt.emplaceBack(t,e.padding,e.padding),n.collisionVertexArrayExt.emplaceBack(t,-e.padding,e.padding),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,c,u,new y(e.x1,e.y1)),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,c,u,new y(e.x2,e.y1)),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,c,u,new y(e.x2,e.y2)),this._commitLayoutVertex(n.layoutVertexArray,r,i,o,c,u,new y(e.x1,e.y2)),s.vertexLength+=4;const h=n.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),s.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceTextSize(e,o,t,a);this._addCollisionDebugVertices(r,i,this.textCollisionBox,r.projectedAnchorX,r.projectedAnchorY,r.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(r,i,this.iconCollisionBox,r.projectedAnchorX,r.projectedAnchorY,r.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ap(Qo,Dh.members,ca),this.iconCollisionBox=new ap(Qo,Dh.members,ca);const n=Uh(this.iconSizeData,e),r=Uh(this.textSizeData,e);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._addTextDebugCollisionBoxes(r,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(r,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(e,t,n,r){const i=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:r),o=Vh(this.textSizeData,e,i)/Fh;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,n){const r=this.icon.placedSymbolArray.get(n),i=Vh(this.iconSizeData,e,r);return this.tilePixelRatio*i}_commitDebugCollisionVertexUpdate(e,t,n){e.emplaceBack(t,-n,-n),e.emplaceBack(t,n,-n),e.emplaceBack(t,n,n),e.emplaceBack(t,-n,n)}_updateTextDebugCollisionBoxes(e,t,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceTextSize(e,o,t,a);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,i,r.padding)}}_updateIconDebugCollisionBoxes(e,t,n,r,i,o){for(let a=r;a<i;a++){const r=n.get(a),i=this.getSymbolInstanceIconSize(e,t,o);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,i,r.padding)}}updateCollisionDebugBuffers(e,t){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const n=Uh(this.iconSizeData,e),r=Uh(this.textSizeData,e);for(let i=0;i<this.symbolInstances.length;i++){const o=this.symbolInstances.get(i);this._updateTextDebugCollisionBoxes(r,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(r,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(n,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(n,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,n,r,i,o,a,s,l){const c={};if(t<n){const{x1:n,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(t);c.textBox={x1:n,y1:r,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.textFeatureIndex=f}if(r<i){const{x1:t,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(r);c.verticalTextBox={x1:t,y1:n,x2:i,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalTextFeatureIndex=f}if(o<a){const{x1:t,y1:n,x2:r,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(o);c.iconBox={x1:t,y1:n,x2:r,y2:i,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.iconFeatureIndex=f}if(s<l){const{x1:t,y1:n,x2:r,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(s);c.verticalIconBox={x1:t,y1:n,x2:r,y2:i,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalIconFeatureIndex=f}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const n=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}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(e,t){const n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+4*n.numGlyphs;for(let t=n.vertexStartIndex;t<r;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),n=Math.cos(e),r=[],i=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const a=this.symbolInstances.get(e);r.push(0|Math.round(t*a.tileAnchorX+n*a.tileAnchorY)),i.push(a.featureIndex)}return o.sort(((e,t)=>r[e]-r[t]||i[t]-i[e])),o}addToSortKeyRanges(e,t){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:r,leftJustifiedTextSymbolIndex:i,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:a,verticalPlacedIconSymbolIndex:s}=t;n>=0&&this.addIndicesForPlacedSymbol(this.text,n),r>=0&&r!==n&&this.addIndicesForPlacedSymbol(this.text,r),i>=0&&i!==r&&i!==n&&this.addIndicesForPlacedSymbol(this.text,i),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Xi(sp,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),sp.MAX_GLYPHS=65535,sp.addDynamicAttributes=rp;const lp=new Po({"symbol-placement":new Ro(et.layout_symbol["symbol-placement"]),"symbol-spacing":new Ro(et.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ro(et.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Lo(et.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ro(et.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ro(et.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ro(et.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ro(et.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ro(et.layout_symbol["icon-rotation-alignment"]),"icon-size":new Lo(et.layout_symbol["icon-size"]),"icon-text-fit":new Ro(et.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ro(et.layout_symbol["icon-text-fit-padding"]),"icon-image":new Lo(et.layout_symbol["icon-image"]),"icon-rotate":new Lo(et.layout_symbol["icon-rotate"]),"icon-padding":new Ro(et.layout_symbol["icon-padding"]),"icon-keep-upright":new Ro(et.layout_symbol["icon-keep-upright"]),"icon-offset":new Lo(et.layout_symbol["icon-offset"]),"icon-anchor":new Lo(et.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ro(et.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ro(et.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ro(et.layout_symbol["text-rotation-alignment"]),"text-field":new Lo(et.layout_symbol["text-field"]),"text-font":new Lo(et.layout_symbol["text-font"]),"text-size":new Lo(et.layout_symbol["text-size"]),"text-max-width":new Lo(et.layout_symbol["text-max-width"]),"text-line-height":new Lo(et.layout_symbol["text-line-height"]),"text-letter-spacing":new Lo(et.layout_symbol["text-letter-spacing"]),"text-justify":new Lo(et.layout_symbol["text-justify"]),"text-radial-offset":new Lo(et.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ro(et.layout_symbol["text-variable-anchor"]),"text-anchor":new Lo(et.layout_symbol["text-anchor"]),"text-max-angle":new Ro(et.layout_symbol["text-max-angle"]),"text-writing-mode":new Ro(et.layout_symbol["text-writing-mode"]),"text-rotate":new Lo(et.layout_symbol["text-rotate"]),"text-padding":new Ro(et.layout_symbol["text-padding"]),"text-keep-upright":new Ro(et.layout_symbol["text-keep-upright"]),"text-transform":new Lo(et.layout_symbol["text-transform"]),"text-offset":new Lo(et.layout_symbol["text-offset"]),"text-allow-overlap":new Ro(et.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ro(et.layout_symbol["text-ignore-placement"]),"text-optional":new Ro(et.layout_symbol["text-optional"])});var cp={paint:new Po({"icon-opacity":new Lo(et.paint_symbol["icon-opacity"]),"icon-color":new Lo(et.paint_symbol["icon-color"]),"icon-halo-color":new Lo(et.paint_symbol["icon-halo-color"]),"icon-halo-width":new Lo(et.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Lo(et.paint_symbol["icon-halo-blur"]),"icon-translate":new Ro(et.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ro(et.paint_symbol["icon-translate-anchor"]),"text-opacity":new Lo(et.paint_symbol["text-opacity"]),"text-color":new Lo(et.paint_symbol["text-color"],{runtimeType:dt,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Lo(et.paint_symbol["text-halo-color"]),"text-halo-width":new Lo(et.paint_symbol["text-halo-width"]),"text-halo-blur":new Lo(et.paint_symbol["text-halo-blur"]),"text-translate":new Ro(et.paint_symbol["text-translate"]),"text-translate-anchor":new Ro(et.paint_symbol["text-translate-anchor"])}),layout:lp};class up{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:lt,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Xi(up,"FormatSectionOverride",{omit:["defaultValue"]});class hp extends rs{constructor(e){super(e,cp)}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const e=[];for(const t of n)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,t,n,r){const i=this.layout.get(e).evaluate(t,{},n,r),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||Xr(o.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,((t,n)=>n in e?String(e[n]):""))}(t.properties,i)}createBucket(e){return new sp(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of cp.paint.overridableProperties){if(!hp.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),n=new up(t),r=new Zr(n,t.property.specification);let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new Kr("source",r):new Jr("composite",r,t.value.zoomStops,t.value._interpolationType),this.paint._values[e]=new Ao(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,n){return!(!this.layout||t.isDataDriven()||n.isDataDriven())&&hp.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const n=e.get("text-field"),r=cp.paint.properties[t];let i=!1;const o=e=>{for(const t of e)if(r.overrides&&r.overrides.hasOverride(t))return void(i=!0)};if("constant"===n.value.kind&&n.value.value instanceof Pt)o(n.value.value.sections);else if("source"===n.value.kind){const e=t=>{i||(t instanceof Vt&&Ft(t.value)===gt?o(t.value.sections):t instanceof Gt?o(t.sections):t.eachChild(e))},t=n.value;t._styleExpression&&e(t._styleExpression.expression)}return i}getProgramConfiguration(e){return new Xa(this,e)}}var dp={paint:new Po({"background-color":new Ro(et.paint_background["background-color"]),"background-pattern":new Ro(et.paint_background["background-pattern"]),"background-opacity":new Ro(et.paint_background["background-opacity"])})},fp={paint:new Po({"raster-opacity":new Ro(et.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ro(et.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ro(et.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ro(et.paint_raster["raster-brightness-max"]),"raster-saturation":new Ro(et.paint_raster["raster-saturation"]),"raster-contrast":new Ro(et.paint_raster["raster-contrast"]),"raster-resampling":new Ro(et.paint_raster["raster-resampling"]),"raster-fade-duration":new Ro(et.paint_raster["raster-fade-duration"])})};class pp extends rs{constructor(e){super(e,{}),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isLayerDraped(){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var mp={paint:new Po({"sky-type":new Ro(et.paint_sky["sky-type"]),"sky-atmosphere-sun":new Ro(et.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Ro(et.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Ro(et.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Ro(et.paint_sky["sky-gradient-radius"]),"sky-gradient":new zo(et.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Ro(et.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Ro(et.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Ro(et.paint_sky["sky-opacity"])})};function gp(e,t,n){const r=[0,0,1],i=qs([]);return Xs(i,i,n?-w(e)+Math.PI:w(e)),Zs(i,i,-w(t)),Fs(r,r,i),Ps(r,r)}const vp={circle:class extends rs{constructor(e){super(e,Cc)}createBucket(e){return new uc(e)}queryRadius(e){const t=e;return Ec("circle-radius",this,t)+Ec("circle-stroke-width",this,t)+kc(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,n,r,i,o,a,s){const l=Mc(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,n)+this.paint.get("circle-stroke-width").evaluate(t,n);return Ac(e,r,o,a,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getProgramConfiguration(e){return new Xa(this,e)}},heatmap:class extends rs{createBucket(e){return new Pc(e)}constructor(e){super(e,Nc),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Vc({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(e){return Ec("heatmap-radius",this,e)}queryIntersectsFeature(e,t,n,r,i,o,a,s){const l=this.paint.get("heatmap-radius").evaluate(t,n);return Ac(e,r,o,a,s,!0,!0,new y(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(e){return new Xa(this,e)}},hillshade:class extends rs{constructor(e){super(e,Uc)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends rs{constructor(e){super(e,Au)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),n=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&n.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),n}getProgramConfiguration(e){return new Xa(this,e)}recalculate(e,t){super.recalculate(e,t);const n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Su(e)}queryRadius(){return kc(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,n,r,i,o){return!e.queryGeometry.isAboveHorizon&&fc(Tc(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),r)}isTileClipped(){return!0}},"fill-extrusion":class extends rs{constructor(e){super(e,uh)}createBucket(e){return new eh(e)}queryRadius(){return kc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(e){return new Xa(this,e)}queryIntersectsFeature(e,t,n,r,i,o,a,s,l){const c=Mc(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(t,n),h=this.paint.get("fill-extrusion-base").evaluate(t,n),d=[0,0],f=s&&o.elevation,p=o.elevation?o.elevation.exaggeration():1,m=e.tile.getBucket(this);if(f&&m instanceof eh){const e=m.centroidVertexArray,t=l+1;t<e.length&&(d[0]=e.geta_centroid_pos0(t),d[1]=e.geta_centroid_pos1(t))}if(0===d[0]&&1===d[1])return!1;"globe"===o.projection.name&&(r=lh([r],[new y(0,0),new y(ss,ss)],e.tileID.canonical).map((e=>e.polygon)).flat());const g=f?s:null,[v,_]=function(e,t,n,r,i,o,a,s,l,c,u){return"globe"===e.projection.name?function(e,t,n,r,i,o,a,s,l,c,u){const h=[],d=[],f=e.projection.upVectorScale(u,e.center.lat,e.worldSize).metersToTile,p=[0,0,0,1],m=[0,0,0,1],g=(e,t,n,r)=>{e[0]=t,e[1]=n,e[2]=r,e[3]=1},v=sh();n>0&&(n+=v),r+=v;for(const v of t){const t=[],y=[];for(const h of v){const d=h.x+i.x,v=h.y+i.y,_=e.projection.projectTilePoint(d,v,u),x=e.projection.upVector(u,h.x,h.y);let w=n,b=r;if(a){const e=_h(d,v,n,r,a,s,l,c);w+=e.base,b+=e.top}0!==n?g(p,_.x+x[0]*f*w,_.y+x[1]*f*w,_.z+x[2]*f*w):g(p,_.x,_.y,_.z),g(m,_.x+x[0]*f*b,_.y+x[1]*f*b,_.z+x[2]*f*b),Bs(p,p,o),Bs(m,m,o),t.push(new gh(p[0],p[1],p[2])),y.push(new gh(m[0],m[1],m[2]))}h.push(t),d.push(y)}return[h,d]}(e,t,n,r,i,o,a,s,l,c,u):a?function(e,t,n,r,i,o,a,s,l){const c=[],u=[],h=[0,0,0,1];for(const d of e){const e=[],f=[];for(const c of d){const u=c.x+r.x,d=c.y+r.y,p=_h(u,d,t,n,o,a,s,l);h[0]=u,h[1]=d,h[2]=p.base,h[3]=1,$s(h,h,i),h[3]=Math.max(h[3],1e-5);const m=new gh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);h[0]=u,h[1]=d,h[2]=p.top,h[3]=1,$s(h,h,i),h[3]=Math.max(h[3],1e-5);const g=new gh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);e.push(m),f.push(g)}c.push(e),u.push(f)}return[c,u]}(t,n,r,i,o,a,s,l,c):function(e,t,n,r,i){const o=[],a=[],s=i[8]*t,l=i[9]*t,c=i[10]*t,u=i[11]*t,h=i[8]*n,d=i[9]*n,f=i[10]*n,p=i[11]*n;for(const t of e){const e=[],n=[];for(const o of t){const t=o.x+r.x,a=o.y+r.y,m=i[0]*t+i[4]*a+i[12],g=i[1]*t+i[5]*a+i[13],v=i[2]*t+i[6]*a+i[14],y=i[3]*t+i[7]*a+i[15],_=m+s,x=g+l,w=v+c,b=Math.max(y+u,1e-5),E=m+h,k=g+d,T=v+f,M=Math.max(y+p,1e-5);e.push(new gh(_/b,x/b,w/b)),n.push(new gh(E/M,k/M,T/M))}o.push(e),a.push(n)}return[o,a]}(t,n,r,i,o)}(o,r,h,u,c,a,g,d,p,o.center.lat,e.tileID.canonical),x=e.queryGeometry;return function(e,t,n){let r=1/0;fc(n,t)&&(r=yh(n,t[0]));for(let i=0;i<t.length;i++){const o=t[i],a=e[i];for(let e=0;e<o.length-1;e++){const t=o[e],i=[t,o[e+1],a[e+1],a[e],t];hc(n,i)&&(r=Math.min(r,yh(n,i)))}}return r!==1/0&&r}(v,_,x.isPointQuery()?x.screenBounds:x.screenGeometry)}},line:class extends rs{constructor(e){super(e,Ch),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Rn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Ah.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Mh(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(e){return new Xa(this,e)}queryRadius(e){const t=e,n=Ih(Ec("line-width",this,t),Ec("line-gap-width",this,t)),r=Ec("line-offset",this,t);return n/2+Math.abs(r)+kc(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,n,r,i,o){if(e.queryGeometry.isAboveHorizon)return!1;const a=Tc(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),s=e.pixelToTileUnitsFactor/2*Ih(this.paint.get("line-width").evaluate(t,n),this.paint.get("line-gap-width").evaluate(t,n)),l=this.paint.get("line-offset").evaluate(t,n);return l&&(r=function(e,t){const n=[],r=new y(0,0);for(let i=0;i<e.length;i++){const o=e[i],a=[];for(let e=0;e<o.length;e++){const n=o[e],i=o[e+1],s=0===e?r:n.sub(o[e-1])._unit()._perp(),l=e===o.length-1?r:i.sub(n)._unit()._perp(),c=s._add(l)._unit();c._mult(1/(c.x*l.x+c.y*l.y)),a.push(c._mult(t)._add(n))}n.push(a)}return n}(r,l*e.pixelToTileUnitsFactor)),function(e,t,n){for(let r=0;r<t.length;r++){const i=t[r];if(e.length>=3)for(let t=0;t<i.length;t++)if(xc(e,i[t]))return!0;if(pc(e,i,n))return!0}return!1}(a,r,s)}isTileClipped(){return!0}},symbol:hp,background:class extends rs{constructor(e){super(e,dp)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends rs{constructor(e){super(e,fp)}getProgramIds(){return["raster"]}},sky:class extends rs{constructor(e){super(e,mp),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=Vc({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const n=this.paint.get("sky-atmosphere-sun"),r=!n,i=e.style.light,o=i.properties.get("position");return r&&"viewport"===i.properties.get("anchor")&&W("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),r?gp(o.azimuthal,90-o.polar,t):gp(n[0],90-n[1],t)}const n=this.paint.get("sky-gradient-center");return gp(n[0],90-n[1],t)}is3D(){return!1}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}}};class yp{constructor(e,t,n,r){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(t,r)}update(e,n,r){const{width:i,height:o}=e,{context:a}=this,{gl:s}=a,{HTMLImageElement:l,HTMLCanvasElement:c,HTMLVideoElement:u,ImageData:h,ImageBitmap:d}=t;if(s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!n||!1!==n.premultiply)),r||this.size&&this.size[0]===i&&this.size[1]===o){const{x:t,y:n}=r||{x:0,y:0};e instanceof l||e instanceof c||e instanceof u||e instanceof h||d&&e instanceof d?s.texSubImage2D(s.TEXTURE_2D,0,t,n,s.RGBA,s.UNSIGNED_BYTE,e):s.texSubImage2D(s.TEXTURE_2D,0,t,n,i,o,s.RGBA,s.UNSIGNED_BYTE,e.data)}else this.size=[i,o],e instanceof l||e instanceof c||e instanceof u||e instanceof h||d&&e instanceof d?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,e):s.texImage2D(s.TEXTURE_2D,0,this.format,i,o,0,this.format,s.UNSIGNED_BYTE,e.data);this.useMipmap=Boolean(n&&n.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,t){const{context:n}=this,{gl:r}=n;r.bindTexture(r.TEXTURE_2D,this.texture),e!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.useMipmap?e===r.NEAREST?r.NEAREST_MIPMAP_NEAREST:r.LINEAR_MIPMAP_NEAREST:e),this.filter=e),t!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class _p{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class xp{constructor(){this.tasks={},this.taskQueue=[],F(["process"],this),this.invoker=new _p(this.process),this.nextId=0}add(e,t){const n=this.nextId++,r=function({type:e,isSymbolTile:t,zoom:n}){return n=n||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-n:"maybePrepare"===e&&t?400-n:500:200-n:100-n}(t);if(0===r){q();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[n]={fn:e,metadata:t,priority:r,id:n},this.taskQueue.push(n),this.invoker.trigger(),{cancel:()=>{delete this.tasks[n]}}}process(){q();try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let n=0;n<this.taskQueue.length;n++){const r=this.tasks[this.taskQueue[n]];r.priority<t&&(t=r.priority,e=n)}if(null===e)return null;const n=this.taskQueue[e];return this.taskQueue.splice(e,1),n}remove(){this.invoker.remove()}}class wp{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const n=e[t];this._stringToNumber[n]=t,this._numberToString[t]=n}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const bp=["tile","layer","source","sourceLayer","state"];class Ep{constructor(e,t,n,r,i){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=n,this._y=r,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};void 0!==this.id&&(e.id=this.id);for(const t of bp)void 0!==this[t]&&(e[t]=this[t]);return e}}const kp=32,Tp=33,Mp=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,n=0,r=0,i=0,o=0,a=0,s=0;for(1&t?i=o=a=kp:n=r=s=kp;(t>>=1)>1;){const e=n+i>>1,l=r+o>>1;1&t?(i=n,o=r,n=a,r=s):(n=i,r=o,i=a,o=s),a=e,s=l}const l=4*e;Mp[l+0]=n,Mp[l+1]=r,Mp[l+2]=i,Mp[l+3]=o}const Sp=new Uint16Array(2178),Cp=new Uint8Array(1089),Ap=new Uint16Array(1089);function Ip(e){return 0===e?-.03125:32===e?.03125:0}var Rp=jo([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Lp={type:2,extent:ss,loadGeometry:()=>[[new y(0,0),new y(ss+1,0),new y(ss+1,ss+1),new y(0,ss+1),new y(0,0)]]};class zp{constructor(e,t,n,r,i){this.tileID=e,this.uid=P(),this.uses=0,this.tileSize=t,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=i,this.expiredRequestCount=0,this.state="loading",r&&r.transform&&(this.projection=r.transform.projection)}registerFadeDuration(e){const t=e+this.timeAdded;t<Ze.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=Rf(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(e,t,n){if(this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){const n={};if(!t)return n;for(const r of e){const e=r.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)n[t.id]=r}}return n}(e.buckets,t.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const t=this.buckets[e];if(t instanceof sp){if(this.hasSymbolBuckets=!0,!n)break;t.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const t=this.buckets[e];if(t instanceof sp&&t.hasRTLText){this.hasRTLText=!0,wo.isLoading()||wo.isLoaded()||"deferred"!==_o()||xo();break}}this.queryPadding=0;for(const e in this.buckets){const n=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(e).queryRadius(n))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new fa}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const t in this.buckets){const n=this.buckets[t];n.uploadPending()&&n.upload(e)}const t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new yp(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new yp(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new yp(e,this.lineAtlas.image,t.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,n,r,i,o,a,s){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:r,pixelPosMatrix:a,transform:o,params:i,tileTransform:this.tileTransform},e,t,n):{}}querySourceFeatures(e,t){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const r=n.loadVTLayers(),i=t?t.sourceLayer:"",o=r._geojsonTileLayer||r[i];if(!o)return;const a=hi(t&&t.filter),{z:s,x:l,y:c}=this.tileID.canonical,u={z:s,x:l,y:c};for(let t=0;t<o.length;t++){const r=o.feature(t);if(a.needGeometry){const e=sc(r,!0);if(!a.filter(new bo(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!a.filter(new bo(this.tileID.overscaledZ),r))continue;const h=n.getId(r,i),d=new Ep(r,s,l,c,h);d.tile=u,e.push(d)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const t=this.expirationTime;if(e.cacheControl){const t=Z(e.cacheControl);t["max-age"]&&(this.expirationTime=Date.now()+1e3*t["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const e=Date.now();let n=!1;if(this.expirationTime>e)n=!1;else if(t)if(this.expirationTime<t)n=!0;else{const r=this.expirationTime-t;r?this.expirationTime=e+Math.max(r,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length||!t)return;const n=this.latestFeatureIndex.loadVTLayers(),r=t.style.listImages();for(const i in this.buckets){if(!t.style.hasLayer(i))continue;const o=this.buckets[i],a=o.layers[0].sourceLayer||"_geojsonTileLayer",s=n[a],l=e[a];if(!s||!l||0===Object.keys(l).length)continue;if(o.update(l,s,r,this.imageAtlas&&this.imageAtlas.patternPositions||{}),o instanceof Mh||o instanceof Su){const e=t.style._getSourceCache(o.layers[0].source);t._terrain&&t._terrain.enabled&&e&&o.programConfigurations.needsUpload&&t._terrain._clearRenderCacheForTile(e.id,this.tileID)}const c=t&&t.style&&t.style.getLayer(i);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(o)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Ze.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=Ze.now()+e}setTexture(e,t){const n=t.context,r=n.gl;this.texture=this.texture||t.getTileTexture(e.width),this.texture?this.texture.update(e,{useMipmap:!0}):(this.texture=new yp(n,e,r.RGBA,{useMipmap:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE))}setDependencies(e,t){const n={};for(const e of t)n[e]=!0;this.dependencies[e]=n}hasDependency(e,t){for(const n of e){const e=this.dependencies[n];if(e)for(const n of t)if(e[n])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(e,t){if(!t||"mercator"===t.name||this._tileDebugBuffer)return;const n=ac(Lp,this.tileID.canonical,this.tileTransform)[0],r=new Vo,i=new ua;for(let e=0;e<n.length;e++){const{x:t,y:o}=n[e];r.emplaceBack(t,o),i.emplaceBack(e)}i.emplaceBack(0),this._tileDebugIndexBuffer=e.createIndexBuffer(i),this._tileDebugBuffer=e.createVertexBuffer(r,el.members),this._tileDebugSegments=as.simpleSegment(0,0,r.length,i.length)}_makeTileBoundsBuffers(e,t){if(this._tileBoundsBuffer||!t||"mercator"===t.name)return;const n=ac(Lp,this.tileID.canonical,this.tileTransform)[0];let r,i;if(this.isRaster){const e=function(e,t){const n=Rf(e,t),r=Math.pow(2,e.z);for(let i=0;i<Tp;i++)for(let o=0;o<Tp;o++){const a=ql((e.x+(o+Ip(o))/kp)/r),s=Zl((e.y+(i+Ip(i))/kp)/r),l=t.project(a,s),c=i*Tp+o;Sp[2*c+0]=Math.round((l.x*n.scale-n.x)*ss),Sp[2*c+1]=Math.round((l.y*n.scale-n.y)*ss)}Cp.fill(0),Ap.fill(0);for(let e=2045;e>=0;e--){const t=4*e,n=Mp[t+0],r=Mp[t+1],i=Mp[t+2],o=Mp[t+3],a=n+i>>1,s=r+o>>1,l=a+s-r,c=s+n-a,u=r*Tp+n,h=o*Tp+i,d=s*Tp+a,f=Math.hypot((Sp[2*u+0]+Sp[2*h+0])/2-Sp[2*d+0],(Sp[2*u+1]+Sp[2*h+1])/2-Sp[2*d+1])>=16;Cp[d]=Cp[d]||(f?1:0),e<1022&&(Cp[d]=Cp[d]||Cp[(r+c>>1)*Tp+(n+l>>1)]||Cp[(o+c>>1)*Tp+(i+l>>1)])}const i=new Ho,o=new ra;let a=0;function s(e,t){const n=t*Tp+e;return 0===Ap[n]&&(i.emplaceBack(Sp[2*n+0],Sp[2*n+1],e*ss/kp,t*ss/kp),Ap[n]=++a),Ap[n]-1}function l(e,t,n,r,i,a){const c=e+n>>1,u=t+r>>1;if(Math.abs(e-i)+Math.abs(t-a)>1&&Cp[u*Tp+c])l(i,a,e,t,c,u),l(n,r,i,a,c,u);else{const l=s(e,t),c=s(n,r),u=s(i,a);o.emplaceBack(l,c,u)}}return l(0,0,kp,kp,kp,0),l(kp,kp,0,0,0,kp),{vertices:i,indices:o}}(this.tileID.canonical,t);r=e.vertices,i=e.indices}else{r=new Ho,i=new ra;for(const{x:e,y:t}of n)r.emplaceBack(e,t,0,0);const e=yu(r.int16,void 0,4);for(let t=0;t<e.length;t+=3)i.emplaceBack(e[t],e[t+1],e[t+2])}this._tileBoundsBuffer=e.createVertexBuffer(r,Rp.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(i),this._tileBoundsSegments=as.simpleSegment(0,0,r.length,i.length)}_makeGlobeTileDebugBuffers(e,t){const n=t.projection;if(!n||"globe"!==n.name||t.freezeTileCoverage)return;const r=this.tileID.canonical,i=Il(xl(r,t)),o=zl(t.zoom);let a;o>0&&(a=ps(new Float64Array(16),t.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,r,t,i,a,o),this._makeGlobeTileDebugTextBuffer(e,r,t,i,a,o)}_globePoint(e,t,n,r,i,o,a){let s=Sl(e,t,n);if(o){const i=1<<n.z,l=Wl(r.center.lng),c=$l(r.center.lat),u=(n.x+.5)/i-l;let h=0;u>.5?h=-1:u<-.5&&(h=1);let d=(e/ss+n.x)/i+h,f=(t/ss+n.y)/i;d=(d-l)*r._pixelsPerMercatorPixel+l,f=(f-c)*r._pixelsPerMercatorPixel+c;const p=[d*r.worldSize,f*r.worldSize,0];Bs(p,p,o),s=_l(s,p,a)}return Bs(s,s,i)}_makeGlobeTileDebugBorderBuffer(e,t,n,r,i,o){const a=new Vo,s=new ua,l=new Uo,c=(e,c,u,h,d)=>{const f=(u-e)/(d-1),p=(h-c)/(d-1),m=a.length;for(let u=0;u<d;u++){const h=e+u*f,d=c+u*p;a.emplaceBack(h,d);const g=this._globePoint(h,d,t,n,r,i,o);l.emplaceBack(g[0],g[1],g[2]),s.emplaceBack(m+u)}},u=ss;c(0,0,u,0,16),c(u,0,u,u,16),c(u,u,0,u,16),c(0,u,0,0,16),this._tileDebugIndexBuffer=e.createIndexBuffer(s),this._tileDebugBuffer=e.createVertexBuffer(a,el.members),this._globeTileDebugBorderBuffer=e.createVertexBuffer(l,Qs.members),this._tileDebugSegments=as.simpleSegment(0,0,a.length,s.length)}_makeGlobeTileDebugTextBuffer(e,t,n,r,i,o){const a=ss/4,s=new Vo,l=new ra,c=new Uo,u=25;l.reserve(32),s.reserve(u),c.reserve(u);const h=(e,t)=>u*e+t;for(let e=0;e<u;e++){const l=e*a;for(let e=0;e<u;e++){const u=e*a;s.emplaceBack(u,l);const h=this._globePoint(u,l,t,n,r,i,o);c.emplaceBack(h[0],h[1],h[2])}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const n=h(e,t),r=h(e,t+1),i=h(e+1,t),o=h(e+1,t+1);l.emplaceBack(n,r,i),l.emplaceBack(i,r,o)}this._tileDebugTextIndexBuffer=e.createIndexBuffer(l),this._tileDebugTextBuffer=e.createVertexBuffer(s,el.members),this._globeTileDebugTextBuffer=e.createVertexBuffer(c,Qs.members),this._tileDebugTextSegments=as.simpleSegment(0,0,u,32)}}class Pp{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,t,n){const r=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][r]=this.stateChanges[e][r]||{},L(this.stateChanges[e][r],n),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==r&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][r]){this.deletedStates[e][r]={};for(const t in this.state[e][r])n[t]||(this.deletedStates[e][r][t]=null)}else for(const t in n)this.deletedStates[e]&&this.deletedStates[e][r]&&null===this.deletedStates[e][r][t]&&delete this.deletedStates[e][r][t]}removeFeatureState(e,t,n){if(null===this.deletedStates[e])return;const r=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&void 0!==t)null!==this.deletedStates[e][r]&&(this.deletedStates[e][r]=this.deletedStates[e][r]||{},this.deletedStates[e][r][n]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][r])for(n in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][n]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}getState(e,t){const n=String(t),r=L({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const n=this.deletedStates[e][t];if(null===n)return{};for(const e in n)delete r[e]}return r}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,t){const n={};for(const e in this.stateChanges){this.state[e]=this.state[e]||{};const t={};for(const n in this.stateChanges[e])this.state[e][n]||(this.state[e][n]={}),L(this.state[e][n],this.stateChanges[e][n]),t[n]=this.state[e][n];n[e]=t}for(const e in this.deletedStates){this.state[e]=this.state[e]||{};const t={};if(null===this.deletedStates[e])for(const n in this.state[e])t[n]={},this.state[e][n]={};else for(const n in this.deletedStates[e]){if(null===this.deletedStates[e][n])this.state[e][n]={};else if(this.state[e][n])for(const t of Object.keys(this.deletedStates[e][n]))delete this.state[e][n][t];t[n]=this.state[e][n]}n[e]=n[e]||{},L(n[e],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const r in e)e[r].setFeatureState(n,t)}}class Op{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const n=this.toIdx(e,t);return{min:this.minimums[n],max:this.maximums[n]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function Dp(e,t,n,r){let i=0,o=Number.MAX_VALUE;for(let a=0;a<3;a++)if(Math.abs(r[a])<1e-15){if(n[a]<e[a]||n[a]>t[a])return null}else{const s=1/r[a];let l=(e[a]-n[a])*s,c=(t[a]-n[a])*s;if(l>c){const e=l;l=c,c=e}if(l>i&&(i=l),c<o&&(o=c),i>o)return null}return i}function Bp(e,t,n,r,i,o,a,s,l,c,u){const h=r-e,d=i-t,f=o-n,p=a-e,m=s-t,g=l-n,v=u[1]*g-u[2]*m,y=u[2]*p-u[0]*g,_=u[0]*m-u[1]*p,x=h*v+d*y+f*_;if(Math.abs(x)<1e-15)return null;const w=1/x,b=c[0]-e,E=c[1]-t,k=c[2]-n,T=(b*v+E*y+k*_)*w;if(T<0||T>1)return null;const M=E*f-k*d,S=k*h-b*f,C=b*d-E*h,A=(u[0]*M+u[1]*S+u[2]*C)*w;return A<0||T+A>1?null:(p*M+m*S+g*C)*w}function Fp(e,t,n){return(e-t)/(n-t)}function jp(e,t,n,r,i,o,a,s,l){const c=1<<n,u=o-r,h=a-i,d=(e+1)/c*u+r,f=(t+0)/c*h+i,p=(t+1)/c*h+i;s[0]=(e+0)/c*u+r,s[1]=f,l[0]=d,l[1]=p}class Np{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),n=[];let r=Math.ceil(Math.pow(2,t));const i=1/r,o=(e,t,n,r,i)=>{const o=r?1:0,a=(e+1)*n-o,s=t*n,l=(t+1)*n-o;i[0]=e*n,i[1]=s,i[2]=a,i[3]=l};let a=new Op(r);const s=[];for(let t=0;t<r*r;t++){o(t%r,Math.floor(t/r),i,!1,s);const n=Up(s[0],s[1],e),l=Up(s[2],s[1],e),c=Up(s[2],s[3],e),u=Up(s[0],s[3],e);a.minimums.push(Math.min(n,l,c,u)),a.maximums.push(Math.max(n,l,c,u)),a.leaves.push(1)}for(n.push(a),r/=2;r>=1;r/=2){const e=n[n.length-1];a=new Op(r);for(let t=0;t<r*r;t++){o(t%r,Math.floor(t/r),2,!0,s);const n=e.getElevation(s[0],s[1]),i=e.getElevation(s[2],s[1]),l=e.getElevation(s[2],s[3]),c=e.getElevation(s[0],s[3]),u=e.isLeaf(s[0],s[1]),h=e.isLeaf(s[2],s[1]),d=e.isLeaf(s[2],s[3]),f=e.isLeaf(s[0],s[3]),p=Math.min(n.min,i.min,l.min,c.min),m=Math.max(n.max,i.max,l.max,c.max),g=u&&h&&d&&f;a.maximums.push(m),a.minimums.push(p),a.leaves.push(m-p<=5&&g?1:0)}n.push(a)}return n}(this.dem),n=t.length-1,r=t[n];this._addNode(r.minimums[0],r.maximums[0],r.leaves[0]),this._construct(t,0,0,n,0)}raycastRoot(e,t,n,r,i,o,a=1){return Dp([e,t,-100],[n,r,this.maximums[0]*a],i,o)}raycast(e,t,n,r,i,o,a=1){if(!this.nodeCount)return null;const s=this.raycastRoot(e,t,n,r,i,o,a);if(null==s)return null;const l=[],c=[],u=[],h=[],d=[{idx:0,t:s,nodex:0,nodey:0,depth:0}];for(;d.length>0;){const{idx:s,t:f,nodex:p,nodey:m,depth:g}=d.pop();if(this.leaves[s]){jp(p,m,g,e,t,n,r,u,h);const s=1<<g,l=(p+0)/s,c=(p+1)/s,d=(m+0)/s,v=(m+1)/s,y=Up(l,d,this.dem)*a,_=Up(c,d,this.dem)*a,x=Up(c,v,this.dem)*a,w=Up(l,v,this.dem)*a,b=Bp(u[0],u[1],y,h[0],u[1],_,h[0],h[1],x,i,o),E=Bp(h[0],h[1],x,u[0],h[1],w,u[0],u[1],y,i,o),k=Math.min(null!==b?b:Number.MAX_VALUE,null!==E?E:Number.MAX_VALUE);if(k!==Number.MAX_VALUE)return k;{const e=zs([],i,o,f);if(Vp(y,_,w,x,Fp(e[0],u[0],h[0]),Fp(e[1],u[1],h[1]))>=e[2])return f}continue}let v=0;for(let d=0;d<this._siblingOffset.length;d++){jp((p<<1)+this._siblingOffset[d][0],(m<<1)+this._siblingOffset[d][1],g+1,e,t,n,r,u,h),u[2]=-100,h[2]=this.maximums[this.childOffsets[s]+d]*a;const f=Dp(u,h,i,o);if(null!=f){const e=f;l[d]=e;let t=!1;for(let n=0;n<v&&!t;n++)e>=l[c[n]]&&(c.splice(n,0,d),t=!0);t||(c[v]=d),v++}}for(let e=0;e<v;e++){const t=c[e];d.push({idx:this.childOffsets[s]+t,t:l[t],nodex:(p<<1)+this._siblingOffset[t][0],nodey:(m<<1)+this._siblingOffset[t][1],depth:g+1})}}return null}_addNode(e,t,n){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(n),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,n,r,i){if(1===e[r].isLeaf(t,n))return;this.childOffsets[i]||(this.childOffsets[i]=this.nodeCount);const o=r-1,a=e[o];let s=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const r=2*t+this._siblingOffset[e][0],i=2*n+this._siblingOffset[e][1],o=a.getElevation(r,i),c=a.isLeaf(r,i),u=this._addNode(o.min,o.max,c);c&&(s|=1<<e),l||(l=u)}for(let r=0;r<this._siblingOffset.length;r++)s&1<<r||this._construct(e,2*t+this._siblingOffset[r][0],2*n+this._siblingOffset[r][1],o,l+r)}}function Vp(e,t,n,r,i,o){return Ln(Ln(e,n,o),Ln(t,r,o),i)}function Up(e,t,n){const r=n.dim,i=S(e*r-.5,0,r-1),o=S(t*r-.5,0,r-1),a=Math.floor(i),s=Math.floor(o),l=Math.min(a+1,r-1),c=Math.min(s+1,r-1);return Vp(n.get(a,s),n.get(l,s),n.get(a,c),n.get(l,c),i-a,o-s)}const Hp={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function Wp(e,t,n){return(256*e*256+256*t+n)/10-1e4}function $p(e,t,n){return 256*e+t+n/256-32768}class Gp{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,n,r=!1,i=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return W(`"${n}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const o=this.dim=t.height-2,a=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.encoding=n||"mapbox",this.borderReady=r,!r){for(let e=0;e<o;e++)a[this._idx(-1,e)]=a[this._idx(0,e)],a[this._idx(o,e)]=a[this._idx(o-1,e)],a[this._idx(e,-1)]=a[this._idx(e,0)],a[this._idx(e,o)]=a[this._idx(e,o-1)];a[this._idx(-1,-1)]=a[this._idx(0,0)],a[this._idx(o,-1)]=a[this._idx(o-1,0)],a[this._idx(-1,o)]=a[this._idx(0,o-1)],a[this._idx(o,o)]=a[this._idx(o-1,o-1)],i&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new Np(this)}get(e,t,n=!1){n&&(e=S(e,-1,this.dim),t=S(t,-1,this.dim));const r=4*this._idx(e,t);return("terrarium"===this.encoding?$p:Wp)(this.pixels[r],this.pixels[r+1],this.pixels[r+2])}static getUnpackVector(e){return Hp[e]}get unpackVector(){return Hp[this.encoding]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const n=[0,0,0,0],r=Gp.getUnpackVector(t);let i=Math.floor((e+r[3])/r[2]);return n[2]=i%256,i=Math.floor(i/256),n[1]=i%256,i=Math.floor(i/256),n[0]=i,n}getPixels(){return new jc({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let r=t*this.dim,i=t*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}const s=-t*this.dim,l=-n*this.dim;for(let t=o;t<a;t++)for(let n=r;n<i;n++){const r=4*this._idx(n,t),i=4*this._idx(n+s,t+l);this.pixels[r+0]=e.pixels[i+0],this.pixels[r+1]=e.pixels[i+1],this.pixels[r+2]=e.pixels[i+2],this.pixels[r+3]=e.pixels[i+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Xi(Gp,"DEMData"),Xi(Np,"DemMinMaxQuadTree",{omit:["dem"]});class qp{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,n){const r=e.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const i={value:t,timeout:void 0};if(void 0!==n&&(i.timeout=setTimeout((()=>{this.remove(e,i)}),n)),this.data[r].push(i),this.order.push(r),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const n=e.wrapped().key,r=void 0===t?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const n in this.data)for(const r of this.data[n])e(r.value)||t.push(r);for(const e of t)this.remove(e.value.tileID,e)}}class Zp{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}}Zp.ReadOnly=!1,Zp.ReadWrite=!0,Zp.disabled=new Zp(519,Zp.ReadOnly,[0,1]);const Xp=7680;class Yp{constructor(e,t,n,r,i,o){this.test=e,this.ref=t,this.mask=n,this.fail=r,this.depthFail=i,this.pass=o}}Yp.disabled=new Yp({func:519,mask:0},0,0,Xp,Xp,Xp);class Kp{constructor(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n}}Kp.Replace=[1,0],Kp.disabled=new Kp(Kp.Replace,Rt.transparent,[!1,!1,!1,!1]),Kp.unblended=new Kp(Kp.Replace,Rt.transparent,[!0,!0,!0,!0]),Kp.alphaBlended=new Kp([1,771],Rt.transparent,[!0,!0,!0,!0]);const Jp=1029,Qp=2305;class em{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}}em.disabled=new em(!1,Jp,Qp),em.backCCW=new em(!0,Jp,Qp),em.backCW=new em(!0,Jp,2304),em.frontCW=new em(!0,1028,2304),em.frontCCW=new em(!0,1028,Qp);class tm extends Qe{constructor(e,t,n){super(),this.id=e,this._onlySymbols=n,t.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),t.on("error",(()=>{this._sourceErrored=!0})),this._source=t,this._tiles={},this._cache=new qp(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new Pp,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,(()=>{}))}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,(()=>{}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const n=this._tiles[t];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return R(this._tiles).map((e=>e.tileID)).sort(nm).map((e=>e.key))}getRenderableIds(e){const t=[];for(const n in this._tiles)this._isIdRenderable(+n,e)&&t.push(this._tiles[n]);return e?t.sort(((e,t)=>{const n=e.tileID,r=t.tileID,i=new y(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new y(r.canonical.x,r.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-r.overscaledZ||o.y-i.y||o.x-i.x})).map((e=>e.tileID.key)):t.map((e=>e.tileID)).sort(nm).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const n=this._tiles[e];n&&("loading"!==n.state&&(n.state=t),this._loadTile(n,this._tileLoaded.bind(this,n,e,t)))}_tileLoaded(e,t,n,r){if(r)if(e.state="errored",404!==r.status)this._source.fire(new Je(r,{tile:e}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=Ze.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),"raster-dem"===this._source.type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new Ke("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const t=this.getRenderableIds();for(let r=0;r<t.length;r++){const i=t[r];if(e.neighboringTiles&&e.neighboringTiles[i]){const t=this.getTileByID(i);n(e,t),n(t,e)}}function n(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let n=t.tileID.canonical.x-e.tileID.canonical.x;const r=t.tileID.canonical.y-e.tileID.canonical.y,i=Math.pow(2,e.tileID.canonical.z),o=t.tileID.key;0===n&&0===r||Math.abs(r)>1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,n,r),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,n,r){for(const i in this._tiles){let o=this._tiles[i];if(r[i]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>n)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(a=e)}let s=a;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){r[a.key]=a;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=t?n:null}for(let n=e.overscaledZ-1;n>=t;n--){const t=e.scaledTo(n),r=this._getLoadedTile(t);if(r)return r}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const n=Math.ceil(e.width/t)+1,r=Math.ceil(e.height/t)+1,i=Math.floor(n*r*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,i):i,a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(a)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const n in this._tiles){const r=this._tiles[n];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),e[r.tileID.key]=r}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(e,t,n){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!n)return;let r;this.updateCacheSize(e,t),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new ph(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(r=e.coveringTiles({tileSize:t||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(r=r.filter((e=>this._source.hasTile(e))))):r=[];const i=this._updateRetainedTiles(r);if(rm(this._source.type)&&0!==r.length){const e={},t={},n=Object.keys(i);for(const r of n){const n=i[r],o=this._tiles[r];if(!o||o.fadeEndTime&&o.fadeEndTime<=Ze.now())continue;const a=this.findLoadedParent(n,Math.max(n.overscaledZ-tm.maxOverzooming,this._source.minzoom));a&&(this._addTile(a.tileID),e[a.tileID.key]=a.tileID),t[r]=n}const o=r[r.length-1].overscaledZ;for(const e in this._tiles){const n=this._tiles[e];if(i[e]||!n.hasData())continue;let r=n.tileID;for(;r.overscaledZ>o;){r=r.scaledTo(r.overscaledZ-1);const o=this._tiles[r.key];if(o&&o.hasData()&&t[r.key]){i[e]=n.tileID;break}}}for(const t in e)i[t]||(this._coveredTiles[t]=!0,i[t]=e[t])}for(const e in i)this._tiles[e].clearFadeHold();const o=function(e,t){const n=[];for(const r in e)r in t||n.push(r);return n}(this._tiles,i);for(const e of o){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const n={},r=e.reduce(((e,t)=>Math.min(e,t.overscaledZ)),1/0),i=e[0].overscaledZ,o=Math.max(i-tm.maxOverzooming,this._source.minzoom),a=Math.max(i+tm.maxUnderzooming,this._source.minzoom),s={};for(const n of e){const e=this._addTile(n);t[n.key]=n,e.hasData()||r<this._source.maxzoom&&(s[n.key]=n)}this._retainLoadedChildren(s,r,a,t);for(const r of e){let e=this._tiles[r.key];if(e.hasData())continue;if(r.canonical.z>=this._source.maxzoom){const e=r.children(this._source.maxzoom)[0],n=this.getTile(e);if(n&&n.hasData()){t[e.key]=e;continue}}else{const e=r.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let i=e.wasRequested();for(let a=r.overscaledZ-1;a>=o;--a){const o=r.scaledTo(a);if(n[o.key])break;if(n[o.key]=!0,e=this.getTile(o),!e&&i&&(e=this._addTile(o)),e&&(t[o.key]=o,i=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let n,r=this._tiles[e].tileID;for(;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}t.push(r.key);const e=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(e),n)break;r=e}for(const e of t)this._loadedParentTiles[e]=n}}_addTile(e){let t=this._tiles[e.key];if(t)return t;t=this._cache.getAndRemove(e),t&&(this._setTileReloadTimer(e.key,t),t.tileID=e,this._state.initializeTileState(t,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,t)));const n=Boolean(t);if(!n){const n=this.map?this.map.painter:null;t=new zp(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,n,this._isRaster),this._loadTile(t,this._tileLoaded.bind(this,t,e.key,t.state))}return t?(t.uses++,this._tiles[e.key]=t,n||this._source.fire(new Ke("dataloading",{tile:t,coord:t.tileID,dataType:"source"})),t):null}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),n))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,t,n){const r=[],i=this.transform;if(!i)return r;const o="globe"===i.projection.name,a=Wl(i.center.lng);for(const s in this._tiles){const l=this._tiles[s];if(n&&l.clearQueryDebugViz(),l.holdingForFade())continue;let c;if(o){const e=l.tileID.canonical;if(0===e.z){const t=[Math.abs(S(a,...im(e,-1))-a),Math.abs(S(a,...im(e,1))-a)];c=[0,2*t.indexOf(Math.min(...t))-1]}else{const t=[Math.abs(S(a,...im(e,-1))-a),Math.abs(S(a,...im(e,0))-a),Math.abs(S(a,...im(e,1))-a)];c=[t.indexOf(Math.min(...t))-1]}}else c=[0];for(const n of c){const o=e.containsTile(l,i,t,n);o&&r.push(o)}}return r}getVisibleCoordinates(e){const t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const e of t)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(rm(this._source.type))for(const e in this._tiles){const t=this._tiles[e];if(void 0!==t.fadeEndTime&&t.fadeEndTime>=Ze.now())return!0}return!1}setFeatureState(e,t,n){this._state.updateState(e=e||"_geojsonTileLayer",t,n)}removeFeatureState(e,t,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,n)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,n){const r=this._tiles[e];r&&r.setDependencies(t,n)}reloadTilesForDependencies(e,t){for(const n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(+n,"reloading");this._cache.filter((n=>!n.hasDependency(e,t)))}_preloadTiles(e,t){if(!this._sourceLoaded){const n=()=>{this._sourceLoaded&&(this._source.off("data",n),this._preloadTiles(e,t))};return void this._source.on("data",n)}const n=new Map,r=Array.isArray(e)?e:[e],i=this.map.painter.terrain,o=this.usedForTerrain&&i?i.getScaledDemTileSize():this._source.tileSize;for(const e of r){const t=e.coveringTiles({tileSize:o,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)n.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}I(Array.from(n.values()),((e,t)=>{const n=new zp(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(n,(e=>{"raster-dem"===this._source.type&&n.dem&&this._backfillDEM(n),t(e,n)}))}),t)}}function nm(e,t){const n=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function rm(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function im(e,t){const n=1<<e.z;return[e.x/n+t,(e.x+1)/n+t]}tm.maxOverzooming=10,tm.maxUnderzooming=3;class om{constructor(e,t,n){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=n}static create(e,t,n){const r=n||e.findDEMTileFor(t);if(!r||!r.dem)return;const i=r.dem,o=r.tileID,a=1<<t.canonical.z-o.canonical.z;return new om(r,r.tileSize/ss/a,[(t.canonical.x/a-o.canonical.x)*i.dim,(t.canonical.y/a-o.canonical.y)*i.dim])}tileCoordToPixel(e,t){const n=t*this._scale+this._offset[1],r=Math.floor(e*this._scale+this._offset[0]),i=Math.floor(n);return new y(r,i)}getElevationAt(e,t,n,r){const i=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],a=Math.floor(i),s=Math.floor(o),l=this._dem;return r=!!r,n?Ln(Ln(l.get(a,s,r),l.get(a,s+1,r),o-s),Ln(l.get(a+1,s,r),l.get(a+1,s+1,r),o-s),i-a):l.get(a,s,r)}getElevationAtPixel(e,t,n){return this._dem.get(e,t,!!n)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Gl(1,e)*this._dem.stride}}class am{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new qi(ss,16,0),this.featureIndexArray=new wa,this.promoteId=t}insert(e,t,n,r,i,o=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i,o);const s=this.grid;for(let e=0;e<t.length;e++){const n=t[e],r=[1/0,1/0,-1/0,-1/0];for(let e=0;e<n.length;e++){const t=n[e];r[0]=Math.min(r[0],t.x),r[1]=Math.min(r[1],t.y),r[2]=Math.max(r[2],t.x),r[3]=Math.max(r[3],t.y)}r[0]<ss&&r[1]<ss&&r[2]>=0&&r[3]>=0&&s.insert(a,r[0],r[1],r[2],r[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Gu(new gd(this.rawTileData)).layers,this.sourceLayerCoder=new wp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t,n,r){this.loadVTLayers();const i=e.params||{},o=hi(i.filter),a=e.tileResult,s=e.transform,l=a.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((e,t,n,r)=>wc(a.bufferedTilespaceGeometry,e,t,n,r)));c.sort(lm);let u=null;s.elevation&&c.length>0&&(u=om.create(s.elevation,this.tileID));const h={};let d;for(let s=0;s<c.length;s++){const l=c[s];if(l===d)continue;d=l;const f=this.featureIndexArray.get(l);let p=null;this.loadMatchingFeature(h,f,o,i.layers,i.availableImages,t,n,r,((t,n,r,i=0)=>(p||(p=ac(t,this.tileID.canonical,e.tileTransform)),n.queryIntersectsFeature(a,t,r,p,this.z,e.transform,e.pixelPosMatrix,u,i))))}return h}loadMatchingFeature(e,t,n,r,i,o,a,s,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:d}=t,f=this.bucketLayerIDs[u];if(r&&!function(e,t){for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>=0)return!0;return!1}(r,f))return;const p=this.sourceLayerCoder.decode(h),m=this.vtLayers[p].feature(c);if(n.needGeometry){const e=sc(m,!0);if(!n.filter(new bo(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new bo(this.tileID.overscaledZ),m))return;const g=this.getId(m,p);for(let t=0;t<f.length;t++){const n=f[t];if(r&&r.indexOf(n)<0)continue;const u=o[n];if(!u)continue;let h={};void 0!==g&&s&&(h=s.getState(u.sourceLayer||"_geojsonTileLayer",g));const p=L({},a[n]);p.paint=sm(p.paint,u.paint,m,h,i),p.layout=sm(p.layout,u.layout,m,h,i);const v=!l||l(m,u,h,d);if(!v)continue;const y=new Ep(m,this.z,this.x,this.y,g);y.layer=p;let _=e[n];void 0===_&&(_=e[n]=[]),_.push({featureIndex:c,feature:y,intersectionZ:v})}}lookupSymbolFeatures(e,t,n,r,i,o,a,s){const l={};this.loadVTLayers();const c=hi(i);for(const i of e)this.loadMatchingFeature(l,{bucketIndex:n,sourceLayerIndex:r,featureIndex:i,layoutVertexArrayOffset:0},c,o,a,s,t);return l}loadFeature(e){const{featureIndex:t,sourceLayerIndex:n}=e;this.loadVTLayers();const r=this.sourceLayerCoder.decode(n),i=this.vtFeatures[r];if(i[t])return i[t];const o=this.vtLayers[r].feature(t);return i[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const n of t)if(e===n)return!0;return!1}getId(e,t){let n=e.id;if(this.promoteId){const r="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];null!=r&&(n=e.properties[r]),"boolean"==typeof n&&(n=Number(n))}return n}}function sm(e,t,n,r,i){return N(e,((e,o)=>{const a=t instanceof Io?t.get(o):null;return a&&a.evaluate?a.evaluate(n,r,i):a}))}function lm(e,t){return t-e}Xi(am,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class cm{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new Fc({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const n=this.getKey(e,t);return this.positions[n]}trim(){const e=this.width,t=this.height=D(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,n){const r=[];let i=e.length%2==1?-e[e.length-1]*n:0,o=e[0]*n,a=!0;r.push({left:i,right:o,isDash:a,zeroLength:0===e[0]});let s=e[0];for(let t=1;t<e.length;t++){a=!a;const l=e[t];i=s*n,s+=l,o=s*n,r.push({left:i,right:o,isDash:a,zeroLength:0===l})}return r}addRoundDash(e,t,n){const r=t/2;for(let t=-n;t<=n;t++){const i=this.width*(this.nextRow+n+t);let o=0,a=e[o];for(let s=0;s<this.width;s++){s/a.right>1&&(a=e[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let h;const d=t/n*(r+1);if(a.isDash){const e=r-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=r-Math.sqrt(u*u+d*d);this.image.data[i+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const n=e[t],r=e[t+1];n.zeroLength?e.splice(t,1):r&&r.isDash===n.isDash&&(r.left=n.left,e.splice(t,1))}const n=e[0],r=e[e.length-1];n.isDash===r.isDash&&(n.left=r.left-this.width,r.right=n.right+this.width);const i=this.width*this.nextRow;let o=0,a=e[o];for(let n=0;n<this.width;n++){n/a.right>1&&(a=e[++o]);const r=Math.abs(n-a.left),s=Math.abs(n-a.right),l=Math.min(r,s);this.image.data[i+n]=Math.max(0,Math.min(255,(a.isDash?l:-l)+t+128))}}addDash(e,t){const n=this.getKey(e,t);if(this.positions[n])return this.positions[n];const r="round"===t,i=r?7:0,o=2*i+1;if(this.nextRow+o>this.height)return W("LineAtlas out of space"),null;0===e.length&&e.push(1);let a=0;for(let t=0;t<e.length;t++)e[t]<0&&(W("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),a+=e[t];if(0!==a){const n=this.width/a,o=this.getDashRanges(e,this.width,n);r?this.addRoundDash(o,n,i):this.addRegularDash(o,"square"===t?.5*n:0)}const s=this.nextRow+i;this.nextRow+=o;const l={tl:[s,i],br:[a,0]};return this.positions[n]=l,l}}Xi(cm,"LineAtlas");const um=1*ef;class hm{constructor(e){const t={},n=[];for(const r in e){const i=e[r],o=t[r]={};for(const e in i.glyphs){const t=i.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const r=t.metrics.localGlyph?um:1,a={x:0,y:0,w:t.bitmap.width+2*r,h:t.bitmap.height+2*r};n.push(a),o[e]=a}}const{w:r,h:i}=bd(n),o=new Fc({width:r||1,height:i||1});for(const n in e){const r=e[n];for(const e in r.glyphs){const i=r.glyphs[+e];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=t[n][e],s=i.metrics.localGlyph?um:1;Fc.copy(i.bitmap,o,{x:0,y:0},{x:a.x+s,y:a.y+s},i.bitmap)}}this.image=o,this.positions=t}}Xi(hm,"GlyphAtlas");class dm{constructor(e){this.tileID=new ph(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.enableTerrain=!!e.enableTerrain,this.isSymbolTile=e.isSymbolTile,this.tileTransform=Rf(e.tileID.canonical,e.projection),this.projection=e.projection}parse(e,t,n,r,i){this.status="parsing",this.data=e,this.collisionBoxArray=new fa;const o=new wp(Object.keys(e.layers).sort()),a=new am(this.tileID,this.promoteId);a.bucketLayerIDs=[];const s={},l=new cm(256,256),c={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:n},u=t.familiesBySource[this.source];for(const t in u){const r=e.layers[t];if(!r)continue;let i=!1,l=!1;for(const e of u[t])"symbol"===e[0].type?i=!0:l=!0;if(!0===this.isSymbolTile&&!i)continue;if(!1===this.isSymbolTile&&!l)continue;1===r.version&&W(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const h=o.encode(t),d=[];for(let e=0;e<r.length;e++){const n=r.feature(e),i=a.getId(n,t);d.push({feature:n,id:i,index:e,sourceLayerIndex:h})}for(const e of u[t]){const t=e[0];void 0!==this.isSymbolTile&&"symbol"===t.type!==this.isSymbolTile||t.minzoom&&this.zoom<Math.floor(t.minzoom)||t.maxzoom&&this.zoom>=t.maxzoom||"none"!==t.visibility&&(fm(e,this.zoom,n),(s[t.id]=t.createBucket({index:a.bucketLayerIDs.length,layers:e,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:h,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:n})).populate(d,c,this.tileID.canonical,this.tileTransform),a.bucketLayerIDs.push(e.map((e=>e.id))))}}let h,d,f,p;l.trim();const m={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},g=()=>{if(h)return i(h);if(d&&f&&p){const e=new hm(d),t=new Td(f,p);for(const r in s){const i=s[r];i instanceof sp?(fm(i.layers,this.zoom,n),xf(i,d,e.positions,f,t.iconPositions,this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection)):i.hasPattern&&(i instanceof Mh||i instanceof Su||i instanceof eh)&&(fm(i.layers,this.zoom,n),i.addFeatures(c,this.tileID.canonical,t.patternPositions,n,this.tileTransform))}this.status="done",i(null,{buckets:R(s).filter((e=>!e.isEmpty())),featureIndex:a,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,lineAtlas:l,imageAtlas:t,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}},v=N(c.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(v).length?r.send("getGlyphs",{uid:this.uid,stacks:v},((e,t)=>{h||(h=e,d=t,g())}),void 0,!1,m):d={};const y=Object.keys(c.iconDependencies);y.length?r.send("getImages",{icons:y,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{h||(h=e,f=t,g())}),void 0,!1,m):f={};const _=Object.keys(c.patternDependencies);_.length?r.send("getImages",{icons:_,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{h||(h=e,p=t,g())}),void 0,!1,m):p={},g()}}function fm(e,t,n){const r=new bo(t);for(const t of e)t.recalculate(r,n)}class pm{constructor(e){this.entries={},this.scheduler=e}request(e,t,n,r){const i=this.entries[e]=this.entries[e]||{callbacks:[]};if(i.result){const[e,n]=i.result;return this.scheduler?this.scheduler.add((()=>{r(e,n)}),t):r(e,n),()=>{}}return i.callbacks.push(r),i.cancel||(i.cancel=n(((n,r)=>{i.result=[n,r];for(const e of i.callbacks)this.scheduler?this.scheduler.add((()=>{e(n,r)}),t):e(n,r);setTimeout((()=>delete this.entries[e]),3e3)}))),()=>{i.result||(i.callbacks=i.callbacks.filter((e=>e!==r)),i.callbacks.length||(i.cancel(),delete this.entries[e]))}}}function mm(e,t,n){const r=JSON.stringify(e.request);return e.data&&(this.deduped.entries[r]={result:[null,e.data]}),this.deduped.request(r,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},(t=>{const r=de(e.request,((e,r,i,o)=>{e?t(e):r&&t(null,{vectorTile:n?void 0:new Gu(new gd(r)),rawData:r,cacheControl:i,expires:o})}));return()=>{r.cancel(),t()}}),t)}const gm=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class vm{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,n]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const r=n>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const i=gm[15&n];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new vm(a,o,i,e)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=gm.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+a+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return ym(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=a){for(let a=h;a<=u;a++){const s=o[2*a],c=o[2*a+1];s>=e&&s<=n&&c>=t&&c<=r&&l.push(i[a])}continue}const d=h+u>>1,f=o[2*d],p=o[2*d+1];f>=e&&f<=n&&p>=t&&p<=r&&l.push(i[d]),(0===c?e<=f:t<=p)&&(s.push(h),s.push(d-1),s.push(1-c)),(0===c?n>=f:r>=p)&&(s.push(d+1),s.push(u),s.push(1-c))}return l}within(e,t,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:i,nodeSize:o}=this,a=[0,r.length-1,0],s=[],l=n*n;for(;a.length;){const c=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=o){for(let n=h;n<=u;n++)bm(i[2*n],i[2*n+1],e,t)<=l&&s.push(r[n]);continue}const d=h+u>>1,f=i[2*d],p=i[2*d+1];bm(f,p,e,t)<=l&&s.push(r[d]),(0===c?e-n<=f:t-n<=p)&&(a.push(h),a.push(d-1),a.push(1-c)),(0===c?e+n>=f:t+n>=p)&&(a.push(d+1),a.push(u),a.push(1-c))}return s}}function ym(e,t,n,r,i,o){if(i-r<=n)return;const a=r+i>>1;_m(e,t,a,r,i,o),ym(e,t,n,r,a-1,1-o),ym(e,t,n,a+1,i,1-o)}function _m(e,t,n,r,i,o){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);_m(e,t,n,Math.max(r,Math.floor(n-s*c/a+u)),Math.min(i,Math.floor(n+(a-s)*c/a+u)),o)}const a=t[2*n+o];let s=r,l=i;for(xm(e,t,r,n),t[2*i+o]>a&&xm(e,t,r,i);s<l;){for(xm(e,t,s,l),s++,l--;t[2*s+o]<a;)s++;for(;t[2*l+o]>a;)l--}t[2*r+o]===a?xm(e,t,r,l):(l++,xm(e,t,l,i)),l<=n&&(r=l+1),n<=l&&(i=l-1)}}function xm(e,t,n,r){wm(e,n,r),wm(t,2*n,2*r),wm(t,2*n+1,2*r+1)}function wm(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function bm(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}e.ARRAY_TYPE=us,e.AUTH_ERR_MSG=ye,e.Aabb=il,e.Actor=class{constructor(e,n,r){this.target=e,this.parent=n,this.mapId=r,this.callbacks={},this.cancelCallbacks={},F(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=q()?e:t,this.scheduler=new xp}send(e,t,n,r,i=!1,o){const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(n.metadata=o,this.callbacks[a]=n);const s=Y(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:e,hasCallback:!!n,targetMapId:r,mustQueue:i,sourceMapId:this.mapId,data:Ji(t,s)},s),{cancel:()=>{n&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:r,sourceMapId:this.mapId})}}}receive(e){const t=e.data,n=t.id;if(n&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[n];delete this.cancelCallbacks[n],e&&e.cancel()}else if(t.mustQueue||q()){const e=this.callbacks[n];this.cancelCallbacks[n]=this.scheduler.add((()=>this.processTask(n,t)),e&&e.metadata||{type:"message"})}else this.processTask(n,t)}processTask(e,t){if("<response>"===t.type){const n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(Qi(t.error)):n(null,Qi(t.data)))}else{const n=Y(this.globalScope)?void 0:[],r=t.hasCallback?(t,r)=>{delete this.cancelCallbacks[e],this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?Ji(t):null,data:Ji(r,n)},n)}:e=>{},i=Qi(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,i,r);else if(this.parent.getWorkerSource){const e=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,e[0],i.source)[e[1]](i,r)}else r(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},e.CanonicalTileID=dh,e.Color=Rt,e.ColorMode=Kp,e.CullFaceMode=em,e.DEMData=Gp,e.DataConstantProperty=Ro,e.DedupedRequest=pm,e.DepthMode=Zp,e.EXTENT=ss,e.Elevation=class{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const n=t.getSource().maxzoom,r=1<<n,i=Math.floor(e.x),o=Math.floor((e.x-i)*r),a=Math.floor(e.y*r),s=this.findDEMTileFor(new ph(n,i,n,o,a));return!(!s||!s.dem)}getAtPointOrZero(e,t=0){return this.getAtPoint(e,t)||0}getAtPoint(e,t,n=!0){if(this.isUsingMockSource())return null;null==t&&(t=null);const r=this._source();if(!r)return t;if(e.y<0||e.y>1)return t;const i=r.getSource().maxzoom,o=1<<i,a=Math.floor(e.x),s=e.x-a,l=new ph(i,a,i,Math.floor(s*o),Math.floor(e.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return t;const u=c.dem,h=1<<c.tileID.canonical.z,d=(s*h-c.tileID.canonical.x)*u.dim,f=(e.y*h-c.tileID.canonical.y)*u.dim,p=Math.floor(d),m=Math.floor(f);return(n?this.exaggeration():1)*Ln(Ln(u.get(p,m),u.get(p,m+1),f-m),Ln(u.get(p+1,m),u.get(p+1,m+1),f-m),d-p)}getAtTileOffset(e,t,n){const r=1<<e.canonical.z;return this.getAtPointOrZero(new Jl(e.wrap+(e.canonical.x+t/ss)/r,(e.canonical.y+n/ss)/r))}getAtTileOffsetFunc(e,t,n,r){return i=>{const o=this.getAtTileOffset(e,i.x,i.y),a=r.upVector(e.canonical,i.x,i.y);return Ls(a,a,o*r.upVectorScale(e.canonical,t,n).metersToTile),a}}getForTilePoints(e,t,n,r){if(this.isUsingMockSource())return!1;const i=om.create(this,e,r);return!!i&&(t.forEach((e=>{e[2]=this.exaggeration()*i.getElevationAt(e[0],e[1],n)})),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const n=t.dem.tree,r=t.tileID,i=1<<e.canonical.z-r.canonical.z;let o=e.canonical.x/i-r.canonical.x,a=e.canonical.y/i-r.canonical.y,s=0;for(let t=0;t<e.canonical.z-r.canonical.z&&!n.leaves[s];t++){o*=2,a*=2;const e=2*Math.floor(a)+Math.floor(o);s=n.childOffsets[s]+e,o%=1,a%=1}return{min:this.exaggeration()*n.minimums[s],max:this.exaggeration()*n.maximums[s]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(e,t,n){throw new Error("Pure virtual method called.")}pointCoordinate(e){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(e){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},e.ErrorEvent=Je,e.EvaluationParameters=bo,e.Event=Ke,e.Evented=Qe,e.FillExtrusionBucket=eh,e.Frustum=rl,e.FrustumCorners=nl,e.GLOBE_RADIUS=sl,e.GLOBE_SCALE_MATCH_LATITUDE=45,e.GLOBE_ZOOM_THRESHOLD_MAX=al,e.GLOBE_ZOOM_THRESHOLD_MIN=ol,e.GlobeSharedBuffers=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const e of this._wireframeSegments)e.destroy()}}_fillGridMeshWithLods(e,t){const n=new Vo,r=new ra,i=[],o=e+1+2,a=t[0]+1,s=t[0]+1+(1+t.length),l=(e,t,n)=>{let r=e===o-1?e-2:0===e?e:e-1;return r+=n?24575:0,[r,t]};for(let e=0;e<o;++e)n.emplaceBack(...l(e,0,!0));for(let e=0;e<a;++e)for(let t=0;t<o;++t)n.emplaceBack(...l(t,e,(0===t||t===o-1)&&!0));for(let e=0;e<t.length;++e){const r=t[e];for(let e=0;e<o;++e)n.emplaceBack(...l(e,r,!0))}for(let e=0;e<t.length;++e){const a=r.length,l=t[e]+1+2,c=new ra;for(let n=0;n<l-1;n++){const i=n===l-2,a=i?o*(s-t.length+e-n):o;for(let e=0;e<o-1;e++){const t=n*o+e;0===n||i||0===e||e===o-2?(c.emplaceBack(t+1,t,t+a),c.emplaceBack(t+a,t+a+1,t+1)):(r.emplaceBack(t+1,t,t+a),r.emplaceBack(t+a,t+a+1,t+1))}}const u=as.simpleSegment(0,a,n.length,r.length-a);for(let e=0;e<c.uint16.length;e+=3)r.emplaceBack(c.uint16[e],c.uint16[e+1],c.uint16[e+2]);const h=as.simpleSegment(0,a,n.length,r.length-a);i.push({withoutSkirts:u,withSkirts:h})}return{vertices:n,indices:r,segments:i}}_createGrid(e){const t=this._fillGridMeshWithLods(cl,ul);this._gridSegments=t.segments,this._gridBuffer=e.createVertexBuffer(t.vertices,el.members),this._gridIndexBuffer=e.createIndexBuffer(t.indices,!0)}_createPoles(e){const t=new ra;for(let e=0;e<=cl;e++)t.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(t,!0);const n=new sa,r=new sa;this._poleSegments=[];for(let e=0,t=0;e<ol;e++){const i=360/(1<<e);n.emplaceBack(0,-sl,0,.5,0),r.emplaceBack(0,-sl,0,.5,1);for(let e=0;e<=cl;e++){const t=e/cl,o=Ln(0,i,t),[a,s,l]=Tl(Bl,Fl,o,sl);n.emplaceBack(a,s,l,t,0),r.emplaceBack(a,s,l,t,1)}this._poleSegments.push(as.simpleSegment(t,0,66,64)),t+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(n,Js,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(r,Js,!1)}getGridBuffers(e,t){return[this._gridBuffer,this._gridIndexBuffer,t?this._gridSegments[e].withSkirts:this._gridSegments[e].withoutSkirts]}getPoleBuffers(e){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}getWirefameBuffers(e,t){if(!this._wireframeSegments){const t=new ca,n=cl,r=n+1+2,i=1;this._wireframeSegments=[];for(let e=0,o=0;e<ul.length;e++){const a=ul[e];for(let e=i;e<a+i;e++)for(let o=i;o<n+i;o++){const n=e*r+o;t.emplaceBack(n,n+1),t.emplaceBack(n,n+r),t.emplaceBack(n,n+r+1)}const s=a*n*3;this._wireframeSegments.push(as.simpleSegment(0,o,(a+1)*r,s)),o+=s}this._wireframeIndexBuffer=e.createIndexBuffer(t)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[t]]}},e.GlyphManager=nf,e.ImagePosition=kd,e.KDBush=vm,e.LivePerformanceUtils=Ne,e.LngLat=Ul,e.LngLatBounds=ls,e.LocalGlyphMode=tf,e.MAX_MERCATOR_LATITUDE=Yl,e.MercatorCoordinate=Jl,e.ONE_EM=Fh,e.OverscaledTileID=ph,e.PerformanceMarkers=je,e.Point=y,e.Properties=Po,e.RGBAImage=jc,e.Ray=tl,e.RequestManager=class{constructor(e,t,n){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!n,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",h,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(e,t){if(!_e(e))return e;const n=Te(e);return n.path=`/styles/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||t)}normalizeGlyphsURL(e,t){if(!_e(e))return e;const n=Te(e);return n.path=`/fonts/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||t)}normalizeSourceURL(e,t,n,r){if(!_e(e))return e;const i=Te(e);return i.path=`/v4/${i.authority}.json`,i.params.push("secure"),n&&i.params.push(`language=${n}`),r&&i.params.push(`worldview=${r}`),this._makeAPIURL(i,this._customAccessToken||t)}normalizeSpriteURL(e,t,n,r){const i=Te(e);return _e(e)?(i.path=`/styles/v1${i.path}/sprite${t}${n}`,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=`${t}${n}`,Me(i))}normalizeTileURL(e,t,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!_e(e))return e;const r=Te(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||n&&"raster"!==r.authority&&512===n?"@2x":""}${o.supported?".webp":"$1"}`),"raster"===r.authority?r.path=`/${i.RASTER_URL_PREFIX}${r.path}`:(r.path=r.path.replace(/^.+\/v4\//,"/"),r.path=`/${i.TILE_URL_VERSION}${r.path}`);const a=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(r.params)||i.ACCESS_TOKEN;return i.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push(`sku=${this._skuToken}`),this._makeAPIURL(r,a)}canonicalizeTileURL(e,t){const n=Te(e);if(!n.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!n.path.match(/\.[\w]+$/))return e;let r="mapbox://";n.path.match(/^\/raster\/v1\//)?r+=`raster/${n.path.replace(`/${i.RASTER_URL_PREFIX}/`,"")}`:r+=`tiles/${n.path.replace(`/${i.TILE_URL_VERSION}/`,"")}`;let o=n.params;return t&&(o=o.filter((e=>!e.match(/^access_token=/)))),o.length&&(r+=`?${o.join("&")}`),r}canonicalizeTileset(e,t){const n=!!t&&_e(t),r=[];for(const t of e.tiles||[])xe(t)?r.push(this.canonicalizeTileURL(t,n)):r.push(t);return r}_makeAPIURL(e,t){const n="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",r=Te(i.API_URL);if(e.protocol=r.protocol,e.authority=r.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==r.path&&(e.path=`${r.path}${e.path}`),!i.REQUIRE_ACCESS_TOKEN)return Me(e);if(t=t||i.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${n}`);if("s"===t[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${n}`)}return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push(`access_token=${t||""}`),Me(e)}},e.ResourceType=le,e.SegmentVector=as,e.SourceCache=tm,e.StencilMode=Yp,e.StructArrayLayout1ui2=ua,e.StructArrayLayout2f1f2i16=ea,e.StructArrayLayout2i4=Vo,e.StructArrayLayout2ui4=ca,e.StructArrayLayout3f12=na,e.StructArrayLayout3ui6=ra,e.StructArrayLayout4i8=Ho,e.StructArrayLayout5f20=sa,e.Texture=yp,e.Tile=zp,e.Transitionable=To,e.Uniform1f=Ba,e.Uniform1i=class extends Da{constructor(e){super(e),this.current=0}set(e,t,n){this.fetchUniformLocation(e,t)&&this.current!==n&&(this.current=n,this.gl.uniform1i(this.location,n))}},e.Uniform2f=class extends Da{constructor(e){super(e),this.current=[0,0]}set(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]||(this.current=n,this.gl.uniform2f(this.location,n[0],n[1])))}},e.Uniform3f=class extends Da{constructor(e){super(e),this.current=[0,0,0]}set(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]||(this.current=n,this.gl.uniform3f(this.location,n[0],n[1],n[2])))}},e.Uniform4f=Fa,e.UniformColor=ja,e.UniformMatrix2f=class extends Da{constructor(e){super(e),this.current=Ua}set(e,t,n){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(n[e]!==this.current[e]){this.current=n,this.gl.uniformMatrix2fv(this.location,!1,n);break}}},e.UniformMatrix3f=class extends Da{constructor(e){super(e),this.current=Va}set(e,t,n){if(this.fetchUniformLocation(e,t))for(let e=0;e<9;e++)if(n[e]!==this.current[e]){this.current=n,this.gl.uniformMatrix3fv(this.location,!1,n);break}}},e.UniformMatrix4f=class extends Da{constructor(e){super(e),this.current=Na}set(e,t,n){if(this.fetchUniformLocation(e,t)){if(n[12]!==this.current[12]||n[0]!==this.current[0])return this.current=n,void this.gl.uniformMatrix4fv(this.location,!1,n);for(let e=1;e<16;e++)if(n[e]!==this.current[e]){this.current=n,this.gl.uniformMatrix4fv(this.location,!1,n);break}}}},e.UnwrappedTileID=fh,e.ValidationError=ni,e.VectorTileFeature=qu,e.VectorTileWorkerSource=class extends Qe{constructor(e,t,n,r,i){super(),this.actor=e,this.layerIndex=t,this.availableImages=n,this.loadVectorData=i||mm,this.loading={},this.loaded={},this.deduped=new pm(e.scheduler),this.isSpriteLoaded=r,this.scheduler=e.scheduler}loadTile(e,t){const n=e.uid,r=e&&e.request,i=r&&r.collectResourceTiming,o=this.loading[n]=new dm(e);o.abort=this.loadVectorData(e,((a,s)=>{const l=!this.loading[n];if(delete this.loading[n],l||a||!s)return o.status="done",l||(this.loaded[n]=o),t(a);const c=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl),o.vectorTile=s.vectorTile||new Gu(new gd(c));const h=()=>{o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,((e,n)=>{if(e||!n)return t(e);const o={};if(i){const e=He(r);e.length>0&&(o.resourceTiming=JSON.parse(JSON.stringify(e)))}t(null,L({rawTileData:c.slice(0)},n,u,o))}))};this.isSpriteLoaded?h():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(h,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom}):h()})),this.loaded=this.loaded||{},this.loaded[n]=o}))}reloadTile(e,t){const n=this.loaded,r=e.uid,i=this;if(n&&n[r]){const o=n[r];o.showCollisionBoxes=e.showCollisionBoxes,o.enableTerrain=!!e.enableTerrain,o.projection=e.projection,o.tileTransform=Rf(e.tileID.canonical,e.projection);const a=(e,n)=>{const r=o.reloadCallback;r&&(delete o.reloadCallback,o.parse(o.vectorTile,i.layerIndex,this.availableImages,i.actor,r)),t(e,n)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(e,t){const n=e.uid,r=this.loading[n];r&&(r.abort&&r.abort(),delete this.loading[n]),t()}removeTile(e,t){const n=this.loaded,r=e.uid;n&&n[r]&&delete n[r],t()}},e.WritingMode=Md,e.ZoomDependentExpression=Jr,e.add=Ss,e.addDynamicAttributes=rp,e.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=i*c-r*u,e[2]=r*s-i*a,e[3]=s*l-o*u,e[4]=n*u-i*l,e[5]=i*o-n*s,e[6]=o*c-a*l,e[7]=r*l-n*c,e[8]=n*a-r*o,e},e.asyncAll=I,e.bezier=T,e.bindAll=F,e.boundsAttributes=Rp,e.bufferConvexPolygon=function(e,t){const n=[];for(let r=0;r<e.length;r++){const i=A(r-1,-1,e.length-1),o=A(r+1,-1,e.length-1),a=e[r],s=e[o],l=e[i].sub(a).unit(),c=s.sub(a).unit(),u=c.angleWithSep(l.x,l.y),h=l.add(c).unit().mult(-1*t/Math.sin(u/2));n.push(a.add(h))}return n},e.cacheEntryPossiblyAdded=function(e){se++,se>re&&(e.getActor().send("enforceCacheSizeLimit",ne),se=0)},e.calculateGlobeLabelMatrix=function(e,t){const{x:n,y:r}=e.point,i=Ll(n,r,e.worldSize/e._pixelsPerMercatorPixel,0,0);return ms(i,i,Rl(yl(t)))},e.calculateGlobeMatrix=function(e){const{x:t,y:n}=e.point,{lng:r,lat:i}=e._center;return Ll(t,n,e.worldSize,r,i)},e.calculateGlobeMercatorMatrix=function(e){const t=e.pixelsPerMeter,n=t/Gl(1,e.center.lat),r=fs(new Float64Array(16));return gs(r,r,[e.point.x,e.point.y,0]),vs(r,r,[n,n,t]),Float32Array.from(r)},e.circumferenceAtLatitude=Hl,e.clamp=S,e.clearTileCache=function(e){if(!ie())return;const n=t.caches.delete(Q);e&&n.catch(e).then((()=>e()))},e.clipLine=Yd,e.clone=function(e){var t=new us(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=U,e.collisionCircleLayout=Bh,e.config=i,e.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},e.create=function(){var e=new us(16);return us!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=hs,e.createExpression=Yr,e.createLayout=jo,e.createStyleLayer=function(e){return"custom"===e.type?new pp(e):new vp[e.type](e)},e.cross=Ds,e.degToRad=w,e.distance=function(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])},e.div=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},e.dot=Os,e.earthRadius=jl,e.ease=M,e.easeCubicInOut=k,e.ecefToLatLng=function([e,t,n]){const r=Math.hypot(e,t,n),i=Math.atan2(e,n),o=.5*Math.PI-Math.acos(-t/r);return new Ul(b(i),b(o))},e.emitValidationErrors=Hi,e.endsWith=j,e.enforceCacheSizeLimit=function(e){oe(),ee&&ee.then((t=>{t.keys().then((n=>{for(let r=0;r<n.length-e;r++)t.delete(n[r])}))}))},e.evaluateSizeForFeature=Vh,e.evaluateSizeForZoom=Uh,e.evaluateVariableOffset=_f,e.evented=yo,e.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},e.exactEquals$1=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},e.exported=Ze,e.exported$1=o,e.extend=L,e.extend$1=tt,e.fillExtrusionHeightLift=sh,e.filterObject=V,e.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},e.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,h=r*s,d=i*a,f=i*s,p=i*l,m=o*a,g=o*s,v=o*l;return e[0]=1-h-p,e[1]=u+v,e[2]=d-g,e[3]=0,e[4]=u-v,e[5]=1-c-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.fromRotation=function(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.fromScaling=xs,e.furthestTileCorner=function(e){const t=Math.round((e+45+360)%360/90)%4;return E[t]},e.getAABBPointSquareDist=function(e,t,n){let r=0;for(let i=0;i<2;++i){const o=n?n[i]:0;e[i]>o&&(r+=(e[i]-o)*(e[i]-o)),t[i]<o&&(r+=(o-t[i])*(o-t[i]))}return r},e.getAnchorAlignment=Fd,e.getAnchorJustification=wf,e.getBounds=function(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const o of e)t=Math.min(t,o.x),n=Math.min(n,o.y),r=Math.max(r,o.x),i=Math.max(i,o.y);return{min:new y(t,n),max:new y(r,i)}},e.getColumn=J,e.getDefaultExportFromCjs=d,e.getGridMatrix=function(e,t,n,r){const i=t.getNorth(),o=t.getSouth(),a=t.getWest(),s=t.getEast(),l=1<<e.z,c=s-a,u=i-o,h=c/cl,d=-u/ul[n],f=[0,h,0,d,0,0,i,a,0];if(e.z>0){const e=180/r;ds(f,f,[e/c+1,0,0,0,e/u+1,0,-.5*e/h,.5*e/d,1])}return f[2]=l,f[5]=e.x,f[8]=e.y,f},e.getImage=ve,e.getJSON=function(e,t){return he(L(e,{type:"json"}),t)},e.getLatitudinalLod=function(e){const t=Yl-5;e=S(e,-t,t)/t*90;const n=Math.pow(Math.abs(Math.sin(w(e))),3);return Math.round(n*(ul.length-1))},e.getMapSessionAPI=Be,e.getPerformanceMeasurement=He,e.getProjection=Jf,e.getRTLTextPluginStatus=_o,e.getReferrer=ue,e.getTilePoint=function(e,{x:t,y:n},r=0){return new y(((t-r)*e.scale-e.x)*ss,(n*e.scale-e.y)*ss)},e.getTileVec3=function(e,t,n=0){return Ms(((t.x-n)*e.scale-e.x)*ss,(t.y*e.scale-e.y)*ss,Xl(t.z,t.y))},e.getVideo=function(e,n){const r=t.document.createElement("video");r.muted=!0,r.onloadstart=function(){n(null,r)};for(let n=0;n<e.length;n++){const i=t.document.createElement("source");fe(e[n])||(r.crossOrigin="Anonymous"),i.src=e[n],r.appendChild(i)}return{cancel:()=>{}}},e.globeCenterToScreenPoint=function(e){const t=[0,0,0],n=fs(new Float64Array(16));return ms(n,e.pixelMatrix,e.globeMatrix),Bs(t,t,n),new y(t[0],t[1])},e.globeDenormalizeECEF=Rl,e.globeECEFOrigin=function(e,t){const n=[0,0,0];return Bs(n,n,Il(yl(t.canonical))),Bs(n,n,e),n},e.globeMetersToEcef=pl,e.globeNormalizeECEF=Il,e.globePixelsToTileUnits=function(e,t){return ss/(512*Math.pow(2,e))*Cl(yl(t))},e.globePoleMatrixForTile=function(e,t,n){const r=fs(new Float64Array(16)),i=(t/(1<<e)-.5)*Math.PI*2;return _s(r,n.globeMatrix,i),Float32Array.from(r)},e.globeTileBounds=yl,e.globeTiltAtLngLat=Pl,e.globeToMercatorTransition=zl,e.globeUseCustomAntiAliasing=function(e,t,n){const r=zl(n.zoom),i=e.style.map._antialias,o=!!t.extStandardDerivatives,a=t.extStandardDerivativesForceOff||e.terrain&&e.terrain.exaggeration()>0;return 0===r&&!i&&!a&&o},e.identity=fs,e.identity$1=qs,e.invert=ps,e.isFullscreen=function(){return!!t.document.fullscreenElement||!!t.document.webkitFullscreenElement},e.isLngLatBehindGlobe=Ol,e.isMapAuthenticated=function(e){return Fe.has(e)},e.isMapboxURL=_e,e.isSafariWithAntialiasingBug=function(e){const t=e.navigator?e.navigator.userAgent:null;return!!Y(e)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},e.latFromMercatorY=Zl,e.latLngToECEF=Ml,e.len=Us,e.length=Ts,e.length$1=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},e.lngFromMercatorX=ql,e.loadVectorTile=mm,e.makeRequest=he,e.mapValue=function(e,t,n,r,i){return S((e-t)/(n-t)*(i-r)+r,r,i)},e.mercatorScale=Kl,e.mercatorXfromLng=Wl,e.mercatorYfromLat=$l,e.mercatorZfromAltitude=Gl,e.mul=bs,e.mul$1=Vs,e.multiply=ms,e.multiply$1=ds,e.multiply$2=As,e.nextPowerOfTwo=D,e.normalize=Ps,e.normalize$1=Ys,e.normalize$2=Ws,e.number=Ln,e.ortho=function(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*c,e[15]=1,e},e.pbf=Zh,e.perspective=function(e,t,n,r,i){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+r)*(o=1/(r-i)),e[14]=2*i*r*o):(e[10]=-1,e[14]=-2*r),e},e.pick=function(e,t){const n={};for(let r=0;r<t.length;r++){const i=t[r];i in e&&(n[i]=e[i])}return n},e.plugin=wo,e.pointGeometry=g,e.polesInViewport=function(e){const t=fs(new Float64Array(16));ms(t,e.pixelMatrix,e.globeMatrix);const n=[0,hl,0],r=[0,dl,0];return Bs(n,n,t),Bs(r,r,t),[n[0]>0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Ol(e,new Ul(e.center.lat,90)),r[0]>0&&r[0]<=e.width&&r[1]>0&&r[1]<=e.height&&!Ol(e,new Ul(e.center.lat,-90))]},e.polygonContainsPoint=xc,e.polygonIntersectsBox=wc,e.polygonIntersectsPolygon=hc,e.polygonizeBounds=function(e,t,n=0,r=!0){const i=new y(n,n),o=e.sub(i),a=t.add(i),s=[o,new y(a.x,o.y),a,new y(o.x,a.y)];return r&&s.push(o.clone()),s},e.posAttributes=el,e.postMapLoadEvent=ze,e.postPerformanceEvent=Oe,e.postTurnstileEvent=Re,e.potpack=bd,e.prevPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},e.radToDeg=b,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.registerForPluginStateChange=function(e){return e({pluginStatus:po,pluginURL:mo}),yo.on("pluginStateChange",e),e},e.removeAuthState=function(e){Fe.delete(e)},e.renderColorRamp=Vc,e.resample=ec,e.rotateX=ys,e.rotateX$1=Zs,e.rotateY=_s,e.rotateY$1=Xs,e.rotateZ=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+u*r,e[2]=s*i+h*r,e[3]=l*i+d*r,e[4]=c*i-o*r,e[5]=u*i-a*r,e[6]=h*i-s*r,e[7]=d*i-l*r,e},e.rotateZ$1=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*s,e[1]=i*l-r*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},e.scale=vs,e.scale$1=Hs,e.scale$2=Ls,e.scaleAndAdd=zs,e.set=function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},e.setCacheLimits=function(e,t){ne=e,re=t},e.setColumn=function(e,t,n){e[4*t+0]=n[0],e[4*t+1]=n[1],e[4*t+2]=n[2],e[4*t+3]=n[3]},e.setRTLTextPlugin=function(e,t,n=!1){if(po===co||po===uo||po===ho)throw new Error("setRTLTextPlugin cannot be called multiple times.");mo=Ze.resolveURL(e),po=co,fo=t,vo(),n||xo()},e.smoothstep=C,e.spec=et,e.squaredLength=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r},e.storeAuthState=function(e,t){t?Fe.add(e):Fe.delete(e)},e.sub=Ns,e.subtract=Cs,e.symbolSize=Hh,e.tileAABB=function(e,t,n,r,i,o,a,s,l){if("globe"===l.name)return bl(e,t,new dh(n,r,i));const c=Rf({z:n,x:r,y:i},l);return new il([(o+c.x/c.scale)*t,t*(c.y/c.scale),a],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),s])},e.tileCornersToBounds=El,e.tileTransform=Rf,e.transformMat3=function(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e},e.transformMat4=Bs,e.transformMat4$1=$s,e.transformQuat=Fs,e.transitionTileAABBinECEF=xl,e.translate=gs,e.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},e.triggerPluginCompletionEvent=go,e.uniqueId=P,e.updateGlobeVertexNormal=function(e,t,n,r,i){const o=5*t+2;e.float32[o+0]=n,e.float32[o+1]=r,e.float32[o+2]=i},e.validateCustomStyleLayer=function(e){const t=[],n=e.id;return void 0===n&&t.push({message:`layers.${n}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${n}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),t},e.validateFilter=e=>Ui(Ei(e)),e.validateFog=e=>Ui(Oi(e)),e.validateLayer=e=>Ui(Ci(e)),e.validateLight=e=>Ui(zi(e)),e.validateSource=e=>Ui(Ri(e)),e.validateStyle=ji,e.validateTerrain=e=>Ui(Pi(e)),e.values=R,e.vectorTile=Pu,e.version=n,e.warnOnce=W,e.window=t,e.wrap=A})),r(["./shared"],(function(e){function t(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let n="[";for(const r of e)n+=`${t(r)},`;return`${n}]`}let n="{";for(const r of Object.keys(e).sort())n+=`${r}:${t(e[r])},`;return`${n}}`}function n(n){let r="";for(const i of e.refProperties)r+=`/${t(n[i])}`;return r}class r{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,r){for(const n of t)this._layerConfigs[n.id]=n,(this._layers[n.id]=e.createStyleLayer(n)).compileFilter(),this.keyCache[n.id]&&delete this.keyCache[n.id];for(const e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const i=function(e,t){const r={};for(let i=0;i<e.length;i++){const o=t&&t[e[i].id]||n(e[i]);t&&(t[e[i].id]=o);let a=r[o];a||(a=r[o]=[]),a.push(e[i])}const i=[];for(const e in r)i.push(r[e]);return i}(e.values(this._layerConfigs),this.keyCache);for(const e of i){const t=e.map((e=>this._layers[e.id])),n=t[0];if("none"===n.visibility)continue;const r=n.source||"";let i=this.familiesBySource[r];i||(i=this.familiesBySource[r]={});const o=n.sourceLayer||"_geojsonTileLayer";let a=i[o];a||(a=i[o]=[]),a.push(t)}}}class i{loadTile(t,n){const{uid:r,encoding:i,rawImageData:o,padding:a,buildQuadTree:s}=t,l=e.window.ImageBitmap&&o instanceof e.window.ImageBitmap?this.getImageData(o,a):o;n(null,new e.DEMData(r,l,i,a<1,s))}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const n=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),n}}function o(e,t){if(0!==e.length){a(e[0],t);for(var n=1;n<e.length;n++)a(e[n],!t)}}function a(e,t){for(var n=0,r=0,i=0,o=e.length,a=o-1;i<o;a=i++){var s=(e[i][0]-e[a][0])*(e[a][1]+e[i][1]),l=n+s;r+=Math.abs(n)>=Math.abs(s)?n-l+s:s-l+n,n=l}n+r>=0!=!!t&&e.reverse()}var s=e.getDefaultExportFromCjs((function e(t,n){var r,i=t&&t.type;if("FeatureCollection"===i)for(r=0;r<t.features.length;r++)e(t.features[r],n);else if("GeometryCollection"===i)for(r=0;r<t.geometries.length;r++)e(t.geometries[r],n);else if("Feature"===i)e(t.geometry,n);else if("Polygon"===i)o(t.coordinates,n);else if("MultiPolygon"===i)for(r=0;r<t.coordinates.length;r++)o(t.coordinates[r],n);return t}));const l=e.VectorTileFeature.prototype.toGeoJSON;var c={exports:{}},u=e.pointGeometry,h=e.vectorTile.VectorTileFeature,d=f;function f(e,t){this.options=t||{},this.features=e,this.length=e.length}function p(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}f.prototype.feature=function(e){return new p(this.features[e],this.options.extent)},p.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var n=e[t],r=[],i=0;i<n.length;i++)r.push(new u(n[i][0],n[i][1]));this.geometry.push(r)}return this.geometry},p.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<e.length;o++)for(var a=e[o],s=0;s<a.length;s++){var l=a[s];t=Math.min(t,l.x),n=Math.max(n,l.x),r=Math.min(r,l.y),i=Math.max(i,l.y)}return[t,r,n,i]},p.prototype.toGeoJSON=h.prototype.toGeoJSON;var m=e.pbf,g=d;function v(e){var t=new m;return function(e,t){for(var n in e.layers)t.writeMessage(3,y,e.layers[n])}(e,t),t.finish()}function y(e,t){var n;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<e.length;n++)r.feature=e.feature(n),t.writeMessage(2,_,r);var i=r.keys;for(n=0;n<i.length;n++)t.writeStringField(3,i[n]);var o=r.values;for(n=0;n<o.length;n++)t.writeMessage(4,k,o[n])}function _(e,t){var n=e.feature;void 0!==n.id&&t.writeVarintField(1,n.id),t.writeMessage(2,x,e),t.writeVarintField(3,n.type),t.writeMessage(4,E,n)}function x(e,t){var n=e.feature,r=e.keys,i=e.values,o=e.keycache,a=e.valuecache;for(var s in n.properties){var l=n.properties[s],c=o[s];if(null!==l){void 0===c&&(r.push(s),o[s]=c=r.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,d=a[h];void 0===d&&(i.push(l),a[h]=d=i.length-1),t.writeVarint(d)}}}function w(e,t){return(t<<3)+(7&e)}function b(e){return e<<1^e>>31}function E(e,t){for(var n=e.loadGeometry(),r=e.type,i=0,o=0,a=n.length,s=0;s<a;s++){var l=n[s],c=1;1===r&&(c=l.length),t.writeVarint(w(1,c));for(var u=3===r?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==r&&t.writeVarint(w(2,u-1));var d=l[h].x-i,f=l[h].y-o;t.writeVarint(b(d)),t.writeVarint(b(f)),i+=d,o+=f}3===r&&t.writeVarint(w(7,1))}}function k(e,t){var n=typeof e;"string"===n?t.writeStringField(1,e):"boolean"===n?t.writeBooleanField(7,e):"number"===n&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}c.exports=v,c.exports.fromVectorTileJs=v,c.exports.fromGeojsonVt=function(e,t){t=t||{};var n={};for(var r in e)n[r]=new g(e[r].features,t),n[r].name=r,n[r].version=t.version,n[r].extent=t.extent;return v({layers:n})},c.exports.GeoJSONWrapper=g;var T=e.getDefaultExportFromCjs(c.exports);const M={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},S=Math.fround||(C=new Float32Array(1),e=>(C[0]=+e,C[0]));var C;const A=3,I=5,R=6;class L{constructor(e){this.options=Object.assign(Object.create(M),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;const o=[];for(let t=0;t<e.length;t++){const n=e[t];if(!n.geometry)continue;const[r,i]=n.geometry.coordinates,a=S(O(r)),s=S(D(i));o.push(a,s,1/0,t,-1,1),this.options.reduce&&o.push(0)}let a=this.trees[r+1]=this._createTree(o);t&&console.timeEnd(i);for(let e=r;e>=n;e--){const n=+Date.now();a=this.trees[e]=this._createTree(this._cluster(a,e)),t&&console.log("z%d: %d clusters in %dms",e,a.numItems,+Date.now()-n)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let i=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){const e=this.getClusters([n,r,180,o],t),a=this.getClusters([-180,r,i,o],t);return e.concat(a)}const a=this.trees[this._limitZoom(t)],s=a.range(O(n),D(o),O(i),D(r)),l=a.data,c=[];for(const e of s){const t=this.stride*e;c.push(l[t+I]>1?z(l,t,this.clusterProps):this.points[l[t+A]])}return c}getChildren(e){const t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);const o=i.data;if(t*this.stride>=o.length)throw new Error(r);const a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=i.within(o[t*this.stride],o[t*this.stride+1],a),l=[];for(const t of s){const n=t*this.stride;o[n+4]===e&&l.push(o[n+I]>1?z(o,n,this.clusterProps):this.points[o[n+A]])}if(0===l.length)throw new Error(r);return l}getLeaves(e,t,n){const r=[];return this._appendLeaves(r,e,t=t||10,n=n||0,0),r}getTile(e,t,n){const r=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:o,radius:a}=this.options,s=a/o,l=(n-s)/i,c=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,l,(t+1+s)/i,c),r.data,t,n,i,u),0===t&&this._addTileFeatures(r.range(1-s/i,l,1,c),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,l,s/i,c),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?i+o.point_count<=r?i+=o.point_count:i=this._appendLeaves(e,o.cluster_id,n,r,i):i<r?i++:e.push(t),e.length===n)break}return i}_createTree(t){const n=new e.KDBush(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)n.add(t[e],t[e+1]);return n.finish(),n.data=t,n}_addTileFeatures(e,t,n,r,i,o){for(const a of e){const e=a*this.stride,s=t[e+I]>1;let l,c,u;if(s)l=P(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const n=this.points[t[e+A]];l=n.properties;const[r,i]=n.geometry.coordinates;c=O(r),u=D(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:l};let d;d=s||this.options.generateId?t[e+A]:this.points[t[e+A]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:n,extent:r,reduce:i,minPoints:o}=this.options,a=n/(r*Math.pow(2,t)),s=e.data,l=[],c=this.stride;for(let n=0;n<s.length;n+=c){if(s[n+2]<=t)continue;s[n+2]=t;const r=s[n],u=s[n+1],h=e.within(s[n],s[n+1],a),d=s[n+I];let f=d;for(const e of h){const n=e*c;s[n+2]>t&&(f+=s[n+I])}if(f>d&&f>=o){let e,o=r*d,a=u*d,p=-1;const m=((n/c|0)<<5)+(t+1)+this.points.length;for(const r of h){const l=r*c;if(s[l+2]<=t)continue;s[l+2]=t;const u=s[l+I];o+=s[l]*u,a+=s[l+1]*u,s[l+4]=m,i&&(e||(e=this._map(s,n,!0),p=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,l)))}s[n+4]=m,l.push(o/f,a/f,1/0,m,-1,f),i&&l.push(p)}else{for(let e=0;e<c;e++)l.push(s[n+e]);if(f>1)for(const e of h){const n=e*c;if(!(s[n+2]<=t)){s[n+2]=t;for(let e=0;e<c;e++)l.push(s[n+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+I]>1){const r=this.clusterProps[e[t+R]];return n?Object.assign({},r):r}const r=this.points[e[t+A]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}}function z(e,t,n){return{type:"Feature",id:e[t+A],properties:P(e,t,n),geometry:{type:"Point",coordinates:[(r=e[t],360*(r-.5)),B(e[t+1])]}};var r}function P(e,t,n){const r=e[t+I],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,o=e[t+R],a=-1===o?{}:Object.assign({},n[o]);return Object.assign(a,{cluster:!0,cluster_id:e[t+A],point_count:r,point_count_abbreviated:i})}function O(e){return e/360+.5}function D(e){const t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function B(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function F(e,t,n,r){for(var i,o=r,a=n-t>>1,s=n-t,l=e[t],c=e[t+1],u=e[n],h=e[n+1],d=t+3;d<n;d+=3){var f=j(e[d],e[d+1],l,c,u,h);if(f>o)i=d,o=f;else if(f===o){var p=Math.abs(d-a);p<s&&(i=d,s=p)}}o>r&&(i-t>3&&F(e,t,i,r),e[i+2]=o,n-i>3&&F(e,i,n,r))}function j(e,t,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var l=((e-n)*a+(t-r)*s)/(a*a+s*s);l>1?(n=i,r=o):l>0&&(n+=a*l,r+=s*l)}return(a=e-n)*a+(s=t-r)*s}function N(e,t,n,r){var i={id:void 0===e?null:e,type:t,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)V(e,t);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<t.length;r++)V(e,t[r]);else if("MultiPolygon"===n)for(r=0;r<t.length;r++)for(var i=0;i<t[r].length;i++)V(e,t[r][i])}(i),i}function V(e,t){for(var n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function U(e,t,n,r){if(t.geometry){var i=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],l=t.id;if(n.promoteId?l=t.properties[n.promoteId]:n.generateId&&(l=r||0),"Point"===o)H(i,s);else if("MultiPoint"===o)for(var c=0;c<i.length;c++)H(i[c],s);else if("LineString"===o)W(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(c=0;c<i.length;c++)W(i[c],s=[],a,!1),e.push(N(l,"LineString",s,t.properties));return}$(i,s,a,!1)}else if("Polygon"===o)$(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<t.geometry.geometries.length;c++)U(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var u=[];$(i[c],u,a,!0),s.push(u)}}e.push(N(l,o,s,t.properties))}}function H(e,t){t.push(G(e[0])),t.push(q(e[1])),t.push(0)}function W(e,t,n,r){for(var i,o,a=0,s=0;s<e.length;s++){var l=G(e[s][0]),c=q(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(a+=r?(i*c-l*o)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-o,2))),i=l,o=c}var u=t.length-3;t[2]=1,F(t,0,u,n),t[u+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function $(e,t,n,r){for(var i=0;i<e.length;i++){var o=[];W(e[i],o,n,r),t.push(o)}}function G(e){return e/360+.5}function q(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function Z(e,t,n,r,i,o,a,s){if(r/=t,o>=(n/=t)&&a<r)return e;if(a<n||o>=r)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],h=u.geometry,d=u.type,f=0===i?u.minX:u.minY,p=0===i?u.maxX:u.maxY;if(f>=n&&p<r)l.push(u);else if(!(p<n||f>=r)){var m=[];if("Point"===d||"MultiPoint"===d)X(h,m,n,r,i);else if("LineString"===d)Y(h,m,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===d)J(h,m,n,r,i,!1);else if("Polygon"===d)J(h,m,n,r,i,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var v=[];J(h[g],v,n,r,i,!0),v.length&&m.push(v)}if(m.length){if(s.lineMetrics&&"LineString"===d){for(g=0;g<m.length;g++)l.push(N(u.id,d,m[g],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===m.length?(d="LineString",m=m[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===m.length?"Point":"MultiPoint"),l.push(N(u.id,d,m,u.tags))}}}return l.length?l:null}function X(e,t,n,r,i){for(var o=0;o<e.length;o+=3){var a=e[o+i];a>=n&&a<=r&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function Y(e,t,n,r,i,o,a){for(var s,l,c=K(e),u=0===i?ee:te,h=e.start,d=0;d<e.length-3;d+=3){var f=e[d],p=e[d+1],m=e[d+2],g=e[d+3],v=e[d+4],y=0===i?f:p,_=0===i?g:v,x=!1;a&&(s=Math.sqrt(Math.pow(f-g,2)+Math.pow(p-v,2))),y<n?_>n&&(l=u(c,f,p,g,v,n),a&&(c.start=h+s*l)):y>r?_<r&&(l=u(c,f,p,g,v,r),a&&(c.start=h+s*l)):Q(c,f,p,m),_<n&&y>=n&&(l=u(c,f,p,g,v,n),x=!0),_>r&&y<=r&&(l=u(c,f,p,g,v,r),x=!0),!o&&x&&(a&&(c.end=h+s*l),t.push(c),c=K(e)),a&&(h+=s)}var w=e.length-3;f=e[w],p=e[w+1],m=e[w+2],(y=0===i?f:p)>=n&&y<=r&&Q(c,f,p,m),w=c.length-3,o&&w>=3&&(c[w]!==c[0]||c[w+1]!==c[1])&&Q(c,c[0],c[1],c[2]),c.length&&t.push(c)}function K(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function J(e,t,n,r,i,o){for(var a=0;a<e.length;a++)Y(e[a],t,n,r,i,o,!1)}function Q(e,t,n,r){e.push(t),e.push(n),e.push(r)}function ee(e,t,n,r,i,o){var a=(o-t)/(r-t);return e.push(o),e.push(n+(i-n)*a),e.push(1),a}function te(e,t,n,r,i,o){var a=(o-n)/(i-n);return e.push(t+(r-t)*a),e.push(o),e.push(1),a}function ne(e,t){for(var n=[],r=0;r<e.length;r++){var i,o=e[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=re(o.geometry,t);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(re(o.geometry[s],t))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var l=[],c=0;c<o.geometry[s].length;c++)l.push(re(o.geometry[s][c],t));i.push(l)}n.push(N(o.id,a,i,o.tags))}return n}function re(e,t){var n=[];n.size=e.size,void 0!==e.start&&(n.start=e.start,n.end=e.end);for(var r=0;r<e.length;r+=3)n.push(e[r]+t,e[r+1],e[r+2]);return n}function ie(e,t){if(e.transformed)return e;var n,r,i,o=1<<e.z,a=e.x,s=e.y;for(n=0;n<e.features.length;n++){var l=e.features[n],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(r=0;r<c.length;r+=2)l.geometry.push(oe(c[r],c[r+1],t,o,a,s));else for(r=0;r<c.length;r++){var h=[];for(i=0;i<c[r].length;i+=2)h.push(oe(c[r][i],c[r][i+1],t,o,a,s));l.geometry.push(h)}}return e.transformed=!0,e}function oe(e,t,n,r,i,o){return[Math.round(n*(e*r-i)),Math.round(n*(t*r-o))]}function ae(e,t,n,r,i){for(var o=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,se(a,e[s],o,i);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,h=e[s].maxY;l<a.minX&&(a.minX=l),c<a.minY&&(a.minY=c),u>a.maxX&&(a.maxX=u),h>a.maxY&&(a.maxY=h)}return a}function se(e,t,n,r){var i=t.geometry,o=t.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===o)le(a,i,e,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)le(a,i[s],e,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)le(a,c[s],e,n,!0,0===s)}if(a.length){var u=t.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var d={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==t.id&&(d.id=t.id),e.features.push(d)}}function le(e,t,n,r,i,o){var a=r*r;if(r>0&&t.size<(i?a:r))n.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===r||t[l+2]>a)&&(n.numSimplified++,s.push(t[l]),s.push(t[l+1])),n.numPoints++;i&&function(e,t){for(var n=0,r=0,i=e.length,o=i-2;r<i;o=r,r+=2)n+=(e[r]-e[o])*(e[r+1]+e[o+1]);if(n>0===t)for(r=0,i=e.length;r<i/2;r+=2){var a=e[r],s=e[r+1];e[r]=e[i-2-r],e[r+1]=e[i-1-r],e[i-2-r]=a,e[i-1-r]=s}}(s,o),e.push(s)}}function ce(e,t){var n=(t=this.options=function(e,t){for(var n in t)e[n]=t[n];return e}(Object.create(this.options),t)).debug;if(n&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(e,t){var n=[];if("FeatureCollection"===e.type)for(var r=0;r<e.features.length;r++)U(n,e.features[r],t,r);else U(n,"Feature"===e.type?e:{geometry:e},t);return n}(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(e,t){var n=t.buffer/t.extent,r=e,i=Z(e,1,-1-n,n,0,-1,2,t),o=Z(e,1,1-n,2+n,0,-1,2,t);return(i||o)&&(r=Z(e,1,-n,1+n,0,-1,2,t)||[],i&&(r=ne(i,1).concat(r)),o&&(r=r.concat(ne(o,-1)))),r}(r,t),r.length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function ue(e,t,n){return 32*((1<<e)*n+t)+e}function he(t,n){const r=t.tileID.canonical;if(!this._geoJSONIndex)return n(null,null);const i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return n(null,null);const o=new class{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t}feature(t){return new class{constructor(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const n of this._feature.geometry)t.push([new e.Point(n[0],n[1])]);return t}{const t=[];for(const n of this._feature.geometry){const r=[];for(const t of n)r.push(new e.Point(t[0],t[1]));t.push(r)}return t}}toGeoJSON(e,t,n){return l.call(this,e,t,n)}}(this._features[t])}}(i.features);let a=T(o);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),n(null,{vectorTile:o,rawData:a.buffer})}ce.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ce.prototype.splitTile=function(e,t,n,r,i,o,a){for(var s=[e,t,n,r],l=this.options,c=l.debug;s.length;){r=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,h=ue(t,n,r),d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=ae(e,t,n,r,l),this.tileCoords.push({z:t,x:n,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(d.source=e,i){if(t===l.maxZoom||t===i)continue;var p=1<<i-t;if(n!==Math.floor(o/p)||r!==Math.floor(a/p))continue}else if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==e.length){c>1&&console.time("clipping");var m,g,v,y,_,x,w=.5*l.buffer/l.extent,b=.5-w,E=.5+w,k=1+w;m=g=v=y=null,_=Z(e,u,n-w,n+E,0,d.minX,d.maxX,l),x=Z(e,u,n+b,n+k,0,d.minX,d.maxX,l),e=null,_&&(m=Z(_,u,r-w,r+E,1,d.minY,d.maxY,l),g=Z(_,u,r+b,r+k,1,d.minY,d.maxY,l),_=null),x&&(v=Z(x,u,r-w,r+E,1,d.minY,d.maxY,l),y=Z(x,u,r+b,r+k,1,d.minY,d.maxY,l),x=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*n,2*r),s.push(g||[],t+1,2*n,2*r+1),s.push(v||[],t+1,2*n+1,2*r),s.push(y||[],t+1,2*n+1,2*r+1)}}},ce.prototype.getTile=function(e,t,n){var r=this.options,i=r.extent,o=r.debug;if(e<0||e>24)return null;var a=1<<e,s=ue(e,t=(t%a+a)%a,n);if(this.tiles[s])return ie(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",e,t,n);for(var l,c=e,u=t,h=n;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[ue(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ie(this.tiles[s],i):null):null};class de extends e.VectorTileWorkerSource{constructor(e,t,n,r,i){super(e,t,n,r,he),i&&(this.loadGeoJSON=i)}loadData(t,n){const r=t&&t.request,i=r&&r.collectResourceTiming;this.loadGeoJSON(t,((o,a)=>{if(o||!a)return n(o);if("object"!=typeof a)return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));{s(a,!0);try{if(t.filter){const n=e.createExpression(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const r=a.features.filter((e=>n.value.evaluate({zoom:0},e)));a={type:"FeatureCollection",features:r}}this._geoJSONIndex=t.cluster?new L(function({superclusterOptions:t,clusterProperties:n}){if(!n||!t)return t;const r={},i={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(n);for(const t of s){const[o,a]=n[t],s=e.createExpression(a),l=e.createExpression("string"==typeof o?[o,["accumulated"],["get",t]]:o);r[t]=s.value,i[t]=l.value}return t.map=e=>{a.properties=e;const t={};for(const e of s)t[e]=r[e].evaluate(o,a);return t},t.reduce=(e,t)=>{a.properties=t;for(const t of s)o.accumulated=e[t],e[t]=i[t].evaluate(o,a)},t}(t)).load(a.features):function(e,t){return new ce(e,t)}(a,t.geojsonVtOptions)}catch(o){return n(o)}this.loaded={};const l={};if(i){const n=e.getPerformanceMeasurement(r);n&&(l.resourceTiming={},l.resourceTiming[t.source]=JSON.parse(JSON.stringify(n)))}n(null,l)}}))}reloadTile(e,t){const n=this.loaded;return n&&n[e.uid]?super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,n){if(t.request)e.getJSON(t.request,n);else{if("string"!=typeof t.data)return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));try{return n(null,JSON.parse(t.data))}catch(e){return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class fe{constructor(t){this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=e.getProjection({name:"mercator"}),this.workerSourceTypes={vector:e.VectorTileWorkerSource,geojson:de},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}}clearCaches(e,t,n){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],n()}checkIfReady(e,t,n){n()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,n){this.isSpriteLoaded[t]=n;for(const r in this.workerSources[t]){const i=this.workerSources[t][r];for(const t in i)i[t]instanceof e.VectorTileWorkerSource&&(i[t].isSpriteLoaded=n,i[t].fire(new e.Event("isSpriteLoaded")))}}setImages(e,t,n){this.availableImages[e]=t;for(const n in this.workerSources[e]){const r=this.workerSources[e][n];for(const e in r)r[e].availableImages=t}n()}enableTerrain(e,t,n){this.terrain=t,n()}setProjection(t,n){this.projections[t]=e.getProjection(n)}setLayers(e,t,n){this.getLayerIndex(e).replace(t),n()}updateLayers(e,t,n){this.getLayerIndex(e).update(t.layers,t.removedIds),n()}loadTile(t,n,r){const i=this.enableTerrain?e.extend({enableTerrain:this.terrain},n):n;i.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,n.type,n.source).loadTile(i,r)}loadDEMTile(t,n,r){const i=this.enableTerrain?e.extend({buildQuadTree:this.terrain},n):n;this.getDEMWorkerSource(t,n.source).loadTile(i,r)}reloadTile(t,n,r){const i=this.enableTerrain?e.extend({enableTerrain:this.terrain},n):n;i.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,n.type,n.source).reloadTile(i,r)}abortTile(e,t,n){this.getWorkerSource(e,t.type,t.source).abortTile(t,n)}removeTile(e,t,n){this.getWorkerSource(e,t.type,t.source).removeTile(t,n)}removeSource(e,t,n){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;const r=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==r.removeSource?r.removeSource(t,n):n()}loadWorkerSource(e,t,n){try{this.self.importScripts(t.url),n()}catch(e){n(e.toString())}}syncRTLPluginState(t,n,r){try{e.plugin.setState(n);const t=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=t){this.self.importScripts(t);const n=e.plugin.isParsed();r(n?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),n)}}catch(e){r(e.toString())}}getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new r),t}getWorkerSource(e,t,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][n]){const r={send:(t,n,r,i,o,a)=>{this.actor.send(t,n,r,e,o,a)},scheduler:this.actor.scheduler};this.workerSources[e][t][n]=new this.workerSourceTypes[t](r,this.getLayerIndex(e),this.getAvailableImages(e),this.isSpriteLoaded[e])}return this.workerSources[e][t][n]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new i),this.demWorkerSources[e][t]}enforceCacheSizeLimit(t,n){e.enforceCacheSizeLimit(n)}getWorkerPerformanceMetrics(e,t,n){n(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new fe(self)),fe})),r(["./shared"],(function(e){function t(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==n){if("object"!=typeof n)return!1;if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(!t(e[r],n[r]))return!1;return!0}return e===n}var n=r;function r(e){return!function(e){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,n=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(n);try{t=new Worker(r),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(r),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var n=t.getImageData(0,0,1,1);return n&&n.width===e.width}()?(void 0===i[t=e&&e.failIfMajorPerformanceCaveat]&&(i[t]=function(e){var t,n=function(e){var t=document.createElement("canvas"),n=Object.create(r.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=e,t.getContext("webgl",n)||t.getContext("experimental-webgl",n)}(e);if(!n)return!1;try{t=n.createShader(n.VERTEX_SHADER)}catch(e){return!1}return!(!t||n.isContextLost())&&(n.shaderSource(t,"void main() {}"),n.compileShader(t),!0===n.getShaderParameter(t,n.COMPILE_STATUS))}(t)),i[t]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var t}(e)}var i={};function o(t,n,r){const i=e.window.document.createElement(t);return void 0!==n&&(i.className=n),r&&r.appendChild(i),i}function a(t,n,r){const i=e.window.document.createElementNS("http://www.w3.org/2000/svg",t);for(const e of Object.keys(n))i.setAttributeNS(null,e,n[e]);return r&&r.appendChild(i),i}r.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const s=e.window.document&&e.window.document.documentElement.style,l=s&&void 0!==s.userSelect?"userSelect":"WebkitUserSelect";let c;function u(){s&&l&&(c=s[l],s[l]="none")}function h(){s&&l&&(s[l]=c)}function d(t){t.preventDefault(),t.stopPropagation(),e.window.removeEventListener("click",d,!0)}function f(){e.window.addEventListener("click",d,!0),e.window.setTimeout((()=>{e.window.removeEventListener("click",d,!0)}),0)}function p(e,t){const n=e.getBoundingClientRect();return v(e,n,t)}function m(e,t){const n=e.getBoundingClientRect(),r=[];for(let i=0;i<t.length;i++)r.push(v(e,n,t[i]));return r}function g(t){return void 0!==e.window.InstallTrigger&&2===t.button&&t.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button}function v(t,n,r){const i=t.offsetWidth===n.width?1:t.offsetWidth/n.width;return new e.Point((r.clientX-n.left)*i,(r.clientY-n.top)*i)}function y(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*o-i*r;return a?(e[0]=o*(a=1/a),e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e):null}function _(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class x extends e.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:e,callback:t}of this.requestors)this._notify(e,t);this.requestors=[]}}hasImage(e){return!!this.getImage(e)}getImage(e){return this.images[e]}addImage(e,t){this._validate(e,t)&&(this.images[e]=t)}_validate(t,n){let r=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),r=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),r=!1),this._validateContent(n.content,n)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),r=!1),r}_validateStretch(e,t){if(!e)return!0;let n=0;for(const r of e){if(r[0]<n||r[1]<r[0]||t<r[1])return!1;n=r[1]}return!0}_validateContent(e,t){return!(e&&(4!==e.length||e[0]<0||t.data.width<e[0]||e[1]<0||t.data.height<e[1]||e[2]<0||t.data.width<e[2]||e[3]<0||t.data.height<e[3]||e[2]<e[0]||e[3]<e[1]))}updateImage(e,t){t.version=this.images[e].version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){const t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e,t){let n=!0;if(!this.isLoaded())for(const t of e)this.images[t]||(n=!1);this.isLoaded()||n?this._notify(e,t):this.requestors.push({ids:e,callback:t})}_notify(t,n){const r={};for(const n of t){this.images[n]||this.fire(new e.Event("styleimagemissing",{id:n}));const t=this.images[n];t?r[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.warnOnce(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}n(null,r)}getPixelSize(){const{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(t){const n=this.patterns[t],r=this.getImage(t);if(!r)return null;if(n&&n.position.version===r.version)return n.position;if(n)n.position.version=r.version;else{const n={w:r.data.width+2,h:r.data.height+2,x:0,y:0},i=new e.ImagePosition(n,r);this.patterns[t]={bin:n,position:i}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(t,this.atlasImage,n.RGBA),this.atlasTexture&&this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:n,h:r}=e.potpack(t),i=this.atlasImage;i.resize({width:n||1,height:r||1});for(const t in this.patterns){const{bin:n}=this.patterns[t],r=n.x+1,o=n.y+1,a=this.images[t].data,s=a.width,l=a.height;e.RGBAImage.copy(a,i,{x:0,y:0},{x:r,y:o},{width:s,height:l}),e.RGBAImage.copy(a,i,{x:0,y:l-1},{x:r,y:o-1},{width:s,height:1}),e.RGBAImage.copy(a,i,{x:0,y:0},{x:r,y:o+l},{width:s,height:1}),e.RGBAImage.copy(a,i,{x:s-1,y:0},{x:r-1,y:o},{width:1,height:l}),e.RGBAImage.copy(a,i,{x:0,y:0},{x:r+s,y:o},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const t of e){if(this.callbackDispatchedThisFrame[t])continue;this.callbackDispatchedThisFrame[t]=!0;const e=this.images[t];_(e)&&this.updateImage(t,e)}}}const w=new e.Properties({anchor:new e.DataConstantProperty(e.spec.light.anchor),position:new class{constructor(){this.specification=e.spec.light.position}possiblyEvaluate(t,n){return function([t,n,r]){const i=e.degToRad(n+90),o=e.degToRad(r);return{x:t*Math.cos(i)*Math.sin(o),y:t*Math.sin(i)*Math.sin(o),z:t*Math.cos(o),azimuthal:n,polar:r}}(t.expression.evaluate(n))}interpolate(t,n,r){return{x:e.number(t.x,n.x,r),y:e.number(t.y,n.y,r),z:e.number(t.z,n.z,r),azimuthal:e.number(t.azimuthal,n.azimuthal,r),polar:e.number(t.polar,n.polar,r)}}},color:new e.DataConstantProperty(e.spec.light.color),intensity:new e.DataConstantProperty(e.spec.light.intensity)});class b extends e.Evented{constructor(t){super(),this._transitionable=new e.Transitionable(w),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}){if(!this._validate(e.validateLight,t,n))for(const n in t){const r=t[n];e.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),r):this._transitionable.setValue(n,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,n,r){return(!r||!1!==r.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}const E=new e.Properties({source:new e.DataConstantProperty(e.spec.terrain.source),exaggeration:new e.DataConstantProperty(e.spec.terrain.exaggeration)});let k=class extends e.Evented{constructor(t,n){super(),this._transitionable=new e.Transitionable(E),this.set(t),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=n}get(){return this._transitionable.serialize()}set(t){for(const n in t){const r=t[n];e.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),r):this._transitionable.setValue(n,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}};function T(t,n,r,i){const o=e.smoothstep(45,65,r),[a,s]=M(t,i),l=e.length(n);let c=1-Math.min(1,Math.exp((l-a)/(s-a)*-6));return c*=c*c,c=Math.min(1,1.00747*c),c*o*t.alpha}function M(e,t){const n=.5/Math.tan(.5*t);return[e.range[0]+n,e.range[1]+n]}const S=new e.Properties({range:new e.DataConstantProperty(e.spec.fog.range),color:new e.DataConstantProperty(e.spec.fog.color),"high-color":new e.DataConstantProperty(e.spec.fog["high-color"]),"space-color":new e.DataConstantProperty(e.spec.fog["space-color"]),"horizon-blend":new e.DataConstantProperty(e.spec.fog["horizon-blend"]),"star-intensity":new e.DataConstantProperty(e.spec.fog["star-intensity"])});class C extends e.Evented{constructor(t,n){super(),this._transitionable=new e.Transitionable(S),this.set(t),this._transitioning=this._transitionable.untransitioned(),this._transform=n}get state(){const t=this._transform,n="globe"===t.projection.name,r=e.globeToMercatorTransition(t.zoom),i=this.properties.get("range"),o=[.5,3];return{range:n?[e.number(o[0],i[0],r),e.number(o[1],i[1],r)]:i,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,n={}){if(!this._validate(e.validateFog,t,n)){for(const n of Object.keys(e.spec.fog))t&&void 0===t[n]&&(t[n]=e.spec.fog[n].default);for(const n in t){const r=t[n];e.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),r):this._transitionable.setValue(n,r)}}}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const n=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.smoothstep(45,65,t))*n.a}getOpacityAtLatLng(t,n){return this._transform.projection.supportsFog?function(t,n,r){const i=e.MercatorCoordinate.fromLngLat(n),o=r.elevation?r.elevation.getAtPointOrZero(i):0,a=[i.x,i.y,o];return e.transformMat4(a,a,r.mercatorFogMatrix),T(t,a,r.pitch,r._fov)}(this.state,t,n):0}getFovAdjustedRange(e){return this._transform.projection.supportsFog?M(this.state,e):[0,1]}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,n,r){return(!r||!1!==r.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}class A{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=e.uniqueId();const r=this.workerPool.acquire(this.id);for(let e=0;e<r.length;e++){const t=new A.Actor(r[e],n,this.id);t.name=`Worker ${e}`,this.actors.push(t)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(t,n,r){e.asyncAll(this.actors,((e,r)=>{e.send(t,n,r)}),r=r||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}function I(t,n,r){return n*(e.EXTENT/(t.tileSize*Math.pow(2,r-t.tileID.overscaledZ)))}A.Actor=e.Actor;class R{constructor(e,t,n,r){this.screenBounds=e,this.cameraPoint=t,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=n,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,r)}static createFromScreenPoints(t,n){let r,i;if(t instanceof e.Point||"number"==typeof t[0]){const o=e.Point.convert(t);r=[o],i=n.isPointAboveHorizon(o)}else{const o=e.Point.convert(t[0]),a=e.Point.convert(t[1]);r=[o,a],i=e.polygonizeBounds(o,a).every((e=>n.isPointAboveHorizon(e)))}return new R(r,n.getCameraPoint(),i,n)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const n=this.screenBounds[0],r=1===this.screenBounds.length?this.screenBounds[0].add(new e.Point(1,1)):this.screenBounds[1],i=e.polygonizeBounds(n,r,0,!1);return this.cameraPoint.y>r.y&&(this.cameraPoint.x>n.x&&this.cameraPoint.x<r.x?i.splice(3,0,this.cameraPoint):this.cameraPoint.x>=r.x?i[2]=this.cameraPoint:this.cameraPoint.x<=n.x&&(i[3]=this.cameraPoint)),e.bufferConvexPolygon(i,t)}bufferedCameraGeometryGlobe(t){const n=this.screenBounds[0],r=1===this.screenBounds.length?this.screenBounds[0].add(new e.Point(1,1)):this.screenBounds[1],i=e.polygonizeBounds(n,r,t),o=this.cameraPoint.clone();switch(3*((o.y>n.y)+(o.y>r.y))+((o.x>n.x)+(o.x>r.x))){case 0:i[0]=o,i[4]=o.clone();break;case 1:i.splice(1,0,o);break;case 2:i[1]=o;break;case 3:i.splice(4,0,o);break;case 5:i.splice(2,0,o);break;case 6:i[3]=o;break;case 7:i.splice(3,0,o);break;case 8:i[2]=o}return i}containsTile(t,n,r,i=0){const o=t.queryPadding/n._pixelsPerMercatorPixel+1,a=r?this._bufferedCameraMercator(o,n):this._bufferedScreenMercator(o,n);let s=t.tileID.wrap+(a.unwrapped?i:0);const l=a.polygon.map((n=>e.getTilePoint(t.tileTransform,n,s)));if(!e.polygonIntersectsBox(l,0,0,e.EXTENT,e.EXTENT))return;s=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?i:0);const c=this.screenGeometryMercator.polygon.map((n=>e.getTileVec3(t.tileTransform,n,s))),u=c.map((t=>new e.Point(t[0],t[1]))),h=n.getFreeCameraOptions().position||new e.MercatorCoordinate(0,0,0),d=e.getTileVec3(t.tileTransform,h,s),f=c.map((t=>{const n=e.sub(t,t,d);return e.normalize(n,n),new e.Ray(d,n)})),p=I(t,1,n.zoom)*n._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:u,tilespaceRays:f,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=e.getBounds(l),m.min.x=e.clamp(m.min.x,0,e.EXTENT),m.min.y=e.clamp(m.min.y,0,e.EXTENT),m.max.x=e.clamp(m.max.x,0,e.EXTENT),m.max.y=e.clamp(m.max.y,0,e.EXTENT),m),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:p};var m}_bufferedScreenMercator(e,t){const n=P(e);if(this._screenRaycastCache[n])return this._screenRaycastCache[n];{let r;return r="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._screenRaycastCache[n]=r,r}}_bufferedCameraMercator(e,t){const n=P(e);if(this._cameraRaycastCache[n])return this._cameraRaycastCache[n];{let r;return r="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._cameraRaycastCache[n]=r,r}}_projectAndResample(t,n){const r=function(t,n){const r=e.multiply([],n.pixelMatrix,n.globeMatrix),i=[0,-e.GLOBE_RADIUS,0,1],o=[0,e.GLOBE_RADIUS,0,1],a=[0,0,0,1];e.transformMat4$1(i,i,r),e.transformMat4$1(o,o,r),e.transformMat4$1(a,a,r);const s=new e.Point(i[0]/i[3],i[1]/i[3]),l=new e.Point(o[0]/o[3],o[1]/o[3]),c=e.polygonContainsPoint(t,s)&&i[3]<a[3],u=e.polygonContainsPoint(t,l)&&o[3]<a[3];if(!c&&!u)return null;const h=function(e,t,n){for(let r=1;r<e.length;r++){const i=z(t.pointCoordinate3D(e[r-1]).x),o=z(t.pointCoordinate3D(e[r]).x);if(n<0){if(i<o)return{idx:r,t:-i/(o-1-i)}}else if(o<i)return{idx:r,t:(1-i)/(o+1-i)}}return null}(t,n,c?-1:1);if(!h)return null;const{idx:d,t:f}=h;let p=d>1?L(t.slice(0,d),n):[],m=d<t.length?L(t.slice(d),n):[];p=p.map((t=>new e.Point(z(t.x),t.y))),m=m.map((t=>new e.Point(z(t.x),t.y)));const g=[...p];0===g.length&&g.push(m[m.length-1]);const v=e.number(g[g.length-1].y,(0===m.length?p[0]:m[0]).y,f);let y;return y=c?[new e.Point(0,v),new e.Point(0,0),new e.Point(1,0),new e.Point(1,v)]:[new e.Point(1,v),new e.Point(1,1),new e.Point(0,1),new e.Point(0,v)],g.push(...y),0===m.length?g.push(p[0]):g.push(...m),{polygon:g.map((t=>new e.MercatorCoordinate(t.x,t.y))),unwrapped:!1}}(t,n);if(r)return r;const i=function(t,n){let r=!1,i=-1/0,o=0;for(let e=0;e<t.length-1;e++)t[e].x>i&&(i=t[e].x,o=e);for(let e=0;e<t.length-1;e++){const n=(o+e)%(t.length-1),i=t[n],a=t[n+1];Math.abs(i.x-a.x)>.5&&(i.x<a.x?(i.x+=1,0===n&&(t[t.length-1].x+=1)):(a.x+=1,n+1===t.length-1&&(t[0].x+=1)),r=!0)}const a=e.mercatorXfromLng(n.center.lng);return r&&a<Math.abs(a-1)&&t.forEach((e=>{e.x-=1})),{polygon:t,unwrapped:r}}(L(t,n).map((t=>new e.Point(z(t.x),t.y))),n);return{polygon:i.polygon.map((t=>new e.MercatorCoordinate(t.x,t.y))),unwrapped:i.unwrapped}}}function L(t,n){return e.resample(t,(e=>{const t=n.pointCoordinate3D(e);e.x=t.x,e.y=t.y}),1/256)}function z(e){return e<0?1+e%1:e%1}function P(e){return 100*e|0}function O(t,n,r,i,o){const a=function(r,i){if(r)return o(r);if(i){t.url&&i.tiles&&t.tiles&&delete t.tiles;const r=e.pick(e.extend(i,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);i.vector_layers&&(r.vectorLayers=i.vector_layers,r.vectorLayerIds=r.vectorLayers.map((e=>e.id))),r.tiles=n.canonicalizeTileset(r,t.url),o(null,r)}};return t.url?e.getJSON(n.transformRequest(n.normalizeSourceURL(t.url,null,r,i),e.ResourceType.Source),a):e.exported.frame((()=>a(null,t)))}class D{constructor(t,n,r){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),r=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*n),i=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*n),o=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*n),a=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=r&&t.x<o&&t.y>=i&&t.y<a}}class B{constructor(e,t,n){this.context=e;const r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const F={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class j{constructor(e,t,n,r){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;const i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n=0;n<this.attributes.length;n++){const r=t.attributes[this.attributes[n].name];void 0!==r&&e.enableVertexAttribArray(r)}}setVertexAttribPointers(e,t,n){for(let r=0;r<this.attributes.length;r++){const i=this.attributes[r],o=t.attributes[i.name];void 0!==o&&e.vertexAttribPointer(o,i.components,e[F[i.type]],!1,this.itemSize,i.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class N{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class V extends N{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class U extends N{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class H extends N{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class W extends N{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class $ extends N{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class G extends N{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class q extends N{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Z extends N{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class X extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class Y extends N{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class K extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class J extends N{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Q extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class ee extends N{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class te extends N{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class ne extends N{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class re extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class ie extends N{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class oe extends N{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let ae,se=class extends N{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class le extends N{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class ce extends N{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class ue extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class he extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class de extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class fe extends N{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class pe extends N{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class me extends N{constructor(e){super(e),this.vao=e.extVertexArrayObject}getDefault(){return null}set(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)}}class ge extends N{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class ve extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class ye extends N{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class _e extends N{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class xe extends _e{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class we extends _e{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class be extends we{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class Ee{constructor(e,t,n,r){this.context=e,this.width=t,this.height=n;const i=this.framebuffer=e.gl.createFramebuffer();this.colorAttachment=new xe(e,i),r&&(this.depthAttachment=new we(e,i))}destroy(){const e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class ke{constructor(e,t=!1){if(this.gl=e,this.isWebGL2=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),t){const t=e;this.extVertexArrayObject={createVertexArrayOES:t.createVertexArray.bind(e),deleteVertexArrayOES:t.deleteVertexArray.bind(e),bindVertexArrayOES:t.bindVertexArray.bind(e)}}this.clearColor=new V(this),this.clearDepth=new U(this),this.clearStencil=new H(this),this.colorMask=new W(this),this.depthMask=new $(this),this.stencilMask=new G(this),this.stencilFunc=new q(this),this.stencilOp=new Z(this),this.stencilTest=new X(this),this.depthRange=new Y(this),this.depthTest=new K(this),this.depthFunc=new J(this),this.blend=new Q(this),this.blendFunc=new ee(this),this.blendColor=new te(this),this.blendEquation=new ne(this),this.cullFace=new re(this),this.cullFaceSide=new ie(this),this.frontFace=new oe(this),this.program=new se(this),this.activeTexture=new le(this),this.viewport=new ce(this),this.bindFramebuffer=new ue(this),this.bindRenderbuffer=new he(this),this.bindTexture=new de(this),this.bindVertexBuffer=new fe(this),this.bindElementBuffer=new pe(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new me(this),this.pixelStoreUnpack=new ge(this),this.pixelStoreUnpackPremultiplyAlpha=new ve(this),this.pixelStoreUnpackFlipY=new ye(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),t||(this.extTextureHalfFloat=e.getExtension("OES_texture_half_float")),(t||this.extTextureHalfFloat&&e.getExtension("OES_texture_half_float_linear"))&&(this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=t||e.getExtension("OES_standard_derivatives"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new B(this,e,t)}createVertexBuffer(e,t,n){return new j(this,e,t,n)}createRenderbuffer(e,t,n){const r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,n){return new Ee(this,e,t,n)}clear({color:e,depth:t,stencil:n}){const r=this.gl;let i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==n&&(i|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),r.clear(i)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(n){t(n.blendFunction,e.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(n.blendFunction),this.blendColor.set(n.blendColor)),this.colorMask.set(n.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class Te extends e.Evented{constructor(t,n,r,i){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(n,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i),this._tileWorkers={},this._deduped=new e.DedupedRequest}load(t){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"}));const n=Array.isArray(this.map._language)?this.map._language.join():this.map._language,r=this.map._worldview;this._tileJSONRequest=O(this._options,this.map._requestManager,n,r,((i,o)=>{this._tileJSONRequest=null,this._loaded=!0,i?(n&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${n}`),r&&2!==r.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${r}`),this.fire(new e.ErrorEvent(i))):o&&(e.extend(this,o),o.bounds&&(this.tileBounds=new D(o.bounds,this.minzoom,this.maxzoom)),e.postTurnstileEvent(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest(),this.load((()=>this.map.style._clearSource(this.id)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return e.extend({},this._options)}loadTile(t,n){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(r,e.ResourceType.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile};if(i.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=n:t.request=t.actor.send("reloadTile",i,o.bind(this));else if(t.actor=this._tileWorkers[r]=this._tileWorkers[r]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",i,o.bind(this),void 0,!0);else{const n=e.loadVectorTile.call({deduped:this._deduped},i,((e,n)=>{e||!n?o.call(this,e):(i.data={cacheControl:n.cacheControl,expires:n.expires,rawData:n.rawData.slice(0)},t.actor&&t.actor.send("loadTile",i,o.bind(this),void 0,!0))}),!0);t.request={cancel:n}}function o(r,i){return delete t.request,t.aborted?n(null):r&&404!==r.status?n(r):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id})}unloadTile(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Me extends e.Evented{constructor(t,n,r,i){super(),this.id=t,this.dispatcher=r,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},n),e.extend(this,e.pick(n,["url","scheme","tileSize"]))}load(t){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=O(this._options,this.map._requestManager,null,null,((n,r)=>{this._tileJSONRequest=null,this._loaded=!0,n?this.fire(new e.ErrorEvent(n)):r&&(e.extend(this,r),r.bounds&&(this.tileBounds=new D(r.bounds,this.minzoom,this.maxzoom)),e.postTurnstileEvent(r.tiles),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))),t&&t(n)}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest(),this.load((()=>this.map.style._clearSource(this.id)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return e.extend({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,n){const r=e.exported.devicePixelRatio>=2,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),r,this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),((r,i,o,a)=>(delete t.request,t.aborted?(t.state="unloaded",n(null)):r?(t.state="errored",n(r)):i?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:a}),t.setTexture(i,this.map.painter),t.state="loaded",e.cacheEntryPossiblyAdded(this.dispatcher),void n(null)):n(null))))}static loadTileData(e,t,n){e.setTexture(t,n)}static unloadTileData(e,t){e.texture&&t.saveTileTexture(e.texture)}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t()}unloadTile(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function Se(t,n,r,i,o,a,s,l){const c=[t,r,o,n,i,a,1,1,1],u=[s,l,1],h=e.adjoint([],c),[d,f,p]=e.transformMat3(u,u,e.transpose(h,h));return e.multiply$1(c,[d,0,0,0,f,0,0,0,p],c)}class Ce extends e.Evented{constructor(e,t,n,r){super(),this.id=e,this.dispatcher=n,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=t,this._dirty=!1}load(t,n){this._loaded=n||!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),((n,r)=>{if(this._imageRequest=null,this._loaded=!0,n)this.fire(new e.ErrorEvent(n));else if(r){const{HTMLImageElement:n}=e.window;this.image=r instanceof n?e.exported.getImageData(r):r,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,t&&(this.coordinates=t),this._finishLoading()}}))}loaded(){return this._loaded}updateImage(e){return this.image&&e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(t){this.coordinates=t,this._boundsArray=void 0;const n=t.map(e.MercatorCoordinate.fromLngLat);return this.tileID=function(t){let n=1/0,r=1/0,i=-1/0,o=-1/0;for(const e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),o=Math.max(o,e.y);const a=Math.max(i-n,o-r),s=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),l=Math.pow(2,s);return new e.CanonicalTileID(s,Math.floor((n+i)/2*l),Math.floor((r+o)/2*l))}(n),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(t){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray)return;const n=e.tileTransform(this.tileID,this.map.transform.projection),[r,i,o,a]=this.coordinates.map((t=>{const r=n.projection.project(t[0],t[1]);return e.getTilePoint(n,r)._round()}));this.perspectiveTransform=function(t,n,r,i,o,a,s,l,c,u){const h=Se(0,0,t,0,0,n,t,n),d=Se(r,i,o,a,s,l,c,u);return e.multiply$1(d,e.adjoint(h,h),d),[d[6]/d[8]*t/e.EXTENT,d[7]/d[8]*n/e.EXTENT]}(this.width,this.height,r.x,r.y,i.x,i.y,a.x,a.y,o.x,o.y);const s=this._boundsArray=new e.StructArrayLayout4i8;s.emplaceBack(r.x,r.y,0,0),s.emplaceBack(i.x,i.y,e.EXTENT,0),s.emplaceBack(a.x,a.y,0,e.EXTENT),s.emplaceBack(o.x,o.y,e.EXTENT,e.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=t.createVertexBuffer(s,e.boundsAttributes.members),this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,n=t.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new e.Texture(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Ae={vector:Te,raster:Me,"raster-dem":class extends Me{constructor(t,n,r,i){super(t,n,r,i),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}loadTile(t,n){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function i(e,r){e&&(t.state="errored",n(e)),r&&(t.dem=r,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",n(null))}t.request=e.getImage(this.map._requestManager.transformRequest(r,e.ResourceType.Tile),function(r,o,a,s){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(r)t.state="errored",n(r);else if(o){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:a,expires:s});const n=e.window.ImageBitmap&&o instanceof e.window.ImageBitmap&&(null==ae&&(ae=e.window.OffscreenCanvas&&new e.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof e.window.createImageBitmap),ae),r=1-(o.width-e.prevPowerOfTwo(o.width))/2;r<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=n?o:e.exported.getImageData(o,r),c={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:l,encoding:this.encoding,padding:r};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",c,i.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const n=t.canonical,r=Math.pow(2,n.z),i=(n.x-1+r)%r,o=0===n.x?t.wrap-1:t.wrap,a=(n.x+1+r)%r,s=n.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,o,n.z,i,n.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y).key]={backfilled:!1},n.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,o,n.z,i,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+1<r&&(l[new e.OverscaledTileID(t.overscaledZ,o,n.z,i,n.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y+1).key]={backfilled:!1}),l}unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded"}},geojson:class extends e.Evented{constructor(t,n,r,i){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=r.getActor(),this.setEventedParent(i),this._data=n.data,this._options=e.extend({},n),this._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:e.EXTENT,radius:(void 0!==n.clusterRadius?n.clusterRadius:50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this}getClusterLeaves(e,t,n,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:n},r),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.Event("dataloading",{dataType:"source"})),this._loaded=!1;const t=e.extend({},this.workerOptions),n=this._data;"string"==typeof n?(t.request=this.map._requestManager.transformRequest(e.exported.resolveURL(n),e.ResourceType.Source),t.request.collectResourceTiming=this._collectResourceTiming):t.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,t,((t,n)=>{if(this._loaded=!0,this._pendingLoad=null,t)this.fire(new e.ErrorEvent(t));else{const t={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&n&&n.resourceTiming&&n.resourceTiming[this.id]&&(t.resourceTiming=n.resourceTiming[this.id]),this.fire(new e.Event("data",t)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(t,n){const r=t.actor?"reloadTile":"loadTile";t.actor=this.actor,t.request=this.actor.send(r,{type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},((e,i)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):e?n(e):(t.loadVectorData(i,this.map.painter,"reloadTile"===r),n(null)))),void 0,"loadTile"===r)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return e.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Ce{constructor(e,t,n,r){super(e,t,n,r),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,e.ResourceType.Source).url);e.getVideo(this.urls,((t,n)=>{this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):n&&(this.video=n,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;t<n.start(0)||t>n.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Ce,canvas:class extends Ce{constructor(t,n,r,i){super(t,n,r,i),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const n=this.map.painter.context;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(n,this.canvas,n.gl.RGBA,{premultiply:!0}),this._prepareData(n)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.Evented{constructor(t,n,r,i){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=r,this._implementation=n,this.setEventedParent(i),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new D(this._implementation.bounds,this.minzoom,this.maxzoom)),n.update=this._update.bind(this),n.clearTiles=this._clearTiles.bind(this),n.coveringTiles=this._coveringTiles.bind(this),e.extend(this,e.pick(n,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this._map=t,this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:n,z:r}=e.canonical;return this._implementation.hasTile({x:t,y:n,z:r})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,n){const{x:r,y:i,z:o}=t.tileID.canonical,a=new e.window.AbortController;t.request=Promise.resolve(this._implementation.loadTile({x:r,y:i,z:o},{signal:a.signal})).then(function(r){return delete t.request,t.aborted?(t.state="unloaded",n(null)):void 0===r?(t.state="errored",n(null)):null===r?(this.loadTileData(t,{width:this.tileSize,height:this.tileSize,data:null}),t.state="loaded",n(null)):function(t){return t instanceof e.window.ImageData||t instanceof e.window.HTMLCanvasElement||t instanceof e.window.ImageBitmap||t instanceof e.window.HTMLImageElement}(r)?(this.loadTileData(t,r),t.state="loaded",void n(null)):(t.state="errored",n(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((e=>{20!==e.code&&(t.state="errored",n(e))})),t.request.cancel=()=>a.abort()}loadTileData(e,t){Me.loadTileData(e,t,this._map.painter)}unloadTileData(e){Me.unloadTileData(e,this._map.painter)}unloadTile(e,t){if(this.unloadTileData(e),this._implementation.unloadTile){const{x:t,y:n,z:r}=e.tileID.canonical;this._implementation.unloadTile({x:t,y:n,z:r})}t()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z})))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))}}},Ie=function(t,n,r,i){const o=new Ae[n.type](t,n,r,i);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.bindAll(["load","abort","unload","serialize","prepare"],o),o};function Re(t,n){const r=e.identity([]);return e.scale(r,r,[.5*t.width,.5*-t.height,1]),e.translate(r,r,[1,-1,0]),e.multiply(r,r,t.calculateProjMatrix(n.toUnwrapped())),Float32Array.from(r)}function Le(e,t,n,r,i,o,a,s=!1){const l=e.tilesIn(r,a,s);l.sort(Pe);const c=[];for(const r of l)c.push({wrappedTileID:r.tile.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(t,n,e._state,r,i,o,Re(e.transform,r.tile.tileID),s)});const u=function(e){const t={},n={};for(const r of e){const e=r.queryResults,i=r.wrappedTileID,o=n[i]=n[i]||{};for(const n in e){const r=e[n],i=o[n]=o[n]||{},a=t[n]=t[n]||[];for(const e of r)i[e.featureIndex]||(i[e.featureIndex]=!0,a.push(e))}}return t}(c);for(const t in u)u[t].forEach((t=>{const n=t.feature,r=n.layer;r&&"background"!==r.type&&"sky"!==r.type&&(n.source=r.source,r["source-layer"]&&(n.sourceLayer=r["source-layer"]),n.state=void 0!==n.id?e.getFeatureState(r["source-layer"],n.id):{})}));return u}function ze(e,t){const n=e.getRenderableIds().map((t=>e.getTileByID(t))),r=[],i={};for(let e=0;e<n.length;e++){const o=n[e],a=o.tileID.canonical.key;i[a]||(i[a]=!0,o.querySourceFeatures(r,t))}return r}function Pe(e,t){const n=e.tileID,r=t.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.canonical.x}function Oe(){return null!=fo.workerClass?new fo.workerClass:new e.window.Worker(fo.workerUrl)}const De="mapboxgl_preloaded_worker_pool";class Be{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Be.workerCount;)this.workers.push(new Oe);return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[De]}numActive(){return Object.keys(this.active).length}}let Fe;function je(){return Fe||(Fe=new Be),Fe}function Ne(t,n){const r={};for(const e in t)"ref"!==e&&(r[e]=t[e]);return e.refProperties.forEach((e=>{e in n&&(r[e]=n[e])})),r}function Ve(e){e=e.slice();const t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)"ref"in e[n]&&(e[n]=Ne(e[n],t[e[n].ref]));return e}Be.workerCount=2;const Ue={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function He(e,t,n){n.push({command:Ue.addSource,args:[e,t[e]]})}function We(e,t,n){t.push({command:Ue.removeSource,args:[e]}),n[e]=!0}function $e(e,t,n,r){We(e,n,r),He(e,t,n)}function Ge(e,n,r){let i;for(i in e[r])if(e[r].hasOwnProperty(i)&&"data"!==i&&!t(e[r][i],n[r][i]))return!1;for(i in n[r])if(n[r].hasOwnProperty(i)&&"data"!==i&&!t(e[r][i],n[r][i]))return!1;return!0}function qe(e,n,r,i,o,a){let s;for(s in n=n||{},e=e||{})e.hasOwnProperty(s)&&(t(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}));for(s in n)n.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}))}function Ze(e){return e.id}function Xe(e,t){return e[t.id]=t,e}class Ye{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);let n=1,r=this._distances[n];const i=t*this.paddedLength+this.padding;for(;r<i&&n<this._distances.length;)r=this._distances[++n];const o=n-1,a=this._distances[o],s=r-a,l=s>0?(i-a)/s:0;return this.points[o].mult(1-l).add(this.points[n].mult(l))}}class Ke{constructor(e,t,n){const r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(let e=0;e<this.xCellCount*this.yCellCount;e++)r.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}insertCircle(e,t,n,r){this._forEachCell(t-r,n-r,t+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(n),this.circles.push(r)}_insertBoxCell(e,t,n,r,i,o){this.boxCells[i].push(o)}_insertCircleCell(e,t,n,r,i,o){this.circleCells[i].push(o)}_query(e,t,n,r,i,o){if(n<0||e>this.width||r<0||t>this.height)return!i&&[];const a=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(let e=0;e<this.boxKeys.length;e++)a.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],n=this.circles[3*e+1],r=this.circles[3*e+2];a.push({key:this.circleKeys[e],x1:t-r,y1:n-r,x2:t+r,y2:n+r})}return o?a.filter(o):a}return this._forEachCell(e,t,n,r,this._queryCell,a,{hitTest:i,seenUids:{box:{},circle:{}}},o),i?a.length>0:a}_queryCircle(e,t,n,r,i){const o=e-n,a=e+n,s=t-n,l=t+n;if(a<0||o>this.width||l<0||s>this.height)return!r&&[];const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},i),r?c.length>0:c}query(e,t,n,r,i){return this._query(e,t,n,r,!1,i)}hitTest(e,t,n,r,i){return this._query(e,t,n,r,!0,i)}hitTestCircle(e,t,n,r){return this._queryCircle(e,t,n,!0,r)}_queryCell(e,t,n,r,i,o,a,s){const l=a.seenUids,c=this.boxCells[i];if(null!==c){const i=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(e<=i[c+2]&&t<=i[c+3]&&n>=i[c+0]&&r>=i[c+1]&&(!s||s(this.boxKeys[u]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:i[c],y1:i[c+1],x2:i[c+2],y2:i[c+3]})}}}const u=this.circleCells[i];if(null!==u){const i=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(i[u],i[u+1],i[u+2],e,t,n,r)&&(!s||s(this.circleKeys[c]))){if(a.hitTest)return o.push(!0),!0;{const e=i[u],t=i[u+1],n=i[u+2];o.push({key:this.circleKeys[c],x1:e-n,y1:t-n,x2:e+n,y2:t+n})}}}}}_queryCellCircle(e,t,n,r,i,o,a,s){const l=a.circle,c=a.seenUids,u=this.boxCells[i];if(null!==u){const e=this.bboxes;for(const t of u)if(!c.box[t]){c.box[t]=!0;const n=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[n+0],e[n+1],e[n+2],e[n+3])&&(!s||s(this.boxKeys[t])))return o.push(!0),!0}}const h=this.circleCells[i];if(null!==h){const e=this.circles;for(const t of h)if(!c.circle[t]){c.circle[t]=!0;const n=3*t;if(this._circlesCollide(e[n],e[n+1],e[n+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,n,r,i,o,a,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),h=this._convertToYCellCoord(r);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++)if(i.call(this,e,t,n,r,this.xCellCount*l+d,o,a,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,n,r,i,o){const a=r-e,s=i-t,l=n+o;return l*l>a*a+s*s}_circleAndRectCollide(e,t,n,r,i,o,a){const s=(o-r)/2,l=Math.abs(e-(r+s));if(l>s+n)return!1;const c=(a-i)/2,u=Math.abs(t-(i+c));if(u>c+n)return!1;if(l<=s||u<=c)return!0;const h=l-s,d=u-c;return h*h+d*d<=n*n}}const Je={unknown:0,flipRequired:1,flipNotRequired:2},Qe=Math.tan(85*Math.PI/180);function et(t,n,r,i,o,a,s){const l=e.create();if(r)if("globe"===a.name){const t=e.calculateGlobeLabelMatrix(o,n);e.multiply(l,l,t)}else{const t=y([],s);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],i||e.rotateZ(l,l,o.angle)}else e.multiply(l,o.labelPlaneMatrix,t);return l}function tt(e,t,n,r,i,o,a){const s=et(e,t,n,r,i,o,a);return"globe"===o.name&&n||(s[2]=s[6]=s[10]=s[14]=0),s}function nt(t,n,r,i,o,a,s){if(r){if("globe"===a.name){const l=et(t,n,r,i,o,a,s);return e.invert(l,l),e.multiply(l,t,l),l}{const n=e.clone(t),r=e.identity([]);return r[0]=s[0],r[1]=s[1],r[4]=s[2],r[5]=s[3],e.multiply(n,n,r),i||e.rotateZ(n,n,-o.angle),n}}return o.glCoordMatrix}function rt(t,n,r,i){const o=[t,n,r,1];r?e.transformMat4$1(o,o,i):pt(o,o,i);const a=o[3];return o[0]/=a,o[1]/=a,o[2]/=a,o}function it(e,t){return Math.min(.5+e/t*.5,1.5)}function ot(e,t){const n=e[0]/e[3],r=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&r>=-t[1]&&r<=t[1]}function at(t,n,r,i,o,a,s,l,c,u){const h=r.transform,d=i?t.textSizeData:t.iconSizeData,f=e.evaluateSizeForZoom(d,r.transform.zoom),p="globe"===h.projection.name,m=[256/r.width*2+1,256/r.height*2+1],g=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let v=null;p&&(v=i?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const y=t.lineVertexArray,_=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=r.transform.width/r.transform.height;let w,b=!1;for(let i=0;i<_.length;i++){const p=_.get(i),{numGlyphs:E,writingMode:k}=p;if(k!==e.WritingMode.vertical||b||w===e.WritingMode.horizontal||(b=!0),w=k,(p.hidden||k===e.WritingMode.vertical)&&!b){ft(E,g);continue}b=!1;const T=new e.Point(p.tileAnchorX,p.tileAnchorY);let{x:M,y:S,z:C}=h.projection.projectTilePoint(T.x,T.y,u.canonical);if(c){const[e,t,n]=c(T);M+=e,S+=t,C+=n}const A=[M,S,C,1];if(e.transformMat4$1(A,A,n),!ot(A,m)){ft(E,g);continue}const I=it(r.transform.cameraToCenterDistance,A[3]),R=e.evaluateSizeForFeature(d,f,p),L=s?R/I:R*I,z=rt(M,S,C,o);if(z[3]<=0){ft(E,g);continue}let P={};const O=s?null:c,D=ct(p,L,!1,l,n,o,a,t.glyphOffsetArray,y,g,v,z,T,P,x,O,h.projection,u,s);b=D.useVertical,O&&D.needsFlipping&&(P={}),(D.notEnoughRoom||b||D.needsFlipping&&ct(p,L,!0,l,n,o,a,t.glyphOffsetArray,y,g,v,z,T,P,x,O,h.projection,u,s).notEnoughRoom)&&ft(E,g)}i?(t.text.dynamicLayoutVertexBuffer.updateData(g),v&&t.text.globeExtVertexBuffer.updateData(v)):(t.icon.dynamicLayoutVertexBuffer.updateData(g),v&&t.icon.globeExtVertexBuffer.updateData(v))}function st(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m){const{lineStartIndex:g,glyphStartIndex:v,segment:y}=s,_=v+s.numGlyphs,x=g+s.lineLength,w=t.getoffsetX(v),b=t.getoffsetX(_-1),E=dt(e*w,n,r,i,o,a,y,g,x,l,c,u,h,d,!0,f,p,m);if(!E)return null;const k=dt(e*b,n,r,i,o,a,y,g,x,l,c,u,h,d,!0,f,p,m);return k?{first:E,last:k}:null}function lt(t,n,r,i){return t===e.WritingMode.horizontal&&Math.abs(i)>Math.abs(r)?{useVertical:!0}:t===e.WritingMode.vertical?i>0?{needsFlipping:!0}:null:n!==Je.unknown&&function(e,t){return 0===e||Math.abs(t/e)>Qe}(r,i)?n===Je.flipRequired?{needsFlipping:!0}:null:r<0?{needsFlipping:!0}:null}function ct(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,_){const x=n/24,w=t.lineOffsetX*x,b=t.lineOffsetY*x,{lineStartIndex:E,glyphStartIndex:k,numGlyphs:T,segment:M,writingMode:S,flipState:C}=t,A=E+t.lineLength,I=t=>{if(h){const[n,r,i]=t.up,o=u.length;e.updateGlobeVertexNormal(h,o+0,n,r,i),e.updateGlobeVertexNormal(h,o+1,n,r,i),e.updateGlobeVertexNormal(h,o+2,n,r,i),e.updateGlobeVertexNormal(h,o+3,n,r,i)}const[n,r,i]=t.point;e.addDynamicAttributes(u,n,r,i,t.angle)};if(T>1){const e=st(x,l,w,b,r,d,f,t,c,a,p,g,!1,v,y,_);if(!e)return{notEnoughRoom:!0};if(i&&!r){let[n,r,i]=e.first.point,[o,a,l]=e.last.point;[n,r]=rt(n,r,i,s),[o,a]=rt(o,a,l,s);const c=lt(S,C,(o-n)*m,a-r);if(t.flipState=c&&c.needsFlipping?Je.flipRequired:Je.flipNotRequired,c)return c}I(e.first);for(let e=k+1;e<k+T-1;e++){const t=dt(x*l.getoffsetX(e),w,b,r,d,f,M,E,A,c,a,p,g,!1,!1,v,y,_);if(!t)return u.length-=4*(e-k),{notEnoughRoom:!0};I(t)}I(e.last)}else{if(i&&!r){const n=rt(f.x,f.y,0,o),r=E+M+1,i=new e.Point(c.getx(r),c.gety(r)),a=rt(i.x,i.y,0,o),s=a[3]>0?a:ht(f,i,n,1,o,void 0,v,y.canonical),l=lt(S,C,(s[0]-n[0])*m,s[1]-n[1]);if(t.flipState=l&&l.needsFlipping?Je.flipRequired:Je.flipNotRequired,l)return l}const n=dt(x*l.getoffsetX(k),w,b,r,d,f,M,E,A,c,a,p,g,!1,!1,v,y,_);if(!n)return{notEnoughRoom:!0};I(n)}return{}}function ut(e,t,n,r,i){const{x:o,y:a,z:s}=r.projectTilePoint(e.x,e.y,t);if(!i)return rt(o,a,s,n);const[l,c,u]=i(e);return rt(o+l,a+c,s+u,n)}function ht(t,n,r,i,o,a,s,l){const c=ut(t.sub(n)._unit()._add(t),l,o,s,a);return e.sub(c,r,c),e.normalize(c,c),e.scaleAndAdd(c,r,c,i)}function dt(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y){const _=i?t-n:t+n;let x=_>0?1:-1,w=0;i&&(x*=-1,w=Math.PI),x<0&&(w+=Math.PI);let b=l+s+(x>0?0:1)|0,E=o,k=o,T=0,M=0;const S=Math.abs(_),C=[],A=[];let I=a,R=I;const L=()=>ht(R,I,k,S-T+1,h,f,g,v.canonical);for(;T+M<=S;){if(b+=x,b<l||b>=c)return null;if(k=E,R=I,C.push(k),p&&A.push(R),I=new e.Point(u.getx(b),u.gety(b)),E=d[b],!E){const e=ut(I,v.canonical,h,g,f);E=e[3]>0?d[b]=e:L()}T+=M,M=e.distance(k,E)}m&&f&&(d[b]&&(E=L(),M=e.distance(k,E)),d[b]=E);const z=(S-T)/M,P=I.sub(R)._mult(z)._add(R),O=e.sub([],E,k),D=e.scaleAndAdd([],k,O,z);let B=[0,0,1],F=O[0],j=O[1];if(y&&(B=g.upVector(v.canonical,P.x,P.y),0!==B[0]||0!==B[1]||1!==B[2])){const t=[B[2],0,-B[0]],n=e.cross([],B,t);e.normalize(t,t),e.normalize(n,n),F=e.dot(O,t),j=e.dot(O,n)}if(r){const t=e.cross([],B,O);e.normalize(t,t),e.scaleAndAdd(D,D,t,r*x)}const N=w+Math.atan2(j,F);return C.push(D),p&&A.push(P),{point:D,angle:N,path:C,tilePath:A,up:B}}function ft(e,t){const n=t.length,r=n+4*e;t.resize(r),t.float32.fill(-1/0,4*n,4*r)}function pt(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e[3]=n[3]*r+n[7]*i+n[15],e}const mt=100;class gt{constructor(e,t,n=new Ke(e.width+200,e.height+200,25),r=new Ke(e.width+200,e.height+200,25)){this.transform=e,this.grid=n,this.ignoredGrid=r,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+mt,this.screenBottomBoundary=e.height+mt,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(e,t,n,r,i,o,a,s){let l=n.projectedAnchorX,c=n.projectedAnchorY,u=n.projectedAnchorZ;const h=n.elevation,d=n.tileID,f=e.getProjection();if(h&&d){const[e,t,r]=f.upVector(d.canonical,n.tileAnchorX,n.tileAnchorY),i=f.upVectorScale(d.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=e*h*i,c+=t*h*i,u+=r*h*i}const p=this.projectAndGetPerspectiveRatio(a,l,c,u,n.tileID,"globe"===f.name||!!h||this.transform.pitch>0,f),m=o*p.perspectiveRatio,g=(n.x1*t+r.x-n.padding)*m+p.point.x,v=(n.y1*t+r.y-n.padding)*m+p.point.y,y=(n.x2*t+r.x+n.padding)*m+p.point.x,_=(n.y2*t+r.y+n.padding)*m+p.point.y,x=p.perspectiveRatio<=.55||p.occluded;return!this.isInsideGrid(g,v,y,_)||!i&&this.grid.hitTest(g,v,y,_,s)||x?{box:[],offscreen:!1,occluded:p.occluded}:{box:[g,v,y,_],offscreen:this.isOffscreen(g,v,y,_),occluded:!1}}placeCollisionCircles(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m){const g=[],v=this.transform.elevation,y=t.getProjection(),_=v?v.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,y):null,x=new e.Point(r.tileAnchorX,r.tileAnchorY);let{x:w,y:b,z:E}=y.projectTilePoint(x.x,x.y,m.canonical);if(_){const[e,t,n]=_(x);w+=e,b+=t,E+=n}const k="globe"===y.name,T=this.projectAndGetPerspectiveRatio(s,w,b,E,m,k||!!v||this.transform.pitch>0,y),{perspectiveRatio:M}=T,S=(h?a/M:a*M)/e.ONE_EM,C=rt(w,b,E,l),A=T.signedDistanceFromCamera>0?st(S,o,r.lineOffsetX*S,r.lineOffsetY*S,!1,C,x,r,i,l,{},v&&!h?_:null,h&&!!v,y,m,h):null;let I=!1,R=!1,L=!0;if(A&&!T.occluded){const t=.5*f*M+p,r=new e.Point(-100,-100),i=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),o=new Ye,{first:a,last:s}=A,l=a.path.length;let h=[];for(let e=l-1;e>=1;e--)h.push(a.path[e]);for(let e=1;e<s.path.length;e++)h.push(s.path[e]);const m=2.5*t;c&&(h=h.map((([e,t,n],r)=>(_&&!k&&(n=_(r<l-1?a.tilePath[l-1-r]:s.tilePath[r-l+2])[2]),rt(e,t,n,c)))),h.some((e=>e[3]<=0))&&(h=[]));let v=[];if(h.length>0){let t=1/0,n=-1/0,o=1/0,a=-1/0;for(const e of h)t=Math.min(t,e[0]),o=Math.min(o,e[1]),n=Math.max(n,e[0]),a=Math.max(a,e[1]);n>=r.x&&t<=i.x&&a>=r.y&&o<=i.y&&(v=[h.map((t=>new e.Point(t[0],t[1])))],(t<r.x||n>i.x||o<r.y||a>i.y)&&(v=e.clipLine(v,r.x,r.y,i.x,i.y)))}for(const e of v){o.reset(e,.25*t);let r=0;r=o.length<=.5*t?1:Math.ceil(o.paddedLength/m)+1;for(let e=0;e<r;e++){const i=e/Math.max(r-1,1),a=o.lerp(i),s=a.x+mt,l=a.y+mt;g.push(s,l,t,0);const c=s-t,h=l-t,f=s+t,p=l+t;if(L=L&&this.isOffscreen(c,h,f,p),R=R||this.isInsideGrid(c,h,f,p),!n&&this.grid.hitTestCircle(s,l,t,d)&&(I=!0,!u))return{circles:[],offscreen:!1,collisionDetected:I,occluded:!1}}}}return{circles:!u&&I||!R?[]:g,offscreen:L,collisionDetected:I,occluded:T.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const n=[];let r=1/0,i=1/0,o=-1/0,a=-1/0;for(const s of t){const t=new e.Point(s.x+mt,s.y+mt);r=Math.min(r,t.x),i=Math.min(i,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y),n.push(t)}const s=this.grid.query(r,i,o,a).concat(this.ignoredGrid.query(r,i,o,a)),l={},c={};for(const t of s){const r=t.key;if(void 0===l[r.bucketInstanceId]&&(l[r.bucketInstanceId]={}),l[r.bucketInstanceId][r.featureIndex])continue;const i=[new e.Point(t.x1,t.y1),new e.Point(t.x2,t.y1),new e.Point(t.x2,t.y2),new e.Point(t.x1,t.y2)];e.polygonIntersectsPolygon(n,i)&&(l[r.bucketInstanceId][r.featureIndex]=!0,void 0===c[r.bucketInstanceId]&&(c[r.bucketInstanceId]=[]),c[r.bucketInstanceId].push(r.featureIndex))}return c}insertCollisionBox(e,t,n,r,i){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:r,collisionGroupID:i},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,n,r,i){const o=t?this.ignoredGrid:this.grid,a={bucketInstanceId:n,featureIndex:r,collisionGroupID:i};for(let t=0;t<e.length;t+=4)o.insertCircle(a,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,n,r,i,o,a,s){const l=[n,r,i,1];let c=!1;if(i||this.transform.pitch>0){if(e.transformMat4$1(l,l,t),this.fogState&&o&&"globe"!==s.name){const t=function(t,n,r,i,o,a){const s=a.calculateFogTileMatrix(o),l=[n,r,i];return e.transformMat4(l,l,s),T(t,l,a.pitch,a._fov)}(this.fogState,n,r,i,o.toUnwrapped(),this.transform);c=t>.9}}else pt(l,l,t);const u=l[3];return{point:new e.Point((l[0]/u+1)/2*this.transform.width+mt,(-l[1]/u+1)/2*this.transform.height+mt),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(s)/u*.5,1.5),signedDistanceFromCamera:u,occluded:a&&l[2]>u||c}}isOffscreen(e,t,n,r){return n<mt||e>=this.screenRightBoundary||r<mt||t>this.screenBottomBoundary}isInsideGrid(e,t,n,r){return n>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.identity([]);return e.translate(t,t,[-100,-100,0]),t}}function vt(t,n,r){const i=n.createTileMatrix(t,t.worldSize,r.toUnwrapped());return e.multiply(new Float32Array(16),t.projMatrix,i)}function yt(e,t,n){if(t.projection.name===n.projection.name)return e.projMatrix;const r=n.clone();return r.setProjection(t.projection),vt(r,t.getProjection(),e)}function _t(e,t,n){return t.name===n.projection.name?e.projMatrix:vt(n,t,e)}class xt{constructor(e,t,n,r){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):r&&n?1:0,this.placed=n}isHidden(){return 0===this.opacity&&!this.placed}}class wt{constructor(e,t,n,r,i,o=!1){this.text=new xt(e?e.text:null,t,n,i),this.icon=new xt(e?e.icon:null,t,r,i),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class bt{constructor(e,t,n,r=!1){this.text=e,this.icon=t,this.skipFade=n,this.clipped=r}}class Et{constructor(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]}}class kt{constructor(e,t,n,r,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i}}class Tt{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function Mt(t,n,r,i,o){const{horizontalAlign:a,verticalAlign:s}=e.getAnchorAlignment(t),l=-(a-.5)*n,c=-(s-.5)*r,u=e.evaluateVariableOffset(t,i);return new e.Point(l+u[0]*o,c+u[1]*o)}function St(t,n,r,i,o){const a=new e.Point(t,n);return r&&a._rotate(i?o:-o),a}class Ct{constructor(e,t,n,r,i){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new gt(this.transform,i),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new Tt(n),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,r,i){const o=r.getBucket(n),a=r.latestFeatureIndex;if(!o||!a||n.id!==o.layerIds[0])return;const s=o.layers[0].layout,l=r.collisionBoxArray,c=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/e.EXTENT,h=r.tileID.toUnwrapped();this.transform.setProjection(o.projection);const d=(f=r.tileID,p=o.getProjection(),m=this.transform,p.name===this.projection?m.calculateProjMatrix(f.toUnwrapped()):vt(m,p,f));var f,p,m;const g="map"===s.get("text-pitch-alignment"),v="map"===s.get("text-rotation-alignment");n.compileFilter();const y=n.dynamicFilter(),_=n.dynamicFilterNeedsFeature(),x=this.transform.calculatePixelsToTileUnitsMatrix(r),w=tt(d,r.tileID.canonical,g,v,this.transform,o.getProjection(),x);let b=null;if(g){const t=nt(d,r.tileID.canonical,g,v,this.transform,o.getProjection(),x);b=e.multiply([],this.transform.labelPlaneMatrix,t)}let E=null;y&&r.latestFeatureIndex&&(E={unwrappedTileID:h,dynamicFilter:y,dynamicFilterNeedsFeature:_,featureIndex:r.latestFeatureIndex}),this.retainedQueryData[o.bucketInstanceId]=new kt(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID);const k={bucket:o,layout:s,posMatrix:d,textLabelPlaneMatrix:w,labelToScreenMatrix:b,clippingData:E,scale:c,textPixelRatio:u,holdingForFade:r.holdingForFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:e.evaluateSizeForZoom(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(i)for(const e of o.sortKeyRanges){const{sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i}=e;t.push({sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i,parameters:k})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:k})}attemptAnchorPlacement(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v){const{textOffset0:y,textOffset1:_,crossTileID:x}=h,w=[y,_],b=Mt(e,n,r,w,i),E=this.collisionIndex.placeCollisionBox(f,i,t,St(b.x,b.y,o,a,this.transform.angle),u,s,l,c.predicate);if(m){const e=f.getSymbolInstanceIconSize(v,this.transform.zoom,h.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(f,e,m,St(b.x,b.y,o,a,this.transform.angle),u,s,l,c.predicate).box.length)return}if(E.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[x]&&this.prevPlacement.placements[x]&&this.prevPlacement.placements[x].text&&(t=this.prevPlacement.variableOffsets[x].anchor),this.variableOffsets[x]={textOffset:w,width:n,height:r,anchor:e,textScale:i,prevAnchor:t},this.markUsedJustification(f,e,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[x]=p),{shift:b,placedGlyphBoxes:E}}}placeLayerBucketPart(t,n,r,i){const{bucket:o,layout:a,posMatrix:s,textLabelPlaneMatrix:l,labelToScreenMatrix:c,clippingData:u,textPixelRatio:h,holdingForFade:d,collisionBoxArray:f,partiallyEvaluatedTextSize:p,partiallyEvaluatedIconSize:m,collisionGroup:g}=t.parameters,v=a.get("text-optional"),y=a.get("icon-optional"),_=a.get("text-allow-overlap"),x=a.get("icon-allow-overlap"),w="map"===a.get("text-rotation-alignment"),b="map"===a.get("text-pitch-alignment"),E="none"!==a.get("icon-text-fit"),k="viewport-y"===a.get("symbol-z-order");this.transform.setProjection(o.projection);let T=_&&(x||!o.hasIconData()||y),M=x&&(_||!o.hasTextData()||v);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f),r&&i&&o.updateCollisionDebugBuffers(this.transform.zoom,f);const S=(t,i,f)=>{const{crossTileID:k,numVerticalGlyphVertices:S}=t;if(u){const r={zoom:this.transform.zoom,pitch:this.transform.pitch};let i=null;if(u.dynamicFilterNeedsFeature){const e=this.retainedQueryData[o.bucketInstanceId];i=u.featureIndex.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,u.dynamicFilter)(r,i,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new e.Point(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(u.unwrappedTileID)))return this.placements[k]=new bt(!1,!1,!1,!0),void n.add(k)}if(n.has(k))return;if(d)return void(this.placements[k]=new bt(!1,!1,!1));let C=!1,A=!1,I=!0,R=!1,L=!1,z=null,P={box:null,offscreen:null,occluded:null},O={box:null,offscreen:null,occluded:null},D=null,B=null,F=null,j=0,N=0,V=0;f.textFeatureIndex?j=f.textFeatureIndex:t.useRuntimeCollisionCircles&&(j=t.featureIndex),f.verticalTextFeatureIndex&&(N=f.verticalTextFeatureIndex);const U=e=>{e.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const t=this.transform.elevation;(t||e.elevation)&&(e.elevation=t?t.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0)},H=f.textBox;if(H){U(H);const n=n=>{let r=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!n&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[k];e&&(this.placedOrientations[k]=e,r=e,this.markUsedOrientation(o,r,t))}return r},r=(t,n)=>{if(o.allowVerticalPlacement&&S>0&&f.verticalTextBox){for(const r of o.writingModes)if(r===e.WritingMode.vertical?(P=n(),O=P):P=t(),P&&P.box&&P.box.length)break}else P=t()};if(a.get("text-variable-anchor")){let l=a.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[k]){const e=this.prevPlacement.variableOffsets[k];l.indexOf(e.anchor)>0&&(l=l.filter((t=>t!==e.anchor)),l.unshift(e.anchor))}const c=(e,n,r)=>{const a=o.getSymbolInstanceTextSize(p,t,this.transform.zoom,i),c=(e.x2-e.x1)*a+2*e.padding,u=(e.y2-e.y1)*a+2*e.padding,d=E&&!x?n:null;d&&U(d);let f={box:[],offscreen:!1,occluded:!1};const v=_?2*l.length:l.length;for(let n=0;n<v;++n){const v=this.attemptAnchorPlacement(l[n%l.length],e,c,u,a,w,b,h,s,g,n>=l.length,t,i,o,r,d,p,m);if(v&&(f=v.placedGlyphBoxes,f&&f.box&&f.box.length)){C=!0,z=v.shift;break}}return f};r((()=>c(H,f.iconBox,e.WritingMode.horizontal)),(()=>{const t=f.verticalTextBox;return t&&U(t),o.allowVerticalPlacement&&!(P&&P.box&&P.box.length)&&S>0&&t?c(t,f.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null,occluded:null}})),P&&(C=P.box,I=P.offscreen,R=P.occluded);const u=n(!(!P||!P.box));if(!C&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[k];e&&(this.variableOffsets[k]=e,this.markUsedJustification(o,e.anchor,t,u))}}else{const a=(n,r)=>{const a=o.getSymbolInstanceTextSize(p,t,this.transform.zoom,i),l=this.collisionIndex.placeCollisionBox(o,a,n,new e.Point(0,0),_,h,s,g.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(o,r,t),this.placedOrientations[k]=r),l};r((()=>a(H,e.WritingMode.horizontal)),(()=>{const t=f.verticalTextBox;return o.allowVerticalPlacement&&S>0&&t?(U(t),a(t,e.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}})),n(!!(P&&P.box&&P.box.length))}}if(D=P,C=D&&D.box&&D.box.length>0,I=D&&D.offscreen,R=D&&D.occluded,t.useRuntimeCollisionCircles){const n=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),i=e.evaluateSizeForFeature(o.textSizeData,p,n),u=a.get("text-padding");B=this.collisionIndex.placeCollisionCircles(o,_,n,o.lineVertexArray,o.glyphOffsetArray,i,s,l,c,r,b,g.predicate,t.collisionCircleDiameter*i/e.ONE_EM,u,this.retainedQueryData[o.bucketInstanceId].tileID),C=_||B.circles.length>0&&!B.collisionDetected,I=I&&B.offscreen,R=B.occluded}if(f.iconFeatureIndex&&(V=f.iconFeatureIndex),f.iconBox){const n=n=>{U(n);const r=E&&z?St(z.x,z.y,w,b,this.transform.angle):new e.Point(0,0),i=o.getSymbolInstanceIconSize(m,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,i,n,r,x,h,s,g.predicate)};O&&O.box&&O.box.length&&f.verticalIconBox?(F=n(f.verticalIconBox),A=F.box.length>0):(F=n(f.iconBox),A=F.box.length>0),I=I&&F.offscreen,L=F.occluded}const W=v||0===t.numHorizontalGlyphVertices&&0===S,$=y||0===t.numIconVertices;if(W||$?$?W||(A=A&&C):C=A&&C:A=C=A&&C,C&&D&&D.box&&this.collisionIndex.insertCollisionBox(D.box,a.get("text-ignore-placement"),o.bucketInstanceId,O&&O.box&&N?N:j,g.ID),A&&F&&this.collisionIndex.insertCollisionBox(F.box,a.get("icon-ignore-placement"),o.bucketInstanceId,V,g.ID),B&&(C&&this.collisionIndex.insertCollisionCircles(B.circles,a.get("text-ignore-placement"),o.bucketInstanceId,j,g.ID),r)){const e=o.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Et);for(let e=0;e<B.circles.length;e+=4)t.circles.push(B.circles[e+0]),t.circles.push(B.circles[e+1]),t.circles.push(B.circles[e+2]),t.circles.push(B.collisionDetected?1:0)}const G="globe"!==o.projection.name;T=T&&(G||!R),M=M&&(G||!L),this.placements[k]=new bt(C||T,A||M,I||o.justReloaded),n.add(k)};if(k){const e=o.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const n=e[t];S(o.symbolInstances.get(n),n,o.collisionArrays[n])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)S(o.symbolInstances.get(e),e,o.collisionArrays[e]);if(r&&o.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[o.bucketInstanceId];e.invert(t.invProjMatrix,s),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}markUsedJustification(t,n,r,i){const{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:l,crossTileID:c}=r,u=e.getAnchorJustification(n),h=i===e.WritingMode.vertical?l:"left"===u?o:"center"===u?a:"right"===u?s:-1;o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=h>=0&&o!==h?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=h>=0&&a!==h?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=h>=0&&s!==h?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=h>=0&&l!==h?0:c)}markUsedOrientation(t,n,r){const i=n===e.WritingMode.horizontal||n===e.WritingMode.horizontalOnly?n:0,o=n===e.WritingMode.vertical?n:0,{leftJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=r,u=t.text.placedSymbolArray;a>=0&&(u.get(a).placedOrientation=i),s>=0&&(u.get(s).placedOrientation=i),l>=0&&(u.get(l).placedOrientation=i),c>=0&&(u.get(c).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const r=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},o=t?t.variableOffsets:{},a=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=i[e];o?(this.opacities[e]=new wt(o,r,t.text,t.icon,null,t.clipped),n=n||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new wt(null,r,t.text,t.icon,t.skipFade,t.clipped),n=n||t.text||t.icon)}for(const e in i){const t=i[e];if(!this.opacities[e]){const i=new wt(t,r,!1,!1);i.isHidden()||(this.opacities[e]=i,n=n||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in a)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=a[e]);n?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const n=new Set;for(const r of t){const t=r.getBucket(e);t&&r.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,n,r.collisionBoxArray)}}updateBucketOpacities(t,n,r){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const i=t.layers[0].layout,o=!!t.layers[0].dynamicFilter(),a=new wt(null,0,!1,!1,!0),s=i.get("text-allow-overlap"),l=i.get("icon-allow-overlap"),c=i.get("text-variable-anchor"),u="map"===i.get("text-rotation-alignment"),h="map"===i.get("text-pitch-alignment"),d="none"!==i.get("icon-text-fit"),f=new wt(null,0,s&&(l||!t.hasIconData()||i.get("icon-optional")),l&&(s||!t.hasTextData()||i.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);const p=(e,t,n)=>{for(let r=0;r<t/4;r++)e.opacityVertexArray.emplaceBack(n)};let m=0;for(let r=0;r<t.symbolInstances.length;r++){const i=t.symbolInstances.get(r),{numHorizontalGlyphVertices:s,numVerticalGlyphVertices:l,crossTileID:g,numIconVertices:v}=i,y=n.has(g);let _=this.opacities[g];y?_=a:_||(_=f,this.opacities[g]=_),n.add(g);const x=s>0||l>0,w=v>0,b=this.placedOrientations[g],E=b===e.WritingMode.vertical,k=b===e.WritingMode.horizontal||b===e.WritingMode.horizontalOnly;if(!x&&!w||_.isHidden()||m++,x){const e=Bt(_.text);p(t.text,s,E?Ft:e),p(t.text,l,k?Ft:e);const n=_.text.isHidden(),{leftJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:c}=i,u=t.text.placedSymbolArray,h=n||E?1:0;r>=0&&(u.get(r).hidden=h),o>=0&&(u.get(o).hidden=h),a>=0&&(u.get(a).hidden=h),c>=0&&(u.get(c).hidden=n||k?1:0);const d=this.variableOffsets[g];d&&this.markUsedJustification(t,d.anchor,i,b);const f=this.placedOrientations[g];f&&(this.markUsedJustification(t,"left",i,f),this.markUsedOrientation(t,f,i))}if(w){const e=Bt(_.icon),{placedIconSymbolIndex:n,verticalPlacedIconSymbolIndex:r}=i,o=t.icon.placedSymbolArray,a=_.icon.isHidden()?1:0;n>=0&&(p(t.icon,v,E?Ft:e),o.get(n).hidden=a),r>=0&&(p(t.icon,i.numVerticalIconVertices,k?Ft:e),o.get(r).hidden=a)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const n=t.collisionArrays[r];if(n){let r=new e.Point(0,0),i=!0;if(n.textBox||n.verticalTextBox){if(c){const e=this.variableOffsets[g];e?(r=Mt(e.anchor,e.width,e.height,e.textOffset,e.textScale),u&&r._rotate(h?this.transform.angle:-this.transform.angle)):i=!1}o&&(i=!_.clipped),n.textBox&&At(t.textCollisionBox.collisionVertexArray,_.text.placed,!i||E,r.x,r.y),n.verticalTextBox&&At(t.textCollisionBox.collisionVertexArray,_.text.placed,!i||k,r.x,r.y)}const a=i&&Boolean(!k&&n.verticalIconBox);n.iconBox&&At(t.iconCollisionBox.collisionVertexArray,_.icon.placed,a,d?r.x:0,d?r.y:0),n.verticalIconBox&&At(t.iconCollisionBox.collisionVertexArray,_.icon.placed,!a,d?r.x:0,d?r.y:0)}}}if(t.fullyClipped=0===m,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const n=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*n>e}setStale(){this.stale=!0}}function At(e,t,n,r,i){e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0),e.emplaceBack(t?1:0,n?1:0,r||0,i||0)}const It=Math.pow(2,25),Rt=Math.pow(2,24),Lt=Math.pow(2,17),zt=Math.pow(2,16),Pt=Math.pow(2,9),Ot=Math.pow(2,8),Dt=Math.pow(2,1);function Bt(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,n=Math.floor(127*e.opacity);return n*It+t*Rt+n*Lt+t*zt+n*Pt+t*Ot+n*Dt+t}const Ft=0;class jt{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,n,r,i){const o=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(o,r,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<o.length;){const e=o[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,n,0===e.symbolInstanceStart),this._currentPartIndex++,i())return!0}return!1}}class Nt{constructor(e,t,n,r,i,o,a,s){this.placement=new Ct(e,i,o,a,s),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=r,this._done=!1}isDone(){return this._done}continuePlacement(t,n,r){const i=e.exported.now(),o=()=>{const t=e.exported.now()-i;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const e=n[t[this._currentPlacementIndex]],i=this.placement.collisionIndex.transform.zoom;if("symbol"===e.type&&(!e.minzoom||e.minzoom<=i)&&(!e.maxzoom||e.maxzoom>i)){if(this._inProgressLayer||(this._inProgressLayer=new jt(e)),this._inProgressLayer.continuePlacement(r[e.source],this.placement,this._showCollisionBoxes,e,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Vt=512/e.EXTENT/2;class Ut{constructor(t,n,r){this.tileID=t,this.bucketInstanceId=r,this.index=new e.KDBush(n.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const i=t.canonical.x*e.EXTENT,o=t.canonical.y*e.EXTENT;for(let e=0;e<n.length;e++){const{key:t,crossTileID:r,tileAnchorX:a,tileAnchorY:s}=n.get(e),l=Math.floor((i+a)*Vt),c=Math.floor((o+s)*Vt);this.index.add(l,c),this.keys.push(t),this.crossTileIDs.push(r)}this.index.finish()}findMatches(t,n,r){const i=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z),o=Vt/Math.pow(2,n.canonical.z-this.tileID.canonical.z),a=n.canonical.x*e.EXTENT,s=n.canonical.y*e.EXTENT;for(let e=0;e<t.length;e++){const n=t.get(e);if(n.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:u}=n,h=Math.floor((a+c)*o),d=Math.floor((s+u)*o),f=this.index.range(h-i,d-i,h+i,d+i);for(const e of f){const t=this.crossTileIDs[e];if(this.keys[e]===l&&!r.has(t)){r.add(t),n.crossTileID=t;break}}}}}class Ht{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Wt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const n=this.indexes[e],r={};for(const e in n){const i=n[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),r[i.tileID.key]=i}this.indexes[e]=r}this.lng=e}addBucket(e,t,n){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]=new Set);const r=this.usedCrossTileIDs[e.overscaledZ];for(const n in this.indexes){const i=this.indexes[n];if(Number(n)>e.overscaledZ)for(const n in i){const o=i[n];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,r)}else{const o=i[e.scaledTo(Number(n)).key];o&&o.findMatches(t.symbolInstances,e,r)}}for(let e=0;e<t.symbolInstances.length;e++){const i=t.symbolInstances.get(e);i.crossTileID||(i.crossTileID=n.generate(),r.add(i.crossTileID))}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Ut(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const n of t.crossTileIDs)this.usedCrossTileIDs[e].delete(n)}removeStaleBuckets(e){let t=!1;for(const n in this.indexes){const r=this.indexes[n];for(const i in r)e[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],t=!0)}return t}}class $t{constructor(){this.layerIndexes={},this.crossTileIDs=new Ht,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,n,r){let i=this.layerIndexes[e.id];void 0===i&&(i=this.layerIndexes[e.id]=new Wt);let o=!1;const a={};"globe"!==r.name&&i.handleWrapJump(n);for(const n of t){const t=n.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(n.tileID,t,this.crossTileIDs)&&(o=!0),a[t.bucketInstanceId]=!0)}return i.removeStaleBuckets(a)&&(o=!0),o}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0}));for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}const Gt=(t,n)=>e.emitValidationErrors(t,n&&n.filter((e=>"source.canvas"!==e.identifier))),qt=e.pick(Ue,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Zt=e.pick(Ue,["setCenter","setZoom","setBearing","setPitch"]),Xt={version:8,layers:[],sources:{}},Yt={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Kt extends e.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new A(je(),this),this.imageManager=new x,this.imageManager.setEventedParent(this),this.glyphManager=new e.GlyphManager(t._requestManager,n.localFontFamily?e.LocalGlyphMode.all:n.localIdeographFontFamily?e.LocalGlyphMode.ideographs:e.LocalGlyphMode.none,n.localFontFamily||n.localIdeographFontFamily),this.crossTileSymbolIndex=new $t,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());const r=this;this._rtlTextPluginCallback=Kt.registerForPluginStateChange((t=>{r.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,n)=>{if(e.triggerPluginCompletionEvent(t),n&&n.every((e=>e)))for(const e in r._sourceCaches){const t=r._sourceCaches[e],n=t.getSource().type;"vector"!==n&&"geojson"!==n||t.reload()}}))})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const n=this._layers[e];n.source===t.id&&this._validateLayer(n)}}))}loadURL(t,n={}){this.fire(new e.Event("dataloading",{dataType:"style"}));const r="boolean"==typeof n.validate?n.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,n.accessToken);const i=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(i,((t,n)=>{this._request=null,t?this.fire(new e.ErrorEvent(t)):n&&this._load(n,r)}))}loadJSON(t,n={}){this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.exported.frame((()=>{this._request=null,this._load(t,!1!==n.validate)}))}loadEmpty(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(Xt,!1)}_updateLayerCount(e,t){const n=t?1:-1;e.is3D()&&(this._num3DLayers+=n),"circle"===e.type&&(this._numCircleLayers+=n),"symbol"===e.type&&(this._numSymbolLayers+=n)}_load(t,n){if(n&&Gt(this,e.validateStyle(t)))return;this._loaded=!0,this.stylesheet=e.clone$1(t),this._updateMapProjection();for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1});this._changed=!1,t.sprite?this._loadSprite(t.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(t.glyphs);const r=Ve(this.stylesheet.layers);this._order=r.map((e=>e.id)),this._layers={},this._serializedLayers={};for(const t of r){const n=e.createStyleLayer(t);n.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=n,this._serializedLayers[n.id]=n.serialize(),this._updateLayerCount(n,!0)}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new b(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(t){this._spriteRequest=function(t,n,r){let i,o,a;const s=e.exported.devicePixelRatio>1?"@2x":"";let l=e.getJSON(n.transformRequest(n.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),((e,t)=>{l=null,a||(a=e,i=t,u())})),c=e.getImage(n.transformRequest(n.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),((e,t)=>{c=null,a||(a=e,o=t,u())}));function u(){if(a)r(a);else if(i&&o){const t=e.exported.getImageData(o),n={};for(const r in i){const{width:o,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:d,content:f}=i[r],p=new e.RGBAImage({width:o,height:a});e.RGBAImage.copy(t,p,{x:s,y:l},{x:0,y:0},{width:o,height:a}),n[r]={data:p,pixelRatio:u,sdf:c,stretchX:h,stretchY:d,content:f}}r(null,n)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,((t,n)=>{if(this._spriteRequest=null,t)this.fire(new e.ErrorEvent(t));else if(n)for(const e in n)this.imageManager.addImage(e,n[e]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new e.Event("data",{dataType:"style"}))}))}_validateLayer(t){const n=this.getSource(t.source);if(!n)return;const r=t.sourceLayer;r&&("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new e.ErrorEvent(new Error(`Source layer "${r}" does not exist on source "${n.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(e){const t=[];for(const n of e){const e=this._layers[n];"custom"!==e.type&&t.push(e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(e){return!!this.terrain&&("function"==typeof e.isLayerDraped?e.isLayerDraped():Yt[e.type])}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const e=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(e.length||n.length)&&this._updateWorkerLayers(e,n);for(const e in this._updatedSources){const t=this._updatedSources[e];"reload"===t?this._reloadSource(e):"clear"===t&&this._clearSource(e)}this._updateTilesForChangedImages();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this._resetUpdates()}const r={};for(const e in this._sourceCaches){const t=this._sourceCaches[e];r[e]=t.used,t.used=!1}for(const e of this._order){const n=this._layers[e];if(n.recalculate(t,this._availableImages),!n.isHidden(t.zoom)){const e=this._getLayerSourceCache(n);e&&(e.used=!0)}const r=this.map.painter;if(r){const e=n.getProgramIds();if(!e)continue;const i=n.getProgramConfiguration(t.zoom);for(const t of e)r.useProgram(t,i)}}for(const t in r){const n=this._sourceCaches[t];r[t]!==n.used&&n.getSource().fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:n.getSource().id}))}this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),n&&this.fire(new e.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const t in this._sourceCaches)this._sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(n){if(this._checkLoaded(),Gt(this,e.validateStyle(n)))return!1;(n=e.clone$1(n)).layers=Ve(n.layers);const r=function(e,n){if(!e)return[{command:Ue.setStyle,args:[n]}];let r=[];try{if(!t(e.version,n.version))return[{command:Ue.setStyle,args:[n]}];t(e.center,n.center)||r.push({command:Ue.setCenter,args:[n.center]}),t(e.zoom,n.zoom)||r.push({command:Ue.setZoom,args:[n.zoom]}),t(e.bearing,n.bearing)||r.push({command:Ue.setBearing,args:[n.bearing]}),t(e.pitch,n.pitch)||r.push({command:Ue.setPitch,args:[n.pitch]}),t(e.sprite,n.sprite)||r.push({command:Ue.setSprite,args:[n.sprite]}),t(e.glyphs,n.glyphs)||r.push({command:Ue.setGlyphs,args:[n.glyphs]}),t(e.transition,n.transition)||r.push({command:Ue.setTransition,args:[n.transition]}),t(e.light,n.light)||r.push({command:Ue.setLight,args:[n.light]}),t(e.fog,n.fog)||r.push({command:Ue.setFog,args:[n.fog]}),t(e.projection,n.projection)||r.push({command:Ue.setProjection,args:[n.projection]});const i={},o=[];!function(e,n,r,i){let o;for(o in n=n||{},e=e||{})e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||We(o,r,i));for(o in n){if(!n.hasOwnProperty(o))continue;const a=n[o];e.hasOwnProperty(o)?t(e[o],a)||("geojson"===e[o].type&&"geojson"===a.type&&Ge(e,n,o)?r.push({command:Ue.setGeoJSONSourceData,args:[o,a.data]}):$e(o,n,r,i)):He(o,n,r)}}(e.sources,n.sources,o,i);const a=[];e.layers&&e.layers.forEach((e=>{e.source&&i[e.source]?r.push({command:Ue.removeLayer,args:[e.id]}):a.push(e)}));let s=e.terrain;s&&i[s.source]&&(r.push({command:Ue.setTerrain,args:[void 0]}),s=void 0),r=r.concat(o),t(s,n.terrain)||r.push({command:Ue.setTerrain,args:[n.terrain]}),function(e,n,r){n=n||[];const i=(e=e||[]).map(Ze),o=n.map(Ze),a=e.reduce(Xe,{}),s=n.reduce(Xe,{}),l=i.slice(),c=Object.create(null);let u,h,d,f,p,m,g;for(u=0,h=0;u<i.length;u++)d=i[u],s.hasOwnProperty(d)?h++:(r.push({command:Ue.removeLayer,args:[d]}),l.splice(l.indexOf(d,h),1));for(u=0,h=0;u<o.length;u++)d=o[o.length-1-u],l[l.length-1-u]!==d&&(a.hasOwnProperty(d)?(r.push({command:Ue.removeLayer,args:[d]}),l.splice(l.lastIndexOf(d,l.length-h),1)):h++,m=l[l.length-u],r.push({command:Ue.addLayer,args:[s[d],m]}),l.splice(l.length-u,0,d),c[d]=!0);for(u=0;u<o.length;u++)if(d=o[u],f=a[d],p=s[d],!c[d]&&!t(f,p))if(t(f.source,p.source)&&t(f["source-layer"],p["source-layer"])&&t(f.type,p.type)){for(g in qe(f.layout,p.layout,r,d,null,Ue.setLayoutProperty),qe(f.paint,p.paint,r,d,null,Ue.setPaintProperty),t(f.filter,p.filter)||r.push({command:Ue.setFilter,args:[d,p.filter]}),t(f.minzoom,p.minzoom)&&t(f.maxzoom,p.maxzoom)||r.push({command:Ue.setLayerZoomRange,args:[d,p.minzoom,p.maxzoom]}),f)f.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?qe(f[g],p[g],r,d,g.slice(6),Ue.setPaintProperty):t(f[g],p[g])||r.push({command:Ue.setLayerProperty,args:[d,g,p[g]]}));for(g in p)p.hasOwnProperty(g)&&!f.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?qe(f[g],p[g],r,d,g.slice(6),Ue.setPaintProperty):t(f[g],p[g])||r.push({command:Ue.setLayerProperty,args:[d,g,p[g]]}))}else r.push({command:Ue.removeLayer,args:[d]}),m=l[l.lastIndexOf(d)+1],r.push({command:Ue.addLayer,args:[p,m]})}(a,n.layers,r)}catch(e){console.warn("Unable to compute style diff:",e),r=[{command:Ue.setStyle,args:[n]}]}return r}(this.serialize(),n).filter((e=>!(e.command in Zt)));if(0===r.length)return!1;const i=r.filter((e=>!(e.command in qt)));if(i.length>0)throw new Error(`Unimplemented: ${i.map((e=>e.command)).join(", ")}.`);return r.forEach((e=>{"setTransition"!==e.command&&"setProjection"!==e.command&&this[e.command].apply(this,e.args)})),this.stylesheet=n,this._updateMapProjection(),!0}addImage(t,n){return this.getImage(t)?this.fire(new e.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,n),this._afterImageUpdated(t),this)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t),this._afterImageUpdated(t),this):this.fire(new e.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(t,n,r={}){if(this._checkLoaded(),void 0!==this.getSource(t))throw new Error("There is already a source with this ID");if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(e.validateSource,`sources.${t}`,n,null,r))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const i=Ie(t,n,this.dispatcher,this);i.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(t),source:i.serialize(),sourceId:t})));const o=n=>{const r=(n?"symbol:":"other:")+t,o=this._sourceCaches[r]=new e.SourceCache(r,i,n);(n?this._symbolSourceCaches:this._otherSourceCaches)[t]=o,o.style=this,o.onAdd(this.map)};o(!1),"vector"!==n.type&&"geojson"!==n.type||o(!0),i.onAdd&&i.onAdd(this.map),this._changed=!0}removeSource(t){this._checkLoaded();const n=this.getSource(t);if(!n)throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===t)return this.fire(new e.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${n}" is using it.`)));if(this.terrain&&this.terrain.get().source===t)return this.fire(new e.ErrorEvent(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));const r=this._getSourceCaches(t);for(const t of r)delete this._sourceCaches[t.id],delete this._updatedSources[t.id],t.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles();return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],n.setEventedParent(null),n.onRemove&&n.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getSource(e).setData(t),this._changed=!0}getSource(e){const t=this._getSourceCache(e);return t&&t.getSource()}_getSources(){const e=[];for(const t in this._otherSourceCaches){const n=this._getSourceCache(t);n&&e.push(n.getSource())}return e}addLayer(t,n,r={}){this._checkLoaded();const i=t.id;if(this.getLayer(i))return void this.fire(new e.ErrorEvent(new Error(`Layer with id "${i}" already exists on this map`)));let o;if("custom"===t.type){if(Gt(this,e.validateCustomStyleLayer(t)))return;o=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateLayer,`layers.${i}`,t,{arrayIndex:-1},r))return;o=e.createStyleLayer(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize(),this._updateLayerCount(o,!0)}const a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)return void this.fire(new e.ErrorEvent(new Error(`Layer with id "${n}" does not exist on this map.`)));this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o;const s=this._getLayerSourceCache(o);if(this._removedLayers[i]&&o.source&&s&&"custom"!==o.type){const e=this._removedLayers[i];delete this._removedLayers[i],e.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",s.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const r=this._order.indexOf(t);this._order.splice(r,1);const i=n?this._order.indexOf(n):this._order.length;n&&-1===i?this.fire(new e.ErrorEvent(new Error(`Layer with id "${n}" does not exist on this map.`))):(this._order.splice(i,0,t),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be removed.`)));n.setEventedParent(null),this._updateLayerCount(n,!1);const r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(e){return this._layers[e]}hasLayer(e){return e in this._layers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(t,n,r){this._checkLoaded();const i=this.getLayer(t);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(n,r,i={}){this._checkLoaded();const o=this.getLayer(n);if(o){if(!t(o.filter,r))return null==r?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(e.validateFilter,`layers.${o.id}.filter`,r,{layerType:o.type},i)||(o.filter=e.clone$1(r),this._updateLayer(o)))}else this.fire(new e.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be filtered.`)))}getFilter(t){const n=this.getLayer(t);return n&&e.clone$1(n.filter)}setLayoutProperty(n,r,i,o={}){this._checkLoaded();const a=this.getLayer(n);a?t(a.getLayoutProperty(r),i)||(a.setLayoutProperty(r,i,o),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(t,n){const r=this.getLayer(t);if(r)return r.getLayoutProperty(n);this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style.`)))}setPaintProperty(n,r,i,o={}){this._checkLoaded();const a=this.getLayer(n);a?t(a.getPaintProperty(r),i)||(a.setPaintProperty(r,i,o)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new e.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(e,t){const n=this.getLayer(e);return n&&n.getPaintProperty(t)}setFeatureState(t,n){this._checkLoaded();const r=t.source,i=t.sourceLayer,o=this.getSource(r);if(!o)return void this.fire(new e.ErrorEvent(new Error(`The source '${r}' does not exist in the map's style.`)));const a=o.type;if("geojson"===a&&i)return void this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===a&&!i)return void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided.")));const s=this._getSourceCaches(r);for(const e of s)e.setFeatureState(i,t.id,n)}removeFeatureState(t,n){this._checkLoaded();const r=t.source,i=this.getSource(r);if(!i)return void this.fire(new e.ErrorEvent(new Error(`The source '${r}' does not exist in the map's style.`)));const o=i.type,a="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!a)return void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(n&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const s=this._getSourceCaches(r);for(const e of s)e.removeFeatureState(a,t.id,n)}getFeatureState(t){this._checkLoaded();const n=t.source,r=t.sourceLayer,i=this.getSource(n);if(i){if("vector"!==i.type||r)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(n)[0].getFeatureState(r,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const t={};for(const e in this._sourceCaches){const n=this._sourceCaches[e].getSource();t[n.id]||(t[n.id]=n.serialize())}return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:t,layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0;const t=this._getLayerSourceCache(e);e.source&&!this._updatedSources[e.source]&&t&&"raster"!==t.getSource().type&&(this._updatedSources[e.source]="reload",t.pause()),this._changed=!0,e.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._layers[e].type,n={},r=[];for(let i=this._order.length-1;i>=0;i--){const o=this._order[i];if(t(o)){n[o]=i;for(const t of e){const e=t[o];if(e)for(const t of e)r.push(t)}}}r.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const i=[];for(let o=this._order.length-1;o>=0;o--){const a=this._order[o];if(t(a))for(let e=r.length-1;e>=0;e--){const t=r[e].feature;if(n[t.layer.id]<o)break;i.push(t),r.pop()}else for(const t of e){const e=t[a];if(e)for(const t of e)i.push(t.feature)}}return i}queryRenderedFeatures(t,n,r){n&&n.filter&&this._validate(e.validateFilter,"queryRenderedFeatures.filter",n.filter,null,n);const i={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const t of n.layers){const n=this._layers[t];if(!n)return this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];i[n.source]=!0}}const o=[];n.availableImages=this._availableImages;const a=n&&n.layers?n.layers.some((e=>{const t=this.getLayer(e);return t&&t.is3D()})):this.has3DLayers(),s=R.createFromScreenPoints(t,r);for(const e in this._sourceCaches){const t=this._sourceCaches[e].getSource().id;n.layers&&!i[t]||o.push(Le(this._sourceCaches[e],this._layers,this._serializedLayers,s,n,r,a,!!this.map._showQueryGeometry))}return this.placement&&o.push(function(e,t,n,r,i,o,a){const s={},l=o.queryRenderedSymbols(r),c=[];for(const e of Object.keys(l).map(Number))c.push(a[e]);c.sort(Pe);for(const n of c){const r=n.featureIndex.lookupSymbolFeatures(l[n.bucketInstanceId],t,n.bucketIndex,n.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(const e in r){const t=s[e]=s[e]||[],i=r[e];i.sort(((e,t)=>{const r=n.featureSortOrder;if(r){const n=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex}));for(const e of i)t.push(e)}}for(const t in s)s[t].forEach((r=>{const i=r.feature,o=n(e[t]);if(!o)return;const a=o.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=a}));return s}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),s.screenGeometry,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,n){n&&n.filter&&this._validate(e.validateFilter,"querySourceFeatures.filter",n.filter,null,n);const r=this._getSourceCaches(t);let i=[];for(const e of r)i=i.concat(ze(e,n));return i}addSourceType(e,t,n){return Kt.getSourceType(e)?n(new Error(`A source type called "${e}" already exists.`)):(Kt.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},n):n(null,null))}getLight(){return this.light.getLight()}setLight(e,n={}){this._checkLoaded();const r=this.light.getLight();let i=!1;for(const n in e)if(!t(e[n],r[n])){i=!0;break}if(!i)return;const o=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(e,n),this.light.updateTransitions(o)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(n,r=1){if(this._checkLoaded(),!n)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);let i=n;if(1===r){if("object"==typeof i.source){const t="terrain-dem-src";this.addSource(t,i.source),i=e.clone$1(i),i=e.extend(i,{source:t})}if(this._validate(e.validateTerrain,"terrain",i))return}if(!this.terrain||this.terrain&&r!==this.terrain.drapeRenderMode){if(!i)return;this._createTerrain(i,r)}else{const n=this.terrain,r=n.get();for(const t of Object.keys(e.spec.terrain))!i.hasOwnProperty(t)&&e.spec.terrain[t].default&&(i[t]=e.spec.terrain[t].default);for(const e in i)if(!t(i[e],r[e])){n.set(i),this.stylesheet.terrain=i;const e=this._setTransitionParameters({duration:0});n.updateTransitions(e);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new C(e,this.map.transform);this.stylesheet.fog=e;const n=this._setTransitionParameters({duration:0});t.updateTransitions(n)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const e of this.map._markers)e._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(e){if(this._checkLoaded(),!e)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const n=this.fog,r=n.get();0===Object.keys(e).length&&n.set(e);for(const i in e)if(!t(e[i],r[i])){n.set(e),this.stylesheet.fog=e;const t=this._setTransitionParameters({duration:0});n.updateTransitions(t);break}}else this._createFog(e);this._markersNeedUpdate=!0}_setTransitionParameters(t){return{now:e.exported.now(),transition:e.extend(t,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const e=this._order.filter((e=>this.isLayerDraped(this._layers[e]))),t=this._order.filter((e=>!this.isLayerDraped(this._layers[e])));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const n=this.terrain=new k(e,t);this.stylesheet.terrain=e,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const r=this._setTransitionParameters({duration:0});n.updateTransitions(r)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,n,r,i,o={}){return(!o||!1!==o.validate)&&Gt(this,t.call(e.validateStyle,e.extend({key:n,style:this.serialize(),value:r,styleSpec:e.spec},i)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles(),this._sourceCaches[e].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(e){const t=this._getSourceCaches(e);for(const e of t)e.clearTiles()}_reloadSource(e){const t=this._getSourceCaches(e);for(const e of t)e.resume(),e.reload()}_reloadSources(){for(const e of this._getSources())e.reload&&e.reload()}_updateSources(e){for(const t in this._sourceCaches)this._sourceCaches[t].update(e)}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_updatePlacement(t,n,r,i,o=!1){let a=!1,s=!1;const l={};for(const e of this._order){const n=this._layers[e];if("symbol"!==n.type)continue;if(!l[n.source]){const e=this._getLayerSourceCache(n);if(!e)continue;l[n.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const r=this.crossTileSymbolIndex.addLayer(n,l[n.source],t.center.lng,t.projection);a=a||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),o=o||this._layerOrderChanged||0===r,this._layerOrderChanged&&this.fire(new e.Event("neworder")),(o||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.exported.now(),t.zoom))&&(this.pauseablePlacement=new Nt(t,this._order,o,n,r,i,this.placement,this.fog&&t.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.exported.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(const e of this._order){const t=this._layers[e];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.exported.now())}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,t,n){this.imageManager.getImages(t.icons,n),this._updateTilesForChangedImages();const r=e=>{e&&e.setDependencies(t.tileID.key,t.type,t.icons)};r(this._otherSourceCaches[t.source]),r(this._symbolSourceCaches[t.source])}getGlyphs(e,t,n){this.glyphManager.getGlyphs(t.stacks,n)}getResource(t,n,r){return e.makeRequest(n,r)}_getSourceCache(e){return this._otherSourceCaches[e]}_getLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}_getSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const n=this._getSourceCaches(t);return 0===n.length?(this.fire(new e.ErrorEvent(new Error(`There is no source with ID '${t}'`))),!1):n.every((e=>e.loaded()))}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Kt.getSourceType=function(e){return Ae[e]},Kt.setSourceType=function(e,t){Ae[e]=t},Kt.registerForPluginStateChange=e.registerForPluginStateChange;var Jt="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#define HALF_PI PI/2.0\n#define QUARTER_PI PI/4.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0",Qt="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",en="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\nconst float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",tn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",nn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif";let rn={},on={};const an=[];hn(Jt,an),hn(en,an),hn(tn,an),hn(nn,an),rn=dn("",en),on=dn(nn,tn);const sn=dn("\n#if __VERSION__ >=300\n#define varying in\n#define gl_FragColor glFragColor\n#define texture2D texture\n#define textureCube texture\nout vec4 glFragColor;\n#endif\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}","\n#if __VERSION__ >=300\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),ln=Jt,cn="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif";var un={background:dn("uniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nvarying vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform vec4 u_color;varying vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(u_color);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:dn("uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:dn("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:dn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:dn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:dn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:dn("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:dn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:dn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:dn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:dn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:dn("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:dn("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:dn("varying vec4 v_color;\n#ifdef RENDER_SHADOWS\nvarying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\nvoid main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvec3 normal=v_normal;\n#endif\nfloat z;vec4 color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);\n#else\ncolor=v_color;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef ZERO_ROOF_RADIUS\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#endif\ncolor.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nv_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(color,NdotL);\n#else\nv_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_color*=u_opacity;\n#ifdef ZERO_ROOF_RADIUS\nv_roof_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef LIGHTING_3D_MODE\nv_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));\n#else\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:dn("uniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,v_NdotL)*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_NdotL=NdotL;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:dn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:dn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\ngl_FragColor=apply_lighting(gl_FragColor);\n#endif\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:dn("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nuniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nfloat linearstep(float edge0,float edge1,float x) {return  clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture2D(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trimmed=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);trimmed=0.0;}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);\n#ifdef RENDER_LINE_BORDER_AUTO\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}\n#else\nout_color.rgb=mix(u_border_color.rgb*u_border_color.a*trimmed,out_color.rgb,smoothAlpha);\n#endif\n}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nattribute highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:dn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:dn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:dn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:dn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:dn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_sdf);}"),terrainRaster:dn("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef RENDER_SHADOWS\ncolor.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nconst float wireframeOffset=0.00015;void main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=wireframeOffset;\n#endif\nv_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}"),terrainDepth:dn("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;varying float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:dn("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Qt),skyboxGradient:dn("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",Qt),skyboxCapture:dn("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:dn("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#else\ncolor=texture2D(u_image0,v_pos0);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nattribute vec3 a_globe_pos;attribute vec2 a_uv;\n#else\nattribute vec2 a_pos;\n#endif\nvarying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nglobe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}"),globeAtmosphere:dn("uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:\n(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:\nuv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}","attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}")};function hn(e,t){const n=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let e of n)if(e=e.trim(),"#"===e[0]&&e.includes("if")&&!e.includes("endif")){e=e.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const n=e.split(" ");for(const e of n)t.includes(e)||t.push(e)}}function dn(e,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),i={},o=[...an];return hn(e,o),hn(t,o),{fragmentSource:e=e.replace(n,((e,t,n,r,o)=>(i[o]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nvarying ${n} ${r} ${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${o}\n    ${n} ${r} ${o} = u_${o};\n#endif\n`))),vertexSource:t=t.replace(n,((e,t,n,r,o)=>{const a="float"===r?"vec2":"vec4",s=o.match(/color/)?"color":a;return i[o]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${n} ${a} a_${o};\nvarying ${n} ${r} ${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${o} = a_${o};\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n    ${o} = unpack_mix_${s}(a_${o}, u_${o}_t);\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${n} ${a} a_${o};\n#else\nuniform ${n} ${r} u_${o};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${n} ${r} ${o} = a_${o};\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n    ${n} ${r} ${o} = unpack_mix_${s}(a_${o}, u_${o}_t);\n#else\n    ${n} ${r} ${o} = u_${o};\n#endif\n`})),staticAttributes:r,usedDefines:o}}class fn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,n,r,i,o,a){this.context=e;let s=this.boundPaintVertexBuffers.length!==r.length;for(let e=0;!s&&e<r.length;e++)this.boundPaintVertexBuffers[e]!==r[e]&&(s=!0);let l=this.boundDynamicVertexBuffers.length!==a.length;for(let e=0;!l&&e<a.length;e++)this.boundDynamicVertexBuffers[e]!==a[e]&&(l=!0);if(!e.extVertexArrayObject||!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||s||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==o)this.freshBind(t,n,r,i,o,a);else{e.bindVertexArrayOES.set(this.vao);for(const e of a)e&&e.bind();i&&i.dynamicDraw&&i.bind()}}freshBind(e,t,n,r,i,o){let a;const s=e.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),a=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffers=o;else{a=l.currentNumAttributes||0;for(let e=s;e<a;e++)c.disableVertexAttribArray(e)}t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,i);for(const t of n)t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,i);for(const t of o)t&&(t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,i));r&&r.bind(),l.currentNumAttributes=s}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function pn(t,n){const r=Math.pow(2,n.canonical.z),i=n.canonical.y;return[new e.MercatorCoordinate(0,i/r).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/r).toLngLat().lat]}function mn(t,n,r,i,o,a,s){const l=t.context,c=l.gl,u=r.fbo;if(!u)return;t.prepareDrawTile();const h=t.useProgram("hillshade");l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment.get());const d=((e,t,n,r)=>{const i=n.paint.get("hillshade-shadow-color"),o=n.paint.get("hillshade-highlight-color"),a=n.paint.get("hillshade-accent-color");let s=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);const l=!e.options.moving;return{u_matrix:r||e.transform.calculateProjMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:pn(0,t.tileID),u_light:[n.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:o,u_accent:a}})(t,r,i,t.terrain?n.projMatrix:null);t.prepareDrawProgram(l,h,n.toUnwrapped());const{tileBoundsBuffer:f,tileBoundsIndexBuffer:p,tileBoundsSegments:m}=t.getTileBoundsBuffers(r);h.draw(l,c.TRIANGLES,o,a,s,e.CullFaceMode.disabled,d,i.id,f,p,m)}function gn(t,n,r){if(!n.needsDEMTextureUpload)return;const i=t.context,o=i.gl;i.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||t.getTileTexture(r.stride);const a=r.getPixels();n.demTexture?n.demTexture.update(a,{premultiply:!1}):n.demTexture=new e.Texture(i,a,o.RGBA,{premultiply:!1}),n.needsDEMTextureUpload=!1}function vn(t,n,r,i,o,a){const s=t.context,l=s.gl;if(!n.dem)return;const c=n.dem;if(s.activeTexture.set(l.TEXTURE1),gn(t,n,c),!n.demTexture)return;n.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);const u=c.dim;s.activeTexture.set(l.TEXTURE0);let h=n.fbo;if(!h){const t=new e.Texture(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),h=n.fbo=s.createFramebuffer(u,u,!0),h.colorAttachment.set(t.texture)}s.bindFramebuffer.set(h.framebuffer),s.viewport.set([0,0,u,u]);const{tileBoundsBuffer:d,tileBoundsIndexBuffer:f,tileBoundsSegments:p}=t.getMercatorTileBoundsBuffers();t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,o,a,e.CullFaceMode.disabled,((t,n)=>{const r=n.stride,i=e.create();return e.ortho(i,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(i,i,[0,-e.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:n.unpackVector}})(n.tileID,c),r.id,d,f,p),n.needsHillshadePrepare=!1}const yn=t=>({u_matrix:new e.UniformMatrix4f(t),u_image0:new e.Uniform1i(t),u_skirt_height:new e.Uniform1f(t)}),_n=(e,t)=>({u_matrix:e,u_image0:0,u_skirt_height:t}),xn=(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(r),u_merc_matrix:n,u_zoom_transition:i,u_merc_center:o,u_image0:0,u_frustum_tl:a,u_frustum_tr:s,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:h,u_viewport:d,u_grid_matrix:p?Float32Array.from(p):new Float32Array(9),u_skirt_height:f});function wn(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const bn=new class{constructor(){this.operations={}}newMorphing(e,t,n,r,i){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==n.tileID.key&&(t.queued=n)}else this.operations[e]={startTime:r,phase:0,duration:i,from:t,to:n,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const n=this.operations[t];for(n.phase=(e-n.startTime)/n.duration;n.phase>=1||!this._validOp(n);)if(!this._nextOp(n,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},En={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function kn(e){return 6*Math.pow(1.5,22-e)}function Tn(e,t){const n=1<<e.z;return!t&&(0===e.x||e.x===n-1)||0===e.y||e.y===n-1}const Mn=e=>({u_matrix:e});function Sn(t,n,r,i,o){if(o>0){const a=e.exported.now(),s=(a-t.timeAdded)/o,l=n?(a-n.timeAdded)/o:-1,c=r.getSource(),u=i.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!n||Math.abs(n.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),d=h&&t.refreshedUponExpiration?1:e.clamp(h?s:1-l,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}class Cn extends e.SourceCache{constructor(e){const t={type:"raster-dem",maxzoom:e.transform.maxZoom},n=new A(je(),null),r=Ie("mock-dem",t,n,e.style);super("mock-dem",r,!1),r.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class An extends e.SourceCache{constructor(e){const t=Ie("proxy",{type:"geojson",maxzoom:e.transform.maxZoom},new A(je(),null),e.style);super("proxy",t,!1),t.setEventedParent(this),this.map=this.getSource().map=e,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(t,n,r){if(t.freezeTileCoverage)return;this.transform=t;const i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((n,r)=>{if(n[r.key]="",!this._tiles[r.key]){const n=new e.Tile(r,this._source.tileSize*r.overscaleFactor(),t.tileZoom);n.state="loaded",this._tiles[r.key]=n}return n}),{});for(const e in this._tiles)e in i||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const n=Object.values(t);this.renderCachePool.push(...n),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach((e=>e.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class In extends e.OverscaledTileID{constructor(e,t,n){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=n}}class Rn extends e.Elevation{constructor(t,n){super(),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[r,i,o]=function(t){const n=new e.StructArrayLayout2i4,r=new e.StructArrayLayout3ui6,i=131;n.reserve(17161),r.reserve(33800);const o=e.EXTENT/128,a=e.EXTENT+o/2,s=a+o;for(let t=-o;t<s;t+=o)for(let r=-o;r<s;r+=o){const i=r<0||r>a||t<0||t>a?24575:0,o=e.clamp(Math.round(r),0,e.EXTENT),s=e.clamp(Math.round(t),0,e.EXTENT);n.emplaceBack(o+i,s)}const l=(e,t)=>{const n=t*i+e;r.emplaceBack(n+1,n,n+i),r.emplaceBack(n+i,n+i+1,n+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)l(t,e);return[0,129].forEach((e=>{for(let t=0;t<130;t++)l(t,e),l(e,t)})),[n,r,32768]}(),a=t.context;this.gridBuffer=a.createVertexBuffer(r,e.posAttributes.members),this.gridIndexBuffer=a.createIndexBuffer(i),this.gridSegments=e.SegmentVector.simpleSegment(0,0,r.length,i.length),this.gridNoSkirtSegments=e.SegmentVector.simpleSegment(0,0,r.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new An(n.map),this.orthoMatrix=e.create(),e.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.EXTENT,0,e.EXTENT,0,1);const s=a.gl;this._overlapStencilMode=new e.StencilMode({func:s.GEQUAL,mask:255},0,255,s.KEEP,s.KEEP,s.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=n,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Cn(n.map)}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),e.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=e,this._checkRenderCacheEfficiency(),this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache()}))}update(t,n,r){if(t&&t.terrain){this._style!==t&&(this.style=t),this.enabled=!0;const i=t.terrain.properties;this.sourceCache=0===t.terrain.drapeRenderMode?this._mockSourceCache:t._getSourceCache(i.get("source")),this._exaggeration=i.get("exaggeration");const o=()=>{this.sourceCache.used&&e.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(n,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,o(),this._initializing=!0),o(),n.updateElevation(!0,r),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(n),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const t=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==t.efficiency&&e.warnOnce(`Terrain render cache efficiency is not optimal (${t.efficiency}%) and performance\n                may be affected negatively, consider placing all background, fill and line layers before layer\n                with id '${t.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._sourceCaches)this._style._sourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach((e=>e.fb.destroy())),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const n=this.proxySourceCache,r=this.painter.transform;this._initializing&&(this._initializing=0===r._centerAltitude&&-1===this.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(r.center),-1),this._emptyDEMTextureDirty=!this._initializing);const i=this.proxyCoords=n.getIds().map((e=>{const t=n.getTileByID(e).tileID;return t.projMatrix=r.calculateProjMatrix(t.toUnwrapped()),t}));!function(t,n){const r=n.transform.pointCoordinate(n.transform.getCameraPoint()),i=new e.Point(r.x,r.y);t.sort(((t,n)=>{if(n.overscaledZ-t.overscaledZ)return n.overscaledZ-t.overscaledZ;const r=new e.Point(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),o=new e.Point(n.canonical.x+(1<<n.canonical.z)*n.wrap,n.canonical.y),a=i.mult(1<<t.canonical.z);return a.x-=.5,a.y-=.5,a.distSqr(r)-a.distSqr(o)}))}(i,this.painter),this._previousZoom=r.zoom;const o=this.proxyToSource||{};this.proxyToSource={},i.forEach((e=>{this.proxyToSource[e.key]={}})),this.terrainTileForTile={};const a=this._style._sourceCaches;for(const e in a){const n=a[e];if(!n.used)continue;if(n!==this.sourceCache&&this.resetTileLookupCache(n.id),this._setupProxiedCoordsForOrtho(n,t[e],o),n.usedForTerrain)continue;const r=t[e];n.getSource().reparseOverscaled&&this._assignTerrainTiles(r)}this.proxiedCoords[n.id]=i.map((e=>new In(e,e.key,this.orthoMatrix))),this._assignTerrainTiles(i),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1,this._updateTimestamp=e.exported.now();const s={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const n=t.tileID.key;n in s||(this._visibleDemTiles.push(t),s[n]=n)}}_assignTerrainTiles(e){this._initializing||e.forEach((e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)}))}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const n in this.terrainTileForTile){const r=this.terrainTileForTile[n],i=r.dem;!i||r.demTexture&&!r.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),gn(this.painter,r,i))}}_prepareDemTileUniforms(e,t,n,r){if(!t||null==t.demTexture)return!1;const i=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-i.z),a=r||"";return n[`u_dem_tl${a}`]=[i.x*o%1,i.y*o%1],n[`u_dem_scale${a}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const t=this.painter.context,n=t.gl;if(!this._emptyDepthBufferTexture){const r=new e.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new e.Texture(t,r,n.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let e=0;const t=this._visibleDemTiles.reduce(((t,n)=>{if(!n.dem)return t;const r=n.dem.tree.minimums[0];return r>0&&e++,t+r}),0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,n=t.gl;t.activeTexture.set(n.TEXTURE2);const r=this._getLoadedAreaMinimum(),i=new e.RGBAImage({width:1,height:1},new Uint8Array(e.DEMData.pack(r,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(i,{premultiply:!1}):o=this._emptyDEMTexture=new e.Texture(t,i,n.RGBA,{premultiply:!1}),o}setupElevationDraw(t,n,r){const i=this.painter.context,o=i.gl,a=(s=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:e.DEMData.getUnpackVector(s),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var s;a.u_dem_size=this.sourceCache.getSource().tileSize,a.u_exaggeration=this.exaggeration();let l=null,c=null,u=1;if(r&&r.morphing&&this._useVertexMorphing){const e=r.morphing.srcDemTile,n=r.morphing.dstDemTile;u=r.morphing.phase,e&&n&&(this._prepareDemTileUniforms(t,e,a,"_prev")&&(c=e),this._prepareDemTileUniforms(t,n,a)&&(l=n))}if(c&&l?(i.activeTexture.set(o.TEXTURE2),l.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),i.activeTexture.set(o.TEXTURE4),c.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),a.u_dem_lerp=u):(l=this.terrainTileForTile[t.tileID.key],i.activeTexture.set(o.TEXTURE2),(this._prepareDemTileUniforms(t,l,a)?l.demTexture:this.emptyDEMTexture).bind(o.NEAREST,o.CLAMP_TO_EDGE)),i.activeTexture.set(o.TEXTURE3),r&&r.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),this._depthFBO&&(a.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),a.u_depth_size_inv=[1,1]),r&&r.useMeterToDem&&l){const t=(1<<l.tileID.canonical.z)*e.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;a.u_meter_to_dem=t}if(r&&r.labelPlaneMatrixInv&&(a.u_label_plane_matrix_inv=r.labelPlaneMatrixInv),n.setTerrainUniformValues(i,a),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,r&&r.useDenormalizedUpVectorScale);n.setGlobeUniformValues(i,e)}}globeUniformValues(t,n,r){const i=t.projection;return{u_tile_tl_up:i.upVector(n,0,0),u_tile_tr_up:i.upVector(n,e.EXTENT,0),u_tile_br_up:i.upVector(n,e.EXTENT,e.EXTENT),u_tile_bl_up:i.upVector(n,0,e.EXTENT),u_tile_up_scale:r?e.globeMetersToEcef(1):i.upVectorScale(n,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const n=this.painter,r=this.painter.context;0!==t.length&&(r.bindFramebuffer.set(null),r.viewport.set([0,0,n.width,n.height]),n.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,n,r,i,o){if("globe"===t.transform.projection.name)!function(t,n,r,i,o){const a=t.context,s=a.gl;let l,c;const u=t.options.showTerrainWireframe?2:0,h=t.transform,d=e.globeUseCustomAntiAliasing(t,a,h),f=(e,n)=>{if(c===e)return;const r=[En[e],"PROJECTION_GLOBE_VIEW"];d&&r.push("CUSTOM_ANTIALIASING"),n&&r.push(En[u]),l=t.useProgram("globeRaster",null,r),c=e},p=t.colorModeForRenderPass(),m=new e.DepthMode(s.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);bn.update(o);const g=e.calculateGlobeMercatorMatrix(h),v=[e.mercatorXfromLng(h.center.lng),e.mercatorYfromLat(h.center.lat)],y=u?[!1,!0]:[!1],_=t.globeSharedBuffers,x=[h.width*e.exported.devicePixelRatio,h.height*e.exported.devicePixelRatio],w=Float32Array.from(h.globeMatrix),b={useDenormalizedUpVectorScale:!0};if(y.forEach((u=>{const h=t.transform,d=kn(h.zoom)*n.exaggeration();c=-1;const y=u?s.LINES:s.TRIANGLES;for(const c of i){const i=r.getTile(c),E=e.StencilMode.disabled,k=n.prevTerrainTileForTile[c.key],T=n.terrainTileForTile[c.key];wn(k,T)&&bn.newMorphing(c.key,k,T,o,250),a.activeTexture.set(s.TEXTURE0),i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const M=bn.getMorphValuesForProxy(c.key),S=M?1:0;M&&e.extend$1(b,{morphing:{srcDemTile:M.from,dstDemTile:M.to,phase:e.easeCubicInOut(M.phase)}});const C=e.tileCornersToBounds(c.canonical),A=e.getLatitudinalLod(C.getCenter().lat),I=e.getGridMatrix(c.canonical,C,A,h.worldSize/h._pixelsPerMercatorPixel),R=e.globeNormalizeECEF(e.globeTileBounds(c.canonical)),L=xn(h.projMatrix,w,g,R,e.globeToMercatorTransition(h.zoom),v,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x,d,I);if(f(S,u),n.setupElevationDraw(i,l,b),t.prepareDrawProgram(a,l,c.toUnwrapped()),_){const[n,r,i]=u?_.getWirefameBuffers(t.context,A):_.getGridBuffers(A,0!==d);l.draw(a,y,m,E,p,e.CullFaceMode.backCCW,L,"globe_raster",n,r,i)}}})),_){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];d&&o.push("CUSTOM_ANTIALIASING"),l=t.useProgram("globeRaster",null,o);for(const o of i){const{x:i,y:c,z:u}=o.canonical,d=0===c,f=c===(1<<u)-1,[g,y,w,E]=_.getPoleBuffers(u);if(E&&(d||f)){const c=r.getTile(o);a.activeTexture.set(s.TEXTURE0),c.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);let _=e.globePoleMatrixForTile(u,i,h);const k=e.globeNormalizeECEF(e.globeTileBounds(o.canonical)),T=(t,n)=>t.draw(a,s.TRIANGLES,m,e.StencilMode.disabled,p,e.CullFaceMode.disabled,xn(h.projMatrix,_,_,k,0,v,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x,0),"globe_pole_raster",n,w,E);n.setupElevationDraw(c,l,b),t.prepareDrawProgram(a,l,o.toUnwrapped()),d&&T(l,g),f&&(_=e.scale(e.create(),_,[1,-1,1]),T(l,y))}}}}(t,n,r,i,o);else{const a=t.context,s=a.gl;let l,c;const u=t.options.showTerrainWireframe?2:0,h=(e,n)=>{if(c===e)return;const r=[En[e]];n&&r.push(En[u]),l=t.useProgram("terrainRaster",null,r),c=e},d=t.colorModeForRenderPass(),f=new e.DepthMode(s.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);bn.update(o);const p=t.transform,m=kn(p.zoom)*n.exaggeration();(u?[!1,!0]:[!1]).forEach((u=>{c=-1;const g=u?s.LINES:s.TRIANGLES,[v,y]=u?n.getWirefameBuffer():[n.gridIndexBuffer,n.gridSegments];for(const c of i){const i=r.getTile(c),_=e.StencilMode.disabled,x=n.prevTerrainTileForTile[c.key],w=n.terrainTileForTile[c.key];wn(x,w)&&bn.newMorphing(c.key,x,w,o,250),a.activeTexture.set(s.TEXTURE0),i.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST);const b=bn.getMorphValuesForProxy(c.key),E=b?1:0;let k;b&&(k={morphing:{srcDemTile:b.from,dstDemTile:b.to,phase:e.easeCubicInOut(b.phase)}});const T=_n(c.projMatrix,Tn(c.canonical,p.renderWorldCopies)?m/10:m);h(E,u),n.setupElevationDraw(i,l,k),t.prepareDrawProgram(a,l,c.toUnwrapped()),l.draw(a,g,f,_,d,e.CullFaceMode.backCCW,T,"terrain_raster",n.gridBuffer,v,y)}}))}}(n,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,n.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const n=this.painter,r=this.painter.context,i=this.proxySourceCache,o=this.proxiedCoords[i.id],a=this._drapedRenderBatches.shift(),s=[],l=n.style.order;let c=0;for(const u of o){const o=i.getTileByID(u.proxyTileKey),h=i.proxyCachedFBO[u.key]?i.proxyCachedFBO[u.key][t]:void 0,d=void 0!==h?i.renderCache[h]:this.pool[c++],f=void 0!==h;if(o.texture=d.tex,f&&!d.dirty){s.push(o.tileID);continue}let p;r.bindFramebuffer.set(d.fb.framebuffer),this.renderedToTile=!1,d.dirty&&(r.clear({color:e.Color.transparent,stencil:0}),d.dirty=!1);for(let e=a.start;e<=a.end;++e){const t=n.style._layers[l[e]];if(t.isHidden(n.transform.zoom))continue;const i=n.style._getLayerSourceCache(t),o=i?this.proxyToSource[u.key][i.id]:[u];if(!o)continue;const a=o;r.viewport.set([0,0,d.fb.width,d.fb.height]),p!==(i?i.id:null)&&(this._setupStencil(d,o,t,i),p=i?i.id:null),n.renderLayer(n,i,t,a)}this.renderedToTile?(d.dirty=!0,s.push(o.tileID)):f||--c,5===c&&(c=0,this.renderToBackBuffer(s))}return this.renderToBackBuffer(s),this.renderingToTexture=!1,r.bindFramebuffer.set(null),r.viewport.set([0,0,n.width,n.height]),a.end+1}postRender(){}renderCacheEfficiency(e){const t=e.order.length;if(0===t)return{efficiency:100};let n,r=0,i=0,o=!1;for(let a=0;a<t;++a){const t=e._layers[e.order[a]];this._style.isLayerDraped(t)?(o&&++r,++i):o||(o=!0,n=t.id)}return 0===i?{efficiency:100}:{efficiency:100*(1-r/i),firstUndrapedLayer:n}}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter((e=>e.dem)).forEach((t=>{e=Math.min(e,t.dem.tree.minimums[0])})),0===e?e:(e-30)*this._exaggeration}raycast(e,t,n){if(!this._visibleDemTiles)return null;const r=this._visibleDemTiles.filter((e=>e.dem)).map((r=>{const i=r.tileID,o=1<<i.overscaledZ,{x:a,y:s}=i.canonical,l=a/o,c=(a+1)/o,u=s/o,h=(s+1)/o;return{minx:l,miny:u,maxx:c,maxy:h,t:r.dem.tree.raycastRoot(l,u,c,h,e,t,n),tile:r}}));r.sort(((e,t)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE)));for(const i of r){if(null==i.t)return null;const r=i.tile.dem.tree.raycast(i.minx,i.miny,i.maxx,i.maxy,e,t,n);if(null!=r)return r}return null}_createFBO(){const t=this.painter.context,n=t.gl,r=this.drapeBufferSize;t.activeTexture.set(n.TEXTURE0);const i=new e.Texture(t,{width:r[0],height:r[1],data:null},n.RGBA);i.bind(n.LINEAR,n.CLAMP_TO_EDGE);const o=t.createFramebuffer(r[0],r[1],!1);return o.colorAttachment.set(i.texture),o.depthAttachment=new be(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,r[0],r[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&!t.extTextureFilterAnisotropicForceOff&&n.texParameterf(n.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:i,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const e in this._style._sourceCaches)if(this._style._sourceCaches[e].hasTransition())return!0;return this._style.order.some((e=>{const t=this._style._layers[e],n=t.isHidden(this.painter.transform.zoom);return"custom"===t.type?!n&&t.shouldRedrape():!n&&t.hasTransition()}))}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style._getSources())if(e instanceof Te){t=!0;break}if(!t)return;const n={};for(let t=0;t<this._style.order.length;++t){const r=this._style._layers[this._style.order[t]],i=this._style._getLayerSourceCache(r);if(i&&!n[i.id]&&!r.isHidden(this.painter.transform.zoom)&&"line"===r.type&&r.widthExpression()instanceof e.ZoomDependentExpression){n[i.id]=!0;for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][i.id];if(t)for(const e of t)this._clearRenderCacheForTile(i.id,e)}}}}_clearRasterLayersFromRenderCache(){let e=!1;for(const t in this._style._sourceCaches)if(this._style._sourceCaches[t]._source instanceof Me){e=!0;break}if(!e)return;const t={};for(let e=0;e<this._style.order.length;++e){const n=this._style._layers[this._style.order[e]],r=this._style._getLayerSourceCache(n);if(!r||t[r.id])continue;if(n.isHidden(this.painter.transform.zoom)||"raster"!==n.type)continue;const i=n.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][r.id];if(t)for(const e of t){const t=Sn(r.getTile(e),r.findLoadedParent(e,0),r,this.painter.transform,i);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(r.id,e)}}}}_setupDrapedRenderBatches(){const e=this._style.order,t=e.length;if(0===t)return;const n=[];let r,i=0,o=this._style._layers[e[i]];for(;!this._style.isLayerDraped(o)&&o.isHidden(this.painter.transform.zoom)&&++i<t;)o=this._style._layers[e[i]];for(;i<t;++i){const t=this._style._layers[e[i]];t.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(t)?void 0===r&&(r=i):void 0!==r&&(n.push({start:r,end:i-1}),r=void 0))}void 0!==r&&n.push({start:r,end:i-1}),this._drapedRenderBatches=n}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let n=0;n<e.length;++n){const r=Object.values(e[n]);t.renderCachePool.push(...r)}}return}this._clearRasterLayersFromRenderCache();const n=this.proxyCoords,r=this._tilesDirty;for(let i=n.length-1;i>=0;i--){const o=n[i];if(t.getTileByID(o.key),void 0!==t.proxyCachedFBO[o.key]){const n=e[o.key],i=this.proxyToSource[o.key];let a=0;for(const e in i){const t=i[e],o=n[e];if(!o||o.length!==t.length||t.some(((t,n)=>t!==o[n]||r[e]&&r[e].hasOwnProperty(t.key)))){a=-1;break}++a}for(const e in t.proxyCachedFBO[o.key])t.renderCache[t.proxyCachedFBO[o.key][e]].dirty=a<0||a!==Object.values(n).length}}const i=[...this._drapedRenderBatches];i.sort(((e,t)=>t.end-t.start-(e.end-e.start)));for(const e of i)for(const r of n){if(t.proxyCachedFBO[r.key])continue;let n=t.renderCachePool.pop();void 0===n&&t.renderCache.length<50&&(n=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==n&&(t.proxyCachedFBO[r.key]={},t.proxyCachedFBO[r.key][e.start]=n,t.renderCache[n].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,n,r){if(!r||!this._sourceTilesOverlap[r.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const i=this.painter.context,o=i.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let a;if(n.isTileClipped())a=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);a=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+a>255&&(i.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=a,this._overlapStencilMode.ref=this._stencilRef,n.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):e.StencilMode.disabled}_renderTileClippingMasks(t,n){const r=this.painter,i=this.painter.context,o=i.gl;r._tileClippingMaskIDs={},i.setColorMode(e.ColorMode.disabled),i.setDepthMode(e.DepthMode.disabled);const a=r.useProgram("clippingMask");for(const s of t){const t=r._tileClippingMaskIDs[s.key]=--n;a.draw(i,o.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:o.ALWAYS,mask:0},t,255,o.KEEP,o.KEEP,o.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,Mn(s.projMatrix),"$clipping",r.tileExtentBuffer,r.quadTriangleIndexBuffer,r.tileExtentSegments)}}pointCoordinate(t){const n=this.painter.transform;if(t.x<0||t.x>n.width||t.y<0||t.y>n.height)return null;const r=[t.x,t.y,1,1];e.transformMat4$1(r,r,n.pixelMatrixInverse),e.scale$1(r,r,1/r[3]),r[0]/=n.worldSize,r[1]/=n.worldSize;const i=n._camera.position,o=e.mercatorZfromAltitude(1,n.center.lat),a=[i[0],i[1],i[2]/o,0],s=e.subtract([],r.slice(0,3),a);e.normalize(s,s);const l=this.raycast(a,s,this._exaggeration);return null!==l&&l?(e.scaleAndAdd(a,a,s,l),a[3]=a[2],a[2]*=o,a):null}drawDepth(){const t=this.painter,n=t.context,r=this.proxySourceCache,i=Math.ceil(t.width),o=Math.ceil(t.height);if(!this._depthFBO||this._depthFBO.width===i&&this._depthFBO.height===o||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const t=n.gl,r=n.createFramebuffer(i,o,!0);n.activeTexture.set(t.TEXTURE0);const a=new e.Texture(n,{width:i,height:o,data:null},t.RGBA);a.bind(t.NEAREST,t.CLAMP_TO_EDGE),r.colorAttachment.set(a.texture);const s=n.createRenderbuffer(n.gl.DEPTH_COMPONENT16,i,o);r.depthAttachment.set(s),this._depthFBO=r,this._depthTexture=a}n.bindFramebuffer.set(this._depthFBO.framebuffer),n.viewport.set([0,0,i,o]),function(t,n,r,i){if("globe"===t.transform.projection.name)return;const o=t.context,a=o.gl;o.clear({depth:1});const s=t.useProgram("terrainDepth"),l=new e.DepthMode(a.LESS,e.DepthMode.ReadWrite,t.depthRangeFor3D);for(const t of i){const i=r.getTile(t),c=_n(t.projMatrix,0);n.setupElevationDraw(i,s),s.draw(o,a.TRIANGLES,l,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.backCCW,c,"terrain_depth",n.gridBuffer,n.gridIndexBuffer,n.gridNoSkirtSegments)}}(t,this,r,this.proxyCoords)}_setupProxiedCoordsForOrtho(e,t,n){if(e.getSource()instanceof Ce)return this._setupProxiedCoordsForImageSource(e,t,n);this._findCoveringTileCache[e.id]=this._findCoveringTileCache[e.id]||{};const r=this.proxiedCoords[e.id]=[],i=this.proxyCoords;for(let t=0;t<i.length;t++){const o=i[t],a=this._findTileCoveringTileID(o,e);if(a){const t=this._createProxiedId(o,a,n[o.key]&&n[o.key][e.id]);r.push(t),this.proxyToSource[o.key][e.id]=[t]}}let o=!1;for(let i=0;i<t.length;i++){const a=e.getTile(t[i]);if(!a||!a.hasData())continue;const s=this._findTileCoveringTileID(a.tileID,this.proxySourceCache);if(s&&s.tileID.canonical.z!==a.tileID.canonical.z){const t=this.proxyToSource[s.tileID.key][e.id],i=this._createProxiedId(s.tileID,a,n[s.tileID.key]&&n[s.tileID.key][e.id]);t?t.splice(t.length-1,0,i):this.proxyToSource[s.tileID.key][e.id]=[i],r.push(i),o=!0}}this._sourceTilesOverlap[e.id]=o}_setupProxiedCoordsForImageSource(t,n,r){if(!t.getSource().loaded())return;const i=this.proxiedCoords[t.id]=[],o=this.proxyCoords,a=t.getSource(),s=new e.Point(a.tileID.x,a.tileID.y)._div(1<<a.tileID.z),l=a.coordinates.map(e.MercatorCoordinate.fromLngLat).reduce(((e,t)=>(e.min.x=Math.min(e.min.x,t.x-s.x),e.min.y=Math.min(e.min.y,t.y-s.y),e.max.x=Math.max(e.max.x,t.x-s.x),e.max.y=Math.max(e.max.y,t.y-s.y),e)),{min:new e.Point(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.Point(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(t,n)=>{const r=t.wrap+t.canonical.x/(1<<t.canonical.z),i=t.canonical.y/(1<<t.canonical.z),o=e.EXTENT/(1<<t.canonical.z),a=n.wrap+n.canonical.x/(1<<n.canonical.z),s=n.canonical.y/(1<<n.canonical.z);return r+o<a+l.min.x||r>a+l.max.x||i+o<s+l.min.y||i>s+l.max.y};for(let e=0;e<o.length;e++){const a=o[e];for(let e=0;e<n.length;e++){const o=t.getTile(n[e]);if(!o||!o.hasData())continue;if(c(a,o.tileID))continue;const s=this._createProxiedId(a,o,r[a.key]&&r[a.key][t.id]),l=this.proxyToSource[a.key][t.id];l?l.push(s):this.proxyToSource[a.key][t.id]=[s],i.push(s)}}}_createProxiedId(t,n,r){let i=this.orthoMatrix;if(r){const e=r.find((e=>e.key===n.tileID.key));if(e)return e}if(n.tileID.key!==t.key){const r=t.canonical.z-n.tileID.canonical.z;let o,a,s;i=e.create();const l=n.tileID.wrap-t.wrap<<t.overscaledZ;r>0?(o=e.EXTENT>>r,a=o*((n.tileID.canonical.x<<r)-t.canonical.x+l),s=o*((n.tileID.canonical.y<<r)-t.canonical.y)):(o=e.EXTENT<<-r,a=e.EXTENT*(n.tileID.canonical.x-(t.canonical.x+l<<-r)),s=e.EXTENT*(n.tileID.canonical.y-(t.canonical.y<<-r))),e.ortho(i,0,o,0,o,0,1),e.translate(i,i,[a,s,0])}return new In(n.tileID,t.key,i)}_findTileCoveringTileID(t,n){let r=n.getTile(t);if(r&&r.hasData())return r;const i=this._findCoveringTileCache[n.id],o=i[t.key];if(r=o?n.getTileByID(o):null,r&&r.hasData()||null===o)return r;let a=r?r.tileID:t,s=a.overscaledZ;const l=n.getSource().minzoom,c=[];if(!o){const i=n.getSource().maxzoom;if(t.canonical.z>=i){const r=t.canonical.z-i;n.getSource().reparseOverscaled?(s=Math.max(t.canonical.z+2,n.transform.tileZoom),a=new e.OverscaledTileID(s,t.wrap,i,t.canonical.x>>r,t.canonical.y>>r)):0!==r&&(s=i,a=new e.OverscaledTileID(s,t.wrap,i,t.canonical.x>>r,t.canonical.y>>r))}a.key!==t.key&&(c.push(a.key),r=n.getTile(a))}const u=e=>{c.forEach((t=>{i[t]=e})),c.length=0};for(s-=1;s>=l&&(!r||!r.hasData());s--){r&&u(r.tileID.key);const e=a.calculateScaledKey(s);if(r=n.getTileByID(e),r&&r.hasData())break;const t=i[e];if(null===t)break;void 0===t?c.push(e):r=n.getTileByID(t)}return u(r?r.tileID.key:null),r&&r.hasData()?r:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let n=this._tilesDirty[e];n||(n=this._tilesDirty[e]={}),n[t.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const t=function(t){let n=0;const r=new e.StructArrayLayout2ui4,i=131;for(let e=1;e<129;e++){for(let t=1;t<129;t++)n=e*i+t,r.emplaceBack(n,n+1),r.emplaceBack(n,n+i),r.emplaceBack(n+1,n+i),128===e&&r.emplaceBack(n+i,n+i+1);r.emplaceBack(n+1,n+1+i)}return r}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(t),this.wireframeSegments=e.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,t.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Ln{static cacheKey(e,t,n,r){let i=`${t}${r?r.cacheKey:""}`;for(const t of n)e.usedDefines.includes(t)&&(i+=`/${t}`);return i}constructor(t,n,r,i,o,a){const s=t.gl;this.program=s.createProgram();const l=function(e){const t=[];for(let n=0;n<e.length;n++){if(null===e[n])continue;const r=e[n].split(" ");t.push(r.pop())}return t}(r.staticAttributes),c=i?i.getBinderAttributes():[],u=l.concat(c);let h=i?i.defines():[];h=h.concat(a.map((e=>`#define ${e}`)));const d=t.isWebGL2?"#version 300 es\n":"",f=d+h.concat(t.extStandardDerivatives&&0===d.length?"#extension GL_OES_standard_derivatives : enable\n".concat(cn):cn,cn,ln,sn.fragmentSource,on.fragmentSource,r.fragmentSource).join("\n"),p=d+h.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",ln,sn.vertexSource,on.vertexSource,rn.vertexSource,r.vertexSource).join("\n"),m=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);s.shaderSource(m,f),s.compileShader(m),s.attachShader(this.program,m);const g=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(g,p),s.compileShader(g),s.attachShader(this.program,g),this.attributes={},this.numAttributes=u.length;for(let e=0;e<this.numAttributes;e++)u[e]&&(s.bindAttribLocation(this.program,e,u[e]),this.attributes[u[e]]=e);s.linkProgram(this.program),s.deleteShader(g),s.deleteShader(m),this.fixedUniforms=o(t),this.binderUniforms=i?i.getUniforms(t):[],a.includes("TERRAIN")&&(this.terrainUniforms=(t=>({u_dem:new e.Uniform1i(t),u_dem_prev:new e.Uniform1i(t),u_dem_unpack:new e.Uniform4f(t),u_dem_tl:new e.Uniform2f(t),u_dem_scale:new e.Uniform1f(t),u_dem_tl_prev:new e.Uniform2f(t),u_dem_scale_prev:new e.Uniform1f(t),u_dem_size:new e.Uniform1f(t),u_dem_lerp:new e.Uniform1f(t),u_exaggeration:new e.Uniform1f(t),u_depth:new e.Uniform1i(t),u_depth_size_inv:new e.Uniform2f(t),u_meter_to_dem:new e.Uniform1f(t),u_label_plane_matrix_inv:new e.UniformMatrix4f(t)}))(t)),a.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.Uniform3f(t),u_tile_tr_up:new e.Uniform3f(t),u_tile_br_up:new e.Uniform3f(t),u_tile_bl_up:new e.Uniform3f(t),u_tile_up_scale:new e.Uniform1f(t)}))(t)),a.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.UniformMatrix4f(t),u_fog_range:new e.Uniform2f(t),u_fog_color:new e.Uniform4f(t),u_fog_horizon_blend:new e.Uniform1f(t),u_fog_temporal_offset:new e.Uniform1f(t),u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_globe_pos:new e.Uniform3f(t),u_globe_radius:new e.Uniform1f(t),u_globe_transition:new e.Uniform1f(t),u_is_globe:new e.Uniform1i(t),u_viewport:new e.Uniform2f(t)}))(t))}}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const n=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e]&&n[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const n=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e]&&n[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const n=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e].set(this.program,e,t[e])}}draw(e,t,n,r,i,o,a,s,l,c,u,h,d,f,p){const m=e.gl;if(this.failedToCreate)return;e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(o);for(const e of Object.keys(this.fixedUniforms))this.fixedUniforms[e].set(this.program,e,a[e]);f&&f.setUniforms(this.program,e,this.binderUniforms,h,{zoom:d});const g={[m.LINES]:2,[m.TRIANGLES]:3,[m.LINE_STRIP]:1}[t];for(const n of u.get()){const r=n.vaos||(n.vaos={});(r[s]||(r[s]=new fn)).bind(e,this,l,f?f.getPaintVertexBuffers():[],c,n.vertexOffset,p||[]),m.drawElements(t,n.primitiveLength*g,m.UNSIGNED_SHORT,n.primitiveOffset*g*2)}}}function zn(e,t){const n=Math.pow(2,t.tileID.overscaledZ),r=t.tileSize*Math.pow(2,e.transform.tileZoom)/n,i=r*(t.tileID.canonical.x+t.tileID.wrap*n),o=r*t.tileID.canonical.y;return{u_image:0,u_texsize:t.imageAtlasTexture.size,u_tile_units_to_pixels:1/I(t,1,e.transform.tileZoom),u_pixel_coord_upper:[i>>16,o>>16],u_pixel_coord_lower:[65535&i,65535&o]}}const Pn=e.create(),On=(t,n,r,i,o,a,s,l,c,u,h)=>{const d=n.style.light,f=d.properties.get("position"),p=[f.x,f.y,f.z],m=e.create$1();"viewport"===d.properties.get("anchor")&&(e.fromRotation(m,-n.transform.angle),e.transformMat3(p,p,m));const g=d.properties.get("color"),v=n.transform,y={u_matrix:t,u_lightpos:p,u_lightintensity:d.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+r,u_opacity:i,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Pn,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:o,u_edge_radius:a};return"globe"===v.projection.name&&(y.u_tile_id=[s.canonical.x,s.canonical.y,1<<s.canonical.z],y.u_zoom_transition=c,y.u_inv_rot_matrix=h,y.u_merc_center=u,y.u_up_dir=v.projection.upVector(new e.CanonicalTileID(0,0,0),u[0]*e.EXTENT,u[1]*e.EXTENT),y.u_height_lift=l),y},Dn=(t,n,r,i,o,a,s,l,c,u,h,d)=>{const f=On(t,n,r,i,o,a,s,c,u,h,d),p={u_height_factor:-Math.pow(2,s.overscaledZ)/l.tileSize/8};return e.extend(f,zn(n,l),p)},Bn=e=>({u_matrix:e}),Fn=(t,n,r)=>e.extend(Bn(t),zn(n,r)),jn=(e,t)=>({u_matrix:e,u_world:t}),Nn=(t,n,r,i)=>e.extend(Fn(t,n,r),{u_world:i}),Vn=e.create(),Un=(t,n,r,i,o,a)=>{const s=t.transform,l="globe"===s.projection.name;let c;if("map"===a.paint.get("circle-pitch-alignment"))if(l){const t=e.globePixelsToTileUnits(s.zoom,n.canonical)*s._pixelsPerMercatorPixel;c=Float32Array.from([t,0,0,t])}else c=s.calculatePixelsToTileUnitsMatrix(r);else c=new Float32Array([s.pixelsToGLUnits[0],0,0,s.pixelsToGLUnits[1]]);const u={u_camera_to_center_distance:s.cameraToCenterDistance,u_matrix:t.translatePosMatrix(n.projMatrix,r,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_device_pixel_ratio:e.exported.devicePixelRatio,u_extrude_scale:c,u_inv_rot_matrix:Vn,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(l){u.u_inv_rot_matrix=i,u.u_merc_center=o,u.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],u.u_zoom_transition=e.globeToMercatorTransition(s.zoom);const t=o[0]*e.EXTENT,r=o[1]*e.EXTENT;u.u_up_dir=s.projection.upVector(new e.CanonicalTileID(0,0,0),t,r)}return u},Hn=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t},Wn=(t,n,r,i)=>{const o=e.EXTENT/r.tileSize;return{u_matrix:t,u_camera_to_center_distance:n.getCameraToCenterDistance(i),u_extrude_scale:[n.pixelsToGLUnits[0]/o,n.pixelsToGLUnits[1]/o]}},$n=(e,t,n=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:n}),Gn=e.create(),qn=(t,n,r,i,o,a,s)=>{const l=t.transform,c="globe"===l.projection.name,u=c?e.globePixelsToTileUnits(l.zoom,n.canonical)*l._pixelsPerMercatorPixel:I(r,1,a),h={u_matrix:n.projMatrix,u_extrude_scale:u,u_intensity:s,u_inv_rot_matrix:Gn,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){h.u_inv_rot_matrix=i,h.u_merc_center=o,h.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],h.u_zoom_transition=e.globeToMercatorTransition(l.zoom);const t=o[0]*e.EXTENT,r=o[1]*e.EXTENT;h.u_up_dir=l.projection.upVector(new e.CanonicalTileID(0,0,0),t,r)}return h},Zn=(e,t,n,r,i,o,a)=>{const s=e.transform,l=s.calculatePixelsToTileUnitsMatrix(t);return{u_matrix:Kn(e,t,n,r),u_pixels_to_tile_units:l,u_device_pixel_ratio:o,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:i,u_texsize:Jn(n)?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Yn(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:a}},Xn=(e,t,n,r,i)=>{const o=e.transform;return{u_matrix:Kn(e,t,n,r),u_texsize:t.imageAtlasTexture.size,u_pixels_to_tile_units:o.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:i,u_image:0,u_tile_units_to_pixels:Yn(t,o),u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Yn(e,t){return 1/I(e,1,t.tileZoom)}function Kn(e,t,n,r){return e.translatePosMatrix(r||t.tileID.projMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}function Jn(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}const Qn=(e,t,n,r,i,o)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:n,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(s=i.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:er(i.paint.get("raster-hue-rotate")),u_perspective_transform:o};var a,s};function er(e){e*=Math.PI/180;const t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const tr=e.create(),nr=(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g)=>{const v=o.transform,y={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:v.cameraToCenterDistance,u_rotate_symbol:+r,u_aspect_ratio:v.width/v.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+c,u_pitch_with_map:+i,u_texsize:u,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:tr,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:tr,u_up_vector:[0,-1,0]};return"globe"===g.name&&(y.u_tile_id=[h.canonical.x,h.canonical.y,1<<h.canonical.z],y.u_zoom_transition=d,y.u_inv_rot_matrix=p,y.u_merc_center=f,y.u_camera_forward=v._camera.forward(),y.u_ecef_origin=e.globeECEFOrigin(v.globeMatrix,h.toUnwrapped()),y.u_tile_matrix=Float32Array.from(v.globeMatrix),y.u_up_vector=m),y},rr=(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v)=>e.extend(nr(t,n,r,i,o,a,s,l,c,u,d,f,p,m,g,v),{u_gamma_scale:i?o.transform.cameraToCenterDistance*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:e.exported.devicePixelRatio,u_is_halo:+h}),ir=(t,n,r,i,o,a,s,l,c,u,h,d,f,p,m,g)=>e.extend(rr(t,n,r,i,o,a,s,l,!0,c,!0,h,d,f,p,m,g),{u_texsize_icon:u,u_texture_icon:1}),or=(e,t,n)=>({u_matrix:e,u_opacity:t,u_color:n}),ar=(t,n,r,i,o)=>e.extend(function(e,t,n){const r=t.imageManager.getPattern(e.toString()),{width:i,height:o}=t.imageManager.getPixelSize(),a=Math.pow(2,n.tileID.overscaledZ),s=n.tileSize*Math.pow(2,t.transform.tileZoom)/a,l=s*(n.tileID.canonical.x+n.tileID.wrap*a),c=s*n.tileID.canonical.y;return{u_image:0,u_pattern_tl:r.tl,u_pattern_br:r.br,u_texsize:[i,o],u_pattern_size:r.displaySize,u_tile_units_to_pixels:1/I(n,1,t.transform.tileZoom),u_pixel_coord_upper:[l>>16,c>>16],u_pixel_coord_lower:[65535&l,65535&c]}}(i,r,o),{u_matrix:t,u_opacity:n}),sr={fillExtrusion:t=>({u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t)}),fillExtrusionPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_height_factor:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t)}),fill:t=>({u_matrix:new e.UniformMatrix4f(t)}),fillPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),fillOutline:t=>({u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t)}),fillOutlinePattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),circle:t=>({u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}),collisionBox:t=>({u_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.Uniform2f(t)}),collisionCircle:t=>({u_matrix:new e.UniformMatrix4f(t),u_inv_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_viewport_size:new e.Uniform2f(t)}),debug:t=>({u_color:new e.UniformColor(t),u_matrix:new e.UniformMatrix4f(t),u_overlay:new e.Uniform1i(t),u_overlay_scale:new e.Uniform1f(t)}),clippingMask:t=>({u_matrix:new e.UniformMatrix4f(t)}),heatmap:t=>({u_extrude_scale:new e.Uniform1f(t),u_intensity:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}),heatmapTexture:t=>({u_image:new e.Uniform1i(t),u_color_ramp:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t)}),hillshade:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_latrange:new e.Uniform2f(t),u_light:new e.Uniform2f(t),u_shadow:new e.UniformColor(t),u_highlight:new e.UniformColor(t),u_accent:new e.UniformColor(t)}),hillshadePrepare:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_dimension:new e.Uniform2f(t),u_zoom:new e.Uniform1f(t),u_unpack:new e.Uniform4f(t)}),line:t=>({u_matrix:new e.UniformMatrix4f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_units_to_pixels:new e.Uniform2f(t),u_dash_image:new e.Uniform1i(t),u_gradient_image:new e.Uniform1i(t),u_image_height:new e.Uniform1f(t),u_texsize:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t),u_trim_offset:new e.Uniform2f(t)}),linePattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_texsize:new e.Uniform2f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_units_to_pixels:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t)}),raster:t=>({u_matrix:new e.UniformMatrix4f(t),u_tl_parent:new e.Uniform2f(t),u_scale_parent:new e.Uniform1f(t),u_fade_t:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_image0:new e.Uniform1i(t),u_image1:new e.Uniform1i(t),u_brightness_low:new e.Uniform1f(t),u_brightness_high:new e.Uniform1f(t),u_saturation_factor:new e.Uniform1f(t),u_contrast_factor:new e.Uniform1f(t),u_spin_weights:new e.Uniform3f(t),u_perspective_transform:new e.Uniform2f(t)}),symbolIcon:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_texture:new e.Uniform1i(t)}),symbolSDF:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_is_halo:new e.Uniform1i(t)}),symbolTextAndIcon:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texsize_icon:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_texture_icon:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_is_halo:new e.Uniform1i(t)}),background:t=>({u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_color:new e.UniformColor(t)}),backgroundPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_pattern_tl:new e.Uniform2f(t),u_pattern_br:new e.Uniform2f(t),u_texsize:new e.Uniform2f(t),u_pattern_size:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),terrainRaster:yn,terrainDepth:yn,skybox:t=>({u_matrix:new e.UniformMatrix4f(t),u_sun_direction:new e.Uniform3f(t),u_cubemap:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}),skyboxGradient:t=>({u_matrix:new e.UniformMatrix4f(t),u_color_ramp:new e.Uniform1i(t),u_center_direction:new e.Uniform3f(t),u_radius:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}),skyboxCapture:t=>({u_matrix_3f:new e.UniformMatrix3f(t),u_sun_direction:new e.Uniform3f(t),u_sun_intensity:new e.Uniform1f(t),u_color_tint_r:new e.Uniform4f(t),u_color_tint_m:new e.Uniform4f(t),u_luminance:new e.Uniform1f(t)}),globeRaster:t=>({u_proj_matrix:new e.UniformMatrix4f(t),u_globe_matrix:new e.UniformMatrix4f(t),u_normalize_matrix:new e.UniformMatrix4f(t),u_merc_matrix:new e.UniformMatrix4f(t),u_zoom_transition:new e.Uniform1f(t),u_merc_center:new e.Uniform2f(t),u_image0:new e.Uniform1i(t),u_grid_matrix:new e.UniformMatrix3f(t),u_skirt_height:new e.Uniform1f(t),u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_globe_pos:new e.Uniform3f(t),u_globe_radius:new e.Uniform1f(t),u_viewport:new e.Uniform2f(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_horizon:new e.Uniform1f(t),u_transition:new e.Uniform1f(t),u_fadeout_range:new e.Uniform1f(t),u_color:new e.Uniform4f(t),u_high_color:new e.Uniform4f(t),u_space_color:new e.Uniform4f(t),u_star_intensity:new e.Uniform1f(t),u_star_density:new e.Uniform1f(t),u_star_size:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t),u_horizon_angle:new e.Uniform1f(t),u_rotation_matrix:new e.UniformMatrix4f(t)})};let lr;function cr(t,n,r,i,o,a,s){const l=t.context,c=l.gl,u=t.transform,h=t.useProgram("collisionBox"),d=[];let f=0,p=0;for(let m=0;m<i.length;m++){const g=i[m],v=n.getTile(g),y=v.getBucket(r);if(!y)continue;const _=yt(g,y,u);let x=_;0===o[0]&&0===o[1]||(x=t.translatePosMatrix(_,v,o,a));const w=s?y.textCollisionBox:y.iconCollisionBox,b=y.collisionCircleArray;if(b.length>0){const t=e.create(),n=x;e.mul(t,y.placementInvProjMatrix,u.glCoordMatrix),e.mul(t,t,y.placementViewportMatrix),d.push({circleArray:b,circleOffset:p,transform:n,invTransform:t,projection:y.getProjection()}),f+=b.length/4,p=f}w&&(t.terrain&&t.terrain.setupElevationDraw(v,h),h.draw(l,c.LINES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,Wn(x,u,v,y.getProjection()),r.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,null,u.zoom,null,[w.collisionVertexBuffer,w.collisionVertexBufferExt]))}if(!s||!d.length)return;const m=t.useProgram("collisionCircle"),g=new e.StructArrayLayout2f1f2i16;g.resize(4*f),g._trim();let v=0;for(const e of d)for(let t=0;t<e.circleArray.length/4;t++){const n=4*t,r=e.circleArray[n+0],i=e.circleArray[n+1],o=e.circleArray[n+2],a=e.circleArray[n+3];g.emplace(v++,r,i,o,a,0),g.emplace(v++,r,i,o,a,1),g.emplace(v++,r,i,o,a,2),g.emplace(v++,r,i,o,a,3)}(!lr||lr.length<2*f)&&(lr=function(t){const n=2*t,r=new e.StructArrayLayout3ui6;r.resize(n),r._trim();for(let e=0;e<n;e++){const t=6*e;r.uint16[t+0]=4*e+0,r.uint16[t+1]=4*e+1,r.uint16[t+2]=4*e+2,r.uint16[t+3]=4*e+2,r.uint16[t+4]=4*e+3,r.uint16[t+5]=4*e+0}return r}(f));const y=l.createIndexBuffer(lr,!0),_=l.createVertexBuffer(g,e.collisionCircleLayout.members,!0);for(const n of d){const i={u_matrix:n.transform,u_inv_matrix:n.invTransform,u_camera_to_center_distance:(x=u).getCameraToCenterDistance(n.projection),u_viewport_size:[x.width,x.height]};m.draw(l,c.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,i,r.id,_,y,e.SegmentVector.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,u.zoom)}var x;_.destroy(),y.destroy()}const ur=e.create();function hr({width:t,height:n,anchor:r,textOffset:i,textScale:o},a){const{horizontalAlign:s,verticalAlign:l}=e.getAnchorAlignment(r),c=-(s-.5)*t,u=-(l-.5)*n,h=e.evaluateVariableOffset(r,i);return new e.Point((c/o+h[0])*a,(u/o+h[1])*a)}function dr(t,n,r,i,o,a,s,l,c,u,h){const d=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,p=t.icon.dynamicLayoutVertexArray,m={},g=t.getProjection(),v=_t(l,g,a),y=a.elevation,_=g.upVectorScale(l.canonical,a.center.lat,a.worldSize).metersToTile;f.clear();for(let p=0;p<d.length;p++){const x=d.get(p),{tileAnchorX:w,tileAnchorY:b,numGlyphs:E}=x,k=x.hidden||!x.crossTileID||t.allowVerticalPlacement&&!x.placedOrientation?null:i[x.crossTileID];if(k){let i=0,d=0,p=0;if(y){const e=y?y.getAtTileOffset(l,w,b):0,[t,n,r]=g.upVector(l.canonical,w,b);i=e*t*_,d=e*n*_,p=e*r*_}let[T,M,S,C]=rt(x.projectedAnchorX+i,x.projectedAnchorY+d,x.projectedAnchorZ+p,r?v:s);const A=it(a.getCameraToCenterDistance(g),C);let I=o.evaluateSizeForFeature(t.textSizeData,u,x)*A/e.ONE_EM;r&&(I*=t.tilePixelRatio/c);const R=hr(k,I);r?(({x:T,y:M,z:S}=g.projectTilePoint(w+R.x,b+R.y,l.canonical)),[T,M,S]=rt(T+i,M+d,S+p,s)):(n&&R._rotate(-a.angle),T+=R.x,M+=R.y,S=0);const L=t.allowVerticalPlacement&&x.placedOrientation===e.WritingMode.vertical?Math.PI/2:0;for(let t=0;t<E;t++)e.addDynamicAttributes(f,T,M,S,L);h&&x.associatedIconIndex>=0&&(m[x.associatedIconIndex]={x:T,y:M,z:S,angle:L})}else ft(E,f)}if(h){p.clear();const n=t.icon.placedSymbolArray;for(let t=0;t<n.length;t++){const r=n.get(t),{numGlyphs:i}=r,o=m[t];if(r.hidden||!o)ft(i,p);else{const{x:t,y:n,z:r,angle:a}=o;for(let o=0;o<i;o++)e.addDynamicAttributes(p,t,n,r,a)}}t.icon.dynamicLayoutVertexBuffer.updateData(p)}t.text.dynamicLayoutVertexBuffer.updateData(f)}function fr(e,t,n){return n.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function pr(t,n,r,i,o,a,s,l,c,u,h,d){const f=t.context,p=f.gl,m=t.transform,g="map"===l,v="map"===c,y=g&&"point"!==r.layout.get("symbol-placement"),_=g&&!v&&!y,x=void 0!==r.layout.get("symbol-sort-key").constantOr(1);let w=!1;const b=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),E=[e.mercatorXfromLng(m.center.lng),e.mercatorYfromLat(m.center.lat)],k=r.layout.get("text-variable-anchor"),T="globe"===m.projection.name,M=[],S=[0,-1,0];let C=S;!T&&!m.mercatorFromTransition||g||(C=function(t){const n=t._camera.getWorldToCamera(t.worldSize,1),r=e.multiply([],n,t.globeMatrix);e.invert(r,r);const i=[0,0,0],o=[0,1,0,0];return e.transformMat4$1(o,o,r),i[0]=o[0],i[1]=o[1],i[2]=o[2],e.normalize(i,i),i}(m));for(const l of i){const i=n.getTile(l),c=i.getBucket(r);if(!c)continue;if("mercator"===c.projection.name&&T)continue;const h=o?c.text:c.icon;if(!h||c.fullyClipped||!h.segments.get().length)continue;const d=h.programConfigurations.get(r.id),f=o||c.sdfIcons,b=o?c.textSizeData:c.iconSizeData,A=v||0!==m.pitch,I=e.evaluateSizeForZoom(b,m.zoom);let R,L,z,P,O=[0,0],D=null;if(o)L=i.glyphAtlasTexture,z=p.LINEAR,R=i.glyphAtlasTexture.size,c.iconsInText&&(O=i.imageAtlasTexture.size,D=i.imageAtlasTexture,P=A||t.options.rotating||t.options.zooming||"composite"===b.kind||"camera"===b.kind?p.LINEAR:p.NEAREST);else{const e=1!==r.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;L=i.imageAtlasTexture,z=f||t.options.rotating||t.options.zooming||e||A?p.LINEAR:p.NEAREST,R=i.imageAtlasTexture.size}const B="globe"===c.projection.name,F=B?C:S,j=B?e.globeToMercatorTransition(m.zoom):0,N=_t(l,c.getProjection(),m),V=m.calculatePixelsToTileUnitsMatrix(i),U=et(N,i.tileID.canonical,v,g,m,c.getProjection(),V),H=t.terrain&&v&&y?e.invert(e.create(),U):ur,W=nt(N,i.tileID.canonical,v,g,m,c.getProjection(),V),$=k&&c.hasTextData(),G="none"!==r.layout.get("icon-text-fit")&&$&&c.hasIconData();if(y){const e=m.elevation,n=e?e.getAtTileOffsetFunc(l,m.center.lat,m.worldSize,c.getProjection()):null,r=tt(N,i.tileID.canonical,v,g,m,c.getProjection(),V);at(c,N,t,o,r,W,v,u,n,l)}const q=y||o&&k||G,Z=t.translatePosMatrix(N,i,a,s),X=q?ur:U,Y=t.translatePosMatrix(W,i,a,s,!0),K=c.getProjection().createInversionMatrix(m,l.canonical),J=[];t.terrainRenderModeElevated()&&v&&J.push("PITCH_WITH_MAP_TERRAIN"),B&&J.push("PROJECTION_GLOBE_VIEW"),q&&J.push("PROJECTED_POS_ON_VIEWPORT");const Q=f&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let ee;ee=f?c.iconsInText?ir(b.kind,I,_,v,t,Z,X,Y,R,O,l,j,E,K,F,c.getProjection()):rr(b.kind,I,_,v,t,Z,X,Y,o,R,!0,l,j,E,K,F,c.getProjection()):nr(b.kind,I,_,v,t,Z,X,Y,o,R,l,j,E,K,F,c.getProjection());const te={program:t.useProgram(fr(f,o,c),d,J),buffers:h,uniformValues:ee,atlasTexture:L,atlasTextureIcon:D,atlasInterpolation:z,atlasInterpolationIcon:P,isSDF:f,hasHalo:Q,tile:i,labelPlaneMatrixInv:H};if(x&&c.canOverlap){w=!0;const t=h.segments.get();for(const n of t)M.push({segments:new e.SegmentVector([n]),sortKey:n.sortKey,state:te})}else M.push({segments:h.segments,sortKey:0,state:te})}w&&M.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of M){const n=e.state;if(t.terrain&&t.terrain.setupElevationDraw(n.tile,n.program,{useDepthForOcclusion:!T,labelPlaneMatrixInv:n.labelPlaneMatrixInv}),f.activeTexture.set(p.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,p.CLAMP_TO_EDGE),n.atlasTextureIcon&&(f.activeTexture.set(p.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,p.CLAMP_TO_EDGE)),n.isSDF){const i=n.uniformValues;n.hasHalo&&(i.u_is_halo=1,mr(n.buffers,e.segments,r,t,n.program,b,h,d,i)),i.u_is_halo=0}mr(n.buffers,e.segments,r,t,n.program,b,h,d,n.uniformValues)}}function mr(t,n,r,i,o,a,s,l,c){const u=i.context,h=[t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer,t.globeExtVertexBuffer];o.draw(u,u.gl.TRIANGLES,a,s,l,e.CullFaceMode.disabled,c,r.id,t.layoutVertexBuffer,t.indexBuffer,n,r.paint,i.transform.zoom,t.programConfigurations.get(r.id),h)}function gr(t,n,r,i,o,a,s){const l=t.context.gl,c=r.paint.get("fill-pattern"),u=c&&c.constantOr(1);let h,d,f,p,m;s?(d=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=l.LINES):(d=u?"fillPattern":"fill",h=l.TRIANGLES);for(const g of i){const i=n.getTile(g);if(u&&!i.patternsLoaded())continue;const v=i.getBucket(r);if(!v)continue;t.prepareDrawTile();const y=v.programConfigurations.get(r.id),_=t.useProgram(d,y);u&&(t.context.activeTexture.set(l.TEXTURE0),i.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers());const x=c.constantOr(null);if(x&&i.imageAtlas){const e=i.imageAtlas.patternPositions[x.toString()];e&&y.setConstantPatternPositions(e)}const w=t.translatePosMatrix(g.projMatrix,i,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(s){p=v.indexBuffer2,m=v.segments2;const e=t.terrain&&t.terrain.renderingToTexture?t.terrain.drapeBufferSize:[l.drawingBufferWidth,l.drawingBufferHeight];f="fillOutlinePattern"===d&&u?Nn(w,t,i,e):jn(w,e)}else p=v.indexBuffer,m=v.segments,f=u?Fn(w,t,i):Bn(w);t.prepareDrawProgram(t.context,_,g.toUnwrapped()),_.draw(t.context,h,o,t.stencilModeForClipping(g),a,e.CullFaceMode.disabled,f,r.id,v.layoutVertexBuffer,p,m,r.paint,t.transform.zoom,y)}}function vr(t,n,r,i,o,a,s){const l=t.context,c=l.gl,u=t.transform,h=r.paint.get("fill-extrusion-pattern"),d=h.constantOr(1),f=r.paint.get("fill-extrusion-opacity"),p=[r.paint.get("fill-extrusion-ambient-occlusion-intensity"),r.paint.get("fill-extrusion-ambient-occlusion-radius")],m=r.layout.get("fill-extrusion-edge-radius"),g=m>0&&!r.paint.get("fill-extrusion-rounded-roof"),v=g?0:m,y="globe"===u.projection.name?e.fillExtrusionHeightLift():0,_="globe"===u.projection.name,x=_?e.globeToMercatorTransition(u.zoom):0,w=[e.mercatorXfromLng(u.center.lng),e.mercatorYfromLat(u.center.lat)],b=[];_&&b.push("PROJECTION_GLOBE_VIEW"),p[0]>0&&b.push("FAUX_AO"),g&&b.push("ZERO_ROOF_RADIUS");for(const m of i){const i=n.getTile(m),g=i.getBucket(r);if(!g||g.projection.name!==u.projection.name)continue;const E=g.programConfigurations.get(r.id),k=t.useProgram(d?"fillExtrusionPattern":"fillExtrusion",E,b);if(t.terrain){const e=t.terrain;if(t.style.terrainSetForDrapingOnly())e.setupElevationDraw(i,k,{useMeterToDem:!0});else{if(!g.enableTerrain)continue;if(e.setupElevationDraw(i,k,{useMeterToDem:!0}),yr(l,n,m,g,r,e),!g.centroidVertexBuffer){const e=k.attributes.a_centroid_pos;void 0!==e&&c.vertexAttrib2f(e,0,0)}}}d&&(t.context.activeTexture.set(c.TEXTURE0),i.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),E.updatePaintBuffers());const T=h.constantOr(null);if(T&&i.imageAtlas){const e=i.imageAtlas.patternPositions[T.toString()];e&&E.setConstantPatternPositions(e)}const M=t.translatePosMatrix(m.projMatrix,i,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),S=u.projection.createInversionMatrix(u,m.canonical),C=r.paint.get("fill-extrusion-vertical-gradient"),A=d?Dn(M,t,C,f,p,v,m,i,y,x,w,S):On(M,t,C,f,p,v,m,y,x,w,S);t.prepareDrawProgram(l,k,m.toUnwrapped());const I=[];t.terrain&&I.push(g.centroidVertexBuffer),_&&I.push(g.layoutVertexExtBuffer),k.draw(l,l.gl.TRIANGLES,o,a,s,e.CullFaceMode.backCCW,A,r.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,r.paint,t.transform.zoom,E,I)}}function yr(t,n,r,i,o,a){const s=[t=>{let n=t.canonical.x-1,r=t.wrap;return n<0&&(n=(1<<t.canonical.z)-1,r--),new e.OverscaledTileID(t.overscaledZ,r,t.canonical.z,n,t.canonical.y)},t=>{let n=t.canonical.x+1,r=t.wrap;return n===1<<t.canonical.z&&(n=0,r++),new e.OverscaledTileID(t.overscaledZ,r,t.canonical.z,n,t.canonical.y)},t=>new e.OverscaledTileID(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,(0===t.canonical.y?1<<t.canonical.z:t.canonical.y)-1),t=>new e.OverscaledTileID(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y===(1<<t.canonical.z)-1?0:t.canonical.y+1)],l=e=>{const t=n.getSource().minzoom,r=e=>{const t=n.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},i=[0,-1,1];for(const n of i){if(e.overscaledZ+n<t)continue;const i=r(e.calculateScaledKey(e.overscaledZ+n));if(i)return i}},c=[0,0,0],u=(t,n)=>(c[0]=Math.min(t.min.y,n.min.y),c[1]=Math.max(t.max.y,n.max.y),c[2]=e.EXTENT-n.min.x>t.max.x?n.min.x-e.EXTENT:t.max.x,c),h=(t,n)=>(c[0]=Math.min(t.min.x,n.min.x),c[1]=Math.max(t.max.x,n.max.x),c[2]=e.EXTENT-n.min.y>t.max.y?n.min.y-e.EXTENT:t.max.y,c),d=[(e,t)=>u(e,t),(e,t)=>u(t,e),(e,t)=>h(e,t),(e,t)=>h(t,e)],f=new e.Point(0,0);let p,m,g;const v=(t,n,i,o,s)=>{const l=[[o?i:t,o?t:i,0],[o?i:n,o?n:i,0]],c=s<0?e.EXTENT+s:s,u=[o?c:(t+n)/2,o?(t+n)/2:c,0];return 0===i&&s<0||0!==i&&s>0?a.getForTilePoints(g,[u],!0,m):l.push(u),a.getForTilePoints(r,l,!0,p),Math.max(l[0][2],l[1][2],u[2])/a.exaggeration()};for(let t=0;t<4;t++){const n=(t<2?1:5)-t,o=i.borders[t];if(0===o.length)continue;const c=g=s[t](r),u=l(c);if(!(u&&u instanceof e.FillExtrusionBucket&&u.enableTerrain))continue;if(i.borderDoneWithNeighborZ[t]===u.canonical.z&&u.borderDoneWithNeighborZ[n]===i.canonical.z)continue;if(m=a.findDEMTileFor(c),!m||!m.dem)continue;if(!p){const e=a.findDEMTileFor(r);if(!e||!e.dem)return;p=e}const h=u.borders[n];let y=0;const _=u.borderDoneWithNeighborZ[n]!==i.canonical.z;if(i.canonical.z===u.canonical.z){for(let r=0;r<o.length;r++){const a=i.featuresOnBorder[o[r]],s=a.borders[t];let l;for(;y<h.length&&(l=u.featuresOnBorder[h[y]],!(l.borders[n][1]>s[0]+3));)_&&u.encodeCentroid(void 0,l,!1),y++;if(l&&y<h.length){const r=y;let o=0;for(;!(l.borders[n][0]>s[1]-3)&&(o++,++y!==h.length);)l=u.featuresOnBorder[h[y]];if(l=u.featuresOnBorder[h[r]],a.intersectsCount()>1||l.intersectsCount()>1||1!==o){1!==o&&(y=r),i.encodeCentroid(void 0,a,!1),_&&u.encodeCentroid(void 0,l,!1);continue}const c=d[t](a,l),p=t%2?e.EXTENT-1:0;f.x=v(c[0],Math.min(e.EXTENT-1,c[1]),p,t<2,c[2]),f.y=0,i.encodeCentroid(f,a,!1),_&&u.encodeCentroid(f,l,!1)}else i.encodeCentroid(void 0,a,!1)}i.borderDoneWithNeighborZ[t]=u.canonical.z,i.needsCentroidUpdate=!0,_&&(u.borderDoneWithNeighborZ[n]=i.canonical.z,u.needsCentroidUpdate=!0)}else{for(const e of o)i.encodeCentroid(void 0,i.featuresOnBorder[e],!1);if(_){for(const e of h)u.encodeCentroid(void 0,u.featuresOnBorder[e],!1);u.borderDoneWithNeighborZ[n]=i.canonical.z,u.needsCentroidUpdate=!0}i.borderDoneWithNeighborZ[t]=u.canonical.z,i.needsCentroidUpdate=!0}}(i.needsCentroidUpdate||!i.centroidVertexBuffer&&0!==i.centroidVertexArray.length)&&i.uploadCentroid(t)}const _r=new e.Color(1,0,0,1),xr=new e.Color(0,1,0,1),wr=new e.Color(0,0,1,1),br=new e.Color(1,0,1,1),Er=new e.Color(0,1,1,1);function kr(t,n,r){const i=t.context,o=t.transform,a=i.gl,s="globe"===o.projection.name,l=s?["PROJECTION_GLOBE_VIEW"]:null;let c=r.projMatrix;if(s&&e.globeToMercatorTransition(o.zoom)>0){const t=e.transitionTileAABBinECEF(r.canonical,o),n=e.globeDenormalizeECEF(t);c=e.multiply(new Float32Array(16),o.globeMatrix,n),e.multiply(c,o.projMatrix,c)}const u=t.useProgram("debug",null,l),h=n.getTileByID(r.key);t.terrain&&t.terrain.setupElevationDraw(h,u);const d=e.DepthMode.disabled,f=e.StencilMode.disabled,p=t.colorModeForRenderPass(),m="$debug";i.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s?h._makeGlobeTileDebugBuffers(t.context,o):h._makeDebugTileBoundsBuffers(t.context,o.projection);const g=h._tileDebugBuffer||t.debugBuffer,v=h._tileDebugIndexBuffer||t.debugIndexBuffer,y=h._tileDebugSegments||t.debugSegments;u.draw(i,a.LINE_STRIP,d,f,p,e.CullFaceMode.disabled,$n(c,e.Color.red),m,g,v,y,null,null,null,[h._globeTileDebugBorderBuffer]);const _=h.latestRawTileData,x=Math.floor((_&&_.byteLength||0)/1024),w=n.getTile(r).tileSize,b=512/Math.min(w,512)*(r.overscaledZ/o.zoom)*.5;let E=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(E+=` => ${r.overscaledZ}`),E+=` ${x}kb`,function(e,t){e.initDebugOverlayCanvas();const n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,n.width,n.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,E);const k=h._tileDebugTextBuffer||t.debugBuffer,T=h._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,M=h._tileDebugTextSegments||t.debugSegments;u.draw(i,a.TRIANGLES,d,f,e.ColorMode.alphaBlended,e.CullFaceMode.disabled,$n(c,e.Color.transparent,b),m,k,T,M,null,null,null,[h._globeTileDebugTextBuffer])}function Tr(e,t,n,r){Sr(e,0,t+n/2,e.transform.width,n,r)}function Mr(e,t,n,r){Sr(e,t-n/2,0,n,e.transform.height,r)}function Sr(t,n,r,i,o,a){const s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*e.exported.devicePixelRatio,r*e.exported.devicePixelRatio,i*e.exported.devicePixelRatio,o*e.exported.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}const Cr=e.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Ar}=Cr;function Ir(e,t,n,r){e.emplaceBack(t,n,r)}class Rr{constructor(t){this.vertexArray=new e.StructArrayLayout3f12,this.indices=new e.StructArrayLayout3ui6,Ir(this.vertexArray,-1,-1,1),Ir(this.vertexArray,1,-1,1),Ir(this.vertexArray,-1,1,1),Ir(this.vertexArray,1,1,1),Ir(this.vertexArray,-1,-1,-1),Ir(this.vertexArray,1,-1,-1),Ir(this.vertexArray,-1,1,-1),Ir(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,Ar),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.SegmentVector.simpleSegment(0,0,36,12)}}function Lr(t,n,r,i,o,a){const s=t.gl,l=n.paint.get("sky-atmosphere-color"),c=n.paint.get("sky-atmosphere-halo-color"),u=n.paint.get("sky-atmosphere-sun-intensity"),h=((e,t,n,r,i)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:n,u_color_tint_r:[r.r,r.g,r.b,r.a],u_color_tint_m:[i.r,i.g,i.b,i.a],u_luminance:5e-5}))(e.fromMat4(e.create$1(),i),o,u,l,c);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+a,n.skyboxTexture,0),r.draw(t,s.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.frontCW,h,"skyboxCapture",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}const zr=e.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Pr{constructor(t){const n=new e.StructArrayLayout5f20;n.emplaceBack(-1,1,1,0,0),n.emplaceBack(1,1,1,1,0),n.emplaceBack(1,-1,1,1,1),n.emplaceBack(-1,-1,1,0,1);const r=new e.StructArrayLayout3ui6;r.emplaceBack(0,1,2),r.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(n,zr.members),this.indexBuffer=t.createIndexBuffer(r),this.segments=e.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Or={symbol:function(t,n,r,i,o){if("translucent"!==t.renderPass)return;const a=e.StencilMode.disabled,s=t.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(t,n,r,i,o,a,s){const l=n.transform,c="map"===o,u="map"===a;for(const n of t){const t=i.getTile(n),o=t.getBucket(r);if(!o||!o.text||!o.text.segments.get().length)continue;const a=e.evaluateSizeForZoom(o.textSizeData,l.zoom),h=_t(n,o.getProjection(),l),d=l.calculatePixelsToTileUnitsMatrix(t),f=et(h,t.tileID.canonical,u,c,l,o.getProjection(),d),p="none"!==r.layout.get("icon-text-fit")&&o.hasIconData();if(a){const r=Math.pow(2,l.zoom-t.tileID.overscaledZ);dr(o,c,u,s,e.symbolSize,l,f,n,r,a,p)}}}(i,t,r,n,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),o),0!==r.paint.get("icon-opacity").constantOr(1)&&pr(t,n,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,s),0!==r.paint.get("text-opacity").constantOr(1)&&pr(t,n,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,s),n.map.showCollisionBoxes&&(cr(t,n,r,i,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),cr(t,n,r,i,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))},circle:function(t,n,r,i){if("translucent"!==t.renderPass)return;const o=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),l=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,h=t.transform,d=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),f=e.StencilMode.disabled,p=t.colorModeForRenderPass(),m="globe"===h.projection.name,g=[e.mercatorXfromLng(h.center.lng),e.mercatorYfromLat(h.center.lat)],v=[];for(let o=0;o<i.length;o++){const a=i[o],s=n.getTile(a),c=s.getBucket(r);if(!c||c.projection.name!==h.projection.name)continue;const u=c.programConfigurations.get(r.id),d=Hn(r);m&&d.push("PROJECTION_GLOBE_VIEW");const f=t.useProgram("circle",u,d),p=c.layoutVertexBuffer,y=c.globeExtVertexBuffer,_=c.indexBuffer,x=h.projection.createInversionMatrix(h,a.canonical),w={programConfiguration:u,program:f,layoutVertexBuffer:p,globeExtVertexBuffer:y,indexBuffer:_,uniformValues:Un(t,a,s,x,g,r),tile:s};if(l){const t=c.segments.get();for(const n of t)v.push({segments:new e.SegmentVector([n]),sortKey:n.sortKey,state:w})}else v.push({segments:c.segments,sortKey:0,state:w})}l&&v.sort(((e,t)=>e.sortKey-t.sortKey));const y={useDepthForOcclusion:!m};for(const n of v){const{programConfiguration:i,program:o,layoutVertexBuffer:a,globeExtVertexBuffer:s,indexBuffer:l,uniformValues:m,tile:g}=n.state,v=n.segments;t.terrain&&t.terrain.setupElevationDraw(g,o,y),t.prepareDrawProgram(c,o,g.tileID.toUnwrapped()),o.draw(c,u.TRIANGLES,d,f,p,e.CullFaceMode.disabled,m,r.id,a,l,v,r.paint,h.zoom,i,[s])}},heatmap:function(t,n,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,a=o.gl,s=e.StencilMode.disabled,l=new e.ColorMode([a.ONE,a.ONE],e.Color.transparent,[!0,!0,!0,!0]);!function(e,t,n,r){const i=e.gl,o=t.width*r,a=t.height*r;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,o,a]);let s=n.heatmapFbo;if(!s||s&&(s.width!==o||s.height!==a)){s&&s.destroy();const t=i.createTexture();i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),s=n.heatmapFbo=e.createFramebuffer(o,a,!1),function(e,t,n,r,i,o){const a=e.gl;a.texImage2D(a.TEXTURE_2D,0,e.isWebGL2&&e.extRenderToTextureHalfFloat?a.RGBA16F:a.RGBA,i,o,0,a.RGBA,e.extRenderToTextureHalfFloat?e.isWebGL2?a.HALF_FLOAT:e.extTextureHalfFloat.HALF_FLOAT_OES:a.UNSIGNED_BYTE,null),r.colorAttachment.set(n)}(e,0,t,s,o,a)}else i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),e.bindFramebuffer.set(s.framebuffer)}(o,t,r,"globe"===t.transform.projection.name?.5:.25),o.clear({color:e.Color.transparent});const c=t.transform,u="globe"===c.projection.name,h=u?["PROJECTION_GLOBE_VIEW"]:null,d=u?e.CullFaceMode.frontCCW:e.CullFaceMode.disabled,f=[e.mercatorXfromLng(c.center.lng),e.mercatorYfromLat(c.center.lat)];for(let p=0;p<i.length;p++){const m=i[p];if(n.hasRenderableParent(m))continue;const g=n.getTile(m),v=g.getBucket(r);if(!v||v.projection.name!==c.projection.name)continue;const y=v.programConfigurations.get(r.id),_=t.useProgram("heatmap",y,h),{zoom:x}=t.transform;t.terrain&&t.terrain.setupElevationDraw(g,_),t.prepareDrawProgram(o,_,m.toUnwrapped());const w=c.projection.createInversionMatrix(c,m.canonical);_.draw(o,a.TRIANGLES,e.DepthMode.disabled,s,l,d,qn(t,m,g,w,f,x,r.paint.get("heatmap-intensity")),r.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,r.paint,t.transform.zoom,y,u?[v.globeExtVertexBuffer]:null)}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,n){const r=t.context,i=r.gl,o=n.heatmapFbo;if(!o)return;r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1);let a=n.colorRampTexture;a||(a=n.colorRampTexture=new e.Texture(r,n.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,i.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,((e,t,n,r)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,n),n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,n.paint,t.transform.zoom)}(t,r))},line:function(t,n,r,i){if("translucent"!==t.renderPass)return;const o=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),l=t.colorModeForRenderPass(),c=t.terrain&&t.terrain.renderingToTexture?1:e.exported.devicePixelRatio,u=r.paint.get("line-dasharray"),h=u.constantOr(1),d=r.layout.get("line-cap"),f=r.paint.get("line-pattern"),p=f.constantOr(1),m=r.paint.get("line-gradient"),g=p?"linePattern":"line",v=t.context,y=v.gl,_=(e=>{const t=[];Jn(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const n=e.paint.get("line-trim-offset");0===n[0]&&0===n[1]||t.push("RENDER_LINE_TRIM_OFFSET");const r=e.paint.get("line-pattern").constantOr(1),i=1!==e.paint.get("line-opacity").constantOr(1);return!r&&i&&t.push("RENDER_LINE_ALPHA_DISCARD"),t})(r);let x=_.includes("RENDER_LINE_ALPHA_DISCARD");t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(x=!1);for(const o of i){const i=n.getTile(o);if(p&&!i.patternsLoaded())continue;const a=i.getBucket(r);if(!a)continue;t.prepareDrawTile();const w=a.programConfigurations.get(r.id),b=t.useProgram(g,w,_),E=f.constantOr(null);if(E&&i.imageAtlas){const e=i.imageAtlas.patternPositions[E.toString()];e&&w.setConstantPatternPositions(e)}const k=u.constantOr(null),T=d.constantOr(null);if(!p&&k&&T&&i.lineAtlas){const e=i.lineAtlas.getDash(k,T);e&&w.setConstantPatternPositions(e)}let[M,S]=r.paint.get("line-trim-offset");if("round"===T||"square"===T){const e=1;M!==S&&(0===M&&(M-=e),1===S&&(S+=e))}const C=t.terrain?o.projMatrix:null,A=p?Xn(t,i,r,C,c):Zn(t,i,r,C,a.lineClipsArray.length,c,[M,S]);if(m){const i=a.gradients[r.id];let s=i.texture;if(r.gradientVersion!==i.version){let l=256;if(r.stepInterpolant){const r=n.getSource().maxzoom,i=o.canonical.z===r?Math.ceil(1<<t.transform.maxZoom-o.canonical.z):1;l=e.clamp(e.nextPowerOfTwo(a.maxLineLength/e.EXTENT*1024*i),256,v.maxTextureSize)}i.gradient=e.renderColorRamp({expression:r.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:i.gradient||void 0,clips:a.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new e.Texture(v,i.gradient,y.RGBA),i.version=r.gradientVersion,s=i.texture}v.activeTexture.set(y.TEXTURE1),s.bind(r.stepInterpolant?y.NEAREST:y.LINEAR,y.CLAMP_TO_EDGE)}h&&(v.activeTexture.set(y.TEXTURE0),i.lineAtlasTexture.bind(y.LINEAR,y.REPEAT),w.updatePaintBuffers()),p&&(v.activeTexture.set(y.TEXTURE0),i.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),w.updatePaintBuffers()),t.prepareDrawProgram(v,b,o.toUnwrapped());const I=n=>{b.draw(v,y.TRIANGLES,s,n,l,e.CullFaceMode.disabled,A,r.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,r.paint,t.transform.zoom,w,[a.layoutVertexBuffer2])};if(x){const n=t.stencilModeForClipping(o).ref;0===n&&t.terrain&&v.clear({stencil:0});const r={func:y.EQUAL,mask:255};A.u_alpha_discard_threshold=.8,I(new e.StencilMode(r,n,255,y.KEEP,y.KEEP,y.INVERT)),A.u_alpha_discard_threshold=0,I(new e.StencilMode(r,n,255,y.KEEP,y.KEEP,y.KEEP))}else I(t.stencilModeForClipping(o))}x&&(t.resetStencilClippingMasks(),t.terrain&&v.clear({stencil:0}))},fill:function(t,n,r,i){const o=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0===a.constantOr(1))return;const s=t.colorModeForRenderPass(),l=r.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(e.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const o=t.depthModeForSublayer(1,"opaque"===t.renderPass?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly);gr(t,n,r,i,o,s,!1)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){const o=t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,e.DepthMode.ReadOnly);gr(t,n,r,i,o,s,!0)}},"fill-extrusion":function(t,n,r,i){const o=r.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){const a=new e.DepthMode(t.context.gl.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);if(1!==o||r.paint.get("fill-extrusion-pattern").constantOr(1))vr(t,n,r,i,a,e.StencilMode.disabled,e.ColorMode.disabled),vr(t,n,r,i,a,t.stencilModeFor3D(),t.colorModeForRenderPass()),t.resetStencilClippingMasks();else{const o=t.colorModeForRenderPass();vr(t,n,r,i,a,e.StencilMode.disabled,o)}}},hillshade:function(t,n,r,i){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const o=t.context,a=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),s=t.colorModeForRenderPass(),l=t.terrain&&t.terrain.renderingToTexture,[c,u]="translucent"!==t.renderPass||l?[{},i]:t.stencilConfigForOverlap(i);for(const i of u){const o=n.getTile(i);if(o.needsHillshadePrepare&&"offscreen"===t.renderPass)vn(t,o,r,a,e.StencilMode.disabled,s);else if("translucent"===t.renderPass){const e=l&&t.terrain?t.terrain.stencilModeForRTTOverlap(i):c[i.overscaledZ];mn(t,i,o,r,a,e,s)}}o.viewport.set([0,0,t.width,t.height]),t.resetStencilClippingMasks()},raster:function(t,n,r,i,o,a){if("translucent"!==t.renderPass)return;if(0===r.paint.get("raster-opacity"))return;if(!i.length)return;const s=t.context,l=s.gl,c=n.getSource(),u=t.useProgram("raster"),h=t.colorModeForRenderPass(),d=t.terrain&&t.terrain.renderingToTexture,[f,p]=c instanceof Ce||d?[{},i]:t.stencilConfigForOverlap(i),m=p[p.length-1].overscaledZ,g=!t.options.moving;for(const i of p){const o=d?e.DepthMode.disabled:t.depthModeForSublayer(i.overscaledZ-m,1===r.paint.get("raster-opacity")?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly,l.LESS),p=i.toUnwrapped(),v=n.getTile(i);if(d&&(!v||!v.hasData()))continue;const y=d?i.projMatrix:t.transform.calculateProjMatrix(p,g),_=t.terrain&&d?t.terrain.stencilModeForRTTOverlap(i):f[i.overscaledZ],x=a?0:r.paint.get("raster-fade-duration");v.registerFadeDuration(x);const w=n.findLoadedParent(i,0),b=Sn(v,w,n,t.transform,x);let E,k;t.terrain&&t.terrain.prepareDrawTile();const T="nearest"===r.paint.get("raster-resampling")?l.NEAREST:l.LINEAR;s.activeTexture.set(l.TEXTURE0),v.texture.bind(T,l.CLAMP_TO_EDGE),s.activeTexture.set(l.TEXTURE1),w?(w.texture.bind(T,l.CLAMP_TO_EDGE),E=Math.pow(2,w.tileID.overscaledZ-v.tileID.overscaledZ),k=[v.tileID.canonical.x*E%1,v.tileID.canonical.y*E%1]):v.texture.bind(T,l.CLAMP_TO_EDGE),v.texture.useMipmap&&s.extTextureFilterAnisotropic&&t.transform.pitch>20&&l.texParameterf(l.TEXTURE_2D,s.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,s.extTextureFilterAnisotropicMax);const M=Qn(y,k||[0,0],E||1,b,r,c instanceof Ce?c.perspectiveTransform:[0,0]);if(t.prepareDrawProgram(s,u,p),c instanceof Ce)c.boundsBuffer&&c.boundsSegments&&u.draw(s,l.TRIANGLES,o,e.StencilMode.disabled,h,e.CullFaceMode.disabled,M,r.id,c.boundsBuffer,t.quadTriangleIndexBuffer,c.boundsSegments);else{const{tileBoundsBuffer:n,tileBoundsIndexBuffer:i,tileBoundsSegments:a}=t.getTileBoundsBuffers(v);u.draw(s,l.TRIANGLES,o,_,h,e.CullFaceMode.disabled,M,r.id,n,i,a)}}t.resetStencilClippingMasks()},background:function(t,n,r,i){const o=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;const s=t.context,l=s.gl,c=t.transform,u=c.tileSize,h=r.paint.get("background-pattern");if(t.isPatternMissing(h))return;const d=!h&&1===o.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==d)return;const f=e.StencilMode.disabled,p=t.depthModeForSublayer(0,"opaque"===d?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly),m=t.colorModeForRenderPass(),g=t.useProgram(h?"backgroundPattern":"background");let v,y=i;y||(v=t.getBackgroundTiles(),y=Object.values(v).map((e=>e.tileID))),h&&(s.activeTexture.set(l.TEXTURE0),t.imageManager.bind(t.context));for(const d of y){const y=d.toUnwrapped(),_=i?d.projMatrix:t.transform.calculateProjMatrix(y);t.prepareDrawTile();const x=n?n.getTile(d):v?v[d.key]:new e.Tile(d,u,c.zoom,t),w=h?ar(_,a,t,h,{tileID:d,tileSize:u}):or(_,a,o);t.prepareDrawProgram(s,g,y);const{tileBoundsBuffer:b,tileBoundsIndexBuffer:E,tileBoundsSegments:k}=t.getTileBoundsBuffers(x);g.draw(s,l.TRIANGLES,p,f,m,e.CullFaceMode.disabled,w,r.id,b,E,k)}},sky:function(t,n,r){const i=t.transform,o="mercator"===i.projection.name||"globe"===i.projection.name?1:e.smoothstep(7,8,i.zoom),a=r.paint.get("sky-opacity")*o;if(0===a)return;const s=t.context,l=r.paint.get("sky-type"),c=new e.DepthMode(s.gl.LEQUAL,e.DepthMode.ReadOnly,[0,1]),u=t.frameCounter/1e3%1;"atmosphere"===l?"offscreen"===t.renderPass?r.needsSkyboxCapture(t)&&(function(t,n,r,i){const o=t.context,a=o.gl;let s=n.skyboxFbo;if(!s){s=n.skyboxFbo=o.createFramebuffer(32,32,!1),n.skyboxGeometry=new Rr(o),n.skyboxTexture=o.gl.createTexture(),a.bindTexture(a.TEXTURE_CUBE_MAP,n.skyboxTexture),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,a.LINEAR);for(let e=0;e<6;++e)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,a.RGBA,32,32,0,a.RGBA,a.UNSIGNED_BYTE,null)}o.bindFramebuffer.set(s.framebuffer),o.viewport.set([0,0,32,32]);const l=n.getCenter(t,!0),c=t.useProgram("skyboxCapture"),u=new Float64Array(16);e.identity(u),e.rotateY(u,u,.5*-Math.PI),Lr(o,n,c,u,l,0),e.identity(u),e.rotateY(u,u,.5*Math.PI),Lr(o,n,c,u,l,1),e.identity(u),e.rotateX(u,u,.5*-Math.PI),Lr(o,n,c,u,l,2),e.identity(u),e.rotateX(u,u,.5*Math.PI),Lr(o,n,c,u,l,3),e.identity(u),Lr(o,n,c,u,l,4),e.identity(u),e.rotateY(u,u,Math.PI),Lr(o,n,c,u,l,5),o.viewport.set([0,0,t.width,t.height])}(t,r),r.markSkyboxValid(t)):"sky"===t.renderPass&&function(t,n,r,i,o){const a=t.context,s=a.gl,l=t.transform,c=t.useProgram("skybox");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_CUBE_MAP,n.skyboxTexture);const u=((e,t,n,r,i)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:r,u_temporal_offset:i}))(l.skyboxMatrix,n.getCenter(t,!1),0,i,o);t.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,r,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,u,"skybox",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}(t,r,c,a,u):"gradient"===l&&"sky"===t.renderPass&&function(t,n,r,i,o){const a=t.context,s=a.gl,l=t.transform,c=t.useProgram("skyboxGradient");n.skyboxGeometry||(n.skyboxGeometry=new Rr(a)),a.activeTexture.set(s.TEXTURE0);let u=n.colorRampTexture;u||(u=n.colorRampTexture=new e.Texture(a,n.colorRamp,s.RGBA)),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);const h=((t,n,r,i,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:n,u_radius:e.degToRad(r),u_opacity:i,u_temporal_offset:o}))(l.skyboxMatrix,n.getCenter(t,!1),n.paint.get("sky-gradient-radius"),i,o);t.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,r,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,h,"skyboxGradient",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}(t,r,c,a,u)},debug:function(e,t,n){for(let r=0;r<n.length;r++)kr(e,t,n[r])},custom:function(t,n,r,i){const o=t.context,a=r.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&r.isLayerDraped()){if("offscreen"===t.renderPass){const n=a.prerender;if(n){if(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const r=t.transform.pointMerc;n.call(a,o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.globeToMercatorTransition(t.transform.zoom),[r.x,r.y],t.transform.pixelsPerMeterRatio)}else n.call(a,o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState()}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const n=a.renderToTile;if(n){const r=i[0].canonical,s=new e.MercatorCoordinate(r.x+i[0].wrap*(1<<r.z),r.y,r.z);o.setDepthMode(e.DepthMode.disabled),o.setStencilMode(e.StencilMode.disabled),o.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults(),n.call(a,o.gl,s),o.setDirty(),t.setBaseState()}return}t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(e.StencilMode.disabled);const n="3d"===a.renderingMode?new e.DepthMode(t.context.gl.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,e.DepthMode.ReadOnly);if(o.setDepthMode(n),"globe"===t.transform.projection.name){const n=t.transform.pointMerc;a.render(o.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.globeToMercatorTransition(t.transform.zoom),[n.x,n.y],t.transform.pixelsPerMeterRatio)}else a.render(o.gl,t.transform.customLayerMatrix());o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}else e.warnOnce("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.")}};class Dr{constructor(t,n,r=!1){this.context=new ke(t,r),this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=e.SourceCache.maxUnderzooming+e.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(e,t){const n=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(n||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Rn(this,e));const r=this._terrain;this.transform.elevation=n?r:null,r.update(e,this.transform,t)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[n,r]=t.getFovAdjustedRange(this.transform._fov);if(n>r)return void(this.transform.fogCullDistSq=null);const i=n+.78*(r-n);this.transform.fogCullDistSq=i*i}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(t,n){if(this.width=t*e.exported.devicePixelRatio,this.height=n*e.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._layers[e].resize()}setup(){const t=this.context,n=new e.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(e.EXTENT,0),n.emplaceBack(0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(n,e.posAttributes.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);const r=new e.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(r,e.posAttributes.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);const i=new e.StructArrayLayout2i4;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(-1,1),i.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(i,e.posAttributes.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);const o=new e.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(e.EXTENT,0,e.EXTENT,0),o.emplaceBack(0,e.EXTENT,0,e.EXTENT),o.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.mercatorBoundsBuffer=t.createVertexBuffer(o,e.boundsAttributes.members),this.mercatorBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);const a=new e.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a);const s=new e.StructArrayLayout1ui2;for(const e of[0,1,3,2,0])s.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.Texture(t,new e.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA),this.identityMat=e.create();const l=this.context.gl;this.stencilClearMode=new e.StencilMode({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(e.window.performance.now()),this.atmosphereBuffer=new Pr(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(t,n.TRIANGLES,e.DepthMode.disabled,this.stencilClearMode,e.ColorMode.disabled,e.CullFaceMode.disabled,Mn(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,n,r){if(!n||this.currentStencilSource===n.id||!t.isTileClipped()||!r||0===r.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of r)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=n.id;const i=this.context,o=i.gl;this.nextStencilID+r.length>256&&this.clearStencil(),i.setColorMode(e.ColorMode.disabled),i.setDepthMode(e.DepthMode.disabled);const a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of r){const r=n.getTile(t),s=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,{tileBoundsBuffer:l,tileBoundsIndexBuffer:c,tileBoundsSegments:u}=this.getTileBoundsBuffers(r);a.draw(i,o.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:o.ALWAYS,mask:0},s,255,o.KEEP,o.KEEP,o.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,Mn(t.projMatrix),"$clipping",l,c,u)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new e.StencilMode({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const n=this.context.gl;return new e.StencilMode({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,r=t.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),i=r[r.length-1].overscaledZ,o=r[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const t={};for(let r=0;r<o;r++)t[r+i]=new e.StencilMode({func:n.GEQUAL,mask:255},r+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[t,r]}return[{[i]:e.StencilMode.disabled},r]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const n=1/8;return new e.ColorMode([t.CONSTANT_COLOR,t.ONE],new e.Color(n,n,n,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?e.ColorMode.unblended:e.ColorMode.alphaBlended}depthModeForSublayer(t,n,r){if(!this.opaquePassEnabledForLayer())return e.DepthMode.disabled;const i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new e.DepthMode(r||this.context.gl.LEQUAL,n,[i,i])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,n){this.style=t,this.options=n,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.exported.now()),this.imageManager.beginFrame();const r=this.style.order,i=this.style._sourceCaches;for(const e in i){const t=i[e];t.used&&t.prepare(this.context)}const o={},a={},s={};for(const e in i){const t=i[e];o[e]=t.getVisibleCoordinates(),a[e]=o[e].slice().reverse(),s[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<r.length;e++)if(this.style._layers[r[e]].is3D()){this.opaquePassCutoff=e;break}if(this.terrain&&(this.terrain.updateTileBinding(s),this.opaquePassCutoff=0),"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.GlobeSharedBuffers(this.context)),!e.isMapAuthenticated(this.context.gl))return;this.renderPass="offscreen";for(const e of r){const n=this.style._layers[e],r=t._getLayerSourceCache(n);if(!n.hasOffscreenPass()||n.isHidden(this.transform.zoom))continue;const i=r?a[r.id]:void 0;("custom"===n.type||n.isSky()||i&&i.length)&&this.renderLayer(this,r,n,i)}this.depthRangeFor3D=[0,1-(t.order.length+2)*this.numSublayers*this.depthEpsilon];const l=this.terrain;if(l&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&l.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:n.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){const e=this.style._layers[r[this.currentLayer]],n=t._getLayerSourceCache(e);if(e.isSky())continue;const i=n?a[n.id]:void 0;this._renderTileClippingMasks(e,n,i),this.renderLayer(this,n,e,i)}if(this.style.fog&&this.transform.projection.supportsFog&&function(t,n){const r=t.context,i=r.gl,o=t.transform,a=new e.DepthMode(i.LEQUAL,e.DepthMode.ReadOnly,[0,1]),s=t.useProgram("globeAtmosphere",null,"globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),l=e.globeToMercatorTransition(o.zoom),c=n.properties.get("color").toArray01(),u=n.properties.get("high-color").toArray01(),h=n.properties.get("space-color").toArray01PremultipliedAlpha(),d=e.identity$1([]);e.rotateY$1(d,d,-e.degToRad(o._center.lng)),e.rotateX$1(d,d,e.degToRad(o._center.lat)),e.rotateZ$1(d,d,o.angle),e.rotateX$1(d,d,-o._pitch);const f=e.fromQuat(new Float32Array(16),d),p=e.mapValue(n.properties.get("star-intensity"),0,1,0,.25),m=5e-4,g=e.mapValue(n.properties.get("horizon-blend"),0,1,m,.25),v=e.globeUseCustomAntiAliasing(t,r,o)&&g===m?o.worldSize/(2*Math.PI*1.025)-1:o.globeRadius,y=t.frameCounter/1e3%1,_=e.length(o.globeCenterInViewSpace),x=Math.sqrt(Math.pow(_,2)-Math.pow(v,2)),w=Math.acos(x/_),b=((t,n,r,i,o,a,s,l,c,u,h,d,f,p)=>({u_frustum_tl:t,u_frustum_tr:n,u_frustum_br:r,u_frustum_bl:i,u_horizon:o,u_transition:a,u_fadeout_range:s,u_color:l,u_high_color:c,u_space_color:u,u_star_intensity:h,u_star_size:5*e.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:d,u_horizon_angle:f,u_rotation_matrix:p}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,l,g,c,u,h,p,y,w,f);t.prepareDrawProgram(r,s);const E=t.atmosphereBuffer;E&&s.draw(r,i.TRIANGLES,a,e.StencilMode.disabled,e.ColorMode.alphaBlended,e.CullFaceMode.backCW,b,"skybox",E.vertexBuffer,E.indexBuffer,E.segments)}(this,this.style.fog),this.renderPass="sky",(e.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){const e=this.style._layers[r[this.currentLayer]],n=t._getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,n,e,n?a[n.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;){const e=this.style._layers[r[this.currentLayer]],n=t._getLayerSourceCache(e);if(e.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const i=n?("symbol"===e.type?s:a)[n.id]:void 0;this._renderTileClippingMasks(e,n,n?o[n.id]:void 0),this.renderLayer(this,n,e,i),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let n=null;e.values(this.style._layers).forEach((e=>{const r=t._getLayerSourceCache(e);r&&!e.isHidden(this.transform.zoom)&&(!n||n.getSource().maxzoom<r.getSource().maxzoom)&&(n=r)})),n&&this.options.showTileBoundaries&&Or.debug(this,n,n.getVisibleCoordinates())}this.options.showPadding&&function(e){const t=e.transform.padding;Tr(e,e.transform.height-(t.top||0),3,_r),Tr(e,t.bottom||0,3,xr),Mr(e,t.left||0,3,wr),Mr(e,e.transform.width-(t.right||0),3,br);const n=e.transform.centerPoint;!function(e,t,n,r){Sr(e,t-1,n-10,2,20,r),Sr(e,t-10,n-1,20,2,r)}(e,n.x,e.transform.height-n.y,Er)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(e.window.performance.now()),this.saveCanvasCopy())}renderLayer(e,t,n,r){n.isHidden(this.transform.zoom)||("background"===n.type||"sky"===n.type||"custom"===n.type||r&&r.length)&&(this.id=n.id,this.gpuTimingStart(n),(!e.transform.projection.unsupportedLayers||!e.transform.projection.unsupportedLayers.includes(n.type)||e.terrain&&"custom"===n.type)&&Or[n.type](e,t,n,r,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery;let n=this.gpuTimers[e.id];n||(n=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),n.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=e.createQueryEXT();this.deferredRenderGpuTimeQueries.push(t),e.beginQueryEXT(e.TIME_ELAPSED_EXT,t)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){const e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){const t={};for(const n in e){const r=e[n],i=this.context.extTimerQuery,o=i.getQueryObjectEXT(r.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(r.query),t[n]=o}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.extTimerQuery;let n=0;for(const r of e)n+=t.getQueryObjectEXT(r,t.QUERY_RESULT_EXT)/1e6,t.deleteQueryEXT(r);return n}translatePosMatrix(t,n,r,i,o){if(!r[0]&&!r[1])return t;const a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}const s=[o?r[0]:I(n,r[0],this.transform.zoom),o?r[1]:I(n,r[1],this.transform.zoom),0],l=new Float32Array(16);return e.translate(l,t,s),l}saveTileTexture(e){const t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){return null===e||void 0!==e&&!this.imageManager.getPattern(e.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const e=this.terrain&&this.terrain.renderingToTexture,t=this.terrain&&0===this.terrain.exaggeration(),n=this.style&&this.style.fog,r=[];return this.terrainRenderModeElevated()&&r.push("TERRAIN"),"globe"===this.transform.projection.name&&r.push("GLOBE"),t&&r.push("ZERO_EXAGGERATION"),n&&!e&&0!==n.getOpacity(this.transform.pitch)&&r.push("FOG"),e&&r.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&r.push("OVERDRAW_INSPECTOR"),r}useProgram(e,t,n){this.cache=this.cache||{};const r=n||[],i=this.currentGlobalDefines().concat(r),o=Ln.cacheKey(un[e],e,i,t);return this.cache[o]||(this.cache[o]=new Ln(this.context,e,un[e],t,sr[e],i)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(t,n,r){if(this.terrain&&this.terrain.renderingToTexture)return;const i=this.style.fog;if(i){const o=i.getOpacity(this.transform.pitch),a=((t,n,r,i,o,a,s,l,c,u,h)=>{const d=t.transform,f=n.properties.get("color").toArray01();f[3]=i;const p=t.frameCounter/1e3%1;return{u_fog_matrix:r?d.calculateFogTileMatrix(r):t.identityMat,u_fog_range:n.getFovAdjustedRange(d._fov),u_fog_color:f,u_fog_horizon_blend:n.properties.get("horizon-blend"),u_fog_temporal_offset:p,u_frustum_tl:o,u_frustum_tr:a,u_frustum_br:s,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:h,u_globe_transition:e.globeToMercatorTransition(d.zoom),u_is_globe:+("globe"===d.projection.name)}})(this,i,r,o,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.exported.devicePixelRatio,this.transform.height*e.exported.devicePixelRatio]);n.setFogUniformValues(t,a)}}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const t=this._backgroundTiles,n=this._backgroundTiles={},r=this.transform.coveringTiles({tileSize:512});for(const i of r)n[i.key]=t[i.key]||new e.Tile(i,512,this.transform.tileZoom,this);return n}clearBackgroundTiles(){this._backgroundTiles={}}}class Br{constructor(e=0,t=0,n=0,r=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=n,this.right=r}interpolate(t,n,r){return null!=n.top&&null!=t.top&&(this.top=e.number(t.top,n.top,r)),null!=n.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,n.bottom,r)),null!=n.left&&null!=t.left&&(this.left=e.number(t.left,n.left,r)),null!=n.right&&null!=t.right&&(this.right=e.number(t.right,n.right,r)),this}getCenter(t,n){const r=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+n-this.bottom)/2,0,n);return new e.Point(r,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Br(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Fr(t,n){const r=e.getColumn(t,3);e.fromQuat(t,n),e.setColumn(t,3,r)}function jr(t,n){const r=e.identity$1([]);return e.rotateZ$1(r,r,-n),e.rotateX$1(r,r,-t),r}function Nr(t,n){const r=[t[0],t[1],0],i=[n[0],n[1],0];if(e.length(r)>=1e-15){const t=e.normalize([],r);e.scale$2(i,t,e.dot(i,t)),n[0]=i[0],n[1]=i[1]}const o=e.cross([],n,t);if(e.len(o)<1e-15)return null;const a=Math.atan2(-o[1],o[0]);return jr(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),a)}class Vr{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const n=t instanceof e.MercatorCoordinate?t:new e.MercatorCoordinate(t[0],t[1],t[2]);this._renderWorldCopies&&(n.x=e.wrap(n.x,0,1)),this._position=n}else this._position=null}lookAtPoint(t,n){if(this.orientation=null,!this.position)return;const r=this.position,i=this._elevation?this._elevation.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(t)):0,o=e.MercatorCoordinate.fromLngLat(t,i),a=[o.x-r.x,o.y-r.y,o.z-r.z];n||(n=[0,0,1]),n[2]=Math.abs(n[2]),this.orientation=Nr(a,n)}setPitchBearing(t,n){this.orientation=jr(e.degToRad(t),e.degToRad(-n))}}class Ur{constructor(t,n){this._transform=e.identity([]),this.orientation=n,this.position=t}get mercatorPosition(){const t=this.position;return new e.MercatorCoordinate(t[0],t[1],t[2])}get position(){const t=e.getColumn(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var n;t&&e.setColumn(this._transform,3,[(n=t)[0],n[1],n[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.identity$1([]),t&&Fr(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=jr(e,t),Fr(this._transform,this._orientation)}forward(){const t=e.getColumn(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.getColumn(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.getColumn(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,n){const r=new Float64Array(16);return e.invert(r,this.getWorldToCamera(t,n)),r}getWorldToCameraPosition(t,n,r){const i=this.position;e.scale$2(i,i,-t);const o=new Float64Array(16);return e.fromScaling(o,[r,r,r]),e.translate(o,o,i),o[10]*=n,o}getWorldToCamera(t,n){const r=new Float64Array(16),i=new Float64Array(4),o=this.position;return e.conjugate(i,this._orientation),e.scale$2(o,o,-t),e.fromQuat(r,i),e.translate(r,r,o),r[1]*=-1,r[5]*=-1,r[9]*=-1,r[13]*=-1,r[8]*=n,r[9]*=n,r[10]*=n,r[11]*=n,r}getCameraToClipPerspective(t,n,r,i){const o=new Float64Array(16);return e.perspective(o,t,n,r,i),o}getDistanceToElevation(t,n=!1){const r=0===t?0:e.mercatorZfromAltitude(t,n?e.latFromMercatorY(this.position[1]):this.position[1]),i=this.forward();return(r-this.position[2])/i[2]}clone(){return new Ur([...this.position],[...this.orientation])}}function Hr(t,n){const r=$r(t.projection,t.zoom,t.width,t.height),i=function(t,n,r,i,o){const a=new e.LngLat(r.lng-180*Gr,r.lat),s=new e.LngLat(r.lng+180*Gr,r.lat),l=t.project(a.lng,a.lat),c=t.project(s.lng,s.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),h=e.MercatorCoordinate.fromLngLat(r);h.y=e.clamp(h.y,-1+Gr,1-Gr);const d=h.toLngLat(),f=t.project(d.lng,d.lat),p=e.MercatorCoordinate.fromLngLat(d);p.x+=Gr;const m=p.toLngLat(),g=t.project(m.lng,m.lat),v=Zr(g.x-f.x,g.y-f.y,u),y=e.MercatorCoordinate.fromLngLat(d);y.y+=Gr;const _=y.toLngLat(),x=t.project(_.lng,_.lat),w=Zr(x.x-f.x,x.y-f.y,u),b=Math.abs(v.x)/Math.abs(w.y),E=e.identity([]);e.rotateZ(E,E,-u*(1-(o?0:i)));const k=e.identity([]);return e.scale(k,k,[1,1-(1-b)*i,1]),k[4]=-w.x/w.y*i,e.rotateZ(k,k,u),e.multiply(k,E,k),k}(t.projection,0,t.center,r,n),o=Wr(t);return e.scale(i,i,[o,o,1]),i}function Wr(t){const n=t.projection,r=$r(t.projection,t.zoom,t.width,t.height),i=qr(n,t.center),o=qr(n,e.LngLat.convert(n.center));return Math.pow(2,i*r+(1-r)*o)}function $r(t,n,r,i,o=1/0){const a=t.range;if(!a)return 0;const s=Math.min(o,Math.max(r,i)),l=Math.log(s/1024)/Math.LN2;return e.smoothstep(a[0]+l,a[1]+l,n)}const Gr=1/4e4;function qr(t,n){const r=e.clamp(n.lat,-e.MAX_MERCATOR_LATITUDE,e.MAX_MERCATOR_LATITUDE),i=new e.LngLat(n.lng-180*Gr,r),o=new e.LngLat(n.lng+180*Gr,r),a=t.project(i.lng,r),s=t.project(o.lng,r),l=e.MercatorCoordinate.fromLngLat(i),c=e.MercatorCoordinate.fromLngLat(o),u=s.x-a.x,h=s.y-a.y,d=c.x-l.x,f=c.y-l.y,p=Math.sqrt((d*d+f*f)/(u*u+h*h));return Math.log(p)/Math.LN2}function Zr(e,t,n){const r=Math.cos(n),i=Math.sin(n);return{x:e*r-t*i,y:e*i+t*r}}class Xr{constructor(t,n,r,i,o,a,s){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=null==r?0:r,this._maxPitch=null==i?60:i,this.setProjection(a),this.setMaxBounds(s),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Br,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Ur,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const e=new Xr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(e,t=!1){const n=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||n)&&this._updateCameraOnTerrain(),(e||n)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.pick(this.projection,["name","center","parallels"])}setProjection(n){this.projectionOptions=n||{name:"mercator"};const r=this.projection?this.getProjection():void 0;this.projection=e.getProjection(this.projectionOptions);const i=!t(r,this.getProjection());return i&&this._calcMatrices(),this.mercatorFromTransition=!1,i}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.getProjection({name:"mercator"});const n=t!==this.projection.name;return n&&this._calcMatrices(),n}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.Point(this.width,this.height)}get bearing(){return e.wrap(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const n=-t*Math.PI/180;var r;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=(r=new e.ARRAY_TYPE(4),e.ARRAY_TYPE!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r),function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);e[0]=r*l+o*s,e[1]=i*l+a*s,e[2]=r*-s+o*l,e[3]=i*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.degToRad(t),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const e=this._elevation;this._centerAltitude=e.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=e.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,n=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],r=this.horizonLineFromTop();let i=0,o=0;for(let a=0;a<n.length;a++){const s=new e.Point(n[a][0]*this.width,r+n[a][1]*(this.height-r)),l=t.pointCoordinate(s);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);i+=l[3]*c,o+=c}return 0===o?NaN:i/o}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const e=this._seaLevelZoom,t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),n=this.pixelsPerMeter/this.worldSize*t,r=this._mercatorZfromZoom(e),i=this._mercatorZfromZoom(this._maxZoom),o=Math.max(r-n,i);this._setZoom(this._zoomFromMercatorZ(o))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}computeZoomRelativeTo(t){const n=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let r;r=t.z<this._camera.position[2]?[n.x,n.y,n.z]:[t.x,t.y,t.z];const i=e.length(e.sub([],this._camera.position,r));return e.clamp(this._zoomFromMercatorZ(i),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let n=!1;if(t.orientation&&!e.exactEquals(t.orientation,this._camera.orientation)&&(n=this._setCameraOrientation(t.orientation)),t.position){const r=[t.position.x,t.position.y,t.position.z];e.exactEquals$1(r,this._camera.position)||(this._setCameraPosition(r),n=!0)}n&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,n=new Vr;return n.position=new e.MercatorCoordinate(t[0],t[1],t[2]),n.orientation=this._camera.orientation,n._elevation=this.elevation,n._renderWorldCopies=this.renderWorldCopies,n}_setCameraOrientation(t){if(!e.length$1(t))return!1;e.normalize$1(t,t);const n=e.transformQuat([],[0,0,-1],t),r=e.transformQuat([],[0,-1,0],t);if(r[2]<0)return!1;const i=Nr(n,r);return!!i&&(this._camera.orientation=i,!0)}_setCameraPosition(t){const n=this.zoomScale(this.minZoom)*this.tileSize,r=this.zoomScale(this.maxZoom)*this.tileSize,i=this.cameraToCenterDistance;t[2]=e.clamp(t[2],i/r,i/n),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(t){const n=[new e.UnwrappedTileID(0,t)];if(this.renderWorldCopies){const r=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),o=this.pointCoordinate(new e.Point(this.width,this.height)),a=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),l=Math.floor(Math.max(r.x,i.x,o.x,a.x)),c=1;for(let r=s-c;r<=l+c;r++)0!==r&&n.push(new e.UnwrappedTileID(r,t))}return n}coveringTiles(t){let n=this.coveringZoomLevel(t);const r=n,i=this.elevation&&!t.isTerrainDEM,o="mercator"===this.projection.name;if(void 0!==t.minzoom&&n<t.minzoom)return[];void 0!==t.maxzoom&&n>t.maxzoom&&(n=t.maxzoom);const a=this.locationCoordinate(this.center),s=this.center.lat,l=1<<n,c=[l*a.x,l*a.y,0],u="globe"===this.projection.name,h=!u,d=e.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n,h),f=u?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),p=l*e.mercatorZfromAltitude(1,this.center.lat),m=this._camera.position[2]/e.mercatorZfromAltitude(1,this.center.lat),g=[l*f.x,l*f.y,m*(h?1:p)],v=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),y=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?n:0,_=t.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,x=t.isTerrainDEM?-_:this._elevation?this._elevation.getMinElevationBelowMSL():0,w=this.projection.isReprojectedInTileSpace?Wr(this):1,b=t=>{const n=1/4e4,r=new e.MercatorCoordinate(t.x+n,t.y,t.z),i=new e.MercatorCoordinate(t.x,t.y+n,t.z),o=t.toLngLat(),a=r.toLngLat(),s=i.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(a),u=this.locationCoordinate(s),h=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(h*d)*w/n},E=t=>{const n=_,r=x;return{aabb:e.tileAABB(this,l,0,0,0,t,r,n,this.projection),zoom:0,x:0,y:0,minZ:r,maxZ:n,wrap:t,fullyVisible:!1}},k=[];let T=[];const M=n,S=t.reparseOverscaled?r:n,C=e=>e*e,A=C((m-this._centerAltitude)*p),I=e=>{if(!this._elevation||!e.tileID||!o)return;const t=this._elevation.getMinMaxForTile(e.tileID),n=e.aabb;t?(n.min[2]=t.min,n.max[2]=t.max,n.center[2]=(n.min[2]+n.max[2])/2):(e.shouldSplit=R(e),e.shouldSplit||(n.min[2]=n.max[2]=n.center[2]=this._centerAltitude))},R=t=>{if(t.zoom<y)return!0;if(t.zoom===M)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const n=t.aabb.distanceX(g),o=t.aabb.distanceY(g);let a=A,l=1;if(u){a=C(t.aabb.distanceZ(g));const n=Math.pow(2,t.zoom),r=e.latFromMercatorY((t.y+1)/n),i=e.latFromMercatorY(t.y/n),o=Math.min(Math.max(s,r),i),c=e.circumferenceAtLatitude(o)/e.circumferenceAtLatitude(s);if(l=o===s?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,c/this._mercatorScaleRatio),this.zoom<=e.GLOBE_ZOOM_THRESHOLD_MIN&&t.zoom===M-1&&c>=.9)return!0}else if(i&&(a=C(t.aabb.distanceZ(g)*p)),this.projection.isReprojectedInTileSpace&&r<=5){const n=Math.pow(2,t.zoom),r=b(new e.MercatorCoordinate((t.x+.5)/n,(t.y+.5)/n));l=r>.85?1:r}const c=n*n+o*o+a,h=C((1<<M-t.zoom)*v*l*((e,t)=>{if(t*C(.707)<e)return 1;const n=Math.sqrt(t/e);return n/(1.4144271570014144+(Math.pow(1.1,n-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(a,A),c));return c<h};if(this.renderWorldCopies)for(let e=1;e<=3;e++)k.push(E(-e)),k.push(E(e));for(k.push(E(0));k.length>0;){const r=k.pop(),a=r.x,s=r.y;let h=r.fullyVisible;if(!h){const e=r.aabb.intersects(d);if(0===e)continue;h=2===e}if(r.zoom!==M&&R(r))for(let t=0;t<4;t++){const n=(a<<1)+t%2,c=(s<<1)+(t>>1),d={aabb:o?r.aabb.quadrant(t):e.tileAABB(this,l,r.zoom+1,n,c,r.wrap,r.minZ,r.maxZ,this.projection),zoom:r.zoom+1,x:n,y:c,wrap:r.wrap,fullyVisible:h,tileID:void 0,shouldSplit:void 0,minZ:r.minZ,maxZ:r.maxZ};i&&!u&&(d.tileID=new e.OverscaledTileID(r.zoom+1===M?S:r.zoom+1,r.wrap,r.zoom+1,n,c),I(d)),k.push(d)}else{const i=r.zoom===M?S:r.zoom;if(t.minzoom&&t.minzoom>i)continue;const o=c[0]-(.5+a+(r.wrap<<r.zoom))*(1<<n-r.zoom),l=c[1]-.5-s,u=r.tileID?r.tileID:new e.OverscaledTileID(i,r.wrap,r.zoom,a,s);T.push({tileID:u,distanceSq:o*o+l*l})}}if(this.fogCullDistSq){const n=this.fogCullDistSq,r=this.horizonLineFromTop();T=T.filter((i=>{const o=[0,0,0,1],a=[e.EXTENT,e.EXTENT,0,1],s=this.calculateFogTileMatrix(i.tileID.toUnwrapped());e.transformMat4$1(o,o,s),e.transformMat4$1(a,a,s);const l=e.getAABBPointSquareDist(o,a);if(0===l)return!0;let c=!1;const u=this._elevation;if(u&&l>n&&0!==r){const n=this.calculateProjMatrix(i.tileID.toUnwrapped());let o;t.isTerrainDEM||(o=u.getMinMaxForTile(i.tileID)),o||(o={min:x,max:_});const a=e.furthestTileCorner(this.rotation),s=[a[0]*e.EXTENT,a[1]*e.EXTENT,o.max];e.transformMat4(s,s,n),c=(1-s[1])*this.height*.5<r}return l<n||c}))}return T.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){const n=e.clamp(t.lat,-e.MAX_MERCATOR_LATITUDE,e.MAX_MERCATOR_LATITUDE),r=this.projection.project(t.lng,n);return new e.Point(r.x*this.worldSize,r.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.mercatorZfromAltitude(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,n){let r,i;const o=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;r=(n.x-o.x)/e,i=(n.y-o.y)/e}else{const e=this.pointCoordinate(n),t=this.pointCoordinate(o);r=e.x-t.x,i=e.y-t.y}const a=this.locationCoordinate(t);this.setLocation(new e.MercatorCoordinate(a.x-r,a.y-i))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e){return this.projection.locationPoint(this,e)}locationPoint3D(e){return this.projection.locationPoint(this,e,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e){return this.coordinateLocation(this.pointCoordinate3D(e))}locationCoordinate(t,n){const r=n?e.mercatorZfromAltitude(n,t.lat):void 0,i=this.projection.project(t.lng,t.lat);return new e.MercatorCoordinate(i.x,i.y,r)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,n){const r=null!=n?n:this._centerAltitude,i=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.transformMat4$1(i,i,this.pixelMatrixInverse),e.transformMat4$1(o,o,this.pixelMatrixInverse);const a=o[3];e.scale$1(i,i,1/i[3]),e.scale$1(o,o,1/a);const s=i[2],l=o[2];return{p0:i,p1:o,t:s===l?0:(r-s)/(l-s)}}screenPointToMercatorRay(t){const n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];return e.transformMat4$1(n,n,this.pixelMatrixInverse),e.transformMat4$1(r,r,this.pixelMatrixInverse),e.scale$1(n,n,1/n[3]),e.scale$1(r,r,1/r[3]),n[2]=e.mercatorZfromAltitude(n[2],this._center.lat)*this.worldSize,r[2]=e.mercatorZfromAltitude(r[2],this._center.lat)*this.worldSize,e.scale$1(n,n,1/this.worldSize),e.scale$1(r,r,1/this.worldSize),new e.Ray([n[0],n[1],n[2]],e.normalize([],e.sub([],r,n)))}rayIntersectionCoordinate(t){const{p0:n,p1:r,t:i}=t,o=e.mercatorZfromAltitude(n[2],this._center.lat),a=e.mercatorZfromAltitude(r[2],this._center.lat);return new e.MercatorCoordinate(e.number(n[0],r[0],i)/this.worldSize,e.number(n[1],r[1],i)/this.worldSize,e.number(o,a,i))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t){if(!this.elevation)return this.pointCoordinate(t);let n=this.projection.pointCoordinate3D(this,t.x,t.y);if(n)return new e.MercatorCoordinate(n[0],n[1],n[2]);let r=0,i=this.horizonLineFromTop();if(t.y>i)return this.pointCoordinate(t);const o=.02*i,a=t.clone();for(let t=0;t<10&&i-r>o;t++){a.y=e.number(r,i,.66);const t=this.projection.pointCoordinate3D(this,a.x,a.y);t?(i=a.y,n=t):r=a.y}return n?new e.MercatorCoordinate(n[0],n[1],n[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX)return!this.isPointAboveHorizon(t);const n=this.pointCoordinate(t);return n.y>=0&&n.y<=1}_coordinatePoint(t,n){const r=n&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,i=[t.x*this.worldSize,t.y*this.worldSize,r+t.toAltitude(),1];return e.transformMat4$1(i,i,this.pixelMatrix),i[3]>0?new e.Point(i[0]/i[3],i[1]/i[3]):new e.Point(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:n}=this._edgeInsets,r=this.height-this._edgeInsets.bottom,i=this.width-this._edgeInsets.right,o=this.pointLocation3D(new e.Point(n,t)),a=this.pointLocation3D(new e.Point(i,t)),s=this.pointLocation3D(new e.Point(i,r)),l=this.pointLocation3D(new e.Point(n,r));let c=Math.min(o.lng,a.lng,s.lng,l.lng),u=Math.max(o.lng,a.lng,s.lng,l.lng),h=Math.min(o.lat,a.lat,s.lat,l.lat),d=Math.max(o.lat,a.lat,s.lat,l.lat);const f=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,m=(t,n,r,i,o)=>{const a=(t+r)/2,s=(n+i)/2,l=new e.Point(a,s),{lng:g,lat:v}=this.pointLocation3D(l),y=Math.max(0,c-g,h-v,g-u,v-d);c=Math.min(c,g),u=Math.max(u,g),h=Math.min(h,v),d=Math.max(d,v),(o<p||y>f)&&(m(t,n,a,s,o+1),m(a,s,r,i,o+1))};if(m(n,t,i,t,1),m(i,t,i,r,1),m(i,r,n,r,1),m(n,r,n,t,1),"globe"===this.projection.name){const[t,n]=e.polesInViewport(this);t?(d=90,u=180,c=-180):n&&(h=-90,u=180,c=-180)}return new e.LngLatBounds(new e.LngLat(c,h),new e.LngLat(u,d))}_getBoundsRectangular(t,n){const{top:r,left:i}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,a=this.width-this._edgeInsets.right,s=new e.Point(i,r),l=new e.Point(a,r),c=new e.Point(a,o),u=new e.Point(i,o);let h=this.pointCoordinate(s,t),d=this.pointCoordinate(l,t);const f=this.pointCoordinate(c,n),p=this.pointCoordinate(u,n),m=(e,t)=>(t.y-e.y)/(t.x-e.x);return h.y>1&&d.y>=0?h=new e.MercatorCoordinate((1-p.y)/m(p,h)+p.x,1):h.y<0&&d.y<=1&&(h=new e.MercatorCoordinate(-p.y/m(p,h)+p.x,0)),d.y>1&&h.y>=0?d=new e.MercatorCoordinate((1-f.y)/m(f,d)+f.x,1):d.y<0&&h.y<=1&&(d=new e.MercatorCoordinate(-f.y/m(f,d)+f.x,0)),(new e.LngLatBounds).extend(this.coordinateLocation(h)).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(f))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce(((e,t)=>{if(t.dem){const n=t.dem.tree;e.min=Math.min(e.min,n.minimums[0]),e.max=Math.max(e.max,n.maximums[0])}return e}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,n=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,n):n}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.MAX_MERCATOR_LATITUDE,this.maxLat=e.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=e.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=e.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=e.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=e.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(t){const n=t.key,r=this._distanceTileDataCache;if(r[n])return r[n];const i=t.canonical,o=1/this.height,a=this.cameraWorldSize,s=a/this.zoomScale(i.z),l=(i.x+Math.pow(2,i.z)*t.wrap)*s,c=i.y*s,u=this.point;u.x*=a/this.worldSize,u.y*=a/this.worldSize;const h=this.angle,d=Math.sin(-h),f=-Math.cos(-h);return r[n]={bearing:[d,f],center:[(u.x-l)*o,(u.y-c)*o],scale:s/e.EXTENT*o},r[n]}calculateFogTileMatrix(t){const n=t.key,r=this._fogTileMatrixCache;if(r[n])return r[n];const i=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return e.multiply(i,this.worldToFogMatrix,i),r[n]=new Float32Array(i),r[n]}calculateProjMatrix(t,n=!1){const r=t.key,i=n?this._alignedProjMatrixCache:this._projMatrixCache;if(i[r])return i[r];const o=this.calculatePosMatrix(t,this.worldSize);return e.multiply(o,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.alignedProjMatrix:this.projMatrix,o),i[r]=new Float32Array(o),i[r]}calculatePixelsToTileUnitsMatrix(t){const n=t.tileID.key,r=this._pixelsToTileUnitsCache;if(r[n])return r[n];const i=function(t,n){const{scale:r}=t.tileTransform,i=r*e.EXTENT/(t.tileSize*Math.pow(2,n.zoom-t.tileID.overscaledZ+t.tileID.canonical.z));return o=new Float32Array(4),l=(a=n.inverseAdjustmentMatrix)[1],c=a[2],u=a[3],d=(s=[i,i])[1],o[0]=a[0]*(h=s[0]),o[1]=l*h,o[2]=c*d,o[3]=u*d,o;var o,a,s,l,c,u,h,d}(t,this);return r[n]=i,r[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,n=e.fromScaling([],[t,t,t]);return e.multiply(n,n,this.globeMatrix),n}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const n=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,r=this._computeCameraPosition(n),i=this._camera.forward(),o=e.mercatorZfromAltitude(1,this._center.lat);r[2]/=o,i[2]/=o,e.normalize(i,i);const a=t.raycast(r,i,t.exaggeration());if(a){const t=e.scaleAndAdd([],r,i,a),n=new e.MercatorCoordinate(t[0],t[1],e.mercatorZfromAltitude(t[2],e.latFromMercatorY(t[1]))),s=(n.z+e.length([n.x-r[0],n.y-r[1],n.z-r[2]*o]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(s),this._centerAltitude=n.toAltitude(),this._center=this.coordinateLocation(n),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const n=this._elevation,r=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(r),o=n.getAtPointOrZero(new e.MercatorCoordinate(...i)),a=this.pixelsPerMeter/this.worldSize*o,s=this._minimumHeightOverTerrain(),l=i[2]-a;if(l<=s)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),n=[i[0],i[1],t.z-i[2]],r=e.length(n);n[2]-=(s-l)/this._pixelsPerMercatorPixel;const o=e.length(n);if(0===o)return;e.scale$2(n,n,r/o*this._pixelsPerMercatorPixel),this._camera.position=[i[0],i[1],t.z*this._pixelsPerMercatorPixel-n[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const n=this.center;return n.lat=e.clamp(n.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(n.lng=e.clamp(n.lng,this.minLng,this.maxLng)),this.center=n,void(this._constraining=!1)}const n=this._unmodified,{x:r,y:i}=this.point;let o=0,a=r,s=i;const l=this.width/2,c=this.height/2,u=this.worldMinY*this.scale,h=this.worldMaxY*this.scale;if(i-c<u&&(s=u+c),i+c>h&&(s=h-c),h-u<this.height&&(o=Math.max(o,this.height/(h-u)),s=(h+u)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,n=this.worldSize/2-(e+t)/2;a=(r+n+this.worldSize)%this.worldSize-n,a-l<e&&(a=e+l),a+l>t&&(a=t-l),t-e<this.width&&(o=Math.max(o,this.width/(t-e)),a=(t+e)/2)}a===r&&s===i||(this.center=this.unproject(new e.Point(a,s))),o&&(this.zoom+=this.scaleZoom(o)),this._constrainCamera(),this._unmodified=n,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.mercatorZfromAltitude(1,this.center.lat)/e.mercatorZfromAltitude(1,e.GLOBE_SCALE_MATCH_LATITUDE));const r=$r(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,r),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const i="meters"===this.projection.zAxisUnit?n:1,o=this._camera.getWorldToCamera(this.worldSize,i),a=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);a[8]=2*-t.x/this.width,a[9]=2*t.y/this.height;let s=e.mul([],a,o);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),n=e.identity([]);e.translate(n,n,[t.x*this.worldSize,t.y*this.worldSize,0]),e.multiply(n,n,Hr(this)),e.translate(n,n,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.multiply(s,s,n),this.inverseAdjustmentMatrix=function(e){const t=Hr(e,!0);return y([],[t[0],t[1],t[4],t[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=e.scale([],s,[this.worldSize,this.worldSize,this.worldSize/i,1]),this.projMatrix=s,this.invProjMatrix=e.invert(new Float64Array(16),this.projMatrix);const l=e.invert([],a);this.frustumCorners=e.FrustumCorners.fromInvProjectionMatrix(l,this.horizonLineFromTop(),this.height);const c=new Float32Array(16);e.identity(c),e.scale(c,c,[1,-1,1]),e.rotateX(c,c,this._pitch),e.rotateZ(c,c,this.angle);const u=e.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),h=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;u[8]=2*-t.x/this.width,u[9]=2*(t.y+h)/this.height,this.skyboxMatrix=e.multiply(c,u,c);const d=this.point,f=d.x,p=d.y,m=this.width%2/2,g=this.height%2/2,v=Math.cos(this.angle),_=Math.sin(this.angle),x=f-Math.round(f)+v*m+_*g,w=p-Math.round(p)+v*g+_*m,b=new Float64Array(s);if(e.translate(b,b,[x>.5?x-1:x,w>.5?w-1:w,0]),this.alignedProjMatrix=b,s=e.create(),e.scale(s,s,[this.width/2,-this.height/2,1]),e.translate(s,s,[1,-1,0]),this.labelPlaneMatrix=s,s=e.create(),e.scale(s,s,[1,-1,1]),e.translate(s,s,[-1,-1,0]),e.scale(s,s,[2/this.width,2/this.height,1]),this.glCoordMatrix=s,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},s=e.invert(new Float64Array(16),this.pixelMatrix),!s)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=s,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.calculateGlobeMatrix(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.transformMat4(t,t,o),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=s;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,n=this.cameraPixelsPerMeter,r=this._camera.position,i=1/this.height/this._pixelsPerMercatorPixel,o=[t,t,n];e.scale$2(o,o,i),e.scale$2(r,r,-1),e.multiply$2(r,r,o);const a=e.create();e.translate(a,a,r),e.scale(a,a,o),this.mercatorFogMatrix=a,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,n,i)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,n=this._camera.forward(),r=this.point,i=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[r.x/this.worldSize-n[0]*i,r.y/this.worldSize-n[1]*i,e/this.worldSize*this._centerAltitude-n[2]*i]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const n=this._maxCameraBoundsDistance()*Math.cos(this._pitch),r=this._camera.position[2],i=t[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),i>0&&(o=Math.min((n-r)/i,1)),this._camera.position=e.scaleAndAdd([],this._camera.position,t,o),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,n=this._camera.forward(),{pitch:r,bearing:i}=this._camera.getPitchBearing(),o=e.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,a=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.degToRad(this._maxPitch)),s=Math.max((t[2]-o)/Math.cos(r),a),l=this._zoomFromMercatorZ(s);e.scaleAndAdd(t,t,n,s),this._pitch=e.clamp(r,e.degToRad(this.minPitch),e.degToRad(this.maxPitch)),this.angle=e.wrap(i,-Math.PI,Math.PI),this._setZoom(e.clamp(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.MercatorCoordinate(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}zoomFromMercatorZAdjusted(t){let n=0,r=e.GLOBE_ZOOM_THRESHOLD_MAX,i=0,o=1/0;for(;r-n>1e-6&&r>n;){const e=n+.5*(r-n),a=this.tileSize*Math.pow(2,e),s=this.getCameraToCenterDistance(this.projection,e,a),l=this.scaleZoom(s/(t*this.tileSize)),c=Math.abs(e-l);c<o&&(o=c,i=e),e<l?n=e:r=e}return i}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(e.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,n){const r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),o=Math.min(t.y,n.y),a=Math.max(t.y,n.y);if(o<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const s=[new e.Point(r,o),new e.Point(i,a),new e.Point(r,a),new e.Point(i,o)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const e of s){const t=this.pointRayIntersection(e);if(t.t<0)return!0;const n=this.rayIntersectionCoordinate(t);if(n.x<l||n.y<0||n.x>c||n.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.Point(0,0),new e.Point(this.width,this.height))}zoomDeltaToMovement(t,n){const r=e.length(e.sub([],this._camera.position,t)),i=this._zoomFromMercatorZ(r)+n;return r-this._mercatorZfromZoom(i)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,n,r],i){const o=[t,n,r,1];e.transformMat4$1(o,o,i);const a=o[3]=Math.max(o[3],1e-6);return o[0]/=a,o[1]/=a,o[2]/=a,o}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.Point(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,t))}}getCameraToCenterDistance(e,t=this.zoom,n=this.worldSize){const r=$r(e,t,this.width,this.height,1024),i=e.pixelSpaceConversion(this.center.lat,n,r);return.5/Math.tan(.5*this._fov)*this.height*i}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.multiply(t,t,this.globeMatrix),t}}function Yr(e,t){let n=!1,r=null;const i=()=>{r=null,n&&(e(),r=setTimeout(i,t),n=!1)};return()=>(n=!0,r||i(),r)}class Kr{constructor(t){this._hashName=t&&encodeURIComponent(t),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Yr(this._updateHashUnthrottled.bind(this),300)}addTo(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),t.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),e.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const t=this._map;if(!t)return"";const n=Jr(t);if(this._hashName){const t=this._hashName;let r=!1;const i=e.window.location.hash.slice(1).split("&").map((e=>{const i=e.split("=")[0];return i===t?(r=!0,`${i}=${n}`):e})).filter((e=>e));return r||i.push(`${t}=${n}`),`#${i.join("&")}`}return`#${n}`}_getCurrentHash(){const t=e.window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((e=>e.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some((e=>isNaN(e)))){const n=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());e.window.history.replaceState(e.window.history.state,null,t)}}function Jr(e,t){const n=e.getCenter(),r=Math.round(100*e.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(n.lng*o)/o,s=Math.round(n.lat*o)/o,l=e.getBearing(),c=e.getPitch();let u=t?`/${a}/${s}/${r}`:`${r}/${s}/${a}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const Qr={linearity:.3,easing:e.bezier(0,0,.3,1)},ei=e.extend({deceleration:2500,maxSpeed:1400},Qr),ti=e.extend({deceleration:20,maxSpeed:1400},Qr),ni=e.extend({deceleration:1e3,maxSpeed:360},Qr),ri=e.extend({deceleration:1e3,maxSpeed:90},Qr);class ii{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=e.exported.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,e.panDelta&&n.pan._add(e.panDelta),e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(n.pan.mag()){const o=ai(n.pan.mag(),r,e.extend({},ei,t||{}));i.offset=n.pan.mult(o.amount/n.pan.mag()),i.center=this._map.transform.center,oi(i,o)}if(n.zoom){const e=ai(n.zoom,r,ti);i.zoom=this._map.transform.zoom+e.amount,oi(i,e)}if(n.bearing){const t=ai(n.bearing,r,ni);i.bearing=this._map.transform.bearing+e.clamp(t.amount,-179,179),oi(i,t)}if(n.pitch){const e=ai(n.pitch,r,ri);i.pitch=this._map.transform.pitch+e.amount,oi(i,e)}if(i.zoom||i.bearing){const e=void 0===n.pinchAround?n.around:n.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),i.noMoveStart=!0,i}}function oi(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function ai(t,n,r){const{maxSpeed:i,linearity:o,deceleration:a}=r,s=e.clamp(t*o/(n/1e3),-i,i),l=Math.abs(s)/(a*o);return{easing:r.easing,duration:1e3*l,amount:s*(l/2)}}class si extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,r,i={}){const o=p(n.getCanvasContainer(),r),a=n.unproject(o);super(t,e.extend({point:o,lngLat:a,originalEvent:r},i)),this._defaultPrevented=!1,this.target=n}}class li extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,r){const i="touchend"===t?r.changedTouches:r.touches,o=m(n.getCanvasContainer(),i),a=o.map((e=>n.unproject(e))),s=o.reduce(((e,t,n,r)=>e.add(t.div(r.length))),new e.Point(0,0));super(t,{points:o,point:s,lngLats:a,lngLat:n.unproject(s),originalEvent:r}),this._defaultPrevented=!1}}class ci extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class ui{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new ci(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new si(e.type,this._map,e))}mouseup(e){this._map.fire(new si(e.type,this._map,e))}preclick(t){const n=e.extend({},t);n.type="preclick",this._map.fire(new si(n.type,this._map,n))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new si(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new si(e.type,this._map,e))}mouseover(e){this._map.fire(new si(e.type,this._map,e))}mouseout(e){this._map.fire(new si(e.type,this._map,e))}touchstart(e){return this._firePreventable(new li(e.type,this._map,e))}touchmove(e){this._map.fire(new li(e.type,this._map,e))}touchend(e){this._map.fire(new li(e.type,this._map,e))}touchcancel(e){this._map.fire(new li(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class hi{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new si(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new si("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new si(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class di{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(u(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const n=t,r=this._startPos,i=this._lastPos;if(!r||!i||i.equals(n)||!this._box&&n.dist(r)<this._clickTolerance)return;this._lastPos=n,this._box||(this._box=o("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const a=Math.min(r.x,n.x),s=Math.max(r.x,n.x),l=Math.min(r.y,n.y),c=Math.max(r.y,n.y);this._map._requestDomTask((()=>{this._box&&(this._box.style.transform=`translate(${a}px,${l}px)`,this._box.style.width=s-a+"px",this._box.style.height=c-l+"px")}))}mouseupWindow(t,n){if(!this._active)return;const r=this._startPos,i=n;if(r&&0===t.button){if(this.reset(),f(),r.x!==i.x||r.y!==i.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(r,i,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),h(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new e.Event(t,{originalEvent:n}))}}function fi(e,t){const n={};for(let r=0;r<e.length;r++)n[e[r].identifier]=t[r];return n}class pi{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,n,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){const n=new e.Point(0,0);for(const e of t)n._add(e);return n.div(t.length)}(n),this.touches=fi(r,n)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;const r=fi(n,t);for(const e in this.touches){const t=r[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class mi{constructor(e){this.singleTap=new pi(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){const r=this.singleTap.touchend(e,t,n);if(r){const t=e.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class gi{constructor(){this._zoomIn=new mi({numTouches:1,numTaps:2}),this._zoomOut=new mi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){const r=this._zoomIn.touchend(e,t,n),i=this._zoomOut.touchend(e,t,n);return r?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(r)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const vi={0:1,2:2};class yi{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const n=g(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}mousemoveWindow(e,t){const n=this._lastPoint;if(n)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const n=vi[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(n,t)}mouseupWindow(e){this._lastPoint&&g(e)===this._eventButton&&(this._moved&&f(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class _i extends yi{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class xi extends yi{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const n=.8*(t.x-e.x);if(n)return this._active=!0,{bearingDelta:n}}contextmenu(e){e.preventDefault()}}class wi extends yi{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const n=-.5*(t.y-e.y);if(n)return this._active=!0,{pitchDelta:n}}contextmenu(e){e.preventDefault()}}class bi{constructor(t,n){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=n.clickTolerance||1,this.reset(),e.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(t,n,r){if(this._active&&!(r.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===r.length&&!e.isFullscreen())return void this._showTouchPanBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,n,r)}}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&n.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,r){r.length>0&&(this._active=!0);const i=fi(r,n),o=new e.Point(0,0),a=new e.Point(0,0);let s=0;for(const e in i){const t=i[e],n=this._touches[e];n&&(o._add(t),a._add(t.sub(n)),s++,i[e]=t)}if(this._touches=i,s<this._minTouches||!a.mag())return;const l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=o("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")}),500)}}class Ei{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,n){return{}}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){const r=this._firstTwoTouches;if(!r)return;e.preventDefault();const[i,o]=r,a=ki(n,t,i),s=ki(n,t,o);if(!a||!s)return;const l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;const[r,i]=this._firstTwoTouches,o=ki(n,t,r),a=ki(n,t,i);o&&a||(this._active&&f(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ki(e,t,n){for(let r=0;r<e.length;r++)if(e[r].identifier===n)return t[r]}function Ti(e,t){return Math.log(e/t)/Math.LN2}class Mi extends Ei{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Ti(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ti(this._distance,n),pinchAround:t}}}function Si(e,t){return 180*e.angleWith(t)/Math.PI}class Ci extends Ei{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const n=this._vector;if(this._vector=e[0].sub(e[1]),n&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Si(this._vector,n),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,n=this._startVector;if(!n)return!1;const r=Si(e,n);return Math.abs(r)<t}}function Ai(e){return Math.abs(e.y)>Math.abs(e.x)}class Ii extends Ei{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,Ai(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,n,r){const i=this._lastPoints;if(!i)return;const o=t[0].sub(i[0]),a=t[1].sub(i[1]);return this._map._cooperativeGestures&&!e.isFullscreen()&&r.touches.length<3||(this._valid=this.gestureBeginsVertically(o,a,r.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+a.y)/2*-.5})}gestureBeginsVertically(e,t,n){if(void 0!==this._valid)return this._valid;const r=e.mag()>=2,i=t.mag()>=2;if(!r&&!i)return;if(!r||!i)return null==this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return Ai(e)&&Ai(t)&&o}}const Ri={panStep:100,bearingStep:15,pitchStep:10};class Li{constructor(){const e=Ri;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,r=0,i=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,r=0),{cameraAnimation:a=>{const s=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:zi,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:a.getBearing()+n*this._bearingStep,pitch:a.getPitch()+r*this._pitchStep,offset:[-i*this._panStep,-o*this._panStep],center:a.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function zi(e){return e*(2-e)}const Pi=4.000244140625;class Oi{constructor(t,n){this._map=t,this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let n=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const r=e.exported.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%Pi==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=p(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const n=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>Pi?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);const i=n(),o=Math.pow(2,i),a="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(a*r))),"wheel"===this._type&&(this._startZoom=i,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:n(),i=this._startZoom,o=this._easing;let a,s=!1;if("wheel"===this._type&&i&&o){const t=Math.min((e.exported.now()-this._lastWheelEventTime)/200,1),n=o(t);a=e.number(i,r,n),t<1?this._frameId||(this._frameId=!0):s=!0}else a=r,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-n(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=e.ease;if(this._prevEase){const t=this._prevEase,r=(e.exported.now()-t.start)/t.duration,i=t.easing(r+.01)-t.easing(r),o=.27/Math.sqrt(i*i+1e-4)*.01,a=Math.sqrt(.0729-o*o);n=e.bezier(o,a,.25,1)}return this._prevEase={start:e.exported.now(),duration:t,easing:n},n}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=o("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(e.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")}),200)}}class Di{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Bi{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fi{constructor(){this._tap=new mi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,n){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=t[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(e,t,n))}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;const r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(e,t,n)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ji{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ni{constructor(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Vi{constructor(e,t,n,r){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Ui=e=>e.zoom||e.drag||e.pitch||e.rotate;class Hi extends e.Event{}class Wi{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,n){const r=e.sub([],n,t);this.radius=e.length(r[2]<0?e.div([],r,this.constants):[r[0],r[1],0])}projectRay(t){e.div(t,t,this.constants),e.normalize(t,t),e.mul$1(t,t,this.constants);const n=e.scale$2([],t,this.radius);if(n[2]>0){const t=e.scale$2([],[0,0,1],e.dot(n,[0,0,1])),r=e.scale$2([],e.normalize([],[n[0],n[1],0]),this.radius),i=e.add([],n,e.scale$2([],e.sub([],e.add([],r,t),n),2));n[0]=i[0],n[1]=i[1]}return n}}function $i(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Gi{constructor(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ii(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Wi,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[e.window,"blur",void 0]];for(const[t,n,r]of this._listeners)t.addEventListener(n,t===e.window.document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(const[t,n,r]of this._listeners)t.removeEventListener(n,t===e.window.document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){const t=this._map,n=t.getCanvasContainer();this._add("mapEvent",new ui(t,e));const r=t.boxZoom=new di(t,e);this._add("boxZoom",r);const i=new gi,o=new Bi;t.doubleClickZoom=new Di(o,i),this._add("tapZoom",i),this._add("clickZoom",o);const a=new Fi;this._add("tapDragZoom",a);const s=t.touchPitch=new Ii(t);this._add("touchPitch",s);const l=new xi(e),c=new wi(e);t.dragRotate=new Ni(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new _i(e),h=new bi(t,e);t.dragPan=new ji(n,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const d=new Ci,f=new Mi;t.touchZoomRotate=new Vi(n,f,d,a),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new hi(t));const p=t.scrollZoom=new Oi(t,this);this._add("scrollZoom",p,["mousePan"]);const m=t.keyboard=new Li;this._add("keyboard",m);for(const n of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[n]&&t[n].enable(e[n])}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ui(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,n){for(const r in e)if(r!==n&&(!t||t.indexOf(r)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const n of e)this._el.contains(n.target)&&t.push(n);return t}handleEvent(e,t){this._updatingCamera=!0;const n="renderFrame"===e.type,r=n?void 0:e,i={needsRenderFrame:!1},o={},a={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?m(this._el,s):n?void 0:p(this._el,e);for(const{handlerName:n,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let h;this._blockedByActive(a,u,n)?c.reset():c[t||e.type]&&(h=c[t||e.type](e,l,s),this.mergeHandlerResult(i,o,h,n,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||c.isActive())&&(a[n]=c)}const c={};for(const e in this._previousActiveHandlers)a[e]||(c[e]=r);this._previousActiveHandlers=a,(Object.keys(c).length||$i(i))&&(this._changes.push([i,o,c]),this._triggerRenderFrame()),(Object.keys(a).length||$i(i))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=i;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(t,n,r,i,o){if(!r)return;e.extend(t,r);const a={handlerName:i,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(n.zoom=a),void 0!==r.panDelta&&(n.drag=a),void 0!==r.pitchDelta&&(n.pitch=a),void 0!==r.bearingDelta&&(n.rotate=a)}_applyChanges(){const t={},n={},r={};for(const[i,o,a]of this._changes)i.panDelta&&(t.panDelta=(t.panDelta||new e.Point(0,0))._add(i.panDelta)),i.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(t.around=i.around),void 0!==i.aroundCoord&&(t.aroundCoord=i.aroundCoord),void 0!==i.pinchAround&&(t.pinchAround=i.pinchAround),i.noInertia&&(t.noInertia=i.noInertia),e.extend(n,o),e.extend(r,a);this._updateMapTransform(t,n,r),this._changes=[]}_updateMapTransform(t,n,r){const i=this._map,o=i.transform,a=e=>[e.x,e.y,e.z];if((e=>{const t=this._eventsInProgress.drag;return t&&!this._handlersById[t.handlerName].isActive()})()&&!$i(t)){const e=o.zoom;o.cameraElevationReference="sea",o.recenterOnTerrain(),o.cameraElevationReference="ground",e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&i._stop(!0),!$i(t))return void this._fireEvents(n,r,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,aroundCoord:d,pinchAround:f}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==f&&(h=f),(l||(e=>n[e]&&!this._eventsInProgress[e])("drag"))&&h&&(this._dragOrigin=a(o.pointCoordinate3D(h)),this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",i._stop(!0),h=h||i.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const p=[0,0,0];if(s)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h.sub(s)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1]}else{const t=o.pointCoordinate(h);if("globe"===o.projection.name){s=s.rotate(-o.angle);const n=o._pixelsPerMercatorPixel/o.worldSize;p[0]=-s.x*e.mercatorScale(e.latFromMercatorY(t.y))*n,p[1]=-s.y*e.mercatorScale(o.center.lat)*n}else{const e=o.pointCoordinate(h.sub(s));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const m=o.zoom,g=[0,0,0];if(l){const t=a(d||o.pointCoordinate3D(h)),n={dir:e.normalize([],e.sub([],t,o._camera.position))};if(n.dir[2]<0){const r=o.zoomDeltaToMovement(t,l);e.scale$2(g,n.dir,r)}}const v=e.add(p,p,g);o._translateCameraConstrained(v),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,r,!0)}_fireEvents(t,n,r){const i=Ui(this._eventsInProgress),o=Ui(t),a={};for(const e in t){const{originalEvent:n}=t[e];this._eventsInProgress[e]||(a[`${e}start`]=n),this._eventsInProgress[e]=t[e]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:n}=t[e];this._fireEvent(e,n)}const s={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:r}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=n[t]||r,s[`${e}end`]=l)}for(const e in s)this._fireEvent(e,s[e]);const c=Ui(this._eventsInProgress);if(r&&(i||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;t?(n(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.Event("moveend",{originalEvent:l})),n(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new e.Event(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{this._frameId=void 0,this.handleEvent(new Hi("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const qi="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Zi extends e.Evented{constructor(t,n){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this._respectPrefersReducedMotion=!1!==n.respectPrefersReducedMotion,e.bindAll(["_renderFrameCallback"],this)}getCenter(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,n,r){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},n),r)}panTo(t,n,r){return this.easeTo(e.extend({center:t},n),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,n,r){return this.easeTo(e.extend({zoom:t},n),r)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,n,r){return this.easeTo(e.extend({bearing:t},n),r)}resetNorth(t,n){return this.rotateTo(0,e.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(t,n){t=e.LngLatBounds.convert(t);const r=n&&n.bearing||0,i=n&&n.pitch||0,o=t.getNorthWest(),a=t.getSouthEast();return this._cameraForBounds(this.transform,o,a,r,i,n)}_extendCameraOptions(t){const n={top:0,bottom:0,right:0,left:0};if("number"==typeof(t=e.extend({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding){const e=t.padding;t.padding={top:e,bottom:e,right:e,left:e}}return t.padding=e.extend(n,t.padding),t}_minimumAABBFrustumDistance(e,t){const n=t.max[0]-t.min[0],r=t.max[1]-t.min[1];return n/r>e.aspect?n/(2*Math.tan(.5*e.fovX)*e.aspect):r/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,n,r,i,o,a){const s=t.clone(),l=this._extendCameraOptions(a);s.bearing=i,s.pitch=o;const c=e.LngLat.convert(n),u=e.LngLat.convert(r),h=.5*(c.lat+u.lat),d=.5*(c.lng+u.lng),f=e.latLngToECEF(h,d),p=e.normalize([],f),m=e.normalize([],e.cross([],p,[0,1,0])),g=e.cross([],m,p),v=[m[0],m[1],m[2],0,g[0],g[1],g[2],0,p[0],p[1],p[2],0,0,0,0,1],y=[f,e.latLngToECEF(c.lat,c.lng),e.latLngToECEF(u.lat,c.lng),e.latLngToECEF(u.lat,u.lng),e.latLngToECEF(c.lat,u.lng),e.latLngToECEF(h,c.lng),e.latLngToECEF(h,u.lng),e.latLngToECEF(c.lat,d),e.latLngToECEF(u.lat,d)];let _=e.Aabb.fromPoints(y.map((t=>[e.dot(m,t),e.dot(g,t),e.dot(p,t)])));const x=e.transformMat4([],_.center,v);0===e.squaredLength(x)&&e.set(x,0,0,1),e.normalize(x,x),e.scale$2(x,x,e.GLOBE_RADIUS),s.center=e.ecefToLatLng(x);const w=s.getWorldToCameraMatrix(),b=e.invert(new Float64Array(16),w);_=e.Aabb.applyTransform(_,e.multiply([],w,v)),e.transformMat4(x,x,w);const E=.5*(_.max[2]-_.min[2]),k=this._minimumAABBFrustumDistance(s,_),T=e.scale$2([],[0,0,1],E),M=e.add(T,x,T),S=k+(0===s.pitch?0:e.distance(x,M)),C=s.globeCenterInViewSpace,A=e.sub([],x,[C[0],C[1],C[2]]);e.normalize(A,A),e.scale$2(A,A,S);const I=e.add([],x,A);e.transformMat4(I,I,b);const R=e.earthRadius/e.GLOBE_RADIUS,L=e.length(I),z=e.mercatorZfromAltitude(Math.max(L*R-e.earthRadius,Number.EPSILON),0),P=Math.min(s.zoomFromMercatorZAdjusted(z),l.maxZoom);return P>.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"mercator"}),s.zoom=P,this._cameraForBounds(s,n,r,i,o,a)):{center:s.center,zoom:P,bearing:i,pitch:o}}queryTerrainElevation(t,n){const r=this.transform.elevation;return r?(n=e.extend({},{exaggerated:!0},n),r.getAtPoint(e.MercatorCoordinate.fromLngLat(t),null,n.exaggerated)):null}_cameraForBounds(t,n,r,i,o,a){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,n,r,i,o,a);const s=t.clone(),l=this._extendCameraOptions(a),c=s.padding;s.bearing=i,s.pitch=o;const u=e.LngLat.convert(n),h=e.LngLat.convert(r),d=new e.LngLat(u.lng,h.lat),f=new e.LngLat(h.lng,u.lat),p=s.project(u),m=s.project(h),g=this.queryTerrainElevation(u),v=this.queryTerrainElevation(h),y=this.queryTerrainElevation(d),_=this.queryTerrainElevation(f),x=[[p.x,p.y,Math.min(g||0,v||0,y||0,_||0)],[m.x,m.y,Math.max(g||0,v||0,y||0,_||0)]];let w=e.Aabb.fromPoints(x);const b=s.getWorldToCameraMatrix(),E=e.invert(new Float64Array(16),b);w=e.Aabb.applyTransform(w,b);const k=e.sub([],w.max,w.min),T=c.left||0,M=c.right||0,S=c.bottom||0,C=c.top||0,{left:A,right:I,top:R,bottom:L}=l.padding,z=.5*(T+M),P=.5*(C+S),O=Math.min(s.scaleZoom(s.scale*Math.min((s.width-(T+M+A+I))/k[0],(s.height-(S+C+L+R))/k[1])),l.maxZoom),D=s.scale/s.zoomScale(O);w=new e.Aabb([w.min[0]-(A+z)*D,w.min[1]-(L+P)*D,w.min[2]],[w.max[0]+(I+z)*D,w.max[1]+(R+P)*D,w.max[2]]);const B=.5*k[2],F=this._minimumAABBFrustumDistance(s,w),j=[0,0,1,0];e.transformMat4$1(j,j,b),e.normalize$2(j,j);const N=e.scale$2([],j,F+B),V=e.add([],w.center,N),U=("number"==typeof l.offset.x&&"number"==typeof l.offset.y?new e.Point(l.offset.x,l.offset.y):e.Point.convert(l.offset)).rotate(-e.degToRad(i));w.center[0]-=U.x*D,w.center[1]+=U.y*D,e.transformMat4(w.center,w.center,E),e.transformMat4(V,V,E);const H=[w.center[0],w.center[1],V[2]*s.pixelsPerMeter];e.scale$2(H,H,1/s.worldSize);const W=e.lngFromMercatorX(H[0]),$=e.latFromMercatorY(H[1]),G=Math.min(s._zoomFromMercatorZ(H[2]),l.maxZoom),q=new e.LngLat(W,$);return s.mercatorFromTransition&&G<.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"globe"}),s.zoom=G,this._cameraForBounds(s,n,r,i,o,a)):{center:q,zoom:G,bearing:i,pitch:o}}fitBounds(e,t,n){const r=this.cameraForBounds(e,t);return this._fitInternal(r,t,n)}fitScreenCoordinates(t,n,r,i,o){const a=e.Point.convert(t),s=e.Point.convert(n),l=new e.Point(Math.min(a.x,s.x),Math.min(a.y,s.y)),c=new e.Point(Math.max(a.x,s.x),Math.max(a.y,s.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(a,s))return this;const u=this.transform.pointLocation3D(l),h=this.transform.pointLocation3D(c),d=this.transform.pointLocation3D(new e.Point(l.x,c.y)),f=this.transform.pointLocation3D(new e.Point(c.x,l.y)),p=[Math.min(u.lng,h.lng,d.lng,f.lng),Math.min(u.lat,h.lat,d.lat,f.lat)],m=[Math.max(u.lng,h.lng,d.lng,f.lng),Math.max(u.lat,h.lat,d.lat,f.lat)],g=i&&i.pitch?i.pitch:this.getPitch(),v=this._cameraForBounds(this.transform,p,m,r,g,i);return this._fitInternal(v,i,o)}_fitInternal(t,n,r){return t?(delete(n=e.extend(t,n)).padding,n.linear?this.easeTo(n,r):this.flyTo(n,r)):this}jumpTo(t,n){this.stop();const r=t.preloadOnly?this.transform.clone():this.transform;let i=!1,o=!1,a=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(i=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=e.LngLat.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(o=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),null==t.padding||r.isPaddingEqual(t.padding)||(r.padding=t.padding),t.preloadOnly?(this._preloadTiles(r),this):(this.fire(new e.Event("movestart",n)).fire(new e.Event("move",n)),i&&this.fire(new e.Event("zoomstart",n)).fire(new e.Event("zoom",n)).fire(new e.Event("zoomend",n)),o&&this.fire(new e.Event("rotatestart",n)).fire(new e.Event("rotate",n)).fire(new e.Event("rotateend",n)),a&&this.fire(new e.Event("pitchstart",n)).fire(new e.Event("pitch",n)).fire(new e.Event("pitchend",n)),this.fire(new e.Event("moveend",n)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.warnOnce(qi),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,n){const r=this.transform;if(!r.projection.supportsFreeCamera)return e.warnOnce(qi),this;this.stop();const i=r.zoom,o=r.pitch,a=r.bearing;r.setFreeCameraOptions(t);const s=i!==r.zoom,l=o!==r.pitch,c=a!==r.bearing;return this.fire(new e.Event("movestart",n)).fire(new e.Event("move",n)),s&&this.fire(new e.Event("zoomstart",n)).fire(new e.Event("zoom",n)).fire(new e.Event("zoomend",n)),c&&this.fire(new e.Event("rotatestart",n)).fire(new e.Event("rotate",n)).fire(new e.Event("rotateend",n)),l&&this.fire(new e.Event("pitchstart",n)).fire(new e.Event("pitch",n)).fire(new e.Event("pitchend",n)),this.fire(new e.Event("moveend",n)),this}easeTo(t,n){this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const r=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?+t.zoom:i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h="padding"in t?t.padding:r.padding,d=e.Point.convert(t.offset);let f,p,m;if("globe"===r.projection.name){const n=e.MercatorCoordinate.fromLngLat(r.center),i=d.rotate(-r.angle);n.x+=i.x/r.worldSize,n.y+=i.y/r.worldSize;const o=n.toLngLat(),a=e.LngLat.convert(t.center||o);this._normalizeCenter(a),f=r.centerPoint.add(i),p=new e.Point(n.x,n.y).mult(r.worldSize),m=new e.Point(e.mercatorXfromLng(a.lng),e.mercatorYfromLat(a.lat)).mult(r.worldSize).sub(p)}else{f=r.centerPoint.add(d);const n=r.pointLocation(f),i=e.LngLat.convert(t.center||n);this._normalizeCenter(i),p=r.project(n),m=r.project(i).sub(p)}const g=r.zoomScale(l-i);let v,y;t.around&&(v=e.LngLat.convert(t.around),y=r.locationPoint(v));const _=this._zooming||l!==i,x=this._rotating||o!==c,w=this._pitching||u!==a,b=!r.isPaddingEqual(h),E=r=>E=>{if(_&&(r.zoom=e.number(i,l,E)),x&&(r.bearing=e.number(o,c,E)),w&&(r.pitch=e.number(a,u,E)),b&&(r.interpolatePadding(s,h,E),f=r.centerPoint.add(d)),v)r.setLocationAtPoint(v,y);else{const e=r.zoomScale(r.zoom-i),t=l>i?Math.min(2,g):Math.max(.5,g),n=Math.pow(t,1-E),o=r.unproject(p.add(m.mult(E*n)).mult(e));r.setLocationAtPoint(r.renderWorldCopies?o.wrap():o,f)}return t.preloadOnly||this._fireMoveEvents(n),r};if(t.preloadOnly){const e=this._emulate(E,t.duration,r);return this._preloadTiles(e),this}const k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=_,this._rotating=x,this._pitching=w,this._padding=b,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,k),this._ease(E(r),(e=>{r.recenterOnTerrain(),this._afterEase(n,e)}),t),this}_prepareEase(t,n,r={}){this._moving=!0,this.transform.cameraElevationReference="sea",n||r.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.Event("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const r=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),o&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}flyTo(t,n){if(this._prefersReducedMotion(t)){const r=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,n)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);const r=this.transform,i=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?e.clamp(+t.zoom,r.minZoom,r.maxZoom):i,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h="padding"in t?t.padding:r.padding,d=r.zoomScale(l-i),f=e.Point.convert(t.offset);let p=r.centerPoint.add(f);const m=r.pointLocation(p),g=e.LngLat.convert(t.center||m);this._normalizeCenter(g);const v=r.project(m),y=r.project(g).sub(v);let _=t.curve;const x=Math.max(r.width,r.height),w=x/d,b=y.mag();if("minZoom"in t){const n=e.clamp(Math.min(t.minZoom,i,l),r.minZoom,r.maxZoom),o=x/r.zoomScale(n-i);_=Math.sqrt(o/b*2)}const E=_*_;function k(e){const t=(w*w-x*x+(e?-1:1)*E*E*b*b)/(2*(e?w:x)*E*b);return Math.log(Math.sqrt(t*t+1)-t)}function T(e){return(Math.exp(e)-Math.exp(-e))/2}function M(e){return(Math.exp(e)+Math.exp(-e))/2}const S=k(0);let C=function(e){return M(S)/M(S+_*e)},A=function(e){return x*((M(S)*(T(t=S+_*e)/M(t))-T(S))/E)/b;var t},I=(k(1)-S)/_;if(Math.abs(b)<1e-6||!isFinite(I)){if(Math.abs(x-w)<1e-6)return this.easeTo(t,n);const e=w<x?-1:1;I=Math.abs(Math.log(w/x))/_,A=function(){return 0},C=function(t){return Math.exp(e*_*t)}}t.duration="duration"in t?+t.duration:1e3*I/("screenSpeed"in t?+t.screenSpeed/_:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const R=o!==c,L=u!==a,z=!r.isPaddingEqual(h),P=r=>d=>{const m=d*I,_=1/C(m);r.zoom=1===d?l:i+r.scaleZoom(_),R&&(r.bearing=e.number(o,c,d)),L&&(r.pitch=e.number(a,u,d)),z&&(r.interpolatePadding(s,h,d),p=r.centerPoint.add(f));const x=1===d?g:r.unproject(v.add(y.mult(A(m))).mult(_));return r.setLocationAtPoint(r.renderWorldCopies?x.wrap():x,p),r._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(n),r};if(t.preloadOnly){const e=this._emulate(P,t.duration,r);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=R,this._pitching=L,this._padding=z,this._prepareEase(n,!1),this._ease(P(r),(()=>this._afterEase(n)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,n,r){!1===r.animate||0===r.duration?(t(1),n()):(this._easeStart=e.exported.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.exported.now()-this._easeStart)/this._easeOptions.duration,1),n=this._onEaseFrame;n&&n(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,n){t=e.wrap(t,-180,180);const r=Math.abs(t-n);return Math.abs(t-360-n)<r&&(t-=360),Math.abs(t+360-n)<r&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(!t.renderWorldCopies||t.maxBounds)return;const n=e.lng-t.center.lng;e.lng+=n>180?-360:n<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.exported.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,n){const r=Math.ceil(15*t/1e3),i=[],o=e(n.clone());for(let e=0;e<=r;e++){const t=o(e/r);i.push(t.clone())}return i}}class Xi{constructor(t={}){this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact;return this._map=e,this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=o("button","mapboxgl-ctrl-attrib-button",this._container),o("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(e,t){const n=this._map._getUIString(`AttributionControl.${t}`);e.setAttribute("aria-label",n),e.removeAttribute("title"),e.firstElementChild&&e.firstElementChild.setAttribute("title",n)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){const r=n.reduce(((e,t,r)=>(t.value&&(e+=`${t.key}=${t.value}${r<n.length-1?"&":""}`),e)),"?");t.href=`${e.config.FEEDBACK_URL}/${r}#${Jr(this._map,!0)}`,t.rel="noopener nofollow",this._setElementTitle(t,"MapFeedback")}}_updateData(e){!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style._sourceCaches;for(const n in t){const r=t[n];if(r.used){const t=r.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,n)=>{for(let r=n+1;r<e.length;r++)if(e[r].indexOf(t)>=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const n=e.join(" | ");n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Yi{constructor(){e.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=o("div","mapboxgl-ctrl");const t=o("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const n=e[t].getSource();if(n.hasOwnProperty("mapbox_logo")&&!n.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Ki{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue;for(const t of n)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ji(t,n,r){if(t=new e.LngLat(t.lng,t.lat),n){const i=new e.LngLat(t.lng-360,t.lat),o=new e.LngLat(t.lng+360,t.lat),a=360*Math.ceil(Math.abs(t.lng-r.center.lng)/360),s=r.locationPoint(t).distSqr(n),l=n.x<0||n.y<0||n.x>r.width||n.y>r.height;r.locationPoint(i).distSqr(n)<s&&(l||Math.abs(i.lng-r.center.lng)<a)?t=i:r.locationPoint(o).distSqr(n)<s&&(l||Math.abs(o.lng-r.center.lng)<a)&&(t=o)}for(;Math.abs(t.lng-r.center.lng)>180;){const e=r.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}const Qi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class eo extends e.Evented{constructor(t,n){if(super(),(t instanceof e.window.HTMLElement||n)&&(t=e.extend({element:t},n)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)this._element=t.element,this._offset=e.Point.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o("div");const n=41,r=27,i=a("svg",{display:"block",height:n*this._scale+"px",width:r*this._scale+"px",viewBox:`0 0 ${r} ${n}`},this._element),s=a("radialGradient",{id:"shadowGradient"},a("defs",{},i));a("stop",{offset:"10%","stop-opacity":.4},s),a("stop",{offset:"100%","stop-opacity":.05},s),a("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},i),a("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},i),a("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},i),a("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},i),this._offset=e.Point.convert(t&&t.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()}));const r=this._element.classList;for(const e in Qi)r.remove(`mapboxgl-marker-anchor-${e}`);r.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,n=13.5,r=Math.sqrt(Math.pow(n,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[r,-1*(t-n+r)],"bottom-right":[-r,-1*(t-n+r)],left:[n,-1*(t-n)],right:[-n,-1*(t-n)]}:this._offset}this._popup=e,e._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,n=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==n&&13!==n||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const n=e.unproject(t),r=e.getFreeCameraOptions();if(!r.position)return!1;const i=r.position.toLngLat();return i.distanceTo(n)<.9*i.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const n=this._pos;if(!n||n.x<0||n.x>t.transform.width||n.y<0||n.y>t.transform.height)return void this._clearFadeTimer();const r=t.unproject(n);let i;t._showingGlobe()&&e.isLngLatBehindGlobe(t.transform,this._lngLat)?i=0:(i=1-t._queryFogOpacity(r),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(i*=this._occludedOpacity)),this._element.style.opacity=`${i}`,this._element.style.pointerEvents=i>0?"auto":"none",this._popup&&this._popup._setOpacity(i),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n            translate(${e.x}px,${e.y}px)\n            ${Qi[this._anchor]}\n            ${this._calculateXYTransform()} ${this._calculateZTransform()}\n            translate(${t.x}px,${t.y}px)\n        `}_calculateXYTransform(){const t=this._pos,n=this._map,r=this.getPitchAlignment();if(!n||!t||"map"!==r)return"";if(!n._showingGlobe()){const e=n.getPitch();return e?`rotateX(${e}deg)`:""}const i=e.radToDeg(e.globeTiltAtLngLat(n.transform,this._lngLat)),o=t.sub(e.globeCenterToScreenPoint(n.transform)),a=Math.abs(o.x)+Math.abs(o.y);if(0===a)return"";const s=i/a;return`rotateX(${-o.y*s}deg) rotateY(${o.x*s}deg)`}_calculateZTransform(){const t=this._pos,n=this._map;if(!n||!t)return"";let r=0;const i=this.getRotationAlignment();if("map"===i)if(n._showingGlobe()){const t=n.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),i=n.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(t);r=e.radToDeg(Math.atan2(i.y,i.x))-90}else r=-n.getBearing();else if("horizon"===i){const i=e.smoothstep(4,6,n.getZoom()),o=e.globeCenterToScreenPoint(n.transform);o.y+=i*n.transform.height;const a=t.sub(o),s=e.radToDeg(Math.atan2(a.y,a.x));r=(s>90?s-270:s+90)*(1-i)}return r+=this._rotation,r?`rotateZ(${r}deg)`:""}_update(t){e.window.cancelAnimationFrame(this._updateFrameId);const n=this._map;n&&(n.transform.renderWorldCopies&&(this._lngLat=Ji(this._lngLat,this._pos,n.transform)),this._pos=n.project(this._lngLat),!0===t?this._updateFrameId=e.window.requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),n._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(n._showingGlobe()||n.getTerrain()||n.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(t){return this._offset=e.Point.convert(t),this._update(),this}_onMove(t){const n=this._map;if(!n)return;const r=this._pointerdownPos,i=this._positionDelta;if(r&&i){if(!this._isDragging){const e=this._clickTolerance||n._clickTolerance;if(t.point.dist(r)<e)return;this._isDragging=!0}this._pos=t.point.sub(i),this._lngLat=n.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"}_addDragHandler(e){const t=this._map,n=this._pos;t&&n&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(n),this._pointerdownPos=e.point,this._state="pending",t.on("mousemove",this._onMove),t.on("touchmove",this._onMove),t.once("mouseup",this._onUp),t.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;const t=this._map;return t&&(e?(t.on("mousedown",this._addDragHandler),t.on("touchstart",this._addDragHandler)):(t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||"auto",this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const to={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},no=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ro(t=new e.Point(0,0),n="bottom"){if("number"==typeof t){const r=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(n){case"top":return new e.Point(0,t);case"top-left":return new e.Point(r,r);case"top-right":return new e.Point(-r,r);case"bottom":return new e.Point(0,-t);case"bottom-left":return new e.Point(r,-r);case"bottom-right":return new e.Point(-r,-r);case"left":return new e.Point(t,0);case"right":return new e.Point(-t,0)}return new e.Point(0,0)}return t instanceof e.Point||Array.isArray(t)?e.Point.convert(t):e.Point.convert(t[n]||[0,0])}class io{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const n=e.easeCubicInOut((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-n)+this._end*n}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,n){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+n}}const oo={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},ao={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0},so={showCompass:!0,showZoom:!0,visualizePitch:!1};class lo{constructor(t,n,r=!1){this._clickTolerance=10,this.element=n,this.mouseRotate=new xi({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,r&&(this.mousePitch=new wi({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchmove",this.touchmove),n.addEventListener("touchend",this.touchend),n.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),u()}move(e,t){const n=this.map,r=this.mouseRotate.mousemoveWindow(e,t),i=r&&r.bearingDelta;if(i&&n.setBearing(n.getBearing()+i),this.mousePitch){const r=this.mousePitch.mousemoveWindow(e,t),i=r&&r.pitchDelta;i&&n.setPitch(n.getPitch()+i)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart,{passive:!1}),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){h(),e.window.removeEventListener("mousemove",this.mousemove),e.window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),p(this.element,t)),e.window.addEventListener("mousemove",this.mousemove),e.window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,p(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=m(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=m(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const co={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},uo={maxWidth:100,unit:"metric"},ho={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},fo={version:e.version,supported:n,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:class extends Zi{constructor(t){if(e.LivePerformanceUtils.mark(e.PerformanceMarkers.create),null!=(t=e.extend({},ao,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.isSafariWithAntialiasingBug(e.window)&&(t.antialias=!1,e.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Xr(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),t),this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._useWebGL2=t.useWebGL2,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._optimizeForTerrain=t.optimizeForTerrain,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Ki,this._domRenderTaskQueue=new Ki,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.uniqueId(),this._locale=e.extend({},oo,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new io(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,"string"==typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error(`Container '${t.container}' not found.`)}else{if(!(t.container instanceof e.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),void 0!==e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1),e.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),e.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Gi(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),this._hash=t.hash&&new Kr("string"==typeof t.hash&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),t.attributionControl&&this.addControl(new Xi({customAttribution:t.customAttribution})),this._logoControl=new Yi,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.Event(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.Event(`${t.dataType}dataloading`,t))}))}_getMapId(){return this._mapId}addControl(t,n){if(void 0===n&&(n=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const i=this._controlPositions[n];return-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const n=!this._moving;return n&&this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t)),this.fire(new e.Event("resize",t)),n&&this.fire(new e.Event("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new e.Event("zoomstart")).fire(new e.Event("zoom")).fire(new e.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.Event("zoomstart")).fire(new e.Event("zoom")).fire(new e.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t?this.setPitch(t):this.fire(new e.Event("pitchstart")).fire(new e.Event("pitch")).fire(new e.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?85:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.Event("pitchstart")).fire(new e.Event("pitch")).fire(new e.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(t){return"auto"===t?e.window.navigator.language:Array.isArray(t)?0===t.length?void 0:t.map((t=>"auto"===t?e.window.navigator.language:t)):t}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style._reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,n=t.projection.name;let r;"globe"===n&&t.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX?(t.setMercatorFromTransition(),r=!0):"mercator"===n&&t.zoom<e.GLOBE_ZOOM_THRESHOLD_MAX&&(t.setProjection({name:"globe"}),r=!0),r&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let n;if(n="globe"===t.name&&this.transform.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),n){this.painter.clearBackgroundTiles();for(const e in this.style._sourceCaches)this.style._sourceCaches[e].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(t){return this.transform.locationPoint3D(e.LngLat.convert(t))}unproject(t){return this.transform.pointLocation3D(e.Point.convert(t))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,n){if("mouseenter"===e||"mouseover"===e){let r=!1;const i=i=>{const o=t.filter((e=>this.getLayer(e))),a=o.length?this.queryRenderedFeatures(i.point,{layers:o}):[];a.length?r||(r=!0,n.call(this,new si(e,this,i.originalEvent,{features:a}))):r=!1},o=()=>{r=!1};return{layers:new Set(t),listener:n,delegates:{mousemove:i,mouseout:o}}}if("mouseleave"===e||"mouseout"===e){let r=!1;const i=i=>{const o=t.filter((e=>this.getLayer(e)));(o.length?this.queryRenderedFeatures(i.point,{layers:o}):[]).length?r=!0:r&&(r=!1,n.call(this,new si(e,this,i.originalEvent)))},o=t=>{r&&(r=!1,n.call(this,new si(e,this,t.originalEvent)))};return{layers:new Set(t),listener:n,delegates:{mousemove:i,mouseout:o}}}{const r=e=>{const r=t.filter((e=>this.getLayer(e))),i=r.length?this.queryRenderedFeatures(e.point,{layers:r}):[];i.length&&(e.features=i,n.call(this,e),delete e.features)};return{layers:new Set(t),listener:n,delegates:{[e]:r}}}}on(e,t,n){if(void 0===n)return super.on(e,t);Array.isArray(t)||(t=[t]);const r=this._createDelegatedListener(e,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(r);for(const e in r.delegates)this.on(e,r.delegates[e]);return this}once(e,t,n){if(void 0===n)return super.once(e,t);Array.isArray(t)||(t=[t]);const r=this._createDelegatedListener(e,t,n);for(const e in r.delegates)this.once(e,r.delegates[e]);return this}off(e,t,n){if(void 0===n)return super.off(e,t);t=new Set(Array.isArray(t)?t:[t]);const r=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0},i=this._delegatedListeners?this._delegatedListeners[e]:void 0;return i&&(e=>{for(let i=0;i<e.length;i++){const o=e[i];if(o.listener===n&&r(o.layers,t)){for(const e in o.delegates)this.off(e,o.delegates[e]);return e.splice(i,1),this}}})(i),this}queryRenderedFeatures(t,n){return this.style?(void 0!==n||void 0===t||t instanceof e.Point||Array.isArray(t)||(n=t,t=void 0),this.style.queryRenderedFeatures(t=t||[[0,0],[this.transform.width,this.transform.height]],n=n||{},this.transform)):[]}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}isPointOnSurface(t){const{name:n}=this.transform.projection;return"globe"!==n&&"mercator"!==n&&e.warnOnce(`${n} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(e.Point.convert(t))}setStyle(t,n){return!1!==(n=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&n.localFontFamily===this._localFontFamily&&this.style&&t?(this._diffStyle(t,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._localFontFamily=n.localFontFamily,this._updateStyle(t,n))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),e&&(this.style=new Kt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Kt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,n){if("string"==typeof t){const r=this._requestManager.normalizeStyleURL(t),i=this._requestManager.transformRequest(r,e.ResourceType.Style);e.getJSON(i,((t,r)=>{t?this.fire(new e.ErrorEvent(t)):r&&this._updateDiff(r,n)}))}else"object"==typeof t&&this._updateDiff(t,n)}_updateDiff(t,n){try{this.style.setState(t)&&this._update(!0)}catch(r){e.warnOnce(`Unable to perform style diff: ${r.message||r.error||r}.  Rebuilding the style from scratch.`),this._updateStyle(t,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.warnOnce("There is no style added to the map."),!1)}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){return!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){const e=this.style&&this.style._sourceCaches;for(const t in e){const n=e[t]._tiles;for(const e in n){const t=n[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}addSourceType(e,t,n){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,n)}removeSource(e){return this.style.removeSource(e),this._updateTerrain(),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(t,n,{pixelRatio:r=1,sdf:i=!1,stretchX:o,stretchY:a,content:s}={}){if(this._lazyInitEmptyStyle(),n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap){const{width:l,height:c,data:u}=e.exported.getImageData(n);this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},u),pixelRatio:r,stretchX:o,stretchY:a,content:s,sdf:i,version:0})}else if(void 0===n.width||void 0===n.height)this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:l,height:c}=n,u=n;this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},new Uint8Array(u.data)),pixelRatio:r,stretchX:o,stretchY:a,content:s,sdf:i,version:0,userImage:u}),u.onAdd&&u.onAdd(this,t)}}updateImage(t,n){const r=this.style.getImage(t);if(!r)return void this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap?e.exported.getImageData(n):n,{width:o,height:a}=i;void 0!==o&&void 0!==a?o===r.data.width&&a===r.data.height?(r.data.replace(i.data,!(n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap)),this.style.updateImage(t,r)):this.fire(new e.ErrorEvent(new Error(`The width and height of the updated image (${o}, ${a})\n                must be that same as the previous version of the image\n                (${r.data.width}, ${r.data.height})`))):this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(t,n){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),((t,r)=>{n(t,r instanceof e.window.HTMLImageElement?e.exported.getImageData(r):r)}))}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t,n={}){return this.style.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n,r={}){return this.style.setPaintProperty(e,t,n,r),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n,r={}){return this.style.setLayoutProperty(e,t,n,r),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.LngLat.convert(t),this.transform):0}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}_updateContainerDimensions(){if(!this._container)return;const t=this._container.getBoundingClientRect().width||400,n=this._container.getBoundingClientRect().height||300;let r,i,o,a=this._container;for(;a&&(!i||!o);){const t=e.window.getComputedStyle(a).transform;t&&"none"!==t&&(r=t.match(/matrix.*\((.+)\)/)[1].split(", "),r[0]&&"0"!==r[0]&&"1"!==r[0]&&(i=r[0]),r[3]&&"0"!==r[3]&&"1"!==r[3]&&(o=r[3])),a=a.parentElement}this._containerWidth=i?Math.abs(t/i):t,this._containerHeight=o?Math.abs(n/o):n}_detectMissingCSS(){"rgb(250, 128, 114)"!==e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=o("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=o("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=o("canvas","mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const n=this._controlContainer=o("div","mapboxgl-control-container",e),r=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{r[e]=o("div",`mapboxgl-ctrl-${e}`,n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,n){const r=e.exported.devicePixelRatio||1;this._canvas.width=r*Math.ceil(t),this._canvas.height=r*Math.ceil(n),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${n}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const t=e.extend({},n.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._useWebGL2&&this._canvas.getContext("webgl2",t),i=r||this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);i?(this._useWebGL2&&!r&&e.warnOnce("Failed to create WebGL 2 context. Using WebGL 1."),e.storeAuthState(i,!0),this.painter=new Dr(i,this.transform,!!r),this.on("data",(e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)})),e.exported$1.testSupport(i)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let n;const r=this.painter.context.extTimerQuery,i=e.exported.now();if(this.listens("gpu-timing-frame")&&(n=r.createQueryEXT(),r.beginQueryEXT(r.TIME_ELAPSED_EXT,n)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],e.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],e.window.performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const o=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,n=this.transform.pitch,r=e.exported.now(),i=new e.EvaluationParameters(t,{now:r,fadeDuration:o,pitch:n,transition:this.style.getTransition()});this.style.update(i)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let a=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),a=this._updateAverageElevation(i),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):a=this._updateAverageElevation(i),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),n){const t=e.exported.now()-i;r.endQueryEXT(r.TIME_ELAPSED_EXT,n),setTimeout((()=>{const o=r.getQueryObjectEXT(n,r.QUERY_RESULT_EXT)/1e6;r.deleteQueryEXT(n),this.fire(new e.Event("gpu-timing-frame",{cpuTime:t,gpuTime:o})),e.window.performance.mark("frame-gpu",{startTime:i,detail:{gpuTime:o}})}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const n=this.painter.queryGpuTimers(t);this.fire(new e.Event("gpu-timing-layer",{layerTimes:n}))}),50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const n=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.Event("gpu-timing-deferred-render",{gpuTime:n}))}),50)}const s=this._sourcesDirty||this._styleDirty||this._placementDirty||a;if(s||this._repaint)this.triggerRepaint();else{const t=!this.isMoving()&&this.loaded();if(t&&(a=this._updateAverageElevation(i,!0)),a)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.Event("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,e.LivePerformanceUtils.mark(e.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&e.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const n=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&n(0);if((t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let r=this.transform.sampleAverageElevation(),i=!1;this.transform.elevation&&(i=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(r)?r=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-r);if(o>1){if(this._isInitialLoad||i)return this._averageElevation.jumpTo(r),n(r);this._averageElevation.easeTo(r,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(r),n(r)}return!!this._averageElevation.isEasing(e)&&n(this._averageElevation.getValue(e))}_authenticate(){e.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>{if(t&&(t.message===e.AUTH_ERR_MSG||401===t.status)){const t=this.painter.context.gl;e.storeAuthState(t,!1),this._logoControl instanceof Yi&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),e.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const n=this.painter.context.gl,r=n.createFramebuffer();function i(e){n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);const t=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);return n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,t),t}return n.bindFramebuffer(n.FRAMEBUFFER,r),this._canvasPixelComparison(i(e),t.canvasCopies.map(i),t.timeStamps)}_canvasPixelComparison(e,t,n){let r=n[1]-n[0];const i=e.length/4;for(let o=0;o<t.length;o++){const a=t[o];let s=0;for(let t=0;t<a.length;t+=4)a[t]===e[t]&&a[t+1]===e[t+1]&&a[t+2]===e[t+2]&&a[t+3]===e[t+3]&&(s+=1);r+=(n[o+2]-n[o+1])*(1-s/i)}return r}remove(){this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),void 0!==e.window&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("orientationchange",this._onWindowResize,!1),e.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1),e.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),e.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new e.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=e.exported.frame((e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)})))}_preloadTiles(t){const n=this.style?Object.values(this.style._sourceCaches):[];return e.asyncAll(n,((e,n)=>e._preloadTiles(t,n)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===e.window.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,e&&this._update())}_setCacheLimits(t,n){e.setCacheLimits(t,n)}get version(){return e.version}},NavigationControl:class{constructor(t){this.options=e.extend({},so,t),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(e=>{this._map&&this._map.zoomIn({},{originalEvent:e})})),o("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(e=>{this._map&&this._map.zoomOut({},{originalEvent:e})})),o("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))})),this._compassIcon=o("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;const t=e.getZoom(),n=t===e.getMaxZoom(),r=t===e.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new lo(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const n=o("button",e,this._container);return n.type="button",n.addEventListener("click",t),n}_setButtonTitle(e,t){if(!this._map)return;const n=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",n),e.firstElementChild&&e.firstElementChild.setAttribute("title",n)}},GeolocateControl:class extends e.Evented{constructor(t){super(),this.options=e.extend({geolocation:e.window.navigator.geolocation},co,t),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Yr(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(t){const n=(e=!!this.options.geolocation)=>{this._supportsGeolocation=e,t(e)};void 0!==this._supportsGeolocation?t(this._supportsGeolocation):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((e=>n("denied"!==e.state))).catch((()=>n())):n()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),n=e.coords;return!!t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}}_updateCamera(t){const n=new e.LngLat(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,i=this._map.getBearing(),o=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),o,{geolocateSource:!0})}_updateMarker(t){if(t){const n=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,n=e.mercatorZfromAltitude(1,t._center.lat)*t.worldSize,r=Math.ceil(2*this._accuracy*n);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=o("button","mapboxgl-ctrl-geolocate",this._container),o("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o("div","mapboxgl-user-location"),this._dotElement.appendChild(o("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(o("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new eo({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=o("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new eo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.Event("trackuserlocationend")))}))}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const t=()=>{e.window.addEventListener("ondeviceorientationabsolute"in e.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==e.window.DeviceMotionEvent&&"function"==typeof e.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((e=>{"granted"===e&&t()})).catch(console.error):t()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),e.window.removeEventListener("deviceorientation",this._onDeviceOrientation),e.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Xi,ScaleControl:class{constructor(t){this.options=e.extend({},uo,t),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return!1}}(),e.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,n=t._containerHeight/2,r=t._containerWidth/2-e/2,i=t.unproject([r,n]),o=t.unproject([r+e,n]),a=i.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*a;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,a/1852,"nautical-mile"):a>=1e3?this._setScale(e,a/1e3,"kilometer"):this._setScale(e,a,"meter")}_setScale(e,t,n){this._map._requestDomTask((()=>{const r=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(n),t*n}(t),i=r/t;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==n?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:n}).format(r):`${r}&nbsp;${ho[n]}`,this._container.style.width=e*i+"px"}))}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in e.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!e.window.document.fullscreenEnabled&&!e.window.document.webkitFullscreenEnabled)}_setupUI(){const t=this._fullscreenButton=o("button","mapboxgl-ctrl-fullscreen",this._controlContainer);o("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(e.window.document.fullscreenElement||e.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends e.Evented{constructor(t){super(),this.options=e.extend(Object.create(to),t),e.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update();const n=this._map;return n&&(n.on("move",this._update),n.off("mousemove",this._onMouseEvent),n._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(e.window.document.createTextNode(t))}setHTML(t){const n=e.window.document.createDocumentFragment(),r=e.window.document.createElement("body");let i;for(r.innerHTML=t;i=r.firstChild,i;)n.appendChild(i);return this.setDOMContent(n)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=o("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=o("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.setAttribute("aria-hidden","true"),e.innerHTML="&#215;",e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,n=this._container,r=this._pos;if(!t||!n||!r)return"bottom";const i=n.offsetWidth,o=n.offsetHeight,a=r.x<i/2,s=r.x>t.transform.width-i/2;if(r.y+e<o)return a?"top-left":s?"top-right":"top";if(r.y>t.transform.height-o){if(a)return"bottom-left";if(s)return"bottom-right"}return a?"left":s?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const n=this._map,r=this._content;if(!n||!this._lngLat&&!this._trackPointer||!r)return;let i=this._container;if(i||(i=this._container=o("div","mapboxgl-popup",n.getContainer()),this._tip=o("div","mapboxgl-popup-tip",i),i.appendChild(r)),this.options.maxWidth&&i.style.maxWidth!==this.options.maxWidth&&(i.style.maxWidth=this.options.maxWidth),n.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ji(this._lngLat,this._pos,n.transform)),!this._trackPointer||t){const e=this._pos=this._trackPointer&&t?t:n.project(this._lngLat),r=ro(this.options.offset),i=this._anchor=this._getAnchor(r.y),o=ro(this.options.offset,i),a=e.add(o).round();n._requestDomTask((()=>{this._container&&i&&(this._container.style.transform=`${Qi[i]} translate(${a.x}px,${a.y}px)`)}))}if(!this._marker&&n._showingGlobe()){const t=e.isLngLatBehindGlobe(n.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(no);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:eo,Style:Kt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,FreeCameraOptions:Vr,Evented:e.Evented,config:e.config,prewarm:function(){je().acquire(De)},clearPrewarmedResources:function(){const e=Fe;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(De),Fe=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return Be.workerCount},set workerCount(e){Be.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.clearTileCache(t)},workerUrl:"",workerClass:null,setNow:e.exported.setNow,restoreNow:e.exported.restoreNow};return fo})),n}()}(yx);var _x=i({__proto__:null,default:Ee(yx.exports)},[yx.exports])}(React,ReactDOM);
