// source --> https://3d360properties.com/wp-includes/js/jquery/jquery.min.js?ver=3.7.1 
/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=ce.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<ce(i,this).index(l):ce.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Yt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&ie.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce});
jQuery.noConflict();
// source --> https://3d360properties.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1 
/*! jQuery Migrate v3.4.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return!(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var Q,A,R=!1,C=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return R=!0,e=r.apply(this,arguments),R=!1,e})}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in R||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(A={animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(A,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=A):A=s.cssNumber,Q=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=x(e),n=r,C.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||A[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))},"css-number");var S,P,k,H,E=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&E.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return E.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&E.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):E.apply(this,arguments)},"data-camelCase"),s.fx&&(k=s.Tween.prototype.run,H=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=H),k.apply(this,arguments)},"easing-one-arg"),S=s.fx.interval,P="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",P),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){u("fx-interval",P),S=e}}));var M=s.fn.load,q=s.event.add,O=s.event.fix;s.event.props=[],s.event.fixHooks={},r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=O.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),q.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?M.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated")}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var F=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(F,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s});
// source --> https://3d360properties.com/wp-content/plugins/houzez-studio/public/js/houzez-studio-public.js?ver=1.2.1 
(function( $ ) {
	'use strict';

	/**
	 * All of the code for your public-facing JavaScript source
	 * should reside in this file.
	 *
	 * Note: It has been assumed you will write jQuery code here, so the
	 * $ function reference has been prepared for usage within the scope
	 * of this function.
	 *
	 * This enables you to define handlers, for when the DOM is ready:
	 *
	 * $(function() {
	 *
	 * });
	 *
	 * When the window is loaded:
	 *
	 * $( window ).load(function() {
	 *
	 * });
	 *
	 * ...and/or other possibilities.
	 *
	 * Ideally, it is not considered best practise to attach more than a
	 * single DOM-ready or window-load handler for a particular page.
	 * Although scripts in the WordPress core, Plugins and Themes may be
	 * practising this, we should strive to set a better example in our own work.
	 */

})( jQuery );
// source --> //3d360properties.com/wp-content/plugins/revslider/public/js/libs/tptools.js?ver=6.7.34 
!function(){"use strict";if(window._tpt??={},_tpt.loadingScripts??={},void 0!==_tpt.checkResources)return;function t(t,e){if(0===t.length)return 0;const r=t[t.length-1]-e;return t.length/(r/1e3)}var e,r,n;_tpt.dpr=Math.max(1,Math.min(2,window.devicePixelRatio||1)),_tpt.hop=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),void 0!==window.RVS&&void 0!==window.tpGS&&(_tpt.gsap=window.tpGS.gsap),_tpt.regResource=function(t){_tpt.R[t.id]??={},_tpt.R[t.id].status??=0,void 0!==t.url&&(_tpt.R[t.id].url=t.url),void 0!==t.fonts&&(_tpt.R[t.id].fonts=t.fonts),void 0!==t.css&&(_tpt.R[t.id].css=t.css),void 0!==t.fontfamily&&(_tpt.R[t.id].fontfamily=t.fontfamily),void 0!==t.fonticon&&(_tpt.R[t.id].fonticon=t.fonticon)},_tpt.acc={announcer:{_el:null,_styleId:"tpt-sr-announcer-style",init(){return this._el||(this._el=document.getElementById("sr-announcer"),this._el||(this._el=document.createElement("div"),this._el.id="sr-announcer",this._el.setAttribute("role","status"),this._el.setAttribute("aria-live","polite"),this._el.setAttribute("aria-atomic","true"),document.body.appendChild(this._el))),this._el},update({customText:t,moduleName:e,slideIndex:r,totalSlides:n,slideTitle:i}){this.init();let s="";if(t&&"auto"!==String(t).toLowerCase()&&t.length>0&&"undefined"!==t)s=t;else{s=`${e?`${e}: `:""}Slide ${r} of ${n}${i?` – ${i}`:""}`}this._el.textContent="",setTimeout((()=>{this._el.textContent=s}),50)}}},_tpt.checkResources=async function(t,e){const r=[];return t.forEach((t=>{const e=_tpt.R[t];void 0!==e&&2!==e.status&&("DOM"===t?(_tpt.R[t].status=1,r.push(_tpt.waitForDOM(t))):void 0!==e.fonticon?(r.push(_tpt.loadCSS(e.url,t)),e.woff2&&r.push(_tpt.loadWoff2(e.woff2,t))):void 0!==e.url?r.push(_tpt.loadScript(e.url,t,e.test,e.listen)):e.fonts||e.css&&r.push(_tpt.loadCSS(e.css,t)))})),e?await Promise.allSettled(r):await Promise.all(r)},_tpt.waitForDOM=async function(){return new Promise((t=>{"interactive"===document.readyState||"complete"===document.readyState?(_tpt.R.DOM.status=2,t()):document.addEventListener("DOMContentLoaded",(()=>{_tpt.R.DOM.status=2,t()}))}))},_tpt.loadScript=function(t,e){return new Promise((async(r,n)=>{_tpt.R[e].status=1,"string"==typeof t&&(t=[t]);for(const i of t)if(_tpt.loadingScripts[i])try{if(await _tpt.loadingScripts[i],2===_tpt.R[e].status)return void r()}catch(t){console.error(t)}else{_tpt.loadingScripts[i]=new Promise(((t,r)=>{const n=document.createElement("script");n.src=i,n.onload=()=>{_tpt.R[e].status=2,t()},n.onerror=()=>{_tpt.R[e].status=3;const t=new Error(`Failed to load script: ${i}`);r(t)},document.head.appendChild(n)}));try{if(await _tpt.loadingScripts[i],2===_tpt.R[e].status)return void r()}catch(t){return console.error(t),void n(t)}}n(new Error("Unable to load scripts."))}))},_tpt.loadWoff2=async function(t,e){return _tpt.R[e].status=1,new Promise(((r,n)=>{const i=document.createElement("style");i.type="text/css",i.classList.add("sr7-inline-css"),i.textContent=`\n\t\t\t\t@font-face {\n\t\t\t\t\tfont-family: ${_tpt.R[e].fontfamily};\n\t\t\t\t\tsrc: url("${t}") format("woff2");\n\t\t\t\t}\n\t\t\t`,i.onload=()=>{_tpt.R[e].status=2,r()},i.onerror=()=>{_tpt.R[e].status=3,n(new Error(`Failed to load font: ${t}`))},document.head.appendChild(i)}))},_tpt.restAPI=async function(t,e){_tpt.restAPILoad(t).then((e=>{"function"==typeof t.callBack&&t.callBack(e)})).catch((r=>{if(!e)throw r;console.log(r),"function"==typeof t.callBack&&t.callBack(r)}))},_tpt.restApiIdCut=function(t){if(null==t)return;const e=(t=t.replace("SR7_","")).lastIndexOf("_");if(-1===e)return t;const r=t.substring(e+1);return Number.isFinite(parseInt(r))?t.substring(0,e):t},_tpt.urlProtocol=function(t,e){return"/"==(""+t)[0]&&"/"==(""+t)[1]?(e?"https:":window.location.protocol)+t:(""+t).includes("://")?(e||t.includes("https")?"https:":window.location.protocol)+"//"+t.split("://").slice(1).join("://"):t},_tpt.restAPILoad=async function(t){var e=_tpt.urlProtocol(t.url||window.SR7.E.resturl),r=t.method||"GET";return e+="get_full_slider_object"==t.action?"sliderrevolution/sliders/":"get_stream_data"==t.action?"sliderrevolution/sliders/stream/":"get_modal_settings"==t.action?"sliderrevolution/sliders/modal/":"",e+=(null==t.id?t.alias??"":_tpt.restApiIdCut(t.id))+(e.includes("?")?"&srengine="+(6==t.version?6:7):"?srengine="+(6==t.version?6:7)),null==t.id&&t.forcealias&&void 0!==t.alias&&(e+=e.includes("?")?"&alias=true":"?alias=true"),"get_stream_data"==t.action&&SR7.E?.wpml?.lang&&(e+=(e.includes("?")?"&srlang=":"?srlang=")+SR7.E.wpml.lang),"get_full_slider_object"==t.action&&void 0!==t.slideid&&(e+=(e.includes("?")?"&slideid":"?slideid")+"="+t.slideid),t.raw&&(e+=(e.includes("?")?"&raw":"?raw")+"=true"),new Promise(((t,n)=>{const i=new XMLHttpRequest;i.open(r,e,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.onload=()=>{200===i.status?t(i.response):n(i.statusText)},i.onerror=()=>n(i.statusText),i.send()}))},_tpt.measureAverageFrameRate=(e,r,n=30)=>new Promise((i=>{let s=[],o=[],a=0;const u=performance.now(),l=()=>{if(SR7?.M[r]?.states?.inViewPort){if(s.push(performance.now()),s.length%45==0){let e=t(s.slice(-45),s[s.length-45]);o.push(e),o.length>3&&o.shift(),e<n&&a++}performance.now()-u<e?requestAnimationFrame(l):i({averageFPS:t(s,u),lowFrameRateCount:a})}else i({averageFPS:t(s,u),lowFrameRateCount:a})};requestAnimationFrame(l)})),_tpt.fixResponse=t=>{if("object"==typeof t)return t;let e=0,r=!1,n=!1,i=-1,s=[];for(let o=0;o<t.length;o++){let a=t[o];if(n)n=!1;else if("\\"!==a){if('"'===a&&(r=!r),!r)if("{"===a)0===e&&(i=o),e++;else if("}"===a&&(e--,0===e&&-1!==i)){let e=t.substring(i,o+1);i=-1;try{let t=JSON.parse(e);s.push(t)}catch(t){}}}else n=!0}for(let t of s)if(t&&!0===t.success)return t;return s.length>0?s[0]:t},_tpt.ajax=async function(t){_tpt.ajaxLoad(t).then((e=>{"function"==typeof t.callBack&&t.callBack(e)})).catch((t=>{throw t}))},_tpt.ajaxLoad=async function(t,e=5){var r=t.url||window.SR7.E.ajaxurl,n=t.method||"POST",i={action:"get_full_slider_object"==t.action&&!0!==t.backend||"get_stream_data"==t.action||"get_modal_data"==t.action?"revslider_ajax_call_front":"rs_ajax_action",client_action:t.action,data:t.data,version:7,nonce:window.SR7.E.backend?window.SR7.E.nonce:void 0};return"get_full_slider_object_v7"==t.action&&(r+=r.includes("?")?"&srengine=6":"?srengine=6"),new Promise(((s,o)=>{const a=new XMLHttpRequest;a.open(n,r,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.onload=()=>{200===a.status?s(a.response):o(a.statusText)},a.onerror=()=>{e>0&&0==a.status?setTimeout((()=>{_tpt.ajaxLoad(t,e-1).then(s).catch(o)}),750):o(a.statusText)};const u=_tpt.objectToParams(i);a.send(u)}))},_tpt.svgCache??={},_tpt.getSVG=async function(t,e,r){t=(t=(t=_tpt.urlProtocol(t)).replace("/public/assets/assets/svg/","/public/assets/svg/")).replace("/public/assets/assets/sources/","/public/assets/sources/");try{const n=await _tpt.loadSVG(t);"function"==typeof e&&e(n,r)}catch(t){throw t}},_tpt.loadSVG=async function(t){return t=(t=(t=_tpt.urlProtocol(t)).replace("/public/assets/assets/svg/","/public/assets/svg/")).replace("/public/assets/assets/sources/","/public/assets/sources/"),_tpt.svgCache[t]?Promise.resolve(_tpt.svgCache[t]):new Promise(((e,r)=>{var n=new XMLHttpRequest;n.overrideMimeType("image/svg+xml"),n.open("GET",t,!0),n.onload=()=>{if(4==n.readyState&&"200"==n.status){var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.innerHTML=n.responseText,_tpt.svgCache[t]=i,e(i)}else r(n.statusText)},n.onerror=()=>r(n.statusText),n.send(null)}))},_tpt.createNS=t=>{var e;for(e in t.n=document.createElementNS("http://www.w3.org/2000/svg",t.n),t.v)t.n.setAttributeNS(null,e.replace(/[A-Z]/g,(function(t,e,r,n){return"-"+t.toLowerCase()})),t.v[e]);for(e in void 0!==t.c&&t.n.setAttribute("class",t.c),void 0!==t.id&&(t.n.id=t.id),void 0!==t.t&&(t.n.textContent=t.t),t.s)t.s.hasOwnProperty(e)&&(t.n.style[e]=t.s[e]);return t.n},_tpt.getJSON=async function(t){_tpt.loadJSON(t).then((e=>{"function"==typeof t.callBack&&t.callBack(e)})).catch((t=>{throw t}))},_tpt.loadJSON=async function(t){return new Promise(((e,r)=>{var n=new XMLHttpRequest;n.overrideMimeType("application/json"),n.open("GET",t.url,!0),n.onload=()=>{4==n.readyState&&"200"==n.status?e(n.responseText):r(n.statusText)},n.send(null)}))},_tpt.objectToParams=function(t,e=new URLSearchParams,r=""){for(const n in t)if(_tpt.hop(t,n)){const i=t[n],s=r?`${r}[${n}]`:n;"object"==typeof i?_tpt.objectToParams(i,e,s):e.append(s,i)}return e.toString()},_tpt.sortPoints=function(t,e){return _tpt.hop(t,"x")?t.x<e.x?-1:t.x>e.x?1:0:t.p<e.p?-1:t.p>e.p?1:0},_tpt.isSet=t=>"inherit"!==t&&null!=t,_tpt.lineBreaks=(t,e)=>"#srfshcd#"==t.slice(0,9)?t.replace("#srfshcd#",""):"full"==e||"content"==e?t.split("\n").join("<br>").replace(/\n/g,"<br/>"):t.replace("\n",""),_tpt.trim=t=>null!=t&&"string"==typeof t?t.trim():t,_tpt.iOSVersion=!!(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i))&&navigator.userAgent.match(/OS 4_\d like Mac OS X/i),_tpt.isiPhone=/iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_tpt.isIOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&void 0!==navigator.standalone,_tpt.setIsChrome8889=navigator.userAgent.indexOf("Chrome/88")>=0||navigator.userAgent.indexOf("Chrome/89")>=0,_tpt.is_mobile=function(){var t=["android","webos","iphone","ipad","blackberry","Android","webos","iPod","iPhone","iPad","Blackberry","BlackBerry"],e=!1;if(void 0!==window.orientation)e=!0;else for(var r in t)_tpt.hop(t,r)&&(e=!!(e||navigator.userAgent.split(t[r]).length>1)||e);return e&&document.body&&-1===document.body.className.indexOf("rs-ISM")&&(document.body.className+=" rs-ISM"),e}(),_tpt.browser=(r=navigator.userAgent,n=r.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],/trident/i.test(n[1])?(e=/\brv[ :]+(\d+)/g.exec(r)||[],"IE"):"Chrome"===n[1]&&null!=(e=r.match(/\b(OPR|Edge)\/(\d+)/))?e[1].replace("OPR","Opera"):(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=r.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),n[0])),_tpt.isWebkit=function(){const t=/(webkit)[ \/]([\w.]+)/.exec(navigator.userAgent.toLowerCase());return t&&t[1]&&"webkit"===t[1]}(),_tpt.browserVersion=function(){var t,e=navigator.appName,r=navigator.userAgent,n=r.match(/(edge|opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);return n&&null!=(t=r.match(/version\/([\.\d]+)/i))&&(n[2]=t[1]),(n=n?[n[1],n[2]]:[e,navigator.appVersion,"-?"])[1]}(),_tpt.isSafari11="safari"===_tpt.trim(_tpt.browser.toLowerCase())&&parseFloat(_tpt.browserVersion)>=11,_tpt.is_android=function(){var t=["android","Android"],e=!1;for(var r in t)_tpt.hop(t,r)&&(e=!!(e||navigator.userAgent.split(t[r]).length>1)||e);return e}(),_tpt.is_mozilla=navigator.userAgent.includes("Firefox"),_tpt.normalizeWheel=t=>{let e=0;return"deltaY"in t||"deltaX"in t?e=0!=t.deltaY&&-0!=t.deltaY||!(t.deltaX<0||t.deltaX>0)?t.deltaY:t.deltaX:("detail"in t&&(e=t.detail),"wheelDelta"in t&&(e=-t.wheelDelta/120),"wheelDeltaY"in t&&(e=-t.wheelDeltaY/120)),e=_tpt.is_mozilla?10*e:e,(e>300||e<-300)&&(e/=10),e},_tpt.extend=function(t,e){for(var r in void 0===t&&(t={}),e)_tpt.hop(e,r)&&("object"==typeof e[r]&&null!==e[r]?Array.isArray(e[r])?t[r]=e[r].slice():t[r]=_tpt.extend(t[r],e[r]):t[r]=e[r]);return t},_tpt.removeEmptyTags=t=>{t.forEach((t=>{""!==t.innerHTML.trim()&&(""!==t.textContent||0!=t.children?.length)||(""+t.className).includes("sr")||(""+t.className).includes("rev")||t.remove()}))},_tpt.gA=function(t,e,r){return void 0===t?void 0:t.hasAttribute&&t.hasAttribute("data-"+e)&&void 0!==t.getAttribute("data-"+e)&&null!==t.getAttribute("data-"+e)?t.getAttribute("data-"+e):void 0!==r?r:void 0},_tpt.sA=function(t,e,r){t&&t.setAttribute&&t.setAttribute("data-"+e,r)},_tpt.rA=function(t,e){t&&t.removeAttribute&&t.removeAttribute("data-"+e)},_tpt.posToNum=function(t,e){return(""+t).includes("%")?e*parseFloat(t)/100:(""+t).includes("px")?parseInt(t):(""+t).includes("auto")?0:t},_tpt.DNTMtoArr=function(t,e="auto",r,n){return r??=e,[1==n?r:"object"==typeof t?"object"==typeof t.d?t.d?.v??r:t.d??r:t??r,"object"==typeof t?"object"==typeof t.d?t.d?.v??e:t.d??e:t??e,"object"==typeof t?"object"==typeof t.n?t.n?.v??e:t.n??e:t??e,"object"==typeof t?"object"==typeof t.t?t.t?.v??e:t.t??e:t??e,"object"==typeof t?"object"==typeof t.m?t.m?.v??e:t.m??e:t??e]};class i extends Event{constructor(t,e){super(t),Object.assign(this,e)}}function s(t,e,r){var n=document.createElement("canvas"),i=n.getContext("2d");if(n.width=100,n.height=200,0===t.length)i.fillStyle=r;else{for(var s=i.createLinearGradient(0,0,100,0),o=0;o<t.length;o++)s.addColorStop(t[o].stop/100,t[o].color);i.fillStyle=s}i.fillRect(0,0,100,200);var a=i.getImageData(0,0,100,2).data,u="";for(o=0;o<e.length;o++){var l=Math.ceil(e[o]),p=4*(0!==l?l-1:l);u+="rgba("+a[p]+","+a[p+1]+","+a[p+2]+","+a[p+3]/255+")",u+=" "+l+(e.length-1===o?"%":"%,")}return n.remove(),u}function o(t,e,r,n){for(var i="",s=_tpt.gsap.utils.mapRange(0,n.length-1,0,t.length-1),o=0;o<n.length;o++){var a=Math.round(s(o));i+=t[a].color,i+=" "+t[a].stop+(n.length-1===o?"%":"%,")}return i}function a(t){var e=/rgb([\s\S]*?)%/g,r=[],n=[],i=[];do{(o=e.exec(t))&&r.push(o[0])}while(o);for(var s=0;s<r.length;s++){var o=r[s],a=(t=/rgb([\s\S]*?)\)/.exec(o),/\)([\s\S]*?)%/.exec(o));t[0]&&(t=t[0]),a[1]&&(a=a[1]),i.push(parseFloat(a)),n.push({color:t,stop:parseFloat(a)})}return 0===n.length&&(n.push({color:t,stop:0}),i.push(0),n.push({color:t,stop:100}),i.push(100)),{points:n,stops:i}}_tpt.tEvtSimple=t=>_tpt.is_mobile?"mouseenter"==t?"touchstart":"mouseleave"==t?"mouseleave":"mousemove"==t?"touchmove":t:t,_tpt.tEvt=t=>Array.isArray(t)?t.map((t=>_tpt.tEvtSimple(t))):_tpt.tEvtSimple(t),_tpt.event={listeners:{},timestamps:{},getId:()=>Math.random().toString(36).substr(2,10),trigger:(t,e,r={})=>{if("dom"==t)document.dispatchEvent(new i(e,r));else{const n=new CustomEvent(e,{detail:r});t.dispatchEvent(n)}},listen:(t,e,r,n,i)=>{_tpt.is_mobile&&"mouseleave"===e&&(e+=" touchend");const s=e.split(" "),o=[];return s.forEach((e=>{const s=_tpt.event.getId(),a=t=>{void 0!==_tpt.event.timestamps[t.target.id]&&_tpt.event.timestamps[t.target.id]>t.timeStamp||(_tpt.event.timestamps[t.target.id]=t.timeStamp,r(t,n))};_tpt.event.listeners[t.id]||(_tpt.event.listeners[t.id]=[]),_tpt.event.listeners[t.id].push({id:s,eventType:e,eventListener:a}),t.addEventListener(e,a,i?{passive:!1}:{passive:!0}),o.push(s)})),o},hasListener:t=>void 0!==_tpt.event.listeners[t.id]&&_tpt.event.listeners[t.id].length>0,rm:(t,e)=>{if(!_tpt.event.listeners[t.id])return;const r=_tpt.event.listeners[t.id].findIndex((t=>t.id==e));if(-1===r)return;const{eventType:n,eventListener:i}=_tpt.event.listeners[t.id][r];return t.removeEventListener(n,i),_tpt.event.listeners[t.id].splice(r,1),"removed"},rmAll:t=>{_tpt.event.listeners[t.id]&&(_tpt.event.listeners[t.id].forEach((e=>{t.removeEventListener(e.eventType,e.eventListener)})),delete _tpt.event.listeners[t.id])}},_tpt.keyBoard={reg:(t,e,r,n)=>{_tpt.event.keyboardTargets??={},_tpt.event.keyboardTargets[e]||(_tpt.event.keyboardTargets[e]={id:t,callback:r,keys:n},_tpt.keyBoard.isListening||(_tpt.keyBoard.isListening=!0,_tpt.event.listen(document,"keydown",(function(t,e){if("INPUT"===document.activeElement.tagName)t.preventDefault();else for(let r in _tpt.event.keyboardTargets)_tpt.hop(_tpt.event.keyboardTargets,r)&&_tpt.event.keyboardTargets[r].keys.includes(t.key)&&_tpt.event.keyboardTargets[r].callback(t,e)}),{id:t,cid:e,keys:n})))},rm:t=>{delete _tpt.event.keyboardTargets[t]},rmAll:()=>{_tpt.event.listen.rm(document,"keydown"),delete _tpt.event.keyboardTargets}},_tpt.strSetToObj=function(t){if(null==t)return{};var e={};return t.split(";").forEach((t=>{var r=t.split(":");void 0!==r[0]&&""!==r[0]&&(e[r[0]]=r[1])})),e},_tpt.padMarArr=function(t){let e;t=Array.isArray(t)?t:[t];var r=!1;for(e=0;e<t.length;e++)Array.isArray(t[e])&&(r=!0);for(r||(t=[t]),t.length<5&&t.unshift(["auto","auto","auto","auto"]),e=0;e<5;e++)t[e]=void 0===t[e]?["auto","auto","auto","auto"]:Array.isArray(t[e])?t[e]:[t[e]],2==t[e].length?t[e]=[t[e][0],t[e][1],t[e][0],t[e][1]]:3==t[e].length?t[e]=[t[e][0],t[e][1],t[e][2],t[e][1]]:t[e].length<4&&(t[e]=_tpt.fillArray(t[e],4));return[...t]},_tpt.explodeData=function(t){t=t.split(";");var e,r,n={};for(r in t)void 0!==(e=t[r].split(":"))[0]&&""!==e[0]&&(n[e[0]]=e[1]);return n},_tpt.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),_tpt.getHighestAttribute=function(t,e,r=0){if(null==t||null==e)return r;for(var n in t)_tpt.hop(t,n)&&void 0!==t[n]&&void 0!==t[n][e]&&t[n][e]>r&&(r=t[n][e]++);return r},_tpt.findIndex=function(t,e,r){if(void 0!==r)return t.findIndex((t=>void 0!==t&&t[e]===r));for(let r=0;r<t.length;r++)if(""+t[r]==""+e)return r;return-1},_tpt.unitize=(t,e="px")=>parseFloat(t)==t?-1==e?t:t+e:-1==e?parseInt(t):t,_tpt.divSize=t=>{if("#"==(""+t)[0]){let e=t.split("#")[1].split("/");return 100/parseInt(e[1])*e[0]+"%"}return t},_tpt.mText=(t="",e="")=>t.trim()+(""!==t&&""!==e?" ":"")+e.trim(),_tpt.defNum=(t,e)=>null==t||isNaN(parseFloat(t))?e:parseFloat(t),_tpt.gradient={SSGCache:[],getSSGColors:(t,e,r)=>{if(r=void 0===r?"fading":r,-1===t.indexOf("gradient")&&-1===e.indexOf("gradient"))return{from:t,to:e};for(var n={from:t,to:e},i=0;i<_tpt.gradient.SSGCache.length;i++){if(_tpt.gradient.SSGCache[i].from===t&&_tpt.gradient.SSGCache[i].to===e&&_tpt.gradient.SSGCache[i].type===r)return{from:_tpt.gradient.SSGCache[i].rFrom,to:_tpt.gradient.SSGCache[i].rTo};if(_tpt.gradient.SSGCache[i].from===e&&_tpt.gradient.SSGCache[i].to===t&&_tpt.gradient.SSGCache[i].type===r)return{from:_tpt.gradient.SSGCache[i].rTo,to:_tpt.gradient.SSGCache[i].rFrom}}var u=a(t),l=a(e);if(u.stops.length===l.stops.length&&-1!==t.indexOf("gradient")&&-1!==e.indexOf("gradient"))return{from:t,to:e};var p,c,h=u.stops;for(i=0;i<l.stops.length;i++)-1===h.indexOf(l.stops[i])&&h.push(l.stops[i]);if(h.sort((function(t,e){return t-e})),-1!==t.indexOf("gradient(")){var d=-1!==t.indexOf("deg,")?t.indexOf("deg,")+4:-1!==t.indexOf("at center,")?t.indexOf("at center,")+10:t.indexOf("gradient(")+9;p=t.substring(0,d),-1===e.indexOf("gradient(")&&(c=t.substring(0,d))}if(-1!==e.indexOf("gradient(")){d=-1!==e.indexOf("deg,")?e.indexOf("deg,")+4:-1!==e.indexOf("at center,")?e.indexOf("at center,")+10:e.indexOf("gradient(")+9;c=e.substring(0,d),-1===t.indexOf("gradient(")&&(p=e.substring(0,d))}return"fading"===r?(u.stops.length,l.stops.length,p+=s(u.points,h,t),c+=s(l.points,h,e)):"sliding"===r&&(u.stops.length>l.stops.length?c+=o(l.points,0,0,u.points):p+=o(u.points,0,0,l.points)),p+=")",c+=")","sliding"===r&&(u.stops.length>l.stops.length?p=t:c=e),n.rFrom=p,n.rTo=c,n.tyep=r,_tpt.gradient.SSGCache.push(n),{from:p,to:c}},getSVGReference:t=>{if(void 0===t)return t;let e=_tpt.gradient.process(_tpt.gradient.convert(t));if("solid"==e.type)return e.string;if(void 0===_tpt.gradient.SVG)_tpt.gradient.SVG=_tpt.createNS({n:"svg",id:"tp_svg_gradients",s:{width:"100%",height:"100%",opacity:0,pointerEvents:"none"}}),_tpt.gradient.SVG.style.visibility="hidden",_tpt.gradient.SVG.style.position="absolute",_tpt.gradient.SVG.style.top="0px",_tpt.gradient.SVG.style.left="0px",_tpt.gradient.SVG.style.width="0px",_tpt.gradient.SVG.style.height="0px",_tpt.gradient.SVG.style.pointerEvents="none",_tpt.gradient.SVG.setAttribute("viewBox","0 0 1 1"),_tpt.gradient.SVG.setAttribute("preserveAspectRatio","none"),document.body.appendChild(_tpt.gradient.SVG),_tpt.gradient.svgReferences={},_tpt.gradient.svgNode={},_tpt.gradient.svgRefIndex=0;else if(_tpt.gradient.svgReferences[e.string])return _tpt.gradient.svgReferences[e.string];let r="radial"===e.type?0:e.angle*_tpt.DEG2RAD,n=_tpt.createNS({id:`tp_svg_gradient_${_tpt.gradient.svgRefIndex}`,n:`${e.type}Gradient`,v:"radial"===e.type?void 0:{gradientUnits:"userSpaceOnUse",x1:`${Math.round(50+50*Math.sin(r))}%`,y1:`${Math.round(50+50*Math.cos(r))}%`,x2:`${Math.round(50+50*Math.sin(r+Math.PI))}%`,y2:`${Math.round(50+50*Math.cos(r+Math.PI))}%`}});for(const t of e.colors){const[e,r,i,s]=_tpt.gsap.utils.splitColor(t.rgba);n.appendChild(_tpt.createNS({n:"stop",v:{offset:`${t.p}%`,stopColor:_tpt.getHexColor([e,r,i]),stopOpacity:s??1}}))}return _tpt.gradient.SVG.appendChild(n),_tpt.gradient.svgReferences[e.string]="url(#tp_svg_gradient_"+_tpt.gradient.svgRefIndex+")",_tpt.gradient.svgNode[_tpt.gradient.svgRefIndex]=n,_tpt.gradient.svgRefIndex++,_tpt.gradient.svgReferences[e.string]},getSVGDef:(t="")=>{let e=t.replace("url(#tp_svg_gradient_","").replace(")","");return _tpt.gradient.svgNode[e]??""},getColorStops:(t,e)=>{if(!t.includes("gradient"))return e?[]:t;const r=/(rgba?\((\d+),\s*(\d+),\s*(\d+)(,\s*([\d.]+))?\)|#[0-9a-fA-F]{6})(\s*(\d+%)|)/gi,n=t.match(/(linear|radial)-gradient\(([^,]+),/),i=n&&n[1]?`${n[1]}`:null;let s=null;if("linear"===i){const t=n[2].trim();switch(t){case"right":s=270;break;case"left":s=90;break;case"top":s=0;break;case"bottom":s=180;break;default:s=parseInt(t)||180}}let o,a,u=[],l=null;for(;null!==(a=r.exec(t));){const t=a[1].startsWith("#")?a[1]:null;let e=a[7]?parseInt(a[7]):null;const r=t?_tpt.gradient.hexToRgba(t):`rgba(${a[2]},${a[3]},${a[4]},${a[6]||"1"})`;r===l&&e===o||(u.push({rgba:r,p:e}),o=e,l=r),u.some((t=>null===t.p))&&u.forEach(((t,e)=>{null===t.p&&(t.p=100/(u.length-1)*e||0)}))}return{colors:u,type:i,angle:s}},hexToRgba:t=>`rgba(${parseInt(t.substring(1,3),16)},${parseInt(t.substring(3,5),16)},${parseInt(t.substring(5,7),16)},1)`,convert:t=>{let e={};if(null==t)return t;if("string"==typeof t){if("transparent"==t)return{orig:"transparent",type:"solid",string:"transparent"};if(t.includes("&")||t.includes("{")&&t.includes('"'))if(e=JSON.parse(t.replaceAll("&",'"')),e.orig??={...e.colors},delete e.colors,"string"==typeof e.orig){if(e.orig.includes("grad")){let{angle:t,colors:r,type:n}=_tpt.gradient.getColorStops(e.orig,!0);e.orig=r,e.angle=t,e.type=n}}else{Array.isArray(e.orig)||"object"!=typeof e.orig||(e.orig=Object.values(e.orig));for(let t in e.orig)e.orig[t]={rgba:e.orig[t]?.rgba??e.orig[t]?.rgbaColor??`rgba(${e.orig[t]?.r??0}, ${e.orig[t]?.g??0}, ${e.orig[t]?.b??0}, ${e.orig[t]?.a??0})`,p:e.orig[t]?.p??e.orig[t]?.position??0,align:e.orig[t]?.align??void 0};e.orig=u(e.orig)}else{if(!t.includes("gradient"))return t.includes("{")&&t.includes('"')&&t.includes("orig")&&(t=JSON.parse(t).orig),{type:"solid",orig:t,string:_tpt.gradient.getString({type:"solid",orig:t})};{let{angle:r,colors:n,type:i}=_tpt.gradient.getColorStops(t,!0);e={orig:n,type:i,angle:r,strength:100,easing:"none"}}}}else"object"==typeof t&&(e={...t},e.orig??={...e.colors},delete e.colors);return e.angle=180===e.angle||void 0===e.angle?180.1:e.angle,e.strength=e.strength||100,e.easing=e.easing||"none",e.string=_tpt.gradient.getString(e),Array.isArray(e.orig)||"object"!=typeof e.orig||(e.orig=Object.values(e.orig),e.orig=u(e.orig)),e},getString:(t,e=!1)=>{if("string"==typeof t.orig){if("transparent"==t.orig)return"transparent";const e=window[null==window._tpt?.gsap?"tpGS":"_tpt"].gsap.utils.splitColor(t.orig)||[0,0,0,1];return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]??1})`}let r=t.colors||t.orig;const n=e&&(180==t.angle||180.1==t.angle);let i,s,o,a="";return"linear"===t.type?a+="linear-gradient("+(n?"":t.angle+"deg"):"radial"===t.type&&(a+="radial-gradient(circle"),a+=r.map(((t,r)=>(t.rgba=_tpt.gradient.toRGBA(t.rgba),e&&void 0!==o&&t.rgba==o.rgba&&o.p==t.p?"":(o={p:t.p,rgba:t.rgba},s=`${0===r&&n?"":","}${t.rgba} ${t.p}%`,s!==i?i=s:s="",s)))).join(""),a+=")",a},process:(t,e)=>("object"!=typeof t||(void 0!==t.easing&&"none"!==t.easing&&(t.colors=_tpt.gradient.ease(t),t.string=_tpt.gradient.getString(t),e=!1),t.colors??=t.orig,Array.isArray(t.colors)||"object"!=typeof t.colors||(t.colors=Object.values(t.colors)),t.string=e||null==t.string?_tpt.gradient.getString(t):t.string),t),ease:t=>{let{strength:e,orig:r,easing:n}=t;if(e=.01*parseInt(e,10)*15,n=t.easing.split("."),n.length<2)return{...t.orig};if(r.sort(_tpt.sortPoints),n=_tpt.gradient.easing[n[0]][n[1]],null==n)return{...t.orig};let i=r.length-1,s=[];for(let t=0;t<i;t++)s[s.length]=r[t],_tpt.gradient.insertPoints(r[t],r[t+1],s,n,e);return s[s.length]=r[i],s},calcPoints:(t,e,r)=>{const n=r*Math.PI/180*-1,i=e/2,s=t/2,o={k:{x:s-Math.tan(n)*i,y:0},j:{x:s+Math.tan(n)*(e-i),y:e},ky:{x:t,y:i+(t-s)/Math.tan(n)},jy:{x:0,y:i-s/Math.tan(n)}};let a={},u={};return[[o.k.x,o.j.x,o.k,o.j],[o.ky.y,o.jy.y,o.ky,o.jy],[o.k.x,o.ky.y,o.k,o.ky],[o.ky.y,o.j.x,o.ky,o.j],[o.j.x,o.jy.y,o.j,o.jy],[o.k.x,o.jy.y,o.k,o.jy]].forEach((([r,n,i,s])=>{_tpt.inBounds(r,0,t)&&_tpt.inBounds(n,0,e)&&(a=i,u=s)})),r>90&&r<315?{tx:a.x,ty:a.y,bx:u.x,by:u.y}:{tx:u.x,ty:u.y,bx:a.x,by:a.y}},getLinear:(t,e,r,n)=>{n=n*_tpt.DEG2RAD+Math.PI/2;for(var i,s,o,a,u=e/2,p=r/2,h=Math.sqrt(u*u+p*p),d={x1:Math.cos(n)*h+u,y1:Math.sin(n)*h+p,x2:u,y2:p},f=[l({x:0,y:0},n),l({x:e,y:0},n),l({x:e,y:r},n),l({x:0,y:r},n)],g=[],_=0;_<f.length;_++)g.push(c(f[_],d));if(SR7.F.dist(u,p,g[0].x,g[0].y)>SR7.F.dist(u,p,g[1].x,g[1].y)?(i=g[0].x,s=g[0].y):(i=g[1].x,s=g[1].y),SR7.F.dist(u,p,g[2].x,g[2].y)>SR7.F.dist(u,p,g[3].x,g[3].y)?(o=g[2].x,a=g[2].y):(o=g[3].x,a=g[3].y),Math.round(100*Math.atan2(p-s,u-i))/100===Math.round(n%(2*Math.PI)*100)/100){var m=i,D=s;i=o,s=a,o=m,a=D}return t.createLinearGradient(Math.round(i),Math.round(s),Math.round(o),Math.round(a))},insertPoints:(t,e,r,n,i)=>{let s=_tpt.gradient.RGBAToObj(t),o=_tpt.gradient.RGBAToObj(e);var a=t.p,u=e.p;if(!(a>u)){for(var l,p,c,h=[],d=0;d<i;d++)(p=parseFloat(n(d,0,1,i).toFixed(2))*(u-a)+a)>a&&p<u&&(h[h.length]=p);var f,g,_=h.length,m=parseFloat(((u-a)/(_+1)).toFixed(2)),D=parseFloat(m+a);for(d=0;d<_;d++)(c=h[d])!==t.p&&(f=_tpt.sanitizeAlpha(s.a),g=_tpt.sanitizeAlpha(o.a),l={p:D,rgba:_tpt.gradient.toRGBA({r:s.r!==o.r?Math.round(_tpt.distColor(c,a,u,s.r,o.r)):s.r,g:s.g!==o.g?Math.round(_tpt.distColor(c,a,u,s.g,o.g)):s.g,b:s.b!==o.b?Math.round(_tpt.distColor(c,a,u,s.b,o.b)):s.b,a:f!==g?_tpt.sanitizeAlpha(_tpt.distAlpha(c,a,u,s.a,o.a)):f})},D+=m,D=parseFloat(D.toFixed(2)),r[r.length]=l)}},transToColor:t=>{if(null==t)return;if(String(t).indexOf("gradient")>=0)return t;let e=_tpt.gradient.toRGBA(t).replace("rgb(","rgba(").split(",");return e[0]+","+e[1]+","+e[2].replace(")","")+",0)"},RGBAToObj:t=>{if("object"==typeof t){if(void 0!==t.r)return{...t};if(void 0!==t.rgba)return p(t.rgba)}else if("string"==typeof t)return p(t)},toRGBA:t=>{if("object"==typeof t)return void 0!==t.rgba&&"string"==typeof t.rgba?t.rgba:"rgba("+t.r+","+t.g+","+t.b+","+(t.a??1)+")";var e=window[null==_tpt.gsap?"tpGS":"_tpt"].gsap.utils.splitColor(t);return"rgba("+e[0]+","+e[1]+","+e[2]+","+(e[3]??1)+")"},easing:{quint:{easeout:function(t,e,r,n){return r*((t=t/n-1)*t*t*t*t+1)+e},easein:function(t,e,r,n){return r*(t/=n)*t*t*t*t+e},easeinout:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e}},quad:{easein:function(t,e,r,n){return r*(t/=n)*t+e},easeout:function(t,e,r,n){return-r*(t/=n)*(t-2)+e},easeinout:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e}},quart:{easein:function(t,e,r,n){return r*(t/=n)*t*t*t+e},easeout:function(t,e,r,n){return-r*((t=t/n-1)*t*t*t-1)+e},easeinout:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e}},cubic:{easein:function(t,e,r,n){return r*(t/=n)*t*t+e},easeout:function(t,e,r,n){return r*((t=t/n-1)*t*t+1)+e},easeinout:function(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e}},circ:{easein:function(t,e,r,n){return-r*(Math.sqrt(1-(t/=n)*t)-1)+e},easeout:function(t,e,r,n){return r*Math.sqrt(1-(t=t/n-1)*t)+e},easeinout:function(t,e,r,n){return(t/=n/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:r/2*(Math.sqrt(1-(t-=2)*t)+1)+e}},sine:{easein:function(t,e,r,n){return-r*Math.cos(t/n*(Math.PI/2))+r+e},easeout:function(t,e,r,n){return r*Math.sin(t/n*(Math.PI/2))+e},easeinout:function(t,e,r,n){return-r/2*(Math.cos(Math.PI*t/n)-1)+e}},expo:{easein:function(t,e,r,n){return 0===t?e:r*Math.pow(2,10*(t/n-1))+e},easeout:function(t,e,r,n){return t===n?e+r:r*(1-Math.pow(2,-10*t/n))+e},easeinout:function(t,e,r,n){return 0===t?e:t===n?e+r:(t/=n/2)<1?r/2*Math.pow(2,10*(t-1))+e:r/2*(2-Math.pow(2,-10*--t))+e}},bounce:{easeout:function(t,e,r,n){return(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easein:function(t,e,r,n){return r-RSColor.easing.bounce.easeout(n-t,0,r,n)+e},easeinout:function(t,e,r,n){return t<n/2?.5*RSColor.easing.bounce.easein(2*t,0,r,n)+e:.5*RSColor.easing.bounce.easeout(2*t-n,0,r,n)+.5*r+e}}}},window.tpGS&&null==window.tpGS?.getSSGColors&&(window.tpGS.getSSGColors=_tpt.gradient.getSSGColors);const u=t=>t.filter(((e,r)=>r===t.length-1||(e.rgba!==t[r+1].rgba||e.p!==t[r+1].p))),l=(t,e)=>{var r=e+Math.PI/2;return{x1:t.x,y1:t.y,x2:t.x+100*Math.cos(r),y2:t.y+100*Math.sin(r)}},p=t=>{let e=_tpt.gsap.utils.splitColor(t);return{r:e[0],g:e[1],b:e[2],a:e[3]??1}};function c(t,e){var r=t.y2-t.y1,n=t.x1-t.x2,i=r*t.x1+n*t.y1,s=e.y2-e.y1,o=e.x1-e.x2,a=s*e.x1+o*e.y1,u=r*o-s*n;return 0!==u&&{x:Math.round((o*i-n*a)/u*100)/100,y:Math.round((r*a-s*i)/u*100)/100}}_tpt.distAlpha=(t,e,r,n,i)=>Math.max(Math.min(Math.abs(parseFloat(((t-e)/(r-e)*(i-n)).toFixed(2))+parseFloat(n)),1),0),_tpt.distColor=(t,e,r,n,i)=>Math.max(Math.min(Math.round(Math.abs((t-e)/(r-e)*(i-n)+n)),255),0),_tpt.sanitizeAlpha=t=>parseFloat(Math.max(Math.min(parseFloat(t),1),0).toFixed(2).replace(/\.?0*$/,"")),_tpt.inBounds=(t,e,r)=>t>=e&&t<=r,_tpt.parseColor=(t,e)=>((t=_tpt.gsap.utils.splitColor(t)).length<=3&&(t[3]=1),e?t:t.map(((t,e)=>e<3?t/255:t))),_tpt.getHexColor=t=>`#${t.slice(0,3).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}`,_tpt.checkFontLoaded=function(t,e="normal",r="normal",n){return t=t.replace(/^"(.*)"$/,"$1"),new Promise(((i,s)=>{_tpt.ongoingTests??={};let o=`${t}-${e}-${r}`;_tpt.ongoingTests[o]||(_tpt.ongoingTests[o]=new Promise(((i,s)=>{if(1==(_tpt.R?.fonts?.[t]??0))return void i();let o,a=t.includes("Material Icons")||t.includes("FontAwesome"),u="Material Icons"==t?"wb_incandescent":"FontAwesome"==t||"Pe-icon-7-stroke"==t?"":"BESbswy",l=document.createElement(a?"i":"span"),p=!1,c=()=>{p||(clearInterval(o),p=!0)};l.style.fontFamily="sans-serif",l.style.fontWeight=e,l.style.fontStyle=r,l.textContent=u,_tpt.fontTester||(_tpt.fontTester=document.createElement("sr7-fonttest-wrap"),_tpt.fontTester.setAttribute("aria-hidden","true"),document.body.appendChild(_tpt.fontTester)),_tpt.fontTester.appendChild(l);let h=l.offsetWidth,d=l.offsetHeight;if(l.style.fontFamily=`'${t}', sans-serif`,"FontAwesome"==t?l.classList.add("fa-power-off"):"Pe-icon-7-stroke"==t&&l.classList.add("pe-7s-album"),h!==l.offsetWidth||d!==l.offsetHeight)return _tpt.R.fonts??={},_tpt.R.fonts[t]=1,c(),void i();o=setInterval((()=>{l.offsetWidth===h&&l.offsetHeight===d||(_tpt.R.fonts??={},_tpt.R.fonts[t]=1,c(),i())}),19),setTimeout((()=>{c(),i()}),n)}))),_tpt.ongoingTests[o].then(i,s)}))},_tpt.fontFamily=function(t,e){return null==t?"none":e?t.split(",")[0].replaceAll("+","-"):t.split(",")[0].replaceAll(" ","+")},_tpt.registerFont=function(t={}){_tpt.R.fonts??={},_tpt.R.fonts.required??={};var e=_tpt.fontFamily(t.family);if(_tpt.R.fonts.required[e]??={name:e,orig:t.family,italic:{},normal:{}},t.link&&(_tpt.R.fonts.required[e].link=t.link),t.url&&(_tpt.R.fonts.required[e].url??={url:t.url})&&(_tpt.R.fonts.required[e].url.state??=0),void 0!==t.weight){t.weight=Array.isArray(t.weight)?t.weight:[t.weight];for(var r=0;r<t.weight.length;r++)"auto"!==t.weight[r]&&(_tpt.R.fonts.required[e][t.italic?"italic":"normal"][t.weight[r]]??=0)}},_tpt.waitFonts=async function(t,e,r){try{let r=[];for(let e in t)t.hasOwnProperty(e)&&r.push(_tpt.loadFonts(e));await Promise.all(r),await new Promise((t=>t())),document.body.offsetHeight,"function"==typeof e&&e()}catch(t){console.log(`Error while waiting for fonts to load: ${t}`)}},_tpt.fixGoogleFontNames=function(t){return(t=t.replaceAll("'","")).split("+").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join("+")},_tpt.capitalize=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),_tpt.updateFontStatus=function(t){for(let e in _tpt.R.fonts.required)if(_tpt.hop(_tpt.R.fonts.required,e))for(let r of["normal","italic"])for(let n in _tpt.R.fonts.required[e][r])_tpt.hop(_tpt.R.fonts.required[e][r],n)&&_tpt.R.fonts.required[e][r][n]===t&&(_tpt.R.fonts.required[e][r][n]=2)},_tpt.getLoadedFontFaces=function(){var t={};for(let e of document.fonts){let r=e.family.replace(/['"]+/g,"");t[r]=t[r]||{italic:[],normal:[]};let n=e.weight,i="italic"===e.style?"italic":"normal";t[r][i].includes(n)||t[r][i].push(n)}return t},_tpt.getExistingGoogleFonts=function(){for(var t={},e=document.getElementsByTagName("link"),r=0;r<e.length;r++){let n=e[r].href.split("?");if(n[0]==(SR7.E.fontBaseUrl??"https://fonts.googleapis.com/css2").replace("?family=","")){let e=n[1].split("&");for(let r in e){let n=e[r].split("family=");if(null==e[r]||null==e[r]||null==n[1]||null==n[1])continue;let i=n[1].split(":"),s=n[1].split("@");if(null==i||null==i||null==i[0]||null==i[0])continue;if(null==s||null==s||null==s[1]||null==s[1])continue;i=i[0],t[i]??={italic:[],normal:[]};let o=s[1].split(";");for(let e=0;e<o.length;e++){let r=o[e].split(","),n=1==r[0]||"1"==r[0]||1==r[1]||"1"==r[1];for(let e=0;e<r.length;e++)r[e]>1&&t[i][n?"italic":"normal"].push(parseInt(r[e]))}}}}return t=_tpt.extend(t,_tpt.getLoadedFontFaces())},_tpt.isWeightInRange=(t,e)=>(t=parseInt(t),e.some((e=>{if("string"==typeof e&&e.includes(" ")){let[r,n]=e.split(" ").map(Number);return t>=r&&t<=n}return t==parseInt(e)}))),_tpt.loadFonts=async function(t){if(!window.SR7?.E?.ignoreGoogleFont&&null!=_tpt.R.fonts){var e,r,n,i,s,o="",a=Math.round(1e3*Math.random()+500),u=[];for(i in _tpt.R.fonts??={},_tpt.R.fonts.domFonts??=_tpt.getExistingGoogleFonts(),_tpt.R.fonts.required){if(!_tpt.hop(_tpt.R.fonts.required,i))continue;let t=(e=_tpt.R.fonts.required[i]).name.toLowerCase();if(t.includes("arial")||t.includes("palatino+linotype")||t.includes("times+new+roman")||t.includes("georgia")||t.includes("tahoma")||t.includes("trebuchet+ms")||t.includes("verdana")||t.includes("courier")||t.includes("courier+new")||t.includes("impact")||t.includes("comic+sans+ms"))continue;let l=i.replaceAll("'",""),p=_tpt.R?.fonts?.customFonts?.[i]??_tpt.R?.fonts?.customFonts?.[l]??!1;if(void 0!==e.url||p)e.url??={},0==e.url.state&&(p&&("string"==typeof p?e.url.url=p:e.url=p),u.push({font:i,url:e.url})),e.url.state=1;else{for(s of(r="",["normal","italic"]))for(n in e[s])if(_tpt.hop(e[s],n)&&0==e[s][n]){e[s][n]=a,n=parseInt(n),e.name=_tpt.fixGoogleFontNames(e.name);let t=e.name.toLowerCase();if(t.includes("arial")||t.includes("palatino+linotype")||t.includes("times+new+roman")||t.includes("georgia")||t.includes("tahoma")||t.includes("trebuchet+ms")||t.includes("verdana")||t.includes("courier")||t.includes("courier+new")||t.includes("impact")||t.includes("comic+sans+ms"))continue;if(""==e.name)continue;if(_tpt.isWeightInRange(n,_tpt.R?.fonts?.domFonts?.[e.orig]?.[s]??[]))continue;if(_tpt.isWeightInRange(n,_tpt.R?.fonts?.domFonts?.[e.name]?.[s]??[]))continue;""!==r?r+=";":r=(""!==o?"&":"")+"family="+e.name+":ital,wght@",r+=("normal"==s?0:1)+","+n}""!==r&&" "!==r&&"&family=:ital,wght@0,400"!==r&&(o+=r)}}if(""!==o&&" "!==o){o=(o=(SR7.E.fontBaseUrl??"https://fonts.googleapis.com/css2")+"?"+o+"&display=swap").replace("?family=?family=","?family=");var l=document.createElement("link");l.rel="stylesheet",l.href=o,l.onload=function(t,e){for(i in _tpt.R.fonts.required)if(_tpt.hop(_tpt.R.fonts.required,i))for(s of["normal","italic"])for(n in _tpt.R.fonts.required[i][s])_tpt.hop(_tpt.R.fonts.required[i][s],n)&&_tpt.R.fonts.required[i][s][n]===t&&(_tpt.R.fonts.required[i][s][n]=2);"function"==typeof e&&e()}(a,t),l.onerror=function(){_tpt.skipFontTrys=!0},document.getElementsByTagName("head")[0].appendChild(l)}else 0===u.length&&"function"==typeof t&&t();if(u.length>0)for(let t in u)(u[t].url?.url??"").endsWith(".css")?_tpt.loadCSS(u[t].url.url,u[t].font,!0):(_tpt.R[u[t].font]??={},_tpt.loadFontFace(u[t].url.url,u[t].font))}},_tpt.compareURL=function(t,e){return!(!t||!e)&&(t==e||(t=_tpt.urlProtocol(t),e=_tpt.urlProtocol(e),(t=_tpt.normalizeUrl(t))==(e=_tpt.normalizeUrl(e))))},_tpt.registerImage=function(t,e=0,r,n,i,s=!0){if(t){t=_tpt.urlProtocol(t),_tpt.R.images??={busy:!1,queue:{},all:Array(5e3),alllen:0,nextId:0,indexMap:{}};var o=_tpt.normalizeNURL(_tpt.normalizeUrl(t)),a=_tpt.findIndex(_tpt.R.images.all,"nurl",o);if(a=-1==a?_tpt.R.images.alllen++:a,!_tpt.R.images.all[a]){const e=_tpt.R.images.nextId++;_tpt.R.images.all[a]={id:e,url:t,nurl:o,nurlshort:o.split("?")[0],crossOrigin:s,callBacks:{},state:"pending",params:i},_tpt.R.images.indexMap[e]=a}"loaded"===_tpt.R.images.all[a].state||"cached"===_tpt.R.images.all[a].state?"function"==typeof r&&r(_tpt.R.images.all[a]):(_tpt.R.images.all[a].prio=e,_tpt.R.images.all[a].callBacks[n]=r),_tpt.updateImageQueue()}},_tpt.updateImageQueue=function(){if(_tpt.R.images.busy)return void setTimeout(_tpt.updateImageQueue,5);_tpt.R.images.busy=!0,_tpt.R.images.all.sort(((t,e)=>t.prio-e.prio)),_tpt.R.images.all.forEach(((t,e)=>{t&&(_tpt.R.images.indexMap[t.id]=e)}));let t=0;for(let e=0;e<5;e++)if(void 0===_tpt.R.images.queue[e])for(let r=t;r<_tpt.R.images.alllen;r++)if("pending"===_tpt.R.images.all[r].state){_tpt.R.images.queue[e]=_tpt.R.images.all[r].id,_tpt.R.images.all[r].state="inqueue",t=r;break}_tpt.processImageQueue(),_tpt.R.images.busy=!1},_tpt.processImageCallbacks=function(t,e){for(var r in _tpt.R.images.all[t].callBacks)_tpt.hop(_tpt.R.images.all[t].callBacks,r)&&"function"==typeof _tpt.R.images.all[t].callBacks[r]&&_tpt.R.images.all[t].callBacks[r](_tpt.R.images.all[t]);_tpt.R.images.queue[e]=void 0,_tpt.updateImageQueue()},_tpt.processImageQueue=function(){for(let t=0;t<5;t++)if(void 0!==_tpt.R.images.queue[t]){let e=_tpt.R.images.indexMap[_tpt.R.images.queue[t]];"inqueue"===_tpt.R.images.all[e].state&&(_tpt.R.images.all[e].state="loading",this.tryLoadImage(_tpt.R.images.all[e].id,t))}},_tpt.normalizeUrl=function(t){return"/"==(t=t.toLowerCase())[t.length-1]&&(t=t.slice(0,-1)),"http://"==t.slice(0,7)?t=t.slice(7):"https://"==t.slice(0,8)&&(t=t.slice(8)),t},_tpt.normalizeNURL=t=>_tpt.normalizeUrl(t).replaceAll("%20"," ").replaceAll("%E2%80%AF"," ").replaceAll("%e2%80%af"," ").replaceAll(" ","%20").replaceAll(/\s/g,"%20"),_tpt.findRequestedImage=function(t){let e=_tpt.normalizeNURL(_tpt.normalizeUrl(t)),r=_tpt.findIndex(_tpt.R.images.all,"nurl",e);if(-1!==r)return r;if(r=_tpt.findIndex(_tpt.R.images.all,"nurlshort",e.split("?")[0]),-1!==r)return r;if(r=_tpt.findIndex(_tpt.R.images.all,"nurl",e.replace(window.location.hostname,"")),-1!==r)return r;if(r=_tpt.findIndex(_tpt.R.images.all,"nurl",decodeURIComponent(e)),-1!==r)return r;let n=_tpt.normalizeUrl(function(){let t=window.location.href;return t.substring(0,t.lastIndexOf("/"))+"/"}())+"/";if(e=e.replace(n,""),r=_tpt.findIndex(_tpt.R.images.all,"nurl",e),-1!==r)return r;let i=decodeURIComponent(e);return r=_tpt.findIndex(_tpt.R.images.all,"nurl",i),-1!==r?r:(r=_tpt.findIndex(_tpt.R.images.all,"nurl",_tpt.normalizeNURL(i)),-1!==r?r:(e="./"+e,_tpt.findIndex(_tpt.R.images.all,"nurl",e)))},_tpt.tryLoadImage=function(t,e,r=!1){let n=_tpt.R.images.indexMap[t],i=_tpt.R.images.all[n],s=r?!i.crossOrigin:i.crossOrigin;_tpt.loadSingleImage(i.url,e,s).then((t=>{let r=_tpt.R.images.indexMap[i.id];_tpt.R.images.all[r].state=t.status,_tpt.R.images.all[r].image=t.image,_tpt.R.images.all[r].width=t.image.width,_tpt.R.images.all[r].height=t.image.height,_tpt.processImageCallbacks(r,e)})).catch((n=>{if(r){const r=_tpt.R.images.indexMap[t];_tpt.R.images.all[r].state=n.status,_tpt.processImageCallbacks(r,e),console.log("Image Error: "+_tpt.R.images.all[r].url+" could not be loaded")}else this.tryLoadImage(t,e,!0)}))},_tpt.allM=function(){var t="";for(var e in window.SR7.M)_tpt.hop(window.SR7.M,e)&&(t+=e+",");return t.slice(0,-1)},_tpt.getMSize=function(t){return delete window.SR7.M[t].c,console.log("Reference C has been deleted for Messuring. Reload Page after !!"),_tpt.getObjectSize(window.SR7.M[t])+"kb"},_tpt.getObjectSize=function(t){return(new TextEncoder).encode("string"==typeof t?t:JSON.stringify(t)).length/1024},_tpt.loadSingleImage=async function(t,e,r=!0){let n=e;return new Promise(((e,i)=>{let s=new Image;r&&(s.crossOrigin="anonymous"),s.src=t,s.onload=()=>{e({image:s,queueIndex:n,status:"loaded"})},s.onerror=()=>{i({url:t,queueIndex:n,status:"error"})},s.complete&&e({image:s,queueIndex:n,status:"cached"})}))},_tpt.isImageURL=t=>{if("string"!=typeof t)return!1;const e=t.split(".").pop().toLowerCase();return["jpg","jpeg","png","gif","bmp","svg","webp"].includes(e)},_tpt.getShader=function(t,e,r){return new Promise((async(n,i)=>{if(_tpt.R.shaders??={},_tpt.R.shaders[t]??={},_tpt.R.shaders[t][e])n(_tpt.R.shaders[t][e]);else try{let s=await fetch(r);if(!s.ok)return void i(`HTTP error! Status: ${s.status}`);let o=await s.text();_tpt.R.shaders[t][e]=o,n(o)}catch(t){i(t)}}))},_tpt.injectCssJs=(t="",e="",r,n)=>{if(""!==t){let e,r=!1;void 0!==n&&(e=document.getElementById(n),r=null!=e),r||(e=document.createElement("style"),e.classList.add("sr7-inline-css"),void 0!==n&&(e.id=n)),e.innerHTML=(e.innerHTML??"")+t,r||document.getElementsByTagName("head")[0].appendChild(e)}if(""!==e){const t=document.createElement("script");t.innerHTML=e,r.appendChild(t)}},_tpt.extndArray=(t,e)=>(t||(t=[]),e||(e=[]),Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]),Array.from(new Set(t.concat(e)))),_tpt.extndArrWithObj=(t=[],e={},r="src",n="")=>{let i;return t.forEach((t=>{let s=Object.keys(t).filter((t=>t!==r&&t!==n)),o=Object.keys(e).filter((t=>t!==r&&t!==n));if(s.length===o.length){if(s.every((r=>t[r]===e[r]))){let s=_tpt.compareParameters(t[r],e[r]),o=""==n||_tpt.compareParameters(t[n],e[n]);!s&&o?(t[r]=_tpt.extndArray(e[r],t[r]),i=!0):""!==n&&s&&(t[n]=_tpt.extndArray(e[n],t[n]),i=!0)}}})),i||t.push(e),t},_tpt.tf=t=>"false"!=t&&0!=t&&("true"==t||1==t||t),_tpt.findNested=(t,e,r)=>{if(null==t)return null;if(e in t&&(!r||r in t[e]))return t[e];for(let n in t)if(_tpt.hop(t,n)&&"object"==typeof t[n]){let i=_tpt.findNested(t[n],e,r);if(i)return i}return null},_tpt.closest=function(t,e){return t&&(e(t)?t:_tpt.closest(t.parentNode,e))},_tpt.closestNode=function(t,e){return _tpt.closest(t,(function(t){return t.nodeName===e}))},_tpt.closestClass=function(t,e){return _tpt.closest(t,(function(t){return(" "+t.className+" ").indexOf(" "+e+" ")>=0}))},_tpt.compareParameters=(t,e)=>{if(t===e)return!0;if(Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]),t.length!==e.length)return!1;t.sort(),e.sort();for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},_tpt.countSubStr=(t="",e="",r=!1)=>{if(0===e.length)return t.length+1;let n=0,i=0;const s=r?1:e.length;for(;i=t.indexOf(e,i),i>=0;)n++,i+=s;return n},_tpt.getRatio=t=>{if(void 0===t||1===t||"number"==typeof t)return t;if("string"==typeof t&&t.includes(":")){const[e,r]=t.split(":");return parseFloat(e)/parseFloat(r)}return 1},_tpt.compareComputedStyles=t=>{var e=t[0];for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];t.every((function(t){return t[r]===n}))||(console.log("Mismatch property:",r),t.forEach((function(t,e){console.log("Element",e,"value:",t[r])})))}},_tpt.cookie={set:(t,e,r)=>{const n=new Date;n.setTime(n.getTime()+60*r*60*1e3);const i=`expires=${n.toUTCString()}`;document.cookie=`${t}=${e};${i};path=/`},get:t=>{const e=`${t}=`,r=document.cookie.split(";").find((t=>t.trim().startsWith(e))),n=r?decodeURIComponent(r.substring(e.length+1)):"";return"true"===n||"false"!==n&&n}},_tpt.displayDeprecationWarnings=t=>{if(t&&t.warnings){console.group("Deprecation Alert: Functions listed below are deprecated and will be removed in Version 7.0.0. Please update accordingly.");for(const[e,r]of Object.entries(t.warnings))r?console.info(`"${e}" is deprecated. Use "${r}" instead.`):console.info(`"${e}" is deprecated.`);console.groupEnd()}},_tpt.viewPortObserverManager={observers:{},inViewPortObserver:new IntersectionObserver((function(t){t.forEach((t=>{t.target.observParams&&t.target.observParams.obj&&(t.target.observParams.obj.states=t.target.observParams.obj.states||{},t.target.observParams.obj.states.inViewPort=t.isIntersecting)}))}),{rootMargin:"0px"}),getObserver:function(t="-100px"){if(t=""==t?"-100px":t,t=-1*parseInt(t)+"px",this.observers[t])return this.observers[t];t=`${t} 0px ${t} 0px`;var e=new IntersectionObserver((function(t){for(var e=0;e<t.length;e++){var r=t[e];r.isIntersecting?(r.target.observParams.obj&&(r.target.observParams.obj.states??={},r.target.observParams.obj.states.boundingClientRect=r.boundingClientRect,r.target.observParams.obj.states.inViewPort=r.isIntersecting,_tpt.scrollObserver.run(r.target)),void 0!==r.target.observParams&&(void 0!==r.target.observParams.callBack&&r.target.observParams.callBack(r.target,r.intersectionRatio),void 0!==r.target.observParams.toggleCall&&r.target.observParams.toggleCall(r.target.id,r.intersectionRatio,"scroll"),r.target.observParams.runonce&&delete r.target.observParams.callBack)):r.target.observParams&&(r.target.observParams.obj.states??={},r.target.observParams.obj.states.inViewPort=!!r.target.observParams?.obj?.settings?.fixed||r.isIntersecting,r.target.observParams?.toggleCall?.(r.target.id,r.intersectionRatio,"scroll"))}}),{rootMargin:t});return this.observers[t]=e,e}},_tpt.observeModule=function(t,e="-100px"){_tpt.viewPortObserverManager.getObserver(e).observe(t)},_tpt.scrollObserver={observe:t=>{_tpt.scrollObserver.entries||(_tpt.scrollObserver.entries=[],_tpt.is_mobile?(_tpt.gsap.ticker.fps(150),_tpt.gsap.ticker.add((()=>{_tpt.scrollObserver.run()}))):document.addEventListener("scroll",(function(t){void 0===_tpt.scrollObserver.RaF&&(_tpt.scrollObserver.RaF=requestAnimationFrame((function(){_tpt.scrollObserver.run()})))}),{passive:!0})),-1==_tpt.scrollObserver.entries.indexOf(t)&&_tpt.scrollObserver.entries.push(t),_tpt.scrollObserver.run(t)},kill:t=>{_tpt.scrollObserver.entries=_tpt.scrollObserver.entries.filter((e=>e!==t))},run:(t,e)=>{if(_tpt.scrollObserver.RaF&&(_tpt.scrollObserver.RaF=cancelAnimationFrame(_tpt.scrollObserver.RaF)),window.scrollY!=_tpt.scrollObserver.y||e)if(_tpt.scrollObserver.y=window.scrollY,null==t){for(let t in _tpt.scrollObserver.entries)if(_tpt.hop(_tpt.scrollObserver.entries,t)){if(!1!==(_tpt.scrollObserver?.entries?.[t]?.observSR7Globals??!1))for(let e in _tpt.scrollObserver.entries[t].observSR7Globals)_tpt.hop(_tpt.scrollObserver.entries[t].observSR7Globals,e)&&_tpt.scrollObserver.entries[t].observSR7Globals[e].callback(_tpt.scrollObserver.entries[t].observSR7Globals[e].params);0!=(_tpt.scrollObserver?.entries?.[t]?.observParams?.obj?.states?.inViewPort??!1)&&_tpt.scrollObserver.process(_tpt.scrollObserver.entries[t])}}else if(!1!==(t?.observParams?.obj?.states?.inViewPort??!1)&&_tpt.scrollObserver.process(t),t.observSR7Globals)for(let e in t.observSR7Globals)_tpt.hop(t.observSR7Globals,e)&&t.observSR7Globals[e].callback(t.observSR7Globals[e].params)},process:t=>{const e=t.observParams.obj;let r="false"!==(""+e.settings?.mod?.use??!1)||"false"!==(""+e.settings?.sbt?.use??!1);if(null!=e.dims.module&&(e.c.moduleListeners?.scroll||r)&&(e.dims.moduleRect=t.getBoundingClientRect(),e.settings)){if(r){if(delete e.scrollProcSA,e.settings.fixed)e.scrollProc=1-Math.min(1,Math.max(0,window.scrollY/_tpt.winH));else{let t=e.dims.moduleRect.height>=_tpt.winH||e.c.module.offsetTop>e.dims.moduleRect.height/2;e.scrollProcSA=t?Math.max(-1,Math.min(1,1-(e.dims.moduleRect.top-_tpt.winH)/(_tpt.winH+e.dims.moduleRect.height)*-2)):Math.max(-1,Math.min(1,e.dims.moduleRect.top/(e.dims.moduleRect.height||e.dims.module.h))),(e.settings?.rOFV??1)&&e.dims.moduleRect.height<_tpt.winH?e.scrollProc=e.dims.moduleRect.top>=0&&e.dims.moduleRect.bottom<=_tpt.winH?0:e.dims.moduleRect.top<0?e.dims.moduleRect.top/e.dims.moduleRect.height:(e.dims.moduleRect.bottom-_tpt.winH)/e.dims.moduleRect.height:(t=!1,e.scrollProc=t?Math.max(-1,Math.min(1,1-(e.dims.moduleRect.top-_tpt.winH)/(_tpt.winH+e.dims.moduleRect.height)*-2)):Math.max(-1,Math.min(1,e.dims.moduleRect.top/(e.dims.moduleRect.height||e.dims.module.h))))}e.scrollProc=e.scrollProc||0,e.scrollProcSA??=e.scrollProc}void 0!==t.observParams.scrollCallback&&t.observParams.scrollCallback(t.id)}}},_tpt.resizeObserver={id:0,targets:{},timer:1e3,inited:!1,observe:function(t,e,r){return"function"==typeof t&&(e??=100,_tpt.resizeObserver.targets[_tpt.resizeObserver.id++]={callBack:t,delay:e,id:r},_tpt.resizeObserver.process(),_tpt.resizeObserver.id)},remove:function(t){delete _tpt.targets[t]},process:function(){1!=_tpt.resizeObserver.observed&&(_tpt.resizeObserver.observed=!0,window.addEventListener("resize",(function(){_tpt.resizeObserver.execute()})))},execute:function(){_tpt.getWinDim(!0);var t=new Date;for(var e in t-_tpt.resizeObserver.timer>=1e3&&(_tpt.resizeObserver.timer=t),_tpt.resizeObserver.targets)_tpt.hop(_tpt.resizeObserver.targets,e)&&(clearTimeout(_tpt.resizeObserver.targets[e].timer),t-_tpt.resizeObserver.timer>=_tpt.resizeObserver.targets[e].delay?_tpt.resizeObserver.targets[e].callBack(_tpt.resizeObserver.targets[e].id):function(t){_tpt.resizeObserver.targets[t].timer=setTimeout((()=>{_tpt.resizeObserver.targets[t].callBack(_tpt.resizeObserver.targets[t].id)}),_tpt.resizeObserver.targets[t].delay)}(e))}},_tpt.orientationObserver={id:0,targets:{},inited:!1,lastZoomLevel:1,checkZoomLevel:()=>{if("visualViewport"in window){return window.visualViewport.scale}return 1},observe:function(t,e,r){return!(!_tpt.is_mobile||"function"!=typeof t)&&(_tpt.orientationObserver.targets[_tpt.orientationObserver.id++]={callBack:t,delay:e,id:r},_tpt.orientationObserver.process(),_tpt.orientationObserver.id)},remove:function(t){delete _tpt.orientationObserver.targets[t]},process:function(){_tpt.orientationObserver.inited||(_tpt.orientationObserver.inited=!0,window.addEventListener("orientationchange",(function(){_tpt.orientationObserver.event="orientation",_tpt.orientationObserver.execute()})))},execute:function(){var t=new Date;for(var e in t-_tpt.resizeObserver.timer>=1e3&&(_tpt.resizeObserver.timer=t),_tpt.orientationObserver.targets)_tpt.hop(_tpt.orientationObserver.targets,e)&&(clearTimeout(_tpt.orientationObserver.targets[e].timer),t-_tpt.orientationObserver.timer>=_tpt.orientationObserver.targets[e].delay?_tpt.orientationObserver.targets[e].callBack(_tpt.orientationObserver.targets[e].id):function(t){_tpt.orientationObserver.targets[t].timer=setTimeout((()=>{_tpt.orientationObserver.targets[t].callBack(_tpt.orientationObserver.targets[t].id)}),_tpt.orientationObserver.targets[t].delay)}(e))}},_tpt.focusObserver={id:0,targets:{},timer:1e3,inited:!1,observe:function(t,e,r){return"function"==typeof t&&(e??=100,_tpt.focusObserver.targets[_tpt.focusObserver.id++]={callBack:t,delay:e,id:r},_tpt.focusObserver.process(),_tpt.focusObserver.id)},remove:function(t){delete _tpt.targets[t]},process:function(){1!=_tpt.focusObserver.observed&&(_tpt.focusObserver.observed=!0,window.addEventListener("blur",(function(){_tpt.focusObserver.execute("blur")})),window.addEventListener("focus",(function(){_tpt.focusObserver.execute("focus")})))},execute:function(t){var e=new Date;for(var r in e-_tpt.focusObserver.timer>=1e3&&(_tpt.focusObserver.timer=e),_tpt.focusObserver.targets)_tpt.hop(_tpt.focusObserver.targets,r)&&(clearTimeout(_tpt.focusObserver.targets[r].timer),e-_tpt.focusObserver.timer>=_tpt.focusObserver.targets[r].delay?_tpt.focusObserver.targets[r].callBack(t,_tpt.focusObserver.targets[r].id):function(e){_tpt.focusObserver.targets[e].timer=setTimeout((()=>{_tpt.focusObserver.targets[e].callBack(t,_tpt.focusObserver.targets[e].id)}),_tpt.focusObserver.targets[e].delay)}(r))}},_tpt.wrapObserver={targets:[],init:function(t){var e=0,r=0,n=i.bind(_tpt.wrapObserver);function i(){if(r++,requestAnimationFrame(n),!(r-e<30)){e=r;for(var i=0;i<_tpt.wrapObserver.targets.length;i++)if(_tpt.hop(_tpt.wrapObserver.targets,i)){var s=_tpt.wrapObserver.targets[i],o=s.elem.getBoundingClientRect();s.lw===o.width&&s.lh===o.height||0===o.width||(s.callback&&(s.callback.pause(),s.callback.kill(),s.callback=null),s.callback=_tpt.gsap.to({},{duration:.2,onComplete:t.bind(window,s.elem,s.id)})),s.lw=o.width,s.lh=o.height}}}i()},observe:function(t,e){if(""!==(t=t.getBoundingClientRect?t:t[0].getBoundingClientRect?t[0]:"")){var r=t.getBoundingClientRect();_tpt.wrapObserver.targets.push({elem:t,id:e,lw:r.width,lh:r.height})}}},_tpt.userInteracted=!1,_tpt.setUserInteractionFlag=()=>{_tpt.userInteracted=!0,document.removeEventListener("click",_tpt.setUserInteractionFlag),document.removeEventListener("keydown",_tpt.setUserInteractionFlag),document.removeEventListener("touchstart",_tpt.setUserInteractionFlag)},document.addEventListener("click",_tpt.setUserInteractionFlag),document.addEventListener("keydown",_tpt.setUserInteractionFlag),document.addEventListener("touchstart",_tpt.setUserInteractionFlag),_tpt.R??={},_tpt.R.tptools=_tpt.extend?_tpt.extend(_tpt.R.tptools,{status:2,version:"6.7.16"}):{status:2,version:"6.7.16"}}(),(()=>{"use strict";function t(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}
/*!
 * GSAP 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/var r,n,i,s,o,a,u,l,p,c,h,d,f,g,_,m={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},D={duration:.5,overwrite:!1,delay:0},v=1e8,y=1e-8,x=2*Math.PI,b=x/4,w=0,C=Math.sqrt,F=Math.cos,E=Math.sin,T=function(t){return"string"==typeof t},S=function(t){return"function"==typeof t},M=function(t){return"number"==typeof t},A=function(t){return void 0===t},R=function(t){return"object"==typeof t},O=function(t){return!1!==t},P=function(){return"undefined"!=typeof window},k=function(t){return S(t)||T(t)},B="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},L=Array.isArray,N=/(?:-?\.?\d|\.)+/gi,I=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,z=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,X=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,j=/[+-]=-?[.\d]+/,Y=/[^,'"\[\]\s]+/gi,q=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,G={},V={},H=function(t){return(V=xt(t,G))&&xr},$=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},U=function(t,e){return!e&&console.warn(t)},W=function(t,e){return t&&(G[t]=e)&&V&&(V[t]=e)||G},Q=function(){return 0},Z={suppressEvents:!0,isStart:!0,kill:!1},J={suppressEvents:!0,kill:!1},K={suppressEvents:!0},tt={},et=[],rt={},nt={},it={},st=30,ot=[],at="",ut=function(t){var e,r,n=t[0];if(R(n)||S(n)||(t=[t]),!(e=(n._gsap||{}).harness)){for(r=ot.length;r--&&!ot[r].targetTest(n););e=ot[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Be(t[r],e)))||t.splice(r,1);return t},lt=function(t){return t._gsap||ut(Jt(t))[0]._gsap},pt=function(t,e,r){return(r=t[e])&&S(r)?t[e]():A(r)&&t.getAttribute&&t.getAttribute(e)||r},ct=function(t,e){return(t=t.split(",")).forEach(e)||t},ht=function(t){return Math.round(1e5*t)/1e5||0},dt=function(t){return Math.round(1e7*t)/1e7||0},ft=function(t,e){var r=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+n:"-"===r?t-n:"*"===r?t*n:t/n},gt=function(t,e){for(var r=e.length,n=0;t.indexOf(e[n])<0&&++n<r;);return n<r},_t=function(){var t,e,r=et.length,n=et.slice(0);for(rt={},et.length=0,t=0;t<r;t++)(e=n[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)},mt=function(t,e,r,i){et.length&&!n&&_t(),t.render(e,r,i||n&&e<0&&(t._initted||t._startAt)),et.length&&!n&&_t()},Dt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(Y).length<2?e:T(t)?t.trim():t},vt=function(t){return t},yt=function(t,e){for(var r in e)r in t||(t[r]=e[r]);return t},xt=function(t,e){for(var r in e)t[r]=e[r];return t},bt=function t(e,r){for(var n in r)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(e[n]=R(r[n])?t(e[n]||(e[n]={}),r[n]):r[n]);return e},wt=function(t,e){var r,n={};for(r in t)r in e||(n[r]=t[r]);return n},Ct=function(t){var e,r=t.parent||s,n=t.keyframes?(e=L(t.keyframes),function(t,r){for(var n in r)n in t||"duration"===n&&e||"ease"===n||(t[n]=r[n])}):yt;if(O(t.inherit))for(;r;)n(t,r.vars.defaults),r=r.parent||r._dp;return t},Ft=function(t,e,r,n,i){void 0===r&&(r="_first"),void 0===n&&(n="_last");var s,o=t[n];if(i)for(s=e[i];o&&o[i]>s;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[n]=e,e._prev=o,e.parent=e._dp=t,e},Et=function(t,e,r,n){void 0===r&&(r="_first"),void 0===n&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:t[r]===e&&(t[r]=s),s?s._prev=i:t[n]===e&&(t[n]=i),e._next=e._prev=e.parent=null},Tt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},St=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},Mt=function(t,e,r,i){return t._startAt&&(n?t._startAt.revert(J):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},At=function t(e){return!e||e._ts&&t(e.parent)},Rt=function(t){return t._repeat?Ot(t._tTime,t=t.duration()+t._rDelay)*t:0},Ot=function(t,e){var r=Math.floor(t/=e);return t&&r===t?r-1:r},Pt=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},kt=function(t){return t._end=dt(t._start+(t._tDur/Math.abs(t._ts||t._rts||y)||0))},Bt=function(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=dt(r._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),kt(t),r._dirty||St(r,t)),t},Lt=function(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Pt(t.rawTime(),e),(!e._dur||Ut(0,e.totalDuration(),r)-e._tTime>y)&&e.render(r,!0)),St(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-1e-8}},Nt=function(t,e,r,n){return e.parent&&Tt(e),e._start=dt((M(r)?r:r||t!==s?Vt(t,r,e):t._time)+e._delay),e._end=dt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Ft(t,e,"_first","_last",t._sort?"_start":0),jt(e)||(t._recent=e),n||Lt(t,e),t._ts<0&&Bt(t,t._tTime),t},It=function(t,e){return(G.ScrollTrigger||$("scrollTrigger",e))&&G.ScrollTrigger.create(e,t)},zt=function(t,e,r,i,s){return qe(t,e,s),t._initted?!r&&t._pt&&!n&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&p!==be.frame?(et.push(t),t._lazy=[s,i],1):void 0:1},Xt=function t(e){var r=e.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||t(r))},jt=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},Yt=function(t,e,r,n){var i=t._repeat,s=dt(e)||0,o=t._tTime/t._tDur;return o&&!n&&(t._time*=s/t._dur),t._dur=s,t._tDur=i?i<0?1e10:dt(s*(i+1)+t._rDelay*i):s,o>0&&!n&&Bt(t,t._tTime=t._tDur*o),t.parent&&kt(t),r||St(t.parent,t),t},qt=function(t){return t instanceof Ne?St(t):Yt(t,t._dur)},Gt={_start:0,endTime:Q,totalDuration:Q},Vt=function t(e,r,n){var i,s,o,a=e.labels,u=e._recent||Gt,l=e.duration()>=v?u.endTime(!1):e._dur;return T(r)&&(isNaN(r)||r in a)?(s=r.charAt(0),o="%"===r.substr(-1),i=r.indexOf("="),"<"===s||">"===s?(i>=0&&(r=r.replace(/=/,"")),("<"===s?u._start:u.endTime(u._repeat>=0))+(parseFloat(r.substr(1))||0)*(o?(i<0?u:n).totalDuration()/100:1)):i<0?(r in a||(a[r]=l),a[r]):(s=parseFloat(r.charAt(i-1)+r.substr(i+1)),o&&n&&(s=s/100*(L(n)?n[0]:n).totalDuration()),i>1?t(e,r.substr(0,i-1),n)+s:l+s)):null==r?l:+r},Ht=function(t,e,r){var n,i,s=M(e[1]),o=(s?2:1)+(t<2?0:1),a=e[o];if(s&&(a.duration=e[1]),a.parent=r,t){for(n=a,i=r;i&&!("immediateRender"in n);)n=i.vars.defaults||{},i=O(i.vars.inherit)&&i.parent;a.immediateRender=O(n.immediateRender),t<2?a.runBackwards=1:a.startAt=e[o-1]}return new Ue(e[0],a,e[o+1])},$t=function(t,e){return t||0===t?e(t):e},Ut=function(t,e,r){return r<t?t:r>e?e:r},Wt=function(t,e){return T(t)&&(e=q.exec(t))?e[1]:""},Qt=[].slice,Zt=function(t,e){return t&&R(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&R(t[0]))&&!t.nodeType&&t!==o},Jt=function(t,e,r){return i&&!e&&i.selector?i.selector(t):!T(t)||r||!a&&we()?L(t)?function(t,e,r){return void 0===r&&(r=[]),t.forEach((function(t){var n;return T(t)&&!e||Zt(t,1)?(n=r).push.apply(n,Jt(t)):r.push(t)}))||r}(t,r):Zt(t)?Qt.call(t,0):t?[t]:[]:Qt.call((e||u).querySelectorAll(t),0)},Kt=function(t){return t=Jt(t)[0]||U("Invalid scope")||{},function(e){var r=t.current||t.nativeElement||t;return Jt(e,r.querySelectorAll?r:r===t?U("Invalid scope")||u.createElement("div"):t)}},te=function(t){return t.sort((function(){return.5-Math.random()}))},ee=function(t){if(S(t))return t;var e=R(t)?t:{each:t},r=Ae(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},o=n>0&&n<1,a=isNaN(n)||o,u=e.axis,l=n,p=n;return T(n)?l=p={center:.5,edges:.5,end:1}[n]||0:!o&&a&&(l=n[0],p=n[1]),function(t,o,c){var h,d,f,g,_,m,D,y,x,b=(c||e).length,w=s[b];if(!w){if(!(x="auto"===e.grid?0:(e.grid||[1,v])[1])){for(D=-v;D<(D=c[x++].getBoundingClientRect().left)&&x<b;);x<b&&x--}for(w=s[b]=[],h=a?Math.min(x,b)*l-.5:n%x,d=x===v?0:a?b*p/x-.5:n/x|0,D=0,y=v,m=0;m<b;m++)f=m%x-h,g=d-(m/x|0),w[m]=_=u?Math.abs("y"===u?g:f):C(f*f+g*g),_>D&&(D=_),_<y&&(y=_);"random"===n&&te(w),w.max=D-y,w.min=y,w.v=b=(parseFloat(e.amount)||parseFloat(e.each)*(x>b?b-1:u?"y"===u?b/x:x:Math.max(x,b/x))||0)*("edges"===n?-1:1),w.b=b<0?i-b:i,w.u=Wt(e.amount||e.each)||0,r=r&&b<0?Se(r):r}return b=(w[t]-w.min)/w.max||0,dt(w.b+(r?r(b):b)*w.v)+w.u}},re=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var n=dt(Math.round(parseFloat(r)/t)*t*e);return(n-n%1)/e+(M(r)?0:Wt(r))}},ne=function(t,e){var r,n,i=L(t);return!i&&R(t)&&(r=i=t.radius||v,t.values?(t=Jt(t.values),(n=!M(t[0]))&&(r*=r)):t=re(t.increment)),$t(e,i?S(t)?function(e){return n=t(e),Math.abs(n-e)<=r?n:e}:function(e){for(var i,s,o=parseFloat(n?e.x:e),a=parseFloat(n?e.y:0),u=v,l=0,p=t.length;p--;)(i=n?(i=t[p].x-o)*i+(s=t[p].y-a)*s:Math.abs(t[p]-o))<u&&(u=i,l=p);return l=!r||u<=r?t[l]:e,n||l===e||M(e)?l:l+Wt(e)}:re(t))},ie=function(t,e,r,n){return $t(L(t)?!e:!0===r?!!(r=0):!n,(function(){return L(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(n=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*n)/n}))},se=function(t,e,r){return $t(r,(function(r){return t[~~e(r)]}))},oe=function(t){for(var e,r,n,i,s=0,o="";~(e=t.indexOf("random(",s));)n=t.indexOf(")",e),i="["===t.charAt(e+7),r=t.substr(e+7,n-e-7).match(i?Y:N),o+=t.substr(s,e-s)+ie(i?r:+r[0],i?0:+r[1],+r[2]||1e-5),s=n+1;return o+t.substr(s,t.length-s)},ae=function(t,e,r,n,i){var s=e-t,o=n-r;return $t(i,(function(e){return r+((e-t)/s*o||0)}))},ue=function(t,e,r){var n,i,s,o=t.labels,a=v;for(n in o)(i=o[n]-e)<0==!!r&&i&&a>(i=Math.abs(i))&&(s=n,a=i);return s},le=function(t,e,r){var n,s,o,a=t.vars,u=a[e],l=i,p=t._ctx;if(u)return n=a[e+"Params"],s=a.callbackScope||t,r&&et.length&&_t(),p&&(i=p),o=n?u.apply(s,n):u.call(s),i=l,o},pe=function(t){return Tt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!n),t.progress()<1&&le(t,"onInterrupt"),t},ce=[],he=function(t){if(t)if(t=!t.name&&t.default||t,P()||t.headless){var e=t.name,r=S(t),n=e&&!r&&t.init?function(){this._props=[]}:t,i={init:Q,render:nr,add:je,kill:sr,modifier:ir,rawVars:0},s={targetTest:0,get:0,getSetter:Ke,aliases:{},register:0};if(we(),t!==n){if(nt[e])return;yt(n,yt(wt(t,i),s)),xt(n.prototype,xt(i,wt(t,s))),nt[n.prop=e]=n,t.targetTest&&(ot.push(n),tt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}W(e,n),t.register&&t.register(xr,n,ur)}else ce.push(t)},de=255,fe={aqua:[0,de,de],lime:[0,de,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,de],navy:[0,0,128],white:[de,de,de],olive:[128,128,0],yellow:[de,de,0],orange:[de,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[de,0,0],pink:[de,192,203],cyan:[0,de,de],transparent:[de,de,de,0]},ge=function(t,e,r){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*de+.5|0},_e=function(t,e,r){var n,i,s,o,a,u,l,p,c,h,d=t?M(t)?[t>>16,t>>8&de,t&de]:0:fe.black;if(!d){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),fe[t])d=fe[t];else if("#"===t.charAt(0)){if(t.length<6&&(n=t.charAt(1),i=t.charAt(2),s=t.charAt(3),t="#"+n+n+i+i+s+s+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(d=parseInt(t.substr(1,6),16))>>16,d>>8&de,d&de,parseInt(t.substr(7),16)/255];d=[(t=parseInt(t.substr(1),16))>>16,t>>8&de,t&de]}else if("hsl"===t.substr(0,3))if(d=h=t.match(N),e){if(~t.indexOf("="))return d=t.match(I),r&&d.length<4&&(d[3]=1),d}else o=+d[0]%360/360,a=+d[1]/100,n=2*(u=+d[2]/100)-(i=u<=.5?u*(a+1):u+a-u*a),d.length>3&&(d[3]*=1),d[0]=ge(o+1/3,n,i),d[1]=ge(o,n,i),d[2]=ge(o-1/3,n,i);else d=t.match(N)||fe.transparent;d=d.map(Number)}return e&&!h&&(n=d[0]/de,i=d[1]/de,s=d[2]/de,u=((l=Math.max(n,i,s))+(p=Math.min(n,i,s)))/2,l===p?o=a=0:(c=l-p,a=u>.5?c/(2-l-p):c/(l+p),o=l===n?(i-s)/c+(i<s?6:0):l===i?(s-n)/c+2:(n-i)/c+4,o*=60),d[0]=~~(o+.5),d[1]=~~(100*a+.5),d[2]=~~(100*u+.5)),r&&d.length<4&&(d[3]=1),d},me=function(t){var e=[],r=[],n=-1;return t.split(ve).forEach((function(t){var i=t.match(z)||[];e.push.apply(e,i),r.push(n+=i.length+1)})),e.c=r,e},De=function(t,e,r){var n,i,s,o,a="",u=(t+a).match(ve),l=e?"hsla(":"rgba(",p=0;if(!u)return t;if(u=u.map((function(t){return(t=_e(t,e,1))&&l+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"})),r&&(s=me(t),(n=r.c).join(a)!==s.c.join(a)))for(o=(i=t.replace(ve,"1").split(z)).length-1;p<o;p++)a+=i[p]+(~n.indexOf(p)?u.shift()||l+"0,0,0,0)":(s.length?s:u.length?u:r).shift());if(!i)for(o=(i=t.split(ve)).length-1;p<o;p++)a+=i[p]+u[p];return a+i[o]},ve=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in fe)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),ye=/hsl[a]?\(/,xe=function(t){var e,r=t.join(" ");if(ve.lastIndex=0,ve.test(r))return e=ye.test(r),t[1]=De(t[1],e),t[0]=De(t[0],e,me(t[1])),!0},be=function(){var t,e,r,n,i,s,p=Date.now,c=500,d=33,f=p(),g=f,_=1e3/240,m=_,D=[],v=function r(o){var a,u,l,h,v=p()-g,y=!0===o;if((v>c||v<0)&&(f+=v-d),((a=(l=(g+=v)-f)-m)>0||y)&&(h=++n.frame,i=l-1e3*n.time,n.time=l/=1e3,m+=a+(a>=_?4:_-a),u=1),y||(t=e(r)),u)for(s=0;s<D.length;s++)D[s](l,i,h,o)};return n={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(t){return i/(1e3/(t||60))},wake:function(){l&&(!a&&P()&&(o=a=window,u=o.document||{},G.gsap=xr,(o.gsapVersions||(o.gsapVersions=[])).push(xr.version),H(V||o.GreenSockGlobals||!o.gsap&&o||{}),ce.forEach(he)),r="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,t&&n.sleep(),e=r||function(t){return setTimeout(t,m-1e3*n.time+1|0)},h=1,v(2))},sleep:function(){(r?cancelAnimationFrame:clearTimeout)(t),h=0,e=Q},lagSmoothing:function(t,e){c=t||1/0,d=Math.min(e||33,c)},fps:function(t){_=1e3/(t||240),m=1e3*n.time+_},add:function(t,e,r){var i=e?function(e,r,s,o){t(e,r,s,o),n.remove(i)}:t;return n.remove(t),D[r?"unshift":"push"](i),we(),i},remove:function(t,e){~(e=D.indexOf(t))&&D.splice(e,1)&&s>=e&&s--},_listeners:D}}(),we=function(){return!h&&be.wake()},Ce={},Fe=/^[\d.\-M][\d.\-,\s]/,Ee=/["']/g,Te=function(t){for(var e,r,n,i={},s=t.substr(1,t.length-3).split(":"),o=s[0],a=1,u=s.length;a<u;a++)r=s[a],e=a!==u-1?r.lastIndexOf(","):r.length,n=r.substr(0,e),i[o]=isNaN(n)?n.replace(Ee,"").trim():+n,o=r.substr(e+1).trim();return i},Se=function(t){return function(e){return 1-t(1-e)}},Me=function t(e,r){for(var n,i=e._first;i;)i instanceof Ne?t(i,r):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===r||(i.timeline?t(i.timeline,r):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=r)),i=i._next},Ae=function(t,e){return t&&(S(t)?t:Ce[t]||function(t){var e,r,n,i,s=(t+"").split("("),o=Ce[s[0]];return o&&s.length>1&&o.config?o.config.apply(null,~t.indexOf("{")?[Te(s[1])]:(e=t,r=e.indexOf("(")+1,n=e.indexOf(")"),i=e.indexOf("(",r),e.substring(r,~i&&i<n?e.indexOf(")",n+1):n)).split(",").map(Dt)):Ce._CE&&Fe.test(t)?Ce._CE("",t):o}(t))||e},Re=function(t,e,r,n){void 0===r&&(r=function(t){return 1-e(1-t)}),void 0===n&&(n=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var i,s={easeIn:e,easeOut:r,easeInOut:n};return ct(t,(function(t){for(var e in Ce[t]=G[t]=s,Ce[i=t.toLowerCase()]=r,s)Ce[i+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Ce[t+"."+e]=s[e]})),s},Oe=function(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}},Pe=function t(e,r,n){var i=r>=1?r:1,s=(n||(e?.3:.45))/(r<1?r:1),o=s/x*(Math.asin(1/i)||0),a=function(t){return 1===t?1:i*Math.pow(2,-10*t)*E((t-o)*s)+1},u="out"===e?a:"in"===e?function(t){return 1-a(1-t)}:Oe(a);return s=x/s,u.config=function(r,n){return t(e,r,n)},u},ke=function t(e,r){void 0===r&&(r=1.70158);var n=function(t){return t?--t*t*((r+1)*t+r)+1:0},i="out"===e?n:"in"===e?function(t){return 1-n(1-t)}:Oe(n);return i.config=function(r){return t(e,r)},i};ct("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var r=e<5?e+1:e;Re(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},(function(t){return 1-Math.pow(1-t,r)}),(function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2}))})),Ce.Linear.easeNone=Ce.none=Ce.Linear.easeIn,Re("Elastic",Pe("in"),Pe("out"),Pe()),d=7.5625,g=1/(f=2.75),Re("Bounce",(function(t){return 1-_(1-t)}),_=function(t){return t<g?d*t*t:t<.7272727272727273?d*Math.pow(t-1.5/f,2)+.75:t<.9090909090909092?d*(t-=2.25/f)*t+.9375:d*Math.pow(t-2.625/f,2)+.984375}),Re("Expo",(function(t){return t?Math.pow(2,10*(t-1)):0})),Re("Circ",(function(t){return-(C(1-t*t)-1)})),Re("Sine",(function(t){return 1===t?1:1-F(t*b)})),Re("Back",ke("in"),ke("out"),ke()),Ce.SteppedEase=Ce.steps=G.SteppedEase={config:function(t,e){void 0===t&&(t=1);var r=1/t,n=t+(e?0:1),i=e?1:0;return function(t){return((n*Ut(0,.99999999,t)|0)+i)*r}}},D.ease=Ce["quad.out"],ct("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return at+=t+","+t+"Params,"}));var Be=function(t,e){this.id=w++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:pt,this.set=e?e.getSetter:Ke},Le=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Yt(this,+t.duration,1,1),this.data=t.data,i&&(this._ctx=i,i.data.push(this)),h||be.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Yt(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(we(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Bt(this,t),!r._dp||r.parent||Lt(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&Nt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===y||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),mt(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Rt(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Rt(this),e):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?Ot(this._tTime,r)+1:1},e.timeScale=function(t,e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Pt(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(Ut(-Math.abs(this._delay),this._tDur,r),!1!==e),kt(this),function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(we(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==y&&(this._tTime-=y)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Nt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(O(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Pt(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=K);var e=n;return n=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),n=e,this},e.globalTime=function(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,qt(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,qt(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(Vt(this,t),O(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,O(e))},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-y))},e.eventCallback=function(t,e,r){var n=this.vars;return arguments.length>1?(e?(n[t]=e,r&&(n[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete n[t],this):n[t]},e.then=function(t){var e=this;return new Promise((function(r){var n=S(t)?t:vt,i=function(){var t=e.then;e.then=null,S(n)&&(n=n(e))&&(n.then||n===e)&&(e.then=t),r(n),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?i():e._prom=i}))},e.kill=function(){pe(this)},t}();yt(Le.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Ne=function(r){function i(e,n){var i;return void 0===e&&(e={}),(i=r.call(this,e)||this).labels={},i.smoothChildTiming=!!e.smoothChildTiming,i.autoRemoveChildren=!!e.autoRemoveChildren,i._sort=O(e.sortChildren),s&&Nt(e.parent||s,t(i),n),e.reversed&&i.reverse(),e.paused&&i.paused(!0),e.scrollTrigger&&It(t(i),e.scrollTrigger),i}e(i,r);var o=i.prototype;return o.to=function(t,e,r){return Ht(0,arguments,this),this},o.from=function(t,e,r){return Ht(1,arguments,this),this},o.fromTo=function(t,e,r,n){return Ht(2,arguments,this),this},o.set=function(t,e,r){return e.duration=0,e.parent=this,Ct(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Ue(t,e,Vt(this,r),1),this},o.call=function(t,e,r){return Nt(this,Ue.delayedCall(0,t,e),r)},o.staggerTo=function(t,e,r,n,i,s,o){return r.duration=e,r.stagger=r.stagger||n,r.onComplete=s,r.onCompleteParams=o,r.parent=this,new Ue(t,r,Vt(this,i)),this},o.staggerFrom=function(t,e,r,n,i,s,o){return r.runBackwards=1,Ct(r).immediateRender=O(r.immediateRender),this.staggerTo(t,e,r,n,i,s,o)},o.staggerFromTo=function(t,e,r,n,i,s,o,a){return n.startAt=r,Ct(n).immediateRender=O(n.immediateRender),this.staggerTo(t,e,n,i,s,o,a)},o.render=function(t,e,r){var i,o,a,u,l,p,c,h,d,f,g,_,m=this._time,D=this._dirty?this.totalDuration():this._tDur,v=this._dur,x=t<=0?0:dt(t),b=this._zTime<0!=t<0&&(this._initted||!v);if(this!==s&&x>D&&t>=0&&(x=D),x!==this._tTime||r||b){if(m!==this._time&&v&&(x+=this._time-m,t+=this._time-m),i=x,d=this._start,p=!(h=this._ts),b&&(v||(m=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(g=this._yoyo,l=v+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*l+t,e,r);if(i=dt(x%l),x===D?(u=this._repeat,i=v):((u=~~(x/l))&&u===x/l&&(i=v,u--),i>v&&(i=v)),f=Ot(this._tTime,l),!m&&this._tTime&&f!==u&&this._tTime-f*l-this._dur<=0&&(f=u),g&&1&u&&(i=v-i,_=1),u!==f&&!this._lock){var w=g&&1&f,C=w===(g&&1&u);if(u<f&&(w=!w),m=w?0:x%v?v:x,this._lock=1,this.render(m||(_?0:dt(u*l)),e,!v)._lock=0,this._tTime=x,!e&&this.parent&&le(this,"onRepeat"),this.vars.repeatRefresh&&!_&&(this.invalidate()._lock=1),m&&m!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(v=this._dur,D=this._tDur,C&&(this._lock=2,m=w?v:-1e-4,this.render(m,!0),this.vars.repeatRefresh&&!_&&this.invalidate()),this._lock=0,!this._ts&&!p)return this;Me(this,_)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(c=function(t,e,r){var n;if(r>e)for(n=t._first;n&&n._start<=r;){if("isPause"===n.data&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=r;){if("isPause"===n.data&&n._start<e)return n;n=n._prev}}(this,dt(m),dt(i)),c&&(x-=i-(i=c._start))),this._tTime=x,this._time=i,this._act=!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,m=0),!m&&i&&!e&&!u&&(le(this,"onStart"),this._tTime!==x))return this;if(i>=m&&t>=0)for(o=this._first;o;){if(a=o._next,(o._act||i>=o._start)&&o._ts&&c!==o){if(o.parent!==this)return this.render(t,e,r);if(o.render(o._ts>0?(i-o._start)*o._ts:(o._dirty?o.totalDuration():o._tDur)+(i-o._start)*o._ts,e,r),i!==this._time||!this._ts&&!p){c=0,a&&(x+=this._zTime=-1e-8);break}}o=a}else{o=this._last;for(var F=t<0?t:i;o;){if(a=o._prev,(o._act||F<=o._end)&&o._ts&&c!==o){if(o.parent!==this)return this.render(t,e,r);if(o.render(o._ts>0?(F-o._start)*o._ts:(o._dirty?o.totalDuration():o._tDur)+(F-o._start)*o._ts,e,r||n&&(o._initted||o._startAt)),i!==this._time||!this._ts&&!p){c=0,a&&(x+=this._zTime=F?-1e-8:y);break}}o=a}}if(c&&!e&&(this.pause(),c.render(i>=m?0:-1e-8)._zTime=i>=m?1:-1,this._ts))return this._start=d,kt(this),this.render(t,e,r);this._onUpdate&&!e&&le(this,"onUpdate",!0),(x===D&&this._tTime>=this.totalDuration()||!x&&m)&&(d!==this._start&&Math.abs(h)===Math.abs(this._ts)||this._lock||((t||!v)&&(x===D&&this._ts>0||!x&&this._ts<0)&&Tt(this,1),e||t<0&&!m||!x&&!m&&D||(le(this,x===D&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(x<D&&this.timeScale()>0)&&this._prom())))}return this},o.add=function(t,e){var r=this;if(M(e)||(e=Vt(this,e,t)),!(t instanceof Le)){if(L(t))return t.forEach((function(t){return r.add(t,e)})),this;if(T(t))return this.addLabel(t,e);if(!S(t))return this;t=Ue.delayedCall(0,t)}return this!==t?Nt(this,t,e):this},o.getChildren=function(t,e,r,n){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===n&&(n=-v);for(var i=[],s=this._first;s;)s._start>=n&&(s instanceof Ue?e&&i.push(s):(r&&i.push(s),t&&i.push.apply(i,s.getChildren(!0,e,r)))),s=s._next;return i},o.getById=function(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},o.remove=function(t){return T(t)?this.removeLabel(t):S(t)?this.killTweensOf(t):(Et(this,t),t===this._recent&&(this._recent=this._last),St(this))},o.totalTime=function(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=dt(be.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),r.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},o.addLabel=function(t,e){return this.labels[t]=Vt(this,e),this},o.removeLabel=function(t){return delete this.labels[t],this},o.addPause=function(t,e,r){var n=Ue.delayedCall(0,e||Q,r);return n.data="isPause",this._hasPause=1,Nt(this,n,Vt(this,t))},o.removePause=function(t){var e=this._first;for(t=Vt(this,t);e;)e._start===t&&"isPause"===e.data&&Tt(e),e=e._next},o.killTweensOf=function(t,e,r){for(var n=this.getTweensOf(t,r),i=n.length;i--;)Ie!==n[i]&&n[i].kill(t,e);return this},o.getTweensOf=function(t,e){for(var r,n=[],i=Jt(t),s=this._first,o=M(e);s;)s instanceof Ue?gt(s._targets,i)&&(o?(!Ie||s._initted&&s._ts)&&s.globalTime(0)<=e&&s.globalTime(s.totalDuration())>e:!e||s.isActive())&&n.push(s):(r=s.getTweensOf(i,e)).length&&n.push.apply(n,r),s=s._next;return n},o.tweenTo=function(t,e){e=e||{};var r,n=this,i=Vt(n,t),s=e,o=s.startAt,a=s.onStart,u=s.onStartParams,l=s.immediateRender,p=Ue.to(n,yt({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:e.duration||Math.abs((i-(o&&"time"in o?o.time:n._time))/n.timeScale())||y,onStart:function(){if(n.pause(),!r){var t=e.duration||Math.abs((i-(o&&"time"in o?o.time:n._time))/n.timeScale());p._dur!==t&&Yt(p,t,0,1).render(p._time,!0,!0),r=1}a&&a.apply(p,u||[])}},e));return l?p.render(0):p},o.tweenFromTo=function(t,e,r){return this.tweenTo(e,yt({startAt:{time:Vt(this,t)}},r))},o.recent=function(){return this._recent},o.nextLabel=function(t){return void 0===t&&(t=this._time),ue(this,Vt(this,t))},o.previousLabel=function(t){return void 0===t&&(t=this._time),ue(this,Vt(this,t),1)},o.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+y)},o.shiftChildren=function(t,e,r){void 0===r&&(r=0);for(var n,i=this._first,s=this.labels;i;)i._start>=r&&(i._start+=t,i._end+=t),i=i._next;if(e)for(n in s)s[n]>=r&&(s[n]+=t);return St(this)},o.invalidate=function(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return r.prototype.invalidate.call(this,t)},o.clear=function(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),St(this)},o.totalDuration=function(t){var e,r,n,i=0,o=this,a=o._last,u=v;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-t:t));if(o._dirty){for(n=o.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),(r=a._start)>u&&o._sort&&a._ts&&!o._lock?(o._lock=1,Nt(o,a,r-a._delay,1)._lock=0):u=r,r<0&&a._ts&&(i-=r,(!n&&!o._dp||n&&n.smoothChildTiming)&&(o._start+=r/o._ts,o._time-=r,o._tTime-=r),o.shiftChildren(-r,!1,-1/0),u=0),a._end>i&&a._ts&&(i=a._end),a=e;Yt(o,o===s&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},i.updateRoot=function(t){if(s._ts&&(mt(s,Pt(t,s)),p=be.frame),be.frame>=st){st+=m.autoSleep||120;var e=s._first;if((!e||!e._ts)&&m.autoSleep&&be._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||be.sleep()}}},i}(Le);yt(Ne.prototype,{_lock:0,_hasPause:0,_forcing:0});var Ie,ze,Xe=function(t,e,r,n,i,s,o){var a,u,l,p,c,h,d,f,g=new ur(this._pt,t,e,0,1,rr,null,i),_=0,m=0;for(g.b=r,g.e=n,r+="",(d=~(n+="").indexOf("random("))&&(n=oe(n)),s&&(s(f=[r,n],t,e),r=f[0],n=f[1]),u=r.match(X)||[];a=X.exec(n);)p=a[0],c=n.substring(_,a.index),l?l=(l+1)%5:"rgba("===c.substr(-5)&&(l=1),p!==u[m++]&&(h=parseFloat(u[m-1])||0,g._pt={_next:g._pt,p:c||1===m?c:",",s:h,c:"="===p.charAt(1)?ft(h,p)-h:parseFloat(p)-h,m:l&&l<4?Math.round:0},_=X.lastIndex);return g.c=_<n.length?n.substring(_,n.length):"",g.fp=o,(j.test(n)||d)&&(g.e=0),this._pt=g,g},je=function(t,e,r,n,i,s,o,a,u,l){S(n)&&(n=n(i||0,t,s));var p,c=t[e],h="get"!==r?r:S(c)?u?t[e.indexOf("set")||!S(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():c,d=S(c)?u?Ze:Qe:We;if(T(n)&&(~n.indexOf("random(")&&(n=oe(n)),"="===n.charAt(1)&&((p=ft(h,n)+(Wt(h)||0))||0===p)&&(n=p)),!l||h!==n||ze)return isNaN(h*n)||""===n?(!c&&!(e in t)&&$(e,n),Xe.call(this,t,e,h,n,d,a||m.stringFilter,u)):(p=new ur(this._pt,t,e,+h||0,n-(h||0),"boolean"==typeof c?er:tr,0,d),u&&(p.fp=u),o&&p.modifier(o,this,t),this._pt=p)},Ye=function(t,e,r,n,i,s){var o,a,u,l;if(nt[t]&&!1!==(o=new nt[t]).init(i,o.rawVars?e[t]:function(t,e,r,n,i){if(S(t)&&(t=Ve(t,i,e,r,n)),!R(t)||t.style&&t.nodeType||L(t)||B(t))return T(t)?Ve(t,i,e,r,n):t;var s,o={};for(s in t)o[s]=Ve(t[s],i,e,r,n);return o}(e[t],n,i,s,r),r,n,s)&&(r._pt=a=new ur(r._pt,i,t,0,1,o.render,o,0,o.priority),r!==c))for(u=r._ptLookup[r._targets.indexOf(i)],l=o._props.length;l--;)u[o._props[l]]=a;return o},qe=function t(e,i,o){var a,u,l,p,c,h,d,f,g,_,m,x,b,w=e.vars,C=w.ease,F=w.startAt,E=w.immediateRender,T=w.lazy,S=w.onUpdate,M=w.runBackwards,A=w.yoyoEase,R=w.keyframes,P=w.autoRevert,k=e._dur,B=e._startAt,L=e._targets,N=e.parent,I=N&&"nested"===N.data?N.vars.targets:L,z="auto"===e._overwrite&&!r,X=e.timeline;if(X&&(!R||!C)&&(C="none"),e._ease=Ae(C,D.ease),e._yEase=A?Se(Ae(!0===A?C:A,D.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!X&&!!w.runBackwards,!X||R&&!w.stagger){if(x=(f=L[0]?lt(L[0]).harness:0)&&w[f.prop],a=wt(w,tt),B&&(B._zTime<0&&B.progress(1),i<0&&M&&E&&!P?B.render(-1,!0):B.revert(M&&k?J:Z),B._lazy=0),F){if(Tt(e._startAt=Ue.set(L,yt({data:"isStart",overwrite:!1,parent:N,immediateRender:!0,lazy:!B&&O(T),startAt:null,delay:0,onUpdate:S&&function(){return le(e,"onUpdate")},stagger:0},F))),e._startAt._dp=0,e._startAt._sat=e,i<0&&(n||!E&&!P)&&e._startAt.revert(J),E&&k&&i<=0&&o<=0)return void(i&&(e._zTime=i))}else if(M&&k&&!B)if(i&&(E=!1),l=yt({overwrite:!1,data:"isFromStart",lazy:E&&!B&&O(T),immediateRender:E,stagger:0,parent:N},a),x&&(l[f.prop]=x),Tt(e._startAt=Ue.set(L,l)),e._startAt._dp=0,e._startAt._sat=e,i<0&&(n?e._startAt.revert(J):e._startAt.render(-1,!0)),e._zTime=i,E){if(!i)return}else t(e._startAt,y,y);for(e._pt=e._ptCache=0,T=k&&O(T)||T&&!k,u=0;u<L.length;u++){if(d=(c=L[u])._gsap||ut(L)[u]._gsap,e._ptLookup[u]=_={},rt[d.id]&&et.length&&_t(),m=I===L?u:I.indexOf(c),f&&!1!==(g=new f).init(c,x||a,e,m,I)&&(e._pt=p=new ur(e._pt,c,g.name,0,1,g.render,g,0,g.priority),g._props.forEach((function(t){_[t]=p})),g.priority&&(h=1)),!f||x)for(l in a)nt[l]&&(g=Ye(l,a,e,m,c,I))?g.priority&&(h=1):_[l]=p=je.call(e,c,l,"get",a[l],m,I,0,w.stringFilter);e._op&&e._op[u]&&e.kill(c,e._op[u]),z&&e._pt&&(Ie=e,s.killTweensOf(c,_,e.globalTime(i)),b=!e.parent,Ie=0),e._pt&&T&&(rt[d.id]=1)}h&&ar(e),e._onInit&&e._onInit(e)}e._onUpdate=S,e._initted=(!e._op||e._pt)&&!b,R&&i<=0&&X.render(v,!0,!0)},Ge=function(t,e,r,n){var i,s,o=e.ease||n||"power1.inOut";if(L(e))s=r[t]||(r[t]=[]),e.forEach((function(t,r){return s.push({t:r/(e.length-1)*100,v:t,e:o})}));else for(i in e)s=r[i]||(r[i]=[]),"ease"===i||s.push({t:parseFloat(t),v:e[i],e:o})},Ve=function(t,e,r,n,i){return S(t)?t.call(e,r,n,i):T(t)&&~t.indexOf("random(")?oe(t):t},He=at+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",$e={};ct(He+",id,stagger,delay,duration,paused,scrollTrigger",(function(t){return $e[t]=1}));var Ue=function(i){function o(e,n,o,a){var u;"number"==typeof n&&(o.duration=n,n=o,o=null);var l,p,c,h,d,f,g,_,D=(u=i.call(this,a?n:Ct(n))||this).vars,v=D.duration,y=D.delay,x=D.immediateRender,b=D.stagger,w=D.overwrite,C=D.keyframes,F=D.defaults,E=D.scrollTrigger,T=D.yoyoEase,S=n.parent||s,A=(L(e)||B(e)?M(e[0]):"length"in n)?[e]:Jt(e);if(u._targets=A.length?ut(A):U("GSAP target "+e+" not found. https://gsap.com",!m.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=w,C||b||k(v)||k(y)){if(n=u.vars,(l=u.timeline=new Ne({data:"nested",defaults:F||{},targets:S&&"nested"===S.data?S.vars.targets:A})).kill(),l.parent=l._dp=t(u),l._start=0,b||k(v)||k(y)){if(h=A.length,g=b&&ee(b),R(b))for(d in b)~He.indexOf(d)&&(_||(_={}),_[d]=b[d]);for(p=0;p<h;p++)(c=wt(n,$e)).stagger=0,T&&(c.yoyoEase=T),_&&xt(c,_),f=A[p],c.duration=+Ve(v,t(u),p,f,A),c.delay=(+Ve(y,t(u),p,f,A)||0)-u._delay,!b&&1===h&&c.delay&&(u._delay=y=c.delay,u._start+=y,c.delay=0),l.to(f,c,g?g(p,f,A):0),l._ease=Ce.none;l.duration()?v=y=0:u.timeline=0}else if(C){Ct(yt(l.vars.defaults,{ease:"none"})),l._ease=Ae(C.ease||n.ease||"none");var P,N,I,z=0;if(L(C))C.forEach((function(t){return l.to(A,t,">")})),l.duration();else{for(d in c={},C)"ease"===d||"easeEach"===d||Ge(d,C[d],c,C.easeEach);for(d in c)for(P=c[d].sort((function(t,e){return t.t-e.t})),z=0,p=0;p<P.length;p++)(I={ease:(N=P[p]).e,duration:(N.t-(p?P[p-1].t:0))/100*v})[d]=N.v,l.to(A,I,z),z+=I.duration;l.duration()<v&&l.to({},{duration:v-l.duration()})}}v||u.duration(v=l.duration())}else u.timeline=0;return!0!==w||r||(Ie=t(u),s.killTweensOf(A),Ie=0),Nt(S,t(u),o),n.reversed&&u.reverse(),n.paused&&u.paused(!0),(x||!v&&!C&&u._start===dt(S._time)&&O(x)&&At(t(u))&&"nested"!==S.data)&&(u._tTime=-1e-8,u.render(Math.max(0,-y)||0)),E&&It(t(u),E),u}e(o,i);var a=o.prototype;return a.render=function(t,e,r){var i,s,o,a,u,l,p,c,h,d=this._time,f=this._tDur,g=this._dur,_=t<0,m=t>f-y&&!_?f:t<y?0:t;if(g){if(m!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==_){if(i=m,c=this.timeline,this._repeat){if(a=g+this._rDelay,this._repeat<-1&&_)return this.totalTime(100*a+t,e,r);if(i=dt(m%a),m===f?(o=this._repeat,i=g):((o=~~(m/a))&&o===dt(m/a)&&(i=g,o--),i>g&&(i=g)),(l=this._yoyo&&1&o)&&(h=this._yEase,i=g-i),u=Ot(this._tTime,a),i===d&&!r&&this._initted&&o===u)return this._tTime=m,this;o!==u&&(c&&this._yEase&&Me(c,l),this.vars.repeatRefresh&&!l&&!this._lock&&this._time!==a&&this._initted&&(this._lock=r=1,this.render(dt(a*o),!0).invalidate()._lock=0))}if(!this._initted){if(zt(this,_?t:i,r,e,m))return this._tTime=0,this;if(!(d===this._time||r&&this.vars.repeatRefresh&&o!==u))return this;if(g!==this._dur)return this.render(t,e,r)}if(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=p=(h||this._ease)(i/g),this._from&&(this.ratio=p=1-p),i&&!d&&!e&&!o&&(le(this,"onStart"),this._tTime!==m))return this;for(s=this._pt;s;)s.r(p,s.d),s=s._next;c&&c.render(t<0?t:c._dur*c._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(_&&Mt(this,t,0,r),le(this,"onUpdate")),this._repeat&&o!==u&&this.vars.onRepeat&&!e&&this.parent&&le(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(_&&!this._onUpdate&&Mt(this,t,0,!0),(t||!g)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&Tt(this,1),e||_&&!d||!(m||d||l)||(le(this,m===f?"onComplete":"onReverseComplete",!0),this._prom&&!(m<f&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,r,i){var s,o,a,u=t.ratio,l=e<0||!e&&(!t._start&&Xt(t)&&(t._initted||!jt(t))||(t._ts<0||t._dp._ts<0)&&!jt(t))?0:1,p=t._rDelay,c=0;if(p&&t._repeat&&(c=Ut(0,t._tDur,e),o=Ot(c,p),t._yoyo&&1&o&&(l=1-l),o!==Ot(t._tTime,p)&&(u=1-l,t.vars.repeatRefresh&&t._initted&&t.invalidate())),l!==u||n||i||t._zTime===y||!e&&t._zTime){if(!t._initted&&zt(t,e,i,r,c))return;for(a=t._zTime,t._zTime=e||(r?y:0),r||(r=e&&!a),t.ratio=l,t._from&&(l=1-l),t._time=0,t._tTime=c,s=t._pt;s;)s.r(l,s.d),s=s._next;e<0&&Mt(t,e,0,!0),t._onUpdate&&!r&&le(t,"onUpdate"),c&&t._repeat&&!r&&t.parent&&le(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===l&&(l&&Tt(t,1),r||n||(le(t,l?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},a.targets=function(){return this._targets},a.invalidate=function(t){return(!t||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),i.prototype.invalidate.call(this,t)},a.resetTo=function(t,e,r,n,i){h||be.wake(),this._ts||this.play();var s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||qe(this,s),function(t,e,r,n,i,s,o,a){var u,l,p,c,h=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!h)for(h=t._ptCache[e]=[],p=t._ptLookup,c=t._targets.length;c--;){if((u=p[c][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return ze=1,t.vars[e]="+=0",qe(t,o),ze=0,a?U(e+" not eligible for reset"):1;h.push(u)}for(c=h.length;c--;)(u=(l=h[c])._pt||l).s=!n&&0!==n||i?u.s+(n||0)+s*u.c:n,u.c=r-u.s,l.e&&(l.e=ht(r)+Wt(l.e)),l.b&&(l.b=u.s+Wt(l.b))}(this,t,e,r,n,this._ease(s/this._dur),s,i)?this.resetTo(t,e,r,n,1):(Bt(this,0),this.parent||Ft(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},a.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?pe(this):this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Ie&&!0!==Ie.vars.overwrite)._first||pe(this),this.parent&&r!==this.timeline.totalDuration()&&Yt(this,this._dur*this.timeline._tDur/r,0,1),this}var n,i,s,o,a,u,l,p=this._targets,c=t?Jt(t):p,h=this._ptLookup,d=this._pt;if((!e||"all"===e)&&function(t,e){for(var r=t.length,n=r===e.length;n&&r--&&t[r]===e[r];);return r<0}(p,c))return"all"===e&&(this._pt=0),pe(this);for(n=this._op=this._op||[],"all"!==e&&(T(e)&&(a={},ct(e,(function(t){return a[t]=1})),e=a),e=function(t,e){var r,n,i,s,o=t[0]?lt(t[0]).harness:0,a=o&&o.aliases;if(!a)return e;for(n in r=xt({},e),a)if(n in r)for(i=(s=a[n].split(",")).length;i--;)r[s[i]]=r[n];return r}(p,e)),l=p.length;l--;)if(~c.indexOf(p[l]))for(a in i=h[l],"all"===e?(n[l]=e,o=i,s={}):(s=n[l]=n[l]||{},o=e),o)(u=i&&i[a])&&("kill"in u.d&&!0!==u.d.kill(a)||Et(this,u,"_pt"),delete i[a]),"all"!==s&&(s[a]=1);return this._initted&&!this._pt&&d&&pe(this),this},o.to=function(t,e){return new o(t,e,arguments[2])},o.from=function(t,e){return Ht(1,arguments)},o.delayedCall=function(t,e,r,n){return new o(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:n})},o.fromTo=function(t,e,r){return Ht(2,arguments)},o.set=function(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new o(t,e)},o.killTweensOf=function(t,e,r){return s.killTweensOf(t,e,r)},o}(Le);yt(Ue.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ct("staggerTo,staggerFrom,staggerFromTo",(function(t){Ue[t]=function(){var e=new Ne,r=Qt.call(arguments,0);return r.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,r)}}));var We=function(t,e,r){return t[e]=r},Qe=function(t,e,r){return t[e](r)},Ze=function(t,e,r,n){return t[e](n.fp,r)},Je=function(t,e,r){return t.setAttribute(e,r)},Ke=function(t,e){return S(t[e])?Qe:A(t[e])&&t.setAttribute?Je:We},tr=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},er=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},rr=function(t,e){var r=e._pt,n="";if(!t&&e.b)n=e.b;else if(1===t&&e.e)n=e.e;else{for(;r;)n=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+n,r=r._next;n+=e.c}e.set(e.t,e.p,n,e)},nr=function(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},ir=function(t,e,r,n){for(var i,s=this._pt;s;)i=s._next,s.p===n&&s.modifier(t,e,r),s=i},sr=function(t){for(var e,r,n=this._pt;n;)r=n._next,n.p===t&&!n.op||n.op===t?Et(this,n,"_pt"):n.dep||(e=1),n=r;return!e},or=function(t,e,r,n){n.mSet(t,e,n.m.call(n.tween,r,n.mt),n)},ar=function(t){for(var e,r,n,i,s=t._pt;s;){for(e=s._next,r=n;r&&r.pr>s.pr;)r=r._next;(s._prev=r?r._prev:i)?s._prev._next=s:n=s,(s._next=r)?r._prev=s:i=s,s=e}t._pt=n},ur=function(){function t(t,e,r,n,i,s,o,a,u){this.t=e,this.s=n,this.c=i,this.p=r,this.r=s||tr,this.d=o||this,this.set=a||We,this.pr=u||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,r){this.mSet=this.mSet||this.set,this.set=or,this.m=t,this.mt=r,this.tween=e},t}();ct(at+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return tt[t]=1})),G.TweenMax=G.TweenLite=Ue,G.TimelineLite=G.TimelineMax=Ne,s=new Ne({sortChildren:!1,defaults:D,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),m.stringFilter=xe;var lr=[],pr={},cr=[],hr=0,dr=0,fr=function(t){return(pr[t]||cr).map((function(t){return t()}))},gr=function(){var t=Date.now(),e=[];t-hr>2&&(fr("matchMediaInit"),lr.forEach((function(t){var r,n,i,s,a=t.queries,u=t.conditions;for(n in a)(r=o.matchMedia(a[n]).matches)&&(i=1),r!==u[n]&&(u[n]=r,s=1);s&&(t.revert(),i&&e.push(t))})),fr("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t,(function(e){return t.add(null,e)}))})),hr=t,fr("matchMedia"))},_r=function(){function t(t,e){this.selector=e&&Kt(e),this.data=[],this._r=[],this.isReverted=!1,this.id=dr++,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,r){S(t)&&(r=e,e=t,t=S);var n=this,s=function(){var t,s=i,o=n.selector;return s&&s!==n&&s.data.push(n),r&&(n.selector=Kt(r)),i=n,t=e.apply(n,arguments),S(t)&&n._r.push(t),i=s,n.selector=o,n.isReverted=!1,t};return n.last=s,t===S?s(n,(function(t){return n.add(null,t)})):t?n[t]=s:s},e.ignore=function(t){var e=i;i=null,t(this),i=e},e.getTweens=function(){var e=[];return this.data.forEach((function(r){return r instanceof t?e.push.apply(e,r.getTweens()):r instanceof Ue&&!(r.parent&&"nested"===r.parent.data)&&e.push(r)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var r=this;if(t?function(){for(var e,n=r.getTweens(),i=r.data.length;i--;)"isFlip"===(e=r.data[i]).data&&(e.revert(),e.getChildren(!0,!0,!1).forEach((function(t){return n.splice(n.indexOf(t),1)})));for(n.map((function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t:t}})).sort((function(t,e){return e.g-t.g||-1/0})).forEach((function(e){return e.t.revert(t)})),i=r.data.length;i--;)(e=r.data[i])instanceof Ne?"nested"!==e.data&&(e.scrollTrigger&&e.scrollTrigger.revert(),e.kill()):!(e instanceof Ue)&&e.revert&&e.revert(t);r._r.forEach((function(e){return e(t,r)})),r.isReverted=!0}():this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e)for(var n=lr.length;n--;)lr[n].id===this.id&&lr.splice(n,1)},e.revert=function(t){this.kill(t||{})},t}(),mr=function(){function t(t){this.contexts=[],this.scope=t,i&&i.data.push(this)}var e=t.prototype;return e.add=function(t,e,r){R(t)||(t={matches:t});var n,s,a,u=new _r(0,r||this.scope),l=u.conditions={};for(s in i&&!u.selector&&(u.selector=i.selector),this.contexts.push(u),e=u.add("onMatch",e),u.queries=t,t)"all"===s?a=1:(n=o.matchMedia(t[s]))&&(lr.indexOf(u)<0&&lr.push(u),(l[s]=n.matches)&&(a=1),n.addListener?n.addListener(gr):n.addEventListener("change",gr));return a&&e(u,(function(t){return u.add(null,t)})),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Dr={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach((function(t){return he(t)}))},timeline:function(t){return new Ne(t)},getTweensOf:function(t,e){return s.getTweensOf(t,e)},getProperty:function(t,e,r,n){T(t)&&(t=Jt(t)[0]);var i=lt(t||{}).get,s=r?vt:Dt;return"native"===r&&(r=""),t?e?s((nt[e]&&nt[e].get||i)(t,e,r,n)):function(e,r,n){return s((nt[e]&&nt[e].get||i)(t,e,r,n))}:t},quickSetter:function(t,e,r){if((t=Jt(t)).length>1){var n=t.map((function(t){return xr.quickSetter(t,e,r)})),i=n.length;return function(t){for(var e=i;e--;)n[e](t)}}t=t[0]||{};var s=nt[e],o=lt(t),a=o.harness&&(o.harness.aliases||{})[e]||e,u=s?function(e){var n=new s;c._pt=0,n.init(t,r?e+r:e,c,0,[t]),n.render(1,n),c._pt&&nr(1,c)}:o.set(t,a);return s?u:function(e){return u(t,a,r?e+r:e,o,1)}},quickTo:function(t,e,r){var n,i=xr.to(t,xt(((n={})[e]="+=0.1",n.paused=!0,n),r||{})),s=function(t,r,n){return i.resetTo(e,t,r,n)};return s.tween=i,s},isTweening:function(t){return s.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Ae(t.ease,D.ease)),bt(D,t||{})},config:function(t){return bt(m,t||{})},registerEffect:function(t){var e=t.name,r=t.effect,n=t.plugins,i=t.defaults,s=t.extendTimeline;(n||"").split(",").forEach((function(t){return t&&!nt[t]&&!G[t]&&U(e+" effect requires "+t+" plugin.")})),it[e]=function(t,e,n){return r(Jt(t),yt(e||{},i),n)},s&&(Ne.prototype[e]=function(t,r,n){return this.add(it[e](t,R(r)?r:(n=r)&&{},this),n)})},registerEase:function(t,e){Ce[t]=Ae(e)},parseEase:function(t,e){return arguments.length?Ae(t,e):Ce},getById:function(t){return s.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var r,n,i=new Ne(t);for(i.smoothChildTiming=O(t.smoothChildTiming),s.remove(i),i._dp=0,i._time=i._tTime=s._time,r=s._first;r;)n=r._next,!e&&!r._dur&&r instanceof Ue&&r.vars.onComplete===r._targets[0]||Nt(i,r,r._start-r._delay),r=n;return Nt(s,i,0),i},context:function(t,e){return t?new _r(t,e):i},matchMedia:function(t){return new mr(t)},matchMediaRefresh:function(){return lr.forEach((function(t){var e,r,n=t.conditions;for(r in n)n[r]&&(n[r]=!1,e=1);e&&t.revert()}))||gr()},addEventListener:function(t,e){var r=pr[t]||(pr[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function(t,e){var r=pr[t],n=r&&r.indexOf(e);n>=0&&r.splice(n,1)},utils:{wrap:function t(e,r,n){var i=r-e;return L(e)?se(e,t(0,e.length),r):$t(n,(function(t){return(i+(t-e)%i)%i+e}))},wrapYoyo:function t(e,r,n){var i=r-e,s=2*i;return L(e)?se(e,t(0,e.length-1),r):$t(n,(function(t){return e+((t=(s+(t-e)%s)%s||0)>i?s-t:t)}))},distribute:ee,random:ie,snap:ne,normalize:function(t,e,r){return ae(t,e,0,1,r)},getUnit:Wt,clamp:function(t,e,r){return $t(r,(function(r){return Ut(t,e,r)}))},splitColor:_e,toArray:Jt,selector:Kt,mapRange:ae,pipe:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(r){return t(parseFloat(r))+(e||Wt(r))}},interpolate:function t(e,r,n,i){var s=isNaN(e+r)?0:function(t){return(1-t)*e+t*r};if(!s){var o,a,u,l,p,c=T(e),h={};if(!0===n&&(i=1)&&(n=null),c)e={p:e},r={p:r};else if(L(e)&&!L(r)){for(u=[],l=e.length,p=l-2,a=1;a<l;a++)u.push(t(e[a-1],e[a]));l--,s=function(t){t*=l;var e=Math.min(p,~~t);return u[e](t-e)},n=r}else i||(e=xt(L(e)?[]:{},e));if(!u){for(o in r)je.call(h,e,o,"get",r[o]);s=function(t){return nr(t,h)||(c?e.p:e)}}}return $t(n,s)},shuffle:te},install:H,effects:it,ticker:be,updateRoot:Ne.updateRoot,plugins:nt,globalTimeline:s,core:{PropTween:ur,globals:W,Tween:Ue,Timeline:Ne,Animation:Le,getCache:lt,_removeLinkedListItem:Et,reverting:function(){return n},context:function(t){return t&&i&&(i.data.push(t),t._ctx=i),i},suppressOverwrites:function(t){return r=t}}};ct("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return Dr[t]=Ue[t]})),be.add(Ne.updateRoot),c=Dr.to({},{duration:0});var vr=function(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r},yr=function(t,e){return{name:t,rawVars:1,init:function(t,r,n){n._onInit=function(t){var n,i;if(T(r)&&(n={},ct(r,(function(t){return n[t]=1})),r=n),e){for(i in n={},r)n[i]=e(r[i]);r=n}!function(t,e){var r,n,i,s=t._targets;for(r in e)for(n=s.length;n--;)(i=t._ptLookup[n][r])&&(i=i.d)&&(i._pt&&(i=vr(i,r)),i&&i.modifier&&i.modifier(e[r],t,s[n],r))}(t,r)}}}},xr=Dr.registerPlugin({name:"attr",init:function(t,e,r,n,i){var s,o,a;for(s in this.tween=r,e)a=t.getAttribute(s)||"",(o=this.add(t,"setAttribute",(a||0)+"",e[s],n,i,0,0,s)).op=s,o.b=a,this._props.push(s)},render:function(t,e){for(var r=e._pt;r;)n?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",init:function(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},yr("roundProps",re),yr("modifiers"),yr("snap",ne))||Dr;Ue.version=Ne.version=xr.version="3.12.5",l=1,P()&&we(),Ce.Power0,Ce.Power1,Ce.Power2,Ce.Power3,Ce.Power4,Ce.Linear,Ce.Quad,Ce.Cubic,Ce.Quart,Ce.Quint,Ce.Strong,Ce.Elastic,Ce.Back,Ce.SteppedEase,Ce.Bounce,Ce.Sine,Ce.Expo,Ce.Circ;var br,wr,Cr,Fr,Er,Tr,Sr,Mr,Ar={},Rr=180/Math.PI,Or=Math.PI/180,Pr=Math.atan2,kr=/([A-Z])/g,Br=/(left|right|width|margin|padding|x)/i,Lr=/[\s,\(]\S/,Nr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Ir=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},zr=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Xr=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},jr=function(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)},Yr=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},qr=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},Gr=function(t,e,r){return t.style[e]=r},Vr=function(t,e,r){return t.style.setProperty(e,r)},Hr=function(t,e,r){return t._gsap[e]=r},$r=function(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r},Ur=function(t,e,r,n,i){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(i,s)},Wr=function(t,e,r,n,i){var s=t._gsap;s[e]=r,s.renderTransform(i,s)},Qr="transform",Zr=Qr+"Origin",Jr=function t(e,r){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Ar&&s){if(this.tfm=this.tfm||{},"transform"===e)return Nr.transform.split(",").forEach((function(e){return t.call(n,e,r)}));if(~(e=Nr[e]||e).indexOf(",")?e.split(",").forEach((function(t){return n.tfm[t]=mn(i,t)})):this.tfm[e]=o.x?o[e]:mn(i,e),e===Zr&&(this.tfm.zOrigin=o.zOrigin),this.props.indexOf(Qr)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Zr,r,"")),e=Qr}(s||r)&&this.props.push(e,r,s[e])},Kr=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},tn=function(){var t,e,r=this.props,n=this.target,i=n.style,s=n._gsap;for(t=0;t<r.length;t+=3)r[t+1]?n[r[t]]=r[t+2]:r[t+2]?i[r[t]]=r[t+2]:i.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(kr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)s[e]=this.tfm[e];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(t=Sr())&&t.isStart||i[Qr]||(Kr(i),s.zOrigin&&i[Zr]&&(i[Zr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},en=function(t,e){var r={target:t,props:[],revert:tn,save:Jr};return t._gsap||xr.core.getCache(t),e&&e.split(",").forEach((function(t){return r.save(t)})),r},rn=function(t,e){var r=wr.createElementNS?wr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):wr.createElement(t);return r&&r.style?r:wr.createElement(t)},nn=function t(e,r,n){var i=getComputedStyle(e);return i[r]||i.getPropertyValue(r.replace(kr,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&t(e,on(r)||r,1)||""},sn="O,Moz,ms,Ms,Webkit".split(","),on=function(t,e,r){var n=(e||Er).style,i=5;if(t in n&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);i--&&!(sn[i]+t in n););return i<0?null:(3===i?"ms":i>=0?sn[i]:"")+t},an=function(){"undefined"!=typeof window&&window.document&&(br=window,wr=br.document,Cr=wr.documentElement,Er=rn("div")||{style:{}},rn("div"),Qr=on(Qr),Zr=Qr+"Origin",Er.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Mr=!!on("perspective"),Sr=xr.core.reverting,Fr=1)},un=function t(e){var r,n=rn("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,s=this.nextSibling,o=this.style.cssText;if(Cr.appendChild(n),n.appendChild(this),this.style.display="block",e)try{r=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(r=this._gsapBBox());return i&&(s?i.insertBefore(this,s):i.appendChild(this)),Cr.removeChild(n),this.style.cssText=o,r},ln=function(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])},pn=function(t){var e;try{e=t.getBBox()}catch(r){e=un.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===un||(e=un.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+ln(t,["x","cx","x1"])||0,y:+ln(t,["y","cy","y1"])||0,width:0,height:0}},cn=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!pn(t))},hn=function(t,e){if(e){var r,n=t.style;e in Ar&&e!==Zr&&(e=Qr),n.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty("--"===r?e:e.replace(kr,"-$1").toLowerCase())):n.removeAttribute(e)}},dn=function(t,e,r,n,i,s){var o=new ur(t._pt,e,r,0,1,s?qr:Yr);return t._pt=o,o.b=n,o.e=i,t._props.push(r),o},fn={deg:1,rad:1,turn:1},gn={grid:1,flex:1},_n=function t(e,r,n,i){var s,o,a,u,l=parseFloat(n)||0,p=(n+"").trim().substr((l+"").length)||"px",c=Er.style,h=Br.test(r),d="svg"===e.tagName.toLowerCase(),f=(d?"client":"offset")+(h?"Width":"Height"),g=100,_="px"===i,m="%"===i;if(i===p||!l||fn[i]||fn[p])return l;if("px"!==p&&!_&&(l=t(e,r,n,"px")),u=e.getCTM&&cn(e),(m||"%"===p)&&(Ar[r]||~r.indexOf("adius")))return s=u?e.getBBox()[h?"width":"height"]:e[f],ht(m?l/s*g:l/100*s);if(c[h?"width":"height"]=g+(_?p:i),o=~r.indexOf("adius")||"em"===i&&e.appendChild&&!d?e:e.parentNode,u&&(o=(e.ownerSVGElement||{}).parentNode),o&&o!==wr&&o.appendChild||(o=wr.body),(a=o._gsap)&&m&&a.width&&h&&a.time===be.time&&!a.uncache)return ht(l/a.width*g);if(!m||"height"!==r&&"width"!==r)(m||"%"===p)&&!gn[nn(o,"display")]&&(c.position=nn(e,"position")),o===e&&(c.position="static"),o.appendChild(Er),s=Er[f],o.removeChild(Er),c.position="absolute";else{var D=e.style[r];e.style[r]=g+i,s=e[f],D?e.style[r]=D:hn(e,r)}return h&&m&&((a=lt(o)).time=be.time,a.width=o[f]),ht(_?s*l/g:s&&l?g/s*l:0)},mn=function(t,e,r,n){var i;return Fr||an(),e in Nr&&"transform"!==e&&~(e=Nr[e]).indexOf(",")&&(e=e.split(",")[0]),Ar[e]&&"transform"!==e?(i=Sn(t,n),i="transformOrigin"!==e?i[e]:i.svg?i.origin:Mn(nn(t,Zr))+" "+i.zOrigin+"px"):(!(i=t.style[e])||"auto"===i||n||~(i+"").indexOf("calc("))&&(i=xn[e]&&xn[e](t,e,r)||nn(t,e)||pt(t,e)||("opacity"===e?1:0)),r&&!~(i+"").trim().indexOf(" ")?_n(t,e,i,r)+r:i},Dn=function(t,e,r,n){if(!r||"none"===r){var i=on(e,t,1),s=i&&nn(t,i,1);s&&s!==r?(e=i,r=s):"borderColor"===e&&(r=nn(t,"borderTopColor"))}var o,a,u,l,p,c,h,d,f,g,_,D=new ur(this._pt,t.style,e,0,1,rr),v=0,y=0;if(D.b=r,D.e=n,r+="","auto"==(n+="")&&(c=t.style[e],t.style[e]=n,n=nn(t,e)||n,c?t.style[e]=c:hn(t,e)),xe(o=[r,n]),n=o[1],u=(r=o[0]).match(z)||[],(n.match(z)||[]).length){for(;a=z.exec(n);)h=a[0],f=n.substring(v,a.index),p?p=(p+1)%5:"rgba("!==f.substr(-5)&&"hsla("!==f.substr(-5)||(p=1),h!==(c=u[y++]||"")&&(l=parseFloat(c)||0,_=c.substr((l+"").length),"="===h.charAt(1)&&(h=ft(l,h)+_),d=parseFloat(h),g=h.substr((d+"").length),v=z.lastIndex-g.length,g||(g=g||m.units[e]||_,v===n.length&&(n+=g,D.e+=g)),_!==g&&(l=_n(t,e,c,g)||0),D._pt={_next:D._pt,p:f||1===y?f:",",s:l,c:d-l,m:p&&p<4||"zIndex"===e?Math.round:0});D.c=v<n.length?n.substring(v,n.length):""}else D.r="display"===e&&"none"===n?qr:Yr;return j.test(n)&&(D.e=0),this._pt=D,D},vn={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},yn=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,n,i,s=e.t,o=s.style,a=e.u,u=s._gsap;if("all"===a||!0===a)o.cssText="",n=1;else for(i=(a=a.split(",")).length;--i>-1;)r=a[i],Ar[r]&&(n=1,r="transformOrigin"===r?Zr:Qr),hn(s,r);n&&(hn(s,Qr),u&&(u.svg&&s.removeAttribute("transform"),Sn(s,1),u.uncache=1,Kr(o)))}},xn={clearProps:function(t,e,r,n,i){if("isFromStart"!==i.data){var s=t._pt=new ur(t._pt,e,r,0,0,yn);return s.u=n,s.pr=-10,s.tween=i,t._props.push(r),1}}},bn=[1,0,0,1,0,0],wn={},Cn=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Fn=function(t){var e=nn(t,Qr);return Cn(e)?bn:e.substr(7).match(I).map(ht)},En=function(t,e){var r,n,i,s,o=t._gsap||lt(t),a=t.style,u=Fn(t);return o.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?bn:u:(u!==bn||t.offsetParent||t===Cr||o.svg||(i=a.display,a.display="block",(r=t.parentNode)&&t.offsetParent||(s=1,n=t.nextElementSibling,Cr.appendChild(t)),u=Fn(t),i?a.display=i:hn(t,"display"),s&&(n?r.insertBefore(t,n):r?r.appendChild(t):Cr.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},Tn=function(t,e,r,n,i,s){var o,a,u,l=t._gsap,p=i||En(t,!0),c=l.xOrigin||0,h=l.yOrigin||0,d=l.xOffset||0,f=l.yOffset||0,g=p[0],_=p[1],m=p[2],D=p[3],v=p[4],y=p[5],x=e.split(" "),b=parseFloat(x[0])||0,w=parseFloat(x[1])||0;r?p!==bn&&(a=g*D-_*m)&&(u=b*(-_/a)+w*(g/a)-(g*y-_*v)/a,b=b*(D/a)+w*(-m/a)+(m*y-D*v)/a,w=u):(b=(o=pn(t)).x+(~x[0].indexOf("%")?b/100*o.width:b),w=o.y+(~(x[1]||x[0]).indexOf("%")?w/100*o.height:w)),n||!1!==n&&l.smooth?(v=b-c,y=w-h,l.xOffset=d+(v*g+y*m)-v,l.yOffset=f+(v*_+y*D)-y):l.xOffset=l.yOffset=0,l.xOrigin=b,l.yOrigin=w,l.smooth=!!n,l.origin=e,l.originIsAbsolute=!!r,t.style[Zr]="0px 0px",s&&(dn(s,l,"xOrigin",c,b),dn(s,l,"yOrigin",h,w),dn(s,l,"xOffset",d,l.xOffset),dn(s,l,"yOffset",f,l.yOffset)),t.setAttribute("data-svg-origin",b+" "+w)},Sn=function(t,e){var r=t._gsap||new Be(t);if("x"in r&&!e&&!r.uncache)return r;var n,i,s,o,a,u,l,p,c,h,d,f,g,_,D,v,y,x,b,w,C,F,E,T,S,M,A,R,O,P,k,B,L=t.style,N=r.scaleX<0,I="px",z="deg",X=getComputedStyle(t),j=nn(t,Zr)||"0";return n=i=s=u=l=p=c=h=d=0,o=a=1,r.svg=!(!t.getCTM||!cn(t)),X.translate&&("none"===X.translate&&"none"===X.scale&&"none"===X.rotate||(L[Qr]=("none"!==X.translate?"translate3d("+(X.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==X.rotate?"rotate("+X.rotate+") ":"")+("none"!==X.scale?"scale("+X.scale.split(" ").join(",")+") ":"")+("none"!==X[Qr]?X[Qr]:"")),L.scale=L.rotate=L.translate="none"),_=En(t,r.svg),r.svg&&(r.uncache?(S=t.getBBox(),j=r.xOrigin-S.x+"px "+(r.yOrigin-S.y)+"px",T=""):T=!e&&t.getAttribute("data-svg-origin"),Tn(t,T||j,!!T||r.originIsAbsolute,!1!==r.smooth,_)),f=r.xOrigin||0,g=r.yOrigin||0,_!==bn&&(x=_[0],b=_[1],w=_[2],C=_[3],n=F=_[4],i=E=_[5],6===_.length?(o=Math.sqrt(x*x+b*b),a=Math.sqrt(C*C+w*w),u=x||b?Pr(b,x)*Rr:0,(c=w||C?Pr(w,C)*Rr+u:0)&&(a*=Math.abs(Math.cos(c*Or))),r.svg&&(n-=f-(f*x+g*w),i-=g-(f*b+g*C))):(B=_[6],P=_[7],A=_[8],R=_[9],O=_[10],k=_[11],n=_[12],i=_[13],s=_[14],l=(D=Pr(B,O))*Rr,D&&(T=F*(v=Math.cos(-D))+A*(y=Math.sin(-D)),S=E*v+R*y,M=B*v+O*y,A=F*-y+A*v,R=E*-y+R*v,O=B*-y+O*v,k=P*-y+k*v,F=T,E=S,B=M),p=(D=Pr(-w,O))*Rr,D&&(v=Math.cos(-D),k=C*(y=Math.sin(-D))+k*v,x=T=x*v-A*y,b=S=b*v-R*y,w=M=w*v-O*y),u=(D=Pr(b,x))*Rr,D&&(T=x*(v=Math.cos(D))+b*(y=Math.sin(D)),S=F*v+E*y,b=b*v-x*y,E=E*v-F*y,x=T,F=S),l&&Math.abs(l)+Math.abs(u)>359.9&&(l=u=0,p=180-p),o=ht(Math.sqrt(x*x+b*b+w*w)),a=ht(Math.sqrt(E*E+B*B)),D=Pr(F,E),c=Math.abs(D)>2e-4?D*Rr:0,d=k?1/(k<0?-k:k):0),r.svg&&(T=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Cn(nn(t,Qr)),T&&t.setAttribute("transform",T))),Math.abs(c)>90&&Math.abs(c)<270&&(N?(o*=-1,c+=u<=0?180:-180,u+=u<=0?180:-180):(a*=-1,c+=c<=0?180:-180)),e=e||r.uncache,r.x=n-((r.xPercent=n&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-n)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+I,r.y=i-((r.yPercent=i&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+I,r.z=s+I,r.scaleX=ht(o),r.scaleY=ht(a),r.rotation=ht(u)+z,r.rotationX=ht(l)+z,r.rotationY=ht(p)+z,r.skewX=c+z,r.skewY=h+z,r.transformPerspective=d+I,(r.zOrigin=parseFloat(j.split(" ")[2])||!e&&r.zOrigin||0)&&(L[Zr]=Mn(j)),r.xOffset=r.yOffset=0,r.force3D=m.force3D,r.renderTransform=r.svg?Ln:Mr?Bn:Rn,r.uncache=0,r},Mn=function(t){return(t=t.split(" "))[0]+" "+t[1]},An=function(t,e,r){var n=Wt(e);return ht(parseFloat(e)+parseFloat(_n(t,"x",r+"px",n)))+n},Rn=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Bn(t,e)},On="0deg",Pn="0px",kn=") ",Bn=function(t,e){var r=e||this,n=r.xPercent,i=r.yPercent,s=r.x,o=r.y,a=r.z,u=r.rotation,l=r.rotationY,p=r.rotationX,c=r.skewX,h=r.skewY,d=r.scaleX,f=r.scaleY,g=r.transformPerspective,_=r.force3D,m=r.target,D=r.zOrigin,v="",y="auto"===_&&t&&1!==t||!0===_;if(D&&(p!==On||l!==On)){var x,b=parseFloat(l)*Or,w=Math.sin(b),C=Math.cos(b);b=parseFloat(p)*Or,x=Math.cos(b),s=An(m,s,w*x*-D),o=An(m,o,-Math.sin(b)*-D),a=An(m,a,C*x*-D+D)}g!==Pn&&(v+="perspective("+g+kn),(n||i)&&(v+="translate("+n+"%, "+i+"%) "),(y||s!==Pn||o!==Pn||a!==Pn)&&(v+=a!==Pn||y?"translate3d("+s+", "+o+", "+a+") ":"translate("+s+", "+o+kn),u!==On&&(v+="rotate("+u+kn),l!==On&&(v+="rotateY("+l+kn),p!==On&&(v+="rotateX("+p+kn),c===On&&h===On||(v+="skew("+c+", "+h+kn),1===d&&1===f||(v+="scale("+d+", "+f+kn),m.style[Qr]=v||"translate(0, 0)"},Ln=function(t,e){var r,n,i,s,o,a=e||this,u=a.xPercent,l=a.yPercent,p=a.x,c=a.y,h=a.rotation,d=a.skewX,f=a.skewY,g=a.scaleX,_=a.scaleY,m=a.target,D=a.xOrigin,v=a.yOrigin,y=a.xOffset,x=a.yOffset,b=a.forceCSS,w=parseFloat(p),C=parseFloat(c);h=parseFloat(h),d=parseFloat(d),(f=parseFloat(f))&&(d+=f=parseFloat(f),h+=f),h||d?(h*=Or,d*=Or,r=Math.cos(h)*g,n=Math.sin(h)*g,i=Math.sin(h-d)*-_,s=Math.cos(h-d)*_,d&&(f*=Or,o=Math.tan(d-f),i*=o=Math.sqrt(1+o*o),s*=o,f&&(o=Math.tan(f),r*=o=Math.sqrt(1+o*o),n*=o)),r=ht(r),n=ht(n),i=ht(i),s=ht(s)):(r=g,s=_,n=i=0),(w&&!~(p+"").indexOf("px")||C&&!~(c+"").indexOf("px"))&&(w=_n(m,"x",p,"px"),C=_n(m,"y",c,"px")),(D||v||y||x)&&(w=ht(w+D-(D*r+v*i)+y),C=ht(C+v-(D*n+v*s)+x)),(u||l)&&(o=m.getBBox(),w=ht(w+u/100*o.width),C=ht(C+l/100*o.height)),o="matrix("+r+","+n+","+i+","+s+","+w+","+C+")",m.setAttribute("transform",o),b&&(m.style[Qr]=o)},Nn=function(t,e,r,n,i){var s,o,a=360,u=T(i),l=parseFloat(i)*(u&&~i.indexOf("rad")?Rr:1)-n,p=n+l+"deg";return u&&("short"===(s=i.split("_")[1])&&(l%=a)!=l%180&&(l+=l<0?a:-360),"cw"===s&&l<0?l=(l+36e9)%a-~~(l/a)*a:"ccw"===s&&l>0&&(l=(l-36e9)%a-~~(l/a)*a)),t._pt=o=new ur(t._pt,e,r,n,l,zr),o.e=p,o.u="deg",t._props.push(r),o},In=function(t,e){for(var r in e)t[r]=e[r];return t},zn=function(t,e,r){var n,i,s,o,a,u,l,p=In({},r._gsap),c=r.style;for(i in p.svg?(s=r.getAttribute("transform"),r.setAttribute("transform",""),c[Qr]=e,n=Sn(r,1),hn(r,Qr),r.setAttribute("transform",s)):(s=getComputedStyle(r)[Qr],c[Qr]=e,n=Sn(r,1),c[Qr]=s),Ar)(s=p[i])!==(o=n[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(a=Wt(s)!==(l=Wt(o))?_n(r,i,s,l):parseFloat(s),u=parseFloat(o),t._pt=new ur(t._pt,n,i,a,u-a,Ir),t._pt.u=l||0,t._props.push(i));In(n,p)};ct("padding,margin,Width,Radius",(function(t,e){var r="Top",n="Right",i="Bottom",s="Left",o=(e<3?[r,n,i,s]:[r+s,r+n,i+n,i+s]).map((function(r){return e<2?t+r:"border"+r+t}));xn[e>1?"border"+t:t]=function(t,e,r,n,i){var s,a;if(arguments.length<4)return s=o.map((function(e){return mn(t,e,r)})),5===(a=s.join(" ")).split(s[0]).length?s[0]:a;s=(n+"").split(" "),a={},o.forEach((function(t,e){return a[t]=s[e]=s[e]||s[(e-1)/2|0]})),t.init(e,a,i)}}));var Xn,jn,Yn={name:"css",register:an,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,r,n,i){var s,o,a,u,l,p,c,h,d,f,g,_,D,v,y,x,b,w,C,F,E=this._props,S=t.style,M=r.vars.startAt;for(c in Fr||an(),this.styles=this.styles||en(t),x=this.styles.props,this.tween=r,e)if("autoRound"!==c&&(o=e[c],!nt[c]||!Ye(c,e,r,n,t,i)))if(l=typeof o,p=xn[c],"function"===l&&(l=typeof(o=o.call(r,n,t,i))),"string"===l&&~o.indexOf("random(")&&(o=oe(o)),p)p(this,t,c,o,r)&&(y=1);else if("--"===c.substr(0,2))s=(getComputedStyle(t).getPropertyValue(c)+"").trim(),o+="",ve.lastIndex=0,ve.test(s)||(h=Wt(s),d=Wt(o)),d?h!==d&&(s=_n(t,c,s,d)+d):h&&(o+=h),this.add(S,"setProperty",s,o,n,i,0,0,c),E.push(c),x.push(c,0,S[c]);else if("undefined"!==l){if(M&&c in M?(s="function"==typeof M[c]?M[c].call(r,n,t,i):M[c],T(s)&&~s.indexOf("random(")&&(s=oe(s)),Wt(s+"")||"auto"===s||(s+=m.units[c]||Wt(mn(t,c))||""),"="===(s+"").charAt(1)&&(s=mn(t,c))):s=mn(t,c),u=parseFloat(s),(f="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),a=parseFloat(o),c in Nr&&("autoAlpha"===c&&(1===u&&"hidden"===mn(t,"visibility")&&a&&(u=0),x.push("visibility",0,S.visibility),dn(this,S,"visibility",u?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==c&&"transform"!==c&&~(c=Nr[c]).indexOf(",")&&(c=c.split(",")[0])),g=c in Ar)if(this.styles.save(c),_||((D=t._gsap).renderTransform&&!e.parseTransform||Sn(t,e.parseTransform),v=!1!==e.smoothOrigin&&D.smooth,(_=this._pt=new ur(this._pt,S,Qr,0,1,D.renderTransform,D,0,-1)).dep=1),"scale"===c)this._pt=new ur(this._pt,D,"scaleY",D.scaleY,(f?ft(D.scaleY,f+a):a)-D.scaleY||0,Ir),this._pt.u=0,E.push("scaleY",c),c+="X";else{if("transformOrigin"===c){x.push(Zr,0,S[Zr]),w=void 0,C=void 0,F=void 0,C=(w=(b=o).split(" "))[0],F=w[1]||"50%","top"!==C&&"bottom"!==C&&"left"!==F&&"right"!==F||(b=C,C=F,F=b),w[0]=vn[C]||C,w[1]=vn[F]||F,o=w.join(" "),D.svg?Tn(t,o,0,v,0,this):((d=parseFloat(o.split(" ")[2])||0)!==D.zOrigin&&dn(this,D,"zOrigin",D.zOrigin,d),dn(this,S,c,Mn(s),Mn(o)));continue}if("svgOrigin"===c){Tn(t,o,1,v,0,this);continue}if(c in wn){Nn(this,D,c,u,f?ft(u,f+o):o);continue}if("smoothOrigin"===c){dn(this,D,"smooth",D.smooth,o);continue}if("force3D"===c){D[c]=o;continue}if("transform"===c){zn(this,o,t);continue}}else c in S||(c=on(c)||c);if(g||(a||0===a)&&(u||0===u)&&!Lr.test(o)&&c in S)a||(a=0),(h=(s+"").substr((u+"").length))!==(d=Wt(o)||(c in m.units?m.units[c]:h))&&(u=_n(t,c,s,d)),this._pt=new ur(this._pt,g?D:S,c,u,(f?ft(u,f+a):a)-u,g||"px"!==d&&"zIndex"!==c||!1===e.autoRound?Ir:jr),this._pt.u=d||0,h!==d&&"%"!==d&&(this._pt.b=s,this._pt.r=Xr);else if(c in S)Dn.call(this,t,c,s,f?f+o:o);else if(c in t)this.add(t,c,s||t[c],f?f+o:o,n,i);else if("parseTransform"!==c){$(c,o);continue}g||(c in S?x.push(c,0,S[c]):x.push(c,1,s||t[c])),E.push(c)}y&&ar(this)},render:function(t,e){if(e.tween._time||!Sr())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:mn,aliases:Nr,getSetter:function(t,e,r){var n=Nr[e];return n&&n.indexOf(",")<0&&(e=n),e in Ar&&e!==Zr&&(t._gsap.x||mn(t,"x"))?r&&Tr===r?"scale"===e?$r:Hr:(Tr=r||{})&&("scale"===e?Ur:Wr):t.style&&!A(t.style[e])?Gr:~e.indexOf("-")?Vr:Ke(t,e)},core:{_removeProperty:hn,_getMatrix:En}};xr.utils.checkPrefix=on,xr.core.getStyleSaver=en,jn=ct("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(Xn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){Ar[t]=1})),ct(Xn,(function(t){m.units[t]="deg",wn[t]=1})),Nr[jn[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+Xn,ct("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");Nr[e[1]]=jn[e[0]]})),ct("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){m.units[t]="px"})),xr.registerPlugin(Yn);var qn=xr.registerPlugin(Yn)||xr,Gn=qn.core.Tween,Vn=/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/;function Hn(t){var e=t.nodeType,r="";if(1===e||9===e||11===e){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)r+=Hn(t)}else if(3===e||4===e)return t.nodeValue;return r}
/*!
 * SplitText: 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/var $n,Un,Wn,Qn,Zn,Jn,Kn=/(?:\r|\n|\t\t)/g,ti=/(?:\s\s+)/g,ei=String.fromCharCode(160),ri=function(t){$n=document,Un=window,(Qn=Qn||t||Un.gsap||console.warn("Please gsap.registerPlugin(SplitText)"))&&(Jn=Qn.utils.toArray,Zn=Qn.core.context||function(){},Wn=1)},ni=function(t){return Un.getComputedStyle(t)},ii=function(t){return"absolute"===t.position||!0===t.absolute},si=function(t,e){for(var r,n=e.length;--n>-1;)if(r=e[n],t.substr(0,r.length)===r)return r.length},oi=function(t,e){void 0===t&&(t="");var r=~t.indexOf("++"),n=1;return r&&(t=t.split("++").join("")),function(){return"<"+e+" style='position:relative;display:inline-block;'"+(t?" class='"+t+(r?n++:"")+"'>":">")}},ai=function t(e,r,n){var i=e.nodeType;if(1===i||9===i||11===i)for(e=e.firstChild;e;e=e.nextSibling)t(e,r,n);else 3!==i&&4!==i||(e.nodeValue=e.nodeValue.split(r).join(n))},ui=function(t,e){for(var r=e.length;--r>-1;)t.push(e[r])},li=function(t,e,r){for(var n;t&&t!==e;){if(n=t._next||t.nextSibling)return n.textContent.charAt(0)===r;t=t.parentNode||t._parent}},pi=function t(e){var r,n,i=Jn(e.childNodes),s=i.length;for(r=0;r<s;r++)(n=i[r])._isSplit?t(n):r&&n.previousSibling&&3===n.previousSibling.nodeType?(n.previousSibling.nodeValue+=3===n.nodeType?n.nodeValue:n.firstChild.nodeValue,e.removeChild(n)):3!==n.nodeType&&(e.insertBefore(n.firstChild,n),e.removeChild(n))},ci=function(t,e){return parseFloat(e[t])||0},hi=function(t,e,r,n,i,s,o){var a,u,l,p,c,h,d,f,g,_,m,D,v=ni(t),y=ci("paddingLeft",v),x=-999,b=ci("borderBottomWidth",v)+ci("borderTopWidth",v),w=ci("borderLeftWidth",v)+ci("borderRightWidth",v),C=ci("paddingTop",v)+ci("paddingBottom",v),F=ci("paddingLeft",v)+ci("paddingRight",v),E=ci("fontSize",v)*(e.lineThreshold||.2),T=v.textAlign,S=[],M=[],A=[],R=e.wordDelimiter||" ",O=e.tag?e.tag:e.span?"span":"div",P=e.type||e.split||"chars,words,lines",k=i&&~P.indexOf("lines")?[]:null,B=~P.indexOf("words"),L=~P.indexOf("chars"),N=ii(e),I=e.linesClass,z=~(I||"").indexOf("++"),X=[],j="flex"===v.display,Y=t.style.display;for(z&&(I=I.split("++").join("")),j&&(t.style.display="block"),l=(u=t.getElementsByTagName("*")).length,c=[],a=0;a<l;a++)c[a]=u[a];if(k||N)for(a=0;a<l;a++)((h=(p=c[a]).parentNode===t)||N||L&&!B)&&(D=p.offsetTop,k&&h&&Math.abs(D-x)>E&&("BR"!==p.nodeName||0===a)&&(d=[],k.push(d),x=D),N&&(p._x=p.offsetLeft,p._y=D,p._w=p.offsetWidth,p._h=p.offsetHeight),k&&((p._isSplit&&h||!L&&h||B&&h||!B&&p.parentNode.parentNode===t&&!p.parentNode._isSplit)&&(d.push(p),p._x-=y,li(p,t,R)&&(p._wordEnd=!0)),"BR"===p.nodeName&&(p.nextSibling&&"BR"===p.nextSibling.nodeName||0===a)&&k.push([])));for(a=0;a<l;a++)if(h=(p=c[a]).parentNode===t,"BR"!==p.nodeName)if(N&&(g=p.style,B||h||(p._x+=p.parentNode._x,p._y+=p.parentNode._y),g.left=p._x+"px",g.top=p._y+"px",g.position="absolute",g.display="block",g.width=p._w+1+"px",g.height=p._h+"px"),!B&&L)if(p._isSplit)for(p._next=u=p.nextSibling,p.parentNode.appendChild(p);u&&3===u.nodeType&&" "===u.textContent;)p._next=u.nextSibling,p.parentNode.appendChild(u),u=u.nextSibling;else p.parentNode._isSplit?(p._parent=p.parentNode,!p.previousSibling&&p.firstChild&&(p.firstChild._isFirst=!0),p.nextSibling&&" "===p.nextSibling.textContent&&!p.nextSibling.nextSibling&&X.push(p.nextSibling),p._next=p.nextSibling&&p.nextSibling._isFirst?null:p.nextSibling,p.parentNode.removeChild(p),c.splice(a--,1),l--):h||(D=!p.nextSibling&&li(p.parentNode,t,R),p.parentNode._parent&&p.parentNode._parent.appendChild(p),D&&p.parentNode.appendChild($n.createTextNode(" ")),"span"===O&&(p.style.display="inline"),S.push(p));else p.parentNode._isSplit&&!p._isSplit&&""!==p.innerHTML?M.push(p):L&&!p._isSplit&&("span"===O&&(p.style.display="inline"),S.push(p));else k||N?(p.parentNode&&p.parentNode.removeChild(p),c.splice(a--,1),l--):B||t.appendChild(p);for(a=X.length;--a>-1;)X[a].parentNode.removeChild(X[a]);if(k){for(N&&(_=$n.createElement(O),t.appendChild(_),m=_.offsetWidth+"px",D=_.offsetParent===t?0:t.offsetLeft,t.removeChild(_)),g=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(f=" "===R&&(!N||!B&&!L),a=0;a<k.length;a++){for(d=k[a],(_=$n.createElement(O)).style.cssText="display:block;text-align:"+T+";position:"+(N?"absolute;":"relative;"),I&&(_.className=I+(z?a+1:"")),A.push(_),l=d.length,u=0;u<l;u++)"BR"!==d[u].nodeName&&(p=d[u],_.appendChild(p),f&&p._wordEnd&&_.appendChild($n.createTextNode(" ")),N&&(0===u&&(_.style.top=p._y+"px",_.style.left=y+D+"px"),p.style.top="0px",D&&(p.style.left=p._x-D+"px")));0===l?_.innerHTML="&nbsp;":B||L||(pi(_),ai(_,String.fromCharCode(160)," ")),N&&(_.style.width=m,_.style.height=p._h+"px"),t.appendChild(_)}t.style.cssText=g}N&&(o>t.clientHeight&&(t.style.height=o-C+"px",t.clientHeight<o&&(t.style.height=o+b+"px")),s>t.clientWidth&&(t.style.width=s-F+"px",t.clientWidth<s&&(t.style.width=s+w+"px"))),j&&(Y?t.style.display=Y:t.style.removeProperty("display")),ui(r,S),B&&ui(n,M),ui(i,A)},di=function(t,e,r,n){var i,s,o,a,u,l,p,c,h=e.tag?e.tag:e.span?"span":"div",d=~(e.type||e.split||"chars,words,lines").indexOf("chars"),f=ii(e),g=e.wordDelimiter||" ",_=function(t){return t===g||t===ei&&" "===g},m=" "!==g?"":f?"&#173; ":" ",D="</"+h+">",v=1,y=e.specialChars?"function"==typeof e.specialChars?e.specialChars:si:null,x=$n.createElement("div"),b=t.parentNode;for(b.insertBefore(x,t),x.textContent=t.nodeValue,b.removeChild(t),p=-1!==(i=Hn(t=x)).indexOf("<"),!1!==e.reduceWhiteSpace&&(i=i.replace(ti," ").replace(Kn,"")),p&&(i=i.split("<").join("{{LT}}")),u=i.length,s=(" "===i.charAt(0)?m:"")+r(),o=0;o<u;o++)if(l=i.charAt(o),y&&(c=y(i.substr(o),e.specialChars)))l=i.substr(o,c||1),s+=d&&" "!==l?n()+l+"</"+h+">":l,o+=c-1;else if(_(l)&&!_(i.charAt(o-1))&&o){for(s+=v?D:"",v=0;_(i.charAt(o+1));)s+=m,o++;o===u-1?s+=m:")"!==i.charAt(o+1)&&(s+=m+r(),v=1)}else"{"===l&&"{{LT}}"===i.substr(o,6)?(s+=d?n()+"{{LT}}</"+h+">":"{{LT}}",o+=5):l.charCodeAt(0)>=55296&&l.charCodeAt(0)<=56319||i.charCodeAt(o+1)>=65024&&i.charCodeAt(o+1)<=65039?(a=((i.substr(o,12).split(Vn)||[])[1]||"").length||2,s+=d&&" "!==l?n()+i.substr(o,a)+"</"+h+">":i.substr(o,a),o+=a-1):s+=d&&" "!==l?n()+l+"</"+h+">":l;t.outerHTML=s+(v?D:""),p&&ai(b,"{{LT}}","<")},fi=function t(e,r,n,i){var s,o,a=Jn(e.childNodes),u=a.length,l=ii(r);if(3!==e.nodeType||u>1){for(r.absolute=!1,s=0;s<u;s++)(o=a[s])._next=o._isFirst=o._parent=o._wordEnd=null,(3!==o.nodeType||/\S+/.test(o.nodeValue))&&(l&&3!==o.nodeType&&"inline"===ni(o).display&&(o.style.display="inline-block",o.style.position="relative"),o._isSplit=!0,t(o,r,n,i));return r.absolute=l,void(e._isSplit=!0)}di(e,r,n,i)},gi=function(){function t(t,e){Wn||ri(),this.elements=Jn(t),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=e||{},Zn(this),this.split(e)}var e=t.prototype;return e.split=function(t){this.isSplit&&this.revert(),this.vars=t=t||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;for(var e,r,n,i=this.elements.length,s=t.tag?t.tag:t.span?"span":"div",o=oi(t.wordsClass,s),a=oi(t.charsClass,s);--i>-1;)n=this.elements[i],this._originals[i]={html:n.innerHTML,style:n.getAttribute("style")},e=n.clientHeight,r=n.clientWidth,fi(n,t,o,a),hi(n,t,this.chars,this.words,this.lines,r,e);return this.chars.reverse(),this.words.reverse(),this.lines.reverse(),this.isSplit=!0,this},e.revert=function(){var t=this._originals;if(!t)throw"revert() call wasn't scoped properly.";return this.elements.forEach((function(e,r){e.innerHTML=t[r].html,e.setAttribute("style",t[r].style)})),this.chars=[],this.words=[],this.lines=[],this.isSplit=!1,this},t.create=function(e,r){return new t(e,r)},t}();gi.version="3.12.5",gi.register=ri;
/*!
 * paths 3.12.5
 * https://gsap.com
 *
 * Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/
var _i=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,mi=/(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,Di=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi,vi=/(^[#\.][a-z]|[a-y][a-z])/i,yi=Math.PI/180,xi=180/Math.PI,bi=Math.sin,wi=Math.cos,Ci=Math.abs,Fi=Math.sqrt,Ei=Math.atan2,Ti=1e8,Si=function(t){return"string"==typeof t},Mi=function(t){return"number"==typeof t},Ai={},Ri={},Oi=1e5,Pi=function(t){return Math.round((t+Ti)%1*Oi)/Oi||(t<0?0:1)},ki=function(t){return Math.round(t*Oi)/Oi||0},Bi=function(t){return Math.round(1e10*t)/1e10||0},Li=function(t,e,r,n){var i=t[e],s=1===n?6:$i(i,r,n);if((s||!n)&&s+r+2<i.length)return t.splice(e,0,i.slice(0,r+s+2)),i.splice(0,r+s),1},Ni=function(t,e,r){var n=t.length,i=~~(r*n);if(t[i]>e){for(;--i&&t[i]>e;);i<0&&(i=0)}else for(;t[++i]<e&&i<n;);return i<n?i:n-1},Ii=function(t,e){return e.totalLength=t.totalLength,t.samples?(e.samples=t.samples.slice(0),e.lookup=t.lookup.slice(0),e.minLength=t.minLength,e.resolution=t.resolution):t.totalPoints&&(e.totalPoints=t.totalPoints),e},zi=function(t,e){var r=t.length,n=t[r-1]||[],i=n.length;r&&e[0]===n[i-2]&&e[1]===n[i-1]&&(e=n.concat(e.slice(2)),r--),t[r]=e};function Xi(t){var e,r=(t=Si(t)&&vi.test(t)&&document.querySelector(t)||t).getAttribute?t:0;return r&&(t=t.getAttribute("d"))?(r._gsPath||(r._gsPath={}),(e=r._gsPath[t])&&!e._dirty?e:r._gsPath[t]=Ji(t)):t?Si(t)?Ji(t):Mi(t[0])?[t]:t:console.warn("Expecting a <path> element or an SVG path data string")}function ji(t){var e,r=0;for(t.reverse();r<t.length;r+=2)e=t[r],t[r]=t[r+1],t[r+1]=e;t.reversed=!t.reversed}var Yi={rect:"rx,ry,x,y,width,height",circle:"r,cx,cy",ellipse:"rx,ry,cx,cy",line:"x1,x2,y1,y2"};function qi(t,e,r){var n,i=t[e],s=t[e+2],o=t[e+4];return i+=(s-i)*r,i+=((s+=(o-s)*r)-i)*r,n=s+(o+(t[e+6]-o)*r-s)*r-i,i=t[e+1],i+=((s=t[e+3])-i)*r,i+=((s+=((o=t[e+5])-s)*r)-i)*r,ki(Ei(s+(o+(t[e+7]-o)*r-s)*r-i,n)*xi)}function Gi(t,e,r){r=void 0===r?1:Bi(r)||0,e=Bi(e)||0;var n=Math.max(0,~~(Ci(r-e)-1e-8)),i=function(t){for(var e=[],r=0;r<t.length;r++)e[r]=Ii(t[r],t[r].slice(0));return Ii(t,e)}(t);if(e>r&&(e=1-e,r=1-r,function(t,e){var r=t.length;for(t.reverse();r--;)t[r].reversed||ji(t[r])}(i),i.totalLength=0),e<0||r<0){var s=Math.abs(~~Math.min(e,r))+1;e+=s,r+=s}i.totalLength||Hi(i);var o,a,u,l,p,c,h,d,f=r>1,g=Ui(i,e,Ai,!0),_=Ui(i,r,Ri),m=_.segment,D=g.segment,v=_.segIndex,y=g.segIndex,x=_.i,b=g.i,w=y===v,C=x===b&&w;if(f||n){for(o=v<y||w&&x<b||C&&_.t<g.t,Li(i,y,b,g.t)&&(y++,o||(v++,C?(_.t=(_.t-g.t)/(1-g.t),x=0):w&&(x-=b))),Math.abs(1-(r-e))<1e-5?v=y-1:!_.t&&v?v--:Li(i,v,x,_.t)&&o&&y++,1===g.t&&(y=(y+1)%i.length),p=[],h=1+(c=i.length)*n,d=y,h+=(c-y+v)%c,l=0;l<h;l++)zi(p,i[d++%c]);i=p}else if(u=1===_.t?6:$i(m,x,_.t),e!==r)for(a=$i(D,b,C?g.t/_.t:g.t),w&&(u+=a),m.splice(x+u+2),(a||b)&&D.splice(0,b+a),l=i.length;l--;)(l<y||l>v)&&i.splice(l,1);else m.angle=qi(m,x+u,0),g=m[x+=u],_=m[x+1],m.length=m.totalLength=0,m.totalPoints=i.totalPoints=8,m.push(g,_,g,_,g,_,g,_);return i.totalLength=0,i}function Vi(t,e,r){e=e||0,t.samples||(t.samples=[],t.lookup=[]);var n,i,s,o,a,u,l,p,c,h,d,f,g,_,m,D,v,y=~~t.resolution||12,x=1/y,b=r?e+6*r+1:t.length,w=t[e],C=t[e+1],F=e?e/6*y:0,E=t.samples,T=t.lookup,S=(e?t.minLength:Ti)||Ti,M=E[F+r*y-1],A=e?E[F-1]:0;for(E.length=T.length=0,i=e+2;i<b;i+=6){if(s=t[i+4]-w,o=t[i+2]-w,a=t[i]-w,p=t[i+5]-C,c=t[i+3]-C,h=t[i+1]-C,u=l=d=f=0,Ci(s)<.01&&Ci(p)<.01&&Ci(a)+Ci(h)<.01)t.length>8&&(t.splice(i,6),i-=6,b-=6);else for(n=1;n<=y;n++)u=l-(l=((_=x*n)*_*s+3*(g=1-_)*(_*o+g*a))*_),d=f-(f=(_*_*p+3*g*(_*c+g*h))*_),(D=Fi(d*d+u*u))<S&&(S=D),A+=D,E[F++]=A;w+=s,C+=p}if(M)for(M-=A;F<E.length;F++)E[F]+=M;if(E.length&&S){if(t.totalLength=v=E[E.length-1]||0,t.minLength=S,v/S<9999)for(D=m=0,n=0;n<v;n+=S)T[D++]=E[m]<n?++m:m}else t.totalLength=E[0]=0;return e?A-E[e/2-1]:A}function Hi(t,e){var r,n,i;for(i=r=n=0;i<t.length;i++)t[i].resolution=~~e||12,n+=t[i].length,r+=Vi(t[i]);return t.totalPoints=n,t.totalLength=r,t}function $i(t,e,r){if(r<=0||r>=1)return 0;var n=t[e],i=t[e+1],s=t[e+2],o=t[e+3],a=t[e+4],u=t[e+5],l=n+(s-n)*r,p=s+(a-s)*r,c=i+(o-i)*r,h=o+(u-o)*r,d=l+(p-l)*r,f=c+(h-c)*r,g=a+(t[e+6]-a)*r,_=u+(t[e+7]-u)*r;return p+=(g-p)*r,h+=(_-h)*r,t.splice(e+2,4,ki(l),ki(c),ki(d),ki(f),ki(d+(p-d)*r),ki(f+(h-f)*r),ki(p),ki(h),ki(g),ki(_)),t.samples&&t.samples.splice(e/6*t.resolution|0,0,0,0,0,0,0,0),6}function Ui(t,e,r,n){r=r||{},t.totalLength||Hi(t),(e<0||e>1)&&(e=Pi(e));var i,s,o,a,u,l,p,c=0,h=t[0];if(e)if(1===e)p=1,l=(h=t[c=t.length-1]).length-8;else{if(t.length>1){for(o=t.totalLength*e,u=l=0;(u+=t[l++].totalLength)<o;)c=l;e=(o-(a=u-(h=t[c]).totalLength))/(u-a)||0}i=h.samples,s=h.resolution,o=h.totalLength*e,a=(l=h.lookup.length?h.lookup[~~(o/h.minLength)]||0:Ni(i,o,e))?i[l-1]:0,(u=i[l])<o&&(a=u,u=i[++l]),p=1/s*((o-a)/(u-a)+l%s),l=6*~~(l/s),n&&1===p&&(l+6<h.length?(l+=6,p=0):c+1<t.length&&(l=p=0,h=t[++c]))}else p=l=c=0,h=t[0];return r.t=p,r.i=l,r.path=t,r.segment=h,r.segIndex=c,r}function Wi(t,e,r,n){var i,s,o,a,u,l,p,c,h,d=t[0],f=n||{};if((e<0||e>1)&&(e=Pi(e)),d.lookup||Hi(t),t.length>1){for(o=t.totalLength*e,u=l=0;(u+=t[l++].totalLength)<o;)d=t[l];e=(o-(a=u-d.totalLength))/(u-a)||0}return i=d.samples,s=d.resolution,o=d.totalLength*e,a=(l=d.lookup.length?d.lookup[e<1?~~(o/d.minLength):d.lookup.length-1]||0:Ni(i,o,e))?i[l-1]:0,(u=i[l])<o&&(a=u,u=i[++l]),h=1-(p=1/s*((o-a)/(u-a)+l%s)||0),c=d[l=6*~~(l/s)],f.x=ki((p*p*(d[l+6]-c)+3*h*(p*(d[l+4]-c)+h*(d[l+2]-c)))*p+c),f.y=ki((p*p*(d[l+7]-(c=d[l+1]))+3*h*(p*(d[l+5]-c)+h*(d[l+3]-c)))*p+c),r&&(f.angle=d.totalLength?qi(d,l,p>=1?1-1e-9:p||1e-9):d.angle||0),f}function Qi(t,e,r,n,i,s,o){for(var a,u,l,p,c,h=t.length;--h>-1;)for(u=(a=t[h]).length,l=0;l<u;l+=2)p=a[l],c=a[l+1],a[l]=p*e+c*n+s,a[l+1]=p*r+c*i+o;return t._dirty=1,t}function Zi(t,e,r,n,i,s,o,a,u){if(t!==a||e!==u){r=Ci(r),n=Ci(n);var l=i%360*yi,p=wi(l),c=bi(l),h=Math.PI,d=2*h,f=(t-a)/2,g=(e-u)/2,_=p*f+c*g,m=-c*f+p*g,D=_*_,v=m*m,y=D/(r*r)+v/(n*n);y>1&&(r=Fi(y)*r,n=Fi(y)*n);var x=r*r,b=n*n,w=(x*b-x*v-b*D)/(x*v+b*D);w<0&&(w=0);var C=(s===o?-1:1)*Fi(w),F=C*(r*m/n),E=C*(-n*_/r),T=(t+a)/2+(p*F-c*E),S=(e+u)/2+(c*F+p*E),M=(_-F)/r,A=(m-E)/n,R=(-_-F)/r,O=(-m-E)/n,P=M*M+A*A,k=(A<0?-1:1)*Math.acos(M/Fi(P)),B=(M*O-A*R<0?-1:1)*Math.acos((M*R+A*O)/Fi(P*(R*R+O*O)));isNaN(B)&&(B=h),!o&&B>0?B-=d:o&&B<0&&(B+=d),k%=d,B%=d;var L,N=Math.ceil(Ci(B)/(d/4)),I=[],z=B/N,X=4/3*bi(z/2)/(1+wi(z/2)),j=p*r,Y=c*r,q=c*-n,G=p*n;for(L=0;L<N;L++)_=wi(i=k+L*z),m=bi(i),M=wi(i+=z),A=bi(i),I.push(_-X*m,m+X*_,M+X*A,A-X*M,M,A);for(L=0;L<I.length;L+=2)_=I[L],m=I[L+1],I[L]=_*j+m*q+T,I[L+1]=_*Y+m*G+S;return I[L-2]=a,I[L-1]=u,I}}function Ji(t){var e,r,n,i,s,o,a,u,l,p,c,h,d,f,g,_=(t+"").replace(Di,(function(t){var e=+t;return e<1e-4&&e>-1e-4?0:e})).match(_i)||[],m=[],D=0,v=0,y=2/3,x=_.length,b=0,w="ERROR: malformed path: "+t,C=function(t,e,r,n){p=(r-t)/3,c=(n-e)/3,a.push(t+p,e+c,r-p,n-c,r,n)};if(!t||!isNaN(_[0])||isNaN(_[1]))return console.log(w),m;for(e=0;e<x;e++)if(d=s,isNaN(_[e])?o=(s=_[e].toUpperCase())!==_[e]:e--,n=+_[e+1],i=+_[e+2],o&&(n+=D,i+=v),e||(u=n,l=i),"M"===s)a&&(a.length<8?m.length-=1:b+=a.length),D=u=n,v=l=i,a=[n,i],m.push(a),e+=2,s="L";else if("C"===s)a||(a=[0,0]),o||(D=v=0),a.push(n,i,D+1*_[e+3],v+1*_[e+4],D+=1*_[e+5],v+=1*_[e+6]),e+=6;else if("S"===s)p=D,c=v,"C"!==d&&"S"!==d||(p+=D-a[a.length-4],c+=v-a[a.length-3]),o||(D=v=0),a.push(p,c,n,i,D+=1*_[e+3],v+=1*_[e+4]),e+=4;else if("Q"===s)p=D+(n-D)*y,c=v+(i-v)*y,o||(D=v=0),D+=1*_[e+3],v+=1*_[e+4],a.push(p,c,D+(n-D)*y,v+(i-v)*y,D,v),e+=4;else if("T"===s)p=D-a[a.length-4],c=v-a[a.length-3],a.push(D+p,v+c,n+(D+1.5*p-n)*y,i+(v+1.5*c-i)*y,D=n,v=i),e+=2;else if("H"===s)C(D,v,D=n,v),e+=1;else if("V"===s)C(D,v,D,v=n+(o?v-D:0)),e+=1;else if("L"===s||"Z"===s)"Z"===s&&(n=u,i=l,a.closed=!0),("L"===s||Ci(D-n)>.5||Ci(v-i)>.5)&&(C(D,v,n,i),"L"===s&&(e+=2)),D=n,v=i;else if("A"===s){if(f=_[e+4],g=_[e+5],p=_[e+6],c=_[e+7],r=7,f.length>1&&(f.length<3?(c=p,p=g,r--):(c=g,p=f.substr(2),r-=2),g=f.charAt(1),f=f.charAt(0)),h=Zi(D,v,+_[e+1],+_[e+2],+_[e+3],+f,+g,(o?D:0)+1*p,(o?v:0)+1*c),e+=r,h)for(r=0;r<h.length;r++)a.push(h[r]);D=a[a.length-2],v=a[a.length-1]}else console.log(w);return(e=a.length)<6?(m.pop(),e=0):a[0]===a[e-2]&&a[1]===a[e-1]&&(a.closed=!0),m.totalPoints=b+e,m}function Ki(t,e){void 0===e&&(e=1);for(var r=t[0],n=0,i=[r,n],s=2;s<t.length;s+=2)i.push(r,n,t[s],n=(t[s]-r)*e/2,r=t[s],-n);return i}function ts(t,e){Ci(t[0]-t[2])<1e-4&&Ci(t[1]-t[3])<1e-4&&(t=t.slice(2));var r,n,i,s,o,a,u,l,p,c,h,d,f,g,_=t.length-2,m=+t[0],D=+t[1],v=+t[2],y=+t[3],x=[m,D,m,D],b=v-m,w=y-D,C=Math.abs(t[_]-m)<.001&&Math.abs(t[_+1]-D)<.001;for(C&&(t.push(v,y),v=m,y=D,m=t[_-2],D=t[_-1],t.unshift(m,D),_+=4),e=e||0===e?+e:1,i=2;i<_;i+=2)r=m,n=D,m=v,D=y,v=+t[i+2],y=+t[i+3],m===v&&D===y||(s=b,o=w,b=v-m,w=y-D,l=((a=Fi(s*s+o*o))+(u=Fi(b*b+w*w)))*e*.25/Fi(Math.pow(b/u+s/a,2)+Math.pow(w/u+o/a,2)),h=m-((p=m-(m-r)*(a?l/a:0))+(((c=m+(v-m)*(u?l/u:0))-p)*(3*a/(a+u)+.5)/4||0)),g=D-((d=D-(D-n)*(a?l/a:0))+(((f=D+(y-D)*(u?l/u:0))-d)*(3*a/(a+u)+.5)/4||0)),m===r&&D===n||x.push(ki(p+h),ki(d+g),ki(m),ki(D),ki(c+h),ki(f+g)));return m!==v||D!==y||x.length<4?x.push(ki(v),ki(y),ki(v),ki(y)):x.length-=2,2===x.length?x.push(m,D,m,D,m,D):C&&(x.splice(0,6),x.length=x.length-6),x}function es(t){Mi(t[0])&&(t=[t]);var e,r,n,i,s="",o=t.length;for(r=0;r<o;r++){for(i=t[r],s+="M"+ki(i[0])+","+ki(i[1])+" C",e=i.length,n=2;n<e;n++)s+=ki(i[n++])+","+ki(i[n++])+" "+ki(i[n++])+","+ki(i[n++])+" "+ki(i[n++])+","+ki(i[n])+" ";i.closed&&(s+="z")}return s}
/*!
 * CustomEase 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/var rs,ns,is=function(){return rs||"undefined"!=typeof window&&(rs=window.gsap)&&rs.registerPlugin&&rs},ss=function(){(rs=is())?(rs.registerEase("_CE",ps.create),ns=1):console.warn("Please gsap.registerPlugin(CustomEase)")},os=function(t){return~~(1e3*t+(t<0?-.5:.5))/1e3},as=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,us=/[cLlsSaAhHvVtTqQ]/g,ls=function t(e,r,n,i,s,o,a,u,l,p,c){var h,d=(e+n)/2,f=(r+i)/2,g=(n+s)/2,_=(i+o)/2,m=(s+a)/2,D=(o+u)/2,v=(d+g)/2,y=(f+_)/2,x=(g+m)/2,b=(_+D)/2,w=(v+x)/2,C=(y+b)/2,F=a-e,E=u-r,T=Math.abs((n-a)*E-(i-u)*F),S=Math.abs((s-a)*E-(o-u)*F);return p||(p=[{x:e,y:r},{x:a,y:u}],c=1),p.splice(c||p.length-1,0,{x:w,y:C}),(T+S)*(T+S)>l*(F*F+E*E)&&(h=p.length,t(e,r,d,f,v,y,w,C,l,p,c),t(w,C,x,b,m,D,a,u,l,p,c+1+(p.length-h))),p},ps=function(){function t(t,e,r){ns||ss(),this.id=t,this.setData(e,r)}var e=t.prototype;return e.setData=function(t,e){e=e||{};var r,n,i,s,o,a,u,l,p,c=(t=t||"0,0,1,1").match(as),h=1,d=[],f=[],g=e.precision||1,_=g<=1;if(this.data=t,(us.test(t)||~t.indexOf("M")&&t.indexOf("C")<0)&&(c=Ji(t)[0]),4===(r=c.length))c.unshift(0,0),c.push(1,1),r=8;else if((r-2)%6)throw"Invalid CustomEase";for(0==+c[0]&&1==+c[r-2]||function(t,e,r){r||0===r||(r=Math.max(+t[t.length-1],+t[1]));var n,i=-1*+t[0],s=-r,o=t.length,a=1/(+t[o-2]+i),u=-e||(Math.abs(+t[o-1]-+t[1])<.01*(+t[o-2]-+t[0])?function(t){var e,r=t.length,n=1e20;for(e=1;e<r;e+=6)+t[e]<n&&(n=+t[e]);return n}(t)+s:+t[o-1]+s);for(u=u?1/u:-a,n=0;n<o;n+=2)t[n]=(+t[n]+i)*a,t[n+1]=(+t[n+1]+s)*u}(c,e.height,e.originY),this.segment=c,s=2;s<r;s+=6)n={x:+c[s-2],y:+c[s-1]},i={x:+c[s+4],y:+c[s+5]},d.push(n,i),ls(n.x,n.y,+c[s],+c[s+1],+c[s+2],+c[s+3],i.x,i.y,1/(2e5*g),d,d.length-1);for(r=d.length,s=0;s<r;s++)u=d[s],l=d[s-1]||u,(u.x>l.x||l.y!==u.y&&l.x===u.x||u===l)&&u.x<=1?(l.cx=u.x-l.x,l.cy=u.y-l.y,l.n=u,l.nx=u.x,_&&s>1&&Math.abs(l.cy/l.cx-d[s-2].cy/d[s-2].cx)>2&&(_=0),l.cx<h&&(l.cx?h=l.cx:(l.cx=.001,s===r-1&&(l.x-=.001,h=Math.min(h,.001),_=0)))):(d.splice(s--,1),r--);if(o=1/(r=1/h+1|0),a=0,u=d[0],_){for(s=0;s<r;s++)p=s*o,u.nx<p&&(u=d[++a]),n=u.y+(p-u.x)/u.cx*u.cy,f[s]={x:p,cx:o,y:n,cy:0,nx:9},s&&(f[s-1].cy=n-f[s-1].y);f[r-1].cy=d[d.length-1].y-n}else{for(s=0;s<r;s++)u.nx<s*o&&(u=d[++a]),f[s]=u;a<d.length-1&&(f[s-1]=d[d.length-2])}return this.ease=function(t){var e=f[t*r|0]||f[r-1];return e.nx<t&&(e=e.n),e.y+(t-e.x)/e.cx*e.cy},this.ease.custom=this,this.id&&rs&&rs.registerEase(this.id,this.ease),this},e.getSVGData=function(e){return t.getSVGData(this,e)},t.create=function(e,r,n){return new t(e,r,n).ease},t.register=function(t){rs=t,ss()},t.get=function(t){return rs.parseEase(t)},t.getSVGData=function(e,r){var n,i,s,o,a,u,l,p,c,h,d=(r=r||{}).width||100,f=r.height||100,g=r.x||0,_=(r.y||0)+f,m=rs.utils.toArray(r.path)[0];if(r.invert&&(f=-f,_=0),"string"==typeof e&&(e=rs.parseEase(e)),e.custom&&(e=e.custom),e instanceof t)n=es(Qi([e.segment],d,0,0,-f,g,_));else{for(n=[g,_],o=1/(l=Math.max(5,200*(r.precision||1))),p=5/(l+=2),c=os(g+o*d),i=((h=os(_+e(o)*-f))-_)/(c-g),s=2;s<l;s++)a=os(g+s*o*d),u=os(_+e(s*o)*-f),(Math.abs((u-h)/(a-c)-i)>p||s===l-1)&&(n.push(c,h),i=(u-h)/(a-c)),c=a,h=u;n="M"+n.join(",")}return m&&m.setAttribute("d",n),n},t}();is()&&rs.registerPlugin(ps),ps.version="3.12.5";
/*!
 * DrawSVGPlugin 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/
var cs,hs,ds,fs,gs,_s,ms,Ds,vs=function(){return"undefined"!=typeof window},ys=function(){return cs||vs()&&(cs=window.gsap)&&cs.registerPlugin&&cs},xs=/[-+=\.]*\d+[\.e\-\+]*\d*[e\-\+]*\d*/gi,bs={rect:["width","height"],circle:["r","r"],ellipse:["rx","ry"],line:["x2","y2"]},ws=function(t){return Math.round(1e4*t)/1e4},Cs=function(t){return parseFloat(t)||0},Fs=function(t,e){var r=Cs(t);return~t.indexOf("%")?r/100*e:r},Es=function(t,e){return Cs(t.getAttribute(e))},Ts=Math.sqrt,Ss=function(t,e,r,n,i,s){return Ts(Math.pow((Cs(r)-Cs(t))*i,2)+Math.pow((Cs(n)-Cs(e))*s,2))},Ms=function(t){return console.warn(t)},As=function(t){return"non-scaling-stroke"===t.getAttribute("vector-effect")},Rs=function(t){if(!(t=hs(t)[0]))return 0;var e,r,n,i,s,o,a,u=t.tagName.toLowerCase(),l=t.style,p=1,c=1;As(t)&&(c=t.getScreenCTM(),p=Ts(c.a*c.a+c.b*c.b),c=Ts(c.d*c.d+c.c*c.c));try{r=t.getBBox()}catch(t){Ms("Some browsers won't measure invisible elements (like display:none or masks inside defs).")}var h=r||{x:0,y:0,width:0,height:0},d=h.x,f=h.y,g=h.width,_=h.height;if(r&&(g||_)||!bs[u]||(g=Es(t,bs[u][0]),_=Es(t,bs[u][1]),"rect"!==u&&"line"!==u&&(g*=2,_*=2),"line"===u&&(d=Es(t,"x1"),f=Es(t,"y1"),g=Math.abs(g-d),_=Math.abs(_-f))),"path"===u)i=l.strokeDasharray,l.strokeDasharray="none",e=t.getTotalLength()||0,ws(p)!==ws(c)&&!_s&&(_s=1)&&Ms("Warning: <path> length cannot be measured when vector-effect is non-scaling-stroke and the element isn't proportionally scaled."),e*=(p+c)/2,l.strokeDasharray=i;else if("rect"===u)e=2*g*p+2*_*c;else if("line"===u)e=Ss(d,f,d+g,f+_,p,c);else if("polyline"===u||"polygon"===u)for(n=t.getAttribute("points").match(xs)||[],"polygon"===u&&n.push(n[0],n[1]),e=0,s=2;s<n.length;s+=2)e+=Ss(n[s-2],n[s-1],n[s],n[s+1],p,c)||0;else"circle"!==u&&"ellipse"!==u||(o=g/2*p,a=_/2*c,e=Math.PI*(3*(o+a)-Ts((3*o+a)*(o+3*a))));return e||0},Os=function(t,e){if(!(t=hs(t)[0]))return[0,0];e||(e=Rs(t)+1);var r=ds.getComputedStyle(t),n=r.strokeDasharray||"",i=Cs(r.strokeDashoffset),s=n.indexOf(",");return s<0&&(s=n.indexOf(" ")),(n=s<0?e:Cs(n.substr(0,s)))>e&&(n=e),[-i||0,n-i||0]},Ps=function(){vs()&&(document,ds=window,gs=cs=ys(),hs=cs.utils.toArray,ms=cs.core.getStyleSaver,Ds=cs.core.reverting||function(){},fs=-1!==((ds.navigator||{}).userAgent||"").indexOf("Edge"))},ks={version:"3.12.5",name:"drawSVG",register:function(t){cs=t,Ps()},init:function(t,e,r,n,i){if(!t.getBBox)return!1;gs||Ps();var s,o,a,u=Rs(t);return this.styles=ms&&ms(t,"strokeDashoffset,strokeDasharray,strokeMiterlimit"),this.tween=r,this._style=t.style,this._target=t,e+""=="true"?e="0 100%":e?-1===(e+"").indexOf(" ")&&(e="0 "+e):e="0 0",o=function(t,e,r){var n,i,s=t.indexOf(" ");return s<0?(n=void 0!==r?r+"":t,i=t):(n=t.substr(0,s),i=t.substr(s+1)),(n=Fs(n,e))>(i=Fs(i,e))?[i,n]:[n,i]}(e,u,(s=Os(t,u))[0]),this._length=ws(u),this._dash=ws(s[1]-s[0]),this._offset=ws(-s[0]),this._dashPT=this.add(this,"_dash",this._dash,ws(o[1]-o[0]),0,0,0,0,0,1),this._offsetPT=this.add(this,"_offset",this._offset,ws(-o[0]),0,0,0,0,0,1),fs&&(a=ds.getComputedStyle(t)).strokeLinecap!==a.strokeLinejoin&&(o=Cs(a.strokeMiterlimit),this.add(t.style,"strokeMiterlimit",o,o+.01)),this._live=As(t)||~(e+"").indexOf("live"),this._nowrap=~(e+"").indexOf("nowrap"),this._props.push("drawSVG"),1},render:function(t,e){if(e.tween._time||!Ds()){var r,n,i,s,o=e._pt,a=e._style;if(o){for(e._live&&(r=Rs(e._target))!==e._length&&(n=r/e._length,e._length=r,e._offsetPT&&(e._offsetPT.s*=n,e._offsetPT.c*=n),e._dashPT?(e._dashPT.s*=n,e._dashPT.c*=n):e._dash*=n);o;)o.r(t,o.d),o=o._next;i=e._dash||t&&1!==t&&1e-4||0,r=e._length-i+.1,s=e._offset,i&&s&&i+Math.abs(s%e._length)>e._length-.2&&(s+=s<0?.1:-.1)&&(r+=.1),a.strokeDashoffset=i?s:s+.001,a.strokeDasharray=r<.2?"none":i?i+"px,"+(e._nowrap?999999:r)+"px":"0px, 999999px"}}else e.styles.revert()},getLength:Rs,getPosition:Os};ys()&&cs.registerPlugin(ks);
/*!
 * CustomBounce 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/
var Bs,Ls,Ns,Is=function(){return Bs||"undefined"!=typeof window&&(Bs=window.gsap)&&Bs.registerPlugin&&Bs},zs=function(t){Bs=Is(),(Ns=Bs&&Bs.parseEase("_CE"))?(Ls=1,Bs.parseEase("bounce").config=function(t){return"object"==typeof t?js("",t):js("bounce("+t+")",{strength:+t})}):t&&console.warn("Please gsap.registerPlugin(CustomEase, CustomBounce)")},Xs=function(t){var e,r=t.length,n=1/t[r-2];for(e=2;e<r;e+=2)t[e]=~~(t[e]*n*1e3)/1e3;t[r-2]=1},js=function(t,e){Ls||zs(1),e=e||{};var r,n,i,s,o,a,u,l=Math.min(.999,e.strength||.7),p=l,c=(e.squash||0)/100,h=c,d=1/.03,f=.2,g=1,_=.1,m=[0,0,.07,0,.1,1,.1,1],D=[0,0,0,0,.1,0,.1,0];for(o=0;o<200&&(a=_+(f*=p*((p+1)/2)),s=1-(g*=l*l),n=(i=_+.49*f)+.8*(i-(r=_+g/d)),c&&(_+=c,r+=c,i+=c,n+=c,a+=c,u=c/h,D.push(_-c,0,_-c,u,_-c/2,u,_,u,_,0,_,0,_,-.6*u,_+(a-_)/6,0,a,0),m.push(_-c,1,_,1,_,1),c*=l*l),m.push(_,1,r,s,i,s,n,s,a,1,a,1),l*=.95,d=g/(a-n),_=a,!(s>.999));o++);if(e.endAtStart&&"false"!==e.endAtStart){if(i=-.1,m.unshift(i,1,i,1,-.07,0),h)for(i-=c=2.5*h,m.unshift(i,1,i,1,i,1),D.splice(0,6),D.unshift(i,0,i,0,i,1,i+c/2,1,i+c,1,i+c,0,i+c,0,i+c,-.6,i+c+.033,0),o=0;o<D.length;o+=2)D[o]-=i;for(o=0;o<m.length;o+=2)m[o]-=i,m[o+1]=1-m[o+1]}return c&&(Xs(D),D[2]="C"+D[2],Ns(e.squashID||t+"-squash","M"+D.join(","))),Xs(m),m[2]="C"+m[2],Ns(t,"M"+m.join(","))},Ys=function(){function t(t,e){this.ease=js(t,e)}return t.create=function(t,e){return js(t,e)},t.register=function(t){Bs=t,zs()},t}();Is()&&Bs.registerPlugin(Ys),Ys.version="3.12.5";
/*!
 * CustomWiggle 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/
var qs,Gs,Vs,Hs=function(){return qs||"undefined"!=typeof window&&(qs=window.gsap)&&qs.registerPlugin&&qs},$s={easeOut:"M0,1,C0.7,1,0.6,0,1,0",easeInOut:"M0,0,C0.1,0,0.24,1,0.444,1,0.644,1,0.6,0,1,0",anticipate:"M0,0,C0,0.222,0.024,0.386,0,0.4,0.18,0.455,0.65,0.646,0.7,0.67,0.9,0.76,1,0.846,1,1",uniform:"M0,0,C0,0.95,0,1,0,1,0,1,1,1,1,1,1,1,1,0,1,0"},Us=function(t){return t},Ws=function(t){if(!Gs)if(qs=Hs(),Vs=qs&&qs.parseEase("_CE")){for(var e in $s)$s[e]=Vs("",$s[e]);Gs=1,Zs("wiggle").config=function(t){return"object"==typeof t?Zs("",t):Zs("wiggle("+t+")",{wiggles:+t})}}else t&&console.warn("Please gsap.registerPlugin(CustomEase, CustomWiggle)")},Qs=function(t,e){return"function"!=typeof t&&(t=qs.parseEase(t)||Vs("",t)),t.custom||!e?t:function(e){return 1-t(e)}},Zs=function(t,e){Gs||Ws(1);var r,n,i,s,o,a,u,l,p,c=0|((e=e||{}).wiggles||10),h=1/c,d=h/2,f="anticipate"===e.type,g=$s[e.type]||$s.easeOut,_=Us;if(f&&(_=g,g=$s.easeOut),e.timingEase&&(_=Qs(e.timingEase)),e.amplitudeEase&&(g=Qs(e.amplitudeEase,!0)),l=[0,0,(a=_(d))/4,0,a/2,u=f?-g(d):g(d),a,u],"random"===e.type){for(l.length=4,r=_(h),n=2*Math.random()-1,p=2;p<c;p++)d=r,u=n,r=_(h*p),n=2*Math.random()-1,i=Math.atan2(n-l[l.length-3],r-l[l.length-4]),s=Math.cos(i)*h,o=Math.sin(i)*h,l.push(d-s,u-o,d,u,d+s,u+o);l.push(r,0,1,0)}else{for(p=1;p<c;p++)l.push(_(d+h/2),u),d+=h,u=(u>0?-1:1)*g(p*h),a=_(d),l.push(_(d-h/2),u,a,u);l.push(_(d+h/4),u,_(d+h/4),0,1,0)}for(p=l.length;--p>-1;)l[p]=~~(1e3*l[p])/1e3;return l[2]="C"+l[2],Vs(t,"M"+l.join(","))},Js=function(){function t(t,e){this.ease=Zs(t,e)}return t.create=function(t,e){return Zs(t,e)},t.register=function(t){qs=t,Ws()},t}();Hs()&&qs.registerPlugin(Js),Js.version="3.12.5";
/*!
 * matrix 3.12.5
 * https://gsap.com
 *
 * Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/
var Ks,to,eo,ro,no,io,so,oo,ao,uo="transform",lo=uo+"Origin",po=function(t){var e=t.ownerDocument||t;!(uo in t.style)&&"msTransform"in t.style&&(lo=(uo="msTransform")+"Origin");for(;e.parentNode&&(e=e.parentNode););if(to=window,so=new Do,e){Ks=e,eo=e.documentElement,ro=e.body,(oo=Ks.createElementNS("http://www.w3.org/2000/svg","g")).style.transform="none";var r=e.createElement("div"),n=e.createElement("div"),i=e&&(e.body||e.firstElementChild);i&&i.appendChild&&(i.appendChild(r),r.appendChild(n),r.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),ao=n.offsetParent!==r,i.removeChild(r))}return e},co=[],ho=[],fo=function(t){return t.ownerSVGElement||("svg"===(t.tagName+"").toLowerCase()?t:null)},go=function t(e){return"fixed"===to.getComputedStyle(e).position||((e=e.parentNode)&&1===e.nodeType?t(e):void 0)},_o=function t(e,r){if(e.parentNode&&(Ks||po(e))){var n=fo(e),i=n?n.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s=n?r?"rect":"g":"div",o=2!==r?0:100,a=3===r?100:0,u="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",l=Ks.createElementNS?Ks.createElementNS(i.replace(/^https/,"http"),s):Ks.createElement(s);return r&&(n?(io||(io=t(e)),l.setAttribute("width",.01),l.setAttribute("height",.01),l.setAttribute("transform","translate("+o+","+a+")"),io.appendChild(l)):(no||((no=t(e)).style.cssText=u),l.style.cssText=u+"width:0.1px;height:0.1px;top:"+a+"px;left:"+o+"px",no.appendChild(l))),l}throw"Need document and parent."},mo=function(t,e,r,n,i,s,o){return t.a=e,t.b=r,t.c=n,t.d=i,t.e=s,t.f=o,t},Do=function(){function t(t,e,r,n,i,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=1),void 0===i&&(i=0),void 0===s&&(s=0),mo(this,t,e,r,n,i,s)}var e=t.prototype;return e.inverse=function(){var t=this.a,e=this.b,r=this.c,n=this.d,i=this.e,s=this.f,o=t*n-e*r||1e-10;return mo(this,n/o,-e/o,-r/o,t/o,(r*s-n*i)/o,-(t*s-e*i)/o)},e.multiply=function(t){var e=this.a,r=this.b,n=this.c,i=this.d,s=this.e,o=this.f,a=t.a,u=t.c,l=t.b,p=t.d,c=t.e,h=t.f;return mo(this,a*e+l*n,a*r+l*i,u*e+p*n,u*r+p*i,s+c*e+h*n,o+c*r+h*i)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(t){var e=this.a,r=this.b,n=this.c,i=this.d,s=this.e,o=this.f;return e===t.a&&r===t.b&&n===t.c&&i===t.d&&s===t.e&&o===t.f},e.apply=function(t,e){void 0===e&&(e={});var r=t.x,n=t.y,i=this.a,s=this.b,o=this.c,a=this.d,u=this.e,l=this.f;return e.x=r*i+n*o+u||0,e.y=r*s+n*a+l||0,e},t}();function vo(t,e,r,n){if(!t||!t.parentNode||(Ks||po(t)).documentElement===t)return new Do;var i=function(t){for(var e,r;t&&t!==ro;)(r=t._gsap)&&r.uncache&&r.get(t,"x"),r&&!r.scaleX&&!r.scaleY&&r.renderTransform&&(r.scaleX=r.scaleY=1e-4,r.renderTransform(1,r),e?e.push(r):e=[r]),t=t.parentNode;return e}(t),s=fo(t)?co:ho,o=function(t,e){var r,n,i,s,o,a,u=fo(t),l=t===u,p=u?co:ho,c=t.parentNode;if(t===to)return t;if(p.length||p.push(_o(t,1),_o(t,2),_o(t,3)),r=u?io:no,u)l?(i=function(t){var e,r=t.getCTM();return r||(e=t.style[uo],t.style[uo]="none",t.appendChild(oo),r=oo.getCTM(),t.removeChild(oo),e?t.style[uo]=e:t.style.removeProperty(uo.replace(/([A-Z])/g,"-$1").toLowerCase())),r||so.clone()}(t),s=-i.e/i.a,o=-i.f/i.d,n=so):t.getBBox?(i=t.getBBox(),n=(n=t.transform?t.transform.baseVal:{}).numberOfItems?n.numberOfItems>1?function(t){for(var e=new Do,r=0;r<t.numberOfItems;r++)e.multiply(t.getItem(r).matrix);return e}(n):n.getItem(0).matrix:so,s=n.a*i.x+n.c*i.y,o=n.b*i.x+n.d*i.y):(n=new Do,s=o=0),e&&"g"===t.tagName.toLowerCase()&&(s=o=0),(l?u:c).appendChild(r),r.setAttribute("transform","matrix("+n.a+","+n.b+","+n.c+","+n.d+","+(n.e+s)+","+(n.f+o)+")");else{if(s=o=0,ao)for(n=t.offsetParent,i=t;i&&(i=i.parentNode)&&i!==n&&i.parentNode;)(to.getComputedStyle(i)[uo]+"").length>4&&(s=i.offsetLeft,o=i.offsetTop,i=0);if("absolute"!==(a=to.getComputedStyle(t)).position&&"fixed"!==a.position)for(n=t.offsetParent;c&&c!==n;)s+=c.scrollLeft||0,o+=c.scrollTop||0,c=c.parentNode;(i=r.style).top=t.offsetTop-o+"px",i.left=t.offsetLeft-s+"px",i[uo]=a[uo],i[lo]=a[lo],i.position="fixed"===a.position?"fixed":"absolute",t.parentNode.appendChild(r)}return r}(t,r),a=s[0].getBoundingClientRect(),u=s[1].getBoundingClientRect(),l=s[2].getBoundingClientRect(),p=o.parentNode,c=!n&&go(t),h=new Do((u.left-a.left)/100,(u.top-a.top)/100,(l.left-a.left)/100,(l.top-a.top)/100,a.left+(c?0:to.pageXOffset||Ks.scrollLeft||eo.scrollLeft||ro.scrollLeft||0),a.top+(c?0:to.pageYOffset||Ks.scrollTop||eo.scrollTop||ro.scrollTop||0));if(p.removeChild(o),i)for(a=i.length;a--;)(u=i[a]).scaleX=u.scaleY=0,u.renderTransform(1,u);return e?h.inverse():h}
/*!
 * MotionPathPlugin 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/var yo,xo,bo,wo,Co,Fo,Eo="x,translateX,left,marginLeft,xPercent".split(","),To="y,translateY,top,marginTop,yPercent".split(","),So=Math.PI/180,Mo=function(t,e,r,n){for(var i=e.length,s=2===n?0:n,o=0;o<i;o++)t[s]=parseFloat(e[o][r]),2===n&&(t[s+1]=0),s+=2;return t},Ao=function(t,e,r){return parseFloat(t._gsap.get(t,e,r||"px"))||0},Ro=function(t){var e,r=t[0],n=t[1];for(e=2;e<t.length;e+=2)r=t[e]+=r,n=t[e+1]+=n},Oo=function(t,e,r,n,i,s,o,a,u){return"cubic"===o.type?e=[e]:(!1!==o.fromCurrent&&e.unshift(Ao(r,n,a),i?Ao(r,i,u):0),o.relative&&Ro(e),e=[(i?ts:Ki)(e,o.curviness)]),e=s(No(e,r,o)),Io(t,r,n,e,"x",a),i&&Io(t,r,i,e,"y",u),Hi(e,o.resolution||(0===o.curviness?20:12))},Po=function(t){return t},ko=/[-+\.]*\d+\.?(?:e-|e\+)?\d*/g,Bo=function(t,e,r){var n,i=vo(t),s=0,o=0;return"svg"===(t.tagName+"").toLowerCase()?(n=t.viewBox.baseVal).width||(n={width:+t.getAttribute("width"),height:+t.getAttribute("height")}):n=e&&t.getBBox&&t.getBBox(),e&&"auto"!==e&&(s=e.push?e[0]*(n?n.width:t.offsetWidth||0):e.x,o=e.push?e[1]*(n?n.height:t.offsetHeight||0):e.y),r.apply(s||o?i.apply({x:s,y:o}):{x:i.e,y:i.f})},Lo=function(t,e,r,n){var i,s=vo(t.parentNode,!0,!0),o=s.clone().multiply(vo(e)),a=Bo(t,r,s),u=Bo(e,n,s),l=u.x,p=u.y;return o.e=o.f=0,"auto"===n&&e.getTotalLength&&"path"===e.tagName.toLowerCase()&&(i=e.getAttribute("d").match(ko)||[],l+=(i=o.apply({x:+i[0],y:+i[1]})).x,p+=i.y),i&&(l-=(i=o.apply(e.getBBox())).x,p-=i.y),o.e=l-a.x,o.f=p-a.y,o},No=function(t,e,r){var n,i,s,o=r.align,a=r.matrix,u=r.offsetX,l=r.offsetY,p=r.alignOrigin,c=t[0][0],h=t[0][1],d=Ao(e,"x"),f=Ao(e,"y");return t&&t.length?(o&&("self"===o||(n=wo(o)[0]||e)===e?Qi(t,1,0,0,1,d-c,f-h):(p&&!1!==p[2]?yo.set(e,{transformOrigin:100*p[0]+"% "+100*p[1]+"%"}):p=[Ao(e,"xPercent")/-100,Ao(e,"yPercent")/-100],s=(i=Lo(e,n,p,"auto")).apply({x:c,y:h}),Qi(t,i.a,i.b,i.c,i.d,d+i.e-(s.x-i.e),f+i.f-(s.y-i.f)))),a?Qi(t,a.a,a.b,a.c,a.d,a.e,a.f):(u||l)&&Qi(t,1,0,0,1,u||0,l||0),t):Xi("M0,0L0,0")},Io=function(t,e,r,n,i,s){var o=e._gsap,a=o.harness,u=a&&a.aliases&&a.aliases[r],l=u&&u.indexOf(",")<0?u:r,p=t._pt=new xo(t._pt,e,l,0,0,Po,0,o.set(e,l,t));p.u=bo(o.get(e,l,s))||0,p.path=n,p.pp=i,t._props.push(l)},zo={version:"3.12.5",name:"motionPath",register:function(t,e,r){bo=(yo=t).utils.getUnit,wo=yo.utils.toArray,Co=yo.core.getStyleSaver,Fo=yo.core.reverting||function(){},xo=r},init:function(t,e,r){if(!yo)return console.warn("Please gsap.registerPlugin(MotionPathPlugin)"),!1;"object"==typeof e&&!e.style&&e.path||(e={path:e});var n,i,s,o,a=[],u=e,l=u.path,p=u.autoRotate,c=u.unitX,h=u.unitY,d=u.x,f=u.y,g=l[0],_=(s=e.start,o="end"in e?e.end:1,function(t){return s||1!==o?Gi(t,s,o):t});if(this.rawPaths=a,this.target=t,this.tween=r,this.styles=Co&&Co(t,"transform"),(this.rotate=p||0===p)&&(this.rOffset=parseFloat(p)||0,this.radians=!!e.useRadians,this.rProp=e.rotation||"rotation",this.rSet=t._gsap.set(t,this.rProp,this),this.ru=bo(t._gsap.get(t,this.rProp))||0),Array.isArray(l)&&!("closed"in l)&&"number"!=typeof g){for(i in g)!d&&~Eo.indexOf(i)?d=i:!f&&~To.indexOf(i)&&(f=i);for(i in d&&f?a.push(Oo(this,Mo(Mo([],l,d,0),l,f,1),t,d,f,_,e,c||bo(l[0][d]),h||bo(l[0][f]))):d=f=0,g)i!==d&&i!==f&&a.push(Oo(this,Mo([],l,i,2),t,i,0,_,e,bo(l[0][i])))}else Hi(n=_(No(Xi(e.path),t,e)),e.resolution),a.push(n),Io(this,t,e.x||"x",n,"x",e.unitX||"px"),Io(this,t,e.y||"y",n,"y",e.unitY||"px")},render:function(t,e){var r=e.rawPaths,n=r.length,i=e._pt;if(e.tween._time||!Fo()){for(t>1?t=1:t<0&&(t=0);n--;)Wi(r[n],t,!n&&e.rotate,r[n]);for(;i;)i.set(i.t,i.p,i.path[i.pp]+i.u,i.d,t),i=i._next;e.rotate&&e.rSet(e.target,e.rProp,r[0].angle*(e.radians?So:1)+e.rOffset+e.ru,e,t)}else e.styles.revert()},getLength:function(t){return Hi(Xi(t)).totalLength},sliceRawPath:Gi,getRawPath:Xi,pointsToSegment:ts,stringToRawPath:Ji,rawPathToString:es,transformRawPath:Qi,getGlobalMatrix:vo,getPositionOnPath:Wi,cacheRawPathMeasurements:Hi,convertToPath:function(t,e){return wo(t).map((function(t){return function(t,e){var r,n,i,s,o,a,u,l,p,c,h,d,f,g,_,m,D,v,y,x,b,w,C=t.tagName.toLowerCase(),F=.552284749831;return"path"!==C&&t.getBBox?(a=function(t,e){var r,n=document.createElementNS("http://www.w3.org/2000/svg","path"),i=[].slice.call(t.attributes),s=i.length;for(e=","+e+",";--s>-1;)r=i[s].nodeName.toLowerCase(),e.indexOf(","+r+",")<0&&n.setAttributeNS(null,r,i[s].nodeValue);return n}(t,"x,y,width,height,cx,cy,rx,ry,r,x1,x2,y1,y2,points"),w=function(t,e){for(var r=e?e.split(","):[],n={},i=r.length;--i>-1;)n[r[i]]=+t.getAttribute(r[i])||0;return n}(t,Yi[C]),"rect"===C?(s=w.rx,o=w.ry||s,n=w.x,i=w.y,c=w.width-2*s,h=w.height-2*o,r=s||o?"M"+(m=(g=(f=n+s)+c)+s)+","+(v=i+o)+" V"+(y=v+h)+" C"+[m,x=y+o*F,_=g+s*F,b=y+o,g,b,g-(g-f)/3,b,f+(g-f)/3,b,f,b,d=n+s*(1-F),b,n,x,n,y,n,y-(y-v)/3,n,v+(y-v)/3,n,v,n,D=i+o*(1-F),d,i,f,i,f+(g-f)/3,i,g-(g-f)/3,i,g,i,_,i,m,D,m,v].join(",")+"z":"M"+(n+c)+","+i+" v"+h+" h"+-c+" v"+-h+" h"+c+"z"):"circle"===C||"ellipse"===C?("circle"===C?l=(s=o=w.r)*F:(s=w.rx,l=(o=w.ry)*F),r="M"+((n=w.cx)+s)+","+(i=w.cy)+" C"+[n+s,i+l,n+(u=s*F),i+o,n,i+o,n-u,i+o,n-s,i+l,n-s,i,n-s,i-l,n-u,i-o,n,i-o,n+u,i-o,n+s,i-l,n+s,i].join(",")+"z"):"line"===C?r="M"+w.x1+","+w.y1+" L"+w.x2+","+w.y2:"polyline"!==C&&"polygon"!==C||(r="M"+(n=(p=(t.getAttribute("points")+"").match(mi)||[]).shift())+","+(i=p.shift())+" L"+p.join(","),"polygon"===C&&(r+=","+n+","+i+"z")),a.setAttribute("d",es(a._gsRawPath=Ji(r))),e&&t.parentNode&&(t.parentNode.insertBefore(a,t),t.parentNode.removeChild(t)),a):t}(t,!1!==e)}))},convertCoordinates:function(t,e,r){var n=vo(e,!0,!0).multiply(vo(t));return r?n.apply(r):n},getAlignMatrix:Lo,getRelativePosition:function(t,e,r,n){var i=Lo(t,e,r,n);return{x:i.e,y:i.f}},arrayToRawPath:function(t,e){var r=Mo(Mo([],t,(e=e||{}).x||"x",0),t,e.y||"y",1);return e.relative&&Ro(r),["cubic"===e.type?r:ts(r,e.curviness)]}};function Xo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(yo||"undefined"!=typeof window&&(yo=window.gsap)&&yo.registerPlugin&&yo)&&yo.registerPlugin(zo);
/*!
 * Draggable 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
 */
var jo,Yo,qo,Go,Vo,Ho,$o,Uo,Wo,Qo,Zo,Jo,Ko,ta,ea,ra,na,ia,sa,oa,aa,ua,la=0,pa=function(){return"undefined"!=typeof window},ca=function(){return jo||pa()&&(jo=window.gsap)&&jo.registerPlugin&&jo},ha=function(t){return"function"==typeof t},da=function(t){return"object"==typeof t},fa=function(t){return void 0===t},ga=function(){return!1},_a="transform",ma="transformOrigin",Da=function(t){return Math.round(1e4*t)/1e4},va=Array.isArray,ya=function(t,e){var r=qo.createElementNS?qo.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):qo.createElement(t);return r.style?r:qo.createElement(t)},xa=180/Math.PI,ba=1e20,wa=new Do,Ca=Date.now||function(){return(new Date).getTime()},Fa=[],Ea={},Ta=0,Sa=/^(?:a|input|textarea|button|select)$/i,Ma=0,Aa={},Ra={},Oa=function(t,e){var r,n={};for(r in t)n[r]=e?t[r]*e:t[r];return n},Pa=function t(e,r){for(var n,i=e.length;i--;)r?e[i].style.touchAction=r:e[i].style.removeProperty("touch-action"),(n=e[i].children)&&n.length&&t(n,r)},ka=function(){return Fa.forEach((function(t){return t()}))},Ba=function(){return!Fa.length&&jo.ticker.remove(ka)},La=function(t){for(var e=Fa.length;e--;)Fa[e]===t&&Fa.splice(e,1);jo.to(Ba,{overwrite:!0,delay:15,duration:0,onComplete:Ba,data:"_draggable"})},Na=function(t,e,r,n){if(t.addEventListener){var i=Ko[e];n=n||(Zo?{passive:!1}:null),t.addEventListener(i||e,r,n),i&&e!==i&&t.addEventListener(e,r,n)}},Ia=function(t,e,r,n){if(t.removeEventListener){var i=Ko[e];t.removeEventListener(i||e,r,n),i&&e!==i&&t.removeEventListener(e,r,n)}},za=function(t){t.preventDefault&&t.preventDefault(),t.preventManipulation&&t.preventManipulation()},Xa=function t(e){ta=e.touches&&la<e.touches.length,Ia(e.target,"touchend",t)},ja=function(t){ta=t.touches&&la<t.touches.length,Na(t.target,"touchend",Xa)},Ya=function(t){return Yo.pageYOffset||t.scrollTop||t.documentElement.scrollTop||t.body.scrollTop||0},qa=function(t){return Yo.pageXOffset||t.scrollLeft||t.documentElement.scrollLeft||t.body.scrollLeft||0},Ga=function t(e,r){Na(e,"scroll",r),Ha(e.parentNode)||t(e.parentNode,r)},Va=function t(e,r){Ia(e,"scroll",r),Ha(e.parentNode)||t(e.parentNode,r)},Ha=function(t){return!(t&&t!==Go&&9!==t.nodeType&&t!==qo.body&&t!==Yo&&t.nodeType&&t.parentNode)},$a=function(t,e){var r="x"===e?"Width":"Height",n="scroll"+r,i="client"+r;return Math.max(0,Ha(t)?Math.max(Go[n],Vo[n])-(Yo["inner"+r]||Go[i]||Vo[i]):t[n]-t[i])},Ua=function t(e,r){var n=$a(e,"x"),i=$a(e,"y");Ha(e)?e=Ra:t(e.parentNode,r),e._gsMaxScrollX=n,e._gsMaxScrollY=i,r||(e._gsScrollX=e.scrollLeft||0,e._gsScrollY=e.scrollTop||0)},Wa=function(t,e,r){var n=t.style;n&&(fa(n[e])&&(e=Wo(e,t)||e),null==r?n.removeProperty&&n.removeProperty(e.replace(/([A-Z])/g,"-$1").toLowerCase()):n[e]=r)},Qa=function(t){return Yo.getComputedStyle(t instanceof Element?t:t.host||(t.parentNode||{}).host||t)},Za={},Ja=function(t){if(t===Yo)return Za.left=Za.top=0,Za.width=Za.right=Go.clientWidth||t.innerWidth||Vo.clientWidth||0,Za.height=Za.bottom=(t.innerHeight||0)-20<Go.clientHeight?Go.clientHeight:t.innerHeight||Vo.clientHeight||0,Za;var e=t.ownerDocument||qo,r=fa(t.pageX)?t.nodeType||fa(t.left)||fa(t.top)?Qo(t)[0].getBoundingClientRect():t:{left:t.pageX-qa(e),top:t.pageY-Ya(e),right:t.pageX-qa(e)+1,bottom:t.pageY-Ya(e)+1};return fa(r.right)&&!fa(r.width)?(r.right=r.left+r.width,r.bottom=r.top+r.height):fa(r.width)&&(r={width:r.right-r.left,height:r.bottom-r.top,right:r.right,left:r.left,bottom:r.bottom,top:r.top}),r},Ka=function(t,e,r){var n,i=t.vars,s=i[r],o=t._listeners[e];return ha(s)&&(n=s.apply(i.callbackScope||t,i[r+"Params"]||[t.pointerEvent])),o&&!1===t.dispatchEvent(e)&&(n=!1),n},tu=function(t,e){var r,n,i,s=Qo(t)[0];return s.nodeType||s===Yo?ru(s,e):fa(t.left)?{left:n=t.min||t.minX||t.minRotation||0,top:r=t.min||t.minY||0,width:(t.max||t.maxX||t.maxRotation||0)-n,height:(t.max||t.maxY||0)-r}:(i={x:0,y:0},{left:t.left-i.x,top:t.top-i.y,width:t.width,height:t.height})},eu={},ru=function(t,e){e=Qo(e)[0];var r,n,i,s,o,a,u,l,p,c,h,d,f,g=t.getBBox&&t.ownerSVGElement,_=t.ownerDocument||qo;if(t===Yo)i=Ya(_),n=(r=qa(_))+(_.documentElement.clientWidth||t.innerWidth||_.body.clientWidth||0),s=i+((t.innerHeight||0)-20<_.documentElement.clientHeight?_.documentElement.clientHeight:t.innerHeight||_.body.clientHeight||0);else{if(e===Yo||fa(e))return t.getBoundingClientRect();r=i=0,g?(h=(c=t.getBBox()).width,d=c.height):(t.viewBox&&(c=t.viewBox.baseVal)&&(r=c.x||0,i=c.y||0,h=c.width,d=c.height),h||(c="border-box"===(f=Qa(t)).boxSizing,h=(parseFloat(f.width)||t.clientWidth||0)+(c?0:parseFloat(f.borderLeftWidth)+parseFloat(f.borderRightWidth)),d=(parseFloat(f.height)||t.clientHeight||0)+(c?0:parseFloat(f.borderTopWidth)+parseFloat(f.borderBottomWidth)))),n=h,s=d}return t===e?{left:r,top:i,width:n-r,height:s-i}:(a=(o=vo(e,!0).multiply(vo(t))).apply({x:r,y:i}),u=o.apply({x:n,y:i}),l=o.apply({x:n,y:s}),p=o.apply({x:r,y:s}),{left:r=Math.min(a.x,u.x,l.x,p.x),top:i=Math.min(a.y,u.y,l.y,p.y),width:Math.max(a.x,u.x,l.x,p.x)-r,height:Math.max(a.y,u.y,l.y,p.y)-i})},nu=function(t,e,r,n,i,s){var o,a,u,l={};if(e)if(1!==i&&e instanceof Array){if(l.end=o=[],u=e.length,da(e[0]))for(a=0;a<u;a++)o[a]=Oa(e[a],i);else for(a=0;a<u;a++)o[a]=e[a]*i;r+=1.1,n-=1.1}else ha(e)?l.end=function(r){var n,s,o=e.call(t,r);if(1!==i)if(da(o)){for(s in n={},o)n[s]=o[s]*i;o=n}else o*=i;return o}:l.end=e;return(r||0===r)&&(l.max=r),(n||0===n)&&(l.min=n),s&&(l.velocity=0),l},iu=function t(e){var r;return!(!e||!e.getAttribute||e===Vo)&&(!("true"!==(r=e.getAttribute("data-clickable"))&&("false"===r||!Sa.test(e.nodeName+"")&&"true"!==e.getAttribute("contentEditable")))||t(e.parentNode))},su=function(t,e){for(var r,n=t.length;n--;)(r=t[n]).ondragstart=r.onselectstart=e?null:ga,jo.set(r,{lazy:!0,userSelect:e?"text":"none"})},ou=function t(e){return"fixed"===Qa(e).position||((e=e.parentNode)&&1===e.nodeType?t(e):void 0)},au=function(t,e){t=jo.utils.toArray(t)[0],e=e||{};var r,n,i,s,o,a,u=document.createElement("div"),l=u.style,p=t.firstChild,c=0,h=0,d=t.scrollTop,f=t.scrollLeft,g=t.scrollWidth,_=t.scrollHeight,m=0,D=0,v=0;aa&&!1!==e.force3D?(o="translate3d(",a="px,0px)"):_a&&(o="translate(",a="px)"),this.scrollTop=function(t,e){if(!arguments.length)return-this.top();this.top(-t,e)},this.scrollLeft=function(t,e){if(!arguments.length)return-this.left();this.left(-t,e)},this.left=function(r,n){if(!arguments.length)return-(t.scrollLeft+h);var i=t.scrollLeft-f,s=h;if((i>2||i<-2)&&!n)return f=t.scrollLeft,jo.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-f),void(e.onKill&&e.onKill());(r=-r)<0?(h=r-.5|0,r=0):r>D?(h=r-D|0,r=D):h=0,(h||s)&&(this._skip||(l[_a]=o+-h+"px,"+-c+a),h+m>=0&&(l.paddingRight=h+m+"px")),t.scrollLeft=0|r,f=t.scrollLeft},this.top=function(r,n){if(!arguments.length)return-(t.scrollTop+c);var i=t.scrollTop-d,s=c;if((i>2||i<-2)&&!n)return d=t.scrollTop,jo.killTweensOf(this,{top:1,scrollTop:1}),this.top(-d),void(e.onKill&&e.onKill());(r=-r)<0?(c=r-.5|0,r=0):r>v?(c=r-v|0,r=v):c=0,(c||s)&&(this._skip||(l[_a]=o+-h+"px,"+-c+a)),t.scrollTop=0|r,d=t.scrollTop},this.maxScrollTop=function(){return v},this.maxScrollLeft=function(){return D},this.disable=function(){for(p=u.firstChild;p;)s=p.nextSibling,t.appendChild(p),p=s;t===u.parentNode&&t.removeChild(u)},this.enable=function(){if((p=t.firstChild)!==u){for(;p;)s=p.nextSibling,u.appendChild(p),p=s;t.appendChild(u),this.calibrate()}},this.calibrate=function(e){var s,o,a,p=t.clientWidth===r;d=t.scrollTop,f=t.scrollLeft,p&&t.clientHeight===n&&u.offsetHeight===i&&g===t.scrollWidth&&_===t.scrollHeight&&!e||((c||h)&&(o=this.left(),a=this.top(),this.left(-t.scrollLeft),this.top(-t.scrollTop)),s=Qa(t),p&&!e||(l.display="block",l.width="auto",l.paddingRight="0px",(m=Math.max(0,t.scrollWidth-t.clientWidth))&&(m+=parseFloat(s.paddingLeft)+(ua?parseFloat(s.paddingRight):0))),l.display="inline-block",l.position="relative",l.overflow="visible",l.verticalAlign="top",l.boxSizing="content-box",l.width="100%",l.paddingRight=m+"px",ua&&(l.paddingBottom=s.paddingBottom),r=t.clientWidth,n=t.clientHeight,g=t.scrollWidth,_=t.scrollHeight,D=t.scrollWidth-r,v=t.scrollHeight-n,i=u.offsetHeight,l.display="block",(o||a)&&(this.left(o),this.top(a)))},this.content=u,this.element=t,this._skip=!1,this.enable()},uu=function(t){if(pa()&&document.body){var e=window&&window.navigator;Yo=window,qo=document,Go=qo.documentElement,Vo=qo.body,Ho=ya("div"),ia=!!window.PointerEvent,($o=ya("div")).style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",na="grab"===$o.style.cursor?"grab":"move",ea=e&&-1!==e.userAgent.toLowerCase().indexOf("android"),Jo="ontouchstart"in Go&&"orientation"in Yo||e&&(e.MaxTouchPoints>0||e.msMaxTouchPoints>0),n=ya("div"),s=(i=ya("div")).style,o=Vo,s.display="inline-block",s.position="relative",n.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",n.appendChild(i),o.appendChild(n),r=i.offsetHeight+18>n.scrollHeight,o.removeChild(n),ua=r,Ko=function(t){for(var e=t.split(","),r=(("onpointerdown"in Ho?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in Ho?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":t).split(",")),n={},i=4;--i>-1;)n[e[i]]=r[i],n[r[i]]=e[i];try{Go.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){Zo=1}}))}catch(t){}return n}("touchstart,touchmove,touchend,touchcancel"),Na(qo,"touchcancel",ga),Na(Yo,"touchmove",ga),Vo&&Vo.addEventListener("touchstart",ga),Na(qo,"contextmenu",(function(){for(var t in Ea)Ea[t].isPressed&&Ea[t].endDrag()})),jo=Uo=ca()}var r,n,i,s,o;jo?(ra=jo.plugins.inertia,sa=jo.core.context||function(){},Wo=jo.utils.checkPrefix,_a=Wo(_a),ma=Wo(ma),Qo=jo.utils.toArray,oa=jo.core.getStyleSaver,aa=!!Wo("perspective")):t&&console.warn("Please gsap.registerPlugin(Draggable)")},lu=function(t){var e,r;function n(e,r){var i;i=t.call(this)||this,Uo||uu(1),e=Qo(e)[0],i.styles=oa&&oa(e,"transform,left,top"),ra||(ra=jo.plugins.inertia),i.vars=r=Oa(r||{}),i.target=e,i.x=i.y=i.rotation=0,i.dragResistance=parseFloat(r.dragResistance)||0,i.edgeResistance=isNaN(r.edgeResistance)?1:parseFloat(r.edgeResistance)||0,i.lockAxis=r.lockAxis,i.autoScroll=r.autoScroll||0,i.lockedAxis=null,i.allowEventDefault=!!r.allowEventDefault,jo.getProperty(e,"x");var s,o,a,u,l,p,c,h,d,f,g,_,m,D,v,y,x,b,w,C,F,E,T,S,M,A,R,O,P,k,B,L,N,I=(r.type||"x,y").toLowerCase(),z=~I.indexOf("x")||~I.indexOf("y"),X=-1!==I.indexOf("rotation"),j=X?"rotation":z?"x":"left",Y=z?"y":"top",q=!(!~I.indexOf("x")&&!~I.indexOf("left")&&"scroll"!==I),G=!(!~I.indexOf("y")&&!~I.indexOf("top")&&"scroll"!==I),V=r.minimumMovement||2,H=Xo(i),$=Qo(r.trigger||r.handle||e),U={},W=0,Q=!1,Z=r.autoScrollMarginTop||40,J=r.autoScrollMarginRight||40,K=r.autoScrollMarginBottom||40,tt=r.autoScrollMarginLeft||40,et=r.clickableTest||iu,rt=0,nt=e._gsap||jo.core.getCache(e),it=ou(e),st=function(t,r){return parseFloat(nt.get(e,t,r))},ot=e.ownerDocument||qo,at=function(t){return za(t),t.stopImmediatePropagation&&t.stopImmediatePropagation(),!1},ut=function t(r){if(H.autoScroll&&H.isDragging&&(Q||x)){var n,i,s,a,u,l,p,c,d=e,f=15*H.autoScroll;for(Q=!1,Ra.scrollTop=null!=Yo.pageYOffset?Yo.pageYOffset:null!=ot.documentElement.scrollTop?ot.documentElement.scrollTop:ot.body.scrollTop,Ra.scrollLeft=null!=Yo.pageXOffset?Yo.pageXOffset:null!=ot.documentElement.scrollLeft?ot.documentElement.scrollLeft:ot.body.scrollLeft,a=H.pointerX-Ra.scrollLeft,u=H.pointerY-Ra.scrollTop;d&&!i;)n=(i=Ha(d.parentNode))?Ra:d.parentNode,s=i?{bottom:Math.max(Go.clientHeight,Yo.innerHeight||0),right:Math.max(Go.clientWidth,Yo.innerWidth||0),left:0,top:0}:n.getBoundingClientRect(),l=p=0,G&&((c=n._gsMaxScrollY-n.scrollTop)<0?p=c:u>s.bottom-K&&c?(Q=!0,p=Math.min(c,f*(1-Math.max(0,s.bottom-u)/K)|0)):u<s.top+Z&&n.scrollTop&&(Q=!0,p=-Math.min(n.scrollTop,f*(1-Math.max(0,u-s.top)/Z)|0)),p&&(n.scrollTop+=p)),q&&((c=n._gsMaxScrollX-n.scrollLeft)<0?l=c:a>s.right-J&&c?(Q=!0,l=Math.min(c,f*(1-Math.max(0,s.right-a)/J)|0)):a<s.left+tt&&n.scrollLeft&&(Q=!0,l=-Math.min(n.scrollLeft,f*(1-Math.max(0,a-s.left)/tt)|0)),l&&(n.scrollLeft+=l)),i&&(l||p)&&(Yo.scrollTo(n.scrollLeft,n.scrollTop),xt(H.pointerX+l,H.pointerY+p)),d=n}if(x){var g=H.x,_=H.y;X?(H.deltaX=g-parseFloat(nt.rotation),H.rotation=g,nt.rotation=g+"deg",nt.renderTransform(1,nt)):o?(G&&(H.deltaY=_-o.top(),o.top(_)),q&&(H.deltaX=g-o.left(),o.left(g))):z?(G&&(H.deltaY=_-parseFloat(nt.y),nt.y=_+"px"),q&&(H.deltaX=g-parseFloat(nt.x),nt.x=g+"px"),nt.renderTransform(1,nt)):(G&&(H.deltaY=_-parseFloat(e.style.top||0),e.style.top=_+"px"),q&&(H.deltaX=g-parseFloat(e.style.left||0),e.style.left=g+"px")),!h||r||O||(O=!0,!1===Ka(H,"drag","onDrag")&&(q&&(H.x-=H.deltaX),G&&(H.y-=H.deltaY),t(!0)),O=!1)}x=!1},lt=function(t,r){var n,i,s=H.x,a=H.y;e._gsap||(nt=jo.core.getCache(e)),nt.uncache&&jo.getProperty(e,"x"),z?(H.x=parseFloat(nt.x),H.y=parseFloat(nt.y)):X?H.x=H.rotation=parseFloat(nt.rotation):o?(H.y=o.top(),H.x=o.left()):(H.y=parseFloat(e.style.top||(i=Qa(e))&&i.top)||0,H.x=parseFloat(e.style.left||(i||{}).left)||0),(w||C||F)&&!r&&(H.isDragging||H.isThrowing)&&(F&&(Aa.x=H.x,Aa.y=H.y,(n=F(Aa)).x!==H.x&&(H.x=n.x,x=!0),n.y!==H.y&&(H.y=n.y,x=!0)),w&&(n=w(H.x))!==H.x&&(H.x=n,X&&(H.rotation=n),x=!0),C&&((n=C(H.y))!==H.y&&(H.y=n),x=!0)),x&&ut(!0),t||(H.deltaX=H.x-s,H.deltaY=H.y-a,Ka(H,"throwupdate","onThrowUpdate"))},pt=function(t,e,r,n){return null==e&&(e=-ba),null==r&&(r=ba),ha(t)?function(i){var s=H.isPressed?1-H.edgeResistance:1;return t.call(H,(i>r?r+(i-r)*s:i<e?e+(i-e)*s:i)*n)*n}:va(t)?function(n){for(var i,s,o=t.length,a=0,u=ba;--o>-1;)(s=(i=t[o])-n)<0&&(s=-s),s<u&&i>=e&&i<=r&&(a=o,u=s);return t[a]}:isNaN(t)?function(t){return t}:function(){return t*n}},ct=function(){var t,n,i,s;c=!1,o?(o.calibrate(),H.minX=g=-o.maxScrollLeft(),H.minY=m=-o.maxScrollTop(),H.maxX=f=H.maxY=_=0,c=!0):r.bounds&&(t=tu(r.bounds,e.parentNode),X?(H.minX=g=t.left,H.maxX=f=t.left+t.width,H.minY=m=H.maxY=_=0):fa(r.bounds.maxX)&&fa(r.bounds.maxY)?(n=tu(e,e.parentNode),H.minX=g=Math.round(st(j,"px")+t.left-n.left),H.minY=m=Math.round(st(Y,"px")+t.top-n.top),H.maxX=f=Math.round(g+(t.width-n.width)),H.maxY=_=Math.round(m+(t.height-n.height))):(t=r.bounds,H.minX=g=t.minX,H.minY=m=t.minY,H.maxX=f=t.maxX,H.maxY=_=t.maxY),g>f&&(H.minX=f,H.maxX=f=g,g=H.minX),m>_&&(H.minY=_,H.maxY=_=m,m=H.minY),X&&(H.minRotation=g,H.maxRotation=f),c=!0),r.liveSnap&&(i=!0===r.liveSnap?r.snap||{}:r.liveSnap,s=va(i)||ha(i),X?(w=pt(s?i:i.rotation,g,f,1),C=null):i.points?F=function(t,e,r,n,i,s,o){return s=s&&s<ba?s*s:ba,ha(t)?function(a){var u,l,p,c=H.isPressed?1-H.edgeResistance:1,h=a.x,d=a.y;return a.x=h=h>r?r+(h-r)*c:h<e?e+(h-e)*c:h,a.y=d=d>i?i+(d-i)*c:d<n?n+(d-n)*c:d,(u=t.call(H,a))!==a&&(a.x=u.x,a.y=u.y),1!==o&&(a.x*=o,a.y*=o),s<ba&&(l=a.x-h)*l+(p=a.y-d)*p>s&&(a.x=h,a.y=d),a}:va(t)?function(e){for(var r,n,i,o,a=t.length,u=0,l=ba;--a>-1;)(o=(r=(i=t[a]).x-e.x)*r+(n=i.y-e.y)*n)<l&&(u=a,l=o);return l<=s?t[u]:e}:function(t){return t}}(s?i:i.points,g,f,m,_,i.radius,o?-1:1):(q&&(w=pt(s?i:i.x||i.left||i.scrollLeft,g,f,o?-1:1)),G&&(C=pt(s?i:i.y||i.top||i.scrollTop,m,_,o?-1:1))))},ht=function(){H.isThrowing=!1,Ka(H,"throwcomplete","onThrowComplete")},dt=function(){H.isThrowing=!1},ft=function(t,n){var i,s,a,u;t&&ra?(!0===t&&(i=r.snap||r.liveSnap||{},s=va(i)||ha(i),t={resistance:(r.throwResistance||r.resistance||1e3)/(X?10:1)},X?t.rotation=nu(H,s?i:i.rotation,f,g,1,n):(q&&(t[j]=nu(H,s?i:i.points||i.x||i.left,f,g,o?-1:1,n||"x"===H.lockedAxis)),G&&(t[Y]=nu(H,s?i:i.points||i.y||i.top,_,m,o?-1:1,n||"y"===H.lockedAxis)),(i.points||va(i)&&da(i[0]))&&(t.linkedProps=j+","+Y,t.radius=i.radius))),H.isThrowing=!0,u=isNaN(r.overshootTolerance)?1===r.edgeResistance?0:1-H.edgeResistance+.2:r.overshootTolerance,t.duration||(t.duration={max:Math.max(r.minDuration||0,"maxDuration"in r?r.maxDuration:2),min:isNaN(r.minDuration)?0===u||da(t)&&t.resistance>1e3?0:.5:r.minDuration,overshoot:u}),H.tween=a=jo.to(o||e,{inertia:t,data:"_draggable",inherit:!1,onComplete:ht,onInterrupt:dt,onUpdate:r.fastMode?Ka:lt,onUpdateParams:r.fastMode?[H,"onthrowupdate","onThrowUpdate"]:i&&i.radius?[!1,!0]:[]}),r.fastMode||(o&&(o._skip=!0),a.render(1e9,!0,!0),lt(!0,!0),H.endX=H.x,H.endY=H.y,X&&(H.endRotation=H.x),a.play(0),lt(!0,!0),o&&(o._skip=!1))):c&&H.applyBounds()},gt=function(t){var r,n=S;S=vo(e.parentNode,!0),t&&H.isPressed&&!S.equals(n||new Do)&&(r=n.inverse().apply({x:a,y:u}),S.apply(r,r),a=r.x,u=r.y),S.equals(wa)&&(S=null)},_t=function(){var t,r,n,i=1-H.edgeResistance,s=it?qa(ot):0,h=it?Ya(ot):0;z&&(nt.x=st(j,"px")+"px",nt.y=st(Y,"px")+"px",nt.renderTransform()),gt(!1),eu.x=H.pointerX-s,eu.y=H.pointerY-h,S&&S.apply(eu,eu),a=eu.x,u=eu.y,x&&(xt(H.pointerX,H.pointerY),ut(!0)),L=vo(e),o?(ct(),p=o.top(),l=o.left()):(mt()?(lt(!0,!0),ct()):H.applyBounds(),X?(t=e.ownerSVGElement?[nt.xOrigin-e.getBBox().x,nt.yOrigin-e.getBBox().y]:(Qa(e)[ma]||"0 0").split(" "),y=H.rotationOrigin=vo(e).apply({x:parseFloat(t[0])||0,y:parseFloat(t[1])||0}),lt(!0,!0),r=H.pointerX-y.x-s,n=y.y-H.pointerY+h,l=H.x,p=H.y=Math.atan2(n,r)*xa):(p=st(Y,"px"),l=st(j,"px"))),c&&i&&(l>f?l=f+(l-f)/i:l<g&&(l=g-(g-l)/i),X||(p>_?p=_+(p-_)/i:p<m&&(p=m-(m-p)/i))),H.startX=l=Da(l),H.startY=p=Da(p)},mt=function(){return H.tween&&H.tween.isActive()},Dt=function(){!$o.parentNode||mt()||H.isDragging||$o.parentNode.removeChild($o)},vt=function(t,i){var l;if(!s||H.isPressed||!t||!("mousedown"!==t.type&&"pointerdown"!==t.type||i)&&Ca()-rt<30&&Ko[H.pointerEvent.type])B&&t&&s&&za(t);else{if(M=mt(),N=!1,H.pointerEvent=t,Ko[t.type]?(T=~t.type.indexOf("touch")?t.currentTarget||t.target:ot,Na(T,"touchend",bt),Na(T,"touchmove",yt),Na(T,"touchcancel",bt),Na(ot,"touchstart",ja)):(T=null,Na(ot,"mousemove",yt)),R=null,ia&&T||(Na(ot,"mouseup",bt),t&&t.target&&Na(t.target,"mouseup",bt)),E=et.call(H,t.target)&&!1===r.dragClickables&&!i)return Na(t.target,"change",bt),Ka(H,"pressInit","onPressInit"),Ka(H,"press","onPress"),su($,!0),void(B=!1);var p;if(A=!(!T||q===G||!1===H.vars.allowNativeTouchScrolling||H.vars.allowContextMenu&&t&&(t.ctrlKey||t.which>2))&&(q?"y":"x"),(B=!A&&!H.allowEventDefault)&&(za(t),Na(Yo,"touchforcechange",za)),t.changedTouches?(t=D=t.changedTouches[0],v=t.identifier):t.pointerId?v=t.pointerId:D=v=null,la++,p=ut,Fa.push(p),1===Fa.length&&jo.ticker.add(ka),u=H.pointerY=t.pageY,a=H.pointerX=t.pageX,Ka(H,"pressInit","onPressInit"),(A||H.autoScroll)&&Ua(e.parentNode),!e.parentNode||!H.autoScroll||o||X||!e.parentNode._gsMaxScrollX||$o.parentNode||e.getBBox||($o.style.width=e.parentNode.scrollWidth+"px",e.parentNode.appendChild($o)),_t(),H.tween&&H.tween.kill(),H.isThrowing=!1,jo.killTweensOf(o||e,U,!0),o&&jo.killTweensOf(e,{scrollTo:1},!0),H.tween=H.lockedAxis=null,(r.zIndexBoost||!X&&!o&&!1!==r.zIndexBoost)&&(e.style.zIndex=n.zIndex++),H.isPressed=!0,h=!(!r.onDrag&&!H._listeners.drag),d=!(!r.onMove&&!H._listeners.move),!1!==r.cursor||r.activeCursor)for(l=$.length;--l>-1;)jo.set($[l],{cursor:r.activeCursor||r.cursor||("grab"===na?"grabbing":na)});Ka(H,"press","onPress")}},yt=function(t){var r,n,i,o,l,p,c=t;if(s&&!ta&&H.isPressed&&t){if(H.pointerEvent=t,r=t.changedTouches){if((t=r[0])!==D&&t.identifier!==v){for(o=r.length;--o>-1&&(t=r[o]).identifier!==v&&t.target!==e;);if(o<0)return}}else if(t.pointerId&&v&&t.pointerId!==v)return;T&&A&&!R&&(eu.x=t.pageX-(it?qa(ot):0),eu.y=t.pageY-(it?Ya(ot):0),S&&S.apply(eu,eu),n=eu.x,i=eu.y,((l=Math.abs(n-a))!==(p=Math.abs(i-u))&&(l>V||p>V)||ea&&A===R)&&(R=l>p&&q?"x":"y",A&&R!==A&&Na(Yo,"touchforcechange",za),!1!==H.vars.lockAxisOnTouchScroll&&q&&G&&(H.lockedAxis="x"===R?"y":"x",ha(H.vars.onLockAxis)&&H.vars.onLockAxis.call(H,c)),ea&&A===R))?bt(c):(H.allowEventDefault||A&&(!R||A===R)||!1===c.cancelable?B&&(B=!1):(za(c),B=!0),H.autoScroll&&(Q=!0),xt(t.pageX,t.pageY,d))}else B&&t&&s&&za(t)},xt=function(t,e,r){var n,i,s,o,h,d,D=1-H.dragResistance,v=1-H.edgeResistance,b=H.pointerX,E=H.pointerY,T=p,M=H.x,A=H.y,R=H.endX,O=H.endY,P=H.endRotation,k=x;H.pointerX=t,H.pointerY=e,it&&(t-=qa(ot),e-=Ya(ot)),X?(o=Math.atan2(y.y-e,t-y.x)*xa,(h=H.y-o)>180?(p-=360,H.y=o):h<-180&&(p+=360,H.y=o),H.x!==l||Math.abs(p-o)>V?(H.y=o,s=l+(p-o)*D):s=l):(S&&(d=t*S.a+e*S.c+S.e,e=t*S.b+e*S.d+S.f,t=d),(i=e-u)<V&&i>-V&&(i=0),(n=t-a)<V&&n>-V&&(n=0),(H.lockAxis||H.lockedAxis)&&(n||i)&&((d=H.lockedAxis)||(H.lockedAxis=d=q&&Math.abs(n)>Math.abs(i)?"y":G?"x":null,d&&ha(H.vars.onLockAxis)&&H.vars.onLockAxis.call(H,H.pointerEvent)),"y"===d?i=0:"x"===d&&(n=0)),s=Da(l+n*D),o=Da(p+i*D)),(w||C||F)&&(H.x!==s||H.y!==o&&!X)&&(F&&(Aa.x=s,Aa.y=o,d=F(Aa),s=Da(d.x),o=Da(d.y)),w&&(s=Da(w(s))),C&&(o=Da(C(o)))),c&&(s>f?s=f+Math.round((s-f)*v):s<g&&(s=g+Math.round((s-g)*v)),X||(o>_?o=Math.round(_+(o-_)*v):o<m&&(o=Math.round(m+(o-m)*v)))),(H.x!==s||H.y!==o&&!X)&&(X?(H.endRotation=H.x=H.endX=s,x=!0):(G&&(H.y=H.endY=o,x=!0),q&&(H.x=H.endX=s,x=!0)),r&&!1===Ka(H,"move","onMove")?(H.pointerX=b,H.pointerY=E,p=T,H.x=M,H.y=A,H.endX=R,H.endY=O,H.endRotation=P,x=k):!H.isDragging&&H.isPressed&&(H.isDragging=N=!0,Ka(H,"dragstart","onDragStart")))},bt=function t(n,i){if(s&&H.isPressed&&(!n||null==v||i||!(n.pointerId&&n.pointerId!==v&&n.target!==e||n.changedTouches&&!function(t,e){for(var r=t.length;r--;)if(t[r].identifier===e)return!0}(n.changedTouches,v)))){H.isPressed=!1;var o,a,u,l,p,c=n,h=H.isDragging,d=H.vars.allowContextMenu&&n&&(n.ctrlKey||n.which>2),f=jo.delayedCall(.001,Dt);if(T?(Ia(T,"touchend",t),Ia(T,"touchmove",yt),Ia(T,"touchcancel",t),Ia(ot,"touchstart",ja)):Ia(ot,"mousemove",yt),Ia(Yo,"touchforcechange",za),ia&&T||(Ia(ot,"mouseup",t),n&&n.target&&Ia(n.target,"mouseup",t)),x=!1,h&&(W=Ma=Ca(),H.isDragging=!1),La(ut),E&&!d)return n&&(Ia(n.target,"change",t),H.pointerEvent=c),su($,!1),Ka(H,"release","onRelease"),Ka(H,"click","onClick"),void(E=!1);for(a=$.length;--a>-1;)Wa($[a],"cursor",r.cursor||(!1!==r.cursor?na:null));if(la--,n){if((o=n.changedTouches)&&(n=o[0])!==D&&n.identifier!==v){for(a=o.length;--a>-1&&(n=o[a]).identifier!==v&&n.target!==e;);if(a<0&&!i)return}H.pointerEvent=c,H.pointerX=n.pageX,H.pointerY=n.pageY}return d&&c?(za(c),B=!0,Ka(H,"release","onRelease")):c&&!h?(B=!1,M&&(r.snap||r.bounds)&&ft(r.inertia||r.throwProps),Ka(H,"release","onRelease"),ea&&"touchmove"===c.type||-1!==c.type.indexOf("cancel")||(Ka(H,"click","onClick"),Ca()-rt<300&&Ka(H,"doubleclick","onDoubleClick"),l=c.target||e,rt=Ca(),p=function(){rt===P||!H.enabled()||H.isPressed||c.defaultPrevented||(l.click?l.click():ot.createEvent&&((u=ot.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,Yo,1,H.pointerEvent.screenX,H.pointerEvent.screenY,H.pointerX,H.pointerY,!1,!1,!1,!1,0,null),l.dispatchEvent(u)))},ea||c.defaultPrevented||jo.delayedCall(.05,p))):(ft(r.inertia||r.throwProps),H.allowEventDefault||!c||!1===r.dragClickables&&et.call(H,c.target)||!h||A&&(!R||A!==R)||!1===c.cancelable?B=!1:(B=!0,za(c)),Ka(H,"release","onRelease")),mt()&&f.duration(H.tween.duration()),h&&Ka(H,"dragend","onDragEnd"),!0}B&&n&&s&&za(n)},wt=function(t){if(t&&H.isDragging&&!o){var r=t.target||e.parentNode,n=r.scrollLeft-r._gsScrollX,i=r.scrollTop-r._gsScrollY;(n||i)&&(S?(a-=n*S.a+i*S.c,u-=i*S.d+n*S.b):(a-=n,u-=i),r._gsScrollX+=n,r._gsScrollY+=i,xt(H.pointerX,H.pointerY))}},Ct=function(t){var e=Ca(),r=e-rt<100,n=e-W<50,i=r&&P===rt,s=H.pointerEvent&&H.pointerEvent.defaultPrevented,o=r&&k===rt,a=t.isTrusted||null==t.isTrusted&&r&&i;if((i||n&&!1!==H.vars.suppressClickOnDrag)&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),r&&(!H.pointerEvent||!H.pointerEvent.defaultPrevented)&&(!i||a&&!o))return a&&i&&(k=rt),void(P=rt);(H.isPressed||n||r)&&(a&&t.detail&&r&&!s||za(t)),r||n||N||(t&&t.target&&(H.pointerEvent=t),Ka(H,"click","onClick"))},Ft=function(t){return S?{x:t.x*S.a+t.y*S.c+S.e,y:t.x*S.b+t.y*S.d+S.f}:{x:t.x,y:t.y}};return(b=n.get(e))&&b.kill(),i.startDrag=function(t,r){var n,i,s,o;vt(t||H.pointerEvent,!0),r&&!H.hitTest(t||H.pointerEvent)&&(n=Ja(t||H.pointerEvent),i=Ja(e),s=Ft({x:n.left+n.width/2,y:n.top+n.height/2}),o=Ft({x:i.left+i.width/2,y:i.top+i.height/2}),a-=s.x-o.x,u-=s.y-o.y),H.isDragging||(H.isDragging=N=!0,Ka(H,"dragstart","onDragStart"))},i.drag=yt,i.endDrag=function(t){return bt(t||H.pointerEvent,!0)},i.timeSinceDrag=function(){return H.isDragging?0:(Ca()-W)/1e3},i.timeSinceClick=function(){return(Ca()-rt)/1e3},i.hitTest=function(t,e){return n.hitTest(H.target,t,e)},i.getDirection=function(t,r){var n,i,s,o,a,u,c="velocity"===t&&ra?t:da(t)&&!X?"element":"start";return"element"===c&&(a=Ja(H.target),u=Ja(t)),n="start"===c?H.x-l:"velocity"===c?ra.getVelocity(e,j):a.left+a.width/2-(u.left+u.width/2),X?n<0?"counter-clockwise":"clockwise":(r=r||2,i="start"===c?H.y-p:"velocity"===c?ra.getVelocity(e,Y):a.top+a.height/2-(u.top+u.height/2),o=(s=Math.abs(n/i))<1/r?"":n<0?"left":"right",s<r&&(""!==o&&(o+="-"),o+=i<0?"up":"down"),o)},i.applyBounds=function(t,n){var i,s,o,a,u,l;if(t&&r.bounds!==t)return r.bounds=t,H.update(!0,n);if(lt(!0),ct(),c&&!mt()){if(i=H.x,s=H.y,i>f?i=f:i<g&&(i=g),s>_?s=_:s<m&&(s=m),(H.x!==i||H.y!==s)&&(o=!0,H.x=H.endX=i,X?H.endRotation=i:H.y=H.endY=s,x=!0,ut(!0),H.autoScroll&&!H.isDragging))for(Ua(e.parentNode),a=e,Ra.scrollTop=null!=Yo.pageYOffset?Yo.pageYOffset:null!=ot.documentElement.scrollTop?ot.documentElement.scrollTop:ot.body.scrollTop,Ra.scrollLeft=null!=Yo.pageXOffset?Yo.pageXOffset:null!=ot.documentElement.scrollLeft?ot.documentElement.scrollLeft:ot.body.scrollLeft;a&&!l;)u=(l=Ha(a.parentNode))?Ra:a.parentNode,G&&u.scrollTop>u._gsMaxScrollY&&(u.scrollTop=u._gsMaxScrollY),q&&u.scrollLeft>u._gsMaxScrollX&&(u.scrollLeft=u._gsMaxScrollX),a=u;H.isThrowing&&(o||H.endX>f||H.endX<g||H.endY>_||H.endY<m)&&ft(r.inertia||r.throwProps,o)}return H},i.update=function(t,r,n){if(r&&H.isPressed){var i=vo(e),s=L.apply({x:H.x-l,y:H.y-p}),o=vo(e.parentNode,!0);o.apply({x:i.e-s.x,y:i.f-s.y},s),H.x-=s.x-o.e,H.y-=s.y-o.f,ut(!0),_t()}var a=H.x,u=H.y;return gt(!r),t?H.applyBounds():(x&&n&&ut(!0),lt(!0)),r&&(xt(H.pointerX,H.pointerY),x&&ut(!0)),H.isPressed&&!r&&(q&&Math.abs(a-H.x)>.01||G&&Math.abs(u-H.y)>.01&&!X)&&_t(),H.autoScroll&&(Ua(e.parentNode,H.isDragging),Q=H.isDragging,ut(!0),Va(e,wt),Ga(e,wt)),H},i.enable=function(t){var n,i,a,u={lazy:!0};if(!1!==r.cursor&&(u.cursor=r.cursor||na),jo.utils.checkPrefix("touchCallout")&&(u.touchCallout="none"),"soft"!==t){for(Pa($,q===G?"none":r.allowNativeTouchScrolling&&e.scrollHeight===e.clientHeight==(e.scrollWidth===e.clientHeight)||r.allowEventDefault?"manipulation":q?"pan-y":"pan-x"),i=$.length;--i>-1;)a=$[i],ia||Na(a,"mousedown",vt),Na(a,"touchstart",vt),Na(a,"click",Ct,!0),jo.set(a,u),a.getBBox&&a.ownerSVGElement&&q!==G&&jo.set(a.ownerSVGElement,{touchAction:r.allowNativeTouchScrolling||r.allowEventDefault?"manipulation":q?"pan-y":"pan-x"}),r.allowContextMenu||Na(a,"contextmenu",at);su($,!1)}return Ga(e,wt),s=!0,ra&&"soft"!==t&&ra.track(o||e,z?"x,y":X?"rotation":"top,left"),e._gsDragID=n="d"+Ta++,Ea[n]=H,o&&(o.enable(),o.element._gsDragID=n),(r.bounds||X)&&_t(),r.bounds&&H.applyBounds(),H},i.disable=function(t){for(var r,n=H.isDragging,i=$.length;--i>-1;)Wa($[i],"cursor",null);if("soft"!==t){for(Pa($,null),i=$.length;--i>-1;)r=$[i],Wa(r,"touchCallout",null),Ia(r,"mousedown",vt),Ia(r,"touchstart",vt),Ia(r,"click",Ct,!0),Ia(r,"contextmenu",at);su($,!0),T&&(Ia(T,"touchcancel",bt),Ia(T,"touchend",bt),Ia(T,"touchmove",yt)),Ia(ot,"mouseup",bt),Ia(ot,"mousemove",yt)}return Va(e,wt),s=!1,ra&&"soft"!==t&&(ra.untrack(o||e,z?"x,y":X?"rotation":"top,left"),H.tween&&H.tween.kill()),o&&o.disable(),La(ut),H.isDragging=H.isPressed=E=!1,n&&Ka(H,"dragend","onDragEnd"),H},i.enabled=function(t,e){return arguments.length?t?H.enable(e):H.disable(e):s},i.kill=function(){return H.isThrowing=!1,H.tween&&H.tween.kill(),H.disable(),jo.set($,{clearProps:"userSelect"}),delete Ea[e._gsDragID],H},i.revert=function(){this.kill(),this.styles&&this.styles.revert()},~I.indexOf("scroll")&&(o=i.scrollProxy=new au(e,function(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}({onKill:function(){H.isPressed&&bt(null)}},r)),e.style.overflowY=G&&!Jo?"auto":"hidden",e.style.overflowX=q&&!Jo?"auto":"hidden",e=o.content),X?U.rotation=1:(q&&(U[j]=1),G&&(U[Y]=1)),nt.force3D=!("force3D"in r)||r.force3D,sa(Xo(i)),i.enable(),i}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,n.register=function(t){jo=t,uu()},n.create=function(t,e){return Uo||uu(!0),Qo(t).map((function(t){return new n(t,e)}))},n.get=function(t){return Ea[(Qo(t)[0]||{})._gsDragID]},n.timeSinceDrag=function(){return(Ca()-Ma)/1e3},n.hitTest=function(t,e,r){if(t===e)return!1;var n,i,s,o=Ja(t),a=Ja(e),u=o.top,l=o.left,p=o.right,c=o.bottom,h=o.width,d=o.height,f=a.left>p||a.right<l||a.top>c||a.bottom<u;return f||!r?!f:(s=-1!==(r+"").indexOf("%"),r=parseFloat(r)||0,(n={left:Math.max(l,a.left),top:Math.max(u,a.top)}).width=Math.min(p,a.right)-n.left,n.height=Math.min(c,a.bottom)-n.top,!(n.width<0||n.height<0)&&(s?(r*=.01,(i=n.width*n.height)>=h*d*r||i>=a.width*a.height*r):n.width>r&&n.height>r))},n}(function(){function t(t){this._listeners={},this.target=t||this}var e=t.prototype;return e.addEventListener=function(t,e){var r=this._listeners[t]||(this._listeners[t]=[]);~r.indexOf(e)||r.push(e)},e.removeEventListener=function(t,e){var r=this._listeners[t],n=r&&r.indexOf(e);n>=0&&r.splice(n,1)},e.dispatchEvent=function(t){var e,r=this;return(this._listeners[t]||[]).forEach((function(n){return!1===n.call(r,{type:t,target:r.target})&&(e=!1)})),e},t}());!function(t,e){for(var r in e)r in t||(t[r]=e[r])}(lu.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1}),lu.zIndex=1e3,lu.version="3.12.5",ca()&&jo.registerPlugin(lu);
/*!
 * VelocityTracker: 3.12.5
 * https://gsap.com
 *
 * Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/
var pu,cu,hu,du,fu,gu,_u,mu,Du=function(){return pu||"undefined"!=typeof window&&(pu=window.gsap)},vu={},yu=function(t){return mu(t).id},xu=function(t){return vu[yu("string"==typeof t?hu(t)[0]:t)]},bu=function(t){var e,r=fu;if(t-_u>=.05)for(_u=t;r;)((e=r.g(r.t,r.p))!==r.v1||t-r.t1>.2)&&(r.v2=r.v1,r.v1=e,r.t2=r.t1,r.t1=t),r=r._next},wu={deg:360,rad:2*Math.PI},Cu=function(){(pu=Du())&&(hu=pu.utils.toArray,du=pu.utils.getUnit,mu=pu.core.getCache,gu=pu.ticker,cu=1)},Fu=function(t,e,r,n){this.t=t,this.p=e,this.g=t._gsap.get,this.rCap=wu[r||du(this.g(t,e))],this.v1=this.v2=0,this.t1=this.t2=gu.time,n&&(this._next=n,n._prev=this)},Eu=function(){function t(t,e){cu||Cu(),this.target=hu(t)[0],vu[yu(this.target)]=this,this._props={},e&&this.add(e)}t.register=function(t){pu=t,Cu()};var e=t.prototype;return e.get=function(t,e){var r,n,i,s=this._props[t]||console.warn("Not tracking "+t+" velocity.");return r=parseFloat(e?s.v1:s.g(s.t,s.p))-parseFloat(s.v2),(n=s.rCap)&&(r%=n)!=r%(n/2)&&(r=r<0?r+n:r-n),i=r/((e?s.t1:gu.time)-s.t2),Math.round(1e4*i)/1e4},e.getAll=function(){var t,e={},r=this._props;for(t in r)e[t]=this.get(t);return e},e.isTracking=function(t){return t in this._props},e.add=function(t,e){t in this._props||(fu||(gu.add(bu),_u=gu.time),fu=this._props[t]=new Fu(this.target,t,e,fu))},e.remove=function(t){var e,r,n=this._props[t];n&&(e=n._prev,r=n._next,e&&(e._next=r),r?r._prev=e:fu===n&&(gu.remove(bu),fu=0),delete this._props[t])},e.kill=function(t){for(var e in this._props)this.remove(e);t||delete vu[yu(this.target)]},t.track=function(e,r,n){cu||Cu();for(var i,s,o=[],a=hu(e),u=r.split(","),l=(n||"").split(","),p=a.length;p--;){for(i=xu(a[p])||new t(a[p]),s=u.length;s--;)i.add(u[s],l[s]||l[0]);o.push(i)}return o},t.untrack=function(t,e){var r=(e||"").split(",");hu(t).forEach((function(t){var e=xu(t);e&&(r.length?r.forEach((function(t){return e.remove(t)})):e.kill(1))}))},t.isTracking=function(t,e){var r=xu(t);return r&&r.isTracking(e)},t.getVelocity=function(t,e){var r=xu(t);return r&&r.isTracking(e)?r.get(e):console.warn("Not tracking velocity of "+e)},t}();Eu.getByTarget=xu,Du()&&pu.registerPlugin(Eu);
/*!
 * InertiaPlugin 3.12.5
 * https://gsap.com
 *
 * @license Copyright 2008-2024, GreenSock. All rights reserved.
 * Subject to the terms at https://gsap.com/standard-license or for
 * Club GSAP members, the agreement issued with that membership.
 * @author: Jack Doyle, jack@greensock.com
*/
var Tu,Su,Mu,Au,Ru,Ou,Pu,ku,Bu,Lu,Nu,Iu,zu,Xu,ju,Yu=Eu.getByTarget,qu=function(){return Tu||"undefined"!=typeof window&&(Tu=window.gsap)&&Tu.registerPlugin&&Tu},Gu=function(t){return"number"==typeof t},Vu=function(t){return"object"==typeof t},Hu=function(t){return"function"==typeof t},$u=Array.isArray,Uu=function(t){return t},Wu=1e10,Qu=function(t,e,r){for(var n in e)n in t||n===r||(t[n]=e[n]);return t},Zu=function t(e){var r,n,i={};for(r in e)i[r]=Vu(n=e[r])&&!$u(n)?t(n):n;return i},Ju=function(t,e,r,n,i){var s,o,a,u,l=e.length,p=0,c=Wu;if(Vu(t)){for(;l--;){for(a in s=e[l],o=0,t)o+=(u=s[a]-t[a])*u;o<c&&(p=l,c=o)}if((i||Wu)<Wu&&i<Math.sqrt(c))return t}else for(;l--;)(o=(s=e[l])-t)<0&&(o=-o),o<c&&s>=n&&s<=r&&(p=l,c=o);return e[p]},Ku=function(t,e,r,n,i,s,o){if("auto"===t.end)return t;var a,u,l=t.end;if(r=isNaN(r)?Wu:r,n=isNaN(n)?-1e10:n,Vu(e)){if(a=e.calculated?e:(Hu(l)?l(e,o):Ju(e,l,r,n,s))||e,!e.calculated){for(u in a)e[u]=a[u];e.calculated=!0}a=a[i]}else a=Hu(l)?l(e,o):$u(l)?Ju(e,l,r,n,s):parseFloat(l);return a>r?a=r:a<n&&(a=n),{max:a,min:a,unitFactor:t.unitFactor}},tl=function(t,e,r){return isNaN(t[e])?r:+t[e]},el=function(t,e){return.05*e*t/Lu},rl=function(t,e,r){return Math.abs((e-t)*Lu/r/.05)},nl={resistance:1,checkpoint:1,preventOvershoot:1,linkedProps:1,radius:1,duration:1},il=function(t,e,r,n){if(e.linkedProps){var i,s,o,a,u,l,p=e.linkedProps.split(","),c={};for(i=0;i<p.length;i++)(o=e[s=p[i]])&&(a=Gu(o.velocity)?o.velocity:(u=u||Yu(t))&&u.isTracking(s)?u.get(s):0,l=Math.abs(a/tl(o,"resistance",n)),c[s]=parseFloat(r(t,s))+el(a,l));return c}},sl=function(){(Tu=qu())&&(Mu=Tu.parseEase,Au=Tu.utils.toArray,Pu=Tu.utils.getUnit,Bu=Tu.core.getCache,Nu=Tu.utils.clamp,zu=Tu.core.getStyleSaver,Xu=Tu.core.reverting||function(){},Ru=Mu("power3"),Lu=Ru(.05),ku=Tu.core.PropTween,Tu.config({resistance:100,unitFactors:{time:1e3,totalTime:1e3,progress:1e3,totalProgress:1e3}}),Ou=Tu.config(),Tu.registerPlugin(Eu),Su=1)},ol={version:"3.12.5",name:"inertia",register:function(t){Tu=t,sl()},init:function(t,e,r,n,i){Su||sl();var s=Yu(t);if("auto"===e){if(!s)return void console.warn("No inertia tracking on "+t+". InertiaPlugin.track(target) first.");e=s.getAll()}this.styles=zu&&"object"==typeof t.style&&zu(t),this.target=t,this.tween=r,Iu=e;var o,a,u,l,p,c,h,d,f,g=t._gsap,_=g.get,m=e.duration,D=Vu(m),v=e.preventOvershoot||D&&0===m.overshoot,y=tl(e,"resistance",Ou.resistance),x=Gu(m)?m:function(t,e,r,n,i,s){if(void 0===r&&(r=10),void 0===n&&(n=.2),void 0===i&&(i=1),void 0===s&&(s=0),"string"==typeof t&&(t=Au(t)[0]),!t)return 0;var o,a,u,l,p,c,h,d,f,g,_=0,m=Wu,D=e.inertia||e,v=Bu(t).get,y=tl(D,"resistance",Ou.resistance);for(o in g=il(t,D,v,y),D)nl[o]||(a=D[o],Vu(a)||((d=d||Yu(t))&&d.isTracking(o)?a=Gu(a)?{velocity:a}:{velocity:d.get(o)}:(l=+a||0,u=Math.abs(l/y))),Vu(a)&&(l=Gu(a.velocity)?a.velocity:(d=d||Yu(t))&&d.isTracking(o)?d.get(o):0,u=Nu(n,r,Math.abs(l/tl(a,"resistance",y))),c=(p=parseFloat(v(t,o))||0)+el(l,u),"end"in a&&(a=Ku(a,g&&o in g?g:c,a.max,a.min,o,D.radius,l),s&&(Iu===e&&(Iu=D=Zu(e)),D[o]=Qu(a,D[o],"end"))),"max"in a&&c>+a.max+1e-10?(f=a.unitFactor||Ou.unitFactors[o]||1,(h=p>a.max&&a.min!==a.max||l*f>-15&&l*f<45?n+.1*(r-n):rl(p,a.max,l))+i<m&&(m=h+i)):"min"in a&&c<+a.min-1e-10&&(f=a.unitFactor||Ou.unitFactors[o]||1,(h=p<a.min&&a.min!==a.max||l*f>-45&&l*f<15?n+.1*(r-n):rl(p,a.min,l))+i<m&&(m=h+i)),h>_&&(_=h)),u>_&&(_=u));return _>m&&(_=m),_>r?r:_<n?n:_}(t,e,D&&m.max||10,D&&m.min||.2,D&&"overshoot"in m?+m.overshoot:v?0:1,!0);for(o in e=Iu,Iu=0,f=il(t,e,_,y),e)nl[o]||(a=e[o],Hu(a)&&(a=a(n,t,i)),Gu(a)?p=a:Vu(a)&&!isNaN(a.velocity)?p=+a.velocity:s&&s.isTracking(o)?p=s.get(o):console.warn("ERROR: No velocity was defined for "+t+" property: "+o),c=el(p,x),d=0,u=_(t,o),l=Pu(u),u=parseFloat(u),Vu(a)&&(h=u+c,"end"in a&&(a=Ku(a,f&&o in f?f:h,a.max,a.min,o,e.radius,p)),"max"in a&&+a.max<h?v||a.preventOvershoot?c=a.max-u:d=a.max-u-c:"min"in a&&+a.min>h&&(v||a.preventOvershoot?c=a.min-u:d=a.min-u-c)),this._props.push(o),this.styles&&this.styles.save(o),this._pt=new ku(this._pt,t,o,u,0,Uu,0,g.set(t,o,this)),this._pt.u=l||0,this._pt.c1=c,this._pt.c2=d);return r.duration(x),1},render:function(t,e){var r,n=e._pt;if((t=Ru(e.tween._time/e.tween._dur))||!Xu())for(;n;)n.set(n.t,n.p,(r=n.s+n.c1*t+n.c2*t*t,Math.round(1e4*r)/1e4+n.u),n.d,t),n=n._next;else e.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach((function(t){return ol[t]=Eu[t]})),qu()&&Tu.registerPlugin(ol),qn.registerPlugin(Ue,Gn,Ne,Ne,Yn,gi,ks,ps,Ys,Js,zo,lu,ol),window._tpt??={};var al=ju=window.punchgs=window.tpGS=_tpt;for(var ul in _tpt.gsap=qn,_tpt.TweenLite=Ue,_tpt.TweenMax=Gn,_tpt.TimelineLite=Ne,_tpt.TimelineMax=Ne,_tpt.CSSPlugin=Yn,_tpt.SplitText=gi,_tpt.motionPath=zo,_tpt.CustomEase=ps,_tpt.CustomBounce=Ys,_tpt.CustomWiggle=Js,_tpt.DrawSVGPlugin=ks,_tpt.draggable=lu,_tpt.Inertia=ol,_tpt.RAD2DEG=180/Math.PI,_tpt.DEG2RAD=Math.PI/180,_tpt.gsap.config({nullTargetWarn:!1}),
/*!FallBack for old and new Eases*/
_tpt.eases=_tpt.gsap.parseEase(),_tpt.eases)_tpt.eases.hasOwnProperty(ul)&&void 0===al[ul]&&(al[ul]=_tpt.eases[ul]
/*! FallBack for Essential Grid */);void 0!==ju&&void 0!==ju.TweenLite&&void 0===ju.TweenLite.lagSmoothing&&(ju.TweenLite.lagSmoothing=function(){}),_tpt.CustomEase.create("late","M0,0,C0,0,0.474,0.078,0.724,0.26,0.969,0.438,1,1,1,1"),_tpt.CustomEase.create("late2","M0,0 C0,0 0.738,-0.06 0.868,0.22 1,0.506 1,1 1,1 "),_tpt.CustomEase.create("late3","M0,0,C0,0,0.682,0.157,0.812,0.438,0.944,0.724,1,1,1,1"),_tpt.SFXBounceLite=_tpt.CustomBounce.create("SFXBounceLite",{strength:.3,squash:1,squashID:"SFXBounceLite-squash"}),_tpt.SFXBounceSolid=_tpt.CustomBounce.create("SFXBounceSolid",{strength:.5,squash:2,squashID:"SFXBounceSolid-squash"}),_tpt.SFXBounceStrong=_tpt.CustomBounce.create("SFXBounceStrong",{strength:.7,squash:3,squashID:"SFXBounceStrong-squash"}),_tpt.SFXBounceExtrem=_tpt.CustomBounce.create("SFXBounceExtrem",{strength:.9,squash:4,squashID:"SFXBounceExtrem-squash"}),_tpt.BounceLite=_tpt.CustomBounce.create("BounceLite",{strength:.3}),_tpt.BounceSolid=_tpt.CustomBounce.create("BounceSolid",{strength:.5}),_tpt.BounceStrong=_tpt.CustomBounce.create("BounceStrong",{strength:.7}),_tpt.BounceExtrem=_tpt.CustomBounce.create("BounceExtrem",{strength:.9}),_tpt.R=_tpt.R||{},_tpt.R.tpgsap=_tpt.extend?_tpt.extend(_tpt.R.tpgsap,{status:2,version:"1.0"}):{status:2,version:"1.0"},window.dispatchEvent(new CustomEvent("tpGSAPReady"))})();
// source --> //3d360properties.com/wp-content/plugins/revslider/public/js/sr7.js?ver=6.7.34 
/*!
╔══════════════════════════════════════════════════════════════════════════════╗
║                                                                              ║
║  PLUGIN:      SLIDER REVOLUTION 7.0                                          ║
║  MODULE:      MAIN PAGE MODULE											   ║
║  VERSION:     1.0.0                                                          ║
║  DATE:        2023-01-03                                                     ║
║  AUTHOR:      Krisztian H. & Sahil P.                                        ║
║  COMPANY:     ThemePunch OHG.                                                ║
║                                                                              ║
╠══════════════════════════════════════════════════════════════════════════════╣
║                                                                              ║
║  UPDATES & DOCS:  https://www.themepunch.com/support-center                  ║
║  GET LICENSE:    https://www.themepunch.com/links/slider_revolution_wordpre  ║
║                               ss_regular_license                             ║
║                                                                              ║
╠══════════════════════════════════════════════════════════════════════════════╣
║                                                                              ║
║  LICENSE:                                                                    ║
║  Copyright (c) 2023, ThemePunch. All rights reserved.                        ║
║  This work is subject to the terms at:                                       ║
║  https://www.themepunch.com/links/slider_revolution_wordpress_regular_licen  ║
║                               se (Regular / Extended)                        ║
║                                                                              ║
╚══════════════════════════════════════════════════════════════════════════════╝
*/
!function(){"use strict";window.SR7??={},window._tpt??={},SR7.F??={},SR7.G??={},SR7.G.breakPoints??=[1600,1240,1024,778,480],SR7.version="Slider Revolution 7.0.0",SR7.F.init=function(){if(void 0===_tpt.removeEmptyTags)return setTimeout(SR7.F.init,49);if(SR7.initialised)return SR7.E.elementorBackend&&_tpt.checkResources(["DOM","sr7min","module","tpgsap","canvas","draw","save","csssr7"]).then((()=>{SR7.F.module.collect()})),void(window.vc_js&&_tpt.checkResources(["DOM","sr7min","module","tpgsap","canvas","draw","save","csssr7"]).then((()=>{let e=333;const t=setInterval((()=>{(document.querySelector(".vc_rev_slider")||e--<0)&&(SR7.F.module.collect(),clearInterval(t))}),100)})));const e=document.getElementsByClassName("rs-p-wp-fix");Array.from(e).forEach((e=>{null!==e.parentNode&&void 0!==e.parentNode&&(_tpt.removeEmptyTags(e.querySelectorAll("span")),_tpt.removeEmptyTags(e.parentNode.querySelectorAll('p:not([role="status"])')))}));let t=!0;for(let e in SR7.PMH){if(!_tpt.hop(SR7.PMH,e))continue;t=!0===SR7.PMH[e].state,SR7.PMH[e].cn>99&&SR7.PMH[e].fn()}if(t&&(SR7.devMode||2===_tpt.R?.module?.status)){SR7.initialised=!0,_tpt.regResource({id:"DOM"});for(let e of SR7.E.modules)SR7.E.resources[e]??=SR7.E.plugin_url+"public/js/"+e+".js";for(let e of SR7.E.libs)SR7.E.resources[e]??=SR7.E.plugin_url+"public/js/libs/"+e.toLowerCase()+".js";for(let e of SR7.E.css)SR7.E.resources[e]??=SR7.E.plugin_url+"public/css/"+e.replace("css","sr7.")+".css";SR7.E.resources.csssr7=SR7.E.plugin_url+"public/css/sr7.css";for(let e in SR7.E.resources)_tpt.hop(SR7.E.resources,e)&&("css"==SR7.E.resources[e].slice(-3)?_tpt.regResource({id:e,css:SR7.E.resources[e]}):_tpt.regResource({id:e,url:SR7.E.resources[e]}));2!==_tpt.R?.csssr7?.status&&"1"===getComputedStyle(document.body).getPropertyValue("--sr-7-css-loaded")&&(_tpt.R.csssr7={status:2}),_tpt.checkResources(["DOM","sr7min","module","tpgsap","canvas","draw","save","csssr7"]).then((()=>{SR7.F.module.collect()}))}else setTimeout(SR7.F.init,19)},SR7.F.regAddonResources=e=>{for(let t in e)if(_tpt.hop(e,t)){let s=t.replace("revslider-","").replace("-addon","");SR7.E.resources[s]=e[t],"css"==SR7.E.resources[s].slice(-3)?_tpt.regResource({id:s,css:SR7.E.resources[t]}):_tpt.regResource({id:s,url:SR7.E.resources[t]})}},SR7.F.modal={register:e=>{let{alias:t,id:s,speed:i,bg:a,pS:r,h:o,v:l}=e;if(s??=SR7.F.module.getIdByAlias(t),void 0!==s&&void 0!==SR7.M[s]&&SR7.M?.[s]?.c?.module?.dataset?.modal){let e=_tpt.strSetToObj(SR7.M?.[s]?.c?.module?.dataset?.modal??"");void 0!==e.bg&&(a=e.bg),void 0!==e.sp&&(i=parseInt(e.sp)/1e3),e.pS,e.h,e.v}SR7.F.modal.modals??={},SR7.F.modal.modals[t]={id:s,alias:t,speed:i,bg:a,pS:r,h:o,v:l},SR7.M[s]&&(SR7.M[s].modalRegistered=!0)},build:()=>{document.querySelector("sr7-modals")||(SR7.F.modal.wrap=document.createElement("sr7-modals"),SR7.F.modal.wrap.innerHTML="<sr7-modal-underlay></sr7-modal-underlay>",SR7.F.modal.cover=SR7.F.modal.wrap.getElementsByTagName("sr7-modal-underlay")[0],SR7.F.modal.cover.style.opacity=0,SR7.F.modal.cover.style.zIndex=0,document.body.appendChild(SR7.F.modal.wrap),SR7.F.modal.wrap.addEventListener("click",(e=>{"SR7-MODAL-UNDERLAY"!=e.target.tagName&&"SR7-MODALS"!=e.target.tagName||SR7.F.modal.close()})))},updatePos:()=>{let e=SR7.F.module.getIdByAlias(SR7.F.modal.requested),t=SR7.M?.[e]??void 0,s=SR7.F.modal.modals[SR7.F.modal.requested],i=t?.c?.module?.style??void 0;if(null==i)return;i.display="block",i.opacity=1,i.position="absolute";let a=SR7.gV?.({v:t.settings.size.width,id:e,u:0})??t.settings.size.width[0]??"100%";i.width="center"!==s.h?"auto":t.settings.size.fullWidth?"100%":a+"px",i.left="center"!=s.h||t.settings.size.fullWidth?"right"!==s.h?"0px":"auto":"50%",i.right="right"==s.h?"0px":"auto";let r="center"!=s.h||t.settings.size.fullWidth?"0px":"-50%";if(t.dims.module.h<_tpt.winH)return i.transform="middle"==s.v?"translate("+r+", -50%)":"translate("+r+", 0px)",void("center"!=s.h||t.settings.size.fullWidth?i.inset="middle"==s.v?"50% 0px auto":"top"==s.v?"0px 0px auto 0px":"auto 0px 0px 0px":i.inset="middle"==s.v?"50% 50% auto 50%":"top"==s.v?"0px 50% auto 50%":"auto 50% 0px 50%");i.top="0px",i.transform="translate("+r+", 0px)"},underlay:e=>{let t=SR7.M?.[SR7.F.module.getIdByAlias(SR7.F.modal.requested)]??void 0,s=SR7.F.modal?.modals?.[SR7.F.modal.requested],i=t?.c?.module??void 0,a=SR7.F.modal.wrap.style,r=document.body.style;if("show"==e){SR7.F.modal.wrap.style;return SR7.F.modal.cover.style.backgroundColor=s.bg,SR7.F.modal.cover.style.pointerEvents="transparent"==s.bg?"none":"auto",SR7.F.modal.fadeOutAnimation&&SR7.F.modal.fadeOutAnimation.isActive()&&SR7.F.modal.fadeOutAnimation.kill(),a.pointerEvents="transparent"==s.bg?"none":"auto",a.display="block",a.position=SR7.F.modal?.sbt?"absolute":"fixed",a.top=0,a.left=0,a.width="100%",a.height=SR7.F.modal?.sbt?t.dims.moduleRect.height+"px":"100%",a.zIndex=999999,SR7.F.modal.lastDocStyle={width:document.body.style.width,height:document.body.style.height,overflow:document.body.style.overflow,sx:window.scrollX,sy:window.scrollY},r.width="100%",r.height="100%",s.pS||(r.overflow=SR7.F.modal?.sbt?"hidden scroll":"hidden"),SR7.F.modal.updatePos(),void _tpt.gsap.to(SR7.F.modal.cover,s.speed,{opacity:1,ease:"power3.out"})}SR7.F.modal.fadeOutAnimation=_tpt.gsap.to(i?[i,SR7.F.modal.cover]:SR7.F.modal.cover,s.speed,{opacity:0,ease:"power3.out",onComplete:function(){SR7.F.modal.sbt=!1,a.display="none",i.style.display="none",r.height=SR7.F.modal.lastDocStyle.height,r.overflow=SR7.F.modal.lastDocStyle.overflow,r.width=SR7.F.modal.lastDocStyle.width,window.scrollTo(SR7.F.modal.lastDocStyle.sx,SR7.F.modal.lastDocStyle.sy)}})},create:(e,t,s)=>{null==t&&((t=document.createElement("sr7-module")).innerHTML="<sr7-adjuster></sr7-adjuster><sr7-content></sr7-content>"),t.id=s,t.dataset.alias??=e.alias??e.settings?.alias??"",t.dataset.id=e.id,SR7.M??={},SR7.M[s]??={};let i=SR7.M[s];return i.settings??={size:{}},i.c??={},i.c.module??=t,i.c.content??=t.getElementsByTagName("sr7-content")[0],i.c.adjuster??=t.getElementsByTagName("sr7-adjuster")[0],i.dims??={},i.dims.content??={},i.dims.CFC??={},i.dims.module??={},i.states??={inViewPort:!0},i.useAsModal=!0,SR7.F.modal.wrap.appendChild(t),SR7.JSON??={},SR7.JSON[t.id]=e,SR7.F.module.register(t,t.id,!1),t},updateContainers:(e,t)=>{let s=SR7.M[e];s.c??={},s.c.module??=t,s.c.content??=t.getElementsByTagName("sr7-content")[0],s.c.adjuster??=t.getElementsByTagName("sr7-adjuster")[0]},loaded:(e,t,s,i)=>{SR7.F.modal.updateContainers(e,SR7.M[e].c.module),SR7.M[e].useAsModal=!0,SR7.M[e].modalRegistered=!1,SR7.M[e].states??={},SR7.M[e].states.inViewPort=!0;const a=function(t){t.id==e&&SR7.M[t.id]?.settings?.sbt?.use&&(window.dispatchEvent(new Event("resize")),document.removeEventListener("sr.slide.changeRequest",a))};document.addEventListener("sr.slide.changeRequest",a),_tpt.event.trigger("dom","sr.module.loaded",{result:i,id:e,slide:String(t).replace("#","")}),_tpt.event.trigger("dom","sr.modal.loaded",{id:e,alias:s}),_tpt.event.trigger("dom","sr.modal.open",{id:e,alias:s,slide:t})},load:(e,t)=>{let s=SR7.F.module?.getIdByAlias(e),i=e;void 0===SR7?.JSON?.[s]&&void 0===SR7.JSON?.[e]?_tpt.restAPI({action:"get_full_slider_object",version:7,id:s,alias:e,forcealias:null==s,callBack:e=>{if("object"!=typeof e)try{e=JSON.parse(e)}catch(t){e=_tpt.fixResponse(e)}const{success:a,alias:r}=e;if(a){SR7.F.regAddonResources(e.addOns??{});let a=SR7.M?.[s]??SR7.F?.module?.get(SR7.F.module.getIdByAlias(r??i));s??=a?.id??"SR7_"+e.id+"_"+SR7.F?.module?.getNextSuffx(e.id)??1,a=SR7.F.modal.create(e,a?.c?.module,s),SR7.F.modal.requested=r??e.settings?.alias??SR7.F.modal.requested,requestAnimationFrame((function(){SR7.F.modal.loaded(s,t,i,e)}))}else console.log(r+" Could not be Loaded from DB")}}):(SR7.F.modal.wrap.appendChild(SR7.M[s].c.module),SR7.F.modal.loaded(s,t,e,SR7.JSON[s]))},open:(e,t=0)=>{null!=e&&_tpt.checkResources(["DOM","sr7min","module","tpgsap","canvas","draw"]).then((()=>{let s=SR7.F?.module?.getIdByAlias(e);if(!SR7?.M?.[s]?.c?.module||SR7.M?.[s]?.useAsModal||SR7.M?.[s].c.module?.dataset?.modal){if(SR7.F.modal.build(),SR7.F.modal.requested=e,SR7.F.modal.visible=!0,!(SR7.M?.[s]&&SR7.M[s].slides&&SR7.F.modal.modals?.[e]&&SR7.M[s]?.settings))return SR7.F.modal.load(e,t);SR7.F.modal.wrap.contains(SR7.M[s].c.module)||SR7.F.modal.wrap.appendChild(SR7.M[s].c.module),SR7.M[s].useAsModal=!0,SR7.F.modal.underlay("show"),_tpt.gsap.set(SR7.F.modal.wrap,{scrollTop:0}),_tpt.event.trigger("dom","sr.modal.open",{id:s,alias:e,slide:t}),SR7.M[s].states??={},SR7.M[s].states.inViewPort=!0,SR7.F.resetGlobalLayers(s),SR7.F.requestSlide({id:s,slide:t}),SR7.M?.[s]?.settings?.sbt?.use&&window.dispatchEvent(new Event("resize"))}else console.warn("Attempt to open a Slider Module ("+e+") as a Modal detected.\n\nPlease note:\n- You cannot use a Slider Module as a Modal on the same page where the Module is already added as a non-Modal element.\n- To use the Slider Module as a Modal:\n  A) Ensure it is not already present on the page as a non-Modal element allowing the Slider Module to be loaded on demand as a Modal.\n  B) (OR) Modify the Page Module Settings to set 'Pop Up' to true.")}))},close:()=>{SR7.F.modal.visible=!1,void 0!==SR7.F.modal.requested&&("carousel"!==SR7.M[SR7.F.module.getIdByAlias(SR7.F.modal.requested)].settings.type&&SR7.F.closeSlide(SR7.F.module.getIdByAlias(SR7.F.modal.requested)),SR7.F.modal.underlay("hide"),_tpt.event.trigger("dom","sr.modal.close",{id:SR7.F.module.getIdByAlias(SR7.F.modal.requested),alias:SR7.F.modal.requested}))},trigger:(e,t,s)=>{if(null==s)return!1;let i=_tpt.strSetToObj(s);if(null==i)return!1;void 0!==i.sp&&(i.sp=parseInt(i.sp)/1e3);let a=!0;return void 0!==i.co?a=""+_tpt.cookie.get(t.dataset.alias+"_modal_one_time")!="true":"true"==_tpt.cookie.get(t.dataset.alias+"_modal_one_time")&&_tpt.cookie.set(t.dataset.alias+"_modal_one_time",!1,10),a&&(SR7.F.modal.modals??={},SR7.F.modal.modals[e]={alias:e,speed:i.sp,bg:i.bg,pS:i.pS,v:i.v,h:i.h},void 0!==i.t&&(void 0!==i.co&&_tpt.cookie.set(t.dataset.alias+"_modal_one_time",!0,i.co),setTimeout((function(){SR7.F.modal.open(e)}),parseInt(i.t))),void 0===i.so&&void 0===i.s||(_tpt.scrollObserver.observe(window),window.observSR7Globals??={},i.so=void 0!==i.s?i.s:i.so,window.observSR7Globals[e]={params:{alias:e,element:i.so.includes("#")?document.querySelector(i.so)??void 0:void 0,co:i.co,offset:parseInt(i.so??0)},callback:e=>{let{alias:s,element:i,offset:a,co:r}=e;null!=window.observSR7Globals[s]&&(void 0!==i?i.getBoundingClientRect().top<=_tpt.winH/2:a<=_tpt.scrollObserver.y)&&(void 0!==r&&_tpt.cookie.set(t.dataset.alias+"_modal_one_time",!0,r),SR7.F.modal.open(s),delete window.observSR7Globals[s])}},_tpt.scrollObserver.run(window))),void 0!==i.e&&document.addEventListener(i.e,(function(t){SR7.F.modal.open(e,parseInt(t?.detail?.slide||1)-1)})),"t"==i.ha&&void 0!==t&&(window.location.hash=="#"+t.dataset.alias&&setTimeout((function(){SR7.F.modal.open(e)}),500),window.addEventListener("hashchange",(function(){window.location.hash==i.ha&&SR7.F.modal.open(e)}))),!0}};class e{constructor(e){return this.element=document.getElementById(e),this}bind(e,t){return this.element.addEventListener(e,t),this}unbind(e,t){return this.element.removeEventListener(e,t),this}on(e,t){return this.element.addEventListener(e,t),this}off(e,t){return this.element.removeEventListener(e,t),this}one(e,t){const s=i=>{t(i),this.element.removeEventListener(e,s)};return this.element.addEventListener(e,s),this}find(e){return Array.from(this.element.querySelectorAll(e))}wrap(){console.log("jQuery is not supported")}revgetparallaxproc(){return SR7.M[this.element.id].scrollProc}revaddcallback(e){SR7.M[this.element.id].c.callBacks??=[],SR7.M[this.element.id].c.callBacks.push(e)}getRSVersion(){return SR7.version}scroll(e,t=400,s="power3.out"){SR7.F.scrollToId({id:this.element.id,offset:e,action:"scrollunder",anchor:this.element.id,speed:t,ease:s})}redraw(){SR7.F.updateModuleDims(this.element.id,!0,!0)}removeSlide(e){let t=SR7.M[this.element.id].slideOrder.indexOf(e),s=this.element.id;SR7.M[s].slideOrder.splice(t,1),SR7.M[s].slides[e]?.slide?.slideshow?.hfn||SR7.M[s].navLen--,SR7.M[s].len--,SR7.M[s].current.id==e&&SR7.F.requestSlide({id:s,slide:"+1"}),SR7.M[s].c.slides[e].remove(),delete SR7.M[s].slides[e],delete SR7.M[s].c.slides[e];for(let t of["bullets","thumbs","tabs"])if(SR7.M[s].c.nav?.[t]?.elements){let i=0;for(let a of SR7.M[s].c.nav[t].elements){if(a.dataset.key==e){a.remove();break}i++}SR7.M[s].c.nav[t].elements.splice(i,1)}SR7.F.navigation.update(s)}modal(){}start(){SR7.F.runModule(this.element.id)}playScene(e,t){let{skey:s,id:i,lkey:a}=SR7.F.getLayer(e),r=SR7.M?.[i]?.slides?.[s]?.layers?.[a].tl?.[t];return!!r&&(SR7.F.animateLayers({id:i,skey:s,layers:[a],scene:t,caller:"action"}),{id:i,skey:s,layers:[a],scene:t,caller:"action"})}goToFrame(e){if(null!=e&&null!=e.layerid&&null!=e.frame)return this.playScene(e.layerid,e.frame)}pause(){SR7.slideShow.pause(this.element.id)}forcedPause(){SR7.slideShow.pause(this.element.id,!0)}resume(){SR7.slideShow.resume(this.element.id)}nextSlide(){SR7.F.requestSlide({id:this.element.id,slide:"+1"})}prevSlide(){SR7.F.requestSlide({id:this.element.id,slide:"-1"})}currentSlide(){let e=SR7.M[this.element.id];return{index:e.slideOrder.indexOf(e.current.id),key:e.current.id,order:e.slideOrder.indexOf(e.current.id)+1}}maxSlide(){return SR7.M[this.element.id].len}lastSlide(){return SR7.M[this.element.id].navLen}showSlide(e){let t=SR7.M[this.element.id];SR7.F.requestSlide({id:this.element.id,slide:"first"==e?"#"+t.slideOrder[0]:"last"==e?"#"+t.slideOrder[t.len-1]:"random"==e?Math.round(Math.random()*t.len+1):"#"+(Array.isArray(e)?e[0]:e)})}kill(){SR7.slideShow.pause(this.element.id),_tpt.event.rmAll(this.element),SR7.M[this.element.id].c.module.remove()}}SR7.revapi=e,e.init=function(t){let s=(SR7.M[t].c.module.dataset.id??SR7.M[t].settings.dbid)||(t.includes("SR7_")?t.split("_")[1]:t);return window["revapi"+s]=new e(t),window["revapi"+s].id=t,window["revapi"+s]},SR7.shouldBeInited&&SR7.F.init()}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},SR7.E??={},void 0!==SR7.F.animateLayers)return;SR7.F.animateLayers=async function(e){let{id:t,skey:s,layers:i,scene:a,caller:r,update:l,subcaller:n,timeto:d,reset:c,ffw:p}=e;const h=SR7.M[t],u=h.slides?.[s]?.slide?.global;if(a??="in",i??=h.c.PO[s],h.c.tl=h.c.tl??{},h.c.tl[s]??={},"update"!==r&&(h.c.tl[s][a]={TL:_tpt.gsap.timeline()}),"action"!==r&&"update"!==r&&!u&&"action"!==n&&("carousel"!==h.settings.type||"all"!==h.settings.carousel.showAllLayers))for(let e in h.c.tl[s])_tpt.hop(h.c.tl[s],e)&&e!=a&&(h.c.tl[s][e]?.TL?.pause(),h.c.tl[s][e].loops&&h.c.tl[s][e]?.loops?.pause());for(let e of i){let{layer:i,c:o}=SR7.F.getLayer({id:t,skey:s,lkey:e});if(null!=o&&("carousel"!=h.settings.type||"update"!=r||"all"!=h.settings.carousel.showAllLayers&&!i.viOC)){if(u){if("out"==a&&!o.animState?.scene)continue;if(o.animState?.scene==a)continue;if(o.gpos=_tpt.inRange(Math.max(0,SR7.M[t].current.index)+1,i.sStart,i.sEnd),"in"==a&&"out"==o.gpos)continue;if("action"!==r&&"parent"!==r&&"out"==a&&"in"==o.gpos)continue;if("action"!==r&&"parent"!==r&&"in"==o.gpos&&"in"==a&&("in"==(o.animState?.scene??"")||"default"!==(o?.animState?.caller??"default")))continue}if("action"==r&&o?.animState?.scene&&o?.tl?.[o?.animState?.scene]&&o.tl[o.animState.scene].TL&&o.tl[o.animState.scene].TL.pause(),c&&"parent"==r&&"action"==n&&"in"==a){for(let e in o.tl)if(_tpt.hop(o.tl,e)&&e!=a)for(let t in o.tl[e])_tpt.hop(o.tl[e],t)&&o.tl[e][t]?.pause(0);o.fxc&&(o.fxitl&&(o.fxitl.pause(0),o.fxotl.pause(1)),o.el.classList.remove("sr7-fx-hidden"))}if("action"===r||"parent"===r||"in"!=a||!SR7.F.inActionEnv(t,s,e)){if("action"==r&&"container"==i.type&&("in"==a||"out"==a)){let i=SR7.F.triggeredChildren(t,s,e),o=SR7.F.getLayer({id:t,skey:s,lkey:e})?.c;null!=c&&1!=c&&!0===o.animState.everCalled||await SR7.F.animateLayers({id:t,skey:s,reset:c,layers:i,scene:a,caller:"parent",subcaller:r}),o.animState.everCalled=!0}if(i?.tl?.[a]||"out"==a&&"slidebg"==i.subtype){let n=void 0!==l&&o.tl?.[a]?.[l]?.progress?o.tl[a][l].progress():0;o.sbt=(h.settings?.sbt?.use??!1)&&"in"==a&&((h.settings?.sbt?.layers??!1)||(i.mod?.s?.ut??!1));let{tl:u,loops:m}=await SR7.F.processFrame({sbt:o.sbt,id:t,c:o,layer:i,reset:c,timeline:i.tl,scene:a,skey:s,lkey:e,caller:r,update:l});if(p&&void 0!==d)return u.time(d);void 0!==l&&0!==n&&u.progress(n),o.sbt&&u.pause(),h.c.tl[s][a].TL.add(u,0),"update"!==r&&void 0!==m&&(h.c.tl[s][a].loops??=_tpt.gsap.timeline(),h.c.tl[s][a].loops.add(m,0)),o.sbt&&(h.sbt??={},h.sbt[s]??={},h.sbt[s][e]={tl:u,so:i.mod?.s?.so??0},_tpt.gsap.to(u,{duration:.01,time:_tpt.gsap.utils.clamp(0,u.duration(),h.sbt.__time)}),m&&(h.sbt[s][e+"_loop"]??={},h.sbt[s][e+"_loop"]={tl:m}))}}}}"update"!=r&&(u||h.c.tl[s][a].TL.eventCallback("onComplete",o.sceneCompleted,[{id:t,scene:a,caller:r,skey:s}]),u||h.c.tl[s][a].TL.eventCallback("onStart",o.sceneStarted,[{id:t,scene:a,caller:r,skey:s}]),!u&&h.slides[s]?.slide?.loop?.u&&h.c.tl[s][a].TL.eventCallback("onUpdate",o.sceneUpdated,[{id:t,scene:a,caller:r,skey:s}]))},SR7.F.processFrame=async function(r){const{timeline:l,scene:n,id:d,layer:c,c:p,caller:h,update:u,skey:m,reset:g,sbt:f}=r,v=l[n],y=_tpt.gsap.timeline();let S;p.tl[n]??={};let b=!1;void 0!==p.mod&&(p.mod.animElem=p.mod.mask?p.el:p.parallax?p.parallax:p.loop?p.loop:p.mask?p.mask:"column"==p.subtype?p.con:p.el);let R=p.loop?"target":p.mask?"mask":"content";if(void 0!==v)for(let r of SR7.D.TLTargetsProcess){if(null==v[r])continue;if(void 0!==u&&r!==u)continue;if("parent"==h&&"loop"==r)continue;p.cache.tl??={},p.cache.tl[r]??="filter"==r?{}:SR7.F.getEmptyAnimObj(1);const l=_tpt.gsap.timeline(),g=void 0!==p.mod&&(!p.parallax||p.mod.mask)&&(p.mod.animElem!==p.el&&"mask"==r||p.mod.animElem==p.el&&"content"==r);for(let u in v[r]){if(!_tpt.hop(v[r],u))continue;if("pers"==u||"orig"==u||"type"==u)continue;let y="filter"==r?["filter"]:"all"==u?SR7.D.animAttr.filter((function(e){return!v[r].hasOwnProperty(e)&&!v[r].hasOwnProperty(SR7.D.animAttrTrans[e])})):"scale"==u?["scaleX","scaleY","skewX","skewY"]:"motionpath"==u?["x","y","z"]:u,S=SR7.F.usePerspective(v[r][u],SR7.M[d].settings.general,v?.content?.pers??"600px");(v.pan||v.filter||v.loop)&&r==R&&(S??=v?.content?.pers??"600px");for(let R in v[r][u]){if("out"==n&&!p.animState?.scene)continue;if("in"==n&&("action"==h||"parent"==h)&&p.animState?.scene&&"out"!=p.animState.scene&&0==R)continue;if("in"==n&&"action"!=h&&"w"==(""+v[r][u][0].t)[0])continue;"in"==n&&0==R&&SR7.F.modify.process(d,"scroll",p.lkey);const w=v[r][u][R],x=SR7.D.splits.indexOf(r)>=0;0==R&&"in"==n&&v[r][u][1]?.t&&parseInt(w?.t)>parseInt(v[r][u][1].t)&&(w.t=v[r][u][1].t),p.splitText??=SR7.F.splitText(c,p);let F={ease:w.e,duration:w.d/1e3,id:p.el.id+"_"+n+"_"+r+"_"+R,immediateRender:"in"===n&&0==R};""+R!="0"&&x&&(F.stagger="center"===w.dir||"edges"===w.dir?SR7.F.offsetStagger({each:(w.delay??5)/100,offset:(w.delay??5)/200,from:w.dir}):SR7.F.offsetStagger({each:(w.delay??5)/100,from:"start"!=w.dir&&"end"!=w.dir||-1!=SR7.dirVal(d,SR7.gV({v:1==R?v[r].all[0].x:w.x,id:d,s:"scale"})).d?w.dir??"start":"start"==w.dir?"end":"end"==w.dir?"start":w.dir??"start"}));let _="words"==r||"lines"==r||"chars"==r?p.splitText[r]:"loop"==r?p.loop:"mask"==r?"column"==p.subtype?[p.mask,p.colbgMask]:p.mask:"row"==p.subtype&&(p.mask||p.loop||"clip"==r&&p.con)?p.con:"column"==p.subtype&&(p.mask||p.loop)?[p.con,p.colbg]:p.el,M=parseInt((""+w.t).replace("w",""))/1e3||0;if("loop"==r&&"filter"==u||"filter"==r||x){if(p.filters??={},(w.fu||void 0!==(p.filters?.simple?.used??void 0))&&("filter"==r&&p.mod?.scroll?.uf&&(p.filters.simple=SR7.F.getFilterStyle(p.mod.scroll,"",p.filters?.simple?.used??void 0)),p.filters.simple=SR7.F.getFilterStyle(w.fu?w:{b:0,r:100,g:0},"",p.filters?.simple?.used??void 0),F.filter=p.filters.simple.filter),(!x&&w.bu||void 0!==(p.filters?.backdrop?.used??void 0))&&(p.filters.backdrop=SR7.F.getFilterStyle(w.bu?w:{b:0,r:100,g:0,s:0,i:0},"b",p.filters?.backdrop?.used??void 0),_tpt.isSafari11||_tpt.isIOS?F["-webkit-backdrop-filter"]=p.filters.backdrop.filter:F.backdropFilter=p.filters.backdrop.filter,S=F.transformPerspective??=v?.content?.pers??"600px"),!x&&null==F.filter&&null==F.backdropFilter&&null==F["-webkit-backdrop-filter"]){l.add(_tpt.gsap.to(_,{}),"out"===n?0:M);continue}"filter"==r&&p.mod?.scroll?.uf&&(_=p.mask?p.mask:p.el,F=SR7.F.modify.get(d,_,F,p,n,R,r,"filter"))}if("clip"==r){if("inherit"==w.c)continue;F["clip-path"]=F["-webkit-clip-path"]=SR7.F.clipEffect(v[r].orig,v[r].type,w.c,w.cb),p.clipPath=!0}else if("pan"==r&&void 0!==c.bg.image){const e=SR7.F.pan.getStep({canvas:p.canvas,x:parseInt(v.pan.all[R].x??0),y:parseInt(v.pan.all[R].y),scale:parseInt(v.pan.all[R].sX)/100,rotate:parseInt(v.pan.all[R].rZ),pos:c.bg.image.pos});void 0!==e&&(F.x=e.x,F.y=e.y,F.scale=e.scale,F.rZ=e.rZ,0==R&&(p.canvas.pan={x:F.x,y:F.y,rZ:F.rZ,scale:F.scale}),_=p.canvas.pan,SR7.M[d].c.pans??={},SR7.M[d].c.pans[p.skey]??=[],SR7.M[d].c.pans[p.skey].includes(p.lkey)||SR7.M[d].c.pans[p.skey].push(p.lkey))}else if("filter"!==r){if("motionpath"!==u||null==w.anchors?(y.includes("x")&&void 0!==w.x&&(F.x=e(d,w,x,p,n,r,"x")),y.includes("y")&&void 0!==w.y&&(F.y=e(d,w,x,p,n,r,"y"))):F.motionPath={type:"thru",curviness:parseInt(w.curv)||2,path:w.anchors,fromCurrent:!1,autoRotate:w.aR??!1,alignOrigin:[.5,.5]},g&&(F.tx=F.x?.()??0,F.ty=F.y?.()??0,y.push("tx"),y.push("ty"),F=SR7.F.modify.get(d,_,F,p,n,R,r,"xy")),y.includes("z")&&void 0!==w.z?F.z=w.z:delete F.z,"mask"==r?(F.overflow=w.oflow??(0==R&&null==v[r][u][1]?.oflow||(1==R&&null==v[r][u][0]?.oflow?"visible":"hidden")),void 0!==c.tr&&(F.rotationX=()=>c.tr?.rX??0,F.rotationY=()=>c.tr?.rY??0,F.rotationZ=()=>c.tr?.rZ??0),p.mod?.scroll?.ut&&(F=SR7.F.modify.get(d,_,F,p,n,R,r,"transform"))):(y.includes("rotationX")&&(void 0!==w.rX||"in"==n&&0==R)&&(F.rotationX=t(d,SR7.F.getSpecialValue(w.rX??0,0,SR7.M[d].lastChangeDir),x)),y.includes("rotationY")&&(void 0!==w.rY||"in"==n&&0==R)&&(F.rotationY=t(d,SR7.F.getSpecialValue(w.rY??0,0,SR7.M[d].lastChangeDir),x)),y.includes("rotationZ")&&(void 0!==w.rZ||"in"==n&&0==R)&&(F.rotationZ=t(d,SR7.F.getSpecialValue(w.rZ??0,0,SR7.M[d].lastChangeDir),x))),_tpt.isSafari11||_tpt.isIOS||void 0===p.ptype||void 0===p.borderW&&void 0===p.borderH||(F.force3D=!0),(void 0!==S||"mask"==r&&(p.mod?.scroll?.ut||p.mod?.mouse?.d3))&&(F.transformPerspective=S??600),(y.includes("scaleX")||y.includes("scaleY")||y.includes("skewX")||y.includes("skewY"))&&(x?(F.scaleX=a(d,s(w.sX||w.scaleX),"scale",s(w.skY||w.skewY)),F.scaleY=a(d,s(w.sY||w.scaleY),"scale",s(w.skY||w.skewY)),F.skewX=a(d,s(w.skX||w.skewX),"skew"),F.skewY=a(d,s(w.skY||w.skewY),"skew")):F=i(F,{sX:w.sX??p.cache.tl[r].scaleX,sY:w.sY??p.cache.tl[r].scaleY,skX:w.skX??p.cache.tl[r].skewX,skY:w.skY??p.cache.tl[r].skewY})),y.includes("opacity")){let e="content"==r&&(p.mod?.scroll?.uf??!1)&&(p.mod?.scroll?.f??0)>0;F[e?"tf":"opacity"]="mask"==r&&c.tr?c.tr.o:x&&"in"==n&&0==R&&"inherit"==w.o?v?.content?.all?.[0]?.o??1:w.o,e&&(F=SR7.F.modify.get(d,_,F,p,n,R,r,"opacity"))}if("content"==r||x){if(!x&&void 0!==w.bgcol){const{gradient:e,bg:t}=0==R&&"in"==n?SR7.F.getBGAnimColor(p.cache?.color?.bg,w.bgcol):SR7.F.getBGAnimColor(w.bgcol,p.cache.color.bg);e?F.background=t.to:F.backgroundColor=t.to,p.cache??={},p.cache.color??={},p.cache.color.bg=t.to,p.cache.color.bgfrom=n+"_"+r+"_"+R}if(void 0!==w.col)F.color=w.col,x||(p.cache.color.c=w.col,p.cache.color.from=n+"_"+r+"_"+R);else if("action"!=h&&1!=R||"in"!=n||!x&&"idle"===(p?.cache?.color?.from??"idle")){if(!x&&"action"==h&&"in"==n&&"idle"!==(p?.cache?.color?.bgfrom??"idle")){const{gradient:e,bg:t}=SR7.F.getBGAnimColor(c.bg.color,p.cache.color.bg);e?p.cache.color.bg=F.background=t.to:F.backgroundColor=t.to,p.cache.color.bg=t.to,p.cache.color.bgfrom="idle"}}else F.color=()=>SR7.gV({v:c.color,id:d}),x||(p.cache.color.c=F.color,p.cache.color.from="idle")}if("loop"!==r){F.display=(e,t)=>"row"==e.subtype&&t.con&&t.mask?t.conDisplay:"chars"==r||"words"==r?"inline-block":"column"==e.subtype&&(t.mask||t.loop)&&"table-cell"==t.display?"block":t.display,p.mask&&"column"==p.subtype&&_==p.mask&&"table-cell"==F.display&&(F.display="block"),F.visibility=x&&"in"==n?"inherit":"in"==n&&0==R?f||"container"==c.type?"visible":"hidden":"in"==n&&1==R&&SR7.M[d].sbt&&SR7.M[d].settings.migrated&&"hidden"==(p.par?.el?.style?.visibility??"visible")&&"inherit"==p.visibility?"visible":()=>p.visibility,0==R&&"in"==n&&"action"!==h&&"parent"!==h&&(F.x="inherit"==F.x||"function"==typeof F.x&&"inherit"==F.x()?0:F.x,F.y="inherit"==F.y||"function"==typeof F.y&&"inherit"==F.y()?0:F.y),"mask"==r&&(p.cache.tl[r].overflow=F.overflow);for(let e of y)"function"!=typeof F[e]||"inherit"!=F[e]()&&null!=F[e]()||void 0===p.cache.tl?.[r]?.[e]?"inherit"==F[e]||null==F[e]?void 0!==p.cache.tl[r][e]&&(F[e]=p.cache.tl[r][e]):"scaleX"==e&&F.skewX?p.cache.tl[r][e]=w.sX??p.cache.tl[r].scaleX:"scaleY"==e&&F.skewY?p.cache.tl[r][e]=w.sY??p.cache.tl[r].scaleY:p.cache.tl[r][e]=F[e]:F[e]=p.cache.tl[r][e],"inherit"==F[e]&&"visibility"!==e&&delete F[e]}}"in"==n&&1==R&&(p.tl.inFrameShift=M),"action"==h&&"in"==n&&R>0&&(M-=p.tl.inFrameShift),void 0!==p.fxc&&"content"==r&&"c"==(w.fx??"")[0]&&(l.add(SR7.F.getFXCoverAnim(p,w,n,R),"out"===n?0:M),"out"!==n&&p.el.classList.add("sr7-fx-hidden")),!p.backFace&&("clip"==r||"function"==typeof F.rotationX&&Math.abs(F.rotationX?.())>90||Math.abs(F.rotationX)>90||"function"==typeof F.rotationY&&Math.abs(F.rotationY?.())>90||Math.abs(F.rotationY)>90||p.filters?.backdrop?.used&&_tpt.is_mozilla)&&(p.backFace=!0,p.el.style.backfaceVisibility="visible","clip"==r&&p.el.classList.add("sr7-withclip")),b=!0;let k="d"==w.pE||null==w.pE?c.pE||"d":w.pE;if(void 0!==w.rep||1==(p.repeat?.[p.repeat.cur]?.state??0))void 0!==w.rep&&("s"!=w.rep.s&&"se"!=w.rep.s||(p.repeat??={},p.repeat[r+"_"+R+"_"+u]?.tl?.kill(),p.repeat[p.repeat.cur=r+"_"+R+"_"+u]={state:1,at:M,tl:_tpt.gsap.timeline()},p.repeat[p.repeat.cur].tl.eventCallback("onStart",o.frameRepeatStart,[{id:d,skey:m,c:p,scene:n,layer:c,target:r,caller:h,frame:R,sbt:f,pE:k}]),l.add(p.repeat[p.repeat.cur].tl,M)),"e"!=w.rep.s&&"se"!=w.rep.s||(p.repeat[p.repeat.cur].state=2,p.repeat[p.repeat.cur].c=w.rep.c,p.repeat[p.repeat.cur].tl.repeat(w.rep.r??-1),p.repeat[p.repeat.cur].tl.vars.repeatRefresh=w.rep.sh??!0,p.repeat[p.repeat.cur].tl.yoyo(w.rep.y??!1))),void 0!==p.repeat&&(p.repeat[p.repeat.cur].tl.to(_,F,M-p.repeat[p.repeat.cur].at),p.repeat[p.repeat.cur].c&&p.repeat[p.repeat.cur].tl.eventCallback("onRepeat",o.frameRepeat,[{id:d,skey:m,c:p,scene:n,layer:c,target:r,caller:h,frame:R,sbt:f,pE:k}]));else{if(0==R&&"in"===n)void 0!==F.opacity&&(F.opacity=parseFloat(F.opacity)),l.set(_,F,M),p.animState.frame=0;else{void 0!==F.opacity&&(F.opacity=parseFloat(F.opacity)),1==R&&"in"==n&&0==p.animState.frame&&0==F.duration&&(F.duration=.0075);let e=_tpt.gsap.to(_,F);e.eventCallback("onStart",o.frameStarted,[{id:d,c:p,scene:n,layer:c,target:r,caller:h,frame:R,sbt:f,pE:k}]),f&&e.eventCallback("onUpdate",o.frameUpdated,[{id:d,c:p,scene:n,layer:c,target:r,caller:h,frame:R,sbt:f,pE:k}]),e.eventCallback("onComplete",o.framesCompleted,[{id:d,c:p,scene:n,layer:c,target:r,caller:h,frame:R,sbt:f,pE:k}]),l.add(e,"out"===n?0:M)}"pan"!=r||p.tl.in.pan||"carousel"!=SR7.M[d].settings.type||(l.progress(0),l.paused(!0),requestAnimationFrame((()=>{l.render(0,!1,!0)})))}void 0!==F.modifiers&&(p.mod.coreTween??={},void 0!==F.modifiers.filter&&(p.mod.coreTween.filter??={},p.mod.coreTween.filter[n]=r),void 0!==F.modifiers.x&&(p.mod.coreTween.xy??={},p.mod.coreTween.xy[n]=r),void 0!==F.modifiers.opacity&&(p.mod.coreTween.opacity??={},p.mod.coreTween.opacity[n]=r))}l.eventCallback("onStart",o.layerStarted,[{id:d,c:p,scene:n,layer:c,target:r,caller:h,sbt:f,tl:l}]),l.eventCallback("onUpdate",o.layerUpdated,[{id:d,c:p,scene:n,layer:c,target:r,caller:h,sbt:f,tl:l}]),l.eventCallback("onComplete",o.layerCompleted,[{id:d,c:p,scene:n,layer:c,target:r,caller:h,sbt:f,tl:l}])}"loop"==r?(S??=_tpt.gsap.timeline(),S.add(l,0)):"pan"===r||"pan"==r&&"update"==h||y.add(l,0),p.tl[n][r]=l,p.tl[n].TL=y}if(null==u||"bg"==u)if("out"==n&&"slidebg"==c.subtype)SR7.M[d].c.leavingBG=p;else if(v.bg)if(p.el.style.display=p.display,p.el.style.visibility=p.visibility,b=!0,"slidebg"==c.subtype){if("in"!==n)return;if(void 0!==p.mod&&(p.mod.animElemXY??=p.mask?p.mask:p.el,_tpt.scrollObserver.run(SR7.M[d].c.module,!0),SR7.F.modify.process(d,"scroll")),void 0!==SR7.M[d].c.leavingBG){let e=SR7.M[d].c.leavingBG;e.tl[n]&&(e.tl[n].bg&&e.tl[n].bg.kill(),SR7.M[d].c.tl[e.skey].out.TL.add(e.tl[n].bg=SR7.F.animateBG({timeline:l,c:e,id:d,scene:"out"}),0))}p.tl.in.bg&&p.tl.in.bg.kill(),y.add(p.tl.in.bg=SR7.F.animateBG(r),0),void 0!==SR7.M[d].c.leavingBG&&SR7.M[d].c.leavingBG.temp.TL.totalDuration()<p.temp.TL.totalDuration()&&SR7.M[d].c.leavingBG.temp.TL.duration(p.temp.TL.totalDuration())}else"in"!=n&&"out"!=n||(p.tl[n].bg&&p.tl[n].bg.kill(),y.add(p.tl[n].bg=SR7.F.animateBG(r),0));return b&&(p.animState.scene=n,p.animState.caller=h||"default"),{tl:y,loops:S}},SR7.F.processHover=(e,t)=>{let{c:s,layer:a,id:r}=e;if(void 0!==(s?.cache?.hover??void 0)&&(s.cache?.hover?.requested??"none")==t)return;if(!s.animState.entered||(s.animState?.runningFrames?.length??0)>0)return;let o=parseInt(a.hov.frame.d)/1e3??300;if(o=0==o?.001:o,s.tl_hover&&s.tl_hover.progress&&s.tl_hover.progress()>0){if("idle"==t)return!0!==s.tl_hover.reversed()&&s.tl_hover.reverse(),void(s.cache.hover.requested=t);if("hover"==t)return 1==s.tl_hover.reversed()&&s.tl_hover.play(),void(s.cache.hover.requested=t)}s.cache.hover??={},s.cache.hover.requested=t,s.tl_hover=_tpt.gsap.timeline({data:{id:s.el.id+"_hover"}});const l=a.hov.frame,n=a.hov.radius,d="hover"==t?a.hov.zIndex:a.zIndex,c="hover"==t?a.hov.deco:a?.content?.deco,p="column"==a.subtype&&s.colbg?"colbg":"row"==a.subtype&&s.con?"con":"el";let h={ease:a.hov.frame.e,duration:o};void 0!==l.x&&(h.x=l.x),void 0!==l.y&&(h.y=l.y),void 0!==l.z&&(h.z=l.z),(void 0!==l.rX||void 0!==l.rotationX)&&(h.rotationX=l.rX??l.rotationX??0),(void 0!==l.rY||void 0!==l.rotationY)&&(h.rotationY=l.rY??l.rotationY??0),(void 0!==l.rZ||void 0!==l.rotationZ)&&(h.rotationZ=l.rZ??l.rotationZ??0),void 0!==d&&"auto"!==d&&(h.zIndex=d),"text"==a.type&&void 0!==c&&(h.textDecoration=c);let u,m=s.perspective=SR7.F.usePerspective(l,SR7.M[r].settings.general,600,!0);if(void 0!==m&&s.tl_hover.set(s.el,{transformPerspective:m??600}),h=i(h,l),s.svg&&!a.content?.oC&&void 0!==a.hov.svg&&(void 0!==a.hov.svg.c&&s.tl_hover.to(s.svgPaths.length>0?s.svgPaths:s.el,{ease:h.ease,duration:h.duration,fill:a.hov.svg.c},0),void 0!==a.hov?.svg?.stroke?.c&&"transparent"!==a.hov?.svg?.stroke?.c&&s.tl_hover.to(s.svg,{ease:h.ease,duration:h.duration,stroke:a.hov?.svg?.stroke.c,strokeWidth:parseInt(a.hov?.svg?.stroke.w)+"px",strokeDashoffset:a.hov?.svg?.stroke.o,strokeDasharray:a.hov?.svg?.stroke.d},0)),h.opacity=l.o||l.opacity,a.hov.color?.bg)if(a.bg.image)h.backgroundColor="string"==typeof a.hov.color.bg?a.hov.color.bg:a.hov.color.bg.string;else{let{gradient:e,bg:t}=SR7.F.getBGAnimColor(a.hov.color.bg,s.cache?.color?.bg,a.hov.color.gAnim);void 0!==s.colbg?(e&&s.tl_hover.set(s.colbg,{background:t.from}),s.tl_hover.to(s.colbg,{ease:h.ease,duration:h.duration,["background"+(e?"":"Color")]:t.to},0)):(t?.from&&-1!==t.from.indexOf("180deg")&&-1!==t.to.indexOf("180deg")&&2===t.from.split("deg").length&&2===t.to.split("deg").length&&(t.from=t.from.replace("180deg,",""),t.to=t.to.replace("180deg,","")),t?.from&&(e&&s.tl_hover.set(s.el,{background:t.from}),!e&&"transparent"==t.from&&s.tl_hover.set(s.el,{background:_tpt.gradient.transToColor(t.to)})),t?.to&&(h["background"+(e?"":"Color")]=t.to))}if(a.hov.color.c!==(s.cache?.color?.c??void 0)&&(h.color=a.hov.color.c),JSON.stringify(a.hov.border)!==JSON.stringify(a.border??{})){const e=a.hov.border;u={duration:h.duration,ease:h.ease,borderColor:e.c??"transparent",borderStyle:null==e.s?"none":"string"==typeof e.s?e.s:SR7.gV({v:e.s??"none",id:r})};for(let t=0;t<4;t++)u[SR7.D.BWID[t]]=_tpt.unitize(SR7.gV({v:e?.w?.[SR7.D.DS[t]]??0??"0px",id:r,f:a.fluid?.tr,m:"round"}))}if(JSON.stringify(a.hov.radius)!==JSON.stringify(a.radius??{})){u??={duration:h.duration,ease:h.ease};for(let e=0;e<4;e++)u[SR7.D.BRAD[e]]=_tpt.unitize(n?.[SR7.D.DS[e]]??"0px")}void 0!==u&&s.tl_hover.to(s[p],u,0);let g="column"==s.subtype&&s.mask?[s.colbg,s.con]:s.el,f=s.mask?"column"==s.subtype?[s.mask,s.colbgMask]:s.mask:void 0;if(SR7.F.useFilter(a.hov.filter)||s.filters?.simple?.filter){let e=SR7.F.getFilterStyle(a.hov.filter,"",s.filters?.simple?.used??void 0),i=SR7.F.getFilterStyle(s.filters?.simple?.filter??"","",e.used);h.filter=e.filter,"hover"==t&&""!==h.filter&&_tpt.gsap.set(g,{filter:i.filter})}if("hover"==t)for(let e of SR7.D.animAttr)"inherit"!=h[e]&&null!=h[e]&&h[e]!=s.cache.tl.content[e]||delete h[e];s.tl_hover.to(g,h,0),f&&s.tl_hover.eventCallback("hover"==t?"onStart":"onComplete",(e=>{_tpt.gsap.set(e.mask,{overflow:e.oflow})}),[{mask:f,oflow:"hover"==t?a.hov?.m?"hidden":"visible":s.cache?.tl?.mask?.overflow}]),s.tl_hover.eventCallback("onReverseComplete",(e=>{e.cache=void 0,e.tl=void 0,e.mask&&_tpt.gsap.set(e.mask,{overflow:e.oflow})}),[{cache:s.cache.hover,tl:s.tl_hover,mask:f,oflow:s.cache?.tl?.mask?.overflow}])};const e=(e,t,s,i,a,r,o)=>s?s=>SR7.cVal(SR7.gV({v:t[o],id:e,s:"scale"}),e,i,SR7.gV({v:t[o+"Re"],id:e,s:"scale"}),t.off,o,i.splitText[r][s],a,s):()=>SR7.cVal(SR7.gV({v:t[o],id:e,s:"scale"}),e,i,SR7.gV({v:t[o+"Re"],id:e,s:"scale"}),t.off,o,!1,a),t=(e,t,s)=>s?s=>SR7.F.getOffset(t,void 0,SR7.M[e].lastChangeDir,s):()=>SR7.F.getOffset(t,void 0,void 0,0),s=e=>"inherit"==e?void 0:e,i=(e,t)=>{let i=s(t.sX??t.scaleX),a=s(t.sY??t.scaleY),r=s(t.skX??t.skewX),o=s(t.skY??t.skewY);return void 0===r&&void 0===o||(void 0!==r&&(a=parseFloat(a??1)*Math.cos((r=parseFloat(r))*_tpt.DEG2RAD)),void 0!==o&&(i=parseFloat(i??1)*Math.cos((o=parseFloat(o))*_tpt.DEG2RAD))),void 0===r&&void 0===o||(e.skewX=_tpt.unitize(r??0,"deg"),e.skewY=_tpt.unitize(o??0,"deg")),void 0===i&&void 0===a||(e.scaleX=i??1,e.scaleY=a??1),e},a=(e,t,s,i)=>a=>{let r=SR7.F.getOffset(t,void 0,SR7.M[e].lastChangeDir,a);if("skew"==s)return _tpt.unitize(r??0,"deg");let o=SR7.F.getOffset(i,void 0,SR7.M[e].lastChangeDir,a);return null==o?r:parseFloat(r||1)*Math.cos(parseFloat(o)*_tpt.DEG2RAD)},r=(e,t,s,i)=>{let a=(i||e.e/1e3<=t.time())&&e.e/1e3>t.time()?1e3*(e.e/1e3-t.time()):0;(i||e.e/1e3<=t.time())&&(-1==e.r||s<e.r)&&setTimeout((()=>{t.time(e.s/1e3)}),a)};SR7.F.updateVisibility=e=>{"column"==e.subtype&&e.target.style.visibilty!==e.el.style.visibility&&(e.target.style.visibility=e.visibility),e.parallax&&e.parallax.style.visibility!==e.el.style.visibilty&&(e.parallax.style.visibility=e.visibility),e.mask&&e.mask.style.visibility!==e.el.style.visibilty&&(e.mask.style.visibility=e.visibility),e.loop&&e.loop.style.visibility!==e.el.style.visibilty&&(e.loop.style.visibility=e.visibility),e.addonWrap&&e.addonWrap.style.visibility!==e.el.style.visibilty&&(e.addonWrap.style.visibility=e.visibility)};const o={sceneStarted:e=>{let{id:t,skey:s,scene:i}=e;"in"==i&&(SR7.M[t].states.sceneInProgress=!0),SR7.M[t].slides[s].slide?.loop?.u&&(SR7.M[t].c.tl[s].loop=0),void 0!==SR7.M[t].c.pans&&SR7.F.pan.observe(t)},sceneUpdated:e=>{let{id:t,skey:s,scene:i}=e;"in"==i&&void 0!==SR7.M[t].c.tl[s].loop&&r(SR7.M[t].slides[s].slide?.loop,SR7.M[t].c.tl[s][i].TL,SR7.M[t].c.tl[s].loop++)},sceneCompleted:function(e){let{id:t,skey:s,scene:i,caller:a}=e;"in"==i&&SR7.F.slideDelayFinished(t),"in"==i&&void 0!==SR7.M[t].c.tl[s].loop?r(SR7.M[t].slides[s].slide?.loop,SR7.M[t].c.tl[s][i].TL,SR7.M[t].c.tl[s].loop++,!0):"out"==i&&"action"!==a&&"parent"!==a&&!0!==SR7.M[t].zOrder.managed&&SR7.F.hideLeavingSlide(t,s)},layerStarted:function(e){let{scene:t,c:s,sbt:i,id:a,frame:r}=e;"out"!==t&&(s.state="animated"),"in"==t&&s.repeat&&SR7.F.updateVisibility(s),i&&!SR7.M[a].sbt.__time&&SR7.F.sbt.process(a)},layerUpdated:async function(e){let{id:t,scene:s,c:i,target:a,sbt:r}=e;r&&!SR7.M[t].sbt.done&&SR7.M[t].sbt?.[SR7.M[t].current.id]?.[i.lkey]&&!SR7.M[t].sbt[SR7.M[t].current.id][i.lkey].tl.paused()&&SR7.M[t].sbt[SR7.M[t].current.id][i.lkey].tl.time()>=SR7.M[t].sbt.__time&&SR7.M[t].sbt[SR7.M[t].current.id][i.lkey].tl.pause(),i.animState?.flagged&&0==i.animState?.frame&&"default"==i.animState?.caller&&"in"==i.animState?.scene||(i.animState.flagged=!0,"in"==s&&"pan"==a&&i.canvas.drawImg(),i.announce?.update&&await SR7.F.triggerLayerEvent(e,"update"))},layerCompleted:function(e){let{scene:t,layer:s,c:i,target:a,caller:r}=e;if("out"==t&&"content"==a&&(SR7.F.manageLayerListeners(i,s,!1),i.state="removed",void 0!==(i.cache?.hover?.requested??void 0)&&(i.cache.hover.requested="idle")),"out"==t)for(let e in i.repeat)_tpt.hop(i.repeat,e)&&"cur"!==e&&i.repeat[e].tl.kill();"out"==t&&(i.el.style.pointerEvents="none",i[i.LME]?.style&&(i[i.LME].style.pointerEvents="none"),i[i.LME].style.visibility="hidden",i.el.style.visibility="hidden"),i.animState.runningFrames=[],delete i.animState.flagged},frameRepeatStart:async function(e){e.caller="repeat",e.animState={scene:e.scene,frame:1},await SR7.F.triggerLayerEvent(e,"framestarted")},frameRepeat:async function(e){let{id:t,c:s,scene:i,skey:a}=e,r=SR7.F.triggeredChildren(t,a,s.lkey);e.c.animState.frame=e.frame,"in"==i&&r&&r.length>0&&await SR7.F.animateLayers({id:t,skey:a,layers:r,scene:i,caller:"parent",ffw:!0,timeto:s.repeat[s.repeat.cur].at}),e.caller="repeat",e.animState={scene:e.scene,frame:1},await SR7.F.triggerLayerEvent(e,"framerepeated")},frameStarted:async function(e){let{id:t,c:s,scene:i,layer:a,target:r,frame:o,caller:n,pE:d,sbt:c}=e;o=parseInt(o),"hover"==s.cache?.hover?.requested&&s.tl_hover&&(s.tl_hover.kill(!0),s.cache.hover.requested="idle",delete s.tl_hover),s.animState.frame=o,s.animState.scene=i,s.animState.entered="in"===i&&s.animState.entered;let p=i+"_"+r+"_"+o;-1==s.animState.runningFrames.indexOf(p)&&s.animState.runningFrames.push(p),"in"==i&&"content"==r&&1==o&&"update"!==n&&SR7.F.manageLayerListeners(s,a,!0),s.el.style.pointerEvents="out"==i||"in"==i&&(0==o||1==o)?"none":s.listeners.hasAny?"auto":"n"==d?"none":"i"==d?"inherit":s.pE,s[s.LME]?.style?.pointerEvents&&(s[s.LME].style.pointerEvents=s.el.style.pointerEvents),SR7.F.updateVisibility(s),await l(s,t,o,i,n);let h="in"==i&&"update"!==n&&"enterstage"!==s.lastEventCalled&&(c&&!s.animState.stageState||1==o)?"enterstage":"out"==i&&"update"!==n?"leavestage":"framestarted";s.animState.stageState=!0,this._dur&&(e.duration=this._dur),this._start&&(e.start=this._start),this.vars?.ease&&(e.ease=this.vars.ease),await SR7.F.triggerLayerEvent(e,h)},frameUpdated:async function(e){let{scene:t,frame:s,pE:i,c:a,interrupt:r}=e;r||"in"!=t||1!=s||(a.el.style.pointerEvents="n"==i?"none":a.listeners.hasAny?"auto":a.pE,a[a.LME]?.style?.pointerEvents&&(a[a.LME].style.pointerEvents=a.el.style.pointerEvents))},framesCompleted:async function(e){let{id:t,scene:s,frame:i,pE:a,c:r,caller:o,target:l,layer:n,interrupt:d}=e;d||"in"!=s||1!=i||(r.el.style.pointerEvents="n"==a?"none":r.listeners.hasAny?"auto":r.pE,r[r.LME]?.style?.pointerEvents&&(r[r.LME].style.pointerEvents=r.el.style.pointerEvents));const c=s+"_"+l+"_"+i;let p;if(r.animState.runningFrames=r.animState.runningFrames.filter((e=>e!==c)),d||"in"!=s||"animateBG"!=o||"slidebg"!=r.subtype?"out"==s&&"animateBG"==o&&"slidebg"==r.subtype?p="leftstage":(p=1==r.animState.frame&&"update"!==o&&"in"==s&&0==r.animState.runningFrames.length?"enteredstage":"out"==s&&"update"!==o?"leftstage":"frameended","enteredstage"==p&&(r.animState.entered=!0)):(SR7.F.triggerSlideEvent(t,"afterChange",["onafterswap","onchange"]),p="enteredstage"),p&&(r.animState.stageState="leftstage"!=p,await SR7.F.triggerLayerEvent(e,p)),!d&&"in"==s&&"animateBG"==o&&r.media&&"slidebg"===r.subtype&&"html5"!==r.media.player.options.type)r.media.play(),SR7.M[t].globalMuted&&r.media.mute();else if("out"==s&&0==i&&r.media){let e=r.media.player.options;"1sttime"==e.autoPlay&&(e.autoPlay=!1),"no1sttime"==e.autoPlay&&(e.autoPlay=!0),r.media.pause(),e.rewind&&r.media.rewind()}"out"==s&&r?.tl?.in?.pan&&r.tl.in.pan.pause()}};SR7.F.hideLeavingSlide=(e,t)=>{if(null==e||null==t||-1==t)return;const s=SR7.M[e];"carousel"!=s.settings.type&&(s.c.slides[t].style.display="none",s.c.slides[t].style.visibilty="hidden",s.c.slides[t].style.pointerEvents="none",s.zOrder={},SR7.F.slideDelayFinished(e))},SR7.F.slideDelayFinished=e=>{clearTimeout(SR7.M[e].states.waitingForNextCallTimer),delete SR7.M[e].states.waitingForNextCallTimer,SR7.M[e].states.sceneInProgress&&(SR7.M[e].states.sceneInProgress=!1,SR7.M[e].states.waitingForNextCall&&SR7.F.requestSlide(SR7.M[e].states.waitingForNextCall))},SR7.F.getRandomSlidetransition=(e,t=0)=>{if(t>10)return null;const s=Object.keys(e).filter((e=>"in"!==e&&"out"!==e&&"icon"!==e));if(0===s.length)return null;const i=e[s[Math.floor(Math.random()*s.length)]];return i.title?i:i.title||"object"!=typeof i?SR7.F.getRandomSlidetransition(e,t+1):SR7.F.getRandomSlidetransition(i,t+1)},SR7.F.animateBG=function(e){const{timeline:t,scene:s,id:i,c:a,layer:r}=e,o=SR7.M[i];n(s,a),u(a,s,a.canvas.width,a.canvas.height),d(a);let l=c(o,t);l.d=parseInt(l.d),l=p(l,s),l=h(l,s);let m=a.temp=g(a,l,s,i,o);return f(m,l,s,o),v(s,l,m,a,o),l=SR7.D.transitions?.[l.tr]?.updateAnim?SR7.D.transitions[l.tr].updateAnim(l,m):l,l[s].e??=l.e??"power2.inOut",m.fdf=m.col*m.row<2||null==l.f?"start":l?.dir??l.f,l.d3=y(l.d3,m.d,m.sdir),l[s].mo=SR7.D.transitions.motionFilter.init(a.aCanvas,l[s].mo),SR7.D.transitions.buildTimeline(i,a,m,l,r),m.TL},SR7.D.transitions={...SR7.D.transitions,buildTimeline:(e,t,s,i,a)=>{if(null!=i.tr&&SR7.D.transitions[i.tr]?.buildTimeline)s.TL=SR7.D.transitions[i.tr].buildTimeline(e,t,s,i,a),SR7.D.transitions?.[i.tr]?.extendTimeLine&&s.TL.add(SR7.D.transitions[i.tr].extendTimeLine(s,i,t),0);else{let r="oppslidebased"==s.fdf?1==s.sdir?"end":"start":"slidebased"==s.fdf?1==s.sdir?"start":"end":"nodelay"===s.fdf?"start":s.fdf;if("in"===s.scene){let a=i.in;for(let e=0;e<s.amnt;e++)s.boxes[e]={x:SR7.F.getOffset(a.x||0,a.m?s.slot.ow:t.canvas.width,s.sdir,e),y:SR7.F.getOffset(a.y||0,a.m?s.slot.oh:t.canvas.height,s.sdir,e),o:SR7.F.getSpecialValue(a.o||0,e,s.sdir),sx:SR7.F.getSpecialValue(0==a.sx?0:a.sx||1,e,s.sdir),sy:SR7.F.getSpecialValue(0==a.sy?0:a.sy||1,e,s.sdir),r:0!==a.r?SR7.F.getSpecialValue(a.r||0,e,s.sdir):0};s.TL.to(s.boxes,s.d/1e3,{delay:s.delay,o:1,sx:1,sy:1,r:0,x:0,y:0,ease:i.e,stagger:{amount:"nodelay"==s.fdf?0:s.sd,grid:[s.col,s.row],from:r}}),void 0!==i.d3&&s.TL.add(SR7.D.transitions.d3.cubeTL(i.d3,t,s,"in",SR7.M[e].dims),0),i.filter?.u&&s.TL.add(SR7.D.transitions.filter.extendTimeLine(s,i,t),0)}else{for(let e=0;e<s.amnt;e++)s.boxes[e]={x:0,y:0,o:1,sx:1,sy:1,r:0};let a=i.out;s.TL.to(s.boxes,s.d/1e3,{o:function(e){return SR7.F.getSpecialValue(0==a.o?0:a.o||1,e,s.sdir)},sx:function(e){return SR7.F.getSpecialValue(0==a.sx?0:a.sx||1,e,s.sdir)},sy:function(e){return SR7.F.getSpecialValue(0==a.sy?0:a.sy||1,e,s.sdir)},r:0!==a.r&&void 0!==a.r?function(e){return SR7.F.getSpecialValue(a.r||0,e,s.sdir)}:0,x:function(e){return SR7.F.getOffset(a.x||0,a.m?s.slot.ow:t.aCanvas.width,s.sdir,e)*(a.reversed?-1:1)},y:function(e){return SR7.F.getOffset(a.y||0,a.m?s.slot.oh:t.aCanvas.height,s.sdir,e)*(a.reversed?-1:1)},ease:a.e,stagger:{amount:"nodelay"===s.fdf?0:s.sd,grid:[s.col,s.row],from:r}},void 0!==a.outdelay?a.outdelay:0),void 0!==i.d3&&s.TL.add(SR7.D.transitions.d3.cubeTL(i.d3,t,s,"out",SR7.M[e].dims),0)}SR7.D.transitions?.[i.tr]?.extendTimeLine&&s.TL.add(SR7.D.transitions[i.tr].extendTimeLine(s,i,t),0),s.TL.eventCallback("onUpdate",SR7.D.transitions.default.updateAnim,[e,t,s,i,a])}s.TL.eventCallback("onStart",(async function(e){e.c.TSS=Date.now(),"in"==e.scene?await SR7.F.triggerLayerEvent(e,"enterstage"):"out"==e.scene&&await SR7.F.triggerLayerEvent(e,"leavestage"),o.frameStarted(e),SR7.D.transitions.default.start(e.c,e.id,e.scene)}),[{c:t,caller:"animateBG",frame:0,pE:i[s.scene].pE,scene:s.scene,layer:a,id:s.id}]),s.TL.eventCallback("onComplete",(e=>SR7.D.transitions.handleCallback(e,s)),[{c:t,caller:"animateBG",frame:0,scene:s.scene,layer:a,id:s.id}]),s.TL.eventCallback("onInterrupt",(e=>SR7.D.transitions.handleCallback(e,s,"onInterrupt",!0)),[{c:t,caller:"animateBG",frame:0,scene:s.scene,layer:a,id:s.id}])},handleCallback:async(e,t,s="onComplete",i=!1)=>{let a=Date.now(),r=a-(e.c?.TSS??a-50)<20?5:0;r||SR7.D.transitions.default.complete(e.c,e.id,e.scene,i),setTimeout((()=>{"html5"===e.c.media?.player.options.type&&e.c.media.stopCanvas(),e.interrupt=i,SR7.F.slideDelayFinished(e.id),o.framesCompleted(e),r&&SR7.D.transitions.default.complete(e.c,e.id,e.scene,i),t[`${s}Callback`]&&t[`${s}Callback`](t,e.c,e.id)}),r)},setDimensions:(e,t)=>{let s="random"==t.col?Math.round(10*Math.random()+3):Math.max(1,Math.min(t.col??1,e.aCanvas.width-10)),i="random"==t.row?Math.round(10*Math.random()+3):Math.max(1,Math.min(t.row??1,e.aCanvas.height-10)),a={s:{},c:{},ow:Math.ceil(e.aCanvas.width/s),oh:Math.ceil(e.aCanvas.height/i)};return a.dx=0-a.ow/2,a.dy=0-a.oh/2,i=Math.ceil(e.aCanvas.height/a.oh)||1,{col:s,row:i,slot:a,width:e.canvas.width,height:e.canvas.height}},default:{updateAnim:(e,t,s,i,a)=>{SR7.E.backend&&(t.media&&("html5"==t.media.player.options.type&&SR7.editing.timelinepos&&t.media.goto(SR7.editing.timelinepos,!0),s.TL.duration()<SR7.editing.timelinepos?t.media.player.container.style.visibility="visible":t.media.player.container.style.visibility="hidden"),t.aCanvas.ctx.clearRect(0,0,t.aCanvas.width,t.aCanvas.height));let r=i[s.scene];if(t.aCanvas&&(s.height!==t.canvas.height||s.width!==t.canvas.width)){t.aCanvas.updateDim();let o=s.TL.progress();s.TL.clear(),s={...s,...SR7.D.transitions.setDimensions(t,r)},SR7.E.backend&&(t.aCanvas.canvas.width=s.width,t.aCanvas.canvas.height=s.height),SR7.D.transitions.buildTimeline(e,t,s,i,a),s.TL.progress(o)}let o=0;const l={};if(null!=t.aCanvas){if((r.mo??0)>0?SR7.D.transitions.motionFilter.render(t.aCanvas,r.moo):t.aCanvas.ctx.clearRect(0,0,t.aCanvas.width,t.aCanvas.height),s.bg&&(t.aCanvas.ctx.fillStyle=s.bg,t.aCanvas.ctx.fillRect(0,0,t.aCanvas.width,t.aCanvas.height)),i.filter?.u&&SR7.D.transitions.filter.update(i,t.aCanvas.ctx,t.aCanvas.canvasFilter),t.canvas.canvas.width>0&&t.canvas.canvas.height>0)for(let e=0;e<s.col;e++){s.slot.sx=s.slot.ow*e,s.slot.tw=s.slot.ow*(e+.5),s.slot.c.wd=Math.min(0,t.aCanvas.width-(s.slot.tw+s.slot.dx+s.slot.ow)),s.slot.dw=s.slot.sw=s.slot.ow+s.slot.c.wd;for(let a=0;a<s.row;a++)t.aCanvas.ctx.save(),l.r=-Math.PI/180*s.boxes[o].r,l.csx=0!==r.r?Math.cos(l.r)*s.boxes[o].sx:s.boxes[o].sx,l.csy=0!==r.r?Math.cos(l.r)*s.boxes[o].sy:s.boxes[o].sy,l.ssx=0!==r.r?Math.sin(l.r)*s.boxes[o].sx:0,l.ssy=0!==r.r?Math.sin(l.r)*-s.boxes[o].sy:0,s.slot.sy=s.slot.oh*a,s.slot.th=s.slot.oh*(a+.5),SR7.D.transitions?.[i.tr]?.beforeDraw&&SR7.D.transitions[i.tr].beforeDraw(t.aCanvas.ctx,s,o),r.m&&(t.aCanvas.ctx.beginPath(),t.aCanvas.ctx.rect(s.slot.ow*e,s.slot.oh*a,s.slot.ow,s.slot.oh),t.aCanvas.ctx.clip()),t.aCanvas.ctx.transform(l.csx,l.ssx,l.ssy,l.csy,s.slot.tw+s.boxes[o].x,s.slot.th+s.boxes[o].y),t.aCanvas.ctx.globalAlpha=Math.max(0,s.boxes[o].o),s.slot.c.hd=t.aCanvas.height-(s.slot.th+s.slot.dy+s.slot.oh),s.slot.c.hd=s.slot.c.hd<0?s.slot.c.hd:0,s.slot.dh=s.slot.sh=s.slot.oh+s.slot.c.hd,s.slot.sw>1&&s.slot.sh>1&&t.aCanvas.ctx.drawImage(t.canvas.canvas,s.slot.sx,s.slot.sy,s.slot.sw,s.slot.sh,s.slot.dx,s.slot.dy,s.slot.dw,s.slot.dh),t.aCanvas.ctx.restore(),SR7.D.transitions?.[i.tr]?.afterDraw&&SR7.D.transitions[i.tr].afterDraw(t.canvas.canvas,t.aCanvas.ctx,s,o,l),o++}void 0!==i.d3&&i.d3.su&&SR7.D.transitions.d3.ticker(i.d3,s,t)}},start:(e,t,s)=>{const i=SR7.M[t];i.c.slideBGStates[e.skey]="animating",null==e.mod&&(e.el.style.opacity=1),e.canvas.canvas.style.visibility="hidden",e.canvas.canvas.style.opacity=0,e.el.style.visibility="visible","out"==s&&"out"==i.zOrder.use&&i.zOrder.managed&&SR7.F.swapSlidezIndex(t,e.skey),SR7.E.backend&&"out"===s||SR7.F.manageLayerListeners(e,i.slides[e.skey].layers[e.lkey],"in"==s)},complete:(e,t,s,i)=>{const a=SR7.M[t];null==e.mod&&(e.el.style.opacity=1),SR7.D.transitions.motionFilter.complete(e,e.aCanvas),SR7.E.backend&&"out"===s||(e.canvas.canvas.style.visibility="visible"),e.canvas.canvas.style.opacity=1,a.c.slideBGStates[e.skey]=s,SR7.E.backend||(void 0!==e.aCanvas&&e.aCanvas.canvas.remove(),e.aCanvas=void 0,i||SR7.E.backend||(a.zOrder.managed&&a.zOrder.use==s&&SR7.F.swapSlidezIndex(t),"out"==s&&SR7.F.hideLeavingSlide(t,e.skey)))}},motionFilter:{init:function(e,t){return void 0!==t&&parseFloat(t)>0&&(t=parseFloat(t),e.fmShadow=void 0===e.fmShadow?document.createElement("canvas"):e.fmShadow,e.fmCtx=e.fmShadow.getContext("2d"),e.fmShadow.width=e.ctx.canvas.width,e.fmShadow.height=e.ctx.canvas.height,e.fmCtx.globalAlpha=tpGS.gsap.utils.mapRange(100,0,40,0,t)/100,e.fmCtx.clearRect(0,0,e.ctx.canvas.width,e.ctx.canvas.height)),t},render:function(e,t){"partial"===t&&(e.fmCtx.globalCompositeOperation="source-over"),0!=e.canvas.width&&0!=e.canvas.height&&(e.fmCtx.drawImage(e.canvas,0,0,e.canvas.width,e.canvas.height),e.ctx.drawImage(e.fmCtx.canvas,0,0,e.canvas.width,e.canvas.height),"partial"===t&&(e.fmCtx.globalCompositeOperation="source-atop"),"partial"!==t&&"full"!==t||(e.fmCtx.fillStyle="rgba(255, 255, 255, 0.1)",e.fmCtx.fillRect(0,0,e.canvas.width,e.canvas.height)))},complete:function(e){e.fmShadow&&e.fmShadow.remove()}},filter:{update:function(e,t,s){if(null==e.filter.tl)return;let i=e.filter;var a=void 0!==s||void 0!==i.tl.blur?" blur("+(void 0!==s?s:0+i.tl.blur!==void 0?i.tl.blur:0)+"px)":"";t.canvas.style.filter=void 0===i.tl.filter?""+a:i.tl.filter+a},extendTimeLine:function(e,t,s){let i=t.filter;if(null!=i){var a=void 0!==i.g&&"0%"!==i.g&&0!==i.g?(""===a?"":" ")+"grayscale(_g_%)":"";return a+=void 0!==i.h&&"100%"!==i.h&&100!==i.h?(""===a?"":" ")+"brightness(_h_%)":"",a+=void 0!==i.s&&"0px"!==i.s&&0!==i.s?(""===a?"":" ")+"sepia(_s_%)":"",a+=void 0!==i.c&&100!==i.c?(""===a?"":" ")+"contrast(_c_%)":"",""!==(a+=void 0!==i.i&&0!==i.i?(""===a?"":" ")+"invert(_i_%)":"")&&(i.tl={filter:a.replace("_g_",parseFloat(i.g)).replace("_h_",parseFloat(i.h)).replace("_s_",parseFloat(i.s)).replace("_c_",parseFloat(i.c)).replace("_i_",parseFloat(i.i))}),void 0!==i.b&&"0px"!==i.b&&0!==i.b&&(void 0===i.tl?i.tl={blur:parseFloat(i.b)}:i.tl.blur=parseFloat(i.b)),void 0!==i.tl?(s.canvasFilter=!0,tpGS.gsap.to(i.tl,e.d/1e3,void 0===i.tl.filter?{blur:0}:void 0===i.tl.blur?{filter:a.replace("_g_","0").replace("_h_","100").replace("_s_","0").replace("_c_",100).replace("_i_",0),ease:i.e}:{blur:0,filter:a.replace("_g_","0").replace("_h_","100").replace("_s_","0").replace("_c_",100).replace("_i_",0),ease:i.e})):void 0}}},slidingoverlay:{getBasic:function(e){return{attr:["x","y"],[e]:"in"==e?{m:!0,o:-1,_xy:20,_gxys:10,_gxye:-10,zIndex:20,e:"power1.inOut"}:{m:!0,reversed:!1,_xy:-100,o:0,zIndex:10,e:"power1.inOut"}}},updateAnim:function(e,t){var s=void 0!==e.in.x&&0!==e.in.x&&"0%"!==e.in.x?"x":"y";e.in["g"+s+"s"]=SR7.F.getOffset(e.in[s],e.in._gxys,t.sdir,1)+"%",e.in["g"+s+"e"]=SR7.F.getOffset(e.in[s],e.in._gxye,t.sdir,1)+"%","out"==t.scene?e.out[s]=SR7.F.getOffset(e.in[s],e.out._xy,t.sdir,1)+"%":e.in[s]=SR7.F.getOffset(e.in[s],e.in._xy,t.sdir,1)+"%";var i=parseInt(e.in[s])>=0;return e.in.d="x"===s?i?"left":"right":i?"up":"down",e},beforeDraw:function(e,t,s){void 0!==t.boxes[s].d&&(t.boxes[s]._dxs="right"===t.boxes[s].d?0+t.boxes[s].mw:"left"===t.boxes[s].d?0-t.boxes[s].mw:0,t.boxes[s]._dys="down"===t.boxes[s].d?0+t.boxes[s].mh:"up"===t.boxes[s].d?0-t.boxes[s].mh:0,t.boxes[s]._xs="left"===t.boxes[s].d?0-t.boxes[s].mw:0,t.boxes[s]._ys="up"===t.boxes[s].d?0-t.boxes[s].mh:0,t.boxes[s]._xe="right"===t.boxes[s].d?t.slot.ow+t.boxes[s].mw:"left"===t.boxes[s].d?t.slot.ow-t.boxes[s].mw:t.slot.ow,t.boxes[s]._ye="down"===t.boxes[s].d?t.slot.oh+t.boxes[s].mh:"up"===t.boxes[s].d?t.slot.oh-t.boxes[s].mh:t.slot.oh,e.beginPath(),e.rect("left"===t.boxes[s].d?Math.max(0,t.boxes[s]._xs):"right"===t.boxes[s].d?Math.min(0,t.boxes[s]._xs):0,"up"===t.boxes[s].d?Math.max(0,t.boxes[s]._ys):"down"===t.boxes[s].d?Math.min(0,t.boxes[s]._ys):0,"left"===t.boxes[s].d?Math.max(t.slot.ow,t.boxes[s]._xe):"right"===t.boxes[s].d?Math.min(t.slot.ow,t.boxes[s]._xe):t.boxes[s]._xe,"up"===t.boxes[s].d?Math.max(t.slot.oh,t.boxes[s]._ye):"down"===t.boxes[s].d?Math.min(t.slot.oh,t.boxes[s]._ye):t.boxes[s]._ye),e.clip())},afterDraw:function(e,t,s,i,a){void 0!==s.boxes[i].d&&(t.save(),t.beginPath(),t.rect(Math.max(0,s.boxes[i]._dxs),Math.max(0,s.boxes[i]._dys),s.boxes[i]._xe,s.boxes[i]._ye),t.clip(),t.save(),t.transform(a.csx,a.ssx,a.ssy,a.csy,.5*s.slot.ow+s.boxes[i].x+s.boxes[i].sgx,.5*s.slot.oh+s.boxes[i].y+s.boxes[i].sgy),t.drawImage(e,0,0,s.slot.ow,s.slot.oh,s.boxes[i].sgx-s.slot.ow/2,s.boxes[i].sgy-s.slot.oh/2,s.slot.ow,s.slot.oh),t.restore(),t.fillStyle="rgba(0,0,0,0.6)",t.fillRect(s.boxes[i].gx,s.boxes[i].gy,s.slot.ow,s.slot.oh),t.restore())},extendTimeLine:function(e,t){if("in"!==e.scene)return;const s=t[e.scene];return void 0!==s.gxe||void 0!==s.gye?(_tpt.extend(e.boxes[0],{d:s.d,gx:void 0===s.gxs?0:2*SR7.F.getOffset(s.gxs,e.width,e.sdir,0),gy:void 0===s.gys?0:2*SR7.F.getOffset(s.gys,e.height,e.sdir,0),sgx:void 0===s.gxs?0:SR7.F.getOffset(s.gxs,e.width,e.sdir,0),sgy:void 0===s.gys?0:SR7.F.getOffset(s.gys,e.height,e.sdir,0),mw:0-e.width,mh:0-e.height}),_tpt.gsap.to(e.boxes,e.d/1e3,{gx:void 0===s.gxe?0:2*SR7.F.getOffset(s.gxe,e.width,e.sdir,0),gy:void 0===s.gye?0:2*SR7.F.getOffset(s.gye,e.height,e.sdir,0),sgx:void 0===s.gxe?0:2*SR7.F.getOffset(s.gxe,e.width,e.sdir,0),sgy:void 0===s.gye?0:2*SR7.F.getOffset(s.gye,e.height,e.sdir,0),mw:e.width,mh:e.height,ease:s.e})):void 0}},d3:{ticker:function(e,t,s){if(void 0!==e.helper){var i=e.smi*("in"===t.scene?e.helper.oo:e.helper.o),a=e.sma*("in"===t.scene?e.helper.oo:e.helper.o);if(e.gradient="vertical"===e.d?"in"===t.scene?s.aCanvas.ctx.createLinearGradient(0,0,0,s.aCanvas.height):s.aCanvas.ctx.createLinearGradient(0,s.aCanvas.height,0,0):"in"===t.scene?s.aCanvas.ctx.createLinearGradient(0,0,s.aCanvas.width,0):s.aCanvas.ctx.createLinearGradient(s.aCanvas.width,0,0,0),e.gradient.addColorStop(0,"rgba("+e.sc+","+i+")"),e.gradient.addColorStop(e.sl,"rgba("+e.sc+","+a+")"),s.aCanvas.ctx.fillStyle=e.gradient,s.aCanvas.ctx.fillRect(0,0,s.aCanvas.width,s.aCanvas.height),void 0!==s.cube&&s.cube.ctx){var r=void 0!==e.roomhelper&&!1!==e.roomhelper&&(90-e.roomhelper.r)/90;i=!1!==r?r:e.smi*e.helper.o,a=!1!==r?r:e.sma*e.helper.o,s.cube.ctx.clearRect(0,0,s.cube.ctx.canvas.width,s.cube.ctx.canvas.height),e.gradientW=!1!==r?"vertical"===e.d?e.t<0&&1===e.sdir||e.t>0&&-1===e.sdir?s.aCanvas.ctx.createRadialGradient(0,s.cube.ctx.canvas.width/2,0,0,0,2*s.cube.ctx.canvas.width):s.aCanvas.ctx.createRadialGradient(s.cube.ctx.canvas.width,0,0,0,0,2*s.cube.ctx.canvas.width):e.t>0&&1===e.sdir||e.t<0&&-1===e.sdir?s.aCanvas.ctx.createRadialGradient(s.cube.ctx.canvas.width/2,s.cube.ctx.canvas.height,0,s.cube.ctx.canvas.width/2,s.cube.ctx.canvas.height,s.cube.ctx.canvas.width):s.aCanvas.ctx.createRadialGradient(s.cube.ctx.canvas.width/2,.2*s.cube.ctx.canvas.height,0,s.cube.ctx.canvas.width/2,.2*s.cube.ctx.canvas.height,s.cube.ctx.canvas.width):"vertical"===e.d?s.aCanvas.ctx.createLinearGradient(0,0,0,s.cube.ctx.canvas.height):s.aCanvas.ctx.createLinearGradient(0,0,s.cube.ctx.canvas.width,0),e.gradientW.addColorStop(0,"rgba("+e.sc+","+(!1!==r?"a"===e.DIR?a:0:"a"===e.DIR?0:a)+")"),e.gradientW.addColorStop(1,"rgba("+e.sc+","+(!1!==r?"a"===e.DIR?0:a:"a"===e.DIR?a:0)+")"),s.cube.ctx.fillStyle=e.gradientW,s.cube.ctx.fillRect(0,0,s.cube.ctx.canvas.width,s.cube.ctx.canvas.height)}}},setWall:function(e,t,s,i,a,r){return e.TL=_tpt.gsap.timeline(),e.TL.add(_tpt.gsap.to(e.c,.2,{display:"block"}),0),"rotationX"===s?(e.ctx.canvas.width=i.w,e.ctx.canvas.height=i.w,e.TL.add(_tpt.gsap.set(e.w,{backgroundColor:a,width:i.w,height:i.w,transformOrigin:"50% 50% -"+i.w/2+"px",x:0,y:t>0?-(i.w-i.h):0,rotationX:t>0?-90:90,rotationY:0}),0)):(e.ctx.canvas.width=r?i.w:i.h,e.ctx.canvas.height=i.h,e.TL.add(_tpt.gsap.set(e.w,{backgroundColor:a,width:r?i.w:i.h,height:i.h,transformOrigin:"50% 50% -"+(r?i.w:i.h)/2+"px",x:t<0?i.w-i.h:0,y:0,rotationX:0,rotationY:t>0?-90:90}),0)),e.TL},buildCube:function(e,t,s){e.cube={c:document.createElement("div"),w:document.createElement("canvas")},e.cube.ctx=e.cube.w.getContext("2d");for(let t of["c","w"])e.cube[t].style.position="absolute",e.cube[t].style.webkitBackfaceVisibility="hidden",e.cube[t].style.backfaceVisibility="hidden",e.cube[t].style.left="0px",e.cube[t].style.top="0px",e.cube[t].style.zIndex=0;e.cube.c.style.transformStyle="preserve-3d",_tpt.gsap.set(e.cube.c,{width:s.module.w,height:s.module.h}),_tpt.gsap.set(e.cube.w,{width:s.module.w,height:s.module.h,backgroundColor:"#ccc"}),e.cube.c.appendChild(e.cube.w),e.el.appendChild(e.cube.c)},cubeTL:function(e,t,s,i,a){if("none"!=(e?.f??"none")){t.el.style.transformStyle="preserve-3d",t.el.style.overflow="visible";var r=_tpt.gsap.timeline(),o="incube"===e.f?1:-1,l="incube"===e.f||"cube"===e.f,n="fly"===e.f?-30:90,d="turn"!==e.f&&!1!==e.t&&s.notFirstIn,c=-1*e.z,p={},h={z:d?0:c,ease:"power1.inOut"},u={ease:e.e},m=[t.aCanvas.canvas],g=l?"50% 50% ":"20% 20% ",f="rotationX",v="rotationY",y="y",S="height",b=e.fd;if("vertical"!==e.d?(f="rotationY",v="rotationX",y="x",S="width",e.DIR=1===e.sdir?"b":"a"):e.DIR=1===e.sdir?"a":"b",t.aCanvas.canvas.style.backfaceVisibility="hidden",t.aCanvas.canvas.style.webkitBackfaceVisibility="hidden","turn"===e.f?(n="vertical"===e.d?-120:120,g="vertical"===e.d?1===e.sdir?"in"===i?"0% 0% 0%":"0% 100% 0%":"in"===i?"0% 100% 0%":"0% 0% 0%":1===e.sdir?"in"===i?"0% 0% 0%":"100% 0% 0%":"in"===i?"100% 0% 0%":"0% 0% 0%",h.z=0,u.ease="out"===i?"power3.out":u.ease,b="out"===i?b/2:b):g+=o*a.module[S[0]]/2+"px",u[f]=0,u[y]=0,"in"===i?p[f]=n*e.sdir:u[f]=-n*e.sdir,"fly"===e.f){var R=void 0===e.fz?20*Math.random()-10:parseInt(e.fz);"in"===i?(p[y]=t.aCanvas[S]/1.6*(void 0===e.fdi?1.5:parseFloat(e.fdi))*e.sdir,p.rotateZ=e.sdir*R*-.5,u.rotateZ=0):(u[y]=t.aCanvas[S]/1.6*(void 0===e.fdo?2:parseFloat(e.fdo))*e.sdir*-1,u.rotateZ=e.sdir*R)}if(t.el.style.perspective=d?"2500px":"1500px",d){var w={z:c*("fly"===e.f?1.5:3),ease:"power1.inOut"},x={z:0,ease:"power1.inOut"};w[v]=-1*e.t,x[v]=0,e.roomhelper={r:0},r.add(tpGS.gsap.set(t.mask,{perspective:1200,transformStyle:"preserve-3d",transformOrigin:g}),0),r.add(_tpt.gsap.to(t.el,3*e.md,w),0),r.add(_tpt.gsap.to(t.el,3*e.md,x),b-e.md),r.add(_tpt.gsap.to(e.roomhelper,3*e.md,{r:Math.abs(e.t)}),0),r.add(_tpt.gsap.to(e.roomhelper,3*e.md,{r:0}),b-e.md),"in"===i&&1!==o&&l&&(void 0===t.cube&&SR7.D.transitions.d3.buildCube(t,s,a),r.add(SR7.D.transitions.d3.setWall(t.cube,w[v],v,a.module,e.c),0),m.push(t.cube.c))}else e.roomhelper=!1,r.add(tpGS.gsap.set(t.mask,{perspective:"none",transformStyle:"none",transformOrigin:"50% 50%"}),0),l&&!0!==s.notFirstIn&&(void 0===t.cube&&SR7.D.transitions.d3.buildCube(t,s,a),r.add(SR7.D.transitions.d3.setWall(t.cube,p[f],f,a.module,e.c,!0),0),r.add(_tpt.gsap.fromTo(t.cube.w,4*e.md,{opacity:0},{opacity:1}),0),m.push(t.cube.c));return e.helper={o:0,oo:1},r.add(_tpt.gsap.to(e.helper,b,{o:1,oo:0,ease:e.e}),e.md),r.add(_tpt.gsap.set(m,_tpt.extend(_tpt.extend({},p),{force3D:!0,transformOrigin:g})),0),"turn"!==e.f&&r.add(_tpt.gsap.to(m,3*e.md,h),0),r.add(_tpt.gsap.to(m,b,u),e.md),"turn"!==e.f&&r.add(_tpt.gsap.to(m,3*e.md,{z:0,ease:"power1.inOut"}),b-e.md),"out"===i&&1!==o&&r.add(_tpt.gsap.to(m,2*e.md,{opacity:0}),e.dur-2*e.md),r}}}};const l=async function(e,t,s,i,a){if(e.media&&(1===s&&"in"===i||"animateBG"===a)&&("slidebg"!==e.subtype||"carousel"!==SR7.M[t].settings.type)){let s=e.media.player.options;e.media.player.frameStart=(new Date).getTime();let r=SR7.M[t];if((e.skey==SR7.M[t].current.id||e.global&&"in"===e.gpos)&&"false"!==s.autoPlay&&!1!==s.autoPlay&&"no1sttime"!==s.autoPlay?("slidebg"===e.subtype&&"html5"!==e.media.player.options.type||(SR7.E.backend&&"animation"==SR7.editing.modi?e.media.pause():e.media.play(),SR7.M[t].globalMuted&&e.media.mute()),s.pauseTimer&&SR7.slideShow.pause(t)):"carousel"==r.settings.type&&"in"===i&&("all"===r.settings.carousel.showAllLayers||"individual"===r.settings.carousel.showAllLayers&&r.slides[e.skey].layers[e.lkey].viOC)&&(e.media.player.options.cOC&&"false"!==String(s.autoPlay)&&"no1sttime"!==s.autoPlay?(r.videoDontInterrupt??={},r.videoDontInterrupt[e.media.player.containerId]=!0,e.media.play()):(r.videoPlayInFocus??={},r.videoPlayInFocus[e.media.player.containerId]=e.media.player)),"out"===i&&"animateBG"===a&&e.media.pause(),SR7.E.backend)return;s.nextSlide&&!e.media.hasEvent("finished")&&e.media.addEvent("finished",((e,t)=>{SR7.F.requestSlide({id:t.id,slide:"+1"})}),{id:t,c:e}),!s.stopAllMedia&&!s.pauseTimer||e.media.hasEvent("playing")||e.media.addEvent("playing",((t,i)=>{s.stopAllMedia&&!e.media.player.pauseRequested&&e.media.stopPlayingMedias(!1),s.pauseTimer&&SR7.slideShow.pause(i.id)}),{id:t,c:e,o:s}),s.pauseTimer&&!e.media.hasEvent("paused")&&e.media.addEvent("paused",((e,t)=>{t.o.pauseTimer&&SR7.slideShow.resume(t.id)}),{id:t,c:e,o:s})}},n=(e,t)=>{"in"==e&&(t.canvas.canvas.style.visibility="hidden"),t.canvas.canvas.style.background="transparent"},d=e=>e.media&&"html5"==e.media.player.options.type&&e.media.startCanvas(e.canvas),c=(e,t)=>-1==e.prev.index&&e.settings.fs?.as?_tpt.extend({},e.settings.fs.a):_tpt.extend({},t.in.bg.all[1]),p=(e,t)=>{if("in"!==t||null==e.rnd||0==_tpt.tf(e.rnd)||null==SR7.E.transtable)return e;const s=SR7.F.getRandomSlidetransition(SR7.E.transtable);return s?SR7.D.getBGAnim(s):e},h=(e,t)=>(Array.isArray(e.addOns)&&0===e.addOns.length&&(e.addOns={}),SR7.D.transitions?.[e.tr]?.getBasic&&(e=_tpt.extend(SR7.D.transitions[e.tr].getBasic(t),e)),e[t]??={},e),u=e=>{e.aCanvas??=new SR7.F.canvas({wrap:e.el,ctx:"2d",create:!0}),e.aCanvas.canvas.classList.add("sr7-a-canvas"),e.aCanvas.canvas.style.background="transparent"},m=e=>"default"==e.d||"d"==e.d?1e3:"random"==e.d?Math.round(1e3*Math.random()+300):_tpt.defNum(e.d,1e3),g=(e,t,s,i,a)=>{let r=SR7.D.transitions.setDimensions(e,t[s]);return{...r,id:i,scene:s,TL:_tpt.gsap.timeline(),sdir:a.lastChangeDir,d:m(t),sd:parseFloat(t.sd||75)/1e3,delay:0,amnt:r.col*r.row,boxes:Array(r.amnt)}},f=(e,t,s,i)=>{-1!==i.prev.index&&"in"==s&&void 0!==t.p&&"none"!==t.p&&(e.bg="dark"===t.p?"#000":"light"===t.p?"#fff":void 0,e.delay=e.d/1e3)},v=(e,t,s,i,a)=>{s.notFirstIn=-1!=a.prev.index,"out"==e?a.zOrder={cache:{skey:i.skey,ms:s.d,animated:1!==(t[e].o??1)||0!==(t[e].x??0)||0!==(t[e].y??0)}}:-1===a.prev.id||null!=a.zOrder.cache&&("forceinout"===t.o||"outin"!=t.o&&!a.zOrder.cache.animated)||(a.zOrder.managed="0"==t?.out?.o||"outin"==t.o||0!==s.delay||1===(t[e].o??1)&&0===(t[e].x??0)&&0===(t[e].y??0),a.zOrder.use=0!==s.delay?"out":(a.zOrder?.cache?.ms??1e3)<(s.d??1e3)?"in":"out")},y=(e,t,s)=>null==e?void 0:{...e,dur:.001*t,fd:7e-4*t,md:15e-5*t,sdir:s,t:void 0!==e.t&&0!==e.t&&e.t,su:_tpt.tf(e.su),smi:_tpt.tf(e.su)?parseFloat(e?.smi||0):void 0,sl:_tpt.tf(e.su)?parseFloat(e?.sl||1):void 0,sma:_tpt.tf(e.su)?parseFloat(e?.sma||.5):void 0,sc:_tpt.tf(e.su)?_tpt.gsap.utils.splitColor(e?.sc??"0,0,0").join(","):void 0};_tpt.R??={},_tpt.R.animate=_tpt.extend?_tpt.extend(_tpt.R.animate,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F=SR7.F||{},void 0!==SR7.F.dist)return;SR7.F.dist=function(e,t,s,i){return Math.sqrt(Math.pow(e-s,2)+Math.pow(t-i,2))},SR7.F.cSort=function(e,t){return e-t},SR7.F.canvas=function(e){e.wrap&&(e.width=null==e.width||0==e.width?e.wrap.clientWidth:e.width,e.height=null==e.height||0==e.height?e.wrap.clientHeight:e.height);var t=e.canvas??document.createElement("canvas");this.ctx=t.getContext(e.ctx||"2d"),this.wrap=e.wrap,"100%"==e.width?(t.width=this.width=1e3,t.style.width="100%"):(t.width=this.width=e.width*_tpt.dpr,t.style.width=e.width+"px"),"100%"==e.height?(t.height=this.height=1e3,t.style.height="100%"):(t.height=this.height=e.height*_tpt.dpr,t.style.height=e.height+"px"),void 0!==e.overlay&&(this.overlay=SR7.F.addOverlay(e.overlay.type,e.overlay.size,e.overlay.cA,e.overlay.cB),e.wrap.appendChild(this.overlay)),void 0!==e.wrap&&e.wrap.appendChild(t),e.position&&(t.style.position=e.position),"absolute"===e.position&&(t.style.top=0,t.style.left=0),this.color=e?.color??void 0,void 0!==e.size&&(this.size=e.size),void 0!==e.pos&&(this.pos=e.pos),void 0!==e.repeat&&(this.repeat=e.repeat),void 0!==e.sizeVal&&(this.sizeVal=e.sizeVal),e.create&&void 0!==e.wrap&&(t.style.zIndex=1,t.style.position="absolute",t.style.top="0px",t.style.left="0px",this.wrap=e.wrap,e.wrap.children[0]?e.wrap.insertBefore(t,e.wrap.children[0]):e.wrap.appendChild(t)),this.canvas=t},SR7.F.canvas.prototype.updateDim=function(){this.wrap&&(this.canvas.width=this.width=this.wrap.clientWidth*_tpt.dpr,this.canvas.height=this.height=this.wrap.clientHeight*_tpt.dpr,this.canvas.style.width=this.wrap.clientWidth+"px",this.canvas.style.height=this.wrap.clientHeight+"px")},SR7.F.canvas.prototype.checkPreDraw=function(){let e={pre:!0,core:!0,post:!0};if(void 0!==this.preDraw)for(let t of this.preDraw)e.pre&&(e=t(this,e));return e},SR7.F.canvas.prototype.checkPostDraw=function(){if(void 0!==this.afterDraw)for(let e of this.afterDraw)r.pre&&(r=e(this,r))},SR7.F.canvas.prototype.drawImg=function(e,t=_tpt.dpr,s){if(!this.image&&null==e)return;this.cacheAltSrc=e;let i="high"==this.stretch&&this?.image?.naturalWidth?this?.image?.naturalWidth??0:this.wrap?.clientWidth||this.requestedWidth||this.image?.naturalWidth||0,a="high"==this.stretch&&this?.image?.naturalWidth?this?.image?.naturalHeight??0:this.wrap?.clientHeight||this.requestedHeight||this.image?.naturalHeight||0;var r,o,l,n;"high"==this.stretch&&1!==t&&(i=(this.wrap?.clientWidth||this.requestedWidth||this.image?.naturalWidth||0)*t,a=(this.wrap?.clientHeight||this.requestedHeight||this.image?.naturalHeight||0)*t),(s||this.cacheW!==i||this.cacheH!==a)&&(this.cacheW=i,this.cacheH=a,this.width=this.canvas.width=i*t,this.height=this.canvas.height=a*t,this.canvas.style.width=i+"px",this.canvas.style.height=a+"px",this.ctx.scale(t,t));var d=l=e?.videoWidth??this.image?.naturalWidth??this.width,c=n=e?.videoHeight??this.image?.naturalHeight??this.height,p=r=i,h=o=a,u=0,m=0,g=0,f=0,v=this.width/this.height,y=d/c;if(void 0!==this.pan)return this.ctx.clearRect(g,f,p,h),this.ctx.save(),this.ctx.transform(Math.cos(this.pan.rZ)*this.pan.scale,Math.sin(this.pan.rZ)*this.pan.scale,Math.sin(this.pan.rZ)*-this.pan.scale,Math.cos(this.pan.rZ)*this.pan.scale,this.pan.x,this.pan.y),v<y?p=this.image.width*(h/this.image.height):h=this.image.height*(p/this.image.width),this.ctx.drawImage(this.image,0,0,p,h),void this.ctx.restore();let S=this.checkPreDraw();var b,R,w;S.core&&(this.repeat&&"no-repeat"!==this.repeat&&"cover"!==this.size&&(R=(b=this.pattern()).pox,w=b.poy),"cover"===this.size?(v>y?c=d/v:d=c*v,u=(l-d)*parseFloat(this.pos.x)/100,m=(n-c)*parseFloat(this.pos.y)/100):"auto"===this.size?(h=c,g=(r-(p=d))*parseFloat(this.pos.x)/100,f=(o-h)*parseFloat(this.pos.y)/100):"percentage"===this.size?(h=(p=i*parseFloat(this.sizeVal)/100)/d*c,g=(r-p)*parseFloat(this.pos.x)/100,f=(o-h)*parseFloat(this.pos.y)/100):(y>v?h=p/y:p=h*y,g=(r-p)*parseFloat(this.pos.x)/100,f=(o-h)*parseFloat(this.pos.y)/100),this.repeat&&"no-repeat"!==this.repeat&&"cover"!==this.size?(this.ctx.fillStyle=b.pattern,this.ctx.fillRect(0,0,r+R,o+w)):(this.ctx.clearRect(g,f,p,h),this.stretch?this.ctx.drawImage(e??this.image,0,0,this.image.width,this.image.height,g,f,p,h):this.ctx.drawImage(e??this.image,u,m,d,c,g,f,p,h)));S.post&&this.checkPostDraw()},SR7.F.canvas.prototype.pattern=function(){var e,t,s=this.image.naturalWidth,i=this.image.naturalHeight,a=this.wrap.clientWidth,r=this.wrap.clientHeight,o=(this.width,this.height,s/i),l=s,n=i;(s>a||i>r)&&"auto"!==this.size&&"percentage"!==this.size?s>=i?(l=a,n=a/o):(n=r,l=r*o):"percentage"===this.size&&(l=l*parseFloat(this.sizeVal)/100,n=n*parseFloat(this.sizeVal)/100),(t=this.pc=this.pc??document.createElement("canvas")).width=l,t.height=n,t.getContext("2d").drawImage(this.image,0,0,l,n);var d=(2*(Math.floor(Math.abs(a/t.width)/2)+1.5)*t.width-a)*parseFloat(this.pos.x)/100,c=(2*(Math.floor(Math.abs(r/t.height)/2)+1.5)*t.height-r)*parseFloat(this.pos.y)/100;return"repeat-x"===this.repeat?c=(t.height-r)*parseFloat(this.pos.y)/100:"repeat-y"===this.repeat&&(d=(t.width-a)*parseFloat(this.pos.x)/100),this.ctx.translate(-d,-c),e=this.ctx.createPattern(this.pc,this.repeat),this.ctx.translate(0,0),{pattern:e,pc:t,pox:d,poy:c}},SR7.F.canvas.prototype.drawColored=function(e,t){let s=this.checkPreDraw();if(s.core){if(this.width=this.canvas.width=e||this.wrap.clientWidth*_tpt.dpr,this.height=this.canvas.height=t||this.wrap.clientHeight*_tpt.dpr,0==this.width||0==this.height)return;this.canvas.style.width=this.wrap.clientWidth+"px",this.canvas.style.height=this.wrap.clientHeight+"px",this.fill()}s.post&&this.checkPostDraw()},SR7.F.canvas.prototype.fill=function(){this.ctx.fillStyle=this.fillColor(),this.ctx.fillRect(0,0,this.width,this.height)},SR7.F.canvas.prototype.fillColor=function(){if(this.color.colors||(this.color=_tpt.gradient.process(this.color)),"solid"!==this.color.type){let t="radial"===this.color.type?this.getRadialGrad():this.getLinearGrad();for(var e in this.color.colors)t.addColorStop(this.color.colors[e].p/100,this.color.colors[e].rgba);return t}return this.color.string},SR7.F.canvas.prototype.getLinearGrad=function(){return _tpt.gradient.getLinear(this.ctx,this.width,this.height,this.color.angle??180)},SR7.F.canvas.prototype.getRadialGrad=function(){return this.ctx.createRadialGradient(this.width/2,this.height/2,0,this.width/2,this.height/2,Math.max(this.width,this.height)/2)},SR7.F.addOverlay=(t,s,i,a)=>{let r=document.createElement("sr7-overlay");return r.style.backgroundImage=e(t,s,i,a),r};const e=(e=1,t=1,s="rgba(0,0,0,0)",i="rgba(0,0,0,1)")=>{if("none"===e)return;let a={0:s,1:i},r={none:[[0]],1:[[1,0],[0,0]],2:[[1,0,0],[0,0,0],[0,0,0]],3:[[1,0,0,0],[0,0,0,0],[0,0,0,0]],4:[[1],[0]],5:[[1],[0],[0]],6:[[1],[0],[0],[0]],7:[[1,0]],8:[[1,0,0]],9:[[1,0,0,0]],10:[[1,0,0,0,0],[0,1,0,1,0],[0,0,0,0,0],[0,1,0,1,0],[0,0,0,0,1]],11:[[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0]],12:[[1,0,0],[0,1,0],[0,0,1]],13:[[0,0,1],[0,1,0],[1,0,0]],14:[[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,0]],15:[[0,0,0,0,1],[0,0,0,1,0],[0,0,1,0,0],[0,1,0,0,0],[1,0,0,0,0]],16:[[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0],[0,1,0,1,0],[1,0,0,0,1]]},o=void 0===r[e]?r[2]:r[e],l=document.createElement("canvas"),n=l.getContext("2d");l.width=o[0].length*t,l.height=o.length*t;for(var d=0;d<o.length;d++)for(var c=0;c<o[d].length;c++)"transparent"!=a[o[d][c]]&&(n.fillStyle=a[o[d][c]],n.fillRect(c*t,d*t,t,t));return"url("+l.toDataURL()+")"};_tpt.R=_tpt.R||{},_tpt.R.canvas=_tpt.extend?_tpt.extend(_tpt.R.canvas,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},SR7.E??={},void 0!==SR7.gVal)return;function e(t,s,i,a){if(0===s.length)for(let e=0;e<i.length;e++)t[i[e]]=a[e];else{const r=s.shift();t.hasOwnProperty(r)||(t[r]={}),e(t[r],s,i,a)}}function t(e,t){void 0!==t.hash&&history.pushState(null,null,t.hash),_tpt.isSafari11||(tpGS.gsap.set("html",{scrollBehavior:t.sbHtml}),tpGS.gsap.set("body",{scrollBehavior:t.sbBody})),SR7.M[e].c.scrollToObj=null}SR7.gVal=(e,t,s=1,i=!1,a,r,o,l,n)=>SR7.gV({v:e,id:t,u:s,f:i,m:a,a:r,debug:o,c:l,s:n}),SR7.gV=function(e){if(null==e?.v)return;let t,s,i=SR7.M[e.id],{v:a,u:r=1,f:o=!1,m:l,a:n,debug:d,c:c=i.LEV,s:p}=e,h=6,u=1;if(Array.isArray(a)){h=0;let e=c;for(;!i.settings.uSize[e]&&e>0;)e--;let s=a[e];if("#a"==s||null==s||!0!==i.settings.uSize[e]&&!0!==n){let s,r;for(r=e;r>=h;r--)if(i.settings.uSize[r]&&"#a"!=a[r]&&void 0!==a[r]&&""!==a[r]&&null!==a[r]){s=r;break}if(null==s)for(r=e;r<=5;r++)if(i.settings.uSize[r]&&"#a"!=a[r]&&void 0!==a[r]&&""!==a[r]&&null!==a[r]){s=r;break}if(void 0!==s){if(0==h&&0==e&&(u=parseFloat(i.settings.size.width[0])/parseFloat(i.settings.size.width[s])),"scale"==p)if(i.slideRatios){let e=parseInt(i.settings.size.height[c],0)*(!1!==i.slideRatios[i.current.id]?i.slideRatios[i.current.id]:parseFloat(i.settings.size.width[s])/parseFloat(i.settings.size.height[s])),t=parseInt(i.settings.size.height[s],0)*(!1!==i.slideRatios[i.current.id]?i.slideRatios[i.current.id]:parseFloat(i.settings.size.width[s])/parseFloat(i.settings.size.height[s]));u=e/t,d&&console.log(u,e,t)}else u=parseFloat(i.settings.size.width[c])/parseFloat(i.settings.size.width[s]);t=a[s]}}t??=s}else t=a;let m=_tpt.gsap.utils.getUnit(t);if((s=Number.isFinite(parseFloat(t)))&&"%"!==m)if(1!==u&&(t=parseFloat(t)*u),1==o){t=parseFloat(t)*(h>c&&(0!=c||i.settings.size.fullWidth&&!i.useHMP)?1:i.MP??1),"round"==l||"ceil"==l?t=Math[l](t):"floor"==l&&(t=t>0?Math.floor(t):Math.ceil(t))}else"forceround"==l&&(t=Math.round(parseFloat(t)));return s?0==r||null==r?parseFloat(t):parseFloat(t)+(1==r?m:r):t},SR7.dirVal=function(e,t){let s=1;return(""+t).includes("(")&&(t=t.slice(1).slice(0,-1),s=SR7.M[e].lastChangeDir),{v:t,d:s}},SR7.F.getParOffsets=(e,t={})=>(t.width??=parseInt(e.cw),t.height??=parseInt(e.ch),t.left=(t.left??0)+parseInt(e?.left??0),t.top=(t.top??0)+parseInt(e?.top??0),void 0!==e.par&&(t=SR7.F.getParOffsets(e.par,t)),t),SR7.F.getParRowMP=e=>{let t={x:0,y:0};for(;e&&"SR7-SLIDE"!==e.tagName;)"SR7-ROW"===e.tagName&&(t.x+=parseFloat(e.style.paddingLeft||0),t.y+=parseFloat(e.style.paddingTop||0),t.x+=parseFloat(e.style.marginLeft||0),t.y+=parseFloat(e.style.marginTop||0)),e=e.parentElement;return t},SR7.F.getOffsetTop=e=>{let t=e.offsetTop,s=e.offsetParent;for(;null!==s;)t+=s.offsetTop,s=s.offsetParent;return t},SR7.cVal=function(e,t,s,i,a,r,o=!1,l,n){let d=(""+e).includes("%"),{v:c,d:p}=!1!==o?{v:SR7.F.getOffset(e,void 0,SR7.M[t].lastChangeDir,n),d:1}:SR7.dirVal(t,(""+e).includes("{")||(""+e).includes("[")?SR7.F.getOffset(e,void 0,void 0,0):e);p="in"!==l&&"out"!==l?1:p;let h=c;if(SR7.D.DA.indexOf(c)>=0){i??=null==s.ptype?1:"zone"==s.ptype?2:0,i=4==(i=!("zone"!=s.ptype&&null!=s.ptype||null!=i&&1!=i)?2:i)&&"column"==s.ptype?"100%"===s.par.w?2:1:i;let e="center"!==c&&"middle"!==c&&0==i?{left:0,top:0,width:"zone"==s.ptype?s.ciw:s.cw,height:s.ch}:SR7.F.getParOffsets(s),o=1==i||("center"==c||"middle"==c)&&0==i?s.par.el?SR7.F.getParOffsets(s.par):{width:s.par.cw,height:s.par.ch,left:s.par?.left??s.par?.x,top:s.par?.top??s.par?.y}:{width:SR7.M[t].dims.content.w,height:SR7.M[t].dims.content.h,left:SR7.M[t].dims.content.x,top:SR7.M[t].dims.content.y},l="center"===c||"middle"===c||null!=a&&0!=a?{left:s.target.offsetLeft,top:s.target.offsetTop}:{left:0,top:0};if(e.width+=s.borderH??0,e.height+=s.borderV??0,"zone"==s.ptype&&(e.height+=s.rpt??0+s.rpb??0,e.width+=s.rptl??0+s.rptr??0),!s.par.el&&SR7.M[t]?.c?.autoParents?.[s.skey]?.includes(s.lkey)&&SR7.M[t]?.firstRendering&&s.el.classList[1==SR7.M[t].firstRendering[s.skey]?"add":"remove"]("sr7-hiddenAutoContainer"),"center"==c||"middle"==c)h="y"==r?i<2?0-e.height/2+o.height/2-l.top:0-e.top-e.height/2+o.height/2:i<2?0-e.width/2+o.width/2-l.left+o.left:0-e.left-e.width/2+o.width/2;else{let a="left"==c||"right"==c?Math.abs(Math.round(parseFloat(s?.mod?.animElemXY?._gsap?.x??s?.mod?.animElem?._gsap?.x??0))):"bottom"==c||"top"==c?Math.abs(Math.round(parseFloat(s?.mod?.animElemXY?._gsap?.y??s?.mod?.animElem?._gsap?.y??0))):0;a+=0==a?0:10,(1==p&&"bottom"==c||-1==p&&"top"==c)&&(h=0==i?e.height:1==i?o.height-(e.top-o.top):SR7.M[t].dims.content.h-e.top),(1==p&&"top"==c||-1==p&&"bottom"==c)&&(h=0==i?0-e.height:1==i?0-(e.top-o.top+e.height):0-(e.top+e.height)),(1==p&&"right"==c||-1==p&&"left"==c)&&(h=0==i?e.width:1==i?(o.left??0)-e.left+o.width:"column"==s.par?.subtype?o.width-e.left:o.width-e.left+l.left-(o?.left??0)),(1==p&&"left"==c||-1==p&&"right"==c)&&(h=0==i?0-e.width:1==i?0-(e.left-(o.left??0)+("row"==s.subtype?SR7.M[t].dims.content.w:e.width)):0-(e.left+("row"==s.subtype?SR7.M[t].dims.content.w:e.width))),h=h>0?h+a:h-a}return h}return d?(i??=null==s.ptype||""+s.ptype=="-1"||"zone"==s.ptype?0:1,null==i||0==i?h=p*parseInt(c)/100*("x"===r?"zone"==s.ptype?s.ciw:o?o.offsetWidth:0==s.cw?s.el?.offsetWidth??s.cw:s.cw:o?o.offsetHeight:0==s.ch?s.el?.offsetHeight??s.ch:s.ch):1==i?h=p*parseInt(c)/100*("x"===r?o?s.cw:s.par.cw:o?s.ch:s.par.ch):2==i&&(h=p*parseInt(c)/100*("x"===r?SR7.M[t].dims.content.cw:SR7.M[t].dims.content.ch)),h):c},SR7.F.getEmptyAnimObj=e=>1==e?{x:0,y:0,z:0,scaleX:1,scaleY:1,rotationX:0,rotationY:0,rotationZ:0,skewX:0,skewY:0,opacity:1}:{x:0,y:0,z:0,scaleX:1,scaleY:1,rotationX:0,rotationY:0,rotationZ:0,skewX:0,skewY:0,opacity:1,blur:0,graysacle:0,brightness:100},SR7.F.checkWrap=(e,t)=>{if(null==e)return!1;let s=!1;for(let i in e)s&&_tpt.hop(e,i)||(s=void 0!==e[i][t]);return s},SR7.F.checkMargin=e=>{let t,s,i=!1;if(e)for(t of SR7.D.DS)if(!i)for(s=0;s<5;s++)i=i||0!==e[t][s]&&void 0!==e[t][s];return i},SR7.F.splitText=(e,t)=>{let s;for(let t in e.tl)for(let i of["words","lines","chars"])!_tpt.hop(e.tl,t)||null!=s&&s[i+"Class"]||void 0===(e.tl[t]?.[i]??void 0)||(s??={},s[i+"Class"]="sr7_splitted_"+i);return void 0!==s&&(s.wordsClass??="sr7_splitted_words_noanim",s.type=Object.keys(s).join(",").replaceAll("Class","")),null!=s&&new _tpt.SplitText(t.el,s)},_tpt.inRange=(e,t,s)=>e>=(t<s?t:s)&&e<=(t>s?t:s)?"in":"out",SR7.F.startOnAction=(e,t,s)=>"zone"!==SR7.M[e].slides[t].layers[s].type&&(void 0!==SR7.M[e].slides[t].layers[s].tl.in&&"w"==(""+(SR7.M[e].slides[t].layers[s].tl.in?.content?.all?.[0]?.t??""))[0]||0==SR7.M[e].slides[t].layers[s].tl.in?.content?.all?.length),SR7.F.triggeredChildren=(e,t,s,i=[])=>{let a=SR7.M[e].slides[t].layers;if("container"==a[s].type)for(let r in a){if(r==s||i.indexOf(r)>=0||!_tpt.hop(a,r))continue;let o=a[r];o.pid==s&&(i.push(r),"container"==o.type&&!0!==SR7.F.startOnAction(e,t,r)&&(i=SR7.F.triggeredChildren(e,t,r,i)))}return i},SR7.F.inActionEnv=(e,t,s,i=!1)=>(null==e||null==s||null==t||(i=i||SR7.F.startOnAction(e,t,s))||-1===SR7.M[e].slides[t].layers[s].pid||(i=SR7.F.inActionEnv(e,t,SR7.M[e].slides[t].layers[s].pid,i)),i),SR7.F.getOffset=(e,t,s,i)=>{let a=e;if("left"==e||"right"==e||"top"==e||"bottom"==e)return a;if(null==a)return;const r=(""+a).includes("%");return a=SR7.F.getSpecialValue(a,i,s),0==a||void 0===a?0:r?null==t?a:t*(parseFloat(a)/100):parseFloat(a)},SR7.F.getSpecialValue=(e,t,s,i)=>{let a=e;if(null!=a)return parseFloat(a)==a?parseFloat(a,0):(""+a).includes("{")?(a=a.slice(1,-1).split(","),_tpt.gsap.utils.random(parseFloat(a[0]),parseFloat(a.length>1?a[1]:0-a[0]))):(""+a).includes("[")?(a=_tpt.gsap.utils.wrap(a.slice(1,-1).split(","),t),(""+a).includes("(")?parseFloat(a.slice(1,-1))*s+(i?"%":""):a):((""+a).includes("(")?parseFloat(a.slice(1,-1))*s:parseFloat(a))+(i?"%":"")},SR7.F.getSpikePath=(e={l:"none",lw:10,r:"none",rw:10})=>"polygon("+SR7.F.getClipPaths(e.l,0,parseFloat(e.lw))+","+SR7.F.getClipPaths(e.r,100,100-parseFloat(e.rw),!0)+")",SR7.F.usePerspective=function(e,t,s=600,i){let a;if(i)(_tpt.isSet(e.z)&&"0deg"!==e.z||_tpt.isSet(e.rX)&&"0deg"!==e.rX||_tpt.isSet(e.rY)&&"0deg"!==e.rY)&&(a="global"==t.perspectiveType?t.perspective??600:"isometric"==t.perspectiveType?"none":s);else for(let i in e)void 0===a&&_tpt.hop(e,i)&&(_tpt.isSet(e[i].z)&&"0deg"!==e[i].z||_tpt.isSet(e[i].rX)&&"0deg"!==e[i].rX||_tpt.isSet(e[i].rY)&&"0deg"!==e[i].rY)&&(a="global"==t.perspectiveType?t.perspective??600:"isometric"==t.perspectiveType?"none":s);return"none"==a?void 0:a},SR7.F.getClipPaths=(e,t,s,i)=>{var a;switch(e){case"none":a=t+"% 100%,"+t+"% 0%";break;case"top":a=s+"% 100%,"+t+"% 0%";break;case"middle":a=s+"% 100%,"+t+"% 50%,"+s+"% 0%";break;case"bottom":a=t+"% 100%,"+s+"% 0%";break;case"two":a=s+"% 100%,"+t+"% 75%,"+s+"% 50%,"+t+"% 25%,"+s+"% 0%";break;case"three":a=t+"% 100%,"+s+"% 75%,"+t+"% 50%,"+s+"% 25%,"+t+"% 0%";break;case"four":a=t+"% 100%,"+s+"% 87.5%,"+t+"% 75%,"+s+"% 62.5%,"+t+"% 50%,"+s+"% 37.5%,"+t+"% 25%,"+s+"% 12.5%,"+t+"% 0%";break;case"five":a=t+"% 100%,"+s+"% 90%,"+t+"% 80%,"+s+"% 70%,"+t+"% 60%,"+s+"% 50%,"+t+"% 40%,"+s+"% 30%,"+t+"% 20%,"+s+"% 10%,"+t+"% 0%"}if(i){var r=a.split(",");for(s in a="",r)_tpt.hop(r,s)&&(a+=r[r.length-1-s]+(s<r.length-1?",":""))}return a},SR7.F.clipEffect=(e,t,s,i=100)=>{t="r"==t||null==t,s=parseInt(s,0),i=100-parseInt(i,0);const a=Math.round(s/2);switch(e){case"invh":return"polygon(0% 0%, 0% 100%, "+s+"% 100%, "+s+"% 0%, 100% 0%, 100% 100%, "+i+"% 100%, "+i+"% 0%, 0% 0%)";case"invv":return"polygon(100% 0%, 0% 0%, 0% "+s+"%, 100% "+s+"%, 100% 100%, 0% 100%, 0% "+i+"%, 100% "+i+"%, 100% 0%)";case"cv":return t?"polygon("+(50-a)+"% 0%, "+(50+a)+"% 0%, "+(50+a)+"% 100%, "+(50-a)+"% 100%)":"circle("+s+"% at 50% 50%)";case"ch":case"cliph":return t?"polygon(0% "+(50-a)+"%, 0% "+(50+a)+"%, 100% "+(50+a)+"%, 100% "+(50-a)+"%)":"circle("+s+"% at 50% 50%)";case"l":return t?"polygon(0% 0%, "+s+"% 0%, "+s+"% 100%, 0% 100%)":"circle("+s+"% at 0% 50%)";case"r":return t?"polygon("+(100-s)+"% 0%, 100% 0%, 100% 100%, "+(100-s)+"% 100%)":"circle("+s+"% at 100% 50%)";case"t":return t?"polygon(0% 0%, 100% 0%, 100% "+s+"%, 0% "+s+"%)":"circle("+s+"% at 50% 0%)";case"b":return t?"polygon(0% 100%, 100% 100%, 100% "+(100-s)+"%, 0% "+(100-s)+"%)":"circle("+s+"% at 50% 100%)";case"lt":return t?"polygon(0% 0%,"+2*s+"% 0%, 0% "+2*s+"%)":"circle("+s+"% at 0% 0%)";case"lb":return t?"polygon(0% "+(100-2*s)+"%, 0% 100%,"+2*s+"% 100%)":"circle("+s+"% at 0% 100%)";case"rt":return t?"polygon("+(100-2*s)+"% 0%, 100% 0%, 100% "+2*s+"%)":"circle("+s+"% at 100% 0%)";case"rb":return t?"polygon("+(100-2*s)+"% 100%, 100% 100%, 100% "+(100-2*s)+"%)":"circle("+s+"% at 100% 100%)";case"clr":return t?"polygon(0% 0%, 0% "+s+"%, "+(100-s)+"% 100%, 100% 100%, 100% "+(100-s)+"%, "+s+"% 0%)":"circle("+s+"% at 50% 50%)";case"crl":return t?"polygon(0% "+(100-s)+"%, 0% 100%, "+s+"% 100%, 100% "+s+"%, 100% 0%, "+(100-s)+"% 0%)":"circle("+s+"% at 50% 50%)"}return""},SR7.F.getCSSTransform=(e={})=>{var t=[];let s=!1;const i=e=>"inherit"==e?void 0:e;let a,r;void 0!==(a=i(e.z))&&0!==a?(s=!0,t.push("translate3d("+_tpt.unitize(i(e.x)??0)+","+_tpt.unitize(i(e.y)??0)+","+_tpt.unitize(i(e.z)??0)+")")):void 0!==(a=i(e.x))&&void 0!==(r=i(e.y))&&t.push("translate("+_tpt.unitize(a)+","+_tpt.unitize(r)+")"),void 0!==(a=i(e.rotate))||void 0!==(a=i(e.rotationZ))?t.push("rotate("+_tpt.unitize(a,"deg")+")"):void 0!==(a=i(e.rotationY))&&(s=!0,t.push("rotateY("+_tpt.unitize(a,"deg")+")")),void 0!==(a=i(e.rotationX))&&(s=!0,t.push("rotateX("+_tpt.unitize(a,"deg")+")")),a=i(e.scaleX),r=i(e.scaleY);let o=i(e.skewX),l=i(e.skewY);return void 0===o&&void 0===l||(void 0!==o&&(r=parseFloat(r??1)*Math.cos((o=parseFloat(o))*_tpt.DEG2RAD)),void 0!==l&&(a=parseFloat(a??1)*Math.cos((l=parseFloat(l))*_tpt.DEG2RAD))),void 0===o&&void 0===l||t.push("skew("+_tpt.unitize(o??0,"deg")+","+_tpt.unitize(l??0,"deg")+")"),void 0===a&&void 0===r||t.push("scale("+(a??1)+","+(r??1)+")"),s&&t.unshift("perspective("+_tpt.unitize(i(e.perspective)??600)+")"),t.join(" ")},SR7.F.offsetStagger=function(e){var t=_tpt.gsap.utils.distribute(e);return function(s,i,a){return t(s,i,a)+(s<=a.length/2?0:e.offset||0)}},SR7.F.useFilter=e=>void 0!==e&&(void 0!==e.r&&100!==parseInt(e.r)||void 0!==e.g&&0!==parseInt(e.g)||void 0!==e.b&&0!==parseInt(e.b)),SR7.F.getFilterStyle=(e,t,s={})=>{const i=Object.keys(SR7.D.dFV),a={...s},r=i.filter((i=>s[i]||"string"==typeof e&&e.includes(i)&&e.split(i+"(")[1].split(")")[0]!==parseInt(SR7.D.dFV[i])||void 0!==e[t+SR7.D.dFVC[i]]&&parseInt(e[t+SR7.D.dFVC[i]])!==parseInt(SR7.D.dFV[i])?(a[i]=!0,!0):(a[i]=!1,!1)));if(0===r.length)return{filter:"none",changedFilters:a};let o=r.map((s=>`${s}(${"string"==typeof e&&e.includes(s)?parseInt(e.split(s+"(")[1].split(")")[0])||parseInt(SR7.D.dFV[s]):parseInt(e[t+SR7.D.dFVC[s]]||SR7.D.dFV[s])}${"blur"===s?"px":"%"})`)).join(" ");const l={};return r.map((s=>{if(!a[s])return;const i="string"==typeof e&&e.includes(s)?parseInt(e.split(s+"(")[1].split(")")[0])||parseInt(SR7.D.dFV[s]):parseInt(e[t+SR7.D.dFVC[s]]||SR7.D.dFV[s]);l[s]=i})),{filter:o,filters:l,used:a}},SR7.F.getBGAnimColor=(e={type:"solid",orig:"transparent",string:"transparent"},t,s)=>{if(null==e||null==t)return{};let i="object"==typeof t?t.string:t,a="object"==typeof e?e.string:e,r=i.includes("gradient");return a.includes("gradient")||r?{gradient:!0,bg:_tpt.gradient.getSSGColors(i,a,s||"fading")}:{gradient:!1,bg:{to:a,from:i}}},SR7.F.cache=(t,s,i,a)=>{e(t,s.split("."),i,a)},SR7.F.getAccelerationPermission=()=>{DeviceMotionEvent.requestPermission().then((function(e){if("granted"==e)for(var t in SR7.M)_tpt.hop(SR7.M,t)&&(SR7.M[t].c.modulesNeedOrientationListener=!1,SR7.F.removeIOSPermissionWait(),SR7.F.addDeviceOrientationListener(t))}))},SR7.F.addDeviceOrientationListener=e=>{const t=SR7.M[e],s=t.c.mod;window.addEventListener("deviceorientation",(function(e){t.c.modulesNeedOrientationListener&&(t.c.modulesNeedOrientationListener=!1,SR7.F.removeIOSPermissionWait()),s.eventData=e}))},SR7.F.removeIOSPermissionWait=()=>{document.querySelectorAll(".iospermaccwait").forEach((function(e){e.classList.add("permanenthidden")}))},SR7.F.calculateVisiblePercentage=e=>{const t=window.pageYOffset||document.documentElement.scrollTop,s=Math.max(e.top+t,t),i=Math.min(e.bottom+t,t+_tpt.winH);if(i<=s)return 0;return(i-s)/e.height},SR7.F.scrollTo=(e,t,s=1,i="power2.out",a)=>{if(!SR7.M[e].useAsModal){let e={_y:window.pageYOffset!==document.documentElement.scrollTop?0!==window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop:window.pageYOffset};return tpGS.gsap.fromTo(e,s,{_y:Math.max(document.body.scrollTop,document.documentElement.scrollTop),ease:i},{_y:t,onUpdate:function(){document.documentElement.scrollTop=e._y,document.body.scrollTop=e._y},onComplete:a})}},SR7.F.scrollToId=e=>{SR7.M[e.id].c.scrollToObj=e,_tpt.isSafari11||(SR7.M[e.id].c.scrollToObj.sbHtml=_tpt.gsap.getProperty("html","scrollBehavior"),SR7.M[e.id].c.scrollToObj.sbBody=_tpt.gsap.getProperty("body","scrollBehavior"),_tpt.gsap.set("html,body",{scrollBehavior:"auto"})),SR7.F.calcScrollToId(e.id)},SR7.F.getContsHeights=(e="",t=_tpt.winH)=>{if(""==e)return 0;const s=e.split(",");let i=0;return s.forEach((e=>{let s=_tpt.posToNum(e,t);if(s==e&&function(e){try{document.querySelector(e)}catch(e){return!1}return!0}(e)){document.querySelectorAll(e.trim()).forEach((e=>{i+=e.offsetHeight}))}else i+=s})),i},SR7.F.calcScrollToId=e=>{const s=SR7.M[e],i=s.c.scrollToObj;var a=i.tween&&i.tween.progress?i.tween.progress():0;i.tween&&i.tween.kill&&i.tween.kill(),void 0!==i.startScrollPos&&null!==i.startScrollPos||(i.startScrollPos=s.useAsModal?SR7.F.modal.wrap.scrollTop:Math.max(document.body.scrollTop,document.documentElement.scrollTop));const r=void 0===i.anchor?s.dims.reduceHeight-(parseInt(i.offset,0)||0)||0:0-(parseInt(i.offset,0)||0),o=null==i.anchor?s.c.module:document.getElementById("#"==i.anchor[0]?i.anchor:i.anchor.replace("#",""))||document.getElementById("#"==i.anchor[0]?i.anchor:i.anchor.replace("#","").toUpperCase()),l={_y:s.useAsModal?SR7.F.modal.wrap.scrollTop:window.pageYOffset!==document.documentElement.scrollTop?0!==window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop:window.pageYOffset},n=(null!=o?SR7.F.getOffsetTop(o):0)+(null==i.anchor?s.settings.tlScroll?.fixed?s.dims.module.h+s.fullScreenOffsetResult:void 0!==s.dims.sbt?s.dims.sbt:s.dims.content.h:0),d=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let p=Math.min(n-r,d-c-1);if(p<0)return t(e,i);i.tween=tpGS.gsap.fromTo(l,parseInt(i.speed)/1e3,{_y:i.startScrollPos},{_y:p,ease:i.ease,onUpdate:function(){s.useAsModal?SR7.F.modal.wrap.scrollTop=l._y:(document.documentElement.scrollTop=l._y,document.body.scrollTop=l._y)},onComplete:function(){t(e,i)}}),i.tween.progress(a)},SR7.F.getFeed=(e,t,i="src",a,r,o)=>{let l=e.settings.source.type,n=e.stream[t-1];if(null==n)return;0==i.indexOf("event_")&&"event_id"!==i&&(i=(i=i.replace("event_location_","")).replace("event_",""));let d="featured_image_url_"==i.slice(0,19)?_tpt.urlProtocol(n.img_urls[i.replace("featured_image_url_","")]?.url??n.img_urls?.full?.url,!1)??"":("thumb"==i||"image"==i)&&"instagram"==l||"thumb"==i&&"facebook"==l?_tpt.urlProtocol(n.thumb??"","flickr"==l||"youtube"==l):"media"==i||("instagram"==l||"facebook"==l)&&("thumb"==i||"image"==i||"thumbnail"==i)||"image"==i&&"html5"!==l&&"youtube"!==l&&"vimeo"!==l?_tpt.urlProtocol(n.media??"","flickr"==l||"youtube"==l):"image"==i||"thumbnail"==i||"thumb"==i?_tpt.urlProtocol(n.thumb??"","flickr"==l||"youtube"==l):"meta"==i?s(n.meta,a)??"":"title"==i||"instagram"==l&&"content"==i?s(n.title,"title",a,r)??"":"content"==i||"youtube"==l&&"excerpt"==i||"woo"==l&&"excerpt"==i&&""==(n.excerpt??"")?s(n.content,"content",a,r)??"":"excerpt"!=i||"youtube"===l&&void 0===n.excerpt?"description"==i?s(n.description,"description",a,r):"wc_star_rating"==i?(n.wc_star_rating??"").replaceAll("rs-starring","sr-starring"):"catlistr"==i||"catlist_raw"==i||"catlistraw"==i?n.catlistraw??n.catlist_raw??n.catlistr??"":void 0!==n["event_location_"+i]?n["event_location_"+i]:void 0!==n["event_"+i]?n["event_"+i]:void 0!==n[i]?n[i]:"postid"==i||"event_id"==i?n.id??"":"link"==i?n.link??"":"author_name"==i?n.author??n.author_name??"":"author_avatar"==i?n.avatar??n.author_avatar??"":"author_website"==i?n.website??n.author_website??"":"author_postpage"==i?n.postpage??n.author_postpage??"":"date"==i||"date_published"==i?n.publish??"":"date_modified"==i?n.modified??"":"wc_categories"==i?n.catlist??"":"wc_tags"==i?n.taglist??"":"retweet_count"==i?n.retweet??"":"favorite_count"==i?n.favorite??"":"ncomments"==i||"num_comments"==i||"numcomments"==i?n.num_comments??n.numcomments??n.ncomments??"":void 0:s(n.excerpt,"excerpt",a,r)??"";return d||""==d?d:o};let s=(e,t,s,i)=>null==s||null==i?e?.[t]??e:e?.[s]?.[i]??e?.[t]??e;SR7.F.updateDynamicMetas=(e,t,s)=>s.replace(/\{\{([^}]+)\}\}/g,(function(s,i){let[a,r,o]=i.split(":"),l=SR7.F.getFeed(SR7.M[e],t,a,r,o);if(l&&r)switch(r){case"words":l=l.split(" ").slice(0,o).join(" ");break;case"chars":l=l.slice(0,o)}return null==l?s:l})),SR7.F.getCurSlideIndDigit=(e,t)=>{var s=void 0!==t&&SR7.M[e].slideOrder.indexOf(t)+1||SR7.M[e].current.index+1;return(s<10&&SR7.M[e].len>9?"0":"")+s},SR7.F.updateBasicMetas=(e,t,s)=>{if(null!=t)return-1!==t.el.innerHTML.indexOf("{{total_slide_count}}")&&(t.el.innerHTML=t.el.innerHTML.replace("{{total_slide_count}}",SR7.M[e].len)),t.el.innerHTML.indexOf("{{current_slide_index}}")>=0&&(SR7.M[e].slides[s].slide.global?(SR7.M[e].metas??={},SR7.M[e].metas.csi??=[],t.el.innerHTML=t.el.innerHTML.replace("{{current_slide_index}}","<cusli>"+SR7.F.getCurSlideIndDigit(e)+"</cusli>"),SR7.M[e].metas.csi.push(t.el.getElementsByTagName("CUSLI")[0])):t.el.innerHTML=t.el.innerHTML.replace("{{current_slide_index}}",SR7.F.getCurSlideIndDigit(e,s))),!0;if(void 0!==SR7.M[e].metas&&void 0!==SR7.M[e].metas.csi)for(let t in SR7.M[e].metas.csi)SR7.M[e].metas.csi[t].innerHTML=SR7.F.getCurSlideIndDigit(e)},_tpt.R??={},_tpt.R.srtools=_tpt.extend?_tpt.extend(_tpt.R.srtools,{status:2,version:"6.7.16"}):{status:2,version:"6.7.16"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},SR7.E??={},void 0!==SR7.D.contentOBJ)return;SR7.D.streamTypes??=["flickr","facebook","instagram","twitter","vimeo","youtube","woo","post"],SR7.D.bgTypes??=["transparent","color","image","video"],SR7.D.BRAD=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],SR7.D.BWID=["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],SR7.D.DL=["Top","Right","Bottom","Left"],SR7.D.DLs=["top","right","bottom","left"],SR7.D.DS=["t","r","b","l"],SR7.D.DA=["bottom","top","left","right","center","middle"],SR7.D.spacings=["margin","padding"],SR7.D.olevels={largedesktop:0,desktop:1,notebook:2,tablet:3,mobile:4,nobreak:5},SR7.D.tagLib={text:"SR7-TXT",button:"SR7-BTN",row:"SR7-ROW",column:"SR7-COL",group:"SR7-GRP",shape:"SR7-SHP",image:"SR7-IMG",svg:"SR7-SVG",zone:"SR7-ZONE",linebreak:"SR7-LINEBRK"},SR7.D.dFV={blur:"0px",brightness:"100%",grayscale:"0%",sepia:"0%",invert:"0%"},SR7.D.dFVC={blur:"b",brightness:"r",grayscale:"g",sepia:"s",invert:"i"},SR7.D.splits=["words","chars","lines"],SR7.D.TLTargets=["words","lines","chars","content","mask","filter","clip","loop","pan"],SR7.D.TLTargetsProcess=["clip","mask","words","lines","chars","content","filter","loop","pan"],SR7.D.animAttr=["x","y","z","opacity","scaleX","scaleY","skewX","skewY","rotate","rotationX","rotationY","rotationZ"],SR7.D.animAttrTrans={x:"x",y:"y",z:"z",opacity:"o",scaleX:"sX",scaleY:"sY",skewX:"skX",skewY:"skY",rotate:"rZ",rotationZ:"rZ",rotationX:"rX",rotationY:"rY"},SR7.D.subsets={"cyrillic-ext":{start:1120,end:1327},cyrillic:{start:1024,end:1279},"greek-ext":{start:7936,end:8191},greek:{start:880,end:1023},vietnamese:{start:258,end:423},"latin-ext":{start:256,end:591},latin:{start:0,end:255}},SR7.D.modulStreamOBJ={post:{excerptLimit:55,maxPosts:30,fetchType:"cat_tag",category:"",sortBy:"ID",types:"post",list:"",sortDirection:"DESC",subType:"post"},woo:{excerptLimit:55,maxProducts:30,featuredOnly:!1,inStockOnly:!1,category:"",sortBy:"ID",types:"product",sortDirection:"DESC",regPriceFrom:"",regPriceTo:"",salePriceFrom:"",salePriceTo:""},instagram:{count:8,hashTag:"",transient:1200,type:"user",userId:"",token_source:"account",connect_with:""},facebook:{album:"",appId:"",appSecret:"",count:8,transient:1200,typeSource:"timeline",token_source:"account",connect_with:"",page_id:""},flickr:{apiKey:"",count:8,galleryURL:"",groupURL:"",photoSet:"",transient:1200,type:"publicphotos",userURL:""},twitter:{accessSecret:"",accessToken:"",consumerKey:"",consumerSecret:"",count:8,excludeReplies:!1,imageOnly:!1,includeRetweets:!1,transient:1200,userId:""},vimeo:{albumId:"",channelName:"",count:8,transient:1200,groupName:"",typeSource:"user",userName:""},youtube:{api:"",channelId:"",count:8,playList:"",transient:1200,typeSource:"channel"}},SR7.D.fixSR6IDs=(e,t)=>{if(!SR7.E.v6v7ids)return e;return t?SR7.E.v6v7ids?.s?.[parseInt(e)||9999999]??e:SR7.E.v6v7ids?.n?.[parseInt(e)||9999999]??e},SR7.D.contentOBJ=function(e,t){t=null==t?"color"==e?"#ffffff":{}:t;var s="image"==e?{ratio:t.ratio??1,src:t.src??"",lib:t.lib??"",lib_id:t.lib_id??"",lib_size:t.lib_size??"full",fromStream:t.fromStream??!1,streamType:t.streamType??"gallery",pos:{x:t.pos?.x??"50%",y:t.pos?.y??"50%"},repeat:t.repeat??"no-repeat",size:t.size??"cover",sizeVal:t.sizeVal??"100%",seo:t.seo??!1}:"color"==e?t:"text"==e?{text:t.text??"",ph:t.ph??"",deco:t.deco??"none",trans:t.trans??"none"}:"svg"==e?{oC:t.oC??!1,color:t.color??["#fff","#fff","#fff","#fff","#fff"],all:t.all??!1,stroke:{c:t.stroke?.c??"transparent",d:t.stroke?.d??0,o:t.stroke?.o??0,w:t.stroke?.w??0},src:t.src??""}:"video"==e||"audio"==e?{src:t.src??"",crossOrigin:t.crossOrigin??!1,afterTransition:t.afterTransition??!1,controls:t.controls??"xl",autoPlay:t.autoPlay??!0,pauseTimer:t.pauseTimer??!0,start:t.start??"00:00",end:t.end??"00:00",nextSlide:t.nextSlide??!0,stopAllMedia:t.stopAllMedia??!0,loop:t.loop??!0,preload:t.preload??"auto",preloadWait:t.preloadWait??"0",rewind:t.rewind??!0,volume:t.volume??"100"}:{};return"video"==e&&(s=_tpt.extend(s,{poster:{src:t.poster?.src??"",lib:t.poster?.lib??"",lib_id:t.poster?.lib_id??"",lib_size:t.poster?.lib_size??"",size:t.poster?.size??"cover",fromStream:t.poster?.fromStream??!1,showOnPause:t.poster?.showOnPause??!1,insteadVideo:t.poster?.insteadVideo??!1,noOnMobile:t.poster?.noOnMobile??!1},fromStream:t.fromStream??!1,streamType:t.streamType??"gallery",type:t.type??"html5",cover:t.cover??!0,noInteract:t.noInteract??!1,aFullScreen:t.aFullScreen??!0,args:t.args??"",fullWidth:t.fullWidth??!1,mute:t.mute??!0,ratio:t.ratio??"16:9",inline:t.inline??!0,speed:t.speed??1,pauseOnSwap:t.pauseOnSwap??!1,cOC:t.cOC??!1})),s},SR7.D.convertBGPosObj=function(e,t="50%",s="50%"){var i={x:"50%",y:"50%"};if(null==e)return i;if("percentage"==e)return{x:parseInt(t)+"%",y:parseInt(s)+"%"};var a=(""+e).split(" ");return"center"==a[0]&&"center"==a[1]||("left"==a[0]&&(i.x="0%"),"right"==a[0]&&(i.x="100%"),"top"==a[1]&&(i.y="0%"),"bottom"==a[1]&&(i.y="100%")),i},SR7.D.carouselSettings=(e,t)=>{if(void 0===e)return{};let s=e?.showAllLayers??"false";return s="true"==String(s)?"all":s,{type:e.type??e.orientation??"h",align:e.align??("h"===(e.orientation??"h")?e.horizontal??"center":e.vertical??"center"),maxV:Math.max("3d"==e.spin?3:1,e.maxV??e.maxItems??3),justify:e.justify??!1,scale:e.scale??!1,minS:e.minS??e.scaleDown??50,vScale:e.vScale??e.varyScale??!1,oScale:e.oScale??e.offsetScale??!1,space:e.space??0,rotation:e.rotation??!1,maxR:e.maxR??e.maxRotation??0,varR:e.varR??e.varyRotate??!1,opacity:e.opacity??e.fadeOut??!0,maxO:e.maxO??e.maxOpacity??100,varO:e.varO??e.varyFade??!1,spin:e.spin??"off",spinA:parseInt(e.spinA??e.spinAngle??0),snap:e.snap??!0,infinity:e.infinity??!1,skewX:e.skewX??0,skewY:e.skewY??0,ease:e.ease??"power3.inOut",dur:e.dur??e.speed??800,overshoot:e.overshoot??!1,stretch:e?.stretch??!1,showAllLayers:s,jMWidth:e.jMWidth||(e?.justifyMaxWidth??!1),bR:e.bR??e?.borderRadius??0,pNV:e.pNV??e?.prevNextVis??"50px",pT:e.pT??e?.paddingTop??0,pB:e.pB??e?.paddingBottom??0}},SR7.D.moduleObj=function(e,t={}){var s=SR7.M[e].migrate?SR7.migrate.moduleObj(t):t,i={id:s.id??"",migrated:s.migrated??!1,addOns:s.addOns??{},uSize:s.uSize??[!1,!0,!1,!1,!1],level:s.level??4,title:s.title??"",alias:s.alias??"",dbid:s.dbid??"",deepLinks:s.deepLinks,type:s.type??"slider",fonts:s.fonts??{},prem:s.prem??!1,class:s.class??"",wClass:s.wClass??"",fixed:s.fixed??!1,mobileURLJumpFix:s.mobileURLJumpFix??!0,wpml:s.wpml??!1,lazyLoad:s.lazyLoad??"none",uS:s.uS??!1,vPort:s.vPort??"-100px",acc:{use:s.acc?.use??!1,live:s.acc?.live??!1},fs:{as:s.fs?.as??!1,a:s.fs?.a??void 0},source:{type:s.source?.type??"gallery"},imgs:s.imgs??[],hasYT:s.hasYT??!1,size:{fullWidth:s.size?.fullWidth??!0,fullHeight:s.size?.fullHeight??!1,fullHeightOffset:","==(s.size?.fullHeightOffset??"")?"":s.size?.fullHeightOffset??"",contentFH:s.size?.contentFH??!1,width:s.size?.width??[1600,1240,1024,778,480],height:s.size?.height??["#a","auto","#a","#a","#a"],cachedHeight:s.size?.cachedHeight??["#a","auto","#a","#a","#a"],minHeight:s.size?.minHeight??[0,0,0,0,0],maxHeight:s.size?.maxHeight??[0,0,0,0,0],upscaling:s.size?.upscaling??!1,respectRatio:s.size?.respectRatio??!1,keepBPHeight:s.size?.keepBPHeight??!1,maxWidth:s.size?.maxWidth??!1,overflow:s.size?.overflow??"false"},snap:{adjust:s.snap?.adjust??"none",snap:s.snap?.snap??!1,helpLines:s.snap?.helpLines??!1,gap:s.snap?.gap??20},default:{fluid:{tx:s.default?.fluid?.tx??!0,tr:s.default?.fluid?.tr??!0,sp:s.default?.fluid?.sp??!0,alien:s.default?.fluid?.alien??!0},len:s.default?.len??9e3},codes:{css:s.codes?.css??"",js:s.codes?.js??""},carousel:SR7.D.carouselSettings(s.carousel),pLoader:{color:s.pLoader?.color??"#ffffff",type:s.pLoader?.type??"off"},slideshow:{auto:s.slideshow?.auto??!0,sOH:s.slideshow?.sOH??!1,loop:s.slideshow?.loop??-1,stopAt:s.slideshow?.stopAt??-1,shuffle:s.slideshow?.shuffle??!1,initDelay:s.slideshow?.initDelay??0,waitApi:s.slideshow?.waitApi??!1,firstSlide:s.slideshow?.firstSlide??"auto"},general:{icache:s.general?.icache??"default",dpr:s.general?.dpr??"dpr",observeWrap:s.general?.observeWrap??!1,disableOnMobile:s.general?.disableOnMobile??!1,autoPlayVideoMobile:s.general?.autoPlayVideoMobile??!0,disablePanMobile:s.general?.disablePanMobile??!1,perspective:s.general?.perspective??600,perspectiveType:s.general?.perspectiveType??"global",outputFilter:s.general?.outputFilter??"none",fallbackURL:s.general?.fallbackURL??"",fallbackType:s.general?.fallbackType??"off"},browser:{nextOnFocus:s.browser?.nextOnFocus??!1,noFocusListener:s.browser?.noFocusListener??!1,freezeOnBlur:s.browser?.freezeOnBlur??!1,mISB:s.browser?.mISB??!1,useURLDeeplink:s.browser?.useURLDeeplink??!1},modal:{bC:s.modal?.bC??"",h:s.modal?.h??"center",v:s.modal?.v??"middle",cover:s.modal?.cover??!0,pS:s.modal?.pS??!1,bg:s.modal?.bg??"rgba(0,0,0,0.5)",sp:s.modal?.sp??1e3},shdw:s.shdw??!1,bg:{color:s.bg?.color??"transparent",image:SR7.D.contentOBJ("image",s.bg?.image??{})},mod:{use:s.mod?.use??!1,dOM:s.mod?.dOM??!1,d3:s.mod?.d3??!1,d3z:s.mod?.d3z??65,d3d:s.mod?.d3d??15,d3s:s.mod?.d3s??3,d3e:s.mod?.d3e??"power3.out",t:s.mod?.t??"scroll",om:s.mod?.om??1,sm:s.mod?.sm??1,dir:s.mod?.dir??"same"},rOFV:s.mod?.rOFV??!0,nav:{acc:{hidden:s.nav?.acc?.hidden??!0,pressed:s.nav?.acc?.pressed??"unset",next:s.nav?.acc?.next??"Next Slide",prev:s.nav?.acc?.prev??"Previous Slide",tab:s.nav?.acc?.tab??"Tab",thumb:s.nav?.acc?.thumb??"Thumbnail",bullet:s.nav?.acc?.bullet??"Bullet"},nd:s.nav?.nd??1e3,m:{use:s.nav?.m?.use??"off",r:s.nav?.m?.r??"default",t:s.nav?.m?.t??"html",st:s.nav?.m?.st??50,v:s.nav?.m?.v??50,cd:s.nav?.m?.cd??1500},s:{use:s.nav?.s?.use??!1,desk:s.nav?.s?.desk??!1,mobC:s.nav?.s?.mobC??!0,deskC:s.nav?.s?.deskC??!0,bV:s.nav?.s?.bV??!1,d:s.nav?.s?.d??"horizontal",t:s.nav?.s?.t??1},k:{use:s.nav?.k?.use??"off"},p:{w:s.nav?.p?.w??300,h:s.nav?.p?.h??200}}};if(void 0!==SR7.M[e]&&void 0!==SR7.M[e].imgList)for(let t in SR7.M[e].imgList)_tpt.hop(SR7.M[e].imgList,t)&&_tpt.compareURL(SR7.M[e].imgList[t].old,i?.bg?.image?.src)&&(i.bg.image.src=SR7.M[e].imgList[t].new);(SR7.E.backend||s.nav?.arrows?.set)&&(i.nav??={},i.nav.arrows??={set:s.nav?.arrows?.set??!1,def:s.nav?.arrows?.def??void 0,cst:s.nav?.arrows?.cst??void 0,key:s.nav?.arrows?.key??"",t:s.nav?.arrows?.t??1e3,m:s.nav?.arrows?.m??"hslide",css:s.nav?.arrows?.css??"",html:s.nav?.arrows?.html??"",ps:s.nav?.arrows?.ps??"default",on:s.nav?.arrows?.on??!0,s:parseInt(s.nav?.arrows?.s??1e3),dIn:s.nav?.arrows?.dIn??["#a",1e3,"#a","#a","#a"],dOut:s.nav?.arrows?.dOut??["#a",1200,"#a","#a","#a"],show:s.nav?.arrows?.show??[!0,!0,!0,!0,!0],l:{a:s.nav?.arrows?.l?.a??"slider",anim:s.nav?.arrows?.l?.anim??"fade",x:s.nav?.arrows?.l?.x??["#a",0,"#a","#a","#a"],y:s.nav?.arrows?.l?.y??["#a",0,"#a","#a","#a"],v:s.nav?.arrows?.l?.v??["#a","center","#a","#a","#a"],h:s.nav?.arrows?.l?.h??["#a","left","#a","#a","#a"]},r:{a:s.nav?.arrows?.r?.a??"slider",anim:s.nav?.arrows?.r?.anim??"fade",x:s.nav?.arrows?.r?.x??["#a",0,"#a","#a","#a"],y:s.nav?.arrows?.r?.y??["#a",0,"#a","#a","#a"],v:s.nav?.arrows?.r?.v??["#a","center","#a","#a","#a"],h:s.nav?.arrows?.r?.h??["#a","right","#a","#a","#a"]}},i.fonts.RevIcon=!0,SR7.R??={},SR7.R.nav=!0),(SR7.E.backend||s.nav?.bullets?.set)&&(i.nav??={},i.nav.bullets={set:s.nav?.bullets?.set??!1,def:s.nav?.bullets?.def??void 0,cst:s.nav?.bullets?.cst??void 0,key:s.nav?.bullets?.key??"",t:s.nav?.bullets?.t??3e3,css:s.nav?.bullets?.css??"",html:s.nav?.bullets?.html??"",on:s.nav?.bullets?.on??!0,d:s.nav?.bullets?.d??"horizontal",ps:s.nav?.arrows?.ps??"default",s:parseInt(s.nav?.bullets?.s??1e3),dIn:s.nav?.bullets?.dIn??["#a",1e3,"#a","#a","#a"],dOut:s.nav?.bullets?.dOut??["#a",1200,"#a","#a","#a"],show:s.nav?.bullets?.show??[!0,!0,!0,!0,!0],g:s.nav?.bullets?.g??5,a:s.nav?.bullets?.a??"slider",anim:s.nav?.bullets?.anim??"fade",x:s.nav?.bullets?.x??["#a",0,"#a","#a","#a"],y:s.nav?.bullets?.y??["#a",0,"#a","#a","#a"],v:s.nav?.bullets?.v??["#a","bottom","#a","#a","#a"],h:s.nav?.bullets?.h??["#a","center","#a","#a","#a"]},i.fonts.RevIcon=!0,SR7.R??={},SR7.R.nav=!0),(SR7.E.backend||s.nav?.scrubber?.set)&&(i.nav??={},i.nav.scrubber={set:s.nav?.scrubber?.set??!1,def:s.nav?.scrubber?.def??void 0,cst:s.nav?.scrubber?.cst??void 0,key:s.nav?.scrubber?.key??"",t:s.nav?.scrubber?.t??5e3,css:s.nav?.scrubber?.css??"",html:s.nav?.scrubber?.html??"",on:s.nav?.scrubber?.on??!0,d:s.nav?.scrubber?.d??"horizontal",ps:s.nav?.arrows?.ps??"default",s:parseInt(s.nav?.scrubber?.s??1e3),dIn:s.nav?.scrubber?.dIn??["#a",1e3,"#a","#a","#a"],dOut:s.nav?.scrubber?.dOut??["#a",1200,"#a","#a","#a"],show:s.nav?.scrubber?.show??[!0,!0,!0,!0,!0],g:s.nav?.scrubber?.g??5,a:s.nav?.scrubber?.a??"slider",anim:s.nav?.scrubber?.anim??"fade",x:s.nav?.scrubber?.x??["#a",0,"#a","#a","#a"],y:s.nav?.scrubber?.y??["#a",0,"#a","#a","#a"],v:s.nav?.scrubber?.v??["#a","bottom","#a","#a","#a"],h:s.nav?.scrubber?.h??["#a","center","#a","#a","#a"],io:s.nav?.scrubber?.io??"inner",size:{w:s.nav?.scrubber?.size?.w??["#a",100,"#a","#a","#a"],h:s.nav?.scrubber?.size?.h??["#a",50,"#a","#a","#a"]},wr:{c:s.nav?.scrubber?.wr?.c??"transparent",p:s.nav?.scrubber?.wr?.p??["#a",5,"#a","#a","#a"],s:s.nav?.scrubber?.wr?.s??!1,mx:s.nav?.scrubber?.wr?.mx??["#a",0,"#a","#a","#a"],my:s.nav?.scrubber?.wr?.my??["#a",0,"#a","#a","#a"]},ts:parseFloat(s.nav?.scrubber?.ts??100),hs:parseFloat(s.nav?.scrubber?.hs??100),ho:s.nav?.scrubber?.ho??!1,tn:s.nav?.scrubber?.tn??!1,hp:s.nav?.scrubber?.hp??!1,pa:s.nav?.scrubber?.pa??"left",sc:parseFloat(s.nav?.scrubber?.sc??100),f:s.nav?.scrubber?.f??!0,asc:s.nav?.scrubber?.asc??!1,tr:parseInt(s.nav?.scrubber?.tr??0),sp:s.nav?.scrubber?.sp??!1,ha:s.nav?.scrubber?.ha??!0,tp:s.nav?.scrubber?.tp??"dots",ms:parseFloat(s.nav?.scrubber?.ms??60),to:parseFloat(s.nav?.scrubber?.to??0),sk:parseFloat(s.nav?.scrubber?.sk??0),cor:s.nav?.scrubber?.cor??!1},i.fonts.RevIcon=!0,SR7.R??={},SR7.R.nav=!0);for(let e of["thumbs","tabs"])(SR7.E.backend||s.nav?.[e]?.set)&&(i.nav??={},i.nav[e]={set:s.nav?.[e]?.set??!1,def:s.nav?.[e]?.def??void 0,cst:s.nav?.[e]?.cst??void 0,key:s.nav?.[e]?.key??"",t:s.nav?.[e]?.t??("tabs"==e?4e3:2e3),css:s.nav?.[e]?.css??"",html:s.nav?.[e]?.html??"",on:s.nav?.[e]?.on??!0,d:s.nav?.[e]?.d??"horizontal",ps:s.nav?.arrows?.ps??"default",s:parseInt(s.nav?.[e]?.s??1e3),dIn:s.nav?.[e]?.dIn??["#a",1e3,"#a","#a","#a"],dOut:s.nav?.[e]?.dOut??["#a",1200,"#a","#a","#a"],ddim:s.nav?.[e]?.ddim??{w:100,h:50},io:s.nav?.[e]?.io??"inner",show:s.nav?.[e]?.show??[!0,!0,!0,!0,!0],g:s.nav?.[e]?.g??5,a:s.nav?.[e]?.a??"slider",anim:s.nav?.[e]?.anim??"fade",x:s.nav?.[e]?.x??["#a",0,"#a","#a","#a"],y:s.nav?.[e]?.y??["#a",0,"#a","#a","#a"],v:s.nav?.[e]?.v??["#a","bottom","#a","#a","#a"],h:s.nav?.[e]?.h??["#a","center","#a","#a","#a"],m:s.nav?.[e]?.m??["#a",5,"#a","#a","#a"],size:{w:s.nav?.[e]?.size?.w??["#a",100,"#a","#a","#a"],h:s.nav?.[e]?.size?.h??["#a",50,"#a","#a","#a"],nw:s.nav?.[e]?.size?.nw??100,nh:s.nav?.[e]?.size?.nh??50,mw:s.nav?.[e]?.size?.mw??50,t:0},wr:{c:s.nav?.[e]?.wr?.c??"transparent",p:s.nav?.[e]?.wr?.p??["#a",5,"#a","#a","#a"],s:s.nav?.[e]?.wr?.s??!1,mx:s.nav?.[e]?.wr?.mx??["#a",0,"#a","#a","#a"],my:s.nav?.[e]?.wr?.my??["#a",0,"#a","#a","#a"]}},i.fonts.RevIcon=!0,SR7.R??={},SR7.R.nav=!0);(SR7.E.backend||s.sbt?.use)&&(i.sbt={use:s.sbt?.use??!1,a:s.sbt?.a??"travel",f:s.sbt?.f??!1,fStart:parseInt(s.sbt?.fStart??2e3),fEnd:parseInt(s.sbt?.fEnd??4e3),layers:s.sbt?.layers??!1,e:s.sbt?.e??"none",s:s.sbt?.s??500,pull:s.sbt?.pull??!1,nL:s.sbt?.nL??!1}),(SR7.E.backend||s.pbar?.set)&&(i.pbar={set:!0,a:s.pbar?.a??"slider",t:s.pbar?.t??"horizontal",s:s.pbar?.s??"5px",r:s.pbar?.r??10,v:s.pbar?.v??"bottom",h:s.pbar?.h??"left",x:s.pbar?.x??0,y:s.pbar?.y??0,c:s.pbar?.c??"rgba(255,255,255,0.5)",bg:s.pbar?.bg??"transparent",base:s.pbar?.base??"slide",g:s.pbar?.g??!1,gs:s.pbar?.gs??0,gc:s.pbar?.gc??"rgba(255,255,255,0.5)",rev:s.pbar?.rev??"reset",vis:s.pbar?.vis??[!0,!0,!0,!0,!0]}),(SR7.E.backend||"none"!==(s.bg?.overlay?.type??"none"))&&(i.bg.overlay={type:s.bg?.overlay?.type??"none",size:s.bg?.overlay?.size??1,cA:s.bg?.overlay?.cA??"transparent",cB:s.bg?.overlay?.cB??"#000000"});for(var a=0;a<5;a++)for(var r of["t","b","l","r"])for(var o of["p","m"])(SR7.E.backend||s.size?.[o]?.[r]?.[a])&&(i.size[o]??={})&&(i.size[o][r]??=Array(5))&&(i.size[o][r][a]??=parseInt(s.size?.[o]?.[r]?.[a]??0)),!SR7.E.backend&&s.size?.[o]?.[r]?.[a]&&(i.size[o]??={})&&(i.size[o][r]??=Array(5))&&(i.size[o][r][a]=parseInt(s?.size?.[o]?.[r]?.[a]??0));for(var l in s.source??={},SR7.D.streamTypes)void 0===s.source[SR7.D.streamTypes[l]]&&i.source.type!=SR7.D.streamTypes[l]||(i.source[SR7.D.streamTypes[l]]=_tpt.extend(SR7.D.modulStreamOBJ[SR7.D.streamTypes[l]],s.source[SR7.D.streamTypes[l]]));return i},SR7.D.hasActionLike=(e,t,s,i,a="a")=>{if(!SR7.M[e].slides[t].slide?.actions)return!1;const r=String(s),o=SR7.M[e].slides[t].slide?.actions.filter((e=>e.src.some((e=>String(e)===r))&&e[a]==i));return o.length>0&&o[0]},SR7.D.slideObj=function(e,t,s){var i=SR7.M[e].migrate?SR7.migrate.slideObj(t):t??{},a=i.global?{addOns:i.addOns??{},id:i.id,version:i.version??"7.0.0",title:i.title??"",parentId:i.parentId??null,language:i.language??"default",oflow:i.oflow??!1,global:!0,respVP:i.respVP??!0,pos:i.pos??"front",actions:i.actions??[],fullHeight:i.fullHeight??!1}:{addOns:i.addOns??{},id:i.id,version:i.version??"7.0.0",actions:i.actions??[],title:i.title??"",parentId:i.parentId??null,language:i.language??"default",order:i.order??s,thumb:{src:i.thumb?.src??"",srcId:i.thumb?.srcId??"",admin:i.thumb?.admin??"",adminId:i.thumb?.adminId??"",dimension:i.thumb?.dimension??"orig",default:i.thumb?.default??void 0},acc:{label:i.acc?.label??"unset",hidden:i.acc?.hidden??"true",live:i.acc?.live??"auto",role:i.acc?.role??"presentation",roledep:i.acc?.roledep??"slide"},description:i.description??"",attr:{class:i.attr?.class??"",data:i.attr?.data??"",id:i.attr?.id??"",a:i.attr?.a??"",aO:i.attr?.aO??"",t:i.attr?.t??"",tO:i.attr?.tO??"",deepLink:i.attr?.deepLink??"",attr:i.attr?.attr??""},publish:{from:i.publish?.from??"",to:i.publish?.to??"",state:""==(i.publish?.state??"")?"published":i.publish?.state,sch:i.publish?.sch??!0},slideshow:{stop:i.slideshow?.stop??!1,len:i.slideshow?.len??"default",hal:i.slideshow?.hal??0,hom:i.slideshow?.hom??!1,hfn:i.slideshow?.hfn??!1},loop:{u:i.loop?.u??!1,r:i.loop?.r??-1,s:i.loop?.s??0,e:i.loop?.e??99999}};if(i.nav){a.nav??={};for(let e of["tabs","thumbs","arrows","bullets"])(i.nav?.[e]||i.nav?.[e])&&(a.nav[e]=i.nav?.[e])}let r=SR7.E.backend;if(r||void 0!==i.params)for(var o in i.params)r=r||""!==i.params[o].v;return r&&(a.params=SR7.D.slideInfoParams(i.params)),{slide:a}},SR7.D.slideInfoParams=function(e){for(var t={},s=0;s<10;s++)""!==(e?.[s]?.v??"")&&(t[s]=void 0!==e&&void 0!==e[s]?{v:e[s].v??"",l:e[s].l??10}:{v:"",l:10});return t},SR7.D.slideTimelineObject=function(e){return{name:e?.name??"",repeat:e?.repeat??0,length:e?.length??0,triggeredBy:e?.triggeredBy??"",triggeredParam:e?.triggeredParam??""}};SR7.D.layerObjects=function(e){let t,{dLEN:s,id:i,slide:a,sid:r,msource:o,snow:l}=e,n={m:0,top:-1,middle:-1,bottom:-1},d=0,c=SR7.M[i].migrate?SR7.migrate.layerListUpdate({layers:a.layers,isStatic:a.global,snow:l,params:a.params,newIDs:n,msource:o,sid:r}):{},p={top:!1,middle:!1,bottom:!1};for(t in a.layers)if(_tpt.hop(a.layers,t)){if(c[n[t]||t]=SR7.D.layerObject({dLEN:s,id:i,obj:a.layers[t],layertype:null,newIDs:n,sid:r,msource:o,global:a.global}),!SR7.E.backend)continue;if(d=Math.max(d,c[n[t]||t].id),!a.global&&"zone"==c[t].subtype){let e=c[t].pos.v[0];e="mid"==e?"middle":e,c[t].alias=e.toUpperCase()+" ROWS",p[e]=!0}}if(SR7.E.backend&&!a.global)for(let e in p)_tpt.hop(p,e)&&!p[e]&&(c[++d]=SR7.D.layerObject({dLEN:s,id:i,obj:{alias:e.toUpperCase()+" ROWS",type:"container",subtype:"zone",rTo:"slide",vA:e,id:d,zIndex:"top"==e?40:"middle"==e?4:3},layertype:null,newIDs:n,sid:r,msource:o,global:a.global}));return SR7.M[i].migrate&&(c=SR7.migrate.fixPos(c)),c},SR7.D.layerObject=function(e){let{dLEN:t,id:s,obj:i,layertype:a="",newIDs:r,sid:o,msource:l,global:n,ISEMPTY:d,usedAddons:c}=e;const p=d&&c;var h=s&&SR7.M[s].migrate?SR7.migrate.LayerObj({dLEN:t,o:i,newIDs:r,sid:o,msource:l,global:n}):i??{};let u;a=h.type??a;let m=h.subtype??"";"image"==a&&"100% 100%"==h.content?.size&&(h.content.size="cover");var g={addOns:h.addOns??{},rTo:h.rTo??"",listen:h.listen,fluid:{tx:h.fluid?.tx??!1,tr:h.fluid?.tr??!1,sp:h.fluid?.sp??!1},id:h.id??"",alias:h.alias??"",type:"image"==a||"video"==a?"shape":a,subtype:"image"==a?"image":"video"==a||"video"==m?"video":h.subtype??"",content:"image"==a?{}:SR7.D.contentOBJ(a,h.content),mF:h.mF??"none",blend:h.blend??"normal",tag:h.tag??"sr7-layer",href:"a"==h.tag?h.href??void 0:void 0,target:"a"==h.tag?Array.isArray(h.target)?h.target[0]:h.target??void 0:void 0,rel:"a"==h.tag?h.rel??void 0:void 0,libSrc:h.libSrc??"",runtime:h.runtime??{},size:{w:h.size?.w??["#a","auto","#a","#a","#a"],h:h.size?.h??["#a","auto","#a","#a","#a"],maxW:h.size?.maxW??["none","none","none","none","none"],maxH:h.size?.maxH??["none","none","none","none","none"],minW:h.size?.minW??["#a","auto","#a","#a","#a"],minH:h.size?.minH??["#a","auto","#a","#a","#a"],cMode:h.size?.cMode??"custom",sProp:h.size?.sProp??!1},pos:{x:h.pos?.x??["#a",0,"#a","#a","#a"],y:h.pos?.y??["#a",0,"#a","#a","#a"],h:h.pos?.h??["left","left","left","left","left"],v:h.pos?.v??["top","top","top","top","top"],pos:"row"==h.subtype||"column"==h.subtype?"relative":h.pos?.pos??void 0,float:h.pos?.float??"none",clear:h.pos?.clear??"none"},pid:Number(h.pid??-1),pE:h.pE??"auto",uS:h.uS??"default",zIndex:Number(h.zIndex??5),order:h.order??5,style:h.style??"",display:h.display??["#a","block","#a","#a","#a"],vA:h.vA??["top","top","top","top","top"],oflow:h.oflow??"visible",cursor:h.cursor??"cursor",bg:{color:h.bg?.color??"transparent",bClip:h.bg?.bClip??"none",tFCol:h.bg?.tFCol??"none",image:""!==(h.bg?.image?.src??"")||h.bg?.image?.fromStream?SR7.D.contentOBJ("image",h.bg?.image??{}):"image"==a?SR7.D.contentOBJ("image",h.content):void 0,video:""!==(h.bg?.video?.src??"")||h.bg?.video?.fromStream?SR7.D.contentOBJ("video",h.bg?.video??{}):"video"==a?SR7.D.contentOBJ("video",h.content):void 0},attr:{},acc:{hidden:h.acc?.hidden??"true",label:h.acc?.label??"",labeledby:h.acc?.labeledby??"",role:h.acc?.role??("image"==a?"img":"video"==a?"video":"button"==m||"button"==a?"button":"presentation"),haspopup:h.acc?.haspopup??"false"},tl:{}};if("slidebg"!==g.subtype&&"shape"==g.type&&(""==(g.bg?.video?.src??"")&&""!==(g.bg?.image?.src??"")&&(!g.subtype||"image"==g.subtype||"video"==g.subtype||g.subtype?.length<6)?g.subtype="image":"shape"==g.type&&""!==(g.bg?.video?.src??"")&&(!g.subtype||"image"==g.subtype||"video"==g.subtype||g.subtype?.length<6)&&(g.subtype="video"),"cover"!=g.size.cMode&&"cover-proportional"!=g.size.cMode||(g.size.cMode="custom",g.size.w=["#a","100%","#a","#a","#a"],g.size.h=["#a","100%","#a","#a","#a"])),"column"==g.subtype&&(g.size.col=h.size.col??"1/3"),SR7.E.backend&&(g.rTo="slidebg"==h.subtype?"slide":""==g.rTo?"row"==h.subtype?"slide":"cfc":g.rTo),(SR7.E.backend||void 0!==h.vis)&&(g.vis=h.vis),(SR7.E.backend||void 0!==h.viSH)&&(g.viSH=h.viSH),(SR7.E.backend||void 0!==h.viOC)&&(g.viOC=h.viOC),SR7.E.backend&&"fullinset"!==g.size.cMode){let e;for(e in g.pos.x)g.pos.x[e]="auto"==g.pos.x[e]?0:g.pos.x[e];for(e in g.pos.y)g.pos.y[e]="auto"==g.pos.y[e]?0:g.pos.y[e]}for(var f of(void 0!==h.break&&(g.break=h.break),void 0!==h.sStart&&(g.sStart=h.sStart),void 0!==h.sEnd&&(g.sEnd=h.sEnd),void 0!==h.sZ&&(g.sZ=h.sZ),["p","m"]))for(u of["t","b","l","r"]){let e=!1;for(var v=0;v<5;v++)(SR7.E.backend||h[f]?.[u])&&(g[f]??={})&&(g[f][u]??=Array(5))&&(g[f][u][v]=0==h[f]?.[u]?.[v]?0:h[f]?.[u]?.[v]||"#a"),"#a"!==g?.[f]?.[u]?.[v]&&(e=!0);e||!SR7.E.backend&&!h[f]?.[u]||(g[f][u][1]="#a"==g[f][u][1]?0:void 0!==g[f][u][1]?g[f][u][1]:0)}h.tr?.rX&&(g.tr=g.tr||{})&&(g.tr.rX=h.tr?.rX||0),h.tr?.rY&&(g.tr=g.tr||{})&&(g.tr.rY=h.tr?.rY||0),h.tr?.rZ&&(g.tr=g.tr||{})&&(g.tr.rZ=h.tr?.rZ||0),h.tr?.o&&(g.tr=g.tr||{})&&(g.tr.o=h.tr?.o||0),g.tr&&(g.tr.fix=h.tr?.fix||"d"),(SR7.E.backend||h.mod?.s?.u||h.mod?.s?.ut||h.mod?.s?.uf)&&(g.mod??={mask:h.mod?.mask??!1},g.mod.s={u:h.mod?.s?.u??!1,x:h.mod?.s?.x??0,y:h.mod?.s?.y??20,s:h.mod?.s?.s??0,e:h.mod?.s?.e??"power3.out",ut:h.mod?.s?.ut??!1,so:h.mod?.s?.so??0,rX:h.mod?.s?.rX??0,rY:h.mod?.s?.rY??0,rZ:h.mod?.s?.rZ??0,sc:h.mod?.s?.sc??1,uf:h.mod?.s?.uf??!1,b:h.mod?.s?.b??0,g:h.mod?.s?.g??1,f:h.mod?.s?.f??1,d:h.mod?.s?.d??"b",t:h.mod?.s?.t??0}),(SR7.E.backend||h.mod?.m?.u||h.mod?.m?.aBG)&&(g.mod??={mask:h.mod?.mask??!1},g.mod.m={u:h.mod?.m?.u??!1,aBG:h.mod?.m?.aBG??!1,x:h.mod?.m?.x??20,y:h.mod?.m?.y??20,s:h.mod?.m?.s??0,e:h.mod?.m?.e??"power3.out",o:h.mod?.m?.o??"c"}),void 0!==h.px&&(g.px={...h.px}),(SR7.E.backend||"none"!==(h.overlay?.type??"none"))&&(g.overlay={type:h.overlay?.type??"none",size:h.overlay?.size??1,cA:h.overlay?.cA??"transparent",cB:h.overlay?.cB??"#000000"}),SR7.E.backend&&(g.size.oW=h.size?.oW||0),SR7.E.backend&&(g.size.oH=h.size?.oH||0),SR7.E.backend&&(g.size.aRatio=h.size?.aRatio||["#a","auto","#a","#a","#a"]),h.attr??={},(SR7.E.backend||""!==(h.attr?.a||""))&&(g.attr.a=h.attr?.a||""),(SR7.E.backend||""!==(h.attr?.aO||""))&&(g.attr.aO=h.attr?.aO||"ml"),(SR7.E.backend||""!==(h.attr?.id||""))&&(g.attr.id=h.attr?.id||""),(SR7.E.backend||""!==(h.attr?.class||""))&&(g.attr.class=h.attr?.class||""),(SR7.E.backend||""!==(h.attr?.rel||""))&&(g.attr.rel=h.attr?.rel||""),(SR7.E.backend||""!==(h.attr?.tabIndex||""))&&(g.attr.tabIndex=h.attr?.tabIndex||0),(SR7.E.backend||""!==(h.attr?.t||""))&&(g.attr.t=h.attr?.t||""),(SR7.E.backend||""!==(h.attr?.tO||""))&&(g.attr.tO=h.attr?.tO||"ml"),(SR7.E.backend||""!==(h.attr?.wrapClass||""))&&(g.attr.wrapClass=h.attr?.wrapClass||""),(SR7.E.backend||""!==(h.attr?.wrapId||""))&&(g.attr.wrapId=h.attr?.wrapId||""),(SR7.E.backend||""!==(h.attr?.iClass||""))&&(g.attr.iClass=h.attr?.iClass||"");let y=h.hov??={};if(!1!==(h.hov.u??!1)&&(g.hov={u:y.u,m:y.m??!1,deco:y.deco??"none",zIndex:y.zIndex??"auto",color:{c:y.color.c??"#ffffff",bg:y.color.bg??"transparent",gAnim:y.color.gAnim??"fading"},border:{c:y.border.c??"transparent",s:y.border.s??"none",w:{t:y.border.w?.t??0,r:y.border.w?.r??0,b:y.border.w?.b??0,l:y.border.w?.l??0}},radius:{t:y.radius?.t??0,r:y.radius?.r??0,b:y.radius?.b??0,l:y.radius?.l??0},frame:{o:y.frame.o??1,oX:y.frame.oX??"50%",oY:y.frame.oY??"50%",oZ:y.frame.oZ??"50%",x:y.frame.x??0,y:y.frame.y??0,z:y.frame.z??0,rZ:y.frame.rZ??0,rX:y.frame.rX??0,rY:y.frame.rY??0,sX:y.frame.sX??1,sY:y.frame.sY??1,skX:y.frame.skX??1,skY:y.frame.skY??1,d:y.frame.d??300,e:y.frame.e??"power3.inOut"},filter:{g:y.filter?.g??0,r:y.filter?.r??100,b:y.filter?.b??0},svg:{c:y.svg.c??"#ffffff",stroke:{c:y.svg.stroke.c??"transparent",d:y.svg.stroke.d??0,o:y.svg.stroke.o??0,w:y.svg.stroke.w??0}}}),"text"!=a&&"container"!=a||(g.tA=h.tA??["left","left","left","left","left"]),"text"!=a&&"row"!=g.subType&&"column"!=g.subType||(g.ws=h.ws??("container"==g.type?["normal","normal","normal","normal","normal"]:["full","full","full","full","full"])),""===(h.codes?.css??"")&&""===(h.codes?.hovercss??"")||(g.codes={css:h.codes?.css??"",hovercss:h.codes?.hovercss??""}),(SR7.E.backend||h.bShdw?.use)&&(g.bShdw={use:h.bShdw?.use??!1,on:"content",h:h.bShdw?.h??[0,0,0,0,0],v:h.bShdw?.v??[0,0,0,0,0],blur:h.bShdw?.blur??[0,0,0,0,0],spread:h.bShdw?.spread??[0,0,0,0,0],color:h.bShdw?.color??"rgba(0,0,0,0.25)"}),SR7.E.backend||void 0!==h.border&&void 0!==h.border.s){var S=SR7.E.backend;if(h.border??={},h.border.s??=["none","none","none","none","none"],!S)for(var b=0;b<5;b++)S=S||"none"!==h.border.s[b];for(u of(g.border={s:h.border.s,c:h.border?.c??"transparent"},SR7.D.DS))(SR7.E.backend||h.border?.w?.[u])&&(g.border.w=g.border.w||{})&&(g.border.w[u]=h.border?.w?.[u]||0)}if(SR7.E.backend||void 0!==h.radius)for(u of SR7.D.DS)(SR7.E.backend||h.radius?.[u])&&(g.radius??={})&&(g.radius[u]=h.radius?.[u]||0);for(var R in"text"==a&&((SR7.E.backend||h.tShdw?.use)&&(g.tShdw={use:h.tShdw?.use??!1,h:h.tShdw?.h??[0,0,0,0,0],v:h.tShdw?.v??[0,0,0,0,0],blur:h.tShdw?.blur??[0,0,0,0,0],color:h.tShdw?.color??"rgba(0,0,0,0.25)"}),(SR7.E.backend||h.tStroke?.use)&&(g.tStroke={use:h.tStroke?.use??!1,w:h.tStroke?.w??[1,1,1,1,1],c:h.tStroke?.c??"rgba(0,0,0,0.25)"}),g.color=h.color??["#a","#ffffff","#a","#a","#a"],g.font={family:h.font?.family??"Roboto",style:h.font?.style??!1,size:h.font?.size??["#a","20","#a","#a","#a"],weight:h.font?.weight??["#a","400","#a","#a","#a"],ls:h.font?.ls??["#a","0","#a","#a","#a"]},(g.font?.family??"").includes(" ")&&(g.font.family="'"+g.font.family+"'"),(SR7.E.backend||1==(h.tog?.u??!1))&&(g.tog={t:h?.tog?.t??"",u:h?.tog?.u??!1,h:h?.tog?.h??!1,i:h?.tog?.i??!1}),SR7.M[s].migrate&&SR7.D.collectModulFont(g.font,s,g.content.text)),"text"!=a&&"container"!=a||(g.lh=h.lh??["#a","25","#a","#a","#a"]),(SR7.E.backend||h.spike?.use)&&(g.spike={use:h.spike?.use??!1,l:h.spike?.l??"none",r:h.spike?.r??"none",lw:h.spike?.lw??10,rw:h.spike?.rw??10}),h.tl)if(_tpt.hop(h.tl,R))for(var w in g.tl[R]??={},h.tl[R])_tpt.hop(h.tl[R],w)&&(g.tl[R]??={},"bg"==w&&"in"==R?g.tl.in.bg={ex:!0,all:[{},SR7.D.getBGAnim(h.tl.in.bg?.all?.[1]?h.tl.in.bg.all[1]:h.tl.in.bg)]}:g.tl[R][w]=SR7.D.layerTLObject(h.tl[R][w],w));if("text"==g.type&&(SR7.M[s].icons??={},(SR7.M[s].settings?.fonts?.FontAwesome||g.content.text.includes("<i")&&(g.content.text.includes('class="fa-')||g.content.text.includes("class='fa-")))&&(SR7.M[s].settings.fonts.FontAwesome=!0),(SR7.M[s].settings?.fonts?.PeIcon||g.content.text.includes("<i")&&(g.content.text.includes('class="pe-7')||g.content.text.includes("class='pe-7")))&&(SR7.M[s].settings.fonts.PeIcon=!0),(SR7.M[s].settings?.fonts?.Materialicons||g.content.text.includes("material-icons"))&&(SR7.M[s].settings.fonts.Materialicons=!0)),void 0!==SR7.M[s]&&void 0!==SR7.M[s].imgList)for(let e in SR7.M[s].imgList)_tpt.hop(SR7.M[s].imgList,e)&&(_tpt.compareURL(SR7.M[s].imgList[e].old,g.content?.src)&&(g.content.src=SR7.M[s].imgList[e].new),_tpt.compareURL(SR7.M[s].imgList[e].old,g?.content?.image?.src)&&(g.content.image.src=SR7.M[s].imgList[e].new),_tpt.compareURL(SR7.M[s].imgList[e].old,g.bg?.src)&&(g.bg.src=SR7.M[s].imgList[e].new),_tpt.compareURL(SR7.M[s].imgList[e].old,g.bg?.image?.src)&&(g.bg.image.src=SR7.M[s].imgList[e].new));if(("video"==g.subtype||g.bg.video||"audio"==g.type)&&(SR7.R??={},SR7.R.media=!0),"text"!=g.type&&"button"!=g.type||((g.attr?.iClass??"").includes("sr7-btn")||(g.attr?.iClass??"").includes("sr7-scroll-btn")||(g.attr?.iClass??"").includes("sr7-brg")||(g.text?.content??"").includes("sr7-btn")||(g.text?.content??"").includes("sr7-scroll-btn")||(g.text?.content??"").includes("sr7-brg"))&&(SR7.R??={},SR7.R.cssbtns=!0),p)for(let e in SR7.A)_tpt.hop(SR7.A,e)&&SR7.A[e]?.getLayerBasics&&c.includes(e)&&(g.addOns??={},g.addOns[e]=SR7.A[e].getLayerBasics({},"compare"));return g},SR7.D.registerModuleFonts=function(e){for(var t in SR7.M[e].settings.fonts)if(_tpt.hop(SR7.M[e].settings.fonts,t)){var s=SR7.M[e].settings.fonts[t];if(_tpt.R.fonts?.customs?.[t])_tpt.registerFont({family:_tpt.R.fonts.customs[t].family??s.name??_tpt.fontFamily(t,!0),url:_tpt.R.fonts.customs[t]});else if("FontAwesome"==t)_tpt.registerFont({family:"FontAwesome",url:SR7.E.plugin_url+"public/css/fonts/font-awesome/css/font-awesome.css"});else if("Materialicons"==t)_tpt.registerFont({family:"Materialicons",url:SR7.E.plugin_url+"public/css/fonts/material/material-icons.css"});else if("PeIcon"==t)_tpt.registerFont({family:"Pe-icon-7-stroke",url:SR7.E.plugin_url+"public/css/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css"});else if("RevIcon"==t)_tpt.registerFont({family:"revicons",url:SR7.E.plugin_url+"public/css/fonts/revicons/css/revicons.css"});else for(var i of["italic","normal"])if(null!=s[i])for(var a in s[i])_tpt.hop(s[i],a)&&_tpt.registerFont({family:s.name??_tpt.fontFamily(t,!0),url:s.url,italic:"italic"==i,weight:a})}},SR7.D.checkSubsets=function(e=""){const t={};for(let s=0;s<e.length;s++){const i=e.charCodeAt(s);for(const e in SR7.D.subsets)i>=SR7.D.subsets[e].start&&i<=SR7.D.subsets[e].end&&(t[e]=!0)}return t},SR7.D.collectModulFont=function(e,t,s){let i="undefined"!=typeof RVS&&(((e,t)=>{if(window.RVS?.LIB?.FONTS)for(var s in RVS.LIB.FONTS)if(RVS.LIB.FONTS[s].label==e&&(t||"googlefont"==RVS.LIB.FONTS[s].type))return RVS.LIB.FONTS[s]})(e.family,!0)??void 0);if(window?.RVS?.LIB?.FONTS&&void 0===_tpt?.R?.fonts?.customs&&_tpt.fontFamily&&(_tpt.R??={},_tpt.R.fonts??={},_tpt.R.fonts.customs=RVS.LIB.FONTS.filter((e=>"custom"===e.type)),_tpt.R.fonts.customs.length>0))for(let e in _tpt.R.fonts.customs)_tpt.R.fonts.customs[e].family=_tpt.fontFamily(_tpt.R.fonts.customs[e].label).replaceAll("'","");if(null==SR7.M[t])return;SR7.M[t].settings.fonts??={};let a=_tpt.fontFamily(e.family);a=a.replace("''","'"),SR7.M[t].settings.fonts[a]??={name:e.family},i?.url&&(SR7.M[t].settings.fonts[a].url=i?.url),SR7.M[t].settings.fonts[a][e.style?"italic":"normal"]??={},SR7.M[t].settings.fonts[a].subset=SR7.D.checkSubsets(s);let r=a.replaceAll("'","");(_tpt.R.fonts?.customs?.length??0)>0&&_tpt.R.fonts.customs.filter((e=>e.family===r)).length>0&&(SR7.M[t].settings.fonts[a].custom=!0);for(var o=0;o<5;o++)"auto"!==e.weight[o]&&(SR7.M[t].settings.fonts[a][e.style?"italic":"normal"][e.weight[o]]=!0)},SR7.D.collectModulFonts=function(e){for(var t in SR7.M[e].settings.fonts={},SR7.M[e].slides)if(_tpt.hop(SR7.M[e].slides,t))for(var s in SR7.M[e].slides[t].layers)_tpt.hop(SR7.M[e].slides[t].layers,s)&&"text"===SR7.M[e].slides[t].layers[s].type&&SR7.D.collectModulFont(SR7.M[e].slides[t].layers[s].font,e,SR7.M[e].slides[t].layers[s].content.text)},SR7.D.layerTLObject=function(e={},t){var s="filter"==t||"mask"==t?{}:"clip"==t?{orig:e?.orig??"l",type:e?.type??"r"}:{pers:e.pers??600,orig:{x:e?.orig?.x??"50%",y:e?.orig?.y??"50%",z:e?.orig?.z??"0"}};for(var i in e)if(_tpt.hop(e,i)&&"orig"!=i&&"type"!=i&&"pers"!=i){s[i]=SR7.backend?Array(e[i].length):[];for(var a=0;a<e[i].length;a++)s[i].push(SR7.D.getKeyFrame(e[i][a],t,i))}return s},SR7.D.getKeyFrame=function(e={},t="content",s="all"){var i={t:e?.t??300,d:e?.d??300,f:e?.f??300,e:e?.e??"power3.inOut"};if("content"==t&&(i.pE=e.pE??"d"),void 0!==e.addOns)for(var a in i.addOns={},e.addOns)_tpt.hop(e.addOns,a)&&(i.addOns[a]=e.addOns[a]);return null!=e.x&&(i.x=e.x??0),null!=e.y&&(i.y=e.y??0),void 0!==e.anchors&&(i.anchors=e.anchors),void 0!==e.curv&&(i.curv=e.curv),null!=e[s]&&(i[s]=e[s]),void 0!==e.rep&&(i.rep={s:e.rep.s,r:e.rep.r??-1,sh:e.rep.sh??!1,y:e.rep.y??!1,c:e.rep.c??!1}),"mask"!==t&&"filter"!==t&&"clip"!==t&&(null!=e.z&&(i.z=e.z),null!=e.sX&&(i.sX=e.sX),null!=e.sY&&(i.sY=e.sY),null!=e.skX&&(i.skX=e.skX),null!=e.skY&&(i.skY=e.skY),null!=e.o&&(i.o=e.o),null!=e.rX&&(i.rX=e.rX??0),null!=e.rY&&(i.rY=e.rY),null!=e.rZ&&(i.rZ=e.rZ),null!=e.fb&&(i.fb=e.fb),null!=e.fgs&&(i.fgs=e.fgs),null!=e.fbr&&(i.fbr=e.fbr),void 0!==e.bgcol&&(i.bgcol=e.bgcol),void 0!==e.col&&(i.col=e.col)),"content"==t&&void 0!==e.fx&&(i.fx=e.fx,i.fxc=e.fxc??"#ffffff",i.fxe=e.fxe??i.e,i.fxs=e.fxs??i.t),"mask"==t&&void 0!==e.oflow&&(i.oflow=e.oflow),("filter"==t||"loop"==t&&"filter"==s)&&(null!=e.fu&&(i.fu=e.fu),i.fu&&(null!=e.b&&(i.b=e.b),null!=e.g&&(i.g=e.g),null!=e.r&&(i.r=e.r)),null!=e.bu&&(i.bu=e.bu),void 0!==i.bu&&(null!=e.bb&&(i.bb=e.bb),null!=e.bg&&(i.bg=e.bg),null!=e.br&&(i.br=e.br),null!=e.bs&&(i.bs=e.bs),null!=e.bi&&(i.bi=e.bi)),void 0!==e.repeat&&(i.repeat=e.repeat)),SR7.D.splits.indexOf(t)>=0&&(void 0!==e.fu&&(i.fu=e.fu),e.fu&&(null!=e.b&&(i.b=e.b),null!=e.g&&(i.g=e.g),null!=e.r&&(i.r=e.r)),i.dir=e.dir??"start",i.delay=e.delay??5),"clip"==t&&(void 0!==e.c&&(i.c=e.c),void 0!==e.cb&&(i.cb=e.cb)),"filter"!==t&&"clip"!==t&&"loop"!==t&&(void 0!==e.xRe&&(i.xRe=parseInt(e.xRe)),void 0!==e.yRe&&(i.yRe=parseInt(e.yRe)),i.off=e.off??0),"loop"==t&&e.aR&&(i.aR=e.aR),i},SR7.D.getBGAnim=function(t={}){null==t&&(t={});var s={};if("7.0"==t.v?((SR7.E.backend||void 0!==t.d)&&(s.d=parseInt(t.d??1e3)),(SR7.E.backend||void 0!==t.sd)&&(s.sd=t.sd??75),(SR7.E.backend||void 0!==t.tr)&&(s.tr=t.tr??"basic"),s.e=t.e??t?.in?.e??"power2.inOut",s.dir=t.dir??"default"):(s.d=t?.ms??t?.speed??1e3,s.sd=parseInt(s.d)/parseInt(t?.d??15)*10,(SR7.E.backend||void 0!==t.e)&&(s.tr=t.e??"basic"),s.e=t?.in?.e??"power2.inOut",s.dir=t.f??"default"),s.t=0,s.rnd=t.preset||t.main?(t.preset??"").toLowerCase().startsWith("rnd")||(t.main??"").toLowerCase().includes("random"):"true"==String(t.random)||"true"==String(t.rnd),s.rnd||"true"==s.rnd)return s.rnd=!0,s.rndmain=t.rndmain??t.rndmain??"",s;s.temp={t:t?.temp?.t??t.title??"",p:t?.temp?.p??t.preset??"",m:t?.temp?.m??t.main??"",g:t?.temp?.g??t.group??""},s.addOns=t?.addOns??t.addOns??{},(SR7.E.backend||void 0!==t.o)&&(s.o=t.o??"inout"),(SR7.E.backend||void 0!==t.f)&&(s.f=t.f??"start"),(SR7.E.backend||void 0!==t.s)&&(s.s=t.s??1e3),(SR7.E.backend||void 0!==t.p)&&(s.p=t.p??"none"),(SR7.E.backend||void 0!==t.eng)&&(s.eng=t.eng??"animateCore"),(SR7.E.backend||void 0!==t.adpr)&&(s.adpr=t.adpr??!0),(SR7.E.backend||void 0!==t.d3)&&(t.d3??={},s.d3??={},(SR7.E.backend||void 0!==t.d3.f)&&(s.d3.f=t.d3.f??"none"),(SR7.E.backend||void 0!==t.d3.d)&&(s.d3.d=t.d3.d??"horizontal"),(SR7.E.backend||void 0!==t.d3.z)&&(s.d3.z=t.d3.z??300),(SR7.E.backend||void 0!==t.d3.t)&&(s.d3.t=t.d3.t??0),(SR7.E.backend||void 0!==t.d3.c)&&(s.d3.c=t.d3.c??"#ccc"),(SR7.E.backend||void 0!==t.d3.e)&&(s.d3.e=t.d3.e??"power2.inOut"),(SR7.E.backend||void 0!==t.d3.fdi)&&(s.d3.fdi=t.d3.fdi??1.5),(SR7.E.backend||void 0!==t.d3.fdo)&&(s.d3.fdo=t.d3.fdo??2),(SR7.E.backend||void 0!==t.d3.fz)&&(s.d3.fz=t.d3.fz??0),(SR7.E.backend||void 0!==t.d3.su)&&(s.d3.su=t.d3.su??!1),(SR7.E.backend||void 0!==t.d3.smi)&&(s.d3.smi=t.d3.smi??0),(SR7.E.backend||void 0!==t.d3.sma)&&(s.d3.sma=t.d3.sma??.5),(SR7.E.backend||void 0!==t.d3.sc)&&(s.d3.sc=t.d3.sc??"#000"),(SR7.E.backend||void 0!==t.d3.sl)&&(s.d3.sl=t.d3.sl??1)),(SR7.E.backend||void 0!==t.filter)&&(t.filter??={},s.filter??={},(SR7.E.backend||void 0!==t.filter.u)&&(s.filter.u=t.filter.u??!1),(SR7.E.backend||void 0!==t.filter.e)&&(s.filter.e=t.filter.e??"default"),(SR7.E.backend||void 0!==t.filter.b)&&(s.filter.b=t.filter.b??0),(SR7.E.backend||void 0!==t.filter.g)&&(s.filter.g=t.filter.g??0),(SR7.E.backend||void 0!==t.filter.h)&&(s.filter.h=t.filter.h??100),(SR7.E.backend||void 0!==t.filter.s)&&(s.filter.s=t.filter.s??0),(SR7.E.backend||void 0!==t.filter.c)&&(s.filter.c=t.filter.c??100),(SR7.E.backend||void 0!==t.filter.i)&&(s.filter.i=t.filter.i??0));for(let i of["in","out"])t[i]??={},"in"!=i&&"out"!=i||!SR7.E.backend&&void 0===t[i]||(s[i]??={},"in"==i?((SR7.E.backend||void 0!==t.in.mo)&&(s.in.mo=t.in.mo??80),(SR7.E.backend||void 0!==t.in.mou)&&(s.in.mou=t.in.mou??!1),(SR7.E.backend||void 0!==t.in.moo)&&(s.in.moo=t.in.moo??!1)):(SR7.E.backend||void 0!==t.out.a)&&(s.out.a=_tpt.tf(t[i].a??!0)),"out"==i&&1==t.out.a?((SR7.E.backend||void 0!==t.in.o)&&(s.out.o=t.in.o??1),(SR7.E.backend||void 0!==t.in.x)&&(s.out.x=e(t.in.x??0)),(SR7.E.backend||void 0!==t.in.y)&&(s.out.y=e(t.in.y??0)),(SR7.E.backend||void 0!==t.in.r)&&(s.out.r=t.in.r??0),(SR7.E.backend||void 0!==t.in.sx)&&(s.out.sx=t.in.sx??1),(SR7.E.backend||void 0!==t.in.sy)&&(s.out.sy=t.in.sy??1),(SR7.E.backend||void 0!==t.in.m)&&(s.out.m=t.in.m??!1),SR7.E.backend&&(s.out.e=e(t.in.e??"power2.inOut")),(SR7.E.backend||void 0!==t.in.row)&&(s.out.row=t.in.row??1),(SR7.E.backend||void 0!==t.in.col)&&(s.out.col=t.in.col??1)):((SR7.E.backend||void 0!==t[i].o)&&(s[i].o=t[i].o??1),(SR7.E.backend||void 0!==t[i].x)&&(s[i].x=t[i].x??0),(SR7.E.backend||void 0!==t[i].y)&&(s[i].y=t[i].y??0),(SR7.E.backend||void 0!==t[i].r)&&(s[i].r=t[i].r??0),(SR7.E.backend||void 0!==t[i].sx)&&(s[i].sx=t[i].sx??1),(SR7.E.backend||void 0!==t[i].sy)&&(s[i].sy=t[i].sy??1),(SR7.E.backend||void 0!==t[i].m)&&(s[i].m=t[i].m??!1),"in"!==i&&(SR7.E.backend||void 0!==t[i].e)&&(s[i].e=t[i].e??"power2.inOut"),(SR7.E.backend||void 0!==t[i].row)&&(s[i].row=t[i].row??1),(SR7.E.backend||void 0!==t[i].col)&&(s[i].col=t[i].col??1)));return(SR7.E.backend||void 0!==t.addOns)&&(s.addOns=t.addOns??SR7.D.getBGAnim_Addons()),s.v=t.v??"7.0",s.a=t.a??"BG Animation",s},SR7.D.getBGAnim_Addons=function(){return{}};const e=function(e){if(String(e).endsWith(".out"))return e.replace(/\.out$/,".in");if(String(e).endsWith(".in"))return e.replace(/\.in$/,".out");if(String(e).endsWith(".Out"))return e.replace(/\.Out$/,".In");if(String(e).endsWith(".In"))return e.replace(/\.In$/,".Out");if(String(e).includes("{"))return e;if(String(e).includes("[")){e=(e=e.replaceAll("[","").replaceAll("]","")).split(",");let t="[";return e.forEach((function(e){const s=(""+e).includes("%"),i=(""+e).includes("px");e.includes("(")?(e=e.replaceAll("(","").replaceAll(")",""),t+="("+-1*parseFloat(e)+(s?"%":i?"px":"")+")"):t+=-1*parseInt(e)+(s?"%":i?"px":""),t+=","})),t=t.slice(0,-1)+"]",t}let t=String(e).includes("(");if(t&&(e=e.replaceAll("(","").replaceAll(")","")),!isNaN(parseFloat(e))){const s=(""+e).includes("%"),i=(""+e).includes("px");e=parseFloat(e);let a=-parseFloat(e)+(s?"%":"")+(i?"px":"");return t?"("+a+")":a}return e};_tpt.R??={},_tpt.R.defaults=_tpt.extend?_tpt.extend(_tpt.R.defaults,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F=SR7.F||{},void 0!==SR7.F.drawBG)return;SR7.F.drawBG=function(e,t,s,i="canvas",a){if(null==e||null==e)return{};let{c:r,skey:o}=SR7.F.getLayer?SR7.F.getLayer(e.id):{c:void 0,skey:void 0},l=null==t.image;var n;if(s&&(e.style.background="",e.style.backgroundImage="",e.style.backgroundColor=""),(l||""==(t.image.src??""))&&(t.color??="#000000",l=!0),t.color&&("canvas"===i&&l?"canvas"==i&&(null!=r&&null!=r.canvas||(r??={},r.canvas=new SR7.F.canvas({wrap:e,color:t.color,ctx:"2d",overlay:t.overlay})),r.canvas.drawColored()):("object"==typeof t.color&&(t.color=_tpt.gradient.process(t.color,!0)),s&&!r?.bgByCSS&&(e.style.background=("object"==typeof t.color?t.color.string:t.color)+("none"!==(t.bClip??"none")?" "+t.bClip:"")))),!l)if("bg"===i)e.style.backgroundImage="url('"+_tpt.urlProtocol(t.image.src.replaceAll(" ","%e2%80%af"))+"')"+(e.style.backgroundImage.indexOf("gradient")>=0?","+e.style.backgroundImage:""),_tpt.gsap.set(e,{backgroundPosition:(t.image?.pos?.x??0)+" "+(t.image?.pos?.y??0),backgroundSize:"percentage"==t.image.size?parseInt(t.image.sizeVal??100)+"%":"pixel"==t.image.size?parseInt(t.image.sizeVal??100)+"px":t.image.size,backgroundRepeat:t.image.repeat});else if("element"===i){var d=document.createElement("sr-container");e.insertBefore(d,e.children[0]),d.style.backgroundImage="url('"+_tpt.urlProtocol(t.image.src.replaceAll(" ","%e2%80%af"))+"')"+ +(d.style.backgroundImage.indexOf("gradient")>=0?","+d.style.backgroundImage:""),_tpt.gsap.set(d,{width:"100%",height:"100%",position:"absolute",top:0,left:0,backgroundPosition:t.image.pos.x+" "+t.image.pos.y,backgroundSize:"percentage"==t.image.size?parseInt(t.image.sizeVal??100)+"%":"pixel"==t.image.size?parseInt(t.image.sizeVal??100)+"px":t.image.size,backgroundRepeat:t.image.repeat})}else"canvas"===i&&""!==t.image.src&&(e.style.overflow="hidden",null==r||null==r.canvas||null==r.canvas.image?(r??={},r.canvas??=new SR7.F.canvas({wrap:e,ctx:"2d",create:!0,overlay:t.overlay,size:t.image.size,pos:t.image.pos,repeat:t.image.repeat,sizeVal:t.image.sizeVal}),n=new Promise((s=>{_tpt.registerImage(t.image.src,1,(function(e){requestAnimationFrame((function(){try{r.canvas.image=e.image,r.canvas.drawImg()}catch(e){console.log(e)}s()}))}),e.id+"_"+Math.round(1e5*Math.random()),void 0,t.image.crossOrigin)}))):r.canvas.drawImg());return{canvas:r?.canvas?.canvas??void 0,promise:n,c:r}},SR7.F.attrId=e=>""==e||null==e?void 0:e,SR7.F.drawRawLayers=function(e,t,s){if(null==t||-1==t)return;let i=SR7.M[e],a=i.slides[t].layers,r=i.c?.PO?.[t];if(null!=r&&null!=i.zones[t]){i.zones[t].cache=i.zones[t].all;for(let i in r)_tpt.hop(r,i)&&void 0!==a[r[i]]&&SR7.F.drawRawLayer(SR7.F.attrId(a[r[i]].attr?.id)??e+"-"+t+"-"+a[r[i]].id,s,t);requestAnimationFrame((function(){SR7.F.getZoneHeights(e,t)!==i.zones[t].cache&&SR7.F.updateModuleDims(e,!0)}))}};const e=(e,t,s)=>{const i=parseFloat(e),a="none"!==s?parseFloat(s):NaN,r="none"!==t?parseFloat(t):NaN;return isNaN(i)?e:!isNaN(a)&&i<a?s:!isNaN(r)&&i>r?t:e},t=(e,t,s,i,a,r)=>t!==(s=_tpt.divSize(SR7.gV({v:s,id:i,f:a,m:"round",s:"scale"})))?(r.style[e]=s&&"none"!==s?s:"",s):t,s=(t,s,i,a,r,o)=>String(t).includes("%")?e(parseFloat(o),a,r)*parseFloat(t)/100/s*i:isNaN(parseFloat(t))?"auto":e(parseFloat(t),a,r)/s*i;SR7.F.drawRawLayer=function(r,o,l,n){var{layer:d,el:c,c:p,id:h,skey:u,lkey:m}=SR7.F.getLayer(r);if("hover"==p.cache?.hover?.requested)return;var g=SR7.M[h],f=[];let v,y;p.LME=p.addonWrap?"addonWrap":p.parallax?"parallax":p.loop?"loop":p.mask?"mask":"el",p.target??="column"!==d.subtype?p[p.LME]:c,SR7.E.backend&&(p.editVals??={con:{},el:{},row:{},column:{}}),p.useAsImage="image"==d.subtype||"text"!==d.type&&"column"!==d.subtype&&"row"!==d.subtype&&"video"!==d.subtype&&"slidebg"!==d.subtype&&""!==d?.bg?.image?.src&&d?.bg?.image?.src?.length>3,p.minMaxCon??="row"!=d.subtype&&"column"!=d.subtype||!p.con?p.target:p.con;const S=_tpt.tf(d.fluid?.tr??void 0);let b=_tpt.divSize(SR7.gV({v:d.size.w,id:h,f:S,m:"round",s:"scale"})),R=_tpt.divSize(SR7.gV({v:d.size.h,id:h,f:S,s:"scale"}));if("auto"==b&&"auto"==R&&p.image)if(p.imgHeight&&p.imgWidth){R=p.imgHeight*g.MP,b=p.imgWidth*g.MP;let e=(p.par?.cw??0)-((p.par?._pLeft??0)+(p.par?._pRight??0)),t=(p.par?.ch??0)-((p.par?._pTop??0)+(p.par?._pBottom??0));b>e&&e>0?(b=e,R=p.imgHeight/p.imgWidth*b):R>t&&t>0&&(R=t,b=p.imgWidth/p.imgHeight*R)}else p.aspectRatio<1?(b="auto",R="100%"):(b="100%",R="auto");p.display=SR7.gV({v:d.display,id:h});let w=!("prepare"!=o&&"animated"===p.state&&"idle"!=(p.cache?.color?.from??"idle")||p.global&&"in"==p.gpos&&"idle"!==(p.cache?.color?.from??"idle")&&void 0!==(p.cache?.color?.c??void 0)),x=!("prepare"!=o&&"animated"===p.state||p.global&&"in"==p.gpos&&"idle"!==(p.cache?.color?.bgfrom??"idle")&&void 0!==(p.cache?.color?.bg??void 0));if("text"==d.type&&(c.style.fontFamily=d.font.family.replaceAll("'",""),("default"==d.uS&&g.settings.uS||"true"==String(d.uS))&&(c.style.userSelect="text"),""==c.style.fontFamily&&(c.style.fontFamily="'"+d.font.family.replaceAll("'","")+"'"),"none"!==(d.bg.tFCol??"none")&&(c.style.webkitTextFillColor=d.bg.tFCol),c.style.fontSize=SR7.gV({v:d.font.size,id:h,u:"px",f:d.fluid.tx,m:"round",s:"scale",a:!0}),c.style.fontWeight=SR7.gV({v:d.font.weight,id:h,u:0}),w&&(c.style.color=SR7.gV({v:d.color,id:h}),SR7.F.cache(p.cache,"color",["c","from"],[c.style.color,"idle"])),c.style.textTransform=d.content.trans,c.style.textDecoration=d.content.deco,c.style.letterSpacing=SR7.gV({v:d.font.ls,id:h,u:"px",f:d.fluid.tx,s:"scale"}),void 0!==d.tShdw&&d.tShdw.use&&(c.style.textShadow=SR7.gV({v:d.tShdw.h,id:h,u:"px",f:d.fluid.tx})+" "+SR7.gV({v:d.tShdw.v,id:h,u:"px",f:d.fluid.tx})+" "+SR7.gV({v:d.tShdw.blur,id:h,u:"px",f:d.fluid.tx})+" "+d.tShdw.color),void 0!==d.tStroke&&d.tStroke.use&&(c.style.webkitTextStroke=SR7.gV({v:d.tStroke.w,id:h,u:"px",f:d.fluid.tx})+" "+d.tStroke.c),p.metas??=SR7.F.updateBasicMetas(h,p,u),d.font.style&&(c.style.fontStyle="italic"),p.fontStr=`${c.style.fontStyle} ${c.style.fontWeight} ${c.style.fontSize} '${c.style.fontFamily}'`,!0!==p.waitOnFont&&(p.waitOnFont=!0,f.push(_tpt.checkFontLoaded(c.style.fontFamily,c.style.fontWeight,c.style.fontStyle,175)),c.innerHTML.includes('class="material-icons')&&f.push(_tpt.checkFontLoaded("Material Icons",c.style.fontWeight,c.style.fontStyle,375)),c.innerHTML.includes('<i class="fa-')&&f.push(_tpt.checkFontLoaded("FontAwesome",c.style.fontWeight,c.style.fontStyle,175)),c.innerHTML.includes('<i class="pe-7s-')&&f.push(_tpt.checkFontLoaded("Pe-icon-7-stroke",c.style.fontWeight,c.style.fontStyle,175)))),"container"==d.type||"text"==d.type){c.style.lineHeight=SR7.gV({v:d.lh,id:h,u:"px",f:d.fluid.tx,m:"round",s:"scale"}),c.style.textAlign=SR7.gV({v:d.tA,id:h,u:0});let e=SR7.gV({v:d.ws,id:h});e="full"===e?"normal":e,p.maw=t("maxWidth",p.maw,d.size.maxW,h,S,p.minMaxCon),e="normal"==e&&p.maw&&"none"!==p.maw?"normal":"normal"===e&&"auto"===b&&("column"!==p.ptype&&"group"!==p.ptype||"relative"!==d.pos.pos)||"content"==e?"nowrap":e,void 0!==e&&(c.style.whiteSpace=e)}void 0!==d.bShdw&&d.bShdw.use&&(p["row"==d.subtype?p.mask?"target":p.con?"con":"el":"column"==d.subtype&&p.colbg?"colbg":"el"].style.boxShadow=SR7.gV({v:d.bShdw.h,id:h,u:"px",f:d.fluid.tx,s:"scale"})+" "+SR7.gV({v:d.bShdw.v,id:h,u:"px",f:d.fluid.tx,s:"scale"})+" "+SR7.gV({v:d.bShdw.blur,id:h,u:"px",f:d.fluid.tx,s:"scale"})+" "+SR7.gV({v:d.bShdw.spread,id:h,u:"px",f:d.fluid.tx,s:"scale"})+" "+d.bShdw.color),"group"==d.subtype&&(c.style.lineHeight="0px");let F,_=d.radius&&("video"==d.type||"video"==d.subtype);if((void 0!==p.oflow||_)&&(p[p.mask?"mask":"el"].style.overflow=_||p.useAsImage&&d.image?.style?"hidden":p.oflow),"column"==d.subtype||"row"==d.subtype)for("column"==d.subtype?(d.break??=g.slides[u].layers[d.pid].break,"1/1"!==d.size.col&&(null==d.break||d.break>g.LEV)?(b=d.size.col.split("/"),b=100/parseInt(b[1])*b[0]+"%",p.display="table-cell"):(b="100%",p.display="block")):p.con?(p.conDisplay=null==d.break||d.break>g.LEV?"table":"block","row"==d.subtype&&p.mask&&(b="100%")):(p.display=null==d.break||d.break>g.LEV?"table":"block",b="100%"),v=0;v<4;v++)p.el.style["padding"+SR7.D.DL[v]]=parseInt(SR7.gV({v:d.m?.[SR7.D.DS[v]]??0,id:h,u:0,f:d.fluid.sp,m:"round"}))+parseInt("row"!=d.subtype||1!=v&&3!=v||"slide"===d.rTo||"carousel"===g.settings.type&&!g.settings.carousel.stretch&&!g.slides[u].slide.global?0:p.con["margin"+SR7.D.DL[v]]=g.dims.CFC.x)+"px",p["rp"+SR7.D.DS[v]]=parseInt(p.el.style["padding"+SR7.D.DL[v]]),p[p.con?"con":"el"].style["padding"+SR7.D.DL[v]]=SR7.gV({v:d.p?.[SR7.D.DS[v]]??0,id:h,u:0,f:d.fluid.sp,m:"round"})+"px","container"==p.type&&(p["_p"+SR7.D.DL[v]]=parseInt(p.el.style["padding"+SR7.D.DL[v]])),p.colbg&&(p.colbg.style[SR7.D.DL[v].toLowerCase()]=p.el.style["padding"+SR7.D.DL[v]],p.colbgMask&&(p.colbgMask.style[SR7.D.DL[v].toLowerCase()]="0px")),p.editVals&&(p.editVals[d.subtype]["padding"+SR7.D.DL[v]]=SR7.gV({v:d.p?.[SR7.D.DS[v]]??0,id:h,u:0,f:d.fluid.sp,m:"round"})+"px",p.editVals[d.subtype]["margin"+SR7.D.DL[v]]=SR7.gV({v:d.m?.[SR7.D.DS[v]]??0,id:h,u:0,f:d.fluid.sp,m:"round"})+"px");else{let e;for(y of SR7.D.spacings)if("absolute"!=d.pos.pos&&"fullinset"!=d.size.cMode||"margin"!=y)for(v=0;v<4;v++)p["padding"!==y?p.LME:"el"].style[y+SR7.D.DL[v]]=e=(void 0!==d[y[0]]&&void 0!==d[y[0]][SR7.D.DS[v]]?SR7.gV({v:d[y[0]][SR7.D.DS[v]],id:h,u:0,f:d.fluid.sp,m:"round",s:"padding"==y?"scale":"inherit"}):0)+"px","0px"!==e&&(F=!0),p.editVals&&(p.editVals.el[y+SR7.D.DL[v]]=e)}"absolute"==d.pos.pos&&"fullinset"==d.size.cMode?(p.target.style.width="auto",p.target.style.height="auto"):(p.imgtype=p.useAsImage?p.imgHeight>p.imgWidth?"portrait":p.imgHeight<p.imgWidth?"landscape":void 0:void 0,p.aspectRatio??=p.media&&p.media?.player?.aspectRatio?p.media.player.aspectRatio:p.canvas?.canvas?.image?p.canvas.canvas.naturalWidth/p.canvas.canvas.naturalHeight:void 0,p.mih=t("minHeight",p.mih,d.size.minH,h,S,p.minMaxCon),p.miw=t("minWidth",p.miw,d.size.minW,h,S,p.minMaxCon),p.mah=t("maxHeight",p.mah,d.size.maxH,h,S,p.minMaxCon),p.maw=t("maxWidth",p.maw,d.size.maxW,h,S,p.minMaxCon),p.w="auto"!==b?b:"shape"==d.type&&p.useAsImage&&p.imgHeight?((t,i)=>"auto"==i?e(t.imgWidth,t.maw,t.miw):s(i,t.imgHeight,t.imgWidth,t.mah,t.mih,t.par?.rch??t.par?.ch))(p,R):"absolute"==d.pos.pos&&"text"!==d.type&&"group"!==d.subtype?p.useAsImage?"landscape"==p.imgtype?"100%":"auto":"100%":"auto",p.h="fullheight"==d.size.cMode||"cover"==d.size.cMode||"cover-proportional"==d.size.cMode?"100%":"auto"==R&&"shape"==d.type&&p.useAsImage&&p.imgHeight?((t,i)=>"auto"==i?e(t.imgHeight,t.mah,t.mih):s(i,t.imgWidth,t.imgHeight,t.maw,t.miw,t.par?.rcw??t.par?.cw))(p,b):R,p.h="-1"==String(p.h)?"auto":p.h,p.target.style.width=-1==d.pid&&"slide"!==d.rTo?"auto"==p.w?"none"!=p.maw&&p.maw?p.maw:"auto":_tpt.posToNum(_tpt.unitize(p.w),g.dims.CFC?.[l]?.w??g.dims.CFC.w)+"px":_tpt.unitize(p.w),p.target.style.height=-1==d.pid&&"slide"==d.rTo&&"100%"==R&&g.settings.fixed&&g.settings.size.fullHeight?_tpt.winH+"px":-1==d.pid&&"slide"!==d.rTo&&"auto"!==p.h?_tpt.posToNum(_tpt.unitize(p.h),g.dims.CFC.h)+"px":"auto"!==p.h&&-1==d.pid&&"slide"==d.rTo?_tpt.posToNum(_tpt.unitize(p.h),g.fHVCarousel?g.dims.CFC.h:g.dims.content.h)+"px":_tpt.unitize(p.h,"px"),p.mask&&(p.loop||p.parallax)&&"absolute"==p.target.style.position&&(p.mask.style.height="100%",p.mask.style.width="100%"),"bg"==p.imageType&&p.image?.style&&(p.image.style.backgroundSize=p.w+" "+p.h)),-1!==d.pid&&(p.target.style.cssFloat=SR7.gV({v:d.pos.float,id:h}),"none"!==p.target.style.cssFloat&&"group"==p.par?.subtype&&p.par.el.classList.add("sr7-clear"),p.target.style.clear=SR7.gV({v:d.pos.clear,id:h}));let M="column"==d.subtype&&p.colbgMask?"colbgMask":"column"==d.subtype&&p.colbg?"colbg":"row"==d.subtype&&p.con?"con":"el";if(d.border){for(p[M].style.borderStyle=SR7.gV({v:d.border.s,id:h}),v=0;v<4;v++)p[M].style[SR7.D.BWID[v]]=_tpt.unitize(SR7.gV({v:d.border?.w?.[SR7.D.DS[v]]??0??"0px",id:h,f:S,m:"round"}));p.borderH??=parseInt(p[M].style.borderLeftWidth)+parseInt(p[M].style.borderRightWidth),p.borderV??=parseInt(p[M].style.borderTopWidth)+parseInt(p[M].style.borderBottomWidth)}if("prepare"==o){if("container"==d.type&&"auto"==p.target.style.height&&"done"!==(g.c?.autoParents?.[u]??!1)&&(g.c.autoParents??={},g.c.autoParents[u]??=[],-1==g.c.autoParents[u].indexOf(m)&&g.c.autoParents[u].push(m)),d.border&&(p[M].style.borderColor=d.border.c),p.target.style.zIndex="zone"==d.subtype?d.zIndex&&-1!==d.zIndex?d.zIndex:(g?.zoneIndexes?.[d.id]??100)+1:d.zIndex+("slidebg"==d.subtype?0:1),d.spike&&!SR7.E.backend&&(p.el.style.clipPath=SR7.F.getSpikePath(d.spike)),"normal"!==(d.blend??"normal")&&(p.target.style.mixBlendMode=d.blend),void 0!==d.radius)for(v=0;v<4;v++)void 0!==d.radius[SR7.D.DS[v]]&&(p[M].style[SR7.D.BRAD[v]]=_tpt.unitize(d.radius[SR7.D.DS[v]]));if(p.target.style.position=d.pos.pos,void 0!==p.mask&&void 0!==d.tr&&"slidebg"!==d.subtype&&(p.mask.style.transform="perspective(600px) rotate("+_tpt.unitize(d.tr.rZ??0,"deg")+") rotateY("+_tpt.unitize(d.tr.rY??0,"deg")+") rotateX("+_tpt.unitize(d.tr.rX??0,"deg")+")",p.mask.style.opacity=d.tr.o??1),d.cursor&&(p.target.style.cursor=d.cursor),p.state??="prepared",p.addonWrap&&p.parallax&&(p.parallax.style.visibility="inherit",p.parallax.style.display="block"),(p.addonWrap||p.loop||p.parallax)&&p.mask&&(p.mask.style.visibility="inherit",p.mask.style.display="block"),p.addonWrap&&p.loop&&(p.loop.style.visibility="inherit",p.loop.style.display="block"),"container"==d.type||"text"==d.type||"relative"==d.pos.pos){let e="container"!==d.type&&-1!==d.pid&&"relative"==d.pos.pos;c.style.verticalAlign=e?p.mask&&"shape"==p.type?"top":"inherit":SR7.gV({v:d.vA,id:h,u:0}),p.mask&&(p.mask.style.verticalAlign=e&&"shape"==p.type?"inherit":c.style.verticalAlign)}}p.transferOrigins?.target&&p.el.style.transformOrigin!==p.transferOrigins.target&&(p.el.style.transformOrigin=p.transferOrigins.target.split(" ").slice(0,2).join(" ")),p.loop&&p.transferOrigins?.loop&&p.loop.style.transformOrigin!==p.transferOrigins.loop&&_tpt.gsap.set(p.loop,{transformOrigin:p.transferOrigins.loop}),(d?.vis?.[g.LEV]??1)||"relative"!=d.pos.pos&&"inline-block"!=p.display||(p.display="none"),p.visibility=d?.vis?.[g.LEV]??1?-1!==d.pid&&"zone"!==p.ptype?"inherit":"visible":"hidden","update"!=o||"animated"!=p.state&&"zone"!=p.subtype||(p.target.style.visibility=p.visibility),p.target.style.display=p.display,"container"==d.type&&(SR7.gV({v:d.vis,id:h})??1?p.target.className.includes("sr-force-hidden")&&p.target.classList.remove("sr-force-hidden"):p.target.classList.add("sr-force-hidden")),"linebreak"==p.type&&(p.target.style.clear="both"),"prepare"==o&&"transparent"==(d?.bg?.color??"")&&d?.codes?.css&&(d.codes.css.includes("background")||d.codes.css.includes("background-color"))&&(p.bgByCSS=!0),"el"!==p.LME&&"column"!==d.subtype&&(c.style.width="absolute"==d.pos.pos&&"fullinset"==d.size.cMode&&p.mask||(""+p.target.style.width).includes("%")?"100%":p.target.style.width,c.style.height="absolute"==d.pos.pos&&("fullinset"==d.size.cMode||p.media&&("video"==p.type||"video"==p.subtype)&&"auto"==p.h)&&p.mask||(""+p.target.style.height).includes("%")?"100%":p.target.style.height,c.style.display="block",c.style.visibility="inherit",p.prepared?"animated"==p.state&&(p[p.LME].style.visibility=p.visibility):p[p.LME].style.visibility="hidden",p.conDisplay&&(p[p.LME].style.width="100%")),p.useAsImage?null==p.image?d.bg?.image?.seo||"fullinset"!=d.size.cMode&&!p.w?(p.image="pending",p.imageType="img","relative"==d.pos.pos||"auto"==b&&"auto"==R?f.push(a({layer:d,el:c,c:p,id:h,skey:u})):a({layer:d,el:c,c:p,id:h,skey:u})):(p.image="done",p.imageType="bg",f.push(SR7.F.drawBG(c,{image:d.bg.image,color:d?.bg?.color,overlay:"slidebg"==p.subtype&&g.settings?.bg?.overlay?.type&&!d.bg.overlay?.type?g.settings.bg.overlay:void 0},!0,d.tl&&d.tl.in&&d.tl.in.bg?"canvas":"bg").promise),F&&(p.bgClip="content-box"),"relative"==d.pos.pos||"auto"==b||"auto"==R?f.push(a({layer:d,el:c,c:p,id:h,skey:u},!1)):a({layer:d,el:c,c:p,id:h,skey:u},!1)):d.tl&&d.tl.in&&d.tl.in.bg&&("slidebg"==p.subtype&&g.settings?.bg?.overlay?.type&&!d.bg.overlay?.type&&(d.bg.overlay=g.settings.bg.overlay),f.push(SR7.F.drawBG("row"==d.subtype&&p.con?p.con:"column"==d.subtype&&p.colbg?p.colbg:p.el,d.bg,!0,"canvas").promise)):"video"==d.type||"audio"==d.type||""!==(d.bg?.video?.src??"")?(p.mediaSettings="video"==d.type||"audio"==d.type?d.content:d.bg.video,p.dOverlay||"none"===(d?.overlay?.type??"none")||(p.dOverlay=SR7.F.addOverlay(d.overlay.type,d.overlay.size,d.overlay.cA,d.overlay.cB),p.el.appendChild(p.dOverlay)),p.mediaPosterAdded||(""!==p.mediaSettings?.poster?.src?!p.mediaPoster||"video"!=d.type&&"video"!=d.subtype?"audio"!==d.type&&f.push(SR7.F.drawBG(p.el,{image:{src:p.mediaSettings.poster.src,size:"cover",pos:{x:"50%",y:"50%"}}},!0,"canvas").promise):f.push(SR7.F.drawBG(p.mediaPoster,{image:{src:p.mediaSettings.poster.src,size:d?.bg?.video?.cover??1?"cover":"contain",pos:{x:"50%",y:"50%"}}},!0,"bg").promise):"slidebg"==p.subtype&&f.push(SR7.F.drawBG(p.mediaPoster?p.mediaPoster:p.el,{color:"transparent"},!0,"canvas").promise)),p.mediaPosterAdded=!0,null!=p.media||n?void 0===p.media||void 0===p.media.updateSize||n||p.media.updateSize(c.style.width,c.style.height,p.mediaSettings.cover??1?"cover":"contain"):(_tpt.is_mobile&&!0===(p.mediaSettings.poster?.insteadVideo??!1)?p.mediaContainer.remove():(p.media=new SR7.videoPlayer(p.mediaContainer,p.el,_tpt.extend({type:"audio"==d.type?"audio":p.mediaSettings.type,subtype:d.subtype,width:c.style.width,height:c.style.height,inline:"slidebg"==d.subtype||p.mediaSettings.inline,target:p.target},p.mediaSettings)),f.push(p.media.add())),"relative"==d.pos.pos&&(p.mediaContainer.style.position="relative"))):d.tl&&d.tl.in&&d.tl.in.bg?("slidebg"==p.subtype&&g.settings?.bg?.overlay?.type&&!d.bg.overlay?.type&&(d.bg.overlay=g.settings.bg.overlay),f.push(SR7.F.drawBG("row"==d.subtype&&p.con?p.con:"column"==d.subtype&&p.colbg?p.colbg:p.el,d.bg,!0,"canvas").promise)):(f.push(SR7.F.drawBG("row"==d.subtype&&p.con?p.con:"column"==d.subtype&&p.colbg?p.colbg:p.el,d.bg,x,"bg").promise),null==d.bg.image&&x&&SR7.F.cache(p.cache,"color",["bg"],[d.bg.color])),"svg"==d.type&&null==p.svg&&(p.svg="loading",_tpt.getSVG(d.content.src,(function(e){if(void 0===e||null==e||""==e)return void(p.svg="failed");c.innerHTML=e.innerHTML,p.svg=c.getElementsByTagName("svg")[0],p.svg.innerHTML=p.svg.innerHTML.replaceAll("#SVGID_1_","#SVGID_1_"+p.el.id);let t=p.svg.getElementById("SVGID_1_");t&&(t.id="SVGID_1_"+p.el.id),i(p.svg),SR7.F.positionLayer(r,l),SR7.F.drawSVG(h,d.content,p)})));for(let e in d.addOns)_tpt.hop(d.addOns,e)&&SR7.A?.[e]?.drawLayer&&SR7.A[e].drawLayer(r,o);if(SR7.F.positionLayer(r,l),p.prepared||(g.c.reposLayers??=[],g.c.reposLayers.push(r)),p.prepared="group"!==d.subtype||!n,"update"==o&&"slidebg"!==p.subtype){let e=p.tl[p.animState.scene]?.TL?.time?.();void 0!==e&&p.tl[p.animState.scene].TL.invalidate().render(e,!0,!0)}return f};const i=e=>{const t="svg_"+Math.random().toString(36).substr(2,9)+"_";e.querySelectorAll("[id]").forEach((s=>{const i=s.id,a=t+i;s.id=a,e.querySelectorAll("*").forEach((e=>{["fill","stroke","clip-path","mask","filter","style"].forEach((t=>{if(e.hasAttribute(t)){const s=e.getAttribute(t);if(s?.includes(`url(#${i})`)){const r=s.replace(`url(#${i})`,`url(#${a})`);e.setAttribute(t,r)}}})),["xlink:href","href"].forEach((t=>{if(e.hasAttribute(t)){e.getAttribute(t)===`#${i}`&&e.setAttribute(t,`#${a}`)}}))}))}))};SR7.F.drawSVG=(e,t,s)=>{if(s.svg&&(s.svgPaths??=s.el.querySelectorAll(0==t.all?"path":"path, circle, ellipse, line, polygon, polyline, rect"),!0!==t.oC)){let i=SR7.gV({v:t.color,id:e});s.svgPaths.forEach((function(e){e.style.fill=i})),0==s.svgPaths.length&&(s.el.style.fill=i),void 0!==t.stroke.c&&"transparent"!==t.stroke.c&&(s.svg.style.stroke=t.stroke.c,void 0!==t.stroke.w&&(s.svg.style.strokeWidth=parseInt(t.stroke.w)+"px"),void 0!==t.stroke.o&&(s.svg.style.strokeDashoffset=t.stroke.o),void 0!==t.stroke.d&&(s.svg.style.strokeDasharray=t.stroke.d))}},SR7.F.reposLayers=e=>{if(void 0!==SR7.M[e].c.reposLayers&&SR7.M[e].c.reposLayers.length>0)for(let t of SR7.M[e].c.reposLayers)SR7.F.positionLayer(t);delete SR7.M[e].c.reposLayers,SR7.F.reposContainers(e,SR7.M[e].current.id)},SR7.F.reposContainers=(e,t)=>{if(null==t||-1==t)return;let s=SR7.M[e],i=s.slides[t].layers,a=s.c?.PO?.[t];if(null==a||null==s.zones[t])return;s.zones[t].cache=s.zones[t].all;let r=!1;for(let s in a)if(_tpt.hop(a,s)&&void 0!==i[a[s]]&&"zone"==i[a[s]].subtype){let{c:o}=SR7.F.getLayer({lkey:a[s],skey:t,id:e});o.el.offsetHeight!==o.ch&&void 0!==o.ch&&(r=!0,SR7.F.drawRawLayer(SR7.F.attrId(i[a[s]].attr?.id)??e+"-"+t+"-"+i[a[s]].id,"prepare",t))}r&&requestAnimationFrame((function(){SR7.F.getZoneHeights(e,t)!==s.zones[t].cache&&SR7.F.updateModuleDims(e,!0)}))},SR7.F.positionLayer=function(e,t){var{layer:s,c:i,id:a,skey:r}=e.layer&&e.c&&e.id&&e.skey?e:SR7.F.getLayer(e);t??=r;const o=SR7.M[a];if(i.par=-1!==s.pid?SR7.F.getLayer({id:a,skey:r,lkey:s.pid}).c:"slide"!==s.rTo&&"zone"!==s.subtype?o.dims.CFC?.[t]??o.dims.CFC:"carousel"==o.settings.type?"v"!=o.settings.carousel.type||o.slides[r].slide.global||"slide"!=s.rTo?o.dims.CFC?.[t+"_slide"]??o.dims.CFC?.[t]??o.dims.CFC:o.dims.CFC?.[t+"_full"]??o.dims.CFC:o.settings.fixed&&o.settings.size.fullHeight&&"slide"==s.rTo?{cw:_tpt.winW,ch:_tpt.winH}:o.dims.content,null==i.par)return;let l=i.aspectRatio??1.77777777,n="column"!=s.subtype&&"row"!=s.subtype||!i.con?i.el.offsetWidth-(s.subtype,0):i.con.offsetWidth,d=(i.image||i.media)&&0!==i.cw&&"auto"==i.h?n/l:"column"!=s.subtype&&"row"!=s.subtype||!i.con?i.el.offsetHeight-(s.subtype,0):i.con.offsetHeight,c=!!(0==n&&d>0&&i.image&&"bg"==i.imageType)&&d*l;if(c&&(n=c),"absolute"==s.pos.pos&&"fullinset"==s.size.cMode)i.top=i[i.LME].style.top=SR7.gV({v:s.m.t,id:a,u:0,f:s.fluid.sp,m:"round"})+"px",i.bottom=i[i.LME].style.bottom=SR7.gV({v:s.m.b,id:a,u:0,f:s.fluid.sp,m:"round"})+"px",i.left=i[i.LME].style.left=SR7.gV({v:s.m.l,id:a,u:0,f:s.fluid.sp,m:"round"})+"px",i.right=i[i.LME].style.right=SR7.gV({v:s.m.r,id:a,u:0,f:s.fluid.sp,m:"round"})+"px";else if("absolute"==s.pos.pos&&"row"!==s.subtype&&"column"!==s.subtype){void 0===i.par.el||null!=i.par.cw&&null!=i.par.ch||(i.par.cw=_tpt.posToNum(i.par.w,i.par.el.offsetWidth-("group"==i.ptype?i.par.borderH??i.par.borderH:0)),i.par.ch=_tpt.posToNum(i.par.h,i.par.el.offsetHeight-("group"==i.ptype?i.par.borderV??i.par.borderV:0))),i.par.cw??=i.par.w,i.par.ch??=i.par.h,i.cw="auto"==i.w?n:_tpt.posToNum(i.w,i.par.cw),i.cw=void 0!==i.maw&&"none"!==i.maw&&parseInt(i.maw)<i.cw?parseInt(i.maw):i.cw,i.ch="auto"==i.h?i.useAsImage&&"auto"==i.h&&void 0!==i.image?i.imgHeight*(i.cw/i.imgWidth):d:_tpt.posToNum(i.h,i.par.ch);let e=SR7.gV({v:s.pos.h,id:a}),t=SR7.gV({v:s.pos.v,id:a});i.ox=(i.ignoreParXY?0:i.par.x??0)+("left"==e?0:"right"==e?i.par.cw-i.cw:(i.par.cw-i.cw)/2),i.oy=(i.ignoreParXY?0:i.par.y??0)+("top"==t?0:"bottom"==t?i.par.ch-i.ch:(i.par.ch-i.ch)/2),"group"!=s.subtype||"auto"!=i.w||"right"!=e||"slide"!=s.rTo&&void 0===i.par.el?(void 0!==i.right&&(i.right=i[i.LME].style.right="auto"),i.left=i[i.LME].style.left=i.ox+("right"==e?-1:1)*_tpt.posToNum(SR7.gV({v:s.pos.x,id:a,s:"scale"}),i.par.cw)*(s.fluid?.sp?o.MP:1)+"px"):(i.right=i[i.LME].style.right=_tpt.posToNum(SR7.gV({v:s.pos.x,id:a,s:"scale"}),i.par.cw)*(s.fluid.sp?o.MP:1)+"px",i.left=i[i.LME].style.left="auto"),i.top=i[i.LME].style.top=i.oy+("bottom"==t?-1:1)*_tpt.posToNum(SR7.gV({v:s.pos.y,id:a,s:"scale"}),i.par.ch)*(s.fluid?.sp?o.MP:1)+"px","bg"==i.imageType&&"shape"!==s.type&&(i.el.style.backgroundPosition=e+" "+t)}else i.left=i.el.offsetLeft,i.top=i.el.offsetTop;i.cPos={left:parseInt(i.left)||i.left,top:parseInt(i.top)||i.top},i.cw=n-("group"==i.subtype?i.borderH??0:0),i.ch=d-("group"==i.subtype?i.borderV??0:0),"container"==i.type&&(i.rcw=i.cw-((i._pLeft??0)+(i._pRight??0)+(i.borderH??0)),i.rch=i.ch-((i._pTop??0)+(i._pBottom??0)+(i.borderV??0))),(i.image||i.media)&&0!==i.cw&&"auto"==i.h&&(i.target.style.height=i.cw/l+"px",(i.image||i.media)&&(i.el.style.height=i.cw/l+"px")),i.image&&c&&(i.el.style.width=c+"px"),"column"!=s.subtype||0!==i.cw&&0!=i.ch||void 0===i.par?"row"==s.subtype&&(i.ciw="slide"!==s.rTo?o.dims.CFC?.[t]?.w??o.dims.CFC.w:i.cw):(i.cw=0==i.cw?_tpt.posToNum(i.w,i.par.cw):i.cw,i.ch=0==i.ch?_tpt.posToNum(i.h,i.par.ch):i.ch),SR7.E.backend&&SR7.editor?.elements?.ghost?.build?.(i),0==i.ch&&"auto"==i.h&&"shape"==i.type&&i.global&&(!i.tryReposition||i.tryReposition<3)&&(i.tryReposition??=0,setTimeout((function(){SR7.F.positionLayer(e,t),i.tryReposition++}),19))};let a=(e,t)=>{let{el:s,c:i,src:a,layer:r,skey:o}=e;return new Promise((l=>{if(!a&&!r.bg?.image?.src)return l();_tpt.registerImage(a||r.bg?.image?.src,0,(function(a){if("error"==a.state)SR7.F.positionLayer(e,o),l();else{if(null==a.image)return void l();i.image=a.image?.used?a.image?.cloneNode():a.image,a.image.used=!0,i.imgWidth=a.width,i.imgHeight=a.height,i.aspectRatio=i.imgWidth/i.imgHeight,t?(s.appendChild(i.image),i.image.style.width="100%",i.image.style.height="auto",SR7.F.positionLayer(e,o)):SR7.F.positionLayer(e,o),i.bgClip&&(i.el.style.backgroundClip="content-box"),l()}}),"load_img_in_layer_"+s.id)}))};_tpt.R=_tpt.R||{},_tpt.R.draw=_tpt.extend?_tpt.extend(_tpt.R.draw,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},SR7.E??={},_tpt.idRegistry??={};const tags=["div","a","p","span","sr7-layer","h1","h2","h3","h4","h5","h6","ul","ol","li","label","img","video","audio","iframe","sr7-txt","sr7-video","sr7-audio","sr7-poster","sr7-img","sr7-shape","sr7-button","sr7-bg","sr7-col","sr7-col-bg","sr7-col-bg-mask","sr7-row","sr7-row-con","sr7-col-con","sr7-media","sr7-poster","sr7-ao","sr7-ao-in","sr7-px","sr7-mask","sr7-fxc","sr7-loop","sr7-3dwrap","sr7-3dwrap-bg","sr7-3dwrap-layers"];function openUrlOrScroll(e,t,s){if("#"==e?.link||String(e.link).toLowerCase().includes("mailto:")||String(e.link).toLowerCase().includes("tel:"))return e.link;let i=new URL(window.location.href),a=i.hostname,r=i.pathname.endsWith("/")?i.pathname:i.pathname+"/",o="";switch(e.http){case"auto":default:o=window.location.protocol;break;case"keep":o="";break;case"http":o="http:";break;case"https":o="https:"}let l=e.link&&e.link.indexOf("://")>-1?e.link.split("://")[0]:"";e.link=e.link&&e.link.replace(l+"://","").replace(l+"//","").replace("//","");let n,d,c=e.link;""==c||null==c?c=void 0:c.startsWith("#")?c=window.location.href.split("#")[0]+c:!c.startsWith("/")&&o?c=o+"//"+c:c.startsWith("/")||o?o&&(c=o+"//"+e.link):c="https://"+c;try{n=null==c||""==c?new URL(window.location.href):c.startsWith("/")&&"/"!==c[2]?new URL(c,window.location.href):new URL(c)}catch(e){console.log(e)}try{d=n.pathname.endsWith("/")?n.pathname:n.pathname+"/"}catch(e){console.log(e)}if(s||a!=n.hostname||r!=d){if(s)return n?.href;e.anchor&&(n.hash=e.anchor),window.open(n.href,e.target)}else SR7.F.scrollToId({id:t,offset:e.offset??0,action:e.a,anchor:e.anchor,speed:e.s??1e3,ease:e.e})}void 0===SR7.F.getLayer&&(SR7.F.getLKey=(e,t,s)=>SR7.F.attrId(SR7.M[e].slides[t].layers[s].attr?.id)?SR7.M[e].slides[t].layers[s].attr?.id:e+"-"+t+"-"+s,SR7.F.getLayer=function(e){if(!e)return{id:void 0,skey:void 0,el:void 0,lkey:void 0,layer:void 0};let t,s,i,a,r,o;const l=typeof e;if("object"!==l||void 0!==e.lid){e="object"==l?e.lid:e;for(const l in SR7.M)!t&&_tpt.hop(SR7.M,l)&&SR7.M[l].c.layers&&SR7.M[l].c.layers[SR7.lToK[e]]&&(o=SR7.M[l].c.layers[SR7.lToK[e]],t=o.el,a=o.skey,r=o.lkey,s=SR7.M[l].slides[a].layers[r],i=l)}else{const{id:l,skey:n,lkey:d}=e;s=SR7.M[l]?.slides?.[n]?.layers?.[d]??{},o=SR7.M[l]?.c.layers?.[SR7.lToK[SR7.F.attrId(s.attr?.id)??`${l}-${n}-${d}`]]??void 0,t=o?.el??void 0,a=n,r=d,i=l}return{id:i,skey:a,el:t,lkey:r,layer:s,c:o}},SR7.F.getCarouselLayers=(e,t,s)=>{const i=SR7.M[e],a=[];if(-1!=t&&null!=i.slides[t]){for(let r in i.slides[t].layers){if(!_tpt.hop(i.slides[t].layers,r))continue;let o="slidebg"==i.slides[t].layers[r].subtype||i.slides[t].layers[r].viOC;if("visible"==s&&o||"outfocus"==s&&!o)a.push(r);else if("infocus"==s){let s=i.c.layers[SR7.lToK[`${e}-${t}-${r}`]];void 0!==s&&"in"!==(s.animState?.scene??"")&&a.push(r)}}return a}},SR7.F.getSlideBG=(e,t)=>{let s,i=SR7.M[e].slides[t]?.layers??void 0;if(null!=i){for(let e in i)!s&&_tpt.hop(i,e)&&"slidebg"==i[e].subtype&&(s=i[e]);return s}},SR7.F.resetGlobalLayers=function(e){const t=SR7.M[e];if(t?.slides)for(let s of t.staticSlides)for(let i in t.slides[s].layers){let{c:t}=SR7.F.getLayer({id:e,skey:s,lkey:i});t&&(t.animState={runningFrames:[]},delete t.gpos,delete t.lastEventCalled,delete t.state,t.cache={},t.prepared=!1)}},SR7.F.layerAddonWraps=(e,t)=>{if(!t)return;let s;for(let i in t.addOns){if(!_tpt.hop(t.addOns,i)||!SR7.A?.[i]?.getLayerWraps)continue;const a=SR7.A?.[i]?.getLayerWraps(e,t)??void 0;null!=a&&(s??={},s.wrap??={},s.wrap.class=(null==s.wrap.class?"":s.wrap.class+" ")+a.wrap.class,s.wrap.use=s.wrap.use||a.wrap.use,!1!==(a.innerWrap?.use??!1)&&(s.innerWrap??={},s.innerWrap.class=(null==(s.innerWrap?.class??void 0)?"":s.innerWrap.class+" ")+(a.innerWrap?.class??""),s.innerWrap.use=s.innerWrap.use||(a.innerWrap?.use??!1)))}return s},SR7.F.prepareLayerAddon=async(e,t,s,i)=>{if(null==SR7.A||!t)return;let a=[];for(let r in SR7.A){if(!_tpt.hop(SR7.A,r)||!SR7.A?.[r]?.prepareLayer)continue;const o=await(SR7.A?.[r]?.prepareLayer(e,t,s,i))??void 0;null!=o&&(Array.isArray(o)?a.push(...o):a.push(o))}return a},SR7.F.prepareLayer=async(e,t,s,i,a,r,o,l,n,d,c)=>{let p=SR7.M[e];const h=(!t?.vis||t.vis?.[p.LEV])&&("c"==(t.tl?.in?.content?.all?.[1]?.fx??!1)[0]||"c"==(t.tl?.out?.content?.all?.[0]?.fx??!1)[0]);let u=e+"-"+s+"-"+t.id,m=0==String(t.attr?.id??"").length?u:t.attr.id,g=SR7.D.hasActionLike(e,s,i,"link");const f=`${_tpt.mText(t.attr?.class??"")} ${"row"==t.subtype&&"slide"!==t.rTo?"sr7-galign":""} ${t.attr?.iClass??""} ${"video"!=t.type&&"video"!=t.subtype||g||!t.content?.noInteract?"":"nointeraction"}`;let v,y=p.c.layers;y[m]&&(m=t.attr.id+="_DBL_"+Math.round(9999*Math.random())),"slidebg"==t.subtype&&(p.c.slideBGs[s]={lid:m,lkey:i}),"slidebg"==t.subtype&&p.migrate?(v=document.getElementById(e+"-"+s+"-slidebg"),null!==v&&(v.id=m)):v=document.getElementById(m),g=!1!==g&&"a"==g.ltype&&g,void 0!==t.tag&&(t.tag=-1==tags.indexOf(t.tag)?"sr7-layer":t.tag);const S=g?"a":"slidebg"==t.subtype?"sr7-bg":"column"==t.subtype?"sr7-col":"sr7-layer"==t.tag||null==t.tag?SR7.D.tagLib[""!==t.subtype&&void 0!==t.subtype?t.subtype:t.type]:t.tag;v&&v.tagName.toLowerCase()!==S.toLowerCase()&&(v.parentElement.removeChild(v),v=void 0),t.codes?.css&&t.codes.css,"container"!==t.type&&v?(v.parentElement.removeChild(v),v.className=_tpt.mText(v.className,f),l.fragment.appendChild(v),"text"==t.type&&p.fromStream&&null==v.getAttribute("srscsrc")&&(v.innerHTML=SR7.F.updateDynamicMetas(e,o.slide.order,_tpt.lineBreaks(t.content.text,SR7.gV({v:t.ws,id:e}))))):(v=l.add({tag:S,class:f,id:m}),"text"==t.type&&(f.includes("sr7-brg")||(t.content.text=_tpt.lineBreaks(t.content.text,SR7.gV({v:t.ws,id:e}))),v.innerHTML=p.fromStream?SR7.F.updateDynamicMetas(e,o.slide.order,t.content.text):t.content.text)),p.hasTouchSwipe&&(SR7.D.hasActionLike(e,s,i,"simulate")||SR7.D.hasActionLike(e,s,i,"click"))&&(v.dataset.clickable="true"),g&&(g?.shrlink?_tpt.checkResources(["sharing"]).then((()=>{SR7.A?.sharing?.postProcessLayer&&SR7.A.sharing.postProcessLayer(e,t,y[m],s)})):(v.href=p.fromStream?SR7.F.updateDynamicMetas(e,o.slide.order,g.link):openUrlOrScroll(g,e,!0),v.target=g.target,"nofollow"==g.flw&&(v.rel="nofollow"),"_blank"==g.target&&(v.rel=(v.rel??"")+(void 0!==v.rel&&v.rel.length>0?" ":"")+"noopener"))),t.viSH&&(p.c.viSH??={},p.c.viSH.el??=[],p.c.viSH.el.push(m)),!v.className.includes("sr7-layer")&&v.classList.add("sr7-layer"),y[m]={el:v,mid:e,skey:s,lkey:i,oflow:t.oflow,cache:{},tl:{},listeners:{hover:!1!==(t.hov?.u??!1),action:void 0!==t.listen&&t.listen.length>0&&_tpt.tEvt(t.listen),aCache:{}},type:t.type,subtype:t.subtype,animState:{runningFrames:[]},ignoreParXY:"carousel"==p.settings.type&&"v"==p.settings?.carousel?.type&&"slide"==t.rTo},SR7.lToK[u]=m,u!==m&&(SR7.lToK[m]=m),"row"==t.subtype&&(p.zoneIndexes[t.pid]=null==p.zoneIndexes[t.pid]||p.zoneIndexes[t.pid]<t.zIndex?t.zIndex:p.zoneIndexes[t.pid]),t.pE=y[m].pE="default"==t.uS&&p.settings.uS||"true"==String(t.uS)?"auto":"none"==t.pE||"text"!==t.type&&p.settings.fixed&&!y[m].listeners.hover&&!y[m].listeners.action&&"auto"==t.pE?"none":t.pE,"none"==y[m].pE&&(v.style.pointerEvents="none"),p.settings?.acc?.use&&"false"==String(t?.acc?.hidden??"true")?(v.setAttribute("aria-hidden",!1),v.setAttribute("tabindex",0),"unset"!==String(t?.acc?.label).toLowerCase()&&String(t?.acc?.label).length>0&&v.setAttribute("aria-label",t?.acc?.label),"unset"!==String(t?.acc?.role).toLowerCase()&&String(t?.acc?.role).length>0&&v.setAttribute("role",t?.acc?.role),"unset"!==String(t?.acc?.haspopup).toLowerCase()&&String(t?.acc?.haspopup).length>0&&v.setAttribute("aria-haspopup",t?.acc?.haspopup),"unset"!==String(t?.acc?.labeledby).toLowerCase()&&String(t?.acc?.labeledby).length>0&&v.setAttribute("aria-labeledby",t?.acc?.labeledby)):v.setAttribute("aria-hidden",!0),t.content?.fromStream&&p.stream&&(t.content.src=SR7.F.getFeed(p,o.slide.order,"media"),t.content.src&&-1===t.content.src.indexOf("video_dashinit.mp4")||(t.content.src=SR7.F.getFeed(p,o.slide.order,"thumb")),t.content.crossOrigin="youtube"!==(SR7.M.settings?.source?.type??""),t.content?.poster?.fromStream&&(t.content.poster.src=SR7.F.getFeed(p,o.slide.order,"thumb"))),t.bg?.image?.fromStream&&p.stream&&(t.bg.image.crossOrigin="youtube"!==(SR7.M.settings?.source?.type??""),t.bg.image.src=SR7.F.getFeed(p,o.slide.order,"image",void 0,void 0,t.bg.image.src)),t.bg?.video?.fromStream&&p.stream&&(t.bg.video.src=SR7.F.getFeed(p,o.slide.order,"media"),t.bg.video.poster.fromStream&&(t.bg.video.poster.src=SR7.F.getFeed(p,o.slide.order,"thumb"))),"video"!=t.type&&"audio"!=t.type&&""===(t.bg?.video?.src??"")||(v.appendChild(y[m].mediaContainer=l.add({tag:"sr7-media",class:"sr7-media",id:m+("audio"==t.type?"_audio":"_video")})),"audio"===t.type||""===(t.bg?.video?.poster?.src??"")&&""===(t.content?.poster?.src??"")||v.appendChild(y[m].mediaPoster=l.add({tag:"sr7-poster",class:"sr7-poster",id:m+"_poster"}))),o.slide.global&&(y[m].global=!0,t.sStart=parseInt(t.sStart??1),t.sEnd=parseInt(t.sEnd??p.len)||p.len,void 0!==t.sZ&&"default"!==t.sZ&&t.sZ!==o.slide.pos&&-1==t.pid&&d.push(m)),y[m].addOns=SR7.F.layerAddonWraps(e,t);let b,R=await SR7.F.prepareLayerAddon(e,t,m,s);void 0!==R&&a.push(...R);let w=SR7.F.checkWrap(t.tl,"mask")||(t.hov?.m??!1);!w&&h&&(w=h,y[m].maskForFx=!0);let x,F,_,M=""!==(t?.attr?.wrapClass??"")||""!==(t?.attr?.wrapId??"")||"slidebg"==t.subtype,k=SR7.F.checkWrap(t.tl,"loop");y[m].transferOrigins={target:t.tl?.in?.content?.orig?(t.tl.in.content.orig.x??"50%")+" "+(t.tl.in.content.orig.y??"50%")+" "+(_tpt.unitize(t.tl.in.content.orig.z)??"50%"):void 0,loop:k&&(t.tl?.in?.loop?.orig?(t.tl.in.loop.orig.x??"50%")+" "+(t.tl.in.loop.orig.y??"50%")+" "+(_tpt.unitize(t.tl.in.loop.orig.z)??"50%"):void 0)},y[m].mod=SR7.F.modify.prepare(t.mod,e),y[m].mod&&(p.c.mod??={},p.c.mod[s]??=[],p.c.mod[s].push(m),w=w||(t.mod?.mask??!1)),(void 0!==t.tr&&(void 0!==t.tr.rX&&0!==parseInt(t.tr.rX)||void 0!==t.tr.rY&&0!==parseInt(t.tr.rY)||void 0!==t.tr.rZ&&0!==parseInt(t.tr.rZ)||void 0!==t.tr.o&&1!==t.tr.o)||w||M)&&(x=y[m].mask=l.add({tag:"sr7-mask",class:t.attr.wrapClass??"",id:t.attr.wrapId??""}),w&&!y[m].maskForFx?y[m].oflow="hidden":M&&(y[m].oflow="visible"),w=!0,h&&(y[m].fxc=l.add({tag:"sr7-fxc"}),y[m].mask.append(y[m].fxc))),k&&(F=y[m].loop=l.add({tag:"sr7-loop"})),"container"==t.type?b=k||w||SR7.F.checkMargin(t.m):"text"==t.type&&!1!==(t.tog?.u??!1)&&(y[m].listeners.toggle=!0,y[m].tog={state:!1,toggled:t.tog.i?t.content.text:_tpt.lineBreaks(t.tog.t,SR7.gV({v:t.ws,id:e}))},t.tog.i&&(v.innerHTML=_tpt.lineBreaks(t.tog.t,SR7.gV({v:t.ws,id:e}))));const C=y[m].addonWrap=y[m].addOns?.wrap?.use?l.add({tag:"sr7-ao",class:y[m].addOns.wrap.class}):void 0,L=y[m].addonInnerWrap=y[m].addOns?.innerWrap?.use?l.add({tag:"sr7-ao-in",class:y[m].addOns.innerWrap.class}):void 0;let E=(t?.mod?.s?.u||t?.mod?.m?.u)&&!t.mod.mask;if(E&&(_=y[m].parallax=l.add({tag:"sr7-px"})),"row"==t.subtype&&("slide"!==t.rTo||E||k||w||b)||"column"==t.subtype&&(E||k||w||b)){const e=y[m].con=l.add({tag:"sr7-"+("row"==t.subtype?"row":"col")+"-con"}),s=y[m].el;s.appendChild(C||(L||(E?_:k?F:w?x:e))),C&&C.appendChild(L||(E?_:k?F:w?x:e)),L&&L.appendChild(E?_:k?F:w?x:e),E&&_.appendChild(k?F:w?x:e),k&&F.appendChild(w?x:e),w&&x.appendChild(e),"column"==t.subtype&&(y[m].colbg=l.add({tag:"sr7-col-bg"}),w?(y[m].colbgMask=l.add({tag:"sr7-col-bg-mask"}),y[m].colbgMask.appendChild(y[m].colbg),E?_.appendChild(y[m].colbgMask):s.appendChild(y[m].colbgMask)):E?_.appendChild(y[m].colbg):s.appendChild(y[m].colbg))}else(C||E||k||w)&&(v.parentNode.insertBefore(C||(L||(E?_:k?F:x)),v),C&&C.appendChild(L||(E?_:k?F:w?x:v)),L&&L.appendChild(E?_:k?F:w?x:v),E&&_.appendChild(k?F:w?x:v),k&&F.appendChild(w?x:v),w&&x.appendChild(v));void 0!==S&&"SR7"!==S.slice(0,3)&&(v.dataset.type=t.type,void 0!==t.subtype&&""!==t.subtype&&(v.dataset.subtype=t.subtype));var O=SR7.F.drawRawLayer(m,"prepare",s,r);if(O.length>0)for(let e in O)_tpt.hop(O,e)&&void 0!==O[e]&&a.push(O[e]);return"zone"==t.subtype?(p.zones[s].zones??={},p.zones[s].zones[m]=0):"slidebg"==t.subtype&&p.settings.mod?.d3&&(c={el:y[m].parallax?y[m].parallax:y[m].loop?y[m].loop:y[m].mask?y[m].mask:y[m].el,use:t.mod?.m?.u??!1}),p.settings.mod?.d3&&t.mod?.m?.aBG&&(p.c.d3tobg??={},p.c.d3tobg[s]??=[],p.c.d3tobg[s].push(y[m])),"none"!==(t.mF??"none")&&(a.push(_tpt.checkResources(["cssfilters"])),v.classList.add(t.mF)),"none"==t.pE&&_&&(_.style.pointerEvents="none"),"none"==t.pE&&F&&(F.style.pointerEvents="none"),{globalLowLayers:d,buildLayers:l,promises:a,d3tobg:c}},SR7.F.prepareLayers=async(e,t,s)=>{const i=SR7.M[e],a=i.slides[t];if(i?.layersPrepared?.[t])return;let r,o=[],{layers:l}=a,n=_tpt.collector(),d=SR7.F.setLayerProcOrder(e,t);i.hasTouchSwipe??="carousel"==i.settings.type||_tpt.is_mobile||"off"!==String(i.settings.nav?.s?.use)&&"false"!==String(i.settings.nav?.s?.use)&&i.settings.nav?.s?.desk,i.c.layers??={},SR7.lToK??={},i.c.slideBGs??={};let c=i.c.layers,p=[];i.zoneIndexes??={};for(let i in d){if(!_tpt.hop(d,i)||null==l[d[i]])continue;({globalLowLayers:p,buildLayers:n,promises:o,d3tobg:r}=await SR7.F.prepareLayer(e,l[d[i]],t,d[i],o,s,a,n,"",p,r));const h=l[d[i]].id;if("-1"===String(l[h].pid))continue;const u=c[SR7.F.getLKey(e,t,h)],m=c[SR7.F.getLKey(e,t,l[h].pid)];m[null==m.con?"el":"con"].appendChild("column"==l[h].subtype||"row"==l[h].subtype?u.el:u.addonWrap?u.addonWrap:u.parallax?u.parallax:u.loop?u.loop:u.mask?u.mask:u.el),u.ptype=m.subtype}if(i.settings.mod?.d3){if(i.c.d3??={},i.c.d3[t]??={},i.c.d3[t].layers=_tpt.addContainer({tag:"sr7-3dwrap",class:"sr7-3dwrap-layers"}),n.append(i.c.d3[t].layers),r){let e=_tpt.addContainer({tag:"sr7-3dwrap",class:"sr7-3dwrap-bg"+(r.use?"":"-no-3d")});if(e.appendChild(r.el),i.c.d3tobg?.[t]?.length>0)for(let s of i.c.d3tobg[t])e.appendChild(s.el);n.append(e),r.use&&(i.c.d3[t].bg=e),i.c.slides[t].appendChild(e)}i.c.slides[t].appendChild(i.c.d3[t].layers)}else n.append(i.c.slides[t]);for(let s in d){if(!_tpt.hop(d,s))continue;const i=l[d[s]],a=SR7.F.attrId(i.attr?.id)??e+"-"+t+"-"+i.id;for(let s in i.addOns)_tpt.hop(i.addOns,s)&&SR7.A?.[s]?.postProcessLayer&&SR7.A[s].postProcessLayer(e,i,c[a],t)}if(i.layersPrepared??={},i.layersPrepared[t]=!0,a.slide.global)for(const e of p)i.c.slides[t+"_2"].appendChild("column"==c[e].subtype||"row"==c[e].subtype?c[e].el:c[e].addonWrap?c[e].addonWrap:c[e].parallax?c[e].parallax:c[e].loop?c[e].loop:c[e].mask?c[e].mask:c[e].el);return _tpt.injectCssJs("",void 0,void 0,e+"_"+t+"_layerstyles"),_tpt.R.fonts&&!SR7.M[e].c.waitingOnFont&&(_tpt.waitFonts(_tpt.R.fonts.required,(function(){SR7.F.updateModuleDims(e,!0,!0)}),e),SR7.M[e].c.waitingOnFont=!0),Promise.all(o)},SR7.F.getSlideBGSource=(e,t)=>{const{bg:s}=SR7.M[e].slides[t].layers[SR7.M[e].c.slideBGs[t].lkey];return s?.image?.src??s?.video?.poster?.src??void 0},SR7.F.setLayerProcOrder=(e,t)=>{if(void 0===t||-1===t)return;const s=SR7.M[e];s.c.PO??={};const i=s.slides[t],{layers:a}=i,r=s.c.PO[t]??=[],o={};Object.keys(a).forEach((e=>{const t=a[e],s=String(t.pid);o[s]||(o[s]=[]),o[s].push(t)}));const l=e=>{const t=o[e]??[];t.sort(((e,t)=>(void 0!==e.order?e.order:e.zIndex)-(void 0!==t.order?t.order:t.zIndex)));for(const e of t)if(r.push(e.id),"container"===e.type&&o[e.id]){o[e.id].sort(((e,t)=>{if("relative"===e.pos.pos&&"relative"!==t.pos.pos)return-1;if("relative"!==e.pos.pos&&"relative"===t.pos.pos)return 1;return(void 0!==e.order?e.order:e.zIndex)-(void 0!==t.order?t.order:t.zIndex)})),l(e.id)}};return l("-1"),r},SR7.F.layerListener=(e,t,s,i,a,r)=>{if(void 0!==s&&!1!==s){let s;for(let o of t)s=_tpt.tEvt(o),e.listeners[s]??=_tpt.event.listen(e.el,s,SR7.F.layerMouse,e,r),a&&(e.listeners.callbacks??={},e.listeners.callbacks[s]??={},e.listeners.callbacks[s][i]=a)}else{let s;for(let i of t)s=_tpt.tEvt(i),_tpt.event.rm(e.el,e.listeners[s]),delete e.listeners[s]}return _tpt.event.hasListener(e.el)},SR7.F.manageLayerListeners=(e,t,s,i,a,r)=>{e.listeners.hover&&(e.listeners.hasAny=SR7.F.layerListener(e,_tpt.is_mobile?["touchstart","touchend","touchmove"]:["mousemove","mouseleave","mouseenter"],s)),e.listeners.toggle&&(e.listeners.hasAny=SR7.F.layerListener(e,["click"],s)),void 0!==t&&void 0!==e.listeners.action&&!1!==e.listeners.action&&(e.listeners.hasAny=SR7.F.layerListener(e,_tpt.tEvt(t.listen),s)),void 0!==i&&!1!==e.listeners[i]&&(e.listeners.hasAny=SR7.F.layerListener(e,a,s,i,r)),void 0===e.media||"slidebg"===e.subtype||t?.content?.noInteract||t.bg?.video?.noInteract||(e.media.player.options.controls??"").includes("s")&&!e.media.player.options.canHide||(e.listeners.hasAny=SR7.F.layerListener(e,["click"],s))},SR7.F.layerMouse=(e,t)=>{let s=_tpt.tEvt(e.type);if("mouseenter"==s||"touchstart"==s||"mousemove"==s||"touchmove"==s?t.listeners.hover&&SR7.F.processHover(SR7.F.getLayer(t.el.id),"hover"):"mouseleave"==s||"touchend"==s?t.listeners.hover&&SR7.F.processHover(SR7.F.getLayer(t.el.id),"idle"):"click"==s&&(t.listeners.toggle&&SR7.F.toggleLayer(SR7.F.getLayer(t.el.id)),void 0===t.media||(t.media.player.options.controls??"").includes("s")&&!t.media.isHidden()||t.media.toggle()),"touchend"===s){let t=e.touches[0]||e.changedTouches[0];e.target!==document.elementFromPoint(t.clientX,t.clientY)&&(s="mouseleave")}if(t.listeners.action&&t.listeners.action.indexOf(s)>=0&&SR7.F.processActions(s,t),t.listeners.callbacks?.[s])for(let i in t.listeners.callbacks[s])_tpt.hop(t.listeners.callbacks[s],i)&&t.listeners.callbacks[s][i](t.mid,e,t)},SR7.F.processActions=(e,t)=>{const{id:s,skey:i}=SR7.F.getLayer(t.el.id),a=String(t.lkey);let r=_tpt.tEvt(e);const o=_tpt.tEvt("mouseleave"==r||"touchend"==r?"mouseenter":"mouseenter"==r||"touchstart"==r?"mouseleave":"click");if(t.delayedAction??={},null!=SR7.M[s].slides[i].slide.actions){if(t.listeners.aCache[r]??=SR7.M[s].slides[i].slide.actions.filter((e=>e.src.some((e=>String(e)===a))&&_tpt.tEvt(e.evt)==r)),t.delayedAction[o])for(let e of t.delayedAction[o])void 0!==e&&void 0!==e.kill&&e.kill();t.delayedAction[o]=[],t.delayedAction[r]=[];for(let e in t.listeners.aCache[r])if(_tpt.hop(t.listeners.aCache[r],e)){let a=t.listeners.aCache[r][e];if(!SR7.F.shouldUpdate(t,a.rd,a.a))continue;if(!t.animState?.stageState)continue;t.delayedAction[r].push(_tpt.gsap.delayedCall(parseInt(a.d??0)/1e3,SR7.F.actionCall,[s,i,a,t.el]))}}},SR7.F.updateAllTogglePrgLayers=e=>{requestAnimationFrame((function(){let t=SR7.M[e];for(let s in t.slides)if(_tpt.hop(t.slides,s)&&null!=(t.slides?.[s]?.slide?.actions??void 0)&&0!=t.slides[s].slide.actions.length)for(let i of t.slides[s].slide.actions)if("togglePrg"==i.a)for(let a of i.src){let i=SR7.F.getLayer({skey:s,lkey:a,id:e});i.c&&i.layer&&SR7.F.toggleLayer(i,"paused"==(t.slideShow?.state??"playing"))}}))},SR7.F.actionCall=(id,skey,action,el)=>{const M=SR7.M[id];switch(M.states.actions??={},M.states.debounceTimers??=new Map,action.a){case"playScene":if(null==action.target)return;for(let e of action.target){let[t,s]=String(e).includes(":")?String(e).split(":"):[skey,e];M.states.debounceTimers.has(t+"_"+s)&&clearTimeout(M.states.debounceTimers.get(t+"_"+s)),M.states.debounceTimers.set(t+"_"+s,setTimeout((()=>{SR7.F.animateLayers({id:id,skey:t,layers:[s],scene:action.sc,reset:action.rec,caller:"action"}),M.states.debounceTimers.delete(t+"_"+s)}),19))}break;case"toggleScenes":if(action.target)for(let e of action.target){let[t,s]=String(e).includes(":")?String(e).split(":"):[skey,e];M.states.debounceTimers.has(t+"_"+s)&&clearTimeout(M.states.debounceTimers.get(t+"_"+s)),M.states.debounceTimers.set(t+"_"+s,setTimeout((()=>{M.states.actions[skey]??={},SR7.F.shouldUpdate(M.states.actions[skey],31,s)&&SR7.F.animateLayers({id:id,skey:t,layers:[s],scene:(M.c.layers[SR7.lToK[id+"-"+t+"-"+s]]?.animState?.scene??"")==action.scn?action.scm:action.scn,reset:action.rec,caller:"action"}),M.states.debounceTimers.delete(t+"_"+s)}),19))}break;case"callSlide":SR7.F.requestSlide({id:id,slide:"first"==action.target?"#"+M.navSlideOrder[0]:"last"==action.target?"#"+M.navSlideOrder[M.len-1]:"random"==action.target?Math.round(Math.random()*M.navLen+1):"#"+(Array.isArray(action.target)?action.target[0]:action.target)});break;case"pause":SR7.slideShow.pause(id);break;case"resume":SR7.slideShow.resume(id);break;case"togglePrg":SR7.slideShow["paused"==(M.slideShow?.state??"nothing")?"resume":"pause"](id);break;case"prev":SR7.F.requestSlide({id:id,slide:"-1"});break;case"next":SR7.F.requestSlide({id:id,slide:"+1"});break;case"toggleClass":for(let e of action.target){let t=M.c.layers[SR7.lToK[id+"-"+skey+"-"+e]].el;t.classList[t.className.includes(action.class)?"remove":"add"](action.class)}break;case"simulate":if(SR7.M[id].c?.swipeAble&&SR7.M[id].c.swipeAble.length)for(let e of SR7.M[id].c.swipeAble)e.disable();for(let e of action.target)M.c.layers[SR7.lToK[id+"-"+skey+"-"+e]??SR7.lToK[id+"-"+e]].el.dispatchEvent(new Event(action.typ,{bubbles:!0}));if(SR7.M[id].c?.swipeAble&&SR7.M[id].c.swipeAble.length)for(let e of SR7.M[id].c.swipeAble)e.enable();break;case"menu":case"link":("a"!==action.ltype||""!==action.anchor&&void 0!==action.anchor)&&openUrlOrScroll(action,id);break;case"callback":eval(action.target);break;case"scroll":SR7.F.scrollToId({id:id,offset:action.offset,action:action.a,anchor:action.target,speed:action.s??1e3,ease:action.e});break;case"scrollbelow":SR7.F.scrollToId({id:id,offset:action.offset,action:action.a,speed:action.s??1e3,ease:action.e});break;case"getAccelerationPermission":_tpt.getAccelerationPermission(id);break;case"open_modal":String(action.msl).includes("rs-")&&SR7?.D?.fixSR6IDs&&(action.msl="#"+SR7.D.fixSR6IDs(action.msl.replace("rs-",""))),SR7.F.modal.open(action.target,action.msl??0);break;case"close_modal":SR7.F.modal.close();break;case"mute_video":case"unmute_video":case"toggle_mute_video":for(let e of action.target){let[t,s]=String(e).includes(":")?String(e).split(":"):[skey,e];if("backgroundvideo"==s&&(s=SR7.F.getSlideBG(id,t).id),M.c.layers[SR7.lToK[id+"-"+t+"-"+s]].media){let e=M.c.layers[SR7.lToK[id+"-"+t+"-"+s]].media,i="audio"==e?.player?.options?.type,a="mute_video"==action.a?"mute":"unmute_video"==action.a||(null==e.player.muted?e.player.player.muted:e.player.muted)||i&&e.player.player.paused?"unmute":"mute";i&&"unmute"==a&&e.play(),e[a]()}}break;case"toggle_video":case"stop_video":case"start_video":for(let e of action.target){let[t,s]=String(e).includes(":")?String(e).split(":"):[skey,e];if("backgroundvideo"==s&&(s=SR7.F.getSlideBG(id,t).id),M.c.layers[SR7.lToK[id+"-"+t+"-"+s]].media){let e=M.c.layers[SR7.lToK[id+"-"+t+"-"+s]].media.player.lastPlayerState;e="start_video"==action.a?"play":"stop_video"==action.a||1==e?"pause":"play",M.c.layers[SR7.lToK[id+"-"+t+"-"+s]].media[e]()}}break;case"exitfullscreen":case"togglefullscreen":case"gofullscreen":SR7.F.module.fullScreen(id,"gofullscreen"==action.a||"togglefullscreen"==action.a&&!M.states.inFullscreen);break;default:for(let e of action.target){e=""+e;let[t,s]=String(e).includes(":")?String(e).split(":"):[skey,e];_tpt.event.trigger("dom","sr.layer.action",{id:id,action:action,scene:action.sc,skey:t,lkey:s,eventtype:action.a})}}},SR7.F.shouldUpdate=(e,t=0,s)=>{if(!t||0==t)return!0;t=parseInt(t),e.timeStamps??={};const i=(new Date).getTime(),a=e.timeStamps[s]?i-e.timeStamps[s]:t+100;return a>t&&(e.timeStamps[s]=i),a>t},SR7.F.toggleLayer=(e,t)=>{let{c:s,skey:i}=e;null!=s.tog&&(s.tog.default??=s.el.innerHTML,s.el.innerHTML=!0===t?s.tog.default:!1===t?s.tog.toggled:s.tog.state?s.tog.default:s.tog.toggled,s.tog.state=1==t||!1!==t&&!s.tog.state,SR7.F.positionLayer(e,i))},SR7.F.showHideLayersOnHover=(e,t)=>{let s="hide"==t||"mouseleave"==t.type?"add":"remove";SR7.M[e].c.viSH.el.forEach((t=>{SR7.M[e].c.layers[SR7.lToK[t]].el.classList[s]("sr7--hidden")}))},_tpt.R??={},_tpt.R.layer=_tpt.extend?_tpt.extend(_tpt.R.layer,{status:2,version:"1.0"}):{status:2,version:"1.0"})}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},SR7.E??={},!SR7.loadVideoAPI){SR7.loadVideoAPI=e=>new Promise(((t,s)=>{if("html5"===e||"audio"===e)return void t();const i={youtube:{globalObjectName:"YT",playerObjectName:"Player",scriptSrc:"https://www.youtube.com/iframe_api"},vimeo:{globalObjectName:"Vimeo",playerObjectName:"Player",scriptSrc:"https://player.vimeo.com/api/player.js"}}[e];if(!i)return void s(new Error('Invalid API name. Please use "youtube" or "vimeo"'));const a=()=>window[i.globalObjectName]&&window[i.globalObjectName][i.playerObjectName],r=Array.from(document.getElementsByTagName("script")).find((e=>e.src===i.scriptSrc));if(a())t();else{if(r){const e=setInterval((()=>{a()&&(t(),clearInterval(e))}),50);return}{const r=document.createElement("script");r.src=i.scriptSrc,r.onload=()=>{const e=setInterval((()=>{a()&&(t(),clearInterval(e))}),50)},r.onerror=()=>s(new Error(`Failed to load ${e} API`)),document.head.appendChild(r)}}}));class e{states={unstarted:-1,ended:0,playing:1,paused:2,buffering:3,cued:4};constructor(e,t,s){let{id:i,skey:a,lkey:r}=SR7.F.getLayer(t.id);this.el=t,this.id=i,this.skey=a,this.container=e,this.containerId=e.id,this.options=s,this.player=null,this.aspectRatio=_tpt.getRatio(this.options.ratio),this.options.loop=s.loop||!1,this.options.start=parseInt(this.convertSec(s.start)),this.options.end=parseInt(this.convertSec(s.end)),this.state=null,this.type=s.type,this.requestedAction=null,this.listeners={},this.options.canHide=!_tpt.is_mobile&&1==(this.options.poster?.showOnPause??void 0)||_tpt.is_mobile&&!0!==(this.options.poster?.noOnMobile??!1)&&1==(this.options.poster?.showOnPause??void 0)}convertSec(e){return""==e?0:null==e?-1:_tpt.isNumeric(e)?e:e.split(":").length>1?60*parseInt(e.split(":")[0],0)+parseInt(e.split(":")[1],0):e}async waitForContainer(e){let t=0;return new Promise(((s,i)=>{let a=document.getElementById(e);if(a)return void s(a);const r=setInterval((()=>{let a=document.getElementById(e);a?(clearInterval(r),s(a)):t>=100&&(clearInterval(r),i(new Error("Container element not found within the timeout period."))),t+=19}),19)}))}showHide(){if(null==this.lastPlayerState)this.options.canHide&&_tpt.gsap.set(this.container,{opacity:0,pointerEvents:"none"}),this.hidden=!0;else if(this.lastPlayerState==this.states.playing){if(this.pauseBy=null,this.container.style.opacity<1){let e=(new Date).getTime()-(this.frameStart??0);_tpt.gsap.to(this.container,e<500?0:.5,{opacity:1,pointerEvents:(this.options.controls??"").includes("s")?"auto":"none"}),this.hidden=!1}}else this.lastPlayerState!=this.states.paused&&this.lastPlayerState!=this.states.ended||this.options.canHide&&"scroll"!==this.pauseBy&&(_tpt.gsap.to(this.container,.5,{opacity:0,pointerEvents:"none"}),this.hidden=!0);"none"==this.options.controls&&this.canvas&&(this.canvas.wrap.style.pointerEvents="none")}isHidden(){return this.hidden}isPlaying(){return this.lastPlayerState==this.states.playing}toggle(){this.player&&(this.lastPlayerState==this.states.playing?this.pause():this.play())}hasEvent(e){return this.listeners[e]}removeEvent(e){this.listeners[e]&&delete this.listeners[e]}playingList(e,t){null!=t&&(SR7.M[t.id].videosPlaying??={},"add"===e?SR7.M[t.id].videosPlaying[t.containerId]=t:"remove"==e&&delete SR7.M[t.id].videosPlaying[t.containerId])}stopPlayingMedias(){if(null!=SR7.M[this.id].videosPlaying)for(let e in SR7.M[this.id].videosPlaying)_tpt.hop(SR7.M[this.id].videosPlaying,e)&&e!==this.containerId&&SR7.M[this.id].videosPlaying[e].pause()}dispatch(e,t){if(!this.listeners)return;const s=this.listeners[e];s&&s.callback(t,s.params)}async ensureReadyAndExecute(e,t,s){this.requestedAction=t;let i=this.requestedAction;this.playerReady?this.readyEventWaitAdded&&this.removeEvent("ready"):await new Promise((e=>{this.readyEventWaitAdded=!0,this.readyListenerID=this.addEvent("ready",e)})),i===this.requestedAction&&e.call(this,s)}}class t extends e{async add(){await SR7.loadVideoAPI("youtube");try{await this.waitForContainer(this.containerId)}catch(e){return void console.error(e)}this.player=new YT.Player(this.containerId,{host:SR7.E.ytnc?"https://www.youtube-nocookie.com":"https://www.youtube.com",height:_tpt.unitize(this.options.height,"px"),width:_tpt.unitize(this.options.width,"px"),videoId:this.options.src,playerVars:{origin:window.location.origin,playsinline:this.options.inline,enablejsapi:1,controls:(this.options.controls??"").includes("s")?1:0,showinfo:0,modestbranding:1,wmode:"opaque",muted:this.options.mute,html5:1,start:this.options.start,end:this.options.end,loop:this.options.loop?1:0,rel:0},events:{onReady:e=>{this.playerReady=!0,this.player.setVolume(this.options.volume),this.updateSize(this.options.width,this.options.height),this.dispatch("ready",e)}}}),this.addEvent(),this.container=document.getElementById(this.containerId),this.container.style.borderRadius=this.container.parentElement.style?.borderRadius,this.muted=this.options.mute,this.showHide()}rewind(e){this.player&&this.player.seekTo&&(this.player.seekTo(this.options.start,!0),"pause"!=this.requestedAction&&"pause"!=e||this.pause())}remove(){this.player&&(this.player.destroy(),this.player=null)}mute(){this.player&&(this.player.mute(),this.player.muted=this.muted=!0)}unmute(){this.player&&(this.player.unMute(),this.player.muted=this.muted=!1)}async play(){this.player&&await this.ensureReadyAndExecute((async()=>{this.player.playVideo(),await new Promise((e=>setTimeout(e,1e3))),1!==this.player.getPlayerState()&&(this.player.mute(),this.player.playVideo())}),"play")}pause(e){this.player&&(this.pauseBy=e,this.ensureReadyAndExecute((()=>{this.player.pauseVideo()}),"pause"))}updateSize(e,t){this.options.cover?(this.aspectRatio<=this.el.clientWidth/this.el.clientHeight?(t=(e=this.el.clientWidth)/this.aspectRatio)<this.el.clientHeight&&(t=this.el.clientHeight):(e=(t=this.el.clientHeight)*this.aspectRatio)<this.el.clientWidth&&(e=this.el.clientWidth),void 0!==e&&0!==e&&e!==this.container.width&&(this.container.style.width=this.container.width=_tpt.unitize(e,"px")),void 0!==t&&0!==t&&t!==this.container.height&&(this.container.style.height=this.container.height=_tpt.unitize(t,"px")),t>this.el.clientHeight?this.container.style.transform="translateX(0px) translateY("+_tpt.unitize((this.el.clientHeight-t)/2,"px")+")":e>this.el.clientWidth?(this.container.style.transform="translateY(0px) translateX("+_tpt.unitize((this.el.clientWidth-e)/2,"px")+")",this.container.style.maxWidth="none"):this.container.style.transform="translateY(0px) translateX(0px)"):(void 0!==e&&0!==e&&e!==this.container.width&&(this.container.width=_tpt.unitize(e,"px")),void 0!==t&&0!==t&&t!==this.container.height&&(this.container.height=_tpt.unitize(t,"px")))}addEvent(e,t,s){let i;return this.stateChangeListenerAdded||(this.lastPlayerState=null,this.player.addEventListener("onError",(e=>{console.group("SR7 YT Embeding Issue"),console.log(e),console.groupEnd("SR7 YT Embeding Issue")})),i=this.player.addEventListener("onStateChange",(e=>{switch(0!==this.options.end&&this.player.getCurrentTime()>=this.options.end?e.data=this.states.ended:0!==this.options.start&&e.data==this.states.playing&&this.player.getCurrentTime()<this.options.start&&this.rewind(),"false"!==this.options.autoPlay&&!1!==this.options.autoPlay&&"no1sttime"!==this.options.autoPlay&&!this.muteFallBack&&"play"==this.requestedAction&&this.playerReady&&this.lastPlayerState===this.states.unstarted&&e.data!==this.states.playing?(this.player.mute(),this.player.playVideo(),this.muteFallBack=!0,this.requestedAction="play"):e.data===this.states.ended&&(this.options.loop?(this.rewind(),this.player.playVideo(),this.requestedAction="play"):(this.options.rewind&&this.rewind(),this.player.pauseVideo(),this.requestedAction="pause")),this.muted&&this.player.mute(),e.data){case this.states.paused:this.playingList("remove",this),this.dispatch("paused",e),this.state="paused",SR7.F.triggerMediaEvent(this,"update");break;case this.states.playing:this.playingList("add",this),this.dispatch("playing",e),this.state="playing",SR7.F.triggerMediaEvent(this,"update");break;case this.states.ended:this.playingList("remove",this),-1!==this.lastPlayerState?(this.dispatch("finished",e),this.state="ended"):this.state="paused",SR7.F.triggerMediaEvent(this,"update")}this.lastPlayerState=e.data,this.showHide()})),this.stateChangeListenerAdded=!0),void 0!==e&&(this.listeners[e]={callback:t,params:s}),i}}class s extends e{async add(){await SR7.loadVideoAPI("vimeo"),this.options.args=this.options.args??"";try{await this.waitForContainer(this.containerId)}catch(e){return void console.error(e)}let e={height:_tpt.unitize(this.options.height,"px"),width:_tpt.unitize(this.options.width,"px"),id:this.options.src,controls:!!(this.options.controls??"").includes("s"),autoplay:this.options.autoPlay,loop:this.options.loop,muted:this.options.mute,playsinline:this.options.inline,responsive:!1,title:!(!this.options.args.includes("title=true")&&!this.options.args.includes("title=1"))||!this.options.args.includes("title=false")&&!this.options.args.includes("title=0")&&void 0};(this.options.args.includes("transparent=false")||this.options.args.includes("transparent=0"))&&(e.transparent=!1),(this.options.args.includes("transcript=false")||this.options.args.includes("transcript=0"))&&(e.transcript=!1);let t=this.options.args.includes("quality=144p")?"144p":this.options.args.includes("quality=240p")?"240p":this.options.args.includes("quality=360p")?"360p":this.options.args.includes("quality=540p")?"540p":this.options.args.includes("quality=720p")?"720p":this.options.args.includes("quality=1080p")?"1080p":this.options.args.includes("quality=2k")?"2k":this.options.args.includes("quality=4k")?"4k":void 0,s=!(!this.options.args.includes("portrait=true")&&!this.options.args.includes("portrait=1"))||!this.options.args.includes("portrait=false")&&!this.options.args.includes("portrait=0")&&void 0,i=!(!this.options.args.includes("dnt=true")&&!this.options.args.includes("dnt=1"))||!this.options.args.includes("dnt=false")&&!this.options.args.includes("dnt=0")&&void 0;t&&(e.quality=t),s&&(e.portrait=s),i&&(e.dnt=i),e.pip=!(!this.options.args.includes("pip=true")&&!this.options.args.includes("pip=1")),this.player=new Vimeo.Player(this.containerId,e),this.pauseRequested=!1,this.player.setCurrentTime(this.options.start),this.player.ready().then((()=>{this.iframe=this.container.getElementsByTagName("IFRAME"),null!==this.iframe&&(this.iframe=this.iframe[0]),this.playerReady=!0,this.updateSize(this.options.width,this.options.height),this.iframe.style.opacity=1,this.iframe.style.borderRadius=this.iframe.parentElement.parentElement.style?.borderRadius,this.options.mute&&this.player.setVolume(0),this.dispatch("ready")})),this.muted=this.options.mute,this.addEvent(),this.showHide(),this.rewind("pause"),this.muteFallBack=!1}rewind(e){this.player&&(this.player.setCurrentTime(this.options.start),"pause"==e&&this.pause())}remove(){this.player&&this.player.unload().then((()=>{this.player=null}))}mute(){if(!this.player)return;let e=this,t=this.player;this.player.getVolume().then((function(s){e.player.muted=!0,e.lastVolume=0==s?1:s,t.setVolume(0),e.muted=!0})).catch((function(e){console.error("Error getting volume:",e)}))}unmute(){if(!this.player)return;let e=this;e.lastVolume=null==e.lastVolume||0==e.lastVolume?1:e.lastVolume,this.player.setVolume(e.lastVolume).catch((function(e){console.error("Error setting volume:",e)})),e.muted=!1,e.player.muted=!1}updateSize(e,t){this.player&&this.playerReady&&(this.options.cover?(this.aspectRatio<=this.el.clientWidth/this.el.clientHeight?t=(e=this.container.clientWidth)/this.aspectRatio:e=(t=this.container.clientHeight)*this.aspectRatio,void 0!==e&&0!==e&&e!==this.iframe.width&&(this.iframe.style.width=this.iframe.width=_tpt.unitize(e,"px")),void 0!==t&&0!==t&&t!==this.iframe.height&&(this.iframe.style.height=this.iframe.height=_tpt.unitize(t,"px")),t>this.container.clientHeight?this.iframe.style.transform="translateX(0px) translateY("+_tpt.unitize((this.container.clientHeight-t)/2,"px")+")":e>this.container.clientWidth&&(this.iframe.style.transform="translateY(0px) translateX("+_tpt.unitize((this.container.clientWidth-e)/2,"px")+")")):(void 0!==e&&0!==e&&e!==this.iframe.width&&(this.iframe.width=_tpt.unitize(e,"px")),void 0!==t&&0!==t&&t!==this.iframe.height&&(this.iframe.height=_tpt.unitize(t,"px"))))}async play(){this.player&&(this.pauseRequested=!1,this.ensureReadyAndExecute((async()=>{try{if(!_tpt.userInteracted&&this.options.autoPlay&&this.player.setVolume(0),await this.player.play(),this.pauseRequested)return void this.pause();this.lastPlayerState=this.states.playing}catch(e){if("NotAllowedError"===e.name)this.muteFallBack=!0,this.player.setVolume(0),"false"!==this.options.autoPlay&&!1!==this.options.autoPlay&&"no1sttime"!==this.options.autoPlay&&this.play();else if("AbortError"===e.name)console.log("Play was interrupted."),this.lastPlayerState=this.states.paused;else{if("PlayInterrupted"!==e.name)throw e;console.log("Play was interrupted by a pause request.")}}}),"play"))}async pause(e){this.pauseRequested=!0,this.player&&(this.pauseBy=e,this.ensureReadyAndExecute((async()=>{try{if(await this.player.getPaused())return;await this.player.pause(),this.lastPlayerState=this.states.paused}catch(e){if("NotAllowedError"===e.name)this.player.setVolume(0),this.pause();else{if("AbortError"!==e.name)throw e;console.log("Pause was interrupted."),this.lastPlayerState=this.states.paused}}}),"pause"))}addEvent(e,t,s){let i;return this.stateChangeListenerAdded||(this.lastPlayerState=null,this.player.on("play",(()=>{this.lastPlayerState=this.states.playing,this.playingList("add",this),this.dispatch("playing"),this.showHide(),this.state="playing",SR7.F.triggerMediaEvent(this,"update")})),this.player.on("pause",(()=>{this.lastPlayerState=this.states.paused,this.playingList("remove",this),this.dispatch("paused"),this.showHide(),this.state="paused",SR7.F.triggerMediaEvent(this,"update")})),this.player.on("ended",(()=>{this.lastPlayerState=this.states.ended,this.playingList("remove",this),this.dispatch("finished"),this.showHide(),this.state="finished",SR7.F.triggerMediaEvent(this,"update")})),i=this.player.on("timeupdate",(e=>{0!==this.options.end&&e.seconds>=this.options.end?this.options.loop?(this.rewind(),this.play()):(this.options.rewind&&this.rewind(),this.pause(),this.dispatch("finished")):0!==this.options.start&&e.seconds<this.options.start&&this.rewind(),this.muted&&!this.isMuted&&(this.player.setVolume(0),this.isMuted=!0),this.dispatch("timeupdate",e),this.lastPlayerState=this.getState(),this.showHide()})),this.stateChangeListenerAdded=!0),void 0!==e&&(this.listeners[e]={callback:t,params:s}),i}}class i extends e{constructor(e,t,s){super(e,t,s),this.player=null}async add(){try{await this.waitForContainer(this.containerId)}catch(e){return void console.error(e)}const e=document.createElement("audio"==this.options.type?"audio":"video");e.setAttribute("id",this.containerId+"_html5"),e.className="sr7-html5-video",e.setAttribute("src",_tpt.urlProtocol(this.options.src)),e.setAttribute("preload","metadata"),e.setAttribute("playsInline","metadata"),(this.options.controls??"").includes("s")&&e.setAttribute("controls",""),"audio"==this.options.type&&void 0!==this.options.controls&&(this.options.controls=this.options.controls.replace("xl","")),("audio"==this.options.type&&""==this.options.controls||null==this.options.controls)&&this.el.classList.add("sr7-hidden-audio"),1==this.options.mute&&e.setAttribute("muted",""),1==this.options.loop&&e.setAttribute("loop",""),this.container.appendChild(e),this.player=e,this.container.style.width="100%",this.player.style.width="100%",this.container.style.height="auto"==this.options.target.style.height?"auto":"100%",this.player.style.height="auto"==this.options.target.style.height?"auto":"100%",this.player.style.borderRadius=this.container.parentElement.style?.borderRadius,this.playerReady=!0,this.options.volume=this.options.volume??1,this.options.volume=this.options.volume>1?this.options.volume/100:this.options.volume,this.player.volume=this.options.volume,this.dispatch("ready"),this.addEvent(),this.showHide(),this.updateSize(this.options.width,this.options.height,this.options.cover??1?"cover":"contain"),this.rewind("pause"),this.largeControls()}rewind(e){this.player&&(this.player.currentTime=this.options.start,"pause"!=this.requestedAction&&"pause"!=e||this.pause())}drawCanvas(){!0===this.toCanvas&&null!=this.canvas&&(this.canvas.image&&this.canvas.drawImg(this.player),requestAnimationFrame(this.drawCanvas.bind(this)))}startCanvas(e){this.hideCanvas&&(this.hideCanvas.kill(),this.hideCanvas=null),this.canvas=e,this.toCanvas=!0,this.drawCanvas(),this.container.style.visibility="hidden"}resumeCanvas(){this.toCanvas=!0,this.drawCanvas()}pauseCanvas(){this.toCanvas=!1}stopCanvas(){this.hideCanvas=_tpt.gsap.fromTo(this.container,.3,{opacity:0,visibility:"hidden"},{opacity:1,visibility:"visible"}),this.hideCanvas.eventCallback("onComplete",(e=>{e.toCanvas=!1,delete e.canvas,this.hideCanvas=null}),[this]),this.container.style.visibility="visible"}largeControls(){if((this.options.controls??"").includes("xl")){if(null==this.lrgbutton){const e=_tpt.collector();this.lrgbutton=e.add({tag:"sr7-lrg-ctrl"}),this.lrgPlay=e.add({tag:"sr7-lrg-play"}),this.lrgPause=e.add({tag:"sr7-lrg-pause"}),this.lrgbutton.appendChild(this.lrgPlay),this.lrgbutton.appendChild(this.lrgPause),this.container.parentNode.appendChild(this.lrgbutton)}this.lastPlayerState==this.states.playing?(this.lrgbutton.classList.remove("playing"),this.lrgbutton.classList.add("paused")):(this.lrgbutton.classList.add("playing"),this.lrgbutton.classList.remove("paused"))}}getState(){return this.player?this.player.ended?this.states.ended:this.player.paused?this.states.paused:this.player.playing?this.states.playing:this.states.unstarted:null}remove(){this.player&&(this.player.pause(),this.player.src="",this.player.load(),this.player=null)}mute(){this.player&&(this.player.muted=!0,this.muted=!0)}unmute(){this.player&&(this.player.muted=!1,0==this.player.volume&&(this.player.volume=1),this.muted=!1)}play(){this.player&&((!_tpt.userInteracted&&this.options.autoPlay||this.options.mute)&&(this.player.muted=!0),this.ensureReadyAndExecute((()=>{this.player.play().catch((e=>{"NotAllowedError"===e.name&&(this.player.muted=!0,this.player.play())}))}),"play"))}pause(e){this.player&&(this.pauseBy=e,this.ensureReadyAndExecute((()=>{this.player.pause()}),"pause"))}updateSize(e,t,s){this.player&&(this.player.arCalculated||void 0===this.player.videoHeight||0===this.player.videoHeight||(this.aspectRatio=this.player.videoWidth/this.player.videoHeight,this.player.arCalculated=!0),"cover"!==s&&"contain"!==s||(this.player.style.objectFit=s),this.el.classList["auto"==this.el?.style?.height?"add":"remove"]("sr7_miah"))}addEvent(e,t,s){this.stateChangeListenerAdded||(this.lastPlayerState=null,this.player.addEventListener("play",(e=>{this.lastPlayerState=this.states.playing,this.playingList("add",this),this.dispatch("playing",e),this.showHide(),this.largeControls(),this.state="playing",SR7.F.triggerMediaEvent(this,"update")})),this.player.addEventListener("pause",(e=>{this.lastPlayerState=this.states.paused,this.playingList("remove",this),this.dispatch("paused",e),this.showHide(),this.largeControls(),this.state="paused",SR7.F.triggerMediaEvent(this,"update")})),this.player.addEventListener("ended",(e=>{this.lastPlayerState=this.states.ended,this.playingList("remove",this),this.dispatch("finished",e),this.showHide(),this.largeControls(),this.state="finished",SR7.F.triggerMediaEvent(this,"update")})),this.player.addEventListener("timeupdate",(e=>{this.player.currentTime>=this.options.end&&0!==this.options.end?this.options.loop?(this.rewind(),this.play()):(this.options.rewind&&this.rewind(),this.pause(),this.dispatch("finished")):this.player.currentTime<this.options.start&&0!==this.options.start&&this.rewind(),this.muted&&(this.player.muted=!0),this.dispatch("timeupdate",e)})),this.stateChangeListenerAdded=!0),void 0!==e&&(this.listeners[e]={callback:t,params:s})}}SR7.videoPlayer=class{constructor(e,a,r){switch("slidebg"==r.subtype&&"html5"!==r.type&&(r.autoPlay=!1,r.poster.showOnPause=!0),r.type){case"youtube":this.player=new t(e,a,r);break;case"vimeo":this.player=new s(e,a,r);break;case"html5":case"audio":this.player=new i(e,a,r);break;default:throw new Error(`Invalid video type. Please use "youtube", "vimeo", or "html5". Received: ${r.type}`)}}add(){return this.player.add()}remove(){this.player.remove()}rewind(){this.player.rewind()}play(){let{c:e}=SR7.F.getLayer(this?.player?.el?.id);this.pauseBy=null,"slidebg"==e?.subtype&&String(SR7.M[e.mid].current.id)!==String(e.skey)||this.player.play()}pause(e){this.pauseBy=e,this.player.pause()}mute(){this.player.mute()}unmute(){this.player.unmute()}updateSize(e,t){this.player.updateSize(e,t)}isPlaying(){return this.player.isPlaying()}isHidden(){return this.player.isHidden()}update(e){return this.remove(),this.player.options=e,this.add()}hasEvent(e){return this.player.hasEvent(e)}addEvent(e,t,s){this.player.addEvent(e,t,s)}isReady(){return this.player.isReady()}toggle(){this.player.toggle()}stopPlayingMedias(){this.player.stopPlayingMedias()}startCanvas(e){this.player.startCanvas&&this.player.startCanvas(e)}stopCanvas(){this.player.stopCanvas&&this.player.stopCanvas()}drawCanvas(){this.player.drawCanvas()&&this.player.drawCanvas()}},_tpt.R??={},_tpt.R.media=_tpt.extend?_tpt.extend(_tpt.R.media,{status:2,version:"1.0"}):{status:2,version:"1.0"}}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},SR7.E??={},void 0!==SR7.F.modify)return;SR7.F.getFXCoverAnim=(e,t,s,i)=>{if("out"==s&&("hidden"==e.el.style.visibility||e.el.className.includes("sr7-fx-hidden")))return;let a=_tpt.gsap.timeline();e.fxitl=_tpt.gsap.timeline(),e.fxotl=_tpt.gsap.timeline();let r=o("in",t.fx,t.fxe,t.fxc),l=o("out",t.fx);return e.fxitl.eventCallback("onStart",(e=>{e.mask.style.overflow="hidden",e.el.classList["in"==s&&i<2?"add":"remove"]("sr7-fx-hidden")}),[e,s,i]),e.fxitl.eventCallback("onComplete",(e=>{e.maskForFx&&(e.mask.style.overflow="visible"),e.el.classList["in"==s&&i<2||"out"==s?"remove":"add"]("sr7-fx-hidden")}),[e,s,i]),e.fxitl.add(_tpt.gsap.fromTo(e.fxc,t.fxs/2e3,r,{scaleX:1,scaleY:1}),0),e.fxotl.add(_tpt.gsap.to(e.fxc,t.fxs/2e3,l),0),a.add(e.fxitl,0),a.add(e.fxotl,t.fxs/2e3),a},SR7.F.pan={getBox:function(e,t,s){let i=e.width/_tpt.dpr,a=e.height/_tpt.dpr,r=a*t,o=i*t;if(null==e.image)return;i/a<e.image.width/e.image.height?o=e.image.width*(r/e.image.height):r=e.image.height*(o/e.image.width);let l={l:(0-("center"==s.x?.5:"left"==s.x?0:"right"==s.x?1:parseInt(s.x)/100||0))*Math.abs(i-o),t:(0-("center"==s.y?.5:"top"==s.y?0:"bottom"==s.y?1:parseInt(s.y)/100||0))*Math.abs(a-r),w:o,h:r};return l.r=l.l+o,l.b=l.t+r,l},getStep:function(e){const{canvas:t,x:s,y:i,scale:a,rotate:r,pos:o}=e,l=SR7.F.pan.getBox(t,a,o);if(null==l)return;const n={rZ:Math.PI/180*r,scale:a,x:parseFloat(s)+l.l,y:parseFloat(i)+l.t,w:l.w,h:l.h},d=l.r-l.l,c=l.b-l.t;return n.x=n.x>0?0:d+n.x<t.width/_tpt.dpr?t.width/_tpt.dpr-d:n.x,n.y=n.y>0?0:c+n.y<t.height/_tpt.dpr?t.height/_tpt.dpr-c:n.y,n},observe:e=>{if(void 0!==SR7.M[e].c.pans.observing)return;let t=document.documentElement.clientHeight,s=document.documentElement.clientWidth;_tpt.resizeObserver.observe((e=>{const i=document.documentElement.clientHeight,a=document.documentElement.clientWidth;(!_tpt.is_mobile||Math.abs(t-i)>30||Math.abs(s-a)>0)&&SR7.F.pan.refresh(e,SR7.M[e].current.id),t=i,s=a}),19,e),SR7.M[e].c.pans.observing=!0},refresh:(e,t)=>{SR7.M[e].c.pans?.[t]&&requestAnimationFrame((function(){for(let s of SR7.M[e].c.pans[t])SR7.F.animateLayers({id:e,skey:t,layers:[s],scene:"in",caller:"update",update:"pan"})}))}},SR7.F.modify={prepare:e=>{if(null!=e&&("false"!=String(e.s?.u??!1)||"false"!=String(e.s?.uf??!1)||"false"!=String(e.m?.u??!1)))return{mx:0,my:0,sx:0,sy:0,srx:0,sry:0,srz:0,ssc:1,sg:0,sb:0,sr:100,sf:100,mask:e.mask,mouse:e?.m??{},scroll:e?.s??{}}},get:(r,o,l,n,d,c,p,h)=>{if(l.modifiers??={},"opacity"==h)l.modifiers.opacity=i(n),"in"==d&&0==c&&(n.mod.animElemOpacity=o,n.el.tf=l.tf);else if("xy"==h)"in"==d&&0==c&&(n.mod.animElemXY=o,o.tx=l.x?.()??0,o.ty=l.y?.()??0,o.tx="inherit"==o.tx?0:o.tx,o.ty="inherit"==o.ty?0:o.ty),l.modifiers.x=e(n,"x"),l.modifiers.y=e(n,"y");else if("filter"==h){n.mod.animElemFilter=o;const{blur:e,grayscale:t,brightness:s}=n.filters.simple.filters;n.filters.simple.used.blur&&(l.tb=e),n.filters.simple.used.grayscale&&(l.tg=t),n.filters.simple.used.brightness&&(l.tr=s),"in"==d&&0==c&&(o.tb=l.tb??0,o.tg=l.tg??0,o.tr=l.tr??100),l.modifiers.filter=a(n.filters.simple,n)}else"transform"==h&&(n.mod.animElemTransform=o,"in"==d&&0==c&&(o.rx=l.rotationX??0,o.ry=l.rotationY??0,o.rz=l.rotationZ??0),l.modifiers.rotationX=t(n,"x"),l.modifiers.rotationY=t(n,"y"),l.modifiers.rotation=t(n,"z"),l.modifiers.scaleX=s(n),l.modifiers.scaleY=s(n));return l},handleListeners:e=>{const t=SR7.M[e];if(!t.settings.mod?.use||null==t.c.mod||_tpt.is_mobile&&t.settings.mod?.dOM)return;let s=!1,i=!1;for(let e in t.c.mod[t.current.id]){if(s&&i)continue;const a=t.c.layers[SR7.lToK[t.c.mod[t.current.id][e]]];s=s||""+(a.mod.mouse?.u??!1)!="false",i=i||""+(a.mod.scroll?.u??!1)!="false"}for(let e in t.staticSlides)if(_tpt.hop(t.staticSlides,e)&&""!=t.staticSlides[e]&&(!s||!i))for(let a in t.c.mod[t.staticSlides[e]]){const r=t.c.layers[SR7.lToK[t.c.mod[t.staticSlides[e]][a]]];s=s||""+(r.mod.mouse?.u??!1)!="false",i=i||""+(r.mod.scroll?.u??!1)!="false"}if(s)SR7.M[e].c.moduleListeners??={},SR7.M[e].c.moduleListeners.modify??={},SR7.M[e].c.moduleListeners.modify.enter??=SR7.F.module.listeners.reg(e,_tpt.is_mobile?"touchstart":"mouseenter",SR7.F.module.listeners.updateMouseCoordinates),SR7.M[e].c.moduleListeners.modify.coord??=SR7.F.module.listeners.reg(e,_tpt.is_mobile?"touchmove":"mousemove",SR7.F.module.listeners.updateMouseCoordinates),SR7.M[e].c.moduleListeners.modify.process??=SR7.F.module.listeners.reg(e,_tpt.is_mobile?"touchmove":"mousemove",(function(e,t){SR7.F.modify.process(e,"mouse",void 0,t)})),_tpt.is_mobile&&(SR7.M[e].c.moduleListeners.modify.processTouch??=SR7.F.module.listeners.reg(e,"touchstart",(function(e,t){SR7.F.modify.process(e,"touch",void 0,t)})));else for(let t of["enter","coord","process","processTouch"])SR7.M[e].c?.moduleListeners?.modify?.[t]&&(SR7.F.module.listeners.del(e,"enter"==t?_tpt.is_mobile?"touchstart":"mouseenter":_tpt.is_mobile?"touchmove":"mousemove",SR7.M[e].c.moduleListeners.modify[t]),delete SR7.M[e].c.moduleListeners.modify[t]);i?(SR7.M[e].c.moduleListeners??={},SR7.M[e].c.moduleListeners.modify??={},SR7.M[e].c.moduleListeners.modify.scroll??=SR7.F.module.listeners.reg(e,"scroll",(function(e,s){"carousel"==t.settings.type?SR7.F.modify.processAll(e,"scroll"):SR7.F.modify.process(e,"scroll")}))):SR7.M[e].c?.moduleListeners?.modify?.scroll&&(SR7.F.module.listeners.del(e,"scroll",SR7.M[e].c.moduleListeners.modify.scroll),delete SR7.M[e].c.moduleListeners.modify.scroll)},processAll:(e,t)=>{for(let s in SR7.M[e].slideOrder)(SR7.M[e].slides[SR7.M[e].slideOrder[s]].slide.visible||SR7.M[e].slideOrder[s]==SR7.M[e].current.id)&&SR7.F.modify.process(e,t,void 0,void 0,SR7.M[e].slideOrder[s])},process:(e,t,s,i,a)=>{SR7.F.modify.pOS(e,t,s,a??SR7.M[e].current.id);for(let i of SR7.M[e].staticSlides)SR7.F.modify.pOS(e,t,s,i)},pOS:(e,t,s,i)=>{const a=SR7.M[e];if(!a.settings.mod?.use||null==a.c.mod||null==a.c.mod[i]||_tpt.is_mobile&&a.settings.mod?.dOM)return;const o=a.c.d3?.[i]&&(a.settings.mod?.d3??!1);if(o){const t=Math.round((a.mouse?.cDY??0)*a.settings.mod.d3d/a.dims.module.h),s=-Math.round((a.mouse?.cDX??0)*a.settings.mod.d3d/a.dims.module.w);_tpt.gsap.to([a.c.d3[i].layers,a.c.d3[i].bg],a.settings.mod.d3s,{rotateX:t,rotateY:s,z:r(e,Math.abs(t)+Math.abs(s)/2),ease:a.settings.mod.d3e,overwrite:"auto"})}for(let e in a.c.mod[i]){if(void 0!==s&&s!==e)continue;const r=a.c.layers[SR7.lToK[a.c.mod[i][e]]];if(r.mod.use3d=o,("mouse"==t||"touch"==t)&&""+(r.mod.mouse?.u??!1)!="false"){let e,s;if(null==r.mod.animElemXY&&"slidebg"==r.subtype&&(r.mod.animElemXY=r.px?r.px:r.mask?r.mask:r.el),"mousedrag"===a.settings.mod.t){let t,i=a.settings.mod.sm,r=a.settings.mod.om;"opposite"===a.settings.mod.dir&&(t=i,i=r,r=i),e=(a.c.carousel.src.lpX-(a.c.carousel.src.s.realDragging?a.c.carousel.src.pX:0))*Math.max(1,i)/10,s=(a.c.carousel.src.lpY-a.c.carousel.src.pY)*Math.max(1,r)/10,"same"===a.settings.mod.dir?"h"===a.settings.carousel.type?s=0:"v"===a.settings.carousel.type&&(e=0):"opposite"===a.settings.mod.dir&&("h"===a.settings.carousel.type?(s=e,e=0):"v"===a.settings.carousel.type&&(e=s,s=0))}else{let i="touch"==t?"F":"";e=(a.mouse[r.mod.mouse.o+"DX"+i]??0)*r.mod.mouse.x/(o?"slidebg"!==r.subtype?200:155:100),s=(a.mouse[r.mod.mouse.o+"DY"+i]??0)*r.mod.mouse.y/(o?"slidebg"!==r.subtype?200:80:100)}r.mod.tlM=_tpt.gsap.to(r.mod,r.mod.mouse.s,{mx:e,my:s,ease:r.mod.mouse.e,overwrite:"auto"}),r.mod.tlM.eventCallback("onUpdate",SR7.F.modify.tlupdate,[r,"xy"])}if("scroll"==t){let e={ease:"power3.out",overwrite:"auto"};if("false"!==(r.mod.scroll?.u??"false")&&(e.sx=Math.round(a.scrollProc*(-r.mod.scroll.x/100*a.dims.module.h)*10)/10||0,e.sy=Math.round(a.scrollProc*(-r.mod.scroll.y/100*a.dims.module.h)*10)/10||0),r.mod.scroll.uf||r.mod.scroll.ut){const t=r.mod.scroll.t/2;let s=a.scrollProc;s=s>t?Math.min(1,(s-t)/(1-t)):s<-t?Math.max(-1,(s+t)/(1-t)):0,r.mod.scroll.uf&&(null==r.mod.animElemFilter&&(r.mod.animElemFilter=r.mask?r.mask:r.el,r.filters??={},r.filters.simple=SR7.F.getFilterStyle(r.mod.scroll,"",r.filters?.simple?.used??void 0)),e.sg=0==r.mod.scroll.g?0:Math.round(Math.abs(s)*r.mod.scroll.g),e.sb=0==r.mod.scroll.b?0:Math.round(Math.abs(s)*r.mod.scroll.b),e.sr=100==r.mod.scroll.r?100:Math.round((1-Math.abs(s))*r.mod.scroll.r),e.sf="off"==r.mod.scroll.f?100:1-Math.abs(s)-Math.abs(s)*((r.mod.scroll.f-100)/100)),r.mod.scroll.ut&&(e.srx=0==r.mod.scroll.rX?0:Math.round(s*r.mod.scroll.rX),e.sry=0==r.mod.scroll.rY?0:Math.round(s*r.mod.scroll.rY),e.srz=0==r.mod.scroll.rZ?0:Math.round(s*r.mod.scroll.rZ),e.ssc=1==r.mod.scroll.sc?1:1+Math.abs(s)*r.mod.scroll.sc)}r.mod.tlS=_tpt.gsap.to(r.mod,r.mod.scroll.s||.001,e),r.mod.tlS.eventCallback("onUpdate",SR7.F.modify.tlupdate,[r,"xy,filter,opacity,rotate"])}}},tlupdate:(r,o)=>{if(o.includes("xy")&&!SR7.F.modify.isTweening(r,"xy")&&(r.mod.animElemXY||r.mod.animElem)&&_tpt.gsap.set(r.mod.animElemXY||r.mod.animElem,{x:e(r,"x")(),y:e(r,"y")()}),o.includes("rotate")&&r.mod.scroll?.ut&&_tpt.gsap.set(r.mask,{rotationX:t(r,"x")(),rotationY:t(r,"y")(),rotationZ:t(r,"z")(),scaleX:s(r)(),scaleY:s(r)()}),o.includes("filter")&&r.mod.animElemFilter&&!SR7.F.modify.isTweening(r,"filter")){let e=void 0===r.filters?"":a(r.filters.simple,r)();_tpt.gsap.set(r.mod.animElemFilter,{filter:""===e?"none":e})}!o.includes("opacity")||"slidebg"!=r.subtype&&!r.mod.animElemOpacity||"slidebg"!=r.subtype&&SR7.F.modify.isTweening(r,"opacity")||_tpt.gsap.set(r.el,{opacity:"slidebg"==r.subtype?Math.min(1,parseFloat(r.mod.sf)||1):i(r)})},isTweening:(e,t)=>{let s=!1;if(null==(e.mod?.coreTween?.[t]??void 0))return!1;for(let i in e.mod.coreTween[t])!s&&_tpt.hop(e.mod.coreTween[t],i)&&(s=e.tl?.[i]?.[e.mod.coreTween[t][i]]?.isActive()??!1);return s}},SR7.F.sbt={init:e=>{SR7.M[e].c.moduleListeners??={},SR7.M[e].c.moduleListeners.sbt??={},null==SR7.M[e].c.moduleListeners.sbt.scroll&&(SR7.M[e].c.moduleListeners.sbt.scroll=SR7.F.module.listeners.reg(e,"scroll",(function(e,t){SR7.F.sbt.process(e,"scroll")}),!0),SR7.F.sbt.process(e,"init"),requestAnimationFrame((()=>{_tpt.scrollObserver.process(SR7.M[e].c.module,!0)})))},process:(e,t,s)=>{const i=SR7.M[e];if(i.settings.sbt?.f){const t=i.dims.content.h<_tpt.winH,s=_tpt.winH-i.dims.content.h-parseInt(i.dims.reduceHeight??0),a=i.settings.sbt.a??"top";if(i.useAsModal&&(SR7.F.module.box(e),SR7.F.modal.sbt=!0,SR7.F.modal.underlay("show"),i.c.module.style.transform="none"),i.sbt.__runTime??=0,(i.dims.moduleRect.top<0||i.dims.moduleRect.top+i.dims.content.h<_tpt.winH&&"travel"==a||i.dims.moduleRect.top+i.dims.content.h<=_tpt.winH&&"bottom"==a)&&i.dims.moduleRect.bottom-i.dims.content.h-("bottom"==a?s:0)>(i.dims.content.h>_tpt.winH?s:0)&&i.dims.moduleRect.top<_tpt.winH){!0!==i.sbtFreeze&&(i.c.content.style.position="fixed",i.c.content.style.top="0px",i.settings.size.fullWidth&&(i.c.content.style.left="0px"),i.c.content.style.bottom="auto",i.sbtFreeze=!0);const e=i.dims.sbt-(i.dims.content.h+(t?-s:s));let r=t?"travel"==a?parseInt(i.dims.reduceHeight??0)+s+(i.dims.moduleRect.top-s)/e*s:"bottom"==a?_tpt.winH-i.dims.content.h-parseInt(i.dims.reduceHeight??0):0:0-i.dims.moduleRect.top/e*s;_tpt.gsap.set(i.c.content,{y:r})}else!1!==i.sbtFreeze&&(i.c.content.style.position="absolute",i.sbtFreeze=!1,i.dims.moduleRect.top>=0?(i.c.content.style.top="0px",i.settings.size.fullWidth&&(i.c.content.style.left=i.dims.content.shiftx+i.dims.content.mwshiftx+"px"),i.c.content.style.bottom="auto",_tpt.gsap.set(i.c.content,{y:0})):(i.c.content.style.top="auto",i.c.content.style.bottom="0px",i.settings.size.fullWidth&&(i.c.content.style.left=i.dims.content.shiftx+i.dims.content.mwshiftx+"px"),_tpt.gsap.set(i.c.content,{y:0})))}let a;if(a=i.settings.sbt?.f&&i.settings.sbt.nL?i.dims.moduleRect.top>=(i.dims.reduceHeight??0)&&i.dims.moduleRect.top<=_tpt.winH?i.sbt.__slen*(1-i.dims.moduleRect.top/_tpt.winH)/1e3:i.dims.moduleRect.top<=(i.dims.reduceHeight??0)&&i.dims.moduleRect.bottom>=i.dims.module.h?(i.sbt.__slen+i.sbt.__mlen*(Math.abs(i.dims.moduleRect.top)/(i.dims.moduleRect.height-i.dims.module.h)))/1e3:i.dims.moduleRect.top>_tpt.winH?0:(parseInt(i.settings.sbt.fEnd??0)+i.sbt.__elen*(1-i.dims.moduleRect.bottom/i.dims.content.h))/1e3:_tpt.gsap.utils.mapRange(1,-1,0,i.sbt.__len/1e3,i.scrollProcSA),i.sbt.__time??=a,"scroll"==t){if(i.sbt.done=!0,i.sbt.__time=a,-1==(i.current?.id??-1))return;!function(e,t){const s=SR7.M[e];for(var i in s.sbt[s.current.id])_tpt.hop(s.sbt[s.current.id],i)&&(s.sbt[s.current.id][i].tl.paused()||s.sbt[s.current.id][i].tl.pause(),_tpt.gsap.to(s.sbt[s.current.id][i].tl,{duration:s.settings.sbt.s,time:_tpt.gsap.utils.clamp(s.sbt[s.current.id][i].so,s.sbt[s.current.id][i].tl.duration(),t)}))}(e,i.sbt.__time)}}};const e=(e,t)=>()=>parseFloat(e.mod.animElem["t"+t]??0)+(e.mod?.["m"+t]??0)+(e.mod?.["s"+t]??0)+"px",t=(e,t)=>()=>parseFloat(e.mod.animElem["r"+t]??0)+(e.mod?.["sr"+t]??0)+(e.mod?.["mr"+t]??0)+"deg",s=e=>()=>parseFloat(e.mod?.ssc??1),i=e=>()=>parseFloat(e.el.tf??0)*(e.mod?.sf??0),a=(e,t)=>()=>(e.used?.blur?"blur("+(parseInt(t.el.tb??0)+parseInt(t.mod?.sb??0))+"px) ":"")+(e.used?.grayscale?"grayscale("+(parseInt(t.el.tg??0)+parseInt(t.mod?.sg??0))+"%) ":"")+(e.used?.brightness?"brightness("+parseInt(t.el.tr??100)+"%)":""),r=(e,t)=>(s,i)=>parseInt(SR7.M[e].settings.mod.d3z??65)*(i.className.includes("-bg")?-t/5:1)+"px";let o=(e,t,s,i)=>{let a="in"==e?"cright"==t?{transformOrigin:"0% 50%",scaleX:0,scaleY:1}:"cleft"==t?{transformOrigin:"100% 50%",scaleX:0,scaleY:1}:"cbottom"==t?{transformOrigin:"50% 0%",scaleX:1,scaleY:0}:{transformOrigin:"50% 100%",scaleX:1,scaleY:0}:"cleft"==t?{transformOrigin:"0% 50%",scaleX:0,scaleY:1}:"cright"==t?{transformOrigin:"100% 50%",scaleX:0,scaleY:1}:"ctop"==t?{transformOrigin:"50% 0%",scaleX:1,scaleY:0}:{transformOrigin:"50% 100%",scaleX:1,scaleY:0};return a.ease=s,a.backgroundColor=i,a};_tpt.R??={},_tpt.R.modifiers=_tpt.extend?_tpt.extend(_tpt.R.modifiers,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},void 0!==SR7.F.navigation)return;SR7.F.navigation={init:e=>{SR7.F.navigation.create(e),a(e),_tpt.resizeObserver.observe((e=>{SR7.F.navigation.showHide(e)}),19,e)},update:e=>{const t=SR7.M[e];t.c.nav&&"hero"!=t.settings.type&&(t.settings.nav?.arrows?.set&&h(e),t.settings.nav?.bullets?.set&&n(e),t.settings.nav?.tabs?.set&&d(e,"tabs"),t.settings.nav?.thumbs?.set&&d(e,"thumbs"),t.settings.nav?.scrubber?.set&&c(e,"scrubber"))},select:(e,t)=>{const s=SR7.M[e];if("hero"!=s.settings.type){for(let e of["bullets","tabs","thumbs","scrubber"]){let i=0;if(s.settings?.nav?.[e]?.set)for(let a of s.c?.nav?.[e]?.elements)a.classList[a.dataset.key==t?"add":"remove"]("selected"),null!==a.getAttribute("aria-pressed")&&a.setAttribute("aria-pressed",a.dataset.key==t?"true":"false"),"scrubber"==e&&a.dataset.key==t&&s.c.nav?.scrubber?.srScrubber&&!s.c.nav.scrubber.srScrubber.dragging&&s.c.nav.scrubber.srScrubber.goTo(i),i++}SR7.F.navigation.refreshContent(e)}},refreshContent:(e,t)=>{const s=SR7.M[e];if(!s.c?.nav||!s.settings?.nav||!s.settings.nav?.arrows?.set)return;let i=s.c.nav.arrows;for(let t of["left","right"]){let a=s.slides?.[s.slideOrder[SR7.F.requestSlide({id:e,slide:i[t].dataset.dir,force:!1,getter:!0})]]?.slide;a&&(f(i[t+"_dcs"],a),void 0!==i[t+"_img_live"]&&v(e,a,i[t+"_img_live"],i[t+"_img_tmp"],s.settings.nav.arrows.m??"hslide",t))}},remove:(e,t)=>{const s=SR7.M[e],i=s?.c?.nav,a=s?.settings?.nav;i&&a&&["bullets","tabs","thumbs"].forEach((e=>{if(!a[e]?.set)return;let s=i[e].elements.findIndex((e=>e.dataset.key==t));-1!==s&&(i[e].elements[s].remove(),i[e].elements.splice(s,1))}))},showHide:(e,t,i)=>{i=i||"touchstart"==t||"mouseenter"==t;const a=SR7.M[e],r=a.c?.nav??!1;if(!r||!a.settings?.nav)return;let o=t;if(t=null==t?SR7.M[e].states.overModule?1:0:"mouseenter"==t||"touchstart"==t?1:0,r.dCalls)for(let e of r.dCalls)void 0!==e&&void 0!==e.kill&&e.kill();r.dCalls=[];let l=!1;["arrows","bullets","tabs","thumbs","scrubber"].forEach((n=>{if(!a.settings.nav?.[n]?.set)return;let d=a.settings.nav[n];t=d?.on?1:t,i=!d?.on&&i;let c="arrows"==n?[r[n].left,r[n].right]:r[n].wrap;if(0==(d?.show?.[a.LEV]??!0))_tpt.gsap.set(c,{display:"none"}),r[n+"visible"]=!1;else{if(0==r[n+"visible"]&&(null==o?_tpt.gsap.set(c,{display:"block",opacity:1}):_tpt.gsap.set(c,{display:"block"}),r[n+"visible"]=!0,l=!0),null==o)return;"arrows"==n?(1==t&&0==i&&!0!==r[n].animated&&(r.dCalls.push(s(e,0,r[n].left,0,d.l.anim,r[n].pos_left,!0)),r.dCalls.push(s(e,0,r[n].right,0,d.r.anim,r[n].pos_right,!0)),r[n].animated=!0),r.dCalls.push(s(e,d,r[n].left,t,d.l.anim,r[n].pos_left,i)),r.dCalls.push(s(e,d,r[n].right,t,d.r.anim,r[n].pos_right,i))):(1==t&&0==i&&!0!==r[n].animated&&(r.dCalls.push(s(e,0,r[n].wrap,0,d.anim,r[n].pos,!0)),r[n].animated=!0),r.dCalls.push(s(e,d,r[n].wrap,t,d.anim,r[n].pos,i)))}})),l&&requestAnimationFrame((function(){SR7.F.navigation.update(e)}))},create:(s,a=["arrows","bullets","tabs","thumbs","scrubber"])=>{const r=SR7.M[s];for(let o of a)if(r.settings.nav?.[o]?.set){r.c.nav??={},r.c.nav[o]??={};let a=r.c.nav[o],n=r.settings.nav[o],d=_tpt.collector();if("arrows"==o)for(let e of["left","right"]){const t=a[e]=d.add({tag:"sr7-arrow",datas:{dir:"left"==e?"-1":"+1"},class:"sr7-"+e+"arrow sr7-arrows "+n.key});r.settings.acc?.use&&"true"!==String(r.settings.nav?.acc?.hidden)?(t.setAttribute("aria-label","left"==e?r.settings.nav?.acc?.next??"Next":r.settings.nav?.acc?.prev??"Previous"),t.setAttribute("role","button"),t.setAttribute("tabindex",0)):t.setAttribute("aria-hidden",!0),t.innerHTML=m(n.html),a[e+"_dcs"]=t.getElementsByTagName("sr7-navdc"),n.html.includes("sr7-nav-img")&&(a[e+"_img"]=t.getElementsByClassName("sr7-nav-img"),null!==a[e+"_img"]&&void 0!==a[e+"_img"]?(a[e+"_img"]=a[e+"_img"][0],a[e+"_img_live"]=d.add({tag:"sr7-nav-img-live"}),a[e+"_img_tmp"]=d.add({tag:"sr7-nav-img-tmp"}),a[e+"_img"].appendChild(a[e+"_img_tmp"]),a[e+"_img"].appendChild(a[e+"_img_live"])):delete a[e+"_img"]),t.style.opacity=0,d.fragment.appendChild(a[e]),i(s,t,"arrow")}else if("bullets"==o){a.wrap=d.add({tag:"sr7-bullets",class:"sr7-bullets "+n.key+" sr7-nd"+SR7.gV({v:n.d,id:s,u:0})[0]+" sr7-nph"+SR7.gV({v:n.h,id:s,u:0})[0]+" sr7-npv"+SR7.gV({v:n.v,id:s,u:0})[0]}),a.wrap.style.opacity=0,d.fragment.appendChild(a.wrap),a.elements=[];let e=1;for(let t of r.slideOrder){if(r.slides[t]?.slide?.slideshow?.hfn)continue;let o=d.add({tag:"sr7-bullet",class:"sr7-bullet",datas:{key:t}});r.settings.acc?.use&&"true"!==String(r.settings.nav?.acc?.hidden)?(o.setAttribute("aria-label",(r.settings.nav?.acc?.bullet??"Bullet")+" "+e),o.setAttribute("role","button"),o.setAttribute("tabindex",0),"unset"!==String(r.settings.nav?.acc?.pressed??"unset")&&o.setAttribute("aria-pressed","false")):o.setAttribute("aria-hidden",!0),e++,o.innerHTML=g(n.html,r.slides[t].slide);let l=o.getElementsByClassName("sr7-bullimg");null!=l&&v(s,r.slides[t].slide,l[0]),i(s,o),a.wrap.appendChild(o),a.elements.push(o)}}else if("tabs"==o||"thumbs"==o){const e="tabs"==o?"sr7-tab":"sr7-thumb";a.wrap=d.add({tag:"sr7-"+o,class:"sr7-"+o+" "+n.key+" sr7-nd"+SR7.gV({v:n.d,id:s,u:0})[0]+" sr7-nph"+SR7.gV({v:n.h,id:s,u:0})[0]+" sr7-npv"+SR7.gV({v:n.v,id:s,u:0})[0]}),a.mask=d.add({tag:"sr7-tt-mask",class:"sr7-"+o+"-mask"}),a.iwrap=d.add({tag:"sr7-"+o+"-wrap",class:"sr7-ntiw"}),a.wrap.appendChild(a.mask),a.mask.appendChild(a.iwrap),a.wrap.style.opacity=0,a.wrap.style.paddingTop=a.wrap.style.paddingBottom=a.wrap.style.paddingLeft=a.wrap.style.paddingRight=(SR7.gV({v:n.wr.p,id:s,u:0})??0)+"px",SR7.F.drawBG(a.wrap,{color:n.wr.c},!0,"bg"),a.elements=[];let t=1;for(let l of r.slideOrder){if(r.slides[l]?.slide?.slideshow?.hfn)continue;let c=d.add({tag:e,class:e,datas:{key:l}});r.settings.acc?.use&&"true"!==String(r.settings.nav?.acc?.hidden)?(c.setAttribute("aria-label",(r.settings.nav?.acc?.[o]??o)+" "+t),c.setAttribute("role",r.settings.nav?.acc?.role??"button"),c.setAttribute("tabindex",0),"unset"!==String(r.settings.nav?.acc?.pressed??"unset")&&c.setAttribute("aria-pressed","false")):c.setAttribute("aria-hidden",!0),c.innerHTML=g(n.html,r.slides[l].slide),t++;let p=c.getElementsByClassName("tabs"==o?"sr7-tab-img":"sr7-thumb-img");null!=p&&v(s,r.slides[l].slide,p[0]),i(s,c),a.iwrap.appendChild(c),a.elements.push(c)}}else if("scrubber"==o){const i=SR7.gV({v:n.h,id:s,u:0}),l=SR7.gV({v:n.v,id:s,u:0}),c="horizontal"==SR7.gV({v:n.d,id:s,u:0});a.wrap=d.add({tag:"sr7-"+o,class:"sr7-"+o+" "+n.key+" sr7-nd"+SR7.gV({v:n.d,id:s,u:0})[0]+" sr7-nph"+SR7.gV({v:n.h,id:s,u:0})[0]+" sr7-npv"+SR7.gV({v:n.v,id:s,u:0})[0]}),a.iWrap=d.add({tag:"sr7-"+o+"-wrap",class:"sr7-"+o+"-wrap"}),a.handle=d.add({tag:"sr7-"+o+"-handle",class:"sr7-"+o+"-handle"}),a.svg=new t({id:s,tp:n.tp,d:c}),a.iWrap.appendChild(a.svg.svg),a.svg.svg.style.position="absolute",c&&n.ha&&(a.rightHandleArrow=d.add({tag:"sr7-"+o+"-hra",class:"sr7-"+o+"-hra sr7-"+o+"-ha"}),a.leftHandleArrow=d.add({tag:"sr7-"+o+"-hla",class:"sr7-"+o+"-hla sr7-"+o+"-ha"}),a.handle.appendChild(a.rightHandleArrow),a.handle.appendChild(a.leftHandleArrow)),a.wrap.appendChild(a.iWrap),a.iWrap.appendChild(a.handle),a.wrap.style.opacity=0,a.wrap.style.paddingTop=a.wrap.style.paddingBottom=a.wrap.style.paddingLeft=a.wrap.style.paddingRight=(SR7.gV({v:n.wr.p,id:s,u:0})??0)+"px",SR7.F.drawBG(a.wrap,{color:n.wr.c},!0,"bg"),a.elemsWrap=d.add({tag:"sr7-"+o+"-thumbwrap",class:"sr7-"+o+"-thumbwrap"}),a.elements=[];for(let e of r.slideOrder){if(r.slides[e]?.slide?.slideshow?.hfn)continue;let t=d.add({tag:"sr7-"+o+"-thumb",class:"sr7-"+o+"-thumb",datas:{key:e}});if(t.innerHTML=g(n.html,r.slides[e].slide),n.tn){let i=t.getElementsByClassName("sr7-scrubber-img");null!=i&&v(s,r.slides[e].slide,i[0])}a.elemsWrap.appendChild(t),a.elements.push(t)}if(a.handle.appendChild(a.elemsWrap),d.fragment.appendChild(a.wrap),n.hp&&r.settings.slideshow.auto){const e="left"===n.pa&&c?"0% 50%":"left"!==n.pa||c?"center"===n.pa?"50% 50%":c?"100% 50%":"50% 100%":"50% 0%";a.progress=d.add({tag:"sr7-"+o+"-progress",class:"sr7-"+o+"-progress"}),a.handle.appendChild(a.progress),a.progTween=_tpt.gsap.fromTo(a.progress,{scaleX:c?0:1,scaleY:c?1:0,transformOrigin:e},{scaleX:1,scaleY:1}),a.progTween.pause()}if(a.hoverTween=_tpt.gsap.timeline(),100!=n.sc){const e=("left"===i?"0%":"center"===i?"50%":"100%")+" "+("top"===l?"0%":"center"===l?"50%":"100%");a.hoverTween.fromTo(a.iWrap,{transformOrigin:e,scaleX:c?1:n.sc/100,scaleY:c?n.sc/100:1},{duration:.2,scaleX:1,scaleY:1},0)}if(0!==n.to&&a.hoverTween.fromTo(a.elemsWrap,{opacity:0},{duration:.2,opacity:1},0),c&&n.ha){const t=e(n,!0,"left"),s=e(n,!0,"right");a.hoverTween.fromTo(a.leftHandleArrow,t.from,t.to,.2).fromTo(a.rightHandleArrow,s.from,s.to,.2)}a.hoverTween.pause()}l({css:n.css??"",key:n.key,within:r.c.module.id,id:s,cst:r.settings.nav[o].cst,def:r.settings.nav[o].def});for(let e in r.slides)void 0!==r.slides[e]?.slide?.nav?.[o]&&l({css:n.css??"",key:n.key,within:r.c.module.id,id:s,navkey:r.settings.nav[o].key,cst:r.settings.nav[o].cst,def:r.settings.nav[o].def,scst:r.slides[e].slide.nav[o],sid:e});d.append("o"==n.io?r.c.module:r.c.content)}o(s),requestAnimationFrame((function(){SR7.F.navigation.update(s),SR7.M[s].states.overModule??=SR7.M[s].c.module.matches(":hover"),SR7.M[s].states.overModule?SR7.F.navigation.showHide(s,"mouseenter"):SR7.F.navigation.showHide(s,"mouseleave",!0)}))}};const e=function(e,t,s){const i={scale:t?0:1,opacity:t?0:1,rotation:t?180:-180,x:t?"left"===s?e.tr:-e.tr:0},a={scale:t?1:0,opacity:t?1:0,rotation:0,x:t?0:"left"===s?e.tr:-e.tr};return e.asc||(delete i.scale,delete a.scale),e.sp||(delete i.rotation,delete a.rotation),0===e.tr&&(delete i.x,delete a.x),e.f||(delete i.opacity,delete a.opacity),a.duration=.2,{from:i,to:a}},t=function(e){const t="http://www.w3.org/2000/svg";this.s=e,this.svg=document.createElementNS(t,"svg"),this.svg.style.display="block",this.rect=document.createElementNS(t,"rect"),this.pattern=document.createElementNS(t,"pattern"),this.pattern.setAttributeNS(null,"patternUnits","userSpaceOnUse"),this.pattern.setAttributeNS(null,"id",this.s.id+"-pattern"),"dots"===e.tp?(this.circle=document.createElementNS(t,"circle"),this.circle.setAttributeNS(null,"class","pattern-color"),this.pattern.appendChild(this.circle)):"vlines"!==this.s.tp&&"hlines"!==this.s.tp||(this.circle=document.createElementNS(t,"rect"),this.circle.setAttributeNS(null,"class","pattern-color"),this.pattern.appendChild(this.circle)),this.svg.appendChild(this.pattern),this.svg.appendChild(this.rect),this.rect.setAttributeNS(null,"fill","url(#"+this.s.id+"-pattern")};t.prototype.resize=function(){if(this.s.d?(this.dw=this.w,this.dh=this.h):(this.dw=this.h,this.dh=this.w),this.svg.style.width=this.w+"px",this.svg.style.height=this.h+"px",this.rect.setAttributeNS(null,"width",this.w),this.rect.setAttributeNS(null,"height",this.h),this.pattern.setAttributeNS(null,"width",this.dh),this.pattern.setAttributeNS(null,"height",this.dh),"dots"===this.s.tp)this.circle.setAttributeNS(null,"cx",this.dh/2),this.circle.setAttributeNS(null,"cy",this.dh/2),this.circle.setAttributeNS(null,"r",1);else if("vlines"===this.s.tp||"hlines"===this.s.tp){var e="vlines"===this.s.tp?1:this.dh/4,t="vlines"===this.s.tp?this.dh/4:1;this.circle.setAttributeNS(null,"x",(this.dh-e)/2),this.circle.setAttributeNS(null,"y",(this.dh-t)/2),this.circle.setAttributeNS(null,"width",e),this.circle.setAttributeNS(null,"height",t)}};const s=(e,t,s,i,a,r,o)=>_tpt.gsap.delayedCall(o?0:SR7.gV({v:t[1==i?"dIn":"dOut"],id:e,u:0})/1e3,(function(e,t,s,i,a){void 0!==e.anim&&e.anim.kill();let r=Math.max(.01,1==i?t*(1-e.style.opacity):t*e.style.opacity),o=((e="fade",t=1,s={x:0,y:0})=>{let i=1==t?{opacity:1,pointerEvents:"auto",ease:"power3.inOut"}:{opacity:0,ease:"power3.inOut"};return"left"!=e&&"right"!=e||(i.x=1==t?s.x:"left"==e?s.x-50:"right"==e?s.x+50:s.x),"top"!=e&&"bottom"!=e||(i.y=1==t?s.y:"top"==e?s.y-50:"bottom"==e?s.y+50:s.y),"zoomin"==e?i.scaleX=i.scaleY=1==t?1:.5:"zoomout"==e&&(i.scaleX=i.scaleY=1==t?1:1.2),i})(s,i,a);i||(o.onCompleteParams=[e],o.onComplete=e=>{e.style.pointerEvents="none"}),e.anim=_tpt.gsap.to(e,r,o)}),[s,t.s/1e3,a,i,r]),i=(e,t,s,i)=>{t.addEventListener(_tpt.is_mobile?"touchend":"click",(function(i){this.moved||(s?SR7.F.requestSlide({id:e,slide:this.dataset.dir}):SR7.F.requestSlide({id:e,slide:"#"+this.dataset.key})),_tpt.is_mobile&&requestAnimationFrame((function(){t.classList.remove("sr7-touchhover")}))})),_tpt.is_mobile&&t.addEventListener("touchmove",(function(e){(Math.abs(e.touches[0].clientX-this.startX)>5||Math.abs(e.touches[0].clientY-this.startY)>5)&&(this.moved=!0)}))},a=e=>{const t=SR7.M[e];if(void 0===SR7.M[e].states.touchListener){t.settings?.nav?.scrubber?.set&&r(e),SR7.M[e].c.module.querySelectorAll(_tpt.is_mobile?".sr7-bullet, .sr7-tab, .sr7-thumb, .sr7-rightarrow, .sr7-leftarrow":".sr7-arrows, .sr7-bullets, .sr7-bullet, .sr7-tab, .sr7-thumb, .sr7-thumbs, .sr7-tabs, .sr7-rightarrow, .sr7-leftarrow").forEach((function(e){e.addEventListener(_tpt.is_mobile?"touchstart":"mouseenter",(function(e){this.classList.add("sr7-touchhover"),_tpt.is_mobile&&(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY,this.moved=!1)})),e.addEventListener("mouseleave",(function(e){var t=this;requestAnimationFrame((function(){t.classList.remove("sr7-touchhover")}))}))})),SR7.M[e].states.touchListener=!0}},r=function(e){const t=SR7.M[e];let s=SR7.M[e].c.module.querySelector(100===t.settings.nav.scrubber.sc?".sr7-scrubber-handle":".sr7-scrubber");s.addEventListener(_tpt.is_mobile?"touchstart":"mouseenter",(function(s){this.classList.add("sr7-touchhover"),t.c.nav?.scrubber?.hoverTween&&t.c.nav.scrubber.hoverTween.play(),t.c.nav.scrubber.progTween?.progress&&t.c.nav.scrubber.progTween.progress(1),SR7.slideShow.pause(e)})),s.addEventListener(_tpt.is_mobile?"touchend":"mouseleave",(function(s){var i=this;requestAnimationFrame((function(){t.c.nav?.scrubber?.srScrubber?.dragging||(i.classList.remove("sr7-touchhover"),t.c.nav?.scrubber?.hoverTween&&(t.c.nav.scrubber.hoverTween.reverse(),SR7.slideShow.resume(e)))}))}))},o=e=>{void 0===SR7.M[e].states.navSHListener&&(SR7.F.module.listeners.reg(e,_tpt.is_mobile?"touchstart touchend":"mouseenter mouseleave",(function(e,t){SR7.F.navigation.showHide(e,t.type)})),SR7.M[e].states.navSHListener=!0)},l=e=>{let{within:t,key:s,scst:i,sid:a,navkey:r}=e,o=new RegExp(`\\.(${s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}[^,{]*)(?=,|{)`,"g"),l=SR7.F.navCSS(e);_tpt.injectCssJs(l.replace(o,`#${t+(r&&a&&i?'[data-current="'+a+'"]':"")} .$1`),void 0,void 0,e.id+"_navigationstyles"+(e.sid?"_"+e.sid:""))};SR7.F.navCSS=e=>{let{css:t,cst:s={},def:i={},scst:a}=e,r=""+t;const o=r.match(/##(.*?)##/g);if(o)for(let e=0;e<o.length;e++){const t=o[e].slice(2,-2);a&&a.hasOwnProperty(t)?r=r.replaceAll(o[e],a[t]):s.hasOwnProperty(t)&&s[t+"-def"]?r=r.replaceAll(o[e],s[t]):i.hasOwnProperty(t)&&(r=r.replaceAll(o[e],i[t].data))}return r};const n=e=>{const t=SR7.M[e],s=t.settings.nav.bullets,i=t.c.nav.bullets;if(!i.elements.length)return;const a={w:i.elements[0].offsetWidth,h:i.elements[0].offsetHeight},r={w:0,h:0},o="horizontal"==SR7.gV({v:s.d,id:e,u:0});for(let e of i.elements)e.style.top=o?"0px":r.h+"px",e.style.left=o?r.w+"px":"0px",r.w=o?r.w+a.w+(s.g??0):a.w,r.h=o?a.h:r.h+a.h+(s.g??0);r.w=r.w-(o?s.g??0:0),r.h=r.h-(o?0:s.g??0),i.wrap.style.width=r.w+"px",i.wrap.style.height=r.h+"px",i.pos=u(e,i.wrap,s,r,o)},d=(e,t)=>{const s=SR7.M[e],i=s.settings.nav[t];if(!s.c.nav||!s.c.nav[t])return;const a=s.c.nav[t];let r;if(0==i.size.t){let e=Math.max(0,Math.min(1,(_tpt.winW-480)/500)),t=Math.max(i.size.nw*e,i.size.mw);r={w:t,h:t/i.size.nw*i.size.nh}}else r={w:SR7.gV({v:i.size.w,id:e,u:0,a:!0}),h:SR7.gV({v:i.size.h,id:e,u:0})};const o={w:0,h:0},l={w:0,h:0},n=2*SR7.gV({v:i.wr.mx,id:e,u:0}),d=2*SR7.gV({v:i.wr.my,id:e,u:0}),c="horizontal"==SR7.gV({v:i.d,id:e,u:0}),p=SR7.gV({v:i.wr.p,id:e,u:0}),h="o"!=i.io||c?s.dims.content.h:s.dims.module.h,m={w:s.dims.content.w-2*p,h:h-2*p};let g=Math.min(SR7.gV({v:i.m,id:e,u:0}),s.len);g=Math.min(g,c?Math.ceil(s.dims.content.w/(r.w+i.g)):Math.round(h/(r.h+i.g)));let f=1;for(let e of a.elements)e.style.top=c?"0px":o.h+"px",e.style.width=r.w+"px",e.style.height=r.h+"px",f<=g&&(l.w=c?l.w+r.w+(f==g?0:i.g??0):r.w,l.h=c?r.h:l.h+r.h+(f==g?0:i.g??0)),f++;if(l.w+=c?0:n,l.h+=c?d:0,o.w=c?i.wr.s?m.w:Math.min(l.w,m.w):l.w,o.h=c?l.h:i.wr.s?m.h:Math.min(l.h,m.h),l.w=c?Math.min(o.w+n,r.w*g+((g-1)*i.g??0)+n):l.w,l.h=c?l.h:Math.min(o.h+d,r.h*g+((g-1)*i.g??0)+d),i.wr.s){let t=SR7.gV({v:i.h,id:e,u:0}),s=SR7.gV({v:i.v,id:e,u:0});a.mask.style.left=c?"left"==t?parseInt(SR7.gV({v:i.x,id:e,u:0}))+p+"px":"right"==t?"":"50%":"",a.mask.style.right=c&&"right"==t?parseInt(SR7.gV({v:i.y,id:e,u:0}))+p+"px":"",a.mask.style.top=c||"top"==s?p+"px":"bottom"==s?"":"50%",a.mask.style.bottom=c||"bottom"!=s?"":p+"px",a.mask.style.transform="translate("+(c&&"center"==t?"-50%":"0px")+","+(c||"center"!=s?"0px":"-50%")+")"}if(a.mask.style.width=l.w+"px",a.mask.style.height=l.h+"px",a.mask.style.padding=.5*d+"px "+.5*n+"px",a.wrap.style.width=o.w+"px",a.wrap.style.height=o.h+"px",a.pos=u(e,a.wrap,i,o,c,p),l.w-=n,l.h-=d,s.settings.nav?.[t]?.set&&s.c?.nav?.[t]?.srcr){var v=s.c.nav[t].srcr.s;let e=!v.everbuild;v.everbuild=!0,v.width!==r.w&&(v.width=r.w,e=!0),v.height!==r.h&&(v.height=r.h,e=!0),v.space!==i.g&&(v.space=i.g,e=!0),v.type!==(c?"h":"v")&&(v.type=c?"h":"v",e=!0),v.wrapWidth!==l.w&&(v.wrapWidth=l.w,e=!0),v.wrapHeight!==l.h&&(v.wrapHeight=l.h,e=!0),e&&s.c.nav[t].srcr.rebuild()}else s.settings.nav?.[t]?.set&&(s.c.nav[t].srcr=new srCarousel({trigger:s.c.nav[t].wrap,wrap:s.c.nav[t].iwrap,slides:s.c.nav[t].elements,width:r.w,height:r.h,space:i.g,maxV:s.navLen,infinity:!1,spin:"off",spinA:0,align:"left",type:c?"h":"v",sightSnap:!0,dur:.3,ignoreOpacity:!0,wrapWidth:l.w,wrapHeight:l.h}))},c=(e,t)=>{const s=SR7.M[e],i=s.settings.nav[t],a=s.c.nav[t],r={w:SR7.gV({v:i.size.w,id:e,u:0,a:!0}),h:SR7.gV({v:i.size.h,id:e,u:0})},o={w:400,h:50},l="horizontal"==SR7.gV({v:i.d,id:e,u:0}),n=SR7.gV({v:i.wr.p,id:e,u:0}),d=SR7.gV({v:i.h,id:e,u:0}),c=SR7.gV({v:i.v,id:e,u:0});let h=s.navLen,m=r.h*i.hs/100;if(!l){const e=r.w;r.w=r.h,r.h=e,m=r.w*i.hs/100}o.w=Math.min(s.dims.module.w,l?Math.max(s.dims.module.w*i.ms/100,r.w*h+((h-1)*i.g??0)):r.w),o.h=Math.min(s.dims.module.h,l?r.h:Math.max(s.dims.module.h*i.ms/100,r.h*h+((h-1)*i.g??0))),a.handle.style.width=r.w+"px",a.handle.style.height=r.h+"px",100!==i.hs&&l?(a.handle.style.height=m+"px",a.handle.style.top=-(m-r.h)/2+"px",i.ho&&a.hoverTween.fromTo(a.handle,{height:r.h,top:0},{top:"bottom"===c?(r.h-m)/2:0,height:m,duration:.2},0)):100!==i.hs&&(a.handle.style.width=m+"px",a.handle.style.left=-(m-r.h)/2+"px",i.ho&&a.hoverTween.fromTo(a.handle,{left:0,width:r.w},{left:"right"===d?(r.w-m)/2:0,width:m,duration:.2},0));for(let e=0;e<s.navLen;e++){var g=a.elements[e];g.style.width=l?"100%":100*i.ts/100+"%",g.style.height=l?100*i.ts/100+"%":"100%",g.style.position="absolute",g.style.display="block",_tpt.gsap.set(g,{xPercent:l?0:"left"===d?i.to:-i.to,yPercent:l?"top"===c?i.to:-i.to:0})}let f=o.w,v=o.h;o.w=l?i.wr.s?s.dims.module.w-2*n:Math.min(o.w,s.dims.module.w-2*n):r.w,o.h=l?r.h:i.wr.s?s.dims.module.h-2*n:Math.min(o.h,s.dims.module.h-2*n),a.wrap.style.width=a.iWrap.style.width=o.w+"px",a.wrap.style.height=a.iWrap.style.height=o.h+"px",a.svg&&(a.svg.w=o.w,a.svg.h=o.h,a.svg.resize()),i.wr.s&&(f=o.w,v=o.h),o.w+=2*n,o.h+=2*n,a.pos=u(e,a.wrap,i,o,l,n),s.settings.nav?.[t]?.set&&s.c?.nav?.[t]?.srScrubber?(a.srScrubber.s.d=l,a.srScrubber.s.ww=f,a.srScrubber.s.wh=v,a.srScrubber.s.w=r.w,a.srScrubber.s.h=r.h,a.srScrubber.s.padding=n,a.srScrubber.s.space=i.g,a.srScrubber.resize()):s.settings.nav?.[t]?.set&&(s.c.nav[t].srScrubber=new p({elems:a.elements,handle:a.handle,d:l,ww:f,wh:v,w:r.w,h:r.h,padding:n,space:i.g,sk:i.sk,cor:i.cor,changeSlide:function(t){("carousel"!==s.settings.type||s.settings.carousel.justify)&&SR7.F.requestSlide({id:e,slide:"#"+a.elements[t].dataset.key})},changeProgress:function(e,t){"carousel"===s.settings.type&&!s.settings.carousel.justify&&s.c.carousel?.src&&s.c.carousel.src.rebuild({p:e,targetIndex:t})},onInteract:function(){s.c.nav.scrubber.progTween?.progress&&s.c.nav.scrubber.progTween.progress(1)},onIdle:function(){SR7.slideShow.resume(e),a.wrap.classList.remove("sr7-touchhover"),s.c.nav.scrubber?.hoverTween&&s.c.nav.scrubber.hoverTween.reverse()}}))},p=function(e){this.s=e,this.setDefaults(),this.len=e.elems.length,this.dl=e.elems.length-1,this.hl=(this.s[this.wdim]-this.s[this.dim])/this.dl,this.updateScrubber=this.update.bind(this);const t=this;this.draggable=_tpt.draggable.create(e.handle,{type:e.d?"x":"y",inertia:!0,cursor:"grab",activeCursor:"grabbing",bounds:e.d?{minX:0,maxX:e.ww-e.w}:{minY:0,maxY:e.wh-e.h},throwResistance:1e4,edgeResistance:.8,minDuration:.1,maxDuration:1.5,onPress:function(){t.dragging=!0,e.onInteract&&e.onInteract()},onDrag:this.updateScrubber,onThrowUpdate:this.updateScrubber,onClick:function(){t.dragging=!1,e.onIdle&&e.onIdle()},onThrowComplete:function(){t.dragging=!1,e.onIdle&&e.onIdle()},snap:{[e.d?"x":"y"]:function(e){return Math.round(e/t.hl)*t.hl}},zIndexBoost:!1,allowContextMenu:!0})[0],this.clampIndex=_tpt.gsap.utils.clamp(0,this.len-1),this.lerpHandler=this.lerp.bind(this),this.v=this.lv=0};p.prototype.setDefaults=function(){this.s.d?(this.tr="x",this.dim="w",this.wdim="ww"):(this.tr="y",this.dim="h",this.wdim="wh")},p.prototype.resize=function(){this.hl=(this.s[this.wdim]-this.s[this.dim])/this.dl,this.draggable.applyBounds({minX:0,maxX:this.s[this.wdim]-this.s[this.dim],minY:0,maxY:this.s[this.wdim]-this.s[this.dim]}),_tpt.gsap.set(this.s.handle,{[this.tr]:this.hl*this.lastIndex})},p.prototype.update=function(){var e=this.hl;const t=this;let s=this.draggable[this.tr]/e,i=-this.draggable[this.tr]%e/e,a=this.clampIndex(Math.round(this.draggable[this.tr]/e));s<=-1?i=1:s>=this.len&&(i=-1),a!==this.lastIndex&&(_tpt.gsap.to(this.s.elems,{opacity:0}),_tpt.gsap.to(this.s.elems[a],{opacity:1}),t.s.cor&&t.draggable.isPressed||(this.lastIndex=a),this.s.changeSlide&&(this.scDelay&&this.scDelay.pause&&this.scDelay.pause(),this.scDelay=_tpt.gsap.delayedCall(.2,(function(){t.s.cor&&t.draggable.isPressed||t.s.changeSlide(a)})))),this.v=this.draggable[this.tr],this.tick||0===this.s.sk||(this.tick=requestAnimationFrame(this.lerpHandler)),this.s.changeProgress&&this.s.changeProgress(i,this.clampIndex(Math.floor((this.draggable[this.tr]-this.draggable[this.tr]%e)/e)))},p.prototype.lerp=function(){this.tick=cancelAnimationFrame(this.tick),this.tick||(this.tick=requestAnimationFrame(this.lerpHandler));let e=this.v-this.lv;this.lv+=.2*e,_tpt.gsap.set(this.s.elems,{[this.s.d?"skewX":"skewY"]:this.s.sk*Math.max(-1,Math.min(1,e/100)),[this.tr]:-e/2})},p.prototype.rebuild=function(e){let{p:t,targetIndex:s}=e;this.lv=-t*this.hl+this.hl*s,_tpt.gsap.set(this.s.handle,{[this.tr]:-t*this.hl+this.hl*s})},p.prototype.goTo=function(e){const t=this;this.lv=this.hl*e,_tpt.gsap.to(this.s.handle,{[this.tr]:this.hl*e,onUpdate:function(){t.updateThumbs()}})},p.prototype.updateThumbs=function(){let e=parseFloat(this.s.handle._gsap[this.tr]),t=this.clampIndex(Math.round(e/this.hl));t!==this.lastIndex&&(_tpt.gsap.to(this.s.elems,{opacity:0}),_tpt.gsap.to(this.s.elems[t],{opacity:1}))};const h=e=>{const t=SR7.M[e];if(null!=t.c.nav)for(let s of["left","right"])t.c.nav.arrows["pos_"+s]=u(e,t.c.nav.arrows[s],t.settings.nav.arrows[s[0]],{w:t.c.nav.arrows[s].offsetWidth,h:t.c.nav.arrows[s].offsetHeight})},u=(e,t,s,i,a,r)=>{const o=SR7.M[e];let l="o"==s.io&&o.settings.size.fullWidth?o.dims?.moduleRect?.x??0:0,n=(o.dims.content.h-o.dims.CFC.h)/2,d={left:s.wr?.s&&a?"o"===s.io?-l:0:"left"==SR7.gV({v:s.h,id:e,u:0})?"grid"==s.a?parseInt(o.dims.CFC.x)+"px":0-l+"px":"right"==SR7.gV({v:s.h,id:e,u:0})?"auto":"50%",right:s.wr?.s&&a?0:"right"==SR7.gV({v:s.h,id:e,u:0})?"grid"==s.a?o.dims.content.w-(parseInt(o.dims.CFC.x)+parseInt(o.dims.CFC.w))+"px":0-l+"px":"auto",top:s.wr?.s&&!a?0:"top"==SR7.gV({v:s.v,id:e,u:0})?("grid"==s.a?n:0)+"px":"bottom"==SR7.gV({v:s.v,id:e,u:0})?"auto":"50%",bottom:s.wr?.s&&!a?0:"bottom"==SR7.gV({v:s.v,id:e,u:0})?("grid"==s.a?n:0)+"px":"auto",x:s.wr?.s&&a?0:"center"==SR7.gV({v:s.h,id:e,u:0})?parseInt(SR7.gV({v:s.x,id:e,u:0}))-i.w/2-(r??0):"right"==SR7.gV({v:s.h,id:e,u:0})?0-parseInt(SR7.gV({v:s.x,id:e,u:0})):parseInt(SR7.gV({v:s.x,id:e,u:0})),y:s.wr?.s&&!a?0:"center"==SR7.gV({v:s.v,id:e,u:0})?parseInt(SR7.gV({v:s.y,id:e,u:0}))-i.h/2-(r??0):"bottom"==SR7.gV({v:s.v,id:e,u:0})?0-parseInt(SR7.gV({v:s.y,id:e,u:0})):parseInt(SR7.gV({v:s.y,id:e,u:0}))};return _tpt.gsap.set(t,d),d},m=(e,t)=>{e=e.replaceAll("{{title}}",'<sr7-navdc data-type="title"></sr7-navdc>').replaceAll("{{description}}",'<sr7-navdc data-type="description"></sr7-navdc>');for(let t=0;t<10;t++)e=e.replaceAll("{{params"+t+"}}",'<sr7-navdc data-type="params" data-index="'+t+'" ></sr7-navdc>');return e},g=(e,t)=>{e=e.replaceAll("{{title}}",t.title).replaceAll("{{description}}",t.description);let s,i=new DOMParser;for(let a=1;a<=10;a++)s=i.parseFromString(t?.params?.[a-1]?.v??"","text/html"),e=e.replaceAll("{{param"+a+"}}",String(s.body.textContent||"").substr(0,parseInt(t.params?.[a-1]?.l??500)));return e},f=(e,t)=>{for(let s of e)s.textContent=void 0!==s.dataset.index?t.params?.[s.dataset.index]?.v??"":t?.[s.dataset.type]??""},v=(e,t,s,i,a,r)=>{let o=t?.thumb?.src??"",l=SR7.F.getSlideBG(e,t.id)?.bg;o=""!=o||l?o:t?.thumb?.admin??"",o=""==o||"#"==o[o.length-1]||o.includes("://server.local/")&&!window.location.hostname.startsWith("server.local")?l:{image:{src:o,size:"cover",repeat:"no-repeat",pos:{x:"center",y:"center"}}},o=0==(o?.image?.src??!1)?0==(o?.video?.poster?.src??!1)?o:{image:{src:o?.video.poster.src,size:"cover",repeat:"no-repeat",pos:{x:"center",y:"center"}}}:o,o=null==o?{image:{src:o,size:"cover",repeat:"no-repeat",pos:{x:"center",y:"center"}}}:o,o.slidebg=l,o?.image?.src?_tpt.registerImage(o.image.src,0,(function(e){if("error"==e.state)return console.log("Fall back to Slide Image instead of Thumbnail"),y(s,i,o.slidebg,a,r);y(s,i,o,a,r)}),"load_nav_thumbnail_"+Math.round(1e4*Math.random()),void 0,"youtube"!==(SR7.M[e].settings?.source?.type??"")):y(s,i,o,a,r)},y=(e,t,s,i="",a)=>{if(""==i)void 0!==e&&SR7.F.drawBG(e,s,void 0,"bg"),void 0!==t&&SR7.F.drawBG(t,s,void 0,"bg");else{if("simple"==i||"fade"==i)return void _tpt.gsap.fromTo(e,.4,{opacity:0},{opacity:1,onStart:function(){SR7.F.drawBG(e,s,void 0,"bg")},onComplete:function(){SR7.F.drawBG(t,s,void 0,"bg")}});if("hslide"==i){let i=e.parentNode.style.overflow;e.parentNode.style.overflow="hidden",_tpt.gsap.fromTo(t,.4,{opacity:1,x:"0%"},{opacity:1,x:"left"==a?"100%":"-100%"}),_tpt.gsap.fromTo(e,.4,{opacity:1,x:"left"==a?"-100%":"100%"},{opacity:1,x:"0%",onStart:function(){t.style.opacity=1,SR7.F.drawBG(e,s,void 0,"bg")},onComplete:function(){t.style.opacity=0,SR7.F.drawBG(t,s,void 0,"bg"),e.parentNode.style.overflow=i}})}}};_tpt.R??={},_tpt.R.navigation=_tpt.extend?_tpt.extend(_tpt.R.navigation,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},SR7.D??={},void 0!==SR7.F.prepareSlides)return;const e=(e,t,s,i)=>{const a=`${t}STR${s+1}`;e.slides[a]=_tpt.extend({},SR7.M[i].slides[t]),e.slides[a].slide.order=s+1,e.slides[a].slide.id=a},t=async(t,s,i)=>new Promise((async a=>{if(null==s?.sourceSlideId||null==s?.sourceModuleId)return void a(!1);let r,o=SR7.E?.v6v7ids?.n?.[s?.sourceSlideId];for(let e in SR7.JSON)if(!r&&String(SR7.JSON[e]?.id)===String(s?.sourceModuleId))if(SR7.JSON[e]?.slides?.[s?.sourceSlideId])r=e;else for(let t in SR7.JSON[e]?.slides)String(SR7.JSON[e]?.slides[t]?.slide?.id)===String(s?.sourceSlideId)||String(SR7.JSON[e]?.slides[t]?.id)===String(s?.sourceSlideId)?r=e:String(SR7.JSON[e]?.slides[t]?.slide?.id)!==String(o)&&String(SR7.JSON[e]?.slides[t]?.id)!==String(o)||(r=e,s.sourceSlideId=o);void 0!==r&&void 0===SR7.M[r]&&(SR7.M[r]={},SR7.M[r].c={},await SR7.F.prepareModule({id:s?.sourceModuleId,result:SR7.JSON[r],onlyPrepare:!0})),void 0===r?(r=s?.sourceModuleId,_tpt.restAPI({action:"get_full_slider_object",version:s?.sourceModuleEngine??7,id:r,callBack:async l=>{try{l="object"!=typeof l?JSON.parse(l):l}catch(e){l=_tpt.fixResponse(l)}!1===l.success?a(!1):(SR7.F.regAddonResources(l.addOns??{}),SR7.JSON??={},SR7.JSON[r]=l,SR7.M[r]={},SR7.M[r].c={},await SR7.F.prepareModule({id:r,result:l,onlyPrepare:!0}),void 0===SR7.M[r].slides[s?.sourceSlideId]&&(null==o&&(o=l?.v6v7ids?.n?.[s?.sourceSlideId]),void 0!==o&&(s.sourceSlideId=o)),e(t,s?.sourceSlideId,i,r),a(!0))}})):(e(t,s?.sourceSlideId,i,r),a(!0))})),s=s=>{const i=SR7.M[s];return(e=>{const t=SR7.M[e];return new Promise((s=>{if(void 0!==t.stream&&Object.keys(t.stream).length>0)s();else{let i="wp-gallery"==t.settings.source.type?t.settings.source.sourceids:t.settings?.dbid??"";i=""==i?t.c?.module?.dataset?.id??e.replace("SR7_","").split("_")[0]:i,_tpt.restAPI({action:"get_stream_data",id:i,callBack:e=>{if("object"!=typeof e)try{e=JSON.parse(e)}catch(t){e=_tpt.fixResponse(e)}0==e.success?console.log("Feed could not be Loaded"):(delete e.success,t.stream=e.data),s()}})}}))})(s).then((async()=>{const a=Object.entries(i.slides).filter((([e,{slide:t}])=>_tpt.hop(i.slides,e)&&!t.global));if(i.slideTMP=a.map((([e,{slide:t}])=>({key:e,order:t.order-1}))),null==i.stream||0==Object.keys(i.stream).length){let e=i.settings.source.type.charAt(0).toUpperCase()+i.settings.source.type.slice(1);return void SR7.F.errorSlide({id:s,subtitle:e+" reports: Please check the settings"})}const r=Object.keys(i.stream).length;if(0==r)return;const{length:o}=i.slideTMP;let l=0;SR7.JSON??={};for(let a=0;a<r;a++){await t(i,i.stream[a],a)||e(i,i.slideTMP[l++%o].key,a,s)}for(let e of i.slideTMP){i.c.slides[e.key]&&i.c.slides[e.key].parentNode.removeChild(i.c.slides[e.key]);let t=document.getElementById(s+"-"+e.key);t&&t.parentNode.removeChild(t),delete i.slides[e.key]}i.fromStream=!0}))};SR7.F.errorSlide=({id:e,title:t="There is nothing to show here!",subtitle:s="Instagram reports: Please check the settings",icon:i='<i class="fa-warning"></i>',bg:a="#ffffff"})=>{const r=SR7.M[e];r.migrate=void 0,r.settings.type="hero",r.settings.nav=void 0,r.slides={error:{slide:{id:"error",version:"7.0.0",order:1},layers:{1:{id:1,content:{text:s},pos:{y:["21px","21px","17px","12px","7px"],h:["center"],v:["middle"],pos:"absolute"},tl:{in:{content:{all:[{pE:"d",sX:.9,sY:.9,o:0},{t:370,d:850,f:850,pE:"d",sX:1,sY:1,o:1}]}},out:{content:{all:[{t:0,d:300,f:300,pE:"n",o:0}]}}},tA:["center"],color:["#000000"],font:{family:"'Arial, Helvetica, sans-serif'",size:["#a",20,16,12,7],weight:["200","200","200","200","200"],ls:[0,0,0,0,0]},lh:["#a",20,16,12,7],type:"text"},2:{id:2,content:{text:t},pos:{y:["-20px","-20px","-16px","-12px","-7px"],h:["center"],v:["middle"],pos:"absolute"},tl:{in:{content:{all:[{pE:"d",sX:.9,sY:.9,o:0},{t:200,d:1e3,f:1e3,pE:"d",sX:1,sY:1,o:1}]}},out:{content:{all:[{t:0,d:300,f:300,pE:"n",o:0}]}}},tA:["center"],color:["#000000"],font:{family:"'Arial, Helvetica, sans-serif'",size:["30px","30px","24px","18px","11px"],weight:["200","200","200","200","200"],ls:[0,0,0,0,0]},lh:["30px","30px","24px","18px","11px"],type:"text"},3:{id:3,content:{text:i},pos:{y:["-70px","-70px","-57px","-43px","-26px"],h:["center"],v:["middle"],pos:"absolute"},tl:{in:{content:{all:[{pE:"d",sX:.9,sY:.9,o:0},{t:0,d:1040,f:1040,pE:"d",sX:1,sY:1,o:1}]}},out:{content:{all:[{t:0,d:300,f:300,pE:"n",o:0}]}}},tA:["center"],color:["#000000"],font:{family:"'Arial, Helvetica, sans-serif'",size:["50px","50px","41px","31px","19px"],weight:[400,400,400,400,400],ls:[0,0,0,0,0]},lh:["50px","50px","41px","31px","19px"],type:"text"},4:{id:4,subtype:"slidebg",size:{cMode:"cover"},bg:{color:a},tl:{in:{bg:{ms:1e3,rnd:!1,temp:{t:"*opacity* Fade In",p:"fade",m:"basic",g:"fade"},in:{o:0},out:{a:!1}}}},type:"shape"}}}},r.slides.error=_tpt.extend(r.slides.error,SR7.D.slideObj(e,r.slides.error.slide,1)),r.slides.error.layers=_tpt.extend(r.slides.error.layers,SR7.D.layerObjects({id:e,slide:r.slides.error,sid:"error",msource:"gallery"}))},SR7.F.prepareSlide=(e,t,s,a)=>{const r=SR7.M[e];r.zones[t]??={};let o=r.slides[t].slide?.attr?.id??"";if(o=""==o?e+"-"+t:o,r.c.slides[t]=document.getElementById(o),r.fromStream&&!r.slides[t].slide.global){r.slides[t].slide.title=SR7.F.getFeed(r,r.slides[t].slide.order,"title"),r.slides[t].slide.thumb.src=SR7.F.getFeed(r,r.slides[t].slide.order,"thumb",void 0,void 0,r.slides[t].slide.thumb?.default?.image?.src);for(let s=0;s<=r.slides[t].slide?.actions?.length;s++)r.slides[t]?.slide?.actions?.[s]?.link&&(r.slides[t].slide.actions[s]=_tpt.extend({},r.slides[t].slide.actions[s]),r.slides[t].slide.actions[s].link?.includes("{{")&&(r.slides[t].slide.actions[s].link=SR7.F.updateDynamicMetas(e,r.slides[t].slide.order,r.slides[t].slide.actions[s].link)));for(let s=0;s<=10;s++)void 0!==(r.slides[t]?.slide?.params?.[s]??void 0)&&(r.slides[t].slide.params[s].v=SR7.F.updateDynamicMetas(e,r.slides[t].slide.order,r.slides[t].slide.params[s].v).trim().replaceAll("<br>","").replace(/  +/g," "))}null==r.c.slides[t]&&(s??=_tpt.collector(),r.c.slides[t]=s.add({tag:"sr7-slide",id:e+"-"+t,class:r.slides[t].slide.global?"sr7-staticslide":"",datas:{key:t}})),!r.slides[t].slide.global&&r.settings.acc?.use&&("unset"!==String(r.slides[t].slide.acc.label).toLowerCase()&&""!==String(r.slides[t].slide.acc.label).toLowerCase()&&r.c.slides[t].setAttribute("aria-label","auto"==String(r.slides[t].slide.acc.label).toLowerCase()?""==r.slides[t].slide.title?"Slide "+r.slides[t].slide.order:r.slides[t].slide.title:r.slides[t].slide.acc.label),r.c.slides[t].setAttribute("aria-hidden","false"==String(r.slides[t].slide.acc.hidden)?"false":"true"),"unset"!==String(r.slides[t].slide.acc.role).toLowerCase()&&(r.c.slides[t].setAttribute("aria-roledescription",r.slides[t].slide.acc.roledep??"slide"),r.c.slides[t].setAttribute("aria-role",r.slides[t].slide.acc.role??"presentation")));for(let s in r.slides[t].slide.addOns){if(!_tpt.hop(r.slides[t].slide.addOns,s))continue;SR7.A?.[s]?.prepareSlide&&SR7.A[s].prepareSlide(e,t)}return r.slides[t].slide.global?(a+=(""==a?"":",")+t,r.c.slides[t].classList.add("sr7-staticslide"),r.c.slides[t].classList.add("back"==r.slides[t].slide.pos?"sr7-staticslide-low":"sr7-staticslide-high"),r.c.slides[t].style.pointerEvents="none",r.staticDiffLayers&&(s??=_tpt.collector(),r.c.slides[t+"_2"]=s.add({tag:"sr7-slide",id:e+"-"+t+"_2",class:"sr7-staticslide "+("back"==r.slides[t].slide.pos?"sr7-staticslide-high":"sr7-staticslide-low"),datas:{key:t+"_2"}}),a+=(""==a?"":",")+t+"_2",r.slides[t+"_2"]={slide:{global:!0},layers:{}})):void 0!==r.slides[t].slide.order?r.slideOrder[r.slides[t].slide.order-1]=t:r.slideOrder.push(t),r.settings.mod.d3&&_tpt.gsap.set(r.c.slides[t],{perspective:1600,transformStyle:"preserve-3d"}),"carousel"==r.settings.type&&"v"==r.settings.carousel.type&&(r.c.slides[t].style.overflow="hidden"),i(r.slides[t].slide.actions),{missingSlides:s,staticSlides:a}},SR7.F.prepareSlides=async function(e){const t=SR7.M[e];t.slides??={},t.c.slides??={},t.zones??={};let i,a,r="";if("gallery"!==t.settings.source.type&&await s(e),"hero"==t.settings.type){t.slideOrder=Array(1);let s=999999,o="";for(a in t.slides)_tpt.hop(t.slides,a)&&(void 0!==t.slides[a].slide.order&&s>t.slides[a].slide.order&&(s=t.slides[a].slide.order,o=a),t.slides[a].slide.global?({missingSlides:i,staticSlides:r}=SR7.F.prepareSlide(e,a,i,r)):""==o&&(o=a));({missingSlides:i,staticSlides:r}=SR7.F.prepareSlide(e,o,i,r))}else for(a in t.slideOrder=Array(Object.keys(t.slides).length),t.slides)_tpt.hop(t.slides,a)&&({missingSlides:i,staticSlides:r}=SR7.F.prepareSlide(e,a,i,r));if(i&&(t.c.adjuster??=t.c.module.getElementsByTagName("sr7-adjuster")[0],t.c.content??=t.c.module.getElementsByTagName("sr7-content")[0],t.c.carousel??=t.c.module.getElementsByTagName("sr7-carousel")[0],i.append("carousel"==t.settings.type?t.c.carousel:t.c.content)),t.slideOrder=t.slideOrder.filter(Boolean),t.slideOrder=t.settings.slideshow.shuffle?_tpt.gsap.utils.shuffle(t.slideOrder):t.slideOrder,t.staticSlides=r.split(","),"carousel"==t.settings.type)for(let e in t.staticSlides)_tpt.hop(t.staticSlides,e)&&t.staticSlides[e]&&t.slides[t.staticSlides[e]].slide.respVP&&t.c.content.appendChild(t.c.slides[t.staticSlides[e]]);t.prev??={},t.current??={},t.next??={};for(let e of["index","slide","id"])t.current[e]=t.prev[e]=t.next[e]=-1;for(var o in t.navSlideOrder=[],t.slideOrder)t.slides[t.slideOrder[o]]?.slide?.slideshow?.hfn||t.navSlideOrder.push(t.slideOrder[o]);t.len=t.slideOrder.length,t.navLen=t.navSlideOrder.length};const i=e=>{if(null!=e)for(let t in e)if(_tpt.hop(e,t)&&"open_modal"==e[t].a){let s=e[t].target;if(SR7.F?.modal?.prepared?.[s])continue;SR7.F.modal.prepared??={},SR7.F.modal.prepared[s]=!0;let i=SR7.F.module.getIdByAlias(s);if(void 0!==i&&void 0!==SR7.M[i].c.module){let e=_tpt.strSetToObj(SR7.M?.[i]?.c?.module?.dataset?.modal??"");SR7.F.modal.register({id:i,alias:s,speed:parseInt(e.sp??1e3)/1e3,bg:e.bg??"transparent",pS:e.pS,v:e.v??"middle",h:e.h??"center"})}else _tpt.restAPI({action:"get_modal_settings",version:7,id:i,alias:s,forcealias:null==i,callBack:e=>{if("object"!=typeof e)try{e=JSON.parse(e)}catch(t){e=_tpt.fixResponse(e)}0==e.success?console.log(s+" Could not be Loaded from DB"):(e.sp=""==e.sp?"1000":e.sp,e.v6v7ids&&(SR7.E.v6v7ids=_tpt.extend(SR7.E.v6v7ids,e.v6v7ids)),e.trans&&(SR7.E.transtable=_tpt.extend(SR7.E.transtable,e.trans)),e.navs&&(SR7.NAV=_tpt.extend(SR7.NAV,obj.p)),SR7.F.modal.register({id:e.id,alias:s,speed:parseInt(e.sp??1e3)/1e3,bg:e.bg??"transpaent",pS:e.pS,v:e.v??"middle",h:e.h??"center"}))}})}};SR7.F.getSlideARatios=e=>{const t=SR7.M[e];if(void 0===t.slideRatios)for(let e in t.c.slides)if(_tpt.hop(t.slides,e))for(let s in t.slides[e].layers)t.slideRatios??={},_tpt.hop(t.slides[e].layers,s)&&"slidebg"==t.slides[e].layers[s].subtype&&(t.slideRatios[e]=""!=(t.slides[e].layers[s].bg?.image?.src??"")&&_tpt.getRatio((t.slides[e].layers[s].bg?.image?.ratio??void 0)||(t.slides[e].layers[s].bg?.video?.ratio??void 0)||1))};document.addEventListener("sr.slide.changeRequest",(async function(e){const t=SR7.M[e.id];if(null==t||null==t||0==t.states.inViewPort){void 0!==t.c.module.observParams&&(t.c.module.observParams.callBack=function(e){_tpt.event.trigger("dom","sr.slide.changeRequest",{id:e.id})},t.c.module.observParams.runonce=!0,t.c.module.observParams.obj=t);let e=t.settings?.vPort??"100px";return e=Array.isArray(e)?e[0]:e,void _tpt.observeModule(t.c.module,e)}SR7.F.triggerSlideEvent(e.id,"beforeChange",["onbeforeswap"]),await SR7.F.drawSlide({id:e.id,slideid:t.next.id,type:"process",global:!0,render:!0,callback:e.callback,inlayers:e.inlayers,outlayers:e.outlayers})})),SR7.F.closeSlide=async e=>{const t=SR7.M[e];-1!=t.current.id&&(await SR7.F.animateLayers({id:e,skey:t.current.id,scene:"out"}),t.current={id:-1,slide:-1,index:-1})};const a=async(e,t)=>new Promise((s=>{Object.keys(SR7.M[e].slides[t]?.layers).length>0||SR7.M[e].slides[t]?.slide?.global||0==Object.keys(SR7.M[e].slides[t]?.slide).length?s():_tpt.restAPI({action:"get_full_slider_object",version:7,id:SR7.M[e].c.module.dataset.id??e,slideid:t,callBack:t=>{if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){t=_tpt.fixResponse(t)}if(t.success){for(let s in t.slides){let i=t.slides[s].slide.id;Object.keys(SR7.M[e].slides[i]?.layers).length>0||(SR7.M[e].slides[i].layers=_tpt.extend(SR7.M[e].slides[i].layers,SR7.D.layerObjects({id:e,slide:t.slides[s],sid:i,msource:SR7.M[e].settings.source?.type??"gallery"})))}s()}}})}));SR7.F.preLoadSiblings=(e,t)=>{let s=SR7.M[e],i=s.slideOrder[t];i&&("preparing"==s.prepareMap[i]||s.prepareMap[i]||(s.prepareMap[i]="preparing",a(e,i).then((async()=>{await SR7.F.prepareLayers(e,i,!0).then((()=>{s.prepareMap[i]=!0}))}))))},SR7.F.drawSlide=async e=>{await a(e.id,e.slideid).then((async()=>{var t;0==SR7.M[e.id].c.content.offsetWidth&&await(t=SR7.M[e.id].c.content,new Promise((e=>{!function s(){t.offsetWidth>0?requestAnimationFrame((()=>e())):requestAnimationFrame(s)}()}))),await SR7.F.drawSlideProc(e)}))},SR7.F.drawSlideProc=async e=>{let{id:t,slideid:s,type:i,global:a,render:r,callback:o,inlayers:l,outlayers:n,keepSlideVisible:d}=e;const c=SR7.M[t];if(null!=SR7.M[t].slides[s]){if(SR7.preLoader.state(t)&&SR7.preLoader.state(t,c.c.slides[s])||SR7.preLoader.show(t,c.c.slides[s]),c.prepareMap??={},"preparing"==c.prepareMap[s])return setTimeout((async function(){await SR7.F.drawSlideProc(e)}),19);if(null==c.prepareMap[s]&&(c.prepareMap[s]="preparing"),await SR7.F.prepareLayers(t,s),c.fpsChecked||(_tpt.measureAverageFrameRate(4e3,t).then((e=>{c.averageFPS=e.averageFPS,c.lowFrameRateCount=e.lowFrameRateCount,c.averageFPS<30&&_tpt.event.trigger("dom","sr7.lowfps",{id:t,fps:e.averageFPS})})),c.fpsChecked=!0),c.prepareMap[s]=!0,SR7.preLoader.hide(t),SR7.preLoader.hide(t,c.c.slides[s]),"process"==i){let e=c.navLen-1;if(c.lastChangeDir=void 0!==c.current.index&&-1!==c.current.index?c.current.index<c.next.index&&c.next.index!==e||c.current.index==e&&0==c.next.index?1:c.current.index>c.next.index||0==c.current.index&&c.next.index==e?-1:1:1,!0!==d&&-1!==c.current.id&&c.current.id!==c.next.id&&await SR7.F.animateLayers({id:t,skey:c.current.id,scene:"out",layers:n}),!0!==d){for(let e of["index","slide","id"])c.prev[e]=c.current[e],c.current[e]=c.next[e],c.next[e]=-1;c.settings.acc?.use&&c.slides[c.current.id]?.slide?.acc?.label&&"auto"==String(c.slides[c.current.id]?.slide?.acc?.hidden).toLowerCase()&&(c.c.slides[c.current.id].setAttribute("aria-hidden","false"),c.c.slides[c.prev.id].setAttribute("aria-hidden","true")),c.settings.acc?.live&&"unset"!==String(c.slides[c.current.id]?.slide?.acc?.live??"unset").toLowerCase()&&_tpt.acc.announcer.update({customText:c.slides[c.current.id]?.slide?.acc?.live??void 0,moduleName:c.settings.alias,slideIndex:c.current.index,totalSlides:c.navLen,slideTitle:c.slides[c.current.id]?.slide?.title??"Slide "+(c.current.index+1)})}c.navLen>1&&c.slides[c.prev.id]?.slide.slideshow.hal&&((e,t)=>{const s=SR7.M[e];if(s.hideAfterLoop??={},s.hideAfterLoop[t]??=0,s.hideAfterLoop[t]++,s.hideAfterLoop[t]>=parseInt(s.slides[t].slide.slideshow.hal)){void 0!==SR7.F.navigation&&SR7.F.navigation.remove(e,t);let i=s.navSlideOrder.findIndex((e=>e==t));-1!==i&&s.navSlideOrder.splice(i,1),i=s.slideOrder.findIndex((e=>e==t)),-1!==i&&s.slideOrder.splice(i,1),s.current.index=s.navSlideOrder.findIndex((e=>e==s.current.id))}})(t,c.prev.id),!0!==d&&SR7.F.navigation&&SR7.F.navigation.select(t,c.current.id),c.settings.fixed||c.slides[s].slide.global||(c.c.slides[s].style.pointerEvents=c.settings.mod.d3?"none":"auto")}if(c.c.slides[s].style.visibility="visible",c.c.slides[s].style.display="block",a)for(let e in c.staticSlides)_tpt.hop(c.staticSlides,e)&&""!=c.staticSlides[e]&&await SR7.F.prepareLayers(t,c.staticSlides[e]).then((async()=>{c.c.slides[c.staticSlides[e]].style.display="block",c.c.slides[c.staticSlides[e]].style.visibility="visible",await SR7.F.drawRawLayers(t,c.staticSlides[e],"prepare"),await SR7.F.animateLayers({id:t,skey:c.staticSlides[e],scene:"out"}),await SR7.F.animateLayers({id:t,skey:c.staticSlides[e],scene:"in"})}));if(!0!==d&&SR7.F.modify.handleListeners(t),SR7.F.updateBasicMetas(t),SR7.F.drawRawLayers(t,s,"prepare"),r&&(c.firstRendering??={},c.firstRendering[s]??=!0,SR7.F.animateLayers({id:t,skey:s,layers:l})),"carousel"==c.settings.type){let i=c.c.layers?.[c.c.slideBGs[c.current.id]?.lid],a=c.c.layers?.[c.c.slideBGs[c.prev.id]?.lid];if(e.skipPan||(i?.tl?.in?.pan&&SR7.F.pan.refresh(t,c.current.id),a?.tl?.in?.pan&&a.tl.in.pan.timeScale(-3)),a?.media){let e=a.media.player.options;"1sttime"==e.autoPlay&&(e.autoPlay=!1),"no1sttime"==e.autoPlay&&(e.autoPlay=!0),a.media.pause(),e.rewind&&a.media.rewind()}for(let e in c.videosPlaying)_tpt.hop(c.videosPlaying,e)&&(c.videosPlaying[e].skey===c.current.id||c.videoDontInterrupt?.[e]||c.videosPlaying[e].pause());if(s==c.current.id)for(let e in c.videoPlayInFocus){if(!_tpt.hop(c.videoPlayInFocus,e))continue;const t=c.videoPlayInFocus[e];t.skey==c.current.id&&"false"!==String(t.options.autoPlay)&&"no1sttime"!==t.options.autoPlay&&t.play(),"no1sttime"!==t.options.autoPlay&&"1sttime"!==t.options.autoPlay||(t.carouselFirstFocus?t.options.autoPlay="no1sttime"===t.options.autoPlay:t.carouselFirstFocus=!0)}i?.media&&i.media.play(),SR7.F.modify?.processAll&&SR7.F.modify.processAll(t,"scroll")}if(requestAnimationFrame((function(){"carousel"!==c.settings.type&&(c.zones[s]?.all||!c.zones[s]?.all&&c.dims.lastZoneDefined)&&(((c.zones[s]?.all??0)<(c.dims.lastZoneHeight??0)||(c.zones[s]?.all??0)>(c.dims.lastHeight??0))&&SR7.F.updateModuleDims(t,!0),c.dims.lastHeight=c.dims.content.h,c.dims.lastZoneHeight=c.zones[s].all),c.dims.lastZoneDefined=void 0!==c.zones[s]?.all,"all"!==c.settings.carousel.showAllLayers&&s!=SR7.M[t].current.id||SR7.F.reposLayers(t),SR7.M[t].c.autoParents?.[s]&&requestAnimationFrame((async function(){c.firstRendering[s]=!1;for(let e of SR7.M[t].c.autoParents[s])("carousel"==c.settings.type&&"all"===c.settings.carousel.showAllLayers||"individual"===c.settings.carousel.showAllLayers&&SR7.M[t].slides[s].layers[e].viOC||s==SR7.M[t].current.id)&&await SR7.F.animateLayers({id:t,skey:s,layers:[e],scene:"in",caller:"update",update:"content"})}))})),"process"==i&&(c.zOrder.managed||SR7.F.swapSlidezIndex(t),"hero"!==c.settings.type&&c.len>1&&SR7.slideShow.start(t),requestAnimationFrame((()=>{_tpt.scrollObserver.run(c.c.module)})),void 0!==c.c.viSH&&(c.c.viSH.me??=SR7.F.module.listeners.reg(t,_tpt.is_mobile?"touchstart":"mouseenter",SR7.F.showHideLayersOnHover),c.c.viSH.ml??=SR7.F.module.listeners.reg(t,_tpt.is_mobile?"touchend":"mouseleave",SR7.F.showHideLayersOnHover),c.states.overModule||SR7.F.showHideLayersOnHover(t,"hide"))),"function"==typeof o&&o(t),c.c.module.dataset.current=c.current.id,"carousel"!==c.settings.type&&requestAnimationFrame((()=>{SR7.F.preLoadSiblings(t,c.current.index+1,!0),SR7.F.preLoadSiblings(t,c.current.index-1>=0?c.current.index-1:c.navLen-1,!0)})),!0===c.settings.browser.useURLDeeplink){const e=c.slides[c.current.id].slide.attr.deepLink;e&&window.location.hash!==e&&(window.location.hash=e)}}},SR7.F.swapSlidezIndex=(e,t)=>{const s=SR7.M[e];for(let e in s.c.slides)_tpt.hop(s.c.slides,e)&&!s.slides[e].slide.global&&e!==t&&e!==s.current.id&&e!==s.prev.id&&(s.c.slides[e].style.zIndex=1);void 0!==t&&void 0!==s.c.slides[t]?(s.c.slides[t].style.zIndex=5,void 0!==s.c.slides[s.current.id]&&(s.c.slides[s.current.id].style.zIndex=2)):(void 0!==s.c.slides[s.prev.id]&&(s.c.slides[s.prev.id].style.zIndex=2),void 0!==s.c.slides[s.current.id]&&(s.c.slides[s.current.id].style.zIndex=5))},SR7.F.requestSlide=function(e){let{id:t,slide:s,force:i=!1,getter:a,indicator:r}=e;var o=SR7.M[t];if("carousel"!==o.settings.type&&parseInt(o.settings?.nav?.nd??0)>0&&o.states.sceneInProgress)return o.states.waitingForNextCall=e,void(o.states.waitingForNextCallTimer||(o.states.waitingForNextCallTimer=setTimeout((()=>{SR7.F.slideDelayFinished(t)}),parseInt(o.settings.nav.nd))));delete o.states.waitingForNextCall;let l=!0;if(void 0!==s){if(s="#"==String(s)[0]&&-1==_tpt.findIndex(o.slideOrder,s.replace("#",""))?parseInt(s)>50?0:s.replace("#",""):s,"#"!==String(s)[0]){let e=o.navSlideOrder.indexOf(o.slideOrder[-1!==o.next.index?o.next.index:o.current.index]);e=-1==e?o.navSlideOrder.indexOf(o.slideOrder[o.lastNavRequested]):e,s="#"+o.navSlideOrder[_tpt.gsap.utils.wrap(0,o.navLen,"+"==(""+s)[0]||"-"==(""+s)[0]?parseInt(e)+parseInt(s):parseInt(s))]}o.required="#undefined"==s?0:_tpt.findIndex(o.slideOrder,s.replace("#","")),l=-1!==o.navSlideOrder.indexOf(o.slideOrder[o.required]),l&&(o.lastNavRequested=o.required,o.navRequired=o.navSlideOrder.indexOf(o.slideOrder[o.required]))}if(a)return o.required;if(!e.skipNav&&l&&(o.c.nav?.thumbs?.srcr&&o.c.nav.thumbs.srcr.goTo(o.navRequired??o.required),o.c.nav?.tabs?.srcr&&o.c.nav.tabs.srcr.goTo(o.navRequired??o.required)),"carousel"!=o.settings.type||"carousel"===r){if(-1==o.next.index&&-1!==o.required)o.next.index=o.required,o.required=-1,o.next.id=o.slideOrder[o.next.index],o.next.slide=o.c.slides[o.next.id];else if(!i)return;if(o.current.id!=o.next.id)_tpt.event.trigger("dom","sr.slide.changeRequest",e);else for(let e of["index","slide","id"])o.next[e]=-1}else o.c.carousel?.src&&o.c.carousel.src.goTo(o.required)},SR7.F.requestSlideFocus=(e,t)=>{const s=SR7.M[e];if(null==s)return;let i="all"==(s.settings?.carousel?.showAllLayers??!1);SR7.F.requestSlide({id:e,slide:"#"+t,indicator:s.settings.type,inlayers:i?[]:SR7.F.getCarouselLayers(e,t,"infocus"),outlayers:i?[]:SR7.F.getCarouselLayers(e,s.current.id,"outfocus"),skipNav:!0,render:!i})},SR7.F.redrawBG=async(e,t,s)=>{await SR7.F.drawSlide({id:e,slideid:t,skipPan:!0,type:"draw",global:!1,inlayers:SR7.F.getCarouselLayers(e,t,"visible"),render:s,callback:function(){"carousel"===SR7.M[e].settings.type&&SR7.F.showCarouselSlide(e,t)}})},SR7.F.nborSlide=(e,t)=>{const s=SR7.M[e];return s.current.index-1==t||s.current.index==t-1||0==s.current.index&&t==s.len-1||0==t&&s.current.index==s.len-1},SR7.slideShow={build:e=>{const t=SR7.M[e],s=t.settings.pbar,i=t.slideShow={t:0,d:0};return t.useProgressBar=void 0!==s&&s.set,void 0!==t.settings.slideshow.stopAt&&t.settings.slideshow.stopAt>=0&&(i.stopAt=parseInt(t.settings.slideshow.stopAt)),void 0!==t.settings.slideshow.loop&&t.settings.slideshow.loop>=0&&(i.loop=parseInt(t.settings.slideshow.loop)-1,i.stopAt=i.stopAt||t.navLen),!_tpt.is_mobile&&t.settings.slideshow.auto&&t.settings.slideshow.sOH&&(i.listenEnter=SR7.F.module.listeners.reg(e,_tpt.is_mobile?"touchstart":"mouseenter",SR7.slideShow.pauseOnHover),i.listenLeave=SR7.F.module.listeners.reg(e,_tpt.is_mobile?"touchstart":"mouseleave",SR7.slideShow.resumeOnLeave)),null==i.loop&&i.stopAt>=0&&(i.loop=0),t.useProgressBar?(i.c=_tpt.collector().add({tag:"canvas",class:"sr7-pbar",id:e+"-pbar"}),i.ctx=i.c.getContext("2d"),i.parts="slide"==s.base?1:t.navLen,i.gap=parseInt("slide"==s.base?0:s.g?s.gs:0),s.s=parseInt(s.s),t.c.content.appendChild(i.c),SR7.slideShow.resize(e),"cw"==s.t||"ccw"==s.t?i.r=parseInt(s.r):(i.totalSize="horizontal"===s.t?i.w:i.h,i.partSize=(i.totalSize-(i.parts-1)*i.gap)/i.parts,i._={w:parseInt("horizontal"==s.t?i.partSize:s.s),h:parseInt("horizontal"==s.t?s.s:i.partSize),x:0,y:0,gw:"horizontal"==s.t?i.gap:s.s,gh:"horizontal"==s.t?s.s:i.gap,k:"horizontal"==s.t?"x":"y"}),i.rtl="horizontal"==s.t?"right"==s.h:"vertical"==s.t&&"bottom"==s.v,i.tween=_tpt.gsap.fromTo(i,9,{t:0},{t:100,ease:"none"}),i.tween.pause(),i.tween.eventCallback("onUpdate",SR7.slideShow["cw"==s.t||"ccw"==s.t?"drawCircle":"drawBar"],[e]),i.tween.eventCallback("onComplete",(e=>{SR7.F.requestSlide({id:e,slide:"+1"}),SR7.F.triggerSlideEvent(e,"ended")}),[e]),t.settings.pbar.s=parseInt(t.settings.pbar.s),_tpt.resizeObserver.observe((e=>{SR7.slideShow.resize(e)}),19,e),i):(i.tween=_tpt.gsap.fromTo(i,9,{t:0},{t:100,ease:"none"}),i.tween.eventCallback("onComplete",(e=>{SR7.F.requestSlide({id:e,slide:"+1"}),SR7.F.triggerSlideEvent(e,"ended")}),[e]),void i.tween.eventCallback("onUpdate",(function(){t?.c?.nav?.scrubber?.progTween&&!t?.c?.nav?.scrubber?.srScrubber?.dragging&&t.c.nav.scrubber.progTween.progress(this.progress())}),[e]))},fastForward:e=>{const t=SR7.M[e],s=t.settings.pbar,i=t.slideShow;i.FF={Sindex:i.Sindex,Reverse:t.current.index<i.Sindex,extra:0!=i.tween.progress()&&t.current.index<i.Sindex,t:100*i.tween.progress()||(i.Sindex<t.current.index?0:100)},i.tweenFF=_tpt.gsap.to(i,{duration:i.tween.progress()>0?(i.FF.Reverse?i.tween.progress():1-i.tween.progress())/10:.1,ease:"none"}),i.tween&&(i.tween.progress(0),i.tween.pause()),i.tweenFF.eventCallback("onUpdate",SR7.slideShow["cw"==s.t||"ccw"==s.t?"drawCircle":"drawBar"],[e,!0]),i.tweenFF.eventCallback("onComplete",((e,t,s)=>{t.FF.Sindex<s.current.index?t.FF.Sindex++:t.FF.Sindex>s.current.index&&t.FF.Sindex--,t.FF.Reverse&&(t.tweenFF.invalidate(),t.FF.t=100),t.FF.Sindex!==s.current.index||t.FF.extra?t.tweenFF.play(0):SR7.slideShow.play(e),t.FF.extra=!1,t.tweenFF.duration(.1)}),[e,i,t])},nullTimer:e=>{const t=SR7.M[e],s=t.slideShow;t.useProgressBar=!1,t.settings.slideshow.auto=!1,void 0!==s&&void 0!==s.c&&_tpt.gsap.to(s.c,.5,{opacity:0,onComplete:()=>{s.c.remove()}})},pauseOnHover:(e,t)=>{SR7.M[e].slideShow.sOH=!0,SR7.slideShow.pause(e,t)},resumeOnLeave:(e,t)=>{SR7.M[e].slideShow.sOH=!1,SR7.slideShow.resume(e)},pause:(e,t)=>{null!=SR7.M[e].slideShow&&null!=SR7.M[e].slideShow.tween&&(!0===t&&(SR7.M[e].states.forcedPause=!0),SR7.M[e].slideShow.tween.pause(),SR7.M[e].slideShow.state="paused",SR7.F.updateAllTogglePrgLayers(e),SR7.F.triggerSlideEvent(e,"pause",["onpause"]))},resume:e=>{null!=SR7.M[e].slideShow&&null!=SR7.M[e].slideShow.tween&&(delete SR7.M[e].states.forcedPause,delete SR7.M[e].slideShow.state,SR7.M[e].slideShow.tween.play(),SR7.F.updateAllTogglePrgLayers(e),SR7.F.triggerSlideEvent(e,"resume",["onresume"]))},getLen:e=>{const t=SR7.M[e];return parseInt("default"==(t.slides[t.current?.id??-1]?.slide?.slideshow?.len??"default")?t.settings.default.len??9e3:t.slides[t.current.id??-1].slide.slideshow.len??9e3)},start:e=>{const t=SR7.M[e],s=t.settings.slideshow.auto?t.slideShow||SR7.slideShow.build(e):void 0;if(!t.settings.slideshow.auto||void 0!==s&&0==s.loop&&s.stopAt-1==t.current.index)return SR7.slideShow.nullTimer(e),void _tpt.event.trigger("dom","sr.module.finished",{id:e});void 0!==s&&s.loop>=0&&t.current.index==t.len-1&&s.loop--,t.useProgressBar?(SR7.slideShow.resize(e),"animate"==t.settings.pbar.rev&&("paused"==SR7.M[e].slideShow.state||1!==s.tween.progress()&&0!==s.tween.progress()||t.current.index<s.Sindex||t.current.index>s.Sindex+1)?SR7.slideShow.fastForward(e):SR7.slideShow.play(e)):SR7.slideShow.play(e)},play:(e,t=0)=>{const s=SR7.M[e],i=s.slideShow;i.Sindex=s.current.index,i.d=SR7.slideShow.getLen(e),i.tween.duration(i.d/1e3),SR7.F.updateAllTogglePrgLayers(e),"paused"==SR7.M[e].slideShow.state?(i.tween.play(0),requestAnimationFrame((function(){i.tween.pause()}))):i.tween.play(t)},resize:e=>{const t=SR7.M[e];if(!t.settings.slideshow.auto||!t.useProgressBar)return;const s=t.settings.pbar,i=t.slideShow;i.w=parseInt("horizontal"==s.t?"grid"==s.a?t.dims.CFC.w:t.dims.content.w:"vertical"==s.t?parseInt(s.s):2*parseInt(s.r)),i.h=parseInt("horizontal"==s.t?parseInt(s.s):"vertical"==s.t?"grid"==s.a?t.dims.CFC.h:t.dims.content.h:2*parseInt(s.r)),i.c.style.width=i.w+"px",i.c.style.height=i.h+"px",i.c.width=i.w*window.devicePixelRatio,i.c.height=i.h*window.devicePixelRatio,i.ctx.scale(window.devicePixelRatio,window.devicePixelRatio),i.resized=!0,SR7.gV({v:s.vis,id:e})?(i.c.style.visibility="visible",i.c.style.top="vertical"!==s.t?"top"==s.v?parseInt(s.y??0)+("grid"==s.a?t.dims.CFC.y:0)+"px":(("grid"==s.a?t.dims.CFC.y+t.dims.CFC.h:t.dims.content.h)-parseInt(s.y??0)-("cw"==s.t||"ccw"==s.t?2*parseInt(s.r):parseInt(s.s)))/("bottom"==s.v?1:2)+"px":"grid"==s.a?t.dims.CFC.y+"px":"0px",i.c.style.left=("horizontal"!==s.t?"left"==s.h?parseInt(s.x??0)+("grid"==s.a?t.dims.CFC.x:0):(("grid"==s.a?t.dims.CFC.x+t.dims.CFC.w:t.dims.content.w)+("right"==s.h?-1:1)*parseInt(s.x??0)-("cw"==s.t||"ccw"==s.t?2*parseInt(s.r):parseInt(s.s)))/("right"==s.h?1:2):"grid"==s.a?t.dims.CFC.x:0)+"px","cw"!=s.t&&"ccw"!=s.t&&(i.totalSize="horizontal"===s.t?i.w:i.h,i.partSize=(i.totalSize-(i.parts-1)*i.gap)/i.parts,null!=i._&&(i._.w=parseInt("horizontal"==s.t?i.partSize:s.s),i._.h=parseInt("horizontal"==s.t?s.s:i.partSize),SR7.slideShow["cw"==s.t||"ccw"==s.t?"drawCircle":"drawBar"](e)))):i.c.style.visibility="hidden"},drawCircle:(e,t)=>{const s=SR7.M[e],i=s.slideShow;if(!t&&void 0!==i.tweenFF&&i.tweenFF.isActive())return;const a=s.settings.pbar,r=t?i.FF.Sindex:i.Sindex,o=(t?i.FF.t:i.t)/100;s?.c?.nav?.scrubber?.progTween&&!s?.c?.nav?.scrubber?.srScrubber?.dragging&&s.c.nav.scrubber.progTween.progress(o);let l="slide"==a.base?360*o:360/i.parts*o;"slide"!==a.base&&(l+=360/i.parts*r),"ccw"==a.t&&(l=360-l),i.r-parseInt(a.s)<=0&&(a.s=a.r/4),i.ctx.lineCap="round",i.ctx.clearRect(0,0,2*a.r,2*a.r),i.ctx.beginPath(),i.ctx.arc(i.r,i.r,a.r-a.s,Math.PI/180*270,Math.PI/180*630),i.ctx.strokeStyle=a.bg,i.ctx.lineWidth=a.s-1,i.ctx.stroke(),i.ctx.beginPath(),i.ctx.strokeStyle=a.c,i.ctx.lineWidth=a.s,i.ctx.arc(i.r,i.r,a.r-a.s,Math.PI/180*270,Math.PI/180*(270+l),"cw"!==a.t),i.ctx.stroke()},drawBar:(e,t)=>{const s=SR7.M[e],i=s.slideShow;if(!t&&void 0!==i.tweenFF&&i.tweenFF.isActive())return;const a=s.settings.pbar,r=t?i.FF.Sindex:i.Sindex;i.ctx.clearRect(0,0,i.c.width,i.c.height);const o=(t?i.FF.t:i.t)/100,l=i.partSize*o;s?.c?.nav?.scrubber?.progTween&&!s?.c?.nav?.scrubber?.srScrubber?.dragging&&s.c.nav.scrubber.progTween.progress(o),i._.pw="horizontal"==a.t?l:a.s,i._.ph="horizontal"==a.t?a.s:l;for(let e=0;e<i.parts;e++)i._[i._.k]=i.rtl?i.totalSize-(e+1)*(i.partSize+i.gap)+i.gap:e*(i.partSize+i.gap),i.ctx.fillStyle=e<r&&1!==i.parts||e===r&&100===i.t?a.c:a.bg,i.ctx.fillRect(i._.x,i._.y,i._.w,i._.h),e!==r&&1!=i.parts||(i._[i._.k]=i.rtl?i._[i._.k]+i.partSize-l:i._[i._.k],i.ctx.fillStyle=a.c,i.ctx.fillRect(i._.x,i._.y,i._.pw,i._.ph));if(i.gap>0){i.ctx.fillStyle=a.gc;for(let e=1;e<i.parts;e++)i._[i._.k]=i.rtl?i.totalSize-e*(i.partSize+i.gap):e*i.partSize+(e-1)*i.gap,"transparent"==a.gc?i.ctx.clearRect(i._.x,i._.y,i._.gw,i._.gh):i.ctx.fillRect(i._.x,i._.y,i._.gw,i._.gh)}}},_tpt.R??={},_tpt.R.slide=_tpt.extend?_tpt.extend(_tpt.R.slide,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F=SR7.F||{},void 0!==SR7.F.initCarousel)return;SR7.F.initCarousel=function(s,i){var a=SR7.M[s];if("carousel"===a.settings.type){void 0===a.c.carousel&&(a.c.carousel={});var r=a.c.carousel;r.slides=[];for(var o=0;o<a.len;o++)r.slides.push(a.c.slides[a.slideOrder[o]]);var l=SR7.F.setCarouselSlideDims(s),n={startIndex:i,mID:s,slides:r.slides,trigger:a.c.module,wrap:a.c.carousel,width:l.width,height:l.height,syncO:!0,length:SR7.slideShow.getLen(s),slideChange:function(e){SR7.F.requestSlideFocus(s,a.slideOrder[e])},snappingTo:function(e){a.c.nav?.thumbs?.srcr&&a.c.nav.thumbs.srcr.goTo(a.c.nav.thumbs.srcr.getRealIndex(a.c.nav.thumbs.srcr.wrapIndex(e))),a.c.nav?.tabs?.srcr&&a.c.nav.tabs.srcr.goTo(a.c.nav.tabs.srcr.getRealIndex(a.c.nav.tabs.srcr.wrapIndex(e)))},slideVisible:function(e,t){var i=r.slides[e].dataset.key;a.slides[i].slide.visible=!0,t&&a.checkCarouselDone&&SR7.F.redrawBG(s,i)},slideHidden:function(e){var t=r.slides[e].dataset.key;a.slides[t].slide.visible=!1},onInteract:function(){SR7.slideShow.pause(s)},onIdle:function(){SR7.M[s]?.slideShow?.sOH||SR7.slideShow.resume(s)},exclude:["SR7-THUMBS","SR7-TABS","SR7-SCRUBBER"],callRebuild:function(e,t){!a.c.nav?.scrubber?.srScrubber?.rebuild||a.c.nav.scrubber.srScrubber.dragging||a.settings.carousel.justify||a.c.nav.scrubber.srScrubber.rebuild({p:e,targetIndex:t})}};"mousedrag"===a.settings.mod.t&&(n.mouseDrag=!0,n.processMod=function(){for(var e in a.slideOrder)a.slides[a.slideOrder[e]].slide.visible&&SR7.F.modify.pOS(s,"mouse",void 0,a.slideOrder[e])}),("false"==String(a.settings.nav?.s?.mobC)&&_tpt.is_mobile||"false"==String(a.settings.nav?.s?.deskC)&&!_tpt.is_mobile)&&(n.ignoreDrag=!0),n=e(_tpt.extend(n,a.settings.carousel,{length:SR7.slideShow.getLen(s)})),r.src=new t(n),_tpt.resizeObserver.observe((e=>{SR7.F.rebuildCarousel(e)}),19,s)}};let e=e=>(e.minS=parseFloat(e.minS??100)/100,e.maxR=parseFloat(e.maxR??0),e.maxO=parseFloat(e.maxO)/100,e.ease=e.ease.replace(".inOut",".out").replace(".in",".out"),e.dur=Math.min(parseInt(e.dur??800),e.length)/1e3,e);function t(e){this.proxy=document.createElement("div"),this.follower=document.createElement("div"),this.slides=e.slides,this.ignoreDrag=e.ignoreDrag,this.arr=[],this.s=e,this.len=e.slides.length,this.last=this.len-1,this.lerp=.1,this.pX=this.lpX=this.pY=this.lpY=0,this.setDefaults(),this.setType(),this.lastMouseEvent;var t=this;!0!==this.ignoreDrag&&(this.draggable=_tpt.draggable.create(this.proxy,{trigger:e.trigger,type:"h"==this.type?"x":"y",inertia:!0,cursor:"grab",activeCursor:"grabbing",throwResistance:this.s.snap?8e3:500,edgeResistance:.8,dragClickables:!1,clickableTest:e=>{if("true"==String(e?.dataset?.clickable))return!0},onPress:function(e){t.lastMouseEvent="press";if(t.onDragDone=!1,t.s.exclude)for(var s=0;s<t.s.exclude.length;s++)_tpt.closestNode(e.target,t.s.exclude[s])&&this.endDrag();_tpt.gsap.to(t,{lerp:.1}),t.s.onInteract&&t.s.onInteract()},onClick:function(e){if(t.lastMouseEvent="click",_tpt.is_mobile&&("SR7-TABS"==this.vars.trigger.tagName||"SR7-THUMBS"==this.vars.trigger.tagName))for(var s=e.target;s&&s!==document;){if("SR7-TAB"===s.tagName||"SR7-THUMB"===s.tagName){s.click();break}s=s.parentNode}},onDragStart:function(){t.lpX=t.pX=this.pointerX,t.lpY=t.pY=this.pointerY,t.direction=this.getDirection(),t.tick||(t.tick=window.requestAnimationFrame(t.lerpHandler)),t.dragging=!0,t.s.lastDirection=this.getDirection(),t.s.realDragging=!0,t.s.dragTime=(new Date).getTime(),t.beforeDragFocused=t.focused},onDragEnd:function(){t.s.realDragging=!1,t.s.dragTimeDiff=(new Date).getTime()-t.s.dragTime},onDrag:function(e){if(t.lastMouseEvent="drag",0===e.pressure)return t.draggable.endDrag();t.onDragDone=!0,t.pX=this.pointerX,t.pY=this.pointerY,t.s.dragTimeDiff=(new Date).getTime()-t.s.dragTime,t.s.lastDirection!==this.getDirection()&&(t.s.directionChanged=!0),t.s.lastDirection=this.getDirection(),SR7.A?.mousetrap&&(SR7.A.mousetrap.processOnSlide(t.s.trigger.id,{type:"dragmove",clientX:t.pX,clientY:t.pY},!0),SR7.A.mousetrap.processOnLayer(t.s.trigger.id,{type:"dragmove",clientX:t.pX,clientY:t.pY}))},onRelease:function(e){!t.onDragDone&&t.s.onIdle&&t.s.onIdle()},snap:{[this.tr]:e=>{let s=t.s.trigger.id;return(!this.forceScroll||!SR7.M[s])&&this.snap.bind(this)(e)}},zIndexBoost:!1,allowContextMenu:!0})[0]),_tpt.gsap.set([this.proxy,this.follower],{[this.tr]:"+=0"}),this.lerpHandler=this.updateSlides.bind(this),this.tick=window.requestAnimationFrame(t.lerpHandler),this.rebuild({targetIndex:e.startIndex}),delete e.startIndex}SR7.F.hideCarouselSlides=function(e){const t=SR7.M[e];for(var s=0;s<t.len;s++){let e=t.slideOrder[s];_tpt.gsap.set(t.c.slides[e],{opacity:0})}},SR7.F.showCarouselSlide=function(e,t){const s=SR7.M[e];for(var i=0;i<s.len;i++){let e=s.c.carousel.src.arr[i],a=e.elem.dataset.key;a===t&&requestAnimationFrame((function(){_tpt.gsap.to(e,{syncedO:1,duration:1,onUpdate:function(e,t){_tpt.gsap.set(s.c.slides[e],{opacity:void 0===t.opacity?t.syncedO:Math.min(t.syncedO,t.opacity)})},onUpdateParams:[a,e]})}))}},SR7.F.rebuildCarousel=function(e,t=!0,s=!0){var i=SR7.M[e];if(i?.c?.carousel?.src){var a=i.c.carousel.src.s,r=SR7.F.setCarouselSlideDims(e);a.width=r.width,a.height=r.height;var o=i.dims.module.w,l=i.dims.content.h;a.justify||("h"===a.type&&(o=Math.min(o,a.width*a.maxV+a.space*Math.max(a.maxV-2,0))),"v"===a.type&&(l=Math.min(l,a.height*a.maxV+a.space*Math.max(a.maxV-2,0)))),a.wrapWidth=o,a.wrapHeight=l,_tpt.gsap.set(i.c.carousel,{width:o,height:l,left:"center"===a.align?(i.dims.module.w-o)/2-("left"!=(i.dims.outNav?.align??"left")||i.settings.size.fullWidth?0:(i.dims.outNav?.w??0)/2):"end"===a.align?i.dims.module.w-o:0,top:"center"===a.align?(i.dims.content.h-l)/2:"end"===a.align?i.dims.content.h-l:0}),s&&i.c.carousel.src.rebuild()}if(t)for(var n in i.slides)i.slides[n].slide.visible&&SR7.F.redrawBG(e,n)},SR7.F.carSlideChange=function(e,t){var s=SR7.M[e];"carousel"===s.settings.type&&(void 0!==s.c.carousel&&s.c.carousel.src.goTo(s.next.index))},SR7.F.setCarouselSlideDims=e=>{var t=SR7.M[e],s=[],i=[];if(t.settings.carousel.justify)for(var a in t.slides)t.slides[a].slide.global||(s.push(t.settings.carousel.jMWidth?Math.min(t.dims.CFC[a].w,t.dims.module.w):t.dims.CFC[a].w),i.push(t.settings.carousel.jMWidth?Math.min(t.dims.CFC[a].h,t.dims.content.h):t.dims.CFC[a].h));return{width:t.settings.carousel.justify?s:t.settings.carousel.stretch?t.dims.module.w:t.dims.CFC.w,height:t.settings.carousel.justify?i:"v"===t.settings.carousel.type?t.dims.CFC.ch:t.dims.content.h}},window.srCarousel=t,t.prototype.setDefaults=function(){var e=this.s;this.s.wrap=this.s.wrap??this.s.trigger,this.s.trigger=this.s.trigger??this.s.wrap,void 0===this.wrapWPreset&&(this.wrapWPreset=void 0!==e.wrapWidth),void 0===this.wrapHPreset&&(this.wrapHPreset=void 0!==e.wrapHeight),this.s.wrapWidth=this.wrapWPreset?e.wrapWidth:this.s.wrap.offsetWidth,this.s.wrapHeight=this.wrapHPreset?e.wrapHeight:this.s.wrap.offsetHeight,this.s.type=this.type=e.type??"h",this.s.align=this.s.sightSnap?"left":this.s.align??"left",this.s.maxV=Math.max("3d"==this.s.spin?3:1,parseInt(this.s.maxV??3)),this.s.justify=this.s.justify??!1,this.s.minS=this.s.scale?this.s.minS??1:1,this.s.vScale=this.s.vScale??!1,this.s.oScale=this.s.oScale??!1,this.s.space=parseFloat(this.s.space??0),this.s.maxR=this.s.rotation?this.s.maxR??0:0,this.s.varR=this.s.varR??!1,this.s.maxO=this.s.opacity?1==this.s.maxV&&1!==this.s.maxO?0:this.s.opacity?this.s.maxO??1:1:1,this.s.varO=this.s.varO??!1,this.s.spin=this.s.spin??"off",this.s.spinA=parseInt(this.s.spinA??0),this.s.wrapPerspective=this.s.wrapPerspective??1200,this.s.snap=this.s.snap??!0,this.s.infinity=this.s.infinity??!0,this.s.skewX=parseFloat(this.s.skewX??0),this.s.skewY=parseFloat(this.s.skewY??0),this.s.dur=this.s.dur??.8,this.s[this.dim]&&this.s.space<-this.s[this.dim]?this.space=.8*this.s.space:this.space=this.s.space,this.s.align=this.s.align&&"center"!==this.s.align?"left"===this.s.align||"top"===this.s.align||"start"===this.s.align?"start":"end":"center",!0!==this.s.justify&&this.s.maxV>this.len&&(this.s.maxV=this.len%2?this.len:this.len+1)},t.prototype.setType=function(e){void 0===e&&(e=this.type),"h"===e?(this.tr="x",this.dim="width",this.wrapDim="wrapWidth"):(this.tr="y",this.dim="height",this.wrapDim="wrapHeight")},t.prototype.rebuild=function(e={}){var t,s=e.p??0;if(this.setDefaults(),e.type&&(this.type=type,this.setType()),this.draggable&&void 0!==this.totalWidth&&(this.totalWidth>this.s[this.wrapDim]?this.draggable.enable():this.draggable.disable()),_tpt.gsap.killTweensOf([this.proxy,this.follower],this.tr),void 0!==this.closest&&void 0===e.targetIndex||(this.closest=this.focused=e.targetIndex??0),this.lastFocused=this.focused,"center"===this.s.align?this.offset=(this.s[this.wrapDim]-(void 0===this.s[this.dim]?this.slides[0]["h"===this.type?"offsetWidth":"offsetHeight"]:"object"==typeof this.s[this.dim]?this.s[this.dim][0]:this.s[this.dim]))/2:"end"===this.s.align?this.offset=this.s[this.wrapDim]-(void 0===this.s[this.dim]?this.slides[0]["h"===this.type?"offsetWidth":"offsetHeight"]:"object"==typeof this.s[this.dim]?this.s[this.dim][0]:this.s[this.dim]):this.offset=0,this.built){for(r=0;r<this.len;r++)for(var i=0;i<this.len;i++)if(this.slides[r]===this.arr[i].elem){var a=this.arr[r];this.arr[r]=this.arr[i],this.arr[i]=a}}else for(var r=0;r<this.len;r++)this.arr.push({elem:this.slides[r],index:1,syncedO:this.s.syncO?0:void 0});if(this.positionSlides(this.focused,s),"off"!==this.s.spin){var o=this.arr[0][this.dim]/2;this.s.spinA=Math.max(Math.min(this.s.spinA,360/this.len),-360/this.len);var l=o/Math.sin(this.s.spinA/2*Math.PI/180);this.spinR=(Math.sqrt(l*l-o*o)+this.space)*Math.sign(this.s.spinA),"2d"===this.s.spin&&"h"===this.s.type?this.spinR+=(this.s.spinA<=0?0:1)*this.s.wrapHeight:"2d"===this.s.spin&&(this.spinR+=(this.s.spinA<=0?0:1)*this.s.wrapWidth)}(0===this.s.maxR&&"3d"!==this.s.spin||_tpt.gsap.set(this.s.slides[0].parentNode,{perspective:this.s.wrapPerspective}),this.s.infinity)||("center"===this.s.align?t=(this.s[this.wrapDim]-this.arr[this.last][this.dim])/2:"end"===this.s.align&&(t=this.s[this.wrapDim]-this.arr[this.last][this.dim]),this.s.sightSnap?this.minTr=this.s[this.wrapDim]-this.totalWidth+this.space:"start"===this.s.align?this.minTr=this.arr[this.last][this.dim]-this.totalWidth:this.minTr=this.s[this.wrapDim]-this.totalWidth-("end"===this.s.align?0:t),void 0===s&&(this.draggable.applyBounds({minX:this.minTr>=0?this.minTr:0,maxX:this.minTr>=0?this.s[this.wrapDim]:0}),this.draggable.update()),this.minTr>0?_tpt.gsap.set([this.proxy,this.follower],{[this.tr]:this.proxyShift}):this.s.sightSnap&&(this.positionSlides(0,s),_tpt.gsap.set([this.proxy,this.follower],{[this.tr]:0})));this.s.sightSnap||_tpt.gsap.set([this.proxy,this.follower],{[this.tr]:-this.proxyShift}),this.s.bR&&_tpt.gsap.set(this.s.slides,{borderRadius:this.s.bR,overflow:"hidden"}),this.built=!0,this.setRange(),this.s.infinity&&this.swapSlides(),this.getClosest(),this.updateSlides()},t.prototype.positionSlides=function(e,t){var s=this.totalWidth=this.offset,i=(t??0)*(this.arr[e]?.width??0);s+=i;for(var a=e;a<this.len;a++)for(var r=0;r<this.len;r++)this.slides[a]===this.arr[r].elem&&(this.arr[r][this.dim]=void 0===this.s[this.dim]?"h"===this.s.type?this.slides[a].offsetWidth:this.slides[a].offsetHeight:"object"==typeof this.s[this.dim]?this.s[this.dim][a]:this.s[this.dim],_tpt.gsap.set(this.slides[a],{[this.tr]:this.totalWidth,position:"absolute",left:0,top:0,x:0,y:0}),this.arr[r].pos=this.totalWidth+i,this.arr[r][this.tr]=this.totalWidth+i,_tpt.gsap.set(this.arr[r].elem,{[this.tr]:this.totalWidth+i}),this.totalWidth+=this.arr[r][this.dim]+(r===this.last?0:this.space));this.proxyShift=0;for(a=e-1;a>=0;a--)for(r=0;r<this.len;r++)this.slides[a]===this.arr[r].elem&&(_tpt.gsap.set(this.slides[a],{[this.tr]:s,position:"absolute",left:0,top:0,x:0,y:0}),this.arr[r][this.dim]=void 0===this.s[this.dim]?"h"===this.s.type?this.slides[a].offsetWidth:this.slides[a].offsetHeight:"object"==typeof this.s[this.dim]?this.s[this.dim][a]:this.s[this.dim],s-=this.arr[r][this.dim]+this.space,this.arr[r].pos=s,this.arr[r][this.tr]=s,_tpt.gsap.set(this.arr[r].elem,{[this.tr]:s}),this.totalWidth+=this.arr[r][this.dim]+this.space,this.proxyShift+=this.arr[r][this.dim]+this.space)},t.prototype.updateSlides=function(){this.tick=window.requestAnimationFrame(this.lerpHandler);var e=parseFloat(this.proxy._gsap[this.tr]),t=parseFloat(this.follower._gsap[this.tr]),s=t+(e-t)*this.lerp,i=s-t;_tpt.gsap.set(this.follower,{[this.tr]:s}),this.s.mouseDrag&&(this.s.realDragging?this.lpX+=(this.pX-this.lpX)*this.lerp:this.lpX=2*(t-s),this.lpY+=(this.pY-this.lpY)*this.lerp,this.s.processMod&&this.s.processMod()),!this.dragging&&(!this.tween||!this.tween.isActive())&&!this.waitTweenInit&&Math.abs(t-e)<.03&&Math.abs(i)<.03&&(t=e,_tpt.gsap.set(this.follower,{[this.tr]:e}),i=0,this.tick=window.cancelAnimationFrame(this.tick)),this.dx=i;for(var a=0;a<this.arr.length;a++)this.arr[a][this.tr]+=i,_tpt.gsap.set(this.arr[a].elem,{[this.tr]:this.arr[a][this.tr]});0!==this.s.skewX&&_tpt.gsap.set(this.s.slides,{skewX:this.s.skewX*Math.max(-1,Math.min(1,i/100))}),0!==this.s.skewY&&_tpt.gsap.set(this.s.slides,{skewY:this.s.skewY*Math.max(-1,Math.min(1,i/100))}),this.getClosest(),this.s.infinity&&this.swapSlides(),this.applyDE()},t.prototype.applyDE=function(){this.lastSlideProgress??=1,this.tempAlign??=this.s.align;let e=this.offset;"v"!==this.s.type||this.s.infinity||this.s.justify||(e=this.offset+(this.s[this.wrapDim]-this.s[this.dim]-this.offset)*(1-this.lastSlideProgress));for(var t=0;t<this.len;t++){var s={},i=parseFloat(this.arr[t][this.tr])-e,a=this.arr[t].sign=0===Math.sign(i)?1:Math.sign(i);this.arr[t].p=Math.abs(i)/(this.arr[t][this.dim]+this.space);var r=this.arr[t].ap=this.arr[t].p;"v"!==this.s.type||this.s.infinity||t!==this.last||(r<=("left"===this.dir?.9:.1)&&!this.vertAlignBottom?(tpGS.gsap.to(this,{lastSlideProgress:0,duration:.2}),this.vertAlignDefault=!1,this.vertAlignBottom=!0,this.tempAlign="end",this.setRange("end")):r>("left"===this.dir?.9:.1)&&!this.vertAlignDefault&&(tpGS.gsap.to(this,{lastSlideProgress:1,duration:.2}),this.vertAlignDefault=!0,this.vertAlignBottom=!1,this.tempAlign=this.s.align,this.setRange(this.s.align)));var o=this.arr[t].vp=this.arr[t].ap/Math.ceil(this.pDiv)*("center"===this.tempAlign?1:"start"===this.tempAlign?a:-a);if("off"!==this.s.spin){if(null==this.tr)continue;s[this.tr]=e,"2d"===this.s.spin?(s.rotation=this.s.spinA*r*("h"===this.s.type?a:-a),"h"===this.s.type?s.transformOrigin="center "+this.spinR+"px 0":s.transformOrigin=this.spinR+"px center 0"):("h"===this.s.type?s.rotationY=this.s.spinA*r*-a:s.rotationX=this.s.spinA*r*a,s.transformOrigin="center center "+this.spinR+"px")}else if(0===this.s.minS||this.s.justify){if(null==this.tr)continue;s[this.tr]=this.arr[t][this.tr]}else{r=Math.min(1,r);var l=1-(this.s.vScale?o:r)*(1-this.s.minS);l=Math.max(0,l);var n=this.s.oScale?this.arr[t].sign*(this.arr[t][this.dim]+this.space-(this.arr[t][this.dim]+this.space)*l)/2*this.arr[t].ap:this.arr[t].sign*(this.arr[t][this.dim]-this.arr[t][this.dim]*l)/2*this.arr[t].ap;s[this.tr]=this.arr[t][this.tr]-n,s.scale=l}this.s.syncO||(s.opacity=1),this.s.justify||(r=Math.min(1,r),0!==this.s.maxR&&(s.rotationY=this.s.maxR*(this.s.varR?o:r)*-a),s.opacity=1+(this.s.maxO-1)*(this.s.varO?o:r),o>this.edgeRatio?s.opacity=this.oRange(o):o<0?s.opacity=this.oRangeMin(o):1===this.s.maxO&&(s.opacity=1)),this.arr[t].opacity=s.opacity,this.s.syncO&&s.opacity>this.arr[t].syncedO&&(s.opacity=this.arr[t].syncedO),s.opacity<=0?(this.s.slideHidden&&(void 0===this.arr[t].visible||this.arr[t].visible)&&this.s.slideHidden(this.getRealIndex(t)),this.arr[t].visible=!1):(!this.s.slideVisible||!1!==this.arr[t].visible&&void 0!==this.arr[t].visible||this.s.slideVisible(this.getRealIndex(t),void 0!==this.arr[t].visible),this.arr[t].visible=!0),s.zIndex=100-5*Math.round(this.arr[t].ap),t===this.closest&&this.s.callRebuild&&this.s.callRebuild(this.arr[t].p*this.arr[t].sign,this.getRealIndex(t)),this.s.ignoreOpacity&&delete s.opacity,_tpt.gsap.set(this.arr[t].elem,s)}},t.prototype.getRealIndex=function(e){for(var t=0;t<this.len;t++)if(this.slides[t]===this.arr[e].elem)return t},t.prototype.getArrIndex=function(e){for(var t=0;t<this.len;t++)if(this.slides[e]===this.arr[t].elem)return t},t.prototype.setRange=function(e){e??=this.s.align,this.pDiv="center"===e?this.s.maxV/2:this.s.maxV,this.edgeRatio=Math.floor(this.pDiv-("center"===e?0:1))/Math.ceil(this.pDiv),1===this.s.maxV&&(this.edgeRatio=1),this.oEdge=1===this.s.maxO?1:this.s.varO?1+(this.s.maxO-1)*this.edgeRatio:this.s.maxO,this.oEdge=1===this.s.maxV?this.s.maxO:this.oEdge,this.oRange=this.s.maxV>1?_tpt.gsap.utils.mapRange(this.edgeRatio,1,this.oEdge,0):_tpt.gsap.utils.mapRange(1,1.1,this.oEdge,0),this.oRangeMin=_tpt.gsap.utils.mapRange(-1/this.s.maxV,-1.1/this.s.maxV,1,0),this.wrapIndex=this.s.infinity?_tpt.gsap.utils.wrap(0,this.len):_tpt.gsap.utils.clamp(0,this.len-1)},t.prototype.swapSlides=function(){for(var e,t=!0;t;){let i=this.arr[0][this.tr]>=0||void 0!==this.arr[0].p&&this.arr[0].p<=this.s.maxV/2&&!(this.arr[this.last].p<=this.s.maxV/2)&&parseFloat(this.arr[this.last][this.tr])>=this.s[this.wrapDim],a=this.arr[this.last][this.tr]+this.arr[this.last][this.dim]<=this.s[this.wrapDim]||void 0!==this.arr[this.last].p&&this.arr[this.last].p<=this.s.maxV/2&&!(this.arr[0].p<=this.s.maxV/2)&&parseFloat(this.arr[0][this.tr])+this.arr[0][this.dim]<=0;if(i&&!a){this.arr[this.last][this.tr]=-this.arr[this.last][this.dim]+this.arr[0][this.tr]-this.space;var s=this.arr.pop();this.arr.unshift(s),s===e&&(t=!1),e=s,_tpt.gsap.set(this.arr[0].elem,{[this.tr]:this.arr[0][this.tr]})}else if(a&&!i){this.arr[0][this.tr]=this.arr[this.last][this.tr]+this.arr[this.last][this.dim]+this.space;s=this.arr.shift();this.arr.push(s),s===e&&(t=!1),e=s,_tpt.gsap.set(this.arr[this.arr.length-1].elem,{[this.tr]:this.arr[this.arr.length-1][this.tr]})}else t=!1}},t.prototype.snap=function(e){_tpt.gsap.killTweensOf([this.proxy,this.follower],this.tr),this.tween&&this.tween.pause&&this.tween.pause(),Math.abs(t)<3&&(t=0);var t="v"===this.s.type?e-this.draggable.endY:e-this.draggable.endX;this.s.snap&&(e=this.newPos(e)),t=this.draggable[this.tr]-e,this.s.infinity||"v"!==this.s.type?this.s.infinity||(e>=0?e=0:e<=this.minTr&&(e=this.minTr)):e<=this.s[this.wrapDim]-this.totalWidth?e=this.s[this.wrapDim]-this.totalWidth:e>=0&&(e=0);var s=this;if(this.s.overshoot){_tpt.gsap.to(this,{duration:this.s.snap?.3:.5,lerp:.8});var i=Math.min(0===this.draggable.deltaX?Math.abs(t)/20:Math.abs(this.draggable.deltaX)/2,this.s[this.wrapDim]/4)*Math.sign(t),a=Math.abs(i/100);a=Math.min(Math.max(a/10,.6*this.s.dur),this.s.dur),this.tween=_tpt.gsap.timeline({onComplete:function(){s.dragging=!1,s.s.onIdle&&s.s.onIdle(),s.waitingDragEnd&&(s.s.slideChange&&s.s.slideChange(s.focused),s.waitingDragEnd=!1),s.s.mID&&SR7.F.updateModuleDims(s.s.mID,"height")}}),this.tween.to(this.proxy,{[this.tr]:e-i,duration:a,ease:"power2.out"}).to(this.proxy,{[this.tr]:e,duration:Math.min(2*a,.6),ease:this.s.ease},"overshoot").to(this,{duration:Math.min(2*a,.6),lerp:1},"overshoot")}else if(this.s.dragTimeDiff>130&&!this.s.directionChanged){let e=this.focused;if(this.focused==this.beforeDragFocused){let t="h"==this.s.type?this.draggable.startX-this.draggable.endX:this.draggable.startY-this.draggable.endY,s=Math.abs(t)/this.arr[this.focused].width;if(Math.abs(s)>.1){e+=this.dist<0?1:-1,e>this.arr.length-1&&(e=this.s.infinity?0:this.arr.length-1),e<0&&(e=this.s.infinity?this.arr.length-1:0)}}s.dragging=!1,s.goTo(e,!0,this.focused!==this.beforeDragFocused)}else a=Math.abs(t/100),a=Math.min(Math.max(a/10,.6*this.s.dur),this.s.dur),this.tween&&this.tween.kill&&this.tween.kill(),this.tween=_tpt.gsap.timeline({onComplete:function(){s.dragging=!1,s.s.onIdle&&s.s.onIdle(),s.waitingDragEnd&&(s.s.slideChange&&s.s.slideChange(s.focused),s.waitingDragEnd=!1),s.s.mID&&SR7.F.updateModuleDims(s.s.mID,"height")}}),this.tween.to(this.proxy,{[this.tr]:e,ease:this.s.ease,duration:a,onComplete:function(){s.dragging=!1,s.s.mID&&SR7.F.updateModuleDims(s.s.mID,"height")}},0),this.tween.to(this,{lerp:1,duration:a},0);return e},t.prototype.goTo=function(e,t,s){if(this.dragging&&!0!==t)return;this.lastRequestedIndex!==e&&_tpt.gsap.killTweensOf([this.proxy,this.follower],this.tr),this.waitTweenInit=!0;let i=parseFloat(this.proxy._gsap[this.tr]),a=this;this.getClosest();var r=this.newPos(i,e,this.getDir(this.focused,e),void 0,s);s&&(r+=parseFloat(this.follower._gsap[this.tr])-parseFloat(this.proxy._gsap[this.tr]));let o=this.s.dur+(this.steps>=2?(this.steps-1)*this.s.dur/10:0);a.s.slideChange&&a.s.slideChange(e),clearTimeout(this.tweenRequest),this.tweenRequest=setTimeout((()=>{this.lastRequestedIndex=e,this.tween=_tpt.gsap.timeline({onComplete:function(){a.s.onIdle&&a.s.onIdle(),a.s.mID&&SR7.F.updateModuleDims(a.s.mID,"height")},onStart:function(){a.waitTweenInit=!1}}).to(this.proxy,{[this.tr]:r,ease:this.s.ease,duration:o},0).to(this,{lerp:1,duration:o},0).to({},{duration:.3*o,onComplete:function(){}},0),this.tick||(this.tick=window.requestAnimationFrame(this.lerpHandler))}),(this.s?.mID?SR7.slideShow.getLen(this.s.mID):9e3)/(1e3*this.s.dur)<1.2?0:50)},t.prototype.getDir=function(e,t){var s=t-e,i="right",a=0,r=0;if(this.s.infinity){for(var o=e;o!=t;)r+=1,o=++o>=this.len?0:o;for(o=e;o!=t;)a+=1,o=--o<0?this.last:o;i=r<=a?"left":"right"}else i=t-e>=0?"left":"right",r=Math.abs(t-e),0===s&&(i="right",!0);return this.steps=r<=a?r:a,i},t.prototype.newPos=function(e,t,s,i){this.getClosest(),void 0===s&&(s=this.draggable.getDirection()),s="v"==this.s.type&&s.includes("up")?"left":"v"==this.s.type&&s.includes("down")?"right":s.includes("left")?"left":"right",this.dir=s;let a=parseFloat(this.follower._gsap[this.tr])-parseFloat(this.arr[this.closest][this.tr]);if("center"!==this.s.align&&"end"!==this.s.align||(a+=this.offset),this.s.sightSnap&&void 0!==t)return this.checkSightSnap(t);if(this.focused===t)return parseFloat(this.proxy._gsap[this.tr])-(this.arr[this.getArrIndex(t)][this.tr]-this.offset);for(var r=this.closest,o=0;!(++o>100);){var l;if("right"===s?(l=this.wrapIndex(r),r--):l=this.wrapIndex(r+1),r=this.wrapIndex(r),"press"!==this.lastMouseEvent&&("center"===this.s.align?a+=(this.arr[r][this.dim]+this.space+this.arr[l][this.dim]+this.space)/2*("left"===s?-1:1):"end"===this.s.align?a+=(this.arr[l][this.dim]+this.space)*("left"===s?-1:1):a+=(this.arr[r][this.dim]+this.space)*("left"===s?-1:1)),"left"===s&&void 0!==t&&(r=this.wrapIndex(r+1)),void 0===t&&("left"===s&&e>a||"right"===s&&e<a)||void 0!==r&&this.arr[r].elem===this.slides[t]){this.s.snappingTo&&void 0===t&&!0!==i&&("left"===s&&this.s.snappingTo(this.getRealIndex(this.wrapIndex(r+1))),"right"===s&&this.s.snappingTo(this.getRealIndex(this.wrapIndex(l-1))));break}"left"===s&&void 0===t&&r++}return e=a,this.s.infinity||"v"!==this.s.type||e<=this.s[this.wrapDim]-this.totalWidth&&(e=this.s[this.wrapDim]-this.totalWidth),e},t.prototype.checkSightSnap=function(e){const t=parseFloat(this.follower._gsap[this.tr])-this.arr[this.closest][this.tr],s=this.getArrIndex(e),i=this.wrapIndex(s-1),a=this.wrapIndex(s+1),r=this.arr[this.closest][this.tr],o=(this.arr[i][this.tr]+this.arr[i][this.dim])/this.arr[i][this.dim]>=.75,l=(this.s[this.wrapDim]-(this.arr[s][this.tr]+this.arr[a][this.dim]))/this.arr[a][this.dim]>=.75,n=this.arr[this.wrapIndex(s)][this.tr],d=this.arr[i][this.dim],c=this.s[this.wrapDim];return(c-this.space)/d<2&&!this.s.infinity?0===s?(this.lastAlign="left",this.lastTi=s,0):s==a||this.lastTi==s&&"left"==this.lastAlign||this.lastFocused>=s?(this.lastAlign="right",this.lastTi=s,c-(2*d+this.space)-(i*this.space+i*d)):this.lastTi==s&&"right"==this.lastAlign||this.lastFocused<s?(this.lastAlign="left",this.lastTi=s,0-(s*this.space+s*d)):void 0:o&&l?t:o?l?t:t+c-(n+this.arr[this.wrapIndex(s)][this.dim]+(s!==a||a!==this.last||this.s.infinity?this.arr[a][this.dim]+this.space:0))+r:t-n+(s!==i||0!==s||this.s.infinity?this.space+d:0)+r},t.prototype.getClosest=function(){for(var e=1/0,t=this,s=0;s<this.arr.length;s++){var i;i="center"===this.s.align?(this.arr[s][this.tr]+this.arr[s][this.dim]/2-this.s[this.wrapDim]/2)%this.totalWidth:"end"===this.s.align?(this.arr[s][this.tr]+this.arr[s][this.dim]-this.s[this.wrapDim])%this.totalWidth:this.arr[s][this.tr]%this.totalWidth,Math.abs(i)<Math.abs(e)&&(e=i,this.closest=s,this.dist=i)}"center"===this.s.align?this.offset=(this.s[this.wrapDim]-this.arr[this.closest][this.dim])/2:"end"===this.s.align&&(this.offset=this.s[this.wrapDim]-this.arr[this.closest][this.dim]),this.lastFocused=this.focused;for(s=0;s<this.len;s++)this.arr[this.closest].elem===this.s.slides[s]&&(this.focused=s);this.focused!==this.lastFocused&&(this.waitingDragEnd=!0,this.s.slideChange&&this.dragging&&(this.scDelay&&this.scDelay.pause&&this.scDelay.pause(),this.scDelay=_tpt.gsap.delayedCall(.2,(function(){t.waitingDragEnd=!1,t.s.slideChange(t.focused)}))))},_tpt.R=_tpt.R||{},_tpt.R.carousel=_tpt.extend?_tpt.extend(_tpt.R.carousel,{status:2,version:"1.0"}):{status:2,version:"1.0"}}(),function(){"use strict";if(window.SR7??={},window._tpt??={},SR7.F??={},void 0!==SR7.F.module)return;document.addEventListener("sr.module.loaded",(function(e){SR7.F.prepareModule(e)})),SR7.F.prepareModule=e=>new Promise((async(t,s)=>{let i,a,r=e.id,o=SR7.M[r];try{a="object"!=typeof e.result?JSON.parse(e.result):e.result}catch(e){a="object"!=typeof e.result?_tpt.fixResponse(e.result):e.result}null==a.settings&&(o.migrate=!0);let l=["defaults"];o.migrate&&(a.slider_params.title=a.title,a.slider_params.alias=a.alias,l.push("migration"),a.slider_params.codes?.javascript.includes("var snowsettings")&&(a.slider_params.addOns??={},a.slider_params.addOns["revslider-snow-addon"]??={enable:!0}),l=[...l,...SR7.F.preLoadAddonsToMigrate(a.slider_params?.addOns??{})]),_tpt.checkResources(l).then((()=>{if(a?.slider_params&&(a.slider_params.dbid=a.id),o.migrate&&(SR7.migrate.collectNav(a.navs),SR7.migrate.collectTransition(a.trans)),o.migrate&&a?.slider_params&&(a.slider_params=SR7.migrate.snowConvert(a.slider_params)),o.settings=_tpt.extend(o.settings,SR7.D.moduleObj(r,a?.slider_params??a?.settings??{})),void 0!==o.cacheSize?.fullWidth&&(o.settings.size.fullWidth=o.cacheSize.fullWidth),void 0!==o.cacheSize?.fullHeight&&(o.settings.size.fullHeight=o.cacheSize.fullHeight),o.settings.general?.fallbackURL&&(_tpt.is_mobile&&"mobile"===o.settings.general?.fallbackType||("ie8"===o.settings.general?.fallbackType||_tpt.is_mobile&&"mobile-ie8"===o.settings.general?.fallbackType)&&"IE"===_tpt.browser&&(-1!==_tpt.browserVersion.indexOf("MSIE 8")||-1!==_tpt.browserVersion.indexOf("MSIE 7")))){let e=document.createElement("img");return e.src=o.settings.general.fallbackURL,e.style.width="100%",e.style.height="auto",void o.c.bgcanvas.appendChild(e)}let s;e.onlyPrepare||SR7.preLoader.state(r)&&SR7.preLoader.state(r,o.c.module)||SR7.preLoader.show(r,o.c.module),void 0!==o.c?.module?.dataset?.source&&(o.settings.source??={},o.settings.source.type=o.c.module.dataset.source,o.settings.source.sourceids=o.c.module.dataset.sourceids),e.onlyPrepare||"carousel"!=o.settings.type||null!=o.c.carousel||(o.c.carousel=document.createElement("sr7-carousel"),o.c.content.appendChild(o.c.carousel)),o.slides??={};let l=a?.slides??{},n=1;for(i in l){s=o.migrate?SR7.D.fixSR6IDs(l[i].id):l[i].slide.id,o.slides[s]=_tpt.extend(o.slides[s],SR7.D.slideObj(r,o.migrate?l[i]:l[i].slide,n++));let e="default"==(o.slides[s]?.slide?.slideshow?.len??"default")?o.settings?.default?.len??9e3:o.slides[s]?.slide?.slideshow?.len??9e3;o.slides[s].layers=_tpt.extend(o.slides[s].layers,SR7.D.layerObjects({dLEN:e,id:r,slide:l[i],sid:s,msource:o.settings.source?.type??"gallery",snow:o.migrate&&null!=a.static_slide&&void 0!==a.static_slide.id?void 0:a.slider_params?.addOns?.["revslider-snow-addon"]})),o.migrate&&(o.slides[s].layers=SR7.migrate.fixParallax(o.slides[s].layers,a?.slider_params??a?.settings??{}))}for(s in o.migrate&&null!=a.static_slide&&void 0!==a.static_slide.id&&(s=SR7.D.fixSR6IDs(a.static_slide.id,!0),a.static_slide.global=!0,o.slides[s]=_tpt.extend(o.slides[s],SR7.D.slideObj(r,a.static_slide)),o.slides[s].layers=_tpt.extend(o.slides[s].layers,SR7.D.layerObjects({id:r,slide:a.static_slide,sid:s,snow:a.slider_params?.addOns?.["revslider-snow-addon"],msource:o.settings.source?.type??"gallery"})),o.migrate&&(o.slides[s].layers=SR7.migrate.fixParallax(o.slides[s].layers,a?.slider_params??a?.settings??{}))),o.staticDiffLayers=!1,o.slides)if(!o.staticDiffLayers&&o.slides[s].slide.global)for(let e in o.slides[s].layers)(!o.staticDiffLayers||_tpt.hop(o.slides[s].layers,e)&&void 0!==o.slides[s].layers[e].sZ&&"default"!==o.slides[s].layers[e].sZ&&o.slides[s].layers[e].sZ!==o.slides[s].slide.pos)&&(o.staticDiffLayers=!0);if(o.migrate){let e=SR7.D.fixSR6IDs(a.static_slide?.id??void 0,!0);for(let t in l)s=SR7.D.fixSR6IDs(l[t].id),o.slides[s].slide.actions=SR7.migrate.fixActions(r,s,e);e&&(o.slides[e].slide.actions=SR7.migrate.fixActions(r,e,e))}if(e.onlyPrepare)return void t();SR7.D.registerModuleFonts(r),_tpt.loadFonts(),o.c?.bgcanvas||_tpt.bgStyle(r),"forceTrue"==o.settings?.size?.overflow&&o.c.module.classList.add("sr7-overflow-force"),o.fHVCarousel=o.settings.size.fullHeight&&"carousel"==o.settings.type&&"v"==o.settings.carousel.type;let d=["slide","layer","draw","animate","modifiers","srtools","csslp","carousel"];(o.settings?.codes?.js??"").includes("jQuery")&&(console.info("%cDeprecation Notice:%cjQuery functions are deprecated and no longer supported in %cSlider Revolution 6.5+. \n%cPlease refer to our documentation for alternatives and further guidance: https://www.sliderrevolution.com/manual/","color: #ee4433; font-size: 12px; font-weight: bold;","color: #aaa; font-size: 12px; ","color: #ff9800; font-size: 12px;font-weight: bold;","color: #aaa; font-size: 12px; "),_tpt.regResource({id:"jQuery",url:"https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"}),null==window.jQuery&&d.push("jQuery")),o.useAsModal&&!o.modalRegistered&&(SR7.F.modal.register({id:r,alias:o.alias,speed:parseInt(o.settings.modal?.sp??1e3)/1e3,bg:o.settings.modal?.bg??"transpaent",pS:o.settings.modal?.pS,v:o.settings.modal?.v??"middle",h:o.settings.modal?.h??"center"}),SR7.F.modal.underlay("show")),_tpt.checkResources(d).then((()=>{o.migrate&&SR7.migrate.orderGroups(o),_tpt.injectCssJs(o.settings.codes?.css??"",o.settings.codes?.js??"",o.c.module,r+"_modulestyles"),SR7.F.updateModuleDims(r,!1),_tpt.resizeObserver.observe((e=>{SR7.F.updateModuleDims(e,!0,!0)}),19,r),_tpt.orientationObserver.observe((e=>{o.c.bgcanvas&&(o.c.bgcanvas.style.maxWidth="100%"),SR7.F.orientationChanged(e,3)}),400,r),o.settings.wClass?.length>0&&o.c.module.parentNode.classList.add(o.settings.wClass),_tpt.is_mobile&&(_tpt.cacheRotation=window.screen.orientation.angle,document.addEventListener("gesturestart",(function(){_tpt.cachezoom=_tpt.getMobileZoom()})),document.addEventListener("gestureend",(function(){o.c.bgcanvas&&(o.c.bgcanvas.style.maxWidth="100%"),SR7.F.orientationChanged(r,3)}),!1)),window.removeEventListener("resize",o.earlyResizerFunction),delete o.earlyResizerFunction,_tpt.checkResources(SR7.F.getRequiredResources(r)).then((()=>{o.J&&(o.J.trigger("revolution.slide.onloaded"),o.J.trigger("sr.module.ready")),_tpt.event.trigger("dom","sr.module.ready",{id:r}),SR7.F.prepareSlides(r).then((()=>{let t;if(""!==window.location.hash){o.deepLinked=window.location.hash.replace("#","");for(let e in o.slides)o.slides[e].slide?.attr?.deepLink==o.deepLinked&&(t="#"+e)}else e?.slide&&o.navSlideOrder.includes(e.slide)?t=o.navSlideOrder.indexOf(e.slide):(t=o.settings?.slideshow?.firstSlide??void 0,t="auto"==t?void 0:parseInt(t)-1);SR7.M[r].settings.slideshow?.waitApi||SR7.F.runModule(r,t)})),o.earlyResizerFunction&&(window.removeEventListener("resize",o.earlyResizerFunction),delete o.earlyResizerFunction)}))})).catch((function(e){throw e})),t()}))})),SR7.F.orientationChanged=(e,t)=>{requestAnimationFrame((()=>{_tpt.cachezoom!=_tpt.getMobileZoom()&&window.screen.orientation.angle===_tpt.cacheRotation||(document.documentElement.scrollLeft=0,document.body.scrollLeft=0,_tpt.cacheRotation=window.screen.orientation.angle),_tpt.getWinDim(),SR7.F.updateModuleDims(e,!0,!0,!0),SR7.F.reposLayers(e),--t>0?SR7.F.orientationChanged(e,t):(_tpt.screenHeightWithUrlBar=window.innerHeight,SR7.F.updateModuleDims(e,!0,!0),SR7.M[e].c.bgcanvas&&(SR7.M[e].c.bgcanvas.style.maxWidth="none"))}))},SR7.F.runModule=(e,t)=>{SR7.F.updateModuleDims(e,!0,!0),SR7.F.module.run(e,t),SR7.F.module.listeners.init(e),SR7.M[e].c.module.observParams.toggleCall=SR7.F.module.toggle,SR7.F.initCarousel(e,t)},SR7.F.triggerSlideEvent=(e,t="",s)=>{let i=SR7.M[e];_tpt.event.trigger("dom","sr.slide"+(""!==t?"."+t:""),{id:e,current:i.current,next:i.next,previous:i.prev}),_tpt.event.trigger(i.c.module,"sr.slide"+(""!==t?"."+t:""),{id:e,current:i.current,next:i.next,previous:i.prev})},SR7.F.triggerMediaEvent=(e,t)=>{_tpt.event.trigger("dom","sr.media."+t,{mediatype:e.type,player:e.player,options:e.options,layer:e.el,id:e.id,layerid:e.el.id,skey:e.skey,state:e.state})},SR7.F.focusBlurCheck=(e,t)=>{let s=SR7.M[t];"blur"==e?s.settings.browser.freezeOnBlur&&SR7.M[t].states.inViewPort&&(s.states??={},s.states.stateBeforeFL=s.slideShow?.state,"paused"!==s.slideShow?.state&&SR7.F.module.pause(t,"blur"),_tpt.event.trigger("dom","sr.slide.tabblured",{id:t})):"focus"==e&&s.settings.browser.freezeOnBlur&&SR7.M[t].states.inViewPort&&("paused"!==s.states?.stateBeforeFL&&SR7.F.module.resume(t,"focus"),s.states??={},s.states.stateBeforeFL=s.slideShow?.state,_tpt.event.trigger("dom","sr.slide.tabfocused",{id:t}))},SR7.F.triggerLayerEvent=async(e,t)=>{let s={id:e.id,eventtype:t,caller:e.caller,scene:e.animState?.scene??e.c.animState.scene,frame:e.animState?.frame??e.c.animState.frame,c:e.c,layer:e.c.el,layerid:e.c.el.id,layertype:e.layer?.type??"",layersettings:e.layer};e.action&&(s.action=e.action),e.ease&&(s.ease=e.ease),e.start&&(s.start=e.start),e.duration&&(s.duration=e.duration),e.c.lastEventCalled=t,_tpt.event.trigger("dom","sr.layer.action",s),_tpt.event.trigger(SR7.M[e.id].c.module,"sr.layer.action",s)},SR7.F.preLoadAddonsToMigrate=e=>{let t=[];if(void 0!==e)for(let s in e)_tpt.hop(e,s)&&0!=e[s]&&"false"!=(""+e[s]?.enable??!1)&&(s=s.replace("revslider-","").replace("-addon",""),void 0!==SR7.E.resources[s]&&t.push(s),void 0!==SR7.E.resources["css"+s]&&t.push("css"+s));return t},SR7.F.initAddons=e=>{const t=[],s=SR7.M[e];if(null!=s.settings.addOns){for(let i in s.settings.addOns)if(_tpt.hop(s.settings.addOns,i)&&SR7.A?.[i]?.init){let s=SR7.A[i].init(e);Array.isArray(s)?t.push(...s):s||t.push(s)}return t}},SR7.F.module={get:e=>{let t,s=document.getElementsByTagName("sr7-module");for(var i in s)""+(s[i].dataset?.id??"")!=e&&""+(s[i].dataset?.alias??"")!=e&&""+s[i].id!=e||(t=s[i]);return t},getNextSuffx:e=>{let t=1,s=SR7.M["SR7_"+e+"_"+t];for(;void 0!==s;)t++,s=SR7.M["SR7_"+e+"_"+t];return t},collect:()=>{SR7.M=SR7.M||{};let e=document.getElementsByTagName("sr7-module");for(var t in e)_tpt.hop(e,t)&&SR7.F.module.register(e[t],e[t].id,!SR7.F.modal.trigger(e[t].dataset?.alias??void 0,e[t],e[t].dataset?.modal??void 0)&&"viewport");_tpt.displayDeprecationWarnings&&_tpt.displayDeprecationWarnings(window.SR7?.E?.php)},register:(e,t,s="viewport")=>{const i=SR7.M[t]??={};i.c??={module:e},i.c.slideBGStates??={},i.zOrder??={},i.alias=e.dataset.alias,i.dims??={},i.dims.CFC??={},i.dims.module??={},i.dims.content??={x:0,y:0},SR7.preLoader.state(t)&&SR7.preLoader.state(t,i.c.module)||SR7.preLoader.show(t,i.c.module),i.LEV=_tpt.getResponsiveLevel(SR7.G.breakPoints,t);const a=i.c.module.getElementsByTagName("image_lists");if(void 0!==a[0]){const e=a[0].getElementsByTagName("img");if(void 0!==e[0]){i.imgList=Array();for(let t in e)if(_tpt.hop(e,t)){let s=e[t].dataset.src||e[t].getAttribute("src")||e[t].getAttribute("data -src");s&&i.imgList.push({old:atob(e[t].dataset.dbsrc),new:s})}}a[0].remove()}i.settings?.fixed?(i.states.inViewPort=!0,SR7.F.module.init(i.c.module),i.c.module.observParams={obj:i}):i.c.module.observParams="viewport"==s?{callBack:SR7.F.module.init,runonce:!0,obj:i}:{obj:i};let r=i.settings?.vPort??"-100px";r=Array.isArray(r)?r[0]:r,String(r).includes("&#039;,")&&(r=r.split("&#039;,")[0]),i.settings?.sbt?.use&&(r="-200px"),String(r).includes("px")&&parseInt(r)>i.settings?.size?.height?.[i.LEV]&&(r=i.settings.size.height[i.LEV]-10+"px"),_tpt.observeModule(i.c.module,r),SR7.revapi.init(e.id)},getIdByAlias:e=>{for(let t in SR7.M)if(_tpt.hop(SR7.M,t)&&(SR7.M[t].alias==e||(SR7.M[t]?.settings?.alias??"")==e))return t},init:e=>{const t=SR7.M[e.id];t?.states?.inited||(SR7.revapi.init(e.id),window.gM=t,t.alias=_tpt.gA(e,"alias",e.id),t.states.inited=!0,SR7.JSON??={},void 0!==SR7.JSON[e.id]?"string"==typeof SR7.JSON[e.id]&&".json"==SR7.JSON[e.id].slice(-5).toLowerCase()?_tpt.getJSON({url:SR7.JSON[e.id],callBack:t=>{if("object"!=typeof t)try{t=JSON.parse(t)}catch(e){t=_tpt.fixResponse(t)}_tpt.event.trigger("dom","sr.module.loaded",{result:t,id:e.id})}}):_tpt.event.trigger("dom","sr.module.loaded",{result:SR7.JSON[e.id],id:e.id}):_tpt.restAPI({action:"get_full_slider_object",version:7,id:t.c.module.dataset.id??e.id,callBack:s=>{if("object"!=typeof s)try{s=JSON.parse(s)}catch(e){s=_tpt.fixResponse(s)}0==s.success?console.log(t.alias+" Could not be Loaded from DB"):(SR7.F.regAddonResources(s.addOns??{}),_tpt.event.trigger("dom","sr.module.loaded",{result:s,id:e.id}))}}))},run:(e,t)=>{const s=SR7.M[e];let i=SR7.F.initAddons(e);"carousel"===s.settings.type&&SR7.F.hideCarouselSlides(e),_tpt.checkResources(i).then((()=>{SR7.F.requestSlide({id:e,slide:t??0,callback:SR7.F.module.checkCarousel,indicator:s.settings.type}),_tpt.getWinDim(),"hero"!==s.settings.type&&SR7.F.navigation&&SR7.F.navigation.init(e),s.settings?.sbt?.use&&SR7.F.sbt.init(e),"off"!==String(s.settings.nav?.m?.use)&&"false"!==String(s.settings.nav?.m?.use)&&(SR7.F.module.wheelModules?-1===SR7.F.module.wheelModules.indexOf(e)&&SR7.F.module.wheelModules.push(e):(SR7.F.module.wheelModules=[e],window.addEventListener("wheel",SR7.F.module.listeners.wheel,{passive:!1}))),"carousel"!==s.settings.type&&"off"!==String(s.settings.nav?.s?.use)&&"false"!==String(s.settings.nav?.s?.use)&&(_tpt.is_mobile||s.settings.nav?.s?.desk)&&SR7.F.module.listeners.touchSwipe(e),"off"!==(s.settings.nav?.k?.use??"off")&&_tpt.keyBoard.reg(e,"navListener",SR7.F.module.listeners.keyboard,["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"])}))},checkCarousel:async e=>{const t=SR7.M[e];if("carousel"===t.settings.type){const s=[];for(let i in t.slides)_tpt.hop(t.slides,i)&&(_tpt.getWinDim(),s.push(new Promise((s=>{setTimeout((async()=>{await SR7.F.redrawBG(e,i,!0),"all"===t.settings.carousel.showAllLayers&&setTimeout((()=>{SR7.F.drawSlide({id:e,slideid:i,keepSlideVisible:!0,type:"process",global:!0,render:!0,callback:()=>SR7.F.showCarouselSlide(e,i)})}),0),s()}),0)}))));await Promise.all(s)}t.checkCarouselDone=!0},toggle:(e,t,s)=>{SR7.M[e].states.inViewPort?SR7.M[e].states?.forcedPause||SR7.F.module.resume(e,s):SR7.F.module.pause(e,s);for(let t in SR7.M[e].settings.addOns)_tpt.hop(SR7.M[e].settings.addOns,t)&&SR7.A?.[t]?.toggle&&SR7.A[t].toggle(e,t)},pause:(e,t)=>{const s=SR7.M[e];if(null!=s.c.tl){SR7.slideShow.pause(e),s.c.tl.cachePlayed=[];for(let e in s.c.tl[s.current.id]){if(!_tpt.hop(s.c.tl[s.current.id],e)||null==s.c.tl[s.current.id][e])continue;let t=s.c.tl[s.current.id][e];for(let i in t)_tpt.hop(t,i)&&t[i].isActive()&&(s.c.tl.cachePlayed.push({scenes:e,tl:i}),t[i].pause())}if(["scroll","blur"].includes(t)&&!s.settings.browser.mISB){s.videosPlayingCache??={};for(let e in s.videosPlaying)_tpt.hop(s.videosPlaying,e)&&("carousel"===s.settings.type&&s.videosPlaying[e]?.skey===s.current.id||(s.videosPlayingCache[e]=s.videosPlaying[e],s.videosPlaying[e].pause("scroll")))}}},resume:(e,t)=>{const s=SR7.M[e],i=s.c?.tl?.cachePlayed??void 0;if(SR7.slideShow.resume(e),i)for(let e in i)s.c.tl[s.current.id][i[e].scenes][i[e].tl].resume();if(["scroll","focus"].includes(t)&&!s.settings.browser.mISB)for(let e in s.videosPlayingCache)_tpt.hop(s.videosPlayingCache,e)&&("carousel"===s.settings.type&&s.videosPlaying[e]?.skey===s.current.id||(s.videosPlayingCache[e].play(),delete s.videosPlayingCache[e]))},size:t=>{const s=SR7.M[t];if(e(t,s,"t"),e(t,s,"b"),s.c.module.style.height=(s.dims.sbt??s.dims.module.h)+"px",s.c.adjuster.style.height=s.dims.module.h+"px",s.c.content.style.height=s.dims.content.h+"px",s.c.content.style.width=s.dims.content.w+"px",s.c.content.style.left=1==s.sbtFreeze?"0px":s.dims.content.mwshiftx+s.dims.content.shiftx+"px",null==s.dims.sbt&&(s.c.content.style.top=s.dims.content.shifty+"px"),s.slideRatios&&"v"!==(s.settings?.carousel?.type??""))for(let e in s.slideRatios)_tpt.hop(s.slideRatios,e)&&!s.slides[e].slide.global&&(s.c.slides[e].style.width=Math.ceil(s.settings.carousel.jMWidth?Math.min(s.dims.CFC[e].w,s.dims.module.w):s.dims.CFC[e].w)+"px");else if("carousel"===s.settings.type)for(let e in s.c.slides)s.slides[e].slide.global?s.slides[e].slide.fullHeight&&(s.c.slides[e].style.height=s.dims.module.h+"px",s.c.slides[e].style.top=0-(s.dims.carousel?.pT??0)+"px"):(s.c.slides[e].style.width=("v"===s.settings.carousel.type||s.settings.carousel.stretch?s.dims.module.w:s.dims.CFC.w)+"px","v"===s.settings.carousel.type&&(s.c.slides[e].style.height=parseInt(s.settings.size.height[s.LEV])+"px"))},box:e=>{SR7.M[e].dims.moduleRect=SR7.M[e].c.module.getBoundingClientRect()},fullScreen:(e,t)=>{requestAnimationFrame((function(){const s=SR7.M[e];t&&!s.states.inFullscreen?s.c.module.classList.add("sr7-fullscreen"):!t&&s.states.inFullscreen&&s.c.module.classList.remove("sr7-fullscreen"),s.states.cachedFullheight??=s.settings.size.fullHeight,s.states.inFullscreen=t,s.settings.size.fullHeight=!!t||s.states.cachedFullheight,_tpt.resizeObserver.execute(),_tpt.scrollObserver.run(s.c.module)}))},isFirstSlide:e=>0==SR7.M[e].current.index,isLastSlide:e=>SR7.M[e].current.index===(void 0!==SR7.M[e].navSlideOrder?SR7.M[e].navLen-1:SR7.M[e].len-1),listeners:{init:e=>{const t=SR7.M[e];(t.settings.mod?.use||t.settings.sbt?.use)&&_tpt.scrollObserver.observe(t.c.module),t.c.module.observParams.scrollCallback=e=>{t.settings.mod?.use&&SR7.F.callBackHandler(e,"parallax","start"),t.settings.sbt?.use&&SR7.F.callBackHandler(e,"sbt","start"),t.c?.moduleListeners?.scroll&&SR7.F.module.listeners.callBacks(e,t.c.moduleListeners.scroll)},t.settings?.browser?.freezeOnBlur&&_tpt.focusObserver.observe(((e,t)=>{SR7.F.focusBlurCheck(e,t)}),0,e)},callBacks:(e,t)=>{for(let s in t)_tpt.hop(t,s)&&t[s](e)},keyboard:(e,t)=>{const s=SR7.M[t.id];void 0!==s.states.navKeyDown&&(new Date).getTime()-s.states.navKeyDown<500||("horizontal"==s.settings.nav.k.use&&39==e.keyCode||"vertical"==s.settings.nav.k.use&&40==e.keyCode?SR7.F.requestSlide({id:t.id,slide:"+1"}):("horizontal"==s.settings.nav.k.use&&37==e.keyCode||"vertical"==s.settings.nav.k.use&&38==e.keyCode)&&SR7.F.requestSlide({id:t.id,slide:"-1"}),s.states.navKeyDown=(new Date).getTime())},mouse:(e,t)=>{const s=SR7.M[t.id];if("mouseenter"==e.type||"touchstart"==e.type?s.states.overModule=!0:"mouseleave"==e.type||"touchend"==e.type?s.states.overModule=!1:"mousemove"==e.type||"touchmove"==e.type?s.states.overModule=!0:e.type,s.c?.moduleListeners?.[e.type])for(let i in s.c.moduleListeners[e.type])_tpt.hop(s.c.moduleListeners[e.type],i)&&s.c.moduleListeners[e.type][i](t.id,e)},touchSwipe:e=>{let t={...SR7.M[e].settings.nav.s};t.t=parseInt(t.t??1),_tpt.is_touch??="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,_tpt.is_touch&&t.t>1?SR7.F.module.listeners.touchSwipeMulti(e,t):SR7.F.module.listeners.touchSwipeSimple(e,t)},touchSwipeMulti:(e,t)=>{let s=0,i=0,a=0,r=0,o=!1,l=!1;function n(n){if(!o)return;let d;if(o=!1,d=Math.abs(r-i)>Math.abs(a-s)?r<i?"up":"down":a<s?"left":"right",l||"vertical"===t.d&&("up"===d&&SR7.F.module.isLastSlide(e)||"down"===d&&SR7.F.module.isFirstSlide(e)))return SR7.F.scrollTo(e,"up"===d?SR7.M[e].c.module.offsetTop+SR7.M[e].dims.module.h:document.documentElement.scrollTop-(window.innerHeight-SR7.M[e].c.module.getBoundingClientRect().top));"horizontal"===t.d&&"left"===d||"vertical"===t.d&&"up"===d?SR7.F.requestSlide({id:e,slide:"+1"}):("horizontal"===t.d&&"right"===d||"vertical"===t.d&&"down"===d)&&SR7.F.requestSlide({id:e,slide:"-1"})}SR7.M[e].c.module.addEventListener("touchstart",(function(e){if(null===e.target.closest(".sr7-tabs, .sr7-thumbs"))if(e.touches.length===t.t){const a=e.touches[0];s=a.pageX,i=a.pageY,o=!0,!_tpt.is_mobile&&t.bV&&e.preventDefault()}else o=!1;else o=!1}),{passive:!1}),SR7.M[e].c.module.addEventListener("touchmove",(function(n){if(!o||n.touches.length!==t.t)return void(o=!1);const d=n.touches[0];a=d.pageX,r=d.pageY;let c=Math.abs(r-i)>Math.abs(a-s)?"vertical":"horizontal";c===t.d&&(n.preventDefault(),l="vertical"===c&&(r<i&&SR7.M[e].current.index===SR7.M[e].navLen||r>i&&0===SR7.M[e].current.index))}),{passive:!1}),SR7.M[e].c.module.addEventListener("touchend",n,{passive:!1}),SR7.M[e].c.module.addEventListener("touchcancel",n,{passive:!1})},touchSwipeSimple:(e,t)=>{SR7.M[e].c.swipeProxy=document.createElement("div"),SR7.M[e].c.swipeAble=_tpt.draggable.create(SR7.M[e].c.swipeProxy,{trigger:SR7.M[e].c.module,type:"horizontal"===t.d?"x":"y",cursor:"pointer",lockAxis:!0,allowContextMenu:_tpt.is_mobile&&!t.bV,allowEventDefault:!t.bV,onPress:function(s){null!==s.target.closest(".sr7-tabs, .sr7-thumbs")&&(SR7.M[e].c.swipeAble[0].endDrag(),SR7.M[e].c.swipeAble[0].disable()),t.pressX=s.pageX,t.pressY=s.pageY},onDragStart:function(){t.forceScroll="up"===this.getDirection()&&SR7.M[e].current.index==SR7.M[e].navLen||"down"===this.getDirection()&&0===SR7.M[e].current.index},onDragEnd:function(s){var i=this.getDirection();if(Math.abs(s.pageY-t.pressY)>Math.abs(s.pageX-t.pressX)){if("right"===i||"left"===i)return}else if(Math.abs(s.pageY-t.pressY)>Math.abs(s.pageX-t.pressX)&&("up"===i||"down"===i))return;return t.forceScroll||"vertical"==t.d&&"up"==i&&SR7.F.module.isLastSlide(e)||"vertical"==t.d&&"down"==i&&SR7.F.module.isFirstSlide(e)?SR7.F.scrollTo(e,"up"===i?SR7.M[e].c.module.offsetTop+SR7.M[e].dims.module.h:document.documentElement.scrollTop-(window.innerHeight-SR7.M[e].c.module.getBoundingClientRect().top)):(_tpt.is_mobile&&(SR7.M[e].settings.nav?.nd??0)>200&&(SR7.M[e].settings.nav.nd=50),"horizontal"==t.d&&"left"==i||"vertical"==t.d&&"up"==i?(SR7.F.requestSlide({id:e,slide:"+1"}),!1):"horizontal"==t.d&&"right"==i||"vertical"==t.d&&"down"==i?(SR7.F.requestSlide({id:e,slide:"-1"}),!1):void 0)}})},wheel:function(e){if(SR7.F.module.wheelModules??=[],!SR7.F.module.wheelModules.length)return;let t=document.elementFromPoint(e.x,e.y);for(let s of SR7.F.module.wheelModules){let i=SR7.M[s];if(!t.closest(`#${i.c.module.id}`))continue;let a=_tpt.normalizeWheel(e),r=i.settings.nav.m,o=r.v/100,l=window.pageYOffset||document.documentElement.scrollTop,n=SR7.F.module["reverse"==r.r?"isLastSlide":"isFirstSlide"](s),d=SR7.F.module["reverse"!==r.r?"isLastSlide":"isFirstSlide"](s);i.dims.moduleRect=SR7.M[s].c.module.getBoundingClientRect();let c=SR7.F.calculateVisiblePercentage(i.dims.moduleRect),p=a<0?-1:1,h=!1,u=!1;if(r.cd??=parseInt(r.cd??1500),!(o-c<=r.st/100)||c>=o||i.dims.moduleRect.top>=0&&-1===p||i.dims.moduleRect.top<=0&&1===p||(u=!0,i.mScrollTween||(i.mScrollTween=SR7.F.scrollTo(s,l+i.dims.moduleRect.top+(p*("reverse"==r.r?-1:1)==1?i.dims.moduleRect.height-_tpt.winH:0),_tpt.isWebkit?1:.7,"power2.out",(function(){SR7.M[s].dims.moduleRect=SR7.M[s].c.module.getBoundingClientRect(),SR7.M[s].mScrollTween.kill(),delete SR7.M[s].mScrollTween})))),Math.abs(c-o)<.1||c>=o||Math.abs(c-o)>=.1&&c<o&&(p*("reverse"==r.r?-1:1)==1&&Math.abs(_tpt.winH-i.dims.moduleRect.top-i.dims.moduleRect.height)/i.dims.moduleRect.height<.1||p*("reverse"==r.r?-1:1)==-1&&Math.abs(i.dims.moduleRect.top)/i.dims.moduleRect.height<.1)){let t="reverse"===r.r&&p<0||"reverse"!==r.r&&p>0?"reverse"!==r.r?0:1:"reverse"!==r.r?1:0;return"carousel"===i.settings.nav.m.use||0===t&&!d||1===t&&!n?(t=0==t?"reverse"==r.r?"-1":"+1":"reverse"==r.r?"+1":"-1",!0!==i.wheelAction&&(SR7.F.requestSlide({id:s,slide:t}),i.wheelAction=!0,setTimeout((function(){i.wheelAction=!1}),r.cd))):!0!==i.wheelAction&&(h=!0),h?(i.mScrollTween&&(SR7.M[s].dims.moduleRect=SR7.M[s].c.module.getBoundingClientRect(),SR7.M[s].mScrollTween.kill(),delete SR7.M[s].mScrollTween),!0):(e.preventDefault(),!1)}u&&e.preventDefault()}},updateMouseCoordinates:(e,t,s)=>{const i=SR7.M[e];let a,r;if(t.type.includes("touch")){if(void 0===t.touches[0])return;a=t.touches[0].clientX,r=t.touches[0].clientY}else a=t.clientX,r=t.clientY;void 0!==i.mouse.enterX&&void 0!==i.mouse.enterY&&"mouseenter"!==t.type&&"touchstart"!==t.type||(SR7.F.module.box(e),i.mouse.enterX=a-i.dims.moduleRect.left,i.mouse.enterY=r-i.dims.moduleRect.top),"mousemove"!==t.type&&"touchmove"!==t.type&&"dragmove"!==t.type||(i.mouse.x=a,i.mouse.y=r,i.mouse.relX=a-("dragmove"==t.type||i.settings.size.fullWidth?0:i.dims.moduleRect.left+i.dims.content.mwshiftx),i.mouse.relY=r-("dragmove"==t.type?_tpt.scrollObserver.y+i.dims.moduleRect.top:i.dims.moduleRect.top),i.mouse.eDX=i.mouse.enterX-i.mouse.relX,i.mouse.eDY=i.mouse.enterY-i.mouse.relY,i.mouse.cDX=i.dims.module.w/2-i.mouse.relX,i.mouse.cDY=i.dims.module.h/2-i.mouse.relY),"touchstart"!=t.type&&"touchend"!=t.type||(i.mouse.relX=a-(i.settings.size.fullWidth?0:i.dims.moduleRect.left+i.dims.content.mwshiftx),i.mouse.relY=r-i.dims.moduleRect.top,i.mouse.eDXF=i.mouse.cDXF=i.dims.module.w/2-i.mouse.relX,i.mouse.eDYF=i.mouse.cDYF=i.dims.module.h/2-i.mouse.relY)},reg:(e,t,s,i)=>{const a=SR7.M[e];a.mouse??={},t=t.split(" ");let r=Math.round(1e6*Math.random());for(let e in t)void 0!==(a.c.moduleListeners?.[t[e]]?.[r]??void 0)&&r++;for(let o in t)0==(a.c.moduleListeners?.[t[o]]??!1)&&_tpt.event.listen(a.c.module,t[o],SR7.F.module.listeners.mouse,{id:e},i),a.c.moduleListeners??={},a.c.moduleListeners[t[o]]??={},a.c.moduleListeners[t[o]][r]=s;return r},del:(e,t,s)=>{SR7.M[e]?.c?.moduleListeners?.[t]?.[s]&&delete SR7.M[e].c.moduleListeners[t][s]}}},SR7.F.getRequiredResources=function(e){const t=Array(50),s=SR7.M[e];let i=0;if(SR7.R?.nav&&(t[i++]="navigation",t[i++]="cssnav"),t[i++]="media",t[i++]="cssmedia",SR7.R?.cssbtns&&(t[i++]="cssbtns"),void 0!==s.settings.addOns)for(let e in s.settings.addOns)_tpt.hop(s.settings.addOns,e)&&0!=s.settings.addOns[e]&&(void 0!==SR7.E.resources[e]&&(t[i++]=e),void 0!==SR7.E.resources["css"+e]&&(t[i++]="css"+e));for(let e in SR7.E.gAddons)_tpt.hop(SR7.E.gAddons,e)&&(void 0!==SR7.E.resources[e]&&(t[i++]=e,s.settings.addOns??={},s.settings.addOns[e]={u:!0}),void 0!==SR7.E.resources["css"+e]&&(t[i++]="css"+e));return t},SR7.F.getNewId=async function(e,t,s){return new Promise(((i,a)=>{"slide"==e&&void 0!==t?i(t):"module"==e&&void 0!==s?i(s):"slide"==e&&null==s?a(null):_tpt.ajax({action:"get_"+e+"id",data:{module:s},callBack:e=>i(e),errorHandler:e=>a(e)})}))},SR7.F.getGlobalZoneHeights=e=>{SR7.M[e].zones??={},SR7.M[e].zones.globals??={},SR7.M[e].zones.globals.all=0;for(let t in SR7.M[e].staticSlides)_tpt.hop(SR7.M[e].staticSlides,t)&&(SR7.M[e].zones.globals.all=Math.max(SR7.M[e].zones.globals.all||0,SR7.F.getZoneHeights(e,SR7.M[e].staticSlides[t])||0));return SR7.M[e].zones.globals.all||0},SR7.F.getZoneHeights=function(e,t){let s=SR7.M[e];if((null!=t||null!=s.current)&&-1!=s.current.id&&(t??=s.current.id,s.zones[t]&&null!=s.zones[t].zones)){s.zones[t].all=0;for(let e in s.zones[t].zones)s.zones[t].zones[e]=s.c.layers[SR7.lToK[e]].el.offsetHeight,s.zones[t].all+=s.zones[t].zones[e];return s.zones[t].all}},SR7.F.getONavs=e=>{const t=SR7.M[e];t.dims.outNav={w:0,h:0,x:0,y:0,align:"left"};for(let s of["tabs","thumbs","scrubber"])if(t.settings.nav?.[s]?.set){let i=t.settings.nav?.[s];if("i"==i.io||0==(i?.show?.[t.LEV]??!0))continue;let a=2*SR7.gV({v:i.wr.p,id:e,u:0});"vertical"==SR7.gV({v:i.d,id:e,u:0})?(t.dims.outNav.w=Math.max(t.dims.outNav.w,SR7.gV({v:i.size.w,id:e,u:0,a:!0})+a),t.dims.outNav.x="left"==SR7.gV({v:i.h,id:e,u:0})?t.dims.outNav.w:-t.dims.outNav.w/2,t.dims.outNav.align="left"==SR7.gV({v:i.h,id:e,u:0})?"left":"right"):(t.dims.outNav.h=Math.max(t.dims.outNav.h,SR7.gV({v:i.size.h,id:e,u:0})+a),t.dims.outNav.y="top"==SR7.gV({v:i.v,id:e,u:0})?t.dims.outNav.h:0,t.dims.outNav.align="top"==SR7.gV({v:i.v,id:e,u:0})?"top":"bottom")}};const e=(e,t,s)=>{let i=SR7.gV({v:t.settings.size.m?.[s]??0,id:e,u:0});(t.dims.margins?.[s]??0)!==i&&(t.c.module.style["margin"+("t"==s?"Top":"Bottom")]=i+"px",t.dims.margins??={},t.dims.margins[s]=i),t.offsetPrepared&&t.c.bgcanvas&&(t.c.bgcanvas.style.visibility="visible",delete t.offsetPrepared)};SR7.F.updateModuleDims=function(e,t,s,i){null==_tpt.winWAll&&_tpt.getWinDim();let a=SR7.M[e],r="carousel"===a.settings.type;a.dims.module.w=a.settings.size.fullWidth?_tpt.winW:a.c.module.offsetWidth,a.LEV=_tpt.getResponsiveLevel(SR7.G.breakPoints,e),SR7.F.getONavs(e),a.dims.cache??=[],a.dims.cache.push({w:_tpt.winW,h:_tpt.winH}),a.dims.cache.length>10&&a.dims.cache.shift();let o=SR7.gV({v:a.settings.size.width,id:e,u:0}),l=parseInt(SR7.gV({v:a.settings.size.height,id:e,u:0}));if(!a.settings.size.fullWidth&&0==a.dims.module.w&&0==a.dims.module.h){try{"flex"==getComputedStyle(a.c?.module?.parentNode?.parentNode)?.display&&(a.c.module.parentNode.style.width="100%"),a.dims.module.w=o,a.dims.module.h=l}catch(e){}console.log(a.alias," set to auto width but its parents element Dimension is 0px. Please check parrent element ! ")}a.dims.reduceHeight=a.settings.size.fullHeight&&!a.states.inFullscreen&&SR7.F.getContsHeights(a.settings.size.fullHeightOffset,a.dims.module.h)||0,a.dims.padding={t:SR7.gV({v:a.settings.size.p?.t??0,id:e,u:0}),b:SR7.gV({v:a.settings.size.p?.b??0,id:e,u:0}),l:SR7.gV({v:a.settings.size.p?.l??0,id:e,u:0}),r:SR7.gV({v:a.settings.size.p?.r??0,id:e,u:0})},a.dims.CFC.w=Math.min(o,a.dims.module.w-a.dims.outNav.w)||0,a.MP=r&&a.settings.carousel.justify?1:Math.min(1,a.dims.CFC.w/o),a.useHMP=(!a.settings.sbt?.use&&a.settings.size.fullHeight&&_tpt.winH<l||(a.settings.sbt?.use??!1)&&_tpt.winW<o)&&a.LEV<3,a.useHMP?(a.settings.sbt?.use||(a.MP=Math.min(a.MP,Math.max(_tpt.is_mobile?320:640,_tpt.winH-a.dims.reduceHeight)/l)),a.dims.CFC.w=Math.min(o*a.MP,a.dims.module.w-a.dims.outNav.w)||0):a.useHMP=!0,a.dims.zones=Math.max(SR7.F.getGlobalZoneHeights(e)||0,SR7.F.getZoneHeights(e)||0);let n=SR7.gV({v:a.settings.size.minHeight,id:e,u:0});n="none"==n?0:n;let d=_tpt.is_mobile&&a.settings.size.fullHeight&&_tpt.is_mobile&&a.settings.mobileURLJumpFix?Math.max(l,Math.max(a.dims.zones,_tpt.screenHeightWithUrlBar)):a.settings.size.respectRatio?l/o*a.dims.module.w:SR7.gV({v:a.settings.size.maxHeight,id:e,u:0});a.dims.module.h=a.settings.size.respectRatio?l/o*a.dims.module.w:Math.max(a.dims.zones,Math.max(a.settings.size.fullHeight?_tpt.is_mobile&&a.settings.mobileURLJumpFix?_tpt.screenHeightWithUrlBar:_tpt.winH:0,Math.max(l,n)*(a.settings.size.keepBPHeight?1:a.MP))),d>0&&(a.dims.module.h=Math.min(d,a.dims.module.h)),a.useAsModal&&(a.dims.module.h<_tpt.winH?(a.c.module.style.inset="50% 0px auto",a.c.module.style.transform="translate(0px, -50%)"):(a.c.module.style.inset="auto",a.c.module.style.transform="translate(0px, 0px)")),r&&(a.dims.carousel={pT:parseInt(a.settings.carousel.pT??0)*a.MP,pB:parseInt(a.settings.carousel.pB??0)*a.MP},a.settings.size.fullHeight||"v"!==a.settings.carousel.type||(a.dims.module.pNV=_tpt.posToNum(a.settings.carousel.pNV,a.dims.module.h),a.dims.module.h+=a.dims.module.pNV)),a.dims.CFC.h=Math.max(a.dims.zones,Math.max(l,n)*(a.settings.size.keepBPHeight?1:a.MP)),a.dims.module.h-=a.dims.reduceHeight,a.dims.content.h=a.dims.module.h,a.settings.size.fullWidth&&SR7.F.module.box(e);let c=(a.settings.size.fullWidth?_tpt.winWAll:a.dims.module.w)-(null==a.settings.size.p?0:a.dims.padding.l+a.dims.padding.r)-a.dims.outNav.w;if(a.dims.content.w=a.settings.size.fullWidth?c:Math.min(parseInt(_tpt.posToNum(a.settings.size.maxWidth,_tpt.winWAll))||_tpt.winWAll,c),a.dims.content.mwshiftx=(c-a.dims.content.w)/2,a.dims.module.h+=(null==a.settings.size.p?0:a.dims.padding.t+a.dims.padding.b)+a.dims.outNav.h+(r?a.dims.carousel.pT+a.dims.carousel.pB:0),a.dims.content.shiftx=a.dims.outNav.x<0?0-(a.settings.size.fullWidth?a.dims.moduleRect.left??0:0):a.settings.size.fullWidth?-(a.dims.moduleRect.left??0)+a.dims.padding.l+a.dims.outNav.x:a.dims.padding.l+a.dims.outNav.x,a.dims.content.shifty=a.dims.padding.t+a.dims.outNav.y+(r?a.dims.carousel.pT:0),a.dims.CFC.x=Math.max(0,(a.dims.content.w-a.dims.CFC.w)/2),a.dims.CFC.y=Math.max(0,(a.dims.content.h-a.dims.CFC.h)/2),a.dims.content.cw=a.dims.content.w,a.dims.content.ch=a.dims.content.h,a.dims.CFC.cw=a.dims.CFC.w,a.dims.CFC.ch=a.dims.CFC.h,a.settings.sbt?.use&&(a.sbt??={},a.sbt.__len=SR7.slideShow.getLen(e),a.sbt.__slen=parseInt(a.settings.sbt.fStart??0),a.sbt.__elen=a.sbt.__len-parseInt(a.settings.sbt.fEnd??a.sbt.__len),a.sbt.__mlen=a.sbt.__len-(a.sbt.__slen+a.sbt.__elen),a.settings.sbt?.f&&(a.dims.sbt=Math.max(2*a.dims.module.h,a.sbt.__len/3))),r){a.dims.CFC.ch=a.dims.CFC.h="v"===a.settings.carousel.type?Math.min(a.dims.module.h,parseFloat(a.settings.size.height[a.LEV])):Math.min(a.dims.content.h,a.dims.module.h),a.settings.carousel.justify&&SR7.F.getSlideARatios(e);for(let e in a.c.slides)_tpt.hop(a.c.slides,e)&&(a.dims.CFC[e]??={},a.dims.content[e]??={},a.dims.CFC[e].cw=a.dims.CFC[e].w=a.slides[e].slide.global?a.settings.carousel.justify?a.dims.content.w:a.dims.CFC.w:"v"===a.settings.carousel.type?a.dims.CFC.w:a.settings.carousel.justify?a.dims.module.h*a.slideRatios[e]||a.dims.CFC.w:a.settings.carousel.stretch?a.dims.module.w:a.dims.CFC.w,a.dims.CFC[e].cw=a.dims.CFC[e].w=Math.min(a.dims.CFC[e].cw,a.dims.module.w),a.dims.CFC[e].ch=a.dims.CFC[e].h=a.slides[e].slide.global?a.dims.CFC.h+(a.settings.carousel.justify?0:a.dims.carousel.pT+a.dims.carousel.pB):(a.slides[e].slide.fullHeight,a.dims.CFC.h),a.slides[e].slide.global&&!a.settings.carousel.justify&&(a.dims.CFC[e].x=a.dims.CFC.x,a.dims.CFC[e+"_slide"]??={},a.dims.CFC[e+"_slide"].cw=a.dims.CFC[e+"_slide"].w=a.dims.module.w,a.dims.CFC[e+"_slide"].ch=a.dims.CFC[e+"_slide"].h=a.dims.CFC[e].ch,a.dims.CFC[e+"_slide"].x=0),"v"==a.settings?.carousel?.type?(a.dims.CFC[e].x=a.dims.CFC.x,a.dims.CFC[e].y=0,a.dims.CFC[e+"_full"]??={},a.dims.CFC[e+"_full"].cw=a.dims.CFC[e+"_full"].w=a.dims.content.w,a.dims.CFC[e+"_full"].ch=a.dims.CFC.h=a.dims.CFC[e].ch,a.dims.CFC[e+"_full"].x=a.dims.content.x):a.slides[e].slide.global&&a.settings.size.fullHeight&&(a.dims.CFC[e].x=0,a.dims.CFC[e].y=0))}!function(e){const t=SR7.M[e];null==t.c.bgOverlay&&t.settings.bg?.overlay?.type&&(null==t.c.bgcanvas&&_tpt.bgStyle(e,void 0,!1,!0,!0),t.c.bgOverlay=SR7.F.addOverlay(t.settings.bg.overlay.type,t.settings.bg.overlay.size,t.settings.bg.overlay.cA,t.settings.bg.overlay.cB),t.c.bgcanvas.appendChild(t.c.bgOverlay));if(null==t.c.bgcanvas)return;t.c.bgcanvas.dataset.pos??=t.c.bgcanvas.closest("SR7-CONTENT")?"content":"module",t.c.bgcanvas.style.width=t.settings.size.fullWidth?_tpt.winW+"px":t.dims.content.w+(t.dims.outNav?.w??0)+"px",t.c.bgcanvas.style.height=("carousel"==t.settings.type?t.dims.module.h:t.dims.content.h+parseInt((t.dims.padding.t??0)+parseInt(t.dims.padding.b??0))+parseInt(t.dims.outNav?.h??0))+"px",t.c.bgcanvas.style.left=t.settings.sbt?.use&&t.settings.sbt?.f||"content"==t.c.bgcanvas.dataset.pos?"0px":(t.settings.size.fullWidth?t.dims.content.mwshiftx+t.dims.content.shiftx:0)+(t.dims.padding?.l??0)-("left"==(t.dims.outNav?.align??"left")&&t.settings.size.fullWidth?t.dims.outNav?.w??0:0)+"px",t.settings.size.fullWidth||0===t.dims.padding.t||(t.c.bgcanvas.style.top=0-t.dims.padding.t+"px")}(e),a.useAsModal&&SR7.F.modal.visible&&SR7.F.modal.requested==a.alias&&(SR7.F.modal.updatePos(),SR7.F?.modal?.sbt&&(SR7.F.modal.wrap.style.height=a.dims.moduleRect.height+"px")),t&&(_tpt.is_mobile&&a.dims.lastHeight&&a.dims.content.Ccw==a.dims.content.w&&a.dims.content.Cch==a.dims.content.h&&a.dims.CFC.Ccw==a.dims.CFC.w&&a.dims.CFC.Cch==a.dims.CFC.h||(a.dims.content.Ccw=a.dims.content.w,a.dims.content.Cch=a.dims.content.h,a.dims.CFC.Ccw=a.dims.CFC.w,a.dims.CFC.Cch=a.dims.CFC.h,i||cancelAnimationFrame(a.updateModuleDimsrAF),a.updateModuleDimsrAF=requestAnimationFrame((function(){if("hero"!==a.settings.type&&SR7.F?.navigation?.update&&SR7.F.navigation.update(e),SR7.F.module.size(e),-1!=(a.current?.id??-1)){if(!(function(e){if(e.length<10)return!1;let t=e.slice(-10),s=[];for(let e=0;e<t.length;e++)s.some((s=>s.w===t[e].w&&s.h===t[e].h))||s.push(t[e]);return 2===s.length}(a.dims.cache)&&(_tpt.getWinDim(),!0!==s&&_tpt.winW>=a.dims.module.w))){_tpt.scrollObserver.run(a.c.module,!0),SR7.F.drawRawLayers(e,a.current.id,"update");for(let t in a.staticSlides)_tpt.hop(a.staticSlides,t)&&""!=a.staticSlides[t]&&SR7.F.drawRawLayers(e,a.staticSlides[t],"update");r&&requestAnimationFrame((()=>{SR7.F.rebuildCarousel(e,"height"!==t,"height"!==t)})),_tpt.getWinDim(),a.dims.cache[a.dims.cache.length-1].w===_tpt.winW&&a.dims.cache[a.dims.cache.length-1].h===_tpt.winH||SR7.F.updateModuleDims(e,!0)}}else r&&a.dims.oldWinW!==_tpt.winW&&(requestAnimationFrame((()=>{SR7.F.rebuildCarousel(e,!1)})),a.dims.oldWinW=_tpt.winW)}))))},SR7.F.callBackHandler=(e,t,s)=>{if(SR7.M[e].c.callBacks)for(let i of SR7.M[e].c.callBacks)i.inmodule==t&&i.atposition==s&&void 0!==i.callback&&i.callback.call()},_tpt.R??={},_tpt.R.module=_tpt.extend?_tpt.extend(_tpt.R.module,{status:2,version:"1.0"}):{status:2,version:"1.0"}}();
// source --> https://3d360properties.com/wp-content/themes/houzez/js/vendors/mapbox/mapbox-gl.js?ver=3.11.1 
/* Mapbox GL JS is Copyright © 2020 Mapbox and subject to the Mapbox Terms of Service ((https://www.mapbox.com/legal/tos/). */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.mapboxgl = factory());
})(this, (function () { 'use strict';

/* eslint-disable */

var shared, worker, mapboxgl;
// define gets called three times: one for each chunk. we rely on the order
// they're imported to know which is which
function define(_, chunk) {
if (!shared) {
    shared = chunk;
} else if (!worker) {
    worker = chunk;
} else {
    var workerBundleString = "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 = {}; (" + shared + ")(sharedChunk); (" + worker + ")(sharedChunk); self.onerror = null;"

    var sharedChunk = {};
    shared(sharedChunk);
    mapboxgl = chunk(sharedChunk);
    if (typeof window !== 'undefined' && window && window.URL && window.URL.createObjectURL) {
        mapboxgl.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' }));
    }
}
}


define(["exports"],(function(t){function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var r,n={},i={};function s(){if(r)return i;r=1,Object.defineProperty(i,"__esModule",{value:!0}),i.setMatrixArrayType=function(t){i.ARRAY_TYPE=e=t;},i.toRadian=function(t){return t*s},i.equals=function(e,r){return Math.abs(e-r)<=t*Math.max(1,Math.abs(e),Math.abs(r))},i.RANDOM=i.ARRAY_TYPE=i.EPSILON=void 0;var t=1e-6;i.EPSILON=t;var e="undefined"!=typeof Float32Array?Float32Array:Array;i.ARRAY_TYPE=e;var n=Math.random;i.RANDOM=n;var s=Math.PI/180;return Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),i}var a,o={};function l(){if(a)return o;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}a=1,Object.defineProperty(o,"__esModule",{value:!0}),o.create=function(){var t=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},o.clone=function(t){var r=new e.ARRAY_TYPE(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r},o.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},o.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},o.fromValues=function(t,r,n,i){var s=new e.ARRAY_TYPE(4);return s[0]=t,s[1]=r,s[2]=n,s[3]=i,s},o.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},o.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r;}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},o.invert=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=r*s-i*n;return a?(t[0]=s*(a=1/a),t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null},o.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t},o.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},o.multiply=n,o.rotate=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(r),l=Math.cos(r);return t[0]=n*l+s*o,t[1]=i*l+a*o,t[2]=n*-o+s*l,t[3]=i*-o+a*l,t},o.scale=function(t,e,r){var n=e[1],i=e[2],s=e[3],a=r[0],o=r[1];return t[0]=e[0]*a,t[1]=n*a,t[2]=i*o,t[3]=s*o,t},o.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t},o.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},o.str=function(t){return "mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},o.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3])},o.LDU=function(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]},o.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},o.subtract=i,o.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},o.equals=function(t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=r[0],l=r[1],u=r[2],c=r[3];return Math.abs(n-o)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-l)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(s-u)<=e.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(a-c)<=e.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))},o.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},o.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},o.sub=o.mul=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var i=r(void 0);if(i&&i.has(e))return i.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,i&&i.set(e,s),s}(s());function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return (r=function(t){return t?n:e})(t)}function n(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*o+s*l,t[1]=i*o+a*l,t[2]=n*u+s*c,t[3]=i*u+a*c,t}function i(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}return o.mul=n,o.sub=i,o}var u,c={};function h(){if(u)return c;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}u=1,Object.defineProperty(c,"__esModule",{value:!0}),c.create=function(){var t=new e.ARRAY_TYPE(6);return e.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},c.clone=function(t){var r=new e.ARRAY_TYPE(6);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r},c.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},c.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},c.fromValues=function(t,r,n,i,s,a){var o=new e.ARRAY_TYPE(6);return o[0]=t,o[1]=r,o[2]=n,o[3]=i,o[4]=s,o[5]=a,o},c.set=function(t,e,r,n,i,s,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=a,t},c.invert=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=r*s-n*i;return l?(t[0]=s*(l=1/l),t[1]=-n*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*o-s*a)*l,t[5]=(n*a-r*o)*l,t):null},c.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},c.multiply=n,c.rotate=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=Math.sin(r),c=Math.cos(r);return t[0]=n*c+s*u,t[1]=i*c+a*u,t[2]=n*-u+s*c,t[3]=i*-u+a*c,t[4]=o,t[5]=l,t},c.scale=function(t,e,r){var n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=r[0],u=r[1];return t[0]=e[0]*l,t[1]=n*l,t[2]=i*u,t[3]=s*u,t[4]=a,t[5]=o,t},c.translate=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=a,t[4]=n*u+s*c+o,t[5]=i*u+a*c+l,t},c.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t},c.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},c.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},c.str=function(t){return "mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},c.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)},c.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t},c.subtract=i,c.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t},c.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t},c.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},c.equals=function(t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=r[0],c=r[1],h=r[2],p=r[3],f=r[4],d=r[5];return Math.abs(n-u)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(i-c)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(s-h)<=e.EPSILON*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(a-p)<=e.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-f)<=e.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(l-d)<=e.EPSILON*Math.max(1,Math.abs(l),Math.abs(d))},c.sub=c.mul=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var i=r(void 0);if(i&&i.has(e))return i.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,i&&i.set(e,s),s}(s());function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return (r=function(t){return t?n:e})(t)}function n(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=r[0],c=r[1],h=r[2],p=r[3],f=r[4],d=r[5];return t[0]=n*u+s*c,t[1]=i*u+a*c,t[2]=n*h+s*p,t[3]=i*h+a*p,t[4]=n*f+s*d+o,t[5]=i*f+a*d+l,t}function i(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}return c.mul=n,c.sub=i,c}var p,f={};function d(){if(p)return f;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}p=1,Object.defineProperty(f,"__esModule",{value:!0}),f.create=function(){var t=new e.ARRAY_TYPE(9);return e.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},f.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},f.clone=function(t){var r=new e.ARRAY_TYPE(9);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r},f.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},f.fromValues=function(t,r,n,i,s,a,o,l,u){var c=new e.ARRAY_TYPE(9);return c[0]=t,c[1]=r,c[2]=n,c[3]=i,c[4]=s,c[5]=a,c[6]=o,c[7]=l,c[8]=u,c},f.set=function(t,e,r,n,i,s,a,o,l,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=a,t[6]=o,t[7]=l,t[8]=u,t},f.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},f.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i;}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},f.invert=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=c*a-o*u,p=-c*s+o*l,f=u*s-a*l,d=r*h+n*p+i*f;return d?(t[0]=h*(d=1/d),t[1]=(-c*n+i*u)*d,t[2]=(o*n-i*a)*d,t[3]=p*d,t[4]=(c*r-i*l)*d,t[5]=(-o*r+i*s)*d,t[6]=f*d,t[7]=(-u*r+n*l)*d,t[8]=(a*r-n*s)*d,t):null},f.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8];return t[0]=a*c-o*u,t[1]=i*u-n*c,t[2]=n*o-i*a,t[3]=o*l-s*c,t[4]=r*c-i*l,t[5]=i*s-r*o,t[6]=s*u-a*l,t[7]=n*l-r*u,t[8]=r*a-n*s,t},f.determinant=function(t){var e=t[3],r=t[4],n=t[5],i=t[6],s=t[7],a=t[8];return t[0]*(a*r-n*s)+t[1]*(-a*e+n*i)+t[2]*(s*e-r*i)},f.multiply=n,f.translate=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=r[0],f=r[1];return t[0]=n,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=l,t[6]=p*n+f*a+u,t[7]=p*i+f*o+c,t[8]=p*s+f*l+h,t},f.rotate=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=Math.sin(r),f=Math.cos(r);return t[0]=f*n+p*a,t[1]=f*i+p*o,t[2]=f*s+p*l,t[3]=f*a-p*n,t[4]=f*o-p*i,t[5]=f*l-p*s,t[6]=u,t[7]=c,t[8]=h,t},f.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},f.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},f.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},f.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},f.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},f.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=r+r,o=n+n,l=i+i,u=r*a,c=n*a,h=n*o,p=i*a,f=i*o,d=i*l,m=s*a,y=s*o,g=s*l;return t[0]=1-h-d,t[3]=c-g,t[6]=p+y,t[1]=c+g,t[4]=1-u-d,t[7]=f-m,t[2]=p-y,t[5]=f+m,t[8]=1-u-h,t},f.normalFromMat4=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],x=r*o-n*a,v=r*l-i*a,b=r*u-s*a,_=n*l-i*o,w=n*u-s*o,M=i*u-s*l,A=c*m-h*d,I=c*y-p*d,S=c*g-f*d,P=h*y-p*m,E=h*g-f*m,z=p*g-f*y,k=x*z-v*E+b*P+_*S-w*I+M*A;return k?(t[0]=(o*z-l*E+u*P)*(k=1/k),t[1]=(l*S-a*z-u*I)*k,t[2]=(a*E-o*S+u*A)*k,t[3]=(i*E-n*z-s*P)*k,t[4]=(r*z-i*S+s*I)*k,t[5]=(n*S-r*E-s*A)*k,t[6]=(m*M-y*w+g*_)*k,t[7]=(y*b-d*M-g*v)*k,t[8]=(d*w-m*b+g*x)*k,t):null},f.projection=function(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},f.str=function(t){return "mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},f.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},f.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t},f.subtract=i,f.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t},f.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t},f.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},f.equals=function(t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=r[0],f=r[1],d=r[2],m=r[3],y=r[4],g=r[5],x=r[6],v=r[7],b=r[8];return Math.abs(n-p)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(i-f)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-d)<=e.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-m)<=e.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(o-y)<=e.EPSILON*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(l-g)<=e.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(u-x)<=e.EPSILON*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(c-v)<=e.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-b)<=e.EPSILON*Math.max(1,Math.abs(h),Math.abs(b))},f.sub=f.mul=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var i=r(void 0);if(i&&i.has(e))return i.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,i&&i.set(e,s),s}(s());function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return (r=function(t){return t?n:e})(t)}function n(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=r[0],f=r[1],d=r[2],m=r[3],y=r[4],g=r[5],x=r[6],v=r[7],b=r[8];return t[0]=p*n+f*a+d*u,t[1]=p*i+f*o+d*c,t[2]=p*s+f*l+d*h,t[3]=m*n+y*a+g*u,t[4]=m*i+y*o+g*c,t[5]=m*s+y*l+g*h,t[6]=x*n+v*a+b*u,t[7]=x*i+v*o+b*c,t[8]=x*s+v*l+b*h,t}function i(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}return f.mul=n,f.sub=i,f}var m,y={};function g(){if(m)return y;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}m=1,Object.defineProperty(y,"__esModule",{value:!0}),y.create=function(){var t=new e.ARRAY_TYPE(16);return e.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},y.clone=function(t){var r=new e.ARRAY_TYPE(16);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},y.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[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},y.fromValues=function(t,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y){var g=new e.ARRAY_TYPE(16);return g[0]=t,g[1]=r,g[2]=n,g[3]=i,g[4]=s,g[5]=a,g[6]=o,g[7]=l,g[8]=u,g[9]=c,g[10]=h,g[11]=p,g[12]=f,g[13]=d,g[14]=m,g[15]=y,g},y.set=function(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=a,t[6]=o,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=m,t[15]=y,t},y.identity=n,y.transpose=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=i,t[13]=a,t[14]=o;}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},y.invert=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],x=r*o-n*a,v=r*l-i*a,b=r*u-s*a,_=n*l-i*o,w=n*u-s*o,M=i*u-s*l,A=c*m-h*d,I=c*y-p*d,S=c*g-f*d,P=h*y-p*m,E=h*g-f*m,z=p*g-f*y,k=x*z-v*E+b*P+_*S-w*I+M*A;return k?(t[0]=(o*z-l*E+u*P)*(k=1/k),t[1]=(i*E-n*z-s*P)*k,t[2]=(m*M-y*w+g*_)*k,t[3]=(p*w-h*M-f*_)*k,t[4]=(l*S-a*z-u*I)*k,t[5]=(r*z-i*S+s*I)*k,t[6]=(y*b-d*M-g*v)*k,t[7]=(c*M-p*b+f*v)*k,t[8]=(a*E-o*S+u*A)*k,t[9]=(n*S-r*E-s*A)*k,t[10]=(d*w-m*b+g*x)*k,t[11]=(h*b-c*w-f*x)*k,t[12]=(o*I-a*P-l*A)*k,t[13]=(r*P-n*I+i*A)*k,t[14]=(m*v-d*_-y*x)*k,t[15]=(c*_-h*v+p*x)*k,t):null},y.adjoint=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15];return t[0]=o*(p*g-f*y)-h*(l*g-u*y)+m*(l*f-u*p),t[1]=-(n*(p*g-f*y)-h*(i*g-s*y)+m*(i*f-s*p)),t[2]=n*(l*g-u*y)-o*(i*g-s*y)+m*(i*u-s*l),t[3]=-(n*(l*f-u*p)-o*(i*f-s*p)+h*(i*u-s*l)),t[4]=-(a*(p*g-f*y)-c*(l*g-u*y)+d*(l*f-u*p)),t[5]=r*(p*g-f*y)-c*(i*g-s*y)+d*(i*f-s*p),t[6]=-(r*(l*g-u*y)-a*(i*g-s*y)+d*(i*u-s*l)),t[7]=r*(l*f-u*p)-a*(i*f-s*p)+c*(i*u-s*l),t[8]=a*(h*g-f*m)-c*(o*g-u*m)+d*(o*f-u*h),t[9]=-(r*(h*g-f*m)-c*(n*g-s*m)+d*(n*f-s*h)),t[10]=r*(o*g-u*m)-a*(n*g-s*m)+d*(n*u-s*o),t[11]=-(r*(o*f-u*h)-a*(n*f-s*h)+c*(n*u-s*o)),t[12]=-(a*(h*y-p*m)-c*(o*y-l*m)+d*(o*p-l*h)),t[13]=r*(h*y-p*m)-c*(n*y-i*m)+d*(n*p-i*h),t[14]=-(r*(o*y-l*m)-a*(n*y-i*m)+d*(n*l-i*o)),t[15]=r*(o*p-l*h)-a*(n*p-i*h)+c*(n*l-i*o),t},y.determinant=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],c=t[9],h=t[10],p=t[11],f=t[12],d=t[13],m=t[14],y=t[15];return (e*a-r*s)*(h*y-p*m)-(e*o-n*s)*(c*y-p*d)+(e*l-i*s)*(c*m-h*d)+(r*o-n*a)*(u*y-p*f)-(r*l-i*a)*(u*m-h*f)+(n*l-i*o)*(u*d-c*f)},y.multiply=i,y.translate=function(t,e,r){var n,i,s,a,o,l,u,c,h,p,f,d,m=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*m+e[4]*y+e[8]*g+e[12],t[13]=e[1]*m+e[5]*y+e[9]*g+e[13],t[14]=e[2]*m+e[6]*y+e[10]*g+e[14],t[15]=e[3]*m+e[7]*y+e[11]*g+e[15]):(i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=n*m+o*y+h*g+e[12],t[13]=i*m+l*y+p*g+e[13],t[14]=s*m+u*y+f*g+e[14],t[15]=a*m+c*y+d*g+e[15]),t},y.scale=function(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},y.rotate=function(t,r,n,i){var s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b,_,w,M,A,I,S,P,E,z=i[0],k=i[1],T=i[2],B=Math.hypot(z,k,T);return B<e.EPSILON?null:(z*=B=1/B,k*=B,T*=B,s=Math.sin(n),a=Math.cos(n),u=r[1],c=r[2],h=r[3],f=r[5],d=r[6],m=r[7],g=r[9],x=r[10],v=r[11],b=z*z*(o=1-a)+a,M=z*k*o-T*s,A=k*k*o+a,I=T*k*o+z*s,S=z*T*o+k*s,P=k*T*o-z*s,E=T*T*o+a,t[0]=(l=r[0])*b+(p=r[4])*(_=k*z*o+T*s)+(y=r[8])*(w=T*z*o-k*s),t[1]=u*b+f*_+g*w,t[2]=c*b+d*_+x*w,t[3]=h*b+m*_+v*w,t[4]=l*M+p*A+y*I,t[5]=u*M+f*A+g*I,t[6]=c*M+d*A+x*I,t[7]=h*M+m*A+v*I,t[8]=l*S+p*P+y*E,t[9]=u*S+f*P+g*E,t[10]=c*S+d*P+x*E,t[11]=h*S+m*P+v*E,r!==t&&(t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t)},y.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*i+u*n,t[5]=a*i+c*n,t[6]=o*i+h*n,t[7]=l*i+p*n,t[8]=u*i-s*n,t[9]=c*i-a*n,t[10]=h*i-o*n,t[11]=p*i-l*n,t},y.rotateY=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[0],a=e[1],o=e[2],l=e[3],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*i-u*n,t[1]=a*i-c*n,t[2]=o*i-h*n,t[3]=l*i-p*n,t[8]=s*n+u*i,t[9]=a*n+c*i,t[10]=o*n+h*i,t[11]=l*n+p*i,t},y.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[0],a=e[1],o=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=e[7];return e!==t&&(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[0]=s*i+u*n,t[1]=a*i+c*n,t[2]=o*i+h*n,t[3]=l*i+p*n,t[4]=u*i-s*n,t[5]=c*i-a*n,t[6]=h*i-o*n,t[7]=p*i-l*n,t},y.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},y.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},y.fromRotation=function(t,r,n){var i,s,a,o=n[0],l=n[1],u=n[2],c=Math.hypot(o,l,u);return c<e.EPSILON?null:(o*=c=1/c,l*=c,u*=c,i=Math.sin(r),s=Math.cos(r),t[0]=o*o*(a=1-s)+s,t[1]=l*o*a+u*i,t[2]=u*o*a-l*i,t[3]=0,t[4]=o*l*a-u*i,t[5]=l*l*a+s,t[6]=u*l*a+o*i,t[7]=0,t[8]=o*u*a+l*i,t[9]=l*u*a-o*i,t[10]=u*u*a+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},y.fromXRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},y.fromYRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},y.fromZRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},y.fromRotationTranslation=a,y.fromQuat2=function(t,r){var n=new e.ARRAY_TYPE(3),i=-r[0],s=-r[1],o=-r[2],l=r[3],u=r[4],c=r[5],h=r[6],p=r[7],f=i*i+s*s+o*o+l*l;return f>0?(n[0]=2*(u*l+p*i+c*o-h*s)/f,n[1]=2*(c*l+p*s+h*i-u*o)/f,n[2]=2*(h*l+p*o+u*s-c*i)/f):(n[0]=2*(u*l+p*i+c*o-h*s),n[1]=2*(c*l+p*s+h*i-u*o),n[2]=2*(h*l+p*o+u*s-c*i)),a(t,r,n),t},y.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},y.getScaling=o,y.getRotation=function(t,r){var n=new e.ARRAY_TYPE(3);o(n,r);var i=1/n[0],s=1/n[1],a=1/n[2],l=r[0]*i,u=r[1]*s,c=r[2]*a,h=r[4]*i,p=r[5]*s,f=r[6]*a,d=r[8]*i,m=r[9]*s,y=r[10]*a,g=l+p+y,x=0;return g>0?(x=2*Math.sqrt(g+1),t[3]=.25*x,t[0]=(f-m)/x,t[1]=(d-c)/x,t[2]=(u-h)/x):l>p&&l>y?(x=2*Math.sqrt(1+l-p-y),t[3]=(f-m)/x,t[0]=.25*x,t[1]=(u+h)/x,t[2]=(d+c)/x):p>y?(x=2*Math.sqrt(1+p-l-y),t[3]=(d-c)/x,t[0]=(u+h)/x,t[1]=.25*x,t[2]=(f+m)/x):(x=2*Math.sqrt(1+y-l-p),t[3]=(u-h)/x,t[0]=(d+c)/x,t[1]=(f+m)/x,t[2]=.25*x),t},y.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],s=e[1],a=e[2],o=e[3],l=i+i,u=s+s,c=a+a,h=i*l,p=i*u,f=i*c,d=s*u,m=s*c,y=a*c,g=o*l,x=o*u,v=o*c,b=n[0],_=n[1],w=n[2];return t[0]=(1-(d+y))*b,t[1]=(p+v)*b,t[2]=(f-x)*b,t[3]=0,t[4]=(p-v)*_,t[5]=(1-(h+y))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(f+x)*w,t[9]=(m-g)*w,t[10]=(1-(h+d))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},y.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var s=e[0],a=e[1],o=e[2],l=e[3],u=s+s,c=a+a,h=o+o,p=s*u,f=s*c,d=s*h,m=a*c,y=a*h,g=o*h,x=l*u,v=l*c,b=l*h,_=n[0],w=n[1],M=n[2],A=i[0],I=i[1],S=i[2],P=(1-(m+g))*_,E=(f+b)*_,z=(d-v)*_,k=(f-b)*w,T=(1-(p+g))*w,B=(y+x)*w,V=(d+v)*M,C=(y-x)*M,D=(1-(p+m))*M;return t[0]=P,t[1]=E,t[2]=z,t[3]=0,t[4]=k,t[5]=T,t[6]=B,t[7]=0,t[8]=V,t[9]=C,t[10]=D,t[11]=0,t[12]=r[0]+A-(P*A+k*I+V*S),t[13]=r[1]+I-(E*A+T*I+C*S),t[14]=r[2]+S-(z*A+B*I+D*S),t[15]=1,t},y.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=r+r,o=n+n,l=i+i,u=r*a,c=n*a,h=n*o,p=i*a,f=i*o,d=i*l,m=s*a,y=s*o,g=s*l;return t[0]=1-h-d,t[1]=c+g,t[2]=p-y,t[3]=0,t[4]=c-g,t[5]=1-u-d,t[6]=f+m,t[7]=0,t[8]=p+y,t[9]=f-m,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},y.frustum=function(t,e,r,n,i,s,a){var o=1/(r-e),l=1/(i-n),u=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*l,t[6]=0,t[7]=0,t[8]=(r+e)*o,t[9]=(i+n)*l,t[10]=(a+s)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*u,t[15]=0,t},y.perspectiveNO=l,y.perspectiveZO=function(t,e,r,n,i){var s,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(s=1/(n-i)),t[14]=i*n*s):(t[10]=-1,t[14]=-n),t},y.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+o),u=2/(i+s);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(a-o)*l*.5,t[9]=(i-s)*u*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},y.orthoNO=u,y.orthoZO=function(t,e,r,n,i,s,a){var o=1/(e-r),l=1/(n-i),u=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+r)*o,t[13]=(i+n)*l,t[14]=s*u,t[15]=1,t},y.lookAt=function(t,r,i,s){var a,o,l,u,c,h,p,f,d,m,y=r[0],g=r[1],x=r[2],v=s[0],b=s[1],_=s[2],w=i[0],M=i[1],A=i[2];return Math.abs(y-w)<e.EPSILON&&Math.abs(g-M)<e.EPSILON&&Math.abs(x-A)<e.EPSILON?n(t):(p=y-w,f=g-M,d=x-A,a=b*(d*=m=1/Math.hypot(p,f,d))-_*(f*=m),o=_*(p*=m)-v*d,l=v*f-b*p,(m=Math.hypot(a,o,l))?(a*=m=1/m,o*=m,l*=m):(a=0,o=0,l=0),u=f*l-d*o,c=d*a-p*l,h=p*o-f*a,(m=Math.hypot(u,c,h))?(u*=m=1/m,c*=m,h*=m):(u=0,c=0,h=0),t[0]=a,t[1]=u,t[2]=p,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=l,t[9]=h,t[10]=d,t[11]=0,t[12]=-(a*y+o*g+l*x),t[13]=-(u*y+c*g+h*x),t[14]=-(p*y+f*g+d*x),t[15]=1,t)},y.targetTo=function(t,e,r,n){var i=e[0],s=e[1],a=e[2],o=n[0],l=n[1],u=n[2],c=i-r[0],h=s-r[1],p=a-r[2],f=c*c+h*h+p*p;f>0&&(c*=f=1/Math.sqrt(f),h*=f,p*=f);var d=l*p-u*h,m=u*c-o*p,y=o*h-l*c;return (f=d*d+m*m+y*y)>0&&(d*=f=1/Math.sqrt(f),m*=f,y*=f),t[0]=d,t[1]=m,t[2]=y,t[3]=0,t[4]=h*y-p*m,t[5]=p*d-c*y,t[6]=c*m-h*d,t[7]=0,t[8]=c,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=s,t[14]=a,t[15]=1,t},y.str=function(t){return "mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},y.frob=function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},y.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},y.subtract=c,y.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},y.multiplyScalarAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t},y.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[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]},y.equals=function(t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],f=t[10],d=t[11],m=t[12],y=t[13],g=t[14],x=t[15],v=r[0],b=r[1],_=r[2],w=r[3],M=r[4],A=r[5],I=r[6],S=r[7],P=r[8],E=r[9],z=r[10],k=r[11],T=r[12],B=r[13],V=r[14],C=r[15];return Math.abs(n-v)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-b)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(s-_)<=e.EPSILON*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(a-w)<=e.EPSILON*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-M)<=e.EPSILON*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(l-A)<=e.EPSILON*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(u-I)<=e.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(c-S)<=e.EPSILON*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(h-P)<=e.EPSILON*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(p-E)<=e.EPSILON*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(f-z)<=e.EPSILON*Math.max(1,Math.abs(f),Math.abs(z))&&Math.abs(d-k)<=e.EPSILON*Math.max(1,Math.abs(d),Math.abs(k))&&Math.abs(m-T)<=e.EPSILON*Math.max(1,Math.abs(m),Math.abs(T))&&Math.abs(y-B)<=e.EPSILON*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(g-V)<=e.EPSILON*Math.max(1,Math.abs(g),Math.abs(V))&&Math.abs(x-C)<=e.EPSILON*Math.max(1,Math.abs(x),Math.abs(C))},y.sub=y.mul=y.ortho=y.perspective=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var i=r(void 0);if(i&&i.has(e))return i.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,i&&i.set(e,s),s}(s());function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return (r=function(t){return t?n:e})(t)}function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function i(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],x=e[15],v=r[0],b=r[1],_=r[2],w=r[3];return t[0]=v*n+b*o+_*h+w*m,t[1]=v*i+b*l+_*p+w*y,t[2]=v*s+b*u+_*f+w*g,t[3]=v*a+b*c+_*d+w*x,t[4]=(v=r[4])*n+(b=r[5])*o+(_=r[6])*h+(w=r[7])*m,t[5]=v*i+b*l+_*p+w*y,t[6]=v*s+b*u+_*f+w*g,t[7]=v*a+b*c+_*d+w*x,t[8]=(v=r[8])*n+(b=r[9])*o+(_=r[10])*h+(w=r[11])*m,t[9]=v*i+b*l+_*p+w*y,t[10]=v*s+b*u+_*f+w*g,t[11]=v*a+b*c+_*d+w*x,t[12]=(v=r[12])*n+(b=r[13])*o+(_=r[14])*h+(w=r[15])*m,t[13]=v*i+b*l+_*p+w*y,t[14]=v*s+b*u+_*f+w*g,t[15]=v*a+b*c+_*d+w*x,t}function a(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=n+n,l=i+i,u=s+s,c=n*o,h=n*l,p=n*u,f=i*l,d=i*u,m=s*u,y=a*o,g=a*l,x=a*u;return t[0]=1-(f+m),t[1]=h+x,t[2]=p-g,t[3]=0,t[4]=h-x,t[5]=1-(c+m),t[6]=d+y,t[7]=0,t[8]=p+g,t[9]=d-y,t[10]=1-(c+f),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function o(t,e){var r=e[4],n=e[5],i=e[6],s=e[8],a=e[9],o=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,n,i),t[2]=Math.hypot(s,a,o),t}function l(t,e,r,n,i){var s,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(s=1/(n-i)),t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t}function u(t,e,r,n,i,s,a){var o=1/(e-r),l=1/(n-i),u=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*o,t[13]=(i+n)*l,t[14]=(a+s)*u,t[15]=1,t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}return y.perspective=l,y.ortho=u,y.mul=i,y.sub=c,y}var x,v={},b={};function _(){if(x)return b;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}x=1,Object.defineProperty(b,"__esModule",{value:!0}),b.create=n,b.clone=function(t){var r=new e.ARRAY_TYPE(3);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r},b.length=i,b.fromValues=function(t,r,n){var i=new e.ARRAY_TYPE(3);return i[0]=t,i[1]=r,i[2]=n,i},b.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},b.set=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t},b.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},b.subtract=a,b.multiply=o,b.divide=l,b.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},b.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},b.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},b.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},b.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},b.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},b.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t},b.distance=u,b.squaredDistance=c,b.squaredLength=h,b.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},b.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},b.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],s=r*r+n*n+i*i;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t},b.dot=p,b.cross=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=r[0],o=r[1],l=r[2];return t[0]=i*l-s*o,t[1]=s*a-n*l,t[2]=n*o-i*a,t},b.lerp=function(t,e,r,n){var i=e[0],s=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=a+n*(r[2]-a),t},b.hermite=function(t,e,r,n,i,s){var a=s*s,o=a*(2*s-3)+1,l=a*(s-2)+s,u=a*(s-1),c=a*(3-2*s);return t[0]=e[0]*o+r[0]*l+n[0]*u+i[0]*c,t[1]=e[1]*o+r[1]*l+n[1]*u+i[1]*c,t[2]=e[2]*o+r[2]*l+n[2]*u+i[2]*c,t},b.bezier=function(t,e,r,n,i,s){var a=1-s,o=a*a,l=s*s,u=o*a,c=3*s*o,h=3*l*a,p=l*s;return t[0]=e[0]*u+r[0]*c+n[0]*h+i[0]*p,t[1]=e[1]*u+r[1]*c+n[1]*h+i[1]*p,t[2]=e[2]*u+r[2]*c+n[2]*h+i[2]*p,t},b.random=function(t,r){r=r||1;var n=2*e.RANDOM()*Math.PI,i=2*e.RANDOM()-1,s=Math.sqrt(1-i*i)*r;return t[0]=Math.cos(n)*s,t[1]=Math.sin(n)*s,t[2]=i*r,t},b.transformMat4=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=r[3]*n+r[7]*i+r[11]*s+r[15];return t[0]=(r[0]*n+r[4]*i+r[8]*s+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*i+r[9]*s+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*s+r[14])/a,t},b.transformMat3=function(t,e,r){var n=e[0],i=e[1],s=e[2];return t[0]=n*r[0]+i*r[3]+s*r[6],t[1]=n*r[1]+i*r[4]+s*r[7],t[2]=n*r[2]+i*r[5]+s*r[8],t},b.transformQuat=function(t,e,r){var n=r[0],i=r[1],s=r[2],a=e[0],o=e[1],l=e[2],u=i*l-s*o,c=s*a-n*l,h=n*o-i*a,p=i*h-s*c,f=s*u-n*h,d=n*c-i*u,m=2*r[3];return c*=m,h*=m,f*=2,d*=2,t[0]=a+(u*=m)+(p*=2),t[1]=o+c+f,t[2]=l+h+d,t},b.rotateX=function(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0],s[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),s[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},b.rotateY=function(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),s[1]=i[1],s[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},b.rotateZ=function(t,e,r,n){var i=[],s=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],s[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),s[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),s[2]=i[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},b.angle=function(t,e){var r=t[0],n=t[1],i=t[2],s=e[0],a=e[1],o=e[2],l=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(s*s+a*a+o*o),u=l&&p(t,e)/l;return Math.acos(Math.min(Math.max(u,-1),1))},b.zero=function(t){return t[0]=0,t[1]=0,t[2]=0,t},b.str=function(t){return "vec3("+t[0]+", "+t[1]+", "+t[2]+")"},b.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},b.equals=function(t,r){var n=t[0],i=t[1],s=t[2],a=r[0],o=r[1],l=r[2];return Math.abs(n-a)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-o)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(s-l)<=e.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))},b.forEach=b.sqrLen=b.len=b.sqrDist=b.dist=b.div=b.mul=b.sub=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var i=r(void 0);if(i&&i.has(e))return i.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,i&&i.set(e,s),s}(s());function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return (r=function(t){return t?n:e})(t)}function n(){var t=new e.ARRAY_TYPE(3);return e.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function i(t){return Math.hypot(t[0],t[1],t[2])}function a(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function o(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function l(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function u(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])}function c(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function h(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}b.sub=a,b.mul=o,b.div=l,b.dist=u,b.sqrDist=c,b.len=i,b.sqrLen=h;var f,d=(f=n(),function(t,e,r,n,i,s){var a,o;for(e||(e=3),r||(r=0),o=n?Math.min(n*e+r,t.length):t.length,a=r;a<o;a+=e)f[0]=t[a],f[1]=t[a+1],f[2]=t[a+2],i(f,f,s),t[a]=f[0],t[a+1]=f[1],t[a+2]=f[2];return t});return b.forEach=d,b}var w,M,A={};function I(){if(w)return A;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}w=1,Object.defineProperty(A,"__esModule",{value:!0}),A.create=n,A.clone=function(t){var r=new e.ARRAY_TYPE(4);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r},A.fromValues=function(t,r,n,i){var s=new e.ARRAY_TYPE(4);return s[0]=t,s[1]=r,s[2]=n,s[3]=i,s},A.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},A.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},A.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},A.subtract=i,A.multiply=a,A.divide=o,A.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},A.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},A.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},A.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},A.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},A.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},A.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},A.distance=l,A.squaredDistance=u,A.length=c,A.squaredLength=h,A.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},A.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},A.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=r*r+n*n+i*i+s*s;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=s*a,t},A.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},A.cross=function(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],s=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],o=r[1]*n[2]-r[2]*n[1],l=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=e[0],h=e[1],p=e[2],f=e[3];return t[0]=h*u-p*l+f*o,t[1]=-c*u+p*a-f*s,t[2]=c*l-h*a+f*i,t[3]=-c*o+h*s-p*i,t},A.lerp=function(t,e,r,n){var i=e[0],s=e[1],a=e[2],o=e[3];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t[2]=a+n*(r[2]-a),t[3]=o+n*(r[3]-o),t},A.random=function(t,r){var n,i,s,a,o,l;r=r||1;do{o=(n=2*e.RANDOM()-1)*n+(i=2*e.RANDOM()-1)*i;}while(o>=1);do{l=(s=2*e.RANDOM()-1)*s+(a=2*e.RANDOM()-1)*a;}while(l>=1);var u=Math.sqrt((1-o)/l);return t[0]=r*n,t[1]=r*i,t[2]=r*s*u,t[3]=r*a*u,t},A.transformMat4=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*a,t},A.transformQuat=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=r[0],o=r[1],l=r[2],u=r[3],c=u*n+o*s-l*i,h=u*i+l*n-a*s,p=u*s+a*i-o*n,f=-a*n-o*i-l*s;return t[0]=c*u+f*-a+h*-l-p*-o,t[1]=h*u+f*-o+p*-a-c*-l,t[2]=p*u+f*-l+c*-o-h*-a,t[3]=e[3],t},A.zero=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},A.str=function(t){return "vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},A.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},A.equals=function(t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=r[0],l=r[1],u=r[2],c=r[3];return Math.abs(n-o)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-l)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(s-u)<=e.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))&&Math.abs(a-c)<=e.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))},A.forEach=A.sqrLen=A.len=A.sqrDist=A.dist=A.div=A.mul=A.sub=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var i=r(void 0);if(i&&i.has(e))return i.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,i&&i.set(e,s),s}(s());function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return (r=function(t){return t?n:e})(t)}function n(){var t=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function i(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function a(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function o(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function l(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3])}function u(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return r*r+n*n+i*i+s*s}function c(t){return Math.hypot(t[0],t[1],t[2],t[3])}function h(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}A.sub=i,A.mul=a,A.div=o,A.dist=l,A.sqrDist=u,A.len=c,A.sqrLen=h;var p,f=(p=n(),function(t,e,r,n,i,s){var a,o;for(e||(e=4),r||(r=0),o=n?Math.min(n*e+r,t.length):t.length,a=r;a<o;a+=e)p[0]=t[a],p[1]=t[a+1],p[2]=t[a+2],p[3]=t[a+3],i(p,p,s),t[a]=p[0],t[a+1]=p[1],t[a+2]=p[2],t[a+3]=p[3];return t});return A.forEach=f,A}function S(){if(M)return v;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}M=1,Object.defineProperty(v,"__esModule",{value:!0}),v.create=l,v.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},v.setAxisAngle=u,v.getAxisAngle=function(t,r){var n=2*Math.acos(r[3]),i=Math.sin(n/2);return i>e.EPSILON?(t[0]=r[0]/i,t[1]=r[1]/i,t[2]=r[2]/i):(t[0]=1,t[1]=0,t[2]=0),n},v.getAngle=function(t,e){var r=g(t,e);return Math.acos(2*r*r-1)},v.multiply=c,v.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*o,t[1]=i*l+s*o,t[2]=s*l-i*o,t[3]=a*l-n*o,t},v.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(r),l=Math.cos(r);return t[0]=n*l-s*o,t[1]=i*l+a*o,t[2]=s*l+n*o,t[3]=a*l-i*o,t},v.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*o,t[1]=i*l-n*o,t[2]=s*l+a*o,t[3]=a*l-s*o,t},v.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},v.exp=h,v.ln=p,v.pow=function(t,e,r){return p(t,e),y(t,t,r),h(t,t),t},v.slerp=f,v.random=function(t){var r=e.RANDOM(),n=e.RANDOM(),i=e.RANDOM(),s=Math.sqrt(1-r),a=Math.sqrt(r);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*i),t[3]=a*Math.cos(2*Math.PI*i),t},v.invert=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=r*r+n*n+i*i+s*s,o=a?1/a:0;return t[0]=-r*o,t[1]=-n*o,t[2]=-i*o,t[3]=s*o,t},v.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},v.fromMat3=m,v.fromEuler=function(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(r),l=Math.cos(r),u=Math.sin(n),c=Math.cos(n);return t[0]=s*l*c-a*o*u,t[1]=a*o*c+s*l*u,t[2]=a*l*u-s*o*c,t[3]=a*l*c+s*o*u,t},v.str=function(t){return "quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},v.setAxes=v.sqlerp=v.rotationTo=v.equals=v.exactEquals=v.normalize=v.sqrLen=v.squaredLength=v.len=v.length=v.lerp=v.dot=v.scale=v.mul=v.add=v.set=v.copy=v.fromValues=v.clone=void 0;var e=o(s()),r=o(d()),n=o(_()),i=o(I());function a(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return (a=function(t){return t?r:e})(t)}function o(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var n=a(r);if(n&&n.has(e))return n.get(e);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=s?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(i,o,l):i[o]=e[o];}return i.default=e,n&&n.set(e,i),i}function l(){var t=new e.ARRAY_TYPE(4);return e.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function u(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function c(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*c+a*o+i*u-s*l,t[1]=i*c+a*l+s*o-n*u,t[2]=s*c+a*u+n*l-i*o,t[3]=a*c-n*o-i*l-s*u,t}function h(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=Math.sqrt(r*r+n*n+i*i),o=Math.exp(s),l=a>0?o*Math.sin(a)/a:0;return t[0]=r*l,t[1]=n*l,t[2]=i*l,t[3]=o*Math.cos(a),t}function p(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=Math.sqrt(r*r+n*n+i*i),o=a>0?Math.atan2(a,s)/a:0;return t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=.5*Math.log(r*r+n*n+i*i+s*s),t}function f(t,r,n,i){var s,a,o,l,u,c=r[0],h=r[1],p=r[2],f=r[3],d=n[0],m=n[1],y=n[2],g=n[3];return (a=c*d+h*m+p*y+f*g)<0&&(a=-a,d=-d,m=-m,y=-y,g=-g),1-a>e.EPSILON?(s=Math.acos(a),o=Math.sin(s),l=Math.sin((1-i)*s)/o,u=Math.sin(i*s)/o):(l=1-i,u=i),t[0]=l*c+u*d,t[1]=l*h+u*m,t[2]=l*p+u*y,t[3]=l*f+u*g,t}function m(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,t[0]=(e[5]-e[7])*(r=.5/r),t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else {var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*a+a]+1),t[i]=.5*r,t[3]=(e[3*s+a]-e[3*a+s])*(r=.5/r),t[s]=(e[3*s+i]+e[3*i+s])*r,t[a]=(e[3*a+i]+e[3*i+a])*r;}return t}v.clone=i.clone,v.fromValues=i.fromValues,v.copy=i.copy,v.set=i.set,v.add=i.add,v.mul=c;var y=i.scale;v.scale=y;var g=i.dot;v.dot=g,v.lerp=i.lerp;var x=i.length;v.length=x,v.len=x;var b=i.squaredLength;v.squaredLength=b,v.sqrLen=b;var w=i.normalize;v.normalize=w,v.exactEquals=i.exactEquals,v.equals=i.equals;var A,S,P,E=(A=n.create(),S=n.fromValues(1,0,0),P=n.fromValues(0,1,0),function(t,e,r){var i=n.dot(e,r);return i<-.999999?(n.cross(A,S,e),n.len(A)<1e-6&&n.cross(A,P,e),n.normalize(A,A),u(t,A,Math.PI),t):i>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(n.cross(A,e,r),t[0]=A[0],t[1]=A[1],t[2]=A[2],t[3]=1+i,w(t,t))});v.rotationTo=E;var z,k,T=(z=l(),k=l(),function(t,e,r,n,i,s){return f(z,e,i,s),f(k,r,n,s),f(t,z,k,2*s*(1-s)),t});v.sqlerp=T;var B,V=(B=r.create(),function(t,e,r,n){return B[0]=r[0],B[3]=r[1],B[6]=r[2],B[1]=n[0],B[4]=n[1],B[7]=n[2],B[2]=-e[0],B[5]=-e[1],B[8]=-e[2],w(t,m(t,B))});return v.setAxes=V,v}var P,E={};function z(){if(P)return E;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}P=1,Object.defineProperty(E,"__esModule",{value:!0}),E.create=function(){var t=new e.ARRAY_TYPE(8);return e.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t},E.clone=function(t){var r=new e.ARRAY_TYPE(8);return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r},E.fromValues=function(t,r,n,i,s,a,o,l){var u=new e.ARRAY_TYPE(8);return u[0]=t,u[1]=r,u[2]=n,u[3]=i,u[4]=s,u[5]=a,u[6]=o,u[7]=l,u},E.fromRotationTranslationValues=function(t,r,n,i,s,a,o){var l=new e.ARRAY_TYPE(8);l[0]=t,l[1]=r,l[2]=n,l[3]=i;var u=.5*s,c=.5*a,h=.5*o;return l[4]=u*i+c*n-h*r,l[5]=c*i+h*t-u*n,l[6]=h*i+u*r-c*t,l[7]=-u*t-c*r-h*n,l},E.fromRotationTranslation=o,E.fromTranslation=function(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t},E.fromRotation=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},E.fromMat4=function(t,i){var s=r.create();n.getRotation(s,i);var a=new e.ARRAY_TYPE(3);return n.getTranslation(a,i),o(t,s,a),t},E.copy=l,E.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},E.set=function(t,e,r,n,i,s,a,o,l){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=s,t[5]=a,t[6]=o,t[7]=l,t},E.getDual=function(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t},E.setDual=function(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t},E.getTranslation=function(t,e){var r=e[4],n=e[5],i=e[6],s=e[7],a=-e[0],o=-e[1],l=-e[2],u=e[3];return t[0]=2*(r*u+s*a+n*l-i*o),t[1]=2*(n*u+s*o+i*a-r*l),t[2]=2*(i*u+s*l+r*o-n*a),t},E.translate=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=.5*r[0],l=.5*r[1],u=.5*r[2],c=e[4],h=e[5],p=e[6],f=e[7];return t[0]=n,t[1]=i,t[2]=s,t[3]=a,t[4]=a*o+i*u-s*l+c,t[5]=a*l+s*o-n*u+h,t[6]=a*u+n*l-i*o+p,t[7]=-n*o-i*l-s*u+f,t},E.rotateX=function(t,e,n){var i=-e[0],s=-e[1],a=-e[2],o=e[3],l=e[4],u=e[5],c=e[6],h=e[7],p=l*o+h*i+u*a-c*s,f=u*o+h*s+c*i-l*a,d=c*o+h*a+l*s-u*i,m=h*o-l*i-u*s-c*a;return r.rotateX(t,e,n),t[4]=p*(o=t[3])+m*(i=t[0])+f*(a=t[2])-d*(s=t[1]),t[5]=f*o+m*s+d*i-p*a,t[6]=d*o+m*a+p*s-f*i,t[7]=m*o-p*i-f*s-d*a,t},E.rotateY=function(t,e,n){var i=-e[0],s=-e[1],a=-e[2],o=e[3],l=e[4],u=e[5],c=e[6],h=e[7],p=l*o+h*i+u*a-c*s,f=u*o+h*s+c*i-l*a,d=c*o+h*a+l*s-u*i,m=h*o-l*i-u*s-c*a;return r.rotateY(t,e,n),t[4]=p*(o=t[3])+m*(i=t[0])+f*(a=t[2])-d*(s=t[1]),t[5]=f*o+m*s+d*i-p*a,t[6]=d*o+m*a+p*s-f*i,t[7]=m*o-p*i-f*s-d*a,t},E.rotateZ=function(t,e,n){var i=-e[0],s=-e[1],a=-e[2],o=e[3],l=e[4],u=e[5],c=e[6],h=e[7],p=l*o+h*i+u*a-c*s,f=u*o+h*s+c*i-l*a,d=c*o+h*a+l*s-u*i,m=h*o-l*i-u*s-c*a;return r.rotateZ(t,e,n),t[4]=p*(o=t[3])+m*(i=t[0])+f*(a=t[2])-d*(s=t[1]),t[5]=f*o+m*s+d*i-p*a,t[6]=d*o+m*a+p*s-f*i,t[7]=m*o-p*i-f*s-d*a,t},E.rotateByQuatAppend=function(t,e,r){var n=r[0],i=r[1],s=r[2],a=r[3],o=e[0],l=e[1],u=e[2],c=e[3];return t[0]=o*a+c*n+l*s-u*i,t[1]=l*a+c*i+u*n-o*s,t[2]=u*a+c*s+o*i-l*n,t[3]=c*a-o*n-l*i-u*s,t[4]=(o=e[4])*a+(c=e[7])*n+(l=e[5])*s-(u=e[6])*i,t[5]=l*a+c*i+u*n-o*s,t[6]=u*a+c*s+o*i-l*n,t[7]=c*a-o*n-l*i-u*s,t},E.rotateByQuatPrepend=function(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=r[0],l=r[1],u=r[2],c=r[3];return t[0]=n*c+a*o+i*u-s*l,t[1]=i*c+a*l+s*o-n*u,t[2]=s*c+a*u+n*l-i*o,t[3]=a*c-n*o-i*l-s*u,t[4]=n*(c=r[7])+a*(o=r[4])+i*(u=r[6])-s*(l=r[5]),t[5]=i*c+a*l+s*o-n*u,t[6]=s*c+a*u+n*l-i*o,t[7]=a*c-n*o-i*l-s*u,t},E.rotateAroundAxis=function(t,r,n,i){if(Math.abs(i)<e.EPSILON)return l(t,r);var s=Math.hypot(n[0],n[1],n[2]);i*=.5;var a=Math.sin(i),o=a*n[0]/s,u=a*n[1]/s,c=a*n[2]/s,h=Math.cos(i),p=r[0],f=r[1],d=r[2],m=r[3];t[0]=p*h+m*o+f*c-d*u,t[1]=f*h+m*u+d*o-p*c,t[2]=d*h+m*c+p*u-f*o,t[3]=m*h-p*o-f*u-d*c;var y=r[4],g=r[5],x=r[6],v=r[7];return t[4]=y*h+v*o+g*c-x*u,t[5]=g*h+v*u+x*o-y*c,t[6]=x*h+v*c+y*u-g*o,t[7]=v*h-y*o-g*u-x*c,t},E.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t},E.multiply=u,E.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t},E.lerp=function(t,e,r,n){var i=1-n;return c(e,r)<0&&(n=-n),t[0]=e[0]*i+r[0]*n,t[1]=e[1]*i+r[1]*n,t[2]=e[2]*i+r[2]*n,t[3]=e[3]*i+r[3]*n,t[4]=e[4]*i+r[4]*n,t[5]=e[5]*i+r[5]*n,t[6]=e[6]*i+r[6]*n,t[7]=e[7]*i+r[7]*n,t},E.invert=function(t,e){var r=p(e);return t[0]=-e[0]/r,t[1]=-e[1]/r,t[2]=-e[2]/r,t[3]=e[3]/r,t[4]=-e[4]/r,t[5]=-e[5]/r,t[6]=-e[6]/r,t[7]=e[7]/r,t},E.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=e[7],t},E.normalize=function(t,e){var r=p(e);if(r>0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,s=e[2]/r,a=e[3]/r,o=e[4],l=e[5],u=e[6],c=e[7],h=n*o+i*l+s*u+a*c;t[0]=n,t[1]=i,t[2]=s,t[3]=a,t[4]=(o-n*h)/r,t[5]=(l-i*h)/r,t[6]=(u-s*h)/r,t[7]=(c-a*h)/r;}return t},E.str=function(t){return "quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},E.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},E.equals=function(t,r){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=r[0],p=r[1],f=r[2],d=r[3],m=r[4],y=r[5],g=r[6],x=r[7];return Math.abs(n-h)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-p)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(s-f)<=e.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-d)<=e.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-m)<=e.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(l-y)<=e.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(u-g)<=e.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-x)<=e.EPSILON*Math.max(1,Math.abs(c),Math.abs(x))},E.sqrLen=E.squaredLength=E.len=E.length=E.dot=E.mul=E.setReal=E.getReal=void 0;var e=a(s()),r=a(S()),n=a(g());function i(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return (i=function(t){return t?r:e})(t)}function a(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var n=i(r);if(n&&n.has(e))return n.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,n&&n.set(e,s),s}function o(t,e,r){var n=.5*r[0],i=.5*r[1],s=.5*r[2],a=e[0],o=e[1],l=e[2],u=e[3];return t[0]=a,t[1]=o,t[2]=l,t[3]=u,t[4]=n*u+i*l-s*o,t[5]=i*u+s*a-n*l,t[6]=s*u+n*o-i*a,t[7]=-n*a-i*o-s*l,t}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function u(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=r[4],l=r[5],u=r[6],c=r[7],h=e[4],p=e[5],f=e[6],d=e[7],m=r[0],y=r[1],g=r[2],x=r[3];return t[0]=n*x+a*m+i*g-s*y,t[1]=i*x+a*y+s*m-n*g,t[2]=s*x+a*g+n*y-i*m,t[3]=a*x-n*m-i*y-s*g,t[4]=n*c+a*o+i*u-s*l+h*x+d*m+p*g-f*y,t[5]=i*c+a*l+s*o-n*u+p*x+d*y+f*m-h*g,t[6]=s*c+a*u+n*l-i*o+f*x+d*g+h*y-p*m,t[7]=a*c-n*o-i*l-s*u+d*x-h*m-p*y-f*g,t}E.getReal=r.copy,E.setReal=r.copy,E.mul=u;var c=r.dot;E.dot=c;var h=r.length;E.length=h,E.len=h;var p=r.squaredLength;return E.squaredLength=p,E.sqrLen=p,E}var k,T,B={};function V(){if(k)return B;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}k=1,Object.defineProperty(B,"__esModule",{value:!0}),B.create=n,B.clone=function(t){var r=new e.ARRAY_TYPE(2);return r[0]=t[0],r[1]=t[1],r},B.fromValues=function(t,r){var n=new e.ARRAY_TYPE(2);return n[0]=t,n[1]=r,n},B.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},B.set=function(t,e,r){return t[0]=e,t[1]=r,t},B.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},B.subtract=i,B.multiply=a,B.divide=o,B.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},B.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},B.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},B.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},B.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},B.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},B.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},B.distance=l,B.squaredDistance=u,B.length=c,B.squaredLength=h,B.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},B.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},B.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t},B.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},B.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},B.lerp=function(t,e,r,n){var i=e[0],s=e[1];return t[0]=i+n*(r[0]-i),t[1]=s+n*(r[1]-s),t},B.random=function(t,r){r=r||1;var n=2*e.RANDOM()*Math.PI;return t[0]=Math.cos(n)*r,t[1]=Math.sin(n)*r,t},B.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},B.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},B.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},B.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},B.rotate=function(t,e,r,n){var i=e[0]-r[0],s=e[1]-r[1],a=Math.sin(n),o=Math.cos(n);return t[0]=i*o-s*a+r[0],t[1]=i*a+s*o+r[1],t},B.angle=function(t,e){var r=t[0],n=t[1],i=e[0],s=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+s*s);return Math.acos(Math.min(Math.max(a&&(r*i+n*s)/a,-1),1))},B.zero=function(t){return t[0]=0,t[1]=0,t},B.str=function(t){return "vec2("+t[0]+", "+t[1]+")"},B.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},B.equals=function(t,r){var n=t[0],i=t[1],s=r[0],a=r[1];return Math.abs(n-s)<=e.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=e.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))},B.forEach=B.sqrLen=B.sqrDist=B.dist=B.div=B.mul=B.sub=B.len=void 0;var e=function(e,n){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var i=r(void 0);if(i&&i.has(e))return i.get(e);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(s,o,l):s[o]=e[o];}return s.default=e,i&&i.set(e,s),s}(s());function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return (r=function(t){return t?n:e})(t)}function n(){var t=new e.ARRAY_TYPE(2);return e.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function i(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function a(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function o(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function l(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1])}function u(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function c(t){return Math.hypot(t[0],t[1])}function h(t){var e=t[0],r=t[1];return e*e+r*r}B.len=c,B.sub=i,B.mul=a,B.div=o,B.dist=l,B.sqrDist=u,B.sqrLen=h;var p,f=(p=n(),function(t,e,r,n,i,s){var a,o;for(e||(e=2),r||(r=0),o=n?Math.min(n*e+r,t.length):t.length,a=r;a<o;a+=e)p[0]=t[a],p[1]=t[a+1],i(p,p,s),t[a]=p[0],t[a+1]=p[1];return t});return B.forEach=f,B}function C(){if(T)return n;function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}T=1,Object.defineProperty(n,"__esModule",{value:!0}),n.vec4=n.vec3=n.vec2=n.quat2=n.quat=n.mat4=n.mat3=n.mat2d=n.mat2=n.glMatrix=void 0;var e=x(s());n.glMatrix=e;var r=x(l());n.mat2=r;var i=x(h());n.mat2d=i;var a=x(d());n.mat3=a;var o=x(g());n.mat4=o;var u=x(S());n.quat=u;var c=x(z());n.quat2=c;var p=x(V());n.vec2=p;var f=x(_());n.vec3=f;var m=x(I());function y(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return (y=function(t){return t?r:e})(t)}function x(e,r){if(e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return {default:e};var n=y(r);if(n&&n.has(e))return n.get(e);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=s?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(i,a,o):i[a]=e[a];}return i.default=e,n&&n.set(e,i),i}return n.vec4=m,n}var D,R,L,F,O=C(),N=function(){if(R)return D;function t(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n;}return R=1,D=t,t.prototype={sampleCurveX:function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return ((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var s=this.sampleCurveDerivativeX(r);if(Math.abs(s)<1e-6)break;r-=i/s;}var a=0,o=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?a=r:o=r,r=.5*(o-a)+a;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},D}(),U=e(N);function j(){if(F)return L;function t(t,e){this.x=t,this.y=e;}return F=1,L=t,t.prototype={clone:function(){return new t(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},t.convert=function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e},L}var q=e(j());function $(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return !1;for(let r=0;r<t.length;r++)if(!$(t[r],e[r]))return !1;return !0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return !1;if(Object.keys(t).length!==Object.keys(e).length)return !1;for(const r in t)if(!$(t[r],e[r]))return !1;return !0}return t===e}const G=Math.PI/180,Y=180/Math.PI;function H(t){return t*G}function X(t){return t*Y}const Z=[[0,0],[1,0],[1,1],[0,1]];function W(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function K(t,e,r,n){const i=new U(t,e,r,n);return function(t){return i.solve(t)}}const J=K(.25,.1,.25,1);function Q(t,e,r){return Math.min(r,Math.max(e,t))}function tt(t,e,r){return (r=Q((r-t)/(e-t),0,1))*r*(3-2*r)}function et(t,e,r){const n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function rt(t,e,r){if(!t.length)return r(null,[]);let n=t.length;const i=new Array(t.length);let s=null;t.forEach(((t,a)=>{e(t,((t,e)=>{t&&(s=t),i[a]=e,0==--n&&r(s,i);}));}));}function nt(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}let it=1;function st(){return it++}function at(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function ot(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e));}));}function lt(t,e,r){const n={};for(const r in t)n[r]=e.call(this,t[r],r,t);return n}function ut(t,e,r){const n={};for(const r in t)e.call(this,t[r],r,t)&&(n[r]=t[r]);return n}function ct(t){return Array.isArray(t)?t.map(ct):"object"==typeof t&&t?lt(t,ct):t}const ht={};function pt(t){ht[t]||("undefined"!=typeof console&&console.warn(t),ht[t]=!0);}function ft(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function dt(t){let e=0;for(let r,n,i=0,s=t.length,a=s-1;i<s;a=i++)r=t[i],n=t[a],e+=(n.x-r.x)*(r.y+n.y);return e}function mt([t,e,r]){const n=H(e+90),i=H(r);return {x:t*Math.cos(n)*Math.sin(i),y:t*Math.sin(n)*Math.sin(i),z:t*Math.cos(i),azimuthal:e,polar:r}}function yt(){return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function gt(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,r,n,i)=>{const s=n||i;return e[r]=!s||s.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t;}return e}let xt=null;function vt(t,e){return [t[4*e],t[4*e+1],t[4*e+2],t[4*e+3]]}function bt(t,e,r,n){for(;e<r;){const i=e+r>>1;t[i]<n?e=i+1:r=i;}return e}function _t(t,e,r,n){for(;e<r;){const i=e+r>>1;t[i]<=n?e=i+1:r=i;}return e}function wt(t){return t>0?1/(1.001-t):1+t}function Mt(t){return t>0?1-1/(1.001-t):-t}const At={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return /^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},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(!At.API_URL)return null;try{const t=new URL(At.API_URL);return "api.mapbox.cn"===t.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===t.hostname?"https://events.mapbox.com/events/v2":null}catch(t){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function It(t){return At.API_URL_REGEX.test(t)}function St(t){return At.API_SPRITE_REGEX.test(t)}let Pt,Et,zt,kt,Tt,Bt;function Vt(){return null==Pt&&(Pt=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Pt}const Ct={now:()=>void 0!==kt?kt:performance.now(),setNow(t){kt=t;},restoreNow(){kt=void 0;},frame(t){const e=requestAnimationFrame(t);return {cancel:()=>cancelAnimationFrame(e)}},getImageData(t,e=0){const{width:r,height:n}=t;Tt||(Tt=document.createElement("canvas"));const i=Tt.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return (r>Tt.width||n>Tt.height)&&(Tt.width=r,Tt.height=n),i.clearRect(-e,-e,r+2*e,n+2*e),i.drawImage(t,0,0,r,n),i.getImageData(-e,-e,r+2*e,n+2*e)},resolveURL:t=>(Et||(Et=document.createElement("a")),Et.href=t,Et.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return !!window.matchMedia&&(null==zt&&(zt=window.matchMedia("(prefers-reduced-motion: reduce)")),zt.matches)},hasCanvasFingerprintNoise(){if(void 0!==Bt)return Bt;if(!Vt())return Bt=!1,!1;const t=new OffscreenCanvas(85,1),e=t.getContext("2d",{willReadFrequently:!0});let r=0;for(let n=0;n<t.width;++n)e.fillStyle=`rgba(${r++},${r++},${r++}, 255)`,e.fillRect(n,0,1,1);const n=e.getImageData(0,0,t.width,t.height);r=0;for(let t=0;t<n.data.length;++t)if(t%4!=3&&r++!==n.data[t])return Bt=!0,!0;return Bt=!1,!1}};function Dt(t,e){const r=t.indexOf("?");if(r<0)return `${t}?${new URLSearchParams(e).toString()}`;const n=new URLSearchParams(t.slice(r));for(const t in e)n.set(t,e[t]);return `${t.slice(0,r)}?${n.toString()}`}function Rt(t,e={persistentParams:[]}){const r=t.indexOf("?");if(r<0)return t;const n=new URLSearchParams,i=new URLSearchParams(t.slice(r));for(const t of e.persistentParams){const e=i.get(t);e&&n.set(t,e);}const s=n.toString();return `${t.slice(0,r)}${s.length>0?`?${s}`:""}`}const Lt="mapbox-tiles";let Ft=500,Ot=50;const Nt=["language","worldview","jobid"];let Ut,jt;function qt(){try{return caches}catch(t){}}function $t(){const t=qt();t&&null==Ut&&(Ut=t.open(Lt));}let Gt=1/0;const Yt={supported:!1,testSupport:function(t){!Zt&&Xt&&(Wt?Jt(t):Ht=t);}};let Ht,Xt,Zt=!1,Wt=!1;const Kt="undefined"!=typeof self?self:{};function Jt(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Xt),t.isContextLost())return;Yt.supported=!0;}catch(t){}t.deleteTexture(e),Zt=!0;}Kt.document&&(Xt=Kt.document.createElement("img"),Xt.onload=function(){Ht&&Jt(Ht),Ht=null,Wt=!0;},Xt.onerror=function(){Zt=!0,Ht=null;},Xt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Qt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Qt);class te extends Error{constructor(t,e,r){401===e&&It(r)&&(t+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(t),this.status=e,this.url=r;}toString(){return `${this.name}: ${this.message} (${this.status}): ${this.url}`}}const ee=yt()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href;const re=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(ee())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(t,e){const r=new AbortController,n=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:ee(),referrerPolicy:t.referrerPolicy,signal:r.signal});let i=!1,s=!1;const a=(o=n.url).indexOf("sku=")>0&&It(o);var o;"json"===t.type&&n.headers.set("Accept","application/json");const l=(r,i,o)=>{if(s)return;if(r&&"SecurityError"!==r.message&&pt(r.toString()),i&&o)return u(i);const l=Date.now();fetch(n).then((r=>{if(r.ok){const t=a?r.clone():null;return u(r,t,l)}return e(new te(r.statusText,r.status,t.url))})).catch((r=>{"AbortError"!==r.name&&e(new Error(`${r.message} ${t.url}`));}));},u=(r,a,o)=>{("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((t=>{s||(a&&o&&function(t,e,r){if($t(),null==Ut)return;const n=gt(e.headers.get("Cache-Control")||"");if(n["no-store"])return;const i={status:e.status,statusText:e.statusText,headers:new Headers};e.headers.forEach(((t,e)=>i.headers.set(e,t))),n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString());const s=i.headers.get("Expires");if(!s)return;if(new Date(s).getTime()-r<42e4)return;let a=Rt(t.url,{persistentParams:Nt});if(206===e.status){const e=t.headers.get("Range");if(!e)return;i.status=200,a=Dt(a,{range:e});}!function(t,e){if(void 0===jt)try{new Response(new ReadableStream),jt=!0;}catch(t){jt=!1;}jt?e(t.body):t.blob().then(e);}(e,(t=>{const r=new Response(200!==(n=e.status)&&404!==n&&[101,103,204,205,304].includes(n)?null:t,i);var n;$t(),null!=Ut&&Ut.then((t=>t.put(a,r))).catch((t=>pt(t.message)));}));}(n,a,o),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((t=>{s||e(new Error(t.message));}));};return a?function(t,e){if($t(),null==Ut)return e(null);Ut.then((r=>{let n=Rt(t.url,{persistentParams:Nt});const i=t.headers.get("Range");i&&(n=Dt(n,{range:i})),r.match(n).then((t=>{const i=function(t){if(!t)return !1;const e=new Date(t.headers.get("Expires")||0),r=gt(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(t);r.delete(n),i&&r.put(n,t.clone()),e(null,t,i);})).catch(e);})).catch(e);}(n,l):l(null,null),{cancel:()=>{s=!0,i||r.abort();}}}(t,e);if(yt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){const r=new XMLHttpRequest;r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer");for(const e in t.headers)r.setRequestHeader(e,t.headers[e]);return "json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=()=>{e(new Error(r.statusText));},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let n=r.response;if("json"===t.type)try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new te(r.statusText,r.status,t.url));},r.send(t.body),{cancel:()=>r.abort()}}(t,e)},ne=function(t,e){return re(nt(t,{type:"arrayBuffer"}),e)};function ie(t){const e=document.createElement("a");return e.href=t,e.protocol===location.protocol&&e.host===location.host}const se="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ae,oe;ae=[],oe=0;const le=function(t,e){if(Yt.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),oe>=At.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0;}};return ae.push(r),r}oe++;let r=!1;const n=()=>{if(!r)for(r=!0,oe--;ae.length&&oe<At.MAX_PARALLEL_IMAGE_REQUESTS;){const t=ae.shift(),{requestParameters:e,callback:r,cancelled:n}=t;n||(t.cancel=le(e,r).cancel);}},i=ne(t,((t,r,i,s)=>{n(),t?e(t):r&&(self.createImageBitmap?function(t,e){const r=new Blob([new Uint8Array(t)],{type:"image/png"});createImageBitmap(r).then((t=>{e(null,t);})).catch((t=>{e(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`));}));}(r,((t,r)=>e(t,r,i,s))):function(t,e){const r=new Image;r.onload=()=>{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,requestAnimationFrame((()=>{r.src=se;}));},r.onerror=()=>e(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 n=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(n):se;}(r,((t,r)=>e(t,r,i,s))));}));return {cancel:()=>{i.cancel(),n();}}};var ue,ce,he,pe={exports:{}},fe={exports:{}},de={exports:{}},me=function(){if(he)return pe.exports;he=1;var t=(ue||(ue=1,fe.exports=function(t,e){var r,n,i,s,a,o,l,u;for(n=t.length-(r=3&t.length),i=e,a=3432918353,o=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(s=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(s>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295;}return i^=t.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}),fe.exports),e=(ce||(ce=1,de.exports=function(t,e){for(var r,n=t.length,i=e^n,s=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++s;switch(n){case 3:i^=(255&t.charCodeAt(s+2))<<16;case 2:i^=(255&t.charCodeAt(s+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(s)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}),de.exports);return pe.exports=t,pe.exports.murmur3=t,pe.exports.murmur2=e,pe.exports}(),ye=e(me);class ge{constructor(t,...e){nt(this,e[0]||{}),this.type=t;}}class xe extends ge{constructor(t,e={}){super("error",nt({error:t},e));}}function ve(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e));}function be(t,e,r){if(r&&r[t]){const n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1);}}class _e{on(t,e){return this._listeners=this._listeners||{},ve(t,e,this._listeners),this}off(t,e){return be(t,e,this._listeners),be(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},ve(t,e,this._oneTimeListeners),this):new Promise((e=>{this.once(t,e);}))}fire(t,e){const r="string"==typeof t?new ge(t,e):t,n=r.type;if(this.listens(n)){r.target=this;const t=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const e of t)e.call(this,r);const e=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const t of e)be(n,t,this._oneTimeListeners),t.call(this,r);const i=this._eventedParent;i&&(nt(r,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(r));}else r instanceof xe&&console.error(r.error);return this}listens(t){return !!(this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t))}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}class we{constructor(t){"string"==typeof t?this.name=t:(this.name=t.name,this.iconsetId=t.iconsetId);}static from(t){return new we(t)}static toString(t){return t.iconsetId?`${t.name}${t.iconsetId}`:t.name}static parse(t){const[e,r]=t.split("");return new we({name:e,iconsetId:r})}static isEqual(t,e){return t.name===e.name&&t.iconsetId===e.iconsetId}toString(){return we.toString(this)}serialize(){return {name:this.name,iconsetId:this.iconsetId}}}var Me,Ae={},Ie=function(){if(Me)return Ae;Me=1;var t={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 e(t){return (t=Math.round(t))<0?0:t>255?255:t}function r(t){return e("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function n(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}function i(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{Ae.parseCSSColor=function(s){var a,o=s.replace(/ /g,"").toLowerCase();if(o in t)return t[o].slice();if("#"===o[0])return 4===o.length?(a=parseInt(o.substr(1),16))>=0&&a<=4095?[(3840&a)>>4|(3840&a)>>8,240&a|(240&a)>>4,15&a|(15&a)<<4,1]:null:7===o.length&&(a=parseInt(o.substr(1),16))>=0&&a<=16777215?[(16711680&a)>>16,(65280&a)>>8,255&a,1]:null;var l=o.indexOf("("),u=o.indexOf(")");if(-1!==l&&u+1===o.length){var c=o.substr(0,l),h=o.substr(l+1,u-(l+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=n(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),p];case"hsla":if(4!==h.length)return null;p=n(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,d=n(h[1]),m=n(h[2]),y=m<=.5?m*(d+1):m+d-m*d,g=2*m-y;return [e(255*i(g,y,f+1/3)),e(255*i(g,y,f)),e(255*i(g,y,f-1/3)),p];default:return null}}return null};}catch(t){}return Ae}();class Se{constructor(t,e,r,n=1){this.r=t,this.g=e,this.b=r,this.a=n;}static parse(t){if(!t)return;if(t instanceof Se)return t;if("string"!=typeof t)return;const e=Ie.parseCSSColor(t);return e?new Se(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toStringPremultipliedAlpha(){const[t,e,r,n]=0===this.a?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a];return `rgba(${Math.round(t)},${Math.round(e)},${Math.round(r)},${n})`}toString(){const[t,e,r,n]=[this.r,this.g,this.b,this.a];return `rgba(${Math.round(255*t)},${Math.round(255*e)},${Math.round(255*r)},${n})`}toRenderColor(t){const{r:e,g:r,b:n,a:i}=this;return new Pe(t,e,r,n,i)}clone(){return new Se(this.r,this.g,this.b,this.a)}}class Pe{constructor(t,e,r,n,i){if(t){const s=t.image.height,a=s*s;e=0===i?0:e/i*(s-1),r=0===i?0:r/i*(s-1),n=0===i?0:n/i*(s-1);const o=Math.floor(e),l=Math.floor(r),u=Math.floor(n),c=Math.ceil(e),h=Math.ceil(r),p=Math.ceil(n),f=e-o,d=r-l,m=n-u,y=t.image.data,g=4*(o+l*a+u*s),x=4*(o+l*a+p*s),v=4*(o+h*a+u*s),b=4*(o+h*a+p*s),_=4*(c+l*a+u*s),w=4*(c+l*a+p*s),M=4*(c+h*a+u*s),A=4*(c+h*a+p*s);if(g<0||A>=y.length)throw new Error("out of range");this.r=Ee(Ee(Ee(y[g],y[x],m),Ee(y[v],y[b],m),d),Ee(Ee(y[_],y[w],m),Ee(y[M],y[A],m),d),f)/255*i,this.g=Ee(Ee(Ee(y[g+1],y[x+1],m),Ee(y[v+1],y[b+1],m),d),Ee(Ee(y[_+1],y[w+1],m),Ee(y[M+1],y[A+1],m),d),f)/255*i,this.b=Ee(Ee(Ee(y[g+2],y[x+2],m),Ee(y[v+2],y[b+2],m),d),Ee(Ee(y[_+2],y[w+2],m),Ee(y[M+2],y[A+2],m),d),f)/255*i,this.a=i;}else this.r=e,this.g=r,this.b=n,this.a=i;}toArray(){const{r:t,g:e,b:r,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]}toHslaArray(){if(0===this.a)return [0,0,0,0];const{r:t,g:e,b:r,a:n}=this,i=Math.min(Math.max(t/n,0),1),s=Math.min(Math.max(e/n,0),1),a=Math.min(Math.max(r/n,0),1),o=Math.min(i,s,a),l=Math.max(i,s,a),u=(o+l)/2;if(o===l)return [0,0,100*u,n];const c=l-o,h=u>.5?c/(2-l-o):c/(l+o);let p=0;return l===i?p=(s-a)/c+(s<a?6:0):l===s?p=(a-i)/c+2:l===a&&(p=(i-s)/c+4),p*=60,[Math.min(Math.max(p,0),360),Math.min(Math.max(100*h,0),100),Math.min(Math.max(100*u,0),100),n]}toArray01(){const{r:t,g:e,b:r,a:n}=this;return 0===n?[0,0,0,0]:[t/n,e/n,r/n,n]}toArray01Scaled(t){const{r:e,g:r,b:n,a:i}=this;return 0===i?[0,0,0]:[e/i*t,r/i*t,n/i*t]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:r,a:n}=this;return [t,e,r,n]}toArray01Linear(){const{r:t,g:e,b:r,a:n}=this;return 0===n?[0,0,0,0]:[Math.pow(t/n,2.2),Math.pow(e/n,2.2),Math.pow(r/n,2.2),n]}}function Ee(t,e,r){return t*(1-r)+e*r}function ze(t,e,r){return t.map(((t,n)=>Ee(t,e[n],r)))}function ke(t){return t*t*t*t*t}Se.black=new Se(0,0,0,1),Se.white=new Se(1,1,1,1),Se.transparent=new Se(0,0,0,0),Se.red=new Se(1,0,0,1),Se.blue=new Se(0,0,1,1);var Te=Object.freeze({__proto__:null,array:ze,color:function(t,e,r){return new Se(Ee(t.r,e.r,r),Ee(t.g,e.g,r),Ee(t.b,e.b,r),Ee(t.a,e.a,r))},easeIn:ke,number:Ee});function Be(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}class Ve extends Error{constructor(t,e){super(e),this.message=e,this.key=t;}}class Ce{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,r]of e)this.bindings[t]=r;}concat(t){return new Ce(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return !!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const De={kind:"null"},Re={kind:"number"},Le={kind:"string"},Fe={kind:"boolean"},Oe={kind:"color"},Ne={kind:"object"},Ue={kind:"value"},je={kind:"collator"},qe={kind:"formatted"},$e={kind:"resolvedImage"};function Ge(t,e){return {kind:"array",itemType:t,N:e}}function Ye(t){if("array"===t.kind){const e=Ye(t.itemType);return "number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const He=[De,Re,Le,Fe,Oe,qe,Ne,Ge(Ue),$e];function Xe(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Xe(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else {if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of He)if(!Xe(t,e))return null}return `Expected ${Ye(t)} but found ${Ye(e)} instead.`}function Ze(t,e){return e.some((e=>e.kind===t.kind))}function We(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}class Ke{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"});}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Je{constructor(t,e,r,n,i){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i;}}class Qe{constructor(t){this.sections=t;}static fromString(t){return new Qe([new Je(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||!!t.image&&t.image.hasPrimary()))}static factory(t){return t instanceof Qe?t:Qe.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){const r=e.image.getPrimary().id.toString();t.push(["image",r]);continue}t.push(e.text);const r={};e.fontStack&&(r["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(r["font-scale"]=e.scale),e.textColor&&(r["text-color"]=["rgba"].concat(e.textColor.toRenderColor(null).toArray())),t.push(r);}return t}}class tr{constructor(t,e={}){if(this.id=we.from(t),this.options=Object.assign({},e),e.transform){const{a:t,b:r,c:n,d:i,e:s,f:a}=e.transform;this.options.transform=new DOMMatrix([t,r,n,i,s,a]);}else this.options.transform=new DOMMatrix([1,0,0,1,0,0]);}toString(){const{a:t,b:e,c:r,d:n,e:i,f:s}=this.options.transform;return JSON.stringify({name:this.id.name,iconsetId:this.id.iconsetId,params:this.options.params,transform:{a:t,b:e,c:r,d:n,e:i,f:s}})}static parse(t){let e,r,n,i;try{({name:e,iconsetId:r,params:n,transform:i}=JSON.parse(t)||{});}catch(t){return null}if(!e)return null;const{a:s,b:a,c:o,d:l,e:u,f:c}=i||{};return new tr({name:e,iconsetId:r},{params:n,transform:new DOMMatrix([s,a,o,l,u,c])})}scaleSelf(t){return this.options.transform.scaleSelf(t),this}}class er{constructor(t,e,r,n,i=!1){this.primaryId=we.from(t),this.primaryOptions=e,r&&(this.secondaryId=we.from(r)),this.secondaryOptions=n,this.available=i;}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return !!this.primaryId}getPrimary(){return new tr(this.primaryId,this.primaryOptions)}hasSecondary(){return !!this.secondaryId}getSecondary(){return this.secondaryId?new tr(this.secondaryId,this.secondaryOptions):null}static from(t){return "string"==typeof t?er.build({name:t}):t}static build(t,e,r,n){return !t||"object"==typeof t&&!("name"in t)?null:new er(t,r,e,n)}}function rr(t,e,r,n){return "number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function nr(t){if(null===t)return !0;if("string"==typeof t)return !0;if("boolean"==typeof t)return !0;if("number"==typeof t)return !0;if(t instanceof Se)return !0;if(t instanceof Ke)return !0;if(t instanceof Qe)return !0;if(t instanceof er)return !0;if(Array.isArray(t)){for(const e of t)if(!nr(e))return !1;return !0}if("object"==typeof t){for(const e in t)if(!nr(t[e]))return !1;return !0}return !1}function ir(t){if(null===t)return De;if("string"==typeof t)return Le;if("boolean"==typeof t)return Fe;if("number"==typeof t)return Re;if(t instanceof Se)return Oe;if(t instanceof Ke)return je;if(t instanceof Qe)return qe;if(t instanceof er)return $e;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=ir(e);if(r){if(r===t)continue;r=Ue;break}r=t;}return Ge(r||Ue,e)}return Ne}function sr(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Se?t.toStringPremultipliedAlpha():t instanceof Qe||t instanceof er?t.toString():JSON.stringify(t)}class ar{constructor(t,e){this.type=t,this.value=e;}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!nr(t[1]))return e.error("invalid value");const r=t[1];let n=ir(r);const i=e.expectedType;return "array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ar(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return !0}serialize(){return "array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Se?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof Qe?this.value.serialize():this.value}}class or{constructor(t){this.name="ExpressionEvaluationError",this.message=t;}toJSON(){return this.message}}const lr={string:Le,number:Re,boolean:Fe,object:Ne};class ur{constructor(t,e){this.type=t,this.args=e;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1;const i=t[0];if("array"===i){let i,s;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in lr)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=lr[r],n++;}else i=Ue;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],n++;}r=Ge(i,s);}else r=lr[i];const s=[];for(;n<t.length;n++){const r=e.parse(t[n],n,Ue);if(!r)return null;s.push(r);}return new ur(r,s)}evaluate(t){for(let e=0;e<this.args.length;e++){const r=this.args[e].evaluate(t);if(!Xe(this.type,ir(r)))return r;if(e===this.args.length-1)throw new or(`The expression ${JSON.stringify(this.args[e].serialize())} evaluated to ${Ye(ir(r))} but was expected to be of type ${Ye(this.type)}.`)}return null}eachChild(t){this.args.forEach(t);}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n);}}return e.concat(this.args.map((t=>t.serialize())))}}class cr{constructor(t){this.type=qe,this.sections=t;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=t.length-1;++r){const s=t[r];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let t=null;if(s["font-scale"]&&(t=e.parseObjectValue(s["font-scale"],r,"font-scale",Re),!t))return null;let a=null;if(s["text-font"]&&(a=e.parseObjectValue(s["text-font"],r,"text-font",Ge(Le)),!a))return null;let o=null;if(s["text-color"]&&(o=e.parseObjectValue(s["text-color"],r,"text-color",Oe),!o))return null;const l=n[n.length-1];l.scale=t,l.font=a,l.textColor=o;}else {const s=e.parse(t[r],r,Ue);if(!s)return null;const a=s.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:s,scale:null,font:null,textColor:null});}}return new cr(n)}evaluate(t){return new Qe(this.sections.map((e=>{const r=e.content.evaluate(t);return ir(r)===$e?new Je("",r,null,null,null):new Je(sr(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor);}outputDefined(){return !1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const r={};e.scale&&(r["font-scale"]=e.scale.serialize()),e.font&&(r["text-font"]=e.font.serialize()),e.textColor&&(r["text-color"]=e.textColor.serialize()),t.push(r);}return t}}class hr{constructor(t,e,r,n){this._imageWarnHistory={},this.type=$e,this.namePrimary=t,this.nameSecondary=e,r&&(this.paramsPrimary=r.params,this.iconsetIdPrimary=r.iconset?r.iconset.id:void 0),n&&(this.paramsSecondary=n.params,this.iconsetIdSecondary=n.iconset?n.iconset.id:void 0);}static parse(t,e){if(t.length<2)return e.error("Expected two or more arguments.");let r=1;const n=[];function i(){if(r<t.length){const i=e.parse(t[r],r++,Le);return i?(n.push({image:i,options:{}}),!0):(e.error(n.length?"Secondary image variant is not a string.":"No image name provided."),!1)}return !0}function s(){if(r<t.length){const s=t[r];if(null===(i=s)||"object"!=typeof i||Array.isArray(i))return !0;const a=s.params,o=s.iconset,l=e.concat(r);if(!a&&!o)return r++,!0;if(a){if("object"!=typeof a||a.constructor!==Object)return l.error('Image options "params" should be an object'),!1;const t={},e=l.concat(void 0,"params");for(const r in a){if(!r)return e.error("Image parameter name should be non-empty"),!1;const n=e.concat(void 0,r).parse(a[r],void 0,Oe,void 0,{typeAnnotation:"coerce"});if(!n)return !1;t[r]=n;}n[n.length-1].options.params=t;}if(o){if("object"!=typeof o||o.constructor!==Object)return l.error('Image options "iconset" should be an object'),!1;if(!o.id)return l.error('Image options "iconset" should have an "id" property'),!1;n[n.length-1].options.iconset=o;}return r++,!0}var i;return !0}for(let t=0;t<2;t++)if(!i()||!s())return;return new hr(n[0].image,n[1]?n[1].image:void 0,n[0].options,n[1]?n[1].options:void 0)}evaluateParams(t,e){const r={};if(e){for(const n in e)if(e[n])try{r[n]=e[n].evaluate(t);}catch(t){continue}if(0!==Object.keys(r).length)return {params:r}}}evaluate(t){const e={name:this.namePrimary.evaluate(t),iconsetId:this.iconsetIdPrimary},r=this.nameSecondary?{name:this.nameSecondary.evaluate(t),iconsetId:this.iconsetIdSecondary}:void 0,n=er.build(e,r,this.paramsPrimary?this.evaluateParams(t,this.paramsPrimary):void 0,this.paramsSecondary?this.evaluateParams(t,this.paramsSecondary):void 0);if(n&&t.availableImages){const e=n.getPrimary().id;if(n.available=t.availableImages.some((t=>we.isEqual(t,e))),n.available){const e=n.getSecondary()?n.getSecondary().id:null;e&&(n.available=t.availableImages.some((t=>we.isEqual(t,e))));}}return n}eachChild(t){if(t(this.namePrimary),this.paramsPrimary)for(const e in this.paramsPrimary)this.paramsPrimary[e]&&t(this.paramsPrimary[e]);if(this.nameSecondary&&(t(this.nameSecondary),this.paramsSecondary))for(const e in this.paramsSecondary)this.paramsSecondary[e]&&t(this.paramsSecondary[e]);}outputDefined(){return !1}serializeOptions(t,e){const r={};if(e&&(r.iconset={id:e}),t){r.params={};for(const e in t)t[e]&&(r.params[e]=t[e].serialize());}return Object.keys(r).length>0?r:void 0}serialize(){const t=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const e=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);e&&t.push(e);}if(this.nameSecondary&&(t.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const e=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);e&&t.push(e);}return t}}function pr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}const fr={"to-boolean":Fe,"to-color":Oe,"to-number":Re,"to-string":Le};class dr{constructor(t,e){this.type=t,this.args=e;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0],n=[];let i=De;if("to-array"===r){if(!Array.isArray(t[1]))return null;const r=t[1].length;if(e.expectedType){if("array"!==e.expectedType.kind)return e.error(`Expected ${e.expectedType.kind} but found array.`);i=Ge(e.expectedType.itemType,r);}else {if(!(r>0&&nr(t[1][0])))return null;i=Ge(ir(t[1][0]),r);}for(let s=0;s<r;s++){const r=t[1][s];let a;if("array"===pr(r))a=e.parse(r,void 0,i.itemType);else {const t=pr(r);if(t!==i.itemType.kind)return e.error(`Expected ${i.itemType.kind} but found ${t}.`);a=e.registry.literal.parse(["literal",void 0===r?null:r],e);}if(!a)return null;n.push(a);}}else {if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");i=fr[r];for(let r=1;r<t.length;r++){const i=e.parse(t[r],r,Ue);if(!i)return null;n.push(i);}}return new dr(i,n)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,r;for(const n of this.args){if(e=n.evaluate(t),r=null,e instanceof Se)return e;if("string"==typeof e){const r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&(r=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:rr(e[0],e[1],e[2],e[3]),!r))return new Se(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new or(r||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new or(`Could not convert ${JSON.stringify(e)} to number.`)}return "formatted"===this.type.kind?Qe.fromString(sr(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?er.build(sr(this.args[0].evaluate(t))):"array"===this.type.kind?this.args.map((e=>e.evaluate(t))):sr(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t);}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new cr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new hr(this.args[0]).serialize();const t="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize());})),t}}const mr=["Unknown","Point","LineString","Polygon"];class yr{constructor(t,e){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,this.scope=t,this.options=e;}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?mr[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||{}}measureLight(t){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:r,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(r*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Se.parse(t)),e}getConfig(t){return this.options?this.options.get(t):null}}class gr{constructor(t,e,r,n,i){this.name=t,this.type=e,this._evaluate=r,this.args=n,this._overloadIndex=i;}evaluate(t){if(!this._evaluate){const t=gr.definitions[this.name];this._evaluate=Array.isArray(t)?t[2]:t.overloads[this._overloadIndex][1];}return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t);}outputDefined(){return !1}serialize(){return [this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const r=t[0],n=gr.definitions[r];if(!n)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=[];let o=null,l=-1;for(const[n,u]of s){if(Array.isArray(n)&&n.length!==t.length-1)continue;a.push(n),l++,o=new Fn(e.registry,e.path,null,e.scope,void 0,e._scope,e.options);const s=[];let c=!1;for(let e=1;e<t.length;e++){const r=t[e],i=Array.isArray(n)?n[e-1]:n.type,a=o.parse(r,1+s.length,i);if(!a){c=!0;break}s.push(a);}if(!c)if(Array.isArray(n)&&n.length!==s.length)o.error(`Expected ${n.length} arguments, but found ${s.length} instead.`);else {for(let t=0;t<s.length;t++){const e=Array.isArray(n)?n[t]:n.type,r=s[t];o.concat(t+1).checkSubtype(e,r.type);}if(0===o.errors.length)return new gr(r,i,u,s,l)}}if(1===a.length)e.errors.push(...o.errors);else {const r=(a.length?a:s.map((([t])=>t))).map(xr).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(Ye(i.type));}e.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`);}return null}static register(t,e){gr.definitions=e;for(const r in e)t[r]=gr;}}function xr(t){return Array.isArray(t)?`(${t.map(Ye).join(", ")})`:`(${Ye(t.type)}...)`}class vr{constructor(t,e,r){this.type=je,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e;}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");const n=void 0===r["case-sensitive"]?e.parse(!1,1,Fe):e.parseObjectValue(r["case-sensitive"],1,"case-sensitive",Fe);if(!n)return null;const i=void 0===r["diacritic-sensitive"]?e.parse(!1,1,Fe):e.parseObjectValue(r["diacritic-sensitive"],1,"diacritic-sensitive",Fe);if(!i)return null;let s=null;return r.locale&&(s=e.parseObjectValue(r.locale,1,"locale",Le),!s)?null:new vr(n,i,s)}evaluate(t){return new Ke(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);}outputDefined(){return !1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function br(t,e,r=0,n=t.length-1,i=wr){for(;n>r;){if(n-r>600){const s=n-r+1,a=e-r+1,o=Math.log(s),l=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*l*(s-l)/s)*(a-s/2<0?-1:1);br(t,e,Math.max(r,Math.floor(e-a*l/s+u)),Math.min(n,Math.floor(e+(s-a)*l/s+u)),i);}const s=t[e];let a=r,o=n;for(_r(t,r,e),i(t[n],s)>0&&_r(t,r,n);a<o;){for(_r(t,a,o),a++,o--;i(t[a],s)<0;)a++;for(;i(t[o],s)>0;)o--;}0===i(t[r],s)?_r(t,r,o):(o++,_r(t,o,n)),o<=e&&(r=o+1),e<=o&&(n=o-1);}}function _r(t,e,r){const n=t[e];t[e]=t[r],t[r]=n;}function wr(t,e){return t<e?-1:t>e?1:0}function Mr(t){let e=0;for(let r,n,i=0,s=t.length,a=s-1;i<s;a=i++)r=t[i],n=t[a],e+=(n.x-r.x)*(r.y+n.y);return e}function Ar(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1]);}function Ir(t,e){return !(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Sr(t,e,r){const n=t[0]-e[0],i=t[1]-e[1],s=t[0]-r[0],a=t[1]-r[1];return n*a-s*i==0&&n*s<=0&&i*a<=0}function Pr(t,e,r=!1){let n=!1;for(let o=0,l=e.length;o<l;o++){const l=e[o];for(let e=0,o=l.length,u=o-1;e<o;u=e++){const o=l[u],c=l[e];if(Sr(t,o,c))return r;(s=o)[1]>(i=t)[1]!=(a=c)[1]>i[1]&&i[0]<(a[0]-s[0])*(i[1]-s[1])/(a[1]-s[1])+s[0]&&(n=!n);}}var i,s,a;return n}function Er(t,e,r,n){const i=n[0]-r[0],s=n[1]-r[1],a=(t[0]-r[0])*s-i*(t[1]-r[1]),o=(e[0]-r[0])*s-i*(e[1]-r[1]);return a>0&&o<0||a<0&&o>0}function zr(t,e,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(s=[e[0]-t[0],e[1]-t[1]])[1]-i[1]*s[0]&&!(!Er(t,e,r,n)||!Er(r,n,t,e));var i,s;}const kr=8192;function Tr(t,e){const r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return [Math.round(r*i*kr),Math.round(n*i*kr)]}function Br(t,e){for(let r=0;r<e.length;r++)if(Pr(t,e[r]))return !0;return !1}function Vr(t,e,r){for(const n of r)for(let r=0,i=n.length,s=i-1;r<i;s=r++)if(zr(t,e,n[s],n[r]))return !0;return !1}function Cr(t,e){for(let r=0;r<t.length;++r)if(!Pr(t[r],e))return !1;for(let r=0;r<t.length-1;++r)if(Vr(t[r],t[r+1],e))return !1;return !0}function Dr(t,e){for(let r=0;r<e.length;r++)if(Cr(t,e[r]))return !0;return !1}function Rr(t,e,r){const n=[];for(let i=0;i<t.length;i++){const s=[];for(let n=0;n<t[i].length;n++){const a=Tr(t[i][n],r);Ar(e,a),s.push(a);}n.push(s);}return n}function Lr(t,e,r){const n=[];for(let i=0;i<t.length;i++){const s=Rr(t[i],e,r);n.push(s);}return n}function Fr(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){const e=.5*n;let i=t[0]-r[0]>e?-n:r[0]-t[0]>e?n:0;0===i&&(i=t[0]-r[2]>e?-n:r[2]-t[0]>e?n:0),t[0]+=i;}Ar(e,t);}function Or(t,e,r,n){const i=Math.pow(2,n.z)*kr,s=[n.x*kr,n.y*kr],a=[];if(!t)return a;for(const n of t)for(const t of n){const n=[t.x+s[0],t.y+s[1]];Fr(n,e,r,i),a.push(n);}return a}function Nr(t,e,r,n){const i=Math.pow(2,n.z)*kr,s=[n.x*kr,n.y*kr],a=[];if(!t)return a;for(const r of t){const t=[];for(const n of r){const r=[n.x+s[0],n.y+s[1]];Ar(e,r),t.push(r);}a.push(t);}if(e[2]-e[0]<=i/2){(o=e)[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(const t of a)for(const n of t)Fr(n,e,r,i);}var o;return a}class Ur{constructor(t,e){this.type=Fe,this.geojson=t,this.geometries=e;}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(nr(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const r=e.features[t].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Ur(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Ur(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Ur(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return !1;if("Polygon"===e.type){const s=Rr(e.coordinates,n,i),a=Or(t.geometry(),r,n,i);if(!Ir(r,n))return !1;for(const t of a)if(!Pr(t,s))return !1}if("MultiPolygon"===e.type){const s=Lr(e.coordinates,n,i),a=Or(t.geometry(),r,n,i);if(!Ir(r,n))return !1;for(const t of a)if(!Br(t,s))return !1}return !0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return !1;if("Polygon"===e.type){const s=Rr(e.coordinates,n,i),a=Nr(t.geometry(),r,n,i);if(!Ir(r,n))return !1;for(const t of a)if(!Cr(t,s))return !1}if("MultiPolygon"===e.type){const s=Lr(e.coordinates,n,i),a=Nr(t.geometry(),r,n,i);if(!Ir(r,n))return !1;for(const t of a)if(!Dr(t,s))return !1}return !0}(t,this.geometries)}return !1}eachChild(){}outputDefined(){return !0}serialize(){return ["within",this.geojson]}}const jr={kilometers:1,miles:1e3/1609.344,nauticalmiles:1e3/1852,meters:1e3,metres:1e3,yards:1e3/.9144,feet:1e3/.3048,inches:1e3/.0254},qr=1/298.257223563,$r=qr*(2-qr),Gr=Math.PI/180;class Yr{static fromTile(t,e,r){const n=Math.PI*(1-2*(t+.5)/Math.pow(2,e)),i=Math.atan(.5*(Math.exp(n)-Math.exp(-n)))/Gr;return new Yr(i,r)}static get units(){return jr}constructor(t,e){if(void 0===t)throw new Error("No latitude given.");if(e&&!jr[e])throw new Error(`Unknown unit ${e}. Use one of: ${Object.keys(jr).join(", ")}`);const r=6378.137*Gr*(e?jr[e]:1),n=Math.cos(t*Gr),i=1/(1-$r*(1-n*n)),s=Math.sqrt(i);this.kx=r*s*n,this.ky=r*s*i*(1-$r);}distance(t,e){const r=Zr(t[0]-e[0])*this.kx,n=(t[1]-e[1])*this.ky;return Math.sqrt(r*r+n*n)}bearing(t,e){const r=Zr(e[0]-t[0])*this.kx;return Math.atan2(r,(e[1]-t[1])*this.ky)/Gr}destination(t,e,r){const n=r*Gr;return this.offset(t,Math.sin(n)*e,Math.cos(n)*e)}offset(t,e,r){return [t[0]+e/this.kx,t[1]+r/this.ky]}lineDistance(t){let e=0;for(let r=0;r<t.length-1;r++)e+=this.distance(t[r],t[r+1]);return e}area(t){let e=0;for(let r=0;r<t.length;r++){const n=t[r];for(let t=0,i=n.length,s=i-1;t<i;s=t++)e+=Zr(n[t][0]-n[s][0])*(n[t][1]+n[s][1])*(r?-1:1);}return Math.abs(e)/2*this.kx*this.ky}along(t,e){let r=0;if(e<=0)return t[0];for(let n=0;n<t.length-1;n++){const i=t[n],s=t[n+1],a=this.distance(i,s);if(r+=a,r>e)return Xr(i,s,(e-(r-a))/a)}return t[t.length-1]}pointToSegmentDistance(t,e,r){let[n,i]=e,s=Zr(r[0]-n)*this.kx,a=(r[1]-i)*this.ky;if(0!==s||0!==a){const e=(Zr(t[0]-n)*this.kx*s+(t[1]-i)*this.ky*a)/(s*s+a*a);e>1?(n=r[0],i=r[1]):e>0&&(n+=s/this.kx*e,i+=a/this.ky*e);}return s=Zr(t[0]-n)*this.kx,a=(t[1]-i)*this.ky,Math.sqrt(s*s+a*a)}pointOnLine(t,e){let r=1/0,n=t[0][0],i=t[0][1],s=0,a=0;for(let o=0;o<t.length-1;o++){let l=t[o][0],u=t[o][1],c=Zr(t[o+1][0]-l)*this.kx,h=(t[o+1][1]-u)*this.ky,p=0;0===c&&0===h||(p=(Zr(e[0]-l)*this.kx*c+(e[1]-u)*this.ky*h)/(c*c+h*h),p>1?(l=t[o+1][0],u=t[o+1][1]):p>0&&(l+=c/this.kx*p,u+=h/this.ky*p)),c=Zr(e[0]-l)*this.kx,h=(e[1]-u)*this.ky;const f=c*c+h*h;f<r&&(r=f,n=l,i=u,s=o,a=p);}return {point:[n,i],index:s,t:Math.max(0,Math.min(1,a))}}lineSlice(t,e,r){let n=this.pointOnLine(r,t),i=this.pointOnLine(r,e);if(n.index>i.index||n.index===i.index&&n.t>i.t){const t=n;n=i,i=t;}const s=[n.point],a=n.index+1,o=i.index;!Hr(r[a],s[0])&&a<=o&&s.push(r[a]);for(let t=a+1;t<=o;t++)s.push(r[t]);return Hr(r[o],i.point)||s.push(i.point),s}lineSliceAlong(t,e,r){let n=0;const i=[];for(let s=0;s<r.length-1;s++){const a=r[s],o=r[s+1],l=this.distance(a,o);if(n+=l,n>t&&0===i.length&&i.push(Xr(a,o,(t-(n-l))/l)),n>=e)return i.push(Xr(a,o,(e-(n-l))/l)),i;n>t&&i.push(o);}return i}bufferPoint(t,e){const r=e/this.ky,n=e/this.kx;return [t[0]-n,t[1]-r,t[0]+n,t[1]+r]}bufferBBox(t,e){const r=e/this.ky,n=e/this.kx;return [t[0]-n,t[1]-r,t[2]+n,t[3]+r]}insideBBox(t,e){return Zr(t[0]-e[0])>=0&&Zr(t[0]-e[2])<=0&&t[1]>=e[1]&&t[1]<=e[3]}}function Hr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Xr(t,e,r){const n=Zr(e[0]-t[0]);return [t[0]+n*r,t[1]+(e[1]-t[1])*r]}function Zr(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}class Wr{constructor(t=[],e=((t,e)=>t<e?-1:t>e?1:0)){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t);}push(t){this.data.push(t),this._up(this.length++);}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return --this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,s=e[i];if(r(n,s)>=0)break;e[t]=s,t=i;}e[t]=n;}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t<n;){let n=1+(t<<1);const s=n+1;if(s<this.length&&r(e[s],e[n])<0&&(n=s),r(e[n],i)>=0)break;e[t]=e[n],t=n;}e[t]=i;}}var Kr=8192;function Jr(t,e){return e.dist-t.dist}const Qr=100,tn=50;function en(t){const e=[1/0,1/0,-1/0,-1/0];if(e.length!==t.length)return !1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return !1;return !0}function rn(t){return t[1]-t[0]+1}function nn(t,e){const r=t[1]>=t[0]&&t[1]<e;return r||console.warn("Distance Expression: Index is out of range"),r}function sn(t,e){if(t[0]>t[1])return [null,null];const r=rn(t);if(e){if(2===r)return [t,null];const e=Math.floor(r/2);return [[t[0],t[0]+e],[t[0]+e,t[1]]]}{if(1===r)return [t,null];const e=Math.floor(r/2)-1;return [[t[0],t[0]+e],[t[0]+e+1,t[1]]]}}function an(t,e){const r=[1/0,1/0,-1/0,-1/0];if(!nn(e,t.length))return r;for(let n=e[0];n<=e[1];++n)Ar(r,t[n]);return r}function on(t){const e=[1/0,1/0,-1/0,-1/0];for(let r=0;r<t.length;++r)for(let n=0;n<t[r].length;++n)Ar(e,t[r][n]);return e}function ln(t,e,r){if(en(t)||en(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}function un(t){return 360*t-180}function cn(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function hn(t,e){const r=Math.pow(2,e.z),n=(t.y/Kr+e.y)/r;return [un((t.x/Kr+e.x)/r),cn(n)]}function pn(t,e){const r=[];for(let n=0;n<t.length;++n)r.push(hn(t[n],e));return r}function fn(t,e,r){const n=r.pointOnLine(e,t).point;return r.distance(t,n)}function dn(t,e,r,n,i){const s=r.slice(n[0],n[1]+1);let a=1/0;for(let r=e[0];r<=e[1];++r)if(0===(a=Math.min(a,fn(t[r],s,i))))return 0;return a}function mn(t,e,r,n,i){const s=Math.min(i.pointToSegmentDistance(t,r,n),i.pointToSegmentDistance(e,r,n)),a=Math.min(i.pointToSegmentDistance(r,t,e),i.pointToSegmentDistance(n,t,e));return Math.min(s,a)}function yn(t,e,r,n,i){if(!nn(e,t.length)||!nn(n,r.length))return NaN;let s=1/0;for(let a=e[0];a<e[1];++a)for(let e=n[0];e<n[1];++e){if(zr(t[a],t[a+1],r[e],r[e+1]))return 0;s=Math.min(s,mn(t[a],t[a+1],r[e],r[e+1],i));}return s}function gn(t,e,r,n,i){if(!nn(e,t.length)||!nn(n,r.length))return NaN;let s=1/0;for(let a=e[0];a<=e[1];++a)for(let e=n[0];e<=n[1];++e)if(0===(s=Math.min(s,i.distance(t[a],r[e]))))return s;return s}function xn(t,e,r){if(Pr(t,e,!0))return 0;let n=1/0;for(const i of e){const e=i.length;if(e<2)return console.warn("Distance Expression: Invalid polygon!"),NaN;if(i[0]!==i[e-1]&&0===(n=Math.min(n,r.pointToSegmentDistance(t,i[e-1],i[0]))))return n;if(0===(n=Math.min(n,fn(t,i,r))))return n}return n}function vn(t,e,r,n){if(!nn(e,t.length))return NaN;for(let n=e[0];n<=e[1];++n)if(Pr(t[n],r,!0))return 0;let i=1/0;for(let s=e[0];s<e[1];++s)for(const e of r)for(let r=0,a=e.length,o=a-1;r<a;o=r++){if(zr(t[s],t[s+1],e[o],e[r]))return 0;i=Math.min(i,mn(t[s],t[s+1],e[o],e[r],n));}return i}function bn(t,e){for(const r of t)for(let t=0;t<=r.length-1;++t)if(Pr(r[t],e,!0))return !0;return !1}function _n(t,e,r,n=1/0){const i=on(t),s=on(e);if(n!==1/0&&ln(i,s,r)>=n)return n;if(Ir(i,s)){if(bn(t,e))return 0}else if(bn(e,t))return 0;let a=n;for(const n of t)for(let t=0,i=n.length,s=i-1;t<i;s=t++)for(const i of e)for(let e=0,o=i.length,l=o-1;e<o;l=e++){if(zr(n[s],n[t],i[l],i[e]))return 0;a=Math.min(a,mn(n[s],n[t],i[l],i[e],r));}return a}function wn(t,e,r,n,i,s,a){if(null===s||null===a)return;const o=ln(an(n,s),an(i,a),r);o<e&&t.push({dist:o,range1:s,range2:a});}function Mn(t,e,r,n,i=1/0){let s=Math.min(n.distance(t[0],r[0][0]),i);if(0===s)return s;const a=new Wr([{dist:0,range1:[0,t.length-1],range2:[0,0]}],Jr),o=e?tn:Qr,l=on(r);for(;a.length;){const i=a.pop();if(i.dist>=s)continue;const u=i.range1;if(rn(u)<=o){if(!nn(u,t.length))return NaN;if(e){const e=vn(t,u,r,n);if(0===(s=Math.min(s,e)))return s}else for(let e=u[0];e<=u[1];++e){const i=xn(t[e],r,n);if(0===(s=Math.min(s,i)))return s}}else {const r=sn(u,e);if(null!==r[0]){const e=ln(an(t,r[0]),l,n);e<s&&a.push({dist:e,range1:r[0],range2:[0,0]});}if(null!==r[1]){const e=ln(an(t,r[1]),l,n);e<s&&a.push({dist:e,range1:r[1],range2:[0,0]});}}}return s}function An(t,e,r,n,i,s=1/0){let a=Math.min(s,i.distance(t[0],r[0]));if(0===a)return a;const o=new Wr([{dist:0,range1:[0,t.length-1],range2:[0,r.length-1]}],Jr),l=e?tn:Qr,u=n?tn:Qr;for(;o.length;){const s=o.pop();if(s.dist>=a)continue;const c=s.range1,h=s.range2;if(rn(c)<=l&&rn(h)<=u){if(!nn(c,t.length)||!nn(h,r.length))return NaN;if(e&&n?a=Math.min(a,yn(t,c,r,h,i)):e||n?e&&!n?a=Math.min(a,dn(r,h,t,c,i)):!e&&n&&(a=Math.min(a,dn(t,c,r,h,i))):a=Math.min(a,gn(t,c,r,h,i)),0===a)return a}else {const s=sn(c,e),l=sn(h,n);wn(o,a,i,t,r,s[0],l[0]),wn(o,a,i,t,r,s[0],l[1]),wn(o,a,i,t,r,s[1],l[0]),wn(o,a,i,t,r,s[1],l[1]);}}return a}function In(t,e,r,n,i=1/0){let s=i;const a=an(t,[0,t.length-1]);for(const i of r)if(!(s!==1/0&&ln(a,an(i,[0,i.length-1]),n)>=s)&&(s=Math.min(s,An(t,e,i,!0,n,s)),0===s))return s;return s}function Sn(t,e,r,n,i=1/0){let s=i;const a=an(t,[0,t.length-1]);for(const i of r){if(s!==1/0&&ln(a,on(i),n)>=s)continue;const r=Mn(t,e,i,n,s);if(isNaN(r))return r;if(0===(s=Math.min(s,r)))return s}return s}function Pn(t){return "Point"===t||"MultiPoint"===t||"LineString"===t||"MultiLineString"===t||"Polygon"===t||"MultiPolygon"===t}class En{constructor(t,e){this.type=Re,this.geojson=t,this.geometries=e;}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires either one argument, but found ' ${t.length-1} instead.`);if(nr(t[1])){const e=t[1];if("FeatureCollection"===e.type){for(let t=0;t<e.features.length;++t)if(Pn(e.features[t].geometry.type))return new En(e,e.features[t].geometry)}else if("Feature"===e.type){if(Pn(e.geometry.type))return new En(e,e.geometry)}else if(Pn(e.type))return new En(e,e)}return e.error("'distance' expression needs to be an array with format ['Distance', GeoJSONObj].")}evaluate(t){const e=t.geometry(),r=t.canonicalID();if(null!=e&&null!=r){if("Point"===t.geometryType())return function(t,e,r){const n=[];for(const r of t)for(const t of r)n.push(hn(t,e));const i=new Yr(n[0][1],"meters");return "Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type?An(n,!1,"Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,i):"MultiLineString"===r.type?In(n,!1,r.coordinates,i):"Polygon"===r.type||"MultiPolygon"===r.type?Sn(n,!1,"Polygon"===r.type?[r.coordinates]:r.coordinates,i):null}(e,r,this.geometries);if("LineString"===t.geometryType())return function(t,e,r){const n=[];for(const r of t){const t=[];for(const n of r)t.push(hn(n,e));n.push(t);}const i=new Yr(n[0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return In("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let t=1/0;for(let e=0;e<r.coordinates.length;e++){const s=In(r.coordinates[e],!0,n,i,t);if(isNaN(s))return s;if(0===(t=Math.min(t,s)))return t}return t}if("Polygon"===r.type||"MultiPolygon"===r.type){let t=1/0;for(let e=0;e<n.length;e++){const s=Sn(n[e],!0,"Polygon"===r.type?[r.coordinates]:r.coordinates,i,t);if(isNaN(s))return s;if(0===(t=Math.min(t,s)))return t}return t}return null}(e,r,this.geometries);if("Polygon"===t.geometryType())return function(t,e,r){const n=[];for(const r of function(t,e){const r=t.length;if(r<=1)return [t];const n=[];let i,s;for(let e=0;e<r;e++){const r=Mr(t[e]);0!==r&&(t[e].area=Math.abs(r),void 0===s&&(s=r<0),s===r<0?(i&&n.push(i),i=[t[e]]):i.push(t[e]));}return i&&n.push(i),n}(t)){const t=[];for(let n=0;n<r.length;++n)t.push(pn(r[n],e));n.push(t);}const i=new Yr(n[0][0][0][1],"meters");if("Point"===r.type||"MultiPoint"===r.type||"LineString"===r.type)return Sn("Point"===r.type?[r.coordinates]:r.coordinates,"LineString"===r.type,n,i);if("MultiLineString"===r.type){let t=1/0;for(let e=0;e<r.coordinates.length;e++){const s=Sn(r.coordinates[e],!0,n,i,t);if(isNaN(s))return s;if(0===(t=Math.min(t,s)))return t}return t}return "Polygon"===r.type||"MultiPolygon"===r.type?function(t,e,r){let n=1/0;for(const i of t)for(const t of e){const e=_n(i,t,r,n);if(isNaN(e))return e;if(0===(n=Math.min(n,e)))return n}return n}("Polygon"===r.type?[r.coordinates]:r.coordinates,n,i):null}(e,r,this.geometries);console.warn("Distance Expression: currently only evaluates valid Point/LineString/Polygon geometries.");}else console.warn("Distance Expression: requirs valid feature and canonical information.");return null}eachChild(){}outputDefined(){return !0}serialize(){return ["distance",this.geojson]}}function zn(t,e){switch(t){case"string":return sr(e);case"number":return +e;case"boolean":return !!e;case"color":return Se.parse(e);case"formatted":return Qe.fromString(sr(e));case"resolvedImage":return er.build(sr(e))}return e}function kn(t,e,r,n){return void 0!==n&&(t=n*Math.round(t/n)),void 0!==e&&t<e&&(t=e),void 0!==r&&t>r&&(t=r),t}class Tn{constructor(t,e,r){this.type=t,this.key=e,this.scope=r;}static parse(t,e){let r=e.expectedType;if(null==r&&(r=Ue),t.length<2||t.length>3)return e.error("Invalid number of arguments for 'config' expression.");const n=e.parse(t[1],1);if(!(n instanceof ar))return e.error("Key name of 'config' expression must be a string literal.");if(t.length>=3){const i=e.parse(t[2],2);return i instanceof ar?new Tn(r,sr(n.value),sr(i.value)):e.error("Scope of 'config' expression must be a string literal.")}return new Tn(r,sr(n.value))}evaluate(t){const e=[this.key,this.scope,t.scope].filter(Boolean).join(""),r=t.getConfig(e);if(!r)return null;const{type:n,value:i,values:s,minValue:a,maxValue:o,stepValue:l}=r,u=r.default.evaluate(t);let c=u;if(i){const e=t.scope;t.scope=(e||"").split("").slice(1).join(""),c=i.evaluate(t),t.scope=e;}return n&&(c=zn(n,c)),void 0===c||void 0===a&&void 0===o&&void 0===l||("number"==typeof c?c=kn(c,a,o,l):Array.isArray(c)&&(c=c.map((t=>"number"==typeof t?kn(t,a,o,l):t)))),void 0!==i&&void 0!==c&&s&&!s.includes(c)&&(c=u,n&&(c=zn(n,c))),(n&&n!==this.type||void 0!==c&&ir(c)!==this.type)&&(c=zn(this.type.kind,c)),c}eachChild(){}outputDefined(){return !1}serialize(){const t=["config",this.key];return this.scope&&t.concat(this.key),t}}function Bn(t){if(t instanceof gr){if("get"===t.name&&1===t.args.length)return !1;if("feature-state"===t.name)return !1;if("has"===t.name&&1===t.args.length)return !1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return !1;if(/^filter-/.test(t.name))return !1}if(t instanceof Ur)return !1;if(t instanceof En)return !1;let e=!0;return t.eachChild((t=>{e&&!Bn(t)&&(e=!1);})),e}function Vn(t){if(t instanceof gr&&"feature-state"===t.name)return !1;let e=!0;return t.eachChild((t=>{e&&!Vn(t)&&(e=!1);})),e}function Cn(t){if(t instanceof Tn)return new Set([t.key]);let e=new Set;return t.eachChild((t=>{e=new Set([...e,...Cn(t)]);})),e}function Dn(t,e){if(t instanceof gr&&e.indexOf(t.name)>=0)return !1;let r=!0;return t.eachChild((t=>{r&&!Dn(t,e)&&(r=!1);})),r}class Rn{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e;}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const r=t[1];return e.scope.has(r)?new Rn(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return !1}serialize(){return ["var",this.name]}}class Ln{constructor(t,e=[],r,n=new Ce,i=[],s,a){this.registry=t,this.path=e,this.key=e.map((t=>"string"==typeof t?`['${t}']`:`[${t}]`)).join(""),this.scope=n,this.errors=i,this.expectedType=r,this._scope=s,this.options=a;}parse(t,e,r,n,i={}){return e||r?this.concat(e,null,r,n)._parse(t,i):this._parse(t,i)}parseObjectValue(t,e,r,n,i,s={}){return this.concat(e,r,n,i)._parse(t,s)}_parse(t,e){function r(t,e,r){return "assert"===r?new ur(e,[t]):"coerce"===r?new dr(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n="string"==typeof t[0]?this.registry[t[0]]:void 0;if(n){let i=n.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,n=i.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"assert");}if(!(i instanceof ar)&&"resolvedImage"!==i.type.kind&&On(i)){const t=new yr(this._scope,this.options);try{i=new ar(i.type,i.evaluate(t));}catch(t){return this.error(t.message),null}}return i}return dr.parse(["to-array",t],this)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r,n){let i="number"==typeof t?this.path.concat(t):this.path;i="string"==typeof e?i.concat(e):i;const s=n?this.scope.concat(n):this.scope;return new Ln(this.registry,i,r||null,s,this.errors,this._scope,this.options)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Ve(r,t));}checkSubtype(t,e){const r=Xe(t,e);return r&&this.error(r),r}}var Fn=Ln;function On(t){if(t instanceof Rn)return On(t.boundExpression);if(t instanceof gr&&"error"===t.name)return !1;if(t instanceof vr)return !1;if(t instanceof Ur)return !1;if(t instanceof En)return !1;if(t instanceof Tn)return !1;const e=t instanceof dr||t instanceof ur;let r=!0;return t.eachChild((t=>{r=e?r&&On(t):r&&t instanceof ar;})),!!r&&Bn(t)&&Dn(t,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function Nn(t,e){const r=t.length-1;let n,i,s=0,a=r,o=0;for(;s<=a;)if(o=Math.floor((s+a)/2),n=t[o],i=t[o+1],n<=e){if(o===r||e<i)return o;s=o+1;}else {if(!(n>e))throw new or("Input is not a number.");a=o-1;}return 0}class Un{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e);}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,Re);if(!r)return null;const n=[];let i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let r=1;r<t.length;r+=2){const s=1===r?-1/0:t[r],a=t[r+1],o=r,l=r+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(n.length&&n[n.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);const u=e.parse(a,l,i);if(!u)return null;i=i||u.type,n.push([s,u]);}return new Un(i,r,n)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Nn(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e);}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}const jn=.95047,qn=1.08883,$n=4/29,Gn=6/29,Yn=3*Gn*Gn,Hn=Gn*Gn*Gn,Xn=Math.PI/180,Zn=180/Math.PI;function Wn(t){return t>Hn?Math.pow(t,1/3):t/Yn+$n}function Kn(t){return t>Gn?t*t*t:Yn*(t-$n)}function Jn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Qn(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ti(t){const e=Qn(t.r),r=Qn(t.g),n=Qn(t.b),i=Wn((.4124564*e+.3575761*r+.1804375*n)/jn),s=Wn((.2126729*e+.7151522*r+.072175*n)/1);return {l:116*s-16,a:500*(i-s),b:200*(s-Wn((.0193339*e+.119192*r+.9503041*n)/qn)),alpha:t.a}}function ei(t){let e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Kn(e),r=jn*Kn(r),n=qn*Kn(n),new Se(Jn(3.2404542*r-1.5371385*e-.4985314*n),Jn(-.969266*r+1.8760108*e+.041556*n),Jn(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function ri(t,e,r){const n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const ni={forward:ti,reverse:ei,interpolate:function(t,e,r){return {l:Ee(t.l,e.l,r),a:Ee(t.a,e.a,r),b:Ee(t.b,e.b,r),alpha:Ee(t.alpha,e.alpha,r)}}},ii={forward:function(t){const{l:e,a:r,b:n}=ti(t),i=Math.atan2(n,r)*Zn;return {h:i<0?i+360:i,c:Math.sqrt(r*r+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Xn,r=t.c;return ei({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:ri(t.h,e.h,r),c:Ee(t.c,e.c,r),l:Ee(t.l,e.l,r),alpha:Ee(t.alpha,e.alpha,r)}}};var si=Object.freeze({__proto__:null,hcl:ii,lab:ni});class ai{constructor(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e);}static interpolationFactor(t,e,r,n){let i=0;if("exponential"===t.name)i=oi(e,t.base,r,n);else if("linear"===t.name)i=oi(e,1,r,n);else if("cubic-bezier"===t.name){const s=t.controlPoints;i=new U(s[0],s[1],s[2],s[3]).solve(oi(e,1,r,n));}return i}static parse(t,e){let[r,n,i,...s]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t};}else {if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t};}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length-1>3&&(t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,Re),!i)return null;const a=[];let o=null;"interpolate-hcl"===r||"interpolate-lab"===r?o=Oe:e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(let t=0;t<s.length;t+=2){const r=s[t],n=s[t+1],i=t+3,l=t+4;if("number"!=typeof r)return e.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]>=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const u=e.parse(n,l,o);if(!u)return null;o=o||u.type,a.push([r,u]);}return "number"===o.kind||"color"===o.kind||"array"===o.kind&&"number"===o.itemType.kind&&"number"==typeof o.N?new ai(o,r,n,i,a):e.error(`Type ${Ye(o)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);const s=Nn(e,n),a=ai.interpolationFactor(this.interpolation,n,e[s],e[s+1]),o=r[s].evaluate(t),l=r[s+1].evaluate(t);return "interpolate"===this.operator?Te[this.type.kind.toLowerCase()](o,l,a):"interpolate-hcl"===this.operator?ii.reverse(ii.interpolate(ii.forward(o),ii.forward(l),a)):ni.reverse(ni.interpolate(ni.forward(o),ni.forward(l),a))}eachChild(t){t(this.input);for(const e of this.outputs)t(e);}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function oi(t,e,r,n){const i=n-r,s=t-r;return 0===i?0:1===e?s/i:(Math.pow(e,s)-1)/(Math.pow(e,i)-1)}class li{constructor(t,e){this.type=t,this.args=e;}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let r=null;const n=e.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of t.slice(1)){const t=e.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r=r||t.type,i.push(t);}const s=n&&i.some((t=>Xe(n,t.type)));return new li(s?Ue:r,i)}evaluate(t){let e,r=null,n=0;for(const i of this.args){if(n++,r=i.evaluate(t),r&&r instanceof er&&!r.available&&(e||(e=r),r=null,n===this.args.length))return e;if(null!==r)break}return r}eachChild(t){this.args.forEach(t);}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize());})),t}}class ui{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e;}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result);}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let n=1;n<t.length-1;n+=2){const i=t[n];if("string"!=typeof i)return e.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const s=e.parse(t[n+1],n+1);if(!s)return null;r.push([i,s]);}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return n?new ui(r,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,r]of this.bindings)t.push(e,r.serialize());return t.push(this.result.serialize()),t}}class ci{constructor(t,e,r){this.type=t,this.index=e,this.input=r;}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,Re),n=e.parse(t[2],2,Ge(e.expectedType||Ue));return r&&n?new ci(n.type.itemType,r,n):null}evaluate(t){const e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new or(`Array index out of bounds: ${e} < 0.`);if(e>=r.length)throw new or(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new or(`Array index must be an integer, but found ${e} instead. Use at-interpolated to retrieve interpolated result with a fractional index.`);return r[e]}eachChild(t){t(this.index),t(this.input);}outputDefined(){return !1}serialize(){return ["at",this.index.serialize(),this.input.serialize()]}}class hi{constructor(t,e,r){this.type=t,this.index=e,this.input=r;}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,Re),n=e.parse(t[2],2,Ge(e.expectedType||Ue));return r&&n?new hi(n.type.itemType,r,n):null}evaluate(t){const e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new or(`Array index out of bounds: ${e} < 0.`);if(e>r.length-1)throw new or(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e===Math.floor(e))return r[e];const n=Math.floor(e),i=Math.ceil(e),s=r[n],a=r[i];if("number"!=typeof s||"number"!=typeof a)throw new or(`Cannot interpolate between non-number values at index ${e}.`);const o=e-n;return s*(1-o)+a*o}eachChild(t){t(this.index),t(this.input);}outputDefined(){return !1}serialize(){return ["at-interpolated",this.index.serialize(),this.input.serialize()]}}class pi{constructor(t,e){this.type=Fe,this.needle=t,this.haystack=e;}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,Ue),n=e.parse(t[2],2,Ue);return r&&n?Ze(r.type,[Fe,Le,Re,De,Ue])?new pi(r,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ye(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return !1;if(!We(e,["boolean","string","number","null"]))throw new or(`Expected first argument to be of type boolean, string, number or null, but found ${Ye(ir(e))} instead.`);if(!We(r,["string","array"]))throw new or(`Expected second argument to be of type array or string, but found ${Ye(ir(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack);}outputDefined(){return !0}serialize(){return ["in",this.needle.serialize(),this.haystack.serialize()]}}class fi{constructor(t,e,r){this.type=Re,this.needle=t,this.haystack=e,this.fromIndex=r;}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,Ue),n=e.parse(t[2],2,Ue);if(!r||!n)return null;if(!Ze(r.type,[Fe,Le,Re,De,Ue]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ye(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,Re);return i?new fi(r,n,i):null}return new fi(r,n)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!We(e,["boolean","string","number","null"]))throw new or(`Expected first argument to be of type boolean, string, number or null, but found ${Ye(ir(e))} instead.`);if(!We(r,["string","array"]))throw new or(`Expected second argument to be of type array or string, but found ${Ye(ir(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex);}outputDefined(){return !1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return ["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return ["index-of",this.needle.serialize(),this.haystack.serialize()]}}class di{constructor(t,e,r,n,i,s){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=s;}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i={},s=[];for(let a=2;a<t.length-1;a+=2){let o=t[a];const l=t[a+1];Array.isArray(o)||(o=[o]);const u=e.concat(a);if(0===o.length)return u.error("Expected at least one branch label.");for(const t of o){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ir(t)))return null}else r=ir(t);if(void 0!==i[String(t)])return u.error("Branch labels must be unique.");i[String(t)]=s.length;}const c=e.parse(l,a,n);if(!c)return null;n=n||c.type,s.push(c);}const a=e.parse(t[1],1,Ue);if(!a)return null;const o=e.parse(t[t.length-1],t.length-1,n);return o?"value"!==a.type.kind&&e.concat(1).checkSubtype(r,a.type)?null:new di(r,n,a,i,s,o):null}evaluate(t){const e=this.input.evaluate(t);return (ir(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),r=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=r.length,r.push([this.cases[t],[t]])):r[e][1].push(t);}const i=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of r)t.push(1===n.length?i(n[0]):n.map(i)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class mi{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r;}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n=[];for(let i=1;i<t.length-1;i+=2){const s=e.parse(t[i],i,Fe);if(!s)return null;const a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([s,a]),r=r||a.type;}const i=e.parse(t[t.length-1],t.length-1,r);return i?new mi(r,n,i):null}evaluate(t){for(const[e,r]of this.branches)if(e.evaluate(t))return r.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,r]of this.branches)t(e),t(r);t(this.otherwise);}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize());})),t}}class yi{constructor(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n;}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,Ue),n=e.parse(t[2],2,Re);if(!r||!n)return null;if(!Ze(r.type,[Ge(Ue),Le,Ue]))return e.error(`Expected first argument to be of type array or string, but found ${Ye(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,Re);return i?new yi(r.type,r,n,i):null}return new yi(r.type,r,n)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!We(e,["string","array"]))throw new or(`Expected first argument to be of type array or string, but found ${Ye(ir(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex);}outputDefined(){return !1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return ["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return ["slice",this.input.serialize(),this.beginIndex.serialize()]}}function gi(t,e){return "=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function xi(t,e,r,n){return 0===n.compare(e,r)}function vi(t,e,r){const n="=="!==t&&"!="!==t;return class i{constructor(t,e,r){this.type=Fe,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind;}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let s=e.parse(t[1],1,Ue);if(!s)return null;if(!gi(r,s.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${Ye(s.type)}'.`);let a=e.parse(t[2],2,Ue);if(!a)return null;if(!gi(r,a.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${Ye(a.type)}'.`);if(s.type.kind!==a.type.kind&&"value"!==s.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${Ye(s.type)}' and '${Ye(a.type)}'.`);n&&("value"===s.type.kind&&"value"!==a.type.kind?s=new ur(a.type,[s]):"value"!==s.type.kind&&"value"===a.type.kind&&(a=new ur(s.type,[a])));let o=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==a.type.kind&&"value"!==s.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(o=e.parse(t[3],3,je),!o)return null}return new i(s,a,o)}evaluate(i){const s=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const e=ir(s),r=ir(a);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new or(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=ir(s),r=ir(a);if("string"!==t.kind||"string"!==r.kind)return e(i,s,a)}return this.collator?r(i,s,a,this.collator.evaluate(i)):e(i,s,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator);}outputDefined(){return !0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize());})),e}}}const bi=vi("==",(function(t,e,r){return e===r}),xi),_i=vi("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return !xi(0,e,r,n)})),wi=vi("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),Mi=vi(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Ai=vi("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Ii=vi(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0}));class Si{constructor(t,e,r,n,i,s){this.type=Le,this.number=t,this.locale=e,this.currency=r,this.unit=n,this.minFractionDigits=i,this.maxFractionDigits=s;}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,Re);if(!r)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=e.parseObjectValue(n.locale,2,"locale",Le),!i))return null;let s=null;if(n.currency&&(s=e.parseObjectValue(n.currency,2,"currency",Le),!s))return null;let a=null;if(n.unit&&(a=e.parseObjectValue(n.unit,2,"unit",Le),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=e.parseObjectValue(n["min-fraction-digits"],2,"min-fraction-digits",Re),!o))return null;let l=null;return n["max-fraction-digits"]&&(l=e.parseObjectValue(n["max-fraction-digits"],2,"max-fraction-digits",Re),!l)?null:new Si(r,i,s,a,o,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits);}outputDefined(){return !1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class Pi{constructor(t){this.type=Re,this.input=t;}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${Ye(r.type)} instead.`):new Pi(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new or(`Expected value to be of type string or array, but found ${Ye(ir(e))} instead.`)}eachChild(t){t(this.input);}outputDefined(){return !1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize());})),t}}function Ei(t){return function(){t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}const zi={"==":bi,"!=":_i,">":Mi,"<":wi,">=":Ii,"<=":Ai,array:ur,at:ci,"at-interpolated":hi,boolean:ur,case:mi,coalesce:li,collator:vr,format:cr,image:hr,in:pi,"index-of":fi,interpolate:ai,"interpolate-hcl":ai,"interpolate-lab":ai,length:Pi,let:ui,literal:ar,match:di,number:ur,"number-format":Si,object:ur,slice:yi,step:Un,string:ur,"to-boolean":dr,"to-color":dr,"to-number":dr,"to-string":dr,var:Rn,within:Ur,distance:En,config:Tn};function ki(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);const s=i?i.evaluate(t):1,a=rr(e,r,n,s);if(a)throw new or(a);return new Se(e/255*s,r/255*s,n/255*s,s)}function Ti(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);const s=i?i.evaluate(t):1,a=function(t,e,r,n){return "number"==typeof t&&t>=0&&t<=360?"number"==typeof e&&e>=0&&e<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid hsla value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'h' must be between 0 and 360.`}(e,r,n,s);if(a)throw new or(a);const o=`hsla(${e}, ${r}%, ${n}%, ${s})`,l=Se.parse(o);if(!l)throw new or(`Failed to parse HSLA color: ${o}`);return l}function Bi(t,e){return t in e}function Vi(t,e){const r=e[t];return void 0===r?null:r}function Ci(t){return {type:t}}function Di(t){return {result:"success",value:t}}function Ri(t){return {result:"error",value:t}}function Li(t,e){return !!t&&!!t.parameters&&t.parameters.indexOf(e)>-1}function Fi(t){return "data-driven"===t["property-type"]}function Oi(t){return Li(t.expression,"measure-light")}function Ni(t){return Li(t.expression,"zoom")}function Ui(t){return !!t.expression&&t.expression.interpolated}function ji(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function qi(t){return t}function $i(t,e){const r="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],i=n||!(n||void 0!==t.property),s=t.type||(Ui(e)?"exponential":"interval");if(r&&((t=Be({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],Se.parse(t[1])]))),t.default=Se.parse(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!si[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let a,o,l;if("exponential"===s)a=Xi;else if("interval"===s)a=Hi;else if("categorical"===s){a=Yi,o=Object.create(null);for(const e of t.stops)o[e[0]]=e[1];l=typeof t.stops[0][0];}else {if("identity"!==s)throw new Error(`Unknown function type "${s}"`);a=Zi;}if(n){const r={},n=[];for(let e=0;e<t.stops.length;e++){const i=t.stops[e],s=i[0].zoom;void 0===r[s]&&(r[s]={zoom:s,type:t.type,property:t.property,default:t.default,stops:[]},n.push(s)),r[s].stops.push([i[0].value,i[1]]);}const i=[];for(const t of n)i.push([r[t].zoom,$i(r[t],e)]);const s={name:"linear"};return {kind:"composite",interpolationType:s,interpolationFactor:ai.interpolationFactor.bind(void 0,s),zoomStops:i.map((t=>t[0])),evaluate:({zoom:r},n)=>Xi({stops:i,base:t.base},e,r).evaluate(r,n)}}if(i){const r="exponential"===s?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return {kind:"camera",interpolationType:r,interpolationFactor:ai.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>a(t,e,r,o,l)}}return {kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?Gi(t.default,e.default):a(t,e,i,o,l)}}}function Gi(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Yi(t,e,r,n,i){return Gi(typeof r===i?n[r]:void 0,t.default,e.default)}function Hi(t,e,r){if("number"!==pr(r))return Gi(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const i=Nn(t.stops.map((t=>t[0])),r);return t.stops[i][1]}function Xi(t,e,r){const n=void 0!==t.base?t.base:1;if("number"!==pr(r))return Gi(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const s=Nn(t.stops.map((t=>t[0])),r),a=function(t,e,r,n){const i=n-r,s=t-r;return 0===i?0:1===e?s/i:(Math.pow(e,s)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[s][0],t.stops[s+1][0]),o=t.stops[s][1],l=t.stops[s+1][1];let u=Te[e.type]||qi;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=si[t.colorSpace];u=(t,r)=>e.reverse(e.interpolate(e.forward(t),e.forward(r),a));}return "function"==typeof o.evaluate?{evaluate(...t){const e=o.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==r)return u(e,r,a)}}:u(o,l,a)}function Zi(t,e,r){return "color"===e.type?r=Se.parse(r):"formatted"===e.type?r=Qe.fromString(r.toString()):"resolvedImage"===e.type?r=er.build(r.toString()):pr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Gi(r,t.default,e.default)}gr.register(zi,{error:[{kind:"error"},[Le],(t,[e])=>{throw new or(e.evaluate(t))}],typeof:[Le,[Ue],(t,[e])=>Ye(ir(e.evaluate(t)))],"to-rgba":[Ge(Re,4),[Oe],(t,[e])=>e.evaluate(t).toRenderColor(null).toArray()],"to-hsla":[Ge(Re,4),[Oe],(t,[e])=>e.evaluate(t).toRenderColor(null).toHslaArray()],rgb:[Oe,[Re,Re,Re],ki],rgba:[Oe,[Re,Re,Re,Re],ki],hsl:[Oe,[Re,Re,Re],Ti],hsla:[Oe,[Re,Re,Re,Re],Ti],has:{type:Fe,overloads:[[[Le],(t,[e])=>Bi(e.evaluate(t),t.properties())],[[Le,Ne],(t,[e,r])=>Bi(e.evaluate(t),r.evaluate(t))]]},get:{type:Ue,overloads:[[[Le],(t,[e])=>Vi(e.evaluate(t),t.properties())],[[Le,Ne],(t,[e,r])=>Vi(e.evaluate(t),r.evaluate(t))]]},"feature-state":[Ue,[Le],(t,[e])=>Vi(e.evaluate(t),t.featureState||{})],properties:[Ne,[],t=>t.properties()],"geometry-type":[Le,[],t=>t.geometryType()],id:[Ue,[],t=>t.id()],zoom:[Re,[],t=>t.globals.zoom],pitch:[Re,[],t=>t.globals.pitch||0],"distance-from-center":[Re,[],t=>t.distanceFromCenter()],"measure-light":[Re,[Le],(t,[e])=>t.measureLight(e.evaluate(t))],"heatmap-density":[Re,[],t=>t.globals.heatmapDensity||0],"line-progress":[Re,[],t=>t.globals.lineProgress||0],"raster-value":[Re,[],t=>t.globals.rasterValue||0],"raster-particle-speed":[Re,[],t=>t.globals.rasterParticleSpeed||0],"sky-radial-progress":[Re,[],t=>t.globals.skyRadialProgress||0],accumulated:[Ue,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Re,Ci(Re),(t,e)=>{let r=0;for(const n of e)r+=n.evaluate(t);return r}],"*":[Re,Ci(Re),(t,e)=>{let r=1;for(const n of e)r*=n.evaluate(t);return r}],"-":{type:Re,overloads:[[[Re,Re],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[Re],(t,[e])=>-e.evaluate(t)]]},"/":[Re,[Re,Re],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[Re,[Re,Re],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[Re,[],()=>Math.LN2],pi:[Re,[],()=>Math.PI],e:[Re,[],()=>Math.E],"^":[Re,[Re,Re],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[Re,[Re],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Re,[Re],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Re,[Re],(t,[e])=>Math.log(e.evaluate(t))],log2:[Re,[Re],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Re,[Re],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Re,[Re],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Re,[Re],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Re,[Re],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Re,[Re],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Re,[Re],(t,[e])=>Math.atan(e.evaluate(t))],min:[Re,Ci(Re),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[Re,Ci(Re),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[Re,[Re],(t,[e])=>Math.abs(e.evaluate(t))],round:[Re,[Re],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Re,[Re],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Re,[Re],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Fe,[Le,Ue],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[Fe,[Ue],(t,[e])=>t.id()===e.value],"filter-type-==":[Fe,[Le],(t,[e])=>t.geometryType()===e.value],"filter-<":[Fe,[Le,Ue],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[Fe,[Ue],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[Fe,[Le,Ue],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[Fe,[Ue],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[Fe,[Le,Ue],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[Fe,[Ue],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[Fe,[Le,Ue],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[Fe,[Ue],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[Fe,[Ue],(t,[e])=>e.value in t.properties()],"filter-has-id":[Fe,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Fe,[Ge(Le)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Fe,[Ge(Ue)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Fe,[Le,Ge(Ue)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Fe,[Le,Ge(Ue)],(t,[e,r])=>function(t,e,r,n){for(;r<=n;){const i=r+n>>1;if(e[i]===t)return !0;e[i]>t?n=i-1:r=i+1;}return !1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Fe,overloads:[[[Fe,Fe],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[Ci(Fe),(t,e)=>{for(const r of e)if(!r.evaluate(t))return !1;return !0}]]},any:{type:Fe,overloads:[[[Fe,Fe],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[Ci(Fe),(t,e)=>{for(const r of e)if(r.evaluate(t))return !0;return !1}]]},"!":[Fe,[Fe],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Fe,[Le],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return !r||r(e.evaluate(t))}],upcase:[Le,[Le],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Le,[Le],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Le,Ci(Ue),(t,e)=>e.map((e=>sr(e.evaluate(t)))).join("")],"resolved-locale":[Le,[je],(t,[e])=>e.evaluate(t).resolvedLocale()],random:[Re,[Re,Re,Ue],(t,e)=>{const[r,n,i]=e.map((e=>e.evaluate(t)));if(r>n)return r;if(r===n)return r;let s;if("string"==typeof i)s=function(t){let e=0;if(0===t.length)return e;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return e}(i);else {if("number"!=typeof i)throw new or(`Invalid seed input: ${i}`);s=i;}return r+Ei(s)()*(n-r)}]});class Wi{constructor(t,e,r,n){this.expression=t,this._warningHistory={},this._evaluator=new yr(r,n),this._defaultValue=e?function(t){return "color"===t.type&&(ji(t.default)||Array.isArray(t.default))?new Se(0,0,0,0):"color"===t.type?Se.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null,this.configDependencies=Cn(t);}evaluateWithoutErrorHandling(t,e,r,n,i,s,a,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=o||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,n,i,s,a,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new or(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${t.message}`)),this._defaultValue}}}function Ki(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in zi}function Ji(t,e,r,n){const i=new Fn(zi,[],e?function(t){const e={color:Oe,string:Le,number:Re,enum:Le,boolean:Fe,formatted:qe,resolvedImage:$e};return "array"===t.type?Ge(e[t.value]||Ue,t.length):e[t.type]}(e):void 0,void 0,void 0,r,n),s=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return s?Di(new Wi(s,e,r,n)):Ri(i.errors)}class Qi{constructor(t,e,r,n){this.kind=t,this._styleExpression=e,this.isLightConstant=r,this.isLineProgressConstant=n,this.isStateDependent="constant"!==t&&!Vn(e.expression),this.configDependencies=Cn(e.expression);}evaluateWithoutErrorHandling(t,e,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,s)}evaluate(t,e,r,n,i,s){return this._styleExpression.evaluate(t,e,r,n,i,s)}}class ts{constructor(t,e,r,n,i,s){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Vn(e.expression),this.isLightConstant=i,this.isLineProgressConstant=s,this.configDependencies=Cn(e.expression),this.interpolationType=n;}evaluateWithoutErrorHandling(t,e,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,s)}evaluate(t,e,r,n,i,s){return this._styleExpression.evaluate(t,e,r,n,i,s)}interpolationFactor(t,e,r){return this.interpolationType?ai.interpolationFactor(this.interpolationType,t,e,r):0}}function es(t,e,r,n){if("error"===(t=Ji(t,e,r,n)).result)return t;const i=t.value.expression,s=Bn(i);if(!s&&!Fi(e))return Ri([new Ve("","data expressions not supported")]);const a=Dn(i,["zoom","pitch","distance-from-center"]);if(!a&&!Ni(e))return Ri([new Ve("","zoom expressions not supported")]);const o=Dn(i,["measure-light"]);if(!o&&!Oi(e))return Ri([new Ve("","measure-light expression not supported")]);const l=Dn(i,["line-progress"]);if(!l&&!function(t){return Li(t.expression,"line-progress")}(e))return Ri([new Ve("","line-progress expression not supported")]);const u=e.expression&&e.expression.relaxZoomRestriction,c=ns(i);return c||a||u?c instanceof Ve?Ri([c]):c instanceof ai&&!Ui(e)?Ri([new Ve("",'"interpolate" expressions cannot be used with this property')]):Di(c?new ts(s&&l?"camera":"composite",t.value,c.labels,c instanceof ai?c.interpolation:void 0,o,l):new Qi(s&&l?"constant":"source",t.value,o,l)):Ri([new Ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class rs{constructor(t,e){this._parameters=t,this._specification=e,Be(this,$i(this._parameters,this._specification));}static deserialize(t){return new rs(t._parameters,t._specification)}static serialize(t){return {_parameters:t._parameters,_specification:t._specification}}}function ns(t){let e=null;if(t instanceof ui)e=ns(t.result);else if(t instanceof li){for(const r of t.args)if(e=ns(r),e)break}else (t instanceof Un||t instanceof ai)&&t.input instanceof gr&&"zoom"===t.input.name&&(e=t);return e instanceof Ve||t.eachChild((t=>{const r=ns(t);r instanceof Ve?e=r:e&&r&&e!==r&&(e=new Ve("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));})),e}var is,ss,as=function(){if(ss)return is;ss=1,is=e;var t=3;function e(e,r,n){var i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var s=new Int32Array(this.arrayBuffer);e=s[0],this.d=(r=s[1])+2*(n=s[2]);for(var a=0;a<this.d*this.d;a++){var o=s[t+a],l=s[t+a+1];i.push(o===l?null:s.subarray(o,l));}var u=s[t+i.length+1];this.keys=s.subarray(s[t+i.length],u),this.bboxes=s.subarray(u),this.insert=this._insertReadonly;}else {this.d=r+2*n;for(var c=0;c<this.d*this.d;c++)i.push([]);this.keys=[],this.bboxes=[];}this.n=r,this.extent=e,this.padding=n,this.scale=r/e,this.uid=0;var h=n/r*e;this.min=-h,this.max=e+h;}return e.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i);},e.prototype._insertReadonly=function(){throw "Cannot insert into a GridIndex created from an ArrayBuffer."},e.prototype._insertCell=function(t,e,r,n,i,s){this.cells[i].push(s);},e.prototype.query=function(t,e,r,n,i){var s=this.min,a=this.max;if(t<=s&&e<=s&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);var o=[];return this._forEachCell(t,e,r,n,this._queryCell,o,{},i),o},e.prototype._queryCell=function(t,e,r,n,i,s,a,o){var l=this.cells[i];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===a[p]){var f=4*p;(o?o(c[f+0],c[f+1],c[f+2],c[f+3]):t<=c[f+2]&&e<=c[f+3]&&r>=c[f+0]&&n>=c[f+1])?(a[p]=!0,s.push(u[p])):a[p]=!1;}}},e.prototype._forEachCell=function(t,e,r,n,i,s,a,o){for(var l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=l;p<=c;p++)for(var f=u;f<=h;f++){var d=this.d*f+p;if((!o||o(this._convertFromCellCoord(p),this._convertFromCellCoord(f),this._convertFromCellCoord(p+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,d,s,a,o))return}},e.prototype._convertFromCellCoord=function(t){return (t-this.padding)/this.scale},e.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},e.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,r=t+this.cells.length+1+1,n=0,i=0;i<this.cells.length;i++)n+=this.cells[i].length;var s=new Int32Array(r+n+this.keys.length+this.bboxes.length);s[0]=this.extent,s[1]=this.n,s[2]=this.padding;for(var a=r,o=0;o<e.length;o++){var l=e[o];s[t+o]=a,s.set(l,a),a+=l.length;}return s[t+e.length]=a,s.set(this.keys,a),s[t+e.length+1]=a+=this.keys.length,s.set(this.bboxes,a),a+=this.bboxes.length,s.buffer},is}(),os=e(as);const ls={};function us(t,e,r={}){Object.defineProperty(t,"_classRegistryKey",{value:e,writable:!1}),ls[e]={klass:t,omit:r.omit||[]};}us(Object,"Object"),os.serialize=function(t,e){const r=t.toArrayBuffer();return e&&e.add(r),{buffer:r}},os.deserialize=function(t){return new os(t.buffer)},Object.defineProperty(os,"name",{value:"Grid"}),us(os,"Grid"),"undefined"!=typeof DOMMatrix&&us(DOMMatrix,"DOMMatrix"),us(Se,"Color"),us(Error,"Error"),us(Qe,"Formatted"),us(Je,"FormattedSection"),us(te,"AJAXError"),us(er,"ResolvedImage"),us(rs,"StylePropertyFunction"),us(Wi,"StyleExpression",{omit:["_evaluator"]}),us(we,"ImageId"),us(tr,"ImageVariant"),us(ts,"ZoomDependentExpression"),us(Qi,"ZoomConstantExpression"),us(gr,"CompoundExpression",{omit:["_evaluate"]});for(const t in zi)ls[zi[t]._classRegistryKey]||us(zi[t],`Expression${t}`);function cs(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function hs(t){return self.ImageBitmap&&t instanceof ImageBitmap}function ps(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(cs(t)||hs(t))return e&&e.add(t),t;if(ArrayBuffer.isView(t))return e&&e.add(t.buffer),t;if(t instanceof ImageData)return e&&e.add(t.data.buffer),t;if(Array.isArray(t)){const r=[];for(const n of t)r.push(ps(n,e));return r}if(t instanceof Map){const e={$name:"Map",entries:[]};for(const[r,n]of t.entries())e.entries.push(ps(r),ps(n));return e}if(t instanceof Set){const e={$name:"Set"};let r=0;for(const n of t.values())e[++r]=ps(n);return e}if(t instanceof DOMMatrix){const e={$name:"DOMMatrix"},r=["is2D","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","a","b","c","d","e","f"];for(const n of r)e[n]=t[n];return e}if("bigint"==typeof t)return {$name:"BigInt",value:t.toString()};if("object"==typeof t){const r=t.constructor,n=r._classRegistryKey;if(!n)throw new Error(`Can't serialize object of unregistered class "${r.name}".`);const i=r.serialize?r.serialize(t,e):{};if(!r.serialize){for(const r in t)t.hasOwnProperty(r)&&(ls[n].omit.indexOf(r)>=0||(i[r]=ps(t[r],e)));t instanceof Error&&(i.message=t.message);}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==n&&(i.$name=n),i}throw new Error("can't serialize object of type "+typeof t)}function fs(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||cs(t)||hs(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(fs);if("object"==typeof t){const e=t.$name||"Object";if("Map"===e){const e=t.entries||[],r=new Map;for(let t=0;t<e.length;t+=2)r.set(fs(e[t]),fs(e[t+1]));return r}if("Set"===e){const e=new Set;for(const r of Object.keys(t))"$name"!==r&&e.add(fs(t[r]));return e}if("DOMMatrix"===e){let e;return e=t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44],new DOMMatrix(e)}if("BigInt"===e)return BigInt(t.value);const{klass:r}=ls[e];if(!r)throw new Error(`Can't deserialize unregistered class "${e}".`);if(r.deserialize)return r.deserialize(t);const n=Object.create(r.prototype);for(const e of Object.keys(t))"$name"!==e&&(n[e]=fs(t[e]));return n}throw new Error("can't deserialize object of type "+typeof t)}const ds={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519,Osage:t=>t>=66736&&t<=66815,"CJK Unified Ideographs Extension B":t=>t>=131072&&t<=173791};function ms(t){for(const e of t)if(xs(e.charCodeAt(0)))return !0;return !1}function ys(t){for(const e of t)if(!gs(e.charCodeAt(0)))return !1;return !0}function gs(t){return !(ds.Arabic(t)||ds["Arabic Supplement"](t)||ds["Arabic Extended-A"](t)||ds["Arabic Presentation Forms-A"](t)||ds["Arabic Presentation Forms-B"](t))}function xs(t){return !(746!==t&&747!==t&&(t<4352||!(ds["Bopomofo Extended"](t)||ds.Bopomofo(t)||ds["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||ds["CJK Compatibility Ideographs"](t)||ds["CJK Compatibility"](t)||ds["CJK Radicals Supplement"](t)||ds["CJK Strokes"](t)||!(!ds["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||ds["CJK Unified Ideographs Extension A"](t)||ds["CJK Unified Ideographs"](t)||ds["Enclosed CJK Letters and Months"](t)||ds["Hangul Compatibility Jamo"](t)||ds["Hangul Jamo Extended-A"](t)||ds["Hangul Jamo Extended-B"](t)||ds["Hangul Jamo"](t)||ds["Hangul Syllables"](t)||ds.Hiragana(t)||ds["Ideographic Description Characters"](t)||ds.Kanbun(t)||ds["Kangxi Radicals"](t)||ds["Katakana Phonetic Extensions"](t)||ds.Katakana(t)&&12540!==t||!(!ds["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!ds["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||ds["Unified Canadian Aboriginal Syllabics"](t)||ds["Unified Canadian Aboriginal Syllabics Extended"](t)||ds["Vertical Forms"](t)||ds["Yijing Hexagram Symbols"](t)||ds["Yi Syllables"](t)||ds["Yi Radicals"](t))))}function vs(t){return !(xs(t)||function(t){return !!(ds["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||ds["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||ds["Letterlike Symbols"](t)||ds["Number Forms"](t)||ds["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||ds["Control Pictures"](t)&&9251!==t||ds["Optical Character Recognition"](t)||ds["Enclosed Alphanumerics"](t)||ds["Geometric Shapes"](t)||ds["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||ds["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||ds["CJK Symbols and Punctuation"](t)||ds.Katakana(t)||ds["Private Use Area"](t)||ds["CJK Compatibility Forms"](t)||ds["Small Form Variants"](t)||ds["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function bs(t){return ds.Arabic(t)||ds["Arabic Supplement"](t)||ds["Arabic Extended-A"](t)||ds["Arabic Presentation Forms-A"](t)||ds["Arabic Presentation Forms-B"](t)}function _s(t){return t>=1424&&t<=2303||ds["Arabic Presentation Forms-A"](t)||ds["Arabic Presentation Forms-B"](t)}function ws(t,e){return !(!e&&_s(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||ds.Khmer(t))}function Ms(t){for(const e of t)if(_s(e.charCodeAt(0)))return !0;return !1}const As="deferred",Is="loading",Ss="loaded";let Ps=null,Es="unavailable",zs=null;const ks=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(Es="error"),Ps&&Ps(t);};function Ts(){Bs.fire(new ge("pluginStateChange",{pluginStatus:Es,pluginURL:zs}));}const Bs=new _e,Vs=function(){return Es},Cs=function(){if(Es!==As||!zs)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Es=Is,Ts(),zs&&ne({url:zs},(t=>{t?ks(t):(Es=Ss,Ts());}));},Ds={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Es===Ss||null!=Ds.applyArabicShaping,isLoading:()=>Es===Is,setState(t){Es=t.pluginStatus,zs=t.pluginURL;},isParsed:()=>null!=Ds.applyArabicShaping&&null!=Ds.processBidirectionalText&&null!=Ds.processStyledBidirectionalText,getPluginURL:()=>zs};class Rs{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.transition=e.transition,this.pitch=e.pitch,this.brightness=e.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0);}isSupportedScript(t){return function(t,e){for(const r of t)if(!ws(r.charCodeAt(0),e))return !1;return !0}(t,Ds.isLoaded())}}class Ls{constructor(t,e,r,n){this.property=t,this.value=e,this.expression=function(t,e,r,n){if(ji(t))return new rs(t,e);if(Ki(t)||Array.isArray(t)&&t.length>0){const i=es(t,e,r,n);if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return i.value}{let r=t;return "string"==typeof t&&"color"===e.type&&(r=Se.parse(t)),{kind:"constant",configDependencies:new Set,evaluate:()=>r}}}(void 0===e?t.specification.default:e,t.specification,r,n);}isDataDriven(){return "source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}}class Fs{constructor(t,e,r){this.property=t,this.value=new Ls(t,void 0,e,r);}transitioned(t,e){return new Ns(this.property,this.value,e,nt({},t.transition,this.transition),t.now)}untransitioned(){return new Ns(this.property,this.value,null,{},0)}}class Os{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._scope=e,this._options=r,this.configDependencies=new Set;}getValue(t){return ct(this._values[t].value.value)}setValue(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Fs(this._values[t].property,this._scope,this._options)),this._values[t].value=new Ls(this._values[t].property,null===e?void 0:ct(e),this._scope,this._options),this._values[t].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[t].value.expression.configDependencies]));}setTransitionOrValue(t,e){e&&(this._options=e);const r=this._properties.properties;if(t)for(const e in t){const n=t[e];if(e.endsWith("-transition")){const t=e.slice(0,-11);r[t]&&this.setTransition(t,n);}else r.hasOwnProperty(e)&&this.setValue(e,n);}}getTransition(t){return ct(this._values[t].transition)}setTransition(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Fs(this._values[t].property)),this._values[t].transition=ct(e)||void 0;}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n);}return t}transitioned(t,e){const r=new Us(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(t,e._values[n]);return r}untransitioned(){const t=new Us(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class Ns{constructor(t,e,r,n,i){const s=n.delay||0,a=n.duration||0;i=i||0,this.property=t,this.value=e,this.begin=i+s,this.end=this.begin+a,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r);}possiblyEvaluate(t,e,r){const n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),s=this.prior;if(s){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return s.possiblyEvaluate(t,e,r);{const a=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(s.possiblyEvaluate(t,e,r),i,W(a))}}return i}}class Us{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);}possiblyEvaluate(t,e,r){const n=new $s(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return !0;return !1}}class js{constructor(t,e,r){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._scope=e,this._options=r,this.configDependencies=new Set;}getValue(t){return ct(this._values[t].value)}setValue(t,e){this._values[t]=new Ls(this._values[t].property,null===e?void 0:ct(e),this._scope,this._options),this._values[t].expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[t].expression.configDependencies]));}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r);}return t}possiblyEvaluate(t,e,r){const n=new $s(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class qs{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r;}isConstant(){return "constant"===this.value.kind}constantOr(t){return "constant"===this.value.kind?this.value.value:t}evaluate(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)}}class $s{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues);}get(t){return this._values[t]}}class Gs{constructor(t){this.specification=t;}possiblyEvaluate(t,e){return t.expression.evaluate(e)}interpolate(t,e,r){const n=Te[this.specification.type];return n?n(t,e,r):t}}class Ys{constructor(t,e){this.specification=t,this.overrides=e;}possiblyEvaluate(t,e,r,n){return new qs(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)}interpolate(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new qs(this,{kind:"constant",value:void 0},t.parameters);const n=Te[this.specification.type];return n?new qs(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t}evaluate(t,e,r,n,i,s){return "constant"===t.kind?t.value:t.evaluate(e,r,n,i,s)}}class Hs{constructor(t){this.specification=t;}possiblyEvaluate(t,e,r,n){return !!t.expression.evaluate(e,null,{},r,n)}interpolate(){return !1}}class Xs{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const e=new Rs(0,{});for(const r in t){const n=t[r];n.specification.overridable&&this.overridableProperties.push(r);const i=this.defaultPropertyValues[r]=new Ls(n,void 0),s=this.defaultTransitionablePropertyValues[r]=new Fs(n);this.defaultTransitioningPropertyValues[r]=s.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate(e);}}}us(Ys,"DataDrivenProperty"),us(Gs,"DataConstantProperty"),us(Hs,"ColorRampProperty");var Zs=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"fragment":{"type":"boolean"},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360},"pitch":{"type":"number","default":0},"light":{"type":"light"},"lights":{"required":false,"type":"array","value":"light-3d"},"terrain":{"type":"terrain","optional":true},"fog":{"type":"fog"},"snow":{"type":"snow","experimental":true},"rain":{"type":"rain","experimental":true},"camera":{"type":"camera"},"color-theme":{"type":"colorTheme"},"indoor":{"type":"indoor","experimental":true},"imports":{"type":"array","value":"import"},"iconsets":{"experimental":true,"type":"iconsets"},"schema":{"type":"schema"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"},"models":{"type":"models"},"featuresets":{"experimental":true,"type":"featuresets"}},"featuresets":{"experimental":true,"*":{"type":"featureset"}},"featureset":{"experimental":true,"metadata":{"experimental":true,"type":"*"},"selectors":{"experimental":true,"type":"array","value":"selector"}},"selector":{"experimental":true,"layer":{"experimental":true,"type":"string","required":true},"properties":{"experimental":true,"type":"selectorProperty","required":false},"featureNamespace":{"experimental":true,"type":"string","required":false},"_uniqueFeatureID":{"experimental":true,"type":"boolean","private":true,"required":false}},"selectorProperty":{"experimental":true,"*":{"experimental":true,"type":"*"}},"model":{"type":"string","required":true},"import":{"id":{"type":"string","required":true},"url":{"type":"string","required":true},"config":{"type":"config"},"data":{"type":"$root"},"color-theme":{"type":"colorTheme","optional":true}},"config":{"*":{"type":"*"}},"schema":{"*":{"type":"option"}},"option":{"default":{"type":"*","property-type":"data-constant","expression":{},"required":true},"type":{"type":"enum","values":{"string":1,"number":1,"boolean":1,"color":1}},"array":{"type":"boolean"},"minValue":{"type":"number"},"maxValue":{"type":"number"},"stepValue":{"type":"number"},"values":{"type":"array","value":"*"},"metadata":{"type":"*"}},"models":{"*":{"type":"model"}},"light-3d":{"id":{"type":"string","required":true},"properties":{"type":"properties"},"type":{"type":"enum","values":{"ambient":{},"directional":{},"flat":{}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"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},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"cast-shadows":{"type":"boolean","default":false,"property-type":"data-constant"},"shadow-quality":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"parameters":["zoom"]},"experimental":true},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"properties_light_ambient":{"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}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"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}},"iconsets":{"*":{"type":"iconset"}},"iconset":["iconset_sprite","iconset_source"],"iconset_sprite":{"type":{"required":true,"type":"enum","values":{"sprite":1}},"url":{"required":true,"type":"string"}},"iconset_source":{"type":{"required":true,"type":"enum","values":{"source":1}},"source":{"required":true,"type":"string"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":1}},"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":1,"tms":1},"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":1}},"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},"scheme":{"type":"enum","values":{"xyz":1,"tms":1},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":1}},"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},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":1,"mapbox":1},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_array":{"experimental":true,"type":{"required":true,"type":"enum","values":{"raster-array":1}},"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},"attribution":{"type":"string"},"rasterLayers":{"type":"*"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":1}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"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"},"dynamic":{"type":"boolean","default":false}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":1}},"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":1}},"url":{"required":false,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":1,"batched-model":1}},"maxzoom":{"type":"number","default":18},"minzoom":{"type":"number","default":0},"tiles":{"type":"array","value":"string"}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"raster-particle":{"experimental":true},"hillshade":{},"model":{"experimental":true},"background":{},"sky":{},"slot":{},"clip":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"slot":{"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_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"model-id":{"type":"string","default":"","property-type":"data-driven","expression":{"parameters":["zoom","feature"]}}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":1,"symbol":1},"default":[],"expression":{},"property-type":"data-constant"},"clip-layer-scope":{"type":"array","value":"string","default":[],"expression":{},"property-type":"data-constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-base":1,"hd-road-markup":1},"default":"none","experimental":true,"private":true,"expression":{},"property-type":"data-constant"},"fill-construct-bridge-guard-rail":{"type":"boolean","default":"true","experimental":true,"private":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"circle-elevation-reference":{"type":"enum","values":{"none":1,"hd-road-markup":1},"default":"none","experimental":true,"expression":{},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":1,"round":1,"square":1},"default":"butt","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":1,"round":1,"miter":1,"none":1},"default":"miter","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","experimental":true,"default":0,"expression":{"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"line-elevation-reference":{"type":"enum","values":{"none":1,"sea":1,"ground":1,"hd-road-markup":1},"default":"none","experimental":true,"expression":{},"property-type":"data-constant"},"line-cross-slope":{"type":"number","experimental":true,"expression":{},"property-type":"constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"},"line-width-unit":{"type":"enum","values":{"pixels":1,"meters":1},"default":"pixels","experimental":true,"private":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":1,"line":1,"line-center":1},"default":"point","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":1,"viewport-y":1,"source":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"symbol-elevation-reference":{"type":"enum","values":{"sea":1,"ground":1,"hd-road-markup":1},"default":"ground","experimental":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"experimental":true,"private":true,"expression":{},"property-type":"data-constant"},"icon-text-fit":{"type":"enum","values":{"none":1,"width":1,"height":1,"both":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":1,"viewport":1,"auto":1},"default":"auto","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size-scale-range":{"type":"array","value":"number","length":2,"default":[0.8,2],"minimum":0.1,"maximum":10,"experimental":true,"private":true,"expression":{},"property-type":"data-constant"},"text-max-width":{"type":"number","default":10,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":1,"left":1,"center":1,"right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","default":0,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":1,"left":1,"right":1,"top":1,"bottom":1,"top-left":1,"top-right":1,"bottom-left":1,"bottom-right":1},"default":"center","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":1,"vertical":1},"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":1,"uppercase":1,"lowercase":1},"default":"none","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","length":2,"default":[0,0],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":1,"none":1},"default":"visible","expression":{},"property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_hillshade":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_raster-particle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_clip":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_model":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"property-type":"data-driven","expression":{"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":1,"!=":1,">":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"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","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"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","measure-light"],"relaxZoomRestriction":true},"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","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.4,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","property-type":"data-constant","default":0.71,"minimum":0,"maximum":5,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.57,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","property-type":"data-constant","default":0.7,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","property-type":"data-constant","expression":{}}},"indoor":{"floorplanFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}},"buildingFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"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":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"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}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"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","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","experimental":true,"private":true,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature"]},"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","transition":true,"experimental":true,"private":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","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,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"flat","property-type":"data-constant"},"fill-extrusion-base-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"terrain","property-type":"data-constant"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true,"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","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","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],"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-trim-color":{"type":"color","experimental":true,"default":"transparent","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"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","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"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"],"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,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"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":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"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","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]},"experimental":true,"property-type":"data-constant"},"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"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"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","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"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"*"}}}');function Ws(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ks(t){if(Array.isArray(t))return t.map(Ks);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=Ks(t[r]);return e}return Ws(t)}function Js(t){if(!0===t||!1===t)return !0;if(!Array.isArray(t)||0===t.length)return !1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return !1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Js(e)&&"boolean"!=typeof e)return !1;return !0;default:return !0}}function Qs(t,e="",r=null,n="fill"){if(null==t)return {filter:()=>!0,needGeometry:!1,needFeature:!1};Js(t)||(t=aa(t));const i=t;let s=!0;try{s=function(t){if(!ra(t))return t;let e=Ks(t);return ea(e),e=ta(e),e}(i);}catch(t){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(i,null,2)}\n        `);}let a=null,o=null;if("background"!==n&&"sky"!==n&&"slot"!==n){o=Zs[`filter_${n}`];const t=Ji(s,o,e,r);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(e,r,n)=>t.value.evaluate(e,r,{},n);}let l=null,u=null;if(s!==i){const t=Ji(i,o,e,r);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));l=(e,r,n,i,s)=>t.value.evaluate(e,r,{},n,void 0,void 0,i,s),u=!Bn(t.value.expression);}return {filter:a,dynamicFilter:l||void 0,needGeometry:sa(s),needFeature:!!u}}function ta(t){if(!Array.isArray(t))return t;const e=function(t){if(na.has(t[0]))for(let e=1;e<t.length;e++)if(ra(t[e]))return !0;return t}(t);return !0===e?e:e.map((t=>ta(t)))}function ea(t){let e=!1;const r=[];if("case"===t[0]){for(let n=1;n<t.length-1;n+=2)e=e||ra(t[n]),r.push(t[n+1]);r.push(t[t.length-1]);}else if("match"===t[0]){e=e||ra(t[1]);for(let e=2;e<t.length-1;e+=2)r.push(t[e+1]);r.push(t[t.length-1]);}else if("step"===t[0]){e=e||ra(t[1]);for(let e=1;e<t.length-1;e+=2)r.push(t[e+1]);}e&&(t.length=0,t.push("any",...r));for(let e=1;e<t.length;e++)ea(t[e]);}function ra(t){if(!Array.isArray(t))return !1;if("pitch"===(e=t[0])||"distance-from-center"===e)return !0;var e;for(let e=1;e<t.length;e++)if(ra(t[e]))return !0;return !1}const na=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function ia(t,e){return t<e?-1:t>e?1:0}function sa(t){if(!Array.isArray(t))return !1;if("within"===t[0]||"distance"===t[0])return !0;for(let e=1;e<t.length;e++)if(sa(t[e]))return !0;return !1}function aa(t){if(!t)return !0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?oa(t[1],t[2],"=="):"!="===e?ca(oa(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?oa(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(aa))):"all"===e?["all"].concat(t.slice(1).map(aa)):"none"===e?["all"].concat(t.slice(1).map(aa).map(ca)):"in"===e?la(t[1],t.slice(2)):"!in"===e?ca(la(t[1],t.slice(2))):"has"===e?ua(t[1]):"!has"!==e||ca(ua(t[1]));var r;}function oa(t,e,r){switch(t){case"$type":return [`filter-type-${r}`,e];case"$id":return [`filter-id-${r}`,e];default:return [`filter-${r}`,t,e]}}function la(t,e){if(0===e.length)return !1;switch(t){case"$type":return ["filter-type-in",["literal",e]];case"$id":return ["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(ia)]]:["filter-in-small",t,["literal",e]]}}function ua(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function ca(t){return ["!",t]}const ha="";function pa(t,e){return e?`${t}${ha}${e}`:t}const fa="-transition",da=new Set(["fill","line","background","hillshade","raster"]);class ma extends _e{constructor(t,e,r,n,i){if(super(),this.id=t.id,this.fqid=pa(this.id,r),this.type=t.type,this.scope=r,this.lut=n,this.options=i,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,"custom"!==t.type){if(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type&&"background"!==t.type&&"sky"!==t.type&&"slot"!==t.type){this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter;const e=Ji(this.filter,Zs[`filter_${t.type}`]);"error"!==e.result&&(this.configDependencies=new Set([...this.configDependencies,...e.value.configDependencies]));}if(t.slot&&(this.slot=t.slot),e.layout&&(this._unevaluatedLayout=new js(e.layout,this.scope,i),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),e.paint){this._transitionablePaint=new Os(e.paint,this.scope,i);for(const e in t.paint)this.setPaintProperty(e,t.paint[e]);for(const e in t.layout)this.setLayoutProperty(e,t.layout[e]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new $s(e.paint);}}}onAdd(t){}onRemove(t){}isDraped(t){return !this.is3D(!0)&&da.has(this.type)}getLayoutProperty(t){return "visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e){if("custom"===this.type&&"visibility"===t)return void(this.visibility=e);const r=this._unevaluatedLayout;r._properties.properties[t]&&(r.setValue(t,e),this.configDependencies=new Set([...this.configDependencies,...r.configDependencies]),"visibility"===t&&this.possiblyEvaluateVisibility());}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}));}getPaintProperty(t){return t.endsWith(fa)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e){const r=this._transitionablePaint,n=r._properties.properties;if(t.endsWith(fa)){const i=t.slice(0,-11);return n[i]&&r.setTransition(i,e||void 0),!1}if(!n[t])return !1;const i=r._values[t],s=i.value.isDataDriven(),a=i.value;r.setValue(t,e),this.configDependencies=new Set([...this.configDependencies,...r.configDependencies]),this._handleSpecialPaintPropertyUpdate(t);const o=r._values[t].value,l=o.isDataDriven(),u=t.endsWith("pattern")||"line-dasharray"===t;return l||s||u||this._handleOverridablePaintPropertyUpdate(t,a,o)}_handleSpecialPaintPropertyUpdate(t){}getProgramIds(){return null}getDefaultProgramParams(t,e,r){return null}_handleOverridablePaintPropertyUpdate(t,e,r){return !1}isHidden(t){return !!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e);}serialize(){return ut({id:this.id,type:this.type,slot:this.slot,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()},((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}is3D(t){return !1}isSky(){return !1}isTileClipped(){return !1}hasOffscreenPass(){return !1}hasShadowPass(){return !1}canCastShadows(){return !1}hasLightBeamPass(){return !1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof qs&&Fi(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return !0}return !1}compileFilter(t){this._filterCompiled||(this._featureFilter=Qs(this.filter,this.scope,t),this._filterCompiled=!0);}invalidateCompiledFilter(){this._filterCompiled=!1;}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(t){this._stats&&("shadow"===t.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0);}queryRadius(t){}queryIntersectsFeature(t,e,r,n,i,s,a,o,l){}}const ya={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ga{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8;}}class xa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0);}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.add(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_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(t){this.reserve(t),this.length=t;}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e);}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...t){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...t){throw new Error("StructArray#emplaceBack() 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 va(t,e=1){let r=0,n=0;return {members:t.map((t=>{const i=ya[t.type].BYTES_PER_ELEMENT,s=r=ba(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:s}})),size:ba(r,Math.max(n,e)),alignment:e}}function ba(t,e){return Math.ceil(t/e)*e}class _a extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t}}_a.prototype.bytesPerElement=4,us(_a,"StructArrayLayout2i4");class wa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}wa.prototype.bytesPerElement=6,us(wa,"StructArrayLayout3i6");class Ma extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const s=4*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,t}}Ma.prototype.bytesPerElement=8,us(Ma,"StructArrayLayout4i8");class Aa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Aa.prototype.bytesPerElement=4,us(Aa,"StructArrayLayout1f4");class Ia extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=4*t,s=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.float32[s+1]=n,t}}Ia.prototype.bytesPerElement=8,us(Ia,"StructArrayLayout2i1f8");class Sa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=4*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}Sa.prototype.bytesPerElement=8,us(Sa,"StructArrayLayout3i8");class Pa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,n,i)}emplace(t,e,r,n,i,s){const a=5*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,this.int16[a+4]=s,t}}Pa.prototype.bytesPerElement=10,us(Pa,"StructArrayLayout5i10");class Ea extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,s,a)}emplace(t,e,r,n,i,s,a,o){const l=6*t,u=12*t,c=3*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=s,this.uint8[u+7]=a,this.float32[c+2]=o,t}}Ea.prototype.bytesPerElement=12,us(Ea,"StructArrayLayout2i4ub1f12");class za extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}za.prototype.bytesPerElement=12,us(za,"StructArrayLayout3f12");class ka extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,n,i)}emplace(t,e,r,n,i,s){const a=6*t,o=3*t;return this.uint16[a+0]=e,this.uint16[a+1]=r,this.uint16[a+2]=n,this.uint16[a+3]=i,this.float32[o+2]=s,t}}ka.prototype.bytesPerElement=12,us(ka,"StructArrayLayout4ui1f12");class Ta extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const s=4*t;return this.uint16[s+0]=e,this.uint16[s+1]=r,this.uint16[s+2]=n,this.uint16[s+3]=i,t}}Ta.prototype.bytesPerElement=8,us(Ta,"StructArrayLayout4ui8");class Ba extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,s)}emplace(t,e,r,n,i,s,a){const o=6*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,this.int16[o+4]=s,this.int16[o+5]=a,t}}Ba.prototype.bytesPerElement=12,us(Ba,"StructArrayLayout6i12");class Va extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u,c,h){const p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,s,a,o,l,u,c,h)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p){const f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=s,this.uint16[f+5]=a,this.uint16[f+6]=o,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t}}Va.prototype.bytesPerElement=24,us(Va,"StructArrayLayout4i4ui4i24");class Ca extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,s)}emplace(t,e,r,n,i,s,a){const o=10*t,l=5*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.float32[l+2]=i,this.float32[l+3]=s,this.float32[l+4]=a,t}}Ca.prototype.bytesPerElement=20,us(Ca,"StructArrayLayout3i3f20");class Da extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const s=4*t;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=n,this.float32[s+3]=i,t}}Da.prototype.bytesPerElement=16,us(Da,"StructArrayLayout4f16");class Ra extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Ra.prototype.bytesPerElement=4,us(Ra,"StructArrayLayout1ul4");class La extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t}}La.prototype.bytesPerElement=4,us(La,"StructArrayLayout2ui4");class Fa extends xa{_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(t,e,r,n,i,s,a,o,l,u,c,h,p){const f=this.length;return this.resize(f+1),this.emplace(f,t,e,r,n,i,s,a,o,l,u,c,h,p)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p,f){const d=20*t,m=10*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.int16[d+4]=s,this.float32[m+3]=a,this.float32[m+4]=o,this.float32[m+5]=l,this.float32[m+6]=u,this.int16[d+14]=c,this.uint32[m+8]=h,this.uint16[d+18]=p,this.uint16[d+19]=f,t}}Fa.prototype.bytesPerElement=40,us(Fa,"StructArrayLayout5i4f1i1ul2ui40");class Oa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,s,a)}emplace(t,e,r,n,i,s,a,o){const l=8*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+4]=i,this.int16[l+5]=s,this.int16[l+6]=a,this.int16[l+7]=o,t}}Oa.prototype.bytesPerElement=16,us(Oa,"StructArrayLayout3i2i2i16");class Na extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,n,i)}emplace(t,e,r,n,i,s){const a=4*t,o=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[o+6]=i,this.int16[o+7]=s,t}}Na.prototype.bytesPerElement=16,us(Na,"StructArrayLayout2f1f2i16");class Ua extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,s)}emplace(t,e,r,n,i,s,a){const o=20*t,l=5*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.float32[l+3]=s,this.float32[l+4]=a,t}}Ua.prototype.bytesPerElement=20,us(Ua,"StructArrayLayout2ub4f20");class ja extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t}}ja.prototype.bytesPerElement=6,us(ja,"StructArrayLayout3ui6");class qa extends xa{_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(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b){const _=this.length;return this.resize(_+1),this.emplace(_,t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b,_){const w=30*t,M=15*t,A=60*t;return this.int16[w+0]=e,this.int16[w+1]=r,this.int16[w+2]=n,this.float32[M+2]=i,this.float32[M+3]=s,this.uint16[w+8]=a,this.uint16[w+9]=o,this.uint32[M+5]=l,this.uint32[M+6]=u,this.uint32[M+7]=c,this.uint16[w+16]=h,this.uint16[w+17]=p,this.uint16[w+18]=f,this.float32[M+10]=d,this.float32[M+11]=m,this.uint8[A+48]=y,this.uint8[A+49]=g,this.uint8[A+50]=x,this.uint32[M+13]=v,this.int16[w+28]=b,this.uint8[A+58]=_,t}}qa.prototype.bytesPerElement=60,us(qa,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class $a extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b,_,w,M,A,I,S,P,E,z,k,T,B){const V=this.length;return this.resize(V+1),this.emplace(V,t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b,_,w,M,A,I,S,P,E,z,k,T,B)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b,_,w,M,A,I,S,P,E,z,k,T,B,V){const C=20*t,D=40*t,R=80*t;return this.float32[C+0]=e,this.float32[C+1]=r,this.int16[D+4]=n,this.int16[D+5]=i,this.int16[D+6]=s,this.int16[D+7]=a,this.int16[D+8]=o,this.int16[D+9]=l,this.int16[D+10]=u,this.int16[D+11]=c,this.int16[D+12]=h,this.uint16[D+13]=p,this.uint16[D+14]=f,this.uint16[D+15]=d,this.uint16[D+16]=m,this.uint16[D+17]=y,this.uint16[D+18]=g,this.uint16[D+19]=x,this.uint16[D+20]=v,this.uint16[D+21]=b,this.uint16[D+22]=_,this.uint16[D+23]=w,this.uint16[D+24]=M,this.uint16[D+25]=A,this.uint16[D+26]=I,this.uint16[D+27]=S,this.uint32[C+14]=P,this.float32[C+15]=E,this.float32[C+16]=z,this.float32[C+17]=k,this.float32[C+18]=T,this.uint8[R+76]=B,this.uint16[D+39]=V,t}}$a.prototype.bytesPerElement=80,us($a,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class Ga extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,n,i)}emplace(t,e,r,n,i,s){const a=5*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,this.float32[a+4]=s,t}}Ga.prototype.bytesPerElement=20,us(Ga,"StructArrayLayout5f20");class Ya extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,s,a)}emplace(t,e,r,n,i,s,a,o){const l=7*t;return this.float32[l+0]=e,this.float32[l+1]=r,this.float32[l+2]=n,this.float32[l+3]=i,this.float32[l+4]=s,this.float32[l+5]=a,this.float32[l+6]=o,t}}Ya.prototype.bytesPerElement=28,us(Ya,"StructArrayLayout7f28");class Ha extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u,c){const h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,n,i,s,a,o,l,u,c)}emplace(t,e,r,n,i,s,a,o,l,u,c,h){const p=11*t;return this.float32[p+0]=e,this.float32[p+1]=r,this.float32[p+2]=n,this.float32[p+3]=i,this.float32[p+4]=s,this.float32[p+5]=a,this.float32[p+6]=o,this.float32[p+7]=l,this.float32[p+8]=u,this.float32[p+9]=c,this.float32[p+10]=h,t}}Ha.prototype.bytesPerElement=44,us(Ha,"StructArrayLayout11f44");class Xa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,s,a,o,l)}emplace(t,e,r,n,i,s,a,o,l,u){const c=9*t;return this.float32[c+0]=e,this.float32[c+1]=r,this.float32[c+2]=n,this.float32[c+3]=i,this.float32[c+4]=s,this.float32[c+5]=a,this.float32[c+6]=o,this.float32[c+7]=l,this.float32[c+8]=u,t}}Xa.prototype.bytesPerElement=36,us(Xa,"StructArrayLayout9f36");class Za extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t}}Za.prototype.bytesPerElement=8,us(Za,"StructArrayLayout2f8");class Wa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const s=6*t;return this.uint32[3*t+0]=e,this.uint16[s+2]=r,this.uint16[s+3]=n,this.uint16[s+4]=i,t}}Wa.prototype.bytesPerElement=12,us(Wa,"StructArrayLayout1ul3ui12");class Ka extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}Ka.prototype.bytesPerElement=2,us(Ka,"StructArrayLayout1ui2");class Ja extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m){const y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y){const g=16*t;return this.float32[g+0]=e,this.float32[g+1]=r,this.float32[g+2]=n,this.float32[g+3]=i,this.float32[g+4]=s,this.float32[g+5]=a,this.float32[g+6]=o,this.float32[g+7]=l,this.float32[g+8]=u,this.float32[g+9]=c,this.float32[g+10]=h,this.float32[g+11]=p,this.float32[g+12]=f,this.float32[g+13]=d,this.float32[g+14]=m,this.float32[g+15]=y,t}}Ja.prototype.bytesPerElement=64,us(Ja,"StructArrayLayout16f64");class Qa extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,s,a)}emplace(t,e,r,n,i,s,a,o){const l=10*t,u=5*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.float32[u+2]=s,this.float32[u+3]=a,this.float32[u+4]=o,t}}Qa.prototype.bytesPerElement=20,us(Qa,"StructArrayLayout4ui3f20");class to extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.int16[1*t+0]=e,t}}to.prototype.bytesPerElement=2,us(to,"StructArrayLayout1i2");class eo extends xa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint8[1*t+0]=e,t}}eo.prototype.bytesPerElement=1,us(eo,"StructArrayLayout1ub1");class ro extends ga{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]}}ro.prototype.size=40;class no extends Fa{get(t){return new ro(this,t)}}us(no,"CollisionBoxArray");class io extends ga{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(t){this._structArray.uint8[this._pos1+49]=t;}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(t){this._structArray.uint8[this._pos1+50]=t;}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(t){this._structArray.uint32[this._pos4+13]=t;}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(t){this._structArray.uint8[this._pos1+58]=t;}}io.prototype.size=60;class so extends qa{get(t){return new io(this,t)}}us(so,"PlacedSymbolArray");class ao extends ga{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(t){this._structArray.uint32[this._pos4+14]=t;}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(t){this._structArray.float32[this._pos4+18]=t;}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}ao.prototype.size=80;class oo extends $a{get(t){return new ao(this,t)}}us(oo,"SymbolInstanceArray");class lo extends Aa{getoffsetX(t){return this.float32[1*t+0]}}us(lo,"GlyphOffsetArray");class uo extends _a{getx(t){return this.int16[2*t+0]}gety(t){return this.int16[2*t+1]}}us(uo,"SymbolLineVertexArray");class co extends ga{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]}}co.prototype.size=12;class ho extends Wa{get(t){return new co(this,t)}}us(ho,"FeatureIndexArray");class po extends La{geta_centroid_pos0(t){return this.uint16[2*t+0]}geta_centroid_pos1(t){return this.uint16[2*t+1]}}us(po,"FillExtrusionCentroidArray");class fo extends ga{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}fo.prototype.size=6;class mo extends wa{get(t){return new fo(this,t)}}us(mo,"FillExtrusionWallArray");const yo=va([{name:"a_pos",components:2,type:"Int16"}],4),go=va([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class xo{constructor(t=[]){this.segments=t;}_prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>xo.MAX_VERTEX_ARRAY_LENGTH&&pt(`Max vertices per segment is ${xo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>xo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e,primitiveOffset:r,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}prepareSegment(t,e,r,n){return this._prepareSegment(t,e.length,r.length,n)}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy();}static simpleSegment(t,e,r,n){return new xo([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function vo(t,e){return 256*(t=Q(Math.floor(t),0,255))+Q(Math.floor(e),0,255)}xo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,us(xo,"SegmentVector");const bo=va([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),_o=va([{name:"a_dash",components:4,type:"Uint16"}]);class wo{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1;}add(t,e,r,n){this.ids.push(Mo(t)),this.positions.push(e,r,n);}eachPosition(t,e){const r=Mo(t);let n=0,i=this.ids.length-1;for(;n<i;){const t=n+i>>1;this.ids[t]>=r?i=t:n=t+1;}for(;this.ids[n]===r;)e(this.positions[3*n],this.positions[3*n+1],this.positions[3*n+2]),n++;}static serialize(t,e){const r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return Ao(r,n,0,r.length-1),e&&(e.add(r.buffer),e.add(n.buffer)),{ids:r,positions:n}}static deserialize(t){const e=new wo;let r;e.ids=t.ids,e.positions=t.positions;for(const t of e.ids)t!==r&&e.uniqueIds.push(t),r=t;return e.indexed=!0,e}}function Mo(t){const e=+t;return !isNaN(e)&&Number.MIN_SAFE_INTEGER<=e&&e<=Number.MAX_SAFE_INTEGER?e:ye(String(t))}function Ao(t,e,r,n){for(;r<n;){const i=t[r+n>>1];let s=r-1,a=n+1;for(;;){do{s++;}while(t[s]<i);do{a--;}while(t[a]>i);if(s>=a)break;Io(t,s,a),Io(e,3*s,3*a),Io(e,3*s+1,3*a+1),Io(e,3*s+2,3*a+2);}a-r<n-a?(Ao(t,e,r,a),r=a+1):(Ao(t,e,a+1,n),n=a);}}function Io(t,e,r){const n=t[e];t[e]=t[r],t[r]=n;}us(wo,"FeaturePositionMap");class So{constructor(t){this.gl=t.gl,this.initialized=!1;}fetchUniformLocation(t,e){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(t,e),this.initialized=!0),!!this.location}set(t,e,r){throw new Error("Uniform#set() must be implemented by each concrete Uniform")}}class Po extends So{constructor(t){super(t),this.current=0;}set(t,e,r){this.fetchUniformLocation(t,e)&&this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r));}}class Eo extends So{constructor(t){super(t),this.current=0;}set(t,e,r){this.fetchUniformLocation(t,e)&&this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r));}}class zo extends So{constructor(t){super(t),this.current=[0,0];}set(t,e,r){this.fetchUniformLocation(t,e)&&(r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1])));}}class ko extends So{constructor(t){super(t),this.current=[0,0,0];}set(t,e,r){this.fetchUniformLocation(t,e)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2])));}}class To extends So{constructor(t){super(t),this.current=[0,0,0,0];}set(t,e,r){this.fetchUniformLocation(t,e)&&(r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3])));}}class Bo extends So{constructor(t){super(t),this.current=Se.transparent.toRenderColor(null);}set(t,e,r){this.fetchUniformLocation(t,e)&&(r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a)));}}const Vo=new Float32Array(16);class Co extends So{constructor(t){super(t),this.current=Vo;}set(t,e,r){if(this.fetchUniformLocation(t,e)){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let t=1;t<16;t++)if(r[t]!==this.current[t]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}}}const Do=new Float32Array(9),Ro=new Float32Array(4);class Lo extends So{constructor(t){super(t),this.current=Ro;}set(t,e,r){if(this.fetchUniformLocation(t,e))for(let t=0;t<4;t++)if(r[t]!==this.current[t]){this.current=r,this.gl.uniformMatrix2fv(this.location,!1,r);break}}}function Fo(t){return [vo(255*t.r,255*t.g),vo(255*t.b,255*t.a)]}class Oo{constructor(t,e,r,n){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=r,this.context=n;}setUniform(t,e,r,n,i){const s=n.constantOr(this.value);e.set(t,i,s instanceof Se?s.toRenderColor(this.lutExpression&&"none"===this.lutExpression.value?null:this.context.lut):s);}getBinding(t,e){return "color"===this.type?new Bo(t):new Eo(t)}}class No{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.pattern=null,this.pixelRatio=1;}setConstantPatternPositions(t){this.pixelRatio=t.pixelRatio||1,this.pattern=t.tl.concat(t.br);}setUniform(t,e,r,n,i){const s="u_pattern"===i||"u_dash"===i?this.pattern:"u_pixel_ratio"===i?this.pixelRatio:null;s&&e.set(t,i,s);}getBinding(t,e){return "u_pattern"===e||"u_dash"===e?new To(t):new Eo(t)}}class Uo{constructor(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n;}populatePaintArray(t,e,r,n,i,s,a){const o=this.paintVertexArray.length,l="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new Rs(0,{brightness:s}),e,{},i,n,a):"constant"===this.expression.kind&&this.expression.value,u=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new Rs(0,{brightness:s}),e,{},i,n,a):this.lutExpression.value);this.paintVertexArray.resize(t),this._setPaintValue(o,t,l,u?null:this.context.lut);}updatePaintArray(t,e,r,n,i,s,a){const o="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:a},r,n,void 0,i):"constant"===this.expression.kind&&this.expression.value,l=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new Rs(0,{brightness:a}),r,n,void 0,i):this.lutExpression.value);this._setPaintValue(t,e,o,l?null:this.context.lut);}_setPaintValue(t,e,r,n){if("color"===this.type){const i=Fo(r.toRenderColor(n));for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i[0],i[1]);}else {for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r));}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.lutExpression&&"constant"!==this.lutExpression.kind&&(this.lutExpression.isStateDependent||!this.lutExpression.isLightConstant)||"constant"!==this.expression.kind&&(this.expression.isStateDependent||!this.expression.isLightConstant)));}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();}}class jo{constructor(t,e,r,n,i,s){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=r,this.useIntegerZoom=n,this.context=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new s;}populatePaintArray(t,e,r,n,i,s,a){const o=this.expression.evaluate(new Rs(this.context.zoom,{brightness:s}),e,{},i,n,a),l=this.expression.evaluate(new Rs(this.context.zoom+1,{brightness:s}),e,{},i,n,a),u=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new Rs(0,{brightness:s}),e,{},i,n,a):this.lutExpression.value),c=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(c,t,o,l,u?null:this.context.lut);}updatePaintArray(t,e,r,n,i,s,a){const o=this.expression.evaluate({zoom:this.context.zoom,brightness:a},r,n,void 0,i),l=this.expression.evaluate({zoom:this.context.zoom+1,brightness:a},r,n,void 0,i),u=!!this.lutExpression&&"none"===("composite"===this.lutExpression.kind||"source"===this.lutExpression.kind?this.lutExpression.evaluate(new Rs(0,{brightness:a}),r,n,void 0,i):this.lutExpression.value);this._setPaintValue(t,e,o,l,u?null:this.context.lut);}_setPaintValue(t,e,r,n,i){if("color"===this.type){const n=Fo(r.toRenderColor(i)),s=Fo(r.toRenderColor(i));for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,n[0],n[1],s[0],s[1]);}else {for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n));}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant));}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();}setUniform(t,e,r,n,i){const s=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,a=Q(this.expression.interpolationFactor(s,this.context.zoom,this.context.zoom+1),0,1);e.set(t,i,a);}getBinding(t,e){return new Eo(t)}}class qo{constructor(t,e,r,n,i){this.expression=t,this.layerId=i,this.paintVertexAttributes=("array"===r?_o:bo).members;for(let t=0;t<e.length;++t);this.paintVertexArray=new n;}populatePaintArray(t,e,r,n){const i=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],r);}updatePaintArray(t,e,r,n,i,s,a){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],s);}_setPaintValues(t,e,r,n){if(!n||!r)return;const i=n[r];if(!i)return;const{tl:s,br:a,pixelRatio:o}=i;for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,s[0],s[1],a[0],a[1],o);}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent||!this.expression.isLightConstant));}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();}}class $o{constructor(t,e,r=(()=>!0)){this.binders={},this._buffers=[],this.context=e;const n=[];for(const i in t.paint._values){const s=t.paint.get(i);if(i.endsWith("-use-theme"))continue;if(!r(i))continue;if(!(s instanceof qs&&Fi(s.property.specification)))continue;const a=Ho(i,t.type),o=s.value,l=s.property.specification.type,u=!!s.property.useIntegerZoom,c="line-dasharray"===i||i.endsWith("pattern"),h=t.paint.get(`${i}-use-theme`),p="line-dasharray"===i&&"constant"!==t.layout.get("line-cap").value.kind||h&&"constant"!==h.value.kind;if("constant"!==o.kind||p)if("source"===o.kind||p||c){const e=Wo(i,l,"source");this.binders[i]=c?new qo(o,a,l,e,t.id):new Uo(o,a,l,e),n.push(`/a_${i}`);}else {const t=Wo(i,l,"composite");this.binders[i]=new jo(o,a,l,u,e,t),n.push(`/z_${i}`);}else this.binders[i]=c?new No(o.value,a):new Oo(o.value,a,l,e),n.push(`/u_${i}`);h&&(this.binders[i].lutExpression=h.value);}this.cacheKey=n.sort().join("");}getMaxValue(t){const e=this.binders[t];return e instanceof Uo||e instanceof jo?e.maxValue:0}populatePaintArrays(t,e,r,n,i,s,a){for(const o in this.binders){const l=this.binders[o];l.context=this.context,(l instanceof Uo||l instanceof jo||l instanceof qo)&&l.populatePaintArray(t,e,r,n,i,s,a);}}setConstantPatternPositions(t){for(const e in this.binders){const r=this.binders[e];r instanceof No&&r.setConstantPatternPositions(t);}}updatePaintArrays(t,e,r,n,i,s,a,o,l){let u=!1;const c=Object.keys(t),h=0!==c.length&&!o,p=h?c:e.uniqueIds;this.context.lut=i.lut;for(const o in this.binders){const c=this.binders[o];if(c.context=this.context,(c instanceof Uo||c instanceof jo||c instanceof qo)&&c.expression&&c.expression.kind&&"constant"!==c.expression.kind&&(!0===c.expression.isStateDependent||!1===c.expression.isLightConstant)){const f=i.paint.get(o);c.expression=f.value;for(const r of p){const i=t[r.toString()];e.eachPosition(r,((t,e,r)=>{const o=n.feature(t);c.updatePaintArray(e,r,o,i,s,a,l);}));}if(!h)for(const e of r.uniqueIds){const i=t[e.toString()];r.eachPosition(e,((t,e,r)=>{const o=n.feature(t);c.updatePaintArray(e,r,o,i,s,a,l);}));}u=!0;}}return u}defines(){const t=[];for(const e in this.binders){const r=this.binders[e];(r instanceof Oo||r instanceof No)&&t.push(...r.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)));}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof Uo||r instanceof jo||r instanceof qo)for(let e=0;e<r.paintVertexAttributes.length;e++)t.push(r.paintVertexAttributes[e].name);}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof Oo||r instanceof No||r instanceof jo)for(const e of r.uniformNames)t.push(e);}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t){const e=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Oo||n instanceof No||n instanceof jo)for(const i of n.uniformNames)e.push({name:i,property:r,binding:n.getBinding(t,i)});}return e}setUniforms(t,e,r,n,i){for(const{name:e,property:s,binding:a}of r)this.binders[s].setUniform(t,a,i,n.get(s),e);}updatePaintBuffers(){this._buffers=[];for(const t in this.binders){const e=this.binders[t];(e instanceof Uo||e instanceof jo||e instanceof qo)&&e.paintVertexBuffer&&this._buffers.push(e.paintVertexBuffer);}}upload(t){for(const e in this.binders){const r=this.binders[e];(r instanceof Uo||r instanceof jo||r instanceof qo)&&r.upload(t);}this.updatePaintBuffers();}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Uo||e instanceof jo||e instanceof qo)&&e.destroy();}}}class Go{constructor(t,e,r=(()=>!0)){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new $o(n,e,r);this.needsUpload=!1,this._featureMap=new wo,this._featureMapWithoutIds=new wo,this._bufferOffset=0,this._idlessCounter=0;}populatePaintArrays(t,e,r,n,i,s,a,o){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,e,n,i,s,a,o);void 0!==e.id?this._featureMap.add(e.id,r,this._bufferOffset,t):(this._featureMapWithoutIds.add(this._idlessCounter,r,this._bufferOffset,t),this._idlessCounter+=1),this._bufferOffset=t,this.needsUpload=!0;}updatePaintArrays(t,e,r,n,i,s,a){for(const o of r)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,this._featureMapWithoutIds,e,o,n,i,s,a||0)||this.needsUpload;}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1;}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy();}}const Yo={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"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"],"symbol-z-offset":["z_offset"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function Ho(t,e){return Yo[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}const Xo={"line-pattern":{source:ka,composite:ka},"fill-pattern":{source:ka,composite:ka},"fill-extrusion-pattern":{source:ka,composite:ka},"line-dasharray":{source:Ta,composite:Ta}},Zo={color:{source:Za,composite:Da},number:{source:Aa,composite:Za}};function Wo(t,e,r){const n=Xo[t];return n&&n[r]||Zo[e][r]}us(Oo,"ConstantBinder"),us(No,"PatternConstantBinder"),us(Uo,"SourceExpressionBinder"),us(qo,"PatternCompositeBinder"),us(jo,"CompositeExpressionBinder"),us($o,"ProgramConfiguration",{omit:["_buffers"]}),us(Go,"ProgramConfigurationSet");const Ko=Kr/Math.PI/2,Jo=5,Qo=6,tl=16383,el=64,rl=[el,32,16],nl=-Ko,il=Ko;function sl(t,e,r,n=Ko){return r=H(r),[t*Math.sin(r)*n,-e*n,t*Math.cos(r)*n]}function al(t,e,r){return sl(Math.cos(H(t)),Math.sin(H(t)),e,r)}const ol=6371008.8,ll=2*Math.PI*ol;class ul{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ul(et(this.lng,-180,180),this.lat)}toArray(){return [this.lng,this.lat]}toString(){return `LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return ol*Math.acos(Math.min(i,1))}toBounds(t=0){const e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new cl({lng:this.lng-r,lat:this.lat-e},{lng:this.lng+r,lat:this.lat+e})}toEcef(t){return al(this.lat,this.lng,Ko+t*Ko/ol)}static convert(t){if(t instanceof ul)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new ul(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new ul(Number("lng"in t?t.lng:t.lon),Number(t.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>]")}}class cl{constructor(t,e){if(t)if(e)this.setSouthWest(t).setNorthEast(e);else if(4===t.length){const e=t;this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]);}else {const e=t;this.setSouthWest(e[0]).setNorthEast(e[1]);}}setNorthEast(t){return this._ne=t instanceof ul?new ul(t.lng,t.lat):ul.convert(t),this}setSouthWest(t){return this._sw=t instanceof ul?new ul(t.lng,t.lat):ul.convert(t),this}extend(t){const e=this._sw,r=this._ne;let n,i;if(t instanceof ul)n=t,i=t;else {if(!(t instanceof cl))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(cl.convert(t)):this.extend(ul.convert(t)):"object"==typeof t&&null!==t&&t.hasOwnProperty("lat")&&(t.hasOwnProperty("lon")||t.hasOwnProperty("lng"))?this.extend(ul.convert(t)):this;if(n=t._sw,i=t._ne,!n||!i)return this}return e||r?(e.lng=Math.min(n.lng,e.lng),e.lat=Math.min(n.lat,e.lat),r.lng=Math.max(i.lng,r.lng),r.lat=Math.max(i.lat,r.lat)):(this._sw=new ul(n.lng,n.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(t){const{lng:e,lat:r}=ul.convert(t);let n=this._sw.lng<=e&&e<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(t){if(t)return t instanceof cl?t:new cl(t)}}const hl=0,pl=25.5;function fl(t){return ll*Math.cos(t*Math.PI/180)}function dl(t){return (180+t)/360}function ml(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function yl(t,e){return t/fl(e)}function gl(t){return 360*t-180}function xl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function vl(t,e){return t*fl(xl(e))}const bl=85.051129;function _l(t){return Math.cos(H(Q(t,-bl,bl)))}function wl(t,e){const r=Q(e,hl,pl),n=Math.pow(2,r);return _l(t)*ll/(512*n)}function Ml(t){return 1/Math.cos(t*Math.PI/180)}function Al(t,e=0){const r=Math.exp(Math.PI*(1-(t.y+e/Kr)/(1<<t.z)*2));return 80150034*r/(r*r+1)/Kr/(1<<t.z)}class Il{constructor(t,e,r=0){this.x=+t,this.y=+e,this.z=+r;}static fromLngLat(t,e=0){const r=ul.convert(t);return new Il(dl(r.lng),ml(r.lat),yl(e,r.lat))}toLngLat(){return new ul(gl(this.x),xl(this.y))}toAltitude(){return vl(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ll*Ml(xl(this.y))}}function Sl(t,e,r,n,i,s,a,o,l){const u=(e+n)/2,c=(r+i)/2,h=new q(u,c);o(h),function(t,e,r,n,i,s){const a=r-i,o=n-s;return Math.abs((n-e)*a-(r-t)*o)/Math.hypot(a,o)}(h.x,h.y,s.x,s.y,a.x,a.y)>=l?(Sl(t,e,r,u,c,s,h,o,l),Sl(t,u,c,n,i,h,a,o,l)):t.push(a);}function Pl(t,e,r){let n=t[0],i=n.x,s=n.y;e(n);const a=[n];for(let o=1;o<t.length;o++){const l=t[o],{x:u,y:c}=l;e(l),Sl(a,i,s,u,c,n,l,e,r),i=u,s=c,n=l;}return a}function El(t,e,r,n){if(n(e,r)){const i=e.add(r)._mult(.5);El(t,e,i,n),El(t,i,r,n);}else t.push(r);}function zl(t,e){let r=t[0];const n=[r];for(let i=1;i<t.length;i++){const s=t[i];El(n,r,s,e),r=s;}return n}const kl=Math.pow(2,14)-1,Tl=-kl-1;function Bl(t,e){const r=Math.round(t.x*e),n=Math.round(t.y*e);return t.x=Q(r,Tl,kl),t.y=Q(n,Tl,kl),(r<t.x||r>t.x+1||n<t.y||n>t.y+1)&&pt("Geometry exceeds allowed extent, reduce your vector tile buffer size"),t}function Vl(t,e,r){const n=t.loadGeometry(),i=t.extent,s=Kr/i;if(e&&r&&r.projection.isReprojectedInTileSpace){const s=1<<e.z,{scale:a,x:o,y:l,projection:u}=r,c=t=>{const r=gl((e.x+t.x/i)/s),n=xl((e.y+t.y/i)/s),c=u.project(r,n);t.x=(c.x*a-o)*i,t.y=(c.y*a-l)*i;};for(let e=0;e<n.length;e++)if(1!==t.type)n[e]=Pl(n[e],c,1);else {const t=[];for(const r of n[e])r.x<0||r.x>=i||r.y<0||r.y>=i||(c(r),t.push(r));n[e]=t;}}for(const t of n)for(const e of t)Bl(e,s);return n}function Cl(t,e){return {type:t.type,id:t.id,properties:t.properties,geometry:e?Vl(t):[]}}function Dl(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}function Rl(t,e,r){const n=16384;t.emplaceBack(e.x,e.y,e.z,r[0]*n,r[1]*n,r[2]*n);}class Ll{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.projection=t.projection,this.layoutVertexArray=new _a,this.indexArray=new ja,this.segments=new xo,this.programConfigurations=new Go(t.layers,{zoom:t.zoom,lut:t.lut}),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id));}updateFootprints(t,e){}populate(t,e,r,n){const i=this.layers[0],s=[];let a=null;"circle"===i.type&&(a=i.layout.get("circle-sort-key"));for(const{feature:e,id:i,index:o,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,u=Cl(e,t);if(!this.layers[0]._featureFilter.filter(new Rs(this.zoom),u,r))continue;const c=a?a.evaluate(u,{},r):void 0,h={id:i,properties:e.properties,type:e.type,sourceLayerIndex:l,index:o,geometry:t?u.geometry:Vl(e,r,n),patterns:{},sortKey:c};s.push(h);}a&&s.sort(((t,e)=>t.sortKey-e.sortKey));let o=null;"globe"===n.projection.name&&(this.globeExtVertexArray=new Ba,o=n.projection);for(const n of s){const{geometry:i,index:s,sourceLayerIndex:a}=n,l=t[s].feature;this.addFeature(n,i,s,e.availableImages,r,o,e.brightness),e.featureIndex.insert(l,i,s,a,this.index);}}update(t,e,r,n,i,s,a){this.programConfigurations.updatePaintArrays(t,e,i,r,n,s,a);}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return !this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,yo.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,go.members))),this.programConfigurations.upload(t),this.uploaded=!0;}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy());}addFeature(t,e,r,n,i,s,a){for(const r of e)for(const e of r){const r=e.x,n=e.y;if(r<0||r>=Kr||n<0||n>=Kr)continue;if(s){const t=s.projectTilePoint(r,n,i),e=s.upVector(i,r,n),a=this.globeExtVertexArray;Rl(a,t,e),Rl(a,t,e),Rl(a,t,e),Rl(a,t,e);}const a=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),o=a.vertexLength;Dl(this.layoutVertexArray,r,n,-1,-1),Dl(this.layoutVertexArray,r,n,1,-1),Dl(this.layoutVertexArray,r,n,1,1),Dl(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(o,o+1,o+2),this.indexArray.emplaceBack(o,o+2,o+3),a.vertexLength+=4,a.primitiveLength+=2;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n,i,a);}}function Fl(t,e){for(let r=0;r<t.length;r++)if(Hl(e,t[r]))return !0;for(let r=0;r<e.length;r++)if(Hl(t,e[r]))return !0;return !!jl(t,e)}function Ol(t,e,r){return !!Hl(t,e)||!!$l(e,t,r)}function Nl(t,e){if(1===t.length)return Yl(e,t[0]);for(let r=0;r<e.length;r++){const n=e[r];for(let e=0;e<n.length;e++)if(Hl(t,n[e]))return !0}for(let r=0;r<t.length;r++)if(Yl(e,t[r]))return !0;for(let r=0;r<e.length;r++)if(jl(t,e[r]))return !0;return !1}function Ul(t,e,r){if(t.length>1){if(jl(t,e))return !0;for(let n=0;n<e.length;n++)if($l(e[n],t,r))return !0}for(let n=0;n<t.length;n++)if($l(t[n],e,r))return !0;return !1}function jl(t,e){if(0===t.length||0===e.length)return !1;for(let r=0;r<t.length-1;r++){const n=t[r],i=t[r+1];for(let t=0;t<e.length-1;t++)if(ql(n,i,e[t],e[t+1]))return !0}return !1}function ql(t,e,r,n){return ft(t,r,n)!==ft(e,r,n)&&ft(t,e,r)!==ft(t,e,n)}function $l(t,e,r){const n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(let r=1;r<e.length;r++)if(Gl(t,e[r-1],e[r])<n)return !0;return !1}function Gl(t,e,r){const n=e.distSqr(r);if(0===n)return t.distSqr(e);const i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function Yl(t,e){let r,n,i,s=!1;for(let a=0;a<t.length;a++){r=t[a];for(let t=0,a=r.length-1;t<r.length;a=t++)n=r[t],i=r[a],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(s=!s);}return s}function Hl(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){const s=t[n],a=t[i];s.y>e.y!=a.y>e.y&&e.x<(a.x-s.x)*(e.y-s.y)/(a.y-s.y)+s.x&&(r=!r);}return r}function Xl(t,e,r,n,i){for(const s of t)if(e<=s.x&&r<=s.y&&n>=s.x&&i>=s.y)return !0;const s=[new q(e,r),new q(e,i),new q(n,i),new q(n,r)];if(t.length>2)for(const e of s)if(Hl(t,e))return !0;for(let e=0;e<t.length-1;e++)if(Zl(t[e],t[e+1],s))return !0;return !1}function Zl(t,e,r){const n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return !1;const s=ft(t,e,r[0]);return s!==ft(t,e,r[1])||s!==ft(t,e,r[2])||s!==ft(t,e,r[3])}function Wl(t,e,r,n,i,s){let a=e.y-t.y,o=t.x-e.x;if(s=s||0){const t=a*a+o*o;if(0===t)return !0;const e=Math.sqrt(t);a/=e,o/=e;}return !((r.x-t.x)*a+(r.y-t.y)*o-s<0||(n.x-t.x)*a+(n.y-t.y)*o-s<0||(i.x-t.x)*a+(i.y-t.y)*o-s<0)}function Kl(t,e,r,n,i,s,a){return !(Wl(t,e,n,i,s,a)||Wl(e,r,n,i,s,a)||Wl(r,t,n,i,s,a)||Wl(n,i,t,e,r,a)||Wl(i,s,t,e,r,a)||Wl(s,n,t,e,r,a))}function Jl(t,e,r){const n=e.paint.get(t).value;return "constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Ql(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function tu(t,e,r,n,i){if(!e[0]&&!e[1])return t;const s=q.convert(e)._mult(i);"viewport"===r&&s._rotate(-n);const a=[];for(let e=0;e<t.length;e++)a.push(t[e].sub(s));return a}function eu(t,e,r,n){const i=q.convert(t)._mult(n);return "viewport"===e&&i._rotate(-r),i}let ru,nu;us(Ll,"CircleBucket",{omit:["layers"]});var iu,su={exports:{}},au=(iu||(iu=1,function(t,e){!function(t){function e(t,e,n){var i=r(256*t,256*(e=Math.pow(2,n)-e-1),n),s=r(256*(t+1),256*(e+1),n);return i[0]+","+i[1]+","+s[0]+","+s[1]}function r(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return [t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}t.getURL=function(t,r,n,i,s,a){return a=a||{},t+"?"+["bbox="+e(n,i,s),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+r].join("&")},t.getTileBBox=e,t.getMercCoords=r,Object.defineProperty(t,"__esModule",{value:!0});}(e);}(0,su.exports)),su.exports);class ou{constructor(t,e,r){this.z=t,this.x=e,this.y=r,this.key=cu(0,t,t,e,r);}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e){const r=au.getTileBBox(this.x,this.y,this.z),n=function(t,e,r){let n,i="";for(let s=t;s>0;s--)n=1<<s-1,i+=(e&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.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"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)}toString(){return `${this.z}/${this.x}/${this.y}`}}class lu{constructor(t,e){this.wrap=t,this.canonical=e,this.key=cu(t,e.z,e.z,e.x,e.y);}}class uu{constructor(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new ou(r,+n,+i),this.key=0===e&&t===r?this.canonical.key:cu(e,t,r,n,i);}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){const e=this.canonical.z-t;return t>this.canonical.z?new uu(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new uu(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e=!0){if(this.overscaledZ===t&&e)return this.key;if(t>this.canonical.z)return cu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y);{const r=this.canonical.z-t;return cu(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)}}isChildOf(t){if(t.wrap!==this.wrap)return !1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.z<this.canonical.z&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return [new uu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return [new uu(e,this.wrap,e,r,n),new uu(e,this.wrap,e,r+1,n),new uu(e,this.wrap,e,r,n+1),new uu(e,this.wrap,e,r+1,n+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new uu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new uu(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new lu(this.wrap,this.canonical)}toString(){return `${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function cu(t,e,r,n,i){const s=1<<Math.min(r,22);let a=s*(i%s)+n%s;return t&&r<22&&(a+=s*s*((t<0?-2*t-1:2*t)%(1<<2*(22-r)))),16*(32*a+r)+(e-r)}const hu=[t=>{let e=t.canonical.x-1,r=t.wrap;return e<0&&(e=(1<<t.canonical.z)-1,r--),new uu(t.overscaledZ,r,t.canonical.z,e,t.canonical.y)},t=>{let e=t.canonical.x+1,r=t.wrap;return e===1<<t.canonical.z&&(e=0,r++),new uu(t.overscaledZ,r,t.canonical.z,e,t.canonical.y)},t=>new uu(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,(0===t.canonical.y?1<<t.canonical.z:t.canonical.y)-1),t=>new uu(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y===(1<<t.canonical.z)-1?0:t.canonical.y+1)];us(ou,"CanonicalTileID"),us(uu,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const pu=va([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:fu}=pu,du=va([{name:"a_pos_3",components:3,type:"Int16"}]);var mu=va([{name:"a_pos",type:"Int16",components:2}]);class yu{constructor(t,e){this.pos=t,this.dir=e;}intersectsPlane(t,e,r){const n=O.vec2.dot(e,this.dir);if(Math.abs(n)<1e-6)return !1;const i=((t[0]-this.pos[0])*e[0]+(t[1]-this.pos[1])*e[1])/n;return r[0]=this.pos[0]+this.dir[0]*i,r[1]=this.pos[1]+this.dir[1]*i,!0}}class gu{constructor(t,e){this.pos=t,this.dir=e;}intersectsPlane(t,e,r){const n=O.vec3.dot(e,this.dir);if(Math.abs(n)<1e-6)return !1;const i=((t[0]-this.pos[0])*e[0]+(t[1]-this.pos[1])*e[1]+(t[2]-this.pos[2])*e[2])/n;return r[0]=this.pos[0]+this.dir[0]*i,r[1]=this.pos[1]+this.dir[1]*i,r[2]=this.pos[2]+this.dir[2]*i,!0}closestPointOnSphere(t,e,r){if(O.vec3.equals(this.pos,t)||0===e)return r[0]=r[1]=r[2]=0,!1;const[n,i,s]=this.dir,a=this.pos[0]-t[0],o=this.pos[1]-t[1],l=this.pos[2]-t[2],u=n*n+i*i+s*s,c=2*(a*n+o*i+l*s),h=c*c-4*u*(a*a+o*o+l*l-e*e);if(h<0){const t=Math.max(-c/2,0),u=a+n*t,h=o+i*t,p=l+s*t,f=Math.hypot(u,h,p);return r[0]=u*e/f,r[1]=h*e/f,r[2]=p*e/f,!1}{const t=(-c-Math.sqrt(h))/(2*u);if(t<0){const t=Math.hypot(a,o,l);return r[0]=a*e/t,r[1]=o*e/t,r[2]=l*e/t,!1}return r[0]=a+n*t,r[1]=o+i*t,r[2]=l+s*t,!0}}}class xu{constructor(t,e,r,n,i){this.TL=t,this.TR=e,this.BR=r,this.BL=n,this.horizon=i;}static fromInvProjectionMatrix(t,e,r){const n=[-1,1,1],i=[1,1,1],s=[1,-1,1],a=[-1,-1,1],o=O.vec3.transformMat4(n,n,t),l=O.vec3.transformMat4(i,i,t),u=O.vec3.transformMat4(s,s,t),c=O.vec3.transformMat4(a,a,t);return new xu(o,l,u,c,e/r)}}function vu(t,e,r){let n=1/0,i=-1/0;const s=[];for(const a of t){O.vec3.sub(s,a,e);const t=O.vec3.dot(s,r);n=Math.min(n,t),i=Math.max(i,t);}return [n,i]}function bu(t,e){let r=!0;for(let n=0;n<t.planes.length;n++){const i=t.planes[n];let s=0;for(let t=0;t<e.length;t++)s+=O.vec3.dot(i,e[t])+i[3]>=0;if(0===s)return 0;s!==e.length&&(r=!1);}return r?2:1}function _u(t,e){for(const r of t.projections){const n=vu(e,t.points[0],r.axis);if(r.projection[1]<n[0]||r.projection[0]>n[1])return 0}return 1}function wu(t,e){let r=0;const n=[0,0,0,0];for(let i=0;i<t.length;i++)n[0]=t[i][0],n[1]=t[i][1],n[2]=t[i][2],n[3]=1,O.vec4.dot(n,e)>=0&&r++;return r}class Mu{constructor(t,e){this.points=t||new Array(8).fill([0,0,0]),this.planes=e||new Array(6).fill([0,0,0,0]),this.bounds=Au.fromPoints(this.points),this.projections=[],this.frustumEdges=[O.vec3.sub([],this.points[2],this.points[3]),O.vec3.sub([],this.points[0],this.points[3]),O.vec3.sub([],this.points[4],this.points[0]),O.vec3.sub([],this.points[5],this.points[1]),O.vec3.sub([],this.points[6],this.points[2]),O.vec3.sub([],this.points[7],this.points[3])];for(const t of this.frustumEdges){const e=[0,-t[2],t[1]],r=[t[2],0,-t[0]];this.projections.push({axis:e,projection:vu(this.points,this.points[0],e)}),this.projections.push({axis:r,projection:vu(this.points,this.points[0],r)});}}static fromInvProjectionMatrix(t,e,r,n){const i=Math.pow(2,r),s=[[-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((r=>{const s=O.vec4.transformMat4([],r,t),a=1/s[3]/e*i;return O.vec4.mul(s,s,[a,a,n?1/s[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=O.vec3.sub([],s[t[0]],s[t[1]]),r=O.vec3.sub([],s[t[2]],s[t[1]]),n=O.vec3.normalize([],O.vec3.cross([],e,r)),i=-O.vec3.dot(n,s[t[1]]);return n.concat(i)})),o=[];for(let t=0;t<s.length;t++)o.push([s[t][0],s[t][1],s[t][2]]);return new Mu(o,a)}intersectsPrecise(t,e,r){for(let r=0;r<e.length;r++)if(!wu(t,e[r]))return 0;for(let e=0;e<this.planes.length;e++)if(!wu(t,this.planes[e]))return 0;for(const e of r)for(const r of this.frustumEdges){const n=O.vec3.cross([],e,r),i=O.vec3.length(n);if(0===i)continue;O.vec3.scale(n,n,1/i);const s=vu(this.points,this.points[0],n),a=vu(t,this.points[0],n);if(s[0]>a[1]||a[0]>s[1])return 0}return 1}containsPoint(t){for(const e of this.planes){const r=e[3];if(O.vec3.dot([e[0],e[1],e[2]],t)+r<0)return !1}return !0}}class Au{static fromPoints(t){const e=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(const n of t)O.vec3.min(e,e,n),O.vec3.max(r,r,n);return new Au(e,r)}static fromTileIdAndHeight(t,e,r){const n=1<<t.canonical.z,i=t.canonical.x,s=t.canonical.y;return new Au([i/n,s/n,e],[(i+1)/n,(s+1)/n,r])}static applyTransform(t,e){const r=t.getCorners();for(let t=0;t<r.length;++t)O.vec3.transformMat4(r[t],r[t],e);return Au.fromPoints(r)}static applyTransformFast(t,e){const r=[e[12],e[13],e[14]],n=[...r];for(let i=0;i<3;i++)for(let s=0;s<3;s++){const a=e[4*s+i],o=a*t.min[s],l=a*t.max[s];r[i]+=Math.min(o,l),n[i]+=Math.max(o,l);}return new Au(r,n)}static projectAabbCorners(t,e){const r=t.getCorners();for(let t=0;t<r.length;++t)O.vec3.transformMat4(r[t],r[t],e);return r}constructor(t,e){this.min=t,this.max=e,this.center=O.vec3.scale([],O.vec3.add([],this.min,this.max),.5);}quadrant(t){const e=[t%2==0,t<2],r=O.vec3.clone(this.min),n=O.vec3.clone(this.max);for(let t=0;t<e.length;t++)r[t]=e[t]?this.min[t]:this.center[t],n[t]=e[t]?this.center[t]:this.max[t];return n[2]=this.max[2],new Au(r,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}distanceZ(t){return Math.max(Math.min(this.max[2],t[2]),this.min[2])-t[2]}getCorners(){const t=this.min,e=this.max;return [[t[0],t[1],t[2]],[e[0],t[1],t[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],e[2]],[t[0],e[1],e[2]]]}intersects(t){return this.intersectsAabb(t.bounds)?bu(t,this.getCorners()):0}intersectsFlat(t){return this.intersectsAabb(t.bounds)?bu(t,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsPrecise(t,e){return e||this.intersects(t)?_u(t,this.getCorners()):0}intersectsPreciseFlat(t,e){return e||this.intersectsFlat(t)?_u(t,[[this.min[0],this.min[1],0],[this.max[0],this.min[1],0],[this.max[0],this.max[1],0],[this.min[0],this.max[1],0]]):0}intersectsAabb(t){for(let e=0;e<3;++e)if(this.min[e]>t.max[e]||t.min[e]>this.max[e])return !1;return !0}intersectsAabbXY(t){return !(this.min[0]>t.max[0]||t.min[0]>this.max[0]||this.min[1]>t.max[1]||t.min[1]>this.max[1])}encapsulate(t){for(let e=0;e<3;e++)this.min[e]=Math.min(this.min[e],t.min[e]),this.max[e]=Math.max(this.max[e],t.max[e]);}encapsulatePoint(t){for(let e=0;e<3;e++)this.min[e]=Math.min(this.min[e],t[e]),this.max[e]=Math.max(this.max[e],t[e]);}closestPoint(t){return [Math.max(Math.min(this.max[0],t[0]),this.min[0]),Math.max(Math.min(this.max[1],t[1]),this.min[1]),Math.max(Math.min(this.max[2],t[2]),this.min[2])]}}function Iu(t){return t*Ko/ol}us(Au,"Aabb");const Su=[new Au([nl,nl,nl],[il,il,il]),new Au([nl,nl,nl],[0,0,il]),new Au([0,nl,nl],[il,0,il]),new Au([nl,0,nl],[0,il,il]),new Au([0,0,nl],[il,il,il])];function Pu(t,e,r,n=!0){const i=O.vec3.scale([],t._camera.position,t.worldSize),s=[e,r,1,1];O.vec4.transformMat4(s,s,t.pixelMatrixInverse),O.vec4.scale(s,s,1/s[3]);const a=O.vec3.sub([],s,i),o=O.vec3.normalize([],a),l=t.globeMatrix,u=[l[12],l[13],l[14]],c=O.vec3.sub([],u,i),h=O.vec3.length(c),p=O.vec3.normalize([],c),f=t.worldSize/(2*Math.PI),d=O.vec3.dot(p,o),m=Math.asin(f/h);if(m<Math.acos(d)){if(!n)return null;const t=[],e=[];O.vec3.scale(t,o,h/d),O.vec3.normalize(e,O.vec3.sub(e,t,c)),O.vec3.normalize(o,O.vec3.add(o,c,O.vec3.scale(o,e,Math.tan(m)*h)));}const y=[];new gu(i,o).closestPointOnSphere(u,f,y);const g=O.vec3.normalize([],vt(l,0)),x=O.vec3.normalize([],vt(l,1)),v=O.vec3.normalize([],vt(l,2)),b=O.vec3.dot(g,y),_=O.vec3.dot(x,y),w=O.vec3.dot(v,y),M=X(Math.asin(-_/f));let A=X(Math.atan2(b,w));A=t.center.lng+function(t,e){const r=(e-t+180)%360-180;return r<-180?r+360:r}(t.center.lng,A);const I=dl(A),S=Q(ml(M),0,1);return new Il(I,S)}class Eu{constructor(t,e,r){this.a=O.vec3.sub([],t,r),this.b=O.vec3.sub([],e,r),this.center=r;const n=O.vec3.normalize([],this.a),i=O.vec3.normalize([],this.b);this.angle=Math.acos(O.vec3.dot(n,i));}}function zu(t,e){if(0===t.angle)return null;let r;return r=0===t.a[e]?1/t.angle*.5*Math.PI:1/t.angle*Math.atan(t.b[e]/t.a[e]/Math.sin(t.angle)-1/Math.tan(t.angle)),r<0||r>1?null:function(t,e,r,n){const i=Math.sin(r);return t*(Math.sin((1-n)*r)/i)+e*(Math.sin(n*r)/i)}(t.a[e],t.b[e],t.angle,Q(r,0,1))+t.center[e]}function ku(t){if(t.z<=1)return Su[t.z+2*t.y+t.x];const e=Du(Cu(t));return Au.fromPoints(e)}function Tu(t,e,r){return O.vec3.scale(t,t,1-r),O.vec3.scaleAndAdd(t,t,e,r)}function Bu(t,e,r){for(const n of t)O.vec3.transformMat4(n,n,e),O.vec3.scale(n,n,r);}function Vu(t,e,r,n){const i=e/t.worldSize,s=t.globeMatrix;if(r.z<=1){const t=ku(r).getCorners();return Bu(t,s,i),Au.fromPoints(t)}const a=Cu(r,n),o=Du(a,Ko+Iu(t._tileCoverLift));Bu(o,s,i);const l=Number.MAX_VALUE,u=[-l,-l,-l],c=[l,l,l];if(a.contains(t.center)){for(const t of o)O.vec3.min(c,c,t),O.vec3.max(u,u,t);u[2]=0;const e=t.point,r=[e.x*i,e.y*i,0];return O.vec3.min(c,c,r),O.vec3.max(u,u,r),new Au(c,u)}if(t._tileCoverLift>0){for(const t of o)O.vec3.min(c,c,t),O.vec3.max(u,u,t);return new Au(c,u)}const h=[s[12]*i,s[13]*i,s[14]*i],p=a.getCenter(),f=Q(t.center.lat,-bl,bl),d=Q(p.lat,-bl,bl),m=dl(t.center.lng),y=ml(f);let g=m-dl(p.lng);const x=y-ml(d);g>.5?g-=1:g<-.5&&(g+=1);let v=0;if(Math.abs(g)>Math.abs(x))v=g>=0?1:3;else {v=x>=0?0:2;const t=[s[4]*i,s[5]*i,s[6]*i],e=-Math.sin(H(x>=0?a.getSouth():a.getNorth()))*Ko;O.vec3.scaleAndAdd(h,h,t,e);}const b=o[v],_=o[(v+1)%4],w=new Eu(b,_,h),M=[zu(w,0)||b[0],zu(w,1)||b[1],zu(w,2)||b[2]],A=$u(t.zoom);if(A>0){const n=function({x:t,y:e,z:r},n,i,s,a){const o=1/(1<<r);let l=t*o,u=l+o,c=e*o,h=c+o,p=0;const f=(l+u)/2-s;return f>.5?p=-1:f<-.5&&(p=1),l=((l+p)*n-(s*=n))*i+s,u=((u+p)*n-s)*i+s,c=(c*n-(a*=n))*i+a,h=(h*n-a)*i+a,[[l,h,0],[u,h,0],[u,c,0],[l,c,0]]}(r,e,t._pixelsPerMercatorPixel,m,y);for(let t=0;t<o.length;t++)Tu(o[t],n[t],A);const i=O.vec3.add([],n[v],n[(v+1)%4]);O.vec3.scale(i,i,.5),Tu(M,i,A);}for(const t of o)O.vec3.min(c,c,t),O.vec3.max(u,u,t);return c[2]=Math.min(b[2],_[2]),O.vec3.min(c,c,M),O.vec3.max(u,u,M),new Au(c,u)}function Cu({x:t,y:e,z:r},n=!1){const i=1/(1<<r),s=new ul(gl(t*i),e===(1<<r)-1&&n?-90:xl((e+1)*i)),a=new ul(gl((t+1)*i),0===e&&n?90:xl(e*i));return new cl(s,a)}function Du(t,e=Ko){const r=H(t.getNorth()),n=H(t.getSouth()),i=Math.cos(r),s=Math.cos(n),a=Math.sin(r),o=Math.sin(n),l=t.getWest(),u=t.getEast();return [sl(s,o,l,e),sl(s,o,u,e),sl(i,a,u,e),sl(i,a,l,e)]}function Ru(t,e,r,n){const i=1<<r.z,s=(t/Kr+r.x)/i;return al(xl((e/Kr+r.y)/i),gl(s),n)}function Lu({min:t,max:e}){return tl/Math.max(e[0]-t[0],e[1]-t[1],e[2]-t[2])}const Fu=new Float64Array(16);function Ou(t){const e=Lu(t),r=O.mat4.fromScaling(Fu,[e,e,e]);return O.mat4.translate(r,r,O.vec3.negate([],t.min))}function Nu(t){const e=O.mat4.fromTranslation(Fu,t.min),r=1/Lu(t);return O.mat4.scale(e,e,[r,r,r])}function Uu(t){const e=Kr/(2*Math.PI);return t/(2*Math.PI)/e}function ju(t,e){return Kr/(512*Math.pow(2,t))*Lu(ku(e))}function qu(t,e,r,n,i){const s=Uu(r),a=[t,e,-r/(2*Math.PI)],o=O.mat4.identity(new Float64Array(16));return O.mat4.translate(o,o,a),O.mat4.scale(o,o,[s,s,s]),O.mat4.rotateX(o,o,H(-i)),O.mat4.rotateY(o,o,H(-n)),o}function $u(t){return tt(Jo,Qo,t)}function Gu(t,e){const r=al(e.lat,e.lng),n=function(t){const e=al(t._center.lat,t._center.lng),r=O.vec3.fromValues(0,1,0);let n=O.vec3.cross([],r,e);const i=O.mat4.fromRotation([],-t.angle,e);n=O.vec3.transformMat4(n,n,i),O.mat4.fromRotation(i,-t._pitch,n);const s=O.vec3.normalize([],e);return O.vec3.scale(s,s,Iu(t.cameraToCenterDistance/t.pixelsPerMeter)),O.vec3.transformMat4(s,s,i),O.vec3.add([],e,s)}(t),i=O.vec3.subtract([],n,r);return O.vec3.angle(i,r)}function Yu(t,e){return Gu(t,e)>Math.PI/2*1.01}const Hu=H(85),Xu=Math.cos(Hu),Zu=Math.sin(Hu),Wu=O.mat4.create(),Ku=t=>{const e=[];return "map"===t.paint.get("circle-pitch-alignment")&&e.push("PITCH_WITH_MAP"),"map"===t.paint.get("circle-pitch-scale")&&e.push("SCALE_WITH_MAP"),e};function Ju(t,e,r,n,i,s,a,o,l){if(s&&t.queryGeometry.isAboveHorizon)return !1;s&&(l*=t.pixelToTileUnitsFactor);const u=t.tileID.canonical,c=r.projection.upVectorScale(u,r.center.lat,r.worldSize).metersToTile;for(const h of e)for(const e of h){const h=e.add(o),p=i&&r.elevation?r.elevation.exaggeration()*i.getElevationAt(h.x,h.y,!0):0,f=r.projection.projectTilePoint(h.x,h.y,u);if(p>0){const t=r.projection.upVector(u,h.x,h.y);f.x+=t[0]*c*p,f.y+=t[1]*c*p,f.z+=t[2]*c*p;}const d=s?h:Qu(f.x,f.y,f.z,n),m=s?t.tilespaceRays.map((t=>rc(t,p))):t.queryGeometry.screenGeometry,y=O.vec4.transformMat4([],[f.x,f.y,f.z,1],n);if(!a&&s?l*=y[3]/r.cameraToCenterDistance:a&&!s&&(l*=r.cameraToCenterDistance/y[3]),s){const t=xl((e.y/Kr+u.y)/(1<<u.z));l/=r.projection.pixelsPerMeter(t,1)/yl(1,t);}if(Ol(m,d,l))return !0}return !1}function Qu(t,e,r,n){const i=O.vec4.transformMat4([],[t,e,r,1],n);return new q(i[0]/i[3],i[1]/i[3])}const tc=O.vec3.fromValues(0,0,0),ec=O.vec3.fromValues(0,0,1);function rc(t,e){const r=O.vec3.create();return tc[2]=e,t.intersectsPlane(tc,ec,r),new q(r[0],r[1])}class nc extends Ll{}let ic,sc,ac,oc;function lc(t,{width:e,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(e*r*n);return t.width=e,t.height=r,t.data=i,t}function uc(t,e,r){const{width:n,height:i}=e;n===t.width&&i===t.height||(cc(t,e,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r,null),t.width=n,t.height=i,t.data=e.data);}function cc(t,e,r,n,i,s,a,o){if(0===i.width||0===i.height)return e;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 source coordinates for image copy");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 destination coordinates for image copy");const l=t.data,u=e.data,c=4===s&&o;for(let o=0;o<i.height;o++){const h=((r.y+o)*t.width+r.x)*s,p=((n.y+o)*e.width+n.x)*s;if(c)for(let t=0;t<i.width;t++){const e=h+t*s+3,r=p+t*s;u[r+0]=255,u[r+1]=255,u[r+2]=255,u[r+3]=l[e];}else if(a)for(let t=0;t<i.width;t++){const e=h+t*s,r=p+t*s,n=l[e+3],i=new Se(l[e+0]/255*n,l[e+1]/255*n,l[e+2]/255*n,n).toRenderColor(a).toArray();u[r+0]=i[0],u[r+1]=i[1],u[r+2]=i[2],u[r+3]=i[3];}else for(let t=0;t<i.width*s;t++)u[p+t]=l[h+t];}return e}us(nc,"HeatmapBucket",{omit:["layers"]});class hc{constructor(t,e){lc(this,t,1,e);}resize(t){uc(this,new hc(t),1);}clone(){return new hc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){cc(t,e,r,n,i,1,null);}}class pc{constructor(t,e){lc(this,t,4,e);}resize(t){uc(this,new pc(t),4);}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t;}clone(){return new pc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i,s,a){cc(t,e,r,n,i,4,s,a);}}class fc{constructor(t,e){this.width=t.width,this.height=t.height,this.data=e instanceof Uint8Array?new Float32Array(e.buffer):e;}}function dc(t){const e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new pc({width:r,height:n}),s=(r,n,s)=>{e[t.evaluationKey]=s;const a=t.expression.evaluate(e);a&&(i.data[r+n+0]=Math.floor(255*a.r/a.a),i.data[r+n+1]=Math.floor(255*a.g/a.a),i.data[r+n+2]=Math.floor(255*a.b/a.a),i.data[r+n+3]=Math.floor(255*a.a));};if(t.clips)for(let e=0,i=0;e<n;++e,i+=4*r)for(let n=0,a=0;n<r;n++,a+=4){const o=n/(r-1),{start:l,end:u}=t.clips[e];s(i,a,l*(1-o)+u*o);}else for(let t=0,e=0;t<r;t++,e+=4)s(0,e,t/(r-1));return i}us(hc,"AlphaImage"),us(pc,"RGBAImage");const mc=va([{name:"a_pos",components:2,type:"Int16"}],4),yc=va([{name:"a_road_z_offset",components:1,type:"Float32"}],4),gc=va([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),xc=va([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);function vc(t,e,r=2){const n=e&&e.length,i=n?e[0]*r:t.length;let s=bc(t,0,i,r,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u;if(n&&(s=function(t,e,r,n){const i=[];for(let r=0,s=e.length;r<s;r++){const a=bc(t,e[r]*n,r<s-1?e[r+1]*n:t.length,n,!1);a===a.next&&(a.steiner=!0),i.push(Tc(a));}i.sort(Pc);for(let t=0;t<i.length;t++)r=Ec(i[t],r);return r}(t,e,s,r)),t.length>80*r){o=1/0,l=1/0;let e=-1/0,n=-1/0;for(let s=r;s<i;s+=r){const r=t[s],i=t[s+1];r<o&&(o=r),i<l&&(l=i),r>e&&(e=r),i>n&&(n=i);}u=Math.max(e-o,n-l),u=0!==u?32767/u:0;}return wc(s,a,r,o,l,u,0),a}function bc(t,e,r,n,i){let s;if(i===function(t,e,r,n){let i=0;for(let s=e,a=r-n;s<r;s+=n)i+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return i}(t,e,r,n)>0)for(let i=e;i<r;i+=n)s=Uc(i/n|0,t[i],t[i+1],s);else for(let i=r-n;i>=e;i-=n)s=Uc(i/n|0,t[i],t[i+1],s);return s&&Dc(s,s.next)&&(jc(s),s=s.next),s}function _c(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!Dc(n,n.next)&&0!==Cc(n.prev,n,n.next))n=n.next;else {if(jc(n),n=e=n.prev,n===n.next)break;r=!0;}}while(r||n!==e);return e}function wc(t,e,r,n,i,s,a){if(!t)return;!a&&s&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=kc(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let s=null;for(e=0;i;){e++;let a=i,o=0;for(let t=0;t<r&&(o++,a=a.nextZ,a);t++);let l=r;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||i.z<=a.z)?(n=i,i=i.nextZ,o--):(n=a,a=a.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;i=a;}s.nextZ=null,r*=2;}while(e>1)}(i);}(t,n,i,s);let o=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(s?Ac(t,n,i,s):Mc(t))e.push(l.i,t.i,u.i),jc(t),t=u.next,o=u.next;else if((t=u)===o){a?1===a?wc(t=Ic(_c(t),e),e,r,n,i,s,2):2===a&&Sc(t,e,r,n,i,s):wc(_c(t),e,r,n,i,s,1);break}}}function Mc(t){const e=t.prev,r=t,n=t.next;if(Cc(e,r,n)>=0)return !1;const i=e.x,s=r.x,a=n.x,o=e.y,l=r.y,u=n.y,c=i<s?i<a?i:a:s<a?s:a,h=o<l?o<u?o:u:l<u?l:u,p=i>s?i>a?i:a:s>a?s:a,f=o>l?o>u?o:u:l>u?l:u;let d=n.next;for(;d!==e;){if(d.x>=c&&d.x<=p&&d.y>=h&&d.y<=f&&Bc(i,o,s,l,a,u,d.x,d.y)&&Cc(d.prev,d,d.next)>=0)return !1;d=d.next;}return !0}function Ac(t,e,r,n){const i=t.prev,s=t,a=t.next;if(Cc(i,s,a)>=0)return !1;const o=i.x,l=s.x,u=a.x,c=i.y,h=s.y,p=a.y,f=o<l?o<u?o:u:l<u?l:u,d=c<h?c<p?c:p:h<p?h:p,m=o>l?o>u?o:u:l>u?l:u,y=c>h?c>p?c:p:h>p?h:p,g=kc(f,d,e,r,n),x=kc(m,y,e,r,n);let v=t.prevZ,b=t.nextZ;for(;v&&v.z>=g&&b&&b.z<=x;){if(v.x>=f&&v.x<=m&&v.y>=d&&v.y<=y&&v!==i&&v!==a&&Bc(o,c,l,h,u,p,v.x,v.y)&&Cc(v.prev,v,v.next)>=0)return !1;if(v=v.prevZ,b.x>=f&&b.x<=m&&b.y>=d&&b.y<=y&&b!==i&&b!==a&&Bc(o,c,l,h,u,p,b.x,b.y)&&Cc(b.prev,b,b.next)>=0)return !1;b=b.nextZ;}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=m&&v.y>=d&&v.y<=y&&v!==i&&v!==a&&Bc(o,c,l,h,u,p,v.x,v.y)&&Cc(v.prev,v,v.next)>=0)return !1;v=v.prevZ;}for(;b&&b.z<=x;){if(b.x>=f&&b.x<=m&&b.y>=d&&b.y<=y&&b!==i&&b!==a&&Bc(o,c,l,h,u,p,b.x,b.y)&&Cc(b.prev,b,b.next)>=0)return !1;b=b.nextZ;}return !0}function Ic(t,e){let r=t;do{const n=r.prev,i=r.next.next;!Dc(n,i)&&Rc(n,r,r.next,i)&&Oc(n,i)&&Oc(i,n)&&(e.push(n.i,r.i,i.i),jc(r),jc(r.next),r=t=i),r=r.next;}while(r!==t);return _c(r)}function Sc(t,e,r,n,i,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&Vc(a,t)){let o=Nc(a,t);return a=_c(a,a.next),o=_c(o,o.next),wc(a,e,r,n,i,s,0),void wc(o,e,r,n,i,s,0)}t=t.next;}a=a.next;}while(a!==t)}function Pc(t,e){return t.x-e.x}function Ec(t,e){const r=function(t,e){let r=e;const n=t.x,i=t.y;let s,a=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=n&&t>a&&(a=t,s=r.x<r.next.x?r:r.next,t===n))return s}r=r.next;}while(r!==e);if(!s)return null;const o=s,l=s.x,u=s.y;let c=1/0;r=s;do{if(n>=r.x&&r.x>=l&&n!==r.x&&Bc(i<u?n:a,i,l,u,i<u?a:n,i,r.x,r.y)){const e=Math.abs(i-r.y)/(n-r.x);Oc(r,t)&&(e<c||e===c&&(r.x>s.x||r.x===s.x&&zc(s,r)))&&(s=r,c=e);}r=r.next;}while(r!==o);return s}(t,e);if(!r)return e;const n=Nc(r,t);return _c(n,n.next),_c(r,r.next)}function zc(t,e){return Cc(t.prev,t,e.prev)<0&&Cc(e.next,t,t.next)<0}function kc(t,e,r,n,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Tc(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;}while(e!==t);return r}function Bc(t,e,r,n,i,s,a,o){return (i-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(n-o)>=(r-a)*(e-o)&&(r-a)*(s-o)>=(i-a)*(n-o)}function Vc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Rc(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&(Oc(t,e)&&Oc(e,t)&&function(t,e){let r=t,n=!1;const i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;}while(r!==t);return n}(t,e)&&(Cc(t.prev,t,e.prev)||Cc(t,e.prev,e))||Dc(t,e)&&Cc(t.prev,t,t.next)>0&&Cc(e.prev,e,e.next)>0)}function Cc(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Dc(t,e){return t.x===e.x&&t.y===e.y}function Rc(t,e,r,n){const i=Fc(Cc(t,e,r)),s=Fc(Cc(t,e,n)),a=Fc(Cc(r,n,t)),o=Fc(Cc(r,n,e));return i!==s&&a!==o||!(0!==i||!Lc(t,r,e))||!(0!==s||!Lc(t,n,e))||!(0!==a||!Lc(r,t,n))||!(0!==o||!Lc(r,e,n))}function Lc(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Fc(t){return t>0?1:t<0?-1:0}function Oc(t,e){return Cc(t.prev,t,t.next)<0?Cc(t,e,t.next)>=0&&Cc(t,t.prev,e)>=0:Cc(t,e,t.prev)<0||Cc(t,t.next,e)<0}function Nc(t,e){const r=qc(t.i,t.x,t.y),n=qc(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Uc(t,e,r,n){const i=qc(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function jc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ);}function qc(t,e,r){return {i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function $c(t,e){const r=t.length;if(r<=1)return [t];const n=[];let i,s;for(let e=0;e<r;e++){const r=dt(t[e]);0!==r&&(t[e].area=Math.abs(r),void 0===s&&(s=r<0),s===r<0?(i&&n.push(i),i=[t[e]]):i.push(t[e]));}if(i&&n.push(i),e>1)for(let t=0;t<n.length;t++)n[t].length<=e||(br(n[t],e,1,n[t].length-1,Gc),n[t]=n[t].slice(0,e));return n}function Gc(t,e){return e.area-t.area}function Yc(t,e,r=1){if(!t)return null;const n="string"==typeof t?er.from(t).getPrimary():t.getPrimary(),i=n.id.toString();return e.has(i)||e.set(i,[]),n.scaleSelf(r),e.get(i).push(n),n.toString()}function Hc(t,e,r,n){const i=n.patternDependencies;let s=!1;for(const n of e){const e=n.paint.get(`${t}-pattern`);e.isConstant()||(s=!0),Yc(e.constantOr(null),i,r)&&(s=!0);}return s}function Xc(t,e,r,n,i,s){const a=s.patternDependencies;for(const o of e){const e=o.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n},r,{},s.availableImages);t=t&&t.name?t.name:t;const l=Yc(t,a,i);l&&(r.patterns[o.id]=l);}}return r}var Zc,Wc,Kc,Jc,Qc,th,eh,rh={};function nh(){if(Wc)return Zc;Wc=1;var t=j();function e(t,e,n,i,s){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=s,t.readFields(r,this,e);}function r(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i;}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos);}function n(t){for(var e,r,n=0,i=0,s=t.length,a=s-1;i<s;a=i++)n+=((r=t[a]).x-(e=t[i]).x)*(e.y+r.y);return n}return Zc=e,e.types=["Unknown","Point","LineString","Polygon"],e.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var r,n=e.readVarint()+e.pos,i=1,s=0,a=0,o=0,l=[];e.pos<n;){if(s<=0){var u=e.readVarint();i=7&u,s=u>>3;}if(s--,1===i||2===i)a+=e.readSVarint(),o+=e.readSVarint(),1===i&&(r&&l.push(r),r=[]),r.push(new t(a,o));else {if(7!==i)throw new Error("unknown command "+i);r&&r.push(r[0].clone());}}return r&&l.push(r),l},e.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,s=0,a=1/0,o=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3;}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>o&&(o=i),(s+=t.readSVarint())<l&&(l=s),s>u&&(u=s);else if(7!==r)throw new Error("unknown command "+r)}return [a,l,o,u]},e.prototype.toGeoJSON=function(t,r,i){var s,a,o=this.extent*Math.pow(2,i),l=this.extent*t,u=this.extent*r,c=this.loadGeometry(),h=e.types[this.type];function p(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+l)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+u)/o)*Math.PI/180))-90];}}switch(this.type){case 1:var f=[];for(s=0;s<c.length;s++)f[s]=c[s][0];p(c=f);break;case 2:for(s=0;s<c.length;s++)p(c[s]);break;case 3:for(c=function(t){var e=t.length;if(e<=1)return [t];for(var r,i,s=[],a=0;a<e;a++){var o=n(t[a]);0!==o&&(void 0===i&&(i=o<0),i===o<0?(r&&s.push(r),r=[t[a]]):r.push(t[a]));}return r&&s.push(r),s}(c),s=0;s<c.length;s++)for(a=0;a<c[s].length;a++)p(c[s][a]);}1===c.length?c=c[0]:h="Multi"+h;var d={type:"Feature",geometry:{type:h,coordinates:c},properties:this.properties};return "id"in this&&(d.id=this.id),d},Zc}function ih(){if(Jc)return Kc;Jc=1;var t=nh();function e(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(r,this,e),this.length=this._features.length;}function r(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null;}return e}(r));}return Kc=e,e.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 r=this._pbf.readVarint()+this._pbf.pos;return new t(this._pbf,r,this.extent,this._keys,this._values)},Kc}function sh(){return eh||(eh=1,rh.VectorTile=function(){if(th)return Qc;th=1;var t=ih();function e(e,r,n){if(3===e){var i=new t(n,n.readVarint()+n.pos);i.length&&(r[i.name]=i);}}return Qc=function(t,r){this.layers=t.readFields(e,{},r);},Qc}(),rh.VectorTileFeature=nh(),rh.VectorTileLayer=ih()),rh}var ah=sh();const oh="3d_elevation_id",lh="level";class uh{constructor(){this._valid=!1;}reset(t){return this.feature=t,this._valid=!0,this._geometry=t.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=!1),this}geometry(t,e){return this._valid&&t(e(this._geometry)),this}require(t,e,r){return this.get(t,!0,e,r)}optional(t,e,r){return this.get(t,!1,e,r)}success(){return this._valid}get(t,e,r,n){const i=this.feature.properties.hasOwnProperty(t)?+this.feature.properties[t]:void 0;return this._valid&&void 0!==i?r(n?n(i):i):e&&(this._valid=!1),this}}class ch{constructor(t,e){this.featureFunc=t,this.vertexFunc=e;}parseFeature(t,e,r){return this.featureFunc(t,e,r)}parseVertex(t,e,r){return this.vertexFunc(t,e,r)}}const hh=new ch(((t,e,r)=>t.reset(e).require(oh,(t=>{r.id=t;})).optional("fixed_height_relative",(t=>{r.constantHeight=t;}),fh.decodeRelativeHeight).geometry((t=>{r.bounds=t;}),fh.computeBounds).success()),((t,e,r)=>t.reset(e).require(oh,(t=>{r.id=t;})).require("elevation_idx",(t=>{r.idx=t;})).require("extent",(t=>{r.extent=t;})).require("height_relative",(t=>{r.height=t;}),fh.decodeRelativeHeight).geometry((t=>{r.position=t;}),fh.getPoint).success())),ph=new ch(((t,e,r)=>t.reset(e).require(oh,(t=>{r.id=t;})).optional("fixed_height",(t=>{r.constantHeight=t;}),fh.decodeMetricHeight).geometry((t=>{r.bounds=t;}),fh.computeBounds).success()),((t,e,r)=>t.reset(e).require(oh,(t=>{r.id=t;})).require("elevation_idx",(t=>{r.idx=t;})).require("extent",(t=>{r.extent=t;})).require("height",(t=>{r.height=t;}),fh.decodeMetricHeight).geometry((t=>{r.position=t;}),fh.getPoint).success()));class fh{static computeBounds(t){const e=new q(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new q(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const n of t[0])e.x>n.x&&(e.x=n.x),e.y>n.y&&(e.y=n.y),r.x<n.x&&(r.x=n.x),r.y<n.y&&(r.y=n.y);return {min:e,max:r}}static getPoint(t){return O.vec2.fromValues(t[0][0].x,t[0][0].y)}static decodeRelativeHeight(t){return 1e-4*t*5}static decodeMetricHeight(t){return 1e-4*t}static parse(t){const e=[],r=[],n=t.length,i=new uh;for(let a=0;a<n;a++){const n=t.feature(a),o=n.properties.hasOwnProperty("version")?String(n.properties.version):void 0,l=(s=o)?"1.0.1"===s?ph:void 0:hh;if(void 0===l){pt(`Unknown elevation feature version number ${o||"(unknown)"}`);continue}const u=n.properties.hasOwnProperty("type")?n.properties.type:void 0;if(u)if("Point"===ah.VectorTileFeature.types[n.type]&&"curve_point"===u){const t={};l.parseVertex(i,n,t)&&e.push(t);}else if("Polygon"===ah.VectorTileFeature.types[n.type]&&"curve_meta"===u){const t={};l.parseFeature(i,n,t)&&r.push(t);}}var s;return {vertices:e,features:r}}}class dh{constructor(t,e,r,n,i,s){if(this.vertices=new Array,this.vertexProps=new Array,this.edges=new Array,this.edgeProps=new Array,this.id=t,this.heightRange={min:r,max:r},this.safeArea=e,this.constantHeight=r,null==this.constantHeight&&(null!=this.constantHeight||0!==n.length)){this.vertices=n,this.edges=i,this.edges=this.edges.filter((t=>t.a<this.vertices.length&&t.b<this.vertices.length&&!O.vec2.exactEquals(this.vertices[t.a].position,this.vertices[t.b].position))),this.heightRange={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};for(const t of this.vertices)this.vertexProps.push({dir:O.vec2.fromValues(0,0)}),this.heightRange.min=Math.min(this.heightRange.min,t.height),this.heightRange.max=Math.max(this.heightRange.max,t.height);for(const t of this.edges){const e=this.vertices[t.a].position,r=this.vertices[t.b].position,n=O.vec2.subtract(O.vec2.create(),r,e),i=O.vec2.length(n),s=O.vec2.scale(O.vec2.create(),n,1/i);this.edgeProps.push({vec:n,dir:s,len:i});const a=this.vertexProps[t.a].dir,o=this.vertexProps[t.b].dir;O.vec2.add(a,a,s),O.vec2.add(o,o,s);}for(const t of this.vertexProps)0===t.dir[0]&&0===t.dir[1]||O.vec2.normalize(t.dir,t.dir);this.tessellate(s);}}pointElevation(t){if(null!=this.constantHeight)return this.constantHeight;const e=this.getClosestEdge(t);if(null==e)return 0;const[r,n]=e;return ((t,e,r)=>(1-r)*t+r*e)(this.vertices[this.edges[r].a].height,this.vertices[this.edges[r].b].height,n)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(t){if(0===this.edges.length)return;let e=0,r=Number.POSITIVE_INFINITY,n=0;const i=O.vec2.fromValues(t.x,t.y);for(let t=0;t<this.edges.length;t++){const s=this.edges[t],a=this.edgeProps[t].dir,o=new yu(i,this.edgeProps[t].dir),l=this.vertices[s.a].position,u=this.vertices[s.b].position,c=O.vec2.create(),h=O.vec2.create(),p=o.intersectsPlane(l,this.vertexProps[s.a].dir,c),f=o.intersectsPlane(u,this.vertexProps[s.b].dir,h);if(!p||!f)continue;const d=O.vec2.subtract(O.vec2.create(),h,c),m=O.vec2.subtract(O.vec2.create(),i,c),y=O.vec2.dot(d,d),g=y>0?O.vec2.dot(m,d)/y:0,x=Q(g,0,1),v=Math.abs((g-x)*this.edgeProps[t].len),b=O.vec2.subtract(O.vec2.create(),i,l),_=v+Math.abs(O.vec2.dot(b,O.vec2.fromValues(a[1],-a[0])));_<r&&(e=t,r=_,n=x);}return [e,n]}tessellate(t){for(let e=this.edges.length-1;e>=0;--e){const r=this.edges[e].a,n=this.edges[e].b,{position:i,height:s,extent:a}=this.vertices[r],{position:o,height:l,extent:u}=this.vertices[n],c=this.vertexProps[r].dir,h=this.vertexProps[n].dir,p=O.vec3.fromValues(i[0]/t,i[1]/t,s),f=O.vec3.fromValues(o[0]/t,o[1]/t,l),d=O.vec3.fromValues(c[1],-c[0],0);O.vec3.scale(d,d,a);const m=O.vec3.fromValues(h[1],-h[0],0);if(O.vec3.scale(m,m,u),this.distSqLines(O.vec3.fromValues(p[0]+.5*d[0],p[1]+.5*d[1],p[2]+.5*d[2]),O.vec3.fromValues(f[0]-.5*m[0],f[1]-.5*m[1],f[2]-.5*m[2]),O.vec3.fromValues(p[0]-.5*d[0],p[1]-.5*d[1],p[2]-.5*d[2]),O.vec3.fromValues(f[0]+.5*m[0],f[1]+.5*m[1],f[2]+.5*m[2]))<=.05*.05)continue;const y=this.vertices.length,g=O.vec2.add(O.vec2.create(),i,o);this.vertices.push({position:O.vec2.scale(g,g,.5),height:.5*(s+l),extent:.5*(a+u)});const x=O.vec2.add(O.vec2.create(),c,h);this.vertexProps.push({dir:O.vec2.normalize(x,x)}),this.edges.splice(e,1),this.edgeProps.splice(e,1),this.edges.push({a:r,b:y}),this.edges.push({a:y,b:n});const v=O.vec2.subtract(O.vec2.create(),this.vertices[y].position,i),b=O.vec2.length(v),_={vec:v,dir:O.vec2.scale(O.vec2.create(),v,1/b),len:b};this.edgeProps.push(_),this.edgeProps.push(_);}}distSqLines(t,e,r,n){const i=O.vec3.subtract(O.vec3.create(),e,t),s=O.vec3.subtract(O.vec3.create(),n,r),a=O.vec3.subtract(O.vec3.create(),t,r),o=O.vec3.dot(i,i),l=O.vec3.dot(i,s),u=O.vec3.dot(i,a),c=O.vec3.dot(s,s),h=O.vec3.dot(s,a),p=o*c-l*l;if(0===p){const e=O.vec3.dot(a,s)/O.vec3.dot(s,s),i=O.vec3.lerp(O.vec3.create(),r,n,e);return O.vec3.squaredDistance(i,t)}const f=(l*h-u*c)/p,d=(o*h-l*u)/p,m=O.vec3.lerp(O.vec3.create(),t,e,f),y=O.vec3.lerp(O.vec3.create(),r,n,d);return O.vec3.squaredDistance(m,y)}}class mh{constructor(t,e){this.zScale=1,this.xOffset=0,this.yOffset=0,t.equals(e)||(this.zScale=Math.pow(2,e.z-t.z),this.xOffset=(t.x*this.zScale-e.x)*Kr,this.yOffset=(t.y*this.zScale-e.y)*Kr);}constantElevation(t,e){if(null!=t.constantHeight)return this.computeBiasedHeight(t.constantHeight,e)}pointElevation(t,e,r){const n=this.constantElevation(e,r);return null!=n?n:(t.x=t.x*this.zScale+this.xOffset,t.y=t.y*this.zScale+this.yOffset,this.computeBiasedHeight(e.pointElevation(t),r))}computeBiasedHeight(t,e){return e<=0?t:t+e*tt(0,e,t>=0?t:Math.abs(.5*t))}}us(dh,"ElevationFeature");class yh{constructor(){this.polygons=new Map;}add(t,...e){this.polygons.has(t)?this.polygons.get(t).push(...e):this.polygons.set(t,e);}merge(t){for(const[e,r]of t.polygons)this.add(e,...r);}}class gh{constructor(){this.portals=[];}static evaluate(t){if(0===t.length)return new gh;let e=[];for(const r of t)e.push(...r.portals);if(0===e.length)return new gh;const r=(t,e)=>t<=0&&e<=0||t>=Kr&&e>=Kr;for(const t of e){const e=t.va,n=t.vb;(r(e.x,n.x)||r(e.y,n.y))&&(t.type="border");}const n=e.filter((t=>"unevaluated"!==t.type)),i=e.filter((t=>"unevaluated"===t.type));if(0===i.length)return new gh;i.sort(((t,e)=>t.hash===e.hash?t.isTunnel===e.isTunnel?0:t.isTunnel?-1:1:t.hash<e.hash?1:-1)),e=n.concat(i);let s=n.length,a=s,o=s;do{if(a++,a===e.length||e[s].hash!==e[a].hash){if(a-s==2){o<s&&(e[o]=e[s],e[s]=null);const t=e[o],r=e[a-1];t.type=t.isTunnel!==r.isTunnel?"tunnel":"polygon",t.connection={a:t.connection.a,b:r.connection.a},o++;}s=a;}}while(s!==e.length);return e.splice(o),e.sort(((t,e)=>t.hash<e.hash?1:-1)),{portals:e}}}us(gh,"ElevationPortalGraph"),us(yh,"ElevationPolygons");class xh{constructor(t,e,r){this.outPositions=t,this.outNormals=e,this.outIndices=r,this.vertexLookup=new Map,this.buffer=new ArrayBuffer(4),this.view=new DataView(this.buffer);}addVertex(t,e,r){let n=t[2];null!=r&&(n*=r);const i=this.getVec3Bits(t)<<96n|this.getVec3Bits(e),s=this.vertexLookup.get(i);if(null!=s)return s;const a=this.outPositions.length;this.vertexLookup.set(i,a);const o=Math.trunc(16384*e[0]),l=Math.trunc(16384*e[1]),u=Math.trunc(16384*e[2]);return this.outPositions.emplaceBack(t[0],t[1],n),this.outNormals.emplaceBack(o,l,u),a}addVertices(t,e,...r){const n=[];for(const i of r){const r=this.addVertex(i,t,e);n.push(r);}return n}addTriangles(t,e,r){if(e&&r){const n=1===r.length,i=O.vec3.fromValues(0,0,0);for(let s=0;s<t.length;s+=3){const a=e[t[s+0]],o=e[t[s+1]],l=e[t[s+2]],u=n?r[0]:r[t[s+1]],c=n?r[0]:r[t[s+2]],h=this.addVertex(O.vec3.fromValues(a.x,a.y,n?r[0]:r[t[s+0]]),i),p=this.addVertex(O.vec3.fromValues(o.x,o.y,u),i),f=this.addVertex(O.vec3.fromValues(l.x,l.y,c),i);this.outIndices.emplaceBack(h,p,f);}}else for(let e=0;e<t.length;e+=3)this.outIndices.emplaceBack(t[e+0],t[e+1],t[e+2]);}addQuad(t,e){const r=this.addVertices(e,void 0,...t.map((t=>O.vec3.fromValues(t.coord.x,t.coord.y,t.height)))),[n,i,s,a]=r;this.addTriangles([n,i,s,s,a,n]);}getBits(t){return this.view.setFloat32(0,t),BigInt(this.view.getUint32(0))}getVec3Bits(t){return this.getBits(t[0])<<64n|this.getBits(t[1])<<32n|this.getBits(t[2])}}class vh{constructor(t){this.unevaluatedPortals=new gh,this.portalPolygons=new yh,this.vertexHashLookup=new Map,this.unevalVertices=[],this.unevalHeights=[],this.unevalTriangles=[],this.unevalTunnelTriangles=[],this.unevalEdges=[],this.vertexPositions=new Ia,this.vertexNormals=new Sa,this.indexArray=new ja,this.tileToMeters=Al(t);}addVertices(t,e){const r=this.unevalVertices.length;for(let r=0;r<t.length;r++)this.unevalVertices.push(t[r]),this.unevalHeights.push(e[r]);return r}addTriangles(t,e,r){const n=r?this.unevalTunnelTriangles:this.unevalTriangles;for(const r of t)n.push(r+e);}addRenderableRing(t,e,r,n,i){const s=[new q(i.min.x,i.min.y),new q(i.max.x,i.min.y),new q(i.max.x,i.max.y),new q(i.min.x,i.max.y)];for(let a=0;a<r-1;a++){const r=e+a,o=r+1,l=this.unevalVertices[r],u=this.unevalVertices[o];if(!(l.x>=i.min.x&&l.x<=i.max.x&&l.y>=i.min.y&&l.y<=i.max.y||u.x>=i.min.x&&u.x<=i.max.x&&u.y>=i.min.y&&u.y<=i.max.y||Zl(l,u,s)))continue;if(this.isOnBorder(l.x,u.x)||this.isOnBorder(l.y,u.y))continue;const c=vh.computeEdgeHash(this.unevalVertices[r],this.unevalVertices[o]);let h,p=this.vertexHashLookup.get(vh.computePosHash(l));null!=p?h=p.next:(p=this.vertexHashLookup.get(vh.computePosHash(u)),h=null!=p?p.prev:c),this.unevalEdges.push({polygonIdx:t,a:r,b:o,hash:c,portalHash:h,isTunnel:n,type:"unevaluated"});}}addPortalCandidates(t,e,r,n,i){if(0===e.length)return;this.portalPolygons.add(t,{geometry:e,zLevel:i});const s=e[0];this.vertexHashLookup.clear();let a=vh.computeEdgeHash(s[s.length-2],s[s.length-1]);for(let e=0;e<s.length-1;e++){const i=s[e+0],o=s[e+1],l=O.vec2.fromValues(o.x-i.x,o.y-i.y),u=O.vec2.length(l);if(0===u)continue;let c="unevaluated";const h=n.pointElevation(i),p=n.pointElevation(o);Math.abs(h)<.01&&Math.abs(p)<.01?c="entrance":(this.isOnBorder(i.x,o.x)||this.isOnBorder(i.y,o.y))&&(c="border");const f=vh.computeEdgeHash(i,o);this.unevaluatedPortals.portals.push({connection:{a:t,b:void 0},va:i,vb:o,vab:l,length:u,hash:f,isTunnel:r,type:c});const d=vh.computePosHash(i);this.vertexHashLookup.set(d,{prev:a,next:f}),a=f;}}construct(t){if(0===this.unevalVertices.length)return;const e=()=>({vertexOffset:0,primitiveOffset:this.indexArray.length}),r=t=>{t.primitiveLength=this.indexArray.length-t.primitiveOffset;},n=new xh(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(t.portals,this.unevalEdges);const i=e(),s=e(),a=e(),o=(t,e)=>{t.sort(((t,r)=>t.type===e&&r.type!==e?-1:t.type!==e&&r.type===e?1:0));const r=t.findIndex((t=>t.type!==e));return r>=0?r:t.length};let l=0;this.unevalEdges.length>0&&(l=o(this.unevalEdges,"none"),this.constructBridgeStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},this.tileToMeters));const u=e();if(this.unevalEdges.length>0){const t=this.unevalEdges.splice(l),e=o(t,"tunnel")+l;this.unevalEdges.push(...t),this.constructTunnelStructures(n,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:l},{min:l,max:e});}r(a),n.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),r(u),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),r(s),n.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,[-.1]),r(i),this.maskSegments=xo.simpleSegment(0,u.primitiveOffset,0,u.primitiveLength),this.depthSegments=xo.simpleSegment(0,s.primitiveOffset,0,s.primitiveLength),this.renderableSegments=xo.simpleSegment(0,a.primitiveOffset,0,a.primitiveLength),this.shadowCasterSegments=xo.simpleSegment(0,i.primitiveOffset,0,i.primitiveLength);}upload(t){this.vertexBuffer||0===this.vertexPositions.length||0===this.vertexNormals.length||0===this.indexArray.length||(this.vertexBuffer=t.createVertexBuffer(this.vertexPositions,gc.members),this.vertexBufferNormal=t.createVertexBuffer(this.vertexNormals,xc.members),this.indexBuffer=t.createIndexBuffer(this.indexArray));}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableSegments.destroy(),this.shadowCasterSegments.destroy());}computeVertexConnections(t,e,r,n){const i=new Map;for(let s=r;s<n;s++){const r=e[s],n=r.a,a=r.b;i.has(n)||i.set(n,{}),i.has(a)||i.set(a,{});const o=i.get(n),l=i.get(a);t[a]>0&&(o.to=a),t[n]>0&&(l.from=n);}return i}constructBridgeStructures(t,e,r,n,i,s){const a=this.computeVertexConnections(r,n,i.min,i.max),o=1/s,l=.5*o,u=t=>O.vec3.fromValues(e[t].x,e[t].y,r[t]*o),c=t=>{const e=a.get(t),r=e.from,n=e.to;if(!r||!n)return;const i=u(r),s=u(t),o=u(n),l=O.vec3.fromValues(0,0,0);if(!O.vec3.exactEquals(i,s)){const t=O.vec3.sub(O.vec3.create(),s,i);O.vec3.add(l,l,O.vec3.normalize(t,t));}if(!O.vec3.exactEquals(o,s)){const t=O.vec3.sub(O.vec3.create(),o,s);O.vec3.add(l,l,O.vec3.normalize(t,t));}const c=O.vec3.len(l);return c>0?O.vec3.scale(l,l,1/c):void 0};for(let a=i.min;a<i.max;a++){const i=n[a],u=this.prepareEdgePoints(e,r,i,((t,e)=>t>=e));if(null==u)continue;const h=u[0],p=u[1],f=O.vec3.fromValues(h.coord.x,h.coord.y,o*h.height),d=O.vec3.fromValues(p.coord.x,p.coord.y,o*p.height);if(O.vec3.exactEquals(f,d))continue;const m=O.vec3.sub(O.vec3.create(),d,f);O.vec3.normalize(m,m);const y=t=>O.vec3.normalize(t,t),g=c(i.a)||m,x=c(i.b)||m,v=y(O.vec3.fromValues(g[1],-g[0],0)),b=y(O.vec3.fromValues(x[1],-x[0],0)),_=y(O.vec3.cross(O.vec3.create(),v,g)),w=y(O.vec3.cross(O.vec3.create(),b,x)),M=O.vec3.create(),A=[O.vec3.add(O.vec3.create(),f,O.vec3.scale(M,O.vec3.sub(M,v,_),l)),O.vec3.add(O.vec3.create(),f,O.vec3.scale(M,O.vec3.add(M,v,_),l)),O.vec3.add(O.vec3.create(),f,O.vec3.scale(M,_,l)),f],I=[O.vec3.add(O.vec3.create(),d,O.vec3.scale(M,O.vec3.sub(M,b,w),l)),O.vec3.add(O.vec3.create(),d,O.vec3.scale(M,O.vec3.add(M,b,w),l)),O.vec3.add(O.vec3.create(),d,O.vec3.scale(M,w,l)),d],[S,P]=t.addVertices(v,s,A[0],A[1]),[E,z]=t.addVertices(b,s,I[0],I[1]);t.addTriangles([S,P,E,P,z,E]);const[k,T]=t.addVertices(_,s,A[1],A[2]),[B,V]=t.addVertices(w,s,I[1],I[2]);t.addTriangles([k,T,B,T,V,B]);const[C,D]=t.addVertices(O.vec3.negate(v,v),s,A[2],A[3]),[R,L]=t.addVertices(O.vec3.negate(b,b),s,I[2],I[3]);t.addTriangles([C,D,R,D,L,R]);}}constructTunnelStructures(t,e,r,n,i,s){const a=t=>O.vec3.normalize(t,t);for(let s=i.min;s<i.max;s++){const i=this.prepareEdgePoints(e,r,n[s],((t,e)=>t<=e));if(null==i)continue;const[o,l]=i,u=a(O.vec3.fromValues(l.coord.y-o.coord.y,-(l.coord.x-o.coord.x),0));t.addQuad([o,l,{coord:l.coord,height:n[s].isTunnel?-.1:0},{coord:o.coord,height:n[s].isTunnel?-.1:0}],u);}for(let i=s.min;i<s.max;i++){const s=n[i],o=e[s.a],l=e[s.b],u=a(O.vec3.fromValues(l.y-o.y,-(l.x-o.x),0));t.addQuad([{coord:l,height:0},{coord:o,height:0},{coord:o,height:r[s.a]+4},{coord:l,height:r[s.b]+4}],u),t.addQuad([{coord:o,height:0},{coord:l,height:0},{coord:l,height:r[s.b]+4},{coord:o,height:r[s.a]+4}],u);}}prepareEdgePoints(t,e,r,n){const i=t[r.a],s=t[r.b];let a=e[r.a],o=e[r.b];if(!(0!==a&&n(a,0)||0!==o&&n(o,0)))return;const l=i.clone(),u=s.clone();if(n(a,0)){if(!n(o,0)){const t=o/(o-a);u.x=Ee(u.x,l.x,t),u.y=Ee(u.y,l.y,t),o=Ee(o,a,t);}}else {const t=a/(a-o);l.x=Ee(l.x,u.x,t),l.y=Ee(l.y,u.y,t),a=Ee(a,o,t);}return [{coord:l,height:a},{coord:u,height:o}]}prepareEdges(t,e){if(0===e.length)return;e.sort(((t,e)=>t.hash===e.hash?e.polygonIdx-t.polygonIdx:e.hash>t.hash?1:-1));let r=0,n=0,i=0,s=e[r].polygonIdx;do{n++,(n===e.length||e[r].hash!==e[n].hash)&&((1==n-r||e[n-1].polygonIdx!==s)&&(i<r&&(e[i]=e[r],e[r]=null),e[i].type="none",i++),r=n,r!==e.length&&(s=e[r].polygonIdx));}while(r!==e.length);if(e.splice(i),0!==e.length&&0!==t.length){e.sort(((t,e)=>t.hash<e.hash?1:-1));let r=0,n=0;for(;r!==e.length&&n!==t.length;){const i=e[r],s=t[n];i.portalHash>s.hash?r++:s.hash>i.portalHash?n++:(i.type=s.type,r++);}}}isOnBorder(t,e){return t<=0&&e<=0||t>=Kr&&e>=Kr}static computeEdgeHash(t,e){return (t.y===e.y&&t.x>e.x||t.y>e.y)&&([t,e]=[e,t]),BigInt(vh.computePosHash(t))<<32n|BigInt(vh.computePosHash(e))}static computePosHash(t){return ((65535&t.x)<<16|65535&t.y)>>>0}}class bh{constructor(t,e){this.layoutVertexArray=new _a,this.indexArray=new ja,this.lineIndexArray=new La,this.triangleSegments=new xo,this.lineSegments=new xo,this.programConfigurations=new Go(t.layers,{zoom:t.zoom,lut:t.lut}),this.uploaded=!1,e&&(this.elevatedLayoutVertexArray=new Aa);}update(t,e,r,n,i,s,a){this.programConfigurations.updatePaintArrays(t,e,i,r,n,s,a);}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,mc.members),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.lineIndexBuffer=t.createIndexBuffer(this.lineIndexArray),this.elevatedLayoutVertexArray&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=t.createVertexBuffer(this.elevatedLayoutVertexArray,yc.members))),this.programConfigurations.upload(t),this.uploaded=!0;}destroy(){this.layoutVertexBuffer&&(this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy());}populatePaintArrays(t,e,r,n,i,s){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,e,r,n,i,s);}}class _h{constructor(t){this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.bufferData=new bh(t,!1),this.elevationBufferData=new bh(t,!0),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.projection=t.projection,this.elevationMode=this.layers[0].layout.get("fill-elevation-reference");}updateFootprints(t,e){}populate(t,e,r,n){this.hasPattern=Hc("fill",this.layers,this.pixelRatio,e);const i=this.layers[0].layout.get("fill-sort-key"),s=[];for(const{feature:a,id:o,index:l,sourceLayerIndex:u}of t){const t=this.layers[0]._featureFilter.needGeometry,c=Cl(a,t);if(!this.layers[0]._featureFilter.filter(new Rs(this.zoom),c,r))continue;const h=i?i.evaluate(c,{},r,e.availableImages):void 0,p={id:o,properties:a.properties,type:a.type,sourceLayerIndex:u,index:l,geometry:t?c.geometry:Vl(a,r,n),patterns:{},sortKey:h};s.push(p);}i&&s.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of s){const{geometry:i,index:s,sourceLayerIndex:a}=n;if(this.hasPattern){const t=Xc("fill",this.layers,n,this.zoom,this.pixelRatio,e);this.patternFeatures.push(t);}else this.addFeature(n,i,s,r,{},e.availableImages,e.brightness,e.elevationFeatures);e.featureIndex.insert(t[s].feature,i,s,a,this.index);}}update(t,e,r,n,i,s,a){this.bufferData.update(t,e,r,n,i,s,a),this.elevationBufferData.update(t,e,r,n,i,s,a);}addFeatures(t,e,r,n,i,s){for(const i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,e,r,n,s,t.elevationFeatures);}isEmpty(){return this.bufferData.isEmpty()&&this.elevationBufferData.isEmpty()}uploadPending(){return !this.uploaded||this.bufferData.needsUpload()||this.elevationBufferData.needsUpload()}upload(t){this.bufferData.upload(t),this.elevationBufferData.upload(t),this.elevatedStructures&&this.elevatedStructures.upload(t);}destroy(){this.bufferData.destroy(),this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy();}addFeature(t,e,r,n,i,s=[],a,o){const l=$c(e,500);"none"!==this.elevationMode?this.addElevatedRoadFeature(t,l,n,r,o):this.addGeometry(l,this.bufferData),this.bufferData.populatePaintArrays(t,r,i,s,n,a),this.elevationBufferData.populatePaintArrays(t,r,i,s,n,a);}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}getElevationPolygons(){return this.elevatedStructures?this.elevatedStructures.portalPolygons:void 0}setEvaluatedPortalGraph(t){this.elevatedStructures&&this.elevatedStructures.construct(t);}addElevatedRoadFeature(t,e,r,n,i){const s=new Array,a=this.getElevationFeature(t,i);if(a){s.push({polygons:e,elevationFeature:a,elevationTileID:r});for(const e of s)if(e.elevationFeature){if("hd-road-base"===this.elevationMode){this.elevatedStructures||(this.elevatedStructures=new vh(e.elevationTileID));const r=e.elevationFeature.isTunnel();let n=0;t.properties.hasOwnProperty(lh)&&(n=+t.properties[lh]);for(const t of e.polygons)this.elevatedStructures.addPortalCandidates(e.elevationFeature.id,t,r,e.elevationFeature,n);}const i=new mh(r,e.elevationTileID);this.addElevatedGeometry(e.polygons,i,e.elevationFeature,"hd-road-base"===this.elevationMode?0:.05,n);}}else this.addGeometry(e,this.bufferData);}addElevatedGeometry(t,e,r,n,i){const s={elevation:r,elevationSampler:e,bias:n,index:i},[a,o]=this.addGeometry(t,this.elevationBufferData,s);null==this.elevationBufferData.heightRange?this.elevationBufferData.heightRange={min:a,max:o}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,a),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,o));}addGeometry(t,e,r){let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=null;r&&(s=r.elevationSampler.constantElevation(r.elevation,r.bias),null!=s&&(n=s,i=s));const a=(t,a,o)=>{if(null!=r)if(a.push(t),null!=s)e.elevatedLayoutVertexArray.emplaceBack(s),o.push(s);else {const s=r.elevationSampler.pointElevation(t,r.elevation,r.bias);e.elevatedLayoutVertexArray.emplaceBack(s),o.push(s),n=Math.min(n,s),i=Math.max(i,s);}};for(const n of t){let t=0;for(const e of n)t+=e.length;const i=e.triangleSegments.prepareSegment(t,e.layoutVertexArray,e.indexArray),s=i.vertexLength,o=[],l=[],u=[],c=[],h=[],p=e.layoutVertexArray.length;for(const t of n){if(0===t.length)continue;t!==n[0]&&l.push(o.length/2);const i=e.lineSegments.prepareSegment(t.length,e.layoutVertexArray,e.lineIndexArray),s=i.vertexLength;r&&h.push(e.layoutVertexArray.length-p),a(t[0],u,c),e.layoutVertexArray.emplaceBack(t[0].x,t[0].y),e.lineIndexArray.emplaceBack(s+t.length-1,s),o.push(t[0].x),o.push(t[0].y);for(let r=1;r<t.length;r++)a(t[r],u,c),e.layoutVertexArray.emplaceBack(t[r].x,t[r].y),e.lineIndexArray.emplaceBack(s+r-1,s+r),o.push(t[r].x),o.push(t[r].y);i.vertexLength+=t.length,i.primitiveLength+=t.length;}const f=vc(o,l);for(let t=0;t<f.length;t+=3)e.indexArray.emplaceBack(s+f[t],s+f[t+1],s+f[t+2]);if(r&&"hd-road-base"===this.elevationMode){const t=r.elevation.isTunnel(),e=r.elevation.safeArea,n=this.elevatedStructures.addVertices(u,c);this.elevatedStructures.addTriangles(f,n,t);const i=h.length;if(i>0){for(let s=0;s<i-1;s++)this.elevatedStructures.addRenderableRing(r.index,h[s]+n,h[s+1]-h[s],t,e);this.elevatedStructures.addRenderableRing(r.index,h[i-1]+n,u.length-h[i-1],t,e);}}i.vertexLength+=t,i.primitiveLength+=f.length/3;}return [n,i]}getElevationFeature(t,e){if(!e)return;const r=+t.properties[oh];return null!=r?e.find((t=>t.id===r)):void 0}}let wh,Mh,Ah,Ih;us(_h,"FillBucket",{omit:["layers","patternFeatures"]}),us(bh,"FillBufferData"),us(vh,"ElevatedStructures");class Sh{constructor(t,e,r,n){if(this.triangleCount=e.length/3,this.min=new q(0,0),this.max=new q(0,0),this.xScale=0,this.yScale=0,this.cellsX=0,this.cellsY=0,this.cells=[],this.payload=[],0===this.triangleCount||0===t.length)return;const[i,s]=[t[0].clone(),t[0].clone()];for(let e=1;e<t.length;++e){const r=t[e];i.x=Math.min(i.x,r.x),i.y=Math.min(i.y,r.y),s.x=Math.max(s.x,r.x),s.y=Math.max(s.y,r.y);}if(n){const t=Math.ceil(Math.max(s.x-i.x,s.y-i.y)/n);r=Math.max(r,t);}if(0===r)return;this.min=i,this.max=s;const a=this.max.sub(this.min);a.x=Math.max(a.x,1),a.y=Math.max(a.y,1);const o=Math.max(a.x,a.y)/r;this.cellsX=Math.max(1,Math.ceil(a.x/o)),this.cellsY=Math.max(1,Math.ceil(a.y/o)),this.xScale=1/o,this.yScale=1/o;const l=[];for(let r=0;r<this.triangleCount;r++){const n=t[e[3*r+0]].sub(this.min),i=t[e[3*r+1]].sub(this.min),s=t[e[3*r+2]].sub(this.min),a=Ph(Math.floor(Math.min(n.x,i.x,s.x)),this.xScale,this.cellsX),u=Ph(Math.floor(Math.max(n.x,i.x,s.x)),this.xScale,this.cellsX),c=Ph(Math.floor(Math.min(n.y,i.y,s.y)),this.yScale,this.cellsY),h=Ph(Math.floor(Math.max(n.y,i.y,s.y)),this.yScale,this.cellsY),p=new q(0,0),f=new q(0,0),d=new q(0,0),m=new q(0,0);for(let t=c;t<=h;++t){p.y=f.y=t*o,d.y=m.y=(t+1)*o;for(let e=a;e<=u;++e)p.x=d.x=e*o,f.x=m.x=(e+1)*o,(Kl(n,i,s,p,f,m)||Kl(n,i,s,p,m,d))&&l.push({cellIdx:t*this.cellsX+e,triIdx:r});}}if(0===l.length)return;l.sort(((t,e)=>t.cellIdx-e.cellIdx||t.triIdx-e.triIdx));let u=0;for(;u<l.length;){const t=l[u].cellIdx,e={start:this.payload.length,len:0};for(;u<l.length&&l[u].cellIdx===t;)++e.len,this.payload.push(l[u++].triIdx);this.cells[t]=e;}}_lazyInitLookup(){this.lookup||(this.lookup=new Uint8Array(Math.ceil(this.triangleCount/8))),this.lookup.fill(0);}queryPoint(t,e){if(0===this.triangleCount||0===this.cells.length)return;if(t.x>this.max.x||this.min.x>t.x||t.y>this.max.y||this.min.y>t.y)return;const r=Ph(t.x-this.min.x,this.xScale,this.cellsX),n=Ph(t.y-this.min.y,this.yScale,this.cellsY),i=this.cells[n*this.cellsX+r];if(i){this._lazyInitLookup();for(let t=0;t<i.len;t++){const r=this.payload[i.start+t],n=Math.floor(r/8),s=1<<r%8;if(!(this.lookup[n]&s)&&(this.lookup[n]|=s,e.push(r),e.length===this.triangleCount))return}}}query(t,e,r){if(0===this.triangleCount||0===this.cells.length)return;if(t.x>this.max.x||this.min.x>e.x)return;if(t.y>this.max.y||this.min.y>e.y)return;this._lazyInitLookup();const n=Ph(t.x-this.min.x,this.xScale,this.cellsX),i=Ph(e.x-this.min.x,this.xScale,this.cellsX),s=Ph(t.y-this.min.y,this.yScale,this.cellsY),a=Ph(e.y-this.min.y,this.yScale,this.cellsY);for(let t=s;t<=a;t++)for(let e=n;e<=i;e++){const n=this.cells[t*this.cellsX+e];if(n)for(let t=0;t<n.len;t++){const e=this.payload[n.start+t],i=Math.floor(e/8),s=1<<e%8;if(!(this.lookup[i]&s)&&(this.lookup[i]|=s,r.push(e),r.length===this.triangleCount))return}}}}function Ph(t,e,r){return Math.max(0,Math.min(r-1,Math.floor(t*e)))}us(Sh,"TriangleGridIndex");class Eh{constructor(t){this.zoom=t.zoom,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.footprints=[];}updateFootprints(t,e){for(const r of this.footprints)e.push({footprint:r,id:t});}populate(t,e,r,n){const i=[];for(const{feature:e,id:s,index:a,sourceLayerIndex:o}of t){const t=this.layers[0]._featureFilter.needGeometry,l=Cl(e,t);if(!this.layers[0]._featureFilter.filter(new Rs(this.zoom),l,r))continue;const u={id:s,properties:e.properties,type:e.type,sourceLayerIndex:o,index:a,geometry:t?l.geometry:Vl(e,r,n),patterns:{}};i.push(u);}for(const n of i){const{geometry:i,index:s,sourceLayerIndex:a}=n;this.addFeature(n,i,s,r,{},e.availableImages,e.brightness),e.featureIndex.insert(t[s].feature,i,s,a,this.index);}}isEmpty(){return 0===this.footprints.length}uploadPending(){return !1}upload(t){}update(t,e,r,n,i,s,a){}destroy(){}addFeature(t,e,r,n,i,s=[],a){for(const t of $c(e,2)){const e=[],r=[],n=[],i=new q(1/0,1/0),s=new q(-1/0,-1/0);for(const a of t)if(0!==a.length){a!==t[0]&&n.push(r.length/2);for(let t=0;t<a.length;t++)r.push(a[t].x),r.push(a[t].y),e.push(a[t]),i.x=Math.min(i.x,a[t].x),i.y=Math.min(i.y,a[t].y),s.x=Math.max(s.x,a[t].x),s.y=Math.max(s.y,a[t].y);}const a=vc(r,n),o=new Sh(e,a,8,256);this.footprints.push({vertices:e,indices:a,grid:o,min:i,max:s});}}}us(Eh,"ClipBucket",{omit:["layers"]});const zh=va([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),kh=va([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Th=va([{name:"a_centroid_pos",components:2,type:"Uint16"}]),Bh=va([{name:"a_join_normal_inside",components:3,type:"Int16"}]),Vh=va([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),Ch=va([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Dh}=zh;class Rh extends q{constructor(t,e,r){super(t,e),this.z=r;}}class Lh extends Rh{constructor(t,e,r,n){super(t,e,r),this.w=n;}}function Fh(t,e,r,n){const i=[],s=0===n?(t,e,r,n,i,s)=>{t.push(new q(s,r+(s-e)/(n-e)*(i-r)));}:(t,e,r,n,i,s)=>{t.push(new q(e+(s-r)/(i-r)*(n-e),s));};for(const a of t){const t=[];for(const i of a){if(i.length<=2)continue;const a=[];for(let t=0;t<i.length-1;t++){const o=i[t].x,l=i[t].y,u=i[t+1].x,c=i[t+1].y,h=0===n?o:l,p=0===n?u:c;h<e?p>e&&s(a,o,l,u,c,e):h>r?p<r&&s(a,o,l,u,c,r):a.push(i[t]),p<e&&h>=e&&s(a,o,l,u,c,e),p>r&&h<=r&&s(a,o,l,u,c,r);}let o=i[i.length-1];const l=0===n?o.x:o.y;l>=e&&l<=r&&a.push(o),a.length&&(o=a[a.length-1],a[0].x===o.x&&a[0].y===o.y||a.push(a[0]),t.push(a));}t.length&&i.push(t);}return i}function Oh(t,e,r,n){const i="x"===r?"y":"x",s=(n-t[r])/(e[r]-t[r]);t[i]=t[i]+(e[i]-t[i])*s,t[r]=n,t.hasOwnProperty("z")&&(t.z=Ee(t.z,e.z,s)),t.hasOwnProperty("w")&&(t.w=Ee(t.w,e.w,s));}function Nh(t,e,r,n){const i=r,s=n;for(const r of ["x","y"]){let n=t,a=e;n[r]>=a[r]&&(n=e,a=t),n[r]<i&&a[r]>i&&Oh(n,a,r,i),n[r]<s&&a[r]>s&&Oh(a,n,r,s);}}const Uh=Number.MAX_SAFE_INTEGER;function jh(t,e,r,n){return t.order<e||t.order===Uh||!(t.clipMask&r)||function(t,e){return 0!==e.length&&void 0===e.find((e=>e===t))}(n,t.clipScope)}function qh(t,e){return t.x-e.x||t.y-e.y}function $h(t,e){return 0===qh(t.min,e.min)&&0===qh(t.max,e.max)}function Gh(t,e){return !(t.min.x>e.max.x||t.max.x<e.min.x||t.min.y>e.max.y||t.max.y<e.min.y)}function Yh(t,e){if(t.length!==e.length)return !1;for(let r=0;r<t.length;r++)if(t[r].sourceId!==e[r].sourceId||!$h(t[r],e[r])||t[r].order!==e[r].order||t[r].clipMask!==e[r].clipMask||!$(t[r].clipScope,e[r].clipScope))return !1;return !0}function Hh(t,e,r){const n=1/Kr,i=1/(1<<r.canonical.z),s=(e.x*n+r.canonical.x)*i+r.wrap,a=(e.y*n+r.canonical.y)*i;return {min:new q((t.x*n+r.canonical.x)*i+r.wrap,(t.y*n+r.canonical.y)*i),max:new q(s,a)}}function Xh(t,e,r){const n=1<<r.canonical.z,i=((e.x-r.wrap)*n-r.canonical.x)*Kr,s=(e.y*n-r.canonical.y)*Kr;return {min:new q(((t.x-r.wrap)*n-r.canonical.x)*Kr,(t.y*n-r.canonical.y)*Kr),max:new q(i,s)}}function Zh(t,e,r,n,i,s,a){const o=t.indices,l=t.vertices,u=[];for(let c=n;c<n+i;c+=3){const n=e[r[c+0]+s],i=e[r[c+1]+s],h=e[r[c+2]+s],p=Math.min(n.x,i.x,h.x),f=Math.max(n.x,i.x,h.x),d=Math.min(n.y,i.y,h.y),m=Math.max(n.y,i.y,h.y);u.length=0,t.grid.query(new q(p,d),new q(f,m),u);for(let t=0;t<u.length;t++){const e=u[t];if(Kl(l[o[3*e+0]],l[o[3*e+1]],l[o[3*e+2]],n,i,h,a))return !0}}return !1}function Wh(t,e,r,n){if(!t||!r)return !1;let i=t.vertices;if(!e.canonical.equals(n.canonical)||e.wrap!==n.wrap){if(r.vertices.length<t.vertices.length)return Wh(r,n,t,e);const s=e.canonical,a=n.canonical,o=Math.pow(2,a.z-s.z);i=t.vertices.map((t=>new q((t.x+s.x*Kr)*o-a.x*Kr,(t.y+s.y*Kr)*o-a.y*Kr)));}return Zh(r,i,t.indices,0,t.indices.length,0,0)}function Kh(t,e,r,n){const i=Math.pow(2,n.z-r.z);return new q((t+r.x*Kr)*i-n.x*Kr,(e+r.y*Kr)*i-n.y*Kr)}function Jh(t,e){const r=[];e.grid.queryPoint(t,r);const n=e.indices,i=e.vertices;for(let e=0;e<r.length;e++){const s=r[e];if(Hl([i[n[3*s+0]],i[n[3*s+1]],i[n[3*s+2]]],t))return !0}return !1}const Qh=[new q(0,0),new q(Kr,0),new q(Kr,Kr),new q(0,Kr)];function tp(t,e){const r=[];let n=[];if(!e||t.length<2)return [t];if(2===t.length)return Zl(t[0],t[1],Qh)?[t]:[];for(let e=0;e<t.length+2;e++){const i=t[e%t.length],s=t[(e+1)%t.length],a=Zl(0===e?t[t.length-1]:t[(e-1)%t.length],i,Qh),o=Zl(i,s,Qh),l=a||o;l&&n.push(i),l&&o||n.length>0&&(n.length>1&&r.push(n),n=[]);}return n.length>1&&r.push(n),r}const ep=ah.VectorTileFeature.types,rp=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],np=["fill-extrusion-flood-light-ground-radius"],ip=Math.pow(2,13),sp=Math.pow(2,15)-1,ap=new q(0,1),op=2147483648;function lp(t,e,r,n,i,s,a,o){t.emplaceBack((e<<1)+a,(r<<1)+s,(Math.floor(n*ip)<<1)+i,Math.round(o));}function up(t,e,r){t.emplaceBack(e.x*Kr,e.y*Kr,r?1:0);}function cp(t,e,r,n,i,s){t.emplaceBack(e.x,e.y,(r.x<<1)+n,(r.y<<1)+i,s);}function hp(t,e,r){const n=16384;t.emplaceBack(e.x,e.y,e.z,r[0]*n,r[1]*n,r[2]*n);}class pp{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0;}}class fp{constructor(){this.centroidXY=new q(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new q(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new q(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0;}span(){return new q(this.max.x-this.min.x,this.max.y-this.min.y)}}class dp{constructor(){this.acc=new q(0,0),this.accCount=0,this.centroidDataIndex=0;}startRing(t,e){t.min.x===Number.MAX_VALUE&&(t.min.x=t.max.x=e.x,t.min.y=t.max.y=e.y);}appendEdge(t,e,r){this.accCount++,this.acc._add(e);let n=!!this.borders;e.x<t.min.x?(t.min.x=e.x,n=!0):e.x>t.max.x&&(t.max.x=e.x,n=!0),e.y<t.min.y?(t.min.y=e.y,n=!0):e.y>t.max.y&&(t.max.y=e.y,n=!0),((0===e.x||e.x===Kr)&&e.x===r.x)!=((0===e.y||e.y===Kr)&&e.y===r.y)&&this.processBorderOverlap(e,r),n&&this.checkBorderIntersection(e,r);}checkBorderIntersection(t,e){e.x<0!=t.x<0&&this.addBorderIntersection(0,Ee(e.y,t.y,(0-e.x)/(t.x-e.x))),e.x>Kr!=t.x>Kr&&this.addBorderIntersection(1,Ee(e.y,t.y,(Kr-e.x)/(t.x-e.x))),e.y<0!=t.y<0&&this.addBorderIntersection(2,Ee(e.x,t.x,(0-e.y)/(t.y-e.y))),e.y>Kr!=t.y>Kr&&this.addBorderIntersection(3,Ee(e.x,t.x,(Kr-e.y)/(t.y-e.y)));}addBorderIntersection(t,e){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 r=this.borders[t];e<r[0]&&(r[0]=e),e>r[1]&&(r[1]=e);}processBorderOverlap(t,e){if(t.x===e.x){if(t.y===e.y)return;const r=0===t.x?0:1;this.addBorderIntersection(r,e.y),this.addBorderIntersection(r,t.y);}else {const r=0===t.y?2:3;this.addBorderIntersection(r,e.x),this.addBorderIntersection(r,t.x);}}centroid(){return 0===this.accCount?new q(0,0):new q(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((t,e)=>t+ +(e[0]!==Number.MAX_VALUE)),0):0}}function mp(t,e){const r=t.add(e)._unit(),n=Q(t.x*r.x+t.y*r.y,-1,1);var i,s,a;return a=Math.acos(n),Math.min(4,Math.max(-4,Math.tan(a)))/4*sp*((i=t).x*(s=e).y-i.y*s.x<0?-1:1)}const yp=[t=>t.x<0,t=>t.x>Kr,t=>t.y<0,t=>t.y>Kr];function gp(t,e,r,n){const i=[4];if(0===n)return i;r._mult(n);const s=t.sub(r),a=e.sub(r),o=[t,e,s,a];for(let t=0;t<4;t++)for(const e of o)if(yp[t](e)){i.push(t);break}return i}class xp{constructor(t){this.vertexArray=new Pa,this.indexArray=new ja,this.programConfigurations=new Go(t.layers,{zoom:t.zoom,lut:t.lut},(t=>np.includes(t))),this._segments=new xo,this.hiddenByLandmarkVertexArray=new eo,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new xo;}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(t,e,r,n=!1){const i=t.length;if(i>2){let s=Math.max(0,this._segments.get().length-1);const a=this._segments._prepareSegment(4*i,this.vertexArray.length,2*this._segmentToGroundQuads[s].length);let o;s!==this._segments.get().length-1&&(s++,this._segmentToGroundQuads[s]=[],this._segmentToRegionTriCounts[s]=[0,0,0,0,0]);{const e=t[0],r=t[1];o=mp(e.sub(t[i-1])._perp()._unit(),r.sub(e)._perp()._unit());}for(let l=0;l<i;l++){const u=l===i-1?0:l+1,c=t[l],h=t[u],p=t[u===i-1?0:u+1],f=h.sub(c)._perp()._unit(),d=mp(f,p.sub(h)._perp()._unit()),m=o,y=d;if(Mp(c,h,e)||n&&Ap(c,e)&&Ap(h,e)){o=d;continue}const g=a.vertexLength;cp(this.vertexArray,c,h,1,1,m),cp(this.vertexArray,c,h,1,0,m),cp(this.vertexArray,c,h,0,1,y),cp(this.vertexArray,c,h,0,0,y),a.vertexLength+=4;const x=gp(c,h,f,r);for(const t of x)this._segmentToGroundQuads[s].push({id:g,region:t}),this._segmentToRegionTriCounts[s][t]+=2,a.primitiveLength+=2;o=d;}}}prepareBorderSegments(){if(!this.hasData())return;const t=this._segments.get(),e=t.length;for(let t=0;t<e;t++)this._segmentToGroundQuads[t].sort(((t,e)=>t.region-e.region));for(let r=0;r<e;r++){const e=this._segmentToGroundQuads[r],n=t[r],i=this._segmentToRegionTriCounts[r];i.reduce(((t,e)=>t+e),0);let s=0;for(let t=0;t<=4;t++){const e=i[t];if(0!==e){let r=this.regionSegments[t];r||(r=this.regionSegments[t]=new xo);const i={vertexOffset:n.vertexOffset,primitiveOffset:n.primitiveOffset+s,vertexLength:n.vertexLength,primitiveLength:e};r.get().push(i);}s+=e;}for(let t=0;t<e.length;t++){const r=e[t].id;this.indexArray.emplaceBack(r,r+1,r+3),this.indexArray.emplaceBack(r,r+3,r+2);}}this._segmentToGroundQuads=null,this._segmentToRegionTriCounts=null,this._segments.destroy(),this._segments=null;}addPaintPropertiesData(t,e,r,n,i,s){this.hasData()&&this.programConfigurations.populatePaintArrays(this.vertexArray.length,t,e,r,n,i,s);}upload(t){this.hasData()&&(this.vertexBuffer=t.createVertexBuffer(this.vertexArray,kh.members),this.indexBuffer=t.createIndexBuffer(this.indexArray));}uploadPaintProperties(t){this.hasData()&&this.programConfigurations.upload(t);}update(t,e,r,n,i,s,a){this.hasData()&&this.programConfigurations.updatePaintArrays(t,e,r,n,i,s,a);}updateHiddenByLandmark(t){if(!this.hasData())return;const e=t.groundVertexCount+t.groundVertexArrayOffset;if(0===t.groundVertexCount)return;const r=t.flags&op?1:0;for(let n=t.groundVertexArrayOffset;n<e;++n)this.hiddenByLandmarkVertexArray.emplace(n,r);this._needsHiddenByLandmarkUpdate=!0;}uploadHiddenByLandmark(t){this.hasData()&&this._needsHiddenByLandmarkUpdate&&(!this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexArray.length>0?this.hiddenByLandmarkVertexBuffer=t.createVertexBuffer(this.hiddenByLandmarkVertexArray,Vh.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1);}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let t=0;t<=4;t++){const e=this.regionSegments[t];e&&e.destroy();}}}}class vp{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.overscaling=t.overscaling,this.layers=t.layers,this.pixelRatio=t.pixelRatio,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=t.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new ja,this.footprintVertices=new _a,this.footprintSegments=[],this.layoutVertexArray=new Ma,this.centroidVertexArray=new po,this.wallVertexArray=new mo,this.indexArray=new ja,this.programConfigurations=new Go(t.layers,{zoom:t.zoom,lut:t.lut},(t=>rp.includes(t))),this.segments=new xo,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.groundEffect=new xp(t),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[];}updateFootprints(t,e){}populate(t,e,r,n){this.features=[],this.hasPattern=Hc("fill-extrusion",this.layers,this.pixelRatio,e),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=Al(r),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:i,id:s,index:a,sourceLayerIndex:o}of t){const t=this.layers[0]._featureFilter.needGeometry,l=Cl(i,t);if(!this.layers[0]._featureFilter.filter(new Rs(this.zoom),l,r))continue;const u={id:s,sourceLayerIndex:o,index:a,geometry:t?l.geometry:Vl(i,r,n),properties:i.properties,type:i.type,patterns:{}},c=this.layoutVertexArray.length,h="Polygon"===ep[u.type];if(this.hasPattern)this.features.push(Xc("fill-extrusion",this.layers,u,this.zoom,this.pixelRatio,e));else if(this.wallMode)for(const t of u.geometry)for(const i of tp(t,h))this.addFeature(u,[i],a,r,{},e.availableImages,n,e.brightness);else this.addFeature(u,u.geometry,a,r,{},e.availableImages,n,e.brightness);e.featureIndex.insert(i,u.geometry,a,o,this.index,c);}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0;}addFeatures(t,e,r,n,i,s){for(const t of this.features){const a="Polygon"===ep[t.type],{geometry:o}=t;if(this.wallMode)for(const l of o)for(const o of tp(l,a))this.addFeature(t,[o],t.index,e,r,n,i,s);else this.addFeature(t,o,t.index,e,r,n,i,s);}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles();}update(t,e,r,n,i,s,a){this.programConfigurations.updatePaintArrays(t,e,i,r,n,s,a),this.groundEffect.update(t,e,i,r,n,s,a);}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return !this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Dh),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.wallVertexBuffer=t.createVertexBuffer(this.wallVertexArray,Bh.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=t.createVertexBuffer(this.layoutVertexExtArray,Ch.members,!0)),this.groundEffect.upload(t)),this.groundEffect.uploadPaintProperties(t),this.programConfigurations.upload(t),this.uploaded=!0;}uploadCentroid(t){this.groundEffect.uploadHiddenByLandmark(t),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Th.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1);}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());}addFeature(t,e,r,n,i,s,a,o){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(t,{})/this.tileToMeter,u=[new q(0,0),new q(Kr,Kr)],c=a.projection,h="globe"===c.name,p=this.wallMode||"Polygon"===ep[t.type],f=new dp;f.centroidDataIndex=this.centroidData.length;const d=new fp,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(t,{},n)<=0,y=this.layers[0].paint.get("fill-extrusion-height").evaluate(t,{},n);let g;if(d.height=y,d.vertexArrayOffset=this.layoutVertexArray.length,d.groundVertexArrayOffset=this.groundEffect.vertexArray.length,h&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Ba),this.wallMode){if(h)return void pt("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==e.length)return;g=function(t){const e=t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y,r=function(t){let e=0;const r=t.length;for(let n=0;n<r;n++)e+=(t[(n+1)%r].x-t[n].x)*(t[(n+1)%r].y+t[n].y);return e>=0}(t);r||(t=t.reverse());const n={geometry:[],joinNormals:[],indices:[]},i=[],s=[],a=[];let o=t.length;for(;o>=2&&t[o-1].equals(t[o-2]);)o--;if(o<(e?3:2))return n;let l,u,c,h,p,f=0;for(;f<o-1&&t[f].equals(t[f+1]);)f++;e&&(l=t[o-2],p=t[f].sub(l)._unit()._perp());for(let r=f;r<o;r++){if(c=r===o-1?e?t[f+1]:void 0:t[r+1],c&&t[r].equals(c))continue;p&&(h=p),l&&(u=l),l=t[r],p=c?c.sub(l)._unit()._perp():h,h=h||p;let n=h.add(p);0===n.x&&0===n.y||n._unit();const d=n.x*p.x+n.y*p.y,m=0!==d?1/d:1/0,y=h.x*p.y-h.y*p.x>0;let g="miter";const x=2;"miter"===g&&m>x&&(g="bevel"),"bevel"===g&&(m>100&&(g="flipbevel"),m<x&&(g="miter"));const v=(t,e,r,n)=>{const o=new q(t.x,t.y),l=new q(t.x,t.y);o.x+=e.x*n,o.y+=e.y*n,l.x-=e.x*Math.max(r,1),l.y-=e.y*Math.max(r,1),a.push(e),i.push(o),s.push(l);};if("miter"===g)n._mult(m),v(l,n,0,0);else if("flipbevel"===g)n=p.mult(-1),v(l,n,0,0),v(l,n.mult(-1),0,0);else {const t=-Math.sqrt(m*m-1),e=y?t:0,r=y?0:t;u&&v(l,h,e,r),c&&v(l,p,e,r);}}n.geometry=[...i,...s.reverse(),i[0]],n.joinNormals=[...a,...a.reverse(),a[a.length-1]];const d=n.geometry.length-1;for(let t=0;t<d/2;t++)if(t+1<d/2){let e=t,r=t+1,i=d-1-t,s=d-2-t;e=0===e?d-1:e-1,r=0===r?d-1:r-1,i=0===i?d-1:i-1,s=0===s?d-1:s-1,n.indices.push(i),n.indices.push(r),n.indices.push(e),n.indices.push(i),n.indices.push(s),n.indices.push(r);}return n}(e[0]),e=[g.geometry];}const x=(t,e)=>t<(e.length-1)/2||t===e.length-1,v=this.wallMode?[e]:$c(e,500);for(let t=v.length-1;t>=0;t--){const e=v[t];(0===e.length||(b=e[0]).every((t=>t.x<=0))||b.every((t=>t.x>=Kr))||b.every((t=>t.y<=0))||b.every((t=>t.y>=Kr)))&&v.splice(t,1);}var b;let _;if(h)_=Ep(v,u,n);else {_=[];for(const t of v)_.push({polygon:t,bounds:u});}const w=p?this.edgeRadius:0,M=w>0&&this.zoom<17,A=(t,e)=>{if(0===t.length)return !1;const r=t[t.length-1];return e.x===r.x&&e.y===r.y};for(const{polygon:t,bounds:e}of _){let r=0,i=0;for(const e of t)p&&!e[0].equals(e[e.length-1])&&e.push(e[0]),i+=p?e.length-1:e.length;const s=this.segments.prepareSegment((p?5:4)*i,this.layoutVertexArray,this.indexArray);d.footprintSegIdx<0&&(d.footprintSegIdx=this.footprintSegments.length),d.polygonSegIdx<0&&(d.polygonSegIdx=this.polygonSegments.length);const a={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},o=new pp;if(o.vertexOffset=this.footprintVertices.length,o.indexOffset=3*this.footprintIndices.length,o.ringIndices=[],p){const i=[],a=[];r=s.vertexLength;for(let r=0;r<t.length;r++){const u=t[r];u.length&&0!==r&&a.push(i.length/2);const p=[];let f,d;f=u[1].sub(u[0])._perp()._unit(),o.ringIndices.push(u.length-1);for(let t=1;t<u.length;t++){const e=u[t],r=u[t===u.length-1?1:t+1],a=e.clone();if(w){d=r.sub(e)._perp()._unit();const t=f.add(d)._unit(),n=w*Math.min(4,1/(f.x*t.x+f.y*t.y));a.x+=n*t.x,a.y+=n*t.y,a.x=Math.round(a.x),a.y=Math.round(a.y),f=d;}if(!m||0!==w&&!M||A(p,a)||p.push(a),lp(this.layoutVertexArray,a.x,a.y,0,0,1,1,0),this.wallMode){const e=x(t,u);up(this.wallVertexArray,g.joinNormals[t],!e);}s.vertexLength++,this.footprintVertices.emplaceBack(e.x,e.y),i.push(e.x,e.y),h&&hp(this.layoutVertexExtArray,c.projectTilePoint(a.x,a.y,n),c.upVector(n,a.x,a.y));}m&&(0===w||M)&&(0!==p.length&&A(p,p[0])&&p.pop(),this.groundEffect.addData(p,e,l));}const u=this.wallMode?g.indices:vc(i,a);for(let t=0;t<u.length;t+=3)this.footprintIndices.emplaceBack(o.vertexOffset+u[t+0],o.vertexOffset+u[t+1],o.vertexOffset+u[t+2]),this.indexArray.emplaceBack(r+u[t],r+u[t+2],r+u[t+1]),s.primitiveLength++;o.indexCount+=u.length,o.vertexCount+=this.footprintVertices.length-o.vertexOffset;}for(let i=0;i<t.length;i++){const a=t[i];f.startRing(d,a[0]);let o=a.length>4&&Ip(a[a.length-2],a[0],a[1]),u=w?_p(a[a.length-2],a[0],a[1],w):0;const y=[];let v,b,_;b=a[1].sub(a[0])._perp()._unit();let M=!0;for(let t=1,i=0;t<a.length;t++){let l=a[t-1],p=a[t];const I=a[t===a.length-1?1:t+1];if(f.appendEdge(d,p,l),Mp(p,l,e)){w&&(b=I.sub(p)._perp()._unit(),M=!M);continue}const S=p.sub(l)._perp(),P=S.x/(Math.abs(S.x)+Math.abs(S.y)),E=S.y>0?1:0,z=l.dist(p);if(i+z>32768&&(i=0),w){_=I.sub(p)._perp()._unit();let t=wp(l,p,I,bp(b,_),w);isNaN(t)&&(t=0);const e=p.sub(l)._unit();l=l.add(e.mult(u))._round(),p=p.add(e.mult(-t))._round(),u=t,b=_,m&&this.zoom>=17&&(A(y,l)||y.push(l),A(y,p)||y.push(p));}const k=s.vertexLength,T=a.length>4&&Ip(l,p,I);let B=Sp(i,o,M);if(lp(this.layoutVertexArray,l.x,l.y,P,E,0,0,B),lp(this.layoutVertexArray,l.x,l.y,P,E,0,1,B),this.wallMode){const e=x(t-1,a),r=g.joinNormals[t-1];up(this.wallVertexArray,r,e),up(this.wallVertexArray,r,e);}if(i+=z,B=Sp(i,T,!M),o=T,lp(this.layoutVertexArray,p.x,p.y,P,E,0,0,B),lp(this.layoutVertexArray,p.x,p.y,P,E,0,1,B),this.wallMode){const e=x(t,a),r=g.joinNormals[t];up(this.wallVertexArray,r,e),up(this.wallVertexArray,r,e);}if(s.vertexLength+=4,this.indexArray.emplaceBack(k+0,k+1,k+2),this.indexArray.emplaceBack(k+1,k+3,k+2),s.primitiveLength+=2,w){const n=r+(1===t?a.length-2:t-2),i=1===t?r:n+1;if(this.indexArray.emplaceBack(k+1,n,k+3),this.indexArray.emplaceBack(n,i,k+3),s.primitiveLength+=2,void 0===v&&(v=k),!Mp(I,a[t],e)){const e=t===a.length-1?v:s.vertexLength;this.indexArray.emplaceBack(k+2,k+3,e),this.indexArray.emplaceBack(k+3,e+1,e),this.indexArray.emplaceBack(k+3,i,e+1),s.primitiveLength+=3;}M=!M;}if(h){const t=this.layoutVertexExtArray,e=c.projectTilePoint(l.x,l.y,n),r=c.projectTilePoint(p.x,p.y,n),i=c.upVector(n,l.x,l.y),s=c.upVector(n,p.x,p.y);hp(t,e,i),hp(t,e,i),hp(t,r,s),hp(t,r,s);}}p&&(r+=a.length-1),m&&w&&this.zoom>=17&&(0!==y.length&&A(y,y[0])&&y.pop(),this.groundEffect.addData(y,e,l,w>0));}this.footprintSegments.push(o),a.triangleCount=this.indexArray.length-a.triangleArrayOffset,this.polygonSegments.push(a),++d.footprintSegLen,++d.polygonSegLen;}if(d.vertexCount=this.layoutVertexArray.length-d.vertexArrayOffset,d.groundVertexCount=this.groundEffect.vertexArray.length-d.groundVertexArrayOffset,0!==d.vertexCount){if(d.centroidXY=f.borders?ap:this.encodeCentroid(f,d),this.centroidData.push(d),f.borders){this.featuresOnBorder.push(f);const t=this.featuresOnBorder.length-1;for(let e=0;e<f.borders.length;e++)f.borders[e][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[e].push(t);}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,s,n,o),this.groundEffect.addPaintPropertiesData(t,r,i,s,n,o),this.maxHeight=Math.max(this.maxHeight,y);}}sortBorders(){for(let t=0;t<this.borderFeatureIndices.length;t++)this.borderFeatureIndices[t].sort(((e,r)=>this.featuresOnBorder[e].borders[t][0]-this.featuresOnBorder[r].borders[t][0]));}splitToSubtiles(){const t=[];for(let e=0;e<this.centroidData.length;e++){const r=this.centroidData[e],n=+(r.min.y+r.max.y>Kr),i=2*n+(+(r.min.x+r.max.x>Kr)^n);for(let n=0;n<r.polygonSegLen;n++){const s=r.polygonSegIdx+n;t.push({centroidIdx:e,subtile:i,polygonSegmentIdx:s,triangleSegmentIdx:this.polygonSegments[s].triangleSegIdx});}}const e=new ja;t.sort(((t,e)=>t.triangleSegmentIdx===e.triangleSegmentIdx?t.subtile-e.subtile:t.triangleSegmentIdx-e.triangleSegmentIdx));let r=0,n=0,i=0;for(const e of t){if(e.triangleSegmentIdx!==r)break;i++;}const s=t.length;for(;n!==t.length;){r=t[n].triangleSegmentIdx;let a=0,o=n,l=n;for(let e=o;e<i&&t[e].subtile===a;e++)l++;for(;o!==i;){const n=t[o];a=n.subtile;const s=this.centroidData[n.centroidIdx].min.clone(),u=this.centroidData[n.centroidIdx].max.clone(),c={vertexOffset:this.segments.segments[r].vertexOffset,primitiveOffset:e.length,vertexLength:this.segments.segments[r].vertexLength,primitiveLength:0,sortKey:void 0,vaos:{}};for(let r=o;r<l;r++){const n=t[r],i=this.polygonSegments[n.polygonSegmentIdx],a=this.centroidData[n.centroidIdx].min,o=this.centroidData[n.centroidIdx].max,l=this.indexArray.uint16;for(let t=i.triangleArrayOffset;t<i.triangleArrayOffset+i.triangleCount;t++)e.emplaceBack(l[3*t],l[3*t+1],l[3*t+2]);c.primitiveLength+=i.triangleCount,s.x=Math.min(s.x,a.x),s.y=Math.min(s.y,a.y),u.x=Math.max(u.x,o.x),u.y=Math.max(u.y,o.y);}c.primitiveLength>0&&this.triangleSubSegments.push({segment:c,min:s,max:u}),o=l;for(let e=o;e<i&&t[e].subtile===t[o].subtile;e++)l++;}n=i;for(let e=n;e<s&&t[e].triangleSegmentIdx===t[n].triangleSegmentIdx;e++)i++;}e._trim(),this.indexArray=e;}getVisibleSegments(t,e,r){const n=new xo;if(this.wallMode){for(const t of this.triangleSubSegments)n.segments.push(t.segment);return n}let i=0,s=0;const a=1<<t.canonical.z;if(e){const r=e.getMinMaxForTile(t);r&&(i=r.min,s=r.max);}s+=this.maxHeight;const o=t.toUnwrapped();let l;const u=[o.canonical.x/a+o.wrap,o.canonical.y/a],c=[(o.canonical.x+1)/a+o.wrap,(o.canonical.y+1)/a],h=(t,e,r)=>[t[0]*(1-r[0])+e[0]*r[0],t[1]*(1-r[1])+e[1]*r[1]],p=[],f=[];for(const t of this.triangleSubSegments){p[0]=t.min.x/Kr,p[1]=t.min.y/Kr,f[0]=t.max.x/Kr,f[1]=t.max.y/Kr;const e=h(u,c,p),a=h(u,c,f);if(0===new Au([e[0],e[1],i],[a[0],a[1],s]).intersectsPrecise(r)){l&&(n.segments.push(l),l=void 0);continue}const o=t.segment;l&&l.vertexOffset!==o.vertexOffset&&(n.segments.push(l),l=void 0),l?(l.vertexLength+=o.vertexLength,l.primitiveLength+=o.primitiveLength):l={vertexOffset:o.vertexOffset,primitiveLength:o.primitiveLength,vertexLength:o.vertexLength,primitiveOffset:o.primitiveOffset,sortKey:void 0,vaos:{}};}return l&&n.segments.push(l),n}encodeCentroid(t,e){const r=t.centroid(),n=e.span(),i=Math.min(7,Math.round(n.x*this.tileToMeter/10)),s=Math.min(7,Math.round(n.y*this.tileToMeter/10));return new q(Q(r.x,1,Kr-1)<<3|i,Q(r.y,1,Kr-1)<<3|s)}encodeBorderCentroid(t){if(!t.borders)return new q(0,0);const e=t.borders,r=Number.MAX_VALUE;if(e[0][0]!==r||e[1][0]!==r){const t=e[0][0]!==r?0:1;return new q(6|(e[0][0]!==r?0:65528),(e[t][0]+e[t][1])/2<<3|6)}{const t=e[2][0]!==r?2:3;return new q((e[t][0]+e[t][1])/2<<3|6,6|(e[2][0]!==r?0:65528))}}showCentroid(t){const e=this.centroidData[t.centroidDataIndex];e.flags&=op,e.centroidXY.x=0,e.centroidXY.y=0,this.writeCentroidToBuffer(e);}writeCentroidToBuffer(t){this.groundEffect.updateHiddenByLandmark(t);const e=t.vertexArrayOffset,r=t.vertexCount+t.vertexArrayOffset,n=t.flags&op?ap:t.centroidXY,i=this.centroidVertexArray.geta_centroid_pos0(e);if(this.centroidVertexArray.geta_centroid_pos1(e)!==n.y||i!==n.x){for(let t=e;t<r;++t)this.centroidVertexArray.emplace(t,n.x,n.y);this.needsCentroidUpdate=!0;}}createCentroidsBuffer(){this.centroidVertexArray.resize(this.layoutVertexArray.length),this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const t of this.centroidData)this.writeCentroidToBuffer(t);}updateReplacement(t,e,r){if(e.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=e.updateTime;const n=e.getReplacementRegionsForTile(t.toUnwrapped());if(Yh(this.activeReplacements,n))return;if(this.activeReplacements=n,0===this.centroidVertexArray.length)this.createCentroidsBuffer();else for(const t of this.centroidData)t.flags&=2147483647;const i=[];for(const e of this.activeReplacements){if(e.order<r)continue;const n=Math.max(1,Math.pow(2,e.footprintTileId.canonical.z-t.canonical.z));for(const r of this.centroidData)if(!(r.flags&op||e.min.x>r.max.x||r.min.x>e.max.x||e.min.y>r.max.y||r.min.y>e.max.y))for(let s=0;s<r.footprintSegLen;s++){const a=this.footprintSegments[r.footprintSegIdx+s];if(i.length=0,zp(this.footprintVertices,a.vertexOffset,a.vertexCount,e.footprintTileId.canonical,t.canonical,i),Zh(e.footprint,i,this.footprintIndices.uint16,a.indexOffset,a.indexCount,-a.vertexOffset,-n)){r.flags|=op;break}}}for(const t of this.centroidData)this.writeCentroidToBuffer(t);this.borderDoneWithNeighborZ=[-1,-1,-1,-1];}footprintContainsPoint(t,e,r){let n=!1;for(let i=0;i<r.footprintSegLen;i++){const s=this.footprintSegments[r.footprintSegIdx+i];let a=0;for(const r of s.ringIndices){for(let i=a,o=r+a-1;i<r+a;o=i++){const r=this.footprintVertices.int16[2*(i+s.vertexOffset)+0],a=this.footprintVertices.int16[2*(i+s.vertexOffset)+1],l=this.footprintVertices.int16[2*(o+s.vertexOffset)+1];a>e!=l>e&&t<(this.footprintVertices.int16[2*(o+s.vertexOffset)+0]-r)*(e-a)/(l-a)+r&&(n=!n);}a=r;}}return n}getHeightAtTileCoord(t,e){let r=Number.NEGATIVE_INFINITY,n=!0;const i=4*(t+Kr)*Kr+(e+Kr);if(this.partLookup.hasOwnProperty(i)){const t=this.partLookup[i];return t?{height:t.height,hidden:!!(t.flags&op)}:void 0}for(const s of this.centroidData)t>s.max.x||s.min.x>t||e>s.max.y||s.min.y>e||this.footprintContainsPoint(t,e,s)&&s&&s.height>r&&(r=s.height,this.partLookup[i]=s,n=!!(s.flags&op));if(r!==Number.NEGATIVE_INFINITY)return {height:r,hidden:n};this.partLookup[i]=void 0;}}function bp(t,e){const r=t.add(e)._unit();return t.x*r.x+t.y*r.y}function _p(t,e,r,n){const i=e.sub(t)._perp()._unit(),s=r.sub(e)._perp()._unit();return wp(t,e,r,bp(i,s),n)}function wp(t,e,r,n,i){const s=Math.sqrt(1-n*n);return Math.min(t.dist(e)/3,e.dist(r)/3,i*s/n)}function Mp(t,e,r){return t.x<r[0].x&&e.x<r[0].x||t.x>r[1].x&&e.x>r[1].x||t.y<r[0].y&&e.y<r[0].y||t.y>r[1].y&&e.y>r[1].y}function Ap(t,e){return t.x<e[0].x||t.x>e[1].x||t.y<e[0].y||t.y>e[1].y}function Ip(t,e,r){if(t.x<0||t.x>=Kr||e.x<0||e.x>=Kr||r.x<0||r.x>=Kr)return !1;const n=r.sub(e),i=n.perp(),s=t.sub(e);return (n.x*s.x+n.y*s.y)/Math.sqrt((n.x*n.x+n.y*n.y)*(s.x*s.x+s.y*s.y))>-.866&&i.x*s.x+i.y*s.y<0}function Sp(t,e,r){const n=e?2|t:-3&t;return r?1|n:-2&n}function Pp(){const t=Math.PI/32,e=Math.tan(t),r=ol;return r*Math.sqrt(1+2*e*e)-r}function Ep(t,e,r){const n=1<<r.z,i=gl(r.x/n),s=gl((r.x+1)/n),a=xl(r.y/n),o=xl((r.y+1)/n);return function(t,e,r,n,i=0,s){const a=[];if(!t.length||!r||!n)return a;const o=(t,e)=>{for(const r of t)a.push({polygon:r,bounds:e});},l=Math.ceil(Math.log2(r)),u=Math.ceil(Math.log2(n)),c=l-u,h=[];for(let t=0;t<Math.abs(c);t++)h.push(c>0?0:1);for(let t=0;t<Math.min(l,u);t++)h.push(0),h.push(1);let p=t;if(p=Fh(p,e[0].y-i,e[1].y+i,1),p=Fh(p,e[0].x-i,e[1].x+i,0),!p.length)return a;const f=[];for(h.length?f.push({polygons:p,bounds:e,depth:0}):o(p,e);f.length;){const t=f.pop(),e=t.depth,r=h[e],n=t.bounds[0],a=t.bounds[1],l=0===r?n.x:n.y,u=0===r?a.x:a.y,c=s?s(r,l,u):.5*(l+u),p=Fh(t.polygons,l-i,c+i,r),d=Fh(t.polygons,c-i,u+i,r);if(p.length){const t=[n,new q(0===r?c:a.x,1===r?c:a.y)];h.length>e+1?f.push({polygons:p,bounds:t,depth:e+1}):o(p,t);}if(d.length){const t=[new q(0===r?c:n.x,1===r?c:n.y),a];h.length>e+1?f.push({polygons:d,bounds:t,depth:e+1}):o(d,t);}}return a}(t,e,Math.ceil((s-i)/11.25),Math.ceil((a-o)/11.25),1,((t,e,i)=>{if(0===t)return .5*(e+i);{const t=xl((r.y+e/Kr)/n);return (ml(.5*(xl((r.y+i/Kr)/n)+t))*n-r.y)*Kr}}))}function zp(t,e,r,n,i,s){const a=Math.pow(2,n.z-i.z);for(let o=0;o<r;o++){let r=t.int16[2*(o+e)+0],l=t.int16[2*(o+e)+1];r=(r+i.x*Kr)*a-n.x*Kr,l=(l+i.y*Kr)*a-n.y*Kr,s.push(new q(r,l));}}let kp,Tp;function Bp(t,e){return t.x*e.x+t.y*e.y}function Vp(t,e){if(1===t.length){let r=0;const n=e[r++];let i;for(;!i||n.equals(i);)if(i=e[r++],!i)return 1/0;for(;r<e.length;r++){const s=e[r],a=t[0],o=i.sub(n),l=s.sub(n),u=a.sub(n),c=Bp(o,o),h=Bp(o,l),p=Bp(l,l),f=Bp(u,o),d=Bp(u,l),m=c*p-h*h,y=(p*f-h*d)/m,g=(c*d-h*f)/m,x=n.z*(1-y-g)+i.z*y+s.z*g;if(isFinite(x))return x}return 1/0}{let t=1/0;for(const r of e)t=Math.min(t,r.z);return t}}function Cp(t,e,r,n,i,s,a,o){const l=a*i.getElevationAt(t,e,!0,!0),u=0!==s[0],c=u?0===s[1]?a*(s[0]/7-450):a*function(t,e,r){const n=Math.floor(e[0]/8),i=Math.floor(e[1]/8),s=10*(e[0]-8*n),a=10*(e[1]-8*i),o=t.getElevationAt(n,i,!0,!0),l=t.getMeterToDEM(r),u=Math.floor(.5*(s*l-1)),c=Math.floor(.5*(a*l-1)),h=t.tileCoordToPixel(n,i),p=2*u+1,f=2*c+1,d=function(t,e,r,n,i){return [t.getElevationAtPixel(e,r,!0),t.getElevationAtPixel(e+i,r,!0),t.getElevationAtPixel(e,r+i,!0),t.getElevationAtPixel(e+n,r+i,!0)]}(t,h.x-u,h.y-c,p,f),m=Math.abs(d[0]-d[1]),y=Math.abs(d[2]-d[3]),g=Math.abs(d[0]-d[2])+Math.abs(d[1]-d[3]),x=Math.min(.25,.5*l*(m+y)/p),v=Math.min(.25,.5*l*g/f);return o+Math.max(x*s,v*a)}(i,s,o):l;return {base:l+(0===r?-1:r),top:u?Math.max(c+n,l+r+2):l+n}}us(vp,"FillExtrusionBucket",{omit:["layers","features"]}),us(fp,"PartData"),us(pp,"FootprintSegment"),us(dp,"BorderCentroidData"),us(xp,"GroundEffect");const Dp=va([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),Rp=va([{name:"a_z_offset_width",components:3,type:"Float32"}],4),{members:Lp}=Dp,Fp=va([{name:"a_packed",components:3,type:"Float32"}]),{members:Op}=Fp,Np=va([{name:"a_pattern_data",components:3,type:"Float32"}]),{members:Up}=Np;class jp{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.image=new hc({width:t,height:e}),this.positions={},this.uploaded=!1;}getDash(t,e){const r=this.getKey(t,e);return this.positions[r]}trim(){const t=this.width,e=this.height=at(this.nextRow);this.image.resize({width:t,height:e});}getKey(t,e){return t.join(",")+e}getDashRanges(t,e,r){const n=[];let i=t.length%2==1?-t[t.length-1]*r:0,s=t[0]*r,a=!0;n.push({left:i,right:s,isDash:a,zeroLength:0===t[0]});let o=t[0];for(let e=1;e<t.length;e++){a=!a;const l=t[e];i=o*r,o+=l,s=o*r,n.push({left:i,right:s,isDash:a,zeroLength:0===l});}return n}addRoundDash(t,e,r){const n=e/2;for(let e=-r;e<=r;e++){const i=this.width*(this.nextRow+r+e);let s=0,a=t[s];for(let o=0;o<this.width;o++){o/a.right>1&&(a=t[++s]);const l=Math.abs(o-a.left),u=Math.abs(o-a.right),c=Math.min(l,u);let h;const p=e/r*(n+1);if(a.isDash){const t=n-Math.abs(p);h=Math.sqrt(c*c+t*t);}else h=n-Math.sqrt(c*c+p*p);this.image.data[i+o]=Math.max(0,Math.min(255,h+128));}}}addRegularDash(t,e){for(let e=t.length-1;e>=0;--e){const r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1));}const r=t[0],n=t[t.length-1];r.isDash===n.isDash&&(r.left=n.left-this.width,n.right=r.right+this.width);const i=this.width*this.nextRow;let s=0,a=t[s];for(let r=0;r<this.width;r++){r/a.right>1&&(a=t[++s]);const n=Math.abs(r-a.left),o=Math.abs(r-a.right),l=Math.min(n,o);this.image.data[i+r]=Math.max(0,Math.min(255,(a.isDash?l:-l)+e+128));}}addDash(t,e){const r=this.getKey(t,e);if(this.positions[r])return this.positions[r];const n="round"===e,i=n?7:0,s=2*i+1;if(this.nextRow+s>this.height)return pt("LineAtlas out of space"),null;0===t.length&&t.push(1);let a=0;for(let e=0;e<t.length;e++)t[e]<0&&(pt("Negative value is found in line dasharray, replacing values with 0"),t[e]=0),a+=t[e];if(0!==a){const r=this.width/a,s=this.getDashRanges(t,this.width,r);n?this.addRoundDash(s,r,i):this.addRegularDash(s,"square"===e?.5*r:0);}const o=this.nextRow+i;this.nextRow+=s;const l={tl:[o,i],br:[a,0]};return this.positions[r]=l,l}}us(jp,"LineAtlas");const qp=ah.VectorTileFeature.types,$p=Math.cos(Math.PI/180*37.5),Gp=Math.cos(Math.PI/180*5);class Yp{constructor(t){this.evaluationGlobals={zoom:0,lineProgress:void 0},this.zoom=t.zoom,this.evaluationGlobals.zoom=this.zoom,this.overscaling=t.overscaling,this.pixelRatio=t.pixelRatio,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.projection=t.projection,this.hasPattern=!1,this.hasZOffset=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={};})),this.layoutVertexArray=new Ea,this.layoutVertexArray2=new za,this.patternVertexArray=new za,this.indexArray=new ja,this.programConfigurations=new Go(t.layers,{zoom:t.zoom,lut:t.lut}),this.segments=new xo,this.maxLineLength=0,this.zOffsetVertexArray=new za,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.tessellationStep=t.tessellationStep?t.tessellationStep:Kr/64;}updateFootprints(t,e){}populate(t,e,r,n){this.hasPattern=Hc("line",this.layers,this.pixelRatio,e);const i=this.layers[0].layout.get("line-sort-key");this.tileToMeter=Al(r);const s=this.layers[0].layout.get("line-z-offset"),a=s.isConstant()&&!s.constantOr(0),o=this.layers[0].layout.get("line-elevation-reference");this.hasZOffset="sea"===o||"ground"===o||!a&&"none"===o,this.hasZOffset&&"none"===o&&pt(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`);const l=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope=this.hasZOffset&&void 0!==l;const u=[];for(const{feature:e,id:s,index:a,sourceLayerIndex:o}of t){const t=this.layers[0]._featureFilter.needGeometry,l=Cl(e,t);if(!this.layers[0]._featureFilter.filter(new Rs(this.zoom),l,r))continue;const c=i?i.evaluate(l,{},r):void 0,h={id:s,properties:e.properties,type:e.type,sourceLayerIndex:o,index:a,geometry:t?l.geometry:Vl(e,r,n),patterns:{},sortKey:c};u.push(h);}i&&u.sort(((t,e)=>t.sortKey-e.sortKey));const{lineAtlas:c,featureIndex:h}=e,p=this.addConstantDashes(c);for(const n of u){const{geometry:i,index:s,sourceLayerIndex:a}=n;if(p&&this.addFeatureDashes(n,c),this.hasPattern){const t=Xc("line",this.layers,n,this.zoom,this.pixelRatio,e);this.patternFeatures.push(t);}else this.addFeature(n,i,s,r,c.positions,e.availableImages,e.brightness);h.insert(t[s].feature,i,s,a,this.index);}}addConstantDashes(t){let e=!1;for(const r of this.layers){const n=r.paint.get("line-dasharray").value,i=r.layout.get("line-cap").value;if("constant"!==n.kind||"constant"!==i.kind)e=!0;else {const e=i.value,r=n.value;if(!r)continue;t.addDash(r,e);}}return e}addFeatureDashes(t,e){const r=this.zoom;for(const n of this.layers){const i=n.paint.get("line-dasharray").value,s=n.layout.get("line-cap").value;if("constant"===i.kind&&"constant"===s.kind)continue;let a,o;if("constant"===i.kind){if(a=i.value,!a)continue}else a=i.evaluate({zoom:r},t);o="constant"===s.kind?s.value:s.evaluate({zoom:r},t),e.addDash(a,o),t.patterns[n.id]=e.getKey(a,o);}}update(t,e,r,n,i,s,a){this.programConfigurations.updatePaintArrays(t,e,i,r,n,s,a);}addFeatures(t,e,r,n,i,s){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r,n,s);}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return !this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Op)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=t.createVertexBuffer(this.patternVertexArray,Up)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=t.createVertexBuffer(this.zOffsetVertexArray,Rp.members,!0)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Lp),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());}lineFeatureClips(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return {start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,r,n,i,s,a){const o=this.layers[0].layout,l=o.get("line-join").evaluate(t,{}),u=o.get("line-cap").evaluate(t,{}),c=o.get("line-miter-limit"),h=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t),this.lineFeature=t,this.zOffsetValue=o.get("line-z-offset").value;const p=this.layers[0].paint.get("line-width").value;"constant"!==p.kind&&!1===p.isLineProgressConstant&&(this.variableWidthValue=p);for(const r of e)this.addLine(r,t,n,l,u,c,h);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,s,n,a);}addLine(t,e,r,n,i,s,a){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0;const o="none"===n;if(this.patternJoinNone=this.hasPattern&&o,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.totalFeatureLength=this.totalDistance/(this.lineClips.end-this.lineClips.start),this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance);}const l="Polygon"===qp[e.type];let u=t.length;for(;u>=2&&t[u-1].equals(t[u-2]);)u--;let c=0;for(;c<u-1&&t[c].equals(t[c+1]);)c++;if(u<(l?3:2))return;"bevel"===n&&(s=1.05);const h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray);let p,f,d,m,y,g;this.e1=this.e2=-1,l&&(p=t[u-2],y=t[c].sub(p)._unit()._perp());for(let e=c;e<u;e++){if(d=e===u-1?l?t[c+1]:void 0:t[e+1],d&&t[e].equals(d))continue;y&&(m=y),p&&(f=p),p=t[e],g=this.evaluateLineProgressFeatures(f?f.dist(p):0),y=d?d.sub(p)._unit()._perp():m,m=m||y;const r=f&&d;let x=r?n:l||o?"butt":i;const v=m.x*y.x+m.y*y.y;if(o){const t=function(t){if(t.patternJoinNone){const e=t.segmentPoints.length/2,r=t.lineSoFar-t.segmentStart;for(let n=0;n<e;++n){const e=t.segmentPoints[2*n+1],i=Math.round(t.segmentPoints[2*n])+.5+.25*e;t.patternVertexArray.emplaceBack(i,r,t.segmentStart),t.patternVertexArray.emplaceBack(i,r,t.segmentStart);}t.segmentPoints.length=0;}t.e1=t.e2=-1;};if(r&&v<Gp){this.updateDistance(f,p),this.addCurrentVertex(p,m,1,1,h,g),t(this),this.addCurrentVertex(p,y,-1,-1,h,g);continue}if(f){if(!d){this.updateDistance(f,p),this.addCurrentVertex(p,m,1,1,h,g),t(this);continue}x="miter";}}let b=m.add(y);0===b.x&&0===b.y||b._unit();const _=b.x*y.x+b.y*y.y,w=0!==_?1/_:1/0,M=2*Math.sqrt(2-2*_),A=_<$p&&f&&d,I=m.x*y.y-m.y*y.x>0,S=this.overscaling<=16?15*Kr/(512*this.overscaling):0;if(r&&"round"===x)if(w<a)x="miter";else if(w<=2){const t=Hp(p,-10,Kr+10);x=this.hasZOffset&&(t||this.hasCrossSlope)?"miter":"fakeround";}if("miter"===x&&w>s&&(x="bevel"),"bevel"===x&&(w>2&&(x="flipbevel"),w<s&&(x="miter")),f&&!("miter"===x&&A)&&this.updateDistance(f,p),"miter"===x)if(A){const t=p.dist(f);if(t>2*S){const e=p.sub(p.sub(f)._mult(S/t)._round());this.updateDistance(f,e),this.addCurrentVertex(e,m,0,0,h,g),f=e;}this.updateDistance(f,p),b._mult(w),this.addCurrentVertex(p,b,0,0,h,g);const e=p.dist(d);if(e>2*S){const t=p.add(d.sub(p)._mult(S/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,y,0,0,h,g),p=t;}}else b._mult(w),this.addCurrentVertex(p,b,0,0,h,g);else if("flipbevel"===x){if(w>100)b=y.mult(-1);else {const t=w*m.add(y).mag()/m.sub(y).mag();b._perp()._mult(t*(I?-1:1));}this.addCurrentVertex(p,b,0,0,h,g),this.addCurrentVertex(p,b.mult(-1),0,0,h,g);}else if("bevel"===x||"fakeround"===x){null!=g&&f&&this.addCurrentVertex(p,m,-1,-1,h,g);const t=p.dist(f)<=2*S&&"bevel"!==x,e=b.mult(I?1:-1);e._mult(w);const r=y.mult(I?-1:1),n=m.mult(I?-1:1),i=this.evaluateLineProgressFeatures(this.distance);if(null==g&&(this.addHalfVertex(p,e.x,e.y,!1,!I,0,h,i),t||this.addHalfVertex(p,e.x+2*n.x,e.y+2*n.y,!1,I,0,h,i)),"fakeround"===x){const t=Math.round(180*M/Math.PI/20);this.addHalfVertex(p,n.x,n.y,!1,I,0,h,i);for(let e=0;e<t;e++){let s=e/t;if(.5!==s){const t=s-.5;s+=s*t*(s-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*t*t+(.848013+v*(.215638*v-1.06021)));}const a=r.sub(n)._mult(s)._add(n)._unit();this.addHalfVertex(p,a.x,a.y,!1,I,0,h,i);}this.addHalfVertex(p,r.x,r.y,!1,I,0,h,i);}t||null!=g||this.addHalfVertex(p,e.x+2*r.x,e.y+2*r.y,!1,I,0,h,i),null!=g&&d&&this.addCurrentVertex(p,y,1,1,h,g);}else "butt"===x?this.addCurrentVertex(p,b,0,0,h,g):"square"===x?(f||this.addCurrentVertex(p,b,-1,-1,h,g),this.addCurrentVertex(p,b,0,0,h,g),f&&this.addCurrentVertex(p,b,1,1,h,g)):"round"===x&&(f&&(this.addCurrentVertex(p,m,0,0,h,g),this.addCurrentVertex(p,m,1,1,h,g,!0)),d&&(this.addCurrentVertex(p,y,-1,-1,h,g,!0),this.addCurrentVertex(p,y,0,0,h,g)));}}addVerticesTo(t,e,r,n,i,s,a,o,l,u){const c=(e.w-t.w)/this.tessellationStep|0;let h=0;const p=this.scaledDistance;if(c>1){this.lineSoFar=t.w;const p=(e.x-t.x)/c,f=(e.y-t.y)/c,d=(e.z-t.z)/c,m=(e.w-t.w)/c;for(let e=1;e<c;++e){t.x+=p,t.y+=f,t.z+=d,this.lineSoFar+=m,h+=m;const e=this.evaluateLineProgressFeatures(this.prevDistance+h);this.scaledDistance=(this.prevDistance+h)/this.totalDistance,this.addHalfVertex(t,r,n,u,!1,a,l,e),this.addHalfVertex(t,i,s,u,!0,-o,l,e);}}this.lineSoFar=e.w,this.scaledDistance=p;const f=this.evaluateLineProgressFeatures(this.distance);this.addHalfVertex(e,r,n,u,!1,a,l,f),this.addHalfVertex(e,i,s,u,!0,-o,l,f);}evaluateLineProgressFeatures(t){if(!this.variableWidthValue&&!this.hasZOffset)return null;this.evaluationGlobals.lineProgress=0,this.lineClips?this.evaluationGlobals.lineProgress=Math.min(1,(this.totalFeatureLength*this.lineClips.start+t)/this.totalFeatureLength):pt(`line-progress evaluation for ${this.layerIds[0]} requires enabling 'lineMetrics' for the source.`);let e=0;return this.variableWidthValue&&"constant"!==this.variableWidthValue.kind&&(e=this.variableWidthValue.evaluate(this.evaluationGlobals,this.lineFeature)||0),this.hasZOffset?"constant"===this.zOffsetValue.kind?{zOffset:this.zOffsetValue.value,variableWidth:e}:{zOffset:this.zOffsetValue.evaluate(this.evaluationGlobals,this.lineFeature)||0,variableWidth:e}:{zOffset:0,variableWidth:e}}addCurrentVertex(t,e,r,n,i,s,a=!1){const o=e.x+e.y*r,l=e.y-e.x*r,u=e.y*n-e.x,c=-e.y-e.x*n;if(null!=s){const e=this.hasZOffset,h=-10,p=Kr+10,f=s.zOffset,d=new Lh(t.x,t.y,f,this.lineSoFar),m=!!e&&Hp(t,h,p),y=this.lineSoFar,g=this.distance;if(this.currentVertex)if(m){const e=this.currentVertexIsOutside,s=this.currentVertex,m=new Lh(t.x,t.y,f,this.lineSoFar);if(Nh(s,m,h,p),!Hp(m,h,p)){if(e){this.e1=this.e2=-1,this.distance-=s.dist(d),this.lineSoFar=s.w;const t=this.evaluateLineProgressFeatures(s.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(s,o,l,a,!1,r,i,t),this.addHalfVertex(s,u,c,a,!0,-n,i,t),this.prevDistance=this.distance;}this.distance=this.prevDistance+s.dist(m),this.scaledDistance=this.distance/this.totalDistance,this.addVerticesTo(s,m,o,l,u,c,r,n,i,a),this.distance=g,this.scaledDistance=this.distance/this.totalDistance;}}else {const t=this.currentVertex;if(this.currentVertexIsOutside){Nh(t,d,h,p),this.e1=this.e2=-1,this.distance-=t.dist(d),this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=t.w;const e=this.evaluateLineProgressFeatures(t.w-this.totalFeatureLength*(this.lineClips?this.lineClips.start:0));this.addHalfVertex(t,o,l,a,!1,r,i,e),this.addHalfVertex(t,u,c,a,!0,-n,i,e),this.prevDistance=this.distance,this.distance=g,this.scaledDistance=this.distance/this.totalDistance;}this.addVerticesTo(t,d,o,l,u,c,r,n,i,a);}else m||(this.addHalfVertex(t,o,l,a,!1,r,i,s),this.addHalfVertex(t,u,c,a,!0,-n,i,s));this.currentVertex=d,this.currentVertexIsOutside=m,this.lineSoFar=y;}else this.addHalfVertex(t,o,l,a,!1,r,i,s),this.addHalfVertex(t,u,c,a,!0,-n,i,s);}addHalfVertex({x:t,y:e},r,n,i,s,a,o,l){if(this.patternJoinNone&&(0===this.segmentPoints.length&&(this.segmentStart=this.lineSoFar,this.segmentStartf32=Math.fround(this.lineSoFar)),s||this.segmentPoints.push(this.lineSoFar-this.segmentStart,a)),this.layoutVertexArray.emplaceBack((t<<1)+(i?1:0),(e<<1)+(s?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar-this.segmentStartf32),this.lineClips){const t=Ee(this.lineClips.start,this.lineClips.end,this.scaledDistance);this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,t);}const u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),s?this.e2=u:this.e1=u,null!=l&&this.zOffsetVertexArray.emplaceBack(l.zOffset,l.variableWidth,l.variableWidth);}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance;}updateDistance(t,e){this.prevDistance=this.distance,this.distance+=t.dist(e),this.updateScaledDistance();}}function Hp(t,e,r){return t.x<e||t.x>r||t.y<e||t.y>r}let Xp,Zp;function Wp(t,e,r){return e*(Kr/(t.tileSize*Math.pow(2,r-t.tileID.overscaledZ)))}us(Yp,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const Kp=(t,e,r)=>(1-r)*t+r*e;function Jp(t,e){return 1/Wp(t,1,e.tileZoom)}function Qp(t,e,r,n){return t.translatePosMatrix(n||e.tileID.projMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const tf=t=>{const e=[];ef(t)&&e.push("RENDER_LINE_DASH"),t.paint.get("line-gradient")&&e.push("RENDER_LINE_GRADIENT");const r=t.paint.get("line-trim-offset");0===r[0]&&0===r[1]||e.push("RENDER_LINE_TRIM_OFFSET"),0!==t.paint.get("line-border-width").constantOr(1)&&e.push("RENDER_LINE_BORDER");const n="none"===t.layout.get("line-join").constantOr("miter"),i=!!t.paint.get("line-pattern").constantOr(1);return n&&i&&e.push("LINE_JOIN_NONE"),e};function ef(t){const e=t.paint.get("line-dasharray").value;return e.value||"constant"!==e.kind}let rf;const nf=()=>rf||(rf={layout:Xp||(Xp=new Xs({"line-cap":new Ys(Zs.layout_line["line-cap"]),"line-join":new Ys(Zs.layout_line["line-join"]),"line-miter-limit":new Gs(Zs.layout_line["line-miter-limit"]),"line-round-limit":new Gs(Zs.layout_line["line-round-limit"]),"line-sort-key":new Ys(Zs.layout_line["line-sort-key"]),"line-z-offset":new Ys(Zs.layout_line["line-z-offset"]),"line-elevation-reference":new Gs(Zs.layout_line["line-elevation-reference"]),"line-cross-slope":new Gs(Zs.layout_line["line-cross-slope"]),visibility:new Gs(Zs.layout_line.visibility),"line-width-unit":new Gs(Zs.layout_line["line-width-unit"])})),paint:Zp||(Zp=new Xs({"line-opacity":new Ys(Zs.paint_line["line-opacity"]),"line-color":new Ys(Zs.paint_line["line-color"]),"line-translate":new Gs(Zs.paint_line["line-translate"]),"line-translate-anchor":new Gs(Zs.paint_line["line-translate-anchor"]),"line-width":new Ys(Zs.paint_line["line-width"]),"line-gap-width":new Ys(Zs.paint_line["line-gap-width"]),"line-offset":new Ys(Zs.paint_line["line-offset"]),"line-blur":new Ys(Zs.paint_line["line-blur"]),"line-dasharray":new Ys(Zs.paint_line["line-dasharray"]),"line-pattern":new Ys(Zs.paint_line["line-pattern"]),"line-gradient":new Hs(Zs.paint_line["line-gradient"]),"line-trim-offset":new Gs(Zs.paint_line["line-trim-offset"]),"line-trim-fade-range":new Gs(Zs.paint_line["line-trim-fade-range"]),"line-trim-color":new Gs(Zs.paint_line["line-trim-color"]),"line-emissive-strength":new Gs(Zs.paint_line["line-emissive-strength"]),"line-border-width":new Ys(Zs.paint_line["line-border-width"]),"line-border-color":new Ys(Zs.paint_line["line-border-color"]),"line-occlusion-opacity":new Gs(Zs.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},rf);class sf extends Ys{possiblyEvaluate(t,e){return e=new Rs(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,n){return e=nt({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,n)}}let af;function of(t,e){return e>0?e+2*t:t}const lf=va([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),uf=va([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),cf=va([{name:"a_projected_pos",components:4,type:"Float32"}],4);va([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const hf=va([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),pf=va([{name:"a_texb",components:2,type:"Uint16"}]),ff=va([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),df=va([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);va([{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 mf=va([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),yf=va([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);va([{name:"triangle",components:3,type:"Uint16"}]),va([{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"}]),va([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{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"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}]),va([{type:"Float32",name:"offsetX"}]),va([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var gf=24;const xf=128;function vf(t,e,r,n,i){if("camera"===t.kind)return t.maxSize;if("composite"===t.kind){const n=e.possiblyEvaluate(new Rs(t.maxZoom),r).evaluate(i,{},r),s=e.possiblyEvaluate(new Rs(t.minZoom),r).evaluate(i,{},r);return Math.max(n,s)}return e.possiblyEvaluate(new Rs(n)).evaluate(i,{},r)}function bf(t,e){const{expression:r}=e;if("constant"===r.kind)return {kind:"constant",layoutSize:r.evaluate(new Rs(t+1))};if("source"===r.kind)return {kind:"source"};{const{zoomStops:e,interpolationType:n}=r;let i=0;for(;i<e.length&&e[i]<=t;)i++;i=Math.max(0,i-1);let s=i;for(;s<e.length&&e[s]<t+1;)s++;s=Math.min(e.length-1,s);const a=e[i],o=e[s];return "composite"===r.kind?{kind:"composite",minZoom:a,maxZoom:o,interpolationType:n}:{kind:"camera",minZoom:a,maxZoom:o,minSize:r.evaluate(new Rs(a)),maxSize:r.evaluate(new Rs(o)),interpolationType:n}}}function _f(t,{uSize:e,uSizeT:r},{lowerSize:n,upperSize:i}){return "source"===t.kind?n/xf:"composite"===t.kind?Ee(n/xf,i/xf,r):e}function wf(t,e,r=1){let n=0,i=0;if("constant"===t.kind)i=t.layoutSize*r;else if("source"!==t.kind){const{interpolationType:s,minZoom:a,maxZoom:o}=t,l=s?Q(ai.interpolationFactor(s,e,a,o),0,1):0;"camera"===t.kind?i=Ee(t.minSize,t.maxSize,l)*r:n=l*r;}return {uSizeT:n,uSize:i}}var Mf=Object.freeze({__proto__:null,SIZE_PACK_FACTOR:xf,evaluateSizeForFeature:_f,evaluateSizeForZoom:wf,getRasterizedIconSize:vf,getSizeData:bf});function Af(t,e,r){return t.sections.forEach((t=>{t.text=function(t,e,r){const n=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Ds.applyArabicShaping&&(t=Ds.applyArabicShaping(t)),t}(t.text,e,r);})),t}const If={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂","←":"↑","→":"↓"};function Sf(t){return "︶"===t||"﹈"===t||"︸"===t||"﹄"===t||"﹂"===t||"︾"===t||"︼"===t||"︺"===t||"︘"===t||"﹀"===t||"︐"===t||"︓"===t||"︔"===t||"｀"===t||"￣"===t||"︑"===t||"︒"===t}function Pf(t){return "︵"===t||"﹇"===t||"︷"===t||"﹃"===t||"﹁"===t||"︽"===t||"︻"===t||"︹"===t||"︗"===t||"︿"===t}var Ef,zf,kf,Tf={};
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function Bf(){return Ef||(Ef=1,Tf.read=function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,s=f&(1<<-c)-1,f>>=-c,c+=o;c>0;s=256*s+t[e+h],h+=p,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===s)s=1-u;else {if(s===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=u;}return (f?-1:1)*a*Math.pow(2,s-n)},Tf.write=function(t,e,r,n,i,s){var a,o,l,u=8*s-i-1,c=(1<<u)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(o=0,a=c):a+h>=1?(o=(e*l-1)*Math.pow(2,i),a+=h):(o=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&o,f+=d,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*m;}),Tf}function Vf(){if(kf)return zf;kf=1,zf=e;var t=Bf();function e(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var r=4294967296,n=1/r,i="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function s(t){return t.type===e.Bytes?t.readVarint()+t.pos:t.pos+1}function a(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i];}function l(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r]);}function u(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r]);}function c(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r]);}function h(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r]);}function p(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r]);}function f(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r]);}function d(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r]);}function m(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r]);}function y(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r]);}function g(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function x(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function v(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}return e.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,s=this.pos;this.type=7&n,t(i,e,this),this.pos===s&&this.skip(n);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=g(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=v(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=g(this.buf,this.pos)+g(this.buf,this.pos+4)*r;return this.pos+=8,t},readSFixed64:function(){var t=g(this.buf,this.pos)+v(this.buf,this.pos+4)*r;return this.pos+=8,t},readFloat:function(){var e=t.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=t.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,s=r.buf;if(n=(112&(i=s[r.pos++]))>>4,i<128)return a(t,n,e);if(n|=(127&(i=s[r.pos++]))<<3,i<128)return a(t,n,e);if(n|=(127&(i=s[r.pos++]))<<10,i<128)return a(t,n,e);if(n|=(127&(i=s[r.pos++]))<<17,i<128)return a(t,n,e);if(n|=(127&(i=s[r.pos++]))<<24,i<128)return a(t,n,e);if(n|=(1&(i=s[r.pos++]))<<31,i<128)return a(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&i?function(t,e,r){return i.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var s,a,o,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(s=t[i+1]))&&(u=(31&l)<<6|63&s)<=127&&(u=null):3===c?(a=t[i+2],128==(192&(s=t[i+1]))&&128==(192&a)&&((u=(15&l)<<12|(63&s)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+2],o=t[i+3],128==(192&(s=t[i+1]))&&128==(192&a)&&128==(192&o)&&((u=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c;}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,r){if(this.type!==e.Bytes)return t.push(this.readVarint(r));var n=s(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(r));return t},readPackedSVarint:function(t){if(this.type!==e.Bytes)return t.push(this.readSVarint());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==e.Bytes)return t.push(this.readBoolean());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==e.Bytes)return t.push(this.readFloat());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==e.Bytes)return t.push(this.readDouble());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed32());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed32());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed64());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed64());var r=s(this);for(t=t||[];this.pos<r;)t.push(this.readSFixed64());return t},skip:function(t){var r=7&t;if(r===e.Varint)for(;this.buf[this.pos++]>127;);else if(r===e.Bytes)this.pos=this.readVarint()+this.pos;else if(r===e.Fixed32)this.pos+=4;else {if(r!==e.Fixed64)throw new Error("Unimplemented type: "+r);this.pos+=8;}},writeTag:function(t,e){this.writeVarint(t<<3|e);},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e;}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4;},writeSFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4;},writeFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*n),this.pos+4),this.pos+=8;},writeSFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*n),this.pos+4),this.pos+=8;},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7);}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))));}(n,e);}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))));},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t);},writeBoolean:function(t){this.writeVarint(Boolean(t));},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,s=0;s<e.length;s++){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){n>56319||s+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null;}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&o(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(e){this.realloc(4),t.write(this.buf,e,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(e){this.realloc(8),t.write(this.buf,e,this.pos,!0,52,8),this.pos+=8;},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r];},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,r,n){this.writeTag(t,e.Bytes),this.writeRawMessage(r,n);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,l,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,u,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,p,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,c,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,h,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,f,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,d,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,m,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,y,e);},writeBytesField:function(t,r){this.writeTag(t,e.Bytes),this.writeBytes(r);},writeFixed32Field:function(t,r){this.writeTag(t,e.Fixed32),this.writeFixed32(r);},writeSFixed32Field:function(t,r){this.writeTag(t,e.Fixed32),this.writeSFixed32(r);},writeFixed64Field:function(t,r){this.writeTag(t,e.Fixed64),this.writeFixed64(r);},writeSFixed64Field:function(t,r){this.writeTag(t,e.Fixed64),this.writeSFixed64(r);},writeVarintField:function(t,r){this.writeTag(t,e.Varint),this.writeVarint(r);},writeSVarintField:function(t,r){this.writeTag(t,e.Varint),this.writeSVarint(r);},writeStringField:function(t,r){this.writeTag(t,e.Bytes),this.writeString(r);},writeFloatField:function(t,r){this.writeTag(t,e.Fixed32),this.writeFloat(r);},writeDoubleField:function(t,r){this.writeTag(t,e.Fixed64),this.writeDouble(r);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}},zf}var Cf=e(Vf());const Df=3;function Rf(t,e,r){e.glyphs=[],1===t&&r.readMessage(Lf,e);}function Lf(t,e,r){if(3===t){const{id:t,bitmap:n,width:i,height:s,left:a,top:o,advance:l}=r.readMessage(Ff,{});e.glyphs.push({id:t,bitmap:new hc({width:i+2*Df,height:s+2*Df},n),metrics:{width:i,height:s,left:a,top:o,advance:l}});}else 4===t?e.ascender=r.readSVarint():5===t&&(e.descender=r.readSVarint());}function Ff(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint());}const Of=Df,Nf={horizontal:1,vertical:2,horizontalOnly:3};class Uf{constructor(){this.scale=1,this.fontStack="",this.image=null;}static forText(t,e){const r=new Uf;return r.scale=t||1,r.fontStack=e,r}static forImage(t){const e=new Uf;return e.image=t,e}}class jf{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null;}static fromFeature(t,e,r){const n=new jf;for(let i=0;i<t.sections.length;i++){const s=t.sections[i];s.image?n.addImageSection(s,r):n.addTextSection(s,e);}return n}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSections(){return this.sections}getSectionIndex(t){return this.sectionIndex[t]}getCodePoint(t){return this.text.codePointAt(t)}verticalizePunctuation(t){this.text=function(t,e){let r="";for(let n=0;n<t.length;n++){const i=t.charCodeAt(n+1)||null,s=t.charCodeAt(n-1)||null;r+=!e&&(i&&vs(i)&&!If[t[n+1]]||s&&vs(s)&&!If[t[n-1]])||!If[t[n]]?t[n]:If[t[n]];}return r}(this.text,t);}trim(){let t=0;for(let e=0;e<this.text.length&&$f[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let r=this.text.length-1;r>=0&&r>=t&&$f[this.text.charCodeAt(r)];r--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e);}substring(t,e){const r=new jf;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(Uf.forText(t.scale,t.fontStack||e));const r=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(r);}addImageSection(t,e){const r=t.image?t.image.getPrimary():null;if(!r)return void pt("Can't add FormattedSection with an empty image.");r.scaleSelf(e);const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCodePoint(n),this.sections.push(Uf.forImage(r)),this.sectionIndex.push(this.sections.length-1)):pt("Reached maximum number of images 6401");}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function qf(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m=1){const y=jf.fromFeature(t,i,m);h===Nf.vertical&&y.verticalizePunctuation(p);let g=[];const x=function(t,e,r,n,i,s){if(!t)return [];const a=[],o=function(t,e,r,n,i,s){let a=0;for(let r=0;r<t.length();r++){const o=t.getSection(r);a+=Yf(t.getCodePoint(r),o,n,i,e,s);}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,n,i,s),l=t.text.indexOf("​")>=0;let u=0;for(let r=0;r<t.length();r++){const h=t.getSection(r),p=t.getCodePoint(r);if($f[p]||(u+=Yf(p,h,n,i,e,s)),r<t.length()-1){const e=!((c=p)<11904||!(ds["Bopomofo Extended"](c)||ds.Bopomofo(c)||ds["CJK Compatibility Forms"](c)||ds["CJK Compatibility Ideographs"](c)||ds["CJK Compatibility"](c)||ds["CJK Radicals Supplement"](c)||ds["CJK Strokes"](c)||ds["CJK Symbols and Punctuation"](c)||ds["CJK Unified Ideographs Extension A"](c)||ds["CJK Unified Ideographs"](c)||ds["Enclosed CJK Letters and Months"](c)||ds["Halfwidth and Fullwidth Forms"](c)||ds.Hiragana(c)||ds["Ideographic Description Characters"](c)||ds["Kangxi Radicals"](c)||ds["Katakana Phonetic Extensions"](c)||ds.Katakana(c)||ds["Vertical Forms"](c)||ds["Yi Radicals"](c)||ds["Yi Syllables"](c)));(Gf[p]||e||h.image)&&a.push(Zf(r+1,u,o,a,Xf(p,t.getCodePoint(r+1),e&&l),!1));}}var c;return Wf(Zf(t.length(),u,o,a,0,!0))}(y,u,s,e,n,f),{processBidirectionalText:v,processStyledBidirectionalText:b}=Ds;if(v&&1===y.sections.length){const t=v(y.toString(),x);for(const e of t){const t=new jf;t.text=e,t.sections=y.sections;for(let r=0;r<e.length;r++)t.sectionIndex.push(0);g.push(t);}}else if(b){const t=b(y.text,y.sectionIndex,x);for(const e of t){const t=new jf;t.text=e[0],t.sectionIndex=e[1],t.sections=y.sections,g.push(t);}}else g=function(t,e){const r=[],n=t.text;let i=0;for(const n of e)r.push(t.substring(i,n)),i=n;return i<n.length&&r.push(t.substring(i,n.length)),r}(y,x);const _=[],w={positionedLines:_,text:y.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};if(function(t,e,r,n,i,s,a,o,l,u,c,h){let p=0,f=0,d=0;const m="right"===o?1:"left"===o?0:.5;let y=!1;for(const t of i){const r=t.getSections();for(const t of r){if(t.image)continue;const r=e[t.fontStack];if(r&&(y=void 0!==r.ascender&&void 0!==r.descender,!y))break}if(!y)break}let g=0;for(const a of i){a.trim();const i=a.getMaxScale(),o=(i-1)*gf,v={positionedGlyphs:[],lineOffset:0};t.positionedLines[g]=v;const b=v.positionedGlyphs;let _=0;if(!a.length()){f+=s,++g;continue}let w=0,M=0;for(let s=0;s<a.length();s++){const o=a.getSection(s),d=a.getSectionIndex(s),m=a.getCodePoint(s);let g=o.scale,v=null,A=null,I=null,S=gf,P=0;l===Nf.vertical&&(12312===(x=m)||12313===x||12316===x||12540===x||12448===x)&&(l=Nf.horizontal);const E=!(l===Nf.horizontal||!c&&!xs(m)||c&&($f[m]||bs(m)));if(o.image){const e=n.get(o.image.toString());if(!e)continue;I=o.image,t.iconsInText=t.iconsInText||!0,A=e.paddedRect;const r=e.displaySize;g=g*gf/h,v={width:r[0],height:r[1],left:0,top:-Of,advance:E?r[1]:r[0],localGlyph:!1},P=y?-v.height*g:i*gf-17-r[1]*g,S=v.advance;const s=(E?r[0]:r[1])*g-gf*i;s>0&&s>_&&(_=s);}else {const t=r[o.fontStack];if(!t)continue;t[m]&&(A=t[m]);const n=e[o.fontStack];if(!n)continue;const s=n.glyphs[m];if(!s)continue;if(v=s.metrics,S=8203!==m?gf:0,y){const t=void 0!==n.ascender?Math.abs(n.ascender):0,e=void 0!==n.descender?Math.abs(n.descender):0,r=(t+e)*g;w<r&&(w=r,M=(t-e)/2*g),P=-t*g;}else P=(i-g)*gf-17;}E?(t.verticalizable=!0,b.push({glyph:m,image:I,x:p,y:f+P,vertical:E,scale:g,localGlyph:v.localGlyph,fontStack:o.fontStack,sectionIndex:d,metrics:v,rect:A}),p+=S*g+u):(b.push({glyph:m,image:I,x:p,y:f+P,vertical:E,scale:g,localGlyph:v.localGlyph,fontStack:o.fontStack,sectionIndex:d,metrics:v,rect:A}),p+=v.advance*g+u);}0!==b.length&&(d=Math.max(p-u,d),y?Jf(b,m,_,M,s*i/2):Jf(b,m,_,0,s/2)),p=0;const A=s*i+_;v.lineOffset=Math.max(_,o),f+=A,++g;}var x;const v=f,{horizontalAlign:b,verticalAlign:_}=Kf(a);((function(t,e,r,n,i,s){const a=(e-r)*i,o=-s*n;for(const e of t)for(const t of e.positionedGlyphs)t.x+=a,t.y+=o;}))(t.positionedLines,m,b,_,d,v),t.top+=-_*v,t.bottom=t.top+v,t.left+=-b*d,t.right=t.left+d,t.hasBaseline=y;}(w,e,r,n,g,a,o,l,h,u,p,d),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return !1;return !0}(_))return w}const $f={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Gf={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 Yf(t,e,r,n,i,s){if(e.image){const t=n.get(e.image.toString());return t?t.displaySize[0]*e.scale*gf/s+i:0}{const n=r[e.fontStack],s=n&&n.glyphs[t];return s?s.metrics.advance*e.scale+i:0}}function Hf(t,e,r,n){const i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function Xf(t,e,r){let n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Zf(t,e,r,n,i,s){let a=null,o=Hf(e,r,i,s);for(const t of n){const n=Hf(e-t.x,r,i,s)+t.badness;n<=o&&(a=t,o=n);}return {index:t,x:e,priorBreak:a,badness:o}}function Wf(t){return t?Wf(t.priorBreak).concat(t.index):[]}function Kf(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;}return {horizontalAlign:e,verticalAlign:r}}function Jf(t,e,r,n,i){if(!(e||r||n||i))return;const s=t.length-1,a=t[s],o=(a.x+a.metrics.advance*a.scale)*e;for(let e=0;e<=s;e++)t[e].x-=o,t[e].y+=r+n+i;}function Qf(t,e,r,n){const{horizontalAlign:i,verticalAlign:s}=Kf(n),a=r[0]-t.displaySize[0]*i,o=r[1]-t.displaySize[1]*s;return {imagePrimary:t,imageSecondary:e,top:o,bottom:o+t.displaySize[1],left:a,right:a+t.displaySize[0]}}function td(t,e,r,n,i,s){const a=t.imagePrimary;let o;if(a.content){const t=a.content,e=a.pixelRatio||1;o=[t[0]/e,t[1]/e,a.displaySize[0]-t[2]/e,a.displaySize[1]-t[3]/e];}const l=e.left*s,u=e.right*s;let c,h,p,f;"width"===r||"both"===r?(f=i[0]+l-n[3],h=i[0]+u+n[1]):(f=i[0]+(l+u-a.displaySize[0])/2,h=f+a.displaySize[0]);const d=e.top*s,m=e.bottom*s;return "height"===r||"both"===r?(c=i[1]+d-n[0],p=i[1]+m+n[2]):(c=i[1]+(d+m-a.displaySize[1])/2,p=c+a.displaySize[1]),{imagePrimary:a,imageSecondary:void 0,top:c,right:h,bottom:p,left:f,collisionPadding:o}}class ed extends q{constructor(t,e,r,n,i){super(t,e),this.angle=n,this.z=r,void 0!==i&&(this.segment=i);}clone(){return new ed(this.x,this.y,this.z,this.angle,this.segment)}}function rd(t,e,r,n,i){if(void 0===e.segment)return !0;let s=e,a=e.segment+1,o=0;for(;o>-r/2;){if(a--,a<0)return !1;o-=t[a].dist(s),s=t[a];}o+=t[a].dist(t[a+1]),a++;const l=[];let u=0;for(;o<r/2;){const e=t[a],r=t[a+1];if(!r)return !1;let s=t[a-1].angleTo(e)-e.angleTo(r);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:s}),u+=s;o-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return !1;a++,o+=e.dist(r);}return !0}function nd(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function id(t,e,r){return t?.6*e*r:0}function sd(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function ad(t,e,r,n,i,s){const a=id(r,i,s),o=sd(r,n)*s;let l=0;const u=nd(t)/2;for(let r=0;r<t.length-1;r++){const n=t[r],i=t[r+1],s=n.dist(i);if(l+s>u){const c=(u-l)/s,h=Ee(n.x,i.x,c),p=Ee(n.y,i.y,c),f=new ed(h,p,0,i.angleTo(n),r);return !a||rd(t,f,o,a,e)?f:void 0}l+=s;}}function od(t,e,r,n,i,s,a,o,l){const u=id(n,s,a),c=sd(n,i),h=c*a,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),ld(t,p?e/2*o%e:(c/2+2*s)*a*o%e,e,u,r,h,p,!1,l)}function ld(t,e,r,n,i,s,a,o,l){const u=s/2,c=nd(t);let h=0,p=e-r,f=[];for(let e=0;e<t.length-1;e++){const a=t[e],o=t[e+1],d=a.dist(o),m=o.angleTo(a);for(;p+r<h+d;){p+=r;const y=(p-h)/d,g=Ee(a.x,o.x,y),x=Ee(a.y,o.y,y);if(g>=0&&g<l&&x>=0&&x<l&&p-u>=0&&p+u<=c){const r=new ed(g,x,0,m,e);n&&!rd(t,r,s,n,i)||f.push(r);}}h+=d;}return o||f.length||a||(f=ld(t,h/2,r,n,i,s,a,!0,l)),f}function ud(t,e,r,n,i){const s=[];for(let a=0;a<t.length;a++){const o=t[a];let l;for(let t=0;t<o.length-1;t++){let a=o[t],u=o[t+1];a.x<e&&u.x<e||(a.x<e?a=new q(e,a.y+(e-a.x)/(u.x-a.x)*(u.y-a.y))._round():u.x<e&&(u=new q(e,a.y+(e-a.x)/(u.x-a.x)*(u.y-a.y))._round()),a.y<r&&u.y<r||(a.y<r?a=new q(a.x+(r-a.y)/(u.y-a.y)*(u.x-a.x),r)._round():u.y<r&&(u=new q(a.x+(r-a.y)/(u.y-a.y)*(u.x-a.x),r)._round()),a.x>=n&&u.x>=n||(a.x>=n?a=new q(n,a.y+(n-a.x)/(u.x-a.x)*(u.y-a.y))._round():u.x>=n&&(u=new q(n,a.y+(n-a.x)/(u.x-a.x)*(u.y-a.y))._round()),a.y>=i&&u.y>=i||(a.y>=i?a=new q(a.x+(i-a.y)/(u.y-a.y)*(u.x-a.x),i)._round():u.y>=i&&(u=new q(a.x+(i-a.y)/(u.y-a.y)*(u.x-a.x),i)._round()),l&&a.equals(l[l.length-1])||(l=[a],s.push(l)),l.push(u)))));}}return s}function cd(t){let e=0,r=0;for(const n of t)e+=n.w*n.h,r=Math.max(r,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let i=0,s=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const r=n[t];if(!(e.w>r.w||e.h>r.h)){if(e.x=r.x,e.y=r.y,s=Math.max(s,e.y+e.h),i=Math.max(i,e.x+e.w),e.w===r.w&&e.h===r.h){const e=n.pop();t<n.length&&(n[t]=e);}else e.h===r.h?(r.x+=e.w,r.w-=e.w):e.w===r.w?(r.y+=e.h,r.h-=e.h):(n.push({x:r.x+e.w,y:r.y,w:r.w-e.w,h:e.h}),r.y+=e.h,r.h-=e.h);break}}return {w:i,h:s,fill:e/(i*s)||0}}us(ed,"Anchor");const hd=1;class pd{static getImagePositionScale(t,e,r){if(e&&t&&t.options&&t.options.transform){const e=t.options.transform;return {x:e.a,y:e.d}}return {x:r,y:r}}constructor(t,e,r,n){this.paddedRect=t;const{pixelRatio:i,version:s,stretchX:a,stretchY:o,content:l,sdf:u,usvg:c}=e;this.pixelRatio=i,this.stretchX=a,this.stretchY=o,this.content=l,this.version=s,this.padding=r,this.sdf=u,this.scale=pd.getImagePositionScale(n,c,i);}get tl(){return [this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return [this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return [(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function fd(t,e,r){const n=tr.parse(t),i=function(t,e,r=[1,1]){return {x:0,y:0,w:(t.data?t.data.width:t.width*r[0])+2*e,h:(t.data?t.data.height:t.height*r[1])+2*e}}(e,r,[n.options.transform.a,n.options.transform.d]);return {bin:i,imagePosition:new pd(i,e,r,n),imageVariant:n}}class dd{constructor(t,e,r){const n=new Map,i=new Map;this.haveRenderCallbacks=[];const s=[];this.addImages(t,n,hd,s),this.addImages(e,i,2,s);const{w:a,h:o}=cd(s),l=new pc({width:a||1,height:o||1});for(const[e,i]of t.entries()){const t=n.get(e).paddedRect;pc.copy(i.data,l,{x:0,y:0},{x:t.x+hd,y:t.y+hd},i.data,r,i.sdf);}for(const[t,n]of e.entries()){const e=i.get(t),s=e.paddedRect;let a=e.padding;const o=s.x+a,u=s.y+a,c=n.data.width,h=n.data.height;a=a>1?a-1:a,pc.copy(n.data,l,{x:0,y:0},{x:o,y:u},n.data,r),pc.copy(n.data,l,{x:0,y:h-a},{x:o,y:u-a},{width:c,height:a},r),pc.copy(n.data,l,{x:0,y:0},{x:o,y:u+h},{width:c,height:a},r),pc.copy(n.data,l,{x:c-a,y:0},{x:o-a,y:u},{width:a,height:h},r),pc.copy(n.data,l,{x:0,y:0},{x:o+c,y:u},{width:a,height:h},r),pc.copy(n.data,l,{x:c-a,y:h-a},{x:o-a,y:u-a},{width:a,height:a},r),pc.copy(n.data,l,{x:0,y:h-a},{x:o+c,y:u-a},{width:a,height:a},r),pc.copy(n.data,l,{x:0,y:0},{x:o+c,y:u+h},{width:a,height:a},r),pc.copy(n.data,l,{x:c-a,y:0},{x:o-a,y:u+h},{width:a,height:a},r);}this.lut=r,this.image=l,this.iconPositions=n,this.patternPositions=i;}addImages(t,e,r,n){for(const[i,s]of t.entries()){const{bin:t,imagePosition:a,imageVariant:o}=fd(i,s,r);e.set(i,a),n.push(t),s.hasRenderCallback&&this.haveRenderCallbacks.push(o.id);}}patchUpdatedImages(t,e,r){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((e=>t.hasImage(e,r))),t.dispatchRenderCallbacks(this.haveRenderCallbacks,r);for(const n of t.getUpdatedImages(r)){for(const i of this.iconPositions.keys()){const s=tr.parse(i);if(we.isEqual(s.id,n)){const s=t.getImage(n,r);this.patchUpdatedImage(this.iconPositions.get(i),s,e);}}for(const i of this.patternPositions.keys()){const s=tr.parse(i);if(we.isEqual(s.id,n)){const s=t.getImage(n,r);this.patchUpdatedImage(this.patternPositions.get(i),s,e);}}}}patchUpdatedImage(t,e,r){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[n,i]=t.tl,s=t.sdf;if(this.lut||s){const t={width:e.data.width,height:e.data.height},a=new pc(t);pc.copy(e.data,a,{x:0,y:0},{x:0,y:0},t,this.lut,s),r.update(a,{position:{x:n,y:i}});}else r.update(e.data,{position:{x:n,y:i}});}}us(pd,"ImagePosition"),us(dd,"ImageAtlas");const md=1e20;function yd(t,e,r,n,i,s,a,o,l){for(let u=e;u<e+n;u++)gd(t,r*s+u,s,i,a,o,l);for(let u=r;u<r+i;u++)gd(t,u*s+e,1,n,a,o,l);}function gd(t,e,r,n,i,s,a){s[0]=0,a[0]=-md,a[1]=md,i[0]=t[e];for(let o=1,l=0,u=0;o<n;o++){i[o]=t[e+o*r];const n=o*o;do{const t=s[l];u=(i[o]-i[t]+n-t*t)/(o-t)/2;}while(u<=a[l]&&--l>-1);l++,s[l]=o,a[l]=u,a[l+1]=md;}for(let o=0,l=0;o<n;o++){for(;a[l+1]<o;)l++;const n=s[l],u=o-n;t[e+o*r]=i[n]+u*u;}}const xd=2,vd={none:0,ideographs:1,all:2};class bd{constructor(t,e,r){this.requestManager=t,this.localGlyphMode=e,this.localFontFamily=r,this.urls={},this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}};}setURL(t,e){this.urls[e]=t;}getGlyphs(t,e,r){const n=[],i=this.urls[e]||At.GLYPHS_URL;for(const e in t)for(const r of t[e])n.push({stack:e,id:r});rt(n,(({stack:t,id:e},r)=>{let n=this.entries[t];n||(n=this.entries[t]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let s=n.glyphs[e];if(void 0!==s)return void r(null,{stack:t,id:e,glyph:s});if(s=this._tinySDF(n,t,e),s)return n.glyphs[e]=s,void r(null,{stack:t,id:e,glyph:s});const a=Math.floor(e/256);if(256*a>65535)return pt("glyphs > 65535 not supported"),void r(null,{stack:t,id:e,glyph:s});if(n.ranges[a])return void r(null,{stack:t,id:e,glyph:s});let o=n.requests[a];o||(o=n.requests[a]=[],bd.loadGlyphRange(t,a,i,this.requestManager,((t,e)=>{if(e){n.ascender=e.ascender,n.descender=e.descender;for(const t in e.glyphs)this._doesCharSupportLocalGlyph(+t)||(n.glyphs[+t]=e.glyphs[+t]);n.ranges[a]=!0;}for(const r of o)r(t,e);delete n.requests[a];}))),o.push(((n,i)=>{n?r(n):i&&r(null,{stack:t,id:e,glyph:i.glyphs[e]||null});}));}),((t,e)=>{if(t)r(t);else if(e){const t={};for(const{stack:r,id:n,glyph:i}of e)void 0===t[r]&&(t[r]={}),void 0===t[r].glyphs&&(t[r].glyphs={}),t[r].glyphs[n]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics},t[r].ascender=this.entries[r].ascender,t[r].descender=this.entries[r].descender;r(null,t);}}));}_doesCharSupportLocalGlyph(t){return this.localGlyphMode!==vd.none&&(this.localGlyphMode===vd.all?!!this.localFontFamily:!!this.localFontFamily&&(ds["CJK Unified Ideographs"](t)||ds["Hangul Syllables"](t)||ds.Hiragana(t)||ds.Katakana(t)||ds["CJK Symbols and Punctuation"](t)||ds["CJK Unified Ideographs Extension A"](t)||ds["CJK Unified Ideographs Extension B"](t)||ds.Osage(t)))}_tinySDF(t,e,r){const n=this.localFontFamily;if(!n||!this._doesCharSupportLocalGlyph(r))return;let i=t.tinySDF;if(!i){let r="400";/bold/i.test(e)?r="900":/medium/i.test(e)?r="500":/light/i.test(e)&&(r="200"),i=t.tinySDF=new bd.TinySDF({fontFamily:n,fontWeight:r,fontSize:24*xd,buffer:3*xd,radius:8*xd}),i.fontWeight=r;}if(this.localGlyphs[i.fontWeight][r])return this.localGlyphs[i.fontWeight][r];const s=String.fromCodePoint(r),{data:a,width:o,height:l,glyphWidth:u,glyphHeight:c,glyphLeft:h,glyphTop:p,glyphAdvance:f}=i.draw(s);return this.localGlyphs[i.fontWeight][r]={id:r,bitmap:new hc({width:o,height:l},a),metrics:{width:u/xd,height:c/xd,left:h/xd,top:p/xd-27,advance:f/xd,localGlyph:!0}}}}bd.loadGlyphRange=function(t,e,r,n,i){const s=256*e,a=s+255,o=n.transformRequest(n.normalizeGlyphsURL(r).replace("{fontstack}",t).replace("{range}",`${s}-${a}`),Qt.Glyphs);ne(o,((t,e)=>{if(t)i(t);else if(e){const t={},r=function(t){return new Cf(t).readFields(Rf,{})}(e);for(const e of r.glyphs)t[e.id]=e;i(null,{glyphs:t,ascender:r.ascender,descender:r.descender});}}));},bd.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:s="normal",fontStyle:a="normal"}={}){this.buffer=e,this.cutoff=n,this.radius=r;const o=this.size=t+4*e,l=this._createCanvas(o),u=this.ctx=l.getContext("2d",{willReadFrequently:!0});u.font=`${a} ${s} ${t}px ${i}`,u.textBaseline="alphabetic",u.textAlign="left",u.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Uint16Array(o);}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:s}=this.ctx.measureText(t),a=Math.ceil(r),o=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s-i))),l=Math.min(this.size-this.buffer,a+Math.ceil(n)),u=o+2*this.buffer,c=l+2*this.buffer,h=Math.max(u*c,0),p=new Uint8ClampedArray(h),f={data:p,width:u,height:c,glyphWidth:o,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:e};if(0===o||0===l)return f;const{ctx:d,buffer:m,gridInner:y,gridOuter:g}=this;d.clearRect(m,m,o,l),d.fillText(t,m,m+a);const x=d.getImageData(m,m,o,l);g.fill(md,0,h),y.fill(0,0,h);for(let t=0;t<l;t++)for(let e=0;e<o;e++){const r=x.data[4*(t*o+e)+3]/255;if(0===r)continue;const n=(t+m)*u+e+m;if(1===r)g[n]=0,y[n]=md;else {const t=.5-r;g[n]=t>0?t*t:0,y[n]=t<0?t*t:0;}}yd(g,0,0,u,c,u,this.f,this.v,this.z),yd(y,m,m,o,l,u,this.f,this.v,this.z);for(let t=0;t<h;t++){const e=Math.sqrt(g[t])-Math.sqrt(y[t]);p[t]=Math.round(255-255*(e/this.radius+this.cutoff));}return f}};const _d=hd;function wd(t,e){return t+e[1]-e[0]}function Md(t,e,r,n,i=1){const s=[],a=t.imagePrimary,o=a.pixelRatio,l=a.paddedRect.w-2*_d,u=a.paddedRect.h-2*_d,c=(t.right-t.left)*i,h=(t.bottom-t.top)*i,p=a.stretchX||[[0,l]],f=a.stretchY||[[0,u]],d=p.reduce(wd,0),m=f.reduce(wd,0),y=l-d,g=u-m;let x=0,v=d,b=0,_=m,w=0,M=y,A=0,I=g;if(a.content&&n){const t=a.content;x=Ad(p,0,t[0]),b=Ad(f,0,t[1]),v=Ad(p,t[0],t[2]),_=Ad(f,t[1],t[3]),w=t[0]-x,A=t[1]-b,M=t[2]-t[0]-v,I=t[3]-t[1]-_;}const S=(n,s,l,u)=>{const p=Sd(n.stretch-x,v,c,t.left*i),f=Pd(n.fixed-w,M,n.stretch,d),y=Sd(s.stretch-b,_,h,t.top*i),g=Pd(s.fixed-A,I,s.stretch,m),S=Sd(l.stretch-x,v,c,t.left*i),P=Pd(l.fixed-w,M,l.stretch,d),E=Sd(u.stretch-b,_,h,t.top*i),z=Pd(u.fixed-A,I,u.stretch,m),k=new q(p,y),T=new q(S,y),B=new q(S,E),V=new q(p,E),C=new q(f/o,g/o),D=new q(P/o,z/o),R=e*Math.PI/180;if(R){const t=Math.sin(R),e=Math.cos(R),r=[e,-t,t,e];k._matMult(r),T._matMult(r),V._matMult(r),B._matMult(r);}const L=n.stretch+n.fixed,F=l.stretch+l.fixed,O=s.stretch+s.fixed,N=u.stretch+u.fixed,U=t.imageSecondary;return {tl:k,tr:T,bl:V,br:B,texPrimary:{x:a.paddedRect.x+_d+L,y:a.paddedRect.y+_d+O,w:F-L,h:N-O},texSecondary:U?{x:U.paddedRect.x+_d+L,y:U.paddedRect.y+_d+O,w:F-L,h:N-O}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:C,pixelOffsetBR:D,minFontScaleX:M/o/c,minFontScaleY:I/o/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){const t=Id(p,y,d),e=Id(f,g,m);for(let r=0;r<t.length-1;r++){const n=t[r],i=t[r+1];for(let t=0;t<e.length-1;t++)s.push(S(n,e[t],i,e[t+1]));}}else s.push(S({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:u+1}));return s}function Ad(t,e,r){let n=0;for(const i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}function Id(t,e,r){const n=[{fixed:-_d,stretch:0}];for(const[e,r]of t){const t=n[n.length-1];n.push({fixed:e-t.stretch,stretch:t.stretch}),n.push({fixed:e-t.stretch,stretch:t.stretch+(r-e)});}return n.push({fixed:e+_d,stretch:r}),n}function Sd(t,e,r,n){return t/e*r+n}function Pd(t,e,r,n){return t-e*r/n}function Ed(t,e,r,n){const i=e+t.positionedLines[n].lineOffset;return 0===n?r+i/2:r+(i+(e+t.positionedLines[n-1].lineOffset))/2}function zd(t,e=1,r=!1){let n=1/0,i=1/0,s=-1/0,a=-1/0;const o=t[0];for(let t=0;t<o.length;t++){const e=o[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<i)&&(i=e.y),(!t||e.x>s)&&(s=e.x),(!t||e.y>a)&&(a=e.y);}const l=Math.min(s-n,a-i);let u=l/2;const c=new Wr([],kd);if(0===l)return new q(n,i);for(let e=n;e<s;e+=l)for(let r=i;r<a;r+=l)c.push(new Td(e+u,r+u,u,t));let h=function(t){let e=0,r=0,n=0;const i=t[0];for(let t=0,s=i.length,a=s-1;t<s;a=t++){const s=i[t],o=i[a],l=s.x*o.y-o.x*s.y;r+=(s.x+o.x)*l,n+=(s.y+o.y)*l,e+=3*l;}return new Td(r/e,n/e,0,t)}(t),p=c.length;for(;c.length;){const n=c.pop();(n.d>h.d||!h.d)&&(h=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-h.d<=e||(u=n.h/2,c.push(new Td(n.p.x-u,n.p.y-u,u,t)),c.push(new Td(n.p.x+u,n.p.y-u,u,t)),c.push(new Td(n.p.x-u,n.p.y+u,u,t)),c.push(new Td(n.p.x+u,n.p.y+u,u,t)),p+=4);}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${h.d}`)),h.p}function kd(t,e){return e.max-t.max}class Td{constructor(t,e,r,n){this.p=new q(t,e),this.h=r,this.d=function(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){const s=e[i];for(let e=0,i=s.length,a=i-1;e<i;a=e++){const i=s[e],o=s[a];i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(r=!r),n=Math.min(n,Gl(t,i,o));}}return (r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2;}}const Bd=Number.POSITIVE_INFINITY,Vd=Math.sqrt(2);function Cd(t,[e,r]){let n=0,i=0;if(r===Bd){e<0&&(e=0);const r=e/Vd;switch(t){case"top-right":case"top-left":i=r-7;break;case"bottom-right":case"bottom-left":i=7-r;break;case"bottom":i=7-e;break;case"top":i=e-7;}switch(t){case"top-right":case"bottom-right":n=-r;break;case"top-left":case"bottom-left":n=r;break;case"left":n=e;break;case"right":n=-e;}}else {switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r;}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e;}}return [n,i]}function Dd(t,e,r,n,i,s,a,o){if(!t)return;const l=vf(e,r,n,i,s);return t.scaleSelf(l*o*a)}function Rd(t,e,r,n,i,s,a,o){return {iconPrimary:Dd(t.getPrimary(),e,r,n,i,s,a,o),iconSecondary:Dd(t.getSecondary(),e,r,n,i,s,a,o)}}function Ld(t,e,r,n){if(!t)return;const i=e.get(r.toString());if(t.imagePrimary=i,n){const r=e.get(n.toString());t.imageSecondary=r;}}function Fd(t,e){for(const r in t.horizontal)Od(t.horizontal[r],e);Od(t.vertical,e);}function Od(t,e){if(t)for(const r of t.positionedLines)for(const t of r.positionedGlyphs)if(null!==t.image){const r=t.image.toString();t.rect=e.get(r).paddedRect;}}function Nd(t){switch(t){case"right":case"top-right":case"bottom-right":return "right";case"left":case"top-left":case"bottom-left":return "left"}return "center"}function Ud(t,e,r,n,i,s,a,o,l){const u=Yd(s.horizontal)||s.vertical,c=r.get("icon-text-fit-padding").evaluate(n,{},i);let h,p=e;return e&&"none"!==l&&(t.allowVerticalPlacement&&s.vertical&&(h=td(e,s.vertical,l,c,o,a)),u&&(p=td(e,u,l,c,o,a))),{defaultShapedIcon:p,verticallyShapedIcon:h}}function jd(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v){let b=a.textMaxSize.evaluate(e,{},p);void 0===b?b=o*a.textScaleFactor:b*=a.textScaleFactor;const _=t.layers[0].layout,w=Yd(r.horizontal)||r.vertical,M="globe"===f.name,A=gf,I=t.tilePixelRatio*b/A,S=(B=t.overscaling,t.zoom>18&&B>2&&(B>>=1),Math.max(Kr/(512*B),1)*_.get("symbol-spacing")),P=_.get("text-padding")*t.tilePixelRatio,E=_.get("icon-padding")*t.tilePixelRatio,z=H(_.get("text-max-angle")),k="map"===_.get("icon-rotation-alignment")&&"point"!==v,T=S/2;var B;!1===t.hasAnyIconTextFit&&"none"!==y&&(t.hasAnyIconTextFit=!0);const V=e.properties?+e.properties[oh]:null,C=V&&t.elevationFeatureIdToIndex?t.elevationFeatureIdToIndex.get(V):65535,D=(o,l,v)=>{if(l.x<0||l.x>=Kr||l.y<0||l.y>=Kr)return;let b=null;if(M){const{x:t,y:e,z:r}=f.projectTilePoint(l.x,l.y,v);b={anchor:new ed(t,e,r,0,void 0),up:f.upVector(v,l.x,l.y)};}!function(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g,x,v,b,_,w,M,A,I,S,P,E){const z=t.addToLineVertexArray(e,n);let k,T,B,V,C,D,R,L=0,F=0,O=0,N=0,U=-1,j=-1;const q={};let $=ye("");const G=r?r.anchor:e,Y="none"!==P;let H=0,X=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[H,X]=l.layout.get("text-offset").evaluate(b,{},A).map((t=>t*gf)):(H=l.layout.get("text-radial-offset").evaluate(b,{},A)*gf,X=Bd),t.allowVerticalPlacement&&i.vertical){const t=i.vertical;if(d)D=Xd(t),o&&(R=Xd(o));else {const r=l.layout.get("text-rotate").evaluate(b,{},A)+90;B=Hd(u,G,e,c,h,p,t,f,r,m),o&&(V=Hd(u,G,e,c,h,p,o,g,r));}}if(s){const n=t.iconSizeData,i=l.layout.get("icon-rotate").evaluate(b,{},A),a=Md(s,i,w,Y,_.iconScaleFactor),f=o?Md(o,i,w,Y,_.iconScaleFactor):void 0;T=Hd(u,G,e,c,h,p,s,g,i,null),L=4*a.length;let d=null;"source"===n.kind?(d=[xf*l.layout.get("icon-size").evaluate(b,{},A)*_.iconScaleFactor],d[0]>$d&&pt(`${t.layerIds[0]}: Value for "icon-size" is >= ${qd}. Reduce your "icon-size".`)):"composite"===n.kind&&(d=[xf*_.compositeIconSizes[0].evaluate(b,{},A)*_.iconScaleFactor,xf*_.compositeIconSizes[1].evaluate(b,{},A)*_.iconScaleFactor],(d[0]>$d||d[1]>$d)&&pt(`${t.layerIds[0]}: Value for "icon-size" is >= ${qd}. Reduce your "icon-size".`)),t.addSymbols(t.icon,a,d,v,x,b,!1,r,e,z.lineStartIndex,z.lineLength,-1,M,A,I,S),U=t.icon.placedSymbolArray.length-1,f&&(F=4*f.length,t.addSymbols(t.icon,f,d,v,x,b,Nf.vertical,r,e,z.lineStartIndex,z.lineLength,-1,M,A,I,S),j=t.icon.placedSymbolArray.length-1);}for(const n in i.horizontal){const s=i.horizontal[n];k||($=ye(s.text),d?C=Xd(s):k=Hd(u,G,e,c,h,p,s,f,l.layout.get("text-rotate").evaluate(b,{},A),m));const o=1===s.positionedLines.length;if(O+=Gd(t,r,e,s,a,l,d,b,m,z,i.vertical?Nf.horizontal:Nf.horizontalOnly,o?Object.keys(i.horizontal):[n],q,U,_,M,A,I),o)break}i.vertical&&(N+=Gd(t,r,e,i.vertical,a,l,d,b,m,z,Nf.vertical,["vertical"],q,j,_,M,A,I));let Z=-1;const W=(t,e)=>t?Math.max(t,e):e;Z=W(C,Z),Z=W(D,Z),Z=W(R,Z);const K=Z>-1?1:0;t.glyphOffsetArray.length>=65535&&pt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,G.x,G.y,G.z,q.right>=0?q.right:-1,q.center>=0?q.center:-1,q.left>=0?q.left:-1,q.vertical>=0?q.vertical:-1,U,j,$,void 0!==k?k:t.collisionBoxArray.length,void 0!==k?k+1:t.collisionBoxArray.length,void 0!==B?B:t.collisionBoxArray.length,void 0!==B?B+1:t.collisionBoxArray.length,void 0!==T?T:t.collisionBoxArray.length,void 0!==T?T+1:t.collisionBoxArray.length,V||t.collisionBoxArray.length,V?V+1:t.collisionBoxArray.length,c,O,N,L,F,K,0,H,X,Z,0,Y?1:0,E);}(t,l,b,o,r,n,s,i,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,P,x,u,0,E,k,g,e,a,c,h,p,d,m,y,C);};if("line"===v)for(const i of ud(e.geometry,0,0,Kr,Kr)){const e=od(i,S,z,r.vertical||w,n,A,I,t.overscaling,Kr);for(const r of e)w&&Zd(t,w.text,T,r)||D(i,r,p);}else if("line-center"===v){for(const t of e.geometry)if(t.length>1){const e=ad(t,z,r.vertical||w,n,A,I);e&&D(t,e,p);}}else if("Polygon"===e.type)for(const t of $c(e.geometry,0)){const e=zd(t,16);D(t[0],new ed(e.x,e.y,0,0,void 0),p);}else if("LineString"===e.type)for(const t of e.geometry)D(t,new ed(t[0].x,t[0].y,0,0,void 0),p);else if("Point"===e.type)for(const t of e.geometry)for(const e of t)D([e],new ed(e.x,e.y,0,0,void 0),p);}const qd=255,$d=qd*xf;function Gd(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m,y,g){const x=function(t,e,r,n,i,s,a,o){const l=[];if(0===e.positionedLines.length)return l;const u=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,c=function(t){const e=t[0],r=t[1],n=e*r;return n>0?[e,-r]:n<0?[-e,r]:0===e?[r,e]:[r,-e]}(r);let h=Math.abs(e.top-e.bottom);for(const t of e.positionedLines)h-=t.lineOffset;const p=e.positionedLines.length,f=h/p;let d=e.top-r[1];for(let t=0;t<p;++t){const n=e.positionedLines[t];d=Ed(e,f,d,t);for(const t of n.positionedGlyphs){if(!t.rect)continue;const n=t.rect||{};let s=Of+1,h=!0,p=1,f=0;if(t.image){const e=a.get(t.image.toString());if(!e)continue;if(e.sdf){pt("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,p=e.pixelRatio,s=hd/p;}const m=(i||o)&&t.vertical,y=t.metrics.advance*t.scale/2,g=t.metrics,x=t.rect;if(null===x)continue;o&&e.verticalizable&&(f=t.image?y-t.metrics.width*t.scale/2:0);const v=i?[t.x+y,t.y]:[0,0];let b=[0,0],_=[0,0],w=!1;i||(m?(_=[t.x+y+c[0],t.y+c[1]-f],w=!0):b=[t.x+y+r[0],t.y+r[1]-f]);const M=x.w*t.scale/(p*(t.localGlyph?xd:1)),A=x.h*t.scale/(p*(t.localGlyph?xd:1));let I,S,P,E;if(m){const e=t.y-d,r=new q(-y,y-e),n=-Math.PI/2,i=new q(..._);I=new q(-y+b[0],b[1]),I._rotateAround(n,r)._add(i),I.x+=-e+y,I.y-=(g.left-s)*t.scale;const a=t.image?g.advance*t.scale:gf*t.scale,o=String.fromCodePoint(t.glyph);Sf(o)?I.x+=(1-s)*t.scale:Pf(o)?I.x+=a-g.height*t.scale+(-s-1)*t.scale:I.x+=t.image||g.width+2*s===x.w&&g.height+2*s===x.h?(a-A)/2:(a-(g.height+2*s)*t.scale)/2,S=new q(I.x,I.y-M),P=new q(I.x+A,I.y),E=new q(I.x+A,I.y-M);}else {const e=(g.left-s)*t.scale-y+b[0],r=(-g.top-s)*t.scale+b[1],n=e+M,i=r+A;I=new q(e,r),S=new q(n,r),P=new q(e,i),E=new q(n,i);}if(u){let t;t=i?new q(0,0):w?new q(c[0],c[1]):new q(r[0],r[1]),I._rotateAround(u,t),S._rotateAround(u,t),P._rotateAround(u,t),E._rotateAround(u,t);}const z=new q(0,0),k=new q(0,0);l.push({tl:I,tr:S,bl:P,br:E,texPrimary:n,texSecondary:void 0,writingMode:e.writingMode,glyphOffset:v,sectionIndex:t.sectionIndex,isSDF:h,pixelOffsetTL:z,pixelOffsetBR:k,minFontScaleX:0,minFontScaleY:0});}}return l}(0,n,l,s,a,o,i,t.allowVerticalPlacement),v=t.textSizeData;let b=null;"source"===v.kind?(b=[xf*s.layout.get("text-size").evaluate(o,{},y)*d.textScaleFactor],b[0]>$d&&pt(`${t.layerIds[0]}: Value for "text-size" is >= ${qd}. Reduce your "text-size".`)):"composite"===v.kind&&(b=[xf*d.compositeTextSizes[0].evaluate(o,{},y)*d.textScaleFactor,xf*d.compositeTextSizes[1].evaluate(o,{},y)*d.textScaleFactor],(b[0]>$d||b[1]>$d)&&pt(`${t.layerIds[0]}: Value for "text-size" is >= ${qd}. Reduce your "text-size".`)),t.addSymbols(t.text,x,b,l,a,o,c,e,r,u.lineStartIndex,u.lineLength,f,m,y,g,!1);for(const e of h)p[e]=t.text.placedSymbolArray.length-1;return 4*x.length}function Yd(t){for(const e in t)return t[e];return null}function Hd(t,e,r,n,i,s,a,o,l,u){let c=a.top,h=a.bottom,p=a.left,f=a.right;const d=a.collisionPadding;if(d&&(p-=d[0],c-=d[1],f+=d[2],h+=d[3]),l){const t=new q(p,c),e=new q(f,c),r=new q(p,h),n=new q(f,h),i=H(l);let s=new q(0,0);u&&(s=new q(u[0],u[1])),t._rotateAround(i,s),e._rotateAround(i,s),r._rotateAround(i,s),n._rotateAround(i,s),p=Math.min(t.x,e.x,r.x,n.x),f=Math.max(t.x,e.x,r.x,n.x),c=Math.min(t.y,e.y,r.y,n.y),h=Math.max(t.y,e.y,r.y,n.y);}return t.emplaceBack(e.x,e.y,e.z,r.x,r.y,p,c,f,h,o,n,i,s),t.length-1}function Xd(t){t.collisionPadding&&(t.top-=t.collisionPadding[1],t.bottom+=t.collisionPadding[3]);const e=t.bottom-t.top;return e>0?Math.max(10,e):null}function Zd(t,e,r,n){const i=t.compareText;if(e in i){const t=i[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])<r)return !0}else i[e]=[];return i[e].push(n),!1}function Wd(t,e){const r=t.fovAboveCenter,n=t.elevation?t.elevation.getMinElevationBelowMSL()*e:0,i=(t._camera.position[2]*t.worldSize-n)/Math.cos(t._pitch),s=Math.sin(r)*i/Math.sin(Math.max(Math.PI/2-t._pitch-r,.01));let a=Math.sin(t._pitch)*s+i;const o=i*(1/t._horizonShift);if(!t.elevation||0===t.elevation.exaggeration()){let e=Math.max(t.zoom-17,0);t.isOrthographic&&(e/=10),a*=1+e;}return Math.min(1.01*a,o)}function Kd(t,e){if(!e.isReprojectedInTileSpace)return {scale:1<<t.z,x:t.x,y:t.y,x2:t.x+1,y2:t.y+1,projection:e};const r=Math.pow(2,-t.z),n=t.x*r,i=(t.x+1)*r,s=t.y*r,a=(t.y+1)*r,o=gl(n),l=gl(i),u=xl(s),c=xl(a),h=e.project(o,u),p=e.project(l,u),f=e.project(l,c),d=e.project(o,c);let m=Math.min(h.x,p.x,f.x,d.x),y=Math.min(h.y,p.y,f.y,d.y),g=Math.max(h.x,p.x,f.x,d.x),x=Math.max(h.y,p.y,f.y,d.y);const v=r/16;function b(t,r,n,i,s,a){const o=(n+s)/2,l=(i+a)/2,u=e.project(gl(o),xl(l)),c=Math.max(0,m-u.x,y-u.y,u.x-g,u.y-x);m=Math.min(m,u.x),g=Math.max(g,u.x),y=Math.min(y,u.y),x=Math.max(x,u.y),c>v&&(b(t,u,n,i,o,l),b(u,r,o,l,s,a));}b(h,p,n,s,i,s),b(p,f,i,s,i,a),b(f,d,i,a,n,a),b(d,h,n,a,n,s),m-=v,y-=v,g+=v,x+=v;const _=1/Math.max(g-m,x-y);return {scale:_,x:m*_,y:y*_,x2:g*_,y2:x*_,projection:e}}function Jd(t,{x:e,y:r},n=0){return new q(((e-n)*t.scale-t.x)*Kr,(r*t.scale-t.y)*Kr)}const Qd=O.mat4.identity(new Float32Array(16));class tm{constructor(t){this.spec=t,this.name=t.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(t,e){return {x:0,y:0,z:0}}unproject(t,e){return new ul(0,0)}projectTilePoint(t,e,r){return {x:t,y:e,z:0}}locationPoint(t,e,r,n=!0){return t._coordinatePoint(t.locationCoordinate(e,r),n)}pixelsPerMeter(t,e){return yl(1,t)*e}pixelSpaceConversion(t,e,r){return 1}farthestPixelDistance(t){return Wd(t,t.pixelsPerMeter)}pointCoordinate(t,e,r,n){const i=t.horizonLineFromTop(!1),s=new q(e,Math.max(i,r));return t.rayIntersectionCoordinate(t.pointRayIntersection(s,n))}pointCoordinate3D(t,e,r){const n=new q(e,r);if(t.elevation)return t.elevation.pointCoordinate(n);{const e=this.pointCoordinate(t,n.x,n.y,0);return [e.x,e.y,e.z]}}isPointAboveHorizon(t,e){if(t.elevation&&t.elevation.visibleDemTiles.length)return !this.pointCoordinate3D(t,e.x,e.y);const r=t.horizonLineFromTop();return e.y<r}createInversionMatrix(t,e){return Qd}createTileMatrix(t,e,r){let n,i,s;const a=r.canonical,o=O.mat4.identity(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=Kd(a,this);n=1,i=l.x+r.wrap*l.scale,s=l.y,O.mat4.scale(o,o,[n/l.scale,n/l.scale,t.pixelsPerMeter/e]);}else n=e/t.zoomScale(a.z),i=(a.x+Math.pow(2,a.z)*r.wrap)*n,s=a.y*n;return O.mat4.translate(o,o,[i,s,0]),O.mat4.scale(o,o,[n/Kr,n/Kr,1]),o}upVector(t,e,r){return [0,0,1]}upVectorScale(t,e,r){return {metersToTile:1}}}class em extends tm{constructor(t){super(t),this.range=[4,7],this.center=t.center||[-96,37.5];const[e,r]=this.parallels=t.parallels||[29.5,45.5],n=Math.sin(H(e));this.n=(n+Math.sin(H(r)))/2,this.c=1+n*(2*this.n-n),this.r0=Math.sqrt(this.c)/this.n;}project(t,e){const{n:r,c:n,r0:i}=this,s=H(t-this.center[0]),a=H(e),o=Math.sqrt(n-2*r*Math.sin(a))/r;return {x:o*Math.sin(s*r),y:o*Math.cos(s*r)-i,z:0}}unproject(t,e){const{n:r,c:n,r0:i}=this,s=i+e;let a=Math.atan2(t,Math.abs(s))*Math.sign(s);s*r<0&&(a-=Math.PI*Math.sign(t)*Math.sign(s));const o=H(this.center[0])*r;a=et(a,-Math.PI-o,Math.PI-o);const l=Q(X(a/r)+this.center[0],-180,180),u=Math.asin(Q((n-(t*t+s*s)*r*r)/(2*r),-1,1)),c=Q(X(u),-bl,bl);return new ul(l,c)}}const rm=1.340264,nm=-.081106,im=893e-6,sm=.003796,am=Math.sqrt(3)/2;class om extends tm{project(t,e){e=e/180*Math.PI,t=t/180*Math.PI;const r=Math.asin(am*Math.sin(e)),n=r*r,i=n*n*n;return {x:.5*(t*Math.cos(r)/(am*(rm+3*nm*n+i*(7*im+9*sm*n)))/Math.PI+.5),y:1-.5*(r*(rm+nm*n+i*(im+sm*n))/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let r=e=(2*(1-e)-1)*Math.PI,n=r*r,i=n*n*n;for(let t,s,a,o=0;o<12&&(s=r*(rm+nm*n+i*(im+sm*n))-e,a=rm+3*nm*n+i*(7*im+9*sm*n),t=s/a,r=Q(r-t,-Math.PI/3,Math.PI/3),n=r*r,i=n*n*n,!(Math.abs(t)<1e-12));++o);const s=am*t*(rm+3*nm*n+i*(7*im+9*sm*n))/Math.cos(r),a=Math.asin(Math.sin(r)/am),o=Q(180*s/Math.PI,-180,180),l=Q(180*a/Math.PI,-bl,bl);return new ul(o,l)}}class lm extends tm{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0;}project(t,e){return {x:.5+t/360,y:.5-e/360,z:0}}unproject(t,e){const r=360*(t-.5),n=Q(360*(.5-e),-bl,bl);return new ul(r,n)}}const um=Math.PI/2;function cm(t){return Math.tan((um+t)/2)}class hm extends tm{constructor(t){super(t),this.center=t.center||[0,30];const[e,r]=this.parallels=t.parallels||[30,30];let n=H(e),i=H(r);this.southernCenter=n+i<0,this.southernCenter&&(n=-n,i=-i);const s=Math.cos(n),a=cm(n);this.n=n===i?Math.sin(n):Math.log(s/Math.cos(i))/Math.log(cm(i)/a),this.f=s*Math.pow(cm(n),this.n)/this.n;}project(t,e){e=H(e),this.southernCenter&&(e=-e),t=H(t-this.center[0]);const r=1e-6,{n,f:i}=this;i>0?e<-um+r&&(e=-um+r):e>um-r&&(e=um-r);const s=i/Math.pow(cm(e),n);let a=s*Math.sin(n*t),o=i-s*Math.cos(n*t);return a=.5*(a/Math.PI+.5),o=.5*(o/Math.PI+.5),{x:a,y:this.southernCenter?o:1-o,z:0}}unproject(t,e){t=(2*t-.5)*Math.PI,this.southernCenter&&(e=1-e),e=(2*(1-e)-.5)*Math.PI;const{n:r,f:n}=this,i=n-e,s=Math.sign(i),a=Math.sign(r)*Math.sqrt(t*t+i*i);let o=Math.atan2(t,Math.abs(i))*s;i*r<0&&(o-=Math.PI*Math.sign(t)*s);const l=Q(X(o/r)+this.center[0],-180,180),u=Q(X(2*Math.atan(Math.pow(n/a,1/r))-um),-bl,bl);return new ul(l,this.southernCenter?-u:u)}}class pm extends tm{constructor(t){super(t),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null;}project(t,e){return {x:dl(t),y:ml(e),z:0}}unproject(t,e){const r=gl(t),n=xl(e);return new ul(r,n)}}const fm=H(bl);class dm extends tm{project(t,e){const r=(e=H(e))*e,n=r*r;return {x:.5*((t=H(t))*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791))/Math.PI+.5),y:1-.5*(e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))/Math.PI+1),z:0}}unproject(t,e){t=(2*t-.5)*Math.PI;let r=e=(2*(1-e)-1)*Math.PI,n=25,i=0,s=r*r;do{s=r*r;const t=s*s;i=(r*(1.007226+s*(.015085+t*(.028874*s-.044475-.005916*t)))-e)/(1.007226+s*(.045255+t*(.259866*s-.311325-.005916*11*t))),r=Q(r-i,-fm,fm);}while(Math.abs(i)>1e-6&&--n>0);s=r*r;const a=Q(X(t/(.8707+s*(s*(s*s*s*(.003971-.001529*s)-.013791)-.131979))),-180,180),o=X(r);return new ul(a,o)}}const mm=H(bl);class ym extends tm{project(t,e){e=H(e),t=H(t);const r=Math.cos(e),n=2/Math.PI,i=Math.acos(r*Math.cos(t/2)),s=Math.sin(i)/i,a=.5*(t*n+2*r*Math.sin(t/2)/s)||0,o=.5*(e+Math.sin(e)/s)||0;return {x:.5*(a/Math.PI+.5),y:1-.5*(o/Math.PI+1),z:0}}unproject(t,e){let r=t=(2*t-.5)*Math.PI,n=e=(2*(1-e)-1)*Math.PI,i=25;const s=1e-6;let a=0,o=0;do{const i=Math.cos(n),s=Math.sin(n),l=2*s*i,u=s*s,c=i*i,h=Math.cos(r/2),p=Math.sin(r/2),f=2*h*p,d=p*p,m=1-c*h*h,y=m?1/m:0,g=m?Math.acos(i*h)*Math.sqrt(1/m):0,x=.5*(2*g*i*p+2*r/Math.PI)-t,v=.5*(g*s+n)-e,b=.5*y*(c*d+g*i*h*u)+1/Math.PI,_=y*(f*l/4-g*s*p),w=.125*y*(l*p-g*s*c*f),M=.5*y*(u*h+g*d*i)+.5,A=_*w-M*b;a=(v*_-x*M)/A,o=(x*w-v*b)/A,r=Q(r-a,-Math.PI,Math.PI),n=Q(n-o,-mm,mm);}while((Math.abs(a)>s||Math.abs(o)>s)&&--i>0);return new ul(X(r),X(n))}}class gm extends tm{constructor(t){super(t),this.center=t.center||[0,0],this.parallels=t.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(H(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0;}project(t,e){const{scale:r,cosPhi:n}=this;return {x:H(t)*n*r+.5,y:-Math.sin(H(e))/n*r+.5,z:0}}unproject(t,e){const{scale:r,cosPhi:n}=this,i=-(e-.5)/r,s=Q(X((t-.5)/r)/n,-180,180),a=Math.asin(Q(i*n,-1,1)),o=Q(X(a),-bl,bl);return new ul(s,o)}}class xm extends pm{constructor(t){super(t),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5];}projectTilePoint(t,e,r){const n=Ru(t,e,r),i=Ou(ku(r));return O.vec3.transformMat4(n,n,i),{x:n[0],y:n[1],z:n[2]}}locationPoint(t,e,r){const n=al(e.lat,e.lng),i=O.vec3.normalize([],n),s=r?t._centerAltitude+r:t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(e),t._centerAltitude):t._centerAltitude,a=yl(1,0)*Kr*s;O.vec3.scaleAndAdd(n,n,i,a);const o=O.mat4.identity(new Float64Array(16));return O.mat4.multiply(o,t.pixelMatrix,t.globeMatrix),O.vec3.transformMat4(n,n,o),new q(n[0],n[1])}pixelsPerMeter(t,e){return yl(1,0)*e}pixelSpaceConversion(t,e,r){const n=yl(1,t)*e,i=Ee(yl(1,45)*e,n,r);return this.pixelsPerMeter(t,e)/i}createTileMatrix(t,e,r){const n=Nu(ku(r.canonical));return O.mat4.multiply(new Float64Array(16),t.globeMatrix,n)}createInversionMatrix(t,e){const{center:r}=t,n=Ou(ku(e));return O.mat4.rotateY(n,n,H(r.lng)),O.mat4.rotateX(n,n,H(r.lat)),O.mat4.scale(n,n,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(t,e,r,n){return Pu(t,e,r,!0)||new Il(0,0)}pointCoordinate3D(t,e,r){const n=this.pointCoordinate(t,e,r,0);return [n.x,n.y,n.z]}isPointAboveHorizon(t,e){return !Pu(t,e.x,e.y,!1)}farthestPixelDistance(t){const e=function(t,e){const r=t.cameraToCenterDistance,n=t._centerAltitude*e,i=t._camera,s=t._camera.forward(),a=O.vec3.add([],O.vec3.scale([],s,-r),[0,0,n]),o=t.worldSize/(2*Math.PI),l=[0,0,-o],u=t.width/t.height,c=Math.tan(t.fovAboveCenter),h=O.vec3.scale([],i.up(),c),p=O.vec3.scale([],i.right(),c*u),f=O.vec3.normalize([],O.vec3.add([],O.vec3.add([],s,h),p)),d=[];let m;if(new gu(a,f).closestPointOnSphere(l,o,d)){const e=O.vec3.add([],d,l),r=O.vec3.sub([],e,a);m=Math.cos(t.fovAboveCenter)*O.vec3.length(r);}else {const t=O.vec3.sub([],a,l),e=O.vec3.sub([],l,a);O.vec3.normalize(e,e);const r=O.vec3.length(t)-o;m=Math.sqrt(r*(r+2*o));const n=Math.acos(m/(o+r))-Math.acos(O.vec3.dot(s,e));m*=Math.cos(n);}return 1.01*m}(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),r=$u(t.zoom);if(r>0){const n=Wd(t,yl(1,t.center.lat)*t.worldSize),i=t.worldSize/(2*Math.PI),s=Math.max(t.width,t.height)/t.worldSize*Math.PI;return Ee(e,n+i*(1-Math.cos(s)),Math.pow(r,10))}return e}upVector(t,e,r){return Ru(e,r,t,1)}upVectorScale(t){return {metersToTile:Iu(Lu(ku(t)))}}}function vm(t){const e=t.parallels,r=!!e&&Math.abs(e[0]+e[1])<.01;switch(t.name){case"mercator":return new pm(t);case"equirectangular":return new lm(t);case"naturalEarth":return new dm(t);case"equalEarth":return new om(t);case"winkelTripel":return new ym(t);case"albers":return r?new gm(t):new em(t);case"lambertConformalConic":return r?new gm(t):new hm(t);case"globe":return new xm(t)}throw new Error(`Invalid projection name: ${t.name}`)}const bm=ah.VectorTileFeature.types,_m=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function wm(t,e,r,n,i,s,a,o,l,u,c,h,p){const f=o?Math.min($d,Math.round(o[0])):0,d=o?Math.min($d,Math.round(o[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),s,a,(f<<1)+(l?1:0),d,16*u,16*c,256*h,256*p);}function Mm(t,e,r){t.emplaceBack(e,r);}function Am(t,e,r,n,i,s,a){t.emplaceBack(e,r,n,i,s,a);}function Im(t,e,r,n,i){t.emplaceBack(e,r,n,i),t.emplaceBack(e,r,n,i),t.emplaceBack(e,r,n,i),t.emplaceBack(e,r,n,i);}function Sm(t){for(const e of t.sections)if(Ms(e.text))return !0;return !1}class Pm{constructor(t){this.layoutVertexArray=new Va,this.indexArray=new ja,this.programConfigurations=t,this.segments=new xo,this.dynamicLayoutVertexArray=new Da,this.opacityVertexArray=new Ra,this.placedSymbolArray=new so,this.iconTransitioningVertexArray=new La,this.globeExtVertexArray=new Ca,this.zOffsetVertexArray=new Aa;}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(t,e,r,n,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,lf.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,cf.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,_m,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=t.createVertexBuffer(this.iconTransitioningVertexArray,pf.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=t.createVertexBuffer(this.globeExtVertexArray,uf.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||i)&&(this.zOffsetVertexBuffer=t.createVertexBuffer(this.zOffsetVertexArray,hf.members,!0)),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t));}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy());}}us(Pm,"SymbolBuffers");class Em{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new xo,this.collisionVertexArray=new Ua,this.collisionVertexArrayExt=new Da;}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ff.members,!0),this.collisionVertexBufferExt=t.createVertexBuffer(this.collisionVertexArrayExt,df.members,!0);}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy());}}us(Em,"CollisionBuffers");class zm{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.lut=t.lut,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=O.mat4.identity([]),this.placementViewportMatrix=O.mat4.identity([]);const e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=bf(this.zoom,e["text-size"]),this.iconSizeData=bf(this.zoom,e["icon-size"]);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=r.get("text-writing-mode").map((t=>Nf[t])),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=t.sourceID,this.projection=t.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=!1,this.elevationType="none",this.elevationStateComplete=!1,this.activeReplacements=[],this.replacementUpdateTime=0;}createArrays(){this.text=new Pm(new Go(this.layers,{zoom:this.zoom,lut:this.lut},(t=>t.startsWith("text")||t.startsWith("symbol")))),this.icon=new Pm(new Go(this.layers,{zoom:this.zoom,lut:this.lut},(t=>t.startsWith("icon")||t.startsWith("symbol")))),this.glyphOffsetArray=new lo,this.lineVertexArray=new uo,this.symbolInstances=new oo;}calculateGlyphDependencies(t,e,r,n,i){for(const r of t){const t=r.codePointAt(0);if(void 0===t)break;if(e[t]=!0,n&&i&&t<=65535){const t=If[r];t&&(e[t.charCodeAt(0)]=!0);}}}updateFootprints(t,e){}updateReplacement(t,e){if(e.updateTime===this.replacementUpdateTime)return !1;this.replacementUpdateTime=e.updateTime;const r=e.getReplacementRegionsForTile(t.toUnwrapped(),!0);return !Yh(this.activeReplacements,r)&&(this.activeReplacements=r,!0)}populate(t,e,r,n){const i=this.layers[0],s=i.layout,a="globe"===this.projection.name,o=s.get("text-font"),l=s.get("text-field"),u=s.get("icon-image"),[c,h]=s.get("icon-size-scale-range"),p=Q(e.scaleFactor||1,c,h),f=("constant"!==l.value.kind||l.value.value instanceof Qe&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),d="constant"!==u.value.kind||!!u.value.value||Object.keys(u.parameters).length>0,m=s.get("symbol-sort-key");if(this.features=[],!f&&!d)return;const y=e.iconDependencies,g=e.glyphDependencies,x=e.availableImages,v=new Rs(this.zoom);for(const{feature:e,id:l,index:u,sourceLayerIndex:c}of t){const t=i._featureFilter.needGeometry,h=Cl(e,t);if(!i._featureFilter.filter(v,h,r))continue;if(t||(h.geometry=Vl(e,r,n)),a&&1!==e.type&&r.z<=5){const t=h.geometry,e=.98078528056,n=(t,n)=>{const i=Ru(t.x,t.y,r,1),s=Ru(n.x,n.y,r,1);return O.vec3.dot(i,s)<e};for(let e=0;e<t.length;e++)t[e]=zl(t[e],n);}let b,_;if(f){const t=i.getValueAndResolveTokens("text-field",h,r,x),e=Qe.factory(t);Sm(e)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Vs()||this.hasRTLText&&Ds.isParsed())&&(b=Af(e,i,h));}if(d){const t=i.getValueAndResolveTokens("icon-image",h,r,x);_=t instanceof er?t:er.build(t);}if(!b&&!_)continue;const w=this.sortFeaturesByKey?m.evaluate(h,{},r):void 0,M={id:l,text:b,icon:_,index:u,sourceLayerIndex:c,geometry:h.geometry,properties:e.properties,type:bm[e.type],sortKey:w};if(this.features.push(M),_){const t=this.layers[0]._unevaluatedLayout._values,{iconPrimary:e,iconSecondary:n}=Rd(_,this.iconSizeData,t["icon-size"],r,this.zoom,M,this.pixelRatio,p),i=e.id.toString();if(y.has(i)?y.get(i).push(e):y.set(i,[e]),n){const t=n.id.toString();y.has(t)?y.get(t).push(n):y.set(t,[n]);}}if(b){const t=o.evaluate(h,{},r).join(","),e="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Nf.vertical)>=0;for(const r of b.sections)if(r.image){const t=r.image.getPrimary().scaleSelf(this.pixelRatio),e=t.id.toString(),n=y.get(e)||[];n.push(t),y.set(e,n);}else {const n=ms(b.toString()),i=r.fontStack||t,s=g[i]=g[i]||{};this.calculateGlyphDependencies(r.text,s,e,this.allowVerticalPlacement,n);}}}if("line"===s.get("symbol-placement")&&(this.features=function(t){const e={},r={},n=[];let i=0;function s(e){n.push(t[e]),i++;}function a(t,e,i){const s=r[t];return delete r[t],r[e]=s,n[s].geometry[0].pop(),n[s].geometry[0]=n[s].geometry[0].concat(i[0]),s}function o(t,r,i){const s=e[r];return delete e[r],e[t]=s,n[s].geometry[0].shift(),n[s].geometry[0]=i[0].concat(n[s].geometry[0]),s}function l(t,e,r){const n=r?e[0][e[0].length-1]:e[0][0];return `${t}:${n.x}:${n.y}`}for(let u=0;u<t.length;u++){const c=t[u],h=c.geometry,p=c.text?c.text.toString():null;if(!p){s(u);continue}const f=l(p,h),d=l(p,h,!0);if(f in r&&d in e&&r[f]!==e[d]){const t=o(f,d,h),i=a(f,d,n[t].geometry);delete e[f],delete r[d],r[l(p,n[i].geometry,!0)]=i,n[t].geometry=null;}else f in r?a(f,d,h):d in e?o(f,d,h):(s(u),e[f]=i-1,r[d]=i-1);}return n.filter((t=>t.geometry))}(this.features)),"hd-road-markup"===s.get("symbol-elevation-reference")){if(this.elevationType="road",e.elevationFeatures){!this.elevationFeatures&&e.elevationFeatures.length>0&&(this.elevationFeatures=[],this.elevationFeatureIdToIndex=new Map);for(const t of e.elevationFeatures)this.elevationFeatureIdToIndex.set(t.id,this.elevationFeatures.length),this.elevationFeatures.push(t);}}else s.get("symbol-z-elevate")&&(this.elevationType="offset");"none"!==this.elevationType&&(this.zOffsetBuffersNeedUpload=!0),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey));}update(t,e,r,n,i,s,a){this.text.programConfigurations.updatePaintArrays(t,e,i,r,n,s,a),this.icon.programConfigurations.updatePaintArrays(t,e,i,r,n,s,a);}updateRoadElevation(){if("road"!==this.elevationType||!this.elevationFeatures)return;if(this.elevationStateComplete)return;this.elevationStateComplete=!0,this.hasAnyZOffset=!1;let t=!1;for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);if(65535===r.elevationFeatureIndex)continue;const n=this.elevationFeatures[r.elevationFeatureIndex];if(n){const e=.05+n.pointElevation(new q(r.tileAnchorX,r.tileAnchorY));r.zOffset!==e&&(t=!0,r.zOffset=e);}}t&&(this.zOffsetBuffersNeedUpload=!0,this.zOffsetSortDirty=!0);}updateZOffset(){const t=(t,e,n)=>{r+=e,r>t.length&&t.resize(r);for(let i=-e;i<0;i++)t.emplace(i+r,n);},e=(t,e,r)=>{n+=e,n>t.length&&t.resize(n);for(let i=-e;i<0;i++)t.emplace(i+n,r);};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let r=0,n=0;for(let r=0;r<this.symbolInstances.length;r++){const n=this.symbolInstances.get(r),{numHorizontalGlyphVertices:i,numVerticalGlyphVertices:s,numIconVertices:a}=n,o=n.zOffset,l=a>0;if((i>0||s>0)&&(t(this.text.zOffsetVertexArray,i,o),t(this.text.zOffsetVertexArray,s,o)),l){const{placedIconSymbolIndex:t,verticalPlacedIconSymbolIndex:r}=n;t>=0&&e(this.icon.zOffsetVertexArray,a,o),r>=0&&e(this.icon.zOffsetVertexArray,n.numVerticalIconVertices,o);}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray);}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return !this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0;}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy();}getProjection(){return this.projectionInstance||(this.projectionInstance=vm(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData();}addToLineVertexArray(t,e){const r=this.lineVertexArray.length;if(void 0!==t.segment)for(const{x:t,y:r}of e)this.lineVertexArray.emplaceBack(t,r);return {lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,m){const y=t.indexArray,g=t.layoutVertexArray,x=t.globeExtVertexArray,v=t.segments.prepareSegment(4*e.length,g,y,this.canOverlap?s.sortKey:void 0),b=this.glyphOffsetArray.length,_=v.vertexLength,w=this.allowVerticalPlacement&&a===Nf.vertical?Math.PI/2:0,M=s.text&&s.text.sections;for(let n=0;n<e.length;n++){const{tl:i,tr:a,bl:u,br:c,texPrimary:h,texSecondary:b,pixelOffsetTL:_,pixelOffsetBR:A,minFontScaleX:I,minFontScaleY:S,glyphOffset:P,isSDF:E,sectionIndex:z}=e[n],k=v.vertexLength,T=P[1];if(wm(g,l.x,l.y,i.x,T+i.y,h.x,h.y,r,E,_.x,_.y,I,S),wm(g,l.x,l.y,a.x,T+a.y,h.x+h.w,h.y,r,E,A.x,_.y,I,S),wm(g,l.x,l.y,u.x,T+u.y,h.x,h.y+h.h,r,E,_.x,A.y,I,S),wm(g,l.x,l.y,c.x,T+c.y,h.x+h.w,h.y+h.h,r,E,A.x,A.y,I,S),o){const{x:e,y:r,z:n}=o.anchor,[i,s,a]=o.up;Am(x,e,r,n,i,s,a),Am(x,e,r,n,i,s,a),Am(x,e,r,n,i,s,a),Am(x,e,r,n,i,s,a),Im(t.dynamicLayoutVertexArray,e,r,n,w);}else Im(t.dynamicLayoutVertexArray,l.x,l.y,l.z,w);if(m){const e=b||h;Mm(t.iconTransitioningVertexArray,e.x,e.y),Mm(t.iconTransitioningVertexArray,e.x+e.w,e.y),Mm(t.iconTransitioningVertexArray,e.x,e.y+e.h),Mm(t.iconTransitioningVertexArray,e.x+e.w,e.y+e.h);}y.emplaceBack(k,k+1,k+2),y.emplaceBack(k+1,k+2,k+3),v.vertexLength+=4,v.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(P[0]),n!==e.length-1&&z===e[n+1].sectionIndex||t.programConfigurations.populatePaintArrays(g.length,s,s.index,{},p,f,d,M&&M[z]);}const A=o?o.anchor:l;t.placedSymbolArray.emplaceBack(A.x,A.y,A.z,l.x,l.y,b,this.glyphOffsetArray.length-b,_,u,c,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],a,0,!1,0,h,0);}_commitLayoutVertex(t,e,r,n,i,s,a){t.emplaceBack(e,r,n,i,s,Math.round(a.x),Math.round(a.y));}_addCollisionDebugVertices(t,e,r,n,i,s,a){const o=r.segments.prepareSegment(4,r.layoutVertexArray,r.indexArray),l=o.vertexLength,u=a.tileAnchorX,c=a.tileAnchorY;for(let t=0;t<4;t++)r.collisionVertexArray.emplaceBack(0,0,0,0,0,0);this._commitDebugCollisionVertexUpdate(r.collisionVertexArrayExt,e,t.padding,a.zOffset),this._commitLayoutVertex(r.layoutVertexArray,n,i,s,u,c,new q(t.x1,t.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,s,u,c,new q(t.x2,t.y1)),this._commitLayoutVertex(r.layoutVertexArray,n,i,s,u,c,new q(t.x2,t.y2)),this._commitLayoutVertex(r.layoutVertexArray,n,i,s,u,c,new q(t.x1,t.y2)),o.vertexLength+=4;const h=r.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),o.primitiveLength+=4;}_addTextDebugCollisionBoxes(t,e,r,n,i,s){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceTextSize(t,s,e,a);this._addCollisionDebugVertices(n,i,this.textCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,s);}}_addIconDebugCollisionBoxes(t,e,r,n,i,s){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceIconSize(t,e,s.placedIconSymbolIndex);this._addCollisionDebugVertices(n,i,this.iconCollisionBox,n.projectedAnchorX,n.projectedAnchorY,n.projectedAnchorZ,s);}}generateCollisionDebugBuffers(t,e,r){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Em(Oa,mf.members,La),this.iconCollisionBox=new Em(Oa,mf.members,La);const n=wf(this.iconSizeData,t),i=wf(this.textSizeData,t,r);for(let r=0;r<this.symbolInstances.length;r++){const s=this.symbolInstances.get(r);this._addTextDebugCollisionBoxes(i,t,e,s.textBoxStartIndex,s.textBoxEndIndex,s),this._addTextDebugCollisionBoxes(i,t,e,s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s),this._addIconDebugCollisionBoxes(n,t,e,s.iconBoxStartIndex,s.iconBoxEndIndex,s),this._addIconDebugCollisionBoxes(n,t,e,s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s);}}getSymbolInstanceTextSize(t,e,r,n){const i=this.text.placedSymbolArray.get(e.rightJustifiedTextSymbolIndex>=0?e.rightJustifiedTextSymbolIndex:e.centerJustifiedTextSymbolIndex>=0?e.centerJustifiedTextSymbolIndex:e.leftJustifiedTextSymbolIndex>=0?e.leftJustifiedTextSymbolIndex:e.verticalPlacedTextSymbolIndex>=0?e.verticalPlacedTextSymbolIndex:n),s=_f(this.textSizeData,t,i)/gf;return this.tilePixelRatio*s}getSymbolInstanceIconSize(t,e,r){const n=this.icon.placedSymbolArray.get(r),i=_f(this.iconSizeData,t,n);return this.tilePixelRatio*i}_commitDebugCollisionVertexUpdate(t,e,r,n){t.emplaceBack(e,-r,-r,n),t.emplaceBack(e,r,-r,n),t.emplaceBack(e,r,r,n),t.emplaceBack(e,-r,r,n);}_updateTextDebugCollisionBoxes(t,e,r,n,i,s,a){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceTextSize(t,s,e,a);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,i,n.padding,s.zOffset);}}_updateIconDebugCollisionBoxes(t,e,r,n,i,s,a){for(let a=n;a<i;a++){const n=r.get(a),i=this.getSymbolInstanceIconSize(t,e,s.placedIconSymbolIndex);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,i,n.padding,s.zOffset);}}updateCollisionDebugBuffers(t,e,r,n){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const i=wf(this.iconSizeData,t,n),s=wf(this.textSizeData,t,r);for(let a=0;a<this.symbolInstances.length;a++){const o=this.symbolInstances.get(a);this._updateTextDebugCollisionBoxes(s,t,e,o.textBoxStartIndex,o.textBoxEndIndex,o,r),this._updateTextDebugCollisionBoxes(s,t,e,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o,r),this._updateIconDebugCollisionBoxes(i,t,e,o.iconBoxStartIndex,o.iconBoxEndIndex,o,n),this._updateIconDebugCollisionBoxes(i,t,e,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o,n);}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(t,e,r,n,i,s,a,o,l){const u={};if(e<r){const{x1:r,y1:n,x2:i,y2:s,padding:a,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p,featureIndex:f}=t.get(e);u.textBox={x1:r,y1:n,x2:i,y2:s,padding:a,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p},u.textFeatureIndex=f;}if(n<i){const{x1:e,y1:r,x2:i,y2:s,padding:a,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p,featureIndex:f}=t.get(n);u.verticalTextBox={x1:e,y1:r,x2:i,y2:s,padding:a,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p},u.verticalTextFeatureIndex=f;}if(s<a){const{x1:e,y1:r,x2:n,y2:i,padding:a,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p,featureIndex:f}=t.get(s);u.iconBox={x1:e,y1:r,x2:n,y2:i,padding:a,projectedAnchorX:o,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p},u.iconFeatureIndex=f;}if(o<l){const{x1:e,y1:r,x2:n,y2:i,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p,featureIndex:f}=t.get(o);u.verticalIconBox={x1:e,y1:r,x2:n,y2:i,padding:s,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:c,tileAnchorX:h,tileAnchorY:p},u.verticalIconFeatureIndex=f;}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.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}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(t,e){const r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs;for(let e=r.vertexStartIndex;e<n;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3);}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),r=Math.cos(t),n=[],i=[],s=[];for(let t=0;t<this.symbolInstances.length;++t){s.push(t);const a=this.symbolInstances.get(t);n.push(0|Math.round(e*a.tileAnchorX+r*a.tileAnchorY)),i.push(a.featureIndex);}return s.sort(((t,e)=>n[t]-n[e]||i[e]-i[t])),s}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let t=0;t<this.symbolInstances.length;++t)this.symbolInstanceIndexesSortedZOffset.push(t);}return this.zOffsetSortDirty=!1,this.symbolInstanceIndexesSortedZOffset.sort(((t,e)=>this.symbolInstances.get(e).zOffset-this.symbolInstances.get(t).zOffset))}addToSortKeyRanges(t,e){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1});}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex);const{rightJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:n,leftJustifiedTextSymbolIndex:i,verticalPlacedTextSymbolIndex:s,placedIconSymbolIndex:a,verticalPlacedIconSymbolIndex:o}=e;r>=0&&this.addIndicesForPlacedSymbol(this.text,r),n>=0&&n!==r&&this.addIndicesForPlacedSymbol(this.text,n),i>=0&&i!==n&&i!==r&&this.addIndicesForPlacedSymbol(this.text,i),s>=0&&this.addIndicesForPlacedSymbol(this.text,s),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a),o>=0&&this.addIndicesForPlacedSymbol(this.icon,o);}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}}}let km,Tm,Bm;us(zm,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),zm.addDynamicAttributes=Im;class Vm{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:De,this.defaultValue=t;}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);}outputDefined(){return !1}serialize(){return null}}us(Vm,"FormatSectionOverride",{omit:["defaultValue"]});const Cm=()=>Bm||(Bm={layout:km||(km=new Xs({"symbol-placement":new Gs(Zs.layout_symbol["symbol-placement"]),"symbol-spacing":new Gs(Zs.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Gs(Zs.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ys(Zs.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Gs(Zs.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new Gs(Zs.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new Gs(Zs.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new Gs(Zs.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Gs(Zs.layout_symbol["icon-ignore-placement"]),"icon-optional":new Gs(Zs.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Gs(Zs.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ys(Zs.layout_symbol["icon-size"]),"icon-size-scale-range":new Gs(Zs.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new Ys(Zs.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ys(Zs.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ys(Zs.layout_symbol["icon-image"]),"icon-rotate":new Ys(Zs.layout_symbol["icon-rotate"]),"icon-padding":new Gs(Zs.layout_symbol["icon-padding"]),"icon-keep-upright":new Gs(Zs.layout_symbol["icon-keep-upright"]),"icon-offset":new Ys(Zs.layout_symbol["icon-offset"]),"icon-anchor":new Ys(Zs.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Gs(Zs.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Gs(Zs.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Gs(Zs.layout_symbol["text-rotation-alignment"]),"text-field":new Ys(Zs.layout_symbol["text-field"]),"text-font":new Ys(Zs.layout_symbol["text-font"]),"text-size":new Ys(Zs.layout_symbol["text-size"]),"text-size-scale-range":new Gs(Zs.layout_symbol["text-size-scale-range"]),"text-max-width":new Ys(Zs.layout_symbol["text-max-width"]),"text-line-height":new Ys(Zs.layout_symbol["text-line-height"]),"text-letter-spacing":new Ys(Zs.layout_symbol["text-letter-spacing"]),"text-justify":new Ys(Zs.layout_symbol["text-justify"]),"text-radial-offset":new Ys(Zs.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Gs(Zs.layout_symbol["text-variable-anchor"]),"text-anchor":new Ys(Zs.layout_symbol["text-anchor"]),"text-max-angle":new Gs(Zs.layout_symbol["text-max-angle"]),"text-writing-mode":new Gs(Zs.layout_symbol["text-writing-mode"]),"text-rotate":new Ys(Zs.layout_symbol["text-rotate"]),"text-padding":new Gs(Zs.layout_symbol["text-padding"]),"text-keep-upright":new Gs(Zs.layout_symbol["text-keep-upright"]),"text-transform":new Ys(Zs.layout_symbol["text-transform"]),"text-offset":new Ys(Zs.layout_symbol["text-offset"]),"text-allow-overlap":new Gs(Zs.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Gs(Zs.layout_symbol["text-ignore-placement"]),"text-optional":new Gs(Zs.layout_symbol["text-optional"]),visibility:new Gs(Zs.layout_symbol.visibility)})),paint:Tm||(Tm=new Xs({"icon-opacity":new Ys(Zs.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Ys(Zs.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Ys(Zs.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Ys(Zs.paint_symbol["text-emissive-strength"]),"icon-color":new Ys(Zs.paint_symbol["icon-color"]),"icon-halo-color":new Ys(Zs.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ys(Zs.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ys(Zs.paint_symbol["icon-halo-blur"]),"icon-translate":new Gs(Zs.paint_symbol["icon-translate"]),"icon-translate-anchor":new Gs(Zs.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Ys(Zs.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Ys(Zs.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Ys(Zs.paint_symbol["text-occlusion-opacity"]),"text-color":new Ys(Zs.paint_symbol["text-color"],{runtimeType:Oe,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Ys(Zs.paint_symbol["text-halo-color"]),"text-halo-width":new Ys(Zs.paint_symbol["text-halo-width"]),"text-halo-blur":new Ys(Zs.paint_symbol["text-halo-blur"]),"text-translate":new Gs(Zs.paint_symbol["text-translate"]),"text-translate-anchor":new Gs(Zs.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new Gs(Zs.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new Gs(Zs.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new Gs(Zs.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new Gs(Zs.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new Ys(Zs.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},Bm);class Dm extends ma{constructor(t,e,r,n){super(t,Cm(),e,r,n),this._colorAdjustmentMatrix=O.mat4.identity([]),this.hasInitialOcclusionOpacityProperties=void 0!==t.paint&&("icon-occlusion-opacity"in t.paint||"text-occlusion-opacity"in t.paint);}recalculate(t,e){super.recalculate(t,e),"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 r=this.layout.get("text-writing-mode");if(r){const t=[];for(const e of r)t.indexOf(e)<0&&t.push(e);this.layout._values["text-writing-mode"]=t;}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides();}getColorAdjustmentMatrix(t,e,r,n){return this._saturation===t&&this._contrast===e&&this._brightnessMin===r&&this._brightnessMax===n||(this._colorAdjustmentMatrix=function(t,e,r,n){t=Mt(t),e=wt(e);const i=O.mat4.create(),s=t/3,a=1-2*s,o=[a,s,s,0,s,a,s,0,s,s,a,0,0,0,0,1],l=.5-.5*e,u=n-r;return O.mat4.multiply(i,[u,0,0,0,0,u,0,0,0,0,u,0,r,r,r,1],[e,0,0,0,0,e,0,0,0,0,e,0,l,l,l,1]),O.mat4.multiply(i,i,o),i}(t,e,r,n),this._saturation=t,this._contrast=e,this._brightnessMin=r,this._brightnessMax=n),this._colorAdjustmentMatrix}getValueAndResolveTokens(t,e,r,n){const i=this.layout.get(t).evaluate(e,{},r,n),s=this._unevaluatedLayout._values[t];return s.isDataDriven()||Ki(s.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,((e,r)=>r in t?String(t[r]):""))}(e.properties,i)}createBucket(t){return new zm(t)}queryRadius(){return 0}queryIntersectsFeature(){return !1}_setPaintOverrides(){for(const t of Cm().paint.overridableProperties){if(!Dm.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),r=new Vm(e),n=new Wi(r,e.property.specification,this.scope,this.options);let i=null;i="constant"===e.value.kind||"source"===e.value.kind?new Qi("source",n):new ts("composite",n,e.value.zoomStops,e.value._interpolationType),this.paint._values[t]=new qs(e.property,i,e.parameters);}}_handleOverridablePaintPropertyUpdate(t,e,r){return !(!this.layout||e.isDataDriven()||r.isDataDriven())&&Dm.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const r=t.get("text-field"),n=Cm().paint.properties[e];let i=!1;const s=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof Qe)s(r.value.value.sections);else if("source"===r.value.kind){const t=e=>{i||(e instanceof ar&&ir(e.value)===qe?s(e.value.sections):e instanceof cr?s(e.sections):e.eachChild(t));},e=r.value;e._styleExpression&&t(e._styleExpression.expression);}return i}getProgramIds(){return ["symbol"]}getDefaultProgramParams(t,e,r){return {config:new $o(this,{zoom:e,lut:r}),overrideFog:!1}}}let Rm,Lm,Fm,Om;var Nm=va([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function Um(t){switch(t){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function jm(t){switch(t){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class qm{constructor(t,e,r,n){this.context=t,this.format=r,this.useMipmap=n&&n.useMipmap,this.texture=t.gl.createTexture(),this.update(e,{premultiply:n&&n.premultiply});}update(t,e){const r=t&&t instanceof HTMLVideoElement&&0===t.width?t.videoWidth:t.width,n=t&&t instanceof HTMLVideoElement&&0===t.height?t.videoHeight:t.height,{context:i}=this,{gl:s}=i,{x:a,y:o}=e&&e.position?e.position:{x:0,y:0},l=a+r,u=o+n;!this.size||this.size[0]===l&&this.size[1]===u||(s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(this.texture),this.texture=s.createTexture(),this.size=null),s.bindTexture(s.TEXTURE_2D,this.texture),i.pixelStoreUnpackFlipY.set(!1),i.pixelStoreUnpack.set(1),i.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA8&&(!e||!1!==e.premultiply));const c=t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||ImageBitmap&&t instanceof ImageBitmap;if(!this.size&&l>0&&u>0){const t=this.useMipmap?Math.floor(Math.log2(Math.max(l,u)))+1:1;s.texStorage2D(s.TEXTURE_2D,t,this.format,l,u),this.size=[l,u];}if(this.size)if(c)s.texSubImage2D(s.TEXTURE_2D,0,a,o,Um(this.format),jm(this.format),t);else {const e=t.data;e&&s.texSubImage2D(s.TEXTURE_2D,0,a,o,r,n,Um(this.format),jm(this.format),e);}this.useMipmap&&s.generateMipmap(s.TEXTURE_2D);}bind(t,e,r=!1){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),t!==this.minFilter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,this.useMipmap&&!r?t===i.NEAREST?i.NEAREST_MIPMAP_NEAREST:i.LINEAR_MIPMAP_LINEAR:t),this.minFilter=t),e!==this.wrapS&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrapS=e);}bindExtraParam(t,e,r,n){const{context:i}=this,{gl:s}=i;s.bindTexture(s.TEXTURE_2D,this.texture),e!==this.magFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,e),this.magFilter=e),t!==this.minFilter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,this.useMipmap?t===s.NEAREST?s.NEAREST_MIPMAP_NEAREST:s.LINEAR_MIPMAP_LINEAR:t),this.minFilter=t),r!==this.wrapS&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,r),this.wrapS=r),n!==this.wrapT&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,n),this.wrapT=n);}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null;}}class $m{constructor(t,e){this.context=t,this.texture=e;}bind(t,e){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_2D,this.texture),t!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,t),this.minFilter=t),e!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrapS=e);}}function Gm(t,e,r,n,i,s,a,o){const l=[t,e,1,r,n,1,i,s,1],u=[a,o,1],c=O.mat3.adjoint([],l),[h,p,f]=O.vec3.transformMat3(u,u,c);return O.mat3.multiply(l,l,[h,0,0,0,p,0,0,0,f])}function Ym(t,e,r,n,i,s,a,o){const l=function(t,e,r,n,i,s,a,o){const l=Gm(0,0,1,0,1,1,0,1),u=Gm(t,e,r,n,i,s,a,o),c=O.mat3.adjoint([],l);return O.mat3.multiply(u,u,c)}(t,e,r,n,i,s,a,o);return [l[2]/l[8]/Kr,l[5]/l[8]/Kr]}function Hm(t){return [t[0],Math.min(Math.max(t[1],-bl),bl)]}class Xm extends _e{constructor(t,e,r,n){super(),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(n),this.options=e,this._dirty=!1;}load(t,e){if(this._loaded=e||!1,this.fire(new ge("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return t&&(this.coordinates=t),this._loaded=!0,void this._finishLoading();this._imageRequest=le(this.map._requestManager.transformRequest(this.url,Qt.Image),((e,r)=>{this._imageRequest=null,this._loaded=!0,e?this.fire(new xe(e)):r&&(this.image=r instanceof HTMLImageElement?Ct.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(t){return t.url?(this._imageRequest&&t.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=t.url,this.load(t.coordinates,this._loaded),this):this}setTexture(t){if(!(t.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new $m(this.map.painter.context,t.handle),this.width=t.dimensions[0],this.height=t.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new ge("data",{dataType:"source",sourceDataType:"metadata"})));}onAdd(t){this.map=t,this.load();}onRemove(t){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof $m||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy());}setCoordinates(t){if(this.coordinates=t,this._boundsArray=void 0,this._unsupportedCoords=!1,!t.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let e=t[0][1],r=t[0][1];for(const n of t)n[1]>r&&(r=n[1]),n[1]<e&&(e=n[1]);const n=(r+e)/2;if(n>bl?this.onNorthPole=!0:n<-bl&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const e=t.map(Il.fromLngLat);this.tileID=function(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const s of t)e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);const s=Math.max(n-e,i-r),a=Math.max(0,Math.floor(-Math.log(s)/Math.LN2)),o=Math.pow(2,a);let l=Math.floor((e+n)/2*o);return l>1&&(l-=1),new ou(a,l,Math.floor((r+i)/2*o))}(e),this.minzoom=this.maxzoom=this.tileID.z;}return this.fire(new ge("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1;}_prepareData(t){for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture);}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const e=Kd(new ou(0,0,0),this.map.transform.projection),r=[e.projection.project(this.coordinates[0][0],this.coordinates[0][1]),e.projection.project(this.coordinates[1][0],this.coordinates[1][1]),e.projection.project(this.coordinates[2][0],this.coordinates[2][1]),e.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(t){const e=t[1].x-t[0].x,r=t[1].y-t[0].y,n=t[2].x-t[1].x,i=t[2].y-t[1].y,s=t[3].x-t[2].x,a=t[3].y-t[2].y,o=t[0].x-t[3].x,l=t[0].y-t[3].y,u=e*i-n*r,c=n*a-s*i,h=s*l-o*a,p=o*r-e*l;return u>0&&c>0&&h>0&&p>0||u<0&&c<0&&h<0&&p<0}(r))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const n=Kd(this.tileID,this.map.transform.projection),[i,s,a,o]=this.coordinates.map((t=>{const e=n.projection.project(t[0],t[1]);return Jd(n,e)._round()}));this.perspectiveTransform=Ym(i.x,i.y,s.x,s.y,a.x,a.y,o.x,o.y);const l=this._boundsArray=new Ma;l.emplaceBack(i.x,i.y,0,0),l.emplaceBack(s.x,s.y,Kr,0),l.emplaceBack(o.x,o.y,0,Kr),l.emplaceBack(a.x,a.y,Kr,Kr),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=t.createVertexBuffer(l,Nm.members),this.boundsSegments=xo.simpleSegment(0,0,4,2);const u=[],c=[Hm((h=this.coordinates)[0]),Hm(h[1]),Hm(h[2]),Hm(h[3])];var h;const[p,f,d,m]=function(t){let e=t[0][0],r=e,n=t[0][1],i=n;for(let s=1;s<t.length;s++)t[s][0]<e?e=t[s][0]:t[s][0]>r&&(r=t[s][0]),t[s][1]<n?n=t[s][1]:t[s][1]>i&&(i=t[s][1]);return [e,n,r-e,i-n]}(c);{const n=new Ma,[i,s,a,o]=function(t){let e=t[0].x,r=e,n=t[0].y,i=n;for(let s=1;s<t.length;s++)t[s].x<e?e=t[s].x:t[s].x>r&&(r=t[s].x),t[s].y<n?n=t[s].y:t[s].y>i&&(i=t[s].y);return [e,n,r-e,i-n]}(r),l=t=>[(t.x-i)/a,(t.y-s)/o],[c,h,y,g]=r.map(l),x=function(t,e,r,n,i,s,a,o){const l=Gm(0,0,1,0,1,1,0,1),u=Gm(t,e,r,n,i,s,a,o),c=O.mat3.adjoint([],u);return O.mat3.multiply(l,l,c)}(c[0],c[1],h[0],h[1],y[0],y[1],g[0],g[1]);this.elevatedGlobePerspectiveTransform=Ym(c[0],c[1],h[0],h[1],y[0],y[1],g[0],g[1]);const v=(t,e)=>{u.push(t.lng);const r=Math.round((t.lng-p)/d*Kr),i=Math.round((t.lat-f)/m*Kr),s=l(e),a=O.vec3.transformMat3([],[s[0],s[1],1],x),o=Math.round(a[0]/a[2]*Kr),c=Math.round(a[1]/a[2]*Kr);n.emplaceBack(r,i,o,c);},b=r[3].x-r[0].x,_=r[3].y-r[0].y,w=r[2].x-r[1].x,M=r[2].y-r[1].y;for(let t=0;t<65;t++){const n=t/64,i=[r[0].x+n*b,r[0].y+n*_],s=[r[1].x+n*w,r[1].y+n*M],a=s[0]-i[0],o=s[1]-i[1];for(let t=0;t<65;t++){const r=t/64,n={x:i[0]+a*r,y:i[1]+o*r,z:0};v(e.projection.unproject(n.x,n.y),n);}}this.elevatedGlobeVertexBuffer=t.createVertexBuffer(n,Nm.members);}{this.maxLongitudeTriangleSize=0;let e=[],r=new ja;const n=(t,n,i)=>{r.emplaceBack(t,n,i);const s=u[t],a=u[n],o=u[i],l=Math.min(Math.min(s,a),o),c=Math.max(Math.max(s,a),o)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),e.push(l+c/2);};for(let t=0;t<64;t++)for(let e=0;e<64;e++){const r=65*t+e,i=r+1,s=r+65,a=s+1;n(r,s,i),n(i,s,a);}[e,r]=function(t,e){const r=Array.from({length:t.length},((t,e)=>e));r.sort(((e,r)=>t[e]-t[r]));const n=[],i=new ja;for(let s=0;s<r.length;s++){const a=r[s];n.push(t[a]);const o=3*a,l=o+1;i.emplaceBack(e.uint16[o],e.uint16[l],e.uint16[l+1]);}return [n,i]}(e,r),this.elevatedGlobeTrianglesCenterLongitudes=e,this.elevatedGlobeIndexBuffer=t.createIndexBuffer(r);}this.elevatedGlobeSegments=xo.simpleSegment(0,0,4225,8192),this.elevatedGlobeGridMatrix=new Float32Array([0,d/Kr,0,m/Kr,0,0,f,p,0]);}prepare(){const t=0!==Object.keys(this.tiles).length;if(this.tileID&&!t)return;const e=this.map.painter.context,r=e.gl;!this._dirty||this.texture instanceof $m||(this.texture?this.texture.update(this.image):(this.texture=new qm(e,this.image,r.RGBA8),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this._dirty=!1),t&&this._prepareData(e);}loadTile(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null));}serialize(){return {type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return !1}getSegmentsForLongitude(t){const e=this.elevatedGlobeSegments;if(!this.elevatedGlobeTrianglesCenterLongitudes||!e)return null;const r=this.elevatedGlobeTrianglesCenterLongitudes;let n=(i=t+180)+360*Math.round((r[0]-i)/360);var i;const s=new xo,a=(t,r)=>{s.segments.push({vertexOffset:0,primitiveOffset:t,vertexLength:e.segments[0].vertexLength,primitiveLength:r,sortKey:void 0,vaos:{}});},o=.51*this.maxLongitudeTriangleSize;if(Math.abs(r[0]-n)<=o){const t=_t(r,0,r.length,n+o);return t===r.length||a(t,bt(r,t+1,r.length,n+360-o)-t),s}n<r[0]&&(n+=360);const l=bt(r,0,r.length,n-o);if(l===r.length)return a(0,r.length),s;a(0,l-0);const u=_t(r,l+1,r.length,n+o);return u!==r.length&&a(u,r.length-u),s}}const Zm=(Math.pow(256,2)-1)/16907520;class Wm extends ma{constructor(t,e,r,n){super(t,{layout:Fm||(Fm=new Xs({visibility:new Gs(Zs.layout_raster.visibility)})),paint:Om||(Om=new Xs({"raster-opacity":new Gs(Zs.paint_raster["raster-opacity"]),"raster-color":new Hs(Zs.paint_raster["raster-color"]),"raster-color-mix":new Gs(Zs.paint_raster["raster-color-mix"]),"raster-color-range":new Gs(Zs.paint_raster["raster-color-range"]),"raster-hue-rotate":new Gs(Zs.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Gs(Zs.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Gs(Zs.paint_raster["raster-brightness-max"]),"raster-saturation":new Gs(Zs.paint_raster["raster-saturation"]),"raster-contrast":new Gs(Zs.paint_raster["raster-contrast"]),"raster-resampling":new Gs(Zs.paint_raster["raster-resampling"]),"raster-fade-duration":new Gs(Zs.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new Gs(Zs.paint_raster["raster-emissive-strength"]),"raster-array-band":new Gs(Zs.paint_raster["raster-array-band"]),"raster-elevation":new Gs(Zs.paint_raster["raster-elevation"]),"raster-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n),this.updateColorRamp(),this._curRampRange=[NaN,NaN];}getProgramIds(){return ["raster"]}hasColorMap(){return !!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(t){return !(t&&t._source instanceof Xm&&(t._source.onNorthPole||t._source.onSouthPole))&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(t){"raster-color"!==t&&"raster-color-range"!==t||(this._curRampRange=[NaN,NaN],this.updateColorRamp());}updateColorRamp(t){if(!this.hasColorMap())return;if(!this._curRampRange)return;const e=this._transitionablePaint._values["raster-color"].value.expression,[r,n]=t||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(r)&&isNaN(n)||r===this._curRampRange[0]&&n===this._curRampRange[1]||(this.colorRamp=dc({expression:e,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:r,end:n}],resolution:256}),this.colorRampTexture=null,this._curRampRange=[r,n]);}}let Km,Jm,Qm,ty,ey;class ry extends ma{constructor(t,e,r,n){super(t,{layout:Km||(Km=new Xs({visibility:new Gs(Zs["layout_raster-particle"].visibility)})),paint:Jm||(Jm=new Xs({"raster-particle-array-band":new Gs(Zs["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new Gs(Zs["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new Hs(Zs["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new Gs(Zs["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new Gs(Zs["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new Gs(Zs["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new Gs(Zs["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new Gs(Zs["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n),this._updateColorRamp(),this.lastInvalidatedAt=Ct.now();}onRemove(t){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy();}hasColorMap(){return !!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return ["rasterParticle"]}hasOffscreenPass(){return "none"!==this.visibility}isDraped(t){return !1}_handleSpecialPaintPropertyUpdate(t){"raster-particle-color"!==t&&"raster-particle-max-speed"!==t||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===t&&this._invalidateAnimationState();}_updateColorRamp(){if(!this.hasColorMap())return;const t=this._transitionablePaint._values["raster-particle-color"].value.expression,e=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=dc({expression:t,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:e}],resolution:256}),this.colorRampTexture=null;}_invalidateAnimationState(){this.lastInvalidatedAt=Ct.now();}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class ny extends ma{constructor(t,e){super(t,{},e,null),this.implementation=t,t.slot&&(this.slot=t.slot);}is3D(t){return "3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(t){return void 0!==this.implementation.renderToTile}shouldRedrape(){return !!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return !1}serialize(){}onAdd(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl);}onRemove(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl);}}function iy(t,e,r){const n=[0,0,1],i=O.quat.identity([]);return O.quat.rotateY(i,i,r?-H(t)+Math.PI:H(t)),O.quat.rotateX(i,i,-H(e)),O.vec3.transformQuat(n,n,i),O.vec3.normalize(n,n)}function sy(t,e){const r=oy(t.projection,t.zoom,t.width,t.height),n=function(t,e,r,n,i){const s=new ul(r.lng-180*ly,r.lat),a=new ul(r.lng+180*ly,r.lat),o=t.project(s.lng,s.lat),l=t.project(a.lng,a.lat),u=-Math.atan2(l.y-o.y,l.x-o.x),c=Il.fromLngLat(r);c.y=Q(c.y,-1+ly,1-ly);const h=c.toLngLat(),p=t.project(h.lng,h.lat),f=Il.fromLngLat(h);f.x+=ly;const d=f.toLngLat(),m=t.project(d.lng,d.lat),y=cy(m.x-p.x,m.y-p.y,u),g=Il.fromLngLat(h);g.y+=ly;const x=g.toLngLat(),v=t.project(x.lng,x.lat),b=cy(v.x-p.x,v.y-p.y,u),_=Math.abs(y.x)/Math.abs(b.y),w=O.mat4.identity([]);O.mat4.rotateZ(w,w,-u*(1-(i?0:n)));const M=O.mat4.identity([]);return O.mat4.scale(M,M,[1,1-(1-_)*n,1]),M[4]=-b.x/b.y*n,O.mat4.rotateZ(M,M,u),O.mat4.multiply(M,w,M),M}(t.projection,0,t.center,r,e),i=ay(t);return O.mat4.scale(n,n,[i,i,1]),n}function ay(t){const e=t.projection,r=oy(t.projection,t.zoom,t.width,t.height),n=uy(e,t.center),i=uy(e,ul.convert(e.center));return Math.pow(2,n*r+(1-r)*i)}function oy(t,e,r,n,i=1/0){const s=t.range;if(!s)return 0;const a=Math.min(i,Math.max(r,n)),o=Math.log(a/1024)/Math.LN2;return tt(s[0]+o,s[1]+o,e)}const ly=1/4e4;function uy(t,e){const r=Q(e.lat,-bl,bl),n=new ul(e.lng-180*ly,r),i=new ul(e.lng+180*ly,r),s=t.project(n.lng,r),a=t.project(i.lng,r),o=Il.fromLngLat(n),l=Il.fromLngLat(i),u=a.x-s.x,c=a.y-s.y,h=l.x-o.x,p=l.y-o.y,f=Math.sqrt((h*h+p*p)/(u*u+c*c));return Math.log(f)/Math.LN2}function cy(t,e,r){const n=Math.cos(r),i=Math.sin(r);return {x:t*n-e*i,y:t*i+e*n}}function hy(t,e,r){O.mat4.identity(t),O.mat4.rotateZ(t,t,H(e[2])),O.mat4.rotateX(t,t,H(e[0])),O.mat4.rotateY(t,t,H(e[1])),O.mat4.scale(t,t,r),O.mat4.multiply(t,t,[1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1]);}function py(t,e,r,n,i,s,a,o){const l=[r[0]-e[0],r[1]-e[1],0],u=[n[0]-e[0],n[1]-e[1],0];if(O.vec3.length(l)<1e-12||O.vec3.length(u)<1e-12)return O.quat.identity(t);const c=O.vec3.cross([],l,u);O.vec3.normalize(c,c),O.vec3.subtract(u,n,e),l[2]=(s-i)*o,u[2]=(a-i)*o;const h=l;return O.vec3.cross(h,l,u),O.vec3.normalize(h,h),O.quat.rotationTo(t,c,h)}function fy(t,e,r=!1){const n=$u(e.zoom),i=function(t,e,r){const n=e.worldSize,i=[t[12],t[13],t[14]],s=xl(i[1]/n),a=gl(i[0]/n),o=O.mat4.identity([]),l=yl(1,s)*n,u=yl(1,0)*n*wl(s,e.zoom),c=1/Uu(n);let h=u*c;if(r){const t=oy(e.projection,e.zoom,e.width,e.height,1024);h=c*e.projection.pixelSpaceConversion(e.center.lat,n,t);}const p=al(s,a);O.vec3.add(p,p,O.vec3.scale([],O.vec3.normalize([],p),l*h*i[2]));const f=function(t){const e=[t[0],t[1],t[2]];let r=[0,1,0];const n=O.vec3.cross([],r,e);return O.vec3.cross(r,e,n),0===O.vec3.squaredLength(r)&&(r=[0,1,0],O.vec3.cross(n,e,r)),O.vec3.normalize(n,n),O.vec3.normalize(r,r),O.vec3.normalize(e,e),[n[0],n[1],n[2],0,r[0],r[1],r[2],0,e[0],e[1],e[2],0,t[0],t[1],t[2],1]}(p);O.mat4.scale(o,o,[h,h,h*l]),O.mat4.translate(o,o,[-i[0],-i[1],-i[2]]);const d=O.mat4.multiply([],e.globeMatrix,f);return O.mat4.multiply(d,d,o),O.mat4.multiply(d,d,t),d}(t,e,r);if(n>0){const r=function(t,e){const r=e.worldSize,n=yl(1,0)*r*wl(e.center.lat,e.zoom)/Uu(r),i=yl(1,e.center.lat)*r,s=O.mat4.identity([]);return O.mat4.rotateY(s,s,H(e.center.lng)),O.mat4.rotateX(s,s,H(e.center.lat)),O.mat4.translate(s,s,[0,0,Ko]),O.mat4.scale(s,s,[n,n,n*i]),O.mat4.translate(s,s,[e.point.x-.5*r,e.point.y-.5*r,0]),O.mat4.multiply(s,s,t),O.mat4.multiply(s,e.globeMatrix,s)}(t,e);return function(t,e,r){const n=(t,e,r)=>{const n=O.vec3.length(t),i=O.vec3.length(e),s=Tu(t,e,r);return O.vec3.scale(s,s,1/O.vec3.length(s)*Ee(n,i,r))},i=n([t[0],t[1],t[2]],[e[0],e[1],e[2]],r),s=n([t[4],t[5],t[6]],[e[4],e[5],e[6]],r),a=n([t[8],t[9],t[10]],[e[8],e[9],e[10]],r),o=Tu([t[12],t[13],t[14]],[e[12],e[13],e[14]],r);return [i[0],i[1],i[2],0,s[0],s[1],s[2],0,a[0],a[1],a[2],0,o[0],o[1],o[2],1]}(i,r,n)}return i}function dy(t,e,r,n){const i=Au.projectAabbCorners(n,r);let s=Number.MAX_VALUE,a=-1;for(let t=0;t<i.length;++t){const r=i[t];r[0]=(.5*r[0]+.5)*e.width,r[1]=(.5-.5*r[1])*e.height,r[2]<s&&(a=t,s=r[2]);}const o=t=>new q(i[t][0],i[t][1]);let l;switch(a){case 0:case 6:l=[o(1),o(5),o(4),o(7),o(3),o(2),o(1)];break;case 1:case 7:l=[o(0),o(4),o(5),o(6),o(2),o(3),o(0)];break;case 3:case 5:l=[o(1),o(0),o(4),o(7),o(6),o(2),o(1)];break;default:l=[o(1),o(5),o(6),o(7),o(3),o(0),o(1)];}if(Fl(t,l))return s}const my=va([{name:"a_pos_3f",components:3,type:"Float32"}]),yy=va([{name:"a_color_3f",components:3,type:"Float32"}]),gy=va([{name:"a_color_4f",components:4,type:"Float32"}]),xy=va([{name:"a_uv_2f",components:2,type:"Float32"}]),vy=va([{name:"a_normal_3f",components:3,type:"Float32"}]),by=va([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),_y=va([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]),wy={None:0,Model:1,Symbol:2,FillExtrusion:4,All:7};class My{constructor(t,e,r,n){this.message=(t?`${t}: `:"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__);}}function Ay(t,e){const r=-1===t.indexOf("://");try{return new URL(t,r&&e?"http://example.com":void 0),!0}catch(t){return !1}}class Iy{constructor(t,e){this.feature=t,this.instancedDataOffset=e,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0];}}class Sy{constructor(){this.instancedDataArray=new Ja,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={};}}class Py{constructor(t){this.zoom=t.zoom,this.canonical=t.canonical,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.fqid)),this.projection=t.projection,this.index=t.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0;}updateFootprints(t,e){}populate(t,e,r,n){this.tileToMeter=Al(r);const i=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:s,id:a,index:o,sourceLayerIndex:l}of t){const t=null!=a?a:s.properties&&s.properties.hasOwnProperty("id")?s.properties.id:void 0,u=Cl(s,i);if(!this.layers[0]._featureFilter.filter(new Rs(this.zoom),u,r))continue;const c={id:t,sourceLayerIndex:l,index:o,geometry:i?u.geometry:Vl(s,r,n),properties:s.properties,type:s.type,patterns:{}},h=this.addFeature(c,c.geometry,u);h&&e.featureIndex.insert(s,c.geometry,o,l,this.index,this.instancesPerModel[h].instancedDataArray.length,Kr/32);}this.lookup=null;}update(t,e,r,n){for(const e in this.instancesPerModel){const r=this.instancesPerModel[e];for(const e in t)r.idToFeaturesIndex.hasOwnProperty(e)&&(this.evaluate(r.features[r.idToFeaturesIndex[e]],t[e],r,!0),this.uploaded=!1);}this.maxHeight=0;}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return !1;let t=!1;for(const e in this.instancesPerModel){const r=this.instancesPerModel[e];for(const e of r.features){const n=this.layers[0],i=e.feature,s=this.canonical,a=n.paint.get("model-rotation").evaluate(i,{},s),o=n.paint.get("model-scale").evaluate(i,{},s),l=n.paint.get("model-translation").evaluate(i,{},s);O.vec3.exactEquals(e.rotation,a)&&O.vec3.exactEquals(e.scale,o)&&O.vec3.exactEquals(e.translation,l)||(this.evaluate(e,e.featureStates,r,!0),t=!0);}}return t}updateReplacement(t,e,r,n){if(e.updateTime===this.replacementUpdateTime)return !1;this.replacementUpdateTime=e.updateTime;const i=e.getReplacementRegionsForTile(t.toUnwrapped(),!0);if(Yh(this.activeReplacements,i))return !1;this.activeReplacements=i;let s=!1;for(const e in this.instancesPerModel){const i=this.instancesPerModel[e],a=i.instancedDataArray;for(const e of i.features){const i=e.instancedDataOffset,o=e.instancedDataCount;for(let e=0;e<o;e++){const o=16*(e+i);let l=a.float32[o+0];const u=l>Kr;l=u?l-Kr:l;const c=Math.floor(l),h=a.float32[o+1];let p=!1;for(const e of this.activeReplacements)if(!jh(e,r,wy.Model,n)&&!(e.min.x>c||c>e.max.x||e.min.y>h||h>e.max.y)&&(p=Jh(Kh(c,h,t.canonical,e.footprintTileId.canonical),e.footprint),p))break;a.float32[o]=p?l+Kr:l,s=s||p!==u;}}}return s}isEmpty(){for(const t in this.instancesPerModel)if(0!==this.instancesPerModel[t].instancedDataArray.length)return !1;return !0}uploadPending(){return !this.uploaded}upload(t){if(!this.uploaded)for(const e in this.instancesPerModel){const r=this.instancesPerModel[e];r.instancedDataArray.length<0||0===r.instancedDataArray.length||(r.instancedDataBuffer?r.instancedDataBuffer.updateData(r.instancedDataArray):r.instancedDataBuffer=t.createVertexBuffer(r.instancedDataArray,by.members,!0,void 0,this.instanceCount));}this.uploaded=!0;}destroy(){for(const t in this.instancesPerModel){const e=this.instancesPerModel[t];0!==e.instancedDataArray.length&&e.instancedDataBuffer&&e.instancedDataBuffer.destroy();}const t=this.layers[0].modelManager;if(t&&this.modelUris)for(const e of this.modelUris)t.removeModel(e,"");}addFeature(t,e,r){const n=this.layers[0],i=n.layout.get("model-id").evaluate(r,{},this.canonical);if(!i)return pt(`modelId is not evaluated for layer ${n.id} and it is not going to get rendered.`),i;Ay(i,!1)&&(this.modelUris.includes(i)||this.modelUris.push(i)),this.instancesPerModel[i]||(this.instancesPerModel[i]=new Sy);const s=this.instancesPerModel[i],a=s.instancedDataArray,o=new Iy(r,a.length);for(const t of e)for(const e of t){if(e.x<0||e.x>=Kr||e.y<0||e.y>=Kr)continue;const t=(this.lookupDim-1)/Kr,r=this.lookupDim*(e.y*t|0)+e.x*t|0;if(this.lookup){if(0!==this.lookup[r])continue;this.lookup[r]=1;}this.instanceCount++;const n=a.length;a.resize(n+1),s.instancesEvaluatedElevation.push(0),a.float32[16*n]=e.x,a.float32[16*n+1]=e.y;}return o.instancedDataCount=s.instancedDataArray.length-o.instancedDataOffset,o.instancedDataCount>0&&(t.id&&(s.idToFeaturesIndex[t.id]=s.features.length),s.features.push(o),this.evaluate(o,{},s,!1)),i}getModelUris(){return this.modelUris}evaluate(t,e,r,n){const i=this.layers[0],s=t.feature,a=this.canonical,o=t.rotation=i.paint.get("model-rotation").evaluate(s,e,a),l=t.scale=i.paint.get("model-scale").evaluate(s,e,a),u=t.translation=i.paint.get("model-translation").evaluate(s,e,a),c=i.paint.get("model-color").evaluate(s,e,a);c.a=i.paint.get("model-color-mix-intensity").evaluate(s,e,a);const h=[];this.maxVerticalOffset<u[2]&&(this.maxVerticalOffset=u[2]),this.maxScale=Math.max(Math.max(this.maxScale,l[0]),Math.max(l[1],l[2])),hy(h,o,l);const p=Math.round(100*c.a)+c.b/1.05;for(let e=0;e<t.instancedDataCount;++e){const i=t.instancedDataOffset+e,s=16*i,o=r.instancedDataArray.float32;let l=0;n&&(l=o[s+6]-r.instancesEvaluatedElevation[i]);const f=0|o[s+1];o[s]=(0|o[s])+c.r/1.05,o[s+1]=f+c.g/1.05,o[s+2]=p,o[s+3]=1/(a.z>10?this.tileToMeter:Al(a,f)),o[s+4]=u[0],o[s+5]=u[1],o[s+6]=u[2]+l,o[s+7]=h[0],o[s+8]=h[1],o[s+9]=h[2],o[s+10]=h[4],o[s+11]=h[5],o[s+12]=h[6],o[s+13]=h[8],o[s+14]=h[9],o[s+15]=h[10],r.instancesEvaluatedElevation[i]=u[2];}}}let Ey,zy;us(Py,"ModelBucket",{omit:["layers"]}),us(Sy,"PerModelAttributes"),us(Iy,"ModelFeature");const ky=64,Ty={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function By(t,e,r,n,i,s,a,o,l,u=!1){const c=r.zoom,h=r.project(n),p=wl(n.lat,c),f=1/p;O.mat4.identity(t),O.mat4.translate(t,t,[h.x+a[0]*f,h.y+a[1]*f,a[2]]);let d=1,m=1;const y=r.worldSize;if(u){if("mercator"===r.projection.name){let t=0;r.elevation&&(t=r.elevation.getAtPointOrZero(new Il(h.x/y,h.y/y),0));const e=O.vec4.transformMat4([],[h.x,h.y,t,1],r.projMatrix)[3]/r.cameraToCenterDistance;d=e,m=e*wl(r.center.lat,c);}else if("globe"===r.projection.name){const e=fy(t,r),i=O.mat4.multiply([],r.projMatrix,e),s=[0,0,0,1];O.vec4.transformMat4(s,s,i);const a=s[3]/r.cameraToCenterDistance,o=$u(c),l=r.projection.pixelsPerMeter(n.lat,y)*wl(n.lat,c),u=r.projection.pixelsPerMeter(r.center.lat,y)*wl(r.center.lat,c);d=a/Ee(l,_l(r.center.lat),o),m=a*p/l,d*=u,m*=u;}}else d=f;O.mat4.scale(t,t,[d,d,m]);const g=[...t],x=e.orientation,v=[];if(hy(v,[x[0]+i[0],x[1]+i[1],x[2]+i[2]],s),O.mat4.multiply(t,g,v),o&&r.elevation){let i=0;const s=[];if(l&&r.elevation){i=function(t,e,r,n,i){const s=e.elevation;if(!s)return 0;const a=Au.projectAabbCorners(r,n),o=yl(1,i.lat)*e.worldSize,l=function(t,e){const r=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const i of n){const n=t[i.corners[0]],s=t[i.corners[1]],a=t[i.corners[2]],o=[s[0]-n[0],s[1]-n[1],e*(s[2]-n[2])],l=O.vec3.cross(o,o,[a[0]-n[0],a[1]-n[1],e*(a[2]-n[2])]);O.vec3.normalize(l,l),i.dotProductWithUp=O.vec3.dot(l,r);}return n.sort(((t,e)=>t.dotProductWithUp-e.dotProductWithUp)),n[0].corners}(a,o),u=a[l[0]],c=a[l[1]],h=a[l[2]],p=a[l[3]],f=s.getAtPointOrZero(new Il(u[0]/e.worldSize,u[1]/e.worldSize),0),d=s.getAtPointOrZero(new Il(c[0]/e.worldSize,c[1]/e.worldSize),0),m=s.getAtPointOrZero(new Il(h[0]/e.worldSize,h[1]/e.worldSize),0),y=s.getAtPointOrZero(new Il(p[0]/e.worldSize,p[1]/e.worldSize),0),g=(f+y)/2,x=(d+m)/2;return g>x?d<m?py(t,c,p,u,d,y,f,o):py(t,h,u,p,m,f,y,o):f<y?py(t,u,c,h,f,d,m,o):py(t,p,h,c,y,m,d,o),Math.max(g,x)}(s,r,e.aabb,t,n);const a=O.mat4.fromQuat([],s),o=O.mat4.multiply([],a,v);O.mat4.multiply(t,g,o);}else i=r.elevation.getAtPointOrZero(new Il(h.x/y,h.y/y),0);0!==i&&(t[14]+=i);}}function Vy(t,e,r=!1){t.uploaded||(t.gfxTexture=new qm(e,t.image,r?e.gl.R8:e.gl.RGBA8,{useMipmap:t.sampler.minFilter>=e.gl.NEAREST_MIPMAP_NEAREST}),t.uploaded=!0,t.image=null);}function Cy(t,e,r){t.indexBuffer=e.createIndexBuffer(t.indexArray,!1,!0),t.vertexBuffer=e.createVertexBuffer(t.vertexArray,my.members,!1,!0),t.normalArray&&(t.normalBuffer=e.createVertexBuffer(t.normalArray,vy.members,!1,!0)),t.texcoordArray&&(t.texcoordBuffer=e.createVertexBuffer(t.texcoordArray,xy.members,!1,!0)),t.colorArray&&(t.colorBuffer=e.createVertexBuffer(t.colorArray,(12===t.colorArray.bytesPerElement?yy:gy).members,!1,!0)),t.featureArray&&(t.pbrBuffer=e.createVertexBuffer(t.featureArray,_y.members,!0)),t.segments=xo.simpleSegment(0,0,t.vertexArray.length,t.indexArray.length);const n=t.material;n.pbrMetallicRoughness.baseColorTexture&&Vy(n.pbrMetallicRoughness.baseColorTexture,e),n.pbrMetallicRoughness.metallicRoughnessTexture&&Vy(n.pbrMetallicRoughness.metallicRoughnessTexture,e),n.normalTexture&&Vy(n.normalTexture,e),n.occlusionTexture&&Vy(n.occlusionTexture,e,r),n.emissionTexture&&Vy(n.emissionTexture,e);}function Dy(t,e,r){if(t.meshes)for(const n of t.meshes)Cy(n,e,r);if(t.children)for(const n of t.children)Dy(n,e,r);}function Ry(t){if(t.meshes)for(const e of t.meshes)e.indexArray.destroy(),e.vertexArray.destroy(),e.colorArray&&e.colorArray.destroy(),e.normalArray&&e.normalArray.destroy(),e.texcoordArray&&e.texcoordArray.destroy(),e.featureArray&&e.featureArray.destroy();if(t.children)for(const e of t.children)Ry(e);}function Ly(t){if(t.meshes)for(const r of t.meshes)r.vertexBuffer&&(r.vertexBuffer.destroy(),r.indexBuffer.destroy(),r.normalBuffer&&r.normalBuffer.destroy(),r.texcoordBuffer&&r.texcoordBuffer.destroy(),r.colorBuffer&&r.colorBuffer.destroy(),r.pbrBuffer&&r.pbrBuffer.destroy(),r.segments.destroy(),r.material&&((e=r.material).pbrMetallicRoughness.baseColorTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture&&e.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),e.pbrMetallicRoughness.metallicRoughnessTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&e.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),e.normalTexture&&e.normalTexture.gfxTexture&&e.normalTexture.gfxTexture.destroy(),e.emissionTexture&&e.emissionTexture.gfxTexture&&e.emissionTexture.gfxTexture.destroy(),e.occlusionTexture&&e.occlusionTexture.gfxTexture&&e.occlusionTexture.gfxTexture.destroy()));var e;if(t.children)for(const e of t.children)Ly(e);}class Fy{constructor(t,e,r){this._demTile=t,this._dem=this._demTile.dem,this._scale=e,this._offset=r;}static create(t,e,r){const n=r||t.findDEMTileFor(e);if(!n||!n.dem)return;const i=n.dem,s=n.tileID,a=1<<e.canonical.z-s.canonical.z;return new Fy(n,i.dim/Kr/a,[(e.canonical.x/a-s.canonical.x)*i.dim,(e.canonical.y/a-s.canonical.y)*i.dim])}tileCoordToPixel(t,e){const r=e*this._scale+this._offset[1],n=Math.floor(t*this._scale+this._offset[0]),i=Math.floor(r);return new q(n,i)}getElevationAt(t,e,r,n){const i=t*this._scale+this._offset[0],s=e*this._scale+this._offset[1],a=Math.floor(i),o=Math.floor(s),l=this._dem;return n=!!n,r?Ee(Ee(l.get(a,o,n),l.get(a,o+1,n),s-o),Ee(l.get(a+1,o,n),l.get(a+1,o+1,n),s-o),i-a):l.get(a,o,n)}getElevationAtPixel(t,e,r){return this._dem.get(t,e,!!r)}getMeterToDEM(t){return (1<<this._demTile.tileID.canonical.z)*yl(1,t)*this._dem.stride}}const Oy=new Float32Array(262144),Ny=new Uint8Array(262144);function Uy(t){let e=0;if(t.meshes)for(const r of t.meshes)e=Math.max(e,r.aabb.max[2]);if(t.children)for(const r of t.children)e=Math.max(e,Uy(r));return e}function jy(t,e,r){if(t.meshes)for(const n of t.meshes){if(n.aabb.min[0]===1/0)continue;const i=Au.applyTransform(n.aabb,t.matrix);r.insert(e,i.min[0],i.min[1],i.max[0],i.max[1]);}if(t.children)for(const n of t.children)jy(n,e,r);}const qy=["","wall","door","roof","window","lamp","logo"];class $y{constructor(t){this.node=t,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.cameraCollisionOpacity=1,this.feature={type:"Point",id:t.id,geometry:[],properties:{height:Uy(t)}},this.aabb=this._getLocalBounds(),this.state=null;}_getLocalBounds(){if(!this.node.meshes)return new Au([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let t=0;const e=new Au([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const r of this.node.meshes)this.node.lightMeshIndex!==t&&(r.transformedAabb=Au.applyTransformFast(r.aabb,this.node.matrix),e.encapsulate(r.transformedAabb)),t++;this.aabb=e;}return this.aabb}}class Gy{constructor(t,e,r,n,i,s,a){this.id=r,this.layers=t,this.layerIds=this.layers.map((t=>t.fqid)),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.modelTraits|=Ty.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,n&&(this.modelTraits|=Ty.HasMapboxMeshFeatures),i&&(this.modelTraits|=Ty.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=s,this.dirty=!0,this.needsUpload=!1,this.filter=null,this.nodesInfo=[];for(const t of e)this.nodesInfo.push(new $y(t)),jy(t,a.featureIndexArray.length,a.grid),a.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,a.bucketLayerIDs.length-1,0);this.states={};}updateFootprints(t,e){for(const r of this.getNodesInfo()){const n=r.node;n.footprint&&e.push({footprint:n.footprint,id:t});}}update(t){const e=0!==Object.keys(t).length;if(e&&!this.stateDependentLayers.length)return;const r=e?this.stateDependentLayers:this.layers;if(!$(t,this.states))for(const e of r)this.evaluate(e,t);this.states=structuredClone(t);}populate(){console.log("populate 3D model bucket");}uploadPending(){return !this.uploaded||this.needsUpload}upload(t){if(!this.needsUpload)return;const e=this.getNodesInfo();for(const r of e){const e=r.node;this.uploaded?this.updatePbrBuffer(e):Dy(e,t,!0);}for(const t of e)Ry(t.node);this.uploaded=!0,this.needsUpload=!1;}updatePbrBuffer(t){let e=!1;if(!t.meshes)return e;for(const r of t.meshes)r.pbrBuffer&&(r.pbrBuffer.updateData(r.featureArray),e=!0);return e}needsReEvaluation(t,e,r){const n=t.transform.projectionOptions,i=t.style.getBrightness(),s=this.brightness!==i;if(!this.uploaded||this.dirty||n.name!==this.projection.name||Yy(r.paint.get("model-color").value,s)||Yy(r.paint.get("model-color-mix-intensity").value,s)||Yy(r.paint.get("model-roughness").value,s)||Yy(r.paint.get("model-emissive-strength").value,s)||Yy(r.paint.get("model-height-based-emissive-strength-multiplier").value,s)){this.projection=n,this.brightness=i;const t=this.getNodesInfo();for(const e of t)e.state=null;return !0}return !1}evaluateScale(t,e){if(t.transform.zoom===this.zoom)return;this.zoom=t.transform.zoom;const r=this.getNodesInfo(),n=this.id.canonical;for(const t of r){const r=t.feature;t.evaluatedScale=e.paint.get("model-scale").evaluate(r,{},n);}}evaluate(t,e){const r=this.getNodesInfo();for(const n of r){if(!n.node.meshes)continue;const r=n.feature,i=e&&e[r.id];if($(i,n.state))continue;n.state=structuredClone(i);const s=n.node.meshes&&n.node.meshes[0].featureData,a=n.evaluatedColor[2],o=n.evaluatedRMEA[2],l=this.id.canonical;if(n.hasTranslucentParts=!1,s){for(let e=0;e<qy.length;e++){const s=qy[e];s.length&&(r.properties.part=s);const a=t.paint.get("model-color").evaluate(r,i,l).toRenderColor(null),o=t.paint.get("model-color-mix-intensity").evaluate(r,i,l);n.evaluatedColor[e]=[a.r,a.g,a.b,o],n.evaluatedRMEA[e][0]=t.paint.get("model-roughness").evaluate(r,i,l),n.evaluatedRMEA[e][2]=t.paint.get("model-emissive-strength").evaluate(r,i,l),n.evaluatedRMEA[e][3]=a.a,n.emissionHeightBasedParams[e]=t.paint.get("model-height-based-emissive-strength-multiplier").evaluate(r,i,l),!n.hasTranslucentParts&&a.a<1&&(n.hasTranslucentParts=!0);}delete r.properties.part,Xy(n,a!==n.evaluatedColor[2]||o!==n.evaluatedRMEA[2],this.modelTraits);}else n.evaluatedRMEA[0][2]=t.paint.get("model-emissive-strength").evaluate(r,i,l);n.evaluatedScale=t.paint.get("model-scale").evaluate(r,i,l),this.updatePbrBuffer(n.node)||(this.needsUpload=!0);}this.dirty=!1;}elevationUpdate(t,e,r,n){const i=t.findDEMTileFor(r);if(i&&(i.tileID.canonical!==this.terrainTile||e!==this.terrainExaggeration)){if(i.dem&&i.tileID.overscaledZ!==this.elevationReadFromZ){this.elevationReadFromZ=i.tileID.overscaledZ;const e=Fy.create(t,r,i);if(!e)return;this.modelTraits&Ty.HasMapboxMeshFeatures&&this.updateDEM(t,e,r,n);for(const t of this.getNodesInfo()){const r=t.node;if(!r.footprint||!r.footprint.vertices||!r.footprint.vertices.length)continue;const n=r.footprint.vertices;let i=e.getElevationAt(n[0].x,n[0].y,!0,!0);for(let t=1;t<n.length;t++)i=Math.min(i,e.getElevationAt(n[t].x,n[t].y,!0,!0));r.elevation=i;}}this.terrainTile=i.tileID.canonical,this.terrainExaggeration=e;}}updateDEM(t,e,r,n){let i=e._dem._modifiedForSources[n];if(void 0===i&&(e._dem._modifiedForSources[n]=[],i=e._dem._modifiedForSources[n]),i.includes(r.canonical))return;const s=e._dem.dim;i.push(r.canonical);let a=!1;for(const t of this.getNodesInfo()){const r=t.node;if(!r.footprint||!r.footprint.grid)continue;const n=r.footprint.grid,i=e.tileCoordToPixel(n.min.x,n.min.y),o=e.tileCoordToPixel(n.max.x,n.max.y),l=Math.min(Math.min(s-o.y,i.x),Math.min(i.y,s-o.x));if(l<0)continue;const u=Q(l,2,5);let c=Math.max(0,i.x-u),h=Math.max(0,i.y-u),p=Math.min(o.x+u,s-1),f=Math.min(o.y+u,s-1);for(let t=h;t<=f;++t)for(let e=c;e<=p;++e)Ny[t*s+e]=255;let d=0,m=0;for(let t=0;t<n.cellsY;++t)for(let r=0;r<n.cellsX;++r){if(!n.cells[t*n.cellsX+r])continue;const i=e.tileCoordToPixel(n.min.x+r/n.xScale,n.min.y+t/n.yScale),a=e.tileCoordToPixel(n.min.x+(r+1)/n.xScale,n.min.y+(t+1)/n.yScale);for(let t=i.y;t<=Math.min(a.y+1,s-1);++t)for(let r=i.x;r<=Math.min(a.x+1,s-1);++r)255===Ny[t*s+r]&&(Ny[t*s+r]=0,d+=e.getElevationAtPixel(r,t),m++);}const y=d/m;c=Math.max(1,i.x-u),h=Math.max(1,i.y-u),p=Math.min(o.x+u,s-2),f=Math.min(o.y+u,s-2),a=!0;for(let t=h;t<=f;++t)for(let r=c;r<=p;++r)0===Ny[t*s+r]&&(Oy[t*s+r]=e._dem.set(r,t,y));for(let t=1;t<u;++t){c=Math.max(1,i.x-t),h=Math.max(1,i.y-t),p=Math.min(o.x+t,s-2),f=Math.min(o.y+t,s-2);for(let r=h;r<=f;++r)for(let n=c;n<=p;++n){const i=r*s+n;if(255===Ny[i]){let a=0,o=0,l=-1,c=-1;for(let e=-1;e<=1;++e)for(let i=-1;i<=1;++i){const u=(r+e)*s+n+i;if(Ny[u]>=t)continue;const h=Oy[u],p=Math.abs(h);p>o&&(a=h,o=p,l=i,c=e);}if(o>.1){const s=1-(t+.5*Math.abs(l*c))/u;let o=e._dem.get(n,r)+a*s;const h=e._dem.get(n+l,r+c),p=e._dem.get(n-l,r-c,!0);(o-h)*(o-p)>0&&(o=(h+p)/2),Oy[i]=e._dem.set(n,r,o),Ny[i]=t;}}}}}a&&(e._demTile.needsDEMTextureUpload=!0,e._dem._timestamp=Ct.now());}setFilter(t){this.filter=t?Qs(t):null;}getNodesInfo(){return this.filter?this.nodesInfo.filter((t=>this.filter.filter(new Rs(this.id.overscaledZ),t.feature,this.id.canonical))):this.nodesInfo}destroy(){const t=this.getNodesInfo();for(const e of t)Ry(e.node),Ly(e.node);}isEmpty(){return !this.nodesInfo.length}updateReplacement(t,e){if(e.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=e.updateTime;const r=e.getReplacementRegionsForTile(t.toUnwrapped()),n=this.getNodesInfo();for(let t=0;t<this.nodesInfo.length;t++){const e=n[t].node;n[t].hiddenByReplacement=!!e.footprint&&!r.find((t=>t.footprint===e.footprint));}}getHeightAtTileCoord(t,e){const r=this.getNodesInfo(),n=[],i=[0,0,0],s=O.mat4.identity([]);for(let a=0;a<this.nodesInfo.length;a++){const o=r[a],l=o.node.meshes[0],u=l.transformedAabb;if(t<u.min[0]||e<u.min[1]||t>u.max[0]||e>u.max[1])continue;if(!0===o.node.hidden)return {height:1/0,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]};O.mat4.invert(s,o.node.matrix),i[0]=t,i[1]=e,O.vec3.transformMat4(i,i,s);const c=(i[0]-l.aabb.min[0])/(l.aabb.max[0]-l.aabb.min[0])*ky|0,h=Math.min(63,(i[1]-l.aabb.min[1])/(l.aabb.max[1]-l.aabb.min[1])*ky|0)*ky+Math.min(63,c),p=l.heightmap[h];if(!(p<0&&o.node.footprint)){if(o.hiddenByReplacement)return;return {height:p,maxHeight:o.feature.properties.height,hidden:!1,verticalScale:o.evaluatedScale[2]}}if(o.node.footprint.grid.query(new q(t,e),new q(t,e),n),n.length>0)return {height:void 0,maxHeight:o.feature.properties.height,hidden:o.hiddenByReplacement,verticalScale:o.evaluatedScale[2]}}}}function Yy(t,e){return !t.isLightConstant&&e}function Hy(t,e,r,n,i,s,a,o){let l=(61440&e|(61440&e)>>4)>>8,u=(3840&e|(3840&e)>>4)>>4,c=240&e|(240&e)>>4;r[3]>0&&(l=Ee(l,255*r[0],r[3]),u=Ee(u,255*r[1],r[3]),c=Ee(c,255*r[2],r[3]));const h=l<<8|u,p=c<<8|Math.floor(255*n[3]),f=function(t){const e=Q(t,0,2);return Math.min(Math.round(.5*e*255),255)}(n[2])<<8|15*n[0]<<4|15*n[1],d=Q(i[0],0,1),m=Q(i[1],0,1),y=Q(i[2],0,1),g=Q(i[3],0,1);let x,v,b,_;if(d!==m&&a!==s&&m!==d){const t=a-s;v=1/(t*(m-d)),b=-(s+t*d)/(t*(m-d));const e=Q(i[4],-1,1);_=Math.pow(10,e),x=255*y<<8|255*g;}else x=65535,v=0,b=1,_=1;if(t.emplaceBack(h,p,f,x,v,b,_),o){const t=o.length;o.clear();for(let e=0;e<t;e++)o.emplaceBack(h,p,f,x,v,b,_);}}function Xy(t,e,r){const n=t.node;let i=0;const s=r&Ty.HasMeshoptCompression;for(const r of n.meshes){if(n.lights&&n.lightMeshIndex===i)continue;if(!r.featureData)continue;r.featureArray=new Qa,r.featureArray.reserve(r.featureData.length);let a=e;for(const e of r.featureData){const i=s?65535&e:e>>16&65535,o=s?e>>16&65535:65535&e,l=(15&o)<8?15&o:0,u=t.evaluatedRMEA[l],c=t.evaluatedColor[l],h=t.emissionHeightBasedParams[l];let p;if(a&&2===l&&n.lights&&(p=new Qa,p.resize(10*n.lights.length)),Hy(r.featureArray,i,c,u,h,r.aabb.min[2],r.aabb.max[2],p),p&&a){a=!1;const t=n.meshes[n.lightMeshIndex];t.featureArray=p,t.featureArray._trim();}}r.featureArray._trim(),i++;}}function Zy(t,e,r,n){const i=1<<t.z;e.lat=xl((n/Kr+t.y)/i),e.lng=gl((r/Kr+t.x)/i);}us(Gy,"Tiled3dModelBucket",{omit:["layers"]}),us($y,"Tiled3dModelFeature");const Wy={circle:class extends ma{constructor(t,e,r,n){super(t,{layout:ru||(ru=new Xs({"circle-sort-key":new Ys(Zs.layout_circle["circle-sort-key"]),"circle-elevation-reference":new Gs(Zs.layout_circle["circle-elevation-reference"]),visibility:new Gs(Zs.layout_circle.visibility)})),paint:nu||(nu=new Xs({"circle-radius":new Ys(Zs.paint_circle["circle-radius"]),"circle-color":new Ys(Zs.paint_circle["circle-color"]),"circle-blur":new Ys(Zs.paint_circle["circle-blur"]),"circle-opacity":new Ys(Zs.paint_circle["circle-opacity"]),"circle-translate":new Gs(Zs.paint_circle["circle-translate"]),"circle-translate-anchor":new Gs(Zs.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Gs(Zs.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Gs(Zs.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ys(Zs.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ys(Zs.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ys(Zs.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Gs(Zs.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n);}createBucket(t){return new Ll(t)}queryRadius(t){const e=t;return Jl("circle-radius",this,e)+Jl("circle-stroke-width",this,e)+Ql(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,r,n,i,s,a,o){const l=eu(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r);return Ju(t,n,s,a,o,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,u)}getProgramIds(){return ["circle"]}getDefaultProgramParams(t,e,r){const n=Ku(this);return {config:new $o(this,{zoom:e,lut:r}),defines:n,overrideFog:!1}}},heatmap:class extends ma{createBucket(t){return new nc(t)}constructor(t,e,r,n){super(t,{layout:ic||(ic=new Xs({visibility:new Gs(Zs.layout_heatmap.visibility)})),paint:sc||(sc=new Xs({"heatmap-radius":new Ys(Zs.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ys(Zs.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Gs(Zs.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Hs(Zs.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Gs(Zs.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n),this._updateColorRamp();}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp();}_updateColorRamp(){this.colorRamp=dc({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(t){return Jl("heatmap-radius",this,t)}queryIntersectsFeature(t,e,r,n,i,s,a,o){const l=this.paint.get("heatmap-radius").evaluate(e,r);return Ju(t,n,s,a,o,!0,!0,new q(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return ["heatmap","heatmapTexture"]}getDefaultProgramParams(t,e,r){return "heatmap"===t?{config:new $o(this,{zoom:e,lut:r}),overrideFog:!1}:{}}},hillshade:class extends ma{constructor(t,e,r,n){super(t,{layout:ac||(ac=new Xs({visibility:new Gs(Zs.layout_hillshade.visibility)})),paint:oc||(oc=new Xs({"hillshade-illumination-direction":new Gs(Zs.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Gs(Zs.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Gs(Zs.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Gs(Zs.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Gs(Zs.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Gs(Zs.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Gs(Zs.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n);}shouldRedrape(){return this.hasOffscreenPass()&&"viewport"===this.paint.get("hillshade-illumination-anchor")}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return ["hillshade","hillshadePrepare"]}getDefaultProgramParams(t,e,r){return {overrideFog:!1}}},fill:class extends ma{constructor(t,e,r,n){super(t,{layout:wh||(wh=new Xs({"fill-sort-key":new Ys(Zs.layout_fill["fill-sort-key"]),visibility:new Gs(Zs.layout_fill.visibility),"fill-elevation-reference":new Gs(Zs.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new Ys(Zs.layout_fill["fill-construct-bridge-guard-rail"])})),paint:Mh||(Mh=new Xs({"fill-antialias":new Gs(Zs.paint_fill["fill-antialias"]),"fill-opacity":new Ys(Zs.paint_fill["fill-opacity"]),"fill-color":new Ys(Zs.paint_fill["fill-color"]),"fill-outline-color":new Ys(Zs.paint_fill["fill-outline-color"]),"fill-translate":new Gs(Zs.paint_fill["fill-translate"]),"fill-translate-anchor":new Gs(Zs.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ys(Zs.paint_fill["fill-pattern"]),"fill-emissive-strength":new Gs(Zs.paint_fill["fill-emissive-strength"]),"fill-z-offset":new Ys(Zs.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new Ys(Zs.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new Ys(Zs.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n);}getProgramIds(){const t=this.paint.get("fill-pattern"),e=t&&t.constantOr(1),r=[e?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&r.push(e&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),r}getDefaultProgramParams(t,e,r){return {config:new $o(this,{zoom:e,lut:r}),overrideFog:!1}}recalculate(t,e){super.recalculate(t,e);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"]);}createBucket(t){return new _h(t)}queryRadius(){return Ql(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,r,n,i,s){return !t.queryGeometry.isAboveHorizon&&Nl(tu(t.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),n)}isTileClipped(){return 0===this.paint.get("fill-z-offset").constantOr(1)}is3D(t){if(0!==this.paint.get("fill-z-offset").constantOr(1))return !0;const e=this.layout&&"none"!==this.layout.get("fill-elevation-reference");return null!=t?e&&!t:e}},"fill-extrusion":class extends ma{constructor(t,e,r,n){super(t,{layout:kp||(kp=new Xs({visibility:new Gs(Zs["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Gs(Zs["layout_fill-extrusion"]["fill-extrusion-edge-radius"])})),paint:Tp||(Tp=new Xs({"fill-extrusion-opacity":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-emissive-strength":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new Ys(Zs["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new Gs(Zs["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0};}createBucket(t){return new vp(t)}queryRadius(){return Ql(this.paint.get("fill-extrusion-translate"))}is3D(t){return !0}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return !0}getProgramIds(){return [this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(t,e,r,n,i,s,a,o,l){const u=eu(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),c=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),p=[0,0],f=o&&s.elevation,d=s.elevation?s.elevation.exaggeration():1,m=t.tile.getBucket(this);if(f&&m instanceof vp){const t=m.centroidVertexArray,e=l+1;e<t.length&&(p[0]=t.geta_centroid_pos0(e),p[1]=t.geta_centroid_pos1(e));}if(0===p[0]&&1===p[1])return !1;"globe"===s.projection.name&&(n=Ep([n],[new q(0,0),new q(Kr,Kr)],t.tileID.canonical).map((t=>t.polygon)).flat());const y=f?o:null,[g,x]=function(t,e,r,n,i,s,a,o,l,u,c){return "globe"===t.projection.name?function(t,e,r,n,i,s,a,o,l,u,c){const h=[],p=[],f=t.projection.upVectorScale(c,t.center.lat,t.worldSize).metersToTile,d=[0,0,0,1],m=[0,0,0,1],y=(t,e,r,n)=>{t[0]=e,t[1]=r,t[2]=n,t[3]=1;},g=Pp();r>0&&(r+=g),n+=g;for(const g of e){const e=[],x=[];for(const h of g){const p=h.x+i.x,g=h.y+i.y,v=t.projection.projectTilePoint(p,g,c),b=t.projection.upVector(c,h.x,h.y);let _=r,w=n;if(a){const t=Cp(p,g,r,n,a,o,l,u);_+=t.base,w+=t.top;}0!==r?y(d,v.x+b[0]*f*_,v.y+b[1]*f*_,v.z+b[2]*f*_):y(d,v.x,v.y,v.z),y(m,v.x+b[0]*f*w,v.y+b[1]*f*w,v.z+b[2]*f*w),O.vec3.transformMat4(d,d,s),O.vec3.transformMat4(m,m,s),e.push(new Rh(d[0],d[1],d[2])),x.push(new Rh(m[0],m[1],m[2]));}h.push(e),p.push(x);}return [h,p]}(t,e,r,n,i,s,a,o,l,u,c):a?function(t,e,r,n,i,s,a,o,l){const u=[],c=[],h=[0,0,0,1];for(const p of t){const t=[],f=[];for(const u of p){const c=u.x+n.x,p=u.y+n.y,d=Cp(c,p,e,r,s,a,o,l);h[0]=c,h[1]=p,h[2]=d.base,h[3]=1,O.vec4.transformMat4(h,h,i),h[3]=Math.max(h[3],1e-5);const m=new Rh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);h[0]=c,h[1]=p,h[2]=d.top,h[3]=1,O.vec4.transformMat4(h,h,i),h[3]=Math.max(h[3],1e-5);const y=new Rh(h[0]/h[3],h[1]/h[3],h[2]/h[3]);t.push(m),f.push(y);}u.push(t),c.push(f);}return [u,c]}(e,r,n,i,s,a,o,l,u):function(t,e,r,n,i){const s=[],a=[],o=i[8]*e,l=i[9]*e,u=i[10]*e,c=i[11]*e,h=i[8]*r,p=i[9]*r,f=i[10]*r,d=i[11]*r;for(const e of t){const t=[],r=[];for(const s of e){const e=s.x+n.x,a=s.y+n.y,m=i[0]*e+i[4]*a+i[12],y=i[1]*e+i[5]*a+i[13],g=i[2]*e+i[6]*a+i[14],x=i[3]*e+i[7]*a+i[15],v=m+o,b=y+l,_=g+u,w=Math.max(x+c,1e-5),M=m+h,A=y+p,I=g+f,S=Math.max(x+d,1e-5);t.push(new Rh(v/w,b/w,_/w)),r.push(new Rh(M/S,A/S,I/S));}s.push(t),a.push(r);}return [s,a]}(e,r,n,i,s)}(s,n,h,c,u,a,y,p,d,s.center.lat,t.tileID.canonical),v=t.queryGeometry;return function(t,e,r){let n=1/0;Nl(r,e)&&(n=Vp(r,e[0]));for(let i=0;i<e.length;i++){const s=e[i],a=t[i];for(let t=0;t<s.length-1;t++){const e=s[t],i=[e,s[t+1],a[t+1],a[t],e];Fl(r,i)&&(n=Math.min(n,Vp(r,i)));}}return n!==1/0&&n}(g,x,v.isPointQuery()?v.screenBounds:v.screenGeometry)}},line:class extends ma{constructor(t,e,r,n){const i=nf();super(t,i,e,r,n),i.layout&&(this.layout=new $s(i.layout)),this.gradientVersion=0,this.hasElevatedBuckets=!1,this.hasNonElevatedBuckets=!1;}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression&&t._styleExpression.expression instanceof Un,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(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=(()=>{if(af)return af;const t=nf();return af=new sf(t.paint.properties["line-width"].specification),af.useIntegerZoom=!0,af})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t);}createBucket(t){return new Yp(t)}getProgramIds(){return [this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(t,e,r){const n=tf(this);return {config:new $o(this,{zoom:e,lut:r}),defines:n,overrideFog:!1}}queryRadius(t){const e=t,r=of(Jl("line-width",this,e),Jl("line-gap-width",this,e)),n=Jl("line-offset",this,e);return r/2+Math.abs(n)+Ql(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,s){if(t.queryGeometry.isAboveHorizon)return !1;const a=tu(t.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,t.pixelToTileUnitsFactor),o=t.pixelToTileUnitsFactor/2*of(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(n=function(t,e){const r=[],n=new q(0,0);for(let i=0;i<t.length;i++){const s=t[i],a=[];for(let t=0;t<s.length;t++){const r=s[t],i=s[t+1],o=0===t?n:r.sub(s[t-1])._unit()._perp(),l=t===s.length-1?n:i.sub(r)._unit()._perp(),u=o._add(l)._unit();u._mult(1/(u.x*l.x+u.y*l.y)),a.push(u._mult(e)._add(r));}r.push(a);}return r}(n,l*t.pixelToTileUnitsFactor)),function(t,e,r){for(let n=0;n<e.length;n++){const i=e[n];if(t.length>=3)for(let e=0;e<i.length;e++)if(Hl(t,i[e]))return !0;if(Ul(t,i,r))return !0}return !1}(a,n,o)}isTileClipped(){return this.hasNonElevatedBuckets}isDraped(t){return !this.hasElevatedBuckets}},symbol:Dm,background:class extends ma{constructor(t,e,r,n){super(t,{layout:Rm||(Rm=new Xs({visibility:new Gs(Zs.layout_background.visibility)})),paint:Lm||(Lm=new Xs({"background-pitch-alignment":new Gs(Zs.paint_background["background-pitch-alignment"]),"background-color":new Gs(Zs.paint_background["background-color"]),"background-pattern":new Gs(Zs.paint_background["background-pattern"]),"background-opacity":new Gs(Zs.paint_background["background-opacity"]),"background-emissive-strength":new Gs(Zs.paint_background["background-emissive-strength"]),"background-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n);}getProgramIds(){return [this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(t,e,r){return {overrideFog:!1}}is3D(t){return "viewport"===this.paint.get("background-pitch-alignment")}},raster:Wm,"raster-particle":ry,sky:class extends ma{constructor(t,e,r,n){super(t,{layout:Qm||(Qm=new Xs({visibility:new Gs(Zs.layout_sky.visibility)})),paint:ty||(ty=new Xs({"sky-type":new Gs(Zs.paint_sky["sky-type"]),"sky-atmosphere-sun":new Gs(Zs.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Gs(Zs.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Gs(Zs.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Gs(Zs.paint_sky["sky-gradient-radius"]),"sky-gradient":new Hs(Zs.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Gs(Zs.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Gs(Zs.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Gs(Zs.paint_sky["sky-opacity"]),"sky-gradient-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n),this._updateColorRamp();}_handleSpecialPaintPropertyUpdate(t){"sky-gradient"===t?this._updateColorRamp():"sky-atmosphere-sun"!==t&&"sky-atmosphere-halo-color"!==t&&"sky-atmosphere-color"!==t&&"sky-atmosphere-sun-intensity"!==t||(this._skyboxInvalidated=!0);}_updateColorRamp(){this.colorRamp=dc({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null);}needsSkyboxCapture(t){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return !0;if(!this.paint.get("sky-atmosphere-sun")){const e=t.style.light.properties.get("position");return this._lightPosition.azimuthal!==e.azimuthal||this._lightPosition.polar!==e.polar}return !1}getCenter(t,e){if("atmosphere"===this.paint.get("sky-type")){const r=this.paint.get("sky-atmosphere-sun"),n=!r,i=t.style.light,s=i.properties.get("position");return n&&"viewport"===i.properties.get("anchor")&&pt("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),n?iy(s.azimuthal,90-s.polar,e):iy(r[0],90-r[1],e)}const r=this.paint.get("sky-gradient-center");return iy(r[0],90-r[1],e)}isSky(){return !0}markSkyboxValid(t){this._skyboxInvalidated=!1,this._lightPosition=t.style.light.properties.get("position");}hasOffscreenPass(){return !0}getProgramIds(){const t=this.paint.get("sky-type");return "atmosphere"===t?["skyboxCapture","skybox"]:"gradient"===t?["skyboxGradient"]:null}},slot:class extends ma{constructor(t,e,r,n){super(t,{paint:ey||(ey=new Xs({}))},e,null);}},model:class extends ma{constructor(t,e,r,n){super(t,{layout:Ey||(Ey=new Xs({visibility:new Gs(Zs.layout_model.visibility),"model-id":new Ys(Zs.layout_model["model-id"])})),paint:zy||(zy=new Xs({"model-opacity":new Ys(Zs.paint_model["model-opacity"]),"model-rotation":new Ys(Zs.paint_model["model-rotation"]),"model-scale":new Ys(Zs.paint_model["model-scale"]),"model-translation":new Ys(Zs.paint_model["model-translation"]),"model-color":new Ys(Zs.paint_model["model-color"]),"model-color-mix-intensity":new Ys(Zs.paint_model["model-color-mix-intensity"]),"model-type":new Gs(Zs.paint_model["model-type"]),"model-cast-shadows":new Gs(Zs.paint_model["model-cast-shadows"]),"model-receive-shadows":new Gs(Zs.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new Gs(Zs.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new Ys(Zs.paint_model["model-emissive-strength"]),"model-roughness":new Ys(Zs.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new Ys(Zs.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new Gs(Zs.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new Gs(Zs.paint_model["model-front-cutoff"]),"model-color-use-theme":new Ys({type:"string",default:"default","property-type":"data-driven"})}))},e,r,n),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0};}createBucket(t){return new Py(t)}getProgramIds(){return ["model"]}is3D(t){return !0}hasShadowPass(){return !0}canCastShadows(){return !0}hasLightBeamPass(){return !0}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(t){return t instanceof Gy?Kr-1:0}queryIntersectsFeature(t,e,r,n,i,s){if(!this.modelManager)return !1;const a=this.modelManager,o=t.tile.getBucket(this);if(!(o&&o instanceof Py))return !1;for(const r in o.instancesPerModel){const n=o.instancesPerModel[r],i=void 0!==e.id?e.id:e.properties&&e.properties.hasOwnProperty("id")?e.properties.id:void 0;if(n.idToFeaturesIndex.hasOwnProperty(i)){const e=n.features[n.idToFeaturesIndex[i]],l=a.getModel(r,this.scope);if(!l)return !1;let u=O.mat4.create();const c=new ul(0,0),h=o.canonical;let p=Number.MAX_VALUE;for(let r=0;r<e.instancedDataCount;++r){const i=16*(e.instancedDataOffset+r),a=n.instancedDataArray.float32,o=[a[i+4],a[i+5],a[i+6]];Zy(h,c,a[i],0|a[i+1]),By(u,l,s,c,e.rotation,e.scale,o,!1,!1,!1),"globe"===s.projection.name&&(u=fy(u,s));const f=O.mat4.multiply([],s.projMatrix,u),d=t.queryGeometry,m=dy(d.isPointQuery()?d.screenBounds:d.screenGeometry,s,f,l.aabb);null!=m&&(p=Math.min(m,p));}return p!==Number.MAX_VALUE&&p}}return !1}_handleOverridablePaintPropertyUpdate(t,e,r){return !(!this.layout||e.isDataDriven()||r.isDataDriven()||"model-color"!==t&&"model-color-mix-intensity"!==t&&"model-rotation"!==t&&"model-scale"!==t&&"model-translation"!==t&&"model-emissive-strength"!==t)}_isPropertyZoomDependent(t){const e=this._transitionablePaint._values[t];return null!=e&&null!=e.value&&null!=e.value.expression&&e.value.expression instanceof ts}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends ma{constructor(t,e,r,n){super(t,{layout:Ah||(Ah=new Xs({"clip-layer-types":new Gs(Zs.layout_clip["clip-layer-types"]),"clip-layer-scope":new Gs(Zs.layout_clip["clip-layer-scope"])})),paint:Ih||(Ih=new Xs({}))},e,r,n);}recalculate(t,e){super.recalculate(t,e);}createBucket(t){return new Eh(t)}is3D(t){return !0}}};class Ky{constructor(t){this._callback=t,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 Jy{constructor(){this.tasks={},this.taskQueue=[],ot(["process"],this),this.invoker=new Ky(this.process),this.nextId=0;}add(t,e){const r=this.nextId++,n=function({type:t,isSymbolTile:e,zoom:r}){return r=r||0,"message"===t?0:"maybePrepare"!==t||e?"parseTile"!==t||e?"parseTile"===t&&e?300-r:"maybePrepare"===t&&e?400-r:500:200-r:100-r}(e);if(0===n){try{t();}finally{}return null}return this.tasks[r]={fn:t,metadata:e,priority:n,id:r},this.taskQueue.push(r),this.invoker.trigger(),{cancel:()=>{delete this.tasks[r];}}}process(){try{if(this.taskQueue=this.taskQueue.filter((t=>!!this.tasks[t])),!this.taskQueue.length)return;const t=this.pick();if(null===t)return;const e=this.tasks[t];if(delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),!e)return;e.fn();}finally{}}pick(){let t=null,e=1/0;for(let r=0;r<this.taskQueue.length;r++){const n=this.tasks[this.taskQueue[r]];n.priority<e&&(e=n.priority,t=r);}if(null===t)return null;const r=this.taskQueue[t];return this.taskQueue.splice(t,1),r}remove(){this.invoker.remove();}}class Qy{constructor(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.cancelCallbacks={},ot(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.scheduler=new Jy;}send(t,e,r,n,i=!1,s){const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(r.metadata=s,this.callbacks[a]=r);const o=new Set;return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:ps(e,o)},o),{cancel:()=>{r&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId});}}}receive(t){const e=t.data;if(!e)return;const r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){const t=this.cancelCallbacks[r];delete this.cancelCallbacks[r],t&&t.cancel();}else if(e.mustQueue||yt()){const t=this.callbacks[r],n=this.scheduler.add((()=>this.processTask(r,e)),t&&t.metadata||{type:"message"});n&&(this.cancelCallbacks[r]=n);}else this.processTask(r,e);}processTask(t,e){if(delete this.cancelCallbacks[t],"<response>"===e.type){const r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(fs(e.error)):r(null,fs(e.data)));}else {const r=new Set,n=e.hasCallback?(e,n)=>{this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:e?ps(e):null,data:ps(n,r)},r);}:()=>{},i=fs(e.data);if(this.parent[e.type])this.parent[e.type](e.sourceMapId,i,n);else if(this.parent.getWorkerSource){const t=e.type.split(".");this.parent.getWorkerSource(e.sourceMapId,t[0],i.source,i.scope)[t[1]](i,n);}else n(new Error(`Could not find function ${e.type}`));}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1);}}var tg={workerUrl:"",workerClass:null,workerParams:void 0};const eg="mapboxgl_preloaded_worker_pool";class rg{constructor(){this.active={};}acquire(t,e=rg.workerCount){if(!this.workers)for(this.workers=[];this.workers.length<e;)this.workers.push(null!=tg.workerClass?new tg.workerClass:new self.Worker(tg.workerUrl,tg.workerParams));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.workers&&0===this.numActive()&&(this.workers.forEach((t=>{t.terminate();})),this.workers=null);}isPreloaded(){return !!this.active[eg]}numActive(){return Object.keys(this.active).length}}rg.workerCount=2;class ng{constructor(t,e,r="Worker",n=rg.workerCount){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=st();const i=this.workerPool.acquire(this.id,n);for(let t=0;t<i.length;t++){const n=new ng.Actor(i[t],e,this.id);n.name=`${r} ${t}`,this.actors.push(n);}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0;}));}broadcast(t,e,r){rt(this.actors,((r,n)=>{r.send(t,e,n);}),r=r||function(){});}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((t=>{t.remove();})),this.actors=[],this.workerPool.release(this.id);}}let ig,sg;function ag(){return ig||(ig=new rg),ig}ng.Actor=Qy;const og=new Se(0,0,0);var lg=(t=>(t[t.PATH_RULE_UNSPECIFIED=0]="PATH_RULE_UNSPECIFIED",t[t.PATH_RULE_NON_ZERO=1]="PATH_RULE_NON_ZERO",t[t.PATH_RULE_EVEN_ODD=2]="PATH_RULE_EVEN_ODD",t))(lg||{}),ug=(t=>(t[t.LINE_CAP_UNSPECIFIED=0]="LINE_CAP_UNSPECIFIED",t[t.LINE_CAP_BUTT=1]="LINE_CAP_BUTT",t[t.LINE_CAP_ROUND=2]="LINE_CAP_ROUND",t[t.LINE_CAP_SQUARE=3]="LINE_CAP_SQUARE",t))(ug||{}),cg=(t=>(t[t.LINE_JOIN_UNSPECIFIED=0]="LINE_JOIN_UNSPECIFIED",t[t.LINE_JOIN_MITER=1]="LINE_JOIN_MITER",t[t.LINE_JOIN_MITER_CLIP=2]="LINE_JOIN_MITER_CLIP",t[t.LINE_JOIN_ROUND=3]="LINE_JOIN_ROUND",t[t.LINE_JOIN_BEVEL=4]="LINE_JOIN_BEVEL",t))(cg||{}),hg=(t=>(t[t.PAINT_ORDER_UNSPECIFIED=0]="PAINT_ORDER_UNSPECIFIED",t[t.PAINT_ORDER_FILL_AND_STROKE=1]="PAINT_ORDER_FILL_AND_STROKE",t[t.PAINT_ORDER_STROKE_AND_FILL=2]="PAINT_ORDER_STROKE_AND_FILL",t))(hg||{}),pg=(t=>(t[t.PATH_COMMAND_UNSPECIFIED=0]="PATH_COMMAND_UNSPECIFIED",t[t.PATH_COMMAND_MOVE=1]="PATH_COMMAND_MOVE",t[t.PATH_COMMAND_LINE=2]="PATH_COMMAND_LINE",t[t.PATH_COMMAND_QUAD=3]="PATH_COMMAND_QUAD",t[t.PATH_COMMAND_CUBIC=4]="PATH_COMMAND_CUBIC",t[t.PATH_COMMAND_CLOSE=5]="PATH_COMMAND_CLOSE",t))(pg||{}),fg=(t=>(t[t.MASK_TYPE_UNSPECIFIED=0]="MASK_TYPE_UNSPECIFIED",t[t.MASK_TYPE_LUMINANCE=1]="MASK_TYPE_LUMINANCE",t[t.MASK_TYPE_ALPHA=2]="MASK_TYPE_ALPHA",t))(fg||{});function dg(t,e,r){1===t&&e.icons.push(function(t,e){return function(t){if(t.usvg_tree.height||(t.usvg_tree.height=t.usvg_tree.width),!t.metadata)return t;const{metadata:e}=t;if(e.content_area){const{content_area:r}=e;null==r.top&&(r.top=r.left),null==r.width&&(r.width=t.usvg_tree.width),null==r.height&&(r.height=r.width);}return e.stretch_x&&e.stretch_x.length&&mg(e,"x"),e.stretch_y&&e.stretch_y.length&&mg(e,"y"),t}(t.readFields(yg,{name:void 0},e))}(r,r.readVarint()+r.pos));}function mg(t,e){const r=[],n=t[`stretch_${e}`];let i=null;for(let t=0;t<n.length;t++)null===i?i=0===r.length?n[0]:r[r.length-1][1]+n[t]:(r.push([i,i+n[t]]),i=null);t[`stretch_${e}_areas`]=r;}function yg(t,e,r){1===t?e.name=r.readString():2===t?e.metadata=function(t,e){return t.readFields(gg,{stretch_x:null,stretch_y:null,stretch_x_areas:null,stretch_y_areas:null,variables:[]},e)}(r,r.readVarint()+r.pos):3===t&&(e.usvg_tree=function(t,e){return t.readFields(bg,{width:20,children:[],linear_gradients:[],radial_gradients:[],clip_paths:[],masks:[]},e)}(r,r.readVarint()+r.pos),e.data="usvg_tree");}function gg(t,e,r){1===t?e.stretch_x=r.readPackedVarint():2===t?e.stretch_y=r.readPackedVarint():3===t?e.content_area=function(t,e){return t.readFields(xg,{left:0},e)}(r,r.readVarint()+r.pos):4===t&&e.variables.push(function(t,e){return t.readFields(vg,{name:void 0},e)}(r,r.readVarint()+r.pos));}function xg(t,e,r){1===t?e.left=r.readVarint():2===t?e.width=r.readVarint():3===t?e.top=r.readVarint():4===t&&(e.height=r.readVarint());}function vg(t,e,r){1===t?e.name=r.readString():2===t&&(e.rgb_color=Eg(r.readVarint()),e.value="rgb_color");}function bg(t,e,r){1===t?e.width=e.height=r.readVarint():2===t?e.height=r.readVarint():3===t?e.children.push(_g(r,r.readVarint()+r.pos)):4===t?e.linear_gradients.push(function(t,e){return t.readFields(kg,{spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0},e)}(r,r.readVarint()+r.pos)):5===t?e.radial_gradients.push(function(t,e){return t.readFields(Vg,{spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0},e)}(r,r.readVarint()+r.pos)):7===t?e.clip_paths.push(function(t,e){return t.readFields(Cg,{children:[]},e)}(r,r.readVarint()+r.pos)):8===t&&e.masks.push(function(t,e){const r=t.readFields(Dg,{left:0,width:20,mask_type:1,children:[]},e);return null==r.height&&(r.height=r.width),null==r.top&&(r.top=r.left),r}(r,r.readVarint()+r.pos));}function _g(t,e){return t.readFields(wg,{},e)}function wg(t,e,r){1===t?(e.group=function(t,e){return t.readFields(Mg,{opacity:255,children:[]},e)}(r,r.readVarint()+r.pos),e.node="group"):2===t&&(e.path=function(t,e){return t.readFields(Sg,{paint_order:1,commands:[],step:1,diffs:[],rule:1},e)}(r,r.readVarint()+r.pos),e.node="path");}function Mg(t,e,r){1===t?e.transform=Ag(r,r.readVarint()+r.pos):2===t?e.opacity=r.readVarint():5===t?e.clip_path_idx=r.readVarint():6===t?e.mask_idx=r.readVarint():7===t&&e.children.push(_g(r,r.readVarint()+r.pos));}function Ag(t,e){return t.readFields(Ig,{sx:1,ky:0,kx:0,sy:1,tx:0,ty:0},e)}function Ig(t,e,r){1===t?e.sx=r.readFloat():2===t?e.ky=r.readFloat():3===t?e.kx=r.readFloat():4===t?e.sy=r.readFloat():5===t?e.tx=r.readFloat():6===t&&(e.ty=r.readFloat());}function Sg(t,e,r){1===t?e.fill=function(t,e){return t.readFields(Pg,{rgb_color:og,paint:"rgb_color",opacity:255},e)}(r,r.readVarint()+r.pos):2===t?e.stroke=function(t,e){return t.readFields(zg,{rgb_color:og,paint:"rgb_color",dasharray:[],dashoffset:0,miterlimit:4,opacity:255,width:1,linecap:1,linejoin:1},e)}(r,r.readVarint()+r.pos):3===t?e.paint_order=r.readVarint():5===t?r.readPackedVarint(e.commands):6===t?e.step=r.readFloat():7===t?r.readPackedSVarint(e.diffs):8===t&&(e.rule=r.readVarint());}function Pg(t,e,r){1===t?(e.rgb_color=Eg(r.readVarint()),e.paint="rgb_color"):2===t?(e.linear_gradient_idx=r.readVarint(),e.paint="linear_gradient_idx"):3===t?(e.radial_gradient_idx=r.readVarint(),e.paint="radial_gradient_idx"):5===t&&(e.opacity=r.readVarint());}function Eg(t){return new Se((t>>16&255)/255,(t>>8&255)/255,(255&t)/255,1)}function zg(t,e,r){1===t?(e.rgb_color=Eg(r.readVarint()),e.paint="rgb_color"):2===t?(e.linear_gradient_idx=r.readVarint(),e.paint="linear_gradient_idx"):3===t?(e.radial_gradient_idx=r.readVarint(),e.paint="radial_gradient_idx"):5===t?r.readPackedFloat(e.dasharray):6===t?e.dashoffset=r.readFloat():7===t?e.miterlimit=r.readFloat():8===t?e.opacity=r.readVarint():9===t?e.width=r.readFloat():10===t?e.linecap=r.readVarint():11===t&&(e.linejoin=r.readVarint());}function kg(t,e,r){1===t?e.transform=Ag(r,r.readVarint()+r.pos):2===t?e.spread_method=r.readVarint():3===t?e.stops.push(Tg(r,r.readVarint()+r.pos)):4===t?e.x1=r.readFloat():5===t?e.y1=r.readFloat():6===t?e.x2=r.readFloat():7===t&&(e.y2=r.readFloat());}function Tg(t,e){return t.readFields(Bg,{offset:0,opacity:255,rgb_color:og},e)}function Bg(t,e,r){1===t?e.offset=r.readFloat():2===t?e.opacity=r.readVarint():3===t&&(e.rgb_color=Eg(r.readVarint()));}function Vg(t,e,r){1===t?e.transform=Ag(r,r.readVarint()+r.pos):2===t?e.spread_method=r.readVarint():3===t?e.stops.push(Tg(r,r.readVarint()+r.pos)):4===t?e.cx=r.readFloat():5===t?e.cy=r.readFloat():6===t?e.r=r.readFloat():7===t?e.fx=r.readFloat():8===t?e.fy=r.readFloat():9===t&&(e.fr=r.readFloat());}function Cg(t,e,r){1===t?e.transform=Ag(r,r.readVarint()+r.pos):2===t?e.clip_path_idx=r.readVarint():3===t&&e.children.push(_g(r,r.readVarint()+r.pos));}function Dg(t,e,r){1===t?e.left=e.top=r.readFloat():2===t?e.width=e.height=r.readFloat():3===t?e.top=r.readFloat():4===t?e.height=r.readFloat():5===t?e.mask_type=r.readVarint():6===t?e.mask_idx=r.readVarint():7===t&&e.children.push(_g(r,r.readVarint()+r.pos));}class Rg{static calculate(t={},e=[]){const r=new Map,n=new Map;if(0===Object.keys(t).length)return r;e.forEach((t=>{n.set(t.name,t.rgb_color||new Se(0,0,0));}));for(const[e,i]of Object.entries(t))n.has(e)?r.set(n.get(e).toStringPremultipliedAlpha(),i):console.warn(`Ignoring unknown image variable "${e}"`);return r}}function Lg(t,e=255,r){const n=e/255,i=t.toStringPremultipliedAlpha(),s=r.has(i)?r.get(i).clone():t.clone();return s.a*=n,s.toString()}function Fg(t,e){if(!Vt()){const r=document.createElement("canvas");return r.width=t,r.height=e,r}return new OffscreenCanvas(t,e)}function Og(t,e){const r=Rg.calculate(e.params,t.metadata?t.metadata.variables:[]),n=t.usvg_tree,i=n.width,s=n.height,a=e.transform?e.transform:new DOMMatrix,o=Math.max(1,Math.round(i*a.a)),l=Math.max(1,Math.round(s*a.d)),u=new DOMMatrix([o/i,0,0,l/s,0,0]),c=Fg(o,l).getContext("2d");return Ng(c,u,n,n,r),c.getImageData(0,0,o,l)}function Ng(t,e,r,n,i){for(const s of n.children)Ug(t,e,r,s,i);}function Ug(t,e,r,n,i){n.group?(t.save(),function(t,e,r,n,i){const s=null!=n.mask_idx?r.masks[n.mask_idx]:null,a=null!=n.clip_path_idx?r.clip_paths[n.clip_path_idx]:null;if(n.transform&&(e=Wg(n.transform).preMultiplySelf(e)),!function(t,e,r){return 255!==t.opacity||e||r}(n,null!=a,null!=s))return void Ng(t,e,r,n,i);const o=Fg(t.canvas.width,t.canvas.height),l=o.getContext("2d");Ng(l,e,r,n,i),a&&Xg(l,e,r,a),s&&Zg(l,e,r,s,i),t.globalAlpha=n.opacity/255,t.drawImage(o,0,0);}(t,e,r,n.group,i),t.restore()):n.path&&(t.save(),function(t,e,r,n,i){const s=Kg(n);t.setTransform(e),n.paint_order===hg.PAINT_ORDER_FILL_AND_STROKE?(jg(t,r,n,s,i),$g(t,r,n,s,i)):($g(t,r,n,s,i),jg(t,r,n,s,i));}(t,e,r,n.path,i),t.restore());}function jg(t,e,r,n,i){const s=r.fill;if(!s)return;const a=s.opacity/255;switch(s.paint){case"rgb_color":t.fillStyle=Lg(s.rgb_color,s.opacity,i);break;case"linear_gradient_idx":t.fillStyle=Gg(t,e.linear_gradients[s.linear_gradient_idx],a,i);break;case"radial_gradient_idx":t.fillStyle=Yg(t,e.radial_gradients[s.radial_gradient_idx],a,i);}t.fill(n,qg(r));}function qg(t){return t.rule===lg.PATH_RULE_NON_ZERO?"nonzero":t.rule===lg.PATH_RULE_EVEN_ODD?"evenodd":void 0}function $g(t,e,r,n,i){const s=r.stroke;if(!s)return;t.lineWidth=s.width,t.miterLimit=s.miterlimit,t.setLineDash(s.dasharray),t.lineDashOffset=s.dashoffset;const a=s.opacity/255;switch(s.paint){case"rgb_color":t.strokeStyle=Lg(s.rgb_color,s.opacity,i);break;case"linear_gradient_idx":t.strokeStyle=Gg(t,e.linear_gradients[s.linear_gradient_idx],a,i);break;case"radial_gradient_idx":t.strokeStyle=Yg(t,e.radial_gradients[s.radial_gradient_idx],a,i);}switch(s.linejoin){case cg.LINE_JOIN_MITER_CLIP:case cg.LINE_JOIN_MITER:t.lineJoin="miter";break;case cg.LINE_JOIN_ROUND:t.lineJoin="round";break;case cg.LINE_JOIN_BEVEL:t.lineJoin="bevel";}switch(s.linecap){case ug.LINE_CAP_BUTT:t.lineCap="butt";break;case ug.LINE_CAP_ROUND:t.lineCap="round";break;case ug.LINE_CAP_SQUARE:t.lineCap="square";}t.stroke(n);}function Gg(t,e,r,n){if(1===e.stops.length){const t=e.stops[0];return Lg(t.rgb_color,t.opacity*r,n)}const i=Wg(e.transform),{x1:s,y1:a,x2:o,y2:l}=e,u=i.transformPoint(new DOMPoint(s,a)),c=i.transformPoint(new DOMPoint(o,l)),h=t.createLinearGradient(u.x,u.y,c.x,c.y);for(const t of e.stops)h.addColorStop(t.offset,Lg(t.rgb_color,t.opacity*r,n));return h}function Yg(t,e,r,n){if(1===e.stops.length){const t=e.stops[0];return Lg(t.rgb_color,t.opacity*r,n)}const i=Wg(e.transform),{fx:s,fy:a,cx:o,cy:l}=e,u=i.transformPoint(new DOMPoint(s,a)),c=i.transformPoint(new DOMPoint(o,l)),h=t.createRadialGradient(u.x,u.y,0,c.x,c.y,e.r*((i.a+i.d)/2));for(const t of e.stops)h.addColorStop(t.offset,Lg(t.rgb_color,t.opacity*r,n));return h}function Hg(t,e,r,n){const i=n.transform?Wg(n.transform).preMultiplySelf(e):e,s=Fg(t.canvas.width,t.canvas.height),a=s.getContext("2d");for(const t of n.children)if(t.group)Hg(a,i,r,t.group);else if(t.path){const e=t.path,r=new Path2D;r.addPath(Kg(e),i),a.fill(r,qg(e));}const o=null!=n.clip_path_idx?r.clip_paths[n.clip_path_idx]:null;o&&Xg(a,i,r,o),t.globalCompositeOperation="source-over",t.drawImage(s,0,0);}function Xg(t,e,r,n){const i=Fg(t.canvas.width,t.canvas.height);Hg(i.getContext("2d"),e,r,n),t.globalCompositeOperation="destination-in",t.drawImage(i,0,0);}function Zg(t,e,r,n,i){if(0===n.children.length)return;const s=null!=n.mask_idx?r.masks[n.mask_idx]:null;s&&Zg(t,e,r,s,i);const a=t.canvas.width,o=t.canvas.height,l=Fg(a,o),u=l.getContext("2d"),c=n.width,h=n.height,p=n.left,f=n.top,d=new Path2D,m=new Path2D;m.rect(p,f,c,h),d.addPath(m,e),u.clip(d);for(const t of n.children)Ug(u,e,r,t,i);const y=u.getImageData(0,0,a,o),g=y.data;if(n.mask_type===fg.MASK_TYPE_LUMINANCE)for(let t=0;t<g.length;t+=4)g[t+3]=g[t+3]/255*(.2126*g[t]+.7152*g[t+1]+.0722*g[t+2]);u.putImageData(y,0,0),t.globalCompositeOperation="destination-in",t.drawImage(l,0,0);}function Wg(t){return t?new DOMMatrix([t.sx,t.ky,t.kx,t.sy,t.tx,t.ty]):new DOMMatrix}function Kg(t){const e=new Path2D,r=t.step;let n=t.diffs[0]*r,i=t.diffs[1]*r;e.moveTo(n,i);for(let s=0,a=2;s<t.commands.length;s++)switch(t.commands[s]){case pg.PATH_COMMAND_MOVE:n+=t.diffs[a++]*r,i+=t.diffs[a++]*r,e.moveTo(n,i);break;case pg.PATH_COMMAND_LINE:n+=t.diffs[a++]*r,i+=t.diffs[a++]*r,e.lineTo(n,i);break;case pg.PATH_COMMAND_QUAD:{const s=n+t.diffs[a++]*r,o=i+t.diffs[a++]*r;n=s+t.diffs[a++]*r,i=o+t.diffs[a++]*r,e.quadraticCurveTo(s,o,n,i);break}case pg.PATH_COMMAND_CUBIC:{const s=n+t.diffs[a++]*r,o=i+t.diffs[a++]*r,l=s+t.diffs[a++]*r,u=o+t.diffs[a++]*r;n=l+t.diffs[a++]*r,i=u+t.diffs[a++]*r,e.bezierCurveTo(s,o,l,u,n,i);break}case pg.PATH_COMMAND_CLOSE:e.closePath();}return e}class Jg{constructor(t){this.capacity=t,this.cache=new Map;}get(t){if(!this.cache.has(t))return;const e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}put(t,e){this.cache.has(t)?this.cache.delete(t):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(t,e);}delete(t){this.cache.delete(t);}}us(Jg,"LRUCache");class Qg{constructor(){this.cacheMap=new Map,this.cacheDependenciesMap=new Map;}static _getImage(t){return new pc(t,t.data)}getFromCache(t,e,r){return this.cacheMap.has(r)||this.cacheMap.set(r,new Jg(150)),this.cacheMap.get(r).get(pa(t.toString(),e))}setInCache(t,e,r,n){this.cacheDependenciesMap.has(n)||this.cacheDependenciesMap.set(n,new Map),this.cacheMap.has(n)||this.cacheMap.set(n,new Jg(150));const i=this.cacheDependenciesMap.get(n),s=pa(t.id.toString(),r);i.get(s)||i.set(s,new Set);const a=this.cacheMap.get(n),o=t.toString();i.get(s).add(o),a.put(pa(t.toString(),r),e);}removeImagesFromCacheByIds(t,e,r=0){if(!this.cacheMap.has(r)||!this.cacheDependenciesMap.has(r))return;const n=this.cacheMap.get(r),i=this.cacheDependenciesMap.get(r);for(const r of t){const t=pa(r.toString(),e);if(i.has(t)){for(const e of i.get(t))n.delete(e);i.delete(t);}}}rasterize(t,e,r,n,i=Og){const s=this.getFromCache(t,r,n);if(s)return s.clone();const a=i(e.icon,t.options),o=Qg._getImage(a);return this.setInCache(t,o,r,n),o.clone()}}class tx{constructor(t){this.size=t,this.minimums=[],this.maximums=[],this.leaves=[];}getElevation(t,e){const r=this.toIdx(t,e);return {min:this.minimums[r],max:this.maximums[r]}}isLeaf(t,e){return this.leaves[this.toIdx(t,e)]}toIdx(t,e){return e*this.size+t}}function ex(t,e,r,n){let i=0,s=Number.MAX_VALUE;for(let a=0;a<3;a++)if(Math.abs(n[a])<1e-15){if(r[a]<t[a]||r[a]>e[a])return null}else {const o=1/n[a];let l=(t[a]-r[a])*o,u=(e[a]-r[a])*o;if(l>u){const t=l;l=u,u=t;}if(l>i&&(i=l),u<s&&(s=u),i>s)return null}return i}function rx(t,e,r,n,i,s,a,o,l,u,c){const h=n-t,p=i-e,f=s-r,d=a-t,m=o-e,y=l-r,g=c[1]*y-c[2]*m,x=c[2]*d-c[0]*y,v=c[0]*m-c[1]*d,b=h*g+p*x+f*v;if(Math.abs(b)<1e-15)return null;const _=1/b,w=u[0]-t,M=u[1]-e,A=u[2]-r,I=(w*g+M*x+A*v)*_;if(I<0||I>1)return null;const S=M*f-A*p,P=A*h-w*f,E=w*p-M*h,z=(c[0]*S+c[1]*P+c[2]*E)*_;return z<0||I+z>1?null:(d*S+m*P+y*E)*_}function nx(t,e,r){return (t-e)/(r-e)}function ix(t,e,r,n,i,s,a,o,l){const u=1<<r,c=s-n,h=a-i,p=(t+1)/u*c+n,f=(e+0)/u*h+i,d=(e+1)/u*h+i;o[0]=(t+0)/u*c+n,o[1]=f,l[0]=p,l[1]=d;}class sx{constructor(t){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=t,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const e=function(t){const e=Math.ceil(Math.log2(t.dim/8)),r=[];let n=Math.ceil(Math.pow(2,e));const i=1/n,s=(t,e,r,n,i)=>{const s=n?1:0,a=(t+1)*r-s,o=e*r,l=(e+1)*r-s;i[0]=t*r,i[1]=o,i[2]=a,i[3]=l;};let a=new tx(n);const o=[];for(let e=0;e<n*n;e++){s(e%n,Math.floor(e/n),i,!1,o);const r=ox(o[0],o[1],t),l=ox(o[2],o[1],t),u=ox(o[2],o[3],t),c=ox(o[0],o[3],t);a.minimums.push(Math.min(r,l,u,c)),a.maximums.push(Math.max(r,l,u,c)),a.leaves.push(1);}for(r.push(a),n/=2;n>=1;n/=2){const t=r[r.length-1];a=new tx(n);for(let e=0;e<n*n;e++){s(e%n,Math.floor(e/n),2,!0,o);const r=t.getElevation(o[0],o[1]),i=t.getElevation(o[2],o[1]),l=t.getElevation(o[2],o[3]),u=t.getElevation(o[0],o[3]),c=t.isLeaf(o[0],o[1]),h=t.isLeaf(o[2],o[1]),p=t.isLeaf(o[2],o[3]),f=t.isLeaf(o[0],o[3]),d=Math.min(r.min,i.min,l.min,u.min),m=Math.max(r.max,i.max,l.max,u.max),y=c&&h&&p&&f;a.maximums.push(m),a.minimums.push(d),a.leaves.push(m-d<=5&&y?1:0);}r.push(a);}return r}(this.dem),r=e.length-1,n=e[r];this._addNode(n.minimums[0],n.maximums[0],n.leaves[0]),this._construct(e,0,0,r,0);}raycastRoot(t,e,r,n,i,s,a=1){return ex([t,e,-100],[r,n,this.maximums[0]*a],i,s)}raycast(t,e,r,n,i,s,a=1){if(!this.nodeCount)return null;const o=this.raycastRoot(t,e,r,n,i,s,a);if(null==o)return null;const l=[],u=[],c=[],h=[],p=[{idx:0,t:o,nodex:0,nodey:0,depth:0}];for(;p.length>0;){const{idx:o,t:f,nodex:d,nodey:m,depth:y}=p.pop();if(this.leaves[o]){ix(d,m,y,t,e,r,n,c,h);const o=1<<y,l=(d+0)/o,u=(d+1)/o,p=(m+0)/o,g=(m+1)/o,x=ox(l,p,this.dem)*a,v=ox(u,p,this.dem)*a,b=ox(u,g,this.dem)*a,_=ox(l,g,this.dem)*a,w=rx(c[0],c[1],x,h[0],c[1],v,h[0],h[1],b,i,s),M=rx(h[0],h[1],b,c[0],h[1],_,c[0],c[1],x,i,s),A=Math.min(null!==w?w:Number.MAX_VALUE,null!==M?M:Number.MAX_VALUE);if(A!==Number.MAX_VALUE)return A;{const t=O.vec3.scaleAndAdd([],i,s,f);if(ax(x,v,_,b,nx(t[0],c[0],h[0]),nx(t[1],c[1],h[1]))>=t[2])return f}continue}let g=0;for(let p=0;p<this._siblingOffset.length;p++){ix((d<<1)+this._siblingOffset[p][0],(m<<1)+this._siblingOffset[p][1],y+1,t,e,r,n,c,h),c[2]=-100,h[2]=this.maximums[this.childOffsets[o]+p]*a;const f=ex(c,h,i,s);if(null!=f){const t=f;l[p]=t;let e=!1;for(let r=0;r<g&&!e;r++)t>=l[u[r]]&&(u.splice(r,0,p),e=!0);e||(u[g]=p),g++;}}for(let t=0;t<g;t++){const e=u[t];p.push({idx:this.childOffsets[o]+e,t:l[e],nodex:(d<<1)+this._siblingOffset[e][0],nodey:(m<<1)+this._siblingOffset[e][1],depth:y+1});}}return null}_addNode(t,e,r){return this.minimums.push(t),this.maximums.push(e),this.leaves.push(r),this.childOffsets.push(0),this.nodeCount++}_construct(t,e,r,n,i){if(1===t[n].isLeaf(e,r))return;this.childOffsets[i]||(this.childOffsets[i]=this.nodeCount);const s=n-1,a=t[s];let o=0,l=0;for(let t=0;t<this._siblingOffset.length;t++){const n=2*e+this._siblingOffset[t][0],i=2*r+this._siblingOffset[t][1],s=a.getElevation(n,i),u=a.isLeaf(n,i),c=this._addNode(s.min,s.max,u);u&&(o|=1<<t),l||(l=c);}for(let n=0;n<this._siblingOffset.length;n++)o&1<<n||this._construct(t,2*e+this._siblingOffset[n][0],2*r+this._siblingOffset[n][1],s,l+n);}}function ax(t,e,r,n,i,s){return Ee(Ee(t,r,s),Ee(e,n,s),i)}function ox(t,e,r){const n=r.dim,i=Q(t*n-.5,0,n-1),s=Q(e*n-.5,0,n-1),a=Math.floor(i),o=Math.floor(s),l=Math.min(a+1,n-1),u=Math.min(o+1,n-1);return ax(r.get(a,o),r.get(l,o),r.get(a,u),r.get(l,u),i-a,s-o)}const lx={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};function ux(t,e,r){return (256*t*256+256*e+r)/10-1e4}function cx(t,e,r){return 256*t+e+r/256-32768}class hx{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(t,e,r,n=!1){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return void pt(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=e.height;const i=this.dim=e.height-2,s=new Uint32Array(e.data.buffer);if(this.pixels=new Uint8Array(e.data.buffer),this.floatView=new Float32Array(e.data.buffer),this.borderReady=n,this._modifiedForSources={},!n){for(let t=0;t<i;t++)s[this._idx(-1,t)]=s[this._idx(0,t)],s[this._idx(i,t)]=s[this._idx(i-1,t)],s[this._idx(t,-1)]=s[this._idx(t,0)],s[this._idx(t,i)]=s[this._idx(t,i-1)];s[this._idx(-1,-1)]=s[this._idx(0,0)],s[this._idx(i,-1)]=s[this._idx(i-1,0)],s[this._idx(-1,i)]=s[this._idx(0,i-1)],s[this._idx(i,i)]=s[this._idx(i-1,i-1)];}const a="terrarium"===r?cx:ux;for(let t=0;t<s.length;++t){const e=4*t;this.floatView[t]=a(this.pixels[e],this.pixels[e+1],this.pixels[e+2]);}this._timestamp=Ct.now();}_buildQuadTree(){this._tree=new sx(this);}get(t,e,r=!1){r&&(t=Q(t,-1,this.dim),e=Q(e,-1,this.dim));const n=this._idx(t,e);return this.floatView[n]}set(t,e,r){const n=this._idx(t,e),i=this.floatView[n];return this.floatView[n]=r,r-i}static getUnpackVector(t){return lx[t]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return (e+1)*this.stride+(t+1)}static pack(t,e){const r=[0,0,0,0],n=hx.getUnpackVector(e);let i=Math.floor((t+n[3])/n[2]);return r[2]=i%256,i=Math.floor(i/256),r[1]=i%256,i=Math.floor(i/256),r[0]=i,r}getPixels(){return new fc({width:this.stride,height:this.stride},this.pixels)}backfillBorder(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,i=e*this.dim+this.dim,s=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1;}switch(r){case-1:s=a-1;break;case 1:a=s+1;}const o=-e*this.dim,l=-r*this.dim;for(let e=s;e<a;e++)for(let r=n;r<i;r++){const n=4*this._idx(r,e),i=4*this._idx(r+o,e+l);this.pixels[n+0]=t.pixels[i+0],this.pixels[n+1]=t.pixels[i+1],this.pixels[n+2]=t.pixels[i+2],this.pixels[n+3]=t.pixels[i+3];}}onDeserialize(){this._tree&&(this._tree.dem=this);}}function px(t,e,r){1===t?e.headerLength=r.readFixed32():2===t?e.x=r.readVarint():3===t?e.y=r.readVarint():4===t?e.z=r.readVarint():5===t&&e.layers.push(function(t,e){return t.readFields(gx,{version:0,name:"",units:"",tileSize:0,buffer:0,pixelFormat:0,dataIndex:[]},e)}(r,r.readVarint()+r.pos));}function fx(t,e,r){1===t?(e.delta_filter=function(t,e){return t.readFields(dx,{blockSize:0},e)}(r,r.readVarint()+r.pos),e.filter="delta_filter"):2===t?(r.readVarint(),e.filter="zigzag_filter"):3===t?(r.readVarint(),e.filter="bitshuffle_filter"):4===t&&(r.readVarint(),e.filter="byteshuffle_filter");}function dx(t,e,r){1===t&&(e.blockSize=r.readVarint());}function mx(t,e,r){1===t?(r.readVarint(),e.codec="gzip_data"):2===t?(r.readVarint(),e.codec="jpeg_image"):3===t?(r.readVarint(),e.codec="webp_image"):4===t&&(r.readVarint(),e.codec="png_image");}function yx(t,e,r){let n=0,i=0;1===t?e.firstByte=r.readFixed64():2===t?e.lastByte=r.readFixed64():3===t?e.filters.push(function(t,e){return t.readFields(fx,{},e)}(r,r.readVarint()+r.pos)):4===t?e.codec=function(t,e){return t.readFields(mx,{},e)}(r,r.readVarint()+r.pos):5===t?i=r.readFloat():6===t?n=r.readFloat():7===t?e.bands.push(r.readString()):8===t?e.offset=r.readDouble():9===t&&(e.scale=r.readDouble()),0===e.offset&&(e.offset=i),0===e.scale&&(e.scale=n);}function gx(t,e,r){1===t?e.version=r.readVarint():2===t?e.name=r.readString():3===t?e.units=r.readString():4===t?e.tileSize=r.readVarint():5===t?e.buffer=r.readVarint():6===t?e.pixelFormat=r.readVarint():7===t&&e.dataIndex.push(function(t,e){return t.readFields(yx,{firstByte:0,lastByte:0,filters:[],codec:null,offset:0,scale:0,bands:[]},e)}(r,r.readVarint()+r.pos));}function xx(t,e,r){if(2===t)!function(t,e,r){t.readFields(vx,r,e);}(r,r.readVarint()+r.pos,e);else if(3===t)throw new Error("Not implemented")}function vx(t,e,r){if(1===t){let t=0;const n=r.readVarint()+r.pos;for(;r.pos<n;)e[t++]=r.readVarint();}}function bx(t,e){if(4!==e.length)throw new Error(`Expected data of dimension 4 but got ${e.length}.`);let r=e[3];for(let n=2;n>=1;n--){const i=1===n?1:0,s=2===n?1:0;for(let n=0;n<e[0];n++){const a=e[1]*n;for(let n=i;n<e[1];n++){const i=e[2]*(n+a);for(let n=s;n<e[2];n++){const s=e[3]*(n+i);for(let n=0;n<e[3];n++){const e=s+n;t[e]+=t[e-r];}}}}r*=e[n];}return t}function _x(t){for(let e=0,r=t.length;e<r;e++)t[e]=t[e]>>>1^-(1&t[e]);return t}function wx(t,e){switch(e){case"uint32":return t;case"uint16":for(let e=0;e<t.length;e+=2){const r=t[e],n=t[e+1];t[e]=(240&r)>>4|(61440&r)>>8|(240&n)<<4|61440&n,t[e+1]=15&r|(3840&r)>>4|(15&n)<<8|(3840&n)<<4;}return t;case"uint8":for(let e=0;e<t.length;e+=4){const r=t[e],n=t[e+1],i=t[e+2],s=t[e+3];t[e+0]=(192&r)>>6|(192&n)>>4|(192&i)>>2|192&s,t[e+1]=(48&r)>>4|(48&n)>>2|48&i|(48&s)<<2,t[e+2]=(12&r)>>2|12&n|(12&i)<<2|(12&s)<<4,t[e+3]=3&r|(3&n)<<2|(3&i)<<4|(3&s)<<6;}return t;default:throw new Error(`Invalid pixel format, "${e}"`)}}us(hx,"DEMData"),us(sx,"DemMinMaxQuadTree",{omit:["dem"]});var Mx=Uint8Array,Ax=Uint16Array,Ix=Int32Array,Sx=new Mx([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Px=new Mx([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ex=new Mx([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zx=function(t,e){for(var r=new Ax(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new Ix(r[30]);for(n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return {b:r,r:i}},kx=zx(Sx,2),Tx=kx.b,Bx=kx.r;Tx[28]=258,Bx[258]=28;for(var Vx=zx(Px,0).b,Cx=new Ax(32768),Dx=0;Dx<32768;++Dx){var Rx=(43690&Dx)>>1|(21845&Dx)<<1;Cx[Dx]=((65280&(Rx=(61680&(Rx=(52428&Rx)>>2|(13107&Rx)<<2))>>4|(3855&Rx)<<4))>>8|(255&Rx)<<8)>>1;}var Lx=function(t,e,r){for(var n=t.length,i=0,s=new Ax(e);i<n;++i)t[i]&&++s[t[i]-1];var a,o=new Ax(e);for(i=1;i<e;++i)o[i]=o[i-1]+s[i-1]<<1;a=new Ax(1<<e);var l=15-e;for(i=0;i<n;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],h=o[t[i]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)a[Cx[h]>>l]=u;return a},Fx=new Mx(288);for(Dx=0;Dx<144;++Dx)Fx[Dx]=8;for(Dx=144;Dx<256;++Dx)Fx[Dx]=9;for(Dx=256;Dx<280;++Dx)Fx[Dx]=7;for(Dx=280;Dx<288;++Dx)Fx[Dx]=8;var Ox=new Mx(32);for(Dx=0;Dx<32;++Dx)Ox[Dx]=5;var Nx=Lx(Fx,9),Ux=Lx(Ox,5),jx=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},qx=function(t,e,r){var n=e/8|0;return (t[n]|t[n+1]<<8)>>(7&e)&r},$x=function(t,e){var r=e/8|0;return (t[r]|t[r+1]<<8|t[r+2]<<16)>>(7&e)},Gx=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Yx=function(t,e,r){var n=new Error(e||Gx[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Yx),!r)throw n;return n},Hx=new Mx(0),Xx="undefined"!=typeof TextDecoder&&new TextDecoder;try{Xx.decode(Hx,{stream:!0});}catch(t){}const Zx={gzip_data:"gzip"};class Wx extends Error{constructor(t){super(t),this.name="MRTError";}}const Kx={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},Jx={uint32:1,uint16:2,uint8:4},Qx={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let tv;class ev{constructor(t=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=t;}getLayer(t){const e=this.layers[t];if(!e)throw new Wx(`Layer '${t}' not found`);return e}getHeaderLength(t){const e=new Uint8Array(t),r=new DataView(t);if(13!==e[0])throw new Wx("File is not a valid MRT.");return r.getUint32(1,!0)}parseHeader(t){const e=new Uint8Array(t),r=this.getHeaderLength(t);if(e.length<r)throw new Wx(`Expected header with length >= ${r} but got buffer of length ${e.length}`);const n=function(t,e){return t.readFields(px,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0)}(new tv(e.subarray(0,r)));if(!isNaN(this.x)&&(this.x!==n.x||this.y!==n.y||this.z!==n.z))throw new Wx(`Invalid attempt to parse header ${n.z}/${n.x}/${n.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=n.x,this.y=n.y,this.z=n.z;for(const t of n.layers)this.layers[t.name]=new rv(t,{cacheSize:this._cacheSize});return this}createDecodingTask(t){const e=[],r=this.getLayer(t.layerName);for(let n of t.blockIndices){const i=r.dataIndex[n],s=i.firstByte-t.firstByte,a=i.lastByte-t.firstByte;if(r._blocksInProgress.has(n))continue;const o={layerName:r.name,firstByte:s,lastByte:a,pixelFormat:r.pixelFormat,blockIndex:n,blockShape:[i.bands.length].concat(r.bandShape),buffer:r.buffer,codec:i.codec.codec,filters:i.filters.map((t=>t.filter))};r._blocksInProgress.add(n),e.push(o);}return new nv(e,(()=>{e.forEach((t=>r._blocksInProgress.delete(t.blockIndex)));}),((t,n)=>{if(e.forEach((t=>r._blocksInProgress.delete(t.blockIndex))),t)throw t;n.forEach((t=>{this.getLayer(t.layerName).processDecodedData(t);}));}))}}class rv{constructor({version:t,name:e,units:r,tileSize:n,pixelFormat:i,buffer:s,dataIndex:a},o){if(this.version=t,1!==this.version)throw new Wx(`Cannot parse raster layer encoded with MRT version ${t}`);this.name=e,this.units=r,this.tileSize=n,this.buffer=s,this.pixelFormat=Kx[i],this.dataIndex=a,this.bandShape=[n+2*s,n+2*s,Jx[this.pixelFormat]],this._decodedBlocks=new Jg(o?o.cacheSize:5),this._blocksInProgress=new Set;}get dimension(){return Jx[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map((({bands:t})=>t)).flat()}processDecodedData(t){const e=t.blockIndex.toString();this._decodedBlocks.get(e)||this._decodedBlocks.put(e,t.data);}getBlockForBand(t){let e=0;switch(typeof t){case"string":for(const[r,n]of this.dataIndex.entries()){for(const[i,s]of n.bands.entries())if(s===t)return {bandIndex:e+i,blockIndex:r,blockBandIndex:i};e+=n.bands.length;}break;case"number":for(const[r,n]of this.dataIndex.entries()){if(t>=e&&t<e+n.bands.length)return {bandIndex:t,blockIndex:r,blockBandIndex:t-e};e+=n.bands.length;}break;default:throw new Wx(`Invalid band \`${JSON.stringify(t)}\`. Expected string or integer.`)}return {blockIndex:-1,blockBandIndex:-1}}getDataRange(t){let e=1/0,r=-1/0;const n=[],i=new Set;for(const s of t){const{blockIndex:t}=this.getBlockForBand(s);if(t<0)throw new Wx(`Invalid band: ${JSON.stringify(s)}`);const a=this.dataIndex[t];n.includes(t)||n.push(t),i.add(t),e=Math.min(e,a.firstByte),r=Math.max(r,a.lastByte);}if(i.size>this.cacheSize)throw new Wx(`Number of blocks to decode (${i.size}) exceeds cache size (${this.cacheSize}).`);return {layerName:this.name,firstByte:e,lastByte:r,blockIndices:n}}hasBand(t){const{blockIndex:e}=this.getBlockForBand(t);return e>=0}hasDataForBand(t){const{blockIndex:e}=this.getBlockForBand(t);return e>=0&&!!this._decodedBlocks.get(e.toString())}getBandView(t){const{blockIndex:e,blockBandIndex:r}=this.getBlockForBand(t);if(e<0)throw new Wx(`Band not found: ${JSON.stringify(t)}`);const n=this._decodedBlocks.get(e.toString());if(!n)throw new Wx(`Data for band ${JSON.stringify(t)} of layer "${this.name}" not decoded.`);const i=this.dataIndex[e],s=this.bandShape.reduce(((t,e)=>t*e),1),a=r*s,o=n.subarray(a,a+s);return {data:o,bytes:new Uint8Array(o.buffer).subarray(o.byteOffset,o.byteOffset+o.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:i.offset,scale:i.scale}}}ev.setPbf=function(t){tv=t;};class nv{constructor(t,e,r){this.tasks=t,this._onCancel=e,this._onComplete=r,this._finalized=!1;}cancel(){this._finalized||(this._onCancel(),this._finalized=!0);}complete(t,e){this._finalized||(this._onComplete(t,e),this._finalized=!0);}}ev.performDecoding=function(t,e){const r=new Uint8Array(t);return Promise.all(e.tasks.map((t=>{const{layerName:e,firstByte:n,lastByte:i,pixelFormat:s,blockShape:a,blockIndex:o,filters:l,codec:u}=t,c=r.subarray(n,i+1),h=new Uint32Array(a[0]*a[1]*a[2]);let p;if("gzip_data"!==u)throw new Wx(`Unhandled codec: ${u}`);return p=function(t,e){if(!globalThis.DecompressionStream&&"gzip_data"===e)return Promise.resolve(((s=function(t){31==t[0]&&139==t[1]&&8==t[2]||Yx(6,"invalid gzip data");var e=t[3],r=10;4&e&&(r+=2+(t[10]|t[11]<<8));for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[r++]);return r+(2&e)}(i=t))+8>i.length&&Yx(6,"invalid gzip data"),function(t,e,r,n){var i=t.length;if(!i||e.f&&!e.l)return r||new Mx(0);var s=!r,a=s||2!=e.i,o=e.i;s&&(r=new Mx(3*i));var l,u,c=function(t){var e=r.length;if(t>e){var n=new Mx(Math.max(2*e,t));n.set(r),r=n;}},h=e.f||0,p=e.p||0,f=e.b||0,d=e.l,m=e.d,y=e.m,g=e.n,x=8*i;do{if(!d){h=qx(t,p,1);var v=qx(t,p+1,3);if(p+=3,!v){var b=t[(T=4+((p+7)/8|0))-4]|t[T-3]<<8,_=T+b;if(_>i){o&&Yx(0);break}a&&c(f+b),r.set(t.subarray(T,_),f),e.b=f+=b,e.p=p=8*_,e.f=h;continue}if(1==v)d=Nx,m=Ux,y=9,g=5;else if(2==v){var w=qx(t,p,31)+257,M=qx(t,p+10,15)+4,A=w+qx(t,p+5,31)+1;p+=14;for(var I=new Mx(A),S=new Mx(19),P=0;P<M;++P)S[Ex[P]]=qx(t,p+3*P,7);p+=3*M;var E=jx(S),z=(1<<E)-1,k=Lx(S,E);for(P=0;P<A;){var T,B=k[qx(t,p,z)];if(p+=15&B,(T=B>>4)<16)I[P++]=T;else {var V=0,C=0;for(16==T?(C=3+qx(t,p,3),p+=2,V=I[P-1]):17==T?(C=3+qx(t,p,7),p+=3):18==T&&(C=11+qx(t,p,127),p+=7);C--;)I[P++]=V;}}var D=I.subarray(0,w),R=I.subarray(w);y=jx(D),g=jx(R),d=Lx(D,y),m=Lx(R,g);}else Yx(1);if(p>x){o&&Yx(0);break}}a&&c(f+131072);for(var L=(1<<y)-1,F=(1<<g)-1,O=p;;O=p){var N=(V=d[$x(t,p)&L])>>4;if((p+=15&V)>x){o&&Yx(0);break}if(V||Yx(2),N<256)r[f++]=N;else {if(256==N){O=p,d=null;break}var U=N-254;N>264&&(U=qx(t,p,(1<<($=Sx[P=N-257]))-1)+Tx[P],p+=$);var j=m[$x(t,p)&F],q=j>>4;if(j||Yx(3),p+=15&j,R=Vx[q],q>3){var $=Px[q];R+=$x(t,p)&(1<<$)-1,p+=$;}if(p>x){o&&Yx(0);break}a&&c(f+131072);var G=f+U;if(f<R){var Y=0-R,H=Math.min(R,G);for(Y+f<0&&Yx(3);f<H;++f)r[f]=(void 0)[Y+f];}for(;f<G;++f)r[f]=r[f-R];}}e.l=d,e.p=O,e.b=f,e.f=h,d&&(h=1,e.m=y,e.d=m,e.n=g);}while(!h);return f!=r.length&&s?(l=r,(null==(u=f)||u>l.length)&&(u=l.length),new Mx(l.subarray(0,u))):r.subarray(0,f)}(i.subarray(s,-8),{i:2},new Mx(((r=i)[(n=r.length)-4]|r[n-3]<<8|r[n-2]<<16|r[n-1]<<24)>>>0))));var r,n,i,s;const a=Zx[e];if(!a)throw new Error(`Unhandled codec: ${e}`);const o=new globalThis.DecompressionStream(a);return new Response(new Blob([t]).stream().pipeThrough(o)).arrayBuffer().then((t=>new Uint8Array(t)))}(c,u).then((t=>(function(t,e){t.readFields(xx,e);}(new tv(t),h),new(0,Qx[s])(h.buffer)))),p.then((t=>{for(let e=l.length-1;e>=0;e--)switch(l[e]){case"delta_filter":bx(t,a);break;case"zigzag_filter":_x(t);break;case"bitshuffle_filter":wx(t,s);break;default:throw new Wx(`Unhandled filter "${l[e]}"`)}return {layerName:e,blockIndex:o,data:t}})).catch((t=>{throw t}))})))},us(nv,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),us(ev,"MapboxRasterTile"),us(rv,"MapboxRasterLayer",{omit:["_blocksInProgress"]});let iv,sv,av,ov,lv,uv=null;function cv(){return yt()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:sv||At.DRACO_URL}function hv(){if(yt()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(ov)return ov;const t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return ov=WebAssembly.validate(t)?At.MESHOPT_SIMD_URL:At.MESHOPT_URL,ov}const pv={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},fv={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},dv={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function mv(t,e,r){const n=r.json.bufferViews.length,i=r.buffers.length;e.bufferView=n,r.json.bufferViews[n]={buffer:i,byteLength:t.byteLength},r.buffers[i]=t;}const yv="KHR_draco_mesh_compression";function gv(t,e){const r=t.extensions&&t.extensions[yv];if(!r)return;const n=new av.Decoder,i=Av(e,r.bufferView),s=new av.Mesh;if(!n.DecodeArrayToMesh(i,i.byteLength,s))throw new Error("Failed to decode Draco mesh");const a=e.json.accessors[t.indices],o=pv[a.componentType],l=a.count*o.BYTES_PER_ELEMENT,u=av._malloc(l);o===Uint16Array?n.GetTrianglesUInt16Array(s,l,u):n.GetTrianglesUInt32Array(s,l,u),mv(av.memory.buffer.slice(u,u+l),a,e),av._free(u);for(const i of Object.keys(r.attributes)){const a=n.GetAttributeByUniqueId(s,r.attributes[i]),o=e.json.accessors[t.attributes[i]],l=fv[o.componentType],u=o.count*dv[o.type]*pv[o.componentType].BYTES_PER_ELEMENT,c=av._malloc(u);n.GetAttributeDataArrayForAllPoints(s,a,av[l],u,c),mv(av.memory.buffer.slice(c,c+u),o,e),av._free(c);}n.destroy(),s.destroy(),delete t.extensions[yv];}const xv="EXT_meshopt_compression";function vv(t,e){if(!t.extensions||!t.extensions[xv])return;const r=t.extensions[xv],n=new Uint8Array(e.buffers[r.buffer],r.byteOffset||0,r.byteLength||0),i=new Uint8Array(r.count*r.byteStride);lv.decodeGltfBuffer(i,r.count,r.byteStride,n,r.mode,r.filter),t.buffer=e.buffers.length,t.byteOffset=0,e.buffers[t.buffer]=i.buffer,delete t.extensions[xv];}const bv=1179937895,_v=new TextDecoder("utf8");function wv(t,e){return new URL(t,e).href}function Mv(t,e,r,n){return fetch(wv(t.uri,n)).then((t=>t.arrayBuffer())).then((t=>{e.buffers[r]=t;}))}function Av(t,e){const r=t.json.bufferViews[e];return new Uint8Array(t.buffers[r.buffer],r.byteOffset||0,r.byteLength)}function Iv(t,e,r,n){if(t.uri){const i=wv(t.uri,n);return fetch(i).then((t=>t.blob())).then((t=>createImageBitmap(t))).then((t=>{e.images[r]=t;}))}if(void 0!==t.bufferView){const n=Av(e,t.bufferView),i=new Blob([n],{type:t.mimeType});return createImageBitmap(i).then((t=>{e.images[r]=t;}))}}function Sv(t,e=0,r){const n={json:null,images:[],buffers:[]};if(new Uint32Array(t,e,1)[0]===bv){const r=new Uint32Array(t,e);let i=2;const s=(r[i++]>>2)-3,a=r[i++]>>2;if(i++,n.json=JSON.parse(_v.decode(r.subarray(i,i+a))),i+=a,i<s){const s=r[i++];i++;const a=e+(i<<2);n.buffers[0]=t.slice(a,a+s);}}else n.json=JSON.parse(_v.decode(new Uint8Array(t,e)));const{buffers:i,images:s,meshes:a,extensionsUsed:o,bufferViews:l}=n.json;let u=Promise.resolve();if(i){const t=[];for(let e=0;e<i.length;e++){const s=i[e];s.uri?t.push(Mv(s,n,e,r)):n.buffers[e]||(n.buffers[e]=null);}u=Promise.all(t);}return u.then((()=>{const t=[],e=o&&o.includes(yv),i=o&&o.includes(xv);if(e&&t.push(function(){if(!av)return null!=iv?iv:(iv=function(t){let e,r=null;function n(){e=new Uint8Array(r.buffer);}function i(){throw new Error("Unexpected Draco error.")}const s={a:{a:i,d:function(t,r,n){return e.copyWithin(t,r,r+n)},c:function(t){const i=e.length,s=Math.max(t>>>0,Math.ceil(1.2*i)),a=Math.ceil((s-i)/65536);try{return r.grow(a),n(),!0}catch(t){return !1}},b:i}};return (WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t,s):t.then((t=>t.arrayBuffer())).then((t=>WebAssembly.instantiate(t,s)))).then((t=>{const{Rb:i,Qb:s,P:a,T:o,X:l,Ja:u,La:c,Qa:h,Va:p,Wa:f,eb:d,jb:m,f:y,e:g,yb:x,zb:v,Ab:b,Bb:_,Db:w,Gb:M}=t.instance.exports;r=g;const A=(()=>{let t=0,r=0,n=0,a=0;return o=>{n&&(i(a),i(t),r+=n,n=t=0),t||(r+=128,t=s(r));const l=o.length+7&-8;let u=t;l>=r&&(n=l,u=a=s(l));for(let t=0;t<o.length;t++)e[u+t]=o[t];return u}})();return n(),y(),{memory:g,_free:i,_malloc:s,Mesh:class{constructor(){this.ptr=a();}destroy(){o(this.ptr);}},Decoder:class{constructor(){this.ptr=u();}destroy(){m(this.ptr);}DecodeArrayToMesh(t,e,r){const n=A(t),i=c(this.ptr,n,e,r.ptr);return !!l(i)}GetAttributeByUniqueId(t,e){return {ptr:h(this.ptr,t.ptr,e)}}GetTrianglesUInt16Array(t,e,r){p(this.ptr,t.ptr,e,r);}GetTrianglesUInt32Array(t,e,r){f(this.ptr,t.ptr,e,r);}GetAttributeDataArrayForAllPoints(t,e,r,n,i){d(this.ptr,t.ptr,e.ptr,r,n,i);}},DT_INT8:x(),DT_UINT8:v(),DT_INT16:b(),DT_UINT16:_(),DT_UINT32:w(),DT_FLOAT32:M()}}))}(fetch(cv())),iv.then((t=>{av=t,iv=void 0;})))}()),i&&t.push(function(){if(lv)return;const t=function(t){let e;const r=WebAssembly.instantiateStreaming(t,{}).then((t=>{e=t.instance,e.exports.__wasm_call_ctors();})),n={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},i={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return {ready:r,supported:!0,decodeGltfBuffer(t,r,s,a,o,l){!function(t,e,r,n,i,s,a){const o=t.exports.sbrk,l=n+3&-4,u=o(l*i),c=o(s.length),h=new Uint8Array(t.exports.memory.buffer);h.set(s,c);const p=e(u,n,i,c,s.length);if(0===p&&a&&a(u,l,i),r.set(h.subarray(u,u+n*i)),o(u-o(0)),0!==p)throw new Error(`Malformed buffer data: ${p}`)}(e,e.exports[i[o]],t,r,s,a,e.exports[n[l]]);}}}(fetch(hv()));return t.ready.then((()=>{lv=t;}))}()),s)for(let e=0;e<s.length;e++)t.push(Iv(s[e],n,e,r));return (t.length?Promise.all(t):Promise.resolve()).then((()=>{if(e&&a)for(const{primitives:t}of a)for(const e of t)gv(e,n);if(i&&a&&l)for(const t of l)vv(t,n);return n}))}))}function Pv(t,e){const r=t.json.bufferViews[e.bufferView],n=pv[e.componentType];return new n(t.buffers[r.buffer],(e.byteOffset||0)+(r.byteOffset||0),e.count*(r.byteStride&&r.byteStride!==dv[e.type]*n.BYTES_PER_ELEMENT?r.byteStride/n.BYTES_PER_ELEMENT:dv[e.type]))}function Ev(t,e,r,n){const i=pv[e.componentType],s=function(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(i),a=t.json.bufferViews[e.bufferView],o=a.byteStride?a.byteStride/i.BYTES_PER_ELEMENT:dv[e.type],l=r.float32,u=l.length/r.capacity;for(let t=0,r=0;t<e.count*o;t+=o,r+=u)for(let e=0;e<u;e++)l[r+e]=n[t+e]*s;r._trim();}function zv(t,e,r){const n=t.indices,i=t.attributes,s={};s.indexArray=new ja;const a=e.json.accessors[n],o=a.count/3;s.indexArray.reserve(o);const l=Pv(e,a);for(let t=0;t<o;t++)s.indexArray.emplaceBack(l[3*t],l[3*t+1],l[3*t+2]);s.indexArray._trim(),s.vertexArray=new za;const u=e.json.accessors[i.POSITION];s.vertexArray.reserve(u.count);const c=Pv(e,u);for(let t=0;t<u.count;t++)s.vertexArray.emplaceBack(c[3*t],c[3*t+1],c[3*t+2]);if(s.vertexArray._trim(),s.aabb=new Au(u.min,u.max),s.centroid=function(t,e){const r=[0,0,0],n=t.length;if(n>0){for(let i=0;i<n;i++){const n=3*t[i];r[0]+=e[n],r[1]+=e[n+1],r[2]+=e[n+2];}r[0]/=n,r[1]/=n,r[2]/=n;}return r}(l,c),void 0!==i.COLOR_0){const t=e.json.accessors[i.COLOR_0],r=dv[t.type],n=Pv(e,t);s.colorArray=3===r?new za:new Da,s.colorArray.resize(t.count),Ev(e,t,s.colorArray,n);}if(void 0!==i.NORMAL){s.normalArray=new za;const t=e.json.accessors[i.NORMAL];s.normalArray.resize(t.count);const r=Pv(e,t);Ev(e,t,s.normalArray,r);}if(void 0!==i.TEXCOORD_0&&r.length>0){s.texcoordArray=new Za;const t=e.json.accessors[i.TEXCOORD_0];s.texcoordArray.resize(t.count);const r=Pv(e,t);Ev(e,t,s.texcoordArray,r);}if(void 0!==i._FEATURE_ID_RGBA4444){const t=e.json.accessors[i._FEATURE_ID_RGBA4444];e.json.extensionsUsed&&e.json.extensionsUsed.includes("EXT_meshopt_compression")&&(s.featureData=Pv(e,t));}void 0!==i._FEATURE_RGBA4444&&(s.featureData=new Uint32Array(Pv(e,e.json.accessors[i._FEATURE_RGBA4444]).buffer));const h=t.material;return s.material=function(t,e){const{emissiveFactor:r=[0,0,0],alphaMode:n="OPAQUE",alphaCutoff:i=.5,normalTexture:s,occlusionTexture:a,emissiveTexture:o,doubleSided:l}=t,{baseColorFactor:u=[1,1,1,1],metallicFactor:c=1,roughnessFactor:h=1,baseColorTexture:p,metallicRoughnessTexture:f}=t.pbrMetallicRoughness||{},d=a?e[a.index]:void 0;if(a&&a.extensions&&a.extensions.KHR_texture_transform&&d){const t=a.extensions.KHR_texture_transform;d.offsetScale=[t.offset[0],t.offset[1],t.scale[0],t.scale[1]];}return {pbrMetallicRoughness:{baseColorFactor:new Se(...u),metallicFactor:c,roughnessFactor:h,baseColorTexture:p?e[p.index]:void 0,metallicRoughnessTexture:f?e[f.index]:void 0},doubleSided:l,emissiveFactor:r,alphaMode:n,alphaCutoff:i,normalTexture:s?e[s.index]:void 0,occlusionTexture:d,emissionTexture:o?e[o.index]:void 0,defined:void 0===t.defined}}(void 0!==h?e.json.materials[h]:{defined:!1},r),s}function kv(t,e,r){const{matrix:n,rotation:i,translation:s,scale:a,mesh:o,extras:l,children:u}=t,c={};if(c.matrix=n||O.mat4.fromRotationTranslationScale([],i||[0,0,0,1],s||[0,0,0],a||[1,1,1]),void 0!==o){c.meshes=r[o];const t=c.anchor=[0,0];for(const e of c.meshes){const{min:r,max:n}=e.aabb;t[0]+=r[0]+n[0],t[1]+=r[1]+n[1];}t[0]=Math.floor(t[0]/c.meshes.length/2),t[1]=Math.floor(t[1]/c.meshes.length/2);}if(l&&(l.id&&(c.id=l.id),l.lights&&(c.lights=function(t){if(!t.length)return [];const e=function(t){const e=atob(t),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.codePointAt(t);return r}(t),r=[],n=e.length/24,i=new Uint16Array(e.buffer),s=new Float32Array(e.buffer);for(let t=0;t<n;t++){const e=i[2*t*6]/30,n=i[2*t*6+1]/30,a=i[2*t*6+10]/100,o=s[6*t+1],l=s[6*t+2],u=s[6*t+3],c=s[6*t+4],h=u-o,p=c-l,f=Math.hypot(h,p);r.push({pos:[o+.5*h,l+.5*p,n],normal:[p/f,-h/f,0],width:f,height:e,depth:a,points:[o,l,u,c]});}return r}(l.lights))),u){const t=[];for(const n of u)t.push(kv(e.json.nodes[n],e,r));c.children=t;}return c}function Tv(t){if(0===t.vertices.length||0===t.indices.length)return null;const e=new Sh(t.vertices,t.indices,8,256),[r,n]=[e.min.clone(),e.max.clone()];return {vertices:t.vertices,indices:t.indices,grid:e,min:r,max:n}}function Bv(t){if(!t.extras||!t.extras.ground)return null;const e=t.extras.ground;if(!e||!Array.isArray(e)||0===e.length)return null;const r=e[0];if(!r||!Array.isArray(r)||0===r.length)return null;const n=[];for(const t of r){if(!Array.isArray(t)||2!==t.length)continue;const e=t[0],r=t[1];"number"==typeof e&&"number"==typeof r&&n.push(new q(e,r));}if(n.length<3)return null;n.length>1&&n[n.length-1].equals(n[0])&&n.pop();let i=0;for(let t=0;t<n.length;t++){const e=n[t],r=n[(t+1)%n.length],s=n[(t+2)%n.length];i+=(e.x-r.x)*(s.y-r.y)-(s.x-r.x)*(e.y-r.y);}i>0&&n.reverse();const s=vc(n.flatMap((t=>[t.x,t.y])),[]);return 0===s.length?null:{vertices:n,indices:s}}function Vv(t,e){const r=[],n=[];let i=0;const s=[];for(const a of t){i=r.length;const t=a.vertexArray.float32,o=a.indexArray.uint16;for(let n=0;n<a.vertexArray.length;n++)s[0]=t[3*n+0],s[1]=t[3*n+1],s[2]=t[3*n+2],O.vec3.transformMat4(s,s,e),r.push(new q(s[0],s[1]));for(let t=0;t<3*a.indexArray.length;t++)n.push(o[t]+i);}if(n.length%3!=0)return null;for(let t=0;t<n.length;t+=3){const e=r[n[t+0]],i=r[n[t+1]],s=r[n[t+2]];(e.x-i.x)*(s.y-i.y)-(s.x-i.x)*(e.y-i.y)>0&&([n[t+1],n[t+2]]=[n[t+2],n[t+1]]);}return {vertices:r,indices:n}}function Cv(t){const e=function(t,e){const r=[],n=WebGL2RenderingContext;if(t.json.textures)for(const i of t.json.textures){const s={magFilter:n.LINEAR,minFilter:n.NEAREST,wrapS:n.REPEAT,wrapT:n.REPEAT};void 0!==i.sampler&&Object.assign(s,t.json.samplers[i.sampler]),r.push({image:e[i.source],sampler:s,uploaded:!1});}return r}(t,t.images),r=function(t,e){const r=[];for(const n of t.json.meshes){const i=[];for(const r of n.primitives)i.push(zv(r,t,e));r.push(i);}return r}(t,e),{scenes:n,scene:i,nodes:s}=t.json,a=n?n[i||0].nodes:s,o=[];for(const e of a)o.push(kv(s[e],t,r));return function(t,e,r){const n={},i=new Set;for(let s=0;s<t.length;s++){const t=r[e[s]];if(!t.extras)continue;const a=t.extras["mapbox:footprint:version"],o=t.extras["mapbox:footprint:id"];(a||o)&&i.add(s),"1.0.0"===a&&o&&(n[o]=s);}for(let s=0;s<t.length;s++){if(i.has(s))continue;const a=t[s],o=r[e[s]];if(!o.extras)continue;let l=null;a.id in n&&(l=Vv(t[n[a.id]].meshes,a.matrix)),l||(l=Bv(o)),l&&(a.footprint=Tv(l));}if(i.size>0){const e=Array.from(i.values()).sort(((t,e)=>t-e));for(let r=e.length-1;r>=0;r--)t.splice(e[r],1);}}(o,a,t.json.nodes),o}function Dv(t){t.heightmap=new Float32Array(4096),t.heightmap.fill(-1);const e=t.vertexArray.float32,r=t.aabb.min[0]-1,n=t.aabb.min[1]-1,i=ky/(t.aabb.max[0]-r+2),s=ky/(t.aabb.max[1]-n+2);for(let a=0;a<e.length;a+=3){const o=e[a+2],l=(e[a+0]-r)*i|0,u=(e[a+1]-n)*s|0;o>t.heightmap[u*ky+l]&&(t.heightmap[u*ky+l]=o);}}function Rv(t,e){const r={};r.indexArray=new ja,r.indexArray.reserve(4*t.length),r.vertexArray=new za,r.vertexArray.reserve(10*t.length),r.colorArray=new Da,r.vertexArray.reserve(10*t.length);let n=0;for(const i of t){const t=Math.min(10,Math.max(4,1.3*i.height))*e,s=[-i.normal[1],i.normal[0],0],a=Math.min(.29,.1*i.width/i.depth),o=i.width-2*i.depth*e*(a+.01),l=O.vec3.scaleAndAdd([],i.pos,s,o/2),u=O.vec3.scaleAndAdd([],i.pos,s,-o/2),c=[l[0],l[1],l[2]+i.height],h=[u[0],u[1],u[2]+i.height],p=O.vec3.scaleAndAdd([],i.normal,s,a);O.vec3.scale(p,p,t);const f=O.vec3.scaleAndAdd([],i.normal,s,-a);O.vec3.scale(f,f,t),O.vec3.add(p,l,p),O.vec3.add(f,u,f),l[2]+=.1,u[2]+=.1,r.vertexArray.emplaceBack(p[0],p[1],p[2]),r.vertexArray.emplaceBack(f[0],f[1],f[2]),r.vertexArray.emplaceBack(l[0],l[1],l[2]),r.vertexArray.emplaceBack(u[0],u[1],u[2]),r.vertexArray.emplaceBack(c[0],c[1],c[2]),r.vertexArray.emplaceBack(h[0],h[1],h[2]),r.vertexArray.emplaceBack(l[0],l[1],l[2]),r.vertexArray.emplaceBack(u[0],u[1],u[2]),r.vertexArray.emplaceBack(p[0],p[1],p[2]),r.vertexArray.emplaceBack(f[0],f[1],f[2]);const d=o/t/2;r.colorArray.emplaceBack(-d-a,-1,d,.8),r.colorArray.emplaceBack(d+a,-1,d,.8),r.colorArray.emplaceBack(-d,0,d,1.3),r.colorArray.emplaceBack(d,0,d,1.3),r.colorArray.emplaceBack(d+a,-.8,d,.7),r.colorArray.emplaceBack(d+a,-.8,d,.7),r.colorArray.emplaceBack(0,0,d,1.3),r.colorArray.emplaceBack(0,0,d,1.3),r.colorArray.emplaceBack(d+a,-1.2,d,.8),r.colorArray.emplaceBack(d+a,-1.2,d,.8),r.indexArray.emplaceBack(6+n,4+n,8+n),r.indexArray.emplaceBack(7+n,9+n,5+n),r.indexArray.emplaceBack(0+n,1+n,2+n),r.indexArray.emplaceBack(1+n,3+n,2+n),n+=10;}const i={defined:!0,emissiveFactor:[0,0,0]},s={};return s.baseColorFactor=Se.white,i.pbrMetallicRoughness=s,r.material=i,r.aabb=new Au([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),r}class Lv{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r;}}encode(t){return this._stringToNumber[t]}decode(t){return this._numberToString[t]}}const Fv=["id","tile","layer","source","sourceLayer","state"];class Ov{constructor(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,this._z=e,this._x=r,this._y=n,this.properties=t.properties,this.id=i;}clone(){const t=new Ov(this._vectorTileFeature,this._z,this._x,this._y,this.id);return this.state&&(t.state=Object.assign({},this.state)),this.layer&&(t.layer=Object.assign({},this.layer)),this.source&&(t.source=this.source),this.sourceLayer&&(t.sourceLayer=this.sourceLayer),t}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(t){this._geometry=t;}toJSON(){const t={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const e of Fv)void 0!==this[e]&&(t[e]=this[e]);return t}}class Nv{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new os(Kr,16,0),this.featureIndexArray=new ho,this.promoteId=e,this.is3DTile=!1,this.serializedLayersCache=new Map;}insert(t,e,r,n,i,s=0,a=0){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i,s);const l=this.grid;for(let t=0;t<e.length;t++){const r=e[t],n=[1/0,1/0,-1/0,-1/0];for(let t=0;t<r.length;t++){const e=r[t];n[0]=Math.min(n[0],e.x),n[1]=Math.min(n[1],e.y),n[2]=Math.max(n[2],e.x),n[3]=Math.max(n[3],e.y);}0!==a&&(n[0]-=a,n[1]-=a,n[2]+=a,n[3]+=a),n[0]<Kr&&n[1]<Kr&&n[2]>=0&&n[3]>=0&&l.insert(o,n[0],n[1],n[2],n[3]);}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new ah.VectorTile(new Cf(this.rawTileData)).layers,this.sourceLayerCoder=new Lv(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const t in this.vtLayers)this.vtFeatures[t]=[];}return this.vtLayers}query(t,e){const{tilespaceGeometry:r,transform:n,tileTransform:i,pixelPosMatrix:s,availableImages:a}=e;this.loadVTLayers(),this.serializedLayersCache.clear();const o=r.bufferedTilespaceBounds,l=this.grid.query(o.min.x,o.min.y,o.max.x,o.max.y,((t,e,n,i)=>Xl(r.bufferedTilespaceGeometry,t,e,n,i)));l.sort(jv);let u=null;n.elevation&&l.length>0&&(u=Fy.create(n.elevation,this.tileID));const c={};let h;for(let e=0;e<l.length;e++){const o=l[e];if(o===h)continue;h=o;const p=this.featureIndexArray.get(o);let f=null;this.is3DTile?this.loadMatchingModelFeature(c,p,t,r,n):this.loadMatchingFeature(c,p,t,a,((t,e,a,o=0)=>(f||(f=Vl(t,this.tileID.canonical,i)),e.queryIntersectsFeature(r,t,a,f,this.z,n,s,u,o))));}return c}loadMatchingFeature(t,e,r,n,i){const{featureIndex:s,bucketIndex:a,sourceLayerIndex:o,layoutVertexArrayOffset:l}=e,u=this.bucketLayerIDs[a],c=r.layers,h=Object.keys(c);if(h.length&&!function(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return !0;return !1}(h,u))return;const p=r.sourceCache,f=this.sourceLayerCoder.decode(o),d=this.vtLayers[f].feature(s),m=this.getId(d,f);for(let e=0;e<u.length;e++){const r=u[e];if(!c[r])continue;const{styleLayer:a,targets:o}=c[r];let h={};void 0!==m&&(h=p.getFeatureState(a.sourceLayer,m));const f=!i||i(d,a,h,l);if(!f)continue;const y=new Ov(d,this.z,this.x,this.y,m);y.tile=this.tileID.canonical,y.state=h;let g=this.serializedLayersCache.get(r);g||(g=a.serialize(),g.id=r,this.serializedLayersCache.set(r,g)),y.source=g.source,y.sourceLayer=g["source-layer"],y.layer=nt({},g),y.layer.paint=Uv(g.paint,a.paint,d,h,n),y.layer.layout=Uv(g.layout,a.layout,d,h,n);let x=!1;for(const t of o){this.updateFeatureProperties(y,t);const{filter:e}=t;if(e)if(d.properties=y.properties,e.needGeometry){const t=Cl(d,!0);if(!e.filter(new Rs(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!e.filter(new Rs(this.tileID.overscaledZ),d))continue;x=!0,t.targetId&&this.addFeatureVariant(y,t);}x&&this.appendToResult(t,r,s,y,f);}}loadMatchingModelFeature(t,e,r,n,i){const s=this.bucketLayerIDs[0][0],a=r.layers;if(!a[s])return;const{styleLayer:o,targets:l}=a[s];if("model"!==o.type)return;const u=n.tile,c=e.featureIndex,h=u.getBucket(o);if(!(h&&h instanceof Gy))return;const p=function(t,e,r,n){const i=t.getNodesInfo()[e];if(i.hiddenByReplacement||!i.node.meshes)return;let s=Number.MAX_VALUE;const a=i.node,o=r.tile,l=n.calculatePosMatrix(o.tileID.toUnwrapped(),n.worldSize),u=i.evaluatedScale;let c=0;n.elevation&&a.elevation&&(c=a.elevation*n.elevation.exaggeration()),O.mat4.translate(l,l,[(a.anchor?a.anchor[0]:0)*(u[0]-1),(a.anchor?a.anchor[1]:0)*(u[1]-1),c]),O.mat4.scale(l,l,u);const h=r.queryGeometry,p=h.isPointQuery()?h.screenBounds:h.screenGeometry,f=function(t){const e=O.mat4.multiply([],l,t.matrix);O.mat4.multiply(e,n.expandedFarZProjMatrix,e);for(let r=0;r<t.meshes.length;++r){const i=t.meshes[r];if(r===t.lightMeshIndex)continue;const a=dy(p,n,e,i.aabb);null!=a&&(s=Math.min(a,s));}if(t.children)for(const e of t.children)f(e);};if(f(a),s===Number.MAX_VALUE)return;const d=new ul(0,0);return Zy(o.tileID.canonical,d,i.node.anchor[0],i.node.anchor[1]),{intersectionZ:s,position:d,feature:i.feature}}(h,c,n,i);if(!p)return;const{z:f,x:d,y:m}=u.tileID.canonical,{feature:y,intersectionZ:g,position:x}=p;let v={};void 0!==y.id&&(v=r.sourceCache.getFeatureState(o.sourceLayer,y.id));const b=new Ov({},f,d,m,y.id);b.tile=this.tileID.canonical,b.state=v,b.properties=y.properties,b.geometry={type:"Point",coordinates:[x.lng,x.lat]};let _=this.serializedLayersCache.get(s);_||(_=o.serialize(),_.id=s,this.serializedLayersCache.set(s,_)),b.source=_.source,b.sourceLayer=_["source-layer"],b.layer=nt({},_);let w=!1;for(const t of l){this.updateFeatureProperties(b,t);const{filter:e}=t;if(e)if(y.properties=b.properties,e.needGeometry){if(!e.filter(new Rs(this.tileID.overscaledZ),y,this.tileID.canonical))continue}else if(!e.filter(new Rs(this.tileID.overscaledZ),y))continue;w=!0,t.targetId&&this.addFeatureVariant(b,t);}w&&this.appendToResult(t,s,c,b,g);}updateFeatureProperties(t,e,r){if(e.properties){const n={};for(const i in e.properties){const s=e.properties[i].evaluate({zoom:this.z},t._vectorTileFeature,t.state,t.tile,r);null!=s&&(n[i]=s);}t.properties=n;}}addFeatureVariant(t,e,r){const n={target:e.target,namespace:e.namespace,uniqueFeatureID:e.uniqueFeatureID};e.properties&&(n.properties=t.properties),t.variants=t.variants||{},t.variants[e.targetId]=t.variants[e.targetId]||[],t.variants[e.targetId].push(n);}appendToResult(t,e,r,n,i){let s=t[e];void 0===s&&(s=t[e]=[]),s.push({featureIndex:r,feature:n,intersectionZ:i});}lookupSymbolFeatures(t,e,r,n,i){const s={};this.loadVTLayers();for(const a of t)this.loadMatchingFeature(s,{bucketIndex:e,sourceLayerIndex:r,featureIndex:a,layoutVertexArrayOffset:0},n,i);return s}loadFeature(t){const{featureIndex:e,sourceLayerIndex:r}=t;this.loadVTLayers();const n=this.sourceLayerCoder.decode(r),i=this.vtFeatures[n];if(i[e])return i[e];const s=this.vtLayers[n].feature(e);return i[e]=s,s}hasLayer(t){for(const e of this.bucketLayerIDs)for(const r of e)if(t===r)return !0;return !1}getId(t,e){let r=t.id;if(this.promoteId){const n=Array.isArray(this.promoteId)||"object"!=typeof this.promoteId?this.promoteId:this.promoteId[e];if(null!=n)if(Array.isArray(n)){if(!this.promoteIdExpression){const t=Ji(n);if("success"!==t.result){const e=t.value.map((t=>`${t.key}: ${t.message}`)).join(", ");return void pt(`Failed to create expression for promoteId: ${e}`)}this.promoteIdExpression=t.value;}this.promoteIdExpression._evaluator||(this.promoteIdExpression._evaluator=new yr),r=this.promoteIdExpression.evaluate({zoom:0},t);}else r=t.properties[n];"boolean"==typeof r&&(r=Number(r));}return r}}function Uv(t,e,r,n,i){return lt(t,((t,s)=>{const a=e instanceof $s?e.get(s):null;return a&&a.evaluate?a.evaluate(r,n,i):a}))}function jv(t,e){return e-t}us(Nv,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const qv=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class $v{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,r]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const n=r>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=qv[15&r];if(!i)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new $v(a,s,i,t)}constructor(t,e=64,r=Float64Array,n){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=qv.indexOf(this.ArrayType),s=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+o,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+s+a+o),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+o,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t);}add(t,e){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=e,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Gv(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:s,nodeSize:a}=this,o=[0,i.length-1,0],l=[];for(;o.length;){const u=o.pop()||0,c=o.pop()||0,h=o.pop()||0;if(c-h<=a){for(let a=h;a<=c;a++){const o=s[2*a],u=s[2*a+1];o>=t&&o<=r&&u>=e&&u<=n&&l.push(i[a]);}continue}const p=h+c>>1,f=s[2*p],d=s[2*p+1];f>=t&&f<=r&&d>=e&&d<=n&&l.push(i[p]),(0===u?t<=f:e<=d)&&(o.push(h),o.push(p-1),o.push(1-u)),(0===u?r>=f:n>=d)&&(o.push(p+1),o.push(c),o.push(1-u));}return l}within(t,e,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:s}=this,a=[0,n.length-1,0],o=[],l=r*r;for(;a.length;){const u=a.pop()||0,c=a.pop()||0,h=a.pop()||0;if(c-h<=s){for(let r=h;r<=c;r++)Zv(i[2*r],i[2*r+1],t,e)<=l&&o.push(n[r]);continue}const p=h+c>>1,f=i[2*p],d=i[2*p+1];Zv(f,d,t,e)<=l&&o.push(n[p]),(0===u?t-r<=f:e-r<=d)&&(a.push(h),a.push(p-1),a.push(1-u)),(0===u?t+r>=f:e+r>=d)&&(a.push(p+1),a.push(c),a.push(1-u));}return o}}function Gv(t,e,r,n,i,s){if(i-n<=r)return;const a=n+i>>1;Yv(t,e,a,n,i,s),Gv(t,e,r,n,a-1,1-s),Gv(t,e,r,a+1,i,1-s);}function Yv(t,e,r,n,i,s){for(;i>n;){if(i-n>600){const a=i-n+1,o=r-n+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(o-a/2<0?-1:1);Yv(t,e,r,Math.max(n,Math.floor(r-o*u/a+c)),Math.min(i,Math.floor(r+(a-o)*u/a+c)),s);}const a=e[2*r+s];let o=n,l=i;for(Hv(t,e,n,r),e[2*i+s]>a&&Hv(t,e,n,i);o<l;){for(Hv(t,e,o,l),o++,l--;e[2*o+s]<a;)o++;for(;e[2*l+s]>a;)l--;}e[2*n+s]===a?Hv(t,e,n,l):(l++,Hv(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1);}}function Hv(t,e,r,n){Xv(t,r,n),Xv(e,2*r,2*n),Xv(e,2*r+1,2*n+1);}function Xv(t,e,r){const n=t[e];t[e]=t[r],t[r]=n;}function Zv(t,e,r,n){const i=t-r,s=e-n;return i*i+s*s}t.$=gr,t.A=ge,t.B=tr,t.C=pa,t.D=ng,t.E=_e,t.F=2,t.G=pd,t.H=cd,t.I=we,t.J=class extends My{},t.K=pr,t.L=Be,t.M=Ws,t.N=Ui,t.O=Fi,t.P=q,t.Q=Ni,t.R=Qt,t.S=Ki,t.T=qm,t.U=Ks,t.V=My,t.W=es,t.X=Ji,t.Y=Vn,t.Z=Dn,t._=Bn,t.a=function(t){return At.API_CDN_URL_REGEX.test(t)},t.a$=Cl,t.a0=Ie,t.a1=Js,t.a2=ji,t.a3=Oi,t.a4=function(t){const e=t.value;let r=[];if(!e)return r;const n=pr(e);return "string"!==n?(r=r.concat([new My(t.key,e,`string expected, "${n}" found`)]),r):(Ay(e,!0)||(r=r.concat([new My(t.key,e,`invalid url "${e}"`)])),r)},t.a5=Zs,t.a6=Os,t.a7=Xs,t.a8=Gs,t.a9=class{constructor(t){this.specification=t;}possiblyEvaluate(t,e){return mt(t.expression.evaluate(e))}interpolate(t,e,r){return {x:Ee(t.x,e.x,r),y:Ee(t.y,e.y,r),z:Ee(t.z,e.z,r),azimuthal:Ee(t.azimuthal,e.azimuthal,r),polar:Ee(t.polar,e.polar,r)}}},t.aA=function(t,e){const r={};for(let n=0;n<e.length;n++){const i=e[n];i in t&&(r[i]=t[i]);}return r},t.aB=cl,t.aC=ml,t.aD=class{constructor(t){this.entries={},this.scheduler=t;}request(t,e,r,n){const i=this.entries[t]=this.entries[t]||{callbacks:[]};if(i.result){const[t,r]=i.result;return this.scheduler?this.scheduler.add((()=>{n(t,r);}),e):n(t,r),()=>{}}return i.callbacks.push(n),i.cancel||(i.cancel=r(((r,n)=>{i.result=[r,n];for(const t of i.callbacks)this.scheduler?this.scheduler.add((()=>{t(r,n);}),e):t(r,n);setTimeout((()=>delete this.entries[t]),3e3);}))),()=>{i.result||(i.callbacks=i.callbacks.filter((t=>t!==n)),i.callbacks.length||(i.cancel(),delete this.entries[t]));}}},t.aE=function(t,e,r){const n=JSON.stringify(t.request);return t.data&&(this.deduped.entries[n]={result:[null,t.data]}),this.deduped.request(n,{type:"parseTile",isSymbolTile:t.isSymbolTile,zoom:t.tileZoom},(e=>{const n=ne(t.request,((t,n,i,s)=>{t?e(t):n&&e(null,{vectorTile:r?void 0:new ah.VectorTile(new Cf(n)),rawData:n,cacheControl:i,expires:s});}));return ()=>{n.cancel(),e();}}),e)},t.aF=function(t){Gt++,Gt>Ot&&(t.getActor().send("enforceCacheSizeLimit",Ft),Gt=0);},t.aG=function(t){return t<=1?1:Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},t.aH=uu,t.aI=Wm,t.aJ=ry,t.aK=Xm,t.aL=function(t,e){const r=document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r);};for(let e=0;e<t.length;e++){const n=document.createElement("source");ie(t[e])||(r.crossOrigin="Anonymous"),n.src=t[e],r.appendChild(n);}return {cancel:()=>{}}},t.aM=$m,t.aN=function(t){return fetch(t).then((t=>t.arrayBuffer())).then((e=>Sv(e,0,t)))},t.aO=Cv,t.aP=class{constructor(t,e,r,n){this.id=t,this.position=null!=e?new ul(e[0],e[1]):new ul(0,0),this.orientation=null!=r?r:[0,0,0],this.nodes=n,this.uploaded=!1,this.aabb=new Au([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[];}_applyTransformations(t,e){if(O.mat4.multiply(t.matrix,e,t.matrix),t.meshes)for(const e of t.meshes){const r=Au.applyTransformFast(e.aabb,t.matrix);this.aabb.encapsulate(r);}if(t.children)for(const e of t.children)this._applyTransformations(e,t.matrix);}computeBoundsAndApplyParent(){const t=O.mat4.identity([]);for(const e of this.nodes)this._applyTransformations(e,t);}computeModelMatrix(t,e,r,n,i,s,a=!1){By(this.matrix,this,t.transform,this.position,e,r,n,i,s,a);}upload(t){if(!this.uploaded){for(const e of this.nodes)Dy(e,t);for(const t of this.nodes)Ry(t);this.uploaded=!0;}}destroy(){for(const t of this.nodes)Ly(t);}},t.aQ=ot,t.aR=Kd,t.aS=gl,t.aT=xl,t.aU=Ma,t.aV=ja,t.aW=st,t.aX=no,t.aY=zm,t.aZ=function(){Ds.isLoading()||Ds.isLoaded()||"deferred"!==Vs()||Cs();},t.a_=Qs,t.aa=Rs,t.ab=ts,t.ac=Il,t.ad=O,t.ae=tt,t.af=$s,t.ag=$u,t.ah=Ee,t.ai=Kr,t.aj=ze,t.ak=H,t.al=Se,t.am=class{constructor(t){this.specification=t;}possiblyEvaluate(t,e){return function([t,e]){const r=mt([1,t,e]);return {x:r.x,y:r.y,z:r.z}}(t.expression.evaluate(e))}interpolate(t,e,r){return {x:Ee(t.x,e.x,r),y:Ee(t.y,e.y,r),z:Ee(t.z,e.z,r)}}},t.an=function(t,e,r=0,n=!0){const i=new q(r,r),s=t.sub(i),a=e.add(i),o=[s,new q(a.x,s.y),a,new q(s.x,a.y)];return n&&o.push(s.clone()),o},t.ao=function(t,e){const r=[];for(let n=0;n<t.length;n++){const i=et(n-1,-1,t.length-1),s=et(n+1,-1,t.length-1),a=t[n],o=t[s],l=t[i].sub(a).unit(),u=o.sub(a).unit(),c=u.angleWithSep(l.x,l.y),h=l.add(u).unit().mult(-1*e/Math.sin(c/2));r.push(a.add(h));}return r},t.ap=Jd,t.aq=Xl,t.ar=function(t,e,r=0){return O.vec3.fromValues(((e.x-r)*t.scale-t.x)*Kr,(e.y*t.scale-t.y)*Kr,vl(e.z,e.y))},t.as=gu,t.at=Wp,t.au=function(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const s of t)e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);return {min:new q(e,r),max:new q(n,i)}},t.av=dl,t.aw=Hl,t.ax=Pl,t.ay=Q,t.az=Ko,t.b=function(t){return At.API_FONTS_REGEX.test(t)},t.b$=oy,t.b0=Ov,t.b1=gt,t.b2=Yp,t.b3=_h,t.b4=Vl,t.b5=_a,t.b6=Ka,t.b7=mu,t.b8=xo,t.b9=vc,t.bA=Jh,t.bB=Nd,t.bC=Cd,t.bD=Kf,t.bE=$v,t.bF=et,t.bG=vt,t.bH=yl,t.bI=function(t,e,r){t[4*e+0]=r[0],t[4*e+1]=r[1],t[4*e+2]=r[2],t[4*e+3]=r[3];},t.bJ=Co,t.bK=zo,t.bL=ko,t.bM=Eo,t.bN=Po,t.bO=ul,t.bP=vm,t.bQ=lu,t.bR=Mu,t.bS=ay,t.bT=ou,t.bU=Vu,t.bV=function(t,e,r,n,i,s,a,o,l){if("globe"===l.name)return Vu(t,e,new ou(r,n,i),!1);const u=Kd({z:r,x:n,y:i},l);return new Au([(s+u.x/u.scale)*e,e*(u.y/u.scale),a],[(s+u.x2/u.scale)*e,e*(u.y2/u.scale),o])},t.bW=function(t,e,r){let n=0;for(let r=0;r<2;++r){const i=0;t[r]>i&&(n+=(t[r]-i)*(t[r]-i)),e[r]<i&&(n+=(i-e[r])*(i-e[r]));}return n},t.bX=bl,t.bY=Qo,t.bZ=function(t){const e=O.mat4.identity(new Float64Array(16));O.mat4.multiply(e,t.pixelMatrix,t.globeMatrix);const r=[0,nl,0],n=[0,il,0];return O.vec3.transformMat4(r,r,e),O.vec3.transformMat4(n,n,e),[r[0]>0&&r[0]<=t.width&&r[1]>0&&r[1]<=t.height&&!Yu(t,new ul(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!Yu(t,new ul(t.center.lat,-90))]},t.b_=function(t,e){const{scale:r}=t.tileTransform,n=r*Kr/(t.tileSize*Math.pow(2,e.zoom-t.tileID.overscaledZ+t.tileID.canonical.z));return O.mat2.scale(new Float32Array(4),e.inverseAdjustmentMatrix,[n,n])},t.ba=Nm,t.bb=function(t,e){const r=$u(e.zoom);if(0===r)return ku(t);const n=Cu(t),i=Du(n),s=dl(n.getWest())*e.worldSize,a=dl(n.getEast())*e.worldSize,o=ml(n.getNorth())*e.worldSize,l=ml(n.getSouth())*e.worldSize,u=[s,o,0],c=[a,o,0],h=[s,l,0],p=[a,l,0],f=O.mat4.invert([],e.globeMatrix);return O.vec3.transformMat4(u,u,f),O.vec3.transformMat4(c,c,f),O.vec3.transformMat4(h,h,f),O.vec3.transformMat4(p,p,f),i[0]=Tu(i[0],h,r),i[1]=Tu(i[1],p,r),i[2]=Tu(i[2],c,r),i[3]=Tu(i[3],u,r),Au.fromPoints(i)},t.bc=Ou,t.bd=Ru,t.be=Tu,t.bf=wa,t.bg=du,t.bh=ev,t.bi=Cf,t.bj=ne,t.bk=function(t,e){const r=[];for(const n in t)n in e||r.push(n);return r},t.bl=rt,t.bm=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.bn=$,t.bo=function(t,e){const{x:r,y:n}=t.point,i=qu(r,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return O.mat4.multiply(i,i,Nu(ku(e)))},t.bp=wf,t.bq=Nf,t.br=_f,t.bs=function(t,e,r,n,i){const s=5*e+2;t.float32[s+0]=r,t.float32[s+1]=n,t.float32[s+2]=i;},t.bt=Im,t.bu=ud,t.bv=Fl,t.bw=gf,t.bx=jh,t.by=wy,t.bz=Kh,t.c=St,t.c$=tf,t.c0=sy,t.c1=function(t){const e=sy(t,!0);return O.mat2.invert([],[e[0],e[1],e[4],e[5]])},t.c2=xu,t.c3=function(t){const{x:e,y:r}=t.point,{lng:n,lat:i}=t._center;return qu(e,r,t.worldSize,n,i)},t.c4=X,t.c5=cu,t.c6=Jo,t.c7=function(t){const e=Math.round((t+45+360)%360/90)%4;return Z[e]},t.c8=45,t.c9=ke,t.cA=Bo,t.cB=class extends So{constructor(t){super(t),this.current=Do;}set(t,e,r){if(this.fetchUniformLocation(t,e))for(let t=0;t<9;t++)if(r[t]!==this.current[t]){this.current=r,this.gl.uniformMatrix3fv(this.location,!1,r);break}}},t.cC=W,t.cD=function(t,e,r){const n=$u(r.zoom),i=t.style.map._antialias,s=t.terrain&&t.terrain.exaggeration()>0;return 0===n&&!i&&!s},t.cE=function(t){const e=t.pixelsPerMeter,r=e/yl(1,t.center.lat),n=O.mat4.identity(new Float64Array(16));return O.mat4.translate(n,n,[t.point.x,t.point.y,0]),O.mat4.scale(n,n,[r,r,e]),Float32Array.from(n)},t.cF=Cu,t.cG=function(t){const e=bl-5;t=Q(t,-e,e)/e*90;const r=Math.pow(Math.abs(Math.sin(H(t))),3);return Math.round(r*(rl.length-1))},t.cH=function(t,e,r,n){const i=e.getNorth(),s=e.getSouth(),a=e.getWest(),o=e.getEast(),l=1<<t.z,u=o-a,c=i-s,h=u/el,p=-c/rl[r],f=[0,h,0,p,0,0,i,a,0];if(t.z>0){const t=180/n;O.mat3.multiply(f,f,[t/u+1,0,0,0,t/c+1,0,-.5*t/h,.5*t/p,1]);}return f[2]=l,f[5]=t.x,f[8]=t.y,f},t.cI=ku,t.cJ=function(t,e,r){const n=O.mat4.identity(new Float64Array(16)),i=(e/(1<<t)-.5)*Math.PI*2;return O.mat4.rotateY(n,r.globeMatrix,i),Float32Array.from(n)},t.cK=class{isDataAvailableAtPoint(t){const e=this._source();if(this.isUsingMockSource()||!e||t.y<0||t.y>1)return !1;const r=e.getSource().maxzoom,n=1<<r,i=Math.floor(t.x),s=Math.floor((t.x-i)*n),a=Math.floor(t.y*n),o=this.findDEMTileFor(new uu(r,i,r,s,a));return !(!o||!o.dem)}getAtPointOrZero(t,e=0){return this.getAtPoint(t,e)||0}getAtPoint(t,e,r=!0){if(this.isUsingMockSource())return null;null==e&&(e=null);const n=this._source();if(!n)return e;if(t.y<0||t.y>1)return e;const i=n.getSource().maxzoom,s=1<<i,a=Math.floor(t.x),o=t.x-a,l=new uu(i,a,i,Math.floor(o*s),Math.floor(t.y*s)),u=this.findDEMTileFor(l);if(!u||!u.dem)return e;const c=u.dem,h=1<<u.tileID.canonical.z,p=(o*h-u.tileID.canonical.x)*c.dim,f=(t.y*h-u.tileID.canonical.y)*c.dim,d=Math.floor(p),m=Math.floor(f);return (r?this.exaggeration():1)*Ee(Ee(c.get(d,m),c.get(d,m+1),f-m),Ee(c.get(d+1,m),c.get(d+1,m+1),f-m),p-d)}getAtTileOffset(t,e,r){const n=1<<t.canonical.z;return this.getAtPointOrZero(new Il(t.wrap+(t.canonical.x+e/Kr)/n,(t.canonical.y+r/Kr)/n))}getAtTileOffsetFunc(t,e,r,n){return i=>{const s=this.getAtTileOffset(t,i.x,i.y),a=n.upVector(t.canonical,i.x,i.y),o=n.upVectorScale(t.canonical,e,r).metersToTile;return O.vec3.scale(a,a,s*o),a}}getForTilePoints(t,e,r,n){if(this.isUsingMockSource())return !1;const i=Fy.create(this,t,n);return !!i&&(e.forEach((t=>{t[2]=this.exaggeration()*i.getElevationAt(t[0],t[1],r);})),!0)}getMinMaxForTile(t){if(this.isUsingMockSource())return null;const e=this.findDEMTileFor(t);if(!e||!e.dem)return null;const r=e.dem.tree,n=e.tileID,i=1<<t.canonical.z-n.canonical.z;let s=t.canonical.x/i-n.canonical.x,a=t.canonical.y/i-n.canonical.y,o=0;for(let e=0;e<t.canonical.z-n.canonical.z&&!r.leaves[o];e++){s*=2,a*=2;const t=2*Math.floor(a)+Math.floor(s);o=r.childOffsets[o]+t,s%=1,a%=1;}return {min:this.exaggeration()*r.minimums[o],max:this.exaggeration()*r.maximums[o]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(t,e,r){throw new Error("Pure virtual method called.")}pointCoordinate(t){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(t){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}getMinMaxForVisibleTiles(){const t=this.visibleDemTiles;if(0===t.length)return null;let e=!1,r=Number.MAX_VALUE,n=Number.MIN_VALUE;for(const i of t){const t=this.getMinMaxForTile(i.tileID);t&&(r=Math.min(r,t.min),n=Math.max(n,t.max),e=!0);}return e?{min:r,max:n}:null}},t.cL=fc,t.cM=Iu,t.cN=function(t,e){return [Math.pow(t[0],2.2)*e,Math.pow(t[1],2.2)*e,Math.pow(t[2],2.2)*e]},t.cO=ju,t.cP=Mt,t.cQ=wt,t.cR=256,t.cS=function(t,e){const r=[0,0,0],n=Ou(ku(e.canonical));return O.vec3.transformMat4(r,r,n),O.vec3.transformMat4(r,r,t),r},t.cT=t=>({u_camera_to_center_distance:new Eo(t),u_extrude_scale:new Lo(t),u_device_pixel_ratio:new Eo(t),u_matrix:new Co(t),u_inv_rot_matrix:new Co(t),u_merc_center:new zo(t),u_tile_id:new ko(t),u_zoom_transition:new Eo(t),u_up_dir:new ko(t),u_emissive_strength:new Eo(t)}),t.cU=t=>({u_matrix:new Co(t),u_pixels_to_tile_units:new Lo(t),u_device_pixel_ratio:new Eo(t),u_width_scale:new Eo(t),u_floor_width_scale:new Eo(t),u_units_to_pixels:new zo(t),u_dash_image:new Po(t),u_gradient_image:new Po(t),u_image_height:new Eo(t),u_texsize:new zo(t),u_tile_units_to_pixels:new Eo(t),u_alpha_discard_threshold:new Eo(t),u_trim_offset:new zo(t),u_trim_fade_range:new zo(t),u_trim_color:new To(t),u_emissive_strength:new Eo(t),u_zbias_factor:new Eo(t),u_tile_to_meter:new Eo(t)}),t.cV=t=>({u_matrix:new Co(t),u_texsize:new zo(t),u_pixels_to_tile_units:new Lo(t),u_device_pixel_ratio:new Eo(t),u_width_scale:new Eo(t),u_floor_width_scale:new Eo(t),u_image:new Po(t),u_units_to_pixels:new zo(t),u_tile_units_to_pixels:new Eo(t),u_alpha_discard_threshold:new Eo(t),u_trim_offset:new zo(t),u_trim_fade_range:new zo(t),u_trim_color:new To(t),u_emissive_strength:new Eo(t),u_zbias_factor:new Eo(t),u_tile_to_meter:new Eo(t)}),t.cW=Na,t.cX=yf,t.cY=Mf,t.cZ=Ku,t.c_=(t,e,r,n,i,s)=>{const a=t.transform,o="globe"===a.projection.name;let l;if("map"===s.paint.get("circle-pitch-alignment"))if(o){const t=ju(a.zoom,e.canonical)*a._pixelsPerMercatorPixel;l=Float32Array.from([t,0,0,t]);}else l=a.calculatePixelsToTileUnitsMatrix(r);else l=new Float32Array([a.pixelsToGLUnits[0],0,0,a.pixelsToGLUnits[1]]);const u={u_camera_to_center_distance:t.transform.getCameraToCenterDistance(a.projection),u_matrix:t.translatePosMatrix(e.projMatrix,r,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_device_pixel_ratio:Ct.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:Wu,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:s.paint.get("circle-emissive-strength")};if(o){u.u_inv_rot_matrix=n,u.u_merc_center=i,u.u_tile_id=[e.canonical.x,e.canonical.y,1<<e.canonical.z],u.u_zoom_transition=$u(a.zoom);const t=i[0]*Kr,r=i[1]*Kr;u.u_up_dir=a.projection.upVector(new ou(0,0,0),t,r);}return u},t.ca=fl,t.cb=To,t.cc=function(t,e,r){const n=Math.sqrt(t*t+e*e+r*r),i=n>0?Math.acos(r/n)*Y:0;let s=0!==t||0!==e?Math.atan2(-e,-t)*Y+90:0;return s<0&&(s+=360),[n,s,i]},t.cd=Al,t.ce=Au,t.cf=mt,t.cg=function(t){return [Math.pow(t[0],1/2.2),Math.pow(t[1],1/2.2),Math.pow(t[2],1/2.2)]},t.ch=function(t,e){return t.readFields(dg,{icons:[]},e)},t.ci=function(t){return t({pluginStatus:Es,pluginURL:zs}),Bs.on("pluginStateChange",t),t},t.cj=ag,t.ck=bd,t.cl=vd,t.cm=ee,t.cn=ks,t.co=Rt,t.cp=ye,t.cq=ct,t.cr=function(t){const e=t.indexOf(ha);return e>=0?t.slice(0,e):t},t.cs=function(t){return t.indexOf(ha)>=0},t.ct=function(t){const e=t.indexOf(ha);return e>=0?t.slice(e+1):""},t.cu=function(t){const e=[],r=t.id;return void 0===r&&e.push({message:`layers.${r}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${r}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},t.cv=function(t,e,r,n){return "custom"===t.type?new ny(t,e):new Wy[t.type](t,e,r,n)},t.cw=ut,t.cx=class extends Ov{constructor(t,e){super(t._vectorTileFeature,t._z,t._x,t._y,t.id),t.state&&(this.state=Object.assign({},t.state)),this.target=e.target,this.namespace=e.namespace,e.properties&&(this.properties=e.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=t.source,this.sourceLayer=t.sourceLayer,this.layer=t.layer);}toJSON(){const t=super.toJSON();return t.target=this.target,t.namespace=this.namespace,t}},t.cy=Bs,t.cz=re,t.d=function(t){return At.API_TILEJSON_REGEX.test(t)},t.d$=Lv,t.d0=er,t.d1=(t,e,r,n,i,s,a,o)=>{const l=t.transform,u=l.pitch<15?Kp(.07,.7,Q((14-l.zoom)/5,0,1)):.07,c="none"===r.paint.get("line-trim-color-use-theme").constantOr("default");return {u_matrix:Qp(t,e,r,n),u_texsize:e.imageAtlasTexture?e.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:l.calculatePixelsToTileUnitsMatrix(e),u_device_pixel_ratio:i,u_width_scale:s,u_floor_width_scale:a,u_image:0,u_tile_units_to_pixels:Jp(e,l),u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:o,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_color:r.paint.get("line-trim-color").toRenderColor(c?null:r.lut).toArray01(),u_emissive_strength:r.paint.get("line-emissive-strength"),u_zbias_factor:u,u_tile_to_meter:Al(e.tileID.canonical,0)}},t.d2=(t,e,r,n,i,s,a,o,l)=>{const u=t.transform,c=u.calculatePixelsToTileUnitsMatrix(e),h="none"===r.paint.get("line-trim-color-use-theme").constantOr("default"),p=u.pitch<15?Kp(.07,.7,Q((14-u.zoom)/5,0,1)):.07;return {u_matrix:Qp(t,e,r,n),u_pixels_to_tile_units:c,u_device_pixel_ratio:s,u_width_scale:a,u_floor_width_scale:o,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:i,u_texsize:ef(r)&&e.lineAtlasTexture?e.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Jp(e,t.transform),u_alpha_discard_threshold:0,u_trim_offset:l,u_trim_fade_range:r.paint.get("line-trim-fade-range"),u_trim_color:r.paint.get("line-trim-color").toRenderColor(h?null:r.lut).toArray01(),u_emissive_strength:r.paint.get("line-emissive-strength"),u_zbias_factor:p,u_tile_to_meter:Al(e.tileID.canonical,0)}},t.d3=at,t.d4=dc,t.d5=vl,t.d6=Pp,t.d7=hu,t.d8=vp,t.d9=op,t.dA=Uh,t.dB=K,t.dC=function(){return !!document.fullscreenElement||!!document.webkitFullscreenElement},t.dD=J,t.dE=Ml,t.dF=al,t.dG=function([t,e,r]){const n=Math.hypot(t,e,r),i=Math.atan2(t,r),s=.5*Math.PI-Math.acos(-e/n);return new ul(X(i),X(s))},t.dH=uy,t.dI=function(t){const e=t.navigator?t.navigator.userAgent:null;return !!function(t){if(null==xt){const e=t.navigator?t.navigator.userAgent:null;xt=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")));}return xt}(t)&&e&&(e.match("Version/15.4")||e.match("Version/15.5")||e.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},t.dJ=function(t,e){Ft=t,Ot=e;},t.dK=Yu,t.dL=Gu,t.dM=function(t){const e=[0,0,0],r=O.mat4.identity(new Float64Array(16));return O.mat4.multiply(r,t.pixelMatrix,t.globeMatrix),O.vec3.transformMat4(e,e,r),new q(e[0],e[1])},t.dN=function(t,e,r=!1){if(Es===As||Es===Is||Es===Ss)throw new Error("setRTLTextPlugin cannot be called multiple times.");zs=Ct.resolveURL(t),Es=As,Ps=e,Ts(),r||Cs();},t.dO=Vs,t.dP=function(){ag().acquire(eg);},t.dQ=function(){const t=ig;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(eg),ig=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()"));},t.dR=rg,t.dS=function(t){const e=qt();if(!e)return;const r=e.delete(Lt);t&&r.catch(t).then((()=>t()));},t.dT=tg,t.dU=cv,t.dV=function(t){sv=Ct.resolveURL(t),uv||(uv=new ng(ag(),new _e)),uv.broadcast("setDracoUrl",sv);},t.dW=hv,t.dX=function(t){ov=Ct.resolveURL(t),uv||(uv=new ng(ag(),new _e)),uv.broadcast("setMeshoptUrl",ov);},t.dY=us,t.dZ=hc,t.d_=xd,t.da=450,t.db=7,t.dc=Zm,t.dd=va,t.de=to,t.df=256,t.dg=Nu,t.dh=za,t.di=Ga,t.dj=Ya,t.dk=function(t,e,r,n,i){return Q((t-e)/(r-e)*(i-n)+n,n,i)},t.dl=Ei,t.dm=wl,t.dn=class{constructor(t,e,r,n){this.context=t,this.format=n,this.size=r,this.texture=t.gl.createTexture();const[i,s,a]=this.size,{gl:o}=t;o.bindTexture(o.TEXTURE_3D,this.texture),t.pixelStoreUnpackFlipY.set(!1),t.pixelStoreUnpack.set(1),t.pixelStoreUnpackPremultiplyAlpha.set(!1),o.texImage3D(o.TEXTURE_3D,0,this.format,i,s,a,0,Um(this.format),jm(this.format),e.data);}bind(t,e){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_3D,this.texture),t!==this.minFilter&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_MIN_FILTER,t),this.minFilter=t),e!==this.wrapS&&(n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_3D,n.TEXTURE_WRAP_T,e),this.wrapS=e);}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null;}},t.dp=fy,t.dq=[1,1,1],t.dr=Fy,t.ds=Ty,t.dt=La,t.du=Za,t.dv=ol,t.dw=Xa,t.dx=Ha,t.dy=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new q(1/0,1/0),max:new q(-1/0,-1/0)};}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[];}get updateTime(){return this._updateTime}getReplacementRegionsForTile(t,e=!1){const r=Hh(new q(0,0),new q(Kr,Kr),t),n=[];if(e&&!Gh(r,this._globalClipBounds))return n;for(const e of this._activeRegions){if(e.hiddenByOverlap)continue;if(!Gh(r,e))continue;const i=Xh(e.min,e.max,t);n.push({min:i.min,max:i.max,sourceId:this._sourceIds[e.priority],footprint:e.footprint,footprintTileId:e.tileId,order:e.order,clipMask:e.clipMask,clipScope:e.clipScope});}return n}setSources(t){this._setSources(t.map((t=>({getSourceId:()=>t.cache.id,getFootprints:()=>{const e=[];for(const r of t.cache.getVisibleCoordinates()){const n=t.cache.getTile(r).buckets[t.layer];n&&n.updateFootprints(r.toUnwrapped(),e);}return e},getOrder:()=>t.order,getClipMask:()=>t.clipMask,getClipScope:()=>t.clipScope}))));}_addSource(t){const e=t.getFootprints();if(0===e.length)return;const r=t.getOrder(),n=t.getClipMask(),i=t.getClipScope();for(const t of e){if(!t.footprint)continue;const e=Hh(t.footprint.min,t.footprint.max,t.id);this._activeRegions.push({min:e.min,max:e.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:t.id,footprint:t.footprint,order:r,clipMask:n,clipScope:i});}this._sourceIds.push(t.getSourceId());}_computeReplacement(){this._activeRegions.sort(((t,e)=>t.priority-e.priority||qh(t.min,e.min)||qh(t.max,e.max)||t.order-e.order||t.clipMask-e.clipMask||function(t,e){const r=(t,e)=>t+e;return t.length-e.length||t.reduce(r,"").localeCompare(e.reduce(r,""))}(t.clipScope,e.clipScope)));let t=this._activeRegions.length!==this._prevRegions.length;if(!t){let e=0;for(;!t&&e!==this._activeRegions.length;){const r=this._activeRegions[e],n=this._prevRegions[e];t=r.priority!==n.priority||!$h(r,n)||r.order!==n.order||r.clipMask!==n.clipMask||!$(r.clipScope,n.clipScope),++e;}}if(t){++this._updateTime;for(const t of this._activeRegions)t.order!==Uh&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,t.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,t.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,t.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,t.max.y));const t=t=>{const e=this._activeRegions;if(t>=e.length)return t;const r=e[t].priority;for(;t<e.length&&e[t].priority===r;)++t;return t};if(this._sourceIds.length>1){let e=0,r=t(e);for(;e!==r;){let n=e;const i=e;for(;n!==r;){const t=this._activeRegions[n];t.hiddenByOverlap=!1;for(let e=0;e<i;e++){const r=this._activeRegions[e];if(!r.hiddenByOverlap&&t.order===Uh&&Gh(t,r)&&(t.hiddenByOverlap=Wh(t.footprint,t.tileId,r.footprint,r.tileId),t.hiddenByOverlap))break}++n;}e=r,r=t(e);}}}}_setSources(t){[this._prevRegions,this._activeRegions]=[this._activeRegions,[]],this._sourceIds=[];for(let e=t.length-1;e>=0;e--)this._addSource(t[e]);this._computeReplacement();}},t.dz=class{constructor(t){this._createGrid(t),this._createPoles(t);}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const t of this._poleSegments)t.destroy();for(const t of this._gridSegments)t.withSkirts.destroy(),t.withoutSkirts.destroy();}_fillGridMeshWithLods(t,e){const r=new _a,n=new ja,i=[],s=t+1+2,a=e[0]+1,o=e[0]+1+(1+e.length),l=(t,e,r)=>{let n=t===s-1?t-2:0===t?t:t-1;return n+=r?24575:0,[n,e]};for(let t=0;t<s;++t)r.emplaceBack(...l(t,0,!0));for(let t=0;t<a;++t)for(let e=0;e<s;++e)r.emplaceBack(...l(e,t,(0===e||e===s-1)&&!0));for(let t=0;t<e.length;++t){const n=e[t];for(let t=0;t<s;++t)r.emplaceBack(...l(t,n,!0));}for(let t=0;t<e.length;++t){const a=n.length,l=e[t]+1+2,u=new ja;for(let r=0;r<l-1;r++){const i=r===l-2,a=i?s*(o-e.length+t-r):s;for(let t=0;t<s-1;t++){const e=r*s+t;0===r||i||0===t||t===s-2?(u.emplaceBack(e+1,e,e+a),u.emplaceBack(e+a,e+a+1,e+1)):(n.emplaceBack(e+1,e,e+a),n.emplaceBack(e+a,e+a+1,e+1));}}const c=xo.simpleSegment(0,a,r.length,n.length-a);for(let t=0;t<u.uint16.length;t+=3)n.emplaceBack(u.uint16[t],u.uint16[t+1],u.uint16[t+2]);const h=xo.simpleSegment(0,a,r.length,n.length-a);i.push({withoutSkirts:c,withSkirts:h});}return {vertices:r,indices:n,segments:i}}_createGrid(t){const e=this._fillGridMeshWithLods(el,rl);this._gridSegments=e.segments,this._gridBuffer=t.createVertexBuffer(e.vertices,mu.members),this._gridIndexBuffer=t.createIndexBuffer(e.indices,!0);}_createPoles(t){const e=new ja;for(let t=0;t<=el;t++)e.emplaceBack(0,t+1,t+2);this._poleIndexBuffer=t.createIndexBuffer(e,!0);const r=new Ga,n=new Ga,i=new Ga,s=new Ga;this._poleSegments=[];for(let t=0,e=0;t<Jo;t++){const a=360/(1<<t);r.emplaceBack(0,-Ko,0,.5,0),n.emplaceBack(0,-Ko,0,.5,1),i.emplaceBack(0,-Ko,0,.5,.5),s.emplaceBack(0,-Ko,0,.5,.5);for(let t=0;t<=el;t++){let e=t/el,o=0;const l=Ee(0,a,e),[u,c,h]=sl(Xu,Zu,l,Ko);r.emplaceBack(u,c,h,e,o),n.emplaceBack(u,c,h,e,1-o);const p=H(l);e=.5+.5*Math.sin(p),o=.5+.5*Math.cos(p),i.emplaceBack(u,c,h,e,o),s.emplaceBack(u,c,h,e,1-o);}this._poleSegments.push(xo.simpleSegment(e,0,66,64)),e+=66;}this._poleNorthVertexBuffer=t.createVertexBuffer(r,fu,!1),this._poleSouthVertexBuffer=t.createVertexBuffer(n,fu,!1),this._texturedPoleNorthVertexBuffer=t.createVertexBuffer(i,fu,!1),this._texturedPoleSouthVertexBuffer=t.createVertexBuffer(s,fu,!1);}getGridBuffers(t,e){return [this._gridBuffer,this._gridIndexBuffer,e?this._gridSegments[t].withSkirts:this._gridSegments[t].withoutSkirts]}getPoleBuffers(t,e){return [e?this._texturedPoleNorthVertexBuffer:this._poleNorthVertexBuffer,e?this._texturedPoleSouthVertexBuffer:this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[t]]}},t.e=At,t.e0=Nv,t.e1=jp,t.e2=oh,t.e3="hd_road_elevation",t.e4=class{static parseFrom(t,e){const r=fh.parse(t);if(!r)return [];let{vertices:n,features:i}=r;const s=1/Al(e);i.sort(((t,e)=>t.id-e.id)),n.sort(((t,e)=>t.id-e.id||t.idx-e.idx)),n=n.filter(((t,e,r)=>e===r.findIndex((e=>e.id===t.id&&e.idx===t.idx))));const a=new Array;let o=0;const l=n.length;for(const t of i){if(t.constantHeight){a.push(new dh(t.id,t.bounds,t.constantHeight));continue}for(;o!==l&&n[o].id<t.id;)o++;if(o===l||n[o].id!==t.id)continue;const e=new Array,r=new Array,i=o;for(;o!==l&&n[o].id===t.id;){const t=n[o];if(e.push({position:t.position,height:t.height,extent:t.extent}),o!==i&&n[o-1].idx===t.idx-1){const t=o-i;r.push({a:t-1,b:t});}o++;}a.push(new dh(t.id,t.bounds,void 0,e,r,s));}return a}},t.e5=lt,t.e6=gh,t.e7=fd,t.e8=hd,t.e9=function(t,e,r,n,i,s,a,o=1,l){t.createArrays(),t.tilePixelRatio=Kr/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;const u=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,h={};h.scaleFactor=o,h.textSizeScaleRange=u.get("text-size-scale-range"),h.iconSizeScaleRange=u.get("icon-size-scale-range");const[p,f]=h.textSizeScaleRange,[d,m]=h.iconSizeScaleRange;h.textScaleFactor=Q(h.scaleFactor,p,f),h.iconScaleFactor=Q(h.scaleFactor,d,m);const y=c["text-size"],g=c["icon-size"];if("composite"===t.textSizeData.kind){const{minZoom:e,maxZoom:r}=t.textSizeData;h.compositeTextSizes=[y.possiblyEvaluate(new Rs(e),s),y.possiblyEvaluate(new Rs(r),s)];}if("composite"===t.iconSizeData.kind){const{minZoom:e,maxZoom:r}=t.iconSizeData;h.compositeIconSizes=[g.possiblyEvaluate(new Rs(e),s),g.possiblyEvaluate(new Rs(r),s)];}h.layoutTextSize=y.possiblyEvaluate(new Rs(a+1),s),h.layoutIconSize=g.possiblyEvaluate(new Rs(a+1),s),h.textMaxSize=y.possiblyEvaluate(new Rs(18),s);const x=u.get("symbol-placement"),v="map"===u.get("text-rotation-alignment")&&"point"!==x,b=u.get("text-size");let _=!1;const w=[];for(const a of t.features){const o=u.get("text-font").evaluate(a,{},s).join(","),p=b.evaluate(a,{},s)*h.textScaleFactor,f=h.layoutTextSize.evaluate(a,{},s)*h.textScaleFactor,d=h.layoutIconSize.evaluate(a,{},s)*h.iconScaleFactor,m={horizontal:{},vertical:void 0},y=a.text;let g,M=[0,0];if(y){const n=y.toString(),c=u.get("text-letter-spacing").evaluate(a,{},s)*gf,h=u.get("text-line-height").evaluate(a,{},s)*gf,d=ys(n)?c:0,g=u.get("text-anchor").evaluate(a,{},s),b=u.get("text-variable-anchor");if(!b){const t=u.get("text-radial-offset").evaluate(a,{},s);M=t?Cd(g,[t*gf,Bd]):u.get("text-offset").evaluate(a,{},s).map((t=>t*gf));}let _=v?"center":u.get("text-justify").evaluate(a,{},s);const w="point"===x,A=w?u.get("text-max-width").evaluate(a,{},s)*gf:1/0,I=s=>{t.allowVerticalPlacement&&ms(n)&&(m.vertical=qf(y,e,r,i,o,A,h,g,s,d,M,Nf.vertical,!0,f,p,l));};if(!v&&b){const t="auto"===_?b.map((t=>Nd(t))):[_];let n=!1;for(let s=0;s<t.length;s++){const a=t[s];if(!m.horizontal[a])if(n)m.horizontal[a]=m.horizontal[0];else {const t=qf(y,e,r,i,o,A,h,"center",a,d,M,Nf.horizontal,!1,f,p,l);t&&(m.horizontal[a]=t,n=1===t.positionedLines.length);}}I("left");}else {if("auto"===_&&(_=Nd(g)),w||u.get("text-writing-mode").indexOf("horizontal")>=0||!ms(n)){const t=qf(y,e,r,i,o,A,h,g,_,d,M,Nf.horizontal,!1,f,p,l);t&&(m.horizontal[_]=t);}I(w?"left":_);}}let A,I,S,P,E,z=!1;if(a.icon&&a.icon.hasPrimary()){const e=Rd(a.icon,t.iconSizeData,c["icon-size"],s,t.zoom,a,l,h.iconScaleFactor);A=e.iconPrimary,I=e.iconSecondary;const r=A.toString(),o=n.get(r);o&&(S=u.get("icon-offset").evaluate(a,{},s),P=u.get("icon-anchor").evaluate(a,{},s),E=u.get("icon-text-fit").evaluate(a,{},s),g=Qf(i.get(r),I?i.get(I.toString()):void 0,S,P),z=o.sdf,void 0===t.sdfIcons?t.sdfIcons=o.sdf:t.sdfIcons!==o.sdf&&pt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(o.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0));}_=_||!(!a.icon||!a.icon.hasSecondary());const k=Yd(m.horizontal)||m.vertical;t.iconsInText||(t.iconsInText=!!k&&k.iconsInText);const T=f*h.textScaleFactor/gf,{defaultShapedIcon:B,verticallyShapedIcon:V}=Ud(t,g,u,a,s,m,T,S,E);g=B,w.push({feature:a,shapedTextOrientations:m,shapedText:k,shapedIcon:g,iconPrimary:A,iconSecondary:I,iconOffset:S,iconAnchor:P,verticallyShapedIcon:V,layoutTextSize:f,layoutIconSize:d,textOffset:M,isSDFIcon:z,iconTextFit:E});}return {featureData:w,sizes:h,hasAnySecondaryIcon:_,textAlongLine:v,symbolPlacement:x}},t.ea=dd,t.eb=function(t,e,r,n,i,s,a,o,l,u){const{featureData:c,hasAnySecondaryIcon:h,sizes:p,textAlongLine:f,symbolPlacement:d}=e;for(const e of c){const{shapedIcon:r,verticallyShapedIcon:s,feature:c,shapedTextOrientations:m,shapedText:y,layoutTextSize:g,textOffset:x,isSDFIcon:v,iconPrimary:b,iconSecondary:_,iconTextFit:w,iconOffset:M}=e;Ld(r,u.iconPositions,b,_),Ld(s,u.iconPositions,b,_),Fd(m,u.iconPositions),(y||r)&&jd(t,c,m,r,s,l,p,g,0,x,v,n,i,a,o,h,w,M,f,d);}r&&t.generateCollisionDebugBuffers(s,t.collisionBoxArray,p.textScaleFactor);},t.ec=ah,t.ed=hx,t.ee=j,t.ef=sh,t.eg=Vf,t.eh=e,t.ei=function(t){let e=0;if(new Uint32Array(t,0,1)[0]!==bv){const r=new Uint32Array(t,0,7),[,,n,i,s,a]=r;e=r.byteLength+i+s+a+s,(n!==t.byteLength||e>=t.byteLength)&&pt("Invalid b3dm header information.");}return Sv(t,e)},t.ej=function(t,e){const r=Cv(t);for(const t of r){for(const e of t.meshes)Dv(e);t.lights&&(t.lightMeshIndex=t.meshes.length,t.meshes.push(Rv(t.lights,e)));}return r},t.ek=Gy,t.el=Qy,t.em=Ds,t.en=function(t){$t(),null!=Ut&&Ut.then((e=>{e.keys().then((r=>{for(let n=0;n<r.length-t;n++)e.delete(r[n]);}));}));},t.f=function(t){return 0===t.indexOf("mapbox:")},t.g=function(t,e){return re(nt(t,{method:"GET"}),e)},t.h=It,t.i=function(t){return At.API_STYLE_REGEX.test(t)&&!St(t)},t.j=function(t){return decodeURIComponent(atob(t).split("").map((t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2))).join(""))},t.k=function(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(Number("0x"+e)))))},t.l=nt,t.m=Yt,t.n=function(t,e){return re(nt(t,{type:"json"}),e)},t.o=le,t.p=function(t,e){return re(nt(t,{method:"POST"}),e)},t.q=Ct,t.r=pc,t.s=function(t){try{const e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return !1}},t.t=Vt,t.u=function(){return function t(e){return e?(e^Math.random()*(16>>e/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()},t.v=function(t){return !!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)},t.w=pt,t.x=function(){return sg||(sg=new rg),sg},t.y=Qg,t.z=xe;}));

define(["./shared"],(function(e){function t(e){const t=e?e.url.toString():void 0;return t?performance.getEntriesByName(t):[]}function s(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const i of e)t+=`${s(i)},`;return `${t}]`}let t="{";for(const i of Object.keys(e).sort())t+=`${i}:${s(e[i])},`;return `${t}}`}function i(t){let i="";for(const o of e.bm)("model"!==t.type||"minzoom"!==o&&"maxzoom"!==o)&&(i+=`/${s(t[o])}`);return i}class o{constructor(e){this.keyCache={},this._layers={},this._layerConfigs={},e&&this.replace(e);}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t);}update(t,o,n){this._options=n;for(const s of t)this._layerConfigs[s.id]=s,(this._layers[s.id]=e.cv(s,this.scope,null,this._options)).compileFilter(n),this.keyCache[s.id]&&delete this.keyCache[s.id];for(const e of o)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const r=function(e,t){const o={};for(let n=0;n<e.length;n++){const r=e[n];let a=t&&t[r.id];!a&&(a=i(r),"line"===r.type&&r.paint)&&function e(t){return "string"==typeof t&&"line-progress"===t||(Array.isArray(t)?t.some(e):!(!t||"object"!=typeof t)&&Object.values(t).some(e))}(r.paint["line-width"])&&(a+=`/${s(r.paint["line-width"])}`),t&&(t[r.id]=a);let l=o[a];l||(l=o[a]=[]),l.push(r);}const n=[];for(const e in o)n.push(o[e]);return n}(Object.values(this._layerConfigs),this.keyCache);for(const e of r){const t=e.map((e=>this._layers[e.id])),s=t[0];if("none"===s.visibility)continue;const i=s.source||"";let o=this.familiesBySource[i];o||(o=this.familiesBySource[i]={});const n=s.sourceLayer||"_geojsonTileLayer";let r=o[n];r||(r=o[n]=[]),r.push(t);}}}const n=1*e.d_;class r{constructor(t){const s={},i=[];for(const e in t){const o=t[e],r=s[e]={};for(const e in o.glyphs){const t=o.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const s=t.metrics.localGlyph?n:1,a={x:0,y:0,w:t.bitmap.width+2*s,h:t.bitmap.height+2*s};i.push(a),r[e]=a;}}const{w:o,h:r}=e.H(i),a=new e.dZ({width:o||1,height:r||1});for(const i in t){const o=t[i];for(const t in o.glyphs){const r=o.glyphs[+t];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const l=s[i][t],c=r.metrics.localGlyph?n:1;e.dZ.copy(r.bitmap,a,{x:0,y:0},{x:l.x+c,y:l.y+c},r.bitmap);}}this.image=a,this.positions=s;}}e.dY(r,"GlyphAtlas");class a{constructor(t){this.tileID=new e.aH(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.lut=t.lut,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.scope=t.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.request&&t.request.collectResourceTiming,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile,this.tileTransform=e.aR(t.tileID.canonical,t.projection),this.projection=t.projection,this.worldview=t.worldview,this.localizableLayerIds=t.localizableLayerIds,this.brightness=t.brightness,this.extraShadowCaster=!!t.extraShadowCaster,this.tessellationStep=t.tessellationStep,this.scaleFactor=t.scaleFactor;}parse(t,s,i,o,n){this.status="parsing",this.data=t,this.collisionBoxArray=new e.aX;const a=new e.d$(Object.keys(t.layers).sort()),c=new e.e0(this.tileID,this.promoteId);c.bucketLayerIDs=[];const h={},u=new e.e1(256,256),d={featureIndex:c,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:u,availableImages:i,brightness:this.brightness,scaleFactor:this.scaleFactor,elevationFeatures:void 0},p=s.familiesBySource[this.source];for(const s in p){const o=t.layers[s];if(!o)continue;let n=!1,r=!1,u=!1;for(const e of p[s])"symbol"===e[0].type?n=!0:r=!0,e[0].is3D()&&"model"!==e[0].type&&(u=!0);if(this.extraShadowCaster&&!u)continue;if(!0===this.isSymbolTile&&!n)continue;if(!1===this.isSymbolTile&&!r)continue;1===o.version&&e.w(`Vector tile source "${this.source}" layer "${s}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const f=a.encode(s),g=[];let m=!1;for(let t=0,i=0;t<o.length;t++){const n=o.feature(t),r=c.getId(n,s);if(this.localizableLayerIds&&this.localizableLayerIds.has(s)){const e=n.properties?n.properties.worldview:null;if(this.worldview&&"string"==typeof e)if("all"===e)n.properties.$localized=!0;else {if(!e.split(",").includes(this.worldview))continue;n.properties.$localized=!0,n.properties.worldview=this.worldview;}}!m&&n.properties&&n.properties.hasOwnProperty(e.e2)&&(m=!0),g.push({feature:n,id:r,index:i,sourceLayerIndex:f}),i++;}m&&!d.elevationFeatures&&t.layers.hasOwnProperty(e.e3)&&(d.elevationFeatures=e.e4.parseFrom(t.layers[e.e3],this.canonical));for(const t of p[s]){const s=t[0];(!this.extraShadowCaster||s.is3D()&&"model"!==s.type)&&(void 0!==this.isSymbolTile&&"symbol"===s.type!==this.isSymbolTile||s.minzoom&&this.zoom<Math.floor(s.minzoom)||s.maxzoom&&this.zoom>=s.maxzoom||"none"!==s.visibility&&(l(t,this.zoom,d.brightness,i),(h[s.id]=s.createBucket({index:c.bucketLayerIDs.length,layers:t,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:f,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep})).populate(g,d,this.tileID.canonical,this.tileTransform),c.bucketLayerIDs.push(t.map((t=>e.C(t.id,t.scope))))));}}let f,g,m,y,x,w;u.trim();const b={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},v=()=>{if(f)return this.status="done",n(f);if(this.extraShadowCaster)this.status="done",n(null,{buckets:Object.values(h).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:d.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(g&&m&&y){const t=new r(g),s=new Map;for(const[t,i]of m.entries()){const{imagePosition:o}=e.e7(t,i,e.e8);s.set(t,o);}const n={};for(const o in h){const r=h[o];r instanceof e.aY&&(l(r.layers,this.zoom,d.brightness,i),n[o]=e.e9(r,g,t.positions,m,s,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio));}const a={iconsPending:!0,patternsPending:!0};this.rasterizeIfNeeded(o,m,x,(()=>{a.iconsPending=!1,I(n,t,a);})),this.rasterizeIfNeeded(o,y,w,(()=>{a.patternsPending=!1,I(n,t,a);}));}},I=(t,s,o,r)=>{if(o.iconsPending||o.patternsPending)return;const a=new e.ea(m,y,this.lut);for(const s in h){const o=h[s];if(s in t)e.eb(o,t[s],this.showCollisionBoxes,i,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,m,a);else if(o.hasPattern&&(o instanceof e.b2||o instanceof e.b3||o instanceof e.d8)){l(o.layers,this.zoom,d.brightness,i);const e=Object.fromEntries(a.patternPositions);o.addFeatures(d,this.tileID.canonical,e,i,this.tileTransform,this.brightness);}}this.status="done",n(null,{buckets:Object.values(h).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:s.image,lineAtlas:u,imageAtlas:a,brightness:d.brightness});};if(!this.extraShadowCaster){const t=e.e5(d.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(t).length?o.send("getGlyphs",{uid:this.uid,stacks:t,scope:this.scope},((e,t)=>{f||(f=e,g=t,v());}),void 0,!1,b):g={};const s=Array.from(d.iconDependencies.keys()).map((t=>e.I.parse(t)));s.length?o.send("getImages",{images:s,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},((e,t)=>{f||(f=e,m=new Map,x=this.updateImageMapAndGetImageTaskQueue(m,t,d.iconDependencies),v());}),void 0,!1,b):(m=new Map,x=new Map);const i=Array.from(d.patternDependencies.keys()).map((t=>e.I.parse(t)));i.length?o.send("getImages",{images:i,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},((e,t)=>{f||(f=e,y=new Map,w=this.updateImageMapAndGetImageTaskQueue(y,t,d.patternDependencies),v());}),void 0,!1,b):(y=new Map,w=new Map);}if(d.elevationFeatures&&d.elevationFeatures.length>0){const t=[];for(const s of Object.values(h))if(s instanceof e.b3){const e=s.getUnevaluatedPortalGraph();e&&t.push(e);}const s=e.e6.evaluate(t);for(const t of Object.values(h))t instanceof e.b3&&t.setEvaluatedPortalGraph(s);}v();}rasterizeIfNeeded(e,t,s,i){Array.from(t.values()).some((e=>e.usvg))?this.rasterize(e,t,s,i):i();}updateImageMapAndGetImageTaskQueue(e,t,s){const i=new Map;for(const o of t.keys()){const n=s.get(o)||[];for(const s of n){const o=s.toString(),n=t.get(s.id.toString());n.usvg?i.has(o)||(i.set(o,s),e.set(o,Object.assign({},n))):e.set(o,n);}}return i}rasterize(e,t,s,i){this.rasterizeTask=e.send("rasterizeImages",{scope:this.scope,tasks:s},((e,s)=>{if(!e)for(const[e,i]of s.entries()){const s=Object.assign(t.get(e),{data:i});t.set(e,s);}i();}));}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel();}}function l(t,s,i,o){const n=new e.aa(s,{brightness:i});for(const e of t)e.recalculate(n,o);}class c extends e.E{constructor(t,s,i,o,n,r){super(),this.actor=t,this.layerIndex=s,this.availableImages=i,this.loadVectorData=n||e.aE,this.loading={},this.loaded={},this.deduped=new e.aD(t.scheduler),this.isSpriteLoaded=o,this.scheduler=t.scheduler,this.brightness=r;}loadTile(s,i){const o=s.uid,n=s&&s.request,r=n&&n.collectResourceTiming,l=this.loading[o]=new a(s);l.abort=this.loadVectorData(s,((a,c)=>{const h=!this.loading[o];if(delete this.loading[o],l.cancelRasterize(),h||a||!c)return l.status="done",h||(this.loaded[o]=l),i(a);const u=c.rawData,d={};c.expires&&(d.expires=c.expires),c.cacheControl&&(d.cacheControl=c.cacheControl),l.vectorTile=c.vectorTile||new e.ec.VectorTile(new e.bi(u));const p=()=>{l.parse(l.vectorTile,this.layerIndex,this.availableImages,this.actor,((s,o)=>{if(s||!o)return i(s);const a={};if(r){const e=t(n);e.length>0&&(a.resourceTiming=JSON.parse(JSON.stringify(e)));}i(null,e.l({rawTileData:u.slice(0)},o,d,a));}));};this.isSpriteLoaded?p():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(p,{type:"parseTile",isSymbolTile:s.isSymbolTile,zoom:s.tileZoom}):p();})),this.loaded=this.loaded||{},this.loaded[o]=l;}));}reloadTile(t,s){const i=this.loaded,o=t.uid;if(i&&i[o]){const n=i[o];n.scaleFactor=t.scaleFactor,n.showCollisionBoxes=t.showCollisionBoxes,n.projection=t.projection,n.brightness=t.brightness,n.tileTransform=e.aR(t.tileID.canonical,t.projection),n.extraShadowCaster=t.extraShadowCaster,n.lut=t.lut;const r=(e,t)=>{const i=n.reloadCallback;i&&(delete n.reloadCallback,n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,i)),s(e,t);};"parsing"===n.status?n.reloadCallback=r:"done"===n.status&&(n.vectorTile?n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,r):r());}else s(null,void 0);}abortTile(e,t){const s=e.uid,i=this.loading[s];i&&(i.abort&&i.abort(),delete this.loading[s]),t();}removeTile(e,t){const s=this.loaded,i=e.uid;s&&s[i]&&delete s[i],t();}}class h{loadTile(t,s){const{uid:i,encoding:o,rawImageData:n,padding:r}=t,a=ImageBitmap&&n instanceof ImageBitmap?this.getImageData(n,r):n;s(null,new e.ed(i,a,o,r<1));}reloadTile(e,t){t(null,null);}abortTile(e,t){t();}removeTile(e,t){t();}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 s=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),s}}e.bh.setPbf(e.bi);class u{constructor(t){this._mrt=new e.bh(t.partial?30:1/0),this._isHeaderLoaded=!1,this.uid=t.uid,this.tileID=t.tileID,this.source=t.source;}parse(t,s){const i=this._mrt;this.status="parsing",this._entireBuffer=t;try{i.parseHeader(t),this._isHeaderLoaded=!0;const o=[];for(const s in i.layers){const n=i.getLayer(s),r=n.getDataRange(n.getBandList()),a=i.createDecodingTask(r),l=t.slice(r.firstByte,r.lastByte+1),c=e.bh.performDecoding(l,a).then((e=>a.complete(null,e))).catch((e=>a.complete(e,null)));o.push(c);}Promise.allSettled(o).then((()=>s(null,i)));}catch(e){s(e);}}}class d{constructor(e){this.actor=e,this.loading={},this.loaded={};}loadTile(t,s){const i=t.uid,o=t.request,n=this.loading[i]=new u(t),{cancel:r}=e.bj(o,((e,t,o,r)=>{const a=!this.loading[i];if(delete this.loading[i],a||e||!t)return n.status="done",a||(this.loaded[i]=n),s(e);n.parse(t,((e,t)=>{if(e||!t)return s(e);s(null,t,o,r);})),this.loaded[i]=n;}));n.abort=r;}reloadTile(e,t){t(null,void 0);}abortTile(e,t){const s=e.uid,i=this.loading[s];i&&(i.abort&&i.abort(),delete this.loading[s]),t();}removeTile(e,t){const s=e.uid;this.loaded[s]&&delete this.loaded[s],t();}decodeRasterArray({task:t,buffer:s},i){e.bh.performDecoding(s,t).then((e=>i(null,e))).catch((e=>i(e)));}}const p=e.ec.VectorTileFeature.prototype.toGeoJSON;class f{constructor(t){this._feature=t,this.extent=e.ai,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 s of this._feature.geometry)t.push([new e.P(s[0],s[1])]);return t}{const t=[];for(const s of this._feature.geometry){const i=[];for(const t of s)i.push(new e.P(t[0],t[1]));t.push(i);}return t}}toGeoJSON(e,t,s){return p.call(this,e,t,s)}}class g{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.ai,this.length=t.length,this._features=t;}feature(e){return new f(this._features[e])}}const m=64/4096,y=128;class x{constructor(){this.features=new Map;}clear(){this.features.clear();}load(e=[],t){for(const s of e){const e=s.id;if(null==e)continue;let i=this.features.get(e);i&&this.updateCache(i,t),s.geometry?(i=b(s),this.updateCache(i,t),this.features.set(e,i)):this.features.delete(e),this.updateCache(i,t);}}updateCache(e,t){for(const{canonical:s,uid:i}of Object.values(t)){const{z:o,x:n,y:r}=s;w(e,Math.pow(2,o),n,r)&&delete t[i];}}getTile(e,t,s){const i=Math.pow(2,e),o=[];for(const e of this.features.values())w(e,i,t,s)&&o.push(M(e,i,t,s));return {features:o}}getFeatures(){return [...this.features.values()]}}function w({minX:e,minY:t,maxX:s,maxY:i},o,n,r){return e<(n+1+m)/o&&t<(r+1+m)/o&&s>(n-m)/o&&i>(r-m)/o}function b(e){const{id:t,geometry:s,properties:i}=e;if(!s)return;if("GeometryCollection"===s.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:o,coordinates:n}=s,r={id:t,type:1,geometry:[],tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},a=r.geometry;if("Point"===o)v(n,a,r);else if("MultiPoint"===o)for(const e of n)v(e,a,r);else if("LineString"===o)r.type=2,I(n,a,r);else if("MultiLineString"===o)r.type=2,S(n,a,r);else if("Polygon"===o)r.type=3,S(n,a,r,!0);else {if("MultiPolygon"!==o)throw new Error("Input data is not a valid GeoJSON object.");r.type=3;for(const e of n)S(e,a,r,!0);}return r}function v([t,s],i,o){const n=e.av(t);let r=e.aC(s);r=r<0?0:r>1?1:r,i.push(n,r),o.minX=Math.min(o.minX,n),o.minY=Math.min(o.minY,r),o.maxX=Math.max(o.maxX,n),o.maxY=Math.max(o.maxY,r);}function I(e,t,s,i=!1,o=!1){const n=[];for(const t of e)v(t,n,s);t.push(n),i&&function(e,t){let s=0;for(let t=0,i=e.length,o=i-2;t<i;o=t,t+=2)s+=(e[t]-e[o])*(e[t+1]+e[o+1]);if(s>0===t)for(let t=0,s=e.length;t<s/2;t+=2){const i=e[t],o=e[t+1];e[t]=e[s-2-t],e[t+1]=e[s-1-t],e[s-2-t]=i,e[s-1-t]=o;}}(n,o);}function S(e,t,s,i=!1){for(let o=0;o<e.length;o++)I(e[o],t,s,i,0===o);}function M(t,s,i,o){const{id:n,type:r,geometry:a,tags:l}=t,c=[];if(1===r)!function(t,s,i,o,n){for(let r=0;r<t.length;r+=2){const a=Math.round(e.ai*(t[r+0]*s-i)),l=Math.round(e.ai*(t[r+1]*s-o));n.push([a,l]);}}(a,s,i,o,c);else for(const e of a)T(e,s,i,o,c);return {id:n,type:r,geometry:c,tags:l}}function T(t,s,i,o,n){const r=-y,a=e.ai+y;let l;for(let c=0;c<t.length-2;c+=2){let h=Math.round(e.ai*(t[c+0]*s-i)),u=Math.round(e.ai*(t[c+1]*s-o)),d=Math.round(e.ai*(t[c+2]*s-i)),p=Math.round(e.ai*(t[c+3]*s-o));const f=d-h,g=p-u;h<r&&d<r||(h<r?(u+=Math.round(g*((r-h)/f)),h=r):d<r&&(p=u+Math.round(g*((r-h)/f)),d=r),u<r&&p<r||(u<r?(h+=Math.round(f*((r-u)/g)),u=r):p<r&&(d=h+Math.round(f*((r-u)/g)),p=r),h>=a&&d>=a||(h>=a?(u+=Math.round(g*((a-h)/f)),h=a):d>=a&&(p=u+Math.round(g*((a-h)/f)),d=a),u>=a&&p>=a||(u>=a?(h+=Math.round(f*((a-u)/g)),u=a):p>=a&&(d=h+Math.round(f*((a-u)/g)),p=a),l&&h===l[l.length-1][0]&&u===l[l.length-1][1]||(l=[[h,u]],n.push(l)),l.push([d,p])))));}}var P,k,C,_={exports:{}},L=function(){if(C)return _.exports;C=1;var t=e.eg(),s=function(){if(k)return P;k=1;var t=e.ee(),s=e.ef().VectorTileFeature;function i(e,t){this.options=t||{},this.features=e,this.length=e.length;}function o(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;}return P=i,i.prototype.feature=function(e){return new o(this.features[e],this.options.extent)},o.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var s=0;s<e.length;s++){for(var i=e[s],o=[],n=0;n<i.length;n++)o.push(new t(i[n][0],i[n][1]));this.geometry.push(o);}return this.geometry},o.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,s=-1/0,i=1/0,o=-1/0,n=0;n<e.length;n++)for(var r=e[n],a=0;a<r.length;a++){var l=r[a];t=Math.min(t,l.x),s=Math.max(s,l.x),i=Math.min(i,l.y),o=Math.max(o,l.y);}return [t,i,s,o]},o.prototype.toGeoJSON=s.prototype.toGeoJSON,P}();function i(e){var s=new t;return function(e,t){for(var s in e.layers)t.writeMessage(3,o,e.layers[s]);}(e,s),s.finish()}function o(e,t){var s;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(s=0;s<e.length;s++)i.feature=e.feature(s),t.writeMessage(2,n,i);var o=i.keys;for(s=0;s<o.length;s++)t.writeStringField(3,o[s]);var r=i.values;for(s=0;s<r.length;s++)t.writeMessage(4,h,r[s]);}function n(e,t){var s=e.feature;void 0!==s.id&&t.writeVarintField(1,s.id),t.writeMessage(2,r,e),t.writeVarintField(3,s.type),t.writeMessage(4,c,s);}function r(e,t){var s=e.feature,i=e.keys,o=e.values,n=e.keycache,r=e.valuecache;for(var a in s.properties){var l=s.properties[a],c=n[a];if(null!==l){void 0===c&&(i.push(a),n[a]=c=i.length-1),t.writeVarint(c);var h=typeof l;"string"!==h&&"boolean"!==h&&"number"!==h&&(l=JSON.stringify(l));var u=h+":"+l,d=r[u];void 0===d&&(o.push(l),r[u]=d=o.length-1),t.writeVarint(d);}}}function a(e,t){return (t<<3)+(7&e)}function l(e){return e<<1^e>>31}function c(e,t){for(var s=e.loadGeometry(),i=e.type,o=0,n=0,r=s.length,c=0;c<r;c++){var h=s[c],u=1;1===i&&(u=h.length),t.writeVarint(a(1,u));for(var d=3===i?h.length-1:h.length,p=0;p<d;p++){1===p&&1!==i&&t.writeVarint(a(2,d-1));var f=h[p].x-o,g=h[p].y-n;t.writeVarint(l(f)),t.writeVarint(l(g)),o+=f,n+=g;}3===i&&t.writeVarint(a(7,1));}}function h(e,t){var s=typeof e;"string"===s?t.writeStringField(1,e):"boolean"===s?t.writeBooleanField(7,e):"number"===s&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e));}return _.exports=i,_.exports.fromVectorTileJs=i,_.exports.fromGeojsonVt=function(e,t){t=t||{};var o={};for(var n in e)o[n]=new s(e[n].features,t),o[n].name=n,o[n].version=t.version,o[n].extent=t.extent;return i({layers:o})},_.exports.GeoJSONWrapper=s,_.exports}(),z=e.eh(L);const D={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},j=Math.fround||(O=new Float32Array(1),e=>(O[0]=+e,O[0]));var O;const F=3,A=5,Z=6;class E{constructor(e){this.options=Object.assign(Object.create(D),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[];}load(e){const{log:t,minZoom:s,maxZoom:i}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;const n=[];for(let t=0;t<e.length;t++){const s=e[t];if(!s.geometry)continue;const[i,o]=s.geometry.coordinates,r=j(B(i)),a=j(G(o));n.push(r,a,1/0,t,-1,1),this.options.reduce&&n.push(0);}let r=this.trees[i+1]=this._createTree(n);t&&console.timeEnd(o);for(let e=i;e>=s;e--){const s=+Date.now();r=this.trees[e]=this._createTree(this._cluster(r,e)),t&&console.log("z%d: %d clusters in %dms",e,r.numItems,+Date.now()-s);}return t&&console.timeEnd("total time"),this}getClusters(e,t){let s=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let o=180===e[2]?180:((e[2]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)s=-180,o=180;else if(s>o){const e=this.getClusters([s,i,180,n],t),r=this.getClusters([-180,i,o,n],t);return e.concat(r)}const r=this.trees[this._limitZoom(t)],a=r.range(B(s),G(n),B(o),G(i)),l=r.data,c=[];for(const e of a){const t=this.stride*e;c.push(l[t+A]>1?N(l,t,this.clusterProps):this.points[l[t+F]]);}return c}getChildren(e){const t=this._getOriginId(e),s=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[s];if(!o)throw new Error(i);const n=o.data;if(t*this.stride>=n.length)throw new Error(i);const r=this.options.radius/(this.options.extent*Math.pow(2,s-1)),a=o.within(n[t*this.stride],n[t*this.stride+1],r),l=[];for(const t of a){const s=t*this.stride;n[s+4]===e&&l.push(n[s+A]>1?N(n,s,this.clusterProps):this.points[n[s+F]]);}if(0===l.length)throw new Error(i);return l}getLeaves(e,t,s){const i=[];return this._appendLeaves(i,e,t=t||10,s=s||0,0),i}getTile(e,t,s){const i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:n,radius:r}=this.options,a=r/n,l=(s-a)/o,c=(s+1+a)/o,h={features:[]};return this._addTileFeatures(i.range((t-a)/o,l,(t+1+a)/o,c),i.data,t,s,o,h),0===t&&this._addTileFeatures(i.range(1-a/o,l,1,c),i.data,o,s,o,h),t===o-1&&this._addTileFeatures(i.range(0,l,a/o,c),i.data,-1,s,o,h),h.features.length?h:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const s=this.getChildren(e);if(t++,1!==s.length)break;e=s[0].properties.cluster_id;}return t}_appendLeaves(e,t,s,i,o){const n=this.getChildren(t);for(const t of n){const n=t.properties;if(n&&n.cluster?o+n.point_count<=i?o+=n.point_count:o=this._appendLeaves(e,n.cluster_id,s,i,o):o<i?o++:e.push(t),e.length===s)break}return o}_createTree(t){const s=new e.bE(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)s.add(t[e],t[e+1]);return s.finish(),s.data=t,s}_addTileFeatures(e,t,s,i,o,n){for(const r of e){const e=r*this.stride,a=t[e+A]>1;let l,c,h;if(a)l=X(t,e,this.clusterProps),c=t[e],h=t[e+1];else {const s=this.points[t[e+F]];l=s.properties;const[i,o]=s.geometry.coordinates;c=B(i),h=G(o);}const u={type:1,geometry:[[Math.round(this.options.extent*(c*o-s)),Math.round(this.options.extent*(h*o-i))]],tags:l};let d;d=a||this.options.generateId?t[e+F]:this.points[t[e+F]].id,void 0!==d&&(u.id=d),n.features.push(u);}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:s,extent:i,reduce:o,minPoints:n}=this.options,r=s/(i*Math.pow(2,t)),a=e.data,l=[],c=this.stride;for(let s=0;s<a.length;s+=c){if(a[s+2]<=t)continue;a[s+2]=t;const i=a[s],h=a[s+1],u=e.within(a[s],a[s+1],r),d=a[s+A];let p=d;for(const e of u){const s=e*c;a[s+2]>t&&(p+=a[s+A]);}if(p>d&&p>=n){let e,n=i*d,r=h*d,f=-1;const g=(s/c<<5)+(t+1)+this.points.length;for(const i of u){const l=i*c;if(a[l+2]<=t)continue;a[l+2]=t;const h=a[l+A];n+=a[l]*h,r+=a[l+1]*h,a[l+4]=g,o&&(e||(e=this._map(a,s,!0),f=this.clusterProps.length,this.clusterProps.push(e)),o(e,this._map(a,l)));}a[s+4]=g,l.push(n/p,r/p,1/0,g,-1,p),o&&l.push(f);}else {for(let e=0;e<c;e++)l.push(a[s+e]);if(p>1)for(const e of u){const s=e*c;if(!(a[s+2]<=t)){a[s+2]=t;for(let e=0;e<c;e++)l.push(a[s+e]);}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return (e-this.points.length)%32}_map(e,t,s){if(e[t+A]>1){const i=this.clusterProps[e[t+Z]];return s?Object.assign({},i):i}const i=this.points[e[t+F]].properties,o=this.options.map(i);return s&&o===i?Object.assign({},o):o}}function N(e,t,s){return {type:"Feature",id:e[t+F],properties:X(e,t,s),geometry:{type:"Point",coordinates:[(i=e[t],360*(i-.5)),Y(e[t+1])]}};var i;}function X(e,t,s){const i=e[t+A],o=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?Math.round(i/100)/10+"k":i,n=e[t+Z],r=-1===n?{}:Object.assign({},s[n]);return Object.assign(r,{cluster:!0,cluster_id:e[t+F],point_count:i,point_count_abbreviated:o})}function B(e){return e/360+.5}function G(e){const t=Math.sin(e*Math.PI/180),s=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return s<0?0:s>1?1:s}function Y(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function R(e,t,s,i){let o=i;const n=t+(s-t>>1);let r,a=s-t;const l=e[t],c=e[t+1],h=e[s],u=e[s+1];for(let i=t+3;i<s;i+=3){const t=J(e[i],e[i+1],l,c,h,u);if(t>o)r=i,o=t;else if(t===o){const e=Math.abs(i-n);e<a&&(r=i,a=e);}}o>i&&(r-t>3&&R(e,t,r,i),e[r+2]=o,s-r>3&&R(e,r,s,i));}function J(e,t,s,i,o,n){let r=o-s,a=n-i;if(0!==r||0!==a){const l=((e-s)*r+(t-i)*a)/(r*r+a*a);l>1?(s=o,i=n):l>0&&(s+=r*l,i+=a*l);}return r=e-s,a=t-i,r*r+a*a}function V(e,t,s,i){const o={id:e??null,type:t,geometry:s,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)$(o,s);else if("Polygon"===t)$(o,s[0]);else if("MultiLineString"===t)for(const e of s)$(o,e);else if("MultiPolygon"===t)for(const e of s)$(o,e[0]);return o}function $(e,t){for(let s=0;s<t.length;s+=3)e.minX=Math.min(e.minX,t[s]),e.minY=Math.min(e.minY,t[s+1]),e.maxX=Math.max(e.maxX,t[s]),e.maxY=Math.max(e.maxY,t[s+1]);}function W(e,t,s,i){if(!t.geometry)return;const o=t.geometry.coordinates;if(o&&0===o.length)return;const n=t.geometry.type,r=Math.pow(s.tolerance/((1<<s.maxZoom)*s.extent),2);let a=[],l=t.id;if(s.promoteId?l=t.properties[s.promoteId]:s.generateId&&(l=i||0),"Point"===n)q(o,a);else if("MultiPoint"===n)for(const e of o)q(e,a);else if("LineString"===n)U(o,a,r,!1);else if("MultiLineString"===n){if(s.lineMetrics){for(const s of o)a=[],U(s,a,r,!1),e.push(V(l,"LineString",a,t.properties));return}H(o,a,r,!1);}else if("Polygon"===n)H(o,a,r,!0);else {if("MultiPolygon"!==n){if("GeometryCollection"===n){for(const o of t.geometry.geometries)W(e,{id:l,geometry:o,properties:t.properties},s,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const e of o){const t=[];H(e,t,r,!0),a.push(t);}}e.push(V(l,n,a,t.properties));}function q(e,t){t.push(Q(e[0]),K(e[1]),0);}function U(e,t,s,i){let o,n,r=0;for(let s=0;s<e.length;s++){const a=Q(e[s][0]),l=K(e[s][1]);t.push(a,l,0),s>0&&(r+=i?(o*l-a*n)/2:Math.sqrt(Math.pow(a-o,2)+Math.pow(l-n,2))),o=a,n=l;}const a=t.length-3;t[2]=1,R(t,0,a,s),t[a+2]=1,t.size=Math.abs(r),t.start=0,t.end=t.size;}function H(e,t,s,i){for(let o=0;o<e.length;o++){const n=[];U(e[o],n,s,i),t.push(n);}}function Q(e){return e/360+.5}function K(e){const t=Math.sin(e*Math.PI/180),s=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return s<0?0:s>1?1:s}function ee(e,t,s,i,o,n,r,a){if(i/=t,n>=(s/=t)&&r<i)return e;if(r<s||n>=i)return null;const l=[];for(const t of e){const e=t.geometry;let n=t.type;const r=0===o?t.minX:t.minY,c=0===o?t.maxX:t.maxY;if(r>=s&&c<i){l.push(t);continue}if(c<s||r>=i)continue;let h=[];if("Point"===n||"MultiPoint"===n)te(e,h,s,i,o);else if("LineString"===n)se(e,h,s,i,o,!1,a.lineMetrics);else if("MultiLineString"===n)oe(e,h,s,i,o,!1);else if("Polygon"===n)oe(e,h,s,i,o,!0);else if("MultiPolygon"===n)for(const t of e){const e=[];oe(t,e,s,i,o,!0),e.length&&h.push(e);}if(h.length){if(a.lineMetrics&&"LineString"===n){for(const e of h)l.push(V(t.id,n,e,t.tags));continue}"LineString"!==n&&"MultiLineString"!==n||(1===h.length?(n="LineString",h=h[0]):n="MultiLineString"),"Point"!==n&&"MultiPoint"!==n||(n=3===h.length?"Point":"MultiPoint"),l.push(V(t.id,n,h,t.tags));}}return l.length?l:null}function te(e,t,s,i,o){for(let n=0;n<e.length;n+=3){const r=e[n+o];r>=s&&r<=i&&ne(t,e[n],e[n+1],e[n+2]);}}function se(e,t,s,i,o,n,r){let a=ie(e);const l=0===o?re:ae;let c,h,u=e.start;for(let d=0;d<e.length-3;d+=3){const p=e[d],f=e[d+1],g=e[d+2],m=e[d+3],y=e[d+4],x=0===o?p:f,w=0===o?m:y;let b=!1;r&&(c=Math.sqrt(Math.pow(p-m,2)+Math.pow(f-y,2))),x<s?w>s&&(h=l(a,p,f,m,y,s),r&&(a.start=u+c*h)):x>i?w<i&&(h=l(a,p,f,m,y,i),r&&(a.start=u+c*h)):ne(a,p,f,g),w<s&&x>=s&&(h=l(a,p,f,m,y,s),b=!0),w>i&&x<=i&&(h=l(a,p,f,m,y,i),b=!0),!n&&b&&(r&&(a.end=u+c*h),t.push(a),a=ie(e)),r&&(u+=c);}let d=e.length-3;const p=e[d],f=e[d+1],g=0===o?p:f;g>=s&&g<=i&&ne(a,p,f,e[d+2]),d=a.length-3,n&&d>=3&&(a[d]!==a[0]||a[d+1]!==a[1])&&ne(a,a[0],a[1],a[2]),a.length&&t.push(a);}function ie(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function oe(e,t,s,i,o,n){for(const r of e)se(r,t,s,i,o,n,!1);}function ne(e,t,s,i){e.push(t,s,i);}function re(e,t,s,i,o,n){const r=(n-t)/(i-t);return ne(e,n,s+(o-s)*r,1),r}function ae(e,t,s,i,o,n){const r=(n-s)/(o-s);return ne(e,t+(i-t)*r,n,1),r}function le(e,t){const s=[];for(let i=0;i<e.length;i++){const o=e[i],n=o.type;let r;if("Point"===n||"MultiPoint"===n||"LineString"===n)r=ce(o.geometry,t);else if("MultiLineString"===n||"Polygon"===n){r=[];for(const e of o.geometry)r.push(ce(e,t));}else if("MultiPolygon"===n){r=[];for(const e of o.geometry){const s=[];for(const i of e)s.push(ce(i,t));r.push(s);}}s.push(V(o.id,n,r,o.tags));}return s}function ce(e,t){const s=[];s.size=e.size,void 0!==e.start&&(s.start=e.start,s.end=e.end);for(let i=0;i<e.length;i+=3)s.push(e[i]+t,e[i+1],e[i+2]);return s}function he(e,t){if(e.transformed)return e;const s=1<<e.z,i=e.x,o=e.y;for(const n of e.features){const e=n.geometry,r=n.type;if(n.geometry=[],1===r)for(let r=0;r<e.length;r+=2)n.geometry.push(ue(e[r],e[r+1],t,s,i,o));else for(let r=0;r<e.length;r++){const a=[];for(let n=0;n<e[r].length;n+=2)a.push(ue(e[r][n],e[r][n+1],t,s,i,o));n.geometry.push(a);}}return e.transformed=!0,e}function ue(e,t,s,i,o,n){return [Math.round(s*(e*i-o)),Math.round(s*(t*i-n))]}function de(e,t,s,i,o){const n=t===o.maxZoom?0:o.tolerance/((1<<t)*o.extent),r={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:s,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const t of e)pe(r,t,n,o);return r}function pe(e,t,s,i){const o=t.geometry,n=t.type,r=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===n||"MultiPoint"===n)for(let t=0;t<o.length;t+=3)r.push(o[t],o[t+1]),e.numPoints++,e.numSimplified++;else if("LineString"===n)fe(r,o,e,s,!1,!1);else if("MultiLineString"===n||"Polygon"===n)for(let t=0;t<o.length;t++)fe(r,o[t],e,s,"Polygon"===n,0===t);else if("MultiPolygon"===n)for(let t=0;t<o.length;t++){const i=o[t];for(let t=0;t<i.length;t++)fe(r,i[t],e,s,!0,0===t);}if(r.length){let s=t.tags||null;if("LineString"===n&&i.lineMetrics){s={};for(const e in t.tags)s[e]=t.tags[e];s.mapbox_clip_start=o.start/o.size,s.mapbox_clip_end=o.end/o.size;}const a={geometry:r,type:"Polygon"===n||"MultiPolygon"===n?3:"LineString"===n||"MultiLineString"===n?2:1,tags:s};null!==t.id&&(a.id=t.id),e.features.push(a);}}function fe(e,t,s,i,o,n){const r=i*i;if(i>0&&t.size<(o?r:i))return void(s.numPoints+=t.length/3);const a=[];for(let e=0;e<t.length;e+=3)(0===i||t[e+2]>r)&&(s.numSimplified++,a.push(t[e],t[e+1])),s.numPoints++;o&&function(e,t){let s=0;for(let t=0,i=e.length,o=i-2;t<i;o=t,t+=2)s+=(e[t]-e[o])*(e[t+1]+e[o+1]);if(s>0===t)for(let t=0,s=e.length;t<s/2;t+=2){const i=e[t],o=e[t+1];e[t]=e[s-2-t],e[t+1]=e[s-1-t],e[s-2-t]=i,e[s-1-t]=o;}}(a,n),e.push(a);}const ge={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class me{constructor(e,t){const s=(t=this.options=function(e,t){for(const s in t)e[s]=t[s];return e}(Object.create(ge),t)).debug;if(s&&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.");let i=function(e,t){const s=[];if("FeatureCollection"===e.type)for(let i=0;i<e.features.length;i++)W(s,e.features[i],t,i);else W(s,"Feature"===e.type?e:{geometry:e},t);return s}(e,t);this.tiles={},this.tileCoords=[],s&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(e,t){const s=t.buffer/t.extent;let i=e;const o=ee(e,1,-1-s,s,0,-1,2,t),n=ee(e,1,1-s,2+s,0,-1,2,t);return (o||n)&&(i=ee(e,1,-s,1+s,0,-1,2,t)||[],o&&(i=le(o,1).concat(i)),n&&(i=i.concat(le(n,-1)))),i}(i,t),i.length&&this.splitTile(i,0,0,0),s&&(i.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)));}splitTile(e,t,s,i,o,n,r){const a=[e,t,s,i],l=this.options,c=l.debug;for(;a.length;){i=a.pop(),s=a.pop(),t=a.pop(),e=a.pop();const h=1<<t,u=ye(t,s,i);let d=this.tiles[u];if(!d&&(c>1&&console.time("creation"),d=this.tiles[u]=de(e,t,s,i,l),this.tileCoords.push({z:t,x:s,y:i}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,s,i,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++;}if(d.source=e,null==o){if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else {if(t===l.maxZoom||t===o)continue;if(null!=o){const e=o-t;if(s!==n>>e||i!==r>>e)continue}}if(d.source=null,0===e.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,f=.5-p,g=.5+p,m=1+p;let y=null,x=null,w=null,b=null,v=ee(e,h,s-p,s+g,0,d.minX,d.maxX,l),I=ee(e,h,s+f,s+m,0,d.minX,d.maxX,l);e=null,v&&(y=ee(v,h,i-p,i+g,1,d.minY,d.maxY,l),x=ee(v,h,i+f,i+m,1,d.minY,d.maxY,l),v=null),I&&(w=ee(I,h,i-p,i+g,1,d.minY,d.maxY,l),b=ee(I,h,i+f,i+m,1,d.minY,d.maxY,l),I=null),c>1&&console.timeEnd("clipping"),a.push(y||[],t+1,2*s,2*i),a.push(x||[],t+1,2*s,2*i+1),a.push(w||[],t+1,2*s+1,2*i),a.push(b||[],t+1,2*s+1,2*i+1);}}getTile(e,t,s){e=+e,t=+t,s=+s;const i=this.options,{extent:o,debug:n}=i;if(e<0||e>24)return null;const r=1<<e,a=ye(e,t=t+r&r-1,s);if(this.tiles[a])return he(this.tiles[a],o);n>1&&console.log("drilling down to z%d-%d-%d",e,t,s);let l,c=e,h=t,u=s;for(;!l&&c>0;)c--,h>>=1,u>>=1,l=this.tiles[ye(c,h,u)];return l&&l.source?(n>1&&(console.log("found parent tile z%d-%d-%d",c,h,u),console.time("drilling down")),this.splitTile(l.source,c,h,u,e,t,s),n>1&&console.timeEnd("drilling down"),this.tiles[a]?he(this.tiles[a],o):null):null}}function ye(e,t,s){return 32*((1<<e)*s+t)+e}function xe(e,t){const s=e.tileID.canonical;if(!this._geoJSONIndex)return void t(null,null);const i=this._geoJSONIndex.getTile(s.z,s.x,s.y);if(!i)return void t(null,null);const o=new g(i.features);let n=z(o);0===n.byteOffset&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),t(null,{vectorTile:o,rawData:n.buffer});}class we extends c{constructor(e,t,s,i,o,n){super(e,t,s,i,xe,n),o&&(this.loadGeoJSON=o),this._dynamicIndex=new x;}loadData(s,i){const o=s&&s.request,n=o&&o.collectResourceTiming;this.loadGeoJSON(s,((r,a)=>{if(r||!a)return i(r);if("object"!=typeof a)return i(new Error(`Input data given to '${s.source}' is not a valid GeoJSON object.`));{try{if(s.filter){const t=e.X(s.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a.features=a.features.filter((e=>t.value.evaluate({zoom:0},e)));}s.dynamic?("Feature"===a.type&&(a={type:"FeatureCollection",features:[a]}),s.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(a.features,this.loaded),s.cluster&&(a.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=s.cluster?new E(function({superclusterOptions:t,clusterProperties:s}){if(!s||!t)return t;const i={},o={},n={accumulated:null,zoom:0},r={properties:null},a=Object.keys(s);for(const t of a){const[n,r]=s[t],a=e.X(r),l=e.X("string"==typeof n?[n,["accumulated"],["get",t]]:n);i[t]=a.value,o[t]=l.value;}return t.map=e=>{r.properties=e;const t={};for(const e of a)t[e]=i[e].evaluate(n,r);return t},t.reduce=(e,t)=>{r.properties=t;for(const t of a)n.accumulated=e[t],e[t]=o[t].evaluate(n,r);},t}(s)).load(a.features):s.dynamic?this._dynamicIndex:function(e,t){return new me(e,t)}(a,s.geojsonVtOptions);}catch(e){return i(e)}const r={};if(n){const e=t(o);e&&(r.resourceTiming={},r.resourceTiming[s.source]=JSON.parse(JSON.stringify(e)));}i(null,r);}}));}reloadTile(e,t){const s=this.loaded;return s&&s[e.uid]?e.partial?t(null,void 0):super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,s){if(t.request)e.n(t.request,s);else {if("string"!=typeof t.data)return s(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));try{return s(null,JSON.parse(t.data))}catch(e){return s(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 be{constructor(t,s){this.tileID=new e.aH(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=t.projection,this.brightness=s;}parse(t,s,i,o){this.status="parsing";const n=new e.aH(i.tileID.overscaledZ,i.tileID.wrap,i.tileID.canonical.z,i.tileID.canonical.x,i.tileID.canonical.y),r=[],a=s.familiesBySource[i.source],l=new e.e0(n,i.promoteId);return l.bucketLayerIDs=[],l.is3DTile=!0,e.ei(t).then((t=>{if(!t)return o(new Error("Could not parse tile"));const s=e.ej(t,1/e.cd(i.tileID.canonical)),c=t.json.extensionsUsed&&t.json.extensionsUsed.includes("MAPBOX_mesh_features")||t.json.asset.extras&&t.json.asset.extras.MAPBOX_mesh_features,h=t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression"),u=new e.aa(this.zoom,{brightness:this.brightness});for(const t in a)for(const i of a[t]){const t=i[0];l.bucketLayerIDs.push(i.map((t=>e.C(t.id,t.scope)))),t.recalculate(u,[]);const o=new e.ek(i,s,n,c,h,this.brightness,l);c||(o.needsUpload=!0),r.push(o),o.evaluate(t);}this.status="done",o(null,{buckets:r,featureIndex:l,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null});})).catch((e=>o(new Error(e.message))))}}class ve{constructor(e,t,s,i,o,n){this.actor=e,this.layerIndex=t,this.availableImages=s,this.brightness=n,this.loading={},this.loaded={};}loadTile(t,s){const i=t.uid,o=this.loading[i]=new be(t,this.brightness);e.bj(t.request,((e,n)=>{const r=!this.loading[i];return delete this.loading[i],r||e?(o.status="done",r||(this.loaded[i]=o),s(e)):n&&0!==n.byteLength?void o.parse(n,this.layerIndex,t,((e,t)=>{o.status="done",this.loaded=this.loaded||{},this.loaded[i]=o,e||!t?s(e):s(null,t);})):(o.status="done",this.loaded[i]=o,s())}));}reloadTile(e,t){const s=this.loaded,i=e.uid;if(s&&s[i]){const o=s[i];o.projection=e.projection,o.brightness=e.brightness;const n=(s,i)=>{o.reloadCallback&&(delete o.reloadCallback,this.loadTile(e,t)),t(s,i);};"parsing"===o.status?o.reloadCallback=n:"done"===o.status&&this.loadTile(e,t);}}abortTile(e,t){const s=e.uid;this.loading[s]&&delete this.loading[s],t();}removeTile(e,t){const s=this.loaded,i=e.uid;s&&s[i]&&delete s[i],t();}}class Ie{constructor(t){this.self=t,this.actor=new e.el(t,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.imageRasterizer=new e.y,this.projections={},this.defaultProjection=e.bP({name:"mercator"}),this.workerSourceTypes={vector:c,geojson:we,"raster-dem":h,"raster-array":d,"batched-model":ve},this.workerSources={},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.em.isParsed())throw new Error("RTL text plugin already registered.");e.em.applyArabicShaping=t.applyArabicShaping,e.em.processBidirectionalText=t.processBidirectionalText,e.em.processStyledBidirectionalText=t.processStyledBidirectionalText;};}clearCaches(e,t,s){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],s();}checkIfReady(e,t,s){s();}setReferrer(e,t){this.referrer=t;}spriteLoaded(t,{scope:s,isLoaded:i}){if(this.isSpriteLoaded[t]||(this.isSpriteLoaded[t]={}),this.isSpriteLoaded[t][s]=i,this.workerSources[t]&&this.workerSources[t][s])for(const o in this.workerSources[t][s]){const n=this.workerSources[t][s][o];for(const t in n){const s=n[t];s instanceof c&&(s.isSpriteLoaded=i,s.fire(new e.A("isSpriteLoaded")));}}}setImages(e,{scope:t,images:s},i){if(this.availableImages[e]||(this.availableImages[e]={}),this.availableImages[e][t]=s,this.workerSources[e]&&this.workerSources[e][t]){for(const i in this.workerSources[e][t]){const o=this.workerSources[e][t][i];for(const e in o)o[e].availableImages=s;}i();}else i();}setProjection(t,s){this.projections[t]=e.bP(s);}setBrightness(e,t,s){this.brightness=t,s();}setLayers(e,t,s){this.getLayerIndex(e,t.scope).replace(t.layers,t.options),s();}updateLayers(e,t,s){this.getLayerIndex(e,t.scope).update(t.layers,t.removedIds,t.options),s();}loadTile(e,t,s){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).loadTile(t,s);}decodeRasterArray(e,t,s){this.getWorkerSource(e,t.type,t.source,t.scope).decodeRasterArray(t,s);}reloadTile(e,t,s){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).reloadTile(t,s);}abortTile(e,t,s){this.getWorkerSource(e,t.type,t.source,t.scope).abortTile(t,s);}removeTile(e,t,s){this.getWorkerSource(e,t.type,t.source,t.scope).removeTile(t,s);}removeSource(e,t,s){if(!(this.workerSources[e]&&this.workerSources[e][t.scope]&&this.workerSources[e][t.scope][t.type]&&this.workerSources[e][t.scope][t.type][t.source]))return;const i=this.workerSources[e][t.scope][t.type][t.source];delete this.workerSources[e][t.scope][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,s):s();}loadWorkerSource(e,t,s){try{this.self.importScripts(t.url),s();}catch(e){s(e.toString());}}syncRTLPluginState(t,s,i){try{e.em.setState(s);const t=e.em.getPluginURL();if(e.em.isLoaded()&&!e.em.isParsed()&&null!=t){this.self.importScripts(t);const s=e.em.isParsed();i(s?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),s);}}catch(e){i(e.toString());}}setDracoUrl(e,t){this.dracoUrl=t;}getAvailableImages(e,t){this.availableImages[e]||(this.availableImages[e]={});let s=this.availableImages[e][t];return s||(s=[]),s}getLayerIndex(e,t){this.layerIndexes[e]||(this.layerIndexes[e]={});let s=this.layerIndexes[e][t];return s||(s=this.layerIndexes[e][t]=new o,s.scope=t),s}getWorkerSource(e,t,s,i){const o=this.workerSources;return o[e]||(o[e]={}),o[e][i]||(o[e][i]={}),o[e][i][t]||(o[e][i][t]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),o[e][i][t][s]||(o[e][i][t][s]=new this.workerSourceTypes[t]({send:(t,s,i,o,n,r)=>{this.actor.send(t,s,i,e,n,r);},scheduler:this.actor.scheduler},this.getLayerIndex(e,i),this.getAvailableImages(e,i),this.isSpriteLoaded[e][i],void 0,this.brightness)),o[e][i][t][s]}rasterizeImages(e,t,s){const i=new Map;for(const[s,{image:o,imageVariant:n}]of t.tasks.entries()){const r=this.imageRasterizer.rasterize(n,o,t.scope,e);i.set(s,r);}s(void 0,i);}removeRasterizedImages(e,t,s){this.imageRasterizer.removeImagesFromCacheByIds(t.imageIds,t.scope,e),s();}enforceCacheSizeLimit(t,s){e.en(s);}getWorkerPerformanceMetrics(e,t,s){s(void 0,void 0);}}return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Ie(self)),Ie}));

define(["./shared"],(function(e){var t="3.11.1";const i={create:"create",load:"load",fullLoad:"fullLoad"},o={mark(e){performance.mark(e);},measure(e,t,i){performance.measure(e,t,i);}};function s(t){const i=t.name.split("?")[0];return e.a(i)&&i.includes("mapbox-gl.js")?"javascript":e.a(i)&&i.includes("mapbox-gl.css")?"css":e.b(i)?"fontRange":e.c(i)?"sprite":e.i(i)?"style":e.d(i)?"tilejson":"other"}var r,n={},a=function(){if(r)return n;function e(e){return !t(e)}function t(t){return "undefined"==typeof window||"undefined"==typeof document?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return !1;var e,t,i=new Blob([""],{type:"text/javascript"}),o=URL.createObjectURL(i);try{t=new Worker(o),e=!0;}catch(t){e=!1;}return t&&t.terminate(),URL.revokeObjectURL(o),e}()?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return !1;var i=t.getImageData(0,0,1,1);return i&&i.width===e.width}()?(void 0===i[o=t&&t.failIfMajorPerformanceCaveat]&&(i[o]=function(t){var i,o=function(t){var i=document.createElement("canvas"),o=Object.create(e.webGLContextAttributes);return o.failIfMajorPerformanceCaveat=t,i.getContext("webgl2",o)}(t);if(!o)return !1;try{i=o.createShader(o.VERTEX_SHADER);}catch(e){return !1}return !(!i||o.isContextLost())&&(o.shaderSource(i,"void main() {}"),o.compileShader(i),!0===o.getShaderParameter(i,o.COMPILE_STATUS))}(o)),i[o]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var o;}r=1,n.supported=e,n.notSupportedReason=t;var i={};return e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},n}();function l(e,t,i){const o=document.createElement(e);return null!=t&&(o.className=t),i&&i.appendChild(o),o}function c(e,t,i){const o=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e of Object.keys(t))o.setAttributeNS(null,e,String(t[e]));return i&&i.appendChild(o),o}const h="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,d=h&&void 0!==h.userSelect?"userSelect":"WebkitUserSelect";let u;function _(){h&&d&&(u=h[d],h[d]="none");}function p(){h&&d&&(h[d]=u);}function f(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",f,!0);}function m(){window.addEventListener("click",f,!0),window.setTimeout((()=>{window.removeEventListener("click",f,!0);}),0);}function g(e,t){const i=e.getBoundingClientRect();return x(e,i,t)}function v(e,t){const i=e.getBoundingClientRect(),o=[];for(let s=0;s<t.length;s++)o.push(x(e,i,t[s]));return o}function y(e){return /firefox/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)&&2===e.button&&e.ctrlKey?0:e.button}function x(t,i,o){const s=t.offsetWidth===i.width?1:t.offsetWidth/i.width;return new e.P((o.clientX-i.left)*s,(o.clientY-i.top)*s)}const b="01",w="NO_ACCESS_TOKEN";class T{constructor(e,t,i){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!i,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",b,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(i,o){if(!e.f(i))return i;const s=S(i);return s.params.push(`sdk=js-${t}`),s.path=`/styles/v1${s.path}`,this._makeAPIURL(s,this._customAccessToken||o)}normalizeGlyphsURL(t,i){if(!e.f(t))return t;const o=S(t);return o.path=`/fonts/v1${o.path}`,this._makeAPIURL(o,this._customAccessToken||i)}normalizeModelURL(t,i){if(!e.f(t))return t;const o=S(t);return o.path=`/models/v1${o.path}`,this._makeAPIURL(o,this._customAccessToken||i)}normalizeSourceURL(t,i,o,s){if(!e.f(t))return t;const r=S(t);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),o&&r.params.push(`language=${o}`),s&&r.params.push(`worldview=${s}`),this._makeAPIURL(r,this._customAccessToken||i)}normalizeIconsetURL(t,i){const o=S(t);return e.f(t)?(o.path=`/styles/v1${o.path}/iconset.pbf`,this._makeAPIURL(o,this._customAccessToken||i)):C(o)}normalizeSpriteURL(t,i,o,s){const r=S(t);return e.f(t)?(r.path=`/styles/v1${r.path}/sprite${i}${o}`,this._makeAPIURL(r,this._customAccessToken||s)):(r.path+=`${i}${o}`,C(r))}normalizeTileURL(t,i,o){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!e.f(t))return t;const s=S(t);s.path=s.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${i||o&&"raster"!==s.authority&&512===o?"@2x":""}${e.m.supported?".webp":"$1"}`),"raster"===s.authority?s.path=`/${e.e.RASTER_URL_PREFIX}${s.path}`:"rasterarrays"===s.authority?s.path=`/${e.e.RASTERARRAYS_URL_PREFIX}${s.path}`:"3dtiles"===s.authority?s.path=`/${e.e.TILES3D_URL_PREFIX}${s.path}`:(s.path=s.path.replace(/^.+\/v4\//,"/"),s.path=`/${e.e.TILE_URL_VERSION}${s.path}`);const r=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(s.params)||e.e.ACCESS_TOKEN;return e.e.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&s.params.push(`sku=${this._skuToken}`),this._makeAPIURL(s,r)}canonicalizeTileURL(t,i){const o=S(t);if(!o.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!o.path.match(/\.[\w]+$/))return t;let s="mapbox://";o.path.match(/^\/raster\/v1\//)?s+=`raster/${o.path.replace(`/${e.e.RASTER_URL_PREFIX}/`,"")}`:o.path.match(/^\/rasterarrays\/v1\//)?s+=`rasterarrays/${o.path.replace(`/${e.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:s+=`tiles/${o.path.replace(`/${e.e.TILE_URL_VERSION}/`,"")}`;let r=o.params;return i&&(r=r.filter((e=>!e.match(/^access_token=/)))),r.length&&(s+=`?${r.join("&")}`),s}canonicalizeTileset(t,i){const o=!!i&&e.f(i),s=[];for(const i of t.tiles||[])e.h(i)?s.push(this.canonicalizeTileURL(i,o)):s.push(i);return s}_makeAPIURL(t,i){const o="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",s=S(e.e.API_URL);if(t.protocol=s.protocol,t.authority=s.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1);}if("/"!==s.path&&(t.path=`${s.path}${t.path}`),!e.e.REQUIRE_ACCESS_TOKEN)return C(t);if(i=i||e.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!i)throw new Error(`An API access token is required to use Mapbox GL. ${o}`);if("s"===i[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${o}`)}return t.params=t.params.filter((e=>-1===e.indexOf("access_token"))),t.params.push(`access_token=${i||""}`),C(t)}}const E=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function S(e){const t=e.match(E);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 C(e){const t=e.params.length?`?${e.params.join("&")}`:"";return `${e.protocol}://${e.authority}${e.path}${t}`}const I="mapbox.eventData";function R(t){if(!t)return null;const i=t.split(".");if(!i||3!==i.length)return null;try{return JSON.parse(e.j(i[1]))}catch(e){return null}}class D{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null;}getStorageKey(t){const i=R(e.e.ACCESS_TOKEN);let o="";return o=i&&i.u?e.k(i.u):e.e.ACCESS_TOKEN||"",t?`${I}.${t}:${o}`:`${I}:${o}`}fetchEventData(){const t=e.s("localStorage"),i=this.getStorageKey(),o=this.getStorageKey("uuid");if(t)try{const e=localStorage.getItem(i);e&&(this.eventData=JSON.parse(e));const t=localStorage.getItem(o);t&&(this.anonId=t);}catch(t){e.w("Unable to read from LocalStorage");}}saveEventData(){const t=e.s("localStorage"),i=this.getStorageKey(),o=this.getStorageKey("uuid"),s=this.anonId;if(t&&s)try{localStorage.setItem(o,s),Object.keys(this.eventData).length>=1&&localStorage.setItem(i,JSON.stringify(this.eventData));}catch(t){e.w("Unable to write to LocalStorage");}}processRequests(e){}postEvent(t,i,o,s){if(!e.e.EVENTS_URL)return;const r=S(e.e.EVENTS_URL);r.params.push(`access_token=${s||e.e.ACCESS_TOKEN||""}`);const n={event:this.type,created:new Date(t).toISOString()},a=i?e.l(n,i):n,l={url:C(r),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=e.p(l,(e=>{this.pendingRequest=null,o(e),this.saveEventData(),this.processRequests(s);}));}queueRequest(e,t){this.queue.push(e),this.processRequests(t);}}const A=new class extends D{constructor(e){super("appUserTurnstile"),this._customAccessToken=e;}postTurnstileEvent(t,i){e.e.EVENTS_URL&&e.e.ACCESS_TOKEN&&Array.isArray(t)&&t.some((t=>e.f(t)||e.h(t)))&&this.queueRequest(Date.now(),i);}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const o=R(e.e.ACCESS_TOKEN),s=o?o.u:e.e.ACCESS_TOKEN;let r=s!==this.eventData.tokenU;e.v(this.anonId)||(this.anonId=e.u(),r=!0);const n=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(n),i=(n-this.eventData.lastSuccess)/864e5;r=r||i>=1||i<-1||e.getDate()!==t.getDate();}else r=!0;r?this.postEvent(n,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=n,this.eventData.tokenU=s);}),i):this.processRequests();}},L=A.postTurnstileEvent.bind(A),P=new class extends D{constructor(){super("map.load"),this.success={},this.skuToken="";}postMapLoadEvent(t,i,o,s){this.skuToken=i,this.errorCb=s,e.e.EVENTS_URL&&(o||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},o):this.errorCb(new Error(w)));}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;const{id:o,timestamp:s}=this.queue.shift();o&&this.success[o]||(this.anonId||this.fetchEventData(),e.v(this.anonId)||(this.anonId=e.u()),this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:b,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):o&&(this.success[o]=!0);}),i));}remove(){this.errorCb=null;}},M=P.postMapLoadEvent.bind(P),z=new class extends D{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap;}getMapInstanceId(t){let i=this.mapInstanceIdMap.get(t);return i||(i=e.u(),this.mapInstanceIdMap.set(t,i)),i}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(t,i){const{map:o,style:s,importedStyles:r}=i;if(!e.e.EVENTS_URL||!t&&!e.e.ACCESS_TOKEN)return;const n=this.getMapInstanceId(o),a={mapInstanceId:n,eventId:this.getEventId(n),style:s};r.length&&(a.importedStyles=r),this.queueRequest({timestamp:Date.now(),payload:a},t);}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:i}=this.queue.shift();this.postEvent(t,i,(()=>{}),e);}},O=z.postStyleLoadEvent.bind(z),F=new class extends D{constructor(){super("gljs.performance");}postPerformanceEvent(t,i){e.e.EVENTS_URL&&(t||e.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:i},t);}processRequests(o){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:r,performanceData:n}=this.queue.shift(),a=function(o){const r=performance.getEntriesByType("resource"),n=performance.getEntriesByType("mark"),a=function(e){const t={};if(e)for(const i in e)if("other"!==i)for(const o of e[i]){const e=`${i}ResolveRangeMin`,s=`${i}ResolveRangeMax`,r=`${i}RequestCount`,n=`${i}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,o.startTime),t[s]=Math.max(t[s]||-1/0,o.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e];};void 0!==o.transferSize&&0===o.transferSize&&a(n),a(r);}return t}(function(e,t){const i={};if(e)for(const o of e){const e=t(o);void 0===i[e]&&(i[e]=[]),i[e].push(o);}return i}(r,s)),l=window.devicePixelRatio,c=navigator.connection||navigator.mozConnection||navigator.webkitConnection,h=c?c.effectiveType:void 0,d={counters:[],metadata:[],attributes:[]},u=(e,t,i)=>{null!=i&&e.push({name:t,value:i.toString()});};for(const e in a)u(d.counters,e,a[e]);if(o.interactionRange[0]!==1/0&&o.interactionRange[1]!==-1/0&&(u(d.counters,"interactionRangeMin",o.interactionRange[0]),u(d.counters,"interactionRangeMax",o.interactionRange[1])),n)for(const e of Object.keys(i)){const t=i[e],o=n.find((e=>e.name===t));o&&u(d.counters,t,o.startTime);}return u(d.counters,"visibilityHidden",o.visibilityHidden),u(d.attributes,"style",function(t){if(t)for(const i of t){const t=i.name.split("?")[0];if(e.i(t)){const e=t.split("/").slice(-2);if(2===e.length)return `mapbox://styles/${e[0]}/${e[1]}`}}}(r)),u(d.attributes,"terrainEnabled",o.terrainEnabled?"true":"false"),u(d.attributes,"fogEnabled",o.fogEnabled?"true":"false"),u(d.attributes,"projection",o.projection),u(d.attributes,"zoom",o.zoom),u(d.metadata,"devicePixelRatio",l),u(d.metadata,"connectionEffectiveType",h),u(d.metadata,"navigatorUserAgent",navigator.userAgent),u(d.metadata,"screenWidth",window.screen.width),u(d.metadata,"screenHeight",window.screen.height),u(d.metadata,"windowWidth",window.innerWidth),u(d.metadata,"windowHeight",window.innerHeight),u(d.metadata,"mapWidth",o.width/l),u(d.metadata,"mapHeight",o.height/l),u(d.metadata,"webglRenderer",o.renderer),u(d.metadata,"webglVendor",o.vendor),u(d.metadata,"sdkVersion",t),u(d.metadata,"sdkIdentifier","mapbox-gl-js"),d}(n);for(const e of a.metadata);for(const e of a.counters);for(const e of a.attributes);this.postEvent(r,a,(()=>{}),o);}},k=F.postPerformanceEvent.bind(F),B=new class extends D{constructor(){super("map.auth"),this.success={},this.skuToken="";}getSession(t,i,o,s){if(!e.e.API_URL||!e.e.SESSION_PATH)return;const r=S(e.e.API_URL+e.e.SESSION_PATH);r.params.push(`sku=${i||""}`),r.params.push(`access_token=${s||e.e.ACCESS_TOKEN||""}`);const n={url:C(r),headers:{"Content-Type":"text/plain"}};this.pendingRequest=e.g(n,(e=>{this.pendingRequest=null,o(e),this.saveEventData(),this.processRequests(s);}));}getSessionAPI(t,i,o,s){this.skuToken=i,this.errorCb=s,e.e.SESSION_PATH&&e.e.API_URL&&(o||e.e.ACCESS_TOKEN?this.queueRequest({id:t,timestamp:Date.now()},o):this.errorCb(new Error(w)));}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0);}),e);}remove(){this.errorCb=null;}},N=B.getSessionAPI.bind(B),U=new Set;function V(e,t){t?U.add(e):U.delete(e);}class G{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={};}isDirty(){return this._changed}setDirty(){this._changed=!0;}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty();}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e];}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty();}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty();}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id];}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty();}getUpdatedImages(e){return this._updatedImages[e]?Array.from(this._updatedImages[e].values()):[]}updateImage(t,i){this._updatedImages[i]=this._updatedImages[i]||new Set,this._updatedImages[i].add(e.I.toString(t)),this.setDirty();}resetUpdatedImages(e){this._updatedImages[e]&&this._updatedImages[e].clear();}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={};}}function j(e){const{userImage:t}=e;return !!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class q extends e.E{constructor(t){super(),this.imageProviders=new Map,this.images=new Map,this.updatedImages=new Map,this.callbackDispatchedThisFrame=new Map,this.loaded=new Map,this.requestors=[],this.patterns=new Map,this.patternsInFlight=new Set,this.atlasImage=new Map,this.atlasTexture=new Map,this.dirty=!0,this.spriteFormat=t,"raster"!==t&&e.t()&&(this.imageRasterizerDispatcher=new e.D(e.x(),this,"Image Rasterizer Worker",1));}addScope(t){this.loaded.set(t,!1),this.imageProviders.set(t,new Map),this.images.set(t,new Map),this.updatedImages.set(t,new Set),this.callbackDispatchedThisFrame.set(t,new Set),this.patterns.set(t,new Map),this.atlasImage.set(t,new e.r({width:1,height:1}));}removeScope(e){this.loaded.delete(e),this.imageProviders.delete(e),this.images.delete(e),this.updatedImages.delete(e),this.callbackDispatchedThisFrame.delete(e),this.patterns.delete(e),this.atlasImage.delete(e);const t=this.atlasTexture.get(e);t&&(t.destroy(),this.atlasTexture.delete(e));}addImageProvider(e,t){this.imageProviders.has(t)||this.imageProviders.set(t,new Map),this.imageProviders.get(t).set(e.id,e);}removeImageProvider(e,t){this.imageProviders.has(t)&&this.imageProviders.get(t).delete(e);}getPendingImageProviders(){const e=[];for(const t of this.imageProviders.values())for(const i of t.values())i.hasPendingRequests()&&e.push(i);return e}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new e.y),this._imageRasterizer}isLoaded(){for(const e of this.loaded.keys())if(!this.loaded.get(e))return !1;return !0}setLoaded(e,t){if(this.loaded.get(t)!==e&&(this.loaded.set(t,e),e)){for(const{ids:e,callback:i}of this.requestors)this._notify(e,t,i);this.requestors=[];}}hasImage(e,t){return !!this.getImage(e,t)}getImage(e,t){return this.images.get(t).get(e.toString())}addImage(e,t,i){this._validate(e,i)&&this.images.get(t).set(e.toString(),i);}_validate(t,i){let o=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new e.z(new Error(`Image "${t.name}" has invalid "stretchX" value`))),o=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new e.z(new Error(`Image "${t.name}" has invalid "stretchY" value`))),o=!1),this._validateContent(i.content,i)||(this.fire(new e.z(new Error(`Image "${t.name}" has invalid "content" value`))),o=!1),o}_validateStretch(e,t){if(!e)return !0;let i=0;for(const o of e){if(o[0]<i||o[1]<o[0]||t<o[1])return !1;i=o[1];}return !0}_validateContent(e,t){if(!e)return !0;if(4!==e.length)return !1;if(!t.usvg){if(e[0]<0||t.data.width<e[0])return !1;if(e[1]<0||t.data.height<e[1])return !1;if(e[2]<0||t.data.width<e[2])return !1;if(e[3]<0||t.data.height<e[3])return !1}return !(e[2]<e[0]||e[3]<e[1])}updateImage(e,t,i){const o=this.images.get(t).get(e.toString());i.version=o.version+1,this.images.get(t).set(e.toString(),i),this.updatedImages.get(t).add(e),this.removeFromImageRasterizerCache(e,t);}clearUpdatedImages(e){this.updatedImages.get(e).clear();}removeFromImageRasterizerCache(t,i){if("raster"!==this.spriteFormat)if(e.t()){const e={imageIds:[t],scope:i};this.imageRasterizerDispatcher.getActor().send("removeRasterizedImages",e);}else this.imageRasterizer.removeImagesFromCacheByIds([t],i);}removeImage(e,t){const i=this.images.get(t),o=i.get(e.toString());i.delete(e.toString()),this.patterns.get(t).delete(e.toString()),this.removeFromImageRasterizerCache(e,t),o.userImage&&o.userImage.onRemove&&o.userImage.onRemove();}listImages(t){return Array.from(this.images.get(t).keys()).map((t=>e.I.from(t)))}getImages(e,t,i){const o=[],s=[],r=this.imageProviders.get(t);for(const i of e){if(!i.iconsetId){o.push(i);continue}const e=r.get(i.iconsetId);e&&(this.getImage(i,t)?s.push(i):e.addPendingRequest(i));}if(0===o.length)return void this._notify(s,t,i);let n=!0;const a=!!this.loaded.get(t),l=this.images.get(t);if(!a)for(const e of o)l.has(e.toString())||(n=!1);a||n?this._notify(o,t,i):this.requestors.push({ids:o,scope:t,callback:i});}rasterizeImages({scope:e,tasks:t},i){const o=new Map;for(const[i,s]of t.entries()){const t=this.getImage(s.id,e);t&&o.set(i,{image:t,imageVariant:s});}this._rasterizeImages(e,o,i);}_rasterizeImages(t,i,o){if(e.t())this.imageRasterizerDispatcher.getActor().send("rasterizeImages",{tasks:i,scope:t},o);else {const e=new Map;for(const[o,{image:s,imageVariant:r}]of i.entries())e.set(o,this.imageRasterizer.rasterize(r,s,t,0));o(void 0,e);}}getUpdatedImages(e){return this.updatedImages.get(e)||new Set}_notify(t,i,o){const s=this.images.get(i),r=new Map;for(const i of t){const t=s.get(i.toString());if(!t){if(i.iconsetId)continue;e.w(`Image "${i.name}" 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.`),this.fire(new e.A("styleimagemissing",{id:i.name}));continue}const o={data:t.usvg?null:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,usvg:t.usvg,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)};t.usvg&&Object.assign(o,{width:t.icon.usvg_tree.width,height:t.icon.usvg_tree.height}),r.set(e.I.toString(i),o);}o(null,r);}getPixelSize(e){const{width:t,height:i}=this.atlasImage.get(e);return {width:t,height:i}}getPattern(t,i,o){const s=t.toString(),r=this.patterns.get(i),n=r.get(s),a=this.getImage(t,i);if(!a)return null;if(n){if(n.position.version===a.version)return n.position;n.position.version=a.version;}else {if(a.usvg&&!a.data){const r=this.getPatternInFlightId(s,i);if(this.patternsInFlight.has(r))return null;this.patternsInFlight.add(r);const n=new e.B(t).scaleSelf(e.q.devicePixelRatio),l=new Map([[n.toString(),{image:a,imageVariant:n}]]);return this._rasterizeImages(i,l,((e,t)=>this.storePatternImage(n,i,a,o,t))),null}this.storePattern(t,i,a);}return this._updatePatternAtlas(i,o),r.get(s).position}getPatternInFlightId(t,i){return e.C(t,i)}hasPatternsInFlight(){return 0!==this.patternsInFlight.size}storePatternImage(e,t,i,o,s){const r=e.toString(),n=s?s.get(r):void 0;n&&(i.data=n,this.storePattern(e.id,t,i),this._updatePatternAtlas(t,o),this.patternsInFlight.delete(this.getPatternInFlightId(e.id.toString(),t)));}storePattern(t,i,o){const s={w:o.data.width+2*e.F,h:o.data.height+2*e.F,x:0,y:0},r=new e.G(s,o,e.F);this.patterns.get(i).set(t.toString(),{bin:s,position:r});}bind(t,i){const o=t.gl;let s=this.atlasTexture.get(i);s?this.dirty&&(s.update(this.atlasImage.get(i)),this.dirty=!1):(s=new e.T(t,this.atlasImage.get(i),o.RGBA8),this.atlasTexture.set(i,s)),s.bind(o.LINEAR,o.CLAMP_TO_EDGE);}_updatePatternAtlas(t,i){const o=this.patterns.get(t),s=Array.from(o.values()).map((({bin:e})=>e)),{w:r,h:n}=e.H(s),a=this.atlasImage.get(t);a.resize({width:r||1,height:n||1});const l=this.images.get(t);for(const[t,{bin:s,position:r}]of o.entries()){let o=r.padding;const n=s.x+o,c=s.y+o,h=l.get(t).data,d=h.width,u=h.height;o=o>1?o-1:o,e.r.copy(h,a,{x:0,y:0},{x:n,y:c},{width:d,height:u},i),e.r.copy(h,a,{x:0,y:u-o},{x:n,y:c-o},{width:d,height:o},i),e.r.copy(h,a,{x:0,y:0},{x:n,y:c+u},{width:d,height:o},i),e.r.copy(h,a,{x:d-o,y:0},{x:n-o,y:c},{width:o,height:u},i),e.r.copy(h,a,{x:0,y:0},{x:n+d,y:c},{width:o,height:u},i),e.r.copy(h,a,{x:d-o,y:u-o},{x:n-o,y:c-o},{width:o,height:o},i),e.r.copy(h,a,{x:0,y:u-o},{x:n+d,y:c-o},{width:o,height:o},i),e.r.copy(h,a,{x:0,y:0},{x:n+d,y:c+u},{width:o,height:o},i),e.r.copy(h,a,{x:d-o,y:0},{x:n-o,y:c+u},{width:o,height:o},i);}this.dirty=!0;}beginFrame(){for(const e of this.images.keys())this.callbackDispatchedThisFrame.set(e,new Set);}dispatchRenderCallbacks(e,t){const i=this.images.get(t);for(const o of e){if(this.callbackDispatchedThisFrame.get(t).has(o.toString()))continue;this.callbackDispatchedThisFrame.get(t).add(o.toString());const e=i.get(o.toString());j(e)&&this.updateImage(o,t,e);}}}function H(t){const i=t.key,o=t.value,s=t.valueSpec||{},r=t.objectElementValidators||{},n=t.style,a=t.styleSpec;let l=[];const c=e.K(o);if("object"!==c)return [new e.V(i,o,`object expected, ${c} found`)];for(const t in o){const c=t.split(".")[0];let h;r[c]?h=r[c]:s[c]?h=_e:r["*"]?h=r["*"]:s["*"]&&(h=_e),h?l=l.concat(h({key:(i?`${i}.`:i)+t,value:o[t],valueSpec:s[c]||s["*"],style:n,styleSpec:a,object:o,objectKey:t},o)):l.push(new e.J(i,o[t],`unknown property "${t}"`));}for(const t in s)r[t]||s[t].required&&void 0===s[t].default&&void 0===o[t]&&l.push(new e.V(i,o,`missing required property "${t}"`));return l}function Z(t){const i=t.value,o=t.valueSpec,s=t.style,r=t.styleSpec,n=t.key,a=t.arrayElementValidator||_e;if("array"!==e.K(i))return [new e.V(n,i,`array expected, ${e.K(i)} found`)];if(o.length&&i.length!==o.length)return [new e.V(n,i,`array length ${o.length} expected, length ${i.length} found`)];if(o["min-length"]&&i.length<o["min-length"])return [new e.V(n,i,`array length at least ${o["min-length"]} expected, length ${i.length} found`)];let l={type:o.value,values:o.values,minimum:o.minimum,maximum:o.maximum,function:void 0};r.$version<7&&(l.function=o.function),"object"===e.K(o.value)&&(l=o.value);let c=[];for(let e=0;e<i.length;e++)c=c.concat(a({array:i,arrayIndex:e,value:i[e],valueSpec:l,style:s,styleSpec:r,key:`${n}[${e}]`},!0));return c}function W(t){const i=t.key,o=t.value,s=t.valueSpec;let r=e.K(o);if("number"===r&&o!=o&&(r="NaN"),"number"!==r)return [new e.V(i,o,`number expected, ${r} found`)];if("minimum"in s){let r=s.minimum;if("array"===e.K(s.minimum)&&(r=s.minimum[t.arrayIndex]),o<r)return [new e.V(i,o,`${o} is less than the minimum value ${r}`)]}if("maximum"in s){let r=s.maximum;if("array"===e.K(s.maximum)&&(r=s.maximum[t.arrayIndex]),o>r)return [new e.V(i,o,`${o} is greater than the maximum value ${r}`)]}return []}function $(t){const i=t.valueSpec,o=e.M(t.value.type);let s,r,n,a={};const l="categorical"!==o&&void 0===t.value.property,c=!l,h="array"===e.K(t.value.stops)&&"array"===e.K(t.value.stops[0])&&"object"===e.K(t.value.stops[0][0]),d=H({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return [new e.V(t.key,t.value,'identity function may not have a "stops" property')];let i=[];const s=t.value;return i=i.concat(Z({key:t.key,value:s,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:u})),"array"===e.K(s)&&0===s.length&&i.push(new e.V(t.key,s,"array must have at least one stop")),i},default:function(e){return _e({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return "identity"===o&&l&&d.push(new e.V(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||d.push(new e.V(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!e.N(t.valueSpec)&&d.push(new e.V(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!e.O(t.valueSpec)?d.push(new e.V(t.key,t.value,"property functions not supported")):l&&!e.Q(t.valueSpec)&&d.push(new e.V(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!h||void 0!==t.value.property||d.push(new e.V(t.key,t.value,'"property" property is required')),d;function u(t){let o=[];const s=t.value,l=t.key;if("array"!==e.K(s))return [new e.V(l,s,`array expected, ${e.K(s)} found`)];if(2!==s.length)return [new e.V(l,s,`array length 2 expected, length ${s.length} found`)];if(h){if("object"!==e.K(s[0]))return [new e.V(l,s,`object expected, ${e.K(s[0])} found`)];if(void 0===s[0].zoom)return [new e.V(l,s,"object stop key must have zoom")];if(void 0===s[0].value)return [new e.V(l,s,"object stop key must have value")];const i=e.M(s[0].zoom);if("number"!=typeof i)return [new e.V(l,s[0].zoom,"stop zoom values must be numbers")];if(n&&n>i)return [new e.V(l,s[0].zoom,"stop zoom values must appear in ascending order")];i!==n&&(n=i,r=void 0,a={}),o=o.concat(H({key:`${l}[0]`,value:s[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:W,value:_}}));}else o=o.concat(_({key:`${l}[0]`,value:s[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},s));return e.S(e.U(s[1]))?o.concat([new e.V(`${l}[1]`,s[1],"expressions are not allowed in function stops.")]):o.concat(_e({key:`${l}[1]`,value:s[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function _(t,n){const l=e.K(t.value),c=e.M(t.value),h=null!==t.value?t.value:n;if(s){if(l!==s)return [new e.V(t.key,h,`${l} stop domain type must match previous stop domain type ${s}`)]}else s=l;if("number"!==l&&"string"!==l&&"boolean"!==l&&"number"!=typeof c&&"string"!=typeof c&&"boolean"!=typeof c)return [new e.V(t.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==o){let s=`number expected, ${l} found`;return e.O(i)&&void 0===o&&(s+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e.V(t.key,h,s)]}return "categorical"!==o||"number"!==l||"number"==typeof c&&isFinite(c)&&Math.floor(c)===c?"categorical"!==o&&"number"===l&&"number"==typeof c&&"number"==typeof r&&void 0!==r&&c<r?[new e.V(t.key,h,"stop domain values must appear in ascending order")]:(r=c,"categorical"===o&&c in a?[new e.V(t.key,h,"stop domain values must be unique")]:(a[c]=!0,[])):[new e.V(t.key,h,`integer expected, found ${String(c)}`)]}}function X(t){const i=("property"===t.expressionContext?e.W:e.X)(e.U(t.value),t.valueSpec);if("error"===i.result)return i.value.map((i=>new e.V(`${t.key}${i.key}`,t.value,i.message)));const o=i.value.expression||i.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!o.outputDefined())return [new e.V(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!e.Y(o))return [new e.V(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return K(o,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!e.Z(o,["zoom","feature-state"]))return [new e.V(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!e._(o))return [new e.V(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return []}function K(t,i){const o=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(i.valueSpec&&i.valueSpec.expression)for(const e of i.valueSpec.expression.parameters)o.delete(e);if(0===o.size)return [];const s=[];return t instanceof e.$&&o.has(t.name)?[new e.V(i.key,i.value,`["${t.name}"] expression is not supported in a filter for a ${i.object.type} layer with id: ${i.object.id}`)]:(t.eachChild((e=>{s.push(...K(e,i));})),s)}function Y(t){const i=t.key,o=t.value,s=t.valueSpec,r=[];return Array.isArray(s.values)?-1===s.values.indexOf(e.M(o))&&r.push(new e.V(i,o,`expected one of [${s.values.join(", ")}], ${JSON.stringify(o)} found`)):-1===Object.keys(s.values).indexOf(e.M(o))&&r.push(new e.V(i,o,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(o)} found`)),r}function J(t){return e.a1(e.U(t.value))?X(e.L({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):Q(t)}function Q(t){const i=t.value,o=t.key;if("array"!==e.K(i))return [new e.V(o,i,`array expected, ${e.K(i)} found`)];const s=t.styleSpec;let r,n=[];if(i.length<1)return [new e.V(o,i,"filter array must have at least 1 element")];switch(n=n.concat(Y({key:`${o}[0]`,value:i[0],valueSpec:s.filter_operator,style:t.style,styleSpec:t.styleSpec})),e.M(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===e.M(i[1])&&n.push(new e.V(o,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":3!==i.length&&n.push(new e.V(o,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(r=e.K(i[1]),"string"!==r&&n.push(new e.V(`${o}[1]`,i[1],`string expected, ${r} found`)));for(let a=2;a<i.length;a++)r=e.K(i[a]),"$type"===e.M(i[1])?n=n.concat(Y({key:`${o}[${a}]`,value:i[a],valueSpec:s.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&n.push(new e.V(`${o}[${a}]`,i[a],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let e=1;e<i.length;e++)n=n.concat(Q({key:`${o}[${e}]`,value:i[e],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":r=e.K(i[1]),2!==i.length?n.push(new e.V(o,i,`filter array for "${i[0]}" operator must have 2 elements`)):"string"!==r&&n.push(new e.V(`${o}[1]`,i[1],`string expected, ${r} found`));}return n}function ee(t,i){const o=t.key,s=t.style,r=t.layer,n=t.styleSpec,a=t.value,l=t.objectKey,c=n[`${i}_${t.layerType}`];if(!c)return [];const h=l.match(/^(.*)-use-theme$/);if("paint"===i&&h&&c[h[1]])return e.S(a)?[].concat(_e({key:t.key,value:a,valueSpec:{type:"string",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},style:s,styleSpec:n,expressionContext:"property",propertyType:i,propertyKey:l})):_e({key:o,value:a,valueSpec:{type:"string"},style:s,styleSpec:n});const d=l.match(/^(.*)-transition$/);if("paint"===i&&d&&c[d[1]]&&c[d[1]].transition)return _e({key:o,value:a,valueSpec:n.transition,style:s,styleSpec:n});const u=t.valueSpec||c[l];if(!u)return [new e.J(o,a,`unknown property "${l}"`)];let _;if("string"===e.K(a)&&e.O(u)&&!u.tokens&&(_=/^{([^}]+)}$/.exec(a))){const t=`\`{ "type": "identity", "property": ${_?JSON.stringify(_[1]):'"_"'} }\``;return [new e.V(o,a,`"${l}" does not support interpolation syntax\nUse an identity property function instead: ${t}.`)]}const p=[];if("symbol"===t.layerType)"text-field"!==l||!s||s.glyphs||s.imports||p.push(new e.V(o,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===l&&e.a2(e.U(a))&&"identity"===e.M(a.type)&&p.push(new e.V(o,a,'"text-font" does not support identity functions'));else if("model"===t.layerType&&"paint"===i&&r&&r.layout&&r.layout.hasOwnProperty("model-id")&&e.O(u)&&(e.a3(u)||e.Q(u))){const t=e.W(e.U(a),u),i=t.value.expression||t.value._styleExpression.expression;i&&!e.Z(i,["measure-light"])&&("model-emissive-strength"===l&&e._(i)&&e.Y(i)||p.push(new e.V(o,a,`${l} does not support measure-light expressions when the model layer source is vector tile or GeoJSON.`)));}return p.concat(_e({key:t.key,value:a,valueSpec:u,style:s,styleSpec:n,expressionContext:"property",propertyType:i,propertyKey:l}))}function te(e){return ee(e,"paint")}function ie(e){return ee(e,"layout")}function oe(t){let i=[];const o=t.value,s=t.key,r=t.style,n=t.styleSpec;o.type||o.ref||i.push(new e.V(s,o,'either "type" or "ref" is required'));let a=e.M(o.type);const l=e.M(o.ref);if(o.id){const n=e.M(o.id);for(let a=0;a<t.arrayIndex;a++){const t=r.layers[a];e.M(t.id)===n&&i.push(new e.V(s,o.id,`duplicate layer id "${o.id}", previously used at line ${t.id.__line__}`));}}if("ref"in o){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in o&&i.push(new e.V(s,o[t],`"${t}" is prohibited for ref layers`));})),r.layers.forEach((i=>{e.M(i.id)===l&&(t=i);})),t?t.ref?i.push(new e.V(s,o.ref,"ref cannot reference another ref layer")):a=e.M(t.type):"string"==typeof l&&i.push(new e.V(s,o.ref,`ref layer "${l}" not found`));}else if("background"!==a&&"sky"!==a&&"slot"!==a)if(o.source){const t=r.sources&&r.sources[o.source],n=t&&e.M(t.type);t?"vector"===n&&"raster"===a?i.push(new e.V(s,o.source,`layer "${o.id}" requires a raster source`)):"raster"===n&&"raster"!==a?i.push(new e.V(s,o.source,`layer "${o.id}" requires a vector source`)):"vector"!==n||o["source-layer"]?"raster-dem"===n&&"hillshade"!==a?i.push(new e.V(s,o.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==n||["raster","raster-particle"].includes(a)?"line"!==a||!o.paint||!o.paint["line-gradient"]&&!o.paint["line-trim-offset"]||"geojson"===n&&t.lineMetrics?"raster-particle"===a&&"raster-array"!==n&&i.push(new e.V(s,o.source,`layer "${o.id}" requires a 'raster-array' source.`)):i.push(new e.V(s,o,`layer "${o.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new e.V(s,o.source,"raster-array source can only be used with layer type 'raster'.")):i.push(new e.V(s,o,`layer "${o.id}" must specify a "source-layer"`)):i.push(new e.V(s,o.source,`source "${o.source}" not found`));}else i.push(new e.V(s,o,'missing required property "source"'));return i=i.concat(H({key:s,value:o,valueSpec:n.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>_e({key:`${s}.type`,value:o.type,valueSpec:n.layer.type,style:t.style,styleSpec:t.styleSpec,object:o,objectKey:"type"}),filter:t=>J(e.L({layerType:a},t)),layout:t=>H({layer:o,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>ie(e.L({layerType:a},t))}}),paint:t=>H({layer:o,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>te(e.L({layerType:a,layer:o},t))}})}})),i}function se(t){const i=t.value,o=t.key,s=e.K(i);return "string"!==s?[new e.V(o,i,`string expected, ${s} found`)]:[]}const re={promoteId:function t({key:i,value:o}){if("string"===e.K(o))return se({key:i,value:o});if(Array.isArray(o)){const t=[],s=e.U(o),r=e.X(s);return "error"===r.result&&r.value.forEach((o=>{t.push(new e.V(`${i}${o.key}`,null,`${o.message}`));})),e.Z(r.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||t.push(new e.V(`${i}`,null,"promoteId expression should be only feature dependent")),t}{const e=[];for(const s in o)e.push(...t({key:`${i}.${s}`,value:o[s]}));return e}}};function ne(t){const i=t.value,o=t.key,s=t.styleSpec,r=t.style;if(!i.type)return [new e.V(o,i,'"type" is required')];const n=e.M(i.type);let a=[];switch(["vector","raster","raster-dem","raster-array"].includes(n)&&(i.url||i.tiles||a.push(new e.J(o,i,'Either "url" or "tiles" is required.'))),n){case"vector":case"raster":case"raster-dem":case"raster-array":return a=a.concat(H({key:o,value:i,valueSpec:s[`source_${n.replace("-","_")}`],style:t.style,styleSpec:s,objectElementValidators:re})),a;case"geojson":if(a=H({key:o,value:i,valueSpec:s.source_geojson,style:r,styleSpec:s,objectElementValidators:re}),i.cluster)for(const e in i.clusterProperties){const[t,s]=i.clusterProperties[e],r="string"==typeof t?[t,["accumulated"],["get",e]]:t;a.push(...X({key:`${o}.${e}.map`,value:s,expressionContext:"cluster-map"})),a.push(...X({key:`${o}.${e}.reduce`,value:r,expressionContext:"cluster-reduce"}));}return a;case"video":return H({key:o,value:i,valueSpec:s.source_video,style:r,styleSpec:s});case"image":return H({key:o,value:i,valueSpec:s.source_image,style:r,styleSpec:s});case"canvas":return [new e.V(o,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Y({key:`${o}.type`,value:i.type,valueSpec:{values:ae(s)},style:r,styleSpec:s})}}function ae(e){return e.source.reduce(((t,i)=>{const o=e[i];return "enum"===o.type.type&&(t=t.concat(Object.keys(o.type.values))),t}),[])}function le(t){const i=t.value,o=t.styleSpec,s=o.light,r=t.style;let n=[];const a=e.K(i);if(void 0===i)return n;if("object"!==a)return n=n.concat([new e.V("light",i,`object expected, ${a} found`)]),n;for(const t in i){const a=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);n=n.concat(l&&s[l[1]]?_e({key:t,value:i[t],valueSpec:{type:"string"},style:r,styleSpec:o}):a&&s[a[1]]&&s[a[1]].transition?_e({key:t,value:i[t],valueSpec:o.transition,style:r,styleSpec:o}):s[t]?_e({key:t,value:i[t],valueSpec:s[t],style:r,styleSpec:o}):[new e.V(t,i[t],`unknown property "${t}"`)]);}return n}function ce(t){const i=t.value;let o=[];if(!i)return o;const s=e.K(i);if("object"!==s)return o=o.concat([new e.V("light-3d",i,`object expected, ${s} found`)]),o;const r=t.styleSpec,n=r["light-3d"],a=t.key,l=t.style,c=t.style.lights;for(const t of ["type","id"])if(!(t in i))return o=o.concat([new e.V("light-3d",i,`missing property ${t} on light`)]),o;if(i.type&&c)for(let s=0;s<t.arrayIndex;s++){const t=e.M(i.type),r=c[s];e.M(r.type)===t&&o.push(new e.V(a,i.id,`duplicate light type "${i.type}", previously defined at line ${r.id.__line__}`));}const h=`properties_light_${i.type}`;if(!(h in r))return o=o.concat([new e.V("light-3d",i,`Invalid light type ${i.type}`)]),o;const d=r[h];for(const s in i)if("properties"===s){const n=i[s],a=e.K(n);if("object"!==a)return o=o.concat([new e.V("properties",n,`object expected, ${a} found`)]),o;for(const i in n)o=o.concat(d[i]?_e({key:i,value:n[i],valueSpec:d[i],style:l,styleSpec:r}):[new e.J(t.key,n[i],`unknown property "${i}"`)]);}else {const t=s.match(/^(.*)-transition$/),a=s.match(/^(.*)-use-theme$/);o=o.concat(a&&n[a[1]]?_e({key:s,value:i[s],valueSpec:{type:"string"},style:l,styleSpec:r}):t&&n[t[1]]&&n[t[1]].transition?_e({key:s,value:i[s],valueSpec:r.transition,style:l,styleSpec:r}):n[s]?_e({key:s,value:i[s],valueSpec:n[s],style:l,styleSpec:r}):[new e.J(s,i[s],`unknown property "${s}"`)]);}return o}function he(t){const i=t.value,o=t.key,s=t.style,r=t.styleSpec,n=r.terrain;let a=[];const l=e.K(i);if(void 0===i)return a;if("null"===l)return a;if("object"!==l)return a=a.concat([new e.V("terrain",i,`object expected, ${l} found`)]),a;for(const t in i){const o=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);a=a.concat(l&&n[l[1]]?_e({key:t,value:i[t],valueSpec:{type:"string"},style:s,styleSpec:r}):o&&n[o[1]]&&n[o[1]].transition?_e({key:t,value:i[t],valueSpec:r.transition,style:s,styleSpec:r}):n[t]?_e({key:t,value:i[t],valueSpec:n[t],style:s,styleSpec:r}):[new e.J(t,i[t],`unknown property "${t}"`)]);}if(i.source){const t=s.sources&&s.sources[i.source],r=t&&e.M(t.type);t?"raster-dem"!==r&&a.push(new e.V(o,i.source,`terrain cannot be used with a source of type ${String(r)}, it only be used with a "raster-dem" source type`)):a.push(new e.V(o,i.source,`source "${i.source}" not found`));}else a.push(new e.V(o,i,'terrain is missing required property "source"'));return a}function de(t){const i=t.value,o=t.style,s=t.styleSpec,r=s.fog;let n=[];const a=e.K(i);if(void 0===i)return n;if("object"!==a)return n=n.concat([new e.V("fog",i,`object expected, ${a} found`)]),n;for(const t in i){const a=t.match(/^(.*)-transition$/),l=t.match(/^(.*)-use-theme$/);n=n.concat(l&&r[l[1]]?_e({key:t,value:i[t],valueSpec:{type:"string"},style:o,styleSpec:s}):a&&r[a[1]]&&r[a[1]].transition?_e({key:t,value:i[t],valueSpec:s.transition,style:o,styleSpec:s}):r[t]?_e({key:t,value:i[t],valueSpec:r[t],style:o,styleSpec:s}):[new e.J(t,i[t],`unknown property "${t}"`)]);}return n}const ue={"*":()=>[],array:Z,boolean:function(t){const i=t.value,o=t.key,s=e.K(i);return "boolean"!==s?[new e.V(o,i,`boolean expected, ${s} found`)]:[]},number:W,color:function(t){const i=t.key,o=t.value,s=e.K(o);return "string"!==s?[new e.V(i,o,`color expected, ${s} found`)]:null===e.a0.parseCSSColor(o)?[new e.V(i,o,`color expected, "${o}" found`)]:[]},enum:Y,filter:J,function:$,layer:oe,object:H,source:ne,model:e.a4,light:le,"light-3d":ce,terrain:he,fog:de,string:se,formatted:function(e){return 0===se(e).length?[]:X(e)},resolvedImage:function(e){return 0===se(e).length?[]:X(e)},projection:function(t){const i=t.value,o=t.styleSpec,s=o.projection,r=t.style;let n=[];const a=e.K(i);if("object"===a)for(const e in i)n=n.concat(_e({key:e,value:i[e],valueSpec:s[e],style:r,styleSpec:o}));else "string"!==a&&(n=n.concat([new e.V("projection",i,`object or string expected, ${a} found`)]));return n},import:function(t){const{value:i,styleSpec:o}=t,{data:s,...r}=i;Object.defineProperty(r,"__line__",{value:i.__line__,enumerable:!1});let n=H(e.L({},t,{value:r,valueSpec:o.import}));return ""===e.M(r.id)&&n.push(new e.V(`${t.key}.id`,r,"import id can't be an empty string")),s&&(n=n.concat(fe(s,o,{key:`${t.key}.data`}))),n},iconset:function(t){const i=t.value,o=t.key,s=t.styleSpec,r=t.style;if(!i.type)return [new e.V(o,i,'"type" is required')];const n=e.M(i.type);let a=[];if(a=a.concat(H({key:o,value:i,valueSpec:s[`iconset_${n}`],style:r,styleSpec:s})),"source"===n&&i.source){const t=r.sources&&r.sources[i.source],s=t&&e.M(t.type);t?"raster-array"!==s&&a.push(new e.V(o,i.source,`iconset cannot be used with a source of type ${String(s)}, it only be used with a "raster-array" source type`)):a.push(new e.V(o,i.source,`source "${i.source}" not found`));}return a}};function _e(t,i=!1){const o=t.value,s=t.valueSpec,r=t.styleSpec;if(s.expression&&e.a2(e.M(o)))return $(t);if(s.expression&&e.S(e.U(o)))return X(t);if(s.type&&ue[s.type]){const o=ue[s.type](t);return !0===i&&o.length>0&&"array"===e.K(t.value)?X(t):o}return H(e.L({},t,{valueSpec:s.type?r[s.type]:s}))}function pe(t){const i=t.value,o=t.key,s=se(t);return s.length||(-1===i.indexOf("{fontstack}")&&s.push(new e.V(o,i,'"glyphs" url must include a "{fontstack}" token')),-1===i.indexOf("{range}")&&s.push(new e.V(o,i,'"glyphs" url must include a "{range}" token'))),s}function fe(t,i=e.a5,o={}){return _e({key:o.key||"",value:t,valueSpec:i.$root,styleSpec:i,style:t,objectElementValidators:{glyphs:pe,"*":()=>[]}})}function me(t,i=e.a5){return De(fe(t,i))}const ge=e=>De(ne(e)),ve=e=>De(le(e)),ye=e=>De(ce(e)),xe=e=>De(he(e)),be=e=>De(de(e)),we=t=>De(function(t){const i=t.value,o=t.style,s=t.styleSpec,r=s.snow;let n=[];const a=e.K(i);if(void 0===i)return n;if("object"!==a)return n=n.concat([new e.V("snow",i,`object expected, ${a} found`)]),n;for(const t in i){const a=t.match(/^(.*)-transition$/);n=n.concat(a&&r[a[1]]&&r[a[1]].transition?_e({key:t,value:i[t],valueSpec:s.transition,style:o,styleSpec:s}):r[t]?_e({key:t,value:i[t],valueSpec:r[t],style:o,styleSpec:s}):[new e.J(t,i[t],`unknown property "${t}"`)]);}return n}(t)),Te=t=>De(function(t){const i=t.value,o=t.style,s=t.styleSpec,r=s.rain;let n=[];const a=e.K(i);if(void 0===i)return n;if("object"!==a)return n=n.concat([new e.V("rain",i,`object expected, ${a} found`)]),n;for(const t in i){const a=t.match(/^(.*)-transition$/);n=n.concat(a&&r[a[1]]&&r[a[1]].transition?_e({key:t,value:i[t],valueSpec:s.transition,style:o,styleSpec:s}):r[t]?_e({key:t,value:i[t],valueSpec:r[t],style:o,styleSpec:s}):[new e.J(t,i[t],`unknown property "${t}"`)]);}return n}(t)),Ee=e=>De(oe(e)),Se=e=>De(J(e)),Ce=e=>De(te(e)),Ie=e=>De(ie(e)),Re=t=>De(e.a4(t));function De(e){return e.slice().sort(((e,t)=>e.line&&t.line?e.line-t.line:0))}function Ae(t,i){let o=!1;if(i&&i.length)for(const s of i)s instanceof e.J?e.w(s.message):(t.fire(new e.z(new Error(s.message))),o=!0);return o}let Le;class Pe extends e.E{constructor(t,i="flat"){super(),this._transitionable=new e.a6(Le||(Le=new e.a7({anchor:new e.a8(e.a5.light.anchor),position:new e.a9(e.a5.light.position),color:new e.a8(e.a5.light.color),intensity:new e.a8(e.a5.light.intensity)}))),this.setLight(t,i),this._transitioning=this._transitionable.untransitioned();}getLight(){return this._transitionable.serialize()}setLight(e,t,i={}){this._validate(ve,e,i)||(this._transitionable.setTransitionOrValue(e),this.id=t);}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,i,o){return (!o||!1!==o.validate)&&Ae(this,t.call(me,e.l({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}}let Me=class extends e.E{constructor(t,i,o,s){super(),this.scope=o,this._transitionable=new e.a6(new e.a7({source:new e.a8(e.a5.terrain.source),exaggeration:new e.a8(e.a5.terrain.exaggeration)}),o,s),this._transitionable.setTransitionOrValue(t,s),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i;}get(){return this._transitionable.serialize()}set(e,t){this._transitionable.setTransitionOrValue(e,t);}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning);}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e);}getExaggeration(t){return this._transitioning.possiblyEvaluate(new e.aa(t)).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const t=this._transitionable._values.exaggeration;if(!t)return null;const i=t.value.expression;if(!i)return null;let o=-1,s=-1,r=1;for(const t of i.zoomStops)r=i.evaluate(new e.aa(t)),r>.01?(o=t,s=-1):s=t;return r<.01&&o>0&&s>o?[o,s]:null}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof e.ab}};const ze=45,Oe=65,Fe=.05;function ke(t,i,o,s){const r=e.ae(ze,Oe,o),[n,a]=Be(t,s);let l=1-Math.min(1,Math.exp((i-n)/(a-n)*-6));return l*=l*l,l=Math.min(1,1.00747*l),l*r*t.alpha}function Be(e,t){const i=.5/Math.tan(.5*t);return [e.range[0]+i,e.range[1]+i]}function Ne(t,i,o,s,r){const n=e.ad.vec3.transformMat4([],[i,o,s],r.mercatorFogMatrix);return ke(t,e.ad.vec3.length(n),r.pitch,r._fov)}function Ue(t,i,o,s,r,n,a){const l=[[o,s,0],[r,s,0],[r,n,0],[o,n,0]];let c=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(const t of l){const o=e.ad.vec3.transformMat4([],t,i),s=e.ad.vec3.length(o);c=Math.min(c,s),h=Math.max(h,s);}return [ke(t,c,a.pitch,a._fov),ke(t,h,a.pitch,a._fov)]}class Ve extends e.E{constructor(t,i,o,s){super();const r=new e.a7({range:new e.a8(e.a5.fog.range),color:new e.a8(e.a5.fog.color),"color-use-theme":new e.a8({type:"string","property-type":"data-constant",default:"default"}),"high-color":new e.a8(e.a5.fog["high-color"]),"high-color-use-theme":new e.a8({type:"string","property-type":"data-constant",default:"default"}),"space-color":new e.a8(e.a5.fog["space-color"]),"space-color-use-theme":new e.a8({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new e.a8(e.a5.fog["horizon-blend"]),"star-intensity":new e.a8(e.a5.fog["star-intensity"]),"vertical-range":new e.a8(e.a5.fog["vertical-range"])});this._transitionable=new e.a6(r,o,new Map(s)),this.set(t,s),this._transitioning=this._transitionable.untransitioned(),this._transform=i,this.properties=new e.af(r),this.scope=o;}get state(){const t=this._transform,i="globe"===t.projection.name,o=e.ag(t.zoom),s=this.properties.get("range"),r=[.5,3];return {range:i?[e.ah(r[0],s[0],o),e.ah(r[1],s[1],o)]:s,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,i,o={}){if(this._validate(be,t,o))return;const s=e.l({},t);for(const t of Object.keys(e.a5.fog))void 0===s[t]&&(s[t]=e.a5.fog[t].default);this._options=s,this._transitionable.setTransitionOrValue(this._options,i);}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const i=this.properties&&this.properties.get("color")||1;return ("globe"===this._transform.projection.name?1:e.ae(ze,Oe,t))*i.a}getOpacityAtLatLng(t,i){return this._transform.projection.supportsFog?function(t,i,o){const s=e.ac.fromLngLat(i),r=o.elevation?o.elevation.getAtPointOrZero(s):0;return Ne(t,s.x,s.y,r,o)}(this.state,t,i):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return [1,1];const i=this._transform.calculateFogTileMatrix(t.toUnwrapped());return Ue(this.state,i,0,0,e.ai,e.ai,this._transform)}getOpacityForBounds(e,t,i,o,s){return this._transform.projection.supportsFog?Ue(this.state,e,t,i,o,s,this._transform):[1,1]}getFovAdjustedRange(e){return this._transform.projection.supportsFog?Be(this.state,e):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return !1;const i=[4,5,6,7];for(const o of i){const i=t.points[o];let s;if(i[2]>=0)s=i;else {const r=t.points[o-4];s=e.aj(r,i,r[2]/(r[2]-i[2]));}if(Ne(this.state,s[0],s[1],0,this._transform)>=Fe)return !0}return !1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e));}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,i,o){return (!o||!1!==o.validate)&&Ae(this,t.call(me,e.l({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}}let Ge,je,qe,He,Ze=class extends e.E{constructor(t,i,o,s){super();const r=Ge||(Ge=new e.a7({density:new e.a8(e.a5.snow.density),intensity:new e.a8(e.a5.snow.intensity),color:new e.a8(e.a5.snow.color),opacity:new e.a8(e.a5.snow.opacity),vignette:new e.a8(e.a5.snow.vignette),"vignette-color":new e.a8(e.a5.snow["vignette-color"]),"center-thinning":new e.a8(e.a5.snow["center-thinning"]),direction:new e.a8(e.a5.snow.direction),"flake-size":new e.a8(e.a5.snow["flake-size"])}));this._transitionable=new e.a6(r,o,new Map(s)),this.set(t,s),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.af(r),this.scope=o;}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),o=this.properties.get("direction"),s=e.ak(o[0]),r=-Math.max(e.ak(o[1]),.01),n=[Math.cos(s)*Math.cos(r),Math.sin(s)*Math.cos(r),Math.sin(r)],a=this.properties.get("vignette"),l=this.properties.get("vignette-color");return l.a=a,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.al(i.r,i.g,i.b,i.a*t),direction:n,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:l}}get(){return this._transitionable.serialize()}set(t,i,o={}){if(this._validate(we,t,o))return;const s=e.l({},t);for(const t of Object.keys(e.a5.snow))void 0===s[t]&&(s[t]=e.a5.snow[t].default);this._options=s,this._transitionable.setTransitionOrValue(this._options,i);}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e));}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,i,o){return (!o||!1!==o.validate)&&Ae(this,t.call(me,e.l({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}},We=class extends e.E{constructor(t,i,o,s){super();const r=je||(je=new e.a7({density:new e.a8(e.a5.rain.density),intensity:new e.a8(e.a5.rain.intensity),color:new e.a8(e.a5.rain.color),opacity:new e.a8(e.a5.rain.opacity),vignette:new e.a8(e.a5.rain.vignette),"vignette-color":new e.a8(e.a5.rain["vignette-color"]),"center-thinning":new e.a8(e.a5.rain["center-thinning"]),direction:new e.a8(e.a5.rain.direction),"droplet-size":new e.a8(e.a5.rain["droplet-size"]),"distortion-strength":new e.a8(e.a5.rain["distortion-strength"])}));this._transitionable=new e.a6(r,o,new Map(s)),this.set(t,s),this._transitioning=this._transitionable.untransitioned(),this.properties=new e.af(r),this.scope=o;}get state(){const t=this.properties.get("opacity"),i=this.properties.get("color"),o=this.properties.get("direction"),s=e.ak(o[0]),r=-Math.max(e.ak(o[1]),.01),n=[Math.cos(s)*Math.cos(r),Math.sin(s)*Math.cos(r),Math.sin(r)],a=this.properties.get("vignette-color");return a.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new e.al(i.r,i.g,i.b,i.a*t),direction:n,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:a}}get(){return this._transitionable.serialize()}set(t,i,o={}){if(this._validate(Te,t,o))return;const s=e.l({},t);for(const t of Object.keys(e.a5.rain))void 0===s[t]&&(s[t]=e.a5.rain[t].default);this._options=s,this._transitionable.setTransitionOrValue(this._options,i);}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e));}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,i,o){return (!o||!1!==o.validate)&&Ae(this,t.call(me,e.l({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.a5})))}};class $e extends e.E{constructor(t,i,o,s){super(),this.scope=o,this._options=t,this.properties=new e.af(i),this._transitionable=new e.a6(i,o,new Map(s)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned();}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,new Map(e));}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning);}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e);}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,t){this._options=e,this._transitionable.setTransitionOrValue(e.properties,t);}shadowsEnabled(){return !!this.properties&&!0===this.properties.get("cast-shadows")}}class Xe{constructor(e,t,i,o){this.screenBounds=e,this.cameraPoint=t,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=i,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,o);}static createFromScreenPoints(t,i){let o,s;if(t instanceof e.P||"number"==typeof t[0]){const r=e.P.convert(t);o=[r],s=i.isPointAboveHorizon(r);}else {const r=e.P.convert(t[0]),n=e.P.convert(t[1]);o=[r,n],s=e.an(r,n).every((e=>i.isPointAboveHorizon(e)));}return new Xe(o,i.getCameraPoint(),s,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.an(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const i=this.screenBounds[0],o=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],s=e.an(i,o,0,!1);return this.cameraPoint.y>o.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x<o.x?s.splice(3,0,this.cameraPoint):this.cameraPoint.x>=o.x?s[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(s[3]=this.cameraPoint)),e.ao(s,t)}bufferedCameraGeometryGlobe(t){const i=this.screenBounds[0],o=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],s=e.an(i,o,t),r=this.cameraPoint.clone();switch(3*((r.y>i.y)+(r.y>o.y))+((r.x>i.x)+(r.x>o.x))){case 0:s[0]=r,s[4]=r.clone();break;case 1:s.splice(1,0,r);break;case 2:s[1]=r;break;case 3:s.splice(4,0,r);break;case 5:s.splice(2,0,r);break;case 6:s[3]=r;break;case 7:s.splice(3,0,r);break;case 8:s[2]=r;}return s}containsTile(t,i,o,s=0){const r=t.queryPadding/i._pixelsPerMercatorPixel+1,n=o?this._bufferedCameraMercator(r,i):this._bufferedScreenMercator(r,i);let a=t.tileID.wrap+(n.unwrapped?s:0);const l=n.polygon.map((i=>e.ap(t.tileTransform,i,a)));if(!e.aq(l,0,0,e.ai,e.ai))return;a=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?s:0);const c=this.screenGeometryMercator.polygon.map((i=>e.ar(t.tileTransform,i,a))),h=c.map((t=>new e.P(t[0],t[1]))),d=i.getFreeCameraOptions().position||new e.ac(0,0,0),u=e.ar(t.tileTransform,d,a),_=c.map((t=>{const i=e.ad.vec3.sub(t,t,u);return e.ad.vec3.normalize(i,i),new e.as(u,i)})),p=e.at(t,1,i.zoom)*i._pixelsPerMercatorPixel;return {queryGeometry:this,tilespaceGeometry:h,tilespaceRays:_,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(f=e.au(l),f.min.x=e.ay(f.min.x,0,e.ai),f.min.y=e.ay(f.min.y,0,e.ai),f.max.x=e.ay(f.max.x,0,e.ai),f.max.y=e.ay(f.max.y,0,e.ai),f),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:p};var f;}_bufferedScreenMercator(e,t){const i=Je(e);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let o;return o="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._screenRaycastCache[i]=o,o}}_bufferedCameraMercator(e,t){const i=Je(e);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let o;return o="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._cameraRaycastCache[i]=o,o}}_projectAndResample(t,i){const o=function(t,i){const o=e.ad.mat4.multiply([],i.pixelMatrix,i.globeMatrix),s=[0,-e.az,0,1],r=[0,e.az,0,1],n=[0,0,0,1];e.ad.vec4.transformMat4(s,s,o),e.ad.vec4.transformMat4(r,r,o),e.ad.vec4.transformMat4(n,n,o);const a=new e.P(s[0]/s[3],s[1]/s[3]),l=new e.P(r[0]/r[3],r[1]/r[3]),c=e.aw(t,a)&&s[3]<n[3],h=e.aw(t,l)&&r[3]<n[3];if(!c&&!h)return null;const d=function(e,t,i){for(let o=1;o<e.length;o++){const s=Ye(t.pointCoordinate3D(e[o-1]).x),r=Ye(t.pointCoordinate3D(e[o]).x);if(i<0){if(s<r)return {idx:o,t:-s/(r-1-s)}}else if(r<s)return {idx:o,t:(1-s)/(r+1-s)}}return null}(t,i,c?-1:1);if(!d)return null;const{idx:u,t:_}=d;let p=u>1?Ke(t.slice(0,u),i):[],f=u<t.length?Ke(t.slice(u),i):[];p=p.map((t=>new e.P(Ye(t.x),t.y))),f=f.map((t=>new e.P(Ye(t.x),t.y)));const m=[...p];0===m.length&&m.push(f[f.length-1]);const g=e.ah(m[m.length-1].y,(0===f.length?p[0]:f[0]).y,_);let v;return v=c?[new e.P(0,g),new e.P(0,0),new e.P(1,0),new e.P(1,g)]:[new e.P(1,g),new e.P(1,1),new e.P(0,1),new e.P(0,g)],m.push(...v),0===f.length?m.push(p[0]):m.push(...f),{polygon:m.map((t=>new e.ac(t.x,t.y))),unwrapped:!1}}(t,i);if(o)return o;const s=function(t,i){let o=!1,s=-1/0,r=0;for(let e=0;e<t.length-1;e++)t[e].x>s&&(s=t[e].x,r=e);for(let e=0;e<t.length-1;e++){const i=(r+e)%(t.length-1),s=t[i],n=t[i+1];Math.abs(s.x-n.x)>.5&&(s.x<n.x?(s.x+=1,0===i&&(t[t.length-1].x+=1)):(n.x+=1,i+1===t.length-1&&(t[0].x+=1)),o=!0);}const n=e.av(i.center.lng);return o&&n<Math.abs(n-1)&&t.forEach((e=>{e.x-=1;})),{polygon:t,unwrapped:o}}(Ke(t,i).map((t=>new e.P(Ye(t.x),t.y))),i);return {polygon:s.polygon.map((t=>new e.ac(t.x,t.y))),unwrapped:s.unwrapped}}}function Ke(t,i){return e.ax(t,(e=>{const t=i.pointCoordinate3D(e);e.x=t.x,e.y=t.y;}),1/256)}function Ye(e){return e<0?1+e%1:e%1}function Je(e){return 100*e|0}function Qe(t,i,o,s,r){const n=function(o,s){if(o)return r(o);if(s){if(t.url&&s.tiles&&t.tiles&&delete t.tiles,s.variants){if(!Array.isArray(s.variants))return r(new Error("variants must be an array"));for(const t of s.variants){if(null==t||"object"!=typeof t||t.constructor!==Object)return r(new Error("variant must be an object"));if(!Array.isArray(t.capabilities))return r(new Error("capabilities must be an array"));if(1===t.capabilities.length&&"meshopt"===t.capabilities[0]){s=e.l(s,t);break}}}const o=e.aA(e.l({},s,t),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);o.tiles=i.canonicalizeTileset(o,t.url),r(null,o);}},a=function(e,t,i){if(!e)return null;if(!t&&!i)return e;i=i||e.worldview_default;const o=Object.values(e.language||{});if(0===o.length)return null;const s=Object.values(e.worldview||{});if(0===s.length)return null;const r=o.every((e=>e===t)),n=s.every((e=>e===i));return r&&n?e:t in(e.language_options||{})||i in(e.worldview_options||{})?null:e.language_options&&e.worldview_options?e:null}(t.data,o,s);return a?e.q.frame((()=>n(null,a))):t.url?e.n(i.transformRequest(i.normalizeSourceURL(t.url,null,o,s),e.R.Source),n):e.q.frame((()=>{const{data:e,...i}=t;n(null,i);}))}class et{constructor(t,i,o){this.bounds=e.aB.convert(this.validateBounds(t)),this.minzoom=i||0,this.maxzoom=o||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 i=Math.pow(2,t.z),o=Math.floor(e.av(this.bounds.getWest())*i),s=Math.floor(e.aC(this.bounds.getNorth())*i),r=Math.ceil(e.av(this.bounds.getEast())*i),n=Math.ceil(e.aC(this.bounds.getSouth())*i);return t.x>=o&&t.x<r&&t.y>=s&&t.y<n}}class tt extends e.E{constructor(t,i,o,s){if(super(),this.id=t,this.dispatcher=o,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.l(this,e.aA(i,["url","scheme","tileSize","promoteId"])),this._options=e.l({type:"vector"},i),this._collectResourceTiming=!!i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(s),this._tileWorkers={},this._deduped=new e.aD;}load(t){this._loaded=!1,this.fire(new e.A("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,o=this.map.getWorldview();this._tileJSONRequest=Qe(this._options,this.map._requestManager,i,o,((s,r)=>{if(this._tileJSONRequest=null,this._loaded=!0,s)i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),o&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${o}`),this.fire(new e.z(s));else if(r){if(e.l(this,r),this.hasWorldviews=!!r.worldview_options,r.worldview_default&&(this.worldviewDefault=r.worldview_default),r.vector_layers){this.vectorLayers=r.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const e of r.vector_layers)this.vectorLayerIds.push(e.id),r.worldview&&r.worldview[e.source]&&this.localizableLayerIds.add(e.id);}r.bounds&&(this.tileBounds=new et(r.bounds,this.minzoom,this.maxzoom)),L(r.tiles,this.map._requestManager._customAccessToken),this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}));}t&&t(s);}));}loaded(){return this._loaded}hasTile(e){return !this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load();}reload(){this.cancelTileJSONRequest();const t=e.C(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)));}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest();}serialize(){return e.l({},this._options)}loadTile(t,i){const o=t.tileID.canonical.url(this.tiles,this.scheme),s=this.map._requestManager.normalizeTileURL(o),r=this.map._requestManager.transformRequest(s,e.R.Tile),n=this.map.style?this.map.style.getLut(this.scope):null,a=n?{image:n.image.clone()}:null,l={request:r,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,lut:a,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:e.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor()};if(this.hasWorldviews&&e.f(o)&&(l.worldview=this.map.getWorldview()||this.worldviewDefault,l.localizableLayerIds=this.localizableLayerIds),l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=i:t.request=t.actor.send("reloadTile",l,c.bind(this));else if(t.actor=this._tileWorkers[s]=this._tileWorkers[s]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",l,c.bind(this),void 0,!0);else {const i=e.aE.call({deduped:this._deduped},l,((e,i)=>{e||!i?c.call(this,e):(l.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},t.actor&&t.actor.send("loadTile",l,c.bind(this),void 0,!0));}),!0);t.request={cancel:i};}function c(o,s){return delete t.request,t.aborted?i(null):o&&404!==o.status?i(o):(s&&s.resourceTiming&&(t.resourceTiming=s.resourceTiming),this.map._refreshExpiredTiles&&s&&t.setExpiryData(s),t.loadVectorData(s,this.map.painter),e.aF(this.dispatcher),i(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,scope:this.scope});}unloadTile(e,t){e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy();}hasTransition(){return !1}afterUpdate(){this._tileWorkers={};}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);}}class it extends e.E{constructor(t,i,o,s){super(),this.id=t,this.dispatcher=o,this.setEventedParent(s),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.l({type:"raster"},i),e.l(this,e.aA(i,["url","scheme","tileSize"]));}load(t){this._loaded=!1,this.fire(new e.A("dataloading",{dataType:"source"})),this._tileJSONRequest=Qe(this._options,this.map._requestManager,null,null,((i,o)=>{this._tileJSONRequest=null,this._loaded=!0,i?this.fire(new e.z(i)):o&&(e.l(this,o),o.raster_layers&&(this.rasterLayers=o.raster_layers,this.rasterLayerIds=this.rasterLayers.map((e=>e.id))),o.bounds&&(this.tileBounds=new et(o.bounds,this.minzoom,this.maxzoom)),L(o.tiles),this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i);}));}loaded(){return this._loaded}onAdd(e){this.map=e,this.load();}reload(){this.cancelTileJSONRequest();const t=e.C(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)));}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest();}serialize(){return e.l({},this._options)}hasTile(e){return !this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,i){const o=e.q.devicePixelRatio>=2,s=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),o,this.tileSize);t.request=e.o(this.map._requestManager.transformRequest(s,e.R.Tile),((o,s,r,n)=>(delete t.request,t.aborted?(t.state="unloaded",i(null)):o?(t.state="errored",i(o)):s?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:r,expires:n}),t.setTexture(s,this.map.painter),t.state="loaded",e.aF(this.dispatcher),void i(null)):i(null))));}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t&&t();}unloadTile(t,i){t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),i&&i();}hasTransition(){return !1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);}}class ot extends it{constructor(t,i,o,s){super(t,i,o,s),this.type="raster-array",this.maxzoom=22,this.partial=!0,this._options=e.l({type:"raster-array"},i);}triggerRepaint(e){const t=this.map.painter._terrain,i=this.map.style.getSourceCache(this.id);t&&t.enabled&&i&&t._clearRenderCacheForTile(i.id,e.tileID),this.map.triggerRepaint();}loadTile(t,i){const o=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),s=this.map._requestManager.transformRequest(o,e.R.Tile),r={request:s,uid:t.uid,tileID:t.tileID,type:this.type,source:this.id,scope:this.scope,partial:this.partial};t.source=this.id,t.scope=this.scope,t.requestParams=s,t.actor||(t.actor=this.dispatcher.getActor());const n=(e,o,s,r)=>{if(delete t.request,t.aborted)return t.state="unloaded",i(null);if(e){if("AbortError"===e.name)return;return t.state="errored",i(e)}if(this.map._refreshExpiredTiles&&o&&t.setExpiryData({cacheControl:s,expires:r}),this.partial)t.state="empty";else {if(!o)return i(null);t.state="loaded",t._isHeaderLoaded=!0,t._mrt=o;}i(null);};t.request=this.partial?t.fetchHeader(void 0,n.bind(this)):t.actor.send("loadTile",r,n.bind(this),void 0,!0);}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,scope:this.scope});}unloadTile(t,i){const o=t.texture;o&&o instanceof e.T?(t.destroy(!0),this.map.painter.saveTileTexture(o)):(t.destroy(),t.flushQueues(),t._isHeaderLoaded=!1,delete t._mrt,delete t.textureDescriptor),t.fbo&&(t.fbo.destroy(),delete t.fbo),delete t.request,delete t.requestParams,delete t.neighboringTiles,t.state="unloaded";}prepareTile(t,i,o){t._isHeaderLoaded&&("empty"!==t.state&&(t.state="reloading"),t.fetchBand(i,o,((i,o)=>{if(i)return t.state="errored",this.fire(new e.z(i)),void this.triggerRepaint(t);o&&(t._isHeaderLoaded=!0,t.setTexture(o,this.map.painter),t.state="loaded",this.triggerRepaint(t));})));}getInitialBand(e){if(!this.rasterLayers)return 0;const t=this.rasterLayers.find((({id:t})=>t===e)),i=t&&t.fields,o=i&&i.bands&&i.bands;return o?o[0]:0}getTextureDescriptor(t,i,o){if(!t)return;const s=i.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!s)return;let r=null;i instanceof e.aI?r=i.paint.get("raster-array-band"):i instanceof e.aJ&&(r=i.paint.get("raster-particle-array-band"));const n=r||this.getInitialBand(s);if(null!=n)if(t.textureDescriptor){if(!t.updateNeeded(s,n)||o)return Object.assign({},t.textureDescriptor,{texture:t.texture})}else this.prepareTile(t,s,n);}getImages(t,i){const o=new Map;for(const s of t)for(const t of i){const[i,r]=t.split("/"),n=s.getLayer(i);if(!n)continue;if(!n.hasBand(r)||!n.hasDataForBand(r))continue;const{bytes:a,tileSize:l,buffer:c}=n.getBandView(r),h=l+2*c,d={data:new e.r({width:h,height:h},a),pixelRatio:2,sdf:!1,usvg:!1,version:0};o.set(t,d);}return o}}const st={vector:tt,raster:it,"raster-dem":class extends it{constructor(t,i,o,s){super(t,i,o,s),this.type="raster-dem",this.maxzoom=22,this._options=e.l({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox";}loadTile(t,i){const o=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function s(e,o){e&&(t.state="errored",i(e)),o&&(t.dem=o,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",i(null));}t.request=e.o(this.map._requestManager.transformRequest(o,e.R.Tile),function(o,r,n,a){if(delete t.request,t.aborted)t.state="unloaded",i(null);else if(o)t.state="errored",i(o);else if(r){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:n,expires:a});const i=ImageBitmap&&r instanceof ImageBitmap&&e.t(),o=1-(r.width-e.aG(r.width))/2;o<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=i?r:e.q.getImageData(r,o),c={uid:t.uid,tileID:t.tileID,source:this.id,type:this.type,scope:this.scope,rawImageData:l,encoding:this.encoding,padding:o};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadTile",c,s.bind(this),void 0,!0));}}.bind(this));}_getNeighboringTiles(t){const i=t.canonical,o=Math.pow(2,i.z),s=(i.x-1+o)%o,r=0===i.x?t.wrap-1:t.wrap,n=(i.x+1+o)%o,a=i.x+1===o?t.wrap+1:t.wrap,l={};return l[new e.aH(t.overscaledZ,r,i.z,s,i.y).key]={backfilled:!1},l[new e.aH(t.overscaledZ,a,i.z,n,i.y).key]={backfilled:!1},i.y>0&&(l[new e.aH(t.overscaledZ,r,i.z,s,i.y-1).key]={backfilled:!1},l[new e.aH(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.aH(t.overscaledZ,a,i.z,n,i.y-1).key]={backfilled:!1}),i.y+1<o&&(l[new e.aH(t.overscaledZ,r,i.z,s,i.y+1).key]={backfilled:!1},l[new e.aH(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.aH(t.overscaledZ,a,i.z,n,i.y+1).key]={backfilled:!1}),l}},"raster-array":ot,geojson:class extends e.E{constructor(t,i,o,s){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=o.getActor(),this.setEventedParent(s),this._data=i.data,this._options=e.l({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),void 0!==i.minzoom&&(this.minzoom=i.minzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const r=e.ai/this.tileSize;this.workerOptions=e.l({source:this.id,scope:this.scope,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*r,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*r,extent:e.ai,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.ai,radius:(void 0!==i.clusterRadius?i.clusterRadius:50)*r,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter,dynamic:i.dynamic},i.workerOptions);}onAdd(e){this.map=e,this.setData(this._data);}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(t){if(!this._options.dynamic)return this.fire(new e.z(new Error("Can't call updateData on a GeoJSON source with dynamic set to false.")));if("string"!=typeof t&&("Feature"===t.type&&(t={type:"FeatureCollection",features:[t]}),"FeatureCollection"!==t.type))return this.fire(new e.z(new Error("Data to update should be a feature or a feature collection.")));if(this._coalesce&&"string"!=typeof t&&"string"!=typeof this._data&&"FeatureCollection"===this._data.type){const e=new Map;for(const t of this._data.features)e.set(t.id,t);for(const i of t.features)e.set(i.id,i);this._data.features=[...e.values()];}else this._data=t;return this._updateWorkerData(!0),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id,scope:this.scope},t),this}getClusterLeaves(e,t,i,o){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:e,limit:t,offset:i},o),this}_updateWorkerData(t=!1){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.A("dataloading",{dataType:"source"})),this._loaded=!1;const i=e.l({append:t},this.workerOptions);i.scope=this.scope;const o=this._data;"string"==typeof o?(i.request=this.map._requestManager.transformRequest(e.q.resolveURL(o),e.R.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(o),this._pendingLoad=this.actor.send(`${this.type}.loadData`,i,((i,o)=>{if(this._loaded=!0,this._pendingLoad=null,i)this.fire(new e.z(i));else {const i={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&o&&o.resourceTiming&&o.resourceTiming[this.id]&&(i.resourceTiming=o.resourceTiming[this.id]),t&&(this._partialReload=!0),this.fire(new e.A("data",i)),this._partialReload=!1,this._metadataFired=!0;}this._coalesce&&(this._updateWorkerData(t),this._coalesce=!1);}));}loaded(){return this._loaded}reload(){const t=e.C(this.id,this.scope);this.map.style.clearSource(t),this._updateWorkerData();}loadTile(t,i){const o=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const s=this.map.style?this.map.style.getLut(this.scope):null,r=s?{image:s.image.clone()}:null,n=this._partialReload,a={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,lut:r,scope:this.scope,pixelRatio:e.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,scaleFactor:this.map.getScaleFactor(),partial:n};t.request=this.actor.send(o,a,((e,s)=>n&&!s?(t.state="loaded",i(null)):(delete t.request,t.destroy(),t.aborted?i(null):e?i(e):(t.loadVectorData(s,this.map.painter,"reloadTile"===o),i(null)))),void 0,"loadTile"===o);}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0;}unloadTile(e,t){this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy();}onRemove(e){this._pendingLoad&&this._pendingLoad.cancel();}serialize(){return e.l({},this._options,{type:this.type,data:this._data})}hasTransition(){return !1}},video:class extends e.aK{constructor(e,t,i,o){super(e,t,i,o),this.roundZoom=!0,this.type="video",this.options=t;}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const i of t.urls)this.urls.push(this.map._requestManager.transformRequest(i,e.R.Source).url);e.aL(this.urls,((t,i)=>{this._loaded=!0,t?this.fire(new e.z(t)):i&&(this.video=i,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 i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.z(new e.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.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,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,i.RGBA8),this.texture.bind(i.LINEAR,i.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:e.aK,model:class extends e.E{constructor(e,t,i,o){super(),this.id=e,this.type="model",this.models=[],this._loaded=!1,this._options=t;}load(){const t=[];for(const i in this._options.models){const o=this._options.models[i],s=e.aN(this.map._requestManager.transformRequest(o.uri,e.R.Model).url).then((t=>{if(!t)return;const s=e.aO(t),r=new e.aP(i,o.position,o.orientation,s);r.computeBoundsAndApplyParent(),this.models.push(r);})).catch((t=>{this.fire(new e.z(new Error(`Could not load model ${i} from ${o.uri}: ${t.message}`)));}));t.push(s);}return Promise.allSettled(t).then((()=>{this._loaded=!0,this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"}));})).catch((t=>{this.fire(new e.z(new Error(`Could not load models: ${t.message}`)));}))}onAdd(e){this.map=e,this.load();}hasTransition(){return !1}loaded(){return this._loaded}getModels(){return this.models}loadTile(e,t){}serialize(){return {type:"model"}}},"batched-model":class extends e.E{constructor(e,t,i,o){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=i,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(o);}onAdd(e){this.map=e,this.load();}reload(){this.cancelTileJSONRequest();const t=e.C(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)));}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);}load(t){this._loaded=!1,this.fire(new e.A("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,o=this.map.getWorldview();this._tileJSONRequest=Qe(this._options,this.map._requestManager,i,o,((s,r)=>{this._tileJSONRequest=null,this._loaded=!0,s?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),o&&2!==o.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${o}`),this.fire(new e.z(s))):r&&(e.l(this,r),r.bounds&&(this.tileBounds=new et(r.bounds,this.minzoom,this.maxzoom)),L(r.tiles,this.map._requestManager._customAccessToken),this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}))),t&&t(s);}));}hasTransition(){return !1}hasTile(e){return !this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}loadTile(t,i){const o=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),s={request:this.map._requestManager.transformRequest(o,e.R.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,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:e.q.devicePixelRatio,promoteId:this.promoteId};if(t.actor&&"expired"!==t.state)if("loading"===t.state)t.reloadCallback=i;else {if(t.buckets){const e=Object.values(t.buckets);for(const t of e)t.dirty=!0;return void(t.state="loaded")}t.request=t.actor.send("reloadTile",s,r.bind(this));}else t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",s,r.bind(this),void 0,!0);function r(e,o){return t.aborted?i(null):e&&404!==e.status?i(e):(this.map._refreshExpiredTiles&&o&&t.setExpiryData(o),t.loadModelData(o,this.map.painter),t.state="loaded",void i(null))}}serialize(){return e.l({},this._options)}},canvas:class extends e.aK{constructor(t,i,o,s){super(t,i,o,s),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.z(new e.V(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.z(new e.V(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.z(new e.V(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.z(new e.V(`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.z(new e.V(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate;}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.z(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(e){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 i=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof e.aM||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(i,this.canvas,i.gl.RGBA8,{premultiply:!0}),this._prepareData(i);}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.E{constructor(t,i,o,s){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=o,this._implementation=i,this.setEventedParent(s),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.z(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.z(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new et(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),e.l(this,e.aA(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]));}serialize(){return e.aA(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.A("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}));}loaded(){return this._loaded}onAdd(t){this.map=t,this._loaded=!1,this.fire(new e.A("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:i,z:o}=e.canonical;return this._implementation.hasTile({x:t,y:i,z:o})}return !this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,t){const{x:i,y:o,z:s}=e.tileID.canonical,r=new AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:i,y:o,z:s},{signal:r.signal})).then(function(i){return delete e.request,e.aborted?(e.state="unloaded",t(null)):void 0===i?(e.state="errored",t(null)):null===i?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",t(null)):function(e){return e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof ImageBitmap||e instanceof HTMLImageElement}(i)?(this.loadTileData(e,i),e.state="loaded",void t(null)):(e.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((i=>{"AbortError"!==i.name&&(e.state="errored",t(i));})),e.request.cancel=()=>r.abort();}loadTileData(e,t){e.setTexture(t,this.map.painter);}unloadTile(t,i){if(t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:i,z:o}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:o});}i&&i();}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t&&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(){const t=e.C(this.id,this.scope);this.map.style.clearSource(t);}_update(){this.fire(new e.A("data",{dataType:"source",sourceDataType:"content"}));}}},rt=function(t,i,o,s){const r=new st[i.type](t,i,o,s);if(r.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${r.id}`);return e.aQ(["load","abort","unload","serialize","prepare"],r),r};function nt(e,t,i=""){return `${i}:${t.id||""}:${t.layer.id}:${function(e){if("layerId"in e)return `layer:${e.layerId}`;{const{featuresetId:t,importId:i}=e;return `featureset:${t}${i?`:import:${i}`:""}`}}(e.target)}`}function at(e,t,i,o=""){if(e.uniqueFeatureID){const s=nt(e,t,o);if(i.has(s))return !0;i.add(s);}return !1}function lt(e,t,i,o,s=!1){const r=t.sourceCache.transform,n=t.sourceCache.tilesIn(e,t.has3DLayers,s);n.sort(dt);const a=[];for(const e of n){const n=e.tile.queryRenderedFeatures(t,e,i,o,r,s);Object.keys(n).length&&a.push({wrappedTileID:e.tile.tileID.wrapped().key,queryResults:n});}return 0===a.length?{}:function(e){const t={},i={};for(const o of e){const e=o.queryResults,s=o.wrappedTileID,r=i[s]=i[s]||{};for(const i in e){const o=e[i],s=r[i]=r[i]||{},n=t[i]=t[i]||[];for(const e of o)s[e.featureIndex]||(s[e.featureIndex]=!0,n.push(e));}}return t}(a)}function ct(e,t,i,o,s){const r={},n=o.queryRenderedSymbols(e),a=[];for(const e of Object.keys(n).map(Number))a.push(s[e]);a.sort(dt);for(const e of a){const o=e.featureIndex.lookupSymbolFeatures(n[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,t,i);for(const t in o){const i=r[t]=r[t]||[],s=o[t];s.sort(((t,i)=>{const o=e.featureSortOrder;if(o){const e=o.indexOf(t.featureIndex);return o.indexOf(i.featureIndex)-e}return i.featureIndex-t.featureIndex}));for(const e of s)i.push(e);}}return r}function ht(e,t){const i=e.getRenderableIds().map((t=>e.getTileByID(t))),o=[],s={};for(let e=0;e<i.length;e++){const r=i[e],n=r.tileID.canonical.key;s[n]||(s[n]=!0,r.querySourceFeatures(o,t));}return o}function dt(e,t){const i=e.tileID,o=t.tileID;return i.overscaledZ-o.overscaledZ||i.canonical.y-o.canonical.y||i.wrap-o.wrap||i.canonical.x-o.canonical.x}function ut(e,t){const i={};if(!t)return i;for(const o of e){const e=o.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){o.layers=e,o.stateDependentLayerIds&&(o.stateDependentLayers=o.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)i[t.fqid]=o;}}return i}const _t=32,pt=33,ft=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,i=0,o=0,s=0,r=0,n=0,a=0;for(1&t?s=r=n=_t:i=o=a=_t;(t>>=1)>1;){const e=i+s>>1,l=o+r>>1;1&t?(s=i,r=o,i=n,o=a):(i=s,o=r,s=n,r=a),n=e,a=l;}const l=4*e;ft[l+0]=i,ft[l+1]=o,ft[l+2]=s,ft[l+3]=r;}const mt=new Uint16Array(2178),gt=new Uint8Array(1089),vt=new Uint16Array(1089);function yt(e){return 0===e?-.03125:32===e?.03125:0}const xt=(()=>({type:2,extent:e.ai,loadGeometry:()=>[[new e.P(0,0),new e.P(e.ai+1,0),new e.P(e.ai+1,e.ai+1),new e.P(0,e.ai+1),new e.P(0,0)]]}))();class bt{constructor(t,i,o,s,r){this.tileID=t,this.uid=e.aW(),this.uses=0,this.tileSize=i,this.tileZoom=o,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=r,s&&s.style&&(this._lastUpdatedBrightness=s.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",s&&s.transform&&(this.projection=s.transform.projection);}registerFadeDuration(t){const i=t+this.timeAdded;i<e.q.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i);}wasRequested(){return "errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=e.aR(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(t,i,o){if(this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=ut(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.aY){if(this.hasSymbolBuckets=!0,!o)break;i.justReloaded=!0;}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.aY&&i.hasRTLText){this.hasRTLText=!0,e.aZ();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e],o=i.style.getOwnLayer(e);if(!o)continue;const s=o.queryRadius(t);this.queryPadding=Math.max(this.queryPadding,s);}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),t.lineAtlas&&(this.lineAtlas=t.lineAtlas),this._lastUpdatedBrightness=t.brightness;}else this.collisionBoxArray=new e.aX;}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";}}loadModelData(e,t,i){e&&(e.resourceTiming&&(this.resourceTiming=e.resourceTiming),this.buckets=Object.assign({},this.buckets,ut(e.buckets,t.style)),e.featureIndex&&(this.latestFeatureIndex=e.featureIndex));}getBucket(e){return this.buckets[e.fqid]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t);}const i=t.gl,o=this.imageAtlas;o&&!o.uploaded&&(this.imageAtlasTexture=new e.T(t,o.image,i.RGBA8,{useMipmap:!!o.patternPositions.size}),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,i.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new e.T(t,this.lineAtlas.image,i.R8),this.lineAtlas.uploaded=!0);}prepare(e,t,i){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,i),!t||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const o=t.style.getBrightness();(this._lastUpdatedBrightness||o)&&(this._lastUpdatedBrightness&&o&&Math.abs(this._lastUpdatedBrightness-o)<.001||(this.updateBuckets(t,this._lastUpdatedBrightness!==o),this._lastUpdatedBrightness=o));}queryRenderedFeatures(t,i,o,s,r,n){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return {};const a=function(t,i){const o=e.ad.mat4.fromScaling([],[.5*t.width,.5*-t.height,1]);return e.ad.mat4.translate(o,o,[1,-1,0]),e.ad.mat4.multiply(o,o,t.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(o)}(r,this.tileID);return this.latestFeatureIndex.query(t,{tilespaceGeometry:i,pixelPosMatrix:a,transform:s,availableImages:o,tileTransform:this.tileTransform})}querySourceFeatures(t,i){const o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;const s=o.loadVTLayers(),r=i?i.sourceLayer:"",n=s._geojsonTileLayer||s[r];if(!n)return;const a=e.a_(i&&i.filter),{z:l,x:c,y:h}=this.tileID.canonical,d={z:l,x:c,y:h};for(let i=0;i<n.length;i++){const s=n.feature(i);if(a.needGeometry){const t=e.a$(s,!0);if(!a.filter(new e.aa(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!a.filter(new e.aa(this.tileID.overscaledZ),s))continue;const u=o.getId(s,r),_=new e.b0(s,l,c,h,u);_.tile=d,t.push(_);}}loaded(){return "loaded"===this.state||"errored"===this.state}hasData(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return !!this.imageAtlas&&!!this.imageAtlas.patternPositions.size}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.b1(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"]);}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const e=Date.now();let t=!1;if(this.expirationTime>e)t=!1;else if(i)if(this.expirationTime<i)t=!0;else {const o=this.expirationTime-i;o?this.expirationTime=e+Math.max(o,3e4):t=!0;}else t=!0;t?(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)}refreshFeatureState(e){this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)&&e&&this.updateBuckets(e);}updateBuckets(t,i){if(!this.latestFeatureIndex)return;if(!t.style)return;const o=this.latestFeatureIndex.loadVTLayers(),s=t.style.listImages(),r=t.style.getBrightness();for(const n in this.buckets){if(!t.style.hasLayer(n))continue;const a=this.buckets[n],l=a.layers[0],c=l.sourceLayer||"_geojsonTileLayer",h=o[c],d=t.style.getLayerSourceCache(l);let u={};d&&(u=d._state.getState(c,void 0));const _=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},p=Object.keys(u).length>0&&!i;p&&!a.stateDependentLayers.length&&!i||a.update(u,h,s,_,p?a.stateDependentLayers:a.layers,i,r),(a instanceof e.b2||a instanceof e.b3)&&t._terrain&&t._terrain.enabled&&d&&a.uploadPending()&&t._terrain._clearRenderCacheForTile(d.id,this.tileID);const f=t&&t.style&&t.style.getOwnLayer(n);f&&(this.queryPadding=Math.max(this.queryPadding,f.queryRadius(a)));}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return !this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.q.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0;}setHoldDuration(t){this.symbolFadeHoldUntil=e.q.now()+t;}setTexture(t,i){const o=i.context,s=o.gl;this.texture=this.texture||i.getTileTexture(t.width),this.texture&&this.texture instanceof e.T?this.texture.update(t):(this.texture=new e.T(o,t,s.RGBA8,{useMipmap:!0}),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE));}setDependencies(e,t){const i={};for(const e of t)i[e]=!0;this.dependencies[e]=i;}hasDependency(e,t){for(const i of e){const e=this.dependencies[i];if(e)for(const i of t)if(e[i])return !0}return !1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(t,i){if(!i||"mercator"===i.name||this._tileDebugBuffer)return;const o=e.b4(xt,this.tileID.canonical,this.tileTransform)[0],s=new e.b5,r=new e.b6;for(let e=0;e<o.length;e++){const{x:t,y:i}=o[e];s.emplaceBack(t,i),r.emplaceBack(e);}r.emplaceBack(0),this._tileDebugIndexBuffer=t.createIndexBuffer(r),this._tileDebugBuffer=t.createVertexBuffer(s,e.b7.members),this._tileDebugSegments=e.b8.simpleSegment(0,0,s.length,r.length);}_makeTileBoundsBuffers(t,i){if(this._tileBoundsBuffer||!i||"mercator"===i.name)return;const o=e.b4(xt,this.tileID.canonical,this.tileTransform)[0];let s,r;if(this.isRaster){const t=function(t,i){const o=e.aR(t,i),s=Math.pow(2,t.z);for(let r=0;r<pt;r++)for(let n=0;n<pt;n++){const a=e.aS((t.x+(n+yt(n))/_t)/s),l=e.aT((t.y+(r+yt(r))/_t)/s),c=i.project(a,l),h=r*pt+n;mt[2*h+0]=Math.round((c.x*o.scale-o.x)*e.ai),mt[2*h+1]=Math.round((c.y*o.scale-o.y)*e.ai);}gt.fill(0),vt.fill(0);for(let e=2045;e>=0;e--){const t=4*e,i=ft[t+0],o=ft[t+1],s=ft[t+2],r=ft[t+3],n=i+s>>1,a=o+r>>1,l=n+a-o,c=a+i-n,h=o*pt+i,d=r*pt+s,u=a*pt+n,_=Math.hypot((mt[2*h+0]+mt[2*d+0])/2-mt[2*u+0],(mt[2*h+1]+mt[2*d+1])/2-mt[2*u+1])>=16;gt[u]=gt[u]||(_?1:0),e<1022&&(gt[u]=gt[u]||gt[(o+c>>1)*pt+(i+l>>1)]||gt[(r+c>>1)*pt+(s+l>>1)]);}const r=new e.aU,n=new e.aV;let a=0;function l(t,i){const o=i*pt+t;return 0===vt[o]&&(r.emplaceBack(mt[2*o+0],mt[2*o+1],t*e.ai/_t,i*e.ai/_t),vt[o]=++a),vt[o]-1}function c(e,t,i,o,s,r){const a=e+i>>1,h=t+o>>1;if(Math.abs(e-s)+Math.abs(t-r)>1&&gt[h*pt+a])c(s,r,e,t,a,h),c(i,o,s,r,a,h);else {const a=l(e,t),c=l(i,o),h=l(s,r);n.emplaceBack(a,c,h);}}return c(0,0,_t,_t,_t,0),c(_t,_t,0,0,0,_t),{vertices:r,indices:n}}(this.tileID.canonical,i);s=t.vertices,r=t.indices;}else {s=new e.aU,r=new e.aV;for(const{x:e,y:t}of o)s.emplaceBack(e,t,0,0);const t=e.b9(s.int16,void 0,4);for(let e=0;e<t.length;e+=3)r.emplaceBack(t[e],t[e+1],t[e+2]);}this._tileBoundsBuffer=t.createVertexBuffer(s,e.ba.members),this._tileBoundsIndexBuffer=t.createIndexBuffer(r),this._tileBoundsSegments=e.b8.simpleSegment(0,0,s.length,r.length);}_makeGlobeTileDebugBuffers(t,i){const o=i.projection;if(!o||"globe"!==o.name||i.freezeTileCoverage)return;const s=this.tileID.canonical,r=e.bb(s,i),n=e.bc(r),a=e.ag(i.zoom);let l;a>0&&(l=e.ad.mat4.invert(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,s,i,n,l,a),this._makeGlobeTileDebugTextBuffer(t,s,i,n,l,a);}_globePoint(t,i,o,s,r,n,a){let l=e.bd(t,i,o);if(n){const r=1<<o.z,c=e.av(s.center.lng),h=e.aC(s.center.lat),d=(o.x+.5)/r-c;let u=0;d>.5?u=-1:d<-.5&&(u=1);let _=(t/e.ai+o.x)/r+u,p=(i/e.ai+o.y)/r;_=(_-c)*s._pixelsPerMercatorPixel+c,p=(p-h)*s._pixelsPerMercatorPixel+h;const f=[_*s.worldSize,p*s.worldSize,0];e.ad.vec3.transformMat4(f,f,n),l=e.be(l,f,a);}return e.ad.vec3.transformMat4(l,l,r)}_makeGlobeTileDebugBorderBuffer(t,i,o,s,r,n){const a=new e.b5,l=new e.b6,c=new e.bf,h=(e,t,h,d,u)=>{const _=(h-e)/(u-1),p=(d-t)/(u-1),f=a.length;for(let h=0;h<u;h++){const d=e+h*_,u=t+h*p;a.emplaceBack(d,u);const m=this._globePoint(d,u,i,o,s,r,n);c.emplaceBack(m[0],m[1],m[2]),l.emplaceBack(f+h);}},d=e.ai;h(0,0,d,0,16),h(d,0,d,d,16),h(d,d,0,d,16),h(0,d,0,0,16),this._tileDebugIndexBuffer=t.createIndexBuffer(l),this._tileDebugBuffer=t.createVertexBuffer(a,e.b7.members),this._globeTileDebugBorderBuffer=t.createVertexBuffer(c,e.bg.members),this._tileDebugSegments=e.b8.simpleSegment(0,0,a.length,l.length);}_makeGlobeTileDebugTextBuffer(t,i,o,s,r,n){const a=e.ai/4,l=new e.b5,c=new e.aV,h=new e.bf,d=25;c.reserve(32),l.reserve(d),h.reserve(d);const u=(e,t)=>d*e+t;for(let e=0;e<d;e++){const t=e*a;for(let e=0;e<d;e++){const c=e*a;l.emplaceBack(c,t);const d=this._globePoint(c,t,i,o,s,r,n);h.emplaceBack(d[0],d[1],d[2]);}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const i=u(e,t),o=u(e,t+1),s=u(e+1,t),r=u(e+1,t+1);c.emplaceBack(i,o,s),c.emplaceBack(s,o,r);}this._tileDebugTextIndexBuffer=t.createIndexBuffer(c),this._tileDebugTextBuffer=t.createVertexBuffer(l,e.b7.members),this._globeTileDebugTextBuffer=t.createVertexBuffer(h,e.bg.members),this._tileDebugTextSegments=e.b8.simpleSegment(0,0,d,32);}destroy(t=!1){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(),delete this.imageAtlasTexture),this.glyphAtlasTexture&&(this.glyphAtlasTexture.destroy(),delete this.glyphAtlasTexture),this.lineAtlasTexture&&(this.lineAtlasTexture.destroy(),delete this.lineAtlasTexture),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),!t&&this.texture&&this.texture instanceof e.T&&(this.texture.destroy(),delete this.texture),this.hillshadeFBO&&(this.hillshadeFBO.destroy(),delete this.hillshadeFBO),this.dem&&delete this.dem,this.neighboringTiles&&delete this.neighboringTiles,this.demTexture&&(this.demTexture.destroy(),delete this.demTexture),this.rasterParticleState&&(this.rasterParticleState.destroy(),delete this.rasterParticleState),this.latestFeatureIndex=null,this.state="unloaded";}}e.bh.setPbf(e.bi);class wt extends bt{constructor(e,t,i,o,s){super(e,t,i,o,s),this._workQueue=[],this._fetchQueue=[],this._isHeaderLoaded=!1;}getLayers(){return this._mrt?Object.values(this._mrt.layers):[]}getLayer(e){return this._mrt&&this._mrt.getLayer(e)}setTexture(t,i){const o=i.context,s=o.gl;this.texture=this.texture||i.getTileTexture(t.width),this.texture&&this.texture instanceof e.T?this.texture.update(t,{premultiply:!1}):this.texture=new e.T(o,t,s.RGBA8,{premultiply:!1});}flushQueues(){for(;this._workQueue.length;)this._workQueue.pop()();for(;this._fetchQueue.length;)this._fetchQueue.pop()();}fetchHeader(t=16384,i){const o=this._mrt=new e.bh(30),s=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(t-1)}});return this.entireBuffer=null,this.request=e.bj(s,((e,s,r,n)=>{if(e)i(e);else try{const e=o.getHeaderLength(s);if(e>t)return void(this.request=this.fetchHeader(e,i));o.parseHeader(s),this._isHeaderLoaded=!0;let a=0;for(const e of Object.values(o.layers))a=Math.max(a,e.dataIndex[e.dataIndex.length-1].lastByte);s.byteLength>=a&&(this.entireBuffer=s),i(null,this.entireBuffer||s,r,n);}catch(e){i(e);}})),this.request}fetchBand(t,i,o){const s=this._mrt;if(!this._isHeaderLoaded||!s)return void o(new Error("Tile header is not ready"));const r=this.actor;if(!r)return void o(new Error("Can't fetch tile band without an actor"));let n;const a=(e,s)=>{n.complete(e,s),e?o(e):(this.updateTextureDescriptor(t,i),o(null,this.textureDescriptor&&this.textureDescriptor.img));},l=(e,t)=>{if(e)return o(e);const i=r.send("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:t,task:n},a,void 0,!0);this._workQueue.push((()=>{i&&i.cancel(),n.cancel();}));},c=s.getLayer(t);if(!c)return void o(new Error(`Unknown sourceLayer "${t}"`));if(c.hasDataForBand(i))return this.updateTextureDescriptor(t,i),void o(null,this.textureDescriptor?this.textureDescriptor.img:null);const h=c.getDataRange([i]);if(n=s.createDecodingTask(h),!n||n.tasks.length)if(this.flushQueues(),this.entireBuffer)l(null,this.entireBuffer.slice(h.firstByte,h.lastByte+1));else {const t=Object.assign({},this.requestParams,{headers:{Range:`bytes=${h.firstByte}-${h.lastByte}`}}),i=e.bj(t,l);this._fetchQueue.push((()=>{i.cancel(),n.cancel();}));}else o(null);}updateNeeded(e,t){return (!this.textureDescriptor||this.textureDescriptor.band!==t||this.textureDescriptor.layer!==e)&&"errored"!==this.state}updateTextureDescriptor(t,i){if(!this._mrt)return;const o=this._mrt.getLayer(t);if(!o||!o.hasBand(i)||!o.hasDataForBand(i))return;const{bytes:s,tileSize:r,buffer:n,offset:a,scale:l}=o.getBandView(i),c=r+2*n,h=new e.r({width:c,height:c},s),d=this.texture;d&&d instanceof e.T&&d.update(h,{premultiply:!1}),this.textureDescriptor={layer:t,band:i,img:h,buffer:n,offset:a,tileSize:r,format:o.pixelFormat,mix:[l,256*l,65536*l,16777216*l]};}}class Tt{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,i){const o=e.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);const s={value:t,timeout:void 0};if(void 0!==i&&(s.timeout=setTimeout((()=>{this.remove(e,s);}),i)),this.data[o].push(s),this.order.push(o),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 i=e.wrapped().key,o=void 0===t?0:this.data[i].indexOf(t),s=this.data[i][o];return this.data[i].splice(o,1),s.timeout&&clearTimeout(s.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(s.value),this.order.splice(this.order.indexOf(i),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 i in this.data)for(const o of this.data[i])e(o.value)||t.push(o);for(const e of t)this.remove(e.value.tileID,e);}}class Et{constructor(){this.state={},this.stateChanges={},this.deletedStates={};}updateState(t,i,o){const s=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][s]=this.stateChanges[t][s]||{},e.l(this.stateChanges[t][s],o),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==s&&(this.deletedStates[t][e]=null);}else if(this.deletedStates[t]&&null===this.deletedStates[t][s]){this.deletedStates[t][s]={};for(const e in this.state[t][s])o[e]||(this.deletedStates[t][s][e]=null);}else for(const e in o)this.deletedStates[t]&&this.deletedStates[t][s]&&null===this.deletedStates[t][s][e]&&delete this.deletedStates[t][s][e];}removeFeatureState(e,t,i){if(null===this.deletedStates[e])return;const o=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},i&&void 0!==t)null!==this.deletedStates[e][o]&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][i]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][o])for(i in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][i]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null;}getState(t,i){const o=this.state[t]||{},s=this.stateChanges[t]||{},r=this.deletedStates[t];if(null===r)return {};if(void 0!==i){const t=String(i),n=e.l({},o[t],s[t]);if(r){const e=r[i];if(null===e)return {};for(const t in e)delete n[t];}return n}const n=e.l({},o,s);if(r)for(const e in r)delete n[e];return n}initializeTileState(e,t){e.refreshFeatureState(t);}coalesceChanges(t,i){const o={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const i={};for(const o in this.stateChanges[t])this.state[t][o]||(this.state[t][o]={}),e.l(this.state[t][o],this.stateChanges[t][o]),i[o]=this.state[t][o];o[t]=i;}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const i={};if(null===this.deletedStates[t])for(const e in this.state[t])i[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else if(this.state[t][e])for(const i of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][i];i[e]=this.state[t][e];}o[t]=o[t]||{},e.l(o[t],i);}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(o).length)for(const e in t)t[e].refreshFeatureState(i);}}class St extends e.E{constructor(e,t,i){super(),this.id=e,this._onlySymbols=i,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 Tt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Et,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===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)if(!this._tiles[e].loaded())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,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],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 i=this._tiles[t];i.upload(e),i.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope);}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(Ct).map((e=>e.key))}getRenderableIds(t,i){const o=[];for(const e in this._tiles)this._isIdRenderable(+e,t,i)&&o.push(this._tiles[e]);return t?o.sort(((t,i)=>{const o=t.tileID,s=i.tileID,r=new e.P(o.canonical.x,o.canonical.y)._rotate(this.transform.angle),n=new e.P(s.canonical.x,s.canonical.y)._rotate(this.transform.angle);return o.overscaledZ-s.overscaledZ||n.y-r.y||n.x-r.x})).map((e=>e.tileID.key)):o.map((e=>e.tileID)).sort(Ct).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return !!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())&&(i||!this._shadowCasterTiles[e])}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 i=this._tiles[e];i&&("loading"!==i.state&&(i.state=t),this._loadTile(i,this._tileLoaded.bind(this,i,e,t)));}_tileLoaded(t,i,o,s){if(s)if(t.state="errored",404!==s.status)this._source.fire(new e.z(s,{tile:t}));else {if(this._source.fire(new e.A("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:t})),!(t.tileID.key in this._loadedParentTiles))return;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 t.timeAdded=e.q.now(),"expired"===o&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),"raster-dem"===this._source.type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new e.A("data",{dataType:"source",tile:t,coord:t.tileID,sourceCacheId:this.id}));}_backfillDEM(e){const t=this.getRenderableIds();for(let o=0;o<t.length;o++){const s=t[o];if(e.neighboringTiles&&e.neighboringTiles[s]){const t=this.getTileByID(s);i(e,t),i(t,e);}}function i(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let i=t.tileID.canonical.x-e.tileID.canonical.x;const o=t.tileID.canonical.y-e.tileID.canonical.y,s=Math.pow(2,e.tileID.canonical.z),r=t.tileID.key;0===i&&0===o||Math.abs(o)>1||(Math.abs(i)>1&&(1===Math.abs(i+s)?i+=s:1===Math.abs(i-s)&&(i-=s)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,o),e.neighboringTiles&&e.neighboringTiles[r]&&(e.neighboringTiles[r].backfilled=!0)));}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,i,o){for(const s in this._tiles){let r=this._tiles[s];if(o[s]||!r.hasData()||r.tileID.overscaledZ<=t||r.tileID.overscaledZ>i)continue;let n=r.tileID;for(;r&&r.tileID.overscaledZ>t+1;){const e=r.tileID.scaledTo(r.tileID.overscaledZ-1);r=this._tiles[e.key],r&&r.hasData()&&(n=e);}let a=n;for(;a.overscaledZ>t;)if(a=a.scaledTo(a.overscaledZ-1),e[a.key]){o[n.key]=n;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const i=this._loadedParentTiles[e.key];return i&&i.tileID.overscaledZ>=t?i:null}for(let i=e.overscaledZ-1;i>=t;i--){const t=e.scaledTo(i),o=this._getLoadedTile(t);if(o)return o}}_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 i=Math.ceil(e.width/t)+1,o=Math.ceil(e.height/t)+1,s=Math.floor(i*o*5),r="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,s):s,n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n);}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const i in this._tiles){const o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),e[o.tileID.key]=o;}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(t,i,o,s){if(this.transform=t,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!o)return;this.updateCacheSize(t,i),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const r="batched-model"===this._source.type;let n,a=this._source.maxzoom;const l=this.map&&this.map.painter?this.map.painter._terrain:null;if(l&&l.sourceCache===this&&l.attenuationRange()){const e=l.attenuationRange()[0],t=Math.floor(e)-Math.log2(l.getDemUpscale());a>t&&(a=t);}if(this.used||this.usedForTerrain){if(this._source.tileID)n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.aH(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)));else if(0!==this.tileCoverLift){const s=t.clone();s.tileCoverLift=this.tileCoverLift,n=s.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:a,roundZoom:this._source.roundZoom&&!o,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:r}),this._source.minzoom<=1&&"globe"===t.projection.name&&(n.push(new e.aH(1,0,1,0,0)),n.push(new e.aH(1,0,1,1,0)),n.push(new e.aH(1,0,1,0,1)),n.push(new e.aH(1,0,1,1,1)));}else if(n=t.coveringTiles({tileSize:i||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:a,roundZoom:this._source.roundZoom&&!o,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:r}),this._source.hasTile){const e=this._source.hasTile.bind(this._source);n=n.filter((t=>e(t)));}}else n=[];if(n.length>0&&this.castsShadows&&s&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!It(this._source.type)){const e=t.coveringZoomLevel({tileSize:i||this._source.tileSize,roundZoom:this._source.roundZoom&&!o}),a=Math.min(e,this._source.maxzoom);if(r){const e=t.extendTileCover(n,a);for(const t of e)n.push(t);}else {const e=t.extendTileCover(n,a,s);for(const t of e)this._shadowCasterTiles[t.key]=!0,n.push(t);}}const c=this._updateRetainedTiles(n);if(It(this._source.type)&&0!==n.length){const t={},i={},o=Object.keys(c);for(const s of o){const o=c[s],r=this._tiles[s];if(!r||r.fadeEndTime&&r.fadeEndTime<=e.q.now())continue;const n=this.findLoadedParent(o,Math.max(o.overscaledZ-St.maxOverzooming,this._source.minzoom));n&&(this._addTile(n.tileID),t[n.tileID.key]=n.tileID),i[s]=o;}const s=n[n.length-1].overscaledZ;for(const e in this._tiles){const t=this._tiles[e];if(c[e]||!t.hasData())continue;let o=t.tileID;for(;o.overscaledZ>s;){o=o.scaledTo(o.overscaledZ-1);const s=this._tiles[o.key];if(s&&s.hasData()&&i[o.key]){c[e]=t.tileID;break}}}for(const e in t)c[e]||(this._coveredTiles[e]=!0,c[e]=t[e]);}for(const e in c)this._tiles[e].clearFadeHold();const h=e.bk(this._tiles,c);for(const e of h){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 i={},o=e.reduce(((e,t)=>Math.min(e,t.overscaledZ)),1/0),s=e[0].overscaledZ,r=Math.max(s-St.maxOverzooming,this._source.minzoom),n=Math.max(s+St.maxUnderzooming,this._source.minzoom),a={};for(const i of e){const e=this._addTile(i);t[i.key]=i,e.hasData()||o<this._source.maxzoom&&(a[i.key]=i);}this._retainLoadedChildren(a,o,n,t);for(const o of e){let e=this._tiles[o.key];if(e.hasData())continue;if(o.canonical.z>=this._source.maxzoom){const e=o.children(this._source.maxzoom)[0],i=this.getTile(e);if(i&&i.hasData()){t[e.key]=e;continue}}else {const e=o.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let s=e.wasRequested();for(let n=o.overscaledZ-1;n>=r;--n){const r=o.scaledTo(n);if(i[r.key])break;if(i[r.key]=!0,e=this.getTile(r),!e&&s&&(e=this._addTile(r)),e&&(t[r.key]=r,s=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let i,o=this._tiles[e].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){i=this._loadedParentTiles[o.key];break}t.push(o.key);const e=o.scaledTo(o.overscaledZ-1);if(i=this._getLoadedTile(e),i)break;o=e;}for(const e of t)this._loadedParentTiles[e]=i;}}_addTile(t){let i=this._tiles[t.key];if(i)return !0!==i.isExtraShadowCaster||!!this._shadowCasterTiles[t.key]||this._reloadTile(t.key,"reloading"),i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const o=Boolean(i);if(!o){const e=this.map?this.map.painter:null,o=this._source.tileSize*t.overscaleFactor();i="raster-array"===this._source.type?new wt(t,o,this.transform.tileZoom,e,this._isRaster):new bt(t,o,this.transform.tileZoom,e,this._isRaster),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state));}return i?(i.uses++,this._tiles[t.key]=i,o||this._source.fire(new e.A("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const i=t.getExpiryTimeout();i&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e];}),i));}_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||"empty"===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(t,i,o){const s=[],r=this.transform;if(!r)return s;const n="globe"===r.projection.name,a=e.av(r.center.lng);for(const l in this._tiles){const c=this._tiles[l];if(o&&c.clearQueryDebugViz(),c.holdingForFade())continue;let h;if(n){const t=c.tileID.canonical;if(0===t.z){const i=[Math.abs(e.ay(a,...Rt(t,-1))-a),Math.abs(e.ay(a,...Rt(t,1))-a)];h=[0,2*i.indexOf(Math.min(...i))-1];}else {const i=[Math.abs(e.ay(a,...Rt(t,-1))-a),Math.abs(e.ay(a,...Rt(t,0))-a),Math.abs(e.ay(a,...Rt(t,1))-a)];h=[i.indexOf(Math.min(...i))-1];}}else h=[0];for(const e of h){const o=t.containsTile(c,r,i,e);o&&s.push(o);}}return s}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,t){const i=this.getRenderableIds(e,t).map((e=>this._tiles[e].tileID)),o="globe"===this.transform.projection.name;for(const e of i)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped()),e.expandedProjMatrix=o?this.transform.calculateProjMatrix(e.toUnwrapped(),!1,!0):e.projMatrix;return i}sortCoordinatesByDistance(e){const t=e.slice(),i=this.transform._camera.position,o=this.transform._camera.forward(),s={};for(const e of t){const t=1/(1<<e.canonical.z);s[e.key]=((e.canonical.x+.5)*t+e.wrap-i[0])*o[0]+((e.canonical.y+.5)*t-i[1])*o[1]-i[2]*o[2];}return t.sort(((e,t)=>s[e.key]-s[t.key])),t}hasTransition(){if(this._source.hasTransition())return !0;if(It(this._source.type))for(const t in this._tiles){const i=this._tiles[t];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=e.q.now())return !0}return !1}setFeatureState(e,t,i){this._state.updateState(e=e||"_geojsonTileLayer",t,i);}removeFeatureState(e,t,i){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,i);}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,i){const o=this._tiles[e];o&&o.setDependencies(t,i);}reloadTilesForDependencies(e,t){for(const i in this._tiles)this._tiles[i].hasDependency(e,t)&&this._reloadTile(+i,"reloading");this._cache.filter((i=>!i.hasDependency(e,t)));}_preloadTiles(t,i){if(!this._sourceLoaded){const e=()=>{this._sourceLoaded&&(this._source.off("data",e),this._preloadTiles(t,i));};return void this._source.on("data",e)}const o=new Map,s=Array.isArray(t)?t:[t],r=this.map.painter.terrain,n=this.usedForTerrain&&r?r.getScaledDemTileSize():this._source.tileSize;for(const e of s){const t=e.coveringTiles({tileSize:n,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)o.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1);}const a=Array.from(o.values());e.bl(a,((e,t)=>{const i=new bt(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(i,(e=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),t(e,i);}));}),i);}}function Ct(e,t){const i=Math.abs(2*e.wrap)-+(e.wrap<0),o=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||o-i||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function It(e){return "raster"===e||"image"===e||"video"===e||"custom"===e}function Rt(e,t){const i=1<<e.z;return [e.x/i+t,(e.x+1)/i+t]}St.maxOverzooming=10,St.maxUnderzooming=3;class Dt{constructor(e){this.style=e,this.layersGotHidden=!1,this.layers=[];}processLayersChanged(){this.layers=[];const e=!1,t=!1;for(const i in this.style._mergedLayers){const o=this.style._mergedLayers[i];if("fill-extrusion"===o.type)this.layers.push({layer:o,visible:e,visibilityChanged:t});else if("model"===o.type){const i=this.style.getLayerSource(o);i&&"batched-model"===i.type&&this.layers.push({layer:o,visible:e,visibilityChanged:t});}}}onNewFrame(e){this.layersGotHidden=!1;for(const t of this.layers){const i=t.layer;let o=!1;"fill-extrusion"===i.type?o=!i.isHidden(e)&&i.paint.get("fill-extrusion-opacity")>0:"model"===i.type&&(o=!i.isHidden(e)&&i.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!o&&t.visible,t.visible=o;}}updateZOffset(e,t){this.currentBuildingBuckets=[];for(const e of this.layers){const i=e.layer,o=this.style.getLayerSourceCache(i);let s=1;"fill-extrusion"===i.type&&(s=e.visible?i.paint.get("fill-extrusion-vertical-scale"):0);let r=o?o.getTile(t):null;if(!r&&o&&t.canonical.z>o.getSource().minzoom){let e=t.scaledTo(Math.min(o.getSource().maxzoom,t.overscaledZ-1));for(;e.overscaledZ>=o.getSource().minzoom&&(r=o.getTile(e),!r&&0!==e.overscaledZ);)e=e.scaledTo(e.overscaledZ-1);}this.currentBuildingBuckets.push({bucket:r?r.getBucket(i):null,tileID:r?r.tileID:t,verticalScale:s});}e.hasAnyZOffset=!1;let i=!1;for(let o=0;o<e.symbolInstances.length;o++){const s=e.symbolInstances.get(o),r=s.zOffset,n=this._getHeightAtTileOffset(t,s.tileAnchorX,s.tileAnchorY);s.zOffset=n!==Number.NEGATIVE_INFINITY?n:r,i||r===s.zOffset||(i=!0),e.hasAnyZOffset||0===s.zOffset||(e.hasAnyZOffset=!0);}i&&(e.zOffsetBuffersNeedUpload=!0,e.zOffsetSortDirty=!0);}_mapCoordToOverlappingTile(t,i,o,s){let r=i,n=o;if(t.canonical.z!==s.canonical.z){const a=s.canonical,l=1/(1<<t.canonical.z-a.z);r=(i+t.canonical.x*e.ai)*l-a.x*e.ai|0,n=(o+t.canonical.y*e.ai)*l-a.y*e.ai|0;}return {tileX:r,tileY:n}}_getHeightAtTileOffset(e,t,i){let o,s;for(let r=0;r<this.layers.length;++r){if("fill-extrusion"!==this.layers[r].layer.type)continue;const{bucket:n,tileID:a,verticalScale:l}=this.currentBuildingBuckets[r];if(!n)continue;const{tileX:c,tileY:h}=this._mapCoordToOverlappingTile(e,t,i,a),d=n.getHeightAtTileCoord(c,h);d&&void 0!==d.height&&(d.hidden?o=d.height:s=Math.max(d.height*l,s||0));}if(void 0!==s)return s;for(let s=0;s<this.layers.length;++s){const r=this.layers[s];if("model"!==r.layer.type||!r.visible)continue;const{bucket:n,tileID:a}=this.currentBuildingBuckets[s];if(!n)continue;const{tileX:l,tileY:c}=this._mapCoordToOverlappingTile(e,t,i,a),h=n.getHeightAtTileCoord(l,c);if(h&&!h.hidden)return void 0===h.height&&void 0!==o?Math.min(h.maxHeight,o)*h.verticalScale:h.height?h.height*h.verticalScale:Number.NEGATIVE_INFINITY}return this.layersGotHidden?0:Number.NEGATIVE_INFINITY}}function At(t,i){const o={};for(const e in t)"ref"!==e&&(o[e]=t[e]);return e.bm.forEach((e=>{e in i&&(o[e]=i[e]);})),o}function Lt(e){e=e.slice();const t=Object.create(null);for(let i=0;i<e.length;i++)t[e[i].id]=e[i];for(let i=0;i<e.length;i++)"ref"in e[i]&&(e[i]=At(e[i],t[e[i].ref]));return e}const Pt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setSlot:"setSlot",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",setSnow:"setSnow",setRain:"setRain",setCamera:"setCamera",setLights:"setLights",setProjection:"setProjection",addImport:"addImport",removeImport:"removeImport",updateImport:"updateImport",addIconset:"addIconset",removeIconset:"removeIconset"};function Mt(e,t,i){i.push({command:Pt.addSource,args:[e,t[e]]});}function zt(e,t,i){t.push({command:Pt.removeSource,args:[e]}),i[e]=!0;}function Ot(e,t,i,o){zt(e,i,o),Mt(e,t,i);}function Ft(t,i,o){let s;for(s in t[o])if(t[o].hasOwnProperty(s)&&"data"!==s&&!e.bn(t[o][s],i[o][s]))return !1;for(s in i[o])if(i[o].hasOwnProperty(s)&&"data"!==s&&!e.bn(t[o][s],i[o][s]))return !1;return !0}function kt(t,i,o,s,r,n){let a;for(a in i=i||{},t=t||{})t.hasOwnProperty(a)&&(e.bn(t[a],i[a])||o.push({command:n,args:[s,a,i[a],r]}));for(a in i)i.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(e.bn(t[a],i[a])||o.push({command:n,args:[s,a,i[a],r]}));}function Bt(e){return e.id}function Nt(e,t){return e[t.id]=t,e}class Ut{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.ay(t,0,1);let i=1,o=this._distances[i];const s=t*this.paddedLength+this.padding;for(;o<s&&i<this._distances.length;)o=this._distances[++i];const r=i-1,n=this._distances[r],a=o-n,l=a>0?(s-n)/a:0;return this.points[r].mult(1-l).add(this.points[i].mult(l))}}class Vt{constructor(e,t,i){const o=this.boxCells=[],s=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(let e=0;e<this.xCellCount*this.yCellCount;e++)o.push([]),s.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,i,o,s){this._forEachCell(t,i,o,s,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(s);}insertCircle(e,t,i,o){this._forEachCell(t-o,i-o,t+o,i+o,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(o);}_insertBoxCell(e,t,i,o,s,r){this.boxCells[s].push(r);}_insertCircleCell(e,t,i,o,s,r){this.circleCells[s].push(r);}_query(e,t,i,o,s,r){if(i<0||e>this.width||o<0||t>this.height)return !s&&[];const n=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=o){if(s)return !0;for(let e=0;e<this.boxKeys.length;e++)n.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],i=this.circles[3*e+1],o=this.circles[3*e+2];n.push({key:this.circleKeys[e],x1:t-o,y1:i-o,x2:t+o,y2:i+o});}return r?n.filter(r):n}return this._forEachCell(e,t,i,o,this._queryCell,n,{hitTest:s,seenUids:{box:{},circle:{}}},r),s?n.length>0:n}_queryCircle(e,t,i,o,s){const r=e-i,n=e+i,a=t-i,l=t+i;if(n<0||r>this.width||l<0||a>this.height)return !o&&[];const c=[];return this._forEachCell(r,a,n,l,this._queryCellCircle,c,{hitTest:o,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}},s),o?c.length>0:c}query(e,t,i,o,s){return this._query(e,t,i,o,!1,s)}hitTest(e,t,i,o,s){return this._query(e,t,i,o,!0,s)}hitTestCircle(e,t,i,o){return this._queryCircle(e,t,i,!0,o)}_queryCell(e,t,i,o,s,r,n,a){const l=n.seenUids,c=this.boxCells[s];if(null!==c){const s=this.bboxes;for(const h of c)if(!l.box[h]){l.box[h]=!0;const c=4*h;if(e<=s[c+2]&&t<=s[c+3]&&i>=s[c+0]&&o>=s[c+1]&&(!a||a(this.boxKeys[h]))){if(n.hitTest)return r.push(!0),!0;r.push({key:this.boxKeys[h],x1:s[c],y1:s[c+1],x2:s[c+2],y2:s[c+3]});}}}const h=this.circleCells[s];if(null!==h){const s=this.circles;for(const c of h)if(!l.circle[c]){l.circle[c]=!0;const h=3*c;if(this._circleAndRectCollide(s[h],s[h+1],s[h+2],e,t,i,o)&&(!a||a(this.circleKeys[c]))){if(n.hitTest)return r.push(!0),!0;{const e=s[h],t=s[h+1],i=s[h+2];r.push({key:this.circleKeys[c],x1:e-i,y1:t-i,x2:e+i,y2:t+i});}}}}}_queryCellCircle(e,t,i,o,s,r,n,a){const l=n.circle,c=n.seenUids,h=this.boxCells[s];if(null!==h){const e=this.bboxes;for(const t of h)if(!c.box[t]){c.box[t]=!0;const i=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[i+0],e[i+1],e[i+2],e[i+3])&&(!a||a(this.boxKeys[t])))return r.push(!0),!0}}const d=this.circleCells[s];if(null!==d){const e=this.circles;for(const t of d)if(!c.circle[t]){c.circle[t]=!0;const i=3*t;if(this._circlesCollide(e[i],e[i+1],e[i+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[t])))return r.push(!0),!0}}}_forEachCell(e,t,i,o,s,r,n,a){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),h=this._convertToXCellCoord(i),d=this._convertToYCellCoord(o);for(let u=l;u<=h;u++)for(let l=c;l<=d;l++)if(s.call(this,e,t,i,o,this.xCellCount*l+u,r,n,a))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,i,o,s,r){const n=o-e,a=s-t,l=i+r;return l*l>n*n+a*a}_circleAndRectCollide(e,t,i,o,s,r,n){const a=(r-o)/2,l=Math.abs(e-(o+a));if(l>a+i)return !1;const c=(n-s)/2,h=Math.abs(t-(s+c));if(h>c+i)return !1;if(l<=a||h<=c)return !0;const d=l-a,u=h-c;return d*d+u*u<=i*i}}const Gt={unknown:0,flipRequired:1,flipNotRequired:2},jt=Math.tan(85*Math.PI/180);function qt(t,i,o,s,r,n,a){const l=e.ad.mat4.create();if(o)if("globe"===n.name){const t=e.bo(r,i);e.ad.mat4.multiply(l,l,t);}else {const t=e.ad.mat2.invert([],a);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],s||e.ad.mat4.rotateZ(l,l,r.angle);}else e.ad.mat4.multiply(l,r.labelPlaneMatrix,t);return l}function Ht(e,t,i,o,s,r,n){const a=qt(e,t,i,o,s,r,n);return "globe"===r.name&&i||(a[2]=a[6]=a[10]=a[14]=0),a}function Zt(t,i,o,s,r,n,a){if(o){if("globe"===n.name){const l=qt(t,i,o,s,r,n,a);return e.ad.mat4.invert(l,l),e.ad.mat4.multiply(l,t,l),l}{const i=e.ad.mat4.clone(t),o=e.ad.mat4.identity([]);return o[0]=a[0],o[1]=a[1],o[4]=a[2],o[5]=a[3],e.ad.mat4.multiply(i,i,o),s||e.ad.mat4.rotateZ(i,i,-r.angle),i}}return r.glCoordMatrix}function Wt(t,i,o,s){const r=[t,i,o,1];o?e.ad.vec4.transformMat4(r,r,s):si(r,r,s);const n=r[3];return r[0]/=n,r[1]/=n,r[2]/=n,r}function $t(e,t){return Math.min(.5+e/t*.5,1.5)}function Xt(e,t){const i=e[0]/e[3],o=e[1]/e[3];return i>=-t[0]&&i<=t[0]&&o>=-t[1]&&o<=t[1]}function Kt(t,i,o,s,r,n,a,l,c,h){const d=o.transform,u=s?t.textSizeData:t.iconSizeData,_=e.bp(u,o.transform.zoom),p="globe"===d.projection.name,f=[256/o.width*2+1,256/o.height*2+1],m=s?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;m.clear();let g=null;p&&(g=s?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const v=t.lineVertexArray,y=s?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=o.transform.width/o.transform.height;let b,w=!1;for(let s=0;s<y.length;s++){const p=y.get(s),{numGlyphs:T,writingMode:E}=p;if(E!==e.bq.vertical||w||b===e.bq.horizontal||(w=!0),b=E,(p.hidden||E===e.bq.vertical)&&!w){oi(T,m);continue}w=!1;const S=new e.P(p.tileAnchorX,p.tileAnchorY);let{x:C,y:I,z:R}=d.projection.projectTilePoint(S.x,S.y,h.canonical);if(c){const[e,t,i]=c(S);C+=e,I+=t,R+=i;}const D=[C,I,R,1];if(e.ad.vec4.transformMat4(D,D,i),!Xt(D,f)){oi(T,m);continue}const A=D[3],L=$t(o.transform.getCameraToCenterDistance(d.projection),A),P=e.br(u,_,p),M=a?P/L:P*L,z=Wt(C,I,R,r);if(z[3]<=0){oi(T,m);continue}let O={};const F=e.ak(t.layers[0].layout.get("text-max-angle")),k=Math.cos(F),B=a?null:c,N=Qt(p,M,!1,l,i,r,n,t.glyphOffsetArray,v,m,g,z,S,O,x,B,d.projection,h,a,k);w=N.useVertical,B&&N.needsFlipping&&(O={}),(N.notEnoughRoom||w||N.needsFlipping&&Qt(p,M,!0,l,i,r,n,t.glyphOffsetArray,v,m,g,z,S,O,x,B,d.projection,h,a,k).notEnoughRoom)&&oi(T,m);}s?(t.text.dynamicLayoutVertexBuffer.updateData(m),g&&t.text.globeExtVertexBuffer&&t.text.globeExtVertexBuffer.updateData(g)):(t.icon.dynamicLayoutVertexBuffer.updateData(m),g&&t.icon.globeExtVertexBuffer&&t.icon.globeExtVertexBuffer.updateData(g));}function Yt(e,t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m){const{lineStartIndex:g,glyphStartIndex:v,segment:y}=a,x=v+a.numGlyphs,b=g+a.lineLength,w=t.getoffsetX(v),T=t.getoffsetX(x-1),E=ii(e*w,i,o,s,r,n,y,g,b,l,c,h,d,u,!0,_,p,f,m);if(!E)return null;const S=ii(e*T,i,o,s,r,n,y,g,b,l,c,h,d,u,!0,_,p,f,m);return S?{first:E,last:S}:null}function Jt(t,i,o,s){return t===e.bq.horizontal&&Math.abs(s)>Math.abs(o)?{useVertical:!0}:t===e.bq.vertical?s>0?{needsFlipping:!0}:null:i!==Gt.unknown&&function(e,t){return 0===e||Math.abs(t/e)>jt}(o,s)?i===Gt.flipRequired?{needsFlipping:!0}:null:o<0?{needsFlipping:!0}:null}function Qt(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g,v,y,x){const b=i/24,w=t.lineOffsetX*b,T=t.lineOffsetY*b,{lineStartIndex:E,glyphStartIndex:S,numGlyphs:C,segment:I,writingMode:R,flipState:D}=t,A=E+t.lineLength,L=t=>{if(d){const[i,o,s]=t.up,r=h.length;e.bs(d,r+0,i,o,s),e.bs(d,r+1,i,o,s),e.bs(d,r+2,i,o,s),e.bs(d,r+3,i,o,s);}const[i,o,s]=t.point;e.bt(h,i,o,s,t.angle);};if(C>1){const e=Yt(b,l,w,T,o,u,_,t,c,n,p,m,!1,g,v,y,x);if(!e)return {notEnoughRoom:!0};if(s&&!o){let[i,o,s]=e.first.point,[r,n,l]=e.last.point;[i,o]=Wt(i,o,s,a),[r,n]=Wt(r,n,l,a);const c=Jt(R,D,(r-i)*f,n-o);if(t.flipState=c&&c.needsFlipping?Gt.flipRequired:Gt.flipNotRequired,c)return c}L(e.first);for(let e=S+1;e<S+C-1;e++){const t=ii(b*l.getoffsetX(e),w,T,o,u,_,I,E,A,c,n,p,m,!1,!1,g,v,y,x);if(!t)return h.length-=4*(e-S),{notEnoughRoom:!0};L(t);}L(e.last);}else {if(s&&!o){const i=Wt(_.x,_.y,0,r),o=E+I+1,s=new e.P(c.getx(o),c.gety(o)),n=Wt(s.x,s.y,0,r),a=n[3]>0?n:ti(_,s,i,1,r,void 0,g,v.canonical),l=Jt(R,D,(a[0]-i[0])*f,a[1]-i[1]);if(t.flipState=l&&l.needsFlipping?Gt.flipRequired:Gt.flipNotRequired,l)return l}const i=ii(b*l.getoffsetX(S),w,T,o,u,_,I,E,A,c,n,p,m,!1,!1,g,v,y,x);if(!i)return {notEnoughRoom:!0};L(i);}return {}}function ei(e,t,i,o,s){const{x:r,y:n,z:a}=o.projectTilePoint(e.x,e.y,t);if(!s)return Wt(r,n,a,i);const[l,c,h]=s(e);return Wt(r+l,n+c,a+h,i)}function ti(t,i,o,s,r,n,a,l){const c=ei(t.sub(i)._unit()._add(t),l,r,a,n);return e.ad.vec3.sub(c,o,c),e.ad.vec3.normalize(c,c),e.ad.vec3.scaleAndAdd(c,o,c,s)}function ii(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g,v,y){const x=s?t-i:t+i;let b=x>0?1:-1,w=0;s&&(b*=-1,w=Math.PI),b<0&&(w+=Math.PI);let T=l+a+(b>0?0:1)|0,E=r,S=r,C=0,I=0;const R=Math.abs(x),D=[],A=[];let L=n,P=L,M=e.ad.vec3.zero([]);const z=()=>ti(P,L,S,R-C+1,d,_,m,g.canonical);for(;C+I<=R;){if(T+=b,T<l||T>=c)return null;if(S=E,P=L,D.push(S),p&&A.push(P),L=new e.P(h.getx(T),h.gety(T)),E=u[T],!E){const e=ei(L,g.canonical,d,m,_);E=e[3]>0?u[T]=e:z();}C+=I;const t=e.ad.vec3.sub([],E,S),i=e.ad.vec3.distance(S,E);if(o&&i>0&&I>0&&e.ad.vec3.dot(M,t)/(I*i)<y)return null;I=i,M=t;}f&&_&&(u[T]&&(E=z(),I=e.ad.vec3.distance(S,E),M=e.ad.vec3.sub([],E,S)),u[T]=E);const O=(R-C)/I,F=L.sub(P)._mult(O)._add(P),k=e.ad.vec3.scaleAndAdd([],S,M,O);let B=[0,0,1],N=M[0],U=M[1];if(v&&(B=m.upVector(g.canonical,F.x,F.y),0!==B[0]||0!==B[1]||1!==B[2])){const t=[B[2],0,-B[0]],i=e.ad.vec3.cross([],B,t);e.ad.vec3.normalize(t,t),e.ad.vec3.normalize(i,i),N=e.ad.vec3.dot(M,t),U=e.ad.vec3.dot(M,i);}if(o){const t=e.ad.vec3.cross([],B,M);e.ad.vec3.normalize(t,t),e.ad.vec3.scaleAndAdd(k,k,t,o*b);}const V=w+Math.atan2(U,N);return D.push(k),p&&A.push(F),{point:k,angle:V,path:D,tilePath:A,up:B}}function oi(e,t){const i=t.length,o=i+4*e;t.resize(o),t.float32.fill(-1/0,4*i,4*o);}function si(e,t,i){const o=t[0],s=t[1];return e[0]=i[0]*o+i[4]*s+i[12],e[1]=i[1]*o+i[5]*s+i[13],e[3]=i[3]*o+i[7]*s+i[15],e}const ri=100;class ni{constructor(e,t,i=new Vt(e.width+200,e.height+200,25),o=new Vt(e.width+200,e.height+200,25)){this.transform=e,this.grid=i,this.ignoredGrid=o,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+ri,this.screenBottomBoundary=e.height+ri,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t;}placeCollisionBox(e,t,i,o,s,r,n,a){let l=i.projectedAnchorX,c=i.projectedAnchorY,h=i.projectedAnchorZ;const d=i.elevation,u=i.tileID,_=e.getProjection();if(d&&u){const[e,t,o]=_.upVector(u.canonical,i.tileAnchorX,i.tileAnchorY),s=_.upVectorScale(u.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=e*d*s,c+=t*d*s,h+=o*d*s;}const p=this.projectAndGetPerspectiveRatio(n,l,c,h,i.tileID,"globe"===_.name||!!d||this.transform.pitch>0,_),f=r*p.perspectiveRatio,m=(i.x1*t+o.x-i.padding)*f+p.point.x,g=(i.y1*t+o.y-i.padding)*f+p.point.y,v=(i.x2*t+o.x+i.padding)*f+p.point.x,y=(i.y2*t+o.y+i.padding)*f+p.point.y,x=p.perspectiveRatio<=.55||p.occluded;return !this.isInsideGrid(m,g,v,y)||!s&&this.grid.hitTest(m,g,v,y,a)||x?{box:[],offscreen:!1,occluded:p.occluded}:{box:[m,g,v,y],offscreen:this.isOffscreen(m,g,v,y),occluded:!1}}placeCollisionCircles(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f){const m=[],g=this.transform.elevation,v=t.getProjection(),y=g?g.getAtTileOffsetFunc(f,this.transform.center.lat,this.transform.worldSize,v):null,x=new e.P(o.tileAnchorX,o.tileAnchorY);let{x:b,y:w,z:T}=v.projectTilePoint(x.x,x.y,f.canonical);if(y){const[e,t,i]=y(x);b+=e,w+=t,T+=i;}const E="globe"===v.name,S=this.projectAndGetPerspectiveRatio(a,b,w,T,f,E||!!g||this.transform.pitch>0,v),{perspectiveRatio:C}=S,I=(d?n/C:n*C)/e.bw,R=Wt(b,w,T,l),D=o.lineOffsetX*I,A=o.lineOffsetY*I,L=e.ak(t.layers[0].layout.get("text-max-angle")),P=Math.cos(L),M=S.signedDistanceFromCamera>0?Yt(I,r,D,A,!1,R,x,o,s,l,{},g&&!d?y:null,d&&!!g,v,f,d,P):null;let z=!1,O=!1,F=!0;if(M&&!S.occluded){const t=.5*_*C+p,o=new e.P(-100,-100),s=new e.P(this.screenRightBoundary,this.screenBottomBoundary),r=new Ut,{first:n,last:a}=M,l=n.path.length;let d=[];for(let e=l-1;e>=1;e--)d.push(n.path[e]);for(let e=1;e<a.path.length;e++)d.push(a.path[e]);const f=2.5*t;c&&(d=d.map((([e,t,i],o)=>(y&&!E&&(i=y(o<l-1?n.tilePath[l-1-o]:a.tilePath[o-l+2])[2]),Wt(e,t,i,c)))),d.some((e=>e[3]<=0))&&(d=[]));let g=[];if(d.length>0){let t=1/0,i=-1/0,r=1/0,n=-1/0;for(const e of d)t=Math.min(t,e[0]),r=Math.min(r,e[1]),i=Math.max(i,e[0]),n=Math.max(n,e[1]);i>=o.x&&t<=s.x&&n>=o.y&&r<=s.y&&(g=[d.map((t=>new e.P(t[0],t[1])))],(t<o.x||i>s.x||r<o.y||n>s.y)&&(g=e.bu(g,o.x,o.y,s.x,s.y)));}for(const e of g){r.reset(e,.25*t);let o=0;o=r.length<=.5*t?1:Math.ceil(r.paddedLength/f)+1;for(let e=0;e<o;e++){const s=e/Math.max(o-1,1),n=r.lerp(s),a=n.x+ri,l=n.y+ri;m.push(a,l,t,0);const c=a-t,d=l-t,_=a+t,p=l+t;if(F=F&&this.isOffscreen(c,d,_,p),O=O||this.isInsideGrid(c,d,_,p),!i&&this.grid.hitTestCircle(a,l,t,u)&&(z=!0,!h))return {circles:[],offscreen:!1,collisionDetected:z,occluded:!1}}}}return {circles:!h&&z||!O?[]:m,offscreen:F,collisionDetected:z,occluded:S.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return {};const i=[];let o=1/0,s=1/0,r=-1/0,n=-1/0;for(const a of t){const t=new e.P(a.x+ri,a.y+ri);o=Math.min(o,t.x),s=Math.min(s,t.y),r=Math.max(r,t.x),n=Math.max(n,t.y),i.push(t);}const a=this.grid.query(o,s,r,n).concat(this.ignoredGrid.query(o,s,r,n)),l={},c={};for(const t of a){const o=t.key;if(void 0===l[o.bucketInstanceId]&&(l[o.bucketInstanceId]={}),l[o.bucketInstanceId][o.featureIndex])continue;const s=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.bv(i,s)&&(l[o.bucketInstanceId][o.featureIndex]=!0,void 0===c[o.bucketInstanceId]&&(c[o.bucketInstanceId]=[]),c[o.bucketInstanceId].push(o.featureIndex));}return c}insertCollisionBox(e,t,i,o,s){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:o,collisionGroupID:s},e[0],e[1],e[2],e[3]);}insertCollisionCircles(e,t,i,o,s){const r=t?this.ignoredGrid:this.grid,n={bucketInstanceId:i,featureIndex:o,collisionGroupID:s};for(let t=0;t<e.length;t+=4)r.insertCircle(n,e[t],e[t+1],e[t+2]);}projectAndGetPerspectiveRatio(t,i,o,s,r,n,a){const l=[i,o,s,1];let c=!1;if(s||this.transform.pitch>0){if(e.ad.vec4.transformMat4(l,l,t),this.fogState&&r&&"globe"!==a.name){const t=function(t,i,o,s,r,n){const a=n.calculateFogTileMatrix(r),l=[i,o,s];return e.ad.vec3.transformMat4(l,l,a),ke(t,e.ad.vec3.length(l),n.pitch,n._fov)}(this.fogState,i,o,s,r.toUnwrapped(),this.transform);c=t>.9;}}else si(l,l,t);const h=l[3];return {point:new e.P((l[0]/h+1)/2*this.transform.width+ri,(-l[1]/h+1)/2*this.transform.height+ri),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(a)/h*.5,1.5),signedDistanceFromCamera:h,occluded:n&&l[2]>h||c}}isOffscreen(e,t,i,o){return i<ri||e>=this.screenRightBoundary||o<ri||t>this.screenBottomBoundary}isInsideGrid(e,t,i,o){return i>=0&&e<this.gridRightBoundary&&o>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.ad.mat4.identity([]);return e.ad.mat4.translate(t,t,[-100,-100,0]),t}}function ai(t,i,o){const s=i.createTileMatrix(t,t.worldSize,o.toUnwrapped());return e.ad.mat4.multiply(new Float32Array(16),t.projMatrix,s)}function li(e,t,i){if(t.projection.name===i.projection.name)return e.projMatrix;const o=i.clone();return o.setProjection(t.projection),ai(o,t.getProjection(),e)}function ci(e,t,i){return t.name===i.projection.name?e.projMatrix:ai(i,t,e)}class hi{constructor(e,t,i,o){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):o&&i?1:0,this.placed=i;}isHidden(){return 0===this.opacity&&!this.placed}}class di{constructor(e,t,i,o,s,r=!1){this.text=new hi(e?e.text:null,t,i,s),this.icon=new hi(e?e.icon:null,t,o,s),this.clipped=r;}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ui{constructor(e,t,i,o=!1){this.text=e,this.icon=t,this.skipFade=i,this.clipped=o;}}class _i{constructor(){this.invProjMatrix=e.ad.mat4.create(),this.viewportMatrix=e.ad.mat4.create(),this.circles=[];}}class pi{constructor(e,t,i,o,s){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=i,this.bucketIndex=o,this.tileID=s;}}class fi{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 mi(t,i,o,s,r){const{horizontalAlign:n,verticalAlign:a}=e.bD(t),l=-(n-.5)*i,c=-(a-.5)*o,h=e.bC(t,s);return new e.P(l+h[0]*r,c+h[1]*r)}function gi(t,i,o,s,r){const n=new e.P(t,i);return o&&n._rotate(s?r:-r),n}class vi{constructor(e,t,i,o,s,r){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new ni(this.transform,s),this.buildingIndex=r,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new fi(i),this.collisionCircleArrays={},this.prevPlacement=o,o&&(o.prevPlacement=void 0),this.placedOrientations={};}getBucketParts(t,i,o,s,r=1){const n=o.getBucket(i),a=o.latestFeatureIndex;if(!n||!a||i.fqid!==n.layerIds[0])return;const l=n.layers[0].layout,c=n.layers[0].paint,h=o.collisionBoxArray,d=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ),u=o.tileSize/e.ai,_=o.tileID.toUnwrapped();this.transform.setProjection(n.projection);const p=(f=o.tileID,m=n.getProjection(),g=this.transform,m.name===this.projection?g.calculateProjMatrix(f.toUnwrapped()):ai(g,m,f));var f,m,g;const v="map"===l.get("text-pitch-alignment"),y="map"===l.get("text-rotation-alignment");i.compileFilter(i.options);const x=i.dynamicFilter(),b=i.dynamicFilterNeedsFeature(),w=this.transform.calculatePixelsToTileUnitsMatrix(o),T=Ht(p,o.tileID.canonical,v,y,this.transform,n.getProjection(),w);let E=null;if(v){const t=Zt(p,o.tileID.canonical,v,y,this.transform,n.getProjection(),w);E=e.ad.mat4.multiply([],this.transform.labelPlaneMatrix,t);}let S=null;x&&o.latestFeatureIndex&&(S={unwrappedTileID:_,dynamicFilter:x,dynamicFilterNeedsFeature:b}),this.retainedQueryData[n.bucketInstanceId]=new pi(n.bucketInstanceId,a,n.sourceLayerIndex,n.index,o.tileID);const[C,I]=n.layers[0].layout.get("text-size-scale-range"),R=e.ay(r,C,I),[D,A]=l.get("icon-size-scale-range"),L=e.ay(r,D,A),P={bucket:n,layout:l,paint:c,posMatrix:p,textLabelPlaneMatrix:T,labelToScreenMatrix:E,clippingData:S,scale:d,textPixelRatio:u,holdingForFade:o.holdingForFade(),collisionBoxArray:h,partiallyEvaluatedTextSize:e.bp(n.textSizeData,this.transform.zoom,R),partiallyEvaluatedIconSize:e.bp(n.iconSizeData,this.transform.zoom,L),collisionGroup:this.collisionGroups.get(n.sourceID),latestFeatureIndex:o.latestFeatureIndex};if(s)for(const e of n.sortKeyRanges){const{sortKey:i,symbolInstanceStart:o,symbolInstanceEnd:s}=e;t.push({sortKey:i,symbolInstanceStart:o,symbolInstanceEnd:s,parameters:P});}else t.push({symbolInstanceStart:0,symbolInstanceEnd:n.symbolInstances.length,parameters:P});}attemptAnchorPlacement(e,t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g){const{textOffset0:v,textOffset1:y,crossTileID:x}=d,b=[v,y],w=mi(e,i,o,b,s),T=this.collisionIndex.placeCollisionBox(_,s,t,gi(w.x,w.y,r,n,this.transform.angle),h,a,l,c.predicate);if(f){const e=_.getSymbolInstanceIconSize(g,this.transform.zoom,d.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(_,e,f,gi(w.x,w.y,r,n,this.transform.angle),h,a,l,c.predicate).box.length)return}if(T.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:b,width:i,height:o,anchor:e,textScale:s,prevAnchor:t},this.markUsedJustification(_,e,d,p),_.allowVerticalPlacement&&(this.markUsedOrientation(_,p,d),this.placedOrientations[x]=p),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(t,i,o,s,r=1){const{bucket:n,layout:a,paint:l,posMatrix:c,textLabelPlaneMatrix:h,labelToScreenMatrix:d,clippingData:u,textPixelRatio:_,holdingForFade:p,collisionBoxArray:f,partiallyEvaluatedTextSize:m,partiallyEvaluatedIconSize:g,collisionGroup:v,latestFeatureIndex:y}=t.parameters,x=a.get("text-optional"),b=a.get("icon-optional"),w=a.get("text-allow-overlap"),T=a.get("icon-allow-overlap"),E="map"===a.get("text-rotation-alignment"),S="map"===a.get("text-pitch-alignment"),C=l.get("symbol-z-offset"),I="sea"===a.get("symbol-elevation-reference"),[R,D]=a.get("text-size-scale-range"),[A,L]=a.get("icon-size-scale-range"),P=e.ay(r,R,D),M=e.ay(r,A,L);this.transform.setProjection(n.projection);let z=w&&(T||!n.hasIconData()||b),O=T&&(w||!n.hasTextData()||x);const F=!C.isConstant();!n.collisionArrays&&f&&n.deserializeCollisionBoxes(f),o&&s&&n.updateCollisionDebugBuffers(this.transform.zoom,f,P,M);const k=(t,s,l)=>{const{crossTileID:f,numVerticalGlyphVertices:R}=t;let D=null;if(u&&u.dynamicFilterNeedsFeature||F){const e=this.retainedQueryData[n.bucketInstanceId];D=y.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.sourceLayerIndex,layoutVertexArrayOffset:0});}if(u&&!(0,u.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch},D,this.retainedQueryData[n.bucketInstanceId].tileID.canonical,new e.P(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(u.unwrappedTileID)))return this.placements[f]=new ui(!1,!1,!1,!0),void i.add(f);const A=C.evaluate(D,{});if(i.has(f))return;if(p)return void(this.placements[f]=new ui(!1,!1,!1));let L=!1,P=!1,M=!0,k=!1,B=!1,N=null,U={box:null,offscreen:null,occluded:null},V={box:null,offscreen:null,occluded:null},G=null,j=null,q=null,H=0,Z=0,W=0;l.textFeatureIndex?H=l.textFeatureIndex:t.useRuntimeCollisionCircles&&(H=t.featureIndex),l.verticalTextFeatureIndex&&(Z=l.verticalTextFeatureIndex);const $=e=>{e.tileID=this.retainedQueryData[n.bucketInstanceId].tileID;const i=this.transform.elevation;e.elevation=I?A:A+(i?i.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0),e.elevation+=t.zOffset;},X=l.textBox;if(X){$(X);const i=i=>{let o=e.bq.horizontal;if(n.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[f];e&&(this.placedOrientations[f]=e,o=e,this.markUsedOrientation(n,o,t));}return o},o=(t,i)=>{if(n.allowVerticalPlacement&&R>0&&l.verticalTextBox){for(const o of n.writingModes)if(o===e.bq.vertical?(U=i(),V=U):U=t(),U&&U.box&&U.box.length)break}else U=t();};if(a.get("text-variable-anchor")){let r=a.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[f]){const e=this.prevPlacement.variableOffsets[f];r.indexOf(e.anchor)>0&&(r=r.filter((t=>t!==e.anchor)),r.unshift(e.anchor));}const h=(e,i,o)=>{const a=n.getSymbolInstanceTextSize(m,t,this.transform.zoom,s),l=(e.x2-e.x1)*a+2*e.padding,h=(e.y2-e.y1)*a+2*e.padding,d=t.hasIconTextFit&&!T?i:null;d&&$(d);let u={box:[],offscreen:!1,occluded:!1};const p=w?2*r.length:r.length;for(let i=0;i<p;++i){const p=this.attemptAnchorPlacement(r[i%r.length],e,l,h,a,E,S,_,c,v,i>=r.length,t,s,n,o,d,m,g);if(p&&(u=p.placedGlyphBoxes,u&&u.box&&u.box.length)){L=!0,N=p.shift;break}}return u};o((()=>h(X,l.iconBox,e.bq.horizontal)),(()=>{const t=l.verticalTextBox;return t&&$(t),n.allowVerticalPlacement&&!(U&&U.box&&U.box.length)&&R>0&&t?h(t,l.verticalIconBox,e.bq.vertical):{box:null,offscreen:null,occluded:null}})),U&&(L=U.box,M=U.offscreen,k=U.occluded);const d=i(!(!U||!U.box));if(!L&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[f];e&&(this.variableOffsets[f]=e,this.markUsedJustification(n,e.anchor,t,d));}}else {const a=(i,o)=>{const a=n.getSymbolInstanceTextSize(m,t,this.transform.zoom,s,r),l=this.collisionIndex.placeCollisionBox(n,a,i,new e.P(0,0),w,_,c,v.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(n,o,t),this.placedOrientations[f]=o),l};o((()=>a(X,e.bq.horizontal)),(()=>{const t=l.verticalTextBox;return n.allowVerticalPlacement&&R>0&&t?($(t),a(t,e.bq.vertical)):{box:null,offscreen:null,occluded:null}})),i(!!(U&&U.box&&U.box.length));}}if(G=U,L=G&&G.box&&G.box.length>0,M=G&&G.offscreen,k=G&&G.occluded,t.useRuntimeCollisionCircles){const i=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),s=e.br(n.textSizeData,m,i),r=a.get("text-padding");j=this.collisionIndex.placeCollisionCircles(n,w,i,n.lineVertexArray,n.glyphOffsetArray,s,c,h,d,o,S,v.predicate,t.collisionCircleDiameter*s/e.bw,r,this.retainedQueryData[n.bucketInstanceId].tileID),L=w||j.circles.length>0&&!j.collisionDetected,M=M&&j.offscreen,k=j.occluded;}if(l.iconFeatureIndex&&(W=l.iconFeatureIndex),l.iconBox){const i=i=>{$(i);const o=t.hasIconTextFit&&N?gi(N.x,N.y,E,S,this.transform.angle):new e.P(0,0),s=n.getSymbolInstanceIconSize(g,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(n,s,i,o,T,_,c,v.predicate)};V&&V.box&&V.box.length&&l.verticalIconBox?(q=i(l.verticalIconBox),P=q.box.length>0):(q=i(l.iconBox),P=q.box.length>0),M=M&&q.offscreen,B=q.occluded;}const K=x||0===t.numHorizontalGlyphVertices&&0===R,Y=b||0===t.numIconVertices;if(K||Y?Y?K||(P=P&&L):L=P&&L:P=L=P&&L,L&&G&&G.box&&this.collisionIndex.insertCollisionBox(G.box,a.get("text-ignore-placement"),n.bucketInstanceId,V&&V.box&&Z?Z:H,v.ID),P&&q&&this.collisionIndex.insertCollisionBox(q.box,a.get("icon-ignore-placement"),n.bucketInstanceId,W,v.ID),j&&(L&&this.collisionIndex.insertCollisionCircles(j.circles,a.get("text-ignore-placement"),n.bucketInstanceId,H,v.ID),o)){const e=n.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new _i);for(let e=0;e<j.circles.length;e+=4)t.circles.push(j.circles[e+0]),t.circles.push(j.circles[e+1]),t.circles.push(j.circles[e+2]),t.circles.push(j.collisionDetected?1:0);}const J="globe"!==n.projection.name;z=z&&(J||!k),O=O&&(J||!B),this.placements[f]=new ui(L||z,P||O,M||n.justReloaded),i.add(f);};if("offset"===n.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(n,this.retainedQueryData[n.bucketInstanceId].tileID),"road"===n.elevationType&&n.updateRoadElevation(),n.updateZOffset(),n.sortFeaturesByY){const t=n.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];k(n.symbolInstances.get(i),i,n.collisionArrays[i]);}n.hasAnyZOffset&&e.w(`${n.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`);}else if(n.hasAnyZOffset){const e=n.getSortedIndexesByZOffset();for(let t=0;t<e.length;++t){const i=e[t];k(n.symbolInstances.get(i),i,n.collisionArrays[i]);}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)k(n.symbolInstances.get(e),e,n.collisionArrays[e]);if(o&&n.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[n.bucketInstanceId];e.ad.mat4.invert(t.invProjMatrix,c),t.viewportMatrix=this.collisionIndex.getViewportMatrix();}n.justReloaded=!1;}markUsedJustification(t,i,o,s){const{leftJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:n,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:l,crossTileID:c}=o,h=e.bB(i),d=s===e.bq.vertical?l:"left"===h?r:"center"===h?n:"right"===h?a:-1;r>=0&&(t.text.placedSymbolArray.get(r).crossTileID=d>=0&&r!==d?0:c),n>=0&&(t.text.placedSymbolArray.get(n).crossTileID=d>=0&&n!==d?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=d>=0&&a!==d?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=d>=0&&l!==d?0:c);}markUsedOrientation(t,i,o){const s=i===e.bq.horizontal||i===e.bq.horizontalOnly?i:0,r=i===e.bq.vertical?i:0,{leftJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=o,h=t.text.placedSymbolArray;n>=0&&(h.get(n).placedOrientation=s),a>=0&&(h.get(a).placedOrientation=s),l>=0&&(h.get(l).placedOrientation=s),c>=0&&(h.get(c).placedOrientation=r);}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const o=t?t.symbolFadeChange(e):1,s=t?t.opacities:{},r=t?t.variableOffsets:{},n=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],r=s[e];r?(this.opacities[e]=new di(r,o,t.text,t.icon,null,t.clipped),i=i||t.text!==r.text.placed||t.icon!==r.icon.placed):(this.opacities[e]=new di(null,o,t.text,t.icon,t.skipFade,t.clipped),i=i||t.text||t.icon);}for(const e in s){const t=s[e];if(!this.opacities[e]){const s=new di(t,o,!1,!1);s.isHidden()||(this.opacities[e]=s,i=i||t.text.placed||t.icon.placed);}}for(const e in r)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=r[e]);for(const e in n)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=n[e]);i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e);}updateLayerOpacities(e,t,i,o){const s=new Set;for(const r of t){const t=r.getBucket(e);t&&r.latestFeatureIndex&&e.fqid===t.layerIds[0]&&(this.updateBucketOpacities(t,s,r,r.collisionBoxArray,i,o,r.tileID,e.scope),"offset"===t.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(t,r.tileID),"road"===t.elevationType&&t.updateRoadElevation(),t.updateZOffset());}}updateBucketOpacities(t,i,o,s,r,n,a,l){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 c=t.layers[0].layout,h=t.layers[0].paint,d=!!t.layers[0].dynamicFilter(),u=new di(null,0,!1,!1,!0),_=c.get("text-allow-overlap"),p=c.get("icon-allow-overlap"),f=c.get("text-variable-anchor"),m="map"===c.get("text-rotation-alignment"),g="map"===c.get("text-pitch-alignment"),v=h.get("symbol-z-offset"),y="sea"===c.get("symbol-elevation-reference"),x=!v.isConstant(),b=new di(null,0,_&&(p||!t.hasIconData()||c.get("icon-optional")),p&&(_||!t.hasTextData()||c.get("text-optional")),!0);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);const w=(e,t,i)=>{for(let o=0;o<t/4;o++)e.opacityVertexArray.emplaceBack(i);};let T=0;n&&t.updateReplacement(a,n);for(let s=0;s<t.symbolInstances.length;s++){const c=t.symbolInstances.get(s),{numHorizontalGlyphVertices:h,numVerticalGlyphVertices:_,crossTileID:p,numIconVertices:E,tileAnchorX:S,tileAnchorY:C}=c;let I=null;const R=this.retainedQueryData[t.bucketInstanceId];x&&c&&R&&(I=o.latestFeatureIndex.loadFeature({featureIndex:c.featureIndex,bucketIndex:R.bucketIndex,sourceLayerIndex:R.sourceLayerIndex,layoutVertexArrayOffset:0}));const D=v.evaluate(I,{}),A=i.has(p);let L=this.opacities[p];A?L=u:L||(L=b,this.opacities[p]=L),i.add(p);const P=h>0||_>0,M=E>0,z=this.placedOrientations[p],O=z===e.bq.vertical,F=z===e.bq.horizontal||z===e.bq.horizontalOnly;!P&&!M||L.isHidden()||T++;let k=!1;if((P||M)&&n)for(const i of t.activeReplacements){if(e.bx(i,r,e.by.Symbol,l))continue;if(i.min.x>S||S>i.max.x||i.min.y>C||C>i.max.y)continue;const t=e.bz(S,C,a.canonical,i.footprintTileId.canonical);if(k=e.bA(t,i.footprint),k)break}if(P){const e=k?Ri:Ii(L.text);w(t.text,h,O?Ri:e),w(t.text,_,F?Ri:e);const i=L.text.isHidden(),{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:r,verticalPlacedTextSymbolIndex:n}=c,a=t.text.placedSymbolArray,l=i||O?1:0;o>=0&&(a.get(o).hidden=l),s>=0&&(a.get(s).hidden=l),r>=0&&(a.get(r).hidden=l),n>=0&&(a.get(n).hidden=i||F?1:0);const d=this.variableOffsets[p];d&&this.markUsedJustification(t,d.anchor,c,z);const u=this.placedOrientations[p];u&&(this.markUsedJustification(t,"left",c,u),this.markUsedOrientation(t,u,c));}if(M){const e=k?Ri:Ii(L.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:o}=c,s=t.icon.placedSymbolArray,r=L.icon.isHidden()?1:0;i>=0&&(w(t.icon,E,O?Ri:e),s.get(i).hidden=r),o>=0&&(w(t.icon,c.numVerticalIconVertices,F?Ri:e),s.get(o).hidden=r);}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const i=t.collisionArrays[s];if(i){let o=new e.P(0,0),s=!0;if(i.textBox||i.verticalTextBox){if(f){const e=this.variableOffsets[p];e?(o=mi(e.anchor,e.width,e.height,e.textOffset,e.textScale),m&&o._rotate(g?this.transform.angle:-this.transform.angle)):s=!1;}d&&(s=!L.clipped),i.textBox&&yi(t.textCollisionBox.collisionVertexArray,L.text.placed,!s||O,D,y,o.x,o.y),i.verticalTextBox&&yi(t.textCollisionBox.collisionVertexArray,L.text.placed,!s||F,D,y,o.x,o.y);}const r=s&&Boolean(!F&&i.verticalIconBox);i.iconBox&&yi(t.iconCollisionBox.collisionVertexArray,L.icon.placed,r,D,y,c.hasIconTextFit?o.x:0,c.hasIconTextFit?o.y:0),i.verticalIconBox&&yi(t.iconCollisionBox.collisionVertexArray,L.icon.placed,!r,D,y,c.hasIconTextFit?o.x:0,c.hasIconTextFit?o.y:0);}}}if(t.fullyClipped=0===T,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 i=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*i>e}setStale(){this.stale=!0;}}function yi(e,t,i,o,s,r,n){e.emplaceBack(t?1:0,i?1:0,r||0,n||0,o,s?1:0),e.emplaceBack(t?1:0,i?1:0,r||0,n||0,o,s?1:0),e.emplaceBack(t?1:0,i?1:0,r||0,n||0,o,s?1:0),e.emplaceBack(t?1:0,i?1:0,r||0,n||0,o,s?1:0);}const xi=Math.pow(2,25),bi=Math.pow(2,24),wi=Math.pow(2,17),Ti=Math.pow(2,16),Ei=Math.pow(2,9),Si=Math.pow(2,8),Ci=Math.pow(2,1);function Ii(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,i=Math.floor(127*e.opacity);return i*xi+t*bi+i*wi+t*Ti+i*Ei+t*Si+i*Ci+t}const Ri=0;class Di{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,i,o,s,r){const n=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(n,o,e[this._currentTileIndex],this._sortAcrossTiles,r),this._currentTileIndex++,s())return !0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,n.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<n.length;){const e=n[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,i,0===e.symbolInstanceStart,r),this._currentPartIndex++,s())return !0}return !1}}class Ai{constructor(e,t,i,o,s,r,n,a,l){this.placement=new vi(e,s,r,n,a,l),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=o,this._done=!1;}isDone(){return this._done}continuePlacement(t,i,o,s,r){const n=e.q.now(),a=()=>{const t=e.q.now()-n;return !this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const n=i[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=l)&&(!n.maxzoom||n.maxzoom>l)){const t=n,i=t.layout.get("symbol-z-elevate"),l=void 0!==t.layout.get("symbol-sort-key").constantOr(1),c=t.layout.get("symbol-z-order"),h="viewport-y"===c||"auto"===c&&!("viewport-y"!==c&&l),d=t.layout.get("text-allow-overlap")||t.layout.get("icon-allow-overlap")||t.layout.get("text-ignore-placement")||t.layout.get("icon-ignore-placement"),u=h&&d,_=this._inProgressLayer=this._inProgressLayer||new Di(t),p=e.C(n.source,n.scope);if(_.continuePlacement(i||u?s[p]:o[p],this.placement,this._showCollisionBoxes,n,a,r))return;delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;}commit(e){return this.placement.commit(e),this.placement}}const Li=512/e.ai/2;class Pi{constructor(t,i,o){this.tileID=t,this.bucketInstanceId=o,this.index=new e.bE(i.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const s=t.canonical.x*e.ai,r=t.canonical.y*e.ai;for(let e=0;e<i.length;e++){const{key:t,crossTileID:o,tileAnchorX:n,tileAnchorY:a}=i.get(e),l=Math.floor((s+n)*Li),c=Math.floor((r+a)*Li);this.index.add(l,c),this.keys.push(t),this.crossTileIDs.push(o);}this.index.finish();}findMatches(t,i,o){const s=this.tileID.canonical.z<i.canonical.z?1:Math.pow(2,this.tileID.canonical.z-i.canonical.z),r=Li/Math.pow(2,i.canonical.z-this.tileID.canonical.z),n=i.canonical.x*e.ai,a=i.canonical.y*e.ai;for(let e=0;e<t.length;e++){const i=t.get(e);if(i.crossTileID)continue;const{key:l,tileAnchorX:c,tileAnchorY:h}=i,d=Math.floor((n+c)*r),u=Math.floor((a+h)*r),_=this.index.range(d-s,u-s,d+s,u+s);for(const e of _){const t=this.crossTileIDs[e];if(this.keys[e]===l&&!o.has(t)){o.add(t),i.crossTileID=t;break}}}}}class Mi{constructor(){this.maxCrossTileID=0;}generate(){return ++this.maxCrossTileID}}class zi{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 i=this.indexes[e],o={};for(const e in i){const s=i[e];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+t),o[s.tileID.key]=s;}this.indexes[e]=o;}this.lng=e;}addBucket(e,t,i){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 o=this.usedCrossTileIDs[e.overscaledZ];for(const i in this.indexes){const s=this.indexes[i];if(Number(i)>e.overscaledZ)for(const i in s){const r=s[i];r.tileID.isChildOf(e)&&r.findMatches(t.symbolInstances,e,o);}else {const r=s[e.scaledTo(Number(i)).key];r&&r.findMatches(t.symbolInstances,e,o);}}for(let e=0;e<t.symbolInstances.length;e++){const s=t.symbolInstances.get(e);s.crossTileID||(s.crossTileID=i.generate(),o.add(s.crossTileID));}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Pi(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const i of t.crossTileIDs)this.usedCrossTileIDs[e].delete(i);}removeStaleBuckets(e){let t=!1;for(const i in this.indexes){const o=this.indexes[i];for(const s in o)e[o[s].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,o[s]),delete o[s],t=!0);}return t}}class Oi{constructor(){this.layerIndexes={},this.crossTileIDs=new Mi,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={};}addLayer(e,t,i,o){let s=this.layerIndexes[e.fqid];void 0===s&&(s=this.layerIndexes[e.fqid]=new zi);let r=!1;const n={};"globe"!==o.name&&s.handleWrapJump(i);for(const i of t){const t=i.getBucket(e);t&&e.fqid===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(i.tileID,t,this.crossTileIDs)&&(r=!0),n[t.bucketInstanceId]=!0);}return s.removeStaleBuckets(n)&&(r=!0),r}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0;}));for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e];}}const Fi=771;class ki{constructor(e,t,i,o){this.blendFunction=e,this.blendColor=t,this.mask=i,this.blendEquation=o;}}ki.Replace=[1,0,1,0],ki.disabled=new ki(ki.Replace,e.al.transparent,[!1,!1,!1,!1]),ki.unblended=new ki(ki.Replace,e.al.transparent,[!0,!0,!0,!0]),ki.alphaBlended=new ki([1,Fi,1,Fi],e.al.transparent,[!0,!0,!0,!0]),ki.alphaBlendedNonPremultiplied=new ki([770,Fi,770,Fi],e.al.transparent,[!0,!0,!0,!0]),ki.multiply=new ki([774,0,774,0],e.al.transparent,[!0,!0,!0,!0]);class Bi{constructor(e,t,i){this.func=e,this.mask=t,this.range=i;}}Bi.ReadOnly=!1,Bi.ReadWrite=!0,Bi.disabled=new Bi(519,Bi.ReadOnly,[0,1]);const Ni=7680;class Ui{constructor(e,t,i,o,s,r){this.test=e,this.ref=t,this.mask=i,this.fail=o,this.depthFail=s,this.pass=r;}}Ui.disabled=new Ui({func:519,mask:0},0,0,Ni,Ni,Ni);const Vi=1029,Gi=2305;class ji{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i;}}function qi(t,i){const o=e.bG(t,3);e.ad.mat4.fromQuat(t,i),e.bI(t,3,o);}function Hi(t,i){const o=e.ad.quat.identity([]);return e.ad.quat.rotateZ(o,o,-i),e.ad.quat.rotateX(o,o,-t),o}function Zi(t,i){const o=[t[0],t[1],0],s=[i[0],i[1],0];if(e.ad.vec3.length(o)>=1e-15){const t=e.ad.vec3.normalize([],o);e.ad.vec3.scale(s,t,e.ad.vec3.dot(s,t)),i[0]=s[0],i[1]=s[1];}const r=e.ad.vec3.cross([],i,t);if(e.ad.vec3.len(r)<1e-15)return null;const n=Math.atan2(-r[1],r[0]);return Hi(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),n)}ji.disabled=new ji(!1,Vi,Gi),ji.backCCW=new ji(!0,Vi,Gi),ji.backCW=new ji(!0,Vi,2304),ji.frontCW=new ji(!0,1028,2304),ji.frontCCW=new ji(!0,1028,Gi);class Wi{constructor(e,t){this.position=e,this.orientation=t;}get position(){return this._position}set position(t){if(t){const i=t instanceof e.ac?t:new e.ac(t[0],t[1],t[2]);this._renderWorldCopies&&(i.x=e.bF(i.x,0,1)),this._position=i;}else this._position=null;}lookAtPoint(t,i){if(this.orientation=null,!this.position)return;const o=this.position,s=this._elevation?this._elevation.getAtPointOrZero(e.ac.fromLngLat(t)):0,r=e.ac.fromLngLat(t,s),n=[r.x-o.x,r.y-o.y,r.z-o.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=Zi(n,i);}setPitchBearing(t,i){this.orientation=Hi(e.ak(t),e.ak(-i));}}class $i{constructor(t,i){this._transform=e.ad.mat4.identity([]),this.orientation=i,this.position=t;}get mercatorPosition(){const t=this.position;return new e.ac(t[0],t[1],t[2])}get position(){const t=e.bG(this._transform,3);return [t[0],t[1],t[2]]}set position(t){var i;t&&e.bI(this._transform,3,[(i=t)[0],i[1],i[2],1]);}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.ad.quat.identity([]),t&&qi(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=Hi(e,t),qi(this._transform,this._orientation);}forward(){const t=e.bG(this._transform,2);return [-t[0],-t[1],-t[2]]}up(){const t=e.bG(this._transform,1);return [-t[0],-t[1],-t[2]]}right(){const t=e.bG(this._transform,0);return [t[0],t[1],t[2]]}getCameraToWorld(t,i){const o=new Float64Array(16);return e.ad.mat4.invert(o,this.getWorldToCamera(t,i)),o}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,i,o){const s=this.position;e.ad.vec3.scale(s,s,-t);const r=new Float64Array(16);return e.ad.mat4.fromScaling(r,[o,o,o]),e.ad.mat4.translate(r,r,s),r[10]*=i,r}getWorldToCamera(t,i){const o=new Float64Array(16),s=new Float64Array(4),r=this.position;return e.ad.quat.conjugate(s,this._orientation),e.ad.vec3.scale(r,r,-t),e.ad.mat4.fromQuat(o,s),e.ad.mat4.translate(o,o,r),o[1]*=-1,o[5]*=-1,o[9]*=-1,o[13]*=-1,o[8]*=i,o[9]*=i,o[10]*=i,o[11]*=i,o}getCameraToClipPerspective(t,i,o,s){const r=new Float64Array(16);return e.ad.mat4.perspective(r,t,i,o,s),r}getCameraToClipOrthographic(t,i,o,s,r,n){const a=new Float64Array(16);return e.ad.mat4.ortho(a,t,i,o,s,r,n),a}getDistanceToElevation(t,i=!1){const o=0===t?0:e.bH(t,i?e.aT(this.position[1]):this.position[1]),s=this.forward();return (o-this.position[2])/s[2]}clone(){return new $i([...this.position],[...this.orientation])}}const Xi={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,LUT:10,ShadowMap0:11};class Ki{constructor(e=0,t=0,i=0,o=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(o)||o<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=i,this.right=o;}interpolate(t,i,o){return null!=i.top&&null!=t.top&&(this.top=e.ah(t.top,i.top,o)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.ah(t.bottom,i.bottom,o)),null!=i.left&&null!=t.left&&(this.left=e.ah(t.left,i.left,o)),null!=i.right&&null!=t.right&&(this.right=e.ah(t.right,i.right,o)),this}getCenter(t,i){const o=e.ay((this.left+t-this.right)/2,0,t),s=e.ay((this.top+i-this.bottom)/2,0,i);return new e.P(o,s)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Ki(this.top,this.bottom,this.left,this.right)}toJSON(){return {top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Yi=15;class Ji{constructor(t,i,o,s,r,n,a){this.tileSize=512,this._renderWorldCopies=void 0===r||r,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=o??0,this._maxPitch=s??60,this.setProjection(n),this.setMaxBounds(a),this.width=0,this.height=0,this._center=new e.bO(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 Ki,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new $i,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1,this._allowWorldUnderZoom=!1;}clone(){const e=new Ji(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection(),this.maxBounds);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._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,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._allowWorldUnderZoom=this._allowWorldUnderZoom,e}get isOrthographic(){return "globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<Yi}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices());}get depthOcclusionForSymbolsAndCircles(){return "globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e,t=!1){const i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(e||i)&&this._constrainCamera(t),this._calcMatrices();}getProjection(){return e.aA(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const i=this.projection?this.getProjection():void 0;this.projection=e.bP(this.projectionOptions);const o=this.getProjection(),s=!e.bn(i,o);return s&&this._calcMatrices(),this.mercatorFromTransition=!1,s}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.bP({name:"mercator"});const i=t!==this.projection.name;return i&&this._calcMatrices(),i}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.bH(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return e.bF(this.rotation,-180,180)}set bearing(e){this.rotation=e;}get rotation(){return -this.angle/Math.PI*180}set rotation(t){const i=-t*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=e.ad.mat2.create(),e.ad.mat2.rotate(this.rotationMatrix,this.rotationMatrix,this.angle));}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const i=e.ay(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices());}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.ak(t),this._calcMatrices());}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}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;}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e);}_updateCameraOnTerrain(){const e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,t=this.elevation&&e===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===Number.NEGATIVE_INFINITY&&(!t||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const i=this._elevation;t||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&i.exaggeration()&&this._centerAltitudeValidForExaggeration!==i.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*i.exaggeration(),this._centerAltitudeValidForExaggeration=i.exaggeration()):(this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=i.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,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],o=this.horizonLineFromTop();let s=0,r=0;for(let n=0;n<i.length;n++){const a=new e.P(i[n][0]*this.width,o+i[n][1]*(this.height-o)),l=t.pointCoordinate(a);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);s+=l[3]*c,r+=c;}return 0===r?NaN:s/r}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)),i=this.pixelsPerMeter/this.worldSize*t,o=this._mercatorZfromZoom(e),s=this._mercatorZfromZoom(this._maxZoom),r=Math.max(o-i,s);this._setZoom(this._zoomFromMercatorZ(r));}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 i=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let o;o=t.z<this._camera.position[2]?[i.x,i.y,i.z]:[t.x,t.y,t.z];const s=e.ad.vec3.length(e.ad.vec3.sub([],this._camera.position,o));return e.ay(this._zoomFromMercatorZ(s),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let i=!1;if(t.orientation&&!e.ad.quat.exactEquals(t.orientation,this._camera.orientation)&&(i=this._setCameraOrientation(t.orientation)),t.position){const o=[t.position.x,t.position.y,t.position.z];e.ad.vec3.exactEquals(o,this._camera.position)||(this._setCameraPosition(o),i=!0);}i&&(this._updateStateFromCamera(),this.recenterOnTerrain());}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,i=new Wi;return i.position=new e.ac(t[0],t[1],t[2]),i.orientation=this._camera.orientation,i._elevation=this.elevation,i._renderWorldCopies=this.renderWorldCopies,i}_setCameraOrientation(t){if(!e.ad.quat.length(t))return !1;e.ad.quat.normalize(t,t);const i=e.ad.vec3.transformQuat([],[0,0,-1],t),o=e.ad.vec3.transformQuat([],[0,-1,0],t);if(o[2]<0)return !1;const s=Zi(i,o);return !!s&&(this._camera.orientation=s,!0)}_setCameraPosition(t){const i=this.zoomScale(this.minZoom)*this.tileSize,o=this.zoomScale(this.maxZoom)*this.tileSize,s=this.cameraToCenterDistance;t[2]=e.ay(t[2],s/o,s/i),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,i){this._unmodified=!1,this._edgeInsets.interpolate(e,t,i),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 i=[new e.bQ(0,t)];if(this.renderWorldCopies){const o=this.pointCoordinate(new e.P(0,0)),s=this.pointCoordinate(new e.P(this.width,0)),r=this.pointCoordinate(new e.P(this.width,this.height)),n=this.pointCoordinate(new e.P(0,this.height)),a=Math.floor(Math.min(o.x,s.x,r.x,n.x)),l=Math.floor(Math.max(o.x,s.x,r.x,n.x)),c=1;for(let o=a-c;o<=l+c;o++)0!==o&&i.push(new e.bQ(o,t));}return i}isLODDisabled(e){return (!e||this.pitch<=60)&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace}extendTileCover(t,i,o){let s=[];const r=void 0!==o,n=!r;if(n&&this.zoom<i)return s;if(r&&0===o[0]&&0===o[1])return s;const a=new Set,l=(t,i,o,r,n)=>{const l=e.c5(i,t,o,r,n);a.has(l)||(s.push(new e.aH(t,i,o,r,n)),a.add(l));};for(let e=0;e<t.length;e++){const s=t[e];if(n&&s.canonical.z!==i)continue;const a=s.canonical,c=s.overscaledZ,h=s.wrap,d=1<<a.z,u=a.x+1<d,_=a.x>0,p=a.y+1<d,f=a.y>0,m=s.wrap-(_?0:1),g=s.wrap+(u?0:1),v=_?a.x-1:d-1,y=u?a.x+1:0;if(r)o[0]<0?(l(c,g,a.z,y,a.y),o[1]<0&&p&&(l(c,h,a.z,a.x,a.y+1),l(c,g,a.z,y,a.y+1)),o[1]>0&&f&&(l(c,h,a.z,a.x,a.y-1),l(c,g,a.z,y,a.y-1))):o[0]>0?(l(c,m,a.z,v,a.y),o[1]<0&&p&&(l(c,h,a.z,a.x,a.y+1),l(c,m,a.z,v,a.y+1)),o[1]>0&&f&&(l(c,h,a.z,a.x,a.y-1),l(c,m,a.z,v,a.y-1))):o[1]<0&&p?l(c,h,a.z,a.x,a.y+1):f&&l(c,h,a.z,a.x,a.y-1);else {const e=s.visibleQuadrants;1&e&&(l(c,m,a.z,v,a.y),f&&(l(c,h,a.z,a.x,a.y-1),l(c,m,a.z,v,a.y-1))),2&e&&(l(c,g,a.z,y,a.y),f&&(l(c,h,a.z,a.x,a.y-1),l(c,g,a.z,y,a.y-1))),4&e&&(l(c,m,a.z,v,a.y),p&&(l(c,h,a.z,a.x,a.y+1),l(c,m,a.z,v,a.y+1))),8&e&&(l(c,g,a.z,y,a.y),p&&(l(c,h,a.z,a.x,a.y+1),l(c,g,a.z,y,a.y+1)));}}const c=[];for(const e of s)s.some((t=>e.isChildOf(t)))||c.push(e);if(s=c.filter((e=>!t.some((t=>!!(e.overscaledZ<i&&t.isChildOf(e))||e.equals(t)||e.isChildOf(t))))),n){const e=1<<i,t="globe"===this.projection.name?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),o=[e*t.x,e*t.y],r=4,n=r*r;s=s.filter((e=>{const t=e.canonical.x+.5-o[0],i=e.canonical.y+.5-o[1];return t*t+i*i<n}));}return s}coveringTiles(t){let i=this.coveringZoomLevel(t);const o=i,s=this.elevation&&this.elevation.exaggeration(),r=s&&!t.isTerrainDEM,n="mercator"===this.projection.name;if(void 0!==t.minzoom&&i<t.minzoom)return [];void 0!==t.maxzoom&&i>t.maxzoom&&(i=t.maxzoom);const a=this.locationCoordinate(this.center),l=this.center.lat,c=1<<i,h=[c*a.x,c*a.y,0],d="globe"===this.projection.name,u=!d,_=e.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i,u),p=d?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),f=c*e.bH(1,this.center.lat),m=this._camera.position[2]/e.bH(1,this.center.lat),g=[c*p.x,c*p.y,m*(u?1:f)],v=d||s,y=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),x=this.isLODDisabled(!0)?i:0;let b;if(this._elevation&&t.isTerrainDEM)b=1e4*this._elevation.exaggeration();else if(this._elevation){const e=this._elevation.getMinMaxForVisibleTiles();b=e?e.max:this._centerAltitude;}else b=this._centerAltitude;const w=t.isTerrainDEM?-b:this._elevation?this._elevation.getMinElevationBelowMSL():0,T=this.projection.isReprojectedInTileSpace?e.bS(this):1,E=t=>{const i=1/4e4,o=new e.ac(t.x+i,t.y,t.z),s=new e.ac(t.x,t.y+i,t.z),r=t.toLngLat(),n=o.toLngLat(),a=s.toLngLat(),l=this.locationCoordinate(r),c=this.locationCoordinate(n),h=this.locationCoordinate(a),d=Math.hypot(c.x-l.x,c.y-l.y),u=Math.hypot(h.x-l.x,h.y-l.y);return Math.sqrt(d*u)*T/i},S=t=>{const i=b,o=w;return {aabb:e.bV(this,c,0,0,0,t,o,i,this.projection),zoom:0,x:0,y:0,minZ:o,maxZ:i,wrap:t,fullyVisible:!1}},C=[];let I=[];const R=i,D=t.reparseOverscaled?o:i,A=(m-this._centerAltitude)*f,L=e=>{if(!this._elevation||!e.tileID||!n)return;const t=this._elevation.getMinMaxForTile(e.tileID),i=e.aabb;t?(i.min[2]=t.min,i.max[2]=t.max,i.center[2]=(i.min[2]+i.max[2])/2):(e.shouldSplit=M(e),e.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude));},P=(e,t)=>{if(.707*t<e)return 1;const i=t/e;return i/(1.4144271570014144+(Math.pow(1.1,i-1.4144271570014144+1)-1)/(1.1-1)-1)},M=t=>{if(t.zoom<x)return !0;if(t.zoom===R)return !1;if(null!=t.shouldSplit)return t.shouldSplit;const i=t.aabb.distanceX(g),s=t.aabb.distanceY(g);let a=A,c=1;if(d){a=t.aabb.distanceZ(g);const i=Math.pow(2,t.zoom),o=e.aT((t.y+1)/i),s=e.aT(t.y/i),r=Math.min(Math.max(l,o),s),n=e.ca(r)/e.ca(l);if(c=r===l?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,n/this._mercatorScaleRatio),this.zoom<=e.c6&&t.zoom===R-1&&n>=.9)return !0}else if(r&&(a=t.aabb.distanceZ(g)*f),this.projection.isReprojectedInTileSpace&&o<=5){const i=Math.pow(2,t.zoom),o=E(new e.ac((t.x+.5)/i,(t.y+.5)/i));c=o>.85?1:o;}if(!n){const e=Math.sqrt(i*i+s*s+a*a);let o=(1<<R-t.zoom)*y*c;return o*=P(Math.max(a,A),e),e<o}let u=Number.MAX_VALUE,_=0;const p=t.aabb.getCorners(),m=[];for(const t of p){e.ad.vec3.sub(m,t,g),d||(r?m[2]*=f:m[2]=A);const i=e.ad.vec3.dot(m,this._camera.forward());i<u&&(u=i,_=Math.abs(m[2]));}let v=(1<<R-t.zoom)*y*c;if(v*=P(Math.max(_,A),u),u<v)return !0;const b=t.aabb.closestPoint(h);return b[0]===h[0]&&b[1]===h[1]};if(this.renderWorldCopies)for(let e=1;e<=3;e++)C.push(S(-e)),C.push(S(e));for(C.push(S(0));C.length>0;){const o=C.pop(),s=o.x,a=o.y;let l=o.fullyVisible;const u=()=>"globe"===this.projection.name&&(0===o.y||o.y===(1<<o.zoom)-1);if(!l){let t=v?o.aabb.intersects(_):o.aabb.intersectsFlat(_);if(0===t&&u()){const i=new e.bT(o.zoom,s,a);t=e.bU(this,c,i,!0).intersects(_);}if(0===t)continue;l=2===t;}if(o.zoom!==R&&M(o))for(let t=0;t<4;t++){const i=(s<<1)+t%2,h=(a<<1)+(t>>1),u={aabb:n?o.aabb.quadrant(t):e.bV(this,c,o.zoom+1,i,h,o.wrap,o.minZ,o.maxZ,this.projection),zoom:o.zoom+1,x:i,y:h,wrap:o.wrap,fullyVisible:l,tileID:void 0,shouldSplit:void 0,minZ:o.minZ,maxZ:o.maxZ};r&&!d&&(u.tileID=new e.aH(o.zoom+1===R?D:o.zoom+1,o.wrap,o.zoom+1,i,h),L(u)),C.push(u);}else {const r=o.zoom===R?D:o.zoom;if(t.minzoom&&t.minzoom>r)continue;let n=0;if(!l){let i=v?o.aabb.intersectsPrecise(_):o.aabb.intersectsPreciseFlat(_);if(0===i&&u()){const t=new e.bT(o.zoom,s,a);i=e.bU(this,c,t,!0).intersectsPrecise(_);}if(0===i)continue;if(t.calculateQuadrantVisibility)if(_.containsPoint(o.aabb.center))n=15;else for(let e=0;e<4;e++)0!==o.aabb.quadrant(e).intersects(_)&&(n|=1<<e);}const d=h[0]-(.5+s+(o.wrap<<o.zoom))*(1<<i-o.zoom),p=h[1]-.5-a,f=o.tileID?o.tileID:new e.aH(r,o.wrap,o.zoom,s,a);t.calculateQuadrantVisibility&&(f.visibleQuadrants=n),I.push({tileID:f,distanceSq:d*d+p*p});}}if(this.fogCullDistSq){const i=this.fogCullDistSq,o=this.horizonLineFromTop();I=I.filter((s=>{const r=[0,0,0,1],n=[e.ai,e.ai,0,1],a=this.calculateFogTileMatrix(s.tileID.toUnwrapped());e.ad.vec4.transformMat4(r,r,a),e.ad.vec4.transformMat4(n,n,a);const l=e.ad.vec4.min([],r,n),c=e.ad.vec4.max([],r,n),h=e.bW(l,c);if(0===h)return !0;let d=!1;const u=this._elevation;if(u&&h>i&&0!==o){const i=this.calculateProjMatrix(s.tileID.toUnwrapped());let r;t.isTerrainDEM||(r=u.getMinMaxForTile(s.tileID)),r||(r={min:w,max:b});const n=e.c7(this.rotation),a=[n[0]*e.ai,n[1]*e.ai,r.max];e.ad.vec3.transformMat4(a,a,i),d=(1-a[1])*this.height*.5<o;}return h<i||d}));}return I.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 i=e.ay(t.lat,-e.bX,e.bX),o=this.projection.project(t.lng,i);return new e.P(o.x*this.worldSize,o.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.bH(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,i){let o,s;const r=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;o=(i.x-r.x)/e,s=(i.y-r.y)/e;}else {const e=this.pointCoordinate(i),t=this.pointCoordinate(r);o=e.x-t.x,s=e.y-t.y;}const n=this.locationCoordinate(t);this.setLocation(new e.ac(n.x-o,n.y-s));}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap());}locationPoint(e,t){return this.projection.locationPoint(this,e,t)}locationPoint3D(e,t){return this.projection.locationPoint(this,e,t,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e,t){return this.coordinateLocation(this.pointCoordinate3D(e,t))}locationCoordinate(t,i){const o=i?e.bH(i,t.lat):void 0,s=this.projection.project(t.lng,t.lat);return new e.ac(s.x,s.y,o)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,i){const o=null!=i?i:this._centerAltitude,s=[t.x,t.y,0,1],r=[t.x,t.y,1,1];e.ad.vec4.transformMat4(s,s,this.pixelMatrixInverse),e.ad.vec4.transformMat4(r,r,this.pixelMatrixInverse);const n=r[3];e.ad.vec4.scale(s,s,1/s[3]),e.ad.vec4.scale(r,r,1/n);const a=s[2],l=r[2];return {p0:s,p1:r,t:a===l?0:(o-a)/(l-a)}}screenPointToMercatorRay(t){const i=[t.x,t.y,0,1],o=[t.x,t.y,1,1];return e.ad.vec4.transformMat4(i,i,this.pixelMatrixInverse),e.ad.vec4.transformMat4(o,o,this.pixelMatrixInverse),e.ad.vec4.scale(i,i,1/i[3]),e.ad.vec4.scale(o,o,1/o[3]),i[2]=e.bH(i[2],this._center.lat)*this.worldSize,o[2]=e.bH(o[2],this._center.lat)*this.worldSize,e.ad.vec4.scale(i,i,1/this.worldSize),e.ad.vec4.scale(o,o,1/this.worldSize),new e.as([i[0],i[1],i[2]],e.ad.vec3.normalize([],e.ad.vec3.sub([],o,i)))}rayIntersectionCoordinate(t){const{p0:i,p1:o,t:s}=t,r=e.bH(i[2],this._center.lat),n=e.bH(o[2],this._center.lat);return new e.ac(e.ah(i[0],o[0],s)/this.worldSize,e.ah(i[1],o[1],s)/this.worldSize,e.ah(r,n,s))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t,i){if(!this.elevation)return this.pointCoordinate(t,i);let o=this.projection.pointCoordinate3D(this,t.x,t.y);if(o)return new e.ac(o[0],o[1],o[2]);let s=0,r=this.horizonLineFromTop();if(t.y>r)return this.pointCoordinate(t,i);const n=.02*r,a=t.clone();for(let t=0;t<10&&r-s>n;t++){a.y=e.ah(s,r,.66);const t=this.projection.pointCoordinate3D(this,a.x,a.y);t?(r=a.y,o=t):s=a.y;}return o?new e.ac(o[0],o[1],o[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.bY)return !this.isPointAboveHorizon(t);const i=this.pointCoordinate(t);return i.y>=0&&i.y<=1}_coordinatePoint(t,i){const o=i&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,s=[t.x*this.worldSize,t.y*this.worldSize,o+t.toAltitude(),1];return e.ad.vec4.transformMat4(s,s,this.pixelMatrix),s[3]>0?new e.P(s[0]/s[3],s[1]/s[3]):new e.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:i}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,s=this.width-this._edgeInsets.right,r=this.pointLocation3D(new e.P(i,t)),n=this.pointLocation3D(new e.P(s,t)),a=this.pointLocation3D(new e.P(s,o)),l=this.pointLocation3D(new e.P(i,o));let c=Math.min(r.lng,n.lng,a.lng,l.lng),h=Math.max(r.lng,n.lng,a.lng,l.lng),d=Math.min(r.lat,n.lat,a.lat,l.lat),u=Math.max(r.lat,n.lat,a.lat,l.lat);const _=Math.pow(2,-this.zoom)/16*270,p="globe"===this.projection.name?1:4,f=(t,i,o,s,r)=>{const n=(t+o)/2,a=(i+s)/2,l=new e.P(n,a),{lng:m,lat:g}=this.pointLocation3D(l),v=Math.max(0,c-m,d-g,m-h,g-u);c=Math.min(c,m),h=Math.max(h,m),d=Math.min(d,g),u=Math.max(u,g),(r<p||v>_)&&(f(t,i,n,a,r+1),f(n,a,o,s,r+1));};if(f(i,t,s,t,1),f(s,t,s,o,1),f(s,o,i,o,1),f(i,o,i,t,1),"globe"===this.projection.name){const[t,i]=e.bZ(this);t?(u=90,h=180,c=-180):i&&(d=-90,h=180,c=-180);}return new e.aB(new e.bO(c,d),new e.bO(h,u))}_getBoundsRectangular(t,i){const{top:o,left:s}=this._edgeInsets,r=this.height-this._edgeInsets.bottom,n=this.width-this._edgeInsets.right,a=new e.P(s,o),l=new e.P(n,o),c=new e.P(n,r),h=new e.P(s,r);let d=this.pointCoordinate(a,t),u=this.pointCoordinate(l,t);const _=this.pointCoordinate(c,i),p=this.pointCoordinate(h,i),f=(e,t)=>(t.y-e.y)/(t.x-e.x);return d.y>1&&u.y>=0?d=new e.ac((1-p.y)/f(p,d)+p.x,1):d.y<0&&u.y<=1&&(d=new e.ac(-p.y/f(p,d)+p.x,0)),u.y>1&&d.y>=0?u=new e.ac((1-_.y)/f(_,u)+_.x,1):u.y<0&&d.y<=1&&(u=new e.ac(-_.y/f(_,u)+_.x,0)),(new e.aB).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(u)).extend(this.coordinateLocation(p)).extend(this.coordinateLocation(_))}_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 i=t.dem.tree;e.min=Math.min(e.min,i.minimums[0]),e.max=Math.max(e.max,i.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,i=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.bX,this.maxLat=e.bX,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.av(this.minLng)*this.tileSize,this.worldMaxX=e.av(this.maxLng)*this.tileSize,this.worldMinY=e.aC(this.maxLat)*this.tileSize,this.worldMaxY=e.aC(this.minLat)*this.tileSize,this._constrain();}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(t){const i=t.key,o=this._distanceTileDataCache;if(o[i])return o[i];const s=t.canonical,r=1/this.height,n=this.cameraWorldSize,a=n/this.zoomScale(s.z),l=(s.x+Math.pow(2,s.z)*t.wrap)*a,c=s.y*a,h=this.point;h.x*=n/this.worldSize,h.y*=n/this.worldSize;const d=this.angle,u=Math.sin(-d),_=-Math.cos(-d);return o[i]={bearing:[u,_],center:[(h.x-l)*r,(h.y-c)*r],scale:a/e.ai*r},o[i]}calculateFogTileMatrix(t){const i=t.key,o=this._fogTileMatrixCache;if(o[i])return o[i];const s=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return e.ad.mat4.multiply(s,this.worldToFogMatrix,s),o[i]=new Float32Array(s),o[i]}calculateProjMatrix(t,i=!1,o=!1){const s=t.key;let r;if(r=o?this._expandedProjMatrixCache:i?this._alignedProjMatrixCache:this._projMatrixCache,r[s])return r[s];const n=this.calculatePosMatrix(t,this.worldSize);let a;return a=this.projection.isReprojectedInTileSpace?this.mercatorMatrix:o?this.expandedFarZProjMatrix:i?this.alignedProjMatrix:this.projMatrix,e.ad.mat4.multiply(n,a,n),r[s]=new Float32Array(n),r[s]}calculatePixelsToTileUnitsMatrix(t){const i=t.tileID.key,o=this._pixelsToTileUnitsCache;if(o[i])return o[i];const s=e.b_(t,this);return o[i]=s,o[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}globeToMercatorMatrix(){if("globe"===this.projection.name){const t=1/this.worldSize,i=e.ad.mat4.fromScaling([],[t,t,t]);return e.ad.mat4.multiply(i,i,this.globeMatrix),i}}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const i=e.bH(1,this._center.lat)*this.worldSize,o=this._computeCameraPosition(i),s=this._camera.forward(),r=e.bH(1,this._center.lat);o[2]/=r,s[2]/=r,e.ad.vec3.normalize(s,s);const n=t.raycast(o,s,t.exaggeration());if(n){const t=e.ad.vec3.scaleAndAdd([],o,s,n),i=new e.ac(t[0],t[1],e.bH(t[2],e.aT(t[1]))),a=(i.z+e.ad.vec3.length([i.x-o[0],i.y-o[1],i.z-o[2]*r]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(a),this._centerAltitude=i.toAltitude(),this._center=this.coordinateLocation(i),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices();}}_constrainCamera(t=!1){if(!this._elevation)return;const i=this._elevation,o=e.bH(1,this._center.lat)*this.worldSize,s=this._computeCameraPosition(o),r=i.getAtPointOrZero(new e.ac(...s)),n=this.pixelsPerMeter/this.worldSize*r,a=this._minimumHeightOverTerrain(),l=s[2]-n;if(l<=a)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),i=[s[0],s[1],t.z-s[2]],o=e.ad.vec3.length(i);i[2]-=(a-l)/this._pixelsPerMercatorPixel;const r=e.ad.vec3.length(i);if(0===r)return;e.ad.vec3.scale(i,i,o/r*this._pixelsPerMercatorPixel),this._camera.position=[s[0],s[1],t.z*this._pixelsPerMercatorPixel-i[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 i=this.center;return i.lat=e.ay(i.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(i.lng=e.ay(i.lng,this.minLng,this.maxLng)),this.center=i,void(this._constraining=!1)}const i=this._unmodified,{x:o,y:s}=this.point;let r=0,n=o,a=s;const l=this.width/2,c=this.height/2,h=this.worldMinY*this.scale,d=this.worldMaxY*this.scale;if(s-c<h&&(a=h+c),s+c>d&&(a=d-c),d-h<this.height&&(r=Math.max(r,this.height/(d-h)),a=(d+h)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,i=this.worldSize/2-(e+t)/2;n=(o+i+this.worldSize)%this.worldSize-i,n-l<e&&(n=e+l),n+l>t&&(n=t-l),t-e<this.width&&(r=Math.max(r,this.width/(t-e)),n=(t+e)/2);}n===o&&a===s||this._allowWorldUnderZoom||(this.center=this.unproject(new e.P(n,a))),r&&!this._allowWorldUnderZoom&&(this.zoom+=this.scaleZoom(r)),this._constrainCamera(),this._unmodified=i,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,i="globe"===this.projection.name,o=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.bH(1,this.center.lat)/e.bH(1,e.c8));const s=e.b$(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,s),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 r="meters"===this.projection.zAxisUnit?o:1,n=this._camera.getWorldToCamera(this.worldSize,r);let a;const l=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);if(l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,this.isOrthographic){let i=.5*this.height/Math.tan(this._fov/2)*1*Math.tan(.5*this._fov),o=i*this.aspect,s=-o,r=-i;o-=t.x,s-=t.x,i+=t.y,r+=t.y,a=this._camera.getCameraToClipOrthographic(s,o,r,i,this._nearZ,this._farZ),((t,i,o,s)=>{for(let r=0;r<16;r++)t[r]=e.ah(i[r],o[r],s);})(a,a,l,e.c9(this.pitch>=Yi?1:this.pitch/Yi));}else a=l;const c=e.ad.mat4.mul([],l,n);let h=e.ad.mat4.mul([],a,n);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),i=e.ad.mat4.identity([]);e.ad.mat4.translate(i,i,[t.x*this.worldSize,t.y*this.worldSize,0]),e.ad.mat4.multiply(i,i,e.c0(this)),e.ad.mat4.translate(i,i,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.ad.mat4.multiply(h,h,i),e.ad.mat4.multiply(c,c,i),this.inverseAdjustmentMatrix=e.c1(this);}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=e.ad.mat4.scale([],h,[this.worldSize,this.worldSize,this.worldSize/r,1]),this.projMatrix=h,this.invProjMatrix=e.ad.mat4.invert(new Float64Array(16),this.projMatrix),i){const i=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.expandedFarZProjMatrix=e.ad.mat4.mul([],i,n);}else this.expandedFarZProjMatrix=this.projMatrix;const d=e.ad.mat4.invert([],a);this.frustumCorners=e.c2.fromInvProjectionMatrix(d,this.horizonLineFromTop(),this.height),this.cameraFrustum=e.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!i);const u=new Float32Array(16);e.ad.mat4.identity(u),e.ad.mat4.scale(u,u,[1,-1,1]),e.ad.mat4.rotateX(u,u,this._pitch),e.ad.mat4.rotateZ(u,u,this.angle);const _=e.ad.mat4.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=e.ad.mat4.clone(_);const p=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;_[8]=2*-t.x/this.width,_[9]=2*(t.y+p)/this.height,this.skyboxMatrix=e.ad.mat4.multiply(u,_,u);const f=this.point,m=f.x,g=f.y,v=this.width%2/2,y=this.height%2/2,x=Math.cos(this.angle),b=Math.sin(this.angle),w=m-Math.round(m)+x*v+b*y,T=g-Math.round(g)+x*y+b*v,E=new Float64Array(h);if(e.ad.mat4.translate(E,E,[w>.5?w-1:w,T>.5?T-1:T,0]),this.alignedProjMatrix=E,h=e.ad.mat4.create(),e.ad.mat4.scale(h,h,[this.width/2,-this.height/2,1]),e.ad.mat4.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=e.ad.mat4.create(),e.ad.mat4.scale(h,h,[1,-1,1]),e.ad.mat4.translate(h,h,[-1,-1,0]),e.ad.mat4.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=e.ad.mat4.multiply(new Float64Array(16),this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},h=e.ad.mat4.invert(new Float64Array(16),this.pixelMatrix),!h)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=h,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.c3(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.ad.vec3.transformMat4(t,t,n),this.globeRadius=this.worldSize/2/Math.PI-1;}else this.globeMatrix=h;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={};}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,i=this.cameraPixelsPerMeter,o=this._camera.position,s=1/this.height/this._pixelsPerMercatorPixel,r=[t,t,i];e.ad.vec3.scale(r,r,s),e.ad.vec3.scale(o,o,-1),e.ad.vec3.multiply(o,o,r);const n=e.ad.mat4.create();e.ad.mat4.translate(n,n,o),e.ad.mat4.scale(n,n,r),this.mercatorFogMatrix=n,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,i,s);}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),o=this.point,s=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return [o.x/this.worldSize-i[0]*s,o.y/this.worldSize-i[1]*s,e/this.worldSize*this._centerAltitude-i[2]*s]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition());}_translateCameraConstrained(t){const i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),o=this._camera.position[2],s=t[2];let r=1;this.projection.wrap&&(this.center=this.center.wrap()),s>0&&(r=Math.min((i-o)/s,1)),this._camera.position=e.ad.vec3.scaleAndAdd([],this._camera.position,t,r),this._updateStateFromCamera();}_updateStateFromCamera(){const t=this._camera.position,i=this._camera.forward(),{pitch:o,bearing:s}=this._camera.getPitchBearing(),r=e.bH(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,n=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.ak(this._maxPitch)),a=Math.max((t[2]-r)/Math.cos(o),n),l=this._zoomFromMercatorZ(a);e.ad.vec3.scaleAndAdd(t,t,i,a),this._pitch=e.ay(o,e.ak(this.minPitch),e.ak(this.maxPitch)),this.angle=e.bF(s,-Math.PI,Math.PI),this._setZoom(e.ay(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.ac(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,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}zoomFromMercatorZAdjusted(t){let i=0,o=e.bY,s=0,r=1/0;for(;o-i>1e-6&&o>i;){const e=i+.5*(o-i),n=this.tileSize*Math.pow(2,e),a=this.getCameraToCenterDistance(this.projection,e,n),l=this.scaleZoom(a/(t*this.tileSize)),c=Math.abs(e-l);c<r&&(r=c,s=e),e<l?i=e:o=e;}return s}_terrainEnabled(){return !(!this._elevation||!this.projection.supportsTerrain&&(e.w("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,i){const o=Math.min(t.x,i.x),s=Math.max(t.x,i.x),r=Math.min(t.y,i.y),n=Math.max(t.y,i.y);if(r<this.horizonLineFromTop(!1))return !0;if("mercator"!==this.projection.name)return !1;const a=[new e.P(o,r),new e.P(s,n),new e.P(o,n),new e.P(s,r)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const e of a){const t=this.pointRayIntersection(e);if(t.t<0)return !0;const i=this.rayIntersectionCoordinate(t);if(i.x<l||i.y<0||i.x>c||i.y>1)return !0}return !1}isHorizonVisible(){return this.pitch+e.c4(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.P(0,0),new e.P(this.width,this.height))}zoomDeltaToMovement(t,i){const o=e.ad.vec3.length(e.ad.vec3.sub([],this._camera.position,t)),s=this._zoomFromMercatorZ(o)+i;return o-this._mercatorZfromZoom(s)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,i,o],s){const r=[t,i,o,1];e.ad.vec4.transformMat4(r,r,s);const n=r[3]=Math.max(r[3],1e-6);return r[0]/=n,r[1]/=n,r[2]/=n,r}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}}getCameraToCenterDistance(t,i=this.zoom,o=this.worldSize){const s=e.b$(t,i,this.width,this.height,1024),r=t.pixelSpaceConversion(this.center.lat,o,s);let n=.5/Math.tan(.5*this._fov)*this.height*r;return this.isOrthographic&&(n=e.ah(1,n,e.c9(this.pitch>=Yi?1:this.pitch/Yi))),n}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return "globe"===this.projection.name&&e.ad.mat4.multiply(t,t,this.globeMatrix),t}getFrustum(t){return e.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,"meters"===this.projection.zAxisUnit)}}const Qi=(t,i)=>{if(i>0&&t.terrain&&e.w("Cutoff is currently disabled on terrain"),i<=0||t.terrain)return {shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const o=t.transform,s=Math.max(Math.abs(o._zoom-(t.minCutoffZoom-1)),1),r=o.isLODDisabled(!1)?e.ae(60,45,o.pitch):e.ae(30,15,o.pitch),n=o._farZ-o._nearZ,a=i*o.height,l=((1-(c=r))*o.cameraToCenterDistance+c*(o._farZ+a))*s;var c;return {shouldRenderCutoff:r<1,uniformValues:{u_cutoff_params:[o._nearZ,o._farZ,(l-o._nearZ)/n,(l-a-o._nearZ)/n]}}},eo={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class to{constructor(e,t){this.aabb=e,this.lastCascade=t;}}class io{add(e,t){const i=this.receivers[e.key];void 0!==i?(i.aabb.min[0]=Math.min(i.aabb.min[0],t.min[0]),i.aabb.min[1]=Math.min(i.aabb.min[1],t.min[1]),i.aabb.min[2]=Math.min(i.aabb.min[2],t.min[2]),i.aabb.max[0]=Math.max(i.aabb.max[0],t.max[0]),i.aabb.max[1]=Math.max(i.aabb.max[1],t.max[1]),i.aabb.max[2]=Math.max(i.aabb.max[2],t.max[2])):this.receivers[e.key]=new to(t,null);}clear(){this.receivers={};}get(e){return this.receivers[e.key]}computeRequiredCascades(t,i,o){const s=e.ce.fromPoints(t.points);let r=0;for(const t in this.receivers){const n=this.receivers[t];if(!n)continue;if(!s.intersectsAabb(n.aabb))continue;n.aabb.min=s.closestPoint(n.aabb.min),n.aabb.max=s.closestPoint(n.aabb.max);const a=n.aabb.getCorners();for(let t=0;t<o.length;t++){let s=!0;for(const r of a){const n=[r[0]*i,r[1]*i,r[2]];if(e.ad.vec3.transformMat4(n,n,o[t].matrix),n[0]<-1||n[0]>1||n[1]<-1||n[1]>1){s=!1;break}}if(n.lastCascade=t,r=Math.max(r,t),s)break}}return r+1}}class oo{constructor(e){this.painter=e,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new io,this._depthMode=new Bi(e.context.gl.LEQUAL,Bi.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,e.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},(()=>{this.painter.style.map.triggerRepaint();})),e.tp.registerParameter(eo,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),e.tp.registerParameter(eo,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),e.tp.registerParameter(eo,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),e.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"});}destroy(){for(const e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[];}updateShadowParameters(t,i){const o=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!i||!i.properties)return;const s=i.properties.get("shadow-intensity");if(!i.shadowsEnabled()||s<=0)return;if(this._shadowLayerCount=o.style.order.reduce(((e,i)=>{const s=o.style._mergedLayers[i];return e+(s.hasShadowPass()&&!s.isHidden(t.zoom)?1:0)}),0),this._enabled=this._shadowLayerCount>0,!this.enabled)return;const r=o.context,n=eo.shadowMapResolution,a=eo.shadowMapResolution;if(0===this._cascades.length||eo.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let t=0;t<eo.cascadeCount;++t){const t=o._shadowMapDebug,i=r.gl,s=r.createFramebuffer(n,a,t,"texture"),l=new e.T(r,{width:n,height:a,data:null},i.DEPTH_COMPONENT16);if(s.depthAttachment.set(l.texture),t){const t=new e.T(r,{width:n,height:a,data:null},i.RGBA8);s.colorAttachment.set(t.texture);}this._cascades.push({framebuffer:s,texture:l,matrix:[],far:0,boundingSphereRadius:0,frustum:new e.bR,scale:0});}}this.shadowDirection=ro(i);let l=0;if(t.elevation){const e=t.elevation,i=[1e4,-1e4];e.visibleDemTiles.filter((e=>e.dem)).forEach((e=>{const t=e.dem.tree;i[0]=Math.min(i[0],t.minimums[0]),i[1]=Math.max(i[1],t.maximums[0]);})),1e4!==i[0]&&(l=(i[1]-i[0])*e.exaggeration());}const c=1.5*t.cameraToCenterDistance,h=3*c,d=new Float64Array(16);for(let i=0;i<this._cascades.length;++i){const o=this._cascades[i];let s=t.height/50,r=1;1===eo.cascadeCount?r=h:0===i?r=c:(s=c,r=h);const[n,a]=ao(t,this.shadowDirection,s,r,eo.shadowMapResolution,l);o.scale=t.scale,o.matrix=n,o.boundingSphereRadius=a,e.ad.mat4.invert(d,o.matrix),o.frustum=e.bR.fromInvProjectionMatrix(d,1,0,!0),o.far=r;}const u=this._cascades.length-1;this._uniformValues.u_fade_range=[.75*this._cascades[u].far,this._cascades[u].far],this._uniformValues.u_shadow_intensity=s,this._uniformValues.u_shadow_direction=[this.shadowDirection[0],this.shadowDirection[1],this.shadowDirection[2]],this._uniformValues.u_shadow_texel_size=1/eo.shadowMapResolution,this._uniformValues.u_shadow_map_resolution=eo.shadowMapResolution,this._uniformValues.u_shadowmap_0=Xi.ShadowMap0,this._uniformValues.u_shadowmap_1=Xi.ShadowMap0+1,this._groundShadowTiles=o.transform.coveringTiles({tileSize:512,renderWorldCopies:!0});const _=o.transform.elevation;for(const e of this._groundShadowTiles){let t={min:0,max:0};if(_){const i=_.getMinMaxForTile(e);i&&(t=i);}this.addShadowReceiver(e.toUnwrapped(),t.min,t.max);}}get enabled(){return this._enabled&&!this._forceDisable}set enabled(e){this._enabled=e;}drawShadowPass(t,i){if(!this.enabled)return;const o=this.painter,s=o.context;this._numCascadesToRender=this._receivers.computeRequiredCascades(o.transform.getFrustum(0),o.transform.worldSize,this._cascades),s.viewport.set([0,0,eo.shadowMapResolution,eo.shadowMapResolution]);for(let r=0;r<this._numCascadesToRender;++r){o.currentShadowCascade=r,s.bindFramebuffer.set(this._cascades[r].framebuffer.framebuffer),s.clear({color:e.al.white,depth:1});for(const e of t.order){const s=t._mergedLayers[e];if(!s.hasShadowPass()||s.isHidden(o.transform.zoom))continue;const r=t.getLayerSourceCache(s),n=r?i[r.id]:void 0;("model"===s.type||n&&n.length)&&o.renderLayer(o,r,s,n);}}o.currentShadowCascade=0;}drawGroundShadows(){if(!this.enabled)return;const e=this.painter,t=e.style,i=e.context,o=t.directionalLight,s=t.ambientLight;if(!o||!s)return;const r=[],n=Qi(e,e.longestCutoffRange);n.shouldRenderCutoff&&r.push("RENDER_CUTOFF"),r.push("RENDER_SHADOWS","DEPTH_TEXTURE"),this.useNormalOffset&&r.push("NORMAL_OFFSET");const a=no(t,o,s),l=new Bi(i.gl.LEQUAL,Bi.ReadOnly,e.depthRangeFor3D);for(const t of this._groundShadowTiles){const o=t.toUnwrapped(),s=e.isTileAffectedByFog(t),c=e.getOrCreateProgram("groundShadow",{defines:r,overrideFog:s});this.setupShadows(o,c),e.uploadCommonUniforms(i,c,o,null,n);const h={u_matrix:e.transform.calculateProjMatrix(o),u_ground_shadow_factor:a};c.draw(e,i.gl.TRIANGLES,l,Ui.disabled,ki.multiply,ji.disabled,h,"ground_shadow",e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments,null,e.transform.zoom,null,null);}}getShadowPassColorMode(){return this.painter._shadowMapDebug?ki.unblended:ki.disabled}getShadowPassDepthMode(){return this._depthMode}getShadowCastingLayerCount(){return this._shadowLayerCount}calculateShadowPassMatrixFromTile(t){const i=this.painter.transform,o=i.calculatePosMatrix(t,i.worldSize);return e.ad.mat4.multiply(o,this._cascades[this.painter.currentShadowCascade].matrix,o),Float32Array.from(o)}calculateShadowPassMatrixFromMatrix(t){return e.ad.mat4.multiply(t,this._cascades[this.painter.currentShadowCascade].matrix,t),Float32Array.from(t)}setupShadows(t,i,o,s=0){if(!this.enabled)return;const r=this.painter.transform,n=this.painter.context,a=n.gl,l=this._uniformValues,c=new Float64Array(16),h=r.calculatePosMatrix(t,r.worldSize);for(let t=0;t<this._cascades.length;t++)e.ad.mat4.multiply(c,this._cascades[t].matrix,h),l[0===t?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(c),n.activeTexture.set(a.TEXTURE0+Xi.ShadowMap0+t),this._cascades[t].texture.bind(a.NEAREST,a.CLAMP_TO_EDGE);if(this.useNormalOffset=!!o,this.useNormalOffset){const i=e.cd(t.canonical),n=2/r.tileSize*e.ai/eo.shadowMapResolution,a=n*this._cascades[0].boundingSphereRadius,c=n*this._cascades[this._cascades.length-1].boundingSphereRadius,h=("vector-tile"===o?1:3)/Math.pow(2,s-t.canonical.z-(1-r.zoom+Math.floor(r.zoom)));l.u_shadow_normal_offset=[i,a*h,c*h],l.u_shadow_bias=[6e-5,.0012,.012];}else l.u_shadow_bias=[36e-5,.0012,.012];i.setShadowUniformValues(n,l);}setupShadowsFromMatrix(t,i,o=!1){if(!this.enabled)return;const s=this.painter.context,r=s.gl,n=this._uniformValues,a=new Float64Array(16);for(let i=0;i<eo.cascadeCount;i++)e.ad.mat4.multiply(a,this._cascades[i].matrix,t),n[0===i?"u_light_matrix_0":"u_light_matrix_1"]=Float32Array.from(a),s.activeTexture.set(r.TEXTURE0+Xi.ShadowMap0+i),this._cascades[i].texture.bind(r.NEAREST,r.CLAMP_TO_EDGE);if(this.useNormalOffset=o,o){const e=eo.normalOffset;n.u_shadow_normal_offset=[1,e,e],n.u_shadow_bias=[6e-5,.0012,.012];}else n.u_shadow_bias=[36e-5,.0012,.012];i.setShadowUniformValues(s,n);}getShadowUniformValues(){return this._uniformValues}getCurrentCascadeFrustum(){return this._cascades[this.painter.currentShadowCascade].frustum}computeSimplifiedTileShadowVolume(t,i,o,s){if(s[2]>=0)return {};const r=function(t,i,o){const s=o/(1<<t.canonical.z);return new e.ce([t.canonical.x*s+t.wrap*o,t.canonical.y*s+t.wrap*o,0],[(t.canonical.x+1)*s+t.wrap*o,(t.canonical.y+1)*s+t.wrap*o,i])}(t,i,o).getCorners(),n=i/-s[2];s[0]<0?(e.ad.vec3.add(r[0],r[0],[s[0]*n,0,0]),e.ad.vec3.add(r[3],r[3],[s[0]*n,0,0])):s[0]>0&&(e.ad.vec3.add(r[1],r[1],[s[0]*n,0,0]),e.ad.vec3.add(r[2],r[2],[s[0]*n,0,0])),s[1]<0?(e.ad.vec3.add(r[0],r[0],[0,s[1]*n,0]),e.ad.vec3.add(r[1],r[1],[0,s[1]*n,0])):s[1]>0&&(e.ad.vec3.add(r[2],r[2],[0,s[1]*n,0]),e.ad.vec3.add(r[3],r[3],[0,s[1]*n,0]));const a={};return a.vertices=r,a.planes=[so(r[1],r[0],r[4]),so(r[2],r[1],r[5]),so(r[3],r[2],r[6]),so(r[0],r[3],r[7])],a}addShadowReceiver(t,i,o){this._receivers.add(t,e.ce.fromTileIdAndHeight(t,i,o));}getMaxCascadeForTile(e){const t=this._receivers.get(e);return t&&t.lastCascade?t.lastCascade:0}}function so(t,i,o){const s=e.ad.vec3.sub([],o,i),r=e.ad.vec3.sub([],t,i),n=e.ad.vec3.cross([],s,r),a=e.ad.vec3.length(n);return 0===a?[0,0,1,0]:(e.ad.vec3.scale(n,n,1/a),[n[0],n[1],n[2],-e.ad.vec3.dot(n,i)])}function ro(t){const i=t.properties.get("direction"),o=e.cc(i.x,i.y,i.z);o[2]=e.ay(o[2],0,75);const s=e.cf([o[0],o[1],o[2]]);return e.ad.vec3.fromValues(s.x,s.y,s.z)}function no(t,i,o){const s="none"===i.properties.get("color-use-theme"),r=i.properties.get("color"),n=i.properties.get("intensity"),a=i.properties.get("direction"),l=[a.x,a.y,a.z],c="none"===o.properties.get("color-use-theme"),h=o.properties.get("color"),d=o.properties.get("intensity"),u=Math.max(e.ad.vec3.dot([0,0,1],l),0),_=[0,0,0];e.ad.vec3.scale(_,h.toRenderColor(c?null:t.getLut(i.scope)).toArray01Linear().slice(0,3),d);const p=[0,0,0];return e.ad.vec3.scale(p,r.toRenderColor(s?null:t.getLut(o.scope)).toArray01Linear().slice(0,3),u*n),e.cg([_[0]>0?_[0]/(_[0]+p[0]):0,_[1]>0?_[1]/(_[1]+p[1]):0,_[2]>0?_[2]/(_[2]+p[2]):0])}function ao(t,i,o,s,r,n){const a=t.zoom,l=t.scale,c=t.worldSize,h=1/c,d=t.aspect,u=Math.sqrt(1+d*d)*Math.tan(.5*t.fovX),_=u*u,p=s-o,f=s+o;let m,g;_>p/f?(m=s,g=s*u):(m=.5*f*(1+_),g=.5*Math.sqrt(p*p+2*(s*s+o*o)*_+f*f*_*_));const v=t.projection.pixelsPerMeter(t.center.lat,c),y=t._camera.getCameraToWorldMercator(),x=[0,0,-m*h];e.ad.vec3.transformMat4(x,x,y);let b=g*h;const w=t._edgeInsets;if(!(0===w.left&&0===w.top&&0===w.right&&0===w.bottom||w.left===w.right&&w.top===w.bottom)){const i=t._camera.getWorldToCamera(t.worldSize,"meters"===t.projection.zAxisUnit?v:1),r=t._camera.getCameraToClipPerspective(t._fov,t.width/t.height,o,s);r[8]=2*-t.centerOffset.x/t.width,r[9]=2*t.centerOffset.y/t.height;const n=new Float64Array(16);e.ad.mat4.mul(n,r,i);const h=new Float64Array(16);e.ad.mat4.invert(h,n);const d=e.bR.fromInvProjectionMatrix(h,c,a,!0);for(const i of d.points){const o=((T=i)[0]/=l,T[1]/=l,T[2]=e.bH(T[2],t._center.lat),T);b=Math.max(b,e.ad.vec3.len(e.ad.vec3.subtract([],x,o)));}}var T;b*=r/(r-1);const E=Math.acos(i[2]),S=Math.atan2(-i[0],-i[1]),C=new $i;C.position=x,C.setPitchBearing(E,S);const I=C.getWorldToCamera(c,v),R=b*c,D=Math.min(t._mercatorZfromZoom(17)*c*-2,-2*R),A=C.getCameraToClipOrthographic(-R,R,-R,R,D,(R+n*v)/i[2]),L=new Float64Array(16);e.ad.mat4.multiply(L,A,I);const P=e.ad.vec3.fromValues(Math.floor(1e6*x[0])/1e6*c,Math.floor(1e6*x[1])/1e6*c,0),M=.5*r,z=[0,0,0];e.ad.vec3.transformMat4(z,P,L),e.ad.vec3.scale(z,z,M);const O=[Math.floor(z[0]),Math.floor(z[1]),Math.floor(z[2])],F=[0,0,0];e.ad.vec3.sub(F,z,O),e.ad.vec3.scale(F,F,-1/M);const k=new Float64Array(16);return e.ad.mat4.identity(k),e.ad.mat4.translate(k,k,F),e.ad.mat4.multiply(L,k,L),[L,R]}class lo extends e.E{constructor(e){super(),this.requestManager=e,this.models={"":{}},this.modelUris={"":{}},this.numModelsLoading={};}loadModel(t,i){return e.aN(this.requestManager.transformRequest(i,e.R.Model).url).then((i=>{if(!i)return;const o=e.aO(i),s=new e.aP(t,void 0,void 0,o);return s.computeBoundsAndApplyParent(),s})).catch((o=>{if(o&&404===o.status)return null;this.fire(new e.z(new Error(`Could not load model ${t} from ${i}: ${o.message}`)));}))}load(t,i,o={keepNumReferences:!1}){this.models[i]||(this.models[i]={});const s=Object.keys(t);this.numModelsLoading[i]=(this.numModelsLoading[i]||0)+s.length;const r=[];for(const e of s)r.push(this.loadModel(e,t[e]));Promise.allSettled(r).then((t=>{for(let e=0;e<t.length;e++){const{status:r,value:n}=t[e];if("fulfilled"===r&&n){const t=this.models[i][s[e]];this.models[i][s[e]]={model:n,numReferences:o.keepNumReferences&&t?t.numReferences:1};}}this.numModelsLoading[i]-=s.length,this.fire(new e.A("data",{dataType:"style"}));})).catch((t=>{this.fire(new e.z(new Error(`Could not load models: ${t.message}`)));}));}isLoaded(){for(const e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return !1;return !0}hasModel(e,t){return !!this.getModel(e,t)}getModel(e,t){return this.models[t]||(this.models[t]={}),this.models[t][e]?this.models[t][e].model:void 0}addModel(e,t,i){this.models[i]||(this.models[i]={}),this.modelUris[i]||(this.modelUris[i]={}),this.hasModel(e,i)&&this.models[i][e].numReferences++,this.modelUris[i][e]=this.requestManager.normalizeModelURL(t),this.load({[e]:this.modelUris[i][e]},i);}addModels(e,t){this.models[t]||(this.models[t]={}),this.modelUris[t]||(this.modelUris[t]={});const i=this.modelUris[t];for(const o in e)this.models[t][o]={},i[o]=this.requestManager.normalizeModelURL(e[o]);this.load(i,t,{keepNumReferences:!0});}reloadModels(e){this.load(this.modelUris[e],e);}addModelsFromBucket(e,t){this.models[t]||(this.models[t]={}),this.modelUris[t]||(this.modelUris[t]={});const i={};for(const o of e)this.hasModel(o,t)?this.models[t][o].numReferences++:(this.modelUris[t][o]=this.requestManager.normalizeModelURL(o),i[o]=this.modelUris[t][o]);this.load(i,t);}removeModel(e,t){if(this.models[t]&&this.models[t][e]&&(this.models[t][e].numReferences--,0===this.models[t][e].numReferences)){const i=this.models[t][e].model;delete this.models[t][e],delete this.modelUris[t][e],i.destroy();}}listModels(e){return this.models[e]||(this.models[e]={}),Object.keys(this.models[e])}upload(e,t){this.models[t]||(this.models[t]={});for(const i in this.models[t])this.models[t][i].model&&this.models[t][i].model.upload(e.context);}}const co=new e.a7({data:new e.a8(e.a5.colorTheme.data)}),ho={"mbx-indoor-active-floorplans":{default:["literal",[]]},"mbx-indoor-underground":{default:["literal",!1]},"mbx-indoor-loaded-levels":{default:["literal",[]]},"mbx-indoor-level-height":{default:["literal",{}]},"mbx-indoor-level-base":{default:["literal",{}]},"mbx-indoor-level-selected":{default:["literal",{}]},"mbx-indoor-level-overlapped":{default:["literal",{}]}};function uo(e){return e=e||{},Object.assign(e,ho)}class _o extends e.E{constructor(t){super(),this.mergeFloors=!0,this._scope=void 0,this._queryFeatureSetId=void 0,this._buildingEntryFeatureSetId=void 0,this._selectedFloorplan=void 0,this._indoorData=void 0,this._selectedLevel=void 0,this._floorplanStates={},e.aQ(["_onLoad","_onMove","_checkFloorplanVisible"],this),this._map=t,this._checkFloorplanVisible(!0),this._map.on("load",this._onLoad),this._map.on("move",this._onMove);}destroy(){this._map.indoor.off("load",this._onLoad),this._map.indoor.off("move",this._onMove),this._map=void 0;}_onLoad(){this._map.style.forEachFragmentStyle((t=>{t.stylesheet.indoor&&(this._queryFeatureSetId?this.fire(new e.z(new Error("Multiple indoor map styles detected, simultaneous usage is not allowed currently."))):(this._queryFeatureSetId=t.stylesheet.indoor.floorplanFeaturesetId,this._buildingEntryFeatureSetId=t.stylesheet.indoor.buildingFeaturesetId,this._scope=t.scope));})),this._queryFeatureSetId&&this._buildingEntryFeatureSetId&&this._map.addInteraction("mbx-indoor-buildingclick",{type:"click",target:{featuresetId:this._buildingEntryFeatureSetId,importId:this._scope},handler:e=>(e.feature&&e.feature.properties.floorplan&&this.selectFloorplan(e.feature.properties.floorplan),!0)}),this._checkFloorplanVisible(!0);}_onMove(){this._checkFloorplanVisible(!1);}_checkFloorplanVisible(t){if(!this._queryFeatureSetId)return;if(!this._map.isStyleLoaded())return;if(this._map.transform.zoom<13)return;this._indoorData&&!function(e,t){const[i,o]=e,{center:s,radius:r}=t,[n,a]=s,l=Math.abs(i-n);return Math.sqrt((l>180?360-l:l)**2+(o-a)**2)<=r}([this._map.getCenter().lng,this._map.getCenter().lat],this._indoorData.circumCircle)&&(this._indoorData=void 0,this._selectedFloorplan=void 0,this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",["literal",[]]),this.fire(new e.A("floorplangone")));const i={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},o=new e.P(this._map.transform.width/2,this._map.transform.height/2),s=[new e.P(0,0),new e.P(this._map.transform.width,this._map.transform.height)],r=this._map.queryRenderedFeatures(t?s:o,i);r.length>0&&(this._selectedFloorplan&&r[0].properties.id===this._selectedFloorplan.properties.id||(this._selectedFloorplan=r[0],this._floorplanSelected(!1)));}_floorplanSelected(t){this._indoorData=JSON.parse(this._selectedFloorplan.properties["indoor-data"]),this._indoorData.id=this._selectedFloorplan.properties.id,this._indoorData.circumCircle=function(e){const[[t,i],[o,s]]=e,r=(o-t+360)%360,n=r>180?360-r:r;return {center:[(t+n/2+360)%360,(i+s)/2],radius:Math.sqrt(n**2+(s-i)**2)/2}}(this._indoorData.extent),this._floorplanStates[this._indoorData.id]||(this._floorplanStates[this._indoorData.id]={});const i=this._floorplanStates[this._indoorData.id].selectedBuilding,o=this._floorplanStates[this._indoorData.id].selectedLevel;let s;if(this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",this._indoorData.floorplanIDs),this._selectedLevel)for(const e of this._indoorData.levels)e.id===this._selectedLevel.id&&(s=e.id);if(this.fire(new e.A("floorplanselected",{buildings:this._indoorData.buildings,levels:this._indoorData.levels,selectedLevelId:s})),i){const e=this._indoorData.buildings.find((e=>e.id===i));this._buildingSelected(e,!1);}else this._indoorData.buildings.length>0&&this._buildingSelected(this._indoorData.buildings[0],!1);if(o){const e=this._indoorData.levels.find((e=>e.id===o));this._updateLevels(e,t);}else t&&this._indoorData["default-levels"].length>0&&this.selectLevel(this._indoorData["default-levels"][0]);}_buildingSelected(t,i){i&&t&&t.extent&&this._map.fitBounds(t.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),this._floorplanStates[this._indoorData.id].selectedBuilding=t?t.id:void 0;const o=this._indoorData.levels.filter((e=>t.levels.includes(e.id)));this.fire(new e.A("buildingselected",{buildingId:t.id,levels:o}));}_levelSelected(t){if("overview"===t)this._updateLevels(void 0,!0);else {const e=this._indoorData.levels.find((e=>e.id===t));this._updateLevels(e,!0);}this.fire(new e.A("levelselected",{levelId:"overview"===t?void 0:t}));}_updateLevels(e,t){if(!e)return this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",[]]),this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._floorplanStates[this._indoorData.id].selectedLevel=void 0,void(t&&this._indoorData.extent&&this._map.fitBounds(this._indoorData.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}));function i(e){const t=e.indexOf("/floor/");if(-1===t)return e;const i=t+7,o=e.indexOf("/",i);return -1===o?e.slice(i):e.slice(i,o)}this._selectedLevel=e,this._floorplanStates[this._indoorData.id].selectedLevel=e?e.id:void 0;const o=[],s={},r={},n={},a={};for(const t of this._indoorData.levels)if(o.push(t.id),s[t.id]=t.height,r[t.id]=t.base,e){if(this.mergeFloors){const o=i(e.id),s=i(t.id);n[t.id]=s===o?"true":"false";}else n[t.id]=t.id===e.id?"true":"false";a[t.id]=t.base<e.base?"true":"false";}else a[t.id]=!0;if(this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",o]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-height",["literal",s]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-base",["literal",r]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-selected",["literal",n]),this._map.setConfigProperty(this._scope,"mbx-indoor-level-overlapped",["literal",a]),e&&(this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!!e.isUnderground),t&&e.extent)){const t=this._map.cameraForBounds(e.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),i=this._map.getZoom(),o=t.zoom?Math.abs(i-t.zoom):0;this._map.fitBounds(e.extent,o>=1?{pitch:this._map.getPitch(),bearing:this._map.getBearing()}:{pitch:this._map.getPitch(),bearing:this._map.getBearing(),zoom:i});}}selectFloorplan(t){const i={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},o=[new e.P(0,0),new e.P(this._map.transform.width,this._map.transform.height)],s=this._map.queryRenderedFeatures(o,i);if(s.length>0)for(const e of s)if(JSON.parse(e.properties["indoor-data"]).floorplanIDs.includes(t)){this._selectedFloorplan=e,this._floorplanSelected(!0);break}}selectBuilding(e){const t=this._indoorData.buildings.find((t=>t.id===e));this._buildingSelected(t,!0);}selectLevel(e){this._levelSelected(e);}}function po(t){if(!t.metadata||!t.metadata.content_area)return;const i=e.q.devicePixelRatio,{left:o,top:s,width:r,height:n}=t.metadata.content_area,a=o*i,l=s*i;return [a,l,a+r*i,l+n*i]}function fo(t){if(t)return t.map((([t,i])=>[t*e.q.devicePixelRatio,i*e.q.devicePixelRatio]))}class mo{constructor(e,t,i){this.id=e,this.scope=t,this.sourceCache=i,this.pendingRequests=new Set,this.missingRequests=new Set;}addPendingRequest(e){this.missingRequests.has(e.name)||this.pendingRequests.has(e.name)||this.pendingRequests.add(e.name);}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const t=new Map;if(!this.sourceCache.loaded())return t;const i=this.sourceCache.getVisibleCoordinates();if(0===i.length)return t;const o=this.sourceCache.getSource();if(!(o instanceof ot))return t;const s=i.map((e=>this.sourceCache.getTile(e))),r=o.getImages(s,Array.from(this.pendingRequests));for(const[i,o]of r)t.set(e.I.from({name:i,iconsetId:this.id}),o),this.pendingRequests.delete(i);for(const e of this.pendingRequests)this.missingRequests.add(e);return this.pendingRequests.clear(),t}}const go=(e,t)=>Ae(e,t&&t.filter((e=>"source.canvas"!==e.identifier))),vo=e.aA(Pt,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),yo=e.aA(Pt,["setCenter","setZoom","setBearing","setPitch"]),xo=new Set(["background","sky","slot","custom"]),bo={version:8,layers:[],sources:{}},wo={duration:300,delay:0};class To extends e.E{constructor(t,i={}){super(),this.map=t,this.scope=i.scope||"",this.globalId=null,this.fragments=[],this.importDepth=i.importDepth||0,this.importsCache=i.importsCache||new Map,this.resolvedImports=i.resolvedImports||new Set,this.transition=e.l({},wo),this._buildingIndex=new Dt(this),this.crossTileSymbolIndex=new Oi,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=i.styleChanges||new G,this.dispatcher=i.dispatcher?i.dispatcher:new e.D(e.cj(),this),i.imageManager?this.imageManager=i.imageManager:(this.imageManager=new q(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=i.glyphManager?i.glyphManager:new e.ck(t._requestManager,i.localFontFamily?e.cl.all:i.localIdeographFontFamily?e.cl.ideographs:e.cl.none,i.localFontFamily||i.localIdeographFontFamily),i.modelManager?this.modelManager=i.modelManager:(this.modelManager=new lo(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this.options=i.configOptions?i.configOptions:new Map,this._configDependentLayers=i.configDependentLayers?i.configDependentLayers:new Set,this._config=i.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:i.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=i.initialConfig,this.dispatcher.broadcast("setReferrer",e.cm());const o=this;this._rtlTextPluginCallback=To.registerForPluginStateChange((t=>{o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,i)=>{if(e.cn(t),i&&i.every((e=>e)))for(const e in o._sourceCaches){const t=o._sourceCaches[e],i=t.getSource().type;"vector"!==i&&"geojson"!==i||t.reload();}}));})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getOwnSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const i=this._layers[e];i.source===t.id&&this._validateLayer(i);}}));}load(e){return e?("string"==typeof e?this.loadURL(e):this.loadJSON(e),this):this}_getGlobalId(t){if(!t)return null;if("string"==typeof t){if(e.f(t))return t;const i=e.co(t);if(!i.startsWith("http"))try{return new URL(i,location.href).toString()}catch(e){return i}return i}return `json://${e.cp(JSON.stringify(t))}`}_diffStyle(t,i,o){this.globalId=this._getGlobalId(t);const s=(e,t)=>{try{t(null,this.setState(e,o));}catch(e){t(e,!1);}};if("string"==typeof t){const o=this.map._requestManager.normalizeStyleURL(t),r=this.map._requestManager.transformRequest(o,e.R.Style);e.n(r,((t,o)=>{t?this.fire(new e.z(t)):o&&s(o,i);}));}else "object"==typeof t&&s(t,i);}loadURL(t,i={}){this.fire(new e.A("dataloading",{dataType:"style"}));const o="boolean"==typeof i.validate?i.validate:!e.f(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,i.accessToken),this.resolvedImports.add(t);const s=this.importsCache.get(t);if(s)return this._load(s,o);const r=this.map._requestManager.transformRequest(t,e.R.Style);this._request=e.n(r,((i,s)=>{if(this._request=null,i)this.fire(new e.z(i));else if(s)return this.importsCache.set(t,s),this._load(s,o)}));}loadJSON(t,i={}){this.fire(new e.A("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=e.q.frame((()=>{this._request=null,this._load(t,!1!==i.validate);}));}loadEmpty(){this.fire(new e.A("dataloading",{dataType:"style"})),this._load(bo,!1);}_loadImports(t,i,o){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const s=[];for(const e of t){const t=this._createFragmentStyle(e),r=new Promise((e=>{t.once("style.import.load",e),t.once("error",e);})).then((()=>this.mergeAll()));if(s.push(r),this.resolvedImports.has(e.url)){t.loadEmpty();continue}const n=e.data||this.importsCache.get(e.url);n?(t.loadJSON(n,{validate:i}),this._isInternalStyle(n)&&(t.globalId=null)):e.url?t.loadURL(e.url,{validate:i}):t.loadEmpty();const a={style:t,id:e.id,config:e.config};if(o){const e=this.fragments.findIndex((({id:e})=>e===o));this.fragments=this.fragments.slice(0,e).concat(a).concat(this.fragments.slice(e));}else this.fragments.push(a);}return Promise.allSettled(s)}getImportGlobalIds(e=this,t=new Set){for(const i of e.fragments)i.style.globalId&&t.add(i.style.globalId),this.getImportGlobalIds(i.style,t);return [...t.values()]}_createFragmentStyle(t){const i=this.scope?e.C(t.id,this.scope):t.id;let o;const s=this._initialConfig&&this._initialConfig[i];(t.config||s)&&(o=e.l({},t.config,s));const r=new To(this.map,{scope:i,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:o,configOptions:this.options,colorThemeOverride:t["color-theme"],configDependentLayers:this._configDependentLayers});return r.setEventedParent(this.map,{style:r}),r}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle();}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}_load(t,i){const o=t.indoor?uo(t.schema):t.schema;if(this._isInternalStyle(t)){const o=e.l({},bo,{imports:[{id:"basemap",data:t,url:""}]});return void this._load(o,i)}if(this.updateConfig(this._config,o),i&&go(this,me(t)))return;this._loaded=!0,this.stylesheet=e.cq(t);const s=()=>{for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});if(t.iconsets)for(const e in t.iconsets)this.addIconset(e,t.iconsets[e]);t.sprite?this._loadIconset(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.setGlyphsUrl(t.glyphs);const o=Lt(this.stylesheet.layers);if(this._order=o.map((e=>e.id)),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const e=this.stylesheet.lights[0];this.light=new Pe(e.properties,e.id);}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Pe(this.stylesheet.light)),this._layers={};for(const t of o){const i=e.cv(t,this.scope,this._styleColorTheme.lut,this.options);0!==i.configDependencies.size&&this._configDependentLayers.add(i.fqid),i.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=i;const o=this.getOwnLayerSourceCache(i),s=!!this.directionalLight&&this.directionalLight.shadowsEnabled();o&&i.canCastShadows()&&s&&(o.castsShadows=!0);}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);const s=this.stylesheet.terrain;s&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(s,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.A("data",{dataType:"style"}));const r=this.isRootStyle();t.imports?this._loadImports(t.imports,i).then((()=>{this._reloadImports(),this.fire(new e.A(r?"style.load":"style.import.load"));})):(this._reloadImports(),this.fire(new e.A(r?"style.load":"style.import.load")));};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const r=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(r){const t=this._evaluateColorThemeData(r);this._loadColorTheme(t).then((()=>{s();})).catch((t=>{e.w(`Couldn't load color theme from the stylesheet: ${t}`),s();}));}else this._styleColorTheme.lut=null,s();}isRootStyle(){return 0===this.importDepth}mergeAll(){let t,i,o,s,r,n,a,l,c,h;const d={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((e=>{if(e.stylesheet){if(null!=e.light&&(t=e.light),e.stylesheet.lights)for(const t of e.stylesheet.lights)"ambient"===t.type&&null!=e.ambientLight&&(i=e.ambientLight),"directional"===t.type&&null!=e.directionalLight&&(o=e.directionalLight);s=this._prioritizeTerrain(s,e.terrain,e.stylesheet.terrain),e.stylesheet.fog&&null!=e.fog&&(r=e.fog),e.stylesheet.snow&&null!=e.snow&&(n=e.snow),e.stylesheet.rain&&null!=e.rain&&(a=e.rain),null!=e.stylesheet.camera&&(h=e.stylesheet.camera),null!=e.stylesheet.projection&&(l=e.stylesheet.projection),null!=e.stylesheet.transition&&(c=e.stylesheet.transition),d[e.scope]=e._styleColorTheme;}})),this.light=t,this.ambientLight=i,this.directionalLight=o,this.fog=r,this.snow=n,this.rain=a,this._styleColorThemeForScope=d,null===s?delete this.terrain:this.terrain=s,this.camera=h||{"camera-projection":"perspective"},this.projection=l||{name:"mercator"},this.transition=e.l({},wo,c),this.mergeSources(),this.mergeLayers();}forEachFragmentStyle(e){const t=i=>{for(const e of i.fragments)t(e.style);e(i);};t(this);}_prioritizeTerrain(e,t,i){const o=e&&0===e.drapeRenderMode;return null===i?t&&0===t.drapeRenderMode?t:o?e:null:null!=t&&(!e||o||t&&1===t.drapeRenderMode)?t:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((t=>{e=this._prioritizeTerrain(e,t.terrain,t.stylesheet.terrain);})),null===e?delete this.terrain:this.terrain=e;}mergeProjection(){let e;this.forEachFragmentStyle((t=>{null!=t.stylesheet.projection&&(e=t.stylesheet.projection);})),this.projection=e||{name:"mercator"};}mergeSources(){const t={},i={},o={};this.forEachFragmentStyle((s=>{for(const i in s._sourceCaches){const o=e.C(i,s.scope);t[o]=s._sourceCaches[i];}for(const t in s._otherSourceCaches){const o=e.C(t,s.scope);i[o]=s._otherSourceCaches[t];}for(const t in s._symbolSourceCaches){const i=e.C(t,s.scope);o[i]=s._symbolSourceCaches[t];}})),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=i,this._mergedSymbolSourceCaches=o;}mergeLayers(){const t={},i=[],o={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle((o=>{for(const s of o._order){const r=o._layers[s];if("slot"===r.type){const i=e.cr(s);if(t[i])continue;t[i]=[];}r.slot&&t[r.slot]?t[r.slot].push(r):i.push(r);}})),this._mergedOrder=[];const s=(i=[])=>{for(const r of i)if("slot"===r.type){const i=e.cr(r.id);t[i]&&s(t[i]),this._mergedSlots.push(i);}else {const t=e.C(r.id,r.scope);this._mergedOrder.push(t),o[t]=r,r.is3D(!!this.terrain)&&(this._has3DLayers=!0),"circle"===r.type&&(this._hasCircleLayers=!0),"symbol"===r.type&&(this._hasSymbolLayers=!0),"clip"===r.type&&(this._clipLayerPresent=!0);}};s(i),this._mergedOrder.sort(((e,t)=>{const i=o[e],s=o[t];return i.hasInitialOcclusionOpacityProperties?s.is3D(!!this.terrain)?1:0:i.is3D(!!this.terrain)&&s.hasInitialOcclusionOpacityProperties?-1:0})),this._mergedLayers=o,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged();}terrainSetForDrapingOnly(){return !!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(t){return this.stylesheet.camera=e.l({},this.stylesheet.camera,t),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?function(t,i,o){const s=e.l({},i);for(const t of Object.keys(e.a5.colorTheme))void 0===s[t]&&(s[t]=e.a5.colorTheme[t].default);const r=new e.a6(co,t,new Map(o));return r.setTransitionOrValue(s,o),r.untransitioned().possiblyEvaluate(new e.aa(0))}(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const i=this._styleColorTheme.lutLoadingCorrelationID;return new Promise(((o,s)=>{const r="data:image/png;base64,";if(!t||0===t.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void o();let n=t;n.startsWith(r)||(n=r+n);const a=e.I.from("mapbox-reserved-lut"),l=new Image;l.src=n,l.onerror=()=>{this._styleColorTheme.lutLoading=!1,s(new Error("Failed to load image data"));},l.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==i)return void o();this._styleColorTheme.lutLoading=!1;const{width:r,height:n,data:c}=e.q.getImageData(l);if(n>32)return void s(new Error("The height of the image must be less than or equal to 32 pixels."));if(r!==n*n)return void s(new Error("The width of the image must be equal to the height squared."));this.getImage(a,this.scope)&&this.removeImage(a,this.scope),this.addImage(a,this.scope,{data:new e.r({width:r,height:n},c),pixelRatio:1,sdf:!1,usvg:!1,version:0});const h=this.imageManager.getImage(a,this.scope);h?(this._styleColorTheme.lut={image:h.data,data:t},o()):s(new Error("Missing LUT image."));};}))}getLut(e){const t=this._styleColorThemeForScope[e];return t?t.lut:null}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection();}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0));}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection));}_loadSprite(t){this._spriteRequest=function(t,i,o){let s,r,n;const a=e.q.devicePixelRatio>1?"@2x":"";let l=e.n(i.transformRequest(i.normalizeSpriteURL(t,a,".json"),e.R.SpriteJSON),((e,t)=>{l=null,n||(n=e,s=t,h());})),c=e.o(i.transformRequest(i.normalizeSpriteURL(t,a,".png"),e.R.SpriteImage),((e,t)=>{c=null,n||(n=e,r=t,h());}));function h(){if(n)o(n);else if(s&&r){const t=e.q.getImageData(r),i={};for(const o in s){const{width:r,height:n,x:a,y:l,sdf:c,pixelRatio:h,stretchX:d,stretchY:u,content:_}=s[o],p=new e.r({width:r,height:n});e.r.copy(t,p,{x:a,y:l},{x:0,y:0},{width:r,height:n},null),i[o]={data:p,pixelRatio:h,sdf:c,stretchX:d,stretchY:u,content:_,usvg:!1};}o(null,i);}}return {cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}(t,this.map._requestManager,((t,i)=>{if(this._spriteRequest=null,t)this.fire(new e.z(t));else if(i){const t=new Map;for(const o in i)t.set(e.I.from(o),i[o]);this.addImages(t,this.scope);}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.A("data",{dataType:"style"}));}));}addIconset(t,i){if("sprite"===i.type)return void this._loadSprite(i.url);const o=this.getOwnSourceCache(i.source);if(!o)return void this.fire(new e.z(new Error(`Source "${i.source}" as specified by iconset "${t}" does not exist and cannot be used as an iconset source`)));const s=o.getSource();if("raster-array"!==s.type)return void this.fire(new e.z(new Error(`Source "${i.source}" as specified by iconset "${t}" is not a "raster-array" source and cannot be used as an iconset source`)));s.partial=!1;const r=new mo(t,this.scope,o);this.imageManager.addImageProvider(r,this.scope);}removeIconset(e){this.imageManager.removeImageProvider(e,this.scope);}_loadIconset(t){if(!e.f(t)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(t);const i="auto"===this.map._spriteFormat;var o,s;this._spriteRequest=(s=(o,s)=>{if(this._spriteRequest=null,o)i?this._loadSprite(t):this.fire(new e.z(o));else if(s){const t=new Map;for(const i in s)t.set(e.I.from(i),s[i]);this.addImages(t,this.scope);}this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.A("data",{dataType:"style"}));},e.bj((o=this.map._requestManager).transformRequest(o.normalizeIconsetURL(t),e.R.Iconset),((t,i)=>{if(t)return void s(t);const o={},r=e.ch(new e.bi(i));for(const t of r.icons){const i={version:1,pixelRatio:e.q.devicePixelRatio,content:po(t),stretchX:t.metadata?fo(t.metadata.stretch_x_areas):void 0,stretchY:t.metadata?fo(t.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:t};o[t.name]=i;}s(null,o);})));}_validateLayer(t){const i=this.getOwnSource(t.source);if(!i)return;const o=t.sourceLayer;o&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(o))&&this.fire(new e.z(new Error(`Source layer "${o}" does not exist on source "${i.id}" as specified by style layer "${t.id}"`)));}loaded(){if(!this._loaded)return !1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return !1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return !1;if(!this.imageManager.isLoaded())return !1;if(this.imageManager.hasPatternsInFlight())return !1;if(!this.modelManager.isLoaded())return !1;if(this._styleColorTheme.lutLoading)return !1;for(const{style:e}of this.fragments)if(!e.loaded())return !1;return !0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map(((e,t)=>{const i=this.fragments[t];return i&&i.style&&(e.data=i.style.serialize()),e}))}_serializeSources(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize());}return e}_serializeLayers(e){const t=[];for(const i of e){const e=this._layers[i];e&&"custom"!==e.type&&t.push(e.serialize());}return t}hasLightTransitions(){return !(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return !!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return !!this.snow&&this.snow.hasTransition()}hasRainTransition(){return !!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return !0;if(this.hasFogTransition())return !0;if(this.hasSnowTransition())return !0;if(this.hasRainTransition())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.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(e){return e?this.order:this._mergedOrder}isLayerDraped(e){return !!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const i=this.getOwnLayer(t);if(i)return i;this.fire(new e.z(new Error(`The layer '${t}' does not exist in the map's style.`)));}_checkSource(t){const i=this.getOwnSource(t);if(i)return i;this.fire(new e.z(new Error(`The source '${t}' does not exist in the map's style.`)));}precompilePrograms(e,t){const i=this.map.painter;if(i)for(let o=e.minzoom||0;o<(e.maxzoom||25.5);o++){const o=e.getProgramIds();if(o)for(const s of o){const o=e.getDefaultProgramParams(s,t.zoom,this._styleColorTheme.lut);o&&(i.style=this,this.fog&&(i._fogVisible=!0,o.overrideFog=!0,i.getOrCreateProgram(s,o)),i._fogVisible=!1,o.overrideFog=!1,i.getOrCreateProgram(s,o),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(o.overrideRtt=!0,i.getOrCreateProgram(s,o)));}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const i=this.calculateLightsBrightness();t.brightness=i||0,i!==this._brightness&&(this._brightness=i,this.dispatcher.broadcast("setBrightness",i));const o=this._changes.isDirty();let s=!1;if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:i,removedIds:o}=e[t];(i||o)&&(this._updateWorkerLayers(t,i,o),s=!0);}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this.snow&&this.snow.updateTransitions(t),this.rain&&this.rain.updateTransitions(t),this._changes.reset();}const r={};for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];r[e]=t.used,t.used=!1,t.tileCoverLift=0;}for(const e of this._mergedOrder){const i=this._mergedLayers[e];if(i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)){const e=this.getLayerSourceCache(i);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,i.tileCoverLift()));}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback((()=>{this.precompilePrograms(i,t);})):this.precompilePrograms(i,t));}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&s&&this.mergeLayers();const n=this.imageManager.getPendingImageProviders();for(const e of n)e.sourceCache.used=!0;for(const t in r){const i=this._mergedSourceCaches[t];r[t]!==i.used&&i.getSource().fire(new e.A("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}));}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.snow&&this.snow.recalculate(t),this.rain&&this.rain.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),this.imageManager.clearUpdatedImages(this.scope),o&&this.fire(new e.A("data",{dataType:"style"}));}updateImageProviders(){const e=this.imageManager.getPendingImageProviders();for(const t of e){const e=t.resolvePendingRequests();this.addImages(e,t.scope);}}_updateTilesForChangedImages(){const e={};for(const t in this._mergedSourceCaches){const i=this._mergedSourceCaches[t].getSource().scope;e[i]=e[i]||this._changes.getUpdatedImages(i),0!==e[i].length&&this._mergedSourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e[i]);}for(const t in e)this._changes.resetUpdatedImages(t);}_updateWorkerLayers(e,t,i){const o=this.getFragmentStyle(e);o&&this.dispatcher.broadcast("updateLayers",{layers:t?o._serializeLayers(t):[],scope:e,removedIds:i||[],options:o.options});}setState(t,i){if(this._checkLoaded(),go(this,me(t)))return !1;(t=e.cq(t)).layers=Lt(t.layers);const o=function(t,i){if(!t)return [{command:Pt.setStyle,args:[i]}];let o=[];try{if(!e.bn(t.version,i.version))return [{command:Pt.setStyle,args:[i]}];if(e.bn(t.center,i.center)||o.push({command:Pt.setCenter,args:[i.center]}),e.bn(t.zoom,i.zoom)||o.push({command:Pt.setZoom,args:[i.zoom]}),e.bn(t.bearing,i.bearing)||o.push({command:Pt.setBearing,args:[i.bearing]}),e.bn(t.pitch,i.pitch)||o.push({command:Pt.setPitch,args:[i.pitch]}),e.bn(t.sprite,i.sprite)||o.push({command:Pt.setSprite,args:[i.sprite]}),e.bn(t.glyphs,i.glyphs)||o.push({command:Pt.setGlyphs,args:[i.glyphs]}),e.bn(t.imports,i.imports)||function(t=[],i=[],o){i=i||[];const s=(t=t||[]).map(Bt),r=i.map(Bt),n=t.reduce(Nt,{}),a=i.reduce(Nt,{}),l=s.slice();let c,h,d,u;for(c=0,h=0;c<s.length;c++)d=s[c],a.hasOwnProperty(d)?h++:(o.push({command:Pt.removeImport,args:[d]}),l.splice(l.indexOf(d,h),1));for(c=0,h=0;c<r.length;c++)d=r[r.length-1-c],l[l.length-1-c]!==d&&(n.hasOwnProperty(d)?(o.push({command:Pt.removeImport,args:[d]}),l.splice(l.lastIndexOf(d,l.length-h),1)):h++,u=l[l.length-c],o.push({command:Pt.addImport,args:[a[d],u]}),l.splice(l.length-c,0,d));for(const t of i){const i=n[t.id];i&&!e.bn(i,t)&&o.push({command:Pt.updateImport,args:[t.id,t]});}}(t.imports,i.imports,o),e.bn(t.transition,i.transition)||o.push({command:Pt.setTransition,args:[i.transition]}),e.bn(t.light,i.light)||o.push({command:Pt.setLight,args:[i.light]}),e.bn(t.fog,i.fog)||o.push({command:Pt.setFog,args:[i.fog]}),e.bn(t.snow,i.snow)||o.push({command:Pt.setSnow,args:[i.snow]}),e.bn(t.rain,i.rain)||o.push({command:Pt.setRain,args:[i.rain]}),e.bn(t.projection,i.projection)||o.push({command:Pt.setProjection,args:[i.projection]}),e.bn(t.lights,i.lights)||o.push({command:Pt.setLights,args:[i.lights]}),e.bn(t.camera,i.camera)||o.push({command:Pt.setCamera,args:[i.camera]}),e.bn(t.iconsets,i.iconsets)||function(t,i,o){let s;for(s in i=i||{},t=t||{})t.hasOwnProperty(s)&&(i.hasOwnProperty(s)||o.push({command:Pt.removeIconset,args:[s]}));for(s in i){if(!i.hasOwnProperty(s))continue;const r=i[s];t.hasOwnProperty(s)?e.bn(t[s],r)||(o.push({command:Pt.removeIconset,args:[s]}),o.push({command:Pt.addIconset,args:[s,r]})):o.push({command:Pt.addIconset,args:[s,r]});}}(t.iconsets,i.iconsets,o),!e.bn(t["color-theme"],i["color-theme"]))return [{command:Pt.setStyle,args:[i]}];const s={},r=[];!function(t,i,o,s){let r;for(r in i=i||{},t=t||{})t.hasOwnProperty(r)&&(i.hasOwnProperty(r)||zt(r,o,s));for(r in i){if(!i.hasOwnProperty(r))continue;const n=i[r];t.hasOwnProperty(r)?e.bn(t[r],n)||("geojson"===t[r].type&&"geojson"===n.type&&Ft(t,i,r)?o.push({command:Pt.setGeoJSONSourceData,args:[r,n.data]}):Ot(r,i,o,s)):Mt(r,i,o);}}(t.sources,i.sources,r,s);const n=[];t.layers&&t.layers.forEach((e=>{e.source&&s[e.source]?o.push({command:Pt.removeLayer,args:[e.id]}):n.push(e);}));let a=t.terrain;a&&s[a.source]&&(o.push({command:Pt.setTerrain,args:[void 0]}),a=void 0),o=o.concat(r),e.bn(a,i.terrain)||o.push({command:Pt.setTerrain,args:[i.terrain]}),function(t,i,o){i=i||[];const s=(t=t||[]).map(Bt),r=i.map(Bt),n=t.reduce(Nt,{}),a=i.reduce(Nt,{}),l=s.slice(),c=Object.create(null);let h,d,u,_,p,f,m;for(h=0,d=0;h<s.length;h++)u=s[h],a.hasOwnProperty(u)?d++:(o.push({command:Pt.removeLayer,args:[u]}),l.splice(l.indexOf(u,d),1));for(h=0,d=0;h<r.length;h++)u=r[r.length-1-h],l[l.length-1-h]!==u&&(n.hasOwnProperty(u)?(o.push({command:Pt.removeLayer,args:[u]}),l.splice(l.lastIndexOf(u,l.length-d),1)):d++,f=l[l.length-h],o.push({command:Pt.addLayer,args:[a[u],f]}),l.splice(l.length-h,0,u),c[u]=!0);for(h=0;h<r.length;h++)if(u=r[h],_=n[u],p=a[u],!c[u]&&!e.bn(_,p))if(e.bn(_.source,p.source)&&e.bn(_["source-layer"],p["source-layer"])&&e.bn(_.type,p.type)){for(m in kt(_.layout,p.layout,o,u,null,Pt.setLayoutProperty),kt(_.paint,p.paint,o,u,null,Pt.setPaintProperty),e.bn(_.slot,p.slot)||o.push({command:Pt.setSlot,args:[u,p.slot]}),e.bn(_.filter,p.filter)||o.push({command:Pt.setFilter,args:[u,p.filter]}),e.bn(_.minzoom,p.minzoom)&&e.bn(_.maxzoom,p.maxzoom)||o.push({command:Pt.setLayerZoomRange,args:[u,p.minzoom,p.maxzoom]}),_)_.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&"slot"!==m&&(0===m.indexOf("paint.")?kt(_[m],p[m],o,u,m.slice(6),Pt.setPaintProperty):e.bn(_[m],p[m])||o.push({command:Pt.setLayerProperty,args:[u,m,p[m]]}));for(m in p)p.hasOwnProperty(m)&&!_.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&"slot"!==m&&(0===m.indexOf("paint.")?kt(_[m],p[m],o,u,m.slice(6),Pt.setPaintProperty):e.bn(_[m],p[m])||o.push({command:Pt.setLayerProperty,args:[u,m,p[m]]}));}else o.push({command:Pt.removeLayer,args:[u]}),f=l[l.lastIndexOf(u)+1],o.push({command:Pt.addLayer,args:[p,f]});}(n,i.layers,o);}catch(e){console.warn("Unable to compute style diff:",e),o=[{command:Pt.setStyle,args:[i]}];}return o}(this.serialize(),t).filter((e=>!(e.command in yo)));if(0===o.length)return !1;const s=o.filter((e=>!(e.command in vo)));if(s.length>0)throw new Error(`Unimplemented: ${s.map((e=>e.command)).join(", ")}.`);const r=[];return o.forEach((e=>{r.push(this[e.command].apply(this,e.args));})),i&&Promise.all(r).then(i),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}_updateWorkerImages(e){const t=this.getFragmentStyle(e);t&&(t._availableImages=t.imageManager.listImages(e),t.dispatcher.broadcast("setImages",{scope:e,images:t._availableImages}));}addImages(t,i){for(const[o,s]of t.entries()){if(this.getImage(o,i))return this.fire(new e.z(new Error(`An image with the name "${o.name}" already exists.`)));this.imageManager.addImage(o,i,s),this._changes.updateImage(o,i);}return this._updateWorkerImages(i),this.fire(new e.A("data",{dataType:"style"})),this}addImage(t,i,o){return this.getImage(t,i)?this.fire(new e.z(new Error(`An image with the name "${t.name}" already exists.`))):(this.imageManager.addImage(t,i,o),this._changes.updateImage(t,i),this._updateWorkerImages(i),this.fire(new e.A("data",{dataType:"style"})),this)}updateImage(t,i,o,s=!1){this.imageManager.updateImage(t,i,o),s&&(this._changes.updateImage(t,i),this._updateWorkerImages(i),this.fire(new e.A("data",{dataType:"style"})));}getImage(e,t){return this.imageManager.getImage(e,t)}removeImage(t,i){return this.getImage(t,i)?(this.imageManager.removeImage(t,i),this._changes.updateImage(t,i),this._updateWorkerImages(i),this.fire(new e.A("data",{dataType:"style"})),this):this.fire(new e.z(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(e,t,i={}){return this._checkLoaded(),this._validate(Re,`models.${e}`,t,null,i)||(this.modelManager.addModel(e,t,this.scope),this._changes.setDirty()),this}hasModel(e){return this.modelManager.hasModel(e,this.scope)}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.scope),this):this.fire(new e.z(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(t,i,o={}){if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(ge,`sources.${t}`,i,null,o))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const s=rt(t,i,this.dispatcher,this);s.scope=this.scope,s.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(s.id),source:s.serialize(),sourceId:s.id})));const r=t=>{const i=(t?"symbol:":"other:")+s.id,o=e.C(i,this.scope),r=this._sourceCaches[i]=new St(o,s,t);(t?this._symbolSourceCaches:this._otherSourceCaches)[s.id]=r,r.onAdd(this.map);};r(!1),"vector"!==i.type&&"geojson"!==i.type||r(!0),s.onAdd&&s.onAdd(this.map),o.isInitialLoad||(this.mergeSources(),this._changes.setDirty());}removeSource(t){this._checkLoaded();const i=this.getOwnSource(t);if(!i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.z(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new e.z(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const i=Object.entries(this.stylesheet.iconsets).find((([e,i])=>"source"===i.type&&i.source===t));if(i)return this.fire(new e.z(new Error(`Source "${t}" cannot be removed while iconset "${i[0]}" is using it.`)))}const o=this.getOwnSourceCaches(t);for(const t of o){const i=e.cr(t.id);delete this._sourceCaches[i],this._changes.discardSourceCacheUpdate(t.id),t.fire(new e.A("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles();}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getOwnSource(e).setData(t),this._changes.setDirty();}getOwnSource(e){const t=this.getOwnSourceCache(e);return t&&t.getSource()}getOwnSources(){const e=[];for(const t in this._otherSourceCaches){const i=this.getOwnSourceCache(t);i&&e.push(i.getSource());}return e}areTilesLoaded(){const e=this._mergedSourceCaches;for(const t in e){const i=e[t]._tiles;for(const e in i){const t=i[e];if("loaded"!==t.state&&"errored"!==t.state)return !1}}return !0}setLights(t){if(this._checkLoaded(),!t)return delete this.ambientLight,void delete this.directionalLight;const i=this._getTransitionParameters();for(const o of t){if(this._validate(ye,"lights",o))return;switch(o.type){case"ambient":if(this.ambientLight){const e=this.ambientLight;e.set(o),e.updateTransitions(i);}else this.ambientLight=new $e(o,qe||(qe=new e.a7({color:new e.a8(e.a5.properties_light_ambient.color),"color-use-theme":new e.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.a8(e.a5.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const e=this.directionalLight;e.set(o),e.updateTransitions(i);}else this.directionalLight=new $e(o,He||(He=new e.a7({direction:new e.am(e.a5.properties_light_directional.direction),color:new e.a8(e.a5.properties_light_directional.color),"color-use-theme":new e.a8({type:"string",default:"default","property-type":"data-constant"}),intensity:new e.a8(e.a5.properties_light_directional.intensity),"cast-shadows":new e.a8(e.a5.properties_light_directional["cast-shadows"]),"shadow-quality":new e.a8(e.a5.properties_light_directional["shadow-quality"]),"shadow-intensity":new e.a8(e.a5.properties_light_directional["shadow-intensity"])})),this.scope,this.options);}}const o=new e.aa(this.z||0,i);this.ambientLight&&this.ambientLight.recalculate(o),this.directionalLight&&this.directionalLight.recalculate(o),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness);}calculateLightsBrightness(){const t=this.directionalLight,i=this.ambientLight;if(!t||!i)return;const o=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),s=t.properties.get("color").toRenderColor(null).toArray01(),r=t.properties.get("intensity"),n=t.properties.get("direction"),a=1-e.cc(n.x,n.y,n.z)[2]/90,l=o(s)*r*a,c=i.properties.get("color").toRenderColor(null).toArray01(),h=i.properties.get("intensity"),d=o(c)*h;return Number(((l+d)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return !!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(!t)return this;if(e.cs(t)){const i=e.ct(t),o=this.fragments.find((({id:e})=>e===i));if(!o)throw new Error(`Style import '${t}' not found`);const s=e.cr(t);return o.style.getFragmentStyle(s)}{const e=this.fragments.find((({id:e})=>e===t));return e?e.style:void 0}}setFeaturesetSelectors(t){if(!t)return;const i={},o=(e,t="")=>`${e}::${t}`;this._featuresetSelectors={};for(const s in t){const r=this._featuresetSelectors[s]=[];for(const n of t[s].selectors){if(n.featureNamespace){const t=this.getOwnLayer(n.layer);if(!t){e.w(`Layer is undefined for selector: ${n.layer}`);continue}const r=o(t.source,t.sourceLayer);if(r in i&&i[r]!==n.featureNamespace){e.w(`"featureNamespace ${n.featureNamespace} of featureset ${s}'s selector is not associated to the same source, skip this selector`);continue}i[r]=n.featureNamespace;}let t;if(n.properties)for(const i in n.properties){const o=e.X(n.properties[i]);"success"===o.result&&(t=t||{},t[i]=o.value);}r.push({layerId:n.layer,namespace:n.featureNamespace,properties:t,uniqueFeatureID:n._uniqueFeatureID});}}}getFeaturesetDescriptors(e){const t=this.getFragmentStyle(e);if(!t||!t.stylesheet.featuresets)return [];const i=[];for(const e in t.stylesheet.featuresets)i.push({featuresetId:e,importId:t.scope?t.scope:void 0});return i}getFeaturesetLayers(t,i){const o=this.getFragmentStyle(i),s=o.stylesheet.featuresets;if(!s||!s[t])return this.fire(new e.z(new Error(`The featureset '${t}' does not exist in the map's style and cannot be queried.`))),[];const r=[];for(const e of s[t].selectors){const t=o.getOwnLayer(e.layer);t&&r.push(t);}return r}getConfigProperty(t,i){const o=this.getFragmentStyle(t);if(!o)return null;const s=e.C(i,o.scope),r=o.options.get(s),n=r?r.value||r.default:null;return n?n.serialize():null}setConfigProperty(t,i,o){const s=this.getFragmentStyle(t);if(!s)return;const r=s.stylesheet.indoor?uo(s.stylesheet.schema):s.stylesheet.schema;if(!r||!r[i])return;const n=e.X(o);if("success"!==n.result)return void go(this,n.value);const a=n.value.expression,l=e.C(i,s.scope),c=s.options.get(l);if(!c)return;let h;const{minValue:d,maxValue:u,stepValue:_,type:p,values:f}=r[i],m=e.X(r[i].default);"success"===m.result&&(h=m.value.expression),h?(this.options.set(l,Object.assign({},c,{value:a,default:h,minValue:d,maxValue:u,stepValue:_,type:p,values:f})),this.updateConfigDependencies(i)):this.fire(new e.z(new Error(`No schema defined for the config option "${i}" in the "${t}" fragment.`)));}getConfig(t){const i=this.getFragmentStyle(t);if(!i)return null;const o=i.stylesheet.schema;if(!o)return null;const s={};for(const t in o){const o=e.C(t,i.scope),r=i.options.get(o),n=r?r.value||r.default:null;s[t]=n?n.serialize():null;}return s}setConfig(e,t){const i=this.getFragmentStyle(e);i&&(i.updateConfig(t,i.stylesheet.schema),this.updateConfigDependencies());}getSchema(e){const t=this.getFragmentStyle(e);return t?t.stylesheet.schema:null}setSchema(e,t){const i=this.getFragmentStyle(e);i&&(i.stylesheet.schema=t,i.updateConfig(i._config,t),this.updateConfigDependencies());}updateConfig(t,i){if(this._config=t,t||i)if(i)for(const o in i){let s,r;const n=e.X(i[o].default);if("success"===n.result&&(s=n.value.expression),t&&void 0!==t[o]){const i=e.X(t[o]);"success"===i.result&&(r=i.value.expression);}const{minValue:a,maxValue:l,stepValue:c,type:h,values:d}=i[o];if(s){const t=e.C(o,this.scope);this.options.set(t,{default:s,value:r,minValue:a,maxValue:l,stepValue:c,type:h,values:d});}else this.fire(new e.z(new Error(`No schema defined for config option "${o}".`)));}else this.fire(new e.z(new Error("Attempting to set config for a style without schema.")));}updateConfigDependencies(e){for(const t of this._configDependentLayers){const i=this.getLayer(t);if(i){if(e&&!i.configDependencies.has(e))continue;i.possiblyEvaluateVisibility(),this._updateLayer(i);}}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle((e=>{const t=e._styleColorTheme.colorThemeOverride?e._styleColorTheme.colorThemeOverride:e._styleColorTheme.colorTheme;if(t){const i=e._evaluateColorThemeData(t);(!e._styleColorTheme.lut&&""!==i||e._styleColorTheme.lut&&i!==e._styleColorTheme.lut.data)&&e.setColorTheme(t);}})),this._changes.setDirty();}addLayer(t,i,o={}){this._checkLoaded();const s=t.id;if(this._layers[s])return void this.fire(new e.z(new Error(`Layer with id "${s}" already exists on this map`)));let r;if("custom"===t.type){if(go(this,e.cu(t)))return;r=e.cv(t,this.scope,this._styleColorTheme.lut,this.options);}else {if("object"==typeof t.source&&(this.addSource(s,t.source),t=e.cq(t),t=e.l(t,{source:s})),this._validate(Ee,`layers.${s}`,t,{arrayIndex:-1},o))return;r=e.cv(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(r),r.setEventedParent(this,{layer:{id:s}});}0!==r.configDependencies.size&&this._configDependentLayers.add(r.fqid);let n=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.z(new Error(`Layer with id "${i}" does not exist on this map.`)));r.slot===this._layers[i].slot?n=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`);}this._order.splice(n,0,s),this._layerOrderChanged=!0,this._layers[s]=r;const a=this.getOwnLayerSourceCache(r),l=!!this.directionalLight&&this.directionalLight.shadowsEnabled();a&&r.canCastShadows()&&l&&(a.castsShadows=!0);const c=this._changes.getRemovedLayer(r);if(c&&r.source&&a&&"custom"!==r.type){this._changes.discardLayerRemoval(r);const t=e.C(r.source,r.scope);c.type!==r.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),a.pause());}this._updateLayer(r),r.onAdd&&r.onAdd(this.map),r.scope=this.scope,this.mergeLayers();}moveLayer(t,i){this._checkLoaded();const o=this._checkLayer(t);if(!o)return;if(t===i)return;const s=this._order.indexOf(t);this._order.splice(s,1);let r=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.z(new Error(`Layer with id "${i}" does not exist on this map.`)));o.slot===this._layers[i].slot?r=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`);}this._order.splice(r,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers();}removeLayer(e){this._checkLoaded();const t=this._checkLayer(e);if(!t)return;t.setEventedParent(null);const i=this._order.indexOf(e);this._order.splice(i,1),delete this._layers[e],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(t.fqid),this._changes.removeLayer(t);const o=this.getOwnLayerSourceCache(t);if(o&&o.castsShadows){let e=!1;for(const i in this._layers)if(this._layers[i].source===t.source&&this._layers[i].canCastShadows()){e=!0;break}o.castsShadows=e;}t.onRemove&&t.onRemove(this.map),this.mergeLayers();}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return !0;return !1}setLayerZoomRange(e,t,i){this._checkLoaded();const o=this._checkLayer(e);o&&(o.minzoom===t&&o.maxzoom===i||(null!=t&&(o.minzoom=t),null!=i&&(o.maxzoom=i),this._updateLayer(o)));}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(e,t){this._checkLoaded();const i=this._checkLayer(e);i&&i.slot!==t&&(i.slot=t,this._updateLayer(i));}setFilter(t,i,o={}){this._checkLoaded();const s=this._checkLayer(t);if(s&&!e.bn(s.filter,i))return null==i?(s.filter=void 0,void this._updateLayer(s)):void(this._validate(Se,`layers.${s.id}.filter`,i,{layerType:s.type},o)||(s.filter=e.cq(i),this._updateLayer(s)))}getFilter(t){const i=this._checkLayer(t);if(i)return e.cq(i.filter)}setLayoutProperty(t,i,o,s={}){this._checkLoaded();const r=this._checkLayer(t);if(r&&!e.bn(r.getLayoutProperty(i),o)){if(null!=o&&(!s||!1!==s.validate)&&go(r,Ie.call(me,{key:`layers.${t}.layout.${i}`,layerType:r.type,objectKey:i,value:o,styleSpec:e.a5,style:{glyphs:!0,sprite:!0}})))return;r.setLayoutProperty(i,o),0!==r.configDependencies.size&&this._configDependentLayers.add(r.fqid),this._updateLayer(r);}}getLayoutProperty(e,t){const i=this._checkLayer(e);if(i)return i.getLayoutProperty(t)}setPaintProperty(t,i,o,s={}){this._checkLoaded();const r=this._checkLayer(t);if(!r)return;if(e.bn(r.getPaintProperty(i),o))return;if(null!=o&&(!s||!1!==s.validate)&&go(r,Ce.call(me,{key:`layers.${t}.paint.${i}`,layerType:r.type,objectKey:i,value:o,styleSpec:e.a5})))return;const n=r.setPaintProperty(i,o);0!==r.configDependencies.size&&this._configDependentLayers.add(r.fqid),n&&this._updateLayer(r),this._changes.updatePaintProperties(r);}getPaintProperty(e,t){const i=this._checkLayer(e);if(i)return i.getPaintProperty(t)}setFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:o}=t.target,s=this.getFragmentStyle(o),r=s.getFeaturesetLayers(e);for(const{source:e,sourceLayer:o}of r)s.setFeatureState({id:t.id,source:e,sourceLayer:o},i);}else if("layerId"in t.target){const{layerId:e}=t.target,o=this.getLayer(e);this.setFeatureState({id:t.id,source:o.source,sourceLayer:o.sourceLayer},i);}return}const o=t.source,s=t.sourceLayer,r=this._checkSource(o);if(!r)return;const n=r.type;if("geojson"===n&&s)return void this.fire(new e.z(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===n&&!s)return void this.fire(new e.z(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.z(new Error("The feature id parameter must be provided.")));const a=this.getOwnSourceCaches(o);for(const e of a)e.setFeatureState(s,t.id,i);}removeFeatureState(t,i){if(this._checkLoaded(),"target"in t){if("featuresetId"in t.target){const{featuresetId:e,importId:o}=t.target,s=this.getFragmentStyle(o),r=s.getFeaturesetLayers(e);for(const{source:e,sourceLayer:o}of r)s.removeFeatureState({id:t.id,source:e,sourceLayer:o},i);}else if("layerId"in t.target){const{layerId:e}=t.target,o=this.getLayer(e);this.removeFeatureState({id:t.id,source:o.source,sourceLayer:o.sourceLayer},i);}return}const o=t.source,s=this._checkSource(o);if(!s)return;const r=s.type,n="vector"===r?t.sourceLayer:void 0;if("vector"===r&&!n)return void this.fire(new e.z(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.z(new Error("A feature id is required to remove its specific state property.")));const a=this.getOwnSourceCaches(o);for(const e of a)e.removeFeatureState(n,t.id,i);}getFeatureState(t){if(this._checkLoaded(),"target"in t){let i;if("featuresetId"in t.target){const{featuresetId:o,importId:s}=t.target,r=this.getFragmentStyle(s),n=r.getFeaturesetLayers(o);for(const{source:o,sourceLayer:s}of n){const n=r.getFeatureState({id:t.id,source:o,sourceLayer:s});if(n&&!i)i=n;else if(!e.bn(i,n))return void this.fire(new e.z(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in t.target){const{layerId:e}=t.target,o=this.getLayer(e);i=this.getFeatureState({id:t.id,source:o.source,sourceLayer:o.sourceLayer});}return i}const i=t.source,o=t.sourceLayer,s=this._checkSource(i);if(s){if("vector"!==s.type||o)return void 0===t.id&&this.fire(new e.z(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(i)[0].getFeatureState(o,t.id);this.fire(new e.z(new Error("The sourceLayer parameter must be provided for vector source types.")));}}setTransition(t){return this.stylesheet.transition=e.l({},this.stylesheet.transition,t),this.transition=this.stylesheet.transition,this}getTransition(){return e.l({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),i=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return e.cw({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:i,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],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:this._serializeSources(),layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateFilteredLayers(e){for(const t of Object.values(this._mergedLayers))e(t)&&this._updateLayer(t);}_updateLayer(t){this._changes.updateLayer(t);const i=this.getLayerSourceCache(t),o=e.C(t.source,t.scope),s=this._changes.getUpdatedSourceCaches();t.source&&!s[o]&&i&&"raster"!==i.getSource().type&&(this._changes.updateSourceCache(o,"reload"),i.pause()),t.invalidateCompiledFilter();}_flattenAndSortRenderedFeatures(e){const t=e=>this._mergedLayers[e].is3D(!!this.terrain),i=this.order,o={},s=[];for(let r=i.length-1;r>=0;r--){const n=i[r];if(t(n)){o[n]=r;for(const t of e){const e=t[n];if(e)for(const t of e)s.push(t);}}}s.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const r=[];for(let n=i.length-1;n>=0;n--){const a=i[n];if(t(a))for(let e=s.length-1;e>=0;e--){const t=s[e].feature;if(t.layer&&o[t.layer.id]<n)break;r.push(t),s.pop();}else for(const t of e){const e=t[a];if(e)for(const t of e)r.push(t.feature);}}return r}queryRenderedFeatures(t,i,o){let s;i&&!Array.isArray(i)&&i.filter&&(this._validate(Se,"queryRenderedFeatures.filter",i.filter,null,i),s=e.a_(i.filter));const r={},n=e=>{if(xo.has(e.type))return;const t=this.getOwnLayerSourceCache(e),i=r[t.id]=r[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};e.is3D(!!this.terrain)&&(i.has3DLayers=!0),i.layers[e.fqid]=i.layers[e.fqid]||{styleLayer:e,targets:[]},i.layers[e.fqid].targets.push({filter:s});};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new e.z(new Error("parameters.layers must be an Array."))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.z(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];n(i);}}else for(const e in this._layers)n(this._layers[e]);const a=this._queryRenderedFeatures(t,r,o),l=this._flattenAndSortRenderedFeatures(a),c=[];for(const t of l)e.ct(t.layer.id)===this.scope&&c.push(t);return c}queryRenderedFeatureset(t,i,o){let s;i&&!Array.isArray(i)&&i.filter&&(this._validate(Se,"queryRenderedFeatures.filter",i.filter,null,i),s=e.a_(i.filter));const r="mock",n=[];if(i&&i.target)n.push(Object.assign({},i,{targetId:r,filter:s}));else {const e=this.getFeaturesetDescriptors();for(const t of e)n.push({targetId:r,filter:s,target:t});for(const{style:e}of this.fragments){const t=e.getFeaturesetDescriptors();for(const e of t)n.push({targetId:r,filter:s,target:e});}}const a=this.queryRenderedTargets(t,n,o),l=[],c=new Set;for(const t of a)for(const i of t.variants[r])at(i,t,c)||l.push(new e.cx(t,i));return l}queryRenderedTargets(t,i,o){const s={},r=(e,t,i,o)=>{const r=s[t.id]=s[t.id]||{sourceCache:t,layers:{},has3DLayers:!1};if(r.layers[e.fqid]=r.layers[e.fqid]||{styleLayer:e,targets:[]},e.is3D(!!this.terrain)&&(r.has3DLayers=!0),!o)return i.uniqueFeatureID=!1,void r.layers[e.fqid].targets.push(i);r.layers[e.fqid].targets.push(Object.assign({},i,{namespace:o.namespace,properties:o.properties,uniqueFeatureID:o.uniqueFeatureID}));};for(const t of i)if("featuresetId"in t.target){const{featuresetId:i,importId:o}=t.target,s=this.getFragmentStyle(o);if(!s||!s._featuresetSelectors)continue;const n=s._featuresetSelectors[i];if(!n){this.fire(new e.z(new Error(`The featureset '${i}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const e of n){const i=s.getOwnLayer(e.layerId);i&&!xo.has(i.type)&&r(i,s.getOwnLayerSourceCache(i),t,e);}}else if("layerId"in t.target){const{layerId:e}=t.target,i=this.getLayer(e);if(!i||xo.has(i.type))continue;r(i,this.getLayerSourceCache(i),t);}const n=this._queryRenderedFeatures(t,s,o);return this._flattenAndSortRenderedFeatures(n)}_queryRenderedFeatures(e,t,i){const o=[],s=!!this.map._showQueryGeometry,r=Xe.createFromScreenPoints(e,i);for(const e in t){const n=lt(r,t[e],this._availableImages,i,s);Object.keys(n).length&&o.push(n);}if(this.placement)for(const e in t){if(!t[e].sourceCache._onlySymbols)continue;const i=ct(r.screenGeometry,t[e],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData);Object.keys(i).length&&o.push(i);}return o}querySourceFeatures(e,t){const i=t&&t.filter;i&&this._validate(Se,"querySourceFeatures.filter",i,null,t);let o=[];const s=this.getOwnSourceCaches(e);for(const e of s)o=o.concat(ht(e,t));return o}addSourceType(e,t,i){return To.getSourceType(e)?i(new Error(`A source type called "${e}" already exists.`)):(To.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},i):i(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,i,o={}){this._checkLoaded();const s=this.light.getLight();let r=!1;for(const i in t)if(!e.bn(t[i],s[i])){r=!0;break}if(!r)return;const n=this._getTransitionParameters();this.light.setLight(t,i,o),this.light.updateTransitions(n);}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0);}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.q.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."));}setTerrain(t,i=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===i&&delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let o=t;const s=null==t.source;if(1===i){if(this.disableElevatedTerrain)return;if("object"==typeof o.source){const t="terrain-dem-src";this.addSource(t,o.source),o=e.cq(o),o=e.l(o,{source:t});}const t=e.l({},o),i={};if(this.terrain&&s){t.source=this.terrain.get().source;const e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(i.style=e.serialize());}if(this._validate(xe,"terrain",t,i))return}if(!this.terrain||this.terrain.scope!==this.scope&&!s||this.terrain&&i!==this.terrain.drapeRenderMode){if(!o)return;this._createTerrain(o,i),this.fire(new e.A("data",{dataType:"style"}));}else {const i=this.terrain,s=i.get();for(const t of Object.keys(e.a5.terrain))!o.hasOwnProperty(t)&&e.a5.terrain[t].default&&(o[t]=e.a5.terrain[t].default);for(const o in t)if(!e.bn(t[o],s[o])){i.set(t,this.options),this.stylesheet.terrain=t;const o=this._getTransitionParameters({duration:0});i.updateTransitions(o),this.fire(new e.A("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0;}_createFog(e){const t=this.fog=new Ve(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i);}_createSnow(e){const t=this.snow=new Ze(e,this.map.transform,this.scope,this.options);this.stylesheet.snow=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i);}_createRain(e){const t=this.rain=new We(e,this.map.transform,this.scope,this.options);this.stylesheet.rain=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i);}_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(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const i=this.fog;if(!e.bn(i.get(),t)){i.set(t,this.options),this.stylesheet.fog=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e);}}else this._createFog(t);this._markersNeedUpdate=!0;}getSnow(){return this.snow?this.snow.get():null}setSnow(t){if(this._checkLoaded(),!t)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const i=this.snow;if(!e.bn(i.get(),t)){i.set(t,this.options),this.stylesheet.snow=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e);}}else this._createSnow(t);this._markersNeedUpdate=!0;}getRain(){return this.rain?this.rain.get():null}setRain(t){if(this._checkLoaded(),!t)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const i=this.rain;if(!e.bn(i.get(),t)){i.set(t,this.options),this.stylesheet.rain=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e);}}else this._createRain(t);this._markersNeedUpdate=!0;}_reloadColorTheme(){const t=()=>{for(const e in this._layers)this._layers[e].lut=this._styleColorTheme.lut;for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles();},i=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!i)return this._styleColorTheme.lut=null,void t();const o=this._evaluateColorThemeData(i);this._loadColorTheme(o).then((()=>{this.fire(new e.A("colorthemeset")),t();})).catch((t=>{e.w(`Couldn't set color theme: ${t}`);}));}setColorTheme(t){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&e.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=t,this._reloadColorTheme();}setImportColorTheme(e,t){const i=this.getFragmentStyle(e);i&&(i._styleColorTheme.colorThemeOverride=t,i._reloadColorTheme());}_getTransitionParameters(t){return {now:e.q.now(),transition:e.l(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const e=[],t=[];for(const i of this._mergedOrder)this.isLayerDraped(this._mergedLayers[i])?e.push(i):t.push(i);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t);}_createTerrain(e,t){const i=this.terrain=new Me(e,t,this.scope,this.options);1===t&&(this.stylesheet.terrain=e),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const o=this._getTransitionParameters({duration:0});i.updateTransitions(o);}_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,i,o,s,r={}){if(r&&!1===r.validate)return !1;const n=e.l({},this.serialize());return go(this,t.call(me,e.l({key:i,style:n,value:o,styleSpec:e.a5},s)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.cy.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._mergedLayers)this._mergedLayers[e].setEventedParent(null);for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles(),this._mergedSourceCaches[e].setEventedParent(null);this.imageManager.removeScope(this.scope),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove());}clearSource(e){const t=this.getSourceCaches(e);for(const e of t)e.clearTiles();}clearSources(){for(const e in this._mergedSourceCaches)this._mergedSourceCaches[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();}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle((e=>{e.modelManager.reloadModels(e.scope);}));}updateSources(e){let t;this.directionalLight&&(t=ro(this.directionalLight));for(const i in this._mergedSourceCaches)this._mergedSourceCaches[i].update(e,void 0,void 0,t);}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload();}}_updatePlacement(t,i,o,s,r,n,a=!1){let l=!1,c=!1;const h={},d={};for(const t of this._mergedOrder){const o=this._mergedLayers[t];if("symbol"!==o.type)continue;const s=e.C(o.source,o.scope);let r=h[s];if(!r){const e=this.getLayerSourceCache(o);if(!e)continue;const t=e.getRenderableIds(!0).map((t=>e.getTileByID(t)));d[s]=t.slice(),r=h[s]=t.sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)));}const n=this.crossTileSymbolIndex.addLayer(o,r,i.center.lng,i.projection);l=l||n;}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),a=a||this._layerOrderChanged||0===s,this._layerOrderChanged&&this.fire(new e.A("neworder")),(a||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.q.now(),i.zoom))&&(this.pauseablePlacement=new Ai(i,this._mergedOrder,a,o,s,r,this.placement,this.fog&&i.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,h,d,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.q.now()),c=!0),l&&this.pauseablePlacement.placement.setStale()),c||l){this._buildingIndex.onNewFrame(i.zoom);for(let t=0;t<this._mergedOrder.length;t++){const i=this._mergedLayers[this._mergedOrder[t]];if("symbol"!==i.type)continue;const o=this.isLayerClipped(i);this.placement.updateLayerOpacities(i,h[e.C(i.source,i.scope)],t,o?n:null);}}return {needsRerender:!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.q.now())}}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles();}addImport(t,i){this._checkLoaded();const o=this.stylesheet.imports=this.stylesheet.imports||[];if(-1!==o.findIndex((({id:e})=>e===t.id)))return void this.fire(new e.z(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!i)return o.push(t),this._loadImports([t],!0);const s=o.findIndex((({id:e})=>e===i));return -1===s&&this.fire(new e.z(new Error(`Import with id "${i}" does not exist on this map.`))),this.stylesheet.imports=o.slice(0,s).concat(t).concat(o.slice(s)),this._loadImports([t],!0,i)}updateImport(t,i){this._checkLoaded();const o=this.stylesheet.imports||[],s=this.getImportIndex(t);return -1===s?this:"string"==typeof i?(this.setImportUrl(t,i),this):(i.url&&i.url!==o[s].url&&this.setImportUrl(t,i.url),e.bn(i.config,o[s].config)||this.setImportConfig(t,i.config,i.data.schema),e.bn(i.data,o[s].data)||this.setImportData(t,i.data),this)}moveImport(e,t){this._checkLoaded();let i=this.stylesheet.imports||[];const o=this.getImportIndex(e);if(-1===o)return this;const s=this.getImportIndex(t);if(-1===s)return this;const r=i[o],n=this.fragments[o];return i=i.filter((({id:t})=>t!==e)),this.fragments=this.fragments.filter((({id:t})=>t!==e)),this.stylesheet.imports=i.slice(0,s).concat(r).concat(i.slice(s)),this.fragments=this.fragments.slice(0,s).concat(n).concat(this.fragments.slice(s)),this.mergeLayers(),this}setImportUrl(e,t){this._checkLoaded();const i=this.stylesheet.imports||[],o=this.getImportIndex(e);if(-1===o)return this;i[o].url=t;const s=this.fragments[o];return s.style=this._createFragmentStyle(i[o]),s.style.on("style.import.load",(()=>this.mergeAll())),s.style.loadURL(t),this}setImportData(e,t){this._checkLoaded();const i=this.getImportIndex(e),o=this.stylesheet.imports||[];return -1===i?this:t?(this.fragments[i].style.setState(t),this._reloadImports(),this):(delete o[i].data,this.setImportUrl(e,o[i].url))}setImportConfig(e,t,i){this._checkLoaded();const o=this.getImportIndex(e),s=this.stylesheet.imports||[];if(-1===o)return this;t?s[o].config=t:delete s[o].config;const r=this.fragments[o];i&&r.style.stylesheet&&(r.style.stylesheet.schema=i);const n=r.style.stylesheet&&r.style.stylesheet.schema;return r.config=t,r.style.updateConfig(t,n),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();const t=this.stylesheet.imports||[],i=this.getImportIndex(e);-1!==i&&(t.splice(i,1),this.fragments[i].style._remove(),this.fragments.splice(i,1),this._reloadImports());}getImportIndex(t){const i=(this.stylesheet.imports||[]).findIndex((e=>e.id===t));return -1===i&&this.fire(new e.z(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),i}getLayer(e){return this._mergedLayers[e]}getSources(){const e=[];for(const t in this._mergedOtherSourceCaches){const i=this._mergedOtherSourceCaches[t];i&&e.push(i.getSource());}return e}getSource(e,t){const i=this.getSourceCache(e,t);return i&&i.getSource()}getLayerSource(e){const t=this.getLayerSourceCache(e);return t&&t.getSource()}getSourceCache(t,i){const o=e.C(t,i);return this._mergedOtherSourceCaches[o]}getLayerSourceCache(t){const i=e.C(t.source,t.scope);return "symbol"===t.type?this._mergedSymbolSourceCaches[i]:this._mergedOtherSourceCaches[i]}getSourceCaches(e){if(null==e)return Object.values(this._mergedSourceCaches);const t=[];return this._mergedOtherSourceCaches[e]&&t.push(this._mergedOtherSourceCaches[e]),this._mergedSymbolSourceCaches[e]&&t.push(this._mergedSymbolSourceCaches[e]),t}updateSourceCaches(){const e=this._changes.getUpdatedSourceCaches();for(const t in e){const i=e[t];"reload"===i?this.reloadSource(t):"clear"===i&&this.clearSource(t);}}updateLayers(e){const t=this._changes.getUpdatedPaintProperties();for(const i of t){const t=this.getLayer(i);t&&t.updateTransitions(e);}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(e){this.stylesheet.glyphs=e,this.glyphManager.setURL(e,this.scope);}getImages(t,i,o){this.imageManager.getImages(i.images,i.scope,o),this._updateTilesForChangedImages();const s=t=>{if(t){const o=i.images.map((t=>e.I.toString(t)));t.setDependencies(i.tileID.key,i.type,o);}},r=e.C(i.source,i.scope);s(this._mergedOtherSourceCaches[r]),s(this._mergedSymbolSourceCaches[r]);}rasterizeImages(e,t,i){this.imageManager.rasterizeImages(t,i);}getGlyphs(e,t,i){this.glyphManager.getGlyphs(t.stacks,t.scope,i);}getResource(t,i,o){return e.cz(i,o)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return "symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}getOwnSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const i=this.getOwnSourceCaches(t);return 0===i.length?(this.fire(new e.z(new Error(`There is no source with ID '${t}'`))),!1):i.every((e=>e.loaded()))}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(e,t){if(!this._clipLayerPresent&&"fill-extrusion"!==e.type)return !1;const i="fill-extrusion"===e.type&&"building"===e.sourceLayer;if(e.is3D(!!this.terrain)){if(i||t&&"batched-model"===t.type)return !0;if("model"===e.type)return !0}else if("symbol"===e.type)return !0;return !1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches");}destroy(){this._clearWorkerCaches(),this.fragments.forEach((e=>{e.style._remove();})),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain);}}To.getSourceType=function(e){return st[e]},To.setSourceType=function(e,t){st[e]=t;},To.registerForPluginStateChange=e.ci;var Eo="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",So="\nout vec4 glFragColor;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#ifdef INDICATOR_CUTOUT\nuniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color,float height) {\n#ifdef INDICATOR_CUTOUT\nfloat verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}",Co="\n#define EXTENT 8192.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\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 vec2 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 (units_to_pixels*pos+offset)/pattern_size;}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) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+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);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const 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);}",Io="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out 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;}",Ro="\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\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;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;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 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*texture(u_dem,pos).r;\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=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;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*texture(u_dem_prev,pos).r;\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=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;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\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return 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; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(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;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif//DEPTH_OCCLUSION",Do="#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;out 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",Ao="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in 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 opacity_limit) {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,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}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;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",Lo="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",Po="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",Mo="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif//RENDER_SHADOWS",zo="#ifdef RENDER_SHADOWS\n#ifdef DEPTH_TEXTURE\nuniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1;\n#else\nuniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1;\n#endif\nuniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_1,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_0,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias;\n#ifdef TEXTURE_GATHER\nhighp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0));\n#else\nhighp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4(\nshadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0)\n);\n#endif\nvec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return clamp(mix(lerpx.x,lerpx.y,f.y),0.0,1.0);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {\n#ifdef SHADOWS_SINGLE_CASCADE\nlight_view_pos0.xyz/=light_view_pos0.w;vec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);\n#else\nlight_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0);\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const Oo=[];Vo(Eo,Oo),Vo(Co,Oo),Vo(So,Oo);const Fo={"_prelude_fog.vertex.glsl":Do,"_prelude_terrain.vertex.glsl":Ro,"_prelude_shadow.vertex.glsl":Mo,"_prelude_fog.fragment.glsl":Ao,"_prelude_shadow.fragment.glsl":zo,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif//LIGHTING_3D_MODE","_prelude_raster_array.glsl":Lo,"_prelude_raster_particle.glsl":Po},ko={};Go("",Ro),Go(Ao,Do),Go(zo,Mo),Go(Lo,""),Go(Po,"");const Bo=Go(So,Co),No=Eo;var Uo={background:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nin 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\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp 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_pattern_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),circle:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in 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\nuniform float u_emissive_strength;void 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 blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;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_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\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;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in 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\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out 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\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\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:Go("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Go('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in 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);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in 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\nout 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:Go("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Go("in float v_placed;in 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);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation),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:Go("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in 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);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out 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:Go("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout 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}'),elevatedStructuresDepth:Go("void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=vec4(0.);\n#endif\n}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructuresDepthReconstruct:Go("#ifdef DEPTH_RECONSTRUCTION\nin float v_height;\n#endif\nvoid main() {\n#ifdef DEPTH_RECONSTRUCTION\nif (v_height >=0.0)\ndiscard;\n#endif\nglFragColor=vec4(1.0,0.0,0.0,1.0);}","in vec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth;\n#ifdef DEPTH_RECONSTRUCTION\nout float v_height;\n#endif\nvoid main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale);\n#ifdef DEPTH_RECONSTRUCTION\nif (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height;\n#endif\ngl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}"),elevatedStructures:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin vec3 v_normal;in float v_height;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nvoid main() {vec3 color=vec3(241.0/255.0,236.0/255.0,225.0/255.0);\n#ifdef LIGHTING_3D_MODE\nvec3 normal=normalize(v_normal);\n#ifdef RENDER_SHADOWS\nfloat shadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);color.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#else\ncolor=apply_lighting(color,normal);\n#endif\nif (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);}\n#endif\n#ifdef FOG\ncolor=fog_apply(color,v_fog_pos);\n#endif\nvec4 out_color=vec4(color,1.0);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_height);\n#endif\nglFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;in float a_height;in vec3 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\nvoid main() {v_normal=a_pos_normal_3/16384.0;v_height=a_height;vec3 pos=vec3(a_pos,a_height);gl_Position=u_matrix*vec4(pos,1);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(v_normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fill:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\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_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=opacity;\n#ifdef INDICATOR_CUTOUT\nif (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=z_offset;\n#endif\n}'),fillOutline:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\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_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nin highp vec2 v_pos;in highp 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;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform 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;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp 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\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);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 RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;in highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\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;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp 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\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_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);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,h);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform 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;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in 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\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 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) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;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=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_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 cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\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);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\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=vec2(mix(concave,-concave,start),y_ground);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\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\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=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:Go("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nout highp float v_depth;void main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=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\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*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\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,height);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform 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 float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in 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\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\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 is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_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\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.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_normal=normal;\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}'),groundShadow:Go('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:Go("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:Go("precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}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));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(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);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out 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:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;\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 lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\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\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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=texture(u_dash_image,v_tex).r;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=((border_width*u_width_scale)+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);if (border_color.a==0.0) {float 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);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH)\nin vec3 a_z_offset_width;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin 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;uniform float u_width_scale;uniform highp float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\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\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\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\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\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;\n#ifdef VARIABLE_LINE_WIDTH\nfloat left=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);halfwidth=(u_width_scale*(left==1.0 ? a_z_offset_width.y : a_z_offset_width.z))/2.0;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\noffset=-1.0*offset*u_width_scale;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);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),0.001);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2];\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=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\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*u_floor_width_scale),(-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#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),linePattern:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nuniform float u_emissive_strength;\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*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);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_z_offset);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec3 a_z_offset_width;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\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);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=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\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=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),raster:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 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_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos   ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);    \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,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;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 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 mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,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)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:Go("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:Go("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:Go('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return  clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:Go('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\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\n#pragma mapbox: define lowp float emissive_strength\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\n#pragma mapbox: initialize lowp float emissive_strength\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\n#ifdef RENDER_SDF\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;\n#else\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n#endif\nout_color*=opacity*fade_opacity;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\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_elevation_from_sea;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;uniform bool u_is_halo;\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\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\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\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\n#pragma mapbox: define lowp float z_offset\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\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\n#pragma mapbox: initialize lowp float z_offset\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;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,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;vec2 a;\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);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 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\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);    \n#endif\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\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+(u_elevation_from_sea ? z_offset : z_offset) : 0.0;\n#else\nz+=u_pitch_with_map ? (u_elevation_from_sea ? z_offset : z_offset) : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\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,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=e;\n#endif\n}'),terrainRaster:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\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\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_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.);\n#endif\n}'),terrainDepth:Go("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out 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:Go('#include "_prelude_fog.fragment.glsl"\nin 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=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Io),skyboxGradient:Go('#include "_prelude_fog.fragment.glsl"\nin 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=texture(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;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Io),skyboxCapture:Go("\nin 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;precision highp float;\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;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out 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:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;uniform float u_far_z_cutoff;in 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\nhighp 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 norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nraster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform 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\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;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);globe_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:Go('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;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) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp 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;\n#ifdef ALPHA_PASS\nfloat 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);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 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=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in 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;out highp vec3 v_ray_dir;out 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);}"),model:Go('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return  depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(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;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor,v_position_height.w);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:Go("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:Go("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),snowParticle:Go("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:Go("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:Go("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),occlusion:Go("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function Vo(e,t){const i=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let e of i)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 i=e.split(" ");for(const e of i)t.includes(e)||t.push(e);}}function Go(e,t){const i=/#include\s+"([^"]+)"/g,o=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let s=t.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);s&&(s=s.map((e=>{const t=e.split(" ");return t[t.length-1]})),s=[...new Set(s)]);const r={},n=[],a=[];if(e=e.replace(i,((e,t)=>(a.push(t),""))),(t=t.replace(i,((e,t)=>(n.push(t),"")))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let l=[...Oo];Vo(e,l),Vo(t,l);for(const e of [...n,...a])Fo[e]||console.error(`Undefined include: ${e}`),ko[e]||(ko[e]=[],Vo(Fo[e],ko[e])),l=[...l,...ko[e]];return {fragmentSource:e=e.replace(o,((e,t,i,o,s)=>(r[s]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${s}\nin ${i} ${o} ${s};\n#else\nuniform ${i} ${o} u_${s};\n#endif\n`:"initialize"===t?`\n#ifdef HAS_UNIFORM_u_${s}\n    ${i} ${o} ${s} = u_${s};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${s}\n    in ${i} ${o} ${s};\n#endif\n`:"initialize-attribute"===t?"":void 0))),vertexSource:t=t.replace(o,((e,t,i,o,s)=>{const n="float"===o?"vec2":o,a=s.match(/color/)?"color":n;return "define-attribute-vertex-shader-only"===t?`\n#ifdef HAS_ATTRIBUTE_a_${s}\nin ${i} ${o} a_${s};\n#endif\n`:r[s]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${s}\nuniform lowp float u_${s}_t;\nin ${i} ${n} a_${s};\nout ${i} ${o} ${s};\n#else\nuniform ${i} ${o} u_${s};\n#endif\n`:"initialize"===t?"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${s}\n    ${s} = a_${s};\n#else\n    ${i} ${o} ${s} = u_${s};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${s}\n    ${s} = unpack_mix_${a}(a_${s}, u_${s}_t);\n#else\n    ${i} ${o} ${s} = u_${s};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${s}\n    in ${i} ${o} a_${s};\n    out ${i} ${o} ${s};\n#endif\n`:"initialize-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${s}\n    ${s} = a_${s};\n#endif\n`:void 0:"define"===t?`\n#ifndef HAS_UNIFORM_u_${s}\nuniform lowp float u_${s}_t;\nin ${i} ${n} a_${s};\n#else\nuniform ${i} ${o} u_${s};\n#endif\n`:"define-instanced"===t?"mat4"===a?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${s}0;\nin vec4 a_${s}1;\nin vec4 a_${s}2;\nin vec4 a_${s}3;\n#else\nuniform ${i} ${o} u_${s};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${i} ${n} a_${s};\n#else\nuniform ${i} ${o} u_${s};\n#endif\n`:"initialize-attribute-custom"===t?`\n#ifdef HAS_ATTRIBUTE_a_${s}\n    ${i} ${o} ${s} = a_${s};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${s}\n    ${i} ${o} ${s} = a_${s};\n#else\n    ${i} ${o} ${s} = u_${s};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${s}\n    ${i} ${o} ${s} = unpack_mix_${a}(a_${s}, u_${s}_t);\n#else\n    ${i} ${o} ${s} = u_${s};\n#endif\n`})),staticAttributes:s,usedDefines:l,vertexIncludes:n,fragmentIncludes:a}}class jo{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null;}bind(e,t,i,o,s,r,n,a){this.context=e;let l=this.boundPaintVertexBuffers.length!==o.length;for(let e=0;!l&&e<o.length;e++)this.boundPaintVertexBuffers[e]!==o[e]&&(l=!0);let c=this.boundDynamicVertexBuffers.length!==n.length;for(let e=0;!c&&e<n.length;e++)this.boundDynamicVertexBuffers[e]!==n[e]&&(c=!0);if(!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||l||c||this.boundIndexBuffer!==s||this.boundVertexOffset!==r)this.freshBind(t,i,o,s,r,n,a);else {e.bindVertexArrayOES.set(this.vao);for(const i of n)i&&(i.bind(),a&&i.instanceCount&&i.setVertexAttribDivisor(e.gl,t,a));s&&s.dynamicDraw&&s.bind();}}freshBind(e,t,i,o,s,r,n){const a=e.numAttributes,l=this.context,c=l.gl;this.vao&&this.destroy(),this.vao=l.gl.createVertexArray(),l.bindVertexArrayOES.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=o,this.boundVertexOffset=s,this.boundDynamicVertexBuffers=r,t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,s);for(const t of i)t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,s);for(const t of r)t&&(t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,s),n&&t.instanceCount&&t.setVertexAttribDivisor(c,e,n));o&&o.bind(),l.currentNumAttributes=a;}destroy(){this.vao&&(this.context.gl.deleteVertexArray(this.vao),this.vao=null);}}function qo(t,i){const o=Math.pow(2,i.canonical.z),s=i.canonical.y;return [new e.ac(0,s/o).toLngLat().lat,new e.ac(0,(s+1)/o).toLngLat().lat]}function Ho(t,i,o,s,r,n,a){const l=t.context,c=l.gl,h=o.hillshadeFBO;if(!h)return;t.prepareDrawTile();const d=t.isTileAffectedByFog(i),u=t.getOrCreateProgram("hillshade",{overrideFog:d});l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,h.colorAttachment.get());const _=((t,i,o,s)=>{const r=o.paint.get("hillshade-shadow-color"),n="none"===o.paint.get("hillshade-shadow-color-use-theme").constantOr("default"),a=o.paint.get("hillshade-highlight-color"),l="none"===o.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),c=o.paint.get("hillshade-accent-color"),h="none"===o.paint.get("hillshade-accent-color-use-theme").constantOr("default"),d=o.paint.get("hillshade-emissive-strength");let u=e.ak(o.paint.get("hillshade-illumination-direction"));if("viewport"===o.paint.get("hillshade-illumination-anchor"))u-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const i=t.style.directionalLight.properties.get("direction"),o=e.cc(i.x,i.y,i.z);u=e.ak(o[1]);}const _=!t.options.moving;return {u_matrix:s||t.transform.calculateProjMatrix(i.tileID.toUnwrapped(),_),u_image:0,u_latrange:qo(0,i.tileID),u_light:[o.paint.get("hillshade-exaggeration"),u],u_shadow:r.toRenderColor(n?null:o.lut),u_highlight:a.toRenderColor(l?null:o.lut),u_emissive_strength:d,u_accent:c.toRenderColor(h?null:o.lut)}})(t,o,s,t.terrain?i.projMatrix:null);t.uploadCommonUniforms(l,u,i.toUnwrapped());const{tileBoundsBuffer:p,tileBoundsIndexBuffer:f,tileBoundsSegments:m}=t.getTileBoundsBuffers(o);u.draw(t,c.TRIANGLES,r,n,a,ji.disabled,_,s.id,p,f,m);}function Zo(t,i,o){if(!i.needsDEMTextureUpload)return;const s=t.context,r=s.gl;s.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(o.stride);const n=o.getPixels();i.demTexture?i.demTexture.update(n,{premultiply:!1}):i.demTexture=new e.T(s,n,r.R32F,{premultiply:!1}),i.needsDEMTextureUpload=!1;}function Wo(t,i,o){const s=t.context,r=s.gl;if(!i.dem)return;const n=i.dem;if(s.activeTexture.set(r.TEXTURE1),Zo(t,i,n),!i.demTexture)return;i.demTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE);const a=n.dim;s.activeTexture.set(r.TEXTURE0);let l=i.hillshadeFBO;if(!l){const t=new e.T(s,{width:a,height:a,data:null},r.RGBA8);t.bind(r.LINEAR,r.CLAMP_TO_EDGE),l=i.hillshadeFBO=s.createFramebuffer(a,a,!0,"renderbuffer"),l.colorAttachment.set(t.texture);}s.bindFramebuffer.set(l.framebuffer),s.viewport.set([0,0,a,a]);const{tileBoundsBuffer:c,tileBoundsIndexBuffer:h,tileBoundsSegments:d}=t.getMercatorTileBoundsBuffers(),u=[];t.linearFloatFilteringSupported()&&u.push("TERRAIN_DEM_FLOAT_FORMAT"),t.getOrCreateProgram("hillshadePrepare",{defines:u}).draw(t,r.TRIANGLES,Bi.disabled,Ui.disabled,ki.unblended,ji.disabled,((t,i)=>{const o=i.stride,s=e.ad.mat4.create();return e.ad.mat4.ortho(s,0,e.ai,-e.ai,0,0,1),e.ad.mat4.translate(s,s,[0,-e.ai,0]),{u_matrix:s,u_image:1,u_dimension:[o,o],u_zoom:t.overscaledZ}})(i.tileID,n),o.id,c,h,d),i.needsHillshadePrepare=!1;}class $o{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 Xo extends $o{getDefault(){return e.al.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 Ko extends $o{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1);}}class Yo extends $o{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1);}}class Jo extends $o{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 Qo extends $o{getDefault(){return !0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1);}}class es extends $o{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1);}}class ts extends $o{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 is extends $o{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 os extends $o{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 ss extends $o{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 rs extends $o{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 ns extends $o{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1);}}class as extends $o{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 ls extends $o{getDefault(){const e=this.gl;return [e.ONE,e.ZERO,e.ONE,e.ZERO]}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.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1);}}class cs extends $o{getDefault(){return e.al.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 hs extends $o{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1);}}class ds extends $o{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 us extends $o{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1);}}class _s extends $o{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1);}}let ps=class extends $o{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1);}};class fs extends $o{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1);}}class ms extends $o{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 gs extends $o{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 vs extends $o{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 ys extends $o{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 xs extends $o{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 bs extends $o{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1;}}class ws extends $o{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1);}}class Ts extends $o{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 Es extends $o{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 Ss extends $o{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 Cs extends $o{constructor(e,t){super(e),this.context=e,this.parent=t;}getDefault(){return null}}class Is extends Cs{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 Rs extends Cs{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 Ds extends Cs{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.framebufferTexture2D(t.FRAMEBUFFER,this.attachment(),t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1;}}class As extends Rs{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const Ls=(e,t,i)=>({u_matrix:e,u_image0:0,u_skirt_height:t,u_ground_shadow_factor:i}),Ps=(e,t,i,o,s,r,n,a,l,c,h,d,u,_,p,f)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(o),u_merc_matrix:i,u_zoom_transition:s,u_merc_center:r,u_image0:0,u_frustum_tl:n,u_frustum_tr:a,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:h,u_globe_radius:d,u_viewport:u,u_grid_matrix:f?Float32Array.from(f):new Float32Array(9),u_skirt_height:_,u_far_z_cutoff:p});function Ms(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const zs=new class{constructor(){this.operations={};}newMorphing(e,t,i,o,s){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==i.tileID.key&&(t.queued=i);}else this.operations[e]={startTime:o,phase:0,duration:s,from:t,to:i,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 i=this.operations[t];for(i.phase=(e-i.startTime)/i.duration;i.phase>=1||!this._validOp(i);)if(!this._nextOp(i,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()}},Os={0:null,1:"TERRAIN_VERTEX_MORPHING"};function Fs(e,t,i){if(0===t)return 0;const o=t<1&&514===i?.25/t:1;return 6*Math.pow(1.5,22-e)*Math.max(t,1)*o}function ks(e,t){const i=1<<e.z;return !t&&(0===e.x||e.x===i-1)||0===e.y||e.y===i-1}const Bs=e=>({u_matrix:e});function Ns(t,i,o,s,r){if(r>0){const n=e.q.now(),a=(n-t.timeAdded)/r,l=i?(n-i.timeAdded)/r:-1,c=o.getSource(),h=s.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),d=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),u=d&&t.refreshedUponExpiration?1:e.ay(d?a:1-l,0,1);return t.refreshedUponExpiration&&a>=1&&(t.refreshedUponExpiration=!1),i?{opacity:1,mix:1-u}:{opacity:u,mix:0}}return {opacity:1,mix:0}}class Us extends St{constructor(t){const i={type:"raster-dem",maxzoom:t.transform.maxZoom},o=new e.D(e.cj(),null),s=rt("mock-dem",i,o,t.style);super("mock-dem",s,!1),s.setEventedParent(this),this._sourceLoaded=!0;}_loadTile(e,t){e.state="loaded",t(null);}}class Vs extends St{constructor(t){const i=rt("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new e.D(e.cj(),null),t.style);super("proxy",i,!1),i.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={};}update(e,t,i){if(e.freezeTileCoverage)return;this.transform=e;const o=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((t,i)=>{if(t[i.key]="",!this._tiles[i.key]){const t=new bt(i,this._source.tileSize*i.overscaleFactor(),e.tileZoom);t.state="loaded",this._tiles[i.key]=t;}return t}),{});for(const e in this._tiles)e in o||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e]);}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const i=Object.values(t);this.renderCachePool.push(...i),delete this.proxyCachedFBO[e];}}deallocRenderCache(){this.renderCache.forEach((e=>e.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={};}}class Gs extends e.aH{constructor(e,t,i){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=i;}}class js extends e.cK{constructor(t,i){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},t.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},(()=>{this._style.map.triggerRepaint();})),t.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},(()=>{this._style.map.triggerRepaint();})),t.tp.registerButton(["Terrain"],"Invalidate Render Cache",(()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint();})),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[o,s,r]=function(t){const i=new e.b5,o=new e.aV,s=131;i.reserve(17161),o.reserve(33800);const r=e.ai/128,n=e.ai+r/2,a=n+r;for(let t=-r;t<a;t+=r)for(let o=-r;o<a;o+=r){const s=o<0||o>n||t<0||t>n?24575:0,r=e.ay(Math.round(o),0,e.ai),a=e.ay(Math.round(t),0,e.ai);i.emplaceBack(r+s,a);}const l=(e,t)=>{const i=t*s+e;o.emplaceBack(i+1,i,i+s),o.emplaceBack(i+s,i+s+1,i+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);})),[i,o,32768]}(),n=t.context;this.gridBuffer=n.createVertexBuffer(o,e.b7.members),this.gridIndexBuffer=n.createIndexBuffer(s),this.gridSegments=e.b8.simpleSegment(0,0,o.length,s.length),this.gridNoSkirtSegments=e.b8.simpleSegment(0,0,o.length,r),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Vs(i.map),this.orthoMatrix=e.ad.mat4.create(),e.ad.mat4.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.ai,0,e.ai,0,1);const a=n.gl;this._overlapStencilMode=new Ui({func:a.GEQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Us(i.map),this._pendingGroundEffectLayers=[];}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache();}));}update(t,i,o){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const s=t.terrain.properties,r=0===t.terrain.drapeRenderMode,n=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.q.now();const a=t.terrain&&t.terrain.scope,l=s.get("source"),c=r?this._mockSourceCache:t.getSourceCache(l,a);if(!c)return void e.w(`Couldn't find terrain source "${l}".`);if(this.sourceCache=c,this._attenuationRange=t.terrain.getAttenuationRange(),this._exaggeration=n?this.calculateExaggeration(i):s.get("exaggeration"),!i.projection.requiresDraping&&n&&0===this._exaggeration)return void this._disable();this.enabled=!0;const h=()=>{this.sourceCache.used&&e.w(`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(i,t,!0),this.resetTileLookupCache(this.sourceCache.id);};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,h(),this._initializing=!0),h(),i.updateElevation(!0,o),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0,this._previousZoom=i.zoom;}else this._disable();}calculateExaggeration(t){if(this._attenuationRange&&t.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(t.zoom);const i=this._previousCameraAltitude,o=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=o;const s=null!=i?o-i:Number.MAX_VALUE;if(Math.abs(s)<2)return this._exaggeration;const r=t.zoom,n=this._style.terrain;if(!this._previousUpdateTimestamp)return n.getExaggeration(r);let a=r-this._previousZoom;const l=this._previousUpdateTimestamp;let c=r;null!=this._evaluationZoom&&(c=this._evaluationZoom,Math.abs(r-c)>.5&&(a=.5*(r-c+a)),a*s<0&&(c+=a)),this._evaluationZoom=c;const h=n.getExaggeration(c),d=h===n.getExaggeration(Math.max(0,c-.1));if(d&&Math.abs(h-this._exaggeration)<.01)return h;let u=Math.min(.1,.00375*(this._updateTimestamp-l));return (d||h<.1||Math.abs(a)<1e-4)&&(u=Math.min(.2,4*u)),e.ah(this._exaggeration,h,u)}resetTileLookupCache(e){this._findCoveringTileCache[e]={};}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0);}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1;}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach((e=>e.fb.destroy())),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy();}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}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 i=this.proxySourceCache,o=this.painter.transform;this._initializing&&(this._initializing=0===o._centerAltitude&&-1===this.getAtPointOrZero(e.ac.fromLngLat(o.center),-1),this._emptyDEMTextureDirty=!this._initializing);const s=this.proxyCoords=i.getIds().map((e=>{const t=i.getTileByID(e).tileID;return t.projMatrix=o.calculateProjMatrix(t.toUnwrapped()),t}));!function(t,i){const o=i.transform.pointCoordinate(i.transform.getCameraPoint()),s=new e.P(o.x,o.y);t.sort(((t,i)=>{if(i.overscaledZ-t.overscaledZ)return i.overscaledZ-t.overscaledZ;const o=new e.P(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),r=new e.P(i.canonical.x+(1<<i.canonical.z)*i.wrap,i.canonical.y),n=s.mult(1<<t.canonical.z);return n.x-=.5,n.y-=.5,n.distSqr(o)-n.distSqr(r)}));}(s,this.painter);const r=this.proxyToSource||{};this.proxyToSource={},s.forEach((e=>{this.proxyToSource[e.key]={};})),this.terrainTileForTile={};const n=this._style._mergedSourceCaches;for(const e in n){const i=n[e];if(!i.used)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,t[e],r),i.usedForTerrain)continue;const o=t[e];i.getSource().reparseOverscaled&&this._assignTerrainTiles(o);}this.proxiedCoords[i.id]=s.map((e=>new Gs(e,e.key,this.orthoMatrix))),this._assignTerrainTiles(s),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(r),this.renderingToTexture=!1;const a={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const i=t.tileID.key;i in a||(this._visibleDemTiles.push(t),a[i]=i);}}_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 i in this.terrainTileForTile){const o=this.terrainTileForTile[i],s=o.dem;!s||o.demTexture&&!o.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),Zo(this.painter,o,s));}}_prepareDemTileUniforms(e,t,i,o){if(!t||null==t.demTexture)return !1;const s=e.tileID.canonical,r=Math.pow(2,t.tileID.canonical.z-s.z),n=o||"";return i[`u_dem_tl${n}`]=[s.x*r%1,s.y*r%1],i[`u_dem_scale${n}`]=r,!0}get emptyDEMTexture(){return !this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let e=0;const t=this._visibleDemTiles.reduce(((t,i)=>{if(!i.dem)return t;const o=i.dem.tree.minimums[0];return o>0&&e++,t+o}),0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,i=t.gl;t.activeTexture.set(i.TEXTURE2);const o=this._getLoadedAreaMinimum(),s=new e.cL({width:1,height:1},new Float32Array([o]));this._emptyDEMTextureDirty=!1;let r=this._emptyDEMTexture;return r?r.update(s,{premultiply:!1}):r=this._emptyDEMTexture=new e.T(t,s,i.R32F,{premultiply:!1}),r}setupElevationDraw(t,i,o){const s=this.painter.context,r=s.gl,n={u_dem:2,u_dem_prev:4,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_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};n.u_exaggeration=this.exaggeration();let a=null,l=null,c=1;if(o&&o.morphing&&this._useVertexMorphing){const e=o.morphing.srcDemTile,i=o.morphing.dstDemTile;c=o.morphing.phase,e&&i&&(this._prepareDemTileUniforms(t,e,n,"_prev")&&(l=e),this._prepareDemTileUniforms(t,i,n)&&(a=i));}const h=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?r.LINEAR:r.NEAREST;let d=null;var u;if(this.enabled?l&&a?(d=a.demTexture,s.activeTexture.set(r.TEXTURE4),l.demTexture.bind(h(l),r.CLAMP_TO_EDGE),n.u_dem_lerp=c):(a=this.terrainTileForTile[t.tileID.key],d=this._prepareDemTileUniforms(t,a,n)?a.demTexture:this.emptyDEMTexture):d=this.emptyDEMTexture,s.activeTexture.set(r.TEXTURE2),d&&(n.u_dem_size=1===(u=d).size[0]?1:u.size[0]-2,d.bind(h(a),r.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(o&&o.useDepthForOcclusion,i,n),o&&o.useMeterToDem&&a){const t=(1<<a.tileID.canonical.z)*e.bH(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;n.u_meter_to_dem=t;}if(o&&o.labelPlaneMatrixInv&&(n.u_label_plane_matrix_inv=o.labelPlaneMatrixInv),i.setTerrainUniformValues(s,n),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,o&&o.useDenormalizedUpVectorScale);i.setGlobeUniformValues(s,e);}}globeUniformValues(t,i,o){const s=t.projection;return {u_tile_tl_up:s.upVector(i,0,0),u_tile_tr_up:s.upVector(i,e.ai,0),u_tile_br_up:s.upVector(i,e.ai,e.ai),u_tile_bl_up:s.upVector(i,0,e.ai),u_tile_up_scale:o?e.cM(1):s.upVectorScale(i,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const i=this.painter,o=this.painter.context;0!==t.length&&(o.bindFramebuffer.set(null),o.viewport.set([0,0,i.width,i.height]),i.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,i,o,s,r){if("globe"===t.transform.projection.name)!function(t,i,o,s,r){const n=t.context,a=n.gl;let l,c;const h=t.transform,d=e.cD(t,n,h),u=(e,i)=>{if(c===i)return;const o=[Os[i],"PROJECTION_GLOBE_VIEW"];d&&o.push("CUSTOM_ANTIALIASING");const s=t.isTileAffectedByFog(e);l=t.getOrCreateProgram("globeRaster",{defines:o,overrideFog:s}),c=i;},_=t.colorModeForRenderPass(),p=new Bi(a.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D);zs.update(r);const f=e.cE(h),m=[e.av(h.center.lng),e.aC(h.center.lat)],g=t.globeSharedBuffers,v=[h.width*e.q.devicePixelRatio,h.height*e.q.devicePixelRatio],y=Float32Array.from(h.globeMatrix),x={useDenormalizedUpVectorScale:!0};{const h=t.transform,d=Fs(h.zoom,i.exaggeration(),i.sourceCache._source.tileSize);c=-1;const b=a.TRIANGLES;for(const c of s){const s=o.getTile(c),w=Ui.disabled,T=i.prevTerrainTileForTile[c.key],E=i.terrainTileForTile[c.key];Ms(T,E)&&zs.newMorphing(c.key,T,E,r,250),n.activeTexture.set(a.TEXTURE0),s.texture&&s.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const S=zs.getMorphValuesForProxy(c.key),C=S?1:0;S&&e.L(x,{morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:e.cC(S.phase)}});const I=e.cF(c.canonical),R=e.cG(I.getCenter().lat),D=e.cH(c.canonical,I,R,h.worldSize/h._pixelsPerMercatorPixel),A=e.bc(e.cI(c.canonical)),L=Ps(h.expandedFarZProjMatrix,y,f,A,e.ag(h.zoom),m,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,v,d,h._farZ,D);if(u(c,C),l&&(i.setupElevationDraw(s,l,x),t.uploadCommonUniforms(n,l,c.toUnwrapped()),g)){const[e,i,o]=g.getGridBuffers(R,0!==d);l.draw(t,b,p,w,_,ji.backCCW,L,"globe_raster",e,i,o);}}}if(g&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const r=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];d&&r.push("CUSTOM_ANTIALIASING"),l=t.getOrCreateProgram("globeRaster",{defines:r});for(const r of s){const{x:s,y:c,z:d}=r.canonical,u=0===c,f=c===(1<<d)-1,[y,b,w,T]=g.getPoleBuffers(d,!1);if(T&&(u||f)){const c=o.getTile(r);n.activeTexture.set(a.TEXTURE0),c.texture&&c.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);let g=e.cJ(d,s,h);const E=e.bc(e.cI(r.canonical)),S=(e,i)=>e.draw(t,a.TRIANGLES,p,Ui.disabled,_,ji.disabled,Ps(h.expandedFarZProjMatrix,g,g,E,0,m,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,v,0,h._farZ),"globe_pole_raster",i,w,T);i.setupElevationDraw(c,l,x),t.uploadCommonUniforms(n,l,r.toUnwrapped()),u&&t.renderDefaultNorthPole&&S(l,y),f&&t.renderDefaultSouthPole&&(g=e.ad.mat4.scale(e.ad.mat4.create(),g,[1,-1,1]),S(l,b));}}}}(t,i,o,s,r);else {const n=t.context,a=n.gl;let l,c;const h=t.shadowRenderer,d=Qi(t,t.longestCutoffRange),u=e=>{if(c===e)return;const i=[];i.push(Os[e]),d.shouldRenderCutoff&&i.push("RENDER_CUTOFF"),h&&(i.push("RENDER_SHADOWS","DEPTH_TEXTURE"),h.useNormalOffset&&i.push("NORMAL_OFFSET")),l=t.getOrCreateProgram("terrainRaster",{defines:i}),c=e;},_=t.colorModeForRenderPass(),p=new Bi(a.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D);zs.update(r);const f=t.transform,m=Fs(f.zoom,i.exaggeration(),i.sourceCache._source.tileSize);let g=[0,0,0];if(h){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(g=no(t.style,e,i));}{c=-1;const v=a.TRIANGLES,[y,x]=[i.gridIndexBuffer,i.gridSegments];for(const c of s){const s=o.getTile(c),b=Ui.disabled,w=i.prevTerrainTileForTile[c.key],T=i.terrainTileForTile[c.key];Ms(w,T)&&zs.newMorphing(c.key,w,T,r,250),n.activeTexture.set(a.TEXTURE0),s.texture&&s.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const E=zs.getMorphValuesForProxy(c.key),S=E?1:0;let C;E&&(C={morphing:{srcDemTile:E.from,dstDemTile:E.to,phase:e.cC(E.phase)}});const I=Ls(c.projMatrix,ks(c.canonical,f.renderWorldCopies)?m/10:m,g);if(u(S),!l)continue;i.setupElevationDraw(s,l,C);const R=c.toUnwrapped();h&&h.setupShadows(R,l),t.uploadCommonUniforms(n,l,R,null,d),l.draw(t,v,p,b,_,ji.backCCW,I,"terrain_raster",i.gridBuffer,y,x);}}}}(i,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,i.gpuTimingDeferredRenderEnd(),t.splice(0,t.length));}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const i=this.painter,o=this.painter.context,s=this.proxySourceCache,r=this.proxiedCoords[s.id],n=this._drapedRenderBatches.shift(),a=i.style.order,l=[];let c=0;for(const h of r){const r=s.getTileByID(h.proxyTileKey),d=s.proxyCachedFBO[h.key]?s.proxyCachedFBO[h.key][t]:void 0,u=void 0!==d?s.renderCache[d]:this.pool[c++],_=void 0!==d;if(r.texture=u.tex,_&&!u.dirty){l.push(r.tileID);continue}let p;o.bindFramebuffer.set(u.fb.framebuffer),this.renderedToTile=!1,u.dirty&&(o.clear({color:e.al.transparent,stencil:0}),u.dirty=!1);for(let e=n.start;e<=n.end;++e){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const s=i.style.getLayerSourceCache(t),r=s?this.proxyToSource[h.key][s.id]:[h];if(!r)continue;const n=r;o.viewport.set([0,0,u.fb.width,u.fb.height]),p!==(s?s.id:null)&&(this._setupStencil(u,r,t,s),p=s?s.id:null),i.renderLayer(i,s,t,n);}if(0===this._drapedRenderBatches.length)for(const e of this._pendingGroundEffectLayers){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const s=i.style.getLayerSourceCache(t),r=s?this.proxyToSource[h.key][s.id]:[h];if(!r)continue;const n=r;o.viewport.set([0,0,u.fb.width,u.fb.height]),p!==(s?s.id:null)&&(this._setupStencil(u,r,t,s),p=s?s.id:null),i.renderLayer(i,s,t,n);}this.renderedToTile?(u.dirty=!0,l.push(r.tileID)):_||--c,5===c&&(c=0,this.renderToBackBuffer(l));}return this.renderToBackBuffer(l),this.renderingToTexture=!1,o.bindFramebuffer.set(null),o.viewport.set([0,0,i.width,i.height]),n.end+1}postRender(){}isLayerOrderingCorrect(e){const t=e.order.length;let i=-1,o=t;for(let s=0;s<t;++s)this._style.isLayerDraped(e._mergedLayers[e.order[s]])?i=Math.max(i,s):o=Math.min(o,s);return o>i}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,i){if(!this._visibleDemTiles)return null;const o=this._visibleDemTiles.filter((e=>e.dem)).map((o=>{const s=o.tileID,r=1<<s.overscaledZ,{x:n,y:a}=s.canonical,l=n/r,c=(n+1)/r,h=a/r,d=(a+1)/r;return {minx:l,miny:h,maxx:c,maxy:d,t:o.dem.tree.raycastRoot(l,h,c,d,e,t,i),tile:o}}));o.sort(((e,t)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE)));for(const s of o){if(null==s.t)return null;const o=s.tile.dem.tree.raycast(s.minx,s.miny,s.maxx,s.maxy,e,t,i);if(null!=o)return o}return null}_createFBO(){const t=this.painter.context,i=t.gl,o=this.drapeBufferSize;t.activeTexture.set(i.TEXTURE0);const s=new e.T(t,{width:o[0],height:o[1],data:null},i.RGBA8);s.bind(i.LINEAR,i.CLAMP_TO_EDGE);const r=t.createFramebuffer(o[0],o[1],!0,null);return r.colorAttachment.set(s.texture),r.depthAttachment=new As(t,r.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,o[0],o[1]),this._stencilRef=0,r.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):r.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:r,tex:s,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO());}_shouldDisableRenderCache(){if(this._debugParams.disableRenderCache)return !0;if(this._style.hasLightTransitions())return !0;for(const e in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[e].hasTransition())return !0;return this._style.order.some((e=>{const t=this._style._mergedLayers[e],i=t.isHidden(this.painter.transform.zoom);return "hillshade"===t.type||"custom"===t.type?!i&&t.shouldRedrape():!i&&t.hasTransition()}))}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if(e instanceof tt){t=!0;break}if(!t)return;const i={};for(let t=0;t<this._style.order.length;++t){const o=this._style._mergedLayers[this._style.order[t]],s=this._style.getLayerSourceCache(o);if(s&&!i[s.id]&&!o.isHidden(this.painter.transform.zoom)&&"line"===o.type&&o.widthExpression()instanceof e.ab){i[s.id]=!0;for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][s.id];if(t)for(const e of t)this._clearRenderCacheForTile(s.id,e);}}}}_clearRasterLayersFromRenderCache(){let e=!1;for(const t in this._style._mergedSourceCaches)if(this._style._mergedSourceCaches[t]._source instanceof it){e=!0;break}if(!e)return;const t={};for(let e=0;e<this._style.order.length;++e){const i=this._style._mergedLayers[this._style.order[e]],o=this._style.getLayerSourceCache(i);if(!o||t[o.id])continue;if(i.isHidden(this.painter.transform.zoom)||"raster"!==i.type)continue;const s=i.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][o.id];if(t)for(const e of t){const t=Ns(o.getTile(e),o.findLoadedParent(e,0),o,this.painter.transform,s);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(o.id,e);}}}}_setupDrapedRenderBatches(){this._style.updateDrapeFirstLayers();const t=this._style.order,i=t.length;if(0===i)return;const o=[];this._pendingGroundEffectLayers=[];let s,r=0,n=this._style._mergedLayers[t[r]];for(;!this._style.isLayerDraped(n)&&n.isHidden(this.painter.transform.zoom)&&++r<i;)n=this._style._mergedLayers[t[r]];for(;r<i;++r){const e=this._style._mergedLayers[t[r]];e.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(e)?void 0===s&&(s=r):("fill-extrusion"===e.type&&this._pendingGroundEffectLayers.push(r),void 0!==s&&(o.push({start:s,end:r-1}),s=void 0)));}if(void 0!==s&&o.push({start:s,end:r-1}),0!==o.length){const t=o[o.length-1];this._pendingGroundEffectLayers.every((e=>e>t.end))||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.");}this._drapedRenderBatches=o;}_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 i=0;i<e.length;++i){const o=Object.values(e[i]);t.renderCachePool.push(...o);}}return}this._clearRasterLayersFromRenderCache();const i=this.proxyCoords,o=this._tilesDirty;for(let s=i.length-1;s>=0;s--){const r=i[s];if(t.getTileByID(r.key),void 0!==t.proxyCachedFBO[r.key]){const i=e[r.key],s=this.proxyToSource[r.key];let n=0;for(const e in s){const t=s[e],r=i[e];if(!r||r.length!==t.length||t.some(((t,i)=>t!==r[i]||o[e]&&o[e].hasOwnProperty(t.key)))){n=-1;break}++n;}for(const e in t.proxyCachedFBO[r.key])t.renderCache[t.proxyCachedFBO[r.key][e]].dirty=n<0||n!==Object.values(i).length;}}const s=[...this._drapedRenderBatches];s.sort(((e,t)=>t.end-t.start-(e.end-e.start)));for(const e of s)for(const o of i){if(t.proxyCachedFBO[o.key])continue;let i=t.renderCachePool.pop();void 0===i&&t.renderCache.length<50&&(i=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==i&&(t.proxyCachedFBO[o.key]={},t.proxyCachedFBO[o.key][e.start]=i,t.renderCache[i].dirty=!0);}this._tilesDirty={};}_setupStencil(e,t,i,o){if(!o||!this._sourceTilesOverlap[o.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const s=this.painter.context,r=s.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let n;if(i.isTileClipped())n=t.length,this._overlapStencilMode.test={func:r.EQUAL,mask:255},this._overlapStencilType="Clip";else {if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);n=1,this._overlapStencilMode.test={func:r.GREATER,mask:255},this._overlapStencilType="Mask";}this._stencilRef+n>255&&(s.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=n,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref);}clipOrMaskOverlapStencilType(){return "Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(e){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[e.key]),this._overlapStencilMode):Ui.disabled}_renderTileClippingMasks(e,t){const i=this.painter,o=this.painter.context,s=o.gl;i._tileClippingMaskIDs={},o.setColorMode(ki.disabled),o.setDepthMode(Bi.disabled);const r=i.getOrCreateProgram("clippingMask");for(const o of e){const e=i._tileClippingMaskIDs[o.key]=--t;r.draw(i,s.TRIANGLES,Bi.disabled,new Ui({func:s.ALWAYS,mask:0},e,255,s.KEEP,s.KEEP,s.REPLACE),ki.disabled,ji.disabled,Bs(o.projMatrix),"$clipping",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments);}}pointCoordinate(t){const i=this.painter.transform;if(t.x<0||t.x>i.width||t.y<0||t.y>i.height)return null;const o=[t.x,t.y,1,1];e.ad.vec4.transformMat4(o,o,i.pixelMatrixInverse),e.ad.vec4.scale(o,o,1/o[3]),o[0]/=i.worldSize,o[1]/=i.worldSize;const s=i._camera.position,r=e.bH(1,i.center.lat),n=[s[0],s[1],s[2]/r,0],a=e.ad.vec3.subtract([],o.slice(0,3),n);e.ad.vec3.normalize(a,a);const l=this.raycast(n,a,this._exaggeration);return null!==l&&l?(e.ad.vec3.scaleAndAdd(n,n,a,l),n[3]=n[2],n[2]*=r,n):null}_setupProxiedCoordsForOrtho(t,i,o){if(t.getSource()instanceof e.aK)return this._setupProxiedCoordsForImageSource(t,i,o);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const s=this.proxiedCoords[t.id]=[],r=this.proxyCoords;for(let e=0;e<r.length;e++){const i=r[e],n=this._findTileCoveringTileID(i,t);if(n){const e=this._createProxiedId(i,n,o[i.key]&&o[i.key][t.id]);s.push(e),this.proxyToSource[i.key][t.id]=[e];}}let n=!1;const a=new Set;for(let e=0;e<i.length;e++){const r=t.getTile(i[e]);if(!r||!r.hasData())continue;const l=this._findTileCoveringTileID(r.tileID,this.proxySourceCache);if(l&&l.tileID.canonical.z!==r.tileID.canonical.z){const e=this.proxyToSource[l.tileID.key][t.id],i=this._createProxiedId(l.tileID,r,o[l.tileID.key]&&o[l.tileID.key][t.id]);e?e.splice(e.length-1,0,i):this.proxyToSource[l.tileID.key][t.id]=[i];const c=this.proxyToSource[l.tileID.key][t.id];a.has(c)||a.add(c),s.push(i),n=!0;}}if(this._sourceTilesOverlap[t.id]=n,n&&this._debugParams.sortTilesHiZFirst)for(const e of a)e.sort(((e,t)=>t.overscaledZ-e.overscaledZ));}_setupProxiedCoordsForImageSource(t,i,o){if(!t.getSource().loaded())return;const s=this.proxiedCoords[t.id]=[],r=this.proxyCoords,n=t.getSource(),a=n.tileID;if(!a)return;const l=new e.P(a.x,a.y)._div(1<<a.z),c=n.coordinates.map(e.ac.fromLngLat).reduce(((e,t)=>(e.min.x=Math.min(e.min.x,t.x-l.x),e.min.y=Math.min(e.min.y,t.y-l.y),e.max.x=Math.max(e.max.x,t.x-l.x),e.max.y=Math.max(e.max.y,t.y-l.y),e)),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),h=(t,i)=>{const o=t.wrap+t.canonical.x/(1<<t.canonical.z),s=t.canonical.y/(1<<t.canonical.z),r=e.ai/(1<<t.canonical.z),n=i.wrap+i.canonical.x/(1<<i.canonical.z),a=i.canonical.y/(1<<i.canonical.z);return o+r<n+c.min.x||o>n+c.max.x||s+r<a+c.min.y||s>a+c.max.y};for(let e=0;e<r.length;e++){const n=r[e];for(let e=0;e<i.length;e++){const r=t.getTile(i[e]);if(!r||!r.hasData())continue;if(h(n,r.tileID))continue;const a=this._createProxiedId(n,r,o[n.key]&&o[n.key][t.id]),l=this.proxyToSource[n.key][t.id];l?l.push(a):this.proxyToSource[n.key][t.id]=[a],s.push(a);}}}_createProxiedId(t,i,o){let s=this.orthoMatrix;if(o){const e=o.find((e=>e.key===i.tileID.key));if(e)return e}if(i.tileID.key!==t.key){const o=t.canonical.z-i.tileID.canonical.z;let r,n,a;s=e.ad.mat4.create();const l=i.tileID.wrap-t.wrap<<t.overscaledZ;o>0?(r=e.ai>>o,n=r*((i.tileID.canonical.x<<o)-t.canonical.x+l),a=r*((i.tileID.canonical.y<<o)-t.canonical.y)):(r=e.ai<<-o,n=e.ai*(i.tileID.canonical.x-(t.canonical.x+l<<-o)),a=e.ai*(i.tileID.canonical.y-(t.canonical.y<<-o))),e.ad.mat4.ortho(s,0,r,0,r,0,1),e.ad.mat4.translate(s,s,[n,a,0]);}return new Gs(i.tileID,t.key,s)}_findTileCoveringTileID(t,i){let o=i.getTile(t);if(o&&o.hasData())return o;const s=this._findCoveringTileCache[i.id],r=s[t.key];if(o=r?i.getTileByID(r):null,o&&o.hasData()||null===r)return o;let n=o?o.tileID:t,a=n.overscaledZ;const l=i.getSource().minzoom,c=[];if(!r){const s=i.getSource().maxzoom;if(t.canonical.z>=s){const o=t.canonical.z-s;i.getSource().reparseOverscaled?(a=Math.max(t.canonical.z+2,i.transform.tileZoom),n=new e.aH(a,t.wrap,s,t.canonical.x>>o,t.canonical.y>>o)):0!==o&&(a=s,n=new e.aH(a,t.wrap,s,t.canonical.x>>o,t.canonical.y>>o));}n.key!==t.key&&(c.push(n.key),o=i.getTile(n));}const h=e=>{c.forEach((t=>{s[t]=e;})),c.length=0;};for(a-=1;a>=l&&(!o||!o.hasData());a--){o&&h(o.tileID.key);const e=n.calculateScaledKey(a);if(o=i.getTileByID(e),o&&o.hasData())break;const t=s[e];if(null===t)break;void 0===t?c.push(e):o=i.getTileByID(t);}return h(o?o.tileID.key:null),o&&o.hasData()?o:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0;}_clearRenderCacheForTile(e,t){let i=this._tilesDirty[e];i||(i=this._tilesDirty[e]={}),i[t.key]=!0;}}function qs(t,i,o){const s=function(t,i,o){const s=e.ad.vec3.dot(i,t),r=e.ad.vec3.dot(o,[.2126,.7152,.0722]),n=(e,t,i)=>(1-i)*e+i*t,a=n(1-.3*Math.min(r,1),1,Math.min(s+1,1));return n(.92,1,Math.asin(e.ay(i[2],-1,1))/Math.PI+.5)*a}(t,[0,0,1],i),r=[0,0,0];e.ad.vec3.scale(r,o.slice(0,3),s);const n=[0,0,0];e.ad.vec3.scale(n,i.slice(0,3),t[2]);const a=[0,0,0];return e.ad.vec3.add(a,r,n),e.cg(a)}const Hs=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],Zs=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","elevatedStructures","model","symbol"];class Ws{static cacheKey(e,t,i,o){let s=`${t}${o?o.cacheKey:""}`;for(const t of i)e.usedDefines.includes(t)&&(s+=`/${t}`);return s}constructor(t,i,o,s,r,n){const a=t.gl;this.program=a.createProgram(),this.configuration=s,this.name=i,this.fixedDefines=[...n];const l=s?s.getBinderAttributes():[],c=(o.staticAttributes||[]).concat(l);let h=s?s.defines():[];h=h.concat(n.map((e=>`#define ${e}`)));const d="#version 300 es\n";let u=d+h.concat("precision mediump float;",No,Bo.fragmentSource).join("\n");for(const e of o.fragmentIncludes)u+=`\n${Fo[e]}`;u+=`\n${o.fragmentSource}`;let _=d+h.concat("precision highp float;",No,Bo.vertexSource).join("\n");for(const e of o.vertexIncludes)_+=`\n${Fo[e]}`;this.forceManualRenderingForInstanceIDShaders=t.forceManualRenderingForInstanceIDShaders&&-1!==o.vertexSource.indexOf("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&(_+="\nuniform int u_instanceID;\n"),_+=`\n${o.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(_=_.replaceAll("gl_InstanceID","u_instanceID"));const p=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())return void(this.failedToCreate=!0);a.shaderSource(p,u),a.compileShader(p),a.attachShader(this.program,p);const f=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else {a.shaderSource(f,_),a.compileShader(f),a.attachShader(this.program,f),this.attributes={},this.numAttributes=c.length;for(let e=0;e<this.numAttributes;e++)if(c[e]){const t=c[e].startsWith("a_")?c[e]:`a_${c[e]}`;a.bindAttribLocation(this.program,e,t),this.attributes[t]=e;}a.linkProgram(this.program),a.deleteShader(f),a.deleteShader(p),this.fixedUniforms=r(t),this.binderUniforms=s?s.getUniforms(t):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(t=>({u_instanceID:new e.bN(t)}))(t)),(n.includes("TERRAIN")||-1!==i.indexOf("symbol")||-1!==i.indexOf("circle"))&&(this.terrainUniforms=(t=>({u_dem:new e.bN(t),u_dem_prev:new e.bN(t),u_dem_tl:new e.bK(t),u_dem_scale:new e.bM(t),u_dem_tl_prev:new e.bK(t),u_dem_scale_prev:new e.bM(t),u_dem_size:new e.bM(t),u_dem_lerp:new e.bM(t),u_exaggeration:new e.bM(t),u_depth:new e.bN(t),u_depth_size_inv:new e.bK(t),u_depth_range_unpack:new e.bK(t),u_occluder_half_size:new e.bM(t),u_occlusion_depth_offset:new e.bM(t),u_meter_to_dem:new e.bM(t),u_label_plane_matrix_inv:new e.bJ(t)}))(t)),n.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.bL(t),u_tile_tr_up:new e.bL(t),u_tile_br_up:new e.bL(t),u_tile_bl_up:new e.bL(t),u_tile_up_scale:new e.bM(t)}))(t)),n.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.bJ(t),u_fog_range:new e.bK(t),u_fog_color:new e.cb(t),u_fog_horizon_blend:new e.bM(t),u_fog_vertical_limit:new e.bK(t),u_fog_temporal_offset:new e.bM(t),u_frustum_tl:new e.bL(t),u_frustum_tr:new e.bL(t),u_frustum_br:new e.bL(t),u_frustum_bl:new e.bL(t),u_globe_pos:new e.bL(t),u_globe_radius:new e.bM(t),u_globe_transition:new e.bM(t),u_is_globe:new e.bN(t),u_viewport:new e.bK(t)}))(t)),n.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(t=>({u_cutoff_params:new e.cb(t)}))(t)),n.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new e.bL(t),u_lighting_directional_dir:new e.bL(t),u_lighting_directional_color:new e.bL(t),u_ground_radiance:new e.bL(t)}))(t)),n.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(t=>({u_light_matrix_0:new e.bJ(t),u_light_matrix_1:new e.bJ(t),u_fade_range:new e.bK(t),u_shadow_normal_offset:new e.bL(t),u_shadow_intensity:new e.bM(t),u_shadow_texel_size:new e.bM(t),u_shadow_map_resolution:new e.bM(t),u_shadow_direction:new e.bL(t),u_shadow_bias:new e.bL(t),u_shadowmap_0:new e.bN(t),u_shadowmap_1:new e.bN(t)}))(t));}}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e]);}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const i=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e]);}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e]);}}setCutoffUniformValues(e,t){if(!this.cutoffUniforms)return;const i=this.cutoffUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e]);}}setLightsUniformValues(e,t){if(!this.lightsUniforms)return;const i=this.lightsUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e]);}}setShadowUniformValues(e,t){if(this.failedToCreate||!this.shadowUniforms)return;const i=this.shadowUniforms;e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e]);}_drawDebugWireframe(t,i,o,s,r,n,a,l,c,h){const d=t.options.wireframe;if(!1===d.terrain&&!1===d.layers2D&&!1===d.layers3D)return;const u=t.context;if(!(()=>!(!d.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!d.layers2D||t._terrain&&t._terrain.renderingToTexture||!Hs.includes(this.name))||!(!d.layers3D||!Zs.includes(this.name)))())return;const _=u.gl,p=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,r,u);if(!p)return;const f=[...this.fixedDefines];f.push("DEBUG_WIREFRAME");const m=t.getOrCreateProgram(this.name,{config:this.configuration,defines:f});u.program.set(m.program);const g=(e,t,i)=>{if(t[e]&&i[e])for(const o in t[e])i[e][o]&&i[e][o].set(i.program,o,t[e][o].current);};c&&c.setUniforms(m.program,u,m.binderUniforms,a,{zoom:l}),g("fixedUniforms",this,m),g("terrainUniforms",this,m),g("globeUniforms",this,m),g("fogUniforms",this,m),g("lightsUniforms",this,m),g("shadowUniforms",this,m),p.bind(),u.setColorMode(new ki([_.ONE,_.ONE_MINUS_SRC_ALPHA,_.ZERO,_.ONE],e.al.transparent,[!0,!0,!0,!1])),u.setDepthMode(new Bi(i.func===_.LESS?_.LEQUAL:i.func,Bi.ReadOnly,i.range)),u.setStencilMode(Ui.disabled);const v=3*n.primitiveLength*2,y=3*n.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const e=h||1;for(let t=0;t<e;++t)m.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",t),_.drawElements(_.LINES,v,_.UNSIGNED_SHORT,y);}else h&&h>1?_.drawElementsInstanced(_.LINES,v,_.UNSIGNED_SHORT,y,h):_.drawElements(_.LINES,v,_.UNSIGNED_SHORT,y);r.bind(),u.program.set(this.program),u.setDepthMode(i),u.setStencilMode(o),u.setColorMode(s);}checkUniforms(e,t,i){if(this.fixedDefines.includes(t))for(const o of Object.keys(i))if(!i[o].initialized)throw new Error(`Program '${this.name}', from draw '${e}': uniform ${o} not set but required by ${t} being defined`)}draw(e,t,i,o,s,r,n,a,l,c,h,d,u,_,p,f){const m=e.context,g=m.gl;if(this.failedToCreate)return;m.program.set(this.program),m.setDepthMode(i),m.setStencilMode(o),m.setColorMode(s),m.setCullFace(r);for(const e of Object.keys(this.fixedUniforms))this.fixedUniforms[e].set(this.program,e,n[e]);_&&_.setUniforms(this.program,m,this.binderUniforms,d,{zoom:u});const v={[g.POINTS]:1,[g.LINES]:2,[g.TRIANGLES]:3,[g.LINE_STRIP]:1}[t];this.checkUniforms(a,"RENDER_SHADOWS",this.shadowUniforms);const y=f&&f>0?1:void 0;for(const r of h.get()){const n=r.vaos||(r.vaos={});if((n[a]||(n[a]=new jo)).bind(m,this,l,_?_.getPaintVertexBuffers():[],c,r.vertexOffset,p||[],y),this.forceManualRenderingForInstanceIDShaders){const e=f||1;for(let i=0;i<e;++i)this.instancingUniforms.u_instanceID.set(this.program,"u_instanceID",i),c?g.drawElements(t,r.primitiveLength*v,g.UNSIGNED_SHORT,r.primitiveOffset*v*2):g.drawArrays(t,r.vertexOffset,r.vertexLength);}else f&&f>1?g.drawElementsInstanced(t,r.primitiveLength*v,g.UNSIGNED_SHORT,r.primitiveOffset*v*2,f):c?g.drawElements(t,r.primitiveLength*v,g.UNSIGNED_SHORT,r.primitiveOffset*v*2):g.drawArrays(t,r.vertexOffset,r.vertexLength);t===g.TRIANGLES&&c&&this._drawDebugWireframe(e,i,o,s,c,r,d,u,_,f);}}}function $s(t,i){const o=Math.pow(2,i.tileID.overscaledZ),s=i.tileSize*Math.pow(2,t.transform.tileZoom)/o,r=s*(i.tileID.canonical.x+i.tileID.wrap*o),n=s*i.tileID.canonical.y;return {u_image:0,u_texsize:i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/e.at(i,1,t.transform.tileZoom),u_pixel_coord_upper:[r>>16,n>>16],u_pixel_coord_lower:[65535&r,65535&n]}}const Xs={terrain:0,flat:1},Ks=e.ad.mat4.create(),Ys=(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g,v)=>{const y=i.style.light,x=y.properties.get("position"),b=[x.x,x.y,x.z],w=e.ad.mat3.create();"viewport"===y.properties.get("anchor")&&(e.ad.mat3.fromRotation(w,-i.transform.angle),e.ad.vec3.transformMat3(b,b,w));const T=y.properties.get("color"),E=i.transform,S={u_matrix:t,u_lightpos:b,u_lightintensity:y.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_vertical_gradient:+o,u_opacity:s,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ks,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:Xs[h],u_base_type:Xs[d],u_ao:r,u_edge_radius:n,u_width_scale:a,u_flood_light_color:f,u_vertical_scale:m,u_flood_light_intensity:g,u_ground_shadow_factor:v};return "globe"===E.projection.name&&(S.u_tile_id=[l.canonical.x,l.canonical.y,1<<l.canonical.z],S.u_zoom_transition=u,S.u_inv_rot_matrix=p,S.u_merc_center=_,S.u_up_dir=E.projection.upVector(new e.bT(0,0,0),_[0]*e.ai,_[1]*e.ai),S.u_height_lift=c),S},Js=(e,t,i,o,s,r)=>({u_matrix:e,u_edge_radius:t,u_width_scale:i,u_vertical_scale:o,u_height_type:Xs[s],u_base_type:Xs[r]}),Qs=(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g)=>{const v=Ys(t,i,o,s,r,n,a,l,h,d,u,_,p,f,m,g,1,[0,0,0]),y={u_height_factor:-Math.pow(2,l.overscaledZ)/c.tileSize/8};return e.l(v,$s(i,c),y)},er=(e,t)=>({u_matrix:e,u_emissive_strength:t}),tr=(t,i,o,s)=>e.l(er(t,i),$s(o,s)),ir=(e,t,i)=>({u_matrix:e,u_world:i,u_emissive_strength:t}),or=(t,i,o,s,r)=>e.l(tr(t,i,o,s),{u_world:r}),sr=(e,t,i,o,s)=>({u_matrix:e,u_camera_pos:[t[0],t[1],t[2]],u_depth_bias:i,u_height_scale:o,u_reset_depth:s}),rr=(t,i,o,s)=>{const r=e.ai/o.tileSize;return {u_matrix:t,u_camera_to_center_distance:i.getCameraToCenterDistance(s),u_extrude_scale:[i.pixelsToGLUnits[0]/r,i.pixelsToGLUnits[1]/r]}},nr=(e,t,i=1)=>({u_matrix:e,u_color:t.toRenderColor(null),u_overlay:0,u_overlay_scale:i}),ar=e.ad.mat4.create(),lr=(t,i,o,s,r,n,a)=>{const l=t.transform,c="globe"===l.projection.name,h=c?e.cO(l.zoom,i.canonical)*l._pixelsPerMercatorPixel:e.at(o,1,n),d={u_matrix:i.projMatrix,u_extrude_scale:h,u_intensity:a,u_inv_rot_matrix:ar,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){d.u_inv_rot_matrix=s,d.u_merc_center=r,d.u_tile_id=[i.canonical.x,i.canonical.y,1<<i.canonical.z],d.u_zoom_transition=e.ag(l.zoom);const t=r[0]*e.ai,o=r[1]*e.ai;d.u_up_dir=l.projection.upVector(new e.bT(0,0,0),t,o);}return d};function cr(e,[t,i,o,s],[r,n]){if(r===n)return [0,0,0,0];const a=255*(e-1)/(e*(n-r));return [t*a,i*a,o*a,s*a]}function hr(e,t,[i,o]){return i===o?0:.5/e+(t-i)*(e-1)/(e*(o-i))}const dr=(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g,v,y,x,b)=>({u_matrix:t,u_normalize_matrix:i,u_globe_matrix:o,u_merc_matrix:s,u_grid_matrix:r,u_tl_parent:n,u_scale_parent:h,u_fade_t:d.mix,u_opacity:d.opacity*u.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:u.paint.get("raster-brightness-min"),u_brightness_high:u.paint.get("raster-brightness-max"),u_saturation_factor:e.cP(u.paint.get("raster-saturation")),u_contrast_factor:e.cQ(u.paint.get("raster-contrast")),u_spin_weights:ur(u.paint.get("raster-hue-rotate")),u_perspective_transform:_,u_raster_elevation:p,u_zoom_transition:a,u_merc_center:l,u_cutoff_params:c,u_colorization_mix:cr(e.cR,m,v),u_colorization_offset:hr(e.cR,g,v),u_color_ramp:f,u_texture_offset:[x/(y+2*x),y/(y+2*x)],u_texture_res:[y+2*x,y+2*x],u_emissive_strength:b});function ur(e){e*=Math.PI/180;const t=Math.sin(e),i=Math.cos(e);return [(2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3]}const _r=.05,pr=(e,t,i,o,s,r,n,a,l,c,h,d)=>({u_matrix:e,u_normalize_matrix:t,u_globe_matrix:i,u_merc_matrix:o,u_grid_matrix:s,u_tl_parent:r,u_scale_parent:c,u_fade_t:h.mix,u_opacity:h.opacity,u_image0:0,u_image1:1,u_raster_elevation:d,u_zoom_transition:n,u_merc_center:a,u_cutoff_params:l}),fr=(e,t,i,o,s,r,n,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_tile_offset:i,u_velocity:o,u_color_ramp:r,u_velocity_res:s,u_max_speed:n,u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[_r,_r]}),mr=(e,t,i,o,s,r,n,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_velocity:i,u_velocity_res:o,u_max_speed:s,u_speed_factor:r,u_reset_rate:n,u_rand_seed:Math.random(),u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[_r,_r]}),gr=e.ad.mat4.create(),vr=(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g,v,y,x,b,w)=>{const T=r.transform,E={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:T.getCameraToCenterDistance(y),u_rotate_symbol:+o,u_aspect_ratio:T.width/T.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:n,u_label_plane_matrix:a,u_coord_matrix:l,u_is_text:+h,u_elevation_from_sea:c?1:0,u_pitch_with_map:+s,u_texsize:d,u_texsize_icon:u,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:gr,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:gr,u_up_vector:[0,-1,0],u_color_adj_mat:x,u_icon_transition:b||0,u_gamma_scale:s?r.transform.getCameraToCenterDistance(y)*Math.cos(r.terrain?0:r.transform._pitch):1,u_device_pixel_ratio:e.q.devicePixelRatio,u_is_halo:+_,u_scale_factor:w||1};return "globe"===y.name&&(E.u_tile_id=[p.canonical.x,p.canonical.y,1<<p.canonical.z],E.u_zoom_transition=f,E.u_inv_rot_matrix=g,E.u_merc_center=m,E.u_camera_forward=T._camera.forward(),E.u_ecef_origin=e.cS(T.globeMatrix,p.toUnwrapped()),E.u_tile_matrix=Float32Array.from(T.globeMatrix),E.u_up_vector=v),E},yr=(e,t,i,o)=>({u_matrix:e,u_emissive_strength:t,u_opacity:i,u_color:o}),xr=(t,i,o,s,r,n,a,l,c)=>e.l(function(t,i,o,s,r,n){const{width:a,height:l}=s.imageManager.getPixelSize(i),c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,s.transform.tileZoom)/c,d=h*(n.tileID.canonical.x+n.tileID.wrap*c),u=h*n.tileID.canonical.y;return {u_image:0,u_pattern_tl:o.tl,u_pattern_br:o.br,u_texsize:[a,l],u_pattern_size:o.displaySize,u_pattern_units_to_pixels:r?[s.transform.width,-1*s.transform.height]:[1/e.at(n,1,s.transform.tileZoom),1/e.at(n,1,s.transform.tileZoom)],u_pixel_coord_upper:[d>>16,u>>16],u_pixel_coord_lower:[65535&d,65535&u]}}(0,n,a,s,l,c),{u_matrix:t,u_emissive_strength:i,u_opacity:o}),br=new Float32Array(e.ad.mat4.identity([])),wr=(t,i,o,s,r,n,a,l,c,h,d,u,_,p=[0,0,0],f)=>{const m=r.style.light,g=m.properties.get("position"),v=[-g.x,-g.y,g.z],y=e.ad.mat3.create();"viewport"===m.properties.get("anchor")&&(e.ad.mat3.fromRotation(y,-r.transform.angle),e.ad.vec3.transformMat3(v,v,y));const x="MASK"===d.alphaMode,b=m.properties.get("color").toRenderColor(null),w=_.paint.get("model-ambient-occlusion-intensity"),T=_.paint.get("model-color").constantOr(e.al.white).toRenderColor(null),E=_.paint.get("model-color-mix-intensity").constantOr(0);return {u_matrix:t,u_lighting_matrix:i,u_normal_matrix:o,u_node_matrix:s||br,u_lightpos:v,u_lightintensity:m.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_camera_pos:p,u_opacity:n,u_baseTextureIsAlpha:0,u_alphaMask:+x,u_alphaCutoff:d.alphaCutoff,u_baseColorFactor:[a.r,a.g,a.b,a.a],u_emissiveFactor:[l[0],l[1],l[2],1],u_metallicFactor:c,u_roughnessFactor:h,u_baseColorTexture:Xi.BaseColor,u_metallicRoughnessTexture:Xi.MetallicRoughness,u_normalTexture:Xi.Normal,u_occlusionTexture:Xi.Occlusion,u_emissionTexture:Xi.Emission,u_lutTexture:Xi.LUT,u_color_mix:[T.r,T.g,T.b,E],u_aoIntensity:w,u_emissive_strength:u,u_occlusionTextureTransform:f||[0,0,0,0]}},Tr=(e,t=br,i=br)=>({u_matrix:e,u_instance:t,u_node_matrix:i}),Er={fillExtrusion:t=>({u_matrix:new e.bJ(t),u_lightpos:new e.bL(t),u_lightintensity:new e.bM(t),u_lightcolor:new e.bL(t),u_vertical_gradient:new e.bM(t),u_opacity:new e.bM(t),u_edge_radius:new e.bM(t),u_width_scale:new e.bM(t),u_ao:new e.bK(t),u_height_type:new e.bN(t),u_base_type:new e.bN(t),u_tile_id:new e.bL(t),u_zoom_transition:new e.bM(t),u_inv_rot_matrix:new e.bJ(t),u_merc_center:new e.bK(t),u_up_dir:new e.bL(t),u_height_lift:new e.bM(t),u_flood_light_color:new e.bL(t),u_vertical_scale:new e.bM(t),u_flood_light_intensity:new e.bM(t),u_ground_shadow_factor:new e.bL(t)}),fillExtrusionDepth:t=>({u_matrix:new e.bJ(t),u_edge_radius:new e.bM(t),u_width_scale:new e.bM(t),u_vertical_scale:new e.bM(t),u_height_type:new e.bN(t),u_base_type:new e.bN(t)}),fillExtrusionPattern:t=>({u_matrix:new e.bJ(t),u_lightpos:new e.bL(t),u_lightintensity:new e.bM(t),u_lightcolor:new e.bL(t),u_vertical_gradient:new e.bM(t),u_height_factor:new e.bM(t),u_edge_radius:new e.bM(t),u_width_scale:new e.bM(t),u_ao:new e.bK(t),u_height_type:new e.bN(t),u_base_type:new e.bN(t),u_tile_id:new e.bL(t),u_zoom_transition:new e.bM(t),u_inv_rot_matrix:new e.bJ(t),u_merc_center:new e.bK(t),u_up_dir:new e.bL(t),u_height_lift:new e.bM(t),u_image:new e.bN(t),u_texsize:new e.bK(t),u_pixel_coord_upper:new e.bK(t),u_pixel_coord_lower:new e.bK(t),u_tile_units_to_pixels:new e.bM(t),u_opacity:new e.bM(t)}),fillExtrusionGroundEffect:t=>({u_matrix:new e.bJ(t),u_opacity:new e.bM(t),u_ao_pass:new e.bM(t),u_meter_to_tile:new e.bM(t),u_ao:new e.bK(t),u_flood_light_intensity:new e.bM(t),u_flood_light_color:new e.bL(t),u_attenuation:new e.bM(t),u_edge_radius:new e.bM(t),u_fb:new e.bN(t),u_fb_size:new e.bM(t),u_dynamic_offset:new e.bM(t)}),fill:t=>({u_matrix:new e.bJ(t),u_emissive_strength:new e.bM(t)}),fillPattern:t=>({u_matrix:new e.bJ(t),u_emissive_strength:new e.bM(t),u_image:new e.bN(t),u_texsize:new e.bK(t),u_pixel_coord_upper:new e.bK(t),u_pixel_coord_lower:new e.bK(t),u_tile_units_to_pixels:new e.bM(t)}),fillOutline:t=>({u_matrix:new e.bJ(t),u_emissive_strength:new e.bM(t),u_world:new e.bK(t)}),fillOutlinePattern:t=>({u_matrix:new e.bJ(t),u_emissive_strength:new e.bM(t),u_world:new e.bK(t),u_image:new e.bN(t),u_texsize:new e.bK(t),u_pixel_coord_upper:new e.bK(t),u_pixel_coord_lower:new e.bK(t),u_tile_units_to_pixels:new e.bM(t)}),elevatedStructures:t=>({u_matrix:new e.bJ(t)}),elevatedStructuresDepthReconstruct:t=>({u_matrix:new e.bJ(t),u_camera_pos:new e.bL(t),u_depth_bias:new e.bM(t),u_height_scale:new e.bM(t),u_reset_depth:new e.bM(t)}),circle:e.cT,collisionBox:t=>({u_matrix:new e.bJ(t),u_camera_to_center_distance:new e.bM(t),u_extrude_scale:new e.bK(t)}),collisionCircle:t=>({u_matrix:new e.bJ(t),u_inv_matrix:new e.bJ(t),u_camera_to_center_distance:new e.bM(t),u_viewport_size:new e.bK(t)}),debug:t=>({u_color:new e.cA(t),u_matrix:new e.bJ(t),u_overlay:new e.bN(t),u_overlay_scale:new e.bM(t)}),clippingMask:t=>({u_matrix:new e.bJ(t)}),heatmap:t=>({u_extrude_scale:new e.bM(t),u_intensity:new e.bM(t),u_matrix:new e.bJ(t),u_inv_rot_matrix:new e.bJ(t),u_merc_center:new e.bK(t),u_tile_id:new e.bL(t),u_zoom_transition:new e.bM(t),u_up_dir:new e.bL(t)}),heatmapTexture:t=>({u_image:new e.bN(t),u_color_ramp:new e.bN(t),u_opacity:new e.bM(t)}),hillshade:t=>({u_matrix:new e.bJ(t),u_image:new e.bN(t),u_latrange:new e.bK(t),u_light:new e.bK(t),u_shadow:new e.cA(t),u_highlight:new e.cA(t),u_emissive_strength:new e.bM(t),u_accent:new e.cA(t)}),hillshadePrepare:t=>({u_matrix:new e.bJ(t),u_image:new e.bN(t),u_dimension:new e.bK(t),u_zoom:new e.bM(t)}),line:e.cU,linePattern:e.cV,raster:t=>({u_matrix:new e.bJ(t),u_normalize_matrix:new e.bJ(t),u_globe_matrix:new e.bJ(t),u_merc_matrix:new e.bJ(t),u_grid_matrix:new e.cB(t),u_tl_parent:new e.bK(t),u_scale_parent:new e.bM(t),u_fade_t:new e.bM(t),u_opacity:new e.bM(t),u_image0:new e.bN(t),u_image1:new e.bN(t),u_brightness_low:new e.bM(t),u_brightness_high:new e.bM(t),u_saturation_factor:new e.bM(t),u_contrast_factor:new e.bM(t),u_spin_weights:new e.bL(t),u_perspective_transform:new e.bK(t),u_raster_elevation:new e.bM(t),u_zoom_transition:new e.bM(t),u_merc_center:new e.bK(t),u_cutoff_params:new e.cb(t),u_colorization_mix:new e.cb(t),u_colorization_offset:new e.bM(t),u_color_ramp:new e.bN(t),u_texture_offset:new e.bK(t),u_texture_res:new e.bK(t),u_emissive_strength:new e.bM(t)}),rasterParticle:t=>({u_matrix:new e.bJ(t),u_normalize_matrix:new e.bJ(t),u_globe_matrix:new e.bJ(t),u_merc_matrix:new e.bJ(t),u_grid_matrix:new e.cB(t),u_tl_parent:new e.bK(t),u_scale_parent:new e.bM(t),u_fade_t:new e.bM(t),u_opacity:new e.bM(t),u_image0:new e.bN(t),u_image1:new e.bN(t),u_raster_elevation:new e.bM(t),u_zoom_transition:new e.bM(t),u_merc_center:new e.bK(t),u_cutoff_params:new e.cb(t)}),rasterParticleTexture:t=>({u_texture:new e.bN(t),u_opacity:new e.bM(t)}),rasterParticleDraw:t=>({u_particle_texture:new e.bN(t),u_particle_texture_side_len:new e.bM(t),u_tile_offset:new e.bK(t),u_velocity:new e.bN(t),u_color_ramp:new e.bN(t),u_velocity_res:new e.bK(t),u_max_speed:new e.bM(t),u_uv_offset:new e.bK(t),u_data_scale:new e.bK(t),u_data_offset:new e.bM(t),u_particle_pos_scale:new e.bM(t),u_particle_pos_offset:new e.bK(t)}),rasterParticleUpdate:t=>({u_particle_texture:new e.bN(t),u_particle_texture_side_len:new e.bM(t),u_velocity:new e.bN(t),u_velocity_res:new e.bK(t),u_max_speed:new e.bM(t),u_speed_factor:new e.bM(t),u_reset_rate:new e.bM(t),u_rand_seed:new e.bM(t),u_uv_offset:new e.bK(t),u_data_scale:new e.bK(t),u_data_offset:new e.bM(t),u_particle_pos_scale:new e.bM(t),u_particle_pos_offset:new e.bK(t)}),symbol:t=>({u_is_size_zoom_constant:new e.bN(t),u_is_size_feature_constant:new e.bN(t),u_size_t:new e.bM(t),u_size:new e.bM(t),u_camera_to_center_distance:new e.bM(t),u_rotate_symbol:new e.bN(t),u_aspect_ratio:new e.bM(t),u_fade_change:new e.bM(t),u_matrix:new e.bJ(t),u_label_plane_matrix:new e.bJ(t),u_coord_matrix:new e.bJ(t),u_is_text:new e.bN(t),u_elevation_from_sea:new e.bN(t),u_pitch_with_map:new e.bN(t),u_texsize:new e.bK(t),u_texsize_icon:new e.bK(t),u_texture:new e.bN(t),u_texture_icon:new e.bN(t),u_gamma_scale:new e.bM(t),u_device_pixel_ratio:new e.bM(t),u_tile_id:new e.bL(t),u_zoom_transition:new e.bM(t),u_inv_rot_matrix:new e.bJ(t),u_merc_center:new e.bK(t),u_camera_forward:new e.bL(t),u_tile_matrix:new e.bJ(t),u_up_vector:new e.bL(t),u_ecef_origin:new e.bL(t),u_is_halo:new e.bN(t),u_icon_transition:new e.bM(t),u_color_adj_mat:new e.bJ(t),u_scale_factor:new e.bM(t)}),background:t=>({u_matrix:new e.bJ(t),u_emissive_strength:new e.bM(t),u_opacity:new e.bM(t),u_color:new e.cA(t)}),backgroundPattern:t=>({u_matrix:new e.bJ(t),u_emissive_strength:new e.bM(t),u_opacity:new e.bM(t),u_image:new e.bN(t),u_pattern_tl:new e.bK(t),u_pattern_br:new e.bK(t),u_texsize:new e.bK(t),u_pattern_size:new e.bK(t),u_pixel_coord_upper:new e.bK(t),u_pixel_coord_lower:new e.bK(t),u_pattern_units_to_pixels:new e.bK(t)}),terrainRaster:t=>({u_matrix:new e.bJ(t),u_image0:new e.bN(t),u_skirt_height:new e.bM(t),u_ground_shadow_factor:new e.bL(t)}),skybox:t=>({u_matrix:new e.bJ(t),u_sun_direction:new e.bL(t),u_cubemap:new e.bN(t),u_opacity:new e.bM(t),u_temporal_offset:new e.bM(t)}),skyboxGradient:t=>({u_matrix:new e.bJ(t),u_color_ramp:new e.bN(t),u_center_direction:new e.bL(t),u_radius:new e.bM(t),u_opacity:new e.bM(t),u_temporal_offset:new e.bM(t)}),skyboxCapture:t=>({u_matrix_3f:new e.cB(t),u_sun_direction:new e.bL(t),u_sun_intensity:new e.bM(t),u_color_tint_r:new e.cb(t),u_color_tint_m:new e.cb(t),u_luminance:new e.bM(t)}),globeRaster:t=>({u_proj_matrix:new e.bJ(t),u_globe_matrix:new e.bJ(t),u_normalize_matrix:new e.bJ(t),u_merc_matrix:new e.bJ(t),u_zoom_transition:new e.bM(t),u_merc_center:new e.bK(t),u_image0:new e.bN(t),u_grid_matrix:new e.cB(t),u_skirt_height:new e.bM(t),u_far_z_cutoff:new e.bM(t),u_frustum_tl:new e.bL(t),u_frustum_tr:new e.bL(t),u_frustum_br:new e.bL(t),u_frustum_bl:new e.bL(t),u_globe_pos:new e.bL(t),u_globe_radius:new e.bM(t),u_viewport:new e.bK(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.bL(t),u_frustum_tr:new e.bL(t),u_frustum_br:new e.bL(t),u_frustum_bl:new e.bL(t),u_horizon:new e.bM(t),u_transition:new e.bM(t),u_fadeout_range:new e.bM(t),u_color:new e.cb(t),u_high_color:new e.cb(t),u_space_color:new e.cb(t),u_temporal_offset:new e.bM(t),u_horizon_angle:new e.bM(t)}),model:t=>({u_matrix:new e.bJ(t),u_lighting_matrix:new e.bJ(t),u_normal_matrix:new e.bJ(t),u_node_matrix:new e.bJ(t),u_lightpos:new e.bL(t),u_lightintensity:new e.bM(t),u_lightcolor:new e.bL(t),u_camera_pos:new e.bL(t),u_opacity:new e.bM(t),u_baseColorFactor:new e.cb(t),u_emissiveFactor:new e.cb(t),u_metallicFactor:new e.bM(t),u_roughnessFactor:new e.bM(t),u_baseTextureIsAlpha:new e.bN(t),u_alphaMask:new e.bN(t),u_alphaCutoff:new e.bM(t),u_baseColorTexture:new e.bN(t),u_metallicRoughnessTexture:new e.bN(t),u_normalTexture:new e.bN(t),u_occlusionTexture:new e.bN(t),u_emissionTexture:new e.bN(t),u_lutTexture:new e.bN(t),u_color_mix:new e.cb(t),u_aoIntensity:new e.bM(t),u_emissive_strength:new e.bM(t),u_occlusionTextureTransform:new e.cb(t)}),modelDepth:t=>({u_matrix:new e.bJ(t),u_instance:new e.bJ(t),u_node_matrix:new e.bJ(t)}),groundShadow:t=>({u_matrix:new e.bJ(t),u_ground_shadow_factor:new e.bL(t)}),stars:t=>({u_matrix:new e.bJ(t),u_up:new e.bL(t),u_right:new e.bL(t),u_intensity_multiplier:new e.bM(t)}),snowParticle:t=>({u_modelview:new e.bJ(t),u_projection:new e.bJ(t),u_time:new e.bM(t),u_cam_pos:new e.bL(t),u_velocityConeAperture:new e.bM(t),u_velocity:new e.bM(t),u_horizontalOscillationRadius:new e.bM(t),u_horizontalOscillationRate:new e.bM(t),u_boxSize:new e.bM(t),u_billboardSize:new e.bM(t),u_simpleShapeParameters:new e.bK(t),u_screenSize:new e.bK(t),u_thinningCenterPos:new e.bK(t),u_thinningShape:new e.bL(t),u_thinningAffectedRatio:new e.bM(t),u_thinningParticleOffset:new e.bM(t),u_particleColor:new e.cb(t),u_direction:new e.bL(t)}),rainParticle:t=>({u_modelview:new e.bJ(t),u_projection:new e.bJ(t),u_time:new e.bM(t),u_cam_pos:new e.bL(t),u_texScreen:new e.bN(t),u_velocityConeAperture:new e.bM(t),u_velocity:new e.bM(t),u_boxSize:new e.bM(t),u_rainDropletSize:new e.bK(t),u_distortionStrength:new e.bM(t),u_rainDirection:new e.bL(t),u_color:new e.cb(t),u_screenSize:new e.bK(t),u_thinningCenterPos:new e.bK(t),u_thinningShape:new e.bL(t),u_thinningAffectedRatio:new e.bM(t),u_thinningParticleOffset:new e.bM(t),u_shapeDirectionalPower:new e.bM(t),u_shapeNormalPower:new e.bM(t),u_mode:new e.bM(t)}),vignette:t=>({u_vignetteShape:new e.bL(t),u_vignetteColor:new e.cb(t)}),occlusion:t=>({u_matrix:new e.bJ(t),u_anchorPos:new e.bL(t),u_screenSizePx:new e.bK(t),u_occluderSizePx:new e.bK(t),u_color:new e.cb(t)})};class Sr{constructor(e,t,i,o){this.id=Sr.uniqueIdxCounter,Sr.uniqueIdxCounter++,this.context=e;const s=e.gl;this.buffer=s.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||o||t.destroy();}bind(){this.context.bindElementBuffer.set(this.buffer);}updateData(e){this.id=Sr.uniqueIdxCounter,Sr.uniqueIdxCounter++;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);}}Sr.uniqueIdxCounter=0;const Cr={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ir{constructor(e,t,i,o,s,r){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=o,this.instanceCount=r,this.context=e;const n=e.gl;this.buffer=n.createBuffer(),e.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||s||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 i=0;i<this.attributes.length;i++){const o=t.attributes[this.attributes[i].name];void 0!==o&&e.enableVertexAttribArray(o);}}setVertexAttribPointers(e,t,i){for(let o=0;o<this.attributes.length;o++){const s=this.attributes[o],r=t.attributes[s.name];void 0!==r&&e.vertexAttribPointer(r,s.components,e[Cr[s.type]],!1,this.itemSize,s.offset+this.itemSize*(i||0));}}setVertexAttribDivisor(e,t,i){for(let o=0;o<this.attributes.length;o++){const s=t.attributes[this.attributes[o].name];void 0!==s&&this.instanceCount&&this.instanceCount>0&&e.vertexAttribDivisor(s,i);}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer);}}class Rr{constructor(e,t,i,o,s){this.context=e,this.width=t,this.height=i;const r=this.framebuffer=e.gl.createFramebuffer();o&&(this.colorAttachment=new Is(e,r)),s&&(this.depthAttachmentType=s,this.depthAttachment="renderbuffer"===s?new Rs(e,r):new Ds(e,r));}destroy(){const e=this.context.gl;if(this.colorAttachment){const t=this.colorAttachment.get();t&&e.deleteTexture(t);}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t);}else {const t=this.depthAttachment.get();t&&e.deleteTexture(t);}e.deleteFramebuffer(this.framebuffer);}}class Dr{constructor(e,t){this.gl=e,this.clearColor=new Xo(this),this.clearDepth=new Ko(this),this.clearStencil=new Yo(this),this.colorMask=new Jo(this),this.depthMask=new Qo(this),this.stencilMask=new es(this),this.stencilFunc=new ts(this),this.stencilOp=new is(this),this.stencilTest=new os(this),this.depthRange=new ss(this),this.depthTest=new rs(this),this.depthFunc=new ns(this),this.blend=new as(this),this.blendFunc=new ls(this),this.blendColor=new cs(this),this.blendEquation=new hs(this),this.cullFace=new ds(this),this.cullFaceSide=new us(this),this.frontFace=new _s(this),this.program=new ps(this),this.activeTexture=new fs(this),this.viewport=new ms(this),this.bindFramebuffer=new gs(this),this.bindRenderbuffer=new vs(this),this.bindTexture=new ys(this),this.bindVertexBuffer=new xs(this),this.bindElementBuffer=new bs(this),this.bindVertexArrayOES=new ws(this),this.pixelStoreUnpack=new Ts(this),this.pixelStoreUnpackPremultiplyAlpha=new Es(this),this.pixelStoreUnpackFlipY=new Ss(this),this.options=t?Object.assign({},t):{},this.options.extTextureFilterAnisotropicForceOff||(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.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)),this.forceManualRenderingForInstanceIDShaders=t&&!!t.forceManualRenderingForInstanceIDShaders||this.renderer&&-1!==this.renderer.indexOf("PowerVR"),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxPointSize=e.getParameter(e.ALIASED_POINT_SIZE_RANGE)[1];}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.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0;}createIndexBuffer(e,t,i){return new Sr(this,e,t,i)}createVertexBuffer(e,t,i,o,s){return new Ir(this,e,t,i,o,s)}createRenderbuffer(e,t,i){const o=this.gl,s=o.createRenderbuffer();return this.bindRenderbuffer.set(s),o.renderbufferStorage(o.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),s}createFramebuffer(e,t,i,o){return new Rr(this,e,t,i,o)}clear({color:e,depth:t,stencil:i,colorMask:o}){const s=this.gl;let r=0;e&&(r|=s.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set(o||[!0,!0,!0,!0])),void 0!==t&&(r|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==i&&(r|=s.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),s.clear(r);}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(t){e.bn(t.blendFunction,ki.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask);}unbindVAO(){this.bindVertexArrayOES.set(null);}}let Ar;function Lr(t,i,o,s,r,n,a){const l=t.context,c=l.gl,h=t.transform,d=t.getOrCreateProgram("collisionBox"),u=[];let _=0,p=0;for(let l=0;l<s.length;l++){const f=s[l],m=i.getTile(f),g=m.getBucket(o);if(!g)continue;const v=li(f,g,h);let y=v;0===r[0]&&0===r[1]||(y=t.translatePosMatrix(v,m,r,n));const x=a?g.textCollisionBox:g.iconCollisionBox,b=g.collisionCircleArray;if(b.length>0){const t=e.ad.mat4.create(),i=y;e.ad.mat4.mul(t,g.placementInvProjMatrix,h.glCoordMatrix),e.ad.mat4.mul(t,t,g.placementViewportMatrix),u.push({circleArray:b,circleOffset:p,transform:i,invTransform:t,projection:g.getProjection()}),_+=b.length/4,p=_;}x&&(t.terrain&&t.terrain.setupElevationDraw(m,d),d.draw(t,c.LINES,Bi.disabled,Ui.disabled,t.colorModeForRenderPass(),ji.disabled,rr(y,h,m,g.getProjection()),o.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,h.zoom,null,[x.collisionVertexBuffer,x.collisionVertexBufferExt]));}if(!a||!u.length)return;const f=t.getOrCreateProgram("collisionCircle"),m=new e.cW;m.resize(4*_),m._trim();let g=0;for(const e of u)for(let t=0;t<e.circleArray.length/4;t++){const i=4*t,o=e.circleArray[i+0],s=e.circleArray[i+1],r=e.circleArray[i+2],n=e.circleArray[i+3];m.emplace(g++,o,s,r,n,0),m.emplace(g++,o,s,r,n,1),m.emplace(g++,o,s,r,n,2),m.emplace(g++,o,s,r,n,3);}(!Ar||Ar.length<2*_)&&(Ar=function(t){const i=2*t,o=new e.aV;o.resize(i),o._trim();for(let e=0;e<i;e++){const t=6*e;o.uint16[t+0]=4*e+0,o.uint16[t+1]=4*e+1,o.uint16[t+2]=4*e+2,o.uint16[t+3]=4*e+2,o.uint16[t+4]=4*e+3,o.uint16[t+5]=4*e+0;}return o}(_));const v=l.createIndexBuffer(Ar,!0),y=l.createVertexBuffer(m,e.cX.members,!0);for(const i of u){const s={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:(x=h).getCameraToCenterDistance(i.projection),u_viewport_size:[x.width,x.height]};f.draw(t,c.TRIANGLES,Bi.disabled,Ui.disabled,t.colorModeForRenderPass(),ji.disabled,s,o.id,y,v,e.b8.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,h.zoom);}var x;y.destroy(),v.destroy();}const Pr=e.ad.mat4.create();function Mr(t){const i=t._camera.getWorldToCamera(t.worldSize,1),o=e.ad.mat4.multiply([],i,t.globeMatrix);e.ad.mat4.invert(o,o);const s=[0,0,0],r=[0,1,0,0];return e.ad.vec4.transformMat4(r,r,o),s[0]=r[0],s[1]=r[1],s[2]=r[2],e.ad.vec3.normalize(s,s),s}function zr({width:t,height:i,anchor:o,textOffset:s,textScale:r},n){const{horizontalAlign:a,verticalAlign:l}=e.bD(o),c=-(a-.5)*t,h=-(l-.5)*i,d=e.bC(o,s);return new e.P((c/r+d[0])*n,(h/r+d[1])*n)}function Or(t,i,o,s,r,n,a,l,c,h,d){const u=t.text.placedSymbolArray,_=t.text.dynamicLayoutVertexArray,p=t.icon.dynamicLayoutVertexArray,f={},m=t.getProjection(),g=ci(l,m,n),v=n.elevation,y=m.upVectorScale(l.canonical,n.center.lat,n.worldSize).metersToTile;_.clear();for(let p=0;p<u.length;p++){const x=u.get(p),{tileAnchorX:b,tileAnchorY:w,numGlyphs:T}=x,E=x.hidden||!x.crossTileID||t.allowVerticalPlacement&&!x.placedOrientation?null:s[x.crossTileID];if(E){let s=0,u=0,p=0;if(v){const e=v?v.getAtTileOffset(l,b,w):0,[t,i,o]=m.upVector(l.canonical,b,w);s=e*t*y,u=e*i*y,p=e*o*y;}let[S,C,I,R]=Wt(x.projectedAnchorX+s,x.projectedAnchorY+u,x.projectedAnchorZ+p,o?g:a);const D=$t(n.getCameraToCenterDistance(m),R);let A=r.evaluateSizeForFeature(t.textSizeData,h,x)*D/e.bw;o&&(A*=t.tilePixelRatio/c);const L=zr(E,A);o?(({x:S,y:C,z:I}=m.projectTilePoint(b+L.x,w+L.y,l.canonical)),[S,C,I]=Wt(S+s,C+u,I+p,a)):(i&&L._rotate(-n.angle),S+=L.x,C+=L.y,I=0);const P=t.allowVerticalPlacement&&x.placedOrientation===e.bq.vertical?Math.PI/2:0;for(let t=0;t<T;t++)e.bt(_,S,C,I,P);d&&x.associatedIconIndex>=0&&(f[x.associatedIconIndex]={x:S,y:C,z:I,angle:P});}else oi(T,_);}if(d){p.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const o=i.get(t),{numGlyphs:s}=o,r=f[t];if(o.hidden||!r)oi(s,p);else {const{x:t,y:i,z:o,angle:n}=r;for(let r=0;r<s;r++)e.bt(p,t,i,o,n);}}t.icon.dynamicLayoutVertexBuffer.updateData(p);}t.text.dynamicLayoutVertexBuffer.updateData(_);}function Fr(t,i,o,s,r,n,a={}){const l=o.paint.get("icon-translate"),c=o.paint.get("text-translate"),h=o.paint.get("icon-translate-anchor"),d=o.paint.get("text-translate-anchor"),u=o.layout.get("icon-rotation-alignment"),_=o.layout.get("text-rotation-alignment"),p=o.layout.get("icon-pitch-alignment"),f=o.layout.get("text-pitch-alignment"),m=o.layout.get("icon-keep-upright"),g=o.layout.get("text-keep-upright"),v=o.paint.get("icon-color-saturation"),y=o.paint.get("icon-color-contrast"),x=o.paint.get("icon-color-brightness-min"),b=o.paint.get("icon-color-brightness-max"),w="sea"===o.layout.get("symbol-elevation-reference"),T=t.context,E=T.gl,S=t.transform,C="map"===u,I="map"===_,R="map"===p,D="map"===f,A=void 0!==o.layout.get("symbol-sort-key").constantOr(1);let L=!1;const P=t.depthModeForSublayer(0,Bi.ReadOnly),M=[e.av(S.center.lng),e.aC(S.center.lat)],z=o.layout.get("text-variable-anchor"),O="globe"===S.projection.name,F=[],k=[0,-1,0];for(const r of s){const s=i.getTile(r),n=s.getBucket(o);if(!n)continue;if("mercator"===n.projection.name&&O)continue;if(n.fullyClipped)continue;const u="globe"===n.projection.name,_=u?e.ag(S.zoom):0,p=ci(r,n.getProjection(),S),f=S.calculatePixelsToTileUnitsMatrix(s),T=z&&n.hasTextData(),P=n.hasIconTextFit()&&T&&n.hasIconData(),B=n.getProjection().createInversionMatrix(S,r.canonical),N=e=>{S.depthOcclusionForSymbolsAndCircles&&(o.hasInitialOcclusionOpacityProperties||t.terrain)&&(e.push("DEPTH_D24"),e.push("DEPTH_OCCLUSION"));},U=()=>{const i=C&&"point"!==o.layout.get("symbol-placement"),a=[];N(a);const c=i||P,d=o.paint.get("icon-image-cross-fade").constantOr(0);t.terrainRenderModeElevated()&&R&&a.push("PITCH_WITH_MAP_TERRAIN"),u&&(a.push("PROJECTION_GLOBE_VIEW"),c&&a.push("PROJECTED_POS_ON_VIEWPORT")),d>0&&a.push("ICON_TRANSITION"),n.icon.zOffsetVertexBuffer&&a.push("Z_OFFSET"),0===v&&0===y&&0===x&&1===b||a.push("COLOR_ADJUSTMENT"),n.sdfIcons&&a.push("RENDER_SDF");const g=n.icon.programConfigurations.get(o.id),T=t.getOrCreateProgram("symbol",{config:g,defines:a}),I=s.imageAtlasTexture?s.imageAtlasTexture.size:[0,0],D=n.iconSizeData,A=e.bp(D,S.zoom),L=R||0!==S.pitch,z=qt(p,s.tileID.canonical,R,C,S,n.getProjection(),f),F=Zt(p,s.tileID.canonical,R,C,S,n.getProjection(),f),U=t.translatePosMatrix(F,s,l,h,!0),V=t.translatePosMatrix(p,s,l,h),G=c?Pr:z,j=C&&!R&&!i;let q=k;!O&&!S.mercatorFromTransition||C||(q=Mr(S));const H=u?q:k,Z=o.getColorAdjustmentMatrix(v,y,x,b),W=vr(D.kind,A,j,R,t,V,G,U,w,!1,I,[0,0],!0,r,_,M,B,H,n.getProjection(),Z,d),$=s.imageAtlasTexture?s.imageAtlasTexture:null,X=1!==o.layout.get("icon-size").constantOr(0)||n.iconsNeedLinear,K=n.sdfIcons||t.options.rotating||t.options.zooming||X||L?E.LINEAR:E.NEAREST,Y=n.sdfIcons&&0!==o.paint.get("icon-halo-width").constantOr(1),J=t.terrain&&R&&i?e.ad.mat4.invert(e.ad.mat4.create(),z):Pr;if(i&&n.icon){const e=S.elevation,i=e?e.getAtTileOffsetFunc(r,S.center.lat,S.worldSize,n.getProjection()):null,o=Ht(p,s.tileID.canonical,R,C,S,n.getProjection(),f);Kt(n,p,t,!1,o,F,R,m,i,r);}return {program:T,buffers:n.icon,uniformValues:W,atlasTexture:$,atlasTextureIcon:null,atlasInterpolation:K,atlasInterpolationIcon:null,isSDF:n.sdfIcons,hasHalo:Y,tile:s,labelPlaneMatrixInv:J}},V=()=>{const i=I&&"point"!==o.layout.get("symbol-placement"),a=[],l=i||z||P;t.terrainRenderModeElevated()&&D&&a.push("PITCH_WITH_MAP_TERRAIN"),u&&(a.push("PROJECTION_GLOBE_VIEW"),l&&a.push("PROJECTED_POS_ON_VIEWPORT")),n.text.zOffsetVertexBuffer&&a.push("Z_OFFSET"),n.iconsInText&&a.push("RENDER_TEXT_AND_SYMBOL"),a.push("RENDER_SDF"),N(a);const h=n.text.programConfigurations.get(o.id),m=t.getOrCreateProgram("symbol",{config:h,defines:a});let v,y=[0,0],x=null;const b=n.textSizeData;n.iconsInText&&(y=s.imageAtlasTexture?s.imageAtlasTexture.size:[0,0],x=s.imageAtlasTexture?s.imageAtlasTexture:null,v=D||0!==S.pitch||t.options.rotating||t.options.zooming||"composite"===b.kind||"camera"===b.kind?E.LINEAR:E.NEAREST);const T=s.glyphAtlasTexture?s.glyphAtlasTexture.size:[0,0],C=o.layout.get("text-size-scale-range"),R=e.ay(t.scaleFactor,C[0],C[1]),A=e.bp(b,S.zoom,R),L=qt(p,s.tileID.canonical,D,I,S,n.getProjection(),f),F=Zt(p,s.tileID.canonical,D,I,S,n.getProjection(),f),U=t.translatePosMatrix(F,s,c,d,!0),V=t.translatePosMatrix(p,s,c,d),G=l?Pr:L,j=I&&!D&&!i;let q=k;!O&&!S.mercatorFromTransition||I||(q=Mr(S));const H=vr(b.kind,A,j,D,t,V,G,U,w,!0,T,y,!0,r,_,M,B,u?q:k,n.getProjection(),null,null,R),Z=s.glyphAtlasTexture?s.glyphAtlasTexture:null,W=E.LINEAR,$=0!==o.paint.get("text-halo-width").constantOr(1),X=t.terrain&&D&&i?e.ad.mat4.invert(e.ad.mat4.create(),L):Pr;if(i&&n.text){const e=S.elevation,i=e?e.getAtTileOffsetFunc(r,S.center.lat,S.worldSize,n.getProjection()):null,o=Ht(p,s.tileID.canonical,D,I,S,n.getProjection(),f);Kt(n,p,t,!0,o,F,D,g,i,r);}return {program:m,buffers:n.text,uniformValues:H,atlasTexture:Z,atlasTextureIcon:x,atlasInterpolation:W,atlasInterpolationIcon:v,isSDF:!0,hasHalo:$,tile:s,labelPlaneMatrixInv:X}},G=n.icon.segments.get().length,j=n.text.segments.get().length,q=G&&!a.onlyText?U():null,H=j&&!a.onlyIcons?V():null,Z=o.paint.get("icon-opacity").constantOr(1),W=o.paint.get("text-opacity").constantOr(1);if(A&&n.canOverlap){L=!0;const t=Z&&!a.onlyText?n.icon.segments.get():[],i=W&&!a.onlyIcons?n.text.segments.get():[];for(const i of t)F.push({segments:new e.b8([i]),sortKey:i.sortKey,state:q});for(const t of i)F.push({segments:new e.b8([t]),sortKey:t.sortKey,state:H});}else a.onlyText||F.push({segments:Z?n.icon.segments:new e.b8([]),sortKey:0,state:q}),a.onlyIcons||F.push({segments:W?n.text.segments:new e.b8([]),sortKey:0,state:H});}L&&F.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of F){const i=e.state;if(i)if(t.terrain?t.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:S.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:i.labelPlaneMatrixInv}):t.setupDepthForOcclusion(S.depthOcclusionForSymbolsAndCircles,i.program),T.activeTexture.set(E.TEXTURE0),i.atlasTexture&&i.atlasTexture.bind(i.atlasInterpolation,E.CLAMP_TO_EDGE,!0),i.atlasTextureIcon&&(T.activeTexture.set(E.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,E.CLAMP_TO_EDGE,!0)),t.uploadCommonLightUniforms(t.context,i.program),i.hasHalo){const s=i.uniformValues;s.u_is_halo=1,kr(i.buffers,e.segments,o,t,i.program,P,r,n,s,2),s.u_is_halo=0;}else {if(i.isSDF){const s=i.uniformValues;i.hasHalo&&(s.u_is_halo=1,kr(i.buffers,e.segments,o,t,i.program,P,r,n,s,1)),s.u_is_halo=0;}kr(i.buffers,e.segments,o,t,i.program,P,r,n,i.uniformValues,1);}}}function kr(e,t,i,o,s,r,n,a,l,c){const h=[e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer,e.iconTransitioningVertexBuffer,e.globeExtVertexBuffer,e.zOffsetVertexBuffer];s.draw(o,o.context.gl.TRIANGLES,r,n,a,ji.disabled,l,i.id,e.layoutVertexBuffer,e.indexBuffer,t,i.paint,o.transform.zoom,e.programConfigurations.get(i.id),h,c);}function Br(t,i){const o=1<<t.canonical.z,s=(i.x*o-t.canonical.x-t.wrap*o)*e.ai,r=(i.y*o-t.canonical.y)*e.ai,n=e.d5(i.z,i.y);return e.ad.vec3.fromValues(s,r,n)}function Nr(t,i,o,s,r){if(!o.layout||"none"===o.layout.get("fill-elevation-reference"))return;const n=t.context.gl,a=new Bi(t.context.gl.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D),l=new Bi(t.context.gl.GREATER,Bi.ReadWrite,t.depthRangeFor3D),c=function(t){const i=e.c4(t.pitch);let o=.01;return t.isOrthographic&&(o=e.ah(1e-4,o,e.c9(i>=Yi?1:i/Yi))),2*o}(t.transform),h=t.transform.getFreeCameraOptions().position,d="elevatedStructuresDepthReconstruct",u=t.getOrCreateProgram(d,{defines:["DEPTH_RECONSTRUCTION"]}),_=t.getOrCreateProgram(d);for(const e of s){const s=i.getTile(e),d=s.getBucket(o);if(!d)continue;const p=d.elevatedStructures;if(!p)continue;const f=d.elevationBufferData.heightRange,m=Br(e.toUnwrapped(),h),g=t.translatePosMatrix(e.projMatrix,s,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));let v,y,x,b;if("initialize"===r){if(!f||f.min>=1||0===p.depthSegments.segments[0].primitiveLength)continue;v=sr(g,m,c,1,0),y=a,x=p.depthSegments,b=u;}else if("reset"===r){if(!f||f.min>=0||0===p.maskSegments.segments[0].primitiveLength)continue;v=sr(g,m,0,0,1),y=l,x=p.maskSegments,b=u;}else if("geometry"===r){if(0===p.depthSegments.segments[0].primitiveLength)continue;v=sr(g,m,c,1,0),y=a,x=p.depthSegments,b=_;}b.draw(t,n.TRIANGLES,y,Ui.disabled,ki.disabled,ji.disabled,v,o.id,p.vertexBuffer,p.indexBuffer,x,o.paint,t.transform.zoom);}}function Ur(t,i,o){const{painter:s,sourceCache:r,layer:n,coords:a,colorMode:l,elevationType:c,terrainEnabled:h,pass:d}=t,u=s.context.gl,_=n.paint.get("fill-pattern");let p=c;"road"!==c||i&&!h||(p="none");const f="road"===p,m=new Bi(s.context.gl.LEQUAL,Bi.ReadWrite,s.depthRangeFor3D),g=_&&_.constantOr(1),v=(t,c)=>{let h,d,v,y,x;c?(d=g&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=u.LINES):(d=g?"fillPattern":"fill",h=u.TRIANGLES);for(const b of a){const a=r.getTile(b);if(g&&!a.patternsLoaded())continue;const w=a.getBucket(n);if(!w)continue;const T=i?w.elevationBufferData:w.bufferData;if(T.isEmpty())continue;s.prepareDrawTile();const E=T.programConfigurations.get(n.id),S=s.isTileAffectedByFog(b),C=[],I=[];f&&(C.push("ELEVATED_ROADS"),I.push(T.elevatedLayoutVertexBuffer));const R=s.getOrCreateProgram(d,{config:E,overrideFog:S,defines:C});g&&(s.context.activeTexture.set(u.TEXTURE0),a.imageAtlasTexture&&a.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),E.updatePaintBuffers());const D=_.constantOr(null);if(D&&a.imageAtlas){const t=a.imageAtlas,i=e.d0.from(D).getPrimary().scaleSelf(e.q.devicePixelRatio).toString(),o=t.patternPositions.get(i);o&&E.setConstantPatternPositions(o);}const A=s.translatePosMatrix(b.projMatrix,a,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor")),L=n.paint.get("fill-emissive-strength");if(c){y=T.lineIndexBuffer,x=T.lineSegments;const e=s.terrain&&s.terrain.renderingToTexture?s.terrain.drapeBufferSize:[u.drawingBufferWidth,u.drawingBufferHeight];v="fillOutlinePattern"===d&&g?or(A,L,s,a,e):ir(A,L,e);}else y=T.indexBuffer,x=T.triangleSegments,v=g?tr(A,L,s,a):er(A,L);s.uploadCommonUniforms(s.context,R,b.toUnwrapped()),R.draw(s,h,"none"!==p?m:t,o||s.stencilModeForClipping(b),l,ji.disabled,v,n.id,T.layoutVertexBuffer,y,x,n.paint,s.transform.zoom,E,I);}};s.renderPass===d&&v(s.depthModeForSublayer(1,"opaque"===s.renderPass?Bi.ReadWrite:Bi.ReadOnly),!1),"none"===p&&"translucent"===s.renderPass&&n.paint.get("fill-antialias")&&v(s.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Bi.ReadOnly),!0);}function Vr(t,i,o,s,r,n,a,l){o.resetLayerRenderingStats(t);const c=t.context,h=c.gl,d=t.transform,u=o.paint.get("fill-extrusion-pattern"),_=u.constantOr(1),p=o.paint.get("fill-extrusion-opacity"),f=t.style.enable3dLights(),m=o.paint.get(f&&!_?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),g=[o.paint.get("fill-extrusion-ambient-occlusion-intensity"),m],v=o.layout.get("fill-extrusion-edge-radius"),y=v>0&&!o.paint.get("fill-extrusion-rounded-roof"),x=y?0:v,b="globe"===d.projection.name?e.d6():0,w="globe"===d.projection.name,T=w?e.ag(d.zoom):0,E=[e.av(d.center.lng),e.aC(d.center.lat)],S="none"===o.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),C=o.paint.get("fill-extrusion-flood-light-color").toRenderColor(S?null:o.lut).toArray01().slice(0,3),I=o.paint.get("fill-extrusion-flood-light-intensity"),R=o.paint.get("fill-extrusion-vertical-scale"),D=0!==o.paint.get("fill-extrusion-line-width").constantOr(1),A=o.paint.get("fill-extrusion-height-alignment"),L=o.paint.get("fill-extrusion-base-alignment"),P=Qi(t,o.paint.get("fill-extrusion-cutoff-fade-range")),M=[];let z;w&&M.push("PROJECTION_GLOBE_VIEW"),g[0]>0&&M.push("FAUX_AO"),y&&M.push("ZERO_ROOF_RADIUS"),l&&M.push("HAS_CENTROID"),I>0&&M.push("FLOOD_LIGHT"),P.shouldRenderCutoff&&M.push("RENDER_CUTOFF"),D&&M.push("RENDER_WALL_MODE");const O="shadow"===t.renderPass,F=t.shadowRenderer,k=O&&!!F;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let B=[0,0,0];if(F){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(B=no(t.style,e,i)),O||(M.push("RENDER_SHADOWS","DEPTH_TEXTURE"),F.useNormalOffset&&M.push("NORMAL_OFFSET")),z=M.concat(["SHADOWS_SINGLE_CASCADE"]);}const N=k?"fillExtrusionDepth":_?"fillExtrusionPattern":"fillExtrusion",U=o.getLayerRenderingStats();for(const f of s){const s=i.getTile(f),m=s.getBucket(o);if(!m||m.projection.name!==d.projection.name)continue;let v=!1;F&&(v=0===F.getMaxCascadeForTile(f.toUnwrapped()));const y=t.isTileAffectedByFog(f),S=m.programConfigurations.get(o.id),k=t.getOrCreateProgram(N,{config:S,defines:v?z:M,overrideFog:y});if(t.terrain&&t.terrain.setupElevationDraw(s,k,{useMeterToDem:!0}),!m.centroidVertexBuffer){const e=k.attributes.a_centroid_pos;void 0!==e&&h.vertexAttrib2f(e,0,0);}!O&&F&&F.setupShadows(s.tileID.toUnwrapped(),k,"vector-tile",s.tileID.overscaledZ),_&&(t.context.activeTexture.set(h.TEXTURE0),s.imageAtlasTexture&&s.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),S.updatePaintBuffers());const V=u.constantOr(null);if(V&&s.imageAtlas){const t=s.imageAtlas,i=e.d0.from(V).getPrimary().scaleSelf(e.q.devicePixelRatio),o=t.patternPositions.get(i.toString());o&&S.setConstantPatternPositions(o);}const G=o.paint.get("fill-extrusion-vertical-gradient"),j=1/m.tileToMeter;let q;if(O&&F){if(Wr(s.tileID,m,t))continue;const e=F.calculateShadowPassMatrixFromTile(s.tileID.toUnwrapped());q=Js(e,x,j,R,A,L);}else {const e=t.translatePosMatrix(f.expandedProjMatrix,s,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),i=d.projection.createInversionMatrix(d,f.canonical);q=_?Qs(e,t,G,p,g,x,j,f,s,b,A,L,T,E,i,C,R):Ys(e,t,G,p,g,x,j,f,b,A,L,T,E,i,C,R,I,B);}t.uploadCommonUniforms(c,k,f.toUnwrapped(),null,P);let H=m.segments;if("mercator"===d.projection.name&&!O&&(H=m.getVisibleSegments(s.tileID,t.terrain,t.transform.getFrustum(0)),!H.get().length))continue;if(U)if(O)for(const e of H.get())U.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(const e of H.get())U.numRenderedVerticesInTransparentPass+=e.primitiveLength;const Z=[];(t.terrain||l)&&Z.push(m.centroidVertexBuffer),w&&Z.push(m.layoutVertexExtBuffer),D&&Z.push(m.wallVertexBuffer),k.draw(t,c.gl.TRIANGLES,r,n,a,ji.backCCW,q,o.id,m.layoutVertexBuffer,m.indexBuffer,H,o.paint,t.transform.zoom,S,Z);}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1);}function Gr(t,i,o,s,r,n,a,l,c,h,d,u,_,p,f,m,g,v,y){const x=t.context,b=x.gl,w=t.transform,T=t.transform.zoom,E=[],S=Qi(t,o.paint.get("fill-extrusion-cutoff-fade-range"));"clear"===h?(E.push("CLEAR_SUBPASS"),y&&(E.push("CLEAR_FROM_TEXTURE"),x.activeTexture.set(b.TEXTURE0),y.bind(b.LINEAR,b.CLAMP_TO_EDGE))):"sdf"===h&&E.push("SDF_SUBPASS"),g&&E.push("HAS_CENTROID"),S.shouldRenderCutoff&&E.push("RENDER_CUTOFF");const C=o.layout.get("fill-extrusion-edge-radius"),I=(e,i,s,h,v)=>{const b=i.programConfigurations.get(o.id),w=t.isTileAffectedByFog(e),I=t.getOrCreateProgram("fillExtrusionGroundEffect",{config:b,defines:E,overrideFog:w}),R=((e,t,i,o,s,r,n,a,l,c,h)=>({u_matrix:t,u_opacity:i,u_ao_pass:o?1:0,u_meter_to_tile:s,u_ao:r,u_flood_light_intensity:n,u_flood_light_color:a,u_attenuation:l,u_edge_radius:c,u_fb:0,u_fb_size:h,u_dynamic_offset:1}))(0,h,d,c,v,[u,_*v],p,f,m,T>=17?0:C*v,y?y.size[0]:0),D=[];g&&D.push(i.hiddenByLandmarkVertexBuffer),t.uploadCommonUniforms(x,I,e.toUnwrapped(),null,S),I.draw(t,x.gl.TRIANGLES,r,n,a,l,R,o.id,i.vertexBuffer,i.indexBuffer,s,o.paint,T,b,D);};for(const r of s){const s=i.getTile(r),n=s.getBucket(o);if(!n||n.projection.name!==w.projection.name||!n.groundEffect||n.groundEffect&&!n.groundEffect.hasData())continue;const a=n.groundEffect,l=1/n.tileToMeter;{const e=t.translatePosMatrix(r.projMatrix,s,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),i=a.getDefaultSegment();I(r,a,i,e,l);}if(v)for(let n=0;n<4;n++){const a=e.d7[n](r),c=i.getTile(a);if(!c)continue;const h=c.getBucket(o);if(!h||h.projection.name!==w.projection.name||!h.groundEffect||h.groundEffect&&!h.groundEffect.hasData())continue;const d=h.groundEffect;let u,_;0===n?(u=[-e.ai,0,0],_=1):1===n?(u=[e.ai,0,0],_=0):2===n?(u=[0,-e.ai,0],_=3):(u=[0,e.ai,0],_=2);const p=d.regionSegments[_];if(!p)continue;const f=new Float32Array(16);e.ad.mat4.translate(f,r.projMatrix,u),I(r,d,p,t.translatePosMatrix(f,s,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),l);}}}function jr(t,i,o,s,r,n,a){0===s.centroidVertexArray.length&&s.createCentroidsBuffer();const l=n?n.findDEMTileFor(o):null;if(!(l&&l.dem||a))return;n&&l&&l.dem&&s.selfDEMTileTimestamp!==l.dem._timestamp&&(s.borderDoneWithNeighborZ=[-1,-1,-1,-1],s.selfDEMTileTimestamp=l.dem._timestamp);const c=t=>new e.P(Math.ceil((t+e.da)*e.db),0),h=e=>{const t=i.getSource().minzoom,o=e=>{const t=i.getTileByID(e);if(t&&t.hasData())return t.getBucket(r)},s=[0,-1,1];for(const i of s){if(e.overscaledZ+i<t)continue;const s=o(e.calculateScaledKey(e.overscaledZ+i));if(s)return s}},d=[0,0,0],u=(t,i)=>(d[0]=Math.min(t.min.y,i.min.y),d[1]=Math.max(t.max.y,i.max.y),d[2]=e.ai-i.min.x>t.max.x?i.min.x-e.ai:t.max.x,d),_=(t,i)=>(d[0]=Math.min(t.min.x,i.min.x),d[1]=Math.max(t.max.x,i.max.x),d[2]=e.ai-i.min.y>t.max.y?i.min.y-e.ai:t.max.y,d),p=[(e,t)=>u(e,t),(e,t)=>u(t,e),(e,t)=>_(e,t),(e,t)=>_(t,e)],f=(t,i,s,r,a,c,h)=>{if(!n)return 0;const d=[[c?s:t,c?t:s,0],[c?s:i,c?i:s,0]],u=h<0?e.ai+h:h,_=[c?u:(t+i)/2,c?(t+i)/2:u,0];return 0===s&&h<0||0!==s&&h>0?n.getForTilePoints(a,[_],!0,r):d.push(_),n.getForTilePoints(o,d,!0,l),Math.max(d[0][2],d[1][2],_[2])/n.exaggeration()};for(let t=0;t<4;t++){const i=s.borderFeatureIndices[t];if(0===i.length)continue;const r=e.d7[t](o),l=h(r);if(!(l&&l instanceof e.d8))continue;const d=n?n.findDEMTileFor(r):null;if(!(d&&d.dem||a))continue;if(n&&d&&d.dem&&s.borderDEMTileTimestamp[t]!==d.dem._timestamp&&(s.borderDoneWithNeighborZ[t]=-1,s.borderDEMTileTimestamp[t]=d.dem._timestamp),s.borderDoneWithNeighborZ[t]===l.canonical.z)continue;0===l.centroidVertexArray.length&&l.createCentroidsBuffer();const u=(t<2?1:5)-t,_=l.borderDoneWithNeighborZ[u]!==s.canonical.z,v=l.borderFeatureIndices[u];let y=0;if(s.canonical.z!==l.canonical.z){for(const e of i)s.showCentroid(s.featuresOnBorder[e]);if(_)for(const e of v)l.showCentroid(l.featuresOnBorder[e]);s.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[u]=s.canonical.z;}for(const o of i){const i=s.featuresOnBorder[o],n=s.centroidData[i.centroidDataIndex],h=i.borders[t];let _;for(;y<v.length;){_=l.featuresOnBorder[v[y]];const e=_.borders[u];if(e[1]>h[0]+3||e[0]>h[0]-3)break;l.showCentroid(_),y++;}if(_&&y<v.length){const o=y;let x=0;for(;!(_.borders[u][0]>h[1]-3)&&(x++,++y!==v.length);)_=l.featuresOnBorder[v[y]];_=l.featuresOnBorder[v[o]];let b=!1;if(x>=1){const e=_.borders[u];Math.abs(h[0]-e[0])<3&&Math.abs(h[1]-e[1])<3&&(x=1,b=!0,y=o+1);}else if(0===x){s.showCentroid(i);continue}const w=l.centroidData[_.centroidDataIndex];a&&b&&(((m=n).flags|(g=w).flags)&e.d9?(m.flags|=e.d9,g.flags|=e.d9):(m.flags&=~e.d9,g.flags&=~e.d9));const T=i.intersectsCount()>1||_.intersectsCount()>1;if(x>1)y=o,n.centroidXY=w.centroidXY=new e.P(0,0);else if(d&&d.dem&&!T){const i=p[t](n,w),o=t%2?e.ai-1:0,s=f(i[0],Math.min(e.ai-1,i[1]),o,d,r,t<2,i[2]);n.centroidXY=w.centroidXY=c(s);}else T?n.centroidXY=w.centroidXY=new e.P(0,0):(n.centroidXY=s.encodeBorderCentroid(i),w.centroidXY=l.encodeBorderCentroid(_));s.writeCentroidToBuffer(n),l.writeCentroidToBuffer(w);}else s.showCentroid(i);}s.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[u]=s.canonical.z;}var m,g;(s.needsCentroidUpdate||!s.centroidVertexBuffer&&0!==s.centroidVertexArray.length)&&s.uploadCentroid(t);}const qr=[1,0,0],Hr=[0,1,0],Zr=[0,0,1];function Wr(t,i,o){const s=o.transform,r=o.shadowRenderer;if(!r)return !0;const n=t.toUnwrapped(),a=s.tileSize*r._cascades[o.currentShadowCascade].scale;let l=i.maxHeight;if(s.elevation){const e=s.elevation.getMinMaxForTile(t);e&&(l+=e.max);}const c=[...r.shadowDirection];c[2]=-c[2];const h=r.computeSimplifiedTileShadowVolume(n,l,a,c);if(!h)return !1;const d=[qr,Hr,Zr,c,[c[0],0,c[2]],[0,c[1],c[2]]],u="globe"===s.projection.name,_=s.scaleZoom(a),p=e.bR.fromInvProjectionMatrix(s.invProjMatrix,s.worldSize,_,!u),f=r.getCurrentCascadeFrustum();return 0===p.intersectsPrecise(h.vertices,h.planes,d)||0===f.intersectsPrecise(h.vertices,h.planes,d)}function $r(t){return [t[0]*e.dc,t[1]*e.dc,t[2]*e.dc,0]}function Xr(t,i,o,s,r,n,a,l,c){const h=s.getSource(),d=o.globeSharedBuffers;if(!d)return;let u,_,p;if(i&&(u=s.getTile(i)),h instanceof e.aK?(_=h.texture,p=e.cJ(0,0,o.transform)):u&&i&&(_=u.texture,p=e.cJ(i.canonical.z,i.canonical.x,o.transform)),!_||!p)return;t||(p=e.ad.mat4.scale(e.ad.mat4.create(),p,[1,-1,1]));const f=o.context,m=f.gl,g="nearest"===r.paint.get("raster-resampling")?m.NEAREST:m.LINEAR,v=o.colorModeForDrapableLayerRenderPass(n),y=a.defines;y.push("GLOBE_POLES");const x=new Bi(m.LEQUAL,Bi.ReadWrite,o.depthRangeFor3D),b=Float32Array.from(o.transform.expandedFarZProjMatrix),w=Float32Array.from(e.bc(e.cI(new e.bT(0,0,0))));o.terrain&&o.terrain.prepareDrawTile(),f.activeTexture.set(m.TEXTURE0),_.bind(g,m.CLAMP_TO_EDGE),f.activeTexture.set(m.TEXTURE1),_.bind(g,m.CLAMP_TO_EDGE),"useMipmap"in _&&f.extTextureFilterAnisotropic&&o.transform.pitch>20&&m.texParameterf(m.TEXTURE_2D,f.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,f.extTextureFilterAnisotropicMax);const[T,E,S,C]=i?d.getPoleBuffers(i.canonical.z,!1):d.getPoleBuffers(0,!0),I=r.paint.get("raster-elevation");let R;t?(R=T,o.renderDefaultNorthPole=0!==I):(R=E,o.renderDefaultSouthPole=0!==I);const D=$r(a.mix),A=((e,t,i,o,s,r,n,a,l,c,h,d,u)=>dr(e,t,i,new Float32Array(16),new Float32Array(9),[0,0],o,[0,0],[0,0,0,0],1,{opacity:1,mix:0},r,[0,0]||[0,0],a,2,c,h,d,1,0,u))(b,w,p,e.ag(o.transform.zoom),0,r,0,I,0,D,a.offset,a.range,n),L=o.getOrCreateProgram("raster",{defines:y});o.uploadCommonUniforms(f,L,null),L.draw(o,m.TRIANGLES,x,c,v,l,A,r.id,R,S,C);}function Kr(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),o=i-t,s=.2*e.height,r=t+s;return [t,i,(r-s-t)/o,(r-t)/o]}function Yr(e,t,i,o){if(e)return t instanceof ot&&e instanceof wt?t.getTextureDescriptor(e,i,!0):{texture:e.texture,mix:$r(o.mix),offset:o.offset,buffer:0,tileSize:1}}var Jr=e.dd([{name:"a_index",type:"Int16",components:1}]);class Qr{constructor(t,i,o,s){const r={width:o[0],height:o[1],data:null},n=t.gl;this.targetColorTexture=new e.T(t,r,n.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new e.T(t,r,n.RGBA8,{useMipmap:!1}),this.context=t,this.updateParticleTexture(i,s),this.lastInvalidatedAt=0;}updateParticleTexture(t,i){if(this.particleTextureDimension===i.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const o=this.context.gl,s=i.width*i.height;this.particleTexture0=new e.T(this.context,i,o.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,i,o.RGBA8,{premultiply:!1,useMipmap:!1});const r=new e.de;r.reserve(s);for(let e=0;e<s;e++)r.emplaceBack(e);this.particleIndexBuffer=this.context.createVertexBuffer(r,Jr.members,!0),this.particleSegment=e.b8.simpleSegment(0,0,this.particleIndexBuffer.length,0),this.particleTextureDimension=i.width;}update(t){return !(this.lastInvalidatedAt<t&&(this.lastInvalidatedAt=e.q.now(),1))}destroy(){this.targetColorTexture.destroy(),this.backgroundColorTexture.destroy(),this.particleIndexBuffer.destroy(),this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleSegment.destroy();}}function en(t,i,o){if(!t)return null;const s=i.getTextureDescriptor(t,o,!0);if(!s)return null;let{texture:r,mix:n,offset:a,tileSize:l,buffer:c,format:h}=s;if(!r||!h)return null;let d=!1;return "uint32"===h&&(d=!0,n[3]=0,n=cr(e.df,n,[0,o.paint.get("raster-particle-max-speed")]),a=hr(e.df,a,[0,o.paint.get("raster-particle-max-speed")])),{texture:r,textureOffset:[c/(l+2*c),l/(l+2*c)],tileSize:l,scalarData:d,scale:n,offset:a,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[h]]}}function tn(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),o=i-t,s=.2*e.height,r=t+s;return [t,i,(r-s-t)/o,(r-t)/o]}const on=new e.al(1,0,0,1),sn=new e.al(0,1,0,1),rn=new e.al(0,0,1,1),nn=new e.al(1,0,1,1),an=new e.al(0,1,1,1);function ln(t,i,o,s,r,n,a){const l=t.context,c=t.transform,h=l.gl,d="globe"===c.projection.name,u=d?["PROJECTION_GLOBE_VIEW"]:[];let _=e.ad.mat4.clone(o.projMatrix);if(d&&e.ag(c.zoom)>0){const t=e.bb(o.canonical,c),i=e.dg(t);_=e.ad.mat4.multiply(new Float32Array(16),c.globeMatrix,i),e.ad.mat4.multiply(_,c.projMatrix,_);}const p=e.ad.mat4.create();p[12]+=2*r/(e.q.devicePixelRatio*c.width),p[13]+=2*n/(e.q.devicePixelRatio*c.height),e.ad.mat4.multiply(_,p,_);const f=t.getOrCreateProgram("debug",{defines:u}),m=i.getTileByID(o.key);t.terrain&&t.terrain.setupElevationDraw(m,f);const g=Bi.disabled,v=Ui.disabled,y=t.colorModeForRenderPass(),x="$debug";l.activeTexture.set(h.TEXTURE0),t.emptyTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),d?m._makeGlobeTileDebugBuffers(t.context,c):m._makeDebugTileBoundsBuffers(t.context,c.projection);const b=m._tileDebugBuffer||t.debugBuffer,w=m._tileDebugIndexBuffer||t.debugIndexBuffer,T=m._tileDebugSegments||t.debugSegments;if(f.draw(t,h.LINE_STRIP,g,v,y,ji.disabled,nr(_,s),x,b,w,T,null,null,null,[m._globeTileDebugBorderBuffer]),a){const e=m.latestRawTileData,i=Math.floor((e&&e.byteLength||0)/1024);let s=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(s+=` => ${o.overscaledZ}`),s+=` ${m.state}`,s+=` ${i}kb`,function(e,t){e.initDebugOverlayCanvas();const i=e.debugOverlayCanvas,o=e.context.gl,s=e.debugOverlayCanvas.getContext("2d");s.clearRect(0,0,i.width,i.height),s.shadowColor="white",s.shadowBlur=2,s.lineWidth=1.5,s.strokeStyle="white",s.textBaseline="top",s.font="bold 36px Open Sans, sans-serif",s.fillText(t,5,5),s.strokeText(t,5,5),e.debugOverlayTexture.update(i),e.debugOverlayTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE);}(t,s);}const E=i.getTile(o).tileSize,S=512/Math.min(E,512)*(o.overscaledZ/c.zoom)*.5,C=m._tileDebugTextBuffer||t.debugBuffer,I=m._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,R=m._tileDebugTextSegments||t.debugSegments;f.draw(t,h.TRIANGLES,g,v,ki.alphaBlended,ji.disabled,nr(_,e.al.transparent,S),x,C,I,R,null,null,null,[m._globeTileDebugTextBuffer]);}function cn(e,t,i,o){dn(e,0,t+i/2,e.transform.width,i,o);}function hn(e,t,i,o){dn(e,t-i/2,0,i,e.transform.height,o);}function dn(t,i,o,s,r,n){const a=t.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*e.q.devicePixelRatio,o*e.q.devicePixelRatio,s*e.q.devicePixelRatio,r*e.q.devicePixelRatio),a.clear({color:n}),l.disable(l.SCISSOR_TEST);}const un=e.dd([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:_n}=un;function pn(e,t,i,o){e.emplaceBack(t,i,o);}class fn{constructor(t){this.vertexArray=new e.dh,this.indices=new e.aV,pn(this.vertexArray,-1,-1,1),pn(this.vertexArray,1,-1,1),pn(this.vertexArray,-1,1,1),pn(this.vertexArray,1,1,1),pn(this.vertexArray,-1,-1,-1),pn(this.vertexArray,1,-1,-1),pn(this.vertexArray,-1,1,-1),pn(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,_n),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.b8.simpleSegment(0,0,36,12);}}function mn(t,i,o,s,r,n){const a=t.context.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),h=i.paint.get("sky-atmosphere-sun-intensity"),d=((e,t,i,o,s)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:i,u_color_tint_r:[o.r,o.g,o.b,o.a],u_color_tint_m:[s.r,s.g,s.b,s.a],u_luminance:5e-5}))(e.ad.mat3.fromMat4(e.ad.mat3.create(),s),r,h,l,c);a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+n,i.skyboxTexture,0),o.draw(t,a.TRIANGLES,Bi.disabled,Ui.disabled,ki.unblended,ji.frontCW,d,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment);}const gn=e.dd([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class vn{constructor(t){const i=new e.di;i.emplaceBack(-1,1,1,0,0),i.emplaceBack(1,1,1,1,0),i.emplaceBack(1,-1,1,1,1),i.emplaceBack(-1,-1,1,0,1);const o=new e.aV;o.emplaceBack(0,1,2),o.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(i,gn.members),this.indexBuffer=t.createIndexBuffer(o),this.segments=e.b8.simpleSegment(0,0,4,2);}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy();}}const yn=e.dd([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class xn{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200;}}class bn{constructor(t){this.colorModeAlphaBlendedWriteRGB=new ki([1,Fi,1,Fi],e.al.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new ki([1,0,1,0],e.al.transparent,[!1,!1,!1,!0]),this.params=new xn,this.updateNeeded=!0,t.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},(()=>{this.updateNeeded=!0;})),t.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),t.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},(()=>{this.updateNeeded=!0;})),t.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},(()=>{this.updateNeeded=!0;}));}update(t){const i=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new vn(i);const t=this.params.sizeRange,o=this.params.intensityRange,s=function(t){const i=e.dl(30),o=[];for(let s=0;s<t;++s){const t=2*Math.PI*i(),s=Math.acos(1-2*i())-.5*Math.PI;o.push(e.ad.vec3.fromValues(Math.cos(s)*Math.cos(t),Math.cos(s)*Math.sin(t),Math.sin(s)));}return o}(this.params.starsCount),r=e.dl(300),n=new e.dj,a=new e.aV;let l=0;for(let i=0;i<s.length;++i){const c=e.ad.vec3.scale([],s[i],200),h=Math.max(0,1+.01*t*(1*r()-.5)),d=Math.max(0,1+.01*o*(1*r()-.5));n.emplaceBack(c[0],c[1],c[2],-1,-1,h,d),n.emplaceBack(c[0],c[1],c[2],1,-1,h,d),n.emplaceBack(c[0],c[1],c[2],1,1,h,d),n.emplaceBack(c[0],c[1],c[2],-1,1,h,d),a.emplaceBack(l+0,l+1,l+2),a.emplaceBack(l+0,l+2,l+3),l+=4;}this.starsVx=i.createVertexBuffer(n,yn.members),this.starsIdx=i.createIndexBuffer(a),this.starsSegments=e.b8.simpleSegment(0,0,n.length,a.length);}}destroy(){this.atmosphereBuffer&&this.atmosphereBuffer.destroy(),this.starsVx&&this.starsVx.destroy(),this.starsIdx&&this.starsIdx.destroy();}drawAtmosphereGlow(t,i){const o=t.context,s=o.gl,r=t.transform,n=new Bi(s.LEQUAL,Bi.ReadOnly,[0,1]),a=e.ag(r.zoom),l=t.style.getLut(i.scope),c="none"===i.properties.get("color-use-theme"),h=i.properties.get("color").toRenderColor(c?null:l).toArray01(),d="none"===i.properties.get("high-color-use-theme"),u=i.properties.get("high-color").toRenderColor(d?null:l).toArray01(),_="none"===i.properties.get("space-color-use-theme"),p=i.properties.get("space-color").toRenderColor(_?null:l).toArray01PremultipliedAlpha(),f=5e-4,m=e.dk(i.properties.get("horizon-blend"),0,1,f,.25),g=e.cD(t,o,r)&&m===f?r.worldSize/(2*Math.PI*1.025)-1:r.globeRadius,v=t.frameCounter/1e3%1,y=e.ad.vec3.length(r.globeCenterInViewSpace),x=Math.sqrt(Math.pow(y,2)-Math.pow(g,2)),b=Math.acos(x/y),w=e=>{const i="globe"===r.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];e&&i.push("ALPHA_PASS");const l=t.getOrCreateProgram("globeAtmosphere",{defines:i}),c=((e,t,i,o,s,r,n,a,l,c,h,d)=>({u_frustum_tl:e,u_frustum_tr:t,u_frustum_br:i,u_frustum_bl:o,u_horizon:s,u_transition:r,u_fadeout_range:n,u_color:a,u_high_color:l,u_space_color:c,u_temporal_offset:h,u_horizon_angle:d}))(r.frustumCorners.TL,r.frustumCorners.TR,r.frustumCorners.BR,r.frustumCorners.BL,r.frustumCorners.horizon,a,m,h,u,p,v,b);t.uploadCommonUniforms(o,l);const d=this.atmosphereBuffer;d&&l.draw(t,s.TRIANGLES,n,Ui.disabled,e?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,ji.backCW,c,e?"atmosphere_glow_alpha":"atmosphere_glow",d.vertexBuffer,d.indexBuffer,d.segments);};w(!1),w(!0);}drawStars(t,i){const o=e.ay(i.properties.get("star-intensity"),0,1);if(0===o)return;const s=t.context,r=s.gl,n=t.transform,a=t.getOrCreateProgram("stars"),l=e.ad.quat.identity([]);e.ad.quat.rotateX(l,l,-n._pitch),e.ad.quat.rotateZ(l,l,-n.angle),e.ad.quat.rotateX(l,l,e.ak(n._center.lat)),e.ad.quat.rotateY(l,l,-e.ak(n._center.lng));const c=e.ad.mat4.fromQuat(new Float32Array(16),l),h=e.ad.mat4.multiply([],n.starsProjMatrix,c),d=e.ad.mat3.fromMat4([],c),u=e.ad.mat3.invert([],d),_=[0,1,0];e.ad.vec3.transformMat3(_,_,u),e.ad.vec3.scale(_,_,this.params.sizeMultiplier);const p=[1,0,0];e.ad.vec3.transformMat3(p,p,u),e.ad.vec3.scale(p,p,this.params.sizeMultiplier);const f=(m=_,g=p,v=o,{u_matrix:Float32Array.from(h),u_up:m,u_right:g,u_intensity_multiplier:v});var m,g,v;t.uploadCommonUniforms(s,a),this.starsVx&&this.starsIdx&&a.draw(t,r.TRIANGLES,Bi.disabled,Ui.disabled,this.colorModeAlphaBlendedWriteRGB,ji.disabled,f,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments);}}function wn(t,i){const o=[...t],s=i.cameraWorldSizeForFog/i.worldSize,r=e.ad.mat4.identity([]);return e.ad.mat4.scale(r,r,[s,s,1]),e.ad.mat4.multiply(o,r,o),e.ad.mat4.multiply(o,i.worldToFogMatrix,o),o}function Tn(t,i,o,s,r){const n=o.material,a=s.context,{baseColorTexture:l,metallicRoughnessTexture:c}=n.pbrMetallicRoughness,{normalTexture:h,occlusionTexture:d,emissionTexture:u}=n;function _(e,i,o){if(e&&(t.push(i),a.activeTexture.set(a.gl.TEXTURE0+o),e.gfxTexture)){const{minFilter:t,magFilter:i,wrapS:o,wrapT:s}=e.sampler;e.gfxTexture.bindExtraParam(t,i,o,s);}}_(l,"HAS_TEXTURE_u_baseColorTexture",Xi.BaseColor),_(c,"HAS_TEXTURE_u_metallicRoughnessTexture",Xi.MetallicRoughness),_(h,"HAS_TEXTURE_u_normalTexture",Xi.Normal),_(d,"HAS_TEXTURE_u_occlusionTexture",Xi.Occlusion),_(u,"HAS_TEXTURE_u_emissionTexture",Xi.Emission),r&&(r.texture||(r.texture=new e.dn(s.context,r.image,[r.image.height,r.image.height,r.image.height],a.gl.RGBA8)),a.activeTexture.set(a.gl.TEXTURE0+Xi.LUT),r.texture&&r.texture.bind(a.gl.LINEAR,a.gl.CLAMP_TO_EDGE),t.push("APPLY_LUT_ON_GPU")),o.texcoordBuffer&&(t.push("HAS_ATTRIBUTE_a_uv_2f"),i.push(o.texcoordBuffer)),o.colorBuffer&&(t.push(12===o.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),i.push(o.colorBuffer)),o.normalBuffer&&(t.push("HAS_ATTRIBUTE_a_normal_3f"),i.push(o.normalBuffer)),o.pbrBuffer&&(t.push("HAS_ATTRIBUTE_a_pbr"),t.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),i.push(o.pbrBuffer)),"OPAQUE"!==n.alphaMode&&"MASK"!==n.alphaMode||t.push("UNPREMULT_TEXTURE_IN_SHADER"),n.defined||t.push("DIFFUSE_SHADED");const p=s.shadowRenderer;p&&(t.push("RENDER_SHADOWS","DEPTH_TEXTURE"),p.useNormalOffset&&t.push("NORMAL_OFFSET"));}function En(t,i,o,s,r,n){const a=o.paint.get("model-opacity").constantOr(1),l=i.context,c=new Bi(i.context.gl.LEQUAL,Bi.ReadWrite,i.depthRangeFor3D),h=i.transform,d=t.mesh,u=d.material,_=u.pbrMetallicRoughness,p=i.style.fog;let f;f="pixels"===i.transform.projection.zAxisUnit?[...t.nodeModelMatrix]:e.ad.mat4.multiply([],s.zScaleMatrix,t.nodeModelMatrix),e.ad.mat4.multiply(f,s.negCameraPosMatrix,f);const m=e.ad.mat4.invert([],f);e.ad.mat4.transpose(m,m);const g="none"===o.paint.get("model-color-use-theme").constantOr("default"),v=o.paint.get("model-emissive-strength").constantOr(0),y=wr(new Float32Array(t.worldViewProjection),new Float32Array(f),new Float32Array(m),null,i,a,_.baseColorFactor.toRenderColor(null),u.emissiveFactor,_.metallicFactor,_.roughnessFactor,u,v,o),x={defines:[]},b=[],w=i.shadowRenderer;w&&(w.useNormalOffset=!1),Tn(x.defines,b,d,i,g?null:o.lut);let T=null;if(p){const e=wn(t.nodeModelMatrix,i.transform);if(T=new Float32Array(e),"globe"!==h.projection.name){const t=d.aabb.min,i=d.aabb.max,[o,s]=p.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);x.overrideFog=o>=Fe||s>=Fe;}}const E=Qi(i,o.paint.get("model-cutoff-fade-range"));E.shouldRenderCutoff&&x.defines.push("RENDER_CUTOFF");const S=i.getOrCreateProgram("model",x);i.uploadCommonUniforms(l,S,null,T,E),"shadow"!==i.renderPass&&w&&w.setupShadowsFromMatrix(t.nodeModelMatrix,S),S.draw(i,l.gl.TRIANGLES,c,r,n,d.material.doubleSided?ji.disabled:ji.backCCW,y,o.id,d.vertexBuffer,d.indexBuffer,d.segments,o.paint,i.transform.zoom,void 0,b);}function Sn(t,i,o,s,r,n,a){let l;l="globe"===t.projection.name?e.dp(o,t):[...o],e.ad.mat4.multiply(l,l,i.matrix);const c=e.ad.mat4.multiply([],s,l);if(i.meshes)for(const o of i.meshes){if("BLEND"!==o.material.alphaMode){a.push({mesh:o,depth:0,modelIndex:r,worldViewProjection:c,nodeModelMatrix:l});continue}const i=e.ad.vec3.transformMat4([],o.centroid,c);!t.isOrthographic&&i[2]<=0||n.push({mesh:o,depth:i[2],modelIndex:r,worldViewProjection:c,nodeModelMatrix:l});}if(i.children)for(const e of i.children)Sn(t,e,o,s,r,n,a);}function Cn(e,t,i,o){const s=i.shadowRenderer;if(!s)return;const r=s.getShadowPassDepthMode(),n=s.getShadowPassColorMode(),a=s.calculateShadowPassMatrixFromMatrix(t),l=Tr(a);i.getOrCreateProgram("modelDepth",{defines:i._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(i,i.context.gl.TRIANGLES,r,Ui.disabled,n,ji.backCCW,l,o.id,e.vertexBuffer,e.indexBuffer,e.segments,o.paint,i.transform.zoom,void 0,void 0);}function In(t,i,o){const s=i.updateZoomBasedPaintProperties(),r=function(t,i,o){let s,r,n,a=t.terrain?t.terrain.exaggeration():0;if(t.terrain&&a>0){const i=t.terrain,r=i.findDEMTileFor(o);r&&r.dem?s=e.dr.create(i,o,r):a=0;}if(0===a&&(i.terrainElevationMin=0,i.terrainElevationMax=0),a===i.validForExaggeration&&(0===a||s&&s._demTile&&s._demTile.tileID===i.validForDEMTile.id&&s._dem._timestamp===i.validForDEMTile.timestamp))return !1;for(const e in i.instancesPerModel){const t=i.instancesPerModel[e];for(let e=0;e<t.instancedDataArray.length;++e){const o=(s?a*s.getElevationAt(0|t.instancedDataArray.float32[16*e],0|t.instancedDataArray.float32[16*e+1],!0,!0):0)+t.instancesEvaluatedElevation[e];t.instancedDataArray.float32[16*e+6]=o,r=r?Math.min(i.terrainElevationMin,o):o,n=n?Math.max(i.terrainElevationMax,o):o;}}return i.terrainElevationMin=r||0,i.terrainElevationMax=n||0,i.validForExaggeration=a,i.validForDEMTile=s&&s._demTile?{id:s._demTile.tileID,timestamp:s._dem._timestamp}:{id:void 0,timestamp:0},!0}(t,i,o);(s||r)&&(i.uploaded=!1,i.upload(t.context));}const Rn={shadowUniformsInitialized:!1,useSingleShadowCascade:!1,tileMatrix:new Float64Array(16),shadowTileMatrix:new Float32Array(16),aabb:new e.ce([0,0,0],[e.ai,e.ai,0])};function Dn(t,i){const o=1<<t.canonical.z,s=i.getFreeCameraOptions().position,r=i.elevation,n=t.canonical.x/o,a=(t.canonical.x+1)/o,l=t.canonical.y/o,c=(t.canonical.y+1)/o;let h=i._centerAltitude;if(r){const e=r.getMinMaxForTile(t);e&&e.max>h&&(h=e.max);}const d=e.ay(s.x,n,a)-s.x,u=e.ay(s.y,l,c)-s.y,_=e.bH(h,i.center.lat)-s.z;return i._zoomFromMercatorZ(Math.sqrt(d*d+u*u+_*_))}function An(e,t,i,o,s,r,n){const a=e.context,l="shadow"===e.renderPass,c=e.shadowRenderer,h=l&&c?c.getShadowPassDepthMode():new Bi(a.gl.LEQUAL,Bi.ReadWrite,e.depthRangeFor3D),d=e.isTileAffectedByFog(r);if(i.meshes)for(const u of i.meshes){const _=["MODEL_POSITION_ON_GPU"],p=[];let f,m,g;o.instancedDataArray.length>20&&_.push("INSTANCED_ARRAYS");const v=Qi(e,t.paint.get("model-cutoff-fade-range"));if(v.shouldRenderCutoff&&_.push("RENDER_CUTOFF"),l&&c)f=e.getOrCreateProgram("modelDepth",{defines:_}),m=Tr(n.shadowTileMatrix,n.shadowTileMatrix,Float32Array.from(i.matrix)),g=c.getShadowPassColorMode();else {Tn(_,p,u,e,"none"===t.paint.get("model-color-use-theme").constantOr("default")?null:t.lut),f=e.getOrCreateProgram("model",{defines:_,overrideFog:d});const o=u.material,l=o.pbrMetallicRoughness,h=t.paint.get("model-opacity").constantOr(1),y=t.paint.get("model-emissive-strength").constantOr(0);m=wr(r.expandedProjMatrix,Float32Array.from(i.matrix),new Float32Array(16),null,e,h,l.baseColorFactor.toRenderColor(null),o.emissiveFactor,l.metallicFactor,l.roughnessFactor,o,y,t,s),c&&(n.shadowUniformsInitialized?f.setShadowUniformValues(a,c.getShadowUniformValues()):(c.setupShadows(r.toUnwrapped(),f,"model-tile",r.overscaledZ),n.shadowUniformsInitialized=!0)),g=v.shouldRenderCutoff||h<1||"OPAQUE"!==o.alphaMode?ki.alphaBlended:ki.unblended;}e.uploadCommonUniforms(a,f,r.toUnwrapped(),null,v);const y=u.material.doubleSided?ji.disabled:ji.backCCW;if(o.instancedDataArray.length>20)p.push(o.instancedDataBuffer),f.draw(e,a.gl.TRIANGLES,h,Ui.disabled,g,y,m,t.id,u.vertexBuffer,u.indexBuffer,u.segments,t.paint,e.transform.zoom,void 0,p,o.instancedDataArray.length);else {const i=l?"u_instance":"u_normal_matrix";for(let s=0;s<o.instancedDataArray.length;++s)m[i]=new Float32Array(o.instancedDataArray.arrayBuffer,64*s,16),f.draw(e,a.gl.TRIANGLES,h,Ui.disabled,g,y,m,t.id,u.vertexBuffer,u.indexBuffer,u.segments,t.paint,e.transform.zoom,void 0,p);}}if(i.children)for(const a of i.children)An(e,t,a,o,s,r,n);}const Ln=[1,-1,1];function Pn(t,i,o,s){if(!o.modelManager)return !0;const r=o.modelManager;if(!o.shadowRenderer)return !0;const n=o.shadowRenderer,a=i.aabb;let l=!0,c=t.maxHeight;if(0===c){let e=0;for(const i in t.instancesPerModel){const t=r.getModel(i,s);t?e=Math.max(e,Math.max(Math.max(t.aabb.max[0],t.aabb.max[1]),t.aabb.max[2])):l=!1;}c=t.maxScale*e*1.41+t.maxVerticalOffset,l&&(t.maxHeight=c);}a.max[2]=c,a.min[2]+=t.terrainElevationMin,a.max[2]+=t.terrainElevationMax,e.ad.vec3.transformMat4(a.min,a.min,i.tileMatrix),e.ad.vec3.transformMat4(a.max,a.max,i.tileMatrix);const h=a.intersects(n.getCurrentCascadeFrustum());return 0===o.currentShadowCascade&&(t.isInsideFirstShadowMapFrustum=2===h),0===h}function Mn(t,i){const o=t.uniformValues.u_cutoff_params[0],s=t.uniformValues.u_cutoff_params[1],r=t.uniformValues.u_cutoff_params[2],n=t.uniformValues.u_cutoff_params[3];return s===o||n===r?1:e.ay(((i-o)/(s-o)-r)/(n-r),0,1)}function zn(t,i,o,s){if(i.pitch<20)return 1;const r=i.getWorldToCameraMatrix();e.ad.mat4.multiply(r,r,t);const n=e.ad.vec4.fromValues(o.min[0],o.min[1],o.min[2],1);let a=e.ad.vec4.transformMat4(e.ad.vec4.create(),n,r),l=a,c=a;n[1]=o.max[1],a=e.ad.vec4.transformMat4(e.ad.vec4.create(),n,r),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c,n[0]=o.max[0],a=e.ad.vec4.transformMat4(e.ad.vec4.create(),n,r),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c,n[1]=o.min[1],a=e.ad.vec4.transformMat4(e.ad.vec4.create(),n,r),l=a[1]<l[1]?a:l,c=a[1]>c[1]?a:c;const h=e.ay(s[0],0,1),d=100*i.pixelsPerMeter*e.ay(s[1],0,1),u=e.ay(s[2],0,1),_=e.ad.vec4.lerp(e.ad.vec4.create(),l,c,h),p=Math.tan(.5*i.fovX),f=-_[2]*p;if(0===d)return _[1]<-Math.abs(f)?u:1;const m=(-Math.abs(f)-_[1])/d,g=(e,t,i)=>(1-i)*e+i*t,v=e.ay(g(1,u,m),u,1);return g(1,v,e.ay((i.pitch-20)/20,0,1))}class On{}class Fn{constructor(){this._storage=new Map;}getLinesFromTrianglesBuffer(t,i,o){{const e=this._storage.get(i.id);if(e)return e.lastUsedFrameIdx=t,e.buf}const s=o.gl,r=s.getBufferParameter(s.ELEMENT_ARRAY_BUFFER,s.BUFFER_SIZE),n=new ArrayBuffer(r),a=new Int16Array(n);s.getBufferSubData(s.ELEMENT_ARRAY_BUFFER,0,new Int16Array(n));const l=new e.dt;for(let e=0;e<r/2;e+=3){const t=a[e],i=a[e+1],o=a[e+2];l.emplaceBack(t,i),l.emplaceBack(i,o),l.emplaceBack(o,t);}const c=o.bindVertexArrayOES.current,h=new On;return h.buf=new Sr(o,l),h.lastUsedFrameIdx=t,this._storage.set(i.id,h),o.bindVertexArrayOES.set(c),h.buf}update(e){for(const[t,i]of this._storage)e-i.lastUsedFrameIdx>30&&(i.buf.destroy(),this._storage.delete(t));}destroy(){for(const[e,t]of this._storage)t.buf.destroy(),this._storage.delete(e);}}class kn{constructor(e){this.occluderSize=30,this.depthOffset=-1e-4,e.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),e.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5});}}const Bn=e.dd([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class Nn{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}class Un{constructor(e,t){this.revealStart=11,this.revealRange=2,e.registerParameter(this,[...t,"Reveal"],"revealStart",{min:0,max:17,step:.05}),e.registerParameter(this,[...t,"Reveal"],"revealRange",{min:.1,max:5.1,step:.05});}}const Vn=e.dd([{type:"Float32",name:"a_pos_2f",components:2}]);class Gn{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy();}draw(t,i){const o=t.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const i=new e.du,o=new e.aV;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1),o.emplaceBack(0,1,2),o.emplaceBack(0,2,3),this.vignetteVx=t.context.createVertexBuffer(i,Vn.members),this.vignetteIdx=t.context.createIndexBuffer(o);}const s=e.b8.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){t.uploadCommonUniforms(t.context,o);const e={u_vignetteShape:(r={vignetteShape:[i.start,i.range,Math.pow(10,i.fadePower)],vignetteColor:[i.color.r,i.color.g,i.color.b,i.color.a*i.strength]}).vignetteShape,u_vignetteColor:r.vignetteColor};o.draw(t,t.context.gl.TRIANGLES,Bi.disabled,Ui.disabled,ki.alphaBlended,ji.disabled,e,"vignette",this.vignetteVx,this.vignetteIdx,s);}var r;}}class jn{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;}update(t,i){const o=t.getFreeCameraOptions().position,s=o.toAltitude(),r=o.toLngLat(),n=e.ak(r.lng),a=e.ak(r.lat),l=t.pixelsPerMeter/i,c=n*e.dv,h=e.dv*Math.log(Math.tan(Math.PI/4+a/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else {const e=-this._offsetYPrev+h,t=-this._elevationPrev+s;this._accumulatedOffsetX+=(-this._offsetXPrev+c)*l,this._accumulatedOffsetY+=e*l,this._accumulatedElevation+=t*l,this._offsetXPrev=c,this._offsetYPrev=h,this._elevationPrev=s;}}getPosition(){return [this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function qn(e,t){return [-(e[0]-Math.floor(e[0]/t)*t),-(e[1]-Math.floor(e[1]/t)*t),-(e[2]-Math.floor(e[2]/t)*t)]}function Hn(t){const i=e.dl(1323123451230),o=[];for(let s=0;s<t;++s){const t=2*i()-1,s=2*i()-1,r=2*i()-1;o.push(e.ad.vec3.fromValues(t,s,r));}return o}function Zn(t,i,o,s,r){const n=e.ay((r-o)/(s-o),0,1);return (1-n)*t+n*i}class Wn{constructor(e){this._movement=new jn,this._accumulatedTimeFromStart=0,this._prevTime=Date.now()/1e3,this._vignette=new Gn,this._ppmScaleFactor=e;}destroy(){this.particlesVx&&this.particlesVx.destroy(),this.particlesIdx&&this.particlesIdx.destroy(),this._vignette&&this._vignette.destroy();}updateOnRender(t,i){const o=t.transform;this._movement.update(o,this._ppmScaleFactor);const s=o.starsProjMatrix,r=e.ad.quat.identity([]);e.ad.quat.rotateX(r,r,e.ak(90)-o._pitch),e.ad.quat.rotateZ(r,r,-o.angle);const n=e.ad.mat4.fromQuat(new Float32Array(16),r),a=e.ad.mat4.fromValues(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),l=e.ad.mat4.transpose([],a),c=e.ad.mat4.multiply([],l,n),h=Date.now()/1e3;return this._accumulatedTimeFromStart+=(h-this._prevTime)*i,this._prevTime=h,{projectionMatrix:s,modelviewMatrix:c}}}class $n extends Wn{constructor(e){super(4.25),this._params={overrideStyleParameters:!1,intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,dropletSizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._revealParams=new Un(e.tp,["Precipitation","Rain"]),this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3;}update(t){const i=t.context;if(!this.particlesVx){const t=Hn(this.particlesCount),o=new e.dw,s=new e.aV;let r=0;const n=e.dl(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=[2*n()-1,n(),n(),n()];o.emplaceBack(i[0],i[1],i[2],-1,-1,...a),o.emplaceBack(i[0],i[1],i[2],1,-1,...a),o.emplaceBack(i[0],i[1],i[2],1,1,...a),o.emplaceBack(i[0],i[1],i[2],-1,1,...a),s.emplaceBack(r+0,r+1,r+2),s.emplaceBack(r+0,r+2,r+3),r+=4;}this.particlesVx=i.createVertexBuffer(o,Bn.members),this.particlesIdx=i.createIndexBuffer(s);}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.rain)return;const i=this._params.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},o=t.transform.zoom;if(i.revealStart>o)return;const s=Zn(0,1,i.revealStart,i.revealStart+i.revealRange,o);if(!this.particlesVx||!this.particlesIdx)return;const r=structuredClone(this._params);let n=[-r.direction.x,r.direction.y,-100];e.ad.vec3.normalize(n,n);const a=structuredClone(this._vignetteParams);a.strength*=s,r.overrideStyleParameters||(r.intensity=t.style.rain.state.density,r.timeFactor=t.style.rain.state.intensity,r.color=structuredClone(t.style.rain.state.color),n=structuredClone(t.style.rain.state.direction),r.screenThinning.intensity=t.style.rain.state.centerThinning,r.dropletSizeX=t.style.rain.state.dropletSize[0],r.dropletSizeYScale=t.style.rain.state.dropletSize[1]/t.style.rain.state.dropletSize[0],r.distortionStrength=100*t.style.rain.state.distortionStrength,a.strength=1,a.color=structuredClone(t.style.rain.state.vignetteColor));const l=this.updateOnRender(t,r.timeFactor),c=t.context,h=c.gl,d=t.transform;this.screenTexture&&this.screenTexture.size[0]===t.width&&this.screenTexture.size[1]===t.height||(this.screenTexture=new e.T(c,{width:t.width,height:t.height,data:null},h.RGBA8)),r.distortionStrength>0&&(c.activeTexture.set(h.TEXTURE0),this.screenTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,0,0,t.width,t.height));const u=t.getOrCreateProgram("rainParticle");t.uploadCommonUniforms(c,u),c.activeTexture.set(h.TEXTURE0),this.screenTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE);const _=[r.color.r,r.color.g,r.color.b,r.color.a],p=(i,o)=>{const s=qn(this._movement.getPosition(),i),a=r.dropletSizeX,c=r.dropletSizeX*r.dropletSizeYScale,p=t.width/2,f=t.height/2,m=Zn(0,r.screenThinning.start,0,1,r.screenThinning.intensity),g=Zn(.001,r.screenThinning.range,0,1,r.screenThinning.intensity),v=Zn(0,r.screenThinning.particleOffset,0,1,r.screenThinning.intensity),y=(x={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:s,velocityConeAperture:r.velocityConeAperture,velocity:r.velocity,boxSize:i,rainDropletSize:[a,c],distortionStrength:r.distortionStrength,rainDirection:n,color:_,screenSize:[d.width,d.height],thinningCenterPos:[p,f],thinningShape:[m,g,Math.pow(10,r.screenThinning.fadePower)],thinningAffectedRatio:r.screenThinning.affectedRatio,thinningParticleOffset:v,shapeDirectionalPower:r.shapeDirPower,shapeNormalPower:r.shapeNormalPower,mode:o?0:1},{u_modelview:Float32Array.from(x.modelview),u_projection:Float32Array.from(x.projection),u_time:x.time,u_cam_pos:x.camPos,u_texScreen:0,u_velocityConeAperture:x.velocityConeAperture,u_velocity:x.velocity,u_boxSize:x.boxSize,u_rainDropletSize:x.rainDropletSize,u_distortionStrength:x.distortionStrength,u_rainDirection:x.rainDirection,u_color:x.color,u_screenSize:x.screenSize,u_thinningCenterPos:x.thinningCenterPos,u_thinningShape:x.thinningShape,u_thinningAffectedRatio:x.thinningAffectedRatio,u_thinningParticleOffset:x.thinningParticleOffset,u_shapeDirectionalPower:x.shapeDirectionalPower,u_shapeNormalPower:x.shapeNormalPower,u_mode:x.mode});var x;const b=Math.round(r.intensity*this.particlesCount),w=e.b8.simpleSegment(0,0,4*b,2*b);u.draw(t,h.TRIANGLES,Bi.disabled,Ui.disabled,ki.alphaBlended,ji.disabled,y,"rain_particles",this.particlesVx,this.particlesIdx,w);};r.distortionStrength>0&&p(r.boxSize,!0),p(r.boxSize,!1),this._vignette.draw(t,a);}}const Xn=e.dd([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]);class Kn extends Wn{constructor(e){super(2.25),this._params={overrideStyleParameters:!1,intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._revealParams=new Un(e.tp,["Precipitation","Snow"]),this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3;}update(t){const i=t.context;if(!this.particlesVx){const t=Hn(this.particlesCount),o=new e.dx,s=new e.aV;let r=0;const n=e.dl(1323123451230);for(let e=0;e<t.length;++e){const i=t[e],a=n(),l=n(),c=n(),h=[e/t.length,a,l,c],d=[n(),n()];o.emplaceBack(i[0],i[1],i[2],-1,-1,...h,...d),o.emplaceBack(i[0],i[1],i[2],1,-1,...h,...d),o.emplaceBack(i[0],i[1],i[2],1,1,...h,...d),o.emplaceBack(i[0],i[1],i[2],-1,1,...h,...d),s.emplaceBack(r+0,r+1,r+2),s.emplaceBack(r+0,r+2,r+3),r+=4;}this.particlesVx=i.createVertexBuffer(o,Xn.members),this.particlesIdx=i.createIndexBuffer(s);}}draw(t){if(!this._params.overrideStyleParameters&&!t.style.snow)return;const i=structuredClone(this._params);let o=[-i.direction.x,i.direction.y,-100];e.ad.vec3.normalize(o,o);const s=structuredClone(this._vignetteParams),r=i.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},n=t.transform.zoom;if(r.revealStart>n)return;const a=Zn(0,1,r.revealStart,r.revealStart+r.revealRange,n);s.strength*=a,i.overrideStyleParameters||(i.intensity=t.style.snow.state.density,i.timeFactor=t.style.snow.state.intensity,i.color=structuredClone(t.style.snow.state.color),o=structuredClone(t.style.snow.state.direction),i.screenThinning.intensity=t.style.snow.state.centerThinning,i.billboardSize=2.79*t.style.snow.state.flakeSize,s.strength=1,s.color=structuredClone(t.style.snow.state.vignetteColor));const l=this.updateOnRender(t,i.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const c=t.context,h=c.gl,d=t.transform,u=t.getOrCreateProgram("snowParticle");t.uploadCommonUniforms(c,u),((i,s,r)=>{const n=qn(this._movement.getPosition(),i),a=d.width/2,c=d.height/2,_=Zn(0,r.screenThinning.start,0,1,r.screenThinning.intensity),p=Zn(.001,r.screenThinning.range,0,1,r.screenThinning.intensity),f=Zn(0,r.screenThinning.particleOffset,0,1,r.screenThinning.intensity),m=(g={modelview:l.modelviewMatrix,projection:l.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:n,velocityConeAperture:r.velocityConeAperture,velocity:r.velocity,horizontalOscillationRadius:r.horizontalOscillationRadius,horizontalOscillationRate:r.horizontalOscillationRate,boxSize:i,billboardSize:1*r.billboardSize,simpleShapeParameters:[r.shapeFadeStart,r.shapeFadePower],screenSize:[d.width,d.height],thinningCenterPos:[a,c],thinningShape:[_,p,Math.pow(10,r.screenThinning.fadePower)],thinningAffectedRatio:r.screenThinning.affectedRatio,thinningParticleOffset:f,color:[r.color.r,r.color.g,r.color.b,r.color.a],direction:o},{u_modelview:Float32Array.from(g.modelview),u_projection:Float32Array.from(g.projection),u_time:g.time,u_cam_pos:g.camPos,u_velocityConeAperture:g.velocityConeAperture,u_velocity:g.velocity,u_horizontalOscillationRadius:g.horizontalOscillationRadius,u_horizontalOscillationRate:g.horizontalOscillationRate,u_boxSize:g.boxSize,u_billboardSize:g.billboardSize,u_simpleShapeParameters:g.simpleShapeParameters,u_screenSize:g.screenSize,u_thinningCenterPos:g.thinningCenterPos,u_thinningShape:g.thinningShape,u_thinningAffectedRatio:g.thinningAffectedRatio,u_thinningParticleOffset:g.thinningParticleOffset,u_particleColor:g.color,u_direction:g.direction});var g;const v=Math.round(r.intensity*this.particlesCount),y=e.b8.simpleSegment(0,0,4*v,2*v);this.particlesVx&&this.particlesIdx&&u.draw(t,h.TRIANGLES,Bi.disabled,Ui.disabled,ki.alphaBlended,ji.disabled,m,"snow_particles",this.particlesVx,this.particlesIdx,y);})(i.boxSize,0,i),this._vignette.draw(t,s);}}const Yn={symbol:function(t,i,o,s,r){if("translucent"!==t.renderPass)return;const n=Ui.disabled,a=t.colorModeForRenderPass(),l=o.layout.get("text-variable-anchor"),c=o.layout.get("text-size-scale-range"),h=e.ay(t.scaleFactor,c[0],c[1]);l&&function(t,i,o,s,r,n,a,l){const c=i.transform,h="map"===r,d="map"===n;for(const i of t){const t=s.getTile(i),r=t.getBucket(o);if(!r||!r.text||!r.text.segments.get().length)continue;const n=e.bp(r.textSizeData,c.zoom,l),u=ci(i,r.getProjection(),c),_=c.calculatePixelsToTileUnitsMatrix(t),p=qt(u,t.tileID.canonical,d,h,c,r.getProjection(),_),f=r.hasIconTextFit()&&r.hasIconData();if(n){const o=Math.pow(2,c.zoom-t.tileID.overscaledZ);Or(r,h,d,a,e.cY,c,p,i,o,n,f);}}}(s,t,o,i,o.layout.get("text-rotation-alignment"),o.layout.get("text-pitch-alignment"),r,h);const d=0!==o.paint.get("icon-opacity").constantOr(1),u=0!==o.paint.get("text-opacity").constantOr(1);void 0!==o.layout.get("symbol-sort-key").constantOr(1)&&(d||u)?Fr(t,i,o,s,n,a):(d&&Fr(t,i,o,s,n,a,{onlyIcons:!0}),u&&Fr(t,i,o,s,n,a,{onlyText:!0})),i.map.showCollisionBoxes&&(Lr(t,i,o,s,o.paint.get("text-translate"),o.paint.get("text-translate-anchor"),!0),Lr(t,i,o,s,o.paint.get("icon-translate"),o.paint.get("icon-translate-anchor"),!1));},circle:function(t,i,o,s){if("translucent"!==t.renderPass)return;const r=o.paint.get("circle-opacity"),n=o.paint.get("circle-stroke-width"),a=o.paint.get("circle-stroke-opacity"),l=void 0!==o.layout.get("circle-sort-key").constantOr(1),c=o.paint.get("circle-emissive-strength");if(0===r.constantOr(1)&&(0===n.constantOr(1)||0===a.constantOr(1)))return;const h=t.context,d=h.gl,u=t.transform,_=t.depthModeForSublayer(0,Bi.ReadOnly),p=Ui.disabled,f=t.colorModeForDrapableLayerRenderPass(c),m="globe"===u.projection.name,g=[e.av(u.center.lng),e.aC(u.center.lat)],v=[];for(let r=0;r<s.length;r++){const n=s[r],a=i.getTile(n),c=a.getBucket(o);if(!c||c.projection.name!==u.projection.name)continue;const h=c.programConfigurations.get(o.id),d=e.cZ(o),_=t.isTileAffectedByFog(n);m&&d.push("PROJECTION_GLOBE_VIEW"),d.push("DEPTH_D24"),t.terrain&&u.depthOcclusionForSymbolsAndCircles&&d.push("DEPTH_OCCLUSION");const p=t.getOrCreateProgram("circle",{config:h,defines:d,overrideFog:_}),f=c.layoutVertexBuffer,y=c.globeExtVertexBuffer,x=c.indexBuffer,b=u.projection.createInversionMatrix(u,n.canonical),w={programConfiguration:h,program:p,layoutVertexBuffer:f,globeExtVertexBuffer:y,indexBuffer:x,uniformValues:e.c_(t,n,a,b,g,o),tile:a};if(l){const t=c.segments.get();for(const i of t)v.push({segments:new e.b8([i]),sortKey:i.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:u.depthOcclusionForSymbolsAndCircles};for(const e of v){const{programConfiguration:i,program:s,layoutVertexBuffer:r,globeExtVertexBuffer:n,indexBuffer:a,uniformValues:l,tile:c}=e.state,m=e.segments;t.terrain&&t.terrain.setupElevationDraw(c,s,y),t.uploadCommonUniforms(h,s,c.tileID.toUnwrapped()),s.draw(t,d.TRIANGLES,_,p,f,ji.disabled,l,o.id,r,a,m,o.paint,u.zoom,i,[n]);}},heatmap:function(t,i,o,s){if(0!==o.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const r=t.context,n=r.gl,a=Ui.disabled,l=new ki([n.ONE,n.ONE,n.ONE,n.ONE],e.al.transparent,[!0,!0,!0,!0]);!function(e,t,i,o){const s=e.gl,r=t.width*o,n=t.height*o;e.activeTexture.set(s.TEXTURE1),e.viewport.set([0,0,r,n]);let a=i.heatmapFbo;if(!a||a&&(a.width!==r||a.height!==n)){a&&a.destroy();const t=s.createTexture();s.bindTexture(s.TEXTURE_2D,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR),a=i.heatmapFbo=e.createFramebuffer(r,n,!0,null),function(e,t,i,o,s,r){const n=e.gl;n.texImage2D(n.TEXTURE_2D,0,e.extRenderToTextureHalfFloat?n.RGBA16F:n.RGBA,s,r,0,n.RGBA,e.extRenderToTextureHalfFloat?n.HALF_FLOAT:n.UNSIGNED_BYTE,null),o.colorAttachment.set(i);}(e,0,t,a,r,n);}else s.bindTexture(s.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer);}(r,t,o,"globe"===t.transform.projection.name?.5:.25),r.clear({color:e.al.transparent});const c=t.transform,h="globe"===c.projection.name,d=h?["PROJECTION_GLOBE_VIEW"]:[],u=h?ji.frontCCW:ji.disabled,_=[e.av(c.center.lng),e.aC(c.center.lat)];for(let e=0;e<s.length;e++){const p=s[e];if(i.hasRenderableParent(p))continue;const f=i.getTile(p),m=f.getBucket(o);if(!m||m.projection.name!==c.projection.name)continue;const g=t.isTileAffectedByFog(p),v=m.programConfigurations.get(o.id),y=t.getOrCreateProgram("heatmap",{config:v,defines:d,overrideFog:g}),{zoom:x}=t.transform;t.terrain&&t.terrain.setupElevationDraw(f,y),t.uploadCommonUniforms(r,y,p.toUnwrapped());const b=c.projection.createInversionMatrix(c,p.canonical);y.draw(t,n.TRIANGLES,Bi.disabled,a,l,u,lr(t,p,f,b,_,x,o.paint.get("heatmap-intensity")),o.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,o.paint,t.transform.zoom,v,h?[m.globeExtVertexBuffer]:null);}r.viewport.set([0,0,t.width,t.height]);}else "translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,i){const o=t.context,s=o.gl,r=i.heatmapFbo;if(!r)return;o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,r.colorAttachment.get()),o.activeTexture.set(s.TEXTURE1);let n=i.colorRampTexture;n||(n=i.colorRampTexture=new e.T(o,i.colorRamp,s.RGBA8)),n.bind(s.LINEAR,s.CLAMP_TO_EDGE),t.getOrCreateProgram("heatmapTexture").draw(t,s.TRIANGLES,Bi.disabled,Ui.disabled,t.colorModeForRenderPass(),ji.disabled,((e,t,i,o)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,i),i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom);}(t,o));},line:function(t,i,o,s){if("translucent"!==t.renderPass)return;const r=o.paint.get("line-opacity"),n=o.paint.get("line-width");if(0===r.constantOr(1)||0===n.constantOr(1))return;const a=o.paint.get("line-emissive-strength"),l=o.paint.get("line-occlusion-opacity"),c=o.layout.get("line-elevation-reference"),h="meters"===o.layout.get("line-width-unit"),d="sea"===c,u=t.context,_=u.gl;if(o.hasElevatedBuckets&&"globe"===t.transform.projection.name)return;const p=o.layout.get("line-cross-slope"),f=void 0!==p,m=p<1,g=t.colorModeForDrapableLayerRenderPass(a),v=t.terrain&&t.terrain.renderingToTexture,y=v?1:e.q.devicePixelRatio,x=o.paint.get("line-dasharray"),b=x.constantOr(1),w=o.layout.get("line-cap"),T=x.constantOr(null),E=w.constantOr(null),S=o.paint.get("line-pattern"),C=S.constantOr(1),I=S.constantOr(null),R=o.paint.get("line-opacity").constantOr(1);let D=!C&&1!==R||t.depthOcclusion&&l>0&&l<1;const A=o.paint.get("line-gradient"),L=C?"linePattern":"line",P=e.c$(o);let M;if(v&&t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(D=!1),0!==l&&t.depthOcclusion){const t=o.paint._values["line-opacity"];t&&t.value&&"constant"===t.value.kind?M=t.value:e.w(`Occlusion opacity for layer ${o.id} is supported only when line-opacity isn't data-driven.`);}"constant"!==n.value.kind&&!1===n.value.isLineProgressConstant&&P.push("VARIABLE_LINE_WIDTH");const z=(s,r,n,a,c,p)=>{for(const f of s){const s=i.getTile(f);if(C&&!s.patternsLoaded())continue;const m=s.getBucket(o);if(!m)continue;if(m.hasZOffset&&!c||!m.hasZOffset&&c)continue;t.prepareDrawTile();const x=m.programConfigurations.get(o.id),w=t.isTileAffectedByFog(f),S=t.getOrCreateProgram(L,{config:x,defines:r,overrideFog:w,overrideRtt:!c&&void 0});if(I&&s.imageAtlas){const t=e.d0.from(I).getPrimary().scaleSelf(y).toString(),i=s.imageAtlas.patternPositions.get(t);i&&x.setConstantPatternPositions(i);}if(!C&&T&&E&&s.lineAtlas){const e=s.lineAtlas.getDash(T,E);e&&x.setConstantPatternPositions(e);}let[P,z]=o.paint.get("line-trim-offset");if("round"===E||"square"===E){const e=1;P!==z&&(0===P&&(P-=e),1===z&&(z+=e));}const O=v?f.projMatrix:null,F=h?1/m.tileToMeter/e.at(s,1,t.transform.zoom):1,k=h?1/m.tileToMeter/e.at(s,1,Math.floor(t.transform.zoom)):1,B=C?e.d1(t,s,o,O,y,F,k,[P,z]):e.d2(t,s,o,O,m.lineClipsArray.length,y,F,k,[P,z]);if(A){const s=m.gradients[o.id];let r=s.texture;if(o.gradientVersion!==s.version){let n=256;if(o.stepInterpolant){const o=i.getSource().maxzoom,s=f.canonical.z===o?Math.ceil(1<<t.transform.maxZoom-f.canonical.z):1;n=e.ay(e.d3(m.maxLineLength/e.ai*1024*s),256,u.maxTextureSize);}s.gradient=e.d4({expression:o.gradientExpression(),evaluationKey:"lineProgress",resolution:n,image:s.gradient||void 0,clips:m.lineClipsArray}),s.texture?s.texture.update(s.gradient):s.texture=new e.T(u,s.gradient,_.RGBA8),s.version=o.gradientVersion,r=s.texture;}u.activeTexture.set(_.TEXTURE1),r.bind(o.stepInterpolant?_.NEAREST:_.LINEAR,_.CLAMP_TO_EDGE);}b&&(u.activeTexture.set(_.TEXTURE0),s.lineAtlasTexture&&s.lineAtlasTexture.bind(_.LINEAR,_.REPEAT),x.updatePaintBuffers()),C&&(u.activeTexture.set(_.TEXTURE0),s.imageAtlasTexture&&s.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),x.updatePaintBuffers()),c&&!d&&t.terrain.setupElevationDraw(s,S),t.uploadCommonUniforms(u,S,f.toUnwrapped());const N=e=>{null!=M&&(M.value=R*l),S.draw(t,_.TRIANGLES,n,e,g,ji.disabled,B,o.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,o.paint,t.transform.zoom,x,[m.layoutVertexBuffer2,m.patternVertexBuffer,m.zOffsetVertexBuffer]),null!=M&&(M.value=R);};if(D&&!c){const e=t.stencilModeForClipping(f).ref;0===e&&v&&u.clear({stencil:0});const i={func:_.EQUAL,mask:255};B.u_alpha_discard_threshold=.8,N(new Ui(i,e,255,_.KEEP,_.KEEP,_.INVERT)),B.u_alpha_discard_threshold=0,N(new Ui(i,e,255,_.KEEP,_.KEEP,_.KEEP));}else B.u_alpha_discard_threshold=D&&c&&p?.8:0,N(c?a:t.stencilModeForClipping(f));}};if(o.hasNonElevatedBuckets){const i=!v&&t.terrain;0!==l&&i?e.w(`Occlusion opacity for layer ${o.id} is supported on terrain only if the layer has line-z-offset enabled.`):i?e.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${o.id}.`):z(s,P,t.depthModeForSublayer(0,Bi.ReadOnly),Ui.disabled,!1,!0);}if(o.hasElevatedBuckets){P.push("ELEVATED"),f&&P.push(m?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),d&&P.push("ELEVATION_REFERENCE_SEA");const e=D?t.stencilModeFor3D():Ui.disabled,i=new Bi(t.depthOcclusion?_.GREATER:_.LEQUAL,Bi.ReadOnly,t.depthRangeFor3D);t.forceTerrainMode=!0,z(s,P,i,e,!0,!0),D&&z(s,P,i,e,!0,!1),t.forceTerrainMode=!1;}D&&(t.resetStencilClippingMasks(),v&&u.clear({stencil:0})),0===l||t.depthOcclusion||v||t.layersWithOcclusionOpacity.push(t.currentLayer);},fill:function(t,i,o,s){const r=o.paint.get("fill-color"),n=o.paint.get("fill-opacity");if(0===n.constantOr(1))return;const a=o.paint.get("fill-emissive-strength"),l=t.colorModeForDrapableLayerRenderPass(a),c=o.paint.get("fill-pattern"),h=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===r.constantOr(e.al.transparent).a&&1===n.constantOr(0)?"opaque":"translucent";let d="none";"none"!==o.layout.get("fill-elevation-reference")?d="road":0!==o.paint.get("fill-z-offset").constantOr(1)&&(d="offset");const u=!(!t.terrain||!t.terrain.enabled),_={painter:t,sourceCache:i,layer:o,coords:s,colorMode:l,elevationType:d,terrainEnabled:u,pass:h};if("offset"!==d){if(Ur(_,!1),"road"===d){const e=!u&&"translucent"===t.renderPass;e&&Nr(t,i,o,s,"geometry"),Ur(_,!0,Ui.disabled),e&&function(e){const{painter:t,sourceCache:i,layer:o,coords:s,colorMode:r}=e,n=t.context.gl,a=new Bi(t.context.gl.LEQUAL,Bi.ReadOnly,t.depthRangeFor3D);for(const e of s){const s=i.getTile(e),l=s.getBucket(o);if(!l)continue;const c=l.elevatedStructures;if(!c||!c.renderableSegments||0===c.renderableSegments.segments[0].primitiveLength)continue;t.prepareDrawTile();const h=l.bufferData.programConfigurations.get(o.id),d=t.isTileAffectedByFog(e),u=t.getOrCreateProgram("elevatedStructures",{config:h,overrideFog:d,defines:["NORMAL_OFFSET"]}),_={u_matrix:t.translatePosMatrix(e.projMatrix,s,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"))};t.uploadCommonUniforms(t.context,u,e.toUnwrapped()),u.draw(t,n.TRIANGLES,a,Ui.disabled,r,ji.backCCW,_,o.id,c.vertexBuffer,c.indexBuffer,c.renderableSegments,o.paint,t.transform.zoom,h,[c.vertexBufferNormal]);}}(_);}}else Ur(_,!1,t.stencilModeFor3D());},"fill-extrusion":function(t,i,o,s){const r=o.paint.get("fill-extrusion-opacity"),n=t.context,a=n.gl,l=t.terrain,c=l&&l.renderingToTexture;if(0===r)return;const h=t.conflationActive&&t.style.isLayerClipped(o,i.getSource()),d=t.style.order.indexOf(o.fqid);if(h&&function(e,t,i,o,s){for(const r of o){const o=t.getTile(r).getBucket(i);o&&(o.updateReplacement(r,e.replacementSource,s),o.uploadCentroid(e.context));}}(t,i,o,s,d),l||h)for(const e of s){const s=i.getTile(e).getBucket(o);s&&jr(t.context,i,e,s,o,l,h);}if("shadow"===t.renderPass&&t.shadowRenderer){const n=t.shadowRenderer;if(l&&r<.65&&o._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.ab)return;const a=n.getShadowPassDepthMode(),c=n.getShadowPassColorMode();Vr(t,i,o,s,a,Ui.disabled,c,h);}else if("translucent"===t.renderPass){const d=!o.paint.get("fill-extrusion-pattern").constantOr(1),u=o.paint.get("fill-extrusion-color").constantOr(e.al.white);if(!c&&0!==u.a){const e=new Bi(t.context.gl.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D);1===r&&d?Vr(t,i,o,s,e,Ui.disabled,ki.unblended,h):(Vr(t,i,o,s,e,Ui.disabled,ki.disabled,h),Vr(t,i,o,s,e,t.stencilModeFor3D(),t.colorModeForRenderPass(),h),t.resetStencilClippingMasks());}if(t.style.enable3dLights()&&d&&(!l&&"globe"!==t.transform.projection.name||c)){const r=o.paint.get("fill-extrusion-opacity"),d=o.paint.get("fill-extrusion-ambient-occlusion-intensity"),u=o.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),_=o.paint.get("fill-extrusion-flood-light-intensity"),p="none"===o.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),f=o.paint.get("fill-extrusion-flood-light-color").toRenderColor(p?null:o.lut).toArray01().slice(0,3),m=d>0&&u>0,g=_>0,v=(e,t,i)=>(1-i)*e+i*t,y=n=>{const l=t.depthModeForSublayer(1,Bi.ReadOnly,a.LEQUAL,!0),c=o.paint.get(n?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),p=v(.1,3,c),m=t._showOverdrawInspector;if(!m){const c=new Ui({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),m=new ki([a.ONE,a.ONE,a.ONE,a.ONE],e.al.transparent,[!1,!1,!1,!0],a.MIN);Gr(t,i,o,s,l,c,m,ji.disabled,n,"sdf",r,d,u,_,f,p,h,!1);}{const c=m?Ui.disabled:new Ui({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),g=m?t.colorModeForRenderPass():new ki([a.ONE_MINUS_DST_ALPHA,a.DST_ALPHA,a.ONE,a.ONE],e.al.transparent,[!0,!0,!0,!0]);Gr(t,i,o,s,l,c,g,ji.disabled,n,"color",r,d,u,_,f,p,h,!1);}};if(c){const c=(n,l,c)=>{const p=t.depthModeForSublayer(1,Bi.ReadOnly,a.LEQUAL,!1),m=o.paint.get(n?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),g=v(.1,3,m);{const c=new ki([a.ONE,a.ONE,a.ONE,a.ONE],e.al.transparent,[!1,!1,!1,!0]);Gr(t,i,o,s,p,Ui.disabled,c,ji.disabled,n,"clear",r,d,u,_,f,g,h,l);}{const c=new Ui({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),m=new ki([a.ONE,a.ONE,a.ONE,a.ONE],e.al.transparent,[!1,!1,!1,!0],a.MIN);Gr(t,i,o,s,p,c,m,ji.disabled,n,"sdf",r,d,u,_,f,g,h,l);}{const c=n?a.ZERO:a.ONE_MINUS_DST_ALPHA,m=new Ui({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),v=new ki([c,a.DST_ALPHA,a.ONE_MINUS_DST_ALPHA,a.ZERO],e.al.transparent,[!0,!0,!0,!0]);Gr(t,i,o,s,p,m,v,ji.disabled,n,"color",r,d,u,_,f,g,h,l);}{const m=new ki([a.ONE,a.ONE,a.ONE,n?a.ZERO:a.ONE],e.al.transparent,[!1,!1,!1,!0],n?a.FUNC_ADD:a.MAX);Gr(t,i,o,s,p,Ui.disabled,m,ji.disabled,n,"clear",r,d,u,_,f,g,h,l,c);}};if(m||g){let i;if(t.prepareDrawTile(),l){const t=l.drapeBufferSize[0],o=l.drapeBufferSize[1];i=l.framebufferCopyTexture,i&&(!i||i.size[0]===t&&i.size[1]===o)||(i&&i.destroy(),i=l.framebufferCopyTexture=new e.T(n,new e.r({width:t,height:o}),a.RGBA8)),i.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.copyTexSubImage2D(a.TEXTURE_2D,0,0,0,0,0,t,o);}m&&c(!0,!1,i),g&&c(!1,!0,i);}}else m&&y(!0),g&&y(!1),(m||g)&&t.resetStencilClippingMasks();}}},hillshade:function(e,t,i,o){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;if(e.style.disableElevatedTerrain)return;const s=e.context,r=e.terrain&&e.terrain.renderingToTexture,[n,a]="translucent"!==e.renderPass||r?[{},o]:e.stencilConfigForOverlap(o);for(const o of a){const s=t.getTile(o);if(s.needsHillshadePrepare&&"offscreen"===e.renderPass)Wo(e,s,i);else if("translucent"===e.renderPass){const t=e.depthModeForSublayer(0,Bi.ReadOnly),a=i.paint.get("hillshade-emissive-strength"),l=e.colorModeForDrapableLayerRenderPass(a),c=r&&e.terrain?e.terrain.stencilModeForRTTOverlap(o):n[o.overscaledZ];Ho(e,o,s,i,t,c,l);}}s.viewport.set([0,0,e.width,e.height]),e.resetStencilClippingMasks();},raster:function(t,i,o,s,r,n){if("translucent"!==t.renderPass)return;if(0===o.paint.get("raster-opacity"))return;const a="globe"===t.transform.projection.name,l=0!==o.paint.get("raster-elevation"),c=l&&a;if(t.renderElevatedRasterBackface&&!c)return;const h=t.context,d=h.gl,u=i.getSource(),_=function(t,i,o,s){const r=i.paint.get("raster-color"),n="raster-array"===t.type,a=[],l=i.paint.get("raster-resampling"),c=i.paint.get("raster-color-mix");let h=i.paint.get("raster-color-range");const d=[c[0],c[1],c[2],0],u=c[3];let _="nearest"===l?s.NEAREST:s.LINEAR;if(n&&(a.push("RASTER_ARRAY"),r||a.push("RASTER_COLOR"),"linear"===l&&a.push("RASTER_ARRAY_LINEAR"),_=s.NEAREST,!h&&t.rasterLayers)){const e=t.rasterLayers.find((({id:e})=>e===i.sourceLayer));e&&e.fields&&e.fields.range&&(h=e.fields.range);}if(h=h||[0,1],r){a.push("RASTER_COLOR"),o.activeTexture.set(s.TEXTURE2),i.updateColorRamp(h);let t=i.colorRampTexture;t||(t=i.colorRampTexture=new e.T(o,i.colorRamp,s.RGBA8)),t.bind(s.LINEAR,s.CLAMP_TO_EDGE);}return {mix:d,range:h,offset:u,defines:a,resampling:_}}(u,o,h,d);if(u instanceof e.aK&&!s.length&&!a)return;const p=o.paint.get("raster-emissive-strength"),f=t.colorModeForDrapableLayerRenderPass(p),m=t.terrain&&t.terrain.renderingToTexture,g=!t.options.moving,v="nearest"===o.paint.get("raster-resampling")?d.NEAREST:d.LINEAR;if(u instanceof e.aK&&!s.length&&(u.onNorthPole||u.onSouthPole)){const e=l?t.stencilModeFor3D():Ui.disabled;return void Xr(!!u.onNorthPole,null,t,i,o,p,_,ji.disabled,e)}if(!s.length)return;const[y,x]=u instanceof e.aK||m?[{},s]:t.stencilConfigForOverlap(s),b=x[x.length-1].overscaledZ;c&&_.defines.push("PROJECTION_GLOBE_VIEW"),l&&_.defines.push("RENDER_CUTOFF");const w=(s,r,x)=>{for(const w of s){const s=w.toUnwrapped(),T=i.getTile(w);if(m&&(!T||!T.hasData()))continue;h.activeTexture.set(d.TEXTURE0);const E=Yr(T,u,o,_);if(!E||!E.texture)continue;const{texture:S,mix:C,offset:I,tileSize:R,buffer:D}=E;let A,L;m?(A=Bi.disabled,L=w.projMatrix):l?(A=new Bi(d.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D),L=a?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(s,g)):(A=t.depthModeForSublayer(w.overscaledZ-b,1===o.paint.get("raster-opacity")?Bi.ReadWrite:Bi.ReadOnly,d.LESS),L=t.transform.calculateProjMatrix(s,g));const P=t.terrain&&m?t.terrain.stencilModeForRTTOverlap(w):y[w.overscaledZ],M=n?0:o.paint.get("raster-fade-duration");T.registerFadeDuration(M);const z=i.findLoadedParent(w,0),O=Ns(T,z,i,t.transform,M);let F,k;t.terrain&&t.terrain.prepareDrawTile(),h.activeTexture.set(d.TEXTURE0),S.bind(v,d.CLAMP_TO_EDGE),h.activeTexture.set(d.TEXTURE1),z?(z.texture&&z.texture.bind(v,d.CLAMP_TO_EDGE),F=Math.pow(2,z.tileID.overscaledZ-T.tileID.overscaledZ),k=[T.tileID.canonical.x*F%1,T.tileID.canonical.y*F%1]):S.bind(v,d.CLAMP_TO_EDGE),"useMipmap"in S&&h.extTextureFilterAnisotropic&&t.transform.pitch>20&&d.texParameterf(d.TEXTURE_2D,h.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,h.extTextureFilterAnisotropicMax);const B=t.transform;let N;const U=l?Kr(B):[0,0,0,0];let V,G,j,q,H,Z=0;if(c&&u instanceof e.aK&&u.coordinates.length>3)V=Float32Array.from(e.bc(e.cI(new e.bT(0,0,0)))),G=Float32Array.from(B.globeMatrix),j=Float32Array.from(e.cE(B)),q=[e.av(B.center.lng),e.aC(B.center.lat)],N=u.elevatedGlobePerspectiveTransform,H=u.elevatedGlobeGridMatrix||new Float32Array(9);else if(c){const t=e.cF(w.canonical);Z=e.cG(t.getCenter().lat),V=Float32Array.from(e.bc(e.cI(w.canonical))),G=Float32Array.from(B.globeMatrix),j=Float32Array.from(e.cE(B)),q=[e.av(B.center.lng),e.aC(B.center.lat)],N=[0,0],H=Float32Array.from(e.cH(w.canonical,t,Z,B.worldSize/B._pixelsPerMercatorPixel));}else N=u instanceof e.aK?u.perspectiveTransform:[0,0],V=new Float32Array(16),G=new Float32Array(9),j=new Float32Array(16),q=[0,0],H=new Float32Array(9);const W=dr(L,V,G,j,H,k||[0,0],e.ag(t.transform.zoom),q,U,F||1,O,o,N,l?o.paint.get("raster-elevation"):0,2,C,I,_.range,R,D,p),$=t.isTileAffectedByFog(w),X=t.getOrCreateProgram("raster",{defines:_.defines,overrideFog:$});if(t.uploadCommonUniforms(h,X,s),u instanceof e.aK){const i=u.elevatedGlobeVertexBuffer,s=u.elevatedGlobeIndexBuffer;if(m||!a)u.boundsBuffer&&u.boundsSegments&&X.draw(t,d.TRIANGLES,A,Ui.disabled,f,ji.disabled,W,o.id,u.boundsBuffer,t.quadTriangleIndexBuffer,u.boundsSegments);else if(i&&s){const n=B.zoom<=e.c6?u.elevatedGlobeSegments:u.getSegmentsForLongitude(B.center.lng);n&&X.draw(t,d.TRIANGLES,A,Ui.disabled,f,r,W,o.id,i,s,n);}}else if(c){A=new Bi(d.LEQUAL,Bi.ReadOnly,t.depthRangeFor3D);const e=t.globeSharedBuffers;if(e){const[i,s,n]=e.getGridBuffers(Z,!1);X.draw(t,d.TRIANGLES,A,x||P,t.colorModeForRenderPass(),r,W,o.id,i,s,n);}}else {const{tileBoundsBuffer:e,tileBoundsIndexBuffer:i,tileBoundsSegments:s}=t.getTileBoundsBuffers(T);X.draw(t,d.TRIANGLES,A,P,f,ji.disabled,W,o.id,e,i,s);}}if(!(u instanceof e.aK)&&c)for(const e of s){const s=e.canonical.y===(1<<e.canonical.z)-1;0===e.canonical.y&&Xr(!0,e,t,i,o,p,_,r,x||Ui.disabled),s&&Xr(!1,e,t,i,o,p,_,r===ji.frontCW?ji.backCW:ji.frontCW,x||Ui.disabled);}};c?w(x,t.renderElevatedRasterBackface?ji.backCW:ji.frontCW,t.stencilModeFor3D()):w(x,ji.disabled,void 0),t.resetStencilClippingMasks();},"raster-particle":function(t,i,o,s,r,n){"offscreen"===t.renderPass&&function(t,i,o,s){if(!s.length)return;const r=t.context,n=r.gl,a=i.getSource();if(!(a instanceof ot))return;const l=Math.ceil(Math.sqrt(o.paint.get("raster-particle-count")));let c=o.particlePositionRGBAImage;if(!c||c.width!==l){const t=function(e){const t=e*e,i=new Uint8Array(4*t),o=function(e){return e|=0,e=Math.imul(2747636419^e,2654435769),e=Math.imul(e^e>>>16,2654435769),((e=Math.imul(e^e>>>16,2654435769))>>>0)/4294967296},s=1/1.1;for(let e=0;e<t;e++){const t=s*(o(2*e+0)+_r),r=s*(o(2*e+1)+_r),n=255*t%1,a=255*r%1,l=n,c=r-a/255,h=a;i[4*e+0]=255*(t-n/255),i[4*e+1]=255*l,i[4*e+2]=255*c,i[4*e+3]=255*h;}return i}(l);c=o.particlePositionRGBAImage=new e.r({width:l,height:l},t);}let h=o.particleFramebuffer;h?h.width!==l&&(h.destroy(),h=o.particleFramebuffer=r.createFramebuffer(l,l,!0,null)):h=o.particleFramebuffer=r.createFramebuffer(l,l,!0,null);const d=[];for(const e of s){const t=i.getTile(e);if(!(t instanceof wt))continue;const s=en(t,a,o);if(!s)continue;const n=[t.tileSize,t.tileSize];let h=o.tileFramebuffer;h||(h=o.tileFramebuffer=r.createFramebuffer(n[0],n[1],!0,null));let u=t.rasterParticleState;u||(u=t.rasterParticleState=new Qr(r,e,n,c));const _=u.update(o.lastInvalidatedAt);u.particleTextureDimension!==l&&u.updateParticleTexture(e,c);const p=u.targetColorTexture;u.targetColorTexture=u.backgroundColorTexture,u.backgroundColorTexture=p;const f=u.particleTexture0;u.particleTexture0=u.particleTexture1,u.particleTexture1=f,d.push([e,s,u,_]);}if(0===d.length)return;const u=e.q.now(),_=o.previousDrawTimestamp?.001*(u-o.previousDrawTimestamp):.0167;if(o.previousDrawTimestamp=u,o.hasColorMap()){r.activeTexture.set(n.TEXTURE0+2);let t=o.colorRampTexture;t||(t=o.colorRampTexture=new e.T(r,o.colorRamp,n.RGBA8)),t.bind(n.LINEAR,n.CLAMP_TO_EDGE);}r.bindFramebuffer.set(o.tileFramebuffer.framebuffer),function(t,i,o){const s=t.context,r=s.gl,n=i.tileFramebuffer;s.activeTexture.set(r.TEXTURE0);const a={u_texture:0,u_opacity:1.05*(c=i.paint.get("raster-particle-fade-opacity-factor"))/(c+.05)},l=t.getOrCreateProgram("rasterParticleTexture",{defines:[],overrideFog:!1});var c;for(const c of o){const[,,o,h]=c;n.colorAttachment.set(o.targetColorTexture.texture),s.viewport.set([0,0,n.width,n.height]),s.clear({color:e.al.transparent}),h&&(o.backgroundColorTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE),l.draw(t,r.TRIANGLES,Bi.disabled,Ui.disabled,ki.alphaBlended,ji.disabled,a,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments));}}(t,o,d),function(t,i,o,s){const r=t.context,n=r.gl,a=o.tileFramebuffer,l="globe"===t.transform.projection.name,c=o.paint.get("raster-particle-max-speed");for(const h of s){const[s,d,u]=h;r.activeTexture.set(n.TEXTURE0+0),d.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),a.colorAttachment.set(u.targetColorTexture.texture);const _=t.getOrCreateProgram("rasterParticleDraw",{defines:d.defines,overrideFog:!1});r.activeTexture.set(n.TEXTURE0+1);const p=d.scalarData?[]:[0,1,2,3].map((t=>e.d7[t](s)));p.push(s);const f=s.canonical.x,m=s.canonical.y;for(const e of p){const r=i.getTile(l?e.wrapped():e);if(!r)continue;const a=r.rasterParticleState;if(!a)continue;const h=e.canonical.x+(1<<e.canonical.z)*(e.wrap-s.wrap),u=e.canonical.y;a.particleTexture0.bind(n.NEAREST,n.CLAMP_TO_EDGE);const p=fr(1,a.particleTexture0.size[0],[h-f,u-m],0,d.texture.size,2,c,d.textureOffset,d.scale,d.offset);_.draw(t,n.POINTS,Bi.disabled,Ui.disabled,ki.alphaBlended,ji.disabled,p,o.id,a.particleIndexBuffer,void 0,a.particleSegment);}}}(t,i,o,d),r.bindFramebuffer.set(o.particleFramebuffer.framebuffer),function(t,i,o,s){const r=t.context,n=r.gl,a=i.paint.get("raster-particle-max-speed"),l=s*i.paint.get("raster-particle-speed-factor")*.15,c=function(e){return Math.pow(e,6)}(.01+1*i.paint.get("raster-particle-reset-rate-factor")),h=i.particleFramebuffer;r.viewport.set([0,0,h.width,h.height]);for(const s of o){const[,o,d]=s;r.activeTexture.set(n.TEXTURE0+0),o.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),r.activeTexture.set(n.TEXTURE0+1);const u=d.particleTexture0;u.bind(n.NEAREST,n.CLAMP_TO_EDGE);const _=mr(1,u.size[0],0,o.texture.size,a,l,c,o.textureOffset,o.scale,o.offset);h.colorAttachment.set(d.particleTexture1.texture),r.clear({color:e.al.transparent}),t.getOrCreateProgram("rasterParticleUpdate",{defines:o.defines}).draw(t,n.TRIANGLES,Bi.disabled,Ui.disabled,ki.unblended,ji.disabled,_,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments);}}(t,o,d,_);}(t,i,o,s),"translucent"===t.renderPass&&(function(t,i,o,s,r){const n=t.context,a=n.gl,l=i.getSource().tileSize,c=5*(1-e.ae(e.bY,e.bY+1,t.transform.zoom))*l+o.paint.get("raster-particle-elevation"),h=!t.options.moving,d="globe"===t.transform.projection.name;if(!s.length)return;const[u,_]=t.stencilConfigForOverlap(s),p=[];d&&p.push("PROJECTION_GLOBE_VIEW");const f=t.stencilModeFor3D();for(const s of _){const r=s.toUnwrapped(),l=i.getTile(s);if(!l.rasterParticleState)continue;const _=l.rasterParticleState,m=100;l.registerFadeDuration(m);const g=i.findLoadedParent(s,0),v=Ns(l,g,i,t.transform,m);let y,x;t.terrain&&t.terrain.prepareDrawTile(),n.activeTexture.set(a.TEXTURE0),_.targetColorTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),n.activeTexture.set(a.TEXTURE1),g&&g.rasterParticleState?(g.rasterParticleState.targetColorTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),y=Math.pow(2,g.tileID.overscaledZ-l.tileID.overscaledZ),x=[l.tileID.canonical.x*y%1,l.tileID.canonical.y*y%1]):_.targetColorTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const b=d?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(r,h),w=t.transform,T=tn(w),E=e.cF(s.canonical),S=e.cG(E.getCenter().lat);let C,I,R,D,A;d?(C=Float32Array.from(e.bc(e.cI(s.canonical))),I=Float32Array.from(w.globeMatrix),R=Float32Array.from(e.cE(w)),D=[e.av(w.center.lng),e.aC(w.center.lat)],A=Float32Array.from(e.cH(s.canonical,E,S,w.worldSize/w._pixelsPerMercatorPixel))):(C=new Float32Array(16),I=new Float32Array(9),R=new Float32Array(16),D=[0,0],A=new Float32Array(9));const L=pr(b,C,I,R,A,x||[0,0],e.ag(t.transform.zoom),D,T,y||1,v,c),P=t.isTileAffectedByFog(s),M=t.getOrCreateProgram("rasterParticle",{defines:p,overrideFog:P});if(t.uploadCommonUniforms(n,M,r),d){const e=new Bi(a.LEQUAL,Bi.ReadOnly,t.depthRangeFor3D),i=0,s=t.globeSharedBuffers;if(s){const[r,n,l]=s.getGridBuffers(S,0!==i);M.draw(t,a.TRIANGLES,e,f,ki.alphaBlended,t.renderElevatedRasterBackface?ji.frontCCW:ji.backCCW,L,o.id,r,n,l);}}else {const e=t.depthModeForSublayer(0,Bi.ReadOnly),i=u[s.overscaledZ],{tileBoundsBuffer:r,tileBoundsIndexBuffer:n,tileBoundsSegments:c}=t.getTileBoundsBuffers(l);M.draw(t,a.TRIANGLES,e,i,ki.alphaBlended,ji.disabled,L,o.id,r,n,c);}}t.resetStencilClippingMasks();}(t,i,o,s),t.style.map.triggerRepaint());},background:function(t,i,o,s){const r=o.paint.get("background-color"),n="none"===o.paint.get("background-color-use-theme").constantOr("default"),a=o.paint.get("background-opacity"),l=o.paint.get("background-emissive-strength"),c="viewport"===o.paint.get("background-pitch-alignment");if(0===a)return;const h=t.context,d=h.gl,u=t.transform,_=u.tileSize,p=o.paint.get("background-pattern");let f;if(void 0!==p){if(null===p)return;if(f=t.imageManager.getPattern(e.I.from(p.toString()),o.scope,t.style.getLut(o.scope)),!f)return}const m=!p&&1===r.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==m)return;const g=Ui.disabled,v=t.depthModeForSublayer(0,"opaque"===m?Bi.ReadWrite:Bi.ReadOnly),y=t.colorModeForDrapableLayerRenderPass(l),x=p?"backgroundPattern":"background";let b,w=s;if(w||(b=t.getBackgroundTiles(),w=Object.values(b).map((e=>e.tileID))),p&&(h.activeTexture.set(d.TEXTURE0),t.imageManager.bind(t.context,o.scope)),c){const i=t.getOrCreateProgram(x,{overrideFog:!1,overrideRtt:!0}),s=new Float32Array(e.ad.mat4.identity([])),h=new e.aH(0,0,0,0,0),u=p?xr(s,l,a,t,0,o.scope,f,c,{tileID:h,tileSize:_}):yr(s,l,a,r.toRenderColor(n?null:o.lut));i.draw(t,d.TRIANGLES,v,g,y,ji.disabled,u,o.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments);}else for(const e of w){const m=t.isTileAffectedByFog(e),w=t.getOrCreateProgram(x,{overrideFog:m}),T=e.toUnwrapped(),E=s?e.projMatrix:t.transform.calculateProjMatrix(T);t.prepareDrawTile();const S=i?i.getTile(e):b?b[e.key]:new bt(e,_,u.zoom,t),C=p?xr(E,l,a,t,0,o.scope,f,c,{tileID:e,tileSize:_}):yr(E,l,a,r.toRenderColor(n?null:o.lut));t.uploadCommonUniforms(h,w,T);const{tileBoundsBuffer:I,tileBoundsIndexBuffer:R,tileBoundsSegments:D}=t.getTileBoundsBuffers(S);w.draw(t,d.TRIANGLES,v,g,y,ji.disabled,C,o.id,I,R,D);}},sky:function(t,i,o){const s=t._atmosphere?e.ag(t.transform.zoom):1,r=o.paint.get("sky-opacity")*s;if(0===r)return;const n=t.context,a=o.paint.get("sky-type"),l=new Bi(n.gl.LEQUAL,Bi.ReadOnly,[0,1]),c=t.frameCounter/1e3%1;"atmosphere"===a?"offscreen"===t.renderPass?o.needsSkyboxCapture(t)&&(function(t,i,o,s){const r=t.context,n=r.gl;let a=i.skyboxFbo;if(!a){a=i.skyboxFbo=r.createFramebuffer(32,32,!0,null),i.skyboxGeometry=new fn(r),i.skyboxTexture=r.gl.createTexture(),n.bindTexture(n.TEXTURE_CUBE_MAP,i.skyboxTexture),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,n.LINEAR);for(let e=0;e<6;++e)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,n.RGBA,32,32,0,n.RGBA,n.UNSIGNED_BYTE,null);}r.bindFramebuffer.set(a.framebuffer),r.viewport.set([0,0,32,32]);const l=i.getCenter(t,!0),c=t.getOrCreateProgram("skyboxCapture"),h=new Float64Array(16);e.ad.mat4.identity(h),e.ad.mat4.rotateY(h,h,.5*-Math.PI),mn(t,i,c,h,l,0),e.ad.mat4.identity(h),e.ad.mat4.rotateY(h,h,.5*Math.PI),mn(t,i,c,h,l,1),e.ad.mat4.identity(h),e.ad.mat4.rotateX(h,h,.5*-Math.PI),mn(t,i,c,h,l,2),e.ad.mat4.identity(h),e.ad.mat4.rotateX(h,h,.5*Math.PI),mn(t,i,c,h,l,3),e.ad.mat4.identity(h),mn(t,i,c,h,l,4),e.ad.mat4.identity(h),e.ad.mat4.rotateY(h,h,Math.PI),mn(t,i,c,h,l,5),r.viewport.set([0,0,t.width,t.height]);}(t,o),o.markSkyboxValid(t)):"sky"===t.renderPass&&function(e,t,i,o,s){const r=e.context,n=r.gl,a=e.transform,l=e.getOrCreateProgram("skybox");r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_CUBE_MAP,t.skyboxTexture);const c=((e,t,i,o,s)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:o,u_temporal_offset:s}))(a.skyboxMatrix,t.getCenter(e,!1),0,o,s);e.uploadCommonUniforms(r,l),l.draw(e,n.TRIANGLES,i,Ui.disabled,e.colorModeForRenderPass(),ji.backCW,c,"skybox",t.skyboxGeometry.vertexBuffer,t.skyboxGeometry.indexBuffer,t.skyboxGeometry.segment);}(t,o,l,r,c):"gradient"===a&&"sky"===t.renderPass&&function(t,i,o,s,r){const n=t.context,a=n.gl,l=t.transform,c=t.getOrCreateProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new fn(n)),n.activeTexture.set(a.TEXTURE0);let h=i.colorRampTexture;h||(h=i.colorRampTexture=new e.T(n,i.colorRamp,a.RGBA8)),h.bind(a.LINEAR,a.CLAMP_TO_EDGE);const d=((t,i,o,s,r)=>({u_matrix:t,u_color_ramp:0,u_center_direction:i,u_radius:e.ak(o),u_opacity:s,u_temporal_offset:r}))(l.skyboxMatrix,i.getCenter(t,!1),i.paint.get("sky-gradient-radius"),s,r);t.uploadCommonUniforms(n,c),c.draw(t,a.TRIANGLES,o,Ui.disabled,t.colorModeForRenderPass(),ji.backCW,d,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment);}(t,o,l,r,c);},debug:function(t,i,o,s,r,n){for(let a=0;a<o.length;a++)if(r){const r=1,l=.8,c=new e.al(s.r*l,s.g*l,s.b*l,1);ln(t,i,o[a],s,-r,-r,n),ln(t,i,o[a],s,-r,r,n),ln(t,i,o[a],s,r,r,n),ln(t,i,o[a],s,r,-r,n),ln(t,i,o[a],c,0,0,n);}else ln(t,i,o[a],s,0,0,n);},custom:function(t,i,o,s){const r=t.context,n=o.implementation;if(!t.transform.projection.unsupportedLayers||!t.transform.projection.unsupportedLayers.includes("custom")||t.terrain&&(t.terrain.renderingToTexture||"offscreen"===t.renderPass)&&o.isDraped(i)){if("offscreen"===t.renderPass){const i=n.prerender;if(i){if(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),"globe"===t.transform.projection.name){const o=t.transform.pointMerc;i.call(n,r.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.ag(t.transform.zoom),[o.x,o.y],t.transform.pixelsPerMeterRatio);}else i.call(n,r.gl,t.transform.customLayerMatrix());r.setDirty(),t.setBaseState();}}else if("translucent"===t.renderPass){if(t.terrain&&t.terrain.renderingToTexture){const i=n.renderToTile;if(i){const o=s[0].canonical,a=new e.ac(o.x+s[0].wrap*(1<<o.z),o.y,o.z);r.setDepthMode(Bi.disabled),r.setStencilMode(Ui.disabled),r.setColorMode(t.colorModeForRenderPass()),t.setCustomLayerDefaults(),i.call(n,r.gl,a),r.setDirty(),t.setBaseState();}return}t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(Ui.disabled);const i="3d"===n.renderingMode?new Bi(t.context.gl.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Bi.ReadOnly);if(r.setDepthMode(i),"globe"===t.transform.projection.name){const i=t.transform.pointMerc;n.render(r.gl,t.transform.customLayerMatrix(),t.transform.getProjection(),t.transform.globeToMercatorMatrix(),e.ag(t.transform.zoom),[i.x,i.y],t.transform.pixelsPerMeterRatio);}else n.render(r.gl,t.transform.customLayerMatrix());r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null);}}else e.w("Custom layers are not yet supported with this projection. Use mercator or globe to enable usage of custom layers.");},model:function(t,i,o,s){if("opaque"===t.renderPass)return;const r=o.paint.get("model-opacity").constantOr(1);if(0===r)return;const n=o.paint.get("model-cast-shadows");if("shadow"===t.renderPass){if(!n)return;if(t.terrain&&r<.65&&o._transitionablePaint._values["model-opacity"].value.expression instanceof e.ab)return}const a=t.shadowRenderer,l=o.paint.get("model-receive-shadows");a&&(a.useNormalOffset=!0,l||(a.enabled=!1));const c=()=>{a&&(a.useNormalOffset=!0,l||(a.enabled=!0));},h=i.getSource();if("light-beam"===t.renderPass&&"batched-model"!==h.type)return;if("vector"===h.type||"geojson"===h.type)return function(t,i,o,s,r){const n=t.transform;if("mercator"!==n.projection.name)return void e.w(`Drawing 3D models for ${n.projection.name} projection is not yet implemented`);const a=n.getFreeCameraOptions().position;if(!t.modelManager)return;const l=t.modelManager;o.modelManager=l;const c=t.shadowRenderer;if(!o._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const h=o._unevaluatedLayout._values["model-id"],d=Object.assign({},o.layout.get("model-id").parameters),u=t.style.order.indexOf(o.fqid);for(const _ of s){const s=i.getTile(_).getBucket(o);if(!s||s.projection.name!==n.projection.name)continue;const p=s.getModelUris();p&&!s.modelsRequested&&(l.addModelsFromBucket(p,r),s.modelsRequested=!0);const f=Dn(_,n);d.zoom=f;const m=h.possiblyEvaluate(d);if(In(t,s,_),Rn.shadowUniformsInitialized=!1,Rn.useSingleShadowCascade=!!c&&0===c.getMaxCascadeForTile(_.toUnwrapped()),"shadow"===t.renderPass&&c){if(1===t.currentShadowCascade&&s.isInsideFirstShadowMapFrustum)continue;const i=n.calculatePosMatrix(_.toUnwrapped(),n.worldSize);if(Rn.tileMatrix.set(i),Rn.shadowTileMatrix=Float32Array.from(c.calculateShadowPassMatrixFromMatrix(i)),Rn.aabb.min.fill(0),Rn.aabb.max[0]=Rn.aabb.max[1]=e.ai,Rn.aabb.max[2]=0,Pn(s,Rn,t,o.scope))continue}const g=1<<_.canonical.z,v=[((a.x-_.wrap)*g-_.canonical.x)*e.ai,(a.y*g-_.canonical.y)*e.ai,a.z*g*e.ai];t.conflationActive&&Object.keys(s.instancesPerModel).length>0&&t.style.isLayerClipped(o,i.getSource())&&s.updateReplacement(_,t.replacementSource,u,r)&&(s.uploaded=!1,s.upload(t.context));for(let e in s.instancesPerModel){const i=s.instancesPerModel[e];i.features.length>0&&(e=m.evaluate(i.features[0].feature,{}));const n=l.getModel(e,r);if(n&&n.uploaded)for(const e of n.nodes)An(t,o,e,i,v,_,Rn);}}}(t,i,o,s,"vector"===h.type?o.scope:""),void c();if(!h.loaded())return;if("batched-model"===h.type)return function(t,i,o,s){o.resetLayerRenderingStats(t);const r=t.context,n=t.transform,a=t.style.fog,l=t.shadowRenderer;if("mercator"!==n.projection.name)return void e.w(`Drawing 3D landmark models for ${n.projection.name} projection is not yet implemented`);const c=t.transform.getFreeCameraOptions().position,h=e.ad.vec3.scale([],[c.x,c.y,c.z],t.transform.worldSize),d=e.ad.vec3.negate([],h),u=e.ad.mat4.identity([]),_=e.dm(n.center.lat,n.zoom),p=e.ad.mat4.fromScaling([],[1,1,1/_]);e.ad.mat4.translate(u,u,d);const f=o.paint.get("model-opacity").constantOr(1),m=new Bi(r.gl.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D),g=new Bi(r.gl.LEQUAL,Bi.ReadOnly,t.depthRangeFor3D),v=new e.ce([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),y="shadow"===t.renderPass,x=y&&l?l.getCurrentCascadeFrustum():n.getFrustum(n.scaleZoom(n.worldSize)),b=o.paint.get("model-front-cutoff"),w=b[2]<1,T=Qi(t,o.paint.get("model-cutoff-fade-range")),E=o.getLayerRenderingStats();((function(e,t,i,o){const s=e.terrain?e.terrain.exaggeration():0,r=e.transform.zoom;for(const n of o){const o=t.getTile(n).getBucket(i);o&&(o.setFilter(i.filter),e.conflationActive&&o.updateReplacement(n,e.replacementSource),o.evaluateScale(e,i),e.terrain&&s>0&&o.elevationUpdate(e.terrain,s,n,i.source),o.needsReEvaluation(e,r,i)&&o.evaluate(i));}}))(t,i,o,s),function(){let c,d,S;w?(c=s.length-1,d=-1,S=-1):(c=0,d=s.length,S=1);const C=new Float64Array(16),I=e.ad.vec3.create(),R=new e.P(0,0);for(let D=c;D!==d;D+=S){const c=s[D],d=i.getTile(c).getBucket(o);if(!d||!d.uploaded)continue;let S=!1;l&&(S=0===l.getMaxCascadeForTile(c.toUnwrapped()));const A=n.calculatePosMatrix(c.toUnwrapped(),n.worldSize),L=d.modelTraits;!y&&w&&(e.ad.mat4.invert(C,A),e.ad.vec3.transformMat4(I,h,C),R.x=I[0],R.y=I[1]);const P=[];d.setFilter(o.filter);for(const i of d.getNodesInfo()){if(i.hiddenByReplacement)continue;if(!i.node.meshes)continue;const o=i.node;let s=0;t.terrain&&o.elevation&&(s=o.elevation*t.terrain.exaggeration());const r=(()=>{const t=i.aabb;return v.min=[...t.min],v.max=[...t.max],v.min[2]+=s,v.max[2]+=s,e.ad.vec3.transformMat4(v.min,v.min,A),e.ad.vec3.transformMat4(v.max,v.max,A),v})(),a=i.evaluatedScale;if(a[0]<=1&&a[1]<=1&&a[2]<=1&&0===r.intersects(x))continue;if(!y&&w){const t=1/6;i.cameraCollisionOpacity=h[0]>r.min[0]&&h[0]<r.max[0]&&h[1]>r.min[1]&&h[1]<r.max[1]&&h[2]*_<r.max[2]&&o.footprint&&e.bA(R,o.footprint)?Math.max(i.cameraCollisionOpacity-t,0):Math.min(1,i.cameraCollisionOpacity+t);}const l=[...A],c=o.anchor?o.anchor[0]:0,d=o.anchor?o.anchor[1]:0;e.ad.mat4.translate(l,l,[c*(a[0]-1),d*(a[1]-1),s]),e.ad.vec3.exactEquals(a,e.dq)||e.ad.mat4.scale(l,l,a);const u=e.ad.mat4.multiply([],l,o.matrix),p=e.ad.mat4.multiply([],n.expandedFarZProjMatrix,u),m=e.ad.mat4.multiply([],n.expandedFarZProjMatrix,l),g=e.ad.vec4.transformMat4([],[c,d,s,1],p)[2];o.hidden=!1;let E=f;y||(w&&(E*=i.cameraCollisionOpacity,E*=zn(l,n,i.aabb,b)),E*=Mn(T,g)),0!==E?P.push({nodeInfo:i,depth:g,opacity:E,wvpForNode:p,wvpForTile:m,nodeModelMatrix:u,tileModelMatrix:l}):o.hidden=!0;}y||P.sort(((e,t)=>!w||1===e.opacity&&1===t.opacity?e.depth<t.depth?-1:1:1===e.opacity?-1:1===t.opacity?1:e.depth>t.depth?-1:1));for(const i of P){const s=i.nodeInfo,c=s.node;let h=e.ad.mat4.multiply([],p,i.tileModelMatrix);e.ad.mat4.multiply(h,u,h);const d=e.ad.mat4.invert([],h);e.ad.mat4.transpose(d,d),e.ad.mat4.scale(d,d,Ln),h=e.ad.mat4.multiply(h,h,c.matrix);const _="light-beam"===t.renderPass,f="none"===o.paint.get("model-color-use-theme").constantOr("default"),v=L&e.ds.HasMapboxMeshFeatures,x=v?0:s.evaluatedRMEA[0][2];for(let e=0;e<c.meshes.length;++e){const u=c.meshes[e],p=e===c.lightMeshIndex;let b=i.wvpForNode;if(p){if(!_&&!t.terrain&&t.shadowRenderer){t.currentLayer<t.firstLightBeamLayer&&(t.firstLightBeamLayer=t.currentLayer);continue}b=i.wvpForTile;}else if(_)continue;const w={defines:[]},T=[];if(!y&&l&&(l.useNormalOffset=!!u.normalBuffer),Tn(w.defines,T,u,t,f?null:o.lut),v||w.defines.push("DIFFUSE_SHADED"),S&&w.defines.push("SHADOWS_SINGLE_CASCADE"),E&&(y?E.numRenderedVerticesInShadowPass+=u.vertexArray.length:E.numRenderedVerticesInTransparentPass+=u.vertexArray.length),y){Cn(u,i.nodeModelMatrix,t,o);continue}let C=null;if(a){const e=wn(i.nodeModelMatrix,t.transform);if(C=new Float32Array(e),"globe"!==n.projection.name){const t=u.aabb.min,i=u.aabb.max,[o,s]=a.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);w.overrideFog=o>=Fe||s>=Fe;}}const I=u.material;let R;I.occlusionTexture&&I.occlusionTexture.offsetScale&&(R=I.occlusionTexture.offsetScale,w.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const D=t.getOrCreateProgram("model",w);!y&&l&&l.setupShadowsFromMatrix(i.tileModelMatrix,D,l.useNormalOffset),t.uploadCommonUniforms(r,D,null,C);const A=I.pbrMetallicRoughness;A.metallicFactor=.9,A.roughnessFactor=.5;const L=wr(new Float32Array(b),new Float32Array(h),new Float32Array(d),new Float32Array(c.matrix),t,i.opacity,A.baseColorFactor.toRenderColor(null),I.emissiveFactor,A.metallicFactor,A.roughnessFactor,I,x,o,[0,0,0],R);!p&&(s.hasTranslucentParts||i.opacity<1)&&D.draw(t,r.gl.TRIANGLES,m,Ui.disabled,ki.disabled,ji.backCCW,L,o.id,u.vertexBuffer,u.indexBuffer,u.segments,o.paint,t.transform.zoom,void 0,T),D.draw(t,r.gl.TRIANGLES,p?g:m,Ui.disabled,p||i.opacity<1||s.hasTranslucentParts?ki.alphaBlended:ki.unblended,ji.backCCW,L,o.id,u.vertexBuffer,u.indexBuffer,u.segments,o.paint,t.transform.zoom,void 0,T);}}}}();}(t,i,o,s),void c();if("model"!==h.type)return;const d=h.getModels(),u=[],_=t.transform.getFreeCameraOptions().position,p=e.ad.vec3.scale([],[_.x,_.y,_.z],t.transform.worldSize);e.ad.vec3.negate(p,p);const f=[],m=[];let g=0;for(const i of d){const s=o.paint.get("model-rotation").constantOr(null),r=o.paint.get("model-scale").constantOr(null),n=o.paint.get("model-translation").constantOr(null);i.computeModelMatrix(t,s,r,n,!0,!0,!1);const a=e.ad.mat4.identity([]),l=e.dm(i.position.lat,t.transform.zoom),c=e.ad.mat4.fromScaling([],[1,1,1/l]);e.ad.mat4.translate(a,a,p),u.push({zScaleMatrix:c,negCameraPosMatrix:a});for(const e of i.nodes)Sn(t.transform,e,i.matrix,t.transform.expandedFarZProjMatrix,g,f,m);g++;}if(f.sort(((e,t)=>t.depth-e.depth)),"shadow"!==t.renderPass){if(1===r)for(const e of m)En(e,t,o,u[e.modelIndex],Ui.disabled,t.colorModeForRenderPass());else {for(const e of m)En(e,t,o,u[e.modelIndex],Ui.disabled,ki.disabled);for(const e of m)En(e,t,o,u[e.modelIndex],t.stencilModeFor3D(),t.colorModeForRenderPass());t.resetStencilClippingMasks();}for(const e of f)En(e,t,o,u[e.modelIndex],Ui.disabled,t.colorModeForRenderPass());c();}else {for(const e of m)Cn(e.mesh,e.nodeModelMatrix,t,o);for(const e of f)Cn(e.mesh,e.nodeModelMatrix,t,o);c();}}},Jn={line:function(e,t,i){if(e.hasElevatedBuckets=!1,e.hasNonElevatedBuckets=!1,void 0!==e._unevaluatedLayout.getValue("line-elevation-reference")||void 0!==e._unevaluatedLayout.getValue("line-z-offset")){if(t){const i=t.getVisibleCoordinates();for(const o of i){const i=t.getTile(o).getBucket(e);if(i&&(i.hasZOffset?e.hasElevatedBuckets=!0:e.hasNonElevatedBuckets=!0,e.hasElevatedBuckets&&e.hasNonElevatedBuckets))break}}}else e.hasNonElevatedBuckets=!0;},model:function(e,t,i){const o=t.getSource();if(!o.loaded())return;if("vector"===o.type||"geojson"===o.type)return void(i.modelManager&&i.modelManager.upload(i,"vector"===o.type?e.scope:""));if("batched-model"===o.type)return;if("model"!==o.type)return;const s=o.getModels();for(const e of s)e.upload(i.context);},raster:function(e,t,i){const o=t.getSource();if(!(o instanceof ot&&o.loaded()))return;const s=e.sourceLayer||o.rasterLayerIds&&o.rasterLayerIds[0];if(!s)return;const r=e.paint.get("raster-array-band")||o.getInitialBand(s);if(null==r)return;const n=t.getIds().map((e=>t.getTileByID(e)));for(const e of n)e.updateNeeded(s,r)&&o.prepareTile(e,s,r);},"raster-particle":function(e,t,i){const o=t.getSource();if(!(o instanceof ot&&o.loaded()))return;const s=e.sourceLayer||o.rasterLayerIds&&o.rasterLayerIds[0];if(!s)return;const r=e.paint.get("raster-particle-array-band")||o.getInitialBand(s);if(null==r)return;const n=t.getIds().map((e=>t.getTileByID(e)));for(const e of n)e.updateNeeded(s,r)&&o.prepareTile(e,s,r);}},Qn={fill:Nr};class ea{constructor(t,i,o,s,r){this.context=new Dr(t,i),this.transform=o,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=r,this._timeStamp=e.q.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const n=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const e of n)this._debugParams.enabledLayers[e]=!0;r.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},(()=>{this.style.map.triggerRepaint();})),r.registerParameter(this._debugParams,["Precipitation"],"forceEnablePrecipitation"),r.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),r.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),r.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),r.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const e of n)r.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],e);this.occlusionParams=new kn(r),this.setup(),this.numSublayers=St.maxUnderzooming+St.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.dy,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new oo(this),this._wireframeDebugCache=new Fn,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const a=new e.r({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new e.T(this.context,a,t.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=s;}updateTerrain(e,t){const i=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new js(this,e));const o=this._terrain;this.transform.elevation=i?o:null,o.update(e,this.transform,t),this.transform.elevation&&!o.enabled&&(this.transform.elevation=null);}_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[i,o]=t.getFovAdjustedRange(this.transform._fov);if(i>o)return void(this.transform.fogCullDistSq=null);const s=i+.78*(o-i);this.transform.fogCullDistSq=s*s;}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(e){e&&!this._terrain&&(this._terrain=new js(this,this.style)),this._forceTerrainMode=e;}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,i){if(this.width=t*e.q.devicePixelRatio,this.height=i*e.q.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._mergedLayers[e].resize();}setup(){const t=this.context,i=new e.b5;i.emplaceBack(0,0),i.emplaceBack(e.ai,0),i.emplaceBack(0,e.ai),i.emplaceBack(e.ai,e.ai),this.tileExtentBuffer=t.createVertexBuffer(i,e.b7.members),this.tileExtentSegments=e.b8.simpleSegment(0,0,4,2);const o=new e.b5;o.emplaceBack(0,0),o.emplaceBack(e.ai,0),o.emplaceBack(0,e.ai),o.emplaceBack(e.ai,e.ai),this.debugBuffer=t.createVertexBuffer(o,e.b7.members),this.debugSegments=e.b8.simpleSegment(0,0,4,5);const s=new e.b5;s.emplaceBack(-1,-1),s.emplaceBack(1,-1),s.emplaceBack(-1,1),s.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(s,e.b7.members),this.viewportSegments=e.b8.simpleSegment(0,0,4,2);const r=new e.aU;r.emplaceBack(0,0,0,0),r.emplaceBack(e.ai,0,e.ai,0),r.emplaceBack(0,e.ai,0,e.ai),r.emplaceBack(e.ai,e.ai,e.ai,e.ai),this.mercatorBoundsBuffer=t.createVertexBuffer(r,e.ba.members),this.mercatorBoundsSegments=e.b8.simpleSegment(0,0,4,2);const n=new e.aV;n.emplaceBack(0,1,2),n.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(n);const a=new e.b6;for(const e of [0,1,3,2,0])a.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new e.T(t,new e.r({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA8),this.identityMat=e.ad.mat4.create();const l=this.context.gl;this.stencilClearMode=new Ui({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(performance.now());}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 e=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,e.TRIANGLES,Bi.disabled,this.stencilClearMode,ki.disabled,ji.disabled,Bs(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments);}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={});}_renderTileClippingMasks(e,t,i){if(!t||this.currentStencilSource===t.id||!e.isTileClipped()||!i||0===i.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of i)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=t.id;const o=this.context,s=o.gl;this.nextStencilID+i.length>256&&this.clearStencil(),o.setColorMode(ki.disabled),o.setDepthMode(Bi.disabled);const r=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of i){const i=t.getTile(e),o=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,{tileBoundsBuffer:n,tileBoundsIndexBuffer:a,tileBoundsSegments:l}=this.getTileBoundsBuffers(i);r.draw(this,s.TRIANGLES,Bi.disabled,new Ui({func:s.ALWAYS,mask:0},o,255,s.KEEP,s.KEEP,s.REPLACE),ki.disabled,ji.disabled,Bs(e.projMatrix),"$clipping",n,a,l);}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Ui({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(e);const t=this.context.gl;return new Ui({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,i=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),o=i[i.length-1].overscaledZ,s=i[0].overscaledZ-o+1;if(s>1){this.currentStencilSource=void 0,this.nextStencilID+s>256&&this.clearStencil();const e={};for(let i=0;i<s;i++)e[i+o]=new Ui({func:t.GEQUAL,mask:255},i+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=s,[e,i]}return [{[o]:Ui.disabled},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new ki([t.CONSTANT_COLOR,t.ONE,t.CONSTANT_COLOR,t.ONE],new e.al(i,i,i,0),[!0,!0,!0,!0])}return "opaque"===this.renderPass?ki.unblended:ki.alphaBlended}colorModeForDrapableLayerRenderPass(t){const i=this.context.gl;return (()=>this.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?new ki([i.ONE,i.ONE_MINUS_SRC_ALPHA,i.CONSTANT_ALPHA,i.ONE_MINUS_SRC_ALPHA],new e.al(0,0,0,void 0===t?0:t),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(e,t,i,o=!1){if(this.depthOcclusion)return new Bi(this.context.gl.GREATER,Bi.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!o)return Bi.disabled;const s=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Bi(i||this.context.gl.LEQUAL,t,[s,s])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}blitDepth(){const t=this.context.gl,i=Math.ceil(this.width),o=Math.ceil(this.height),s=this.context.bindFramebuffer.get(),r=t.getParameter(t.TEXTURE_BINDING_2D);this.depthFBO&&this.depthFBO.width===i&&this.depthFBO.height===o||(this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),0!==i&&0!==o&&(this.depthFBO=new Rr(this.context,i,o,!1,"texture"),this.depthTexture=new e.T(this.context,{width:i,height:o,data:null},t.DEPTH24_STENCIL8),this.depthFBO.depthAttachment.set(this.depthTexture.texture))),this.context.bindFramebuffer.set(s),t.bindTexture(t.TEXTURE_2D,r),this.depthFBO&&(t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.depthFBO.framebuffer),t.blitFramebuffer(0,0,i,o,0,0,i,o,t.DEPTH_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(t.FRAMEBUFFER,this.context.bindFramebuffer.current));}updateAverageFPS(){this._fpsHistory.push(0===this._dt?0:1e3/this._dt),this._fpsHistory.length>this._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce(((e,t)=>e+t/this._fpsHistory.length),0));}render(t,i){const o=e.q.now();this._dt=o-this._timeStamp,this._timeStamp=o,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=i;const s=this.style._mergedLayers,r=!(!this.terrain||!this.terrain.enabled),n=()=>this.style._getOrder(r).filter((e=>{const t=s[e];return !(t.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[t.type]}));let a=n(),l=!1,c=!1;for(const e of a){const t=s[e];"circle"===t.type&&(l=!0),"symbol"===t.type&&(t.hasInitialOcclusionOpacityProperties?c=!0:l=!0);}let h=a.map((e=>s[e]));const d=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.q.now()),this.imageManager.beginFrame();let u=0,_=!1;for(const e in d){const t=d[e];t.used&&(t.prepare(this.context),t.getSource().usedInConflation&&++u);}let p=!1;for(const e of h)e.isHidden(this.transform.zoom)||("clip"===e.type&&(p=!0),this.prepareLayer(e));const f={},m={},g={},v={},y={};for(const e in d){const t=d[e];f[e]=t.getVisibleCoordinates(),m[e]=f[e].slice().reverse(),g[e]=t.getVisibleCoordinates(!0).reverse(),v[e]=t.getShadowCasterCoordinates(),y[e]=t.sortCoordinatesByDistance(f[e]);}const x=e=>{const t=this.style.getLayerSourceCache(e);return t&&t.used?t.getSource():null};if(u||p||this._clippingActiveLastFrame){const t=[],i=[];let o=0;for(const e of h)this.isSourceForClippingOrConflation(e,x(e))&&(t.push(e),i.push(o)),o++;if(t&&(p||t.length>1)||this._clippingActiveLastFrame){p=!1;const o=[];for(let s=0;s<t.length;s++){const r=t[s],n=i[s],a=this.style.getLayerSourceCache(r);if(!a||!a.used||!a.getSource().usedInConflation&&"clip"!==r.type)continue;let l=e.dA,c=e.by.None;const h=[];let d=!0;if("clip"===r.type){l=n;for(const t of r.layout.get("clip-layer-types"))c|="model"===t?e.by.Model:"symbol"===t?e.by.Symbol:e.by.FillExtrusion;for(const e of r.layout.get("clip-layer-scope"))h.push(e);r.isHidden(this.transform.zoom)?d=!1:p=!0;}d&&o.push({layer:r.fqid,cache:a,order:l,clipMask:c,clipScope:h});}this.replacementSource.setSources(o),_=!0;}}this._clippingActiveLastFrame=p,_||this.replacementSource.clear(),this.conflationActive=_,this.minCutoffZoom=0,this.longestCutoffRange=0,this.opaquePassCutoff=1/0,this._lastOcclusionLayer=-1,this.layersWithOcclusionOpacity=[];for(let e=0;e<h.length;e++){const t=h[e],i=t.cutoffRange();if(this.longestCutoffRange=Math.max(i,this.longestCutoffRange),i>0){const e=x(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom));}t.is3D(r)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=e),this._lastOcclusionLayer=e);}const b=this.style&&this.style.fog;b?(this._fogVisible=0!==b.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=b.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(g),this.opaquePassCutoff=0,a=n(),h=a.map((e=>s[e])));const w=this._shadowRenderer;if(w){w.updateShadowParameters(this.transform,this.style.directionalLight);for(const e in d)for(const t of f[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(t)||e),w.addShadowReceiver(t.toUnwrapped(),e.min,e.max);}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.dz(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new bn(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const T=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),E=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(T&&!this._snow&&(this._snow=new Kn(this)),!T&&this._snow&&(this._snow.destroy(),delete this._snow),E&&!this._rain&&(this._rain=new $n(this)),!E&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),!U.has(this.context.gl))return;this.renderPass="offscreen";for(const e of h){const i=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const o=i?m[i.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||o&&o.length)&&this.renderLayer(this,i,e,o);}this.depthRangeFor3D=[0,1-(h.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,v)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const S="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),C=(()=>{if(i.showOverdrawInspector)return e.al.black;const t=this.style.fog;if(t&&this.transform.projection.supportsFog){const i=this.style.getLut(t.scope);if(!S){const o="none"===t.properties.get("color-use-theme"),s=t.properties.get("color").toRenderColor(o?null:i).toArray01();return new e.al(...s)}if(S){const o="none"===t.properties.get("space-color-use-theme"),s=t.properties.get("space-color").toRenderColor(o?null:i).toArray01();return new e.al(...s)}}return e.al.transparent})();if(this.context.clear({color:C,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&S&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const e=h[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())continue;const o=i?(e.is3D(r)?y:m)[i.id]:void 0;this._renderTileClippingMasks(e,i,o),this.renderLayer(this,i,e,o);}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&S&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.ag(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){const e=h[this.currentLayer],i=t.getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,i,e,i?m[i.id]:void 0);}function I(e,t){let i;return t&&(i=("symbol"===e.type?g:e.is3D(r)?y:m)[t.id]),i}if(this.renderPass="translucent","globe"===this.transform.projection.name){for(this.renderElevatedRasterBackface=!0,this.currentLayer=0;this.currentLayer<a.length;){const e=h[this.currentLayer];if("raster"===e.type||"raster-particle"===e.type){const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,I(e,i));}++this.currentLayer;}this.renderElevatedRasterBackface=!1;}this.currentLayer=0,this.firstLightBeamLayer=Number.MAX_SAFE_INTEGER;let R=0;w&&(R=w.getShadowCastingLayerCount());let D=!1,A=-1;for(let e=0;e<a.length;++e){const t=h[e];t.isHidden(this.transform.zoom)||t.is3D(r)&&(A=e);}c&&-1===A&&(l=!0);let L=!1;for(;this.currentLayer<a.length;){const e=h[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())++this.currentLayer;else if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer),this._lastOcclusionLayer=Math.max(this.currentLayer,this._lastOcclusionLayer);}else {if(!L&&e.is3D(r)&&!r){const e=this.currentLayer,t=e=>{for(this.currentLayer=0;this.currentLayer<h.length;this.currentLayer++){const t=h[this.currentLayer];if(Qn[t.type]){const i=this.style.getLayerSourceCache(t);Qn[t.type](this,i,t,I(t,i),e);}}};t("initialize"),t("reset"),this.currentLayer=e,L=!0;}if(l&&!D&&this.terrain&&!this.transform.isOrthographic&&(D=!0,this.blitDepth()),c&&-1!==A&&this.currentLayer===A+1&&!this.transform.isOrthographic&&this.blitDepth(),this.terrain||this._renderTileClippingMasks(e,i,i?f[i.id]:void 0),this.renderLayer(this,i,e,I(e,i)),!this.terrain&&w&&R>0&&e.hasShadowPass()&&0==--R&&(w.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=h[this.currentLayer];if(!e.hasLightBeamPass())continue;const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,i?m[i.id]:void 0);}this.currentLayer=e,this.renderPass="translucent";}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const e=this.currentLayer;this.depthOcclusion=!0;for(const e of this.layersWithOcclusionOpacity){this.currentLayer=e;const i=h[this.currentLayer],o=t.getLayerSourceCache(i),s=o?m[o.id]:void 0;this.terrain||this._renderTileClippingMasks(i,o,o?f[o.id]:void 0),this.renderLayer(this,o,i,s);}this.depthOcclusion=!1,this.currentLayer=e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[];}++this.currentLayer;}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let i=null;h.forEach((e=>{const o=t.getLayerSourceCache(e);o&&!e.isHidden(this.transform.zoom)&&o.getVisibleCoordinates().length&&(!i||i.getSource().maxzoom<o.getSource().maxzoom)&&(i=o);})),i&&this.options.showTileBoundaries&&Yn.debug(this,i,i.getVisibleCoordinates(),e.al.red,!1,this.options.showParseStatus);}this.terrain&&this._debugParams.showTerrainProxyTiles&&Yn.debug(this,this.terrain.proxySourceCache,this.terrain.proxyCoords,new e.al(1,.8,.1,1),!0,this.options.showParseStatus),this.options.showPadding&&function(e){const t=e.transform.padding;cn(e,e.transform.height-(t.top||0),3,on),cn(e,t.bottom||0,3,sn),hn(e,t.left||0,3,rn),hn(e,e.transform.width-(t.right||0),3,nn);const i=e.transform.centerPoint;!function(e,t,i,o){dn(e,t-1,i-10,2,20,o),dn(e,t-10,i-1,20,2,o);}(e,i.x,e.transform.height-i.y,an);}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(performance.now()),this.saveCanvasCopy()),_||(this.conflationActive=!1);}prepareLayer(e){this.gpuTimingStart(e);const{unsupportedLayers:t}=this.transform.projection,i=!t||!t.includes(e.type);if(Jn[e.type]&&(i||this.terrain&&"custom"===e.type)){const t=this.style.getLayerSourceCache(e);Jn[e.type](e,t,this);}this.gpuTimingEnd();}renderLayer(e,t,i,o){i.isHidden(this.transform.zoom)||("background"===i.type||"sky"===i.type||"custom"===i.type||"model"===i.type||"raster"===i.type||"raster-particle"===i.type||o&&o.length)&&(this.id=i.id,this.gpuTimingStart(i),e.transform.projection.unsupportedLayers&&e.transform.projection.unsupportedLayers.includes(i.type)&&(!e.terrain||"custom"!==i.type)||"clip"===i.type||Yn[i.type](e,t,i,o,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd());}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery,i=this.context.gl;let o=this.gpuTimers[e.id];o||(o=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:i.createQuery()}),o.calls++,i.beginQuery(t.TIME_ELAPSED_EXT,o.query);}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=this.context.gl,i=t.createQuery();this.deferredRenderGpuTimeQueries.push(i),t.beginQuery(e.TIME_ELAPSED_EXT,i);}}gpuTimingDeferredRenderEnd(){this.options.gpuTimingDeferredRender&&this.context.gl.endQuery(this.context.extTimerQuery.TIME_ELAPSED_EXT);}gpuTimingEnd(){this.options.gpuTiming&&this.context.gl.endQuery(this.context.extTimerQuery.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 i in e){const o=e[i],s=this.context.extTimerQuery,r=s.getQueryParameter(o.query,this.context.gl.QUERY_RESULT)/1e6;s.deleteQueryEXT(o.query),t[i]=r;}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.gl;let i=0;for(const o of e)i+=t.getQueryParameter(o,t.QUERY_RESULT)/1e6,t.deleteQuery(o);return i}translatePosMatrix(t,i,o,s,r){if(!o[0]&&!o[1])return t;const n=r?"map"===s?this.transform.angle:0:"viewport"===s?-this.transform.angle:0;if(n){const e=Math.sin(n),t=Math.cos(n);o=[o[0]*t-o[1]*e,o[0]*e+o[1]*t];}const a=[r?o[0]:e.at(i,o[0],this.transform.zoom),r?o[1]:e.at(i,o[1],this.transform.zoom),0],l=new Float32Array(16);return e.ad.mat4.translate(l,t,a),l}saveTileTexture(e){const t=e.size[0],i=this._tileTextures[t];i?i.push(e):this._tileTextures[t]=[e];}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,t,i){const o=void 0===i?this.terrain&&this.terrain.renderingToTexture:i,s=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(s.push("LIGHTING_3D_MODE"),s.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):o||s.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass&&(this._shadowMapDebug||s.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(s.push("TERRAIN"),this.linearFloatFilteringSupported()&&s.push("TERRAIN_DEM_FLOAT_FORMAT")),"globe"===this.transform.projection.name&&s.push("GLOBE"),!this._fogVisible||o||void 0!==t&&!t||s.push("FOG","FOG_DITHERING"),o&&s.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&s.push("OVERDRAW_INSPECTOR"),s}getOrCreateProgram(e,t){this.cache=this.cache||{};const i=t&&t.defines||[],o=t&&t.config,s=this.currentGlobalDefines(e,t&&t.overrideFog,t&&t.overrideRtt).concat(i),r=Ws.cacheKey(Uo[e],e,s,o);return this.cache[r]||(this.cache[r]=new Ws(this.context,e,Uo[e],o,Er[e],s)),this.cache[r]}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=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8));}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy();}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile();}uploadCommonLightUniforms(t,i){if(this.style.enable3dLights()){const o=this.style.directionalLight,s=this.style.ambientLight;if(o&&s){const r=((t,i,o)=>{const s=t.properties.get("direction"),r="none"===t.properties.get("color-use-theme"),n=t.properties.get("color").toRenderColor(r?null:o.getLut(t.scope)).toArray01(),a=t.properties.get("intensity"),l="none"===i.properties.get("color-use-theme"),c=i.properties.get("color").toRenderColor(l?null:o.getLut(i.scope)).toArray01(),h=i.properties.get("intensity"),d=[s.x,s.y,s.z],u=e.cN(c,h),_=e.cN(n,a);return {u_lighting_ambient_color:u,u_lighting_directional_dir:d,u_lighting_directional_color:_,u_ground_radiance:qs(d,_,u)}})(o,s,this.style);i.setLightsUniformValues(t,r);}}}uploadCommonUniforms(t,i,o,s,r){if(this.uploadCommonLightUniforms(t,i),this.terrain&&this.terrain.renderingToTexture)return;const n=this.style.fog;if(n){const r=n.getOpacity(this.transform.pitch),a=((t,i,o,s,r,n,a,l,c,h,d,u)=>{const _=t.transform,p="none"===i.properties.get("color-use-theme"),f=i.properties.get("color").toRenderColor(p?null:t.style.getLut(i.scope)).toArray01();f[3]=s;const m=t.frameCounter/1e3%1,[g,v]=i.properties.get("vertical-range");return {u_fog_matrix:o?_.calculateFogTileMatrix(o):u||t.identityMat,u_fog_range:i.getFovAdjustedRange(_._fov),u_fog_color:f,u_fog_horizon_blend:i.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(g,v),v],u_fog_temporal_offset:m,u_frustum_tl:r,u_frustum_tr:n,u_frustum_br:a,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:h,u_viewport:d,u_globe_transition:e.ag(_.zoom),u_is_globe:+("globe"===_.projection.name)}})(this,n,o,r,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.q.devicePixelRatio,this.transform.height*e.q.devicePixelRatio],s);i.setFogUniformValues(t,a);}r&&i.setCutoffUniformValues(t,r.uniformValues);}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 e=this._backgroundTiles,t=this._backgroundTiles={},i=this.transform.coveringTiles({tileSize:512});for(const o of i)t[o.key]=e[o.key]||new bt(o,512,this.transform.tileZoom,this);return t}clearBackgroundTiles(){this._backgroundTiles={};}isSourceForClippingOrConflation(e,t){return !(!e.is3D(!(!this.terrain||!this.terrain.enabled))||"clip"!==e.type&&(e.minzoom&&e.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==e.sourceLayer)&&(!t||"batched-model"!==t.type)))}isTileAffectedByFog(e){if(!this.style||!this.style.fog)return !1;if("globe"===this.transform.projection.name)return !0;let t=this._cachedTileFogOpacities[e.key];return t||(this._cachedTileFogOpacities[e.key]=t=this.style.fog.getOpacityForTile(e)),t[0]>=Fe||t[1]>=Fe}setupDepthForOcclusion(e,t,i){const o=this.context,s=o.gl,r=!!i;var n;i||(i={u_dem:2,u_dem_prev:4,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_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),o.activeTexture.set(s.TEXTURE3),e&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE),i.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],i.u_depth_range_unpack=[2/((n=this.depthRangeFor3D)[1]-n[0]),-1-2*n[0]/(n[1]-n[0])],i.u_occluder_half_size=.5*this.occlusionParams.occluderSize,i.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE),o.activeTexture.set(s.TEXTURE0),r||t.setTerrainUniformValues(o,i);}}function ta(e,t){let i=!1,o=null;const s=()=>{o=null,i&&(e(),o=setTimeout(s,t),i=!1);};return ()=>(i=!0,o||s(),o)}class ia{constructor(t){this._hashName=t&&encodeURIComponent(t),e.aQ(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=ta(this._updateHashUnthrottled.bind(this),300);}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return "";const t=oa(e);if(this._hashName){const e=this._hashName;let i=!1;const o=location.hash.slice(1).split("&").map((o=>{const s=o.split("=")[0];return s===e?(i=!0,`${s}=${t}`):o})).filter((e=>e));return i||o.push(`${e}=${t}`),`#${o.join("&")}`}return `#${t}`}_getCurrentHash(){const e=location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e);})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._map;if(!e)return !1;const t=this._getCurrentHash();if(t.length>=3&&!t.some((e=>isNaN(e)))){const i=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0}return !1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()));}}function oa(e,t){const i=e.getCenter(),o=Math.round(100*e.getZoom())/100,s=Math.ceil((o*Math.LN2+Math.log(512/360/.5))/Math.LN10),r=Math.pow(10,s),n=Math.round(i.lng*r)/r,a=Math.round(i.lat*r)/r,l=e.getBearing(),c=e.getPitch();let h=t?`/${n}/${a}/${o}`:`${o}/${a}/${n}`;return (l||c)&&(h+="/"+Math.round(10*l)/10),c&&(h+=`/${Math.round(c)}`),h}const sa={linearity:.3,easing:e.dB(0,0,.3,1)},ra=e.l({deceleration:2500,maxSpeed:1400},sa),na=e.l({deceleration:20,maxSpeed:1400},sa),aa=e.l({deceleration:1e3,maxSpeed:360},sa),la=e.l({deceleration:1e3,maxSpeed:90},sa);class ca{constructor(e){this._map=e,this.clear();}clear(){this._inertiaBuffer=[];}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.q.now(),settings:t});}_drainInertiaBuffer(){const t=this._inertiaBuffer,i=e.q.now();for(;t.length>0&&i-t[0].time>160;)t.shift();}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);const o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(i.pan.mag()){const r=da(i.pan.mag(),o,e.l({},ra,t||{}));s.offset=i.pan.mult(r.amount/i.pan.mag()),s.center=this._map.transform.center,ha(s,r);}if(i.zoom){const e=da(i.zoom,o,na);s.zoom=this._map.transform.zoom+e.amount,ha(s,e);}if(i.bearing){const t=da(i.bearing,o,aa);s.bearing=this._map.transform.bearing+e.ay(t.amount,-179,179),ha(s,t);}if(i.pitch){const e=da(i.pitch,o,la);s.pitch=this._map.transform.pitch+e.amount,ha(s,e);}if(s.zoom||s.bearing){const e=void 0===i.pinchAround?i.around:i.pinchAround;s.around=e?this._map.unproject(e):this._map.getCenter();}return this.clear(),s.noMoveStart=!0,s}}function ha(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing);}function da(t,i,o){const{maxSpeed:s,linearity:r,deceleration:n}=o,a=e.ay(t*r/(i/1e3),-s,s),l=Math.abs(a)/(n*r);return {easing:o.easing,duration:1e3*l,amount:a*(l/2)}}class ua extends e.A{preventDefault(){this._defaultPrevented=!0;}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,o,s={}){const r=g(i.getCanvasContainer(),o),n=i.unproject(r);super(t,e.l({point:r,lngLat:n,originalEvent:o},s)),this._defaultPrevented=!1,this.target=i;}}class _a extends e.A{preventDefault(){this._defaultPrevented=!0;}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,o){const s="touchend"===t?o.changedTouches:o.touches,r=v(i.getCanvasContainer(),s),n=r.map((e=>i.unproject(e))),a=r.reduce(((e,t,i,o)=>e.add(t.div(o.length))),new e.P(0,0));super(t,{points:r,point:a,lngLats:n,lngLat:i.unproject(a),originalEvent:o}),this._defaultPrevented=!1;}}class pa extends e.A{preventDefault(){this._defaultPrevented=!0;}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1;}}class fa{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance;}reset(){this._mousedownPos=void 0;}wheel(e){return this._firePreventable(new pa(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new ua(e.type,this._map,e))}mouseup(e){this._map.fire(new ua(e.type,this._map,e));}preclick(t){const i=e.l({},t);i.type="preclick",this._map.fire(new ua(i.type,this._map,i));}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new ua(e.type,this._map,e)));}dblclick(e){return this._firePreventable(new ua(e.type,this._map,e))}mouseover(e){this._map.fire(new ua(e.type,this._map,e));}mouseout(e){this._map.fire(new ua(e.type,this._map,e));}touchstart(e){return this._firePreventable(new _a(e.type,this._map,e))}touchmove(e){this._map.fire(new _a(e.type,this._map,e));}touchend(e){this._map.fire(new _a(e.type,this._map,e));}touchcancel(e){this._map.fire(new _a(e.type,this._map,e));}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return {}}isEnabled(){return !0}isActive(){return !1}enable(){}disable(){}}class ma{constructor(e){this._map=e;}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0;}mousemove(e){this._map.fire(new ua(e.type,this._map,e));}mousedown(){this._delayContextMenu=!0;}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ua("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent);}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new ua(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault();}isEnabled(){return !0}isActive(){return !1}enable(){}disable(){}}class ga{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&&(_(),this._startPos=this._lastPos=t,this._active=!0);}mousemoveWindow(e,t){if(!this._active)return;const i=t,o=this._startPos,s=this._lastPos;if(!o||!s||s.equals(i)||!this._box&&i.dist(o)<this._clickTolerance)return;this._lastPos=i,this._box||(this._box=l("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const r=Math.min(o.x,i.x),n=Math.max(o.x,i.x),a=Math.min(o.y,i.y),c=Math.max(o.y,i.y);this._map._requestDomTask((()=>{this._box&&(this._box.style.transform=`translate(${r}px,${a}px)`,this._box.style.width=n-r+"px",this._box.style.height=c-a+"px");}));}mouseupWindow(t,i){if(!this._active)return;const o=this._startPos,s=i;if(o&&0===t.button){if(this.reset(),m(),o.x!==s.x||o.y!==s.y)return this._map.fire(new e.A("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(o,s,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),p(),delete this._startPos,delete this._lastPos;}_fireEvent(t,i){return this._map.fire(new e.A(t,{originalEvent:i}))}}function va(e,t){const i={};for(let o=0;o<e.length;o++)i[e[o].identifier]=t[o];return i}class ya{constructor(e){this.reset(),this.numTouches=e.numTouches;}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1;}touchstart(t,i,o){(this.centroid||o.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),o.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=va(o,i)));}touchmove(e,t,i){if(this.aborted||!this.centroid)return;const o=va(i,t);for(const e in this.touches){const t=o[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0);}}touchend(e,t,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class xa{constructor(e){this.singleTap=new ya(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,i){this.singleTap.touchstart(e,t,i);}touchmove(e,t,i){this.singleTap.touchmove(e,t,i);}touchend(e,t,i){const o=this.singleTap.touchend(e,t,i);if(o){const t=e.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(o)<30;if(t&&i||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}}}class ba{constructor(){this._zoomIn=new xa({numTouches:1,numTaps:2}),this._zoomOut=new xa({numTouches:2,numTaps:1}),this.reset();}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset();}touchstart(e,t,i){this._zoomIn.touchstart(e,t,i),this._zoomOut.touchstart(e,t,i);}touchmove(e,t,i){this._zoomIn.touchmove(e,t,i),this._zoomOut.touchmove(e,t,i);}touchend(e,t,i){const o=this._zoomIn.touchend(e,t,i),s=this._zoomOut.touchend(e,t,i);return o?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(o)},{originalEvent:e})}):s?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(s)},{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 wa={0:1,2:2},Ta={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class Ea{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 i=y(e);this._correctButton(e,i)&&(this._lastPoint=t,this._eventButton=i);}mousemoveWindow(e,t){const i=this._lastPoint;if(i)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const i=wa[t];return void 0===e.buttons||(e.buttons&i)!==i}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(i,t)}mouseupWindow(e){this._lastPoint&&y(e)===this._eventButton&&(this._moved&&m(),this.reset());}enable(){this._enabled=!0;}disable(){this._enabled=!1,this.reset();}isEnabled(){return this._enabled}isActive(){return this._active}}class Sa extends Ea{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 Ca extends Ea{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?Ta[e.pitchRotateKey]:void 0;}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=.8*(t.x-e.x);if(i)return this._active=!0,{bearingDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault();}}class Ia extends Ea{constructor(e){super(e),this._pitchRotateKey=e.pitchRotateKey?Ta[e.pitchRotateKey]:void 0;}_correctButton(e,t){return this._pitchRotateKey?0===t&&e[this._pitchRotateKey]:0===t&&e.ctrlKey||2===t}_move(e,t){const i=-.5*(t.y-e.y);if(i)return this._active=!0,{pitchDelta:i}}contextmenu(e){this._pitchRotateKey||e.preventDefault();}}class Ra{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset(),e.aQ(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this);}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0);}touchstart(e,t,i){return this._calculateTransform(e,t,i)}touchmove(t,i,o){if(this._active&&!(o.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===o.length&&!e.dC())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,i,o)}}touchend(e,t,i){this._calculateTransform(e,t,i),this._active&&i.length<this._minTouches&&this.reset();}touchcancel(){this.reset();}_calculateTransform(t,i,o){o.length>0&&(this._active=!0);const s=va(o,i),r=new e.P(0,0),n=new e.P(0,0);let a=0;for(const e in s){const t=s[e],i=this._touches[e];i&&(r._add(t),n._add(t.sub(i)),a++,s[e]=t);}if(this._touches=s,a<this._minTouches||!n.mag())return;const l=n.div(a);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:r.div(a),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=l("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=window.setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role");}),500);}}class Da{constructor(){this.reset();}reset(){this._active=!1,this._firstTwoTouches=void 0;}_start(e){}_move(e,t,i){return {}}touchstart(e,t,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([t[0],t[1]]));}touchmove(e,t,i){const o=this._firstTwoTouches;if(!o)return;e.preventDefault();const[s,r]=o,n=Aa(i,t,s),a=Aa(i,t,r);if(!n||!a)return;const l=this._aroundCenter?null:n.add(a).div(2);return this._move([n,a],l,e)}touchend(e,t,i){if(!this._firstTwoTouches)return;const[o,s]=this._firstTwoTouches,r=Aa(i,t,o),n=Aa(i,t,s);r&&n||(this._active&&m(),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 Aa(e,t,i){for(let o=0;o<e.length;o++)if(e[o].identifier===i)return t[o]}function La(e,t){return Math.log(e/t)/Math.LN2}class Pa extends Da{reset(){super.reset(),this._distance=0,this._startDistance=0;}_start(e){this._startDistance=this._distance=e[0].dist(e[1]);}_move(e,t){const i=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(La(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:La(this._distance,i),pinchAround:t}}}function Ma(e,t){return 180*e.angleWith(t)/Math.PI}class za extends Da{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 i=this._vector;if(this._vector=e[0].sub(e[1]),i&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Ma(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,i=this._startVector;if(!i)return !1;const o=Ma(e,i);return Math.abs(o)<t}}function Oa(e){return Math.abs(e.y)>Math.abs(e.x)}class Fa extends Da{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,Oa(e[0].sub(e[1]))&&(this._valid=!1);}_move(t,i,o){const s=this._lastPoints;if(!s)return;const r=t[0].sub(s[0]),n=t[1].sub(s[1]);return this._map._cooperativeGestures&&!e.dC()&&o.touches.length<3||(this._valid=this.gestureBeginsVertically(r,n,o.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+n.y)/2*-.5})}gestureBeginsVertically(e,t,i){if(void 0!==this._valid)return this._valid;const o=e.mag()>=2,s=t.mag()>=2;if(!o&&!s)return;if(!o||!s)return null==this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const r=e.y>0==t.y>0;return Oa(e)&&Oa(t)&&r}}const ka={panStep:100,bearingStep:15,pitchStep:10};class Ba{constructor(){const e=ka;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,i=0,o=0,s=0,r=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?i=-1:(e.preventDefault(),s=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),s=1);break;case 38:e.shiftKey?o=1:(e.preventDefault(),r=-1);break;case 40:e.shiftKey?o=-1:(e.preventDefault(),r=1);break;default:return}return this._rotationDisabled&&(i=0,o=0),{cameraAnimation:n=>{const a=n.getZoom();n.easeTo({duration:300,easeId:"keyboardHandler",easing:Na,zoom:t?Math.round(a)+t*(e.shiftKey?2:1):a,bearing:n.getBearing()+i*this._bearingStep,pitch:n.getPitch()+o*this._pitchStep,offset:[-s*this._panStep,-r*this._panStep],center:n.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 Na(e){return e*(2-e)}const Ua=4.000244140625,Va=1/450;class Ga{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._handler=i,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Va,e.aQ(["_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.dC()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer));}let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const o=e.q.now(),s=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,0!==i&&i%Ua==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=i,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(s*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,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=g(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 i=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>Ua?this._wheelZoomRate:this._defaultZoomRate;let o=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==o&&(o=1/o);const s=i(),r=Math.pow(2,s),n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):r;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*o))),"wheel"===this._type&&(this._startZoom=s,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0;}const o="number"==typeof this._targetZoom?this._targetZoom:i(),s=this._startZoom,r=this._easing;let n,a=!1;if("wheel"===this._type&&s&&r){const t=Math.min((e.q.now()-this._lastWheelEventTime)/200,1),i=r(t);n=e.ah(s,o,i),t<1?this._frameId||(this._frameId=!0):a=!0;}else n=o,a=!0;this._active=!0,a&&(this._active=!1,this._finishTimeout=window.setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout;}),200));let l=n-i();return l*this._lastDelta<0&&(l=0),{noInertia:!0,needsRenderFrame:!a,zoomDelta:l,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.dD;if(this._prevEase){const t=this._prevEase,o=(e.q.now()-t.start)/t.duration,s=t.easing(o+.01)-t.easing(o),r=.27/Math.sqrt(s*s+1e-4)*.01,n=Math.sqrt(.0729-r*r);i=e.dB(r,n,.25,1);}return this._prevEase={start:e.q.now(),duration:t,easing:i},i}blur(){this.reset();}reset(){this._active=!1;}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=l("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(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=window.setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role");}),200);}}class ja{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 qa{constructor(){this.reset();}reset(){this._active=!1;}blur(){this.reset();}dblclick(e,t){return e.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(e.shiftKey?-1:1),around:i.unproject(t)},{originalEvent:e});}}}enable(){this._enabled=!0;}disable(){this._enabled=!1,this.reset();}isEnabled(){return this._enabled}isActive(){return this._active}}class Ha{constructor(){this._tap=new xa({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,i){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=t[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(e,t,i));}touchmove(e,t,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const o=t[0],s=o.y-this._swipePoint.y;return this._swipePoint=o,e.preventDefault(),this._active=!0,{zoomDelta:s/128}}}else this._tap.touchmove(e,t,i);}touchend(e,t,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(e,t,i)&&(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 Za{constructor(e,t,i){this._el=e,this._mousePan=t,this._touchPan=i;}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 Wa{constructor(e,t,i){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=i;}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 $a{constructor(e,t,i,o){this._el=e,this._touchZoom=t,this._touchRotate=i,this._tapDragZoom=o,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 Xa=e=>e.zoom||e.drag||e.pitch||e.rotate;class Ka extends e.A{}class Ya{constructor(){this.constants=[1,1,.01],this.radius=0;}setup(t,i){const o=e.ad.vec3.sub([],i,t);this.radius=e.ad.vec3.length(o[2]<0?e.ad.vec3.div([],o,this.constants):[o[0],o[1],0]);}projectRay(t){e.ad.vec3.div(t,t,this.constants),e.ad.vec3.normalize(t,t),e.ad.vec3.mul(t,t,this.constants);const i=e.ad.vec3.scale([],t,this.radius);if(i[2]>0){const t=e.ad.vec3.scale([],[0,0,1],e.ad.vec3.dot(i,[0,0,1])),o=e.ad.vec3.scale([],e.ad.vec3.normalize([],[i[0],i[1],0]),this.radius),s=e.ad.vec3.add([],i,e.ad.vec3.scale([],e.ad.vec3.sub([],e.ad.vec3.add([],o,t),i),2));i[0]=s[0],i[1]=s[1];}return i}}function Ja(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Qa{constructor(t,i){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ca(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Ya,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),e.aQ(["handleEvent","handleWindowEvent"],this);const o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,t,i]of this._listeners){const o=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(t,o,i);}}destroy(){for(const[e,t,i]of this._listeners){const o=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(t,o,i);}}_addDefaultHandlers(e){const t=this._map,i=t.getCanvasContainer();this._add("mapEvent",new fa(t,e));const o=t.boxZoom=new ga(t,e);this._add("boxZoom",o);const s=new ba,r=new qa;t.doubleClickZoom=new ja(r,s),this._add("tapZoom",s),this._add("clickZoom",r);const n=new Ha;this._add("tapDragZoom",n);const a=t.touchPitch=new Fa(t);this._add("touchPitch",a);const l=new Ca(e),c=new Ia(e);t.dragRotate=new Wa(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const h=new Sa(e),d=new Ra(t,e);t.dragPan=new Za(i,h,d),this._add("mousePan",h),this._add("touchPan",d,["touchZoom","touchRotate"]);const u=new za,_=new Pa;t.touchZoomRotate=new $a(i,_,u,n),this._add("touchRotate",u,["touchPan","touchZoom"]),this._add("touchZoom",_,["touchPan","touchRotate"]),this._add("blockableMapEvent",new ma(t));const p=t.scrollZoom=new Ga(t,this);this._add("scrollZoom",p,["mousePan"]);const f=t.keyboard=new Ba;this._add("keyboard",f);for(const i of ["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[i]&&t[i].enable(e[i]);}_add(e,t,i){this._handlers.push({handlerName:e,handler:t,allowed:i}),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=[],this._originalZoom=void 0;}}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 !!Xa(this._eventsInProgress)||this.isZooming()}_isDragging(){return !!this._eventsInProgress.drag}_blockedByActive(e,t,i){for(const o in e)if(o!==i&&(!t||t.indexOf(o)<0))return !0;return !1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`);}_getMapTouches(e){const t=[];for(const i of e)this._el.contains(i.target)&&t.push(i);return t}handleEvent(e,t){this._updatingCamera=!0;const i="renderFrame"===e.type,o=i?void 0:e,s={needsRenderFrame:!1},r={},n={},a=e.touches?this._getMapTouches(e.touches):void 0,l=a?v(this._el,a):i?void 0:g(this._el,e);for(const{handlerName:i,handler:c,allowed:h}of this._handlers){if(!c.isEnabled())continue;let d;this._blockedByActive(n,h,i)?c.reset():c[t||e.type]&&(d=c[t||e.type](e,l,a),this.mergeHandlerResult(s,r,d,i,o),d&&d.needsRenderFrame&&this._triggerRenderFrame()),(d||c.isActive())&&(n[i]=c);}const c={};for(const e in this._previousActiveHandlers)n[e]||(c[e]=o);this._previousActiveHandlers=n,(Object.keys(c).length||Ja(s))&&(this._changes.push([s,r,c]),this._triggerRenderFrame()),(Object.keys(n).length||Ja(s))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=s;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map));}mergeHandlerResult(t,i,o,s,r){if(!o)return;e.l(t,o);const n={handlerName:s,originalEvent:o.originalEvent||r};void 0!==o.zoomDelta&&(i.zoom=n),void 0!==o.panDelta&&(i.drag=n),void 0!==o.pitchDelta&&(i.pitch=n),void 0!==o.bearingDelta&&(i.rotate=n);}_applyChanges(){const t={},i={},o={};for(const[s,r,n]of this._changes)s.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(s.panDelta)),s.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(t.around=s.around),void 0!==s.aroundCoord&&(t.aroundCoord=s.aroundCoord),void 0!==s.pinchAround&&(t.pinchAround=s.pinchAround),s.noInertia&&(t.noInertia=s.noInertia),e.l(i,r),e.l(o,n);this._updateMapTransform(t,i,o),this._changes=[];}_updateMapTransform(t,i,o){const s=this._map,r=s.transform,n=e=>[e.x,e.y,e.z];if((e=>{const t=this._eventsInProgress.drag;return t&&!this._handlersById[t.handlerName].isActive()})()&&!Ja(t)){const e=r.zoom;r.cameraElevationReference="sea",null!=this._originalZoom&&r._orthographicProjectionAtLowPitch&&"globe"!==r.projection.name&&0===r.pitch?(r.cameraElevationReference="ground",r.zoom=this._originalZoom):(r.recenterOnTerrain(),r.cameraElevationReference="ground"),e!==r.zoom&&this._map._update(!0);}if(r._isCameraConstrained&&s._stop(!0),!Ja(t))return void this._fireEvents(i,o,!0);let{panDelta:a,zoomDelta:l,bearingDelta:c,pitchDelta:h,around:d,aroundCoord:u,pinchAround:_}=t;r._isCameraConstrained&&(l>0&&(l=0),r._isCameraConstrained=!1),void 0!==_&&(d=_),(l||(e=>i[e]&&!this._eventsInProgress[e])("drag"))&&d&&(this._dragOrigin=n(r.pointCoordinate3D(d)),this._originalZoom=r.zoom,this._trackingEllipsoid.setup(r._camera.position,this._dragOrigin)),r.cameraElevationReference="sea",s._stop(!0),d=d||s.transform.centerPoint,c&&(r.bearing+=c),h&&(r.pitch+=h),r._updateCameraState();const p=[0,0,0];if(a)if("mercator"===r.projection.name){const e=this._trackingEllipsoid.projectRay(r.screenPointToMercatorRay(d).dir),t=this._trackingEllipsoid.projectRay(r.screenPointToMercatorRay(d.sub(a)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1];}else {const t=r.pointCoordinate(d);if("globe"===r.projection.name){a=a.rotate(-r.angle);const i=r._pixelsPerMercatorPixel/r.worldSize;p[0]=-a.x*e.dE(e.aT(t.y))*i,p[1]=-a.y*e.dE(r.center.lat)*i;}else {const e=r.pointCoordinate(d.sub(a));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y);}}const f=r.zoom,m=[0,0,0];if(l){const t=n(u||r.pointCoordinate3D(d)),i={dir:e.ad.vec3.normalize([],e.ad.vec3.sub([],t,r._camera.position))};if(i.dir[2]<0){const o=r.zoomDeltaToMovement(t,l);e.ad.vec3.scale(m,i.dir,o);}}const g=e.ad.vec3.add(p,p,m);r._translateCameraConstrained(g),l&&Math.abs(r.zoom-f)>1e-4&&r.recenterOnTerrain(),r.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(i,o,!0);}_fireEvents(t,i,o){const s=Xa(this._eventsInProgress),r=Xa(t),n={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(n[`${e}start`]=i),this._eventsInProgress[e]=t[e];}!s&&r&&this._fireEvent("movestart",r.originalEvent);for(const e in n)this._fireEvent(e,n[e]);r&&this._fireEvent("move",r.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i);}const a={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:o}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=i[t]||o,a[`${e}end`]=l);}for(const e in a)this._fireEvent(e,a[e]);const c=Xa(this._eventsInProgress);if(o&&(s||r)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;t?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.A("moveend",{originalEvent:l})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1;}}_fireEvent(t,i){this._map.fire(new e.A(t,i?{originalEvent:i}:{}));}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{this._frameId=void 0,this.handleEvent(new Ka("renderFrame",{timeStamp:e})),this._applyChanges();}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame());}}const el="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class tl extends e.E{constructor(t,i){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this._respectPrefersReducedMotion=!1!==i.respectPrefersReducedMotion,e.aQ(["_renderFrameCallback"],this);}getCenter(){return new e.bO(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,i,o){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.l({offset:t},i),o)}panTo(t,i,o){return this.easeTo(e.l({center:t},i),o)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,i,o){return this.easeTo(e.l({zoom:t},i),o)}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,i,o){return this.easeTo(e.l({bearing:t},i),o)}resetNorth(t,i){return this.rotateTo(0,e.l({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.l({bearing:0,pitch:0,duration:1e3},t),i),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,i){t=e.aB.convert(t);const o=i&&i.bearing||0,s=i&&i.pitch||0,r=t.getNorthWest(),n=t.getSouthEast();return this._cameraForBounds(this.transform,r,n,o,s,i)}_extendPadding(t){const i={top:0,right:0,bottom:0,left:0};return null==t?e.l({},i,this.transform.padding):"number"==typeof t?{top:t,bottom:t,right:t,left:t}:e.l({},i,t)}_extendCameraOptions(t){return (t=e.l({offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding=this._extendPadding(t.padding),t}_minimumAABBFrustumDistance(e,t){const i=t.max[0]-t.min[0],o=t.max[1]-t.min[1];return i/o>e.aspect?i/(2*Math.tan(.5*e.fovX)*e.aspect):o/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,i,o,s,r,n){const a=t.clone(),l=this._extendCameraOptions(n);a.bearing=s,a.pitch=r;const c=e.bO.convert(i),h=e.bO.convert(o),d=.5*(c.lat+h.lat),u=.5*(c.lng+h.lng),_=e.dF(d,u),p=e.ad.vec3.normalize([],_),f=e.ad.vec3.normalize([],e.ad.vec3.cross([],p,[0,1,0])),m=e.ad.vec3.cross([],f,p),g=[f[0],f[1],f[2],0,m[0],m[1],m[2],0,p[0],p[1],p[2],0,0,0,0,1],v=[_,e.dF(c.lat,c.lng),e.dF(h.lat,c.lng),e.dF(h.lat,h.lng),e.dF(c.lat,h.lng),e.dF(d,c.lng),e.dF(d,h.lng),e.dF(c.lat,u),e.dF(h.lat,u)];let y=e.ce.fromPoints(v.map((t=>[e.ad.vec3.dot(f,t),e.ad.vec3.dot(m,t),e.ad.vec3.dot(p,t)])));const x=e.ad.vec3.transformMat4([],y.center,g);0===e.ad.vec3.squaredLength(x)&&e.ad.vec3.set(x,0,0,1),e.ad.vec3.normalize(x,x),e.ad.vec3.scale(x,x,e.az),a.center=e.dG(x);const b=a.getWorldToCameraMatrix(),w=e.ad.mat4.invert(new Float64Array(16),b);y=e.ce.applyTransform(y,e.ad.mat4.multiply([],b,g));const T=this._extendAABB(y,a,l,s);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");y=T,e.ad.vec3.transformMat4(x,x,b);const E=.5*(y.max[2]-y.min[2]),S=this._minimumAABBFrustumDistance(a,y),C=e.ad.vec3.scale([],[0,0,1],E),I=e.ad.vec3.add(C,x,C),R=S+(0===a.pitch?0:e.ad.vec3.distance(x,I)),D=a.globeCenterInViewSpace,A=e.ad.vec3.sub([],x,[D[0],D[1],D[2]]);e.ad.vec3.normalize(A,A),e.ad.vec3.scale(A,A,R);const L=e.ad.vec3.add([],x,A);e.ad.vec3.transformMat4(L,L,w);const P=e.dv/e.az,M=e.ad.vec3.length(L),z=e.bH(Math.max(M*P-e.dv,Number.EPSILON),0),O=Math.min(a.zoomFromMercatorZAdjusted(z),l.maxZoom);return O>.5*(e.c6+e.bY)?(a.setProjection({name:"mercator"}),a.zoom=O,this._cameraForBounds(a,i,o,s,r,n)):{center:a.center,zoom:O,bearing:s,pitch:r}}_extendAABB(t,i,o,s){const r=.5*((o.padding.left||0)+(o.padding.right||0)),n=.5*((o.padding.top||0)+(o.padding.bottom||0)),a=n,l=r,c=r,h=n,d=i.width-(l+c),u=i.height-(a+h),_=e.ad.vec3.sub([],t.max,t.min),p=Math.min(d/_[0],u/_[1]),f=Math.min(i.scaleZoom(i.scale*p),o.maxZoom);if(isNaN(f))return null;const m=i.scale/i.zoomScale(f),g=new e.ce([t.min[0]-l*m,t.min[1]-h*m,t.min[2]],[t.max[0]+c*m,t.max[1]+a*m,t.max[2]]),v=("number"==typeof o.offset.x&&"number"==typeof o.offset.y?new e.P(o.offset.x,o.offset.y):e.P.convert(o.offset)).rotate(-e.ak(s));return g.center[0]-=v.x*m,g.center[1]+=v.y*m,g}queryTerrainElevation(t,i){const o=this.transform.elevation;return o?(i=e.l({},{exaggerated:!0},i),o.getAtPoint(e.ac.fromLngLat(t),null,i.exaggerated)):null}_cameraForBounds(t,i,o,s,r,n){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,i,o,s,r,n);const a=t.clone(),l=this._extendCameraOptions(n);a.bearing=s,a.pitch=r;const c=e.bO.convert(i),h=e.bO.convert(o),d=new e.bO(c.lng,h.lat),u=new e.bO(h.lng,c.lat),_=a.project(c),p=a.project(h),f=this.queryTerrainElevation(c),m=this.queryTerrainElevation(h),g=this.queryTerrainElevation(d),v=this.queryTerrainElevation(u),y=[[_.x,_.y,Math.min(f||0,m||0,g||0,v||0)],[p.x,p.y,Math.max(f||0,m||0,g||0,v||0)]];let x=e.ce.fromPoints(y);const b=a.getWorldToCameraMatrix(),w=e.ad.mat4.invert(new Float64Array(16),b);x=e.ce.applyTransform(x,b);const T=this._extendAABB(x,a,l,s);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");x=T;const E=.5*e.ad.vec3.sub([],x.max,x.min)[2],S=this._minimumAABBFrustumDistance(a,x),C=[0,0,1,0];e.ad.vec4.transformMat4(C,C,b),e.ad.vec4.normalize(C,C);const I=e.ad.vec3.scale([],C,S+E),R=e.ad.vec3.add([],x.center,I);e.ad.vec3.transformMat4(x.center,x.center,w),e.ad.vec3.transformMat4(R,R,w);const D=a.unproject(new e.P(x.center[0],x.center[1])),A=e.dH(a.projection,D),L=Math.pow(2,A),P=Math.min(a._zoomFromMercatorZ(R[2]*a.pixelsPerMeter*L/a.worldSize),l.maxZoom);return a.mercatorFromTransition&&P<.5*(e.c6+e.bY)?(a.setProjection({name:"globe"}),a.zoom=P,this._cameraForBounds(a,i,o,s,r,n)):{center:D,zoom:P,bearing:s,pitch:r}}fitBounds(e,t,i){const o=this.cameraForBounds(e,t);return this._fitInternal(o,t,i)}fitScreenCoordinates(t,i,o,s,r){const n=e.P.convert(t),a=e.P.convert(i),l=new e.P(Math.min(n.x,a.x),Math.min(n.y,a.y)),c=new e.P(Math.max(n.x,a.x),Math.max(n.y,a.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(n,a))return this;const h=this.transform.pointLocation3D(l),d=this.transform.pointLocation3D(c),u=this.transform.pointLocation3D(new e.P(l.x,c.y)),_=this.transform.pointLocation3D(new e.P(c.x,l.y)),p=[Math.min(h.lng,d.lng,u.lng,_.lng),Math.min(h.lat,d.lat,u.lat,_.lat)],f=[Math.max(h.lng,d.lng,u.lng,_.lng),Math.max(h.lat,d.lat,u.lat,_.lat)],m=s&&s.pitch?s.pitch:this.getPitch(),g=this._cameraForBounds(this.transform,p,f,o,m,s);return this._fitInternal(g,s,r)}_fitInternal(t,i,o){return t?(i=e.l(t,i)).linear?this.easeTo(i,o):this.flyTo(i,o):this}jumpTo(t,i){this.stop();const o=t.preloadOnly?this.transform.clone():this.transform;let s=!1,r=!1,n=!1;"zoom"in t&&o.zoom!==+t.zoom&&(s=!0,o.zoom=+t.zoom),void 0!==t.center&&(o.center=e.bO.convert(t.center)),"bearing"in t&&o.bearing!==+t.bearing&&(r=!0,o.bearing=+t.bearing),"pitch"in t&&o.pitch!==+t.pitch&&(n=!0,o.pitch=+t.pitch);const a="number"==typeof t.padding?this._extendPadding(t.padding):t.padding;if(null!=t.padding&&!o.isPaddingEqual(a))if(!1===t.retainPadding){const e=o.clone();e.padding=a,o.setLocationAtPoint(o.center,e.centerPoint);}else o.padding=a;return t.preloadOnly?(this._preloadTiles(o),this):(this.fire(new e.A("movestart",i)).fire(new e.A("move",i)),s&&this.fire(new e.A("zoomstart",i)).fire(new e.A("zoom",i)).fire(new e.A("zoomend",i)),r&&this.fire(new e.A("rotatestart",i)).fire(new e.A("rotate",i)).fire(new e.A("rotateend",i)),n&&this.fire(new e.A("pitchstart",i)).fire(new e.A("pitch",i)).fire(new e.A("pitchend",i)),this.fire(new e.A("moveend",i)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w(el),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,i){const o=this.transform;if(!o.projection.supportsFreeCamera)return e.w(el),this;this.stop();const s=o.zoom,r=o.pitch,n=o.bearing;o.setFreeCameraOptions(t);const a=s!==o.zoom,l=r!==o.pitch,c=n!==o.bearing;return this.fire(new e.A("movestart",i)).fire(new e.A("move",i)),a&&this.fire(new e.A("zoomstart",i)).fire(new e.A("zoom",i)).fire(new e.A("zoomend",i)),c&&this.fire(new e.A("rotatestart",i)).fire(new e.A("rotate",i)).fire(new e.A("rotateend",i)),l&&this.fire(new e.A("pitchstart",i)).fire(new e.A("pitch",i)).fire(new e.A("pitchend",i)),this.fire(new e.A("moveend",i)),this}easeTo(t,i){this._stop(!1,t.easeId),(!1===(t=e.l({offset:[0,0],duration:500,easing:e.dD},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const o=this.transform,s=this.getZoom(),r=this.getBearing(),n=this.getPitch(),a=this.getPadding(),l="zoom"in t?+t.zoom:s,c="bearing"in t?this._normalizeBearing(t.bearing,r):r,h="pitch"in t?+t.pitch:n,d=this._extendPadding(t.padding),u=e.P.convert(t.offset);let _,p,f;if("globe"===o.projection.name){const i=e.ac.fromLngLat(o.center),s=u.rotate(-o.angle);i.x+=s.x/o.worldSize,i.y+=s.y/o.worldSize;const r=i.toLngLat(),n=e.bO.convert(t.center||r);this._normalizeCenter(n),_=o.centerPoint.add(s),p=new e.P(i.x,i.y).mult(o.worldSize),f=new e.P(e.av(n.lng),e.aC(n.lat)).mult(o.worldSize).sub(p);}else {_=o.centerPoint.add(u);const i=o.pointLocation(_),s=e.bO.convert(t.center||i);this._normalizeCenter(s),p=o.project(i),f=o.project(s).sub(p);}const m=o.zoomScale(l-s);let g,v;t.around&&(g=e.bO.convert(t.around),v=o.locationPoint(g));const y=this._zooming||l!==s,x=this._rotating||r!==c,b=this._pitching||h!==n,w=!o.isPaddingEqual(d),T=!1===t.retainPadding?o.clone():o,E=o=>E=>{if(y&&(o.zoom=e.ah(s,l,E)),x&&(o.bearing=e.ah(r,c,E)),b&&(o.pitch=e.ah(n,h,E)),w&&(T.interpolatePadding(a,d,E),_=T.centerPoint.add(u)),g)o.setLocationAtPoint(g,v);else {const e=o.zoomScale(o.zoom-s),t=l>s?Math.min(2,m):Math.max(.5,m),i=Math.pow(t,1-E),r=o.unproject(p.add(f.mult(E*i)).mult(e));o.setLocationAtPoint(o.renderWorldCopies?r.wrap():r,_);}return t.preloadOnly||this._fireMoveEvents(i),o};if(t.preloadOnly){const e=this._emulate(E,t.duration,o);return this._preloadTiles(e),this}const S={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=y,this._rotating=x,this._pitching=b,this._padding=w,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,S),this._ease(E(o),(e=>{"sea"===o.cameraElevationReference&&o.recenterOnTerrain(),this._afterEase(i,e);}),t),this}_prepareEase(t,i,o={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),i||o.moving||this.fire(new e.A("movestart",t)),this._zooming&&!o.zooming&&this.fire(new e.A("zoomstart",t)),this._rotating&&!o.rotating&&this.fire(new e.A("rotatestart",t)),this._pitching&&!o.pitching&&this.fire(new e.A("pitchstart",t));}_fireMoveEvents(t){this.fire(new e.A("move",t)),this._zooming&&this.fire(new e.A("zoom",t)),this._rotating&&this.fire(new e.A("rotate",t)),this._pitching&&this.fire(new e.A("pitch",t));}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const o=this._zooming,s=this._rotating,r=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,o&&this.fire(new e.A("zoomend",t)),s&&this.fire(new e.A("rotateend",t)),r&&this.fire(new e.A("pitchend",t)),this.fire(new e.A("moveend",t));}flyTo(t,i){if(this._prefersReducedMotion(t)){const o=e.aA(t,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(o,i)}this.stop(),t=e.l({offset:[0,0],speed:1.2,curve:1.42,easing:e.dD},t);const o=this.transform,s=this.getZoom(),r=this.getBearing(),n=this.getPitch(),a=this.getPadding(),l="zoom"in t?e.ay(+t.zoom,o.minZoom,o.maxZoom):s,c="bearing"in t?this._normalizeBearing(t.bearing,r):r,h="pitch"in t?+t.pitch:n,d=this._extendPadding(t.padding),u=o.zoomScale(l-s),_=e.P.convert(t.offset);let p=o.centerPoint.add(_);const f=o.pointLocation(p),m=e.bO.convert(t.center||f);this._normalizeCenter(m);const g=o.project(f),v=o.project(m).sub(g);let y=t.curve;const x=Math.max(o.width,o.height),b=x/u,w=v.mag();if("minZoom"in t){const i=e.ay(Math.min(t.minZoom,s,l),o.minZoom,o.maxZoom),r=x/o.zoomScale(i-s);y=Math.sqrt(r/w*2);}const T=y*y;function E(e){const t=(b*b-x*x+(e?-1:1)*T*T*w*w)/(2*(e?b:x)*T*w);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return (Math.exp(e)-Math.exp(-e))/2}function C(e){return (Math.exp(e)+Math.exp(-e))/2}const I=E(0);let R=function(e){return C(I)/C(I+y*e)},D=function(e){return x*((C(I)*(S(t=I+y*e)/C(t))-S(I))/T)/w;var t;},A=(E(1)-I)/y;if(Math.abs(w)<1e-6||!isFinite(A)){if(Math.abs(x-b)<1e-6)return this.easeTo(t,i);const e=b<x?-1:1;A=Math.abs(Math.log(b/x))/y,D=function(){return 0},R=function(t){return Math.exp(e*y*t)};}t.duration="duration"in t?+t.duration:1e3*A/("screenSpeed"in t?+t.screenSpeed/y:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const L=r!==c,P=h!==n,M=!o.isPaddingEqual(d),z=!1===t.retainPadding?o.clone():o,O=o=>u=>{const f=u*A,y=1/R(f);o.zoom=1===u?l:s+o.scaleZoom(y),L&&(o.bearing=e.ah(r,c,u)),P&&(o.pitch=e.ah(n,h,u)),M&&(z.interpolatePadding(a,d,u),p=z.centerPoint.add(_));const x=1===u?m:o.unproject(g.add(v.mult(D(f))).mult(y));return o.setLocationAtPoint(o.renderWorldCopies?x.wrap():x,p),o._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(i),o};if(t.preloadOnly){const e=this._emulate(O,t.duration,o);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=L,this._pitching=P,this._padding=M,this._prepareEase(i,!1),this._ease(O(o),(()=>this._afterEase(i)),t),this}isEasing(){return !!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_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,i,o){!1===o.animate||0===o.duration?(t(1),i()):(this._easeStart=e.q.now(),this._easeOptions=o,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));}_renderFrameCallback(){const t=Math.min((e.q.now()-this._easeStart)/this._easeOptions.duration,1),i=this._onEaseFrame;i&&i(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop();}_normalizeBearing(t,i){t=e.bF(t,-180,180);const o=Math.abs(t-i);return Math.abs(t-360-i)<o&&(t-=360),Math.abs(t+360-i)<o&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(t.maxBounds)return;if("globe"!==t.projection.name&&!t.renderWorldCopies)return;const i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0;}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.q.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,i){const o=Math.ceil(15*t/1e3),s=[],r=e(i.clone());for(let e=0;e<=o;e++){const t=r(e/o);s.push(t.clone());}return s}_preloadTiles(e,t){}}class il{constructor(t={}){this.options=t,e.aQ(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this);}getDefaultPosition(){return "bottom-right"}onAdd(e){const t=this.options&&this.options.compact,i=e._getUIString("AttributionControl.ToggleAttribution");this._map=e,this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=l("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",i);const o=l("span","mapboxgl-ctrl-icon",this._compactButton);return o.setAttribute("aria-hidden","true"),o.setAttribute("title",i),this._innerContainer=l("div","mapboxgl-ctrl-attrib-inner",this._container),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;}_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 i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.e.ACCESS_TOKEN}];if(t){const o=i.reduce(((e,t,o)=>(t.value&&(e+=`${t.key}=${t.value}${o<i.length-1?"&":""}`),e)),"?");t.href=`${e.e.FEEDBACK_URL}/${o}#${oa(this._map,!0)}`,t.rel="noopener nofollow";}}_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._mergedSourceCaches;for(const i in t){const o=t[i];if(o.used){const t=o.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution);}}e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,i)=>{for(let o=i+1;o<e.length;o++)if(e[o].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 i=e.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=i,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 ol{constructor(){e.aQ(["_updateLogo","_updateCompact"],this);}onAdd(e){this._map=e,this._container=l("div","mapboxgl-ctrl");const t=l("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 i=e[t].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.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 sl{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,i=t?this._queue.concat(t):this._queue;for(const t of i)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const i of t)if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1;}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[];}}class rl{constructor(e){this.jumpTo(e);}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const i=e.cC((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}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,i){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+i;}}const nl={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","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"};class al extends e.A{constructor(e,t,i,o){const{point:s,lngLat:r,originalEvent:n,target:a}=e;super(e.type,{point:s,lngLat:r,originalEvent:n,target:a}),this.preventDefault=()=>{e.preventDefault();},this.id=t,this.interaction=i,this.feature=o;}}class ll{constructor(e){this.map=e,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map;}add(t,i){if(this.typeById.has(t))throw new Error(`Interaction id "${t}" already exists.`);const o=i.filter;let s=i.type;o&&this.filters.set(t,e.a_(o)),"mouseover"===s&&(s="mouseenter"),"mouseout"===s&&(s="mouseleave");const r=this.interactionsByType.get(s)||new Map;"mouseenter"===s||"mouseleave"===s?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(t,i)):0===r.size&&this.map.on(s,this.handleType),0===r.size&&this.interactionsByType.set(s,r),r.set(t,i),this.typeById.set(t,s);}get(e){const t=this.typeById.get(e);if(!t)return;const i=this.interactionsByType.get(t);return i?i.get(e):void 0}remove(e){const t=this.typeById.get(e);if(!t)return;this.typeById.delete(e),this.filters.delete(e);const i=this.interactionsByType.get(t);i&&(i.delete(e),"mouseenter"===t||"mouseleave"===t?(this.delegatedInteractions.delete(e),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===i.size&&this.map.off(t,this.handleType));}queryTargets(e,t){const i=[];for(const[e,o]of t)o.target&&i.push({targetId:e,target:o.target,filter:this.filters.get(e)});return this.map.style.queryRenderedTargets(e,i,this.map.transform)}handleMove(e){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const t=this.queryTargets(e.point,Array.from(this.delegatedInteractions).reverse());t.length&&(e.type="mouseenter",this.handleType(e,t));const i=new Map;for(const[e,{feature:t}]of this.prevHoveredFeatures)this.hoveredFeatures.has(e)||i.set(t.id,t);i.size&&(e.type="mouseleave",this.handleType(e,Array.from(i.values())));}handleOut(e){const t=Array.from(this.hoveredFeatures.values()).map((({feature:e})=>e));t.length&&(e.type="mouseleave",this.handleType(e,t)),this.hoveredFeatures.clear();}handleType(t,i){const o=Array.from(this.interactionsByType.get(t.type)).reverse(),s=!!i;i=i||this.queryTargets(t.point,o);const r="mouseenter"===t.type;let n=!1;const a=new Set;for(const l of i){for(const[i,c]of o){if(!c.target)continue;const o=l.variants?l.variants[i]:null;if(o){for(const h of o){if(at(h,l,a,i))continue;const o=new e.cx(l,h),d=nt(h,l,i);s&&(o.state=this.map.getFeatureState(o));const u=r?this.prevHoveredFeatures.get(d):null,_=new al(t,i,c,o),p=u?u.stop:c.handler(_);if(r&&this.hoveredFeatures.set(d,{feature:l,stop:p}),!1!==p){n=!0;break}}if(n)break}}if(n)break}if(!n)for(const[e,i]of o){const{handler:o,target:s}=i;if(!s&&!1!==o(new al(t,e,i,null)))break}}}function cl(t,i){if(Array.isArray(t)&&Array.isArray(i)){const e=new Set(t),o=new Set(i);return e.size===o.size&&t.every((e=>o.has(e)))}return e.bn(t,i)}const hl={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,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},dl={showCompass:!0,showZoom:!0,visualizePitch:!1};class ul{constructor(t,i,o=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new Ca({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,o&&(this.mousePitch=new Ia({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.aQ(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset);}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),_();}move(e,t){const i=this.map,o=this.mouseRotate.mousemoveWindow(e,t),s=o&&o.bearingDelta;if(s&&i.setBearing(i.getBearing()+s),this.mousePitch){const o=this.mousePitch.mousemoveWindow(e,t),s=o&&o.pitchDelta;s&&i.setPitch(i.getPitch()+s);}}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(){p(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup);}mousedown(t){this.down(e.l({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),g(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup);}mousemove(e){this.move(e,g(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=v(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=v(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();}}function _l(t,i,o){if(t=new e.bO(t.lng,t.lat),i){const s=new e.bO(t.lng-360,t.lat),r=new e.bO(t.lng+360,t.lat),n=360*Math.ceil(Math.abs(t.lng-o.center.lng)/360),a=o.locationPoint3D(t).distSqr(i),l=i.x<0||i.y<0||i.x>o.width||i.y>o.height;o.locationPoint3D(s).distSqr(i)<a&&(l||Math.abs(s.lng-o.center.lng)<n)?t=s:o.locationPoint3D(r).distSqr(i)<a&&(l||Math.abs(r.lng-o.center.lng)<n)&&(t=r);}for(;Math.abs(t.lng-o.center.lng)>180;){const e=o.locationPoint3D(t);if(e.x>=0&&e.y>=0&&e.x<=o.width&&e.y<=o.height)break;t.lng>o.center.lng?t.lng-=360:t.lng+=360;}return t}const pl={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%)"},fl={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class ml extends e.E{constructor(t,i){super(),(t instanceof HTMLElement||i)&&(t=e.l({element:t},i)),e.aQ(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:o="center",color:s="#3FB1CE",scale:r=1,draggable:n=!1,clickTolerance:a=0,rotation:l=fl.rotation,rotationAlignment:c=fl.rotationAlignment,pitchAlignment:h=fl.pitchAlignment,occludedOpacity:d=fl.occludedOpacity,altitude:u=fl.altitude}=t||{};this._anchor=o,this._color=s,this._scale=r,this._draggable=n,this._clickTolerance=a,this._rotation=l,this._rotationAlignment=c,this._pitchAlignment=h,this._occludedOpacity=d,this._altitude=u,this._state="inactive",this._isDragging=!1,this._updateMoving=()=>this._update(!0),t&&t.element?(this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0])):(this._defaultMarker=!0,this._element=this._createDefaultMarker(),this._offset=e.P.convert(t&&t.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault();})),this._element.addEventListener("mousedown",(e=>{e.preventDefault();}));const _=this._element.classList;for(const e in pl)_.remove(`mapboxgl-marker-anchor-${e}`);_.add(`mapboxgl-marker-anchor-${this._anchor}`);const p=t&&t.className?t.className.trim().split(/\s+/):[];_.add(...p),this._popup=null;}_createDefaultMarker(){const e=l("div"),t=c("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},e);if(0===this._altitude){const e=c("radialGradient",{id:"shadowGradient"},c("defs",{},t));c("stop",{offset:"10%","stop-opacity":.4},e),c("stop",{offset:"100%","stop-opacity":.05},e),c("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},t);}return c("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"},t),c("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"},t),c("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},t),e}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.bO.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}setAltitude(e){return e===this._altitude||(this._defaultMarker&&(0===this._altitude&&0!==e||0!==this._altitude&&0===e)&&(this._element=this._createDefaultMarker()),this._altitude=e||fl.altitude,this._update()),this}getAltitude(){return this._altitude}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,i=13.5,o=Math.sqrt(Math.pow(i,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[o,-1*(t-i+o)],"bottom-right":[-o,-1*(t-i+o)],left:[i,-1*(t-i)],right:[-i,-1*(t-i)]}:this._offset;}this._popup=e,e._marker=this,e._altitude=this._altitude,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,i=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==i&&13!==i||this.togglePopup();}_onMapClick(e){const t=e.originalEvent.target,i=this._element;this._popup&&(t===i||i.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 i=e.unproject(t,this._altitude),o=e.getFreeCameraOptions();if(!o.position)return !1;const s=o.position.toLngLat();return s.distanceTo(i)<.9*s.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const i=this._pos;if(!i||i.x<0||i.x>t.transform.width||i.y<0||i.y>t.transform.height)return void this._clearFadeTimer();const o=t.unproject(i,this._altitude);let s;t._showingGlobe()&&e.dK(t.transform,this._lngLat)?s=0:(s=1-t._queryFogOpacity(o),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(s*=this._occludedOpacity)),this._element.style.opacity=`${s}`,this._element.style.pointerEvents=s>0?"auto":"none",this._popup&&this._popup._setOpacity(s),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            ${pl[this._anchor]}\n            ${this._calculateXYTransform()} ${this._calculateZTransform()}\n            translate(${t.x}px,${t.y}px)\n        `;}_calculateXYTransform(){const t=this._pos,i=this._map,o=this.getPitchAlignment();if(!i||!t||"map"!==o)return "";if(!i._showingGlobe()){const e=i.getPitch();return e?`rotateX(${e}deg)`:""}const s=e.c4(e.dL(i.transform,this._lngLat)),r=t.sub(e.dM(i.transform)),n=Math.abs(r.x)+Math.abs(r.y);if(0===n)return "";const a=s/n;return `rotateX(${-r.y*a}deg) rotateY(${r.x*a}deg)`}_calculateZTransform(){const t=this._pos,i=this._map;if(!i||!t)return "";let o=0;const s=this.getRotationAlignment();if("map"===s)if(i._showingGlobe()){const t=i.project(new e.bO(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),s=i.project(new e.bO(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(t);o=e.c4(Math.atan2(s.y,s.x))-90;}else o=-i.getBearing();else if("horizon"===s){const s=e.ae(4,6,i.getZoom()),r=e.dM(i.transform);r.y+=s*i.transform.height;const n=t.sub(r),a=e.c4(Math.atan2(n.y,n.x));o=(a>90?a-270:a+90)*(1-s);}return o+=this._rotation,o?`rotateZ(${o}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);const t=this._map;t&&(t.transform.renderWorldCopies&&(this._lngLat=_l(this._lngLat,this._pos,t.transform)),this._pos=t.project(this._lngLat,this._altitude),!0===e?this._updateFrameId=requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM());})):this._pos=this._pos.round(),t._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(t._showingGlobe()||t.getTerrain()||t.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)));})));}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(t){const i=this._map;if(!i)return;const o=this._pointerdownPos,s=this._positionDelta;if(o&&s){if(!this._isDragging){const e=this._clickTolerance||i._clickTolerance;if(t.point.dist(o)<e)return;this._isDragging=!0;}this._pos=t.point.sub(s),this._lngLat=i.unproject(this._pos,this._altitude),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.A("dragstart"))),this.fire(new e.A("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.A("dragend")),this._state="inactive";}_addDragHandler(e){const t=this._map,i=this._pos;t&&i&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(i),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||fl.rotation,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||fl.rotationAlignment,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||fl.pitchAlignment,this._update(),this}getPitchAlignment(){return "auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||fl.occludedOpacity,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const gl={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},vl={maxWidth:100,unit:"metric"},yl={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},xl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",altitude:0},bl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function wl(t=new e.P(0,0),i="bottom"){if("number"==typeof t){const o=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(i){case"top":return new e.P(0,t);case"top-left":return new e.P(o,o);case"top-right":return new e.P(-o,o);case"bottom":return new e.P(0,-t);case"bottom-left":return new e.P(o,-o);case"bottom-right":return new e.P(-o,-o);case"left":return new e.P(t,0);case"right":return new e.P(-t,0)}return new e.P(0,0)}return t instanceof e.P||Array.isArray(t)?e.P.convert(t):e.P.convert(t[i]||[0,0])}const Tl={version:t,supported:a.supported,setRTLTextPlugin:e.dN,getRTLTextPluginStatus:e.dO,Map:class extends tl{constructor(t){o.mark(i.create);const s=t;if(null!=(t=e.l({},hl,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.dI(window)&&(t.antialias=!1,e.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Ji(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies,null,null),t),this._repaint=!!t.repaint,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._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._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new sl,this._domRenderTaskQueue=new sl,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.aW(),this._locale=e.l({},nl,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._tessellationStep=t.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=t.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new rl(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=t.scaleFactor,this._requestManager=new T(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?Object.assign({},t.contextCreateOptions):{},"string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container '${t.container.toString()}' not found.`);this._container=e;}else {if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container;}if(this._container.childNodes.length>0&&e.w("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),this._spriteFormat=t.spriteFormat,e.aQ(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new Nn),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},(()=>{this._update();})),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._tp.registerParameter(this,["Scaling"],"_scaleFactor",{min:.1,max:10,step:.1},(()=>{this.setScaleFactor(this._scaleFactor);})),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new Qa(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,(t.style||!t.testMode)&&this.setStyle(t.style||e.e.DEFAULT_STYLE,{config:t.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),this.indoor=new _o(this),t.hash&&(this._hash=new ia("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==s.center&&null==s.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const i=t.bounds;i&&(this.resize(),this.fitBounds(i,e.l({},t.fitBoundsOptions,{duration:0})));}this.resize(),t.attributionControl&&this.addControl(new il({customAttribution:t.customAttribution})),this._logoControl=new ol,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent();})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.A(`${t.dataType}data`,t));})),this.on("dataloading",(t=>{this.fire(new e.A(`${t.dataType}dataloading`,t));})),this._interactions=new ll(this);}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.z(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=t.onAdd(this);this._controls.push(t);const s=this._controlPositions[i];return -1!==i.indexOf("bottom")?s.insertBefore(o,s.firstChild):s.appendChild(o),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.z(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,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 i=!this._moving;return i&&this.fire(new e.A("movestart",t)).fire(new e.A("move",t)),this.fire(new e.A("resize",t)),i&&this.fire(new e.A("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.aB.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new e.A("zoomstart")).fire(new e.A("zoom")).fire(new e.A("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=t??22)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.A("zoomstart")).fire(new e.A("zoom")).fire(new e.A("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=t??0)<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.A("pitchstart")).fire(new e.A("pitch")).fire(new e.A("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=t??85)>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.A("pitchstart")).fire(new e.A("pitch")).fire(new e.A("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(e){return this._scaleFactor=e,this.painter.scaleFactor=e,this._tp.refreshUI(),this._scaleFactorChanged=!0,this.style._updateFilteredLayers((e=>"symbol"===e.type)),this._update(!0),this}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(e){return "auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map((e=>"auto"===e?navigator.language:e)):e}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.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,i=t.projection.name;let o;"globe"===i&&t.zoom>=e.bY?(t.setMercatorFromTransition(),o=!0):"mercator"===i&&t.zoom<e.bY&&(t.setProjection({name:"globe"}),o=!0),o&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate());}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let i;return i="globe"===t.name&&this.transform.zoom>=e.bY?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),i&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t,i){return this.transform.locationPoint3D(e.bO.convert(t),i)}unproject(t,i){return this.transform.pointLocation3D(e.P.convert(t),i)}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,i){const o=e=>{let i=[];if(Array.isArray(t)){const o=t.filter((e=>this.getLayer(e)));i=o.length?this.queryRenderedFeatures(e,{layers:o}):[];}else i=this.queryRenderedFeatures(e,{target:t});return i};if("mouseenter"===e||"mouseover"===e){let s=!1;const r=t=>{const r=o(t.point);r.length?s||(s=!0,i.call(this,new ua(e,this,t.originalEvent,{features:r}))):s=!1;};return {listener:i,targets:t,delegates:{mousemove:r,mouseout:()=>{s=!1;}}}}if("mouseleave"===e||"mouseout"===e){let s=!1;const r=t=>{o(t.point).length?s=!0:s&&(s=!1,i.call(this,new ua(e,this,t.originalEvent)));},n=t=>{s&&(s=!1,i.call(this,new ua(e,this,t.originalEvent)));};return {listener:i,targets:t,delegates:{mousemove:r,mouseout:n}}}{const s=e=>{const t=o(e.point);t.length&&(e.features=t,i.call(this,e),delete e.features);};return {listener:i,targets:t,delegates:{[e]:s}}}}on(e,t,i){if("function"==typeof t||void 0===i)return super.on(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const o=this._createDelegatedListener(e,t,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(o);for(const e in o.delegates)this.on(e,o.delegates[e]);return this}once(e,t,i){if("function"==typeof t||void 0===i)return super.once(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const o=this._createDelegatedListener(e,t,i);for(const e in o.delegates)this.once(e,o.delegates[e]);return this}off(e,t,i){if("function"==typeof t||void 0===i)return super.off(e,t);if("string"==typeof t&&(t=[t]),!this._areTargetsValid(t))return this;const o=this._delegatedListeners?this._delegatedListeners[e]:void 0;return o&&(e=>{for(let o=0;o<e.length;o++){const s=e[o];if(s.listener===i&&cl(s.targets,t)){for(const e in s.delegates)this.off(e,s.delegates[e]);return e.splice(o,1),this}}})(o),this}queryRenderedFeatures(t,i){if(!this.style)return [];if(void 0===t||t instanceof e.P||Array.isArray(t)||void 0!==i||(i=t,t=void 0),t=t||[[0,0],[this.transform.width,this.transform.height]],!i){const e=this.style.queryRenderedFeatures(t,void 0,this.transform),i=this.style.queryRenderedFeatureset(t,void 0,this.transform);return e.concat(i)}let o=!0;if(i.target&&(o=this._isTargetValid(i.target),o&&!i.layers))return this.style.queryRenderedFeatureset(t,i,this.transform);let s=!0;if(i.layers&&Array.isArray(i.layers)){for(const e of i.layers)if(!this._isValidId(e)){s=!1;break}if(s&&!i.target)return this.style.queryRenderedFeatures(t,i,this.transform)}let r=[];return s&&(r=r.concat(this.style.queryRenderedFeatures(t,i,this.transform))),o&&(r=r.concat(this.style.queryRenderedFeatureset(t,i,this.transform))),r}querySourceFeatures(e,t){return !e||"string"==typeof e&&!this._isValidId(e)?[]:this.style.querySourceFeatures(e,t)}isPointOnSurface(t){const{name:i}=this.transform.projection;return "globe"!==i&&"mercator"!==i&&e.w(`${i} projection does not support isPointOnSurface, this API may behave unexpectedly.`),this.transform.isPointOnSurface(e.P.convert(t))}addInteraction(e,t){return this._interactions.add(e,t),this}removeInteraction(e){return this._interactions.remove(e),this}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(e){return this._cooperativeGestures=e,this}setStyle(t,i){return i=e.l({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},i),this.style&&t&&!1!==i.diff&&i.localFontFamily===this._localFontFamily&&i.localIdeographFontFamily===this._localIdeographFontFamily&&!i.config?(this.style._diffStyle(t,((o,s)=>{o?(e.w(`Unable to perform style diff: ${String(o.message||o.error||o)}. Rebuilding the style from scratch.`),this._updateStyle(t,i)):s&&this._update(!0);}),(()=>{this._postStyleLoadEvent();})),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(t,i))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(t,i){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),t){const o=e.l({},i);i&&i.config&&(o.initialConfig=i.config,delete o.config),this.style=new To(this,o).load(t),this.style.setEventedParent(this,{style:this.style});}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new To(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty());}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new e.z(new Error("IDs can't be empty."))),!1):!e.cs(t)||(this.fire(new e.z(new Error(`IDs can't contain special symbols: "${t}".`))),!1)}_isTargetValid(e){return "featuresetId"in e?this._isValidId("importId"in e?e.importId:e.featuresetId):"layerId"in e&&this._isValidId(e.layerId)}_areTargetsValid(e){if(Array.isArray(e)){for(const t of e)if(!this._isValidId(t))return !1;return !0}return this._isTargetValid(e)}addSource(e,t){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)):this}isSourceLoaded(e){return !!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(e,t,i){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,i);}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(t,i,{pixelRatio:o=1,sdf:s=!1,stretchX:r,stretchY:n,content:a}={}){this._lazyInitEmptyStyle();const l=e.I.from(t);if(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap){const{width:t,height:c,data:h}=e.q.getImageData(i);this.style.addImage(l,this.style.scope,{data:new e.r({width:t,height:c},h),pixelRatio:o,stretchX:r,stretchY:n,content:a,sdf:s,version:0,usvg:!1});}else if(void 0===i.width||void 0===i.height)this.fire(new e.z(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:c,height:h}=i,d=i;this.style.addImage(l,this.style.scope,{data:new e.r({width:c,height:h},new Uint8Array(d.data)),pixelRatio:o,stretchX:r,stretchY:n,content:a,sdf:s,usvg:!1,version:0,userImage:d}),d.onAdd&&d.onAdd(this,t);}}updateImage(t,i){this._lazyInitEmptyStyle();const o=e.I.from(t),s=this.style.getImage(o,this.style.scope);if(!s)return void this.fire(new e.z(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const r=i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap?e.q.getImageData(i):i,{width:n,height:a,data:l}=r;if(void 0===n||void 0===a)return void this.fire(new e.z(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`")));if(n!==(s.usvg?s.icon.usvg_tree.width:s.data.width)||a!==(s.usvg?s.icon.usvg_tree.height:s.data.height))return void this.fire(new e.z(new Error(`The width and height of the updated image (${n}, ${a})\n                must be that same as the previous version of the image\n                (${s.data.width}, ${s.data.height})`)));const c=!(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap);let h=!1;s.usvg?(s.data=new e.r({width:n,height:a},new Uint8Array(l)),s.usvg=!1,s.icon=void 0,h=!0):s.data.replace(l,c),this.style.updateImage(o,this.style.scope,s,h);}hasImage(t){return t?!!this.style&&!!this.style.getImage(e.I.from(t),this.style.scope):(this.fire(new e.z(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(e.I.from(t),this.style.scope);}loadImage(t,i){e.o(this._requestManager.transformRequest(t,e.R.Image),((t,o)=>{i(t,o instanceof HTMLImageElement?e.q.getImageData(o):o);}));}listImages(){return this.style.listImages().map((e=>e.name))}addModel(e,t){this._lazyInitEmptyStyle(),this.style.addModel(e,t);}hasModel(t){return t?this.style.hasModel(t):(this.fire(new e.z(new Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e);}listModels(){return this.style.listModels()}addLayer(e,t){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)):this}getSlot(e){const t=this.getLayer(e);return t&&t.slot||null}setSlot(e,t){return this.style.setSlot(e,t),this.style.mergeLayers(),this._update(!0)}addImport(e,t){return this.style.addImport(e,t),this}updateImport(e,t){return "string"!=typeof t&&t.id!==e?(this.removeImport(e),this.addImport(t)):(this.style.updateImport(e,t),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,t){return this.style.moveImport(e,t),this._update(!0)}moveLayer(e,t){return this._isValidId(e)?(this.style.moveLayer(e,t),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){if(!this._isValidId(e))return null;const t=this.style.getOwnLayer(e);return t?"custom"===t.type?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(e,t,i){return this._isValidId(e)?(this.style.setLayerZoomRange(e,t,i),this._update(!0)):this}setFilter(e,t,i={}){return this._isValidId(e)?(this.style.setFilter(e,t,i),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,t,i,o={}){return this._isValidId(e)?(this.style.setPaintProperty(e,t,i,o),this._update(!0)):this}getPaintProperty(e,t){return this._isValidId(e)?this.style.getPaintProperty(e,t):null}setLayoutProperty(e,t,i,o={}){return this._isValidId(e)?(this.style.setLayoutProperty(e,t,i,o),this._update(!0)):this}getLayoutProperty(e,t){return this._isValidId(e)?this.style.getLayoutProperty(e,t):null}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(e){return this.style.setGlyphsUrl(e),this._update(!0)}getSchema(e){return this.style.getSchema(e)}setSchema(e,t){return this.style.setSchema(e,t),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,t){return this.style.setConfig(e,t),this._update(!0)}getConfigProperty(e,t){return this.style.getConfigProperty(e,t)}setConfigProperty(e,t,i){return this.style.setConfigProperty(e,t,i),this._update(!0)}getFeaturesetDescriptors(e){return this.style.getFeaturesetDescriptors(e)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){const t=e[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat");}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e,t={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}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}setSnow(e){return this._lazyInitEmptyStyle(),this.style.setSnow(e),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(e){return this._lazyInitEmptyStyle(),this.style.setRain(e),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(e){return this._lazyInitEmptyStyle(),this.style.setColorTheme(e),this._update(!0)}setImportColorTheme(e,t){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(e,t),this._update(!0)}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.bO.convert(t),this.transform):0}setFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.setFeatureState(e,t),this._update())}removeFeatureState(e,t){return e.source&&!this._isValidId(e.source)?this:(this.style.removeFeatureState(e,t),this._update())}getFeatureState(e){return e.source&&!this._isValidId(e.source)?null:this.style.getFeatureState(e)}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let i,o,s,r=this._container;for(;r&&(!o||!s);){const e=window.getComputedStyle(r).transform;e&&"none"!==e&&(i=e.match(/matrix.*\((.+)\)/)[1].split(", "),i[0]&&"0"!==i[0]&&"1"!==i[0]&&(o=i[0]),i[3]&&"0"!==i[3]&&"1"!==i[3]&&(s=i[3])),r=r.parentElement;}this._containerWidth=o?Math.abs(e/o):e,this._containerHeight=s?Math.abs(t/s):t;}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("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=l("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=l("div","mapboxgl-canvas-container",e);this._canvas=l("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const i=this._controlContainer=l("div","mapboxgl-control-container",e),o=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach((e=>{o[e]=l("div",`mapboxgl-ctrl-${e}`,i);})),this._container.addEventListener("scroll",this._onMapScroll,!1);}_resizeCanvas(t,i){const o=e.q.devicePixelRatio||1;this._canvas.width=o*Math.ceil(t),this._canvas.height=o*Math.ceil(i),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${i}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.l({},a.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl2",t);i?(V(i,!0),this.painter=new ea(i,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp),this.on("data",(e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0);})),e.m.testSupport(i)):this.fire(new e.z(new Error("Failed to initialize WebGL")));}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.A("webglcontextlost",{originalEvent:t}));}_contextRestored(t){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style.reloadModels(),this.style.clearSources(),this._update(),this.fire(new e.A("webglcontextrestored",{originalEvent:t}));}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return !this.isMoving()&&this.loaded()}loaded(){return !this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_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 s;this.fire(new e.A("renderstart")),++this._frameId;const r=this.painter.context.extTimerQuery,n=e.q.now(),a=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(s=a.createQuery(),a.beginQuery(r.TIME_ELAPSED_EXT,s)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const l=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=this.transform.pitch,o=e.q.now(),s=new e.aa(t,{now:o,fadeDuration:l,pitch:i,transition:this.style.transition});this.style.update(s);}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let c=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),c=this._updateAverageElevation(n),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):c=this._updateAverageElevation(n);const h=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),h&&(this._placementDirty=h.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,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.A("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.mark(i.load),this.fire(new e.A("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),s){const t=e.q.now()-n;a.endQuery(r.TIME_ELAPSED_EXT),setTimeout((()=>{const i=a.getQueryParameter(s,a.QUERY_RESULT)/1e6;a.deleteQuery(s),this.fire(new e.A("gpu-timing-frame",{cpuTime:t,gpuTime:i}));}),50);}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const i=this.painter.queryGpuTimers(t);this.fire(new e.A("gpu-timing-layer",{layerTimes:i}));}),50);}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const i=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.A("gpu-timing-deferred-render",{gpuTime:i}));}),50);}const d=this._sourcesDirty||this._styleDirty||this._placementDirty||c;if(d||this._repaint)this.triggerRepaint();else {const t=this.idle();if(t&&(c=this._updateAverageElevation(n,!0)),c)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.A("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.A("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1;}}!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0,o.mark(i.fullLoad),this._performanceMetricsCollection&&k(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 i=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);const o=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(o||(t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let s=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(s)?s=0:this._averageElevationLastSampledAt=e;const r=Math.abs(t-s);if(r>1){if(this._isInitialLoad||o)return this._averageElevation.jumpTo(s),i(s);this._averageElevation.easeTo(s,e,300);}else if(r>1e-4)return this._averageElevation.jumpTo(s),i(s)}return !!this._averageElevation.isEasing(e)&&i(this._averageElevation.getValue(e))}_authenticate(){N(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>{if(t&&(t.message===w||401===t.status)){const t=this.painter.context.gl;V(t,!1),this._logoControl instanceof ol&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.z(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/")));}})),M(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}));}_postStyleLoadEvent(){this.style.globalId&&O(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()});}_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 i=this.painter.context.gl,o=i.createFramebuffer();function s(e){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0);const t=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,t),t}return i.bindFramebuffer(i.FRAMEBUFFER,o),this._canvasPixelComparison(s(e),t.canvasCopies.map(s),t.timeStamps)}_canvasPixelComparison(e,t,i){let o=i[1]-i[0];const s=e.length/4;for(let r=0;r<t.length;r++){const n=t[r];let a=0;for(let t=0;t<n.length;t+=4)n[t]===e[t]&&n[t+1]===e[t+1]&&n[t+2]===e[t+2]&&n[t+3]===e[t+3]&&(a+=1);o+=(i[r+2]-i[r+1])*(1-a/s);}return o}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.indoor.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("orientationchange",this._onWindowResize,!1),window.removeEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1),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),U.delete(this.painter.context.gl),B.remove(),P.remove(),this._removed=!0,this.fire(new e.A("remove"));}triggerRepaint(){this._triggerFrame(!0);}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=e.q.frame((e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e);})));}_preloadTiles(t){const i=this.style?this.style.getSourceCaches():[];return e.bl(i,((e,i)=>e._preloadTiles(t,i)),(()=>{this.triggerRepaint();})),this}_onWindowOnline(){this._update();}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update();}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++;}get showTileBoundaries(){return !!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._tp.refreshUI(),this._update());}get showParseStatus(){return !!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._tp.refreshUI(),this._update());}get showTerrainWireframe(){return !!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._tp.refreshUI(),this._update());}get showLayers2DWireframe(){return !!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._tp.refreshUI(),this._update());}get showLayers3DWireframe(){return !!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._tp.refreshUI(),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._tp.refreshUI(),this._update());}get showCollisionBoxes(){return !!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,this._tp.refreshUI(),e?this.style._generateCollisionBoxes():this._update());}get showOverdrawInspector(){return !!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._tp.refreshUI(),this._update());}get repaint(){return !!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this._tp.refreshUI(),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,this._tp.refreshUI(),e&&this._update());}_setCacheLimits(t,i){e.dJ(t,i);}get version(){return t}},NavigationControl:class{constructor(t={}){this.options=e.l({},dl,t),this._container=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.aQ(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(e=>{this._map&&this._map.zoomIn({},{originalEvent:e});})),l("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});})),l("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.aQ(["_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=l("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"));}_updateZoomButtons(){const e=this._map;if(!e)return;const t=e.getZoom(),i=t===e.getMaxZoom(),o=t===e.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=o,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",o.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 ul(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 i=l("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_setButtonTitle(e,t){if(!this._map)return;const i=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",i),e.firstElementChild&&e.firstElementChild.setAttribute("title",i);}},GeolocateControl:class extends e.E{constructor(t={}){super();const i=navigator.geolocation;this.options=e.l({geolocation:i},gl,t),e.aQ(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=ta(this._updateMarkerRotation,20),this._numberOfWatches=0;}onAdd(e){return this._map=e,this._container=l("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(e){const t=(t=!!this.options.geolocation)=>{this._supportsGeolocation=t,e(t);};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then((e=>t("denied"!==e.state))).catch((()=>t())):t();}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),i=e.coords;return !!t&&(i.longitude<t.getWest()||i.longitude>t.getEast()||i.latitude<t.getSouth()||i.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.A("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._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.A("geolocate",t)),this._finish();}}_updateCamera(t){const i=new e.bO(t.coords.longitude,t.coords.latitude),o=t.coords.accuracy,s=this._map.getBearing(),r=e.l({bearing:s},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(o),r,{geolocateSource:!0});}_updateMarker(t){if(t){const i=new e.bO(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).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,i=e.bH(1,t._center.lat)*t.worldSize,o=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`;}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("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._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.A("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=l("button","mapboxgl-ctrl-geolocate",this._container),l("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("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=l("div","mapboxgl-user-location"),this._dotElement.appendChild(l("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(l("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new ml({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=l("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ml({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.A("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.w("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.A("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.A("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.A("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=window.setTimeout(this._finish,1e4);return !0}_addDeviceOrientationListener(){const e=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation);};"undefined"!=typeof DeviceMotionEvent&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((t=>{"granted"===t&&e();})).catch(console.error):e();}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),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:il,ScaleControl:class{constructor(t={}){this.options=e.l({},vl,t),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return !1}}(),e.aQ(["_update","_setScale","setUnit"],this);}getDefaultPosition(){return "bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,i=t._containerHeight/2,o=t._containerWidth/2-e/2,s=t.unproject([o,i]),r=t.unproject([o+e,i]),n=s.distanceTo(r);if("imperial"===this.options.unit){const t=3.2808*n;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot");}else "nautical"===this.options.unit?this._setScale(e,n/1852,"nautical-mile"):n>=1e3?this._setScale(e,n/1e3,"kilometer"):this._setScale(e,n,"meter");}_setScale(e,t,i){this._map._requestDomTask((()=>{const o=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let i=e/t;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(i),t*i}(t),s=o/t;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(o):`${o}&nbsp;${yl[i]}`,this._container.style.width=e*s+"px";}));}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=l("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 HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),e.aQ(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange");}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=l("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon);}_checkFullscreenSupport(){return !(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=l("button","mapboxgl-ctrl-fullscreen",this._controlContainer);l("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),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(){(document.fullscreenElement||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()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen();}},Popup:class extends e.E{constructor(t){super(),this.options=e.l(Object.create(xl),t),this._altitude=this.options.altitude,e.aQ(["_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.A("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.A("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.bO.convert(t),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(e){return this._altitude=e,this._update(),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(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),i=document.createElement("body");let o;for(i.innerHTML=e;o=i.firstChild,o;)t.appendChild(o);return this.setDOMContent(t)}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=l("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=l("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.innerHTML='<span aria-hidden="true">&#215;</span>',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,i=this._container,o=this._pos;if(!t||!i||!o)return "bottom";const s=i.offsetWidth,r=i.offsetHeight,n=o.x<s/2,a=o.x>t.transform.width-s/2;if(o.y+e<r)return n?"top-left":a?"top-right":"top";if(o.y>t.transform.height-r){if(n)return "bottom-left";if(a)return "bottom-right"}return n?"left":a?"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 i=this._map,o=this._content;if(!i||!this._lngLat&&!this._trackPointer||!o)return;let s=this._container;if(s||(s=this._container=l("div","mapboxgl-popup",i.getContainer()),this._tip=l("div","mapboxgl-popup-tip",s),s.appendChild(o)),this.options.maxWidth&&s.style.maxWidth!==this.options.maxWidth&&(s.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=_l(this._lngLat,this._pos,i.transform)),!this._trackPointer||t){const o=this._pos=this._trackPointer&&t instanceof e.P?t:i.project(this._lngLat,this._altitude),s=wl(this.options.offset),r=this._anchor=this._getAnchor(s.y),n=wl(this.options.offset,r),a=o.add(n).round();i._requestDomTask((()=>{this._container&&r&&(this._container.style.transform=`${pl[r]} translate(${a.x}px,${a.y}px)`);}));}if(!this._marker&&i._showingGlobe()){const t=e.dK(i.transform,this._lngLat)?0:1;this._setOpacity(t);}this._updateClassList();}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(bl);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:ml,Style:To,LngLat:e.bO,LngLatBounds:e.aB,Point:e.P,MercatorCoordinate:e.ac,FreeCameraOptions:Wi,Evented:e.E,config:e.e,prewarm:e.dP,clearPrewarmedResources:e.dQ,get accessToken(){return e.e.ACCESS_TOKEN},set accessToken(t){e.e.ACCESS_TOKEN=t;},get baseApiUrl(){return e.e.API_URL},set baseApiUrl(t){e.e.API_URL=t;},get workerCount(){return e.dR.workerCount},set workerCount(t){e.dR.workerCount=t;},get maxParallelImageRequests(){return e.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.e.MAX_PARALLEL_IMAGE_REQUESTS=t;},clearStorage(t){e.dS(t);},get workerUrl(){return e.dT.workerUrl},set workerUrl(t){e.dT.workerUrl=t;},get workerClass(){return e.dT.workerClass},set workerClass(t){e.dT.workerClass=t;},get workerParams(){return e.dT.workerParams},set workerParams(t){e.dT.workerParams=t;},get dracoUrl(){return e.dU()},set dracoUrl(t){e.dV(t);},get meshoptUrl(){return e.dW()},set meshoptUrl(t){e.dX(t);},setNow:e.q.setNow,restoreNow:e.q.restoreNow};return Tl}));

//
// Our custom intro provides a specialized "define()" function, called by the
// AMD modules below, that sets up the worker blob URL and then executes the
// main module, storing its exported value as 'mapboxgl'


var mapboxgl$1 = mapboxgl;

return mapboxgl$1;

}));
//# sourceMappingURL=mapbox-gl.js.map;
// source --> https://3d360properties.com/wp-content/themes/houzez/js/vendors/mapbox/mapbox-gl-geocoder.min.js?ver=5.0.0 
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.MapboxGeocoder=t()}}(function(){var t;return function(){function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){return r(e[s][1][t]||t)},l,l.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}return t}()({1:[function(t,e,n){"use strict";function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){this.origin=t.origin||"https://api.mapbox.com",this.endpoint="events/v2",this.access_token=t.accessToken,this.version="0.2.0",this.sessionID=this.generateSessionID(),this.userAgent=this.getUserAgent(),this.options=t,this.send=this.send.bind(this),this.countries=t.countries?t.countries.split(","):null,this.types=t.types?t.types.split(","):null,this.bbox=t.bbox?t.bbox:null,this.language=t.language?t.language.split(","):null,this.limit=t.limit?+t.limit:null,this.locale=navigator.language||null,this.enableEventLogging=this.shouldEnableLogging(t),this.eventQueue=new Array,this.flushInterval=t.flushInterval||1e3,this.maxQueueSize=t.maxQueueSize||100,this.timer=this.flushInterval?setTimeout(this.flush.bind(this),this.flushInterval):null,this.lastSentInput="",this.lastSentIndex=0}var o=t("nanoid").nanoid;r.prototype={select:function(t,e){var n=this.getSelectedIndex(t,e),i=this.getEventPayload("search.select",e);if(i.resultIndex=n,i.resultPlaceName=t.place_name,i.resultId=t.id,(n!==this.lastSentIndex||i.queryString!==this.lastSentInput)&&-1!=n&&(this.lastSentIndex=n,this.lastSentInput=i.queryString,i.queryString))return this.push(i)},start:function(t){var e=this.getEventPayload("search.start",t);if(e.queryString)return this.push(e)},keyevent:function(t,e){if(t.key&&!t.metaKey&&-1===[9,27,37,39,13,38,40].indexOf(t.keyCode)){var n=this.getEventPayload("search.keystroke",e);if(n.lastAction=t.key,n.queryString)return this.push(n)}},send:function(t,e){if(this.enableEventLogging){var n=this.getRequestOptions(t);this.request(n,function(t){return t?this.handleError(t,e):e?e():void 0}.bind(this))}else if(e)return e()},getRequestOptions:function(t){return Array.isArray(t)||(t=[t]),{method:"POST",host:this.origin,path:this.endpoint+"?access_token="+this.access_token,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}},getEventPayload:function(t,e){var n;n=e.options.proximity?"object"===i(e.options.proximity)?[e.options.proximity.longitude,e.options.proximity.latitude]:"ip"===e.options.proximity?[999,999]:e.options.proximity:null;var r=e._map?e._map.getZoom():void 0,o={event:t,created:+new Date,sessionIdentifier:this.sessionID,country:this.countries,userAgent:this.userAgent,language:this.language,bbox:this.bbox,types:this.types,endpoint:"mapbox.places",autocomplete:e.options.autocomplete,fuzzyMatch:e.options.fuzzyMatch,proximity:n,limit:e.options.limit,routing:e.options.routing,worldview:e.options.worldview,mapZoom:r,keyboardLocale:this.locale};return"search.select"===t?o.queryString=e.inputString:"search.select"!=t&&e._inputEl?o.queryString=e._inputEl.value:o.queryString=e.inputString,o},request:function(t,e){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==this.readyState)return e(204==this.status?null:this.statusText)},n.open(t.method,t.host+"/"+t.path,!0);for(var i in t.headers){var r=t.headers[i];n.setRequestHeader(i,r)}n.send(t.body)},handleError:function(t,e){if(e)return e(t)},generateSessionID:function(){return o()},getUserAgent:function(){return"mapbox-gl-geocoder."+this.version+"."+navigator.userAgent},getSelectedIndex:function(t,e){if(e._typeahead){var n=e._typeahead.data,i=t.id;return n.map(function(t){return t.id}).indexOf(i)}},shouldEnableLogging:function(t){return!1!==t.enableEventLogging&&((!t.origin||-1!=t.origin.indexOf("api.mapbox.com"))&&(!t.localGeocoder&&!t.filter))},flush:function(){this.eventQueue.length>0&&(this.send(this.eventQueue),this.eventQueue=new Array),this.timer&&clearTimeout(this.timer),this.flushInterval&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval))},push:function(t,e){this.eventQueue.push(t),(this.eventQueue.length>=this.maxQueueSize||e)&&this.flush()},remove:function(){this.flush()}},e.exports=r},{nanoid:32}],2:[function(t,e,n){"use strict";e.exports={fr:{name:"France",bbox:[[-4.59235,41.380007],[9.560016,51.148506]]},us:{name:"United States",bbox:[[-171.791111,18.91619],[-66.96466,71.357764]]},ru:{name:"Russia",bbox:[[19.66064,41.151416],[190.10042,81.2504]]},ca:{name:"Canada",bbox:[[-140.99778,41.675105],[-52.648099,83.23324]]}}},{}],3:[function(t,e,n){"use strict";function i(){}i.prototype={isSupport:function(){return Boolean(window.navigator.geolocation)},getCurrentPosition:function(){var t={enableHighAccuracy:!0};return new Promise(function(e,n){window.navigator.geolocation.getCurrentPosition(e,n,t)})}},e.exports=i},{}],4:[function(t,e,n){"use strict";function i(){var t=document.createElement("div");return t.className="mapboxgl-ctrl-geocoder--powered-by",t.innerHTML='<a href="https://www.mapbox.com/search-service" target="_blank">Powered by Mapbox</a>',t}function r(t){this._eventEmitter=new u,this.options=a({},this.options,t),this.inputString="",this.fresh=!0,this.lastSelected=null,this.geolocation=new g}var o=t("suggestions"),s=t("lodash.debounce"),a=t("xtend"),u=t("events").EventEmitter,c=t("./exceptions"),l=t("@mapbox/mapbox-sdk"),h=t("@mapbox/mapbox-sdk/services/geocoding"),p=t("./events"),f=t("./localization"),d=t("subtag"),g=t("./geolocation"),m=t("./utils"),y={FORWARD:0,LOCAL:1,REVERSE:2};r.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,minLength:2,reverseGeocode:!1,flipCoordinates:!1,limit:5,origin:"https://api.mapbox.com",enableEventLogging:!0,marker:!0,mapboxgl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,enableGeolocation:!1,addressAccuracy:"street",getItemValue:function(t){return t.place_name},render:function(t){var e=t.place_name.split(",");return'<div class="mapboxgl-ctrl-geocoder--suggestion"><div class="mapboxgl-ctrl-geocoder--suggestion-title">'+e[0]+'</div><div class="mapboxgl-ctrl-geocoder--suggestion-address">'+e.splice(1,e.length).join(",")+"</div></div>"}},addTo:function(t){function e(t,e){if(!document.body.contains(e))throw new Error("Element provided to #addTo() exists, but is not in the DOM");var n=t.onAdd();e.appendChild(n)}if(t._controlContainer)t.addControl(this);else if(t instanceof HTMLElement)e(this,t);else{if("string"!=typeof t)throw new Error("Error: addTo must be a mapbox-gl-js map, an html element, or a CSS selector query for a single html element");var n=document.querySelectorAll(t);if(0===n.length)throw new Error("Element ",t,"not found.");if(n.length>1)throw new Error("Geocoder can only be added to a single html element");e(this,n[0])}},onAdd:function(t){if(t&&"string"!=typeof t&&(this._map=t),this.setLanguage(),this.options.localGeocoderOnly||(this.geocoderService=h(l({accessToken:this.options.accessToken,origin:this.options.origin}))),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this.eventManager=new p(this.options),this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this),this._geolocateUser=this._geolocateUser.bind(this);var e=this.container=document.createElement("div");e.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl";var n=this.createIcon("search",'<path d="M7.4 2.5c-2.7 0-4.9 2.2-4.9 4.9s2.2 4.9 4.9 4.9c1 0 1.8-.2 2.5-.8l3.7 3.7c.2.2.4.3.8.3.7 0 1.1-.4 1.1-1.1 0-.3-.1-.5-.3-.8L11.4 10c.4-.8.8-1.6.8-2.5.1-2.8-2.1-5-4.8-5zm0 1.6c1.8 0 3.2 1.4 3.2 3.2s-1.4 3.2-3.2 3.2-3.3-1.3-3.3-3.1 1.4-3.3 3.3-3.3z"/>');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",s(this._onKeyDown,200)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton),this._inputEl.addEventListener("keyup",function(t){this.eventManager.keyevent(t,this)}.bind(this));var r=document.createElement("div");r.classList.add("mapboxgl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button";var a=this.createIcon("close",'<path d="M3.8 2.5c-.6 0-1.3.7-1.3 1.3 0 .3.2.7.5.8L7.2 9 3 13.2c-.3.3-.5.7-.5 1 0 .6.7 1.3 1.3 1.3.3 0 .7-.2 1-.5L9 10.8l4.2 4.2c.2.3.7.3 1 .3.6 0 1.3-.7 1.3-1.3 0-.3-.2-.7-.3-1l-4.4-4L15 4.6c.3-.2.5-.5.5-.8 0-.7-.7-1.3-1.3-1.3-.3 0-.7.2-1 .3L9 7.1 4.8 2.8c-.3-.1-.7-.3-1-.3z"/>');if(this._clearEl.appendChild(a),this._loadingEl=this.createIcon("loading",'<path fill="#333" d="M4.4 4.4l.8.8c2.1-2.1 5.5-2.1 7.6 0l.8-.8c-2.5-2.5-6.7-2.5-9.2 0z"/><path opacity=".1" d="M12.8 12.9c-2.1 2.1-5.5 2.1-7.6 0-2.1-2.1-2.1-5.5 0-7.7l-.8-.8c-2.5 2.5-2.5 6.7 0 9.2s6.6 2.5 9.2 0 2.5-6.6 0-9.2l-.8.8c2.2 2.1 2.2 5.6 0 7.7z"/>'),r.appendChild(this._clearEl),r.appendChild(this._loadingEl),e.appendChild(n),e.appendChild(this._inputEl),e.appendChild(r),this.options.enableGeolocation&&this.geolocation.isSupport()){this._geolocateEl=document.createElement("button"),this._geolocateEl.setAttribute("aria-label","Geolocate"),this._geolocateEl.addEventListener("click",this._geolocateUser),this._geolocateEl.className="mapboxgl-ctrl-geocoder--button";var u=this.createIcon("geolocate",'<path d="M12.999 3.677L2.042 8.269c-.962.403-.747 1.823.29 1.912l5.032.431.431 5.033c.089 1.037 1.509 1.252 1.912.29l4.592-10.957c.345-.822-.477-1.644-1.299-1.299z" fill="#4264fb"/>');this._geolocateEl.appendChild(u),r.appendChild(this._geolocateEl),this._showGeolocateButton()}var c=this._typeahead=new o(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit});this.setRenderFunction(this.options.render),c.getItemValue=this.options.getItemValue;var f=c.list.draw,d=this._footerNode=i();return c.list.draw=function(){f.call(this),d.addEventListener("mousedown",function(){this.selectingListItem=!0}.bind(this)),d.addEventListener("mouseup",function(){this.selectingListItem=!1}.bind(this)),this.element.appendChild(d)},this.mapMarker=null,this._handleMarker=this._handleMarker.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._mapboxgl=this.options.mapboxgl,!this._mapboxgl&&this.options.marker&&(console.error("No mapboxgl detected in options. Map markers are disabled. Please set options.mapboxgl."),this.options.marker=!1)),e},_geolocateUser:function(){this._hideGeolocateButton(),this._showLoadingIcon(),this.geolocation.getCurrentPosition().then(function(t){this._hideLoadingIcon();var e={geometry:{type:"Point",coordinates:[t.coords.longitude,t.coords.latitude]}};this._handleMarker(e),this._fly(e),this._typeahead.clear(),this._typeahead.selected=!0,this.lastSelected=JSON.stringify(e),this._showClearButton(),this.fresh=!1;var n={limit:1,language:[this.options.language],query:e.geometry.coordinates,types:["address"]};if(this.options.localGeocoderOnly){var i=e.geometry.coordinates[0]+","+e.geometry.coordinates[1];this._setInputValue(i),this._eventEmitter.emit("result",{result:e})}else this.geocoderService.reverseGeocode(n).send().then(function(t){var n=t.body.features[0];if(n){var i=m.transformFeatureToGeolocationText(n,this.options.addressAccuracy);this._setInputValue(i),n.user_coordinates=e.geometry.coordinates,this._eventEmitter.emit("result",{result:n})}else this._eventEmitter.emit("result",{result:{user_coordinates:e.geometry.coordinates}})}.bind(this))}.bind(this)).catch(function(t){1===t.code?this._renderUserDeniedGeolocationError():this._renderLocationError(),this._hideLoadingIcon(),this._showGeolocateButton(),this._hideAttribution()}.bind(this))},createIcon:function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+t),n.setAttribute("viewBox","0 0 18 18"),n.setAttribute("xml:space","preserve"),n.setAttribute("width",18),n.setAttribute("height",18),n.innerHTML=e,n},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_setInputValue:function(t){this._inputEl.value=t,setTimeout(function(){this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0)}.bind(this),1)},_onPaste:function(t){var e=(t.clipboardData||window.clipboardData).getData("text");e.length>=this.options.minLength&&this._geocode(e)},_onKeyDown:function(t){if(27===t.keyCode&&this.options.clearAndBlurOnEsc)return this._clear(t),this._inputEl.blur();var e=t.target&&t.target.shadowRoot?t.target.shadowRoot.activeElement:t.target;if(!(e?e.value:""))return this.fresh=!0,9!==t.keyCode&&this.clear(t),this._showGeolocateButton(),this._hideClearButton();this._hideGeolocateButton(),t.metaKey||-1!==[9,27,37,39,13,38,40].indexOf(t.keyCode)||e.value.length>=this.options.minLength&&this._geocode(e.value)},_showButton:function(){this._typeahead.selected&&this._showClearButton()},_hideButton:function(){this._typeahead.selected&&this._hideClearButton()},_showClearButton:function(){this._clearEl.style.display="block"},_hideClearButton:function(){this._clearEl.style.display="none"},_showGeolocateButton:function(){this._geolocateEl&&this.geolocation.isSupport()&&(this._geolocateEl.style.display="block")},_hideGeolocateButton:function(){this._geolocateEl&&(this._geolocateEl.style.display="none")},_showLoadingIcon:function(){this._loadingEl.style.display="block"},_hideLoadingIcon:function(){this._loadingEl.style.display="none"},_showAttribution:function(){this._footerNode.style.display="block"},_hideAttribution:function(){this._footerNode.style.display="none"},_onBlur:function(t){this.options.clearOnBlur&&this._clearOnBlur(t),this.options.collapsed&&this._collapse()},_onChange:function(){var t=this._typeahead.selected;t&&JSON.stringify(t)!==this.lastSelected&&(this._hideClearButton(),this.options.flyTo&&this._fly(t),this.options.marker&&this._mapboxgl&&this._handleMarker(t),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(t),this._eventEmitter.emit("result",{result:t}),this.eventManager.select(t,this))},_fly:function(t){var e;if(t.properties&&c[t.properties.short_code])e=a({},this.options.flyTo),this._map&&this._map.fitBounds(c[t.properties.short_code].bbox,e);else if(t.bbox){var n=t.bbox;e=a({},this.options.flyTo),this._map&&this._map.fitBounds([[n[0],n[1]],[n[2],n[3]]],e)}else{var i={zoom:this.options.zoom};e=a({},i,this.options.flyTo),t.center?e.center=t.center:t.geometry&&t.geometry.type&&"Point"===t.geometry.type&&t.geometry.coordinates&&(e.center=t.geometry.coordinates),this._map&&this._map.flyTo(e)}},_requestType:function(t,e){var n=/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/;return t.localGeocoderOnly?y.LOCAL:t.reverseGeocode&&n.test(e)?y.REVERSE:y.FORWARD},_setupConfig:function(t,e){var n=["bbox","limit","proximity","countries","types","language","reverseMode","mode","autocomplete","fuzzyMatch","routing","worldview"],i=/[\s,]+/,r=this,o=n.reduce(function(t,e){if(void 0===r.options[e]||null===r.options[e])return t;["countries","types","language"].indexOf(e)>-1?t[e]=r.options[e].split(i):t[e]=r.options[e];var n="number"==typeof r.options[e].longitude&&"number"==typeof r.options[e].latitude;if("proximity"===e&&n){var o=r.options[e].longitude,s=r.options[e].latitude;t[e]=[o,s]}return t},{});switch(t){case y.REVERSE:var s=e.split(i).map(function(t){return parseFloat(t,10)});r.options.flipCoordinates||s.reverse(),o.types&&o.types[0],o=a(o,{query:s,limit:1}),["proximity","autocomplete","fuzzyMatch","bbox"].forEach(function(t){t in o&&delete o[t]});break;case y.FORWARD:/^[ ]*(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)*[ ]*$/.test(e)&&(e=e.replace(/,/g," ")),o=a(o,{query:e})}return o},_geocode:function(t){this.inputString=t,this._showLoadingIcon(),this._eventEmitter.emit("loading",{query:t});var e,n=this._requestType(this.options,t),i=this._setupConfig(n,t);switch(n){case y.LOCAL:e=Promise.resolve();break;case y.FORWARD:e=this.geocoderService.forwardGeocode(i).send();break;case y.REVERSE:e=this.geocoderService.reverseGeocode(i).send()}var r=this.options.localGeocoder?this.options.localGeocoder(t)||[]:[],o=[],s=null;return e.catch(function(t){s=t}.bind(this)).then(function(e){this._hideLoadingIcon();var n={};return e?"200"==e.statusCode&&(n=e.body,n.request=e.request,n.headers=e.headers):n={type:"FeatureCollection",features:[]},n.config=i,this.fresh&&(this.eventManager.start(this),this.fresh=!1),n.features=n.features?r.concat(n.features):r,this.options.externalGeocoder?(o=this.options.externalGeocoder(t,n.features)||Promise.resolve([]),o.then(function(t){return n.features=n.features?t.concat(n.features):t,n},function(){return n})):n}.bind(this)).then(function(t){if(s)throw s;this.options.filter&&t.features.length&&(t.features=t.features.filter(this.options.filter)),t.features.length?(this._showClearButton(),this._hideGeolocateButton(),this._showAttribution(),this._eventEmitter.emit("results",t),this._typeahead.update(t.features)):(this._hideClearButton(),this._hideAttribution(),this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",t))}.bind(this)).catch(function(t){this._hideLoadingIcon(),this._hideAttribution(),r.length&&this.options.localGeocoder||o.length&&this.options.externalGeocoder?(this._showClearButton(),this._hideGeolocateButton(),this._typeahead.update(r)):(this._hideClearButton(),this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:r}),this._eventEmitter.emit("error",{error:t})}.bind(this)),e},_clear:function(t){t&&t.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._hideClearButton(),this._showGeolocateButton(),this._removeMarker(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(t){this._clear(t),this._inputEl.focus()},_clearOnBlur:function(t){var e=this;t.relatedTarget&&e._clear(t)},_onQueryResult:function(t){var e=t.body;if(e.features.length){var n=e.features[0];this._typeahead.selected=n,this._inputEl.value=n.place_name,this._onChange()}},_updateProximity:function(){if(this._map&&this.options.trackProximity)if(this._map.getZoom()>9){var t=this._map.getCenter().wrap();this.setProximity({longitude:t.lng,latitude:t.lat},!1)}else this.setProximity(null,!1)},_collapse:function(){this._inputEl.value||this._inputEl===document.activeElement||this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed")},query:function(t){return this._geocode(t).then(this._onQueryResult),this},_renderError:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error'>There was an error reaching the server</div>")},_renderLocationError:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error'>A location error has occurred</div>")},_renderNoResults:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error mapbox-gl-geocoder--no-results'>No results found</div>")},_renderUserDeniedGeolocationError:function(){this._renderMessage("<div class='mapbox-gl-geocoder--error'>Geolocation permission denied</div>")},_renderMessage:function(t){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(t)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var t=this.options.language.split(",")[0],e=d.language(t),n=f.placeholder[e];if(n)return n}return"Search"},setInput:function(t){return this._inputEl.value=t,this._typeahead.selected=null,this._typeahead.clear(),t.length>=this.options.minLength&&this._geocode(t),this},setProximity:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.options.proximity=t,e&&(this.options.trackProximity=!1),this},getProximity:function(){return this.options.proximity},setRenderFunction:function(t){return t&&"function"==typeof t&&(this._typeahead.render=t),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(t){var e=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=t||this.options.language||e,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(t){return this.options.zoom=t,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(t){return this.options.flyTo=t,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(t){return this.placeholder=t||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(t){return this.options.bbox=t,this},getCountries:function(){return this.options.countries},setCountries:function(t){return this.options.countries=t,this},getTypes:function(){return this.options.types},setTypes:function(t){return this.options.types=t,this},getMinLength:function(){return this.options.minLength},setMinLength:function(t){return this.options.minLength=t,this._typeahead&&(this._typeahead.options.minLength=t),this},getLimit:function(){return this.options.limit},setLimit:function(t){return this.options.limit=t,this._typeahead&&(this._typeahead.options.limit=t),this},getFilter:function(){return this.options.filter},setFilter:function(t){return this.options.filter=t,this},setOrigin:function(t){return this.options.origin=t,this.geocoderService=h(l({accessToken:this.options.accessToken,origin:this.options.origin})),this},getOrigin:function(){return this.options.origin},setAccessToken:function(t){return this.options.accessToken=t,this.geocoderService=h(l({accessToken:this.options.accessToken,origin:this.options.origin})),this},setAutocomplete:function(t){return this.options.autocomplete=t,this},getAutocomplete:function(){return this.options.autocomplete},setFuzzyMatch:function(t){return this.options.fuzzyMatch=t,this},getFuzzyMatch:function(){return this.options.fuzzyMatch},setRouting:function(t){return this.options.routing=t,this},getRouting:function(){return this.options.routing},setWorldview:function(t){return this.options.worldview=t,this},getWorldview:function(){return this.options.worldview},_handleMarker:function(t){if(this._map){this._removeMarker();var e={color:"#4668F2"},n=a({},e,this.options.marker);return this.mapMarker=new this._mapboxgl.Marker(n),t.center?this.mapMarker.setLngLat(t.center).addTo(this._map):t.geometry&&t.geometry.type&&"Point"===t.geometry.type&&t.geometry.coordinates&&this.mapMarker.setLngLat(t.geometry.coordinates).addTo(this._map),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},on:function(t,e){return this._eventEmitter.on(t,e),this},off:function(t,e){return this._eventEmitter.removeListener(t,e),this.eventManager.remove(),this}},e.exports=r},{"./events":1,"./exceptions":2,"./geolocation":3,"./localization":5,"./utils":6,"@mapbox/mapbox-sdk":8,"@mapbox/mapbox-sdk/services/geocoding":19,events:28,"lodash.debounce":31,subtag:35,suggestions:36,xtend:39}],5:[function(t,e,n){"use strict";var i={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"לחפש",ja:"サーチ",lv:"Meklēt",pt:"Procurar",sr:"Претрага",zh:"搜索",cs:"Vyhledávání",hu:"Keresés",ka:"ძიება",nb:"Søke",sk:"Vyhľadávanie",th:"ค้นหา",fi:"Hae",is:"Leita",ko:"수색",pl:"Szukaj",sl:"Iskanje",fa:"جستجو",ru:"Поиск"};e.exports={placeholder:i}},{}],6:[function(t,e,n){"use strict";function i(t,e){var n,i=r(t),o=["address","street","place","country"];if("function"==typeof e)return e(i);var s=o.indexOf(e);return n=-1===s?o:o.slice(s),n.reduce(function(t,e){return i[e]?(""!==t&&(t+=", "),t+i[e]):t},"")}function r(t){var e=t.address||"",n=t.text||"",i=t.place_name||"",r=i.split(",")[0],o={address:r,houseNumber:e,street:n,placeName:i};return t.context.forEach(function(t){var e=t.id.split(".")[0];o[e]=t.text}),o}e.exports={transformFeatureToGeolocationText:i,getAddressInfo:r}},{}],7:[function(t,e,n){"use strict";function i(t){var e=Array.isArray(t),n=function(n){return e?t[n]:t};return function(i){var o=r(g.plainArray,i);if(o)return o;if(e&&i.length!==t.length)return"an array with "+t.length+" items";for(var s=0;s<i.length;s++)if(o=r(n(s),i[s]))return[s].concat(o)}}function r(t,e){if(null!=e||t.hasOwnProperty("__required")){var n=t(e);return n?Array.isArray(n)?n:[n]:void 0}}function o(t,e){var n=t.length,i=t[n-1],r=t.slice(0,n-1);return 0===r.length&&(r=[d]),e=f(e,{path:r}),"function"==typeof i?i(e):c(e,a(i))}function s(t){return t.length<2?t[0]:2===t.length?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t.slice(-1)}function a(t){return"must be "+u(t)+"."}function u(t){return/^an? /.test(t)?t:/^[aeiou]/i.test(t)?"an "+t:/^[a-z]/i.test(t)?"a "+t:t}function c(t,e){var n=l(t.path),i=t.path.join(".")+" "+e;return(n?"Item at position ":"")+i}function l(t){return"number"==typeof t[t.length-1]||"number"==typeof t[0]}function h(t){return Object.keys(t||{}).map(function(e){return{key:e,value:t[e]}})}var p=t("is-plain-obj"),f=t("xtend"),d="value",g={};g.assert=function(t,e){return e=e||{},function(n){var i=r(t,n);if(i){var s=o(i,e);throw e.apiName&&(s=e.apiName+": "+s),new Error(s)}}},g.shape=function(t){var e=h(t);return function(t){var n=r(g.plainObject,t);if(n)return n;for(var i,s,a=[],u=0;u<e.length;u++)i=e[u].key,s=e[u].value,(n=r(s,t[i]))&&a.push([i].concat(n));return a.length<2?a[0]:function(t){a=a.map(function(e){return"- "+e[0]+": "+o(e,t).split("\n").join("\n  ")});var e=t.path.join(".");return"The following properties"+(e===d?"":" of "+e)+" have invalid values:\n  "+a.join("\n  ")}}},g.strictShape=function(t){var e=g.shape(t);return function(n){var i=e(n);if(i)return i;var r=Object.keys(n).reduce(function(e,n){return void 0===t[n]&&e.push(n),e},[]);return 0!==r.length?function(){return"The following keys are invalid: "+r.join(", ")}:void 0}},g.arrayOf=function(t){return i(t)},g.tuple=function(){return i(Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments))},g.required=function(t){function e(e){return null==e?function(t){return c(t,l(t.path)?"cannot be undefined/null.":"is required.")}:t.apply(this,arguments)}return e.__required=!0,e},g.oneOfType=function(){var t=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments);return function(e){var n=t.map(function(t){return r(t,e)}).filter(Boolean);if(n.length===t.length)return n.every(function(t){return 1===t.length&&"string"==typeof t[0]})?s(n.map(function(t){return t[0]})):n.reduce(function(t,e){return e.length>t.length?e:t})}},g.equal=function(t){return function(e){if(e!==t)return JSON.stringify(t)}},g.oneOf=function(){var t=Array.isArray(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments),e=t.map(function(t){return g.equal(t)});return g.oneOfType.apply(this,e)},g.range=function(t){var e=t[0],n=t[1];return function(t){if(r(g.number,t)||t<e||t>n)return"number between "+e+" & "+n+" (inclusive)"}},g.any=function(){},g.boolean=function(t){if("boolean"!=typeof t)return"boolean"},g.number=function(t){if("number"!=typeof t)return"number"},g.plainArray=function(t){if(!Array.isArray(t))return"array"},g.plainObject=function(t){if(!p(t))return"object"},g.string=function(t){if("string"!=typeof t)return"string"},g.func=function(t){if("function"!=typeof t)return"function"},g.validate=r,g.processMessage=o,e.exports=g},{"is-plain-obj":30,xtend:39}],8:[function(t,e,n){"use strict";var i=t("./lib/client");e.exports=i},{"./lib/client":9}],9:[function(t,e,n){"use strict";function i(t){s.call(this,t)}function r(t){return new i(t)}var o=t("./browser-layer"),s=t("../classes/mapi-client");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,i.prototype.sendRequest=o.browserSend,i.prototype.abortRequest=o.browserAbort,e.exports=r},{"../classes/mapi-client":11,"./browser-layer":10}],10:[function(t,e,n){"use strict";function i(t){var e=f[t.id];e&&(e.abort(),delete f[t.id])}function r(t,e){return new c(t,{body:e.response,headers:p(e.getAllResponseHeaders()),statusCode:e.status})}function o(t){var e=t.total,n=t.loaded;return{total:e,transferred:n,percent:100*n/e}}function s(t,e){return new Promise(function(n,i){e.onprogress=function(e){t.emitter.emit(h.EVENT_PROGRESS_DOWNLOAD,o(e))};var r=t.file;r&&(e.upload.onprogress=function(e){t.emitter.emit(h.EVENT_PROGRESS_UPLOAD,o(e))}),e.onerror=function(t){i(t)},e.onabort=function(){var e=new l({request:t,type:h.ERROR_REQUEST_ABORTED});i(e)},e.onload=function(){if(delete f[t.id],e.status<200||e.status>=400){var r=new l({request:t,body:e.response,statusCode:e.status});return void i(r)}n(e)};var s=t.body;"string"==typeof s?e.send(s):s?e.send(JSON.stringify(s)):r?e.send(r):e.send(),f[t.id]=e}).then(function(e){return r(t,e)})}function a(t,e){var n=t.url(e),i=new window.XMLHttpRequest;return i.open(t.method,n),Object.keys(t.headers).forEach(function(e){i.setRequestHeader(e,t.headers[e])}),i}function u(t){return Promise.resolve().then(function(){var e=a(t,t.client.accessToken);return s(t,e)})}var c=t("../classes/mapi-response"),l=t("../classes/mapi-error"),h=t("../constants"),p=t("../helpers/parse-headers"),f={};e.exports={browserAbort:i,sendRequestXhr:s,browserSend:u,createRequestXhr:a}},{"../classes/mapi-error":12,"../classes/mapi-response":14,"../constants":15,"../helpers/parse-headers":16}],11:[function(t,e,n){"use strict";function i(t){if(!t||!t.accessToken)throw new Error("Cannot create a client without an access token");r(t.accessToken),this.accessToken=t.accessToken,this.origin=t.origin||s.API_ORIGIN}var r=t("@mapbox/parse-mapbox-token"),o=t("./mapi-request"),s=t("../constants");i.prototype.createRequest=function(t){return new o(this,t)},e.exports=i},{"../constants":15,"./mapi-request":13,"@mapbox/parse-mapbox-token":25}],12:[function(t,e,n){"use strict";function i(t){var e,n=t.type||r.ERROR_HTTP;if(t.body)try{e=JSON.parse(t.body)}catch(n){e=t.body}else e=null;var i=t.message||null
;i||("string"==typeof e?i=e:e&&"string"==typeof e.message?i=e.message:n===r.ERROR_REQUEST_ABORTED&&(i="Request aborted")),this.message=i,this.type=n,this.statusCode=t.statusCode||null,this.request=t.request,this.body=e}var r=t("../constants");e.exports=i},{"../constants":15}],13:[function(t,e,n){"use strict";function i(t,e){if(!t)throw new Error("MapiRequest requires a client");if(!e||!e.path||!e.method)throw new Error("MapiRequest requires an options object with path and method properties");var n={};e.body&&(n["content-type"]="application/json");var i=o(n,e.headers),r=Object.keys(i).reduce(function(t,e){return t[e.toLowerCase()]=i[e],t},{});this.id=c++,this._options=e,this.emitter=new s,this.client=t,this.response=null,this.error=null,this.sent=!1,this.aborted=!1,this.path=e.path,this.method=e.method,this.origin=e.origin||t.origin,this.query=e.query||{},this.params=e.params||{},this.body=e.body||null,this.file=e.file||null,this.encoding=e.encoding||"utf8",this.sendFileAs=e.sendFileAs||null,this.headers=r}var r=t("@mapbox/parse-mapbox-token"),o=t("xtend"),s=t("eventemitter3"),a=t("../helpers/url-utils"),u=t("../constants"),c=1;i.prototype.url=function(t){var e=a.prependOrigin(this.path,this.origin);e=a.appendQueryObject(e,this.query);var n=this.params,i=null==t?this.client.accessToken:t;if(i){e=a.appendQueryParam(e,"access_token",i);var s=r(i).user;n=o({ownerId:s},n)}return e=a.interpolateRouteParams(e,n),e},i.prototype.send=function(){var t=this;if(t.sent)throw new Error("This request has already been sent. Check the response and error properties. Create a new request with clone().");return t.sent=!0,t.client.sendRequest(t).then(function(e){return t.response=e,t.emitter.emit(u.EVENT_RESPONSE,e),e},function(e){throw t.error=e,t.emitter.emit(u.EVENT_ERROR,e),e})},i.prototype.abort=function(){this._nextPageRequest&&(this._nextPageRequest.abort(),delete this._nextPageRequest),this.response||this.error||this.aborted||(this.aborted=!0,this.client.abortRequest(this))},i.prototype.eachPage=function(t){function e(e){function n(){delete r._nextPageRequest;var t=e.nextPage();t&&(r._nextPageRequest=t,i(t))}t(null,e,n)}function n(e){t(e,null,function(){})}function i(t){t.send().then(e,n)}var r=this;i(this)},i.prototype.clone=function(){return this._extend()},i.prototype._extend=function(t){var e=o(this._options,t);return new i(this.client,e)},e.exports=i},{"../constants":15,"../helpers/url-utils":18,"@mapbox/parse-mapbox-token":25,eventemitter3:27,xtend:39}],14:[function(t,e,n){"use strict";function i(t,e){this.request=t,this.headers=e.headers,this.rawBody=e.body,this.statusCode=e.statusCode;try{this.body=JSON.parse(e.body||"{}")}catch(t){this.body=e.body}this.links=r(this.headers.link)}var r=t("../helpers/parse-link-header");i.prototype.hasNextPage=function(){return!!this.links.next},i.prototype.nextPage=function(){return this.hasNextPage()?this.request._extend({path:this.links.next.url}):null},e.exports=i},{"../helpers/parse-link-header":17}],15:[function(t,e,n){"use strict";e.exports={API_ORIGIN:"https://api.mapbox.com",EVENT_PROGRESS_DOWNLOAD:"downloadProgress",EVENT_PROGRESS_UPLOAD:"uploadProgress",EVENT_ERROR:"error",EVENT_RESPONSE:"response",ERROR_HTTP:"HttpError",ERROR_REQUEST_ABORTED:"RequestAbortedError"}},{}],16:[function(t,e,n){"use strict";function i(t){var e=t.indexOf(":");return{name:t.substring(0,e).trim().toLowerCase(),value:t.substring(e+1).trim()}}function r(t){var e={};return t?(t.trim().split(/[\r|\n]+/).forEach(function(t){var n=i(t);e[n.name]=n.value}),e):e}e.exports=r},{}],17:[function(t,e,n){"use strict";function i(t){var e=t.match(/\s*(.+)\s*=\s*"?([^"]+)"?/);return e?{key:e[1],value:e[2]}:null}function r(t){var e=t.match(/<?([^>]*)>(.*)/);if(!e)return null;var n=e[1],r=e[2].split(";"),o=null,s=r.reduce(function(t,e){var n=i(e);return n?"rel"===n.key?(o||(o=n.value),t):(t[n.key]=n.value,t):t},{});return o?{url:n,rel:o,params:s}:null}function o(t){return t?t.split(/,\s*</).reduce(function(t,e){var n=r(e);return n?(n.rel.split(/\s+/).forEach(function(e){t[e]||(t[e]={url:n.url,params:n.params})}),t):t},{}):{}}e.exports=o},{}],18:[function(t,e,n){"use strict";function i(t){return t.map(encodeURIComponent).join(",")}function r(t){return Array.isArray(t)?i(t):encodeURIComponent(String(t))}function o(t,e,n){if(!1===n||null===n)return t;var i=/\?/.test(t)?"&":"?",o=encodeURIComponent(e);return void 0!==n&&""!==n&&!0!==n&&(o+="="+r(n)),""+t+i+o}function s(t,e){if(!e)return t;var n=t;return Object.keys(e).forEach(function(t){var i=e[t];void 0!==i&&(Array.isArray(i)&&(i=i.filter(function(t){return null!==t&&void 0!==t}).join(",")),n=o(n,t,i))}),n}function a(t,e){if(!e)return t;if("http"===t.slice(0,4))return t;var n="/"===t[0]?"":"/";return""+e.replace(/\/$/,"")+n+t}function u(t,e){return e?t.replace(/\/:([a-zA-Z0-9]+)/g,function(t,n){var i=e[n];if(void 0===i)throw new Error("Unspecified route parameter "+n);return"/"+r(i)}):t}e.exports={appendQueryObject:s,appendQueryParam:o,prependOrigin:a,interpolateRouteParams:u}},{}],19:[function(t,e,n){"use strict";var i=t("xtend"),r=t("./service-helpers/validator"),o=t("./service-helpers/pick"),s=t("./service-helpers/stringify-booleans"),a=t("./service-helpers/create-service-factory"),u={},c=["country","region","postcode","district","place","locality","neighborhood","address","poi","poi.landmark"];u.forwardGeocode=function(t){r.assertShape({query:r.required(r.string),mode:r.oneOf("mapbox.places","mapbox.places-permanent"),countries:r.arrayOf(r.string),proximity:r.oneOf(r.coordinates,"ip"),types:r.arrayOf(r.oneOf(c)),autocomplete:r.boolean,bbox:r.arrayOf(r.number),limit:r.number,language:r.arrayOf(r.string),routing:r.boolean,fuzzyMatch:r.boolean,worldview:r.string})(t),t.mode=t.mode||"mapbox.places";var e=s(i({country:t.countries},o(t,["proximity","types","autocomplete","bbox","limit","language","routing","fuzzyMatch","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(t,["mode","query"]),query:e})},u.reverseGeocode=function(t){r.assertShape({query:r.required(r.coordinates),mode:r.oneOf("mapbox.places","mapbox.places-permanent"),countries:r.arrayOf(r.string),types:r.arrayOf(r.oneOf(c)),bbox:r.arrayOf(r.number),limit:r.number,language:r.arrayOf(r.string),reverseMode:r.oneOf("distance","score"),routing:r.boolean,worldview:r.string})(t),t.mode=t.mode||"mapbox.places";var e=s(i({country:t.countries},o(t,["country","types","bbox","limit","language","reverseMode","routing","worldview"])));return this.client.createRequest({method:"GET",path:"/geocoding/v5/:mode/:query.json",params:o(t,["mode","query"]),query:e})},e.exports=a(u)},{"./service-helpers/create-service-factory":20,"./service-helpers/pick":22,"./service-helpers/stringify-booleans":23,"./service-helpers/validator":24,xtend:39}],20:[function(t,e,n){"use strict";function i(t){return function(e){var n;n=r.prototype.isPrototypeOf(e)?e:o(e);var i=Object.create(t);return i.client=n,i}}var r=t("../../lib/classes/mapi-client"),o=t("../../lib/client");e.exports=i},{"../../lib/classes/mapi-client":11,"../../lib/client":9}],21:[function(t,e,n){"use strict";function i(t,e){return Object.keys(t).reduce(function(n,i){return n[i]=e(i,t[i]),n},{})}e.exports=i},{}],22:[function(t,e,n){"use strict";function i(t,e){var n=function(t,n){return-1!==e.indexOf(t)&&void 0!==n};return"function"==typeof e&&(n=e),Object.keys(t).filter(function(e){return n(e,t[e])}).reduce(function(e,n){return e[n]=t[n],e},{})}e.exports=i},{}],23:[function(t,e,n){"use strict";function i(t){return r(t,function(t,e){return"boolean"==typeof e?JSON.stringify(e):e})}var r=t("./object-map");e.exports=i},{"./object-map":21}],24:[function(t,e,n){(function(n){(function(){"use strict";function i(t){if("undefined"!=typeof window){if(t instanceof n.Blob||t instanceof n.ArrayBuffer)return;return"Blob or ArrayBuffer"}if("string"!=typeof t&&void 0===t.pipe)return"Filename or Readable stream"}function r(t,e){return u.assert(u.strictShape(t),e)}function o(t){if("boolean"==typeof t)return"date";try{var e=new Date(t);if(e.getTime&&isNaN(e.getTime()))return"date"}catch(t){return"date"}}function s(t){return u.tuple(u.number,u.number)(t)}var a=t("xtend"),u=t("@mapbox/fusspot");e.exports=a(u,{file:i,date:o,coordinates:s,assertShape:r})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"@mapbox/fusspot":7,xtend:39}],25:[function(t,e,n){"use strict";function i(t){if(a[t])return a[t];var e=t.split("."),n=e[0],i=e[1];if(!i)throw new Error("Invalid token");var s=r(i),u={usage:n,user:s.u};return o(s,"a")&&(u.authorization=s.a),o(s,"exp")&&(u.expires=1e3*s.exp),o(s,"iat")&&(u.created=1e3*s.iat),o(s,"scopes")&&(u.scopes=s.scopes),o(s,"client")&&(u.client=s.client),o(s,"ll")&&(u.lastLogin=s.ll),o(s,"iu")&&(u.impersonator=s.iu),a[t]=u,u}function r(t){try{return JSON.parse(s.decode(t))}catch(t){throw new Error("Invalid token")}}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var s=t("base-64"),a={};e.exports=i},{"base-64":26}],26:[function(e,n,i){(function(e){(function(){"use strict";function r(t){"@babel/helpers - typeof";return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(o){var s="object"==(void 0===i?"undefined":r(i))&&i,a="object"==(void 0===n?"undefined":r(n))&&n&&n.exports==s&&n,u="object"==(void 0===e?"undefined":r(e))&&e;u.global!==u&&u.window!==u||(o=u);var c=function(t){this.message=t};c.prototype=new Error,c.prototype.name="InvalidCharacterError";var l=function(t){throw new c(t)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=/[\t\n\f\r ]/g,f=function(t){t=String(t).replace(p,"");var e=t.length;e%4==0&&(t=t.replace(/==?$/,""),e=t.length),(e%4==1||/[^+a-zA-Z0-9\/]/.test(t))&&l("Invalid character: the string to be decoded is not correctly encoded.");for(var n,i,r=0,o="",s=-1;++s<e;)i=h.indexOf(t.charAt(s)),n=r%4?64*n+i:i,r++%4&&(o+=String.fromCharCode(255&n>>(-2*r&6)));return o},d=function(t){t=String(t),/[^\0-\xFF]/.test(t)&&l("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,i,r,o=t.length%3,s="",a=-1,u=t.length-o;++a<u;)e=t.charCodeAt(a)<<16,n=t.charCodeAt(++a)<<8,i=t.charCodeAt(++a),r=e+n+i,s+=h.charAt(r>>18&63)+h.charAt(r>>12&63)+h.charAt(r>>6&63)+h.charAt(63&r);return 2==o?(e=t.charCodeAt(a)<<8,n=t.charCodeAt(++a),r=e+n,s+=h.charAt(r>>10)+h.charAt(r>>4&63)+h.charAt(r<<2&63)+"="):1==o&&(r=t.charCodeAt(a),s+=h.charAt(r>>2)+h.charAt(r<<4&63)+"=="),s},g={encode:d,decode:f,version:"0.1.0"};if("function"==typeof t&&"object"==r(t.amd)&&t.amd)t(function(){return g});else if(s&&!s.nodeType)if(a)a.exports=g;else for(var m in g)g.hasOwnProperty(m)&&(s[m]=g[m]);else o.base64=g}(void 0)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],27:[function(t,e,n){"use strict";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,i||t,o),a=c?c+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],s]:t._events[a].push(s):(t._events[a]=s,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}var u=Object.prototype.hasOwnProperty,c="~";Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(c=!1)),a.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)u.call(t,e)&&n.push(c?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=c?c+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,r=n.length,o=new Array(r);i<r;i++)o[i]=n[i].fn;return o},a.prototype.listenerCount=function(t){var e=c?c+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,r,o){var s=c?c+t:t;if(!this._events[s])return!1;var a,u,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,i),!0;case 5:return l.fn.call(l.context,e,n,i,r),!0;case 6:return l.fn.call(l.context,e,n,i,r,o),!0}for(u=1,a=new Array(h-1);u<h;u++)a[u-1]=arguments[u];l.fn.apply(l.context,a)}else{var p,f=l.length;for(u=0;u<f;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),h){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,n);break;case 4:l[u].fn.call(l[u].context,e,n,i);break;default:if(!a)for(p=1,a=new Array(h-1);p<h;p++)a[p-1]=arguments[p];l[u].fn.apply(l[u].context,a)}}return!0},a.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,n,i){var r=c?c+t:t;if(!this._events[r])return this;if(!e)return s(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||i&&!o.once||n&&o.context!==n||s(this,r);else{for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==e||i&&!o[a].once||n&&o[a].context!==n)&&u.push(o[a]);u.length?this._events[r]=1===u.length?u[0]:u:s(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=c?c+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=c,a.EventEmitter=a,void 0!==e&&(e.exports=a)},{}],28:[function(t,e,n){"use strict";function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=x(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}function o(t){return void 0===t._maxListeners?r.defaultMaxListeners:t._maxListeners}function s(t,e,n){if(e)t.call(n);else for(var i=t.length,r=y(t,i),o=0;o<i;++o)r[o].call(n)}function a(t,e,n,i){if(e)t.call(n,i);else for(var r=t.length,o=y(t,r),s=0;s<r;++s)o[s].call(n,i)}function u(t,e,n,i,r){if(e)t.call(n,i,r);else for(var o=t.length,s=y(t,o),a=0;a<o;++a)s[a].call(n,i,r)}function c(t,e,n,i,r,o){if(e)t.call(n,i,r,o);else for(var s=t.length,a=y(t,s),u=0;u<s;++u)a[u].call(n,i,r,o)}function l(t,e,n,i){if(e)t.apply(n,i);else for(var r=t.length,o=y(t,r),s=0;s<r;++s)o[s].apply(n,i)}function h(t,e,n,r){var s,a,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if(a=t._events,a?(a.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),a=t._events),u=a[e]):(a=t._events=x(null),t._eventsCount=0),u){if("function"==typeof u?u=a[e]=r?[n,u]:[u,n]:r?u.unshift(n):u.push(n),!u.warned&&(s=o(t))&&s>0&&u.length>s){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=u.length,"object"===("undefined"==typeof console?"undefined":i(console))&&console.warn&&console.warn("%s: %s",c.name,c.message)}}else u=a[e]=n,++t._eventsCount;return t}function p(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function f(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=L.call(p,i);return r.listener=n,i.wrapFn=r,r}function d(t,e,n){var i=t._events;if(!i)return[];var r=i[e];return r?"function"==typeof r?n?[r.listener||r]:[r]:n?v(r):y(r,r.length):[]}function g(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function m(t,e){for(var n=e,i=n+1,r=t.length;i<r;n+=1,i+=1)t[n]=t[i];t.pop()}function y(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function v(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}function b(t){var e=function(){};return e.prototype=t,new e}function _(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return n}function w(t){var e=this;return function(){return e.apply(t,arguments)}}var x=Object.create||b,E=Object.keys||_,L=Function.prototype.bind||w;e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0;var O,k=10;try{var A={};Object.defineProperty&&Object.defineProperty(A,"x",{value:0}),O=0===A.x}catch(t){O=!1}O?Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return k},set:function(t){if("number"!=typeof t||t<0||t!==t)throw new TypeError('"defaultMaxListeners" must be a positive number');k=t}}):r.defaultMaxListeners=k,r.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(t){var e,n,i,r,o,h,p="error"===t;if(h=this._events)p=p&&null==h.error;else if(!p)return!1;if(p){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var f=new Error('Unhandled "error" event. ('+e+")");throw f.context=e,f}if(!(n=h[t]))return!1;var d="function"==typeof n;switch(i=arguments.length){case 1:s(n,d,this);break;case 2:a(n,d,this,arguments[1]);break;case 3:u(n,d,this,arguments[1],arguments[2]);break;case 4:c(n,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];l(n,d,this,r)}return!0},r.prototype.addListener=function(t,e){return h(this,t,e,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(t,e){return h(this,t,e,!0)},r.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,f(this,t,e)),this},r.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,f(this,t,e)),this},r.prototype.removeListener=function(t,e){var n,i,r,o,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=x(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():m(n,r),1===n.length&&(i[t]=n[0]),i.removeListener&&this.emit("removeListener",t,s||e)}return this},r.prototype.removeAllListeners=function(t){var e,n,i;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=x(null),this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=x(null):delete n[t]),this;if(0===arguments.length){var r,o=E(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=x(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},r.prototype.listeners=function(t){return d(this,t,!0)},r.prototype.rawListeners=function(t){return d(this,t,!1)},r.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},r.prototype.listenerCount=g,r.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],29:[function(t,e,n){"use strict";!function(){var t=this,i={};void 0!==n?e.exports=i:t.fuzzy=i,i.simpleFilter=function(t,e){return e.filter(function(e){return i.test(t,e)})},i.test=function(t,e){return null!==i.match(t,e)},i.match=function(t,e,n){n=n||{};var i,r=0,o=[],s=e.length,a=0,u=0,c=n.pre||"",l=n.post||"",h=n.caseSensitive&&e||e.toLowerCase();t=n.caseSensitive&&t||t.toLowerCase();for(var p=0;p<s;p++)i=e[p],h[p]===t[r]?(i=c+i+l,r+=1,u+=1+u):u=0,a+=u,o[o.length]=i;return r===t.length?(a=h===t?1/0:a,{rendered:o.join(""),score:a}):null},i.filter=function(t,e,n){return e&&0!==e.length?"string"!=typeof t?e:(n=n||{},e.reduce(function(e,r,o,s){var a=r;n.extract&&(a=n.extract(r));var u=i.match(t,a,n);return null!=u&&(e[e.length]={string:u.rendered,score:u.score,index:o,original:r}),e},[]).sort(function(t,e){var n=e.score-t.score;return n||t.index-e.index})):[]}}()},{}],30:[function(t,e,n){"use strict";var i=Object.prototype.toString;e.exports=function(t){var e;return"[object Object]"===i.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],31:[function(t,e,n){(function(t){(function(){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e,n){function i(e){var n=g,i=m;return g=m=void 0,L=e,v=t.apply(i,n)}function o(t){return L=t,b=setTimeout(l,e),O?i(t):v}function s(t){var n=t-_,i=t-L,r=e-n;return k?x(r,y-i):r}function c(t){var n=t-_,i=t-L;return void 0===_||n>=e||n<0||k&&i>=y}function l(){var t=E();if(c(t))return h(t);b=setTimeout(l,s(t))}function h(t){return b=void 0,A&&g?i(t):(g=m=void 0,v)}function p(){void 0!==b&&clearTimeout(b),L=0,g=_=m=b=void 0}function f(){return void 0===b?v:h(E())}function d(){var t=E(),n=c(t);if(g=arguments,m=this,_=t,n){if(void 0===b)return o(_);if(k)return b=setTimeout(l,e),i(_)}return void 0===b&&(b=setTimeout(l,e)),v}var g,m,y,v,b,_,L=0,O=!1,k=!1,A=!0;if("function"!=typeof t)throw new TypeError(u);return e=a(e)||0,r(n)&&(O=!!n.leading,k="maxWait"in n,y=k?w(a(n.maxWait)||0,e):y,A="trailing"in n?!!n.trailing:A),d.cancel=p,d.flush=f,d}function r(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function o(t){return!!t&&"object"==n(t)}function s(t){return"symbol"==n(t)||o(t)&&_.call(t)==l}function a(t){if("number"==typeof t)return t;if(s(t))return c;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(h,"");var n=f.test(t);return n||d.test(t)?g(t.slice(2),n?2:8):p.test(t)?c:+t}var u="Expected a function",c=NaN,l="[object Symbol]",h=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,d=/^0o[0-7]+$/i,g=parseInt,m="object"==(void 0===t?"undefined":n(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,v=m||y||Function("return this")(),b=Object.prototype,_=b.toString,w=Math.max,x=Math.min,E=function(){return v.Date.now()};e.exports=i}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],32:[function(t,e,n){(function(n){(function(){"use strict";var i=t("./url-alphabet/index.cjs"),r=i.urlAlphabet;if("production"!==n.env.NODE_ENV){if("undefined"!=typeof navigator&&"ReactNative"===navigator.product&&"undefined"==typeof crypto)throw new Error("React Native does not have a built-in secure random generator. If you don’t need unpredictable IDs use `nanoid/non-secure`. For secure IDs, import `react-native-get-random-values` before Nano ID.");if("undefined"!=typeof msCrypto&&"undefined"==typeof crypto)throw new Error("Import file with `if (!window.crypto) window.crypto = window.msCrypto` before importing Nano ID to fix IE 11 support");if("undefined"==typeof crypto)throw new Error("Your browser does not have secure random generator. If you don’t need unpredictable IDs, you can use nanoid/non-secure.")}var o=function(t){return crypto.getRandomValues(new Uint8Array(t))},s=function(t,e,n){var i=(2<<Math.log(t.length-1)/Math.LN2)-1,r=-~(1.6*i*e/t.length);return function(){for(var o="";;)for(var s=n(r),a=r;a--;)if(o+=t[s[a]&i]||"",o.length===e)return o}},a=function(t,e){return s(t,e,o)},u=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21,e="",n=crypto.getRandomValues(new Uint8Array(t));t--;){var i=63&n[t];e+=i<36?i.toString(36):i<62?(i-26).toString(36).toUpperCase():i<63?"_":"-"}return e};e.exports={nanoid:u,customAlphabet:a,customRandom:s,urlAlphabet:r,random:o}}).call(this)}).call(this,t("_process"))},{"./url-alphabet/index.cjs":33,_process:34}],33:[function(t,e,n){"use strict";e.exports={urlAlphabet:"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"}},{}],34:[function(t,e,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(h===setTimeout)return setTimeout(t,0);if((h===i||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function s(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){m&&d&&(m=!1,d.length?g=d.concat(g):y=-1,g.length&&u())}function u(){if(!m){var t=o(a);m=!0;for(var e=g.length;e;){for(d=g,g=[];++y<e;)d&&d[y].run();y=-1,e=g.length}d=null,m=!1,s(t)}}function c(t,e){this.fun=t,this.array=e}function l(){}var h,p,f=e.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:i}catch(t){h=i}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}}();var d,g=[],m=!1,y=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];g.push(new c(t,e)),1!==g.length||m||o(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],35:[function(t,e,n){"use strict";!function(t,n,i){void 0!==e&&e.exports?e.exports=i():t.subtag=i()}(void 0,0,function(){function t(t){return t.match(s)||[]}function e(e){return t(e).filter(function(t,e){return t&&e})}function n(e){return e=t(e),{language:e[1]||o,extlang:e[2]||o,script:e[3]||o,region:e[4]||o}}function i(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!0})}function r(e,r,s){function a(n){return t(n)[e]||o}i(a,"pattern",r),i(n,s,a)}var o="",s=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;return r(1,/^[a-zA-Z]{2,3}$/,"language"),r(2,/^[a-zA-Z]{3}$/,"extlang"),r(3,/^[a-zA-Z]{4}$/,"script"),r(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),i(n,"split",e),n})},{}],36:[function(t,e,n){"use strict";var i=t("./src/suggestions");e.exports=i,"undefined"!=typeof window&&(window.Suggestions=i)},{"./src/suggestions":38}],37:[function(t,e,n){"use strict";var i=function(t){return this.component=t,this.items=[],this.active=0,this.wrapper=document.createElement("div"),this.wrapper.className="suggestions-wrapper",this.element=document.createElement("ul"),this.element.className="suggestions",this.wrapper.appendChild(this.element),this.selectingListItem=!1,t.el.parentNode.insertBefore(this.wrapper,t.el.nextSibling),this};i.prototype.show=function(){this.element.style.display="block"},i.prototype.hide=function(){this.element.style.display="none"},i.prototype.add=function(t){this.items.push(t)},i.prototype.clear=function(){this.items=[],this.active=0},i.prototype.isEmpty=function(){return!this.items.length},i.prototype.isVisible=function(){return"block"===this.element.style.display},i.prototype.draw=function(){if(this.element.innerHTML="",0===this.items.length)return void this.hide();for(var t=0;t<this.items.length;t++)this.drawItem(this.items[t],this.active===t);this.show()},i.prototype.drawItem=function(t,e){var n=document.createElement("li"),i=document.createElement("a");e&&(n.className+=" active"),i.innerHTML=t.string,n.appendChild(i),this.element.appendChild(n),n.addEventListener("mousedown",function(){this.selectingListItem=!0}.bind(this)),n.addEventListener("mouseup",function(){this.handleMouseUp.call(this,t)}.bind(this))},i.prototype.handleMouseUp=function(t){this.selectingListItem=!1,this.component.value(t.original),this.clear(),this.draw()},i.prototype.move=function(t){this.active=t,this.draw()},i.prototype.previous=function(){this.move(0===this.active?this.items.length-1:this.active-1)},i.prototype.next=function(){this.move(this.active===this.items.length-1?0:this.active+1)},i.prototype.drawError=function(t){var e=document.createElement("li");e.innerHTML=t,this.element.appendChild(e),this.show()},e.exports=i},{}],38:[function(t,e,n){"use strict";var i=t("xtend"),r=t("fuzzy"),o=t("./list"),s=function(t,e,n){return n=n||{},this.options=i({minLength:2,limit:5,filter:!0,hideOnBlur:!0},n),this.el=t,this.data=e||[],this.list=new o(this),this.query="",this.selected=null,this.list.draw(),this.el.addEventListener("keyup",function(t){this.handleKeyUp(t.keyCode)}.bind(this),!1),this.el.addEventListener("keydown",function(t){this.handleKeyDown(t)}.bind(this)),this.el.addEventListener("focus",function(){this.handleFocus()}.bind(this)),this.el.addEventListener("blur",function(){this.handleBlur()}.bind(this)),this.el.addEventListener("paste",function(t){this.handlePaste(t)}.bind(this)),this.render=this.options.render?this.options.render.bind(this):this.render.bind(this),this.getItemValue=this.options.getItemValue?this.options.getItemValue.bind(this):this.getItemValue.bind(this),this};s.prototype.handleKeyUp=function(t){40!==t&&38!==t&&27!==t&&13!==t&&9!==t&&this.handleInputChange(this.el.value)},s.prototype.handleKeyDown=function(t){switch(t.keyCode){case 13:case 9:this.list.isEmpty()||(this.list.isVisible()&&t.preventDefault(),this.value(this.list.items[this.list.active].original),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next()}},s.prototype.handleBlur=function(){!this.list.selectingListItem&&this.options.hideOnBlur&&this.list.hide()},s.prototype.handlePaste=function(t){if(t.clipboardData)this.handleInputChange(t.clipboardData.getData("Text"));else{var e=this;setTimeout(function(){e.handleInputChange(t.target.value)},100)}},s.prototype.handleInputChange=function(t){if(this.query=this.normalize(t),this.list.clear(),this.query.length<this.options.minLength)return void this.list.draw();this.getCandidates(function(t){for(var e=0;e<t.length&&(this.list.add(t[e]),e!==this.options.limit-1);e++);this.list.draw()}.bind(this))},s.prototype.handleFocus=function(){this.list.isEmpty()||this.list.show(),this.list.selectingListItem=!1},s.prototype.update=function(t){this.data=t,this.handleKeyUp()},s.prototype.clear=function(){this.data=[],this.list.clear()},s.prototype.normalize=function(t){return t=t.toLowerCase()},s.prototype.match=function(t,e){return t.indexOf(e)>-1},s.prototype.value=function(t){if(this.selected=t,this.el.value=this.getItemValue(t),
document.createEvent){var e=document.createEvent("HTMLEvents");e.initEvent("change",!0,!1),this.el.dispatchEvent(e)}else this.el.fireEvent("onchange")},s.prototype.getCandidates=function(t){var e,n={pre:"<strong>",post:"</strong>",extract:function(t){return this.getItemValue(t)}.bind(this)};this.options.filter?(e=r.filter(this.query,this.data,n),e=e.map(function(t){return{original:t.original,string:this.render(t.original,t.string)}}.bind(this))):e=this.data.map(function(t){return{original:t,string:this.render(t)}}.bind(this)),t(e)},s.prototype.getItemValue=function(t){return t},s.prototype.render=function(t,e){if(e)return e;for(var n=t.original?this.getItemValue(t.original):this.getItemValue(t),i=this.normalize(n),r=i.lastIndexOf(this.query);r>-1;){var o=r+this.query.length;n=n.slice(0,r)+"<strong>"+n.slice(r,o)+"</strong>"+n.slice(o),r=i.slice(0,r).lastIndexOf(this.query)}return n},s.prototype.renderError=function(t){this.list.drawError(t)},e.exports=s},{"./list":37,fuzzy:29,xtend:39}],39:[function(t,e,n){"use strict";function i(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t}e.exports=i;var r=Object.prototype.hasOwnProperty},{}]},{},[4])(4)});