@local-logic/sdks-app 1.6.3 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-legacy.342dbea0.js +1 -0
- package/dist/assets/{index-legacy.179cd665.js → index-legacy.38ddc665.js} +1 -1
- package/dist/assets/{index-legacy.fbe89b00.js → index-legacy.66e8a364.js} +6 -6
- package/dist/assets/{index-legacy.6046cbcc.js → index-legacy.eaf5a83c.js} +1 -1
- package/dist/assets/{index.bbaf30f8.js → index.1f97e119.js} +91 -87
- package/dist/assets/{index.b3ea593b.js → index.26d510ab.js} +39 -35
- package/dist/assets/{index.cd28a05f.js → index.301fb019.js} +1 -1
- package/dist/assets/{index.1dd67175.js → index.7361062f.js} +202 -202
- package/dist/assets/polyfills-legacy.38956e0d.js +1 -0
- package/dist/index.html +3 -3
- package/dist/types/components/Search/styles.d.ts +1 -4
- package/dist/types/components/Search/styles.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/components/Section/styles.d.ts +1 -4
- package/dist/types/sdks/DataExplorer/components/Section/styles.d.ts.map +1 -1
- package/dist/types/sdks/DataExplorer/components/Section/styles.js +6 -2
- package/dist/types/sdks/DataExplorer/components/Section/styles.js.map +1 -1
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/CommuteCalculator/styles.d.ts +1 -4
- package/dist/types/sdks/LocalContent/Map/CommuteContainer/CommuteCalculator/styles.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/styles.d.ts +1 -4
- package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/styles.d.ts.map +1 -1
- package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/styles.js +6 -2
- package/dist/types/sdks/LocalContent/Map/DesktopScores/ScoreCategoryAccordion/ScoreCategory/Score/styles.js.map +1 -1
- package/package.json +4 -4
- package/dist/assets/index-legacy.c9ad2d55.js +0 -1
- package/dist/assets/polyfills-legacy.419ef49e.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){var t,e,n,r,i,o,s,a,u,c,l,f,h,p,d,g;function v(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */y=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(A){a=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),s=new R(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return x()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=S(s,n);if(a){if(a===l)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,s),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(A){return{type:"throw",arg:A}}}t.wrap=u;var l={};function f(){}function h(){}function p(){}var d={};a(d,i,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(O([])));v&&v!==e&&n.call(v,i)&&(d=v);var m=p.prototype=f.prototype=Object.create(d);function b(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(i,o,s,a){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==w(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function S(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return h.prototype=p,a(m,"constructor",p),a(p,"constructor",h),h.displayName=a(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(_.prototype),a(_.prototype,o,(function(){return this})),t.AsyncIterator=_,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var s=new _(u(e,n,r,i),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},b(m),a(m,s,"Generator"),a(m,i,(function(){return this})),a(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function m(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(c){return void n(c)}a.done?e(u):Promise.resolve(u).then(r,i)}function b(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){m(o,r,i,s,a,"next",t)}function a(t){m(o,r,i,s,a,"throw",t)}s(void 0)}))}}function w(t){return w="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},w(t)}function _(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){k(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);s=!0);}catch(u){a=!0,i=u}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return x(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}System.register(["./index-legacy.eaf5a83c.js","./index-legacy.66e8a364.js"],(function(m,S){"use strict";var O,x,A,T,L,j,C,P,M,B,I,N,U,D,F,q,Y,z,V,W,J,G,H,$,X,Q,K,Z,tt,et,nt,rt,it,ot,st,at,ut,ct,lt;return{setters:[function(t){O=t.g,x=t.c,A=t.n,T=t.f,L=t.S,j=t.u,C=t.b,P=t.s,M=t.p,B=t.i,I=t.k,N=t.m,U=t.N,D=t.P},function(t){F=t.R,q=t.u,Y=t.r,z=t.j,V=t.s,W=t.y,J=t.k,G=t.e,H=t.p,$=t.a5,X=t.q,Q=t.c,K=t._,Z=t.d,tt=t.A,et=t.v,nt=t.T,rt=t.a6,it=t.h,ot=t.a7,st=t.F,at=t.P,ut=t.a8,ct=t.a9,lt=t.aa}],execute:function(){var S=F.createContext({}),ft=function(){return Y.exports.useContext(S)},ht=function(t){var e,n,r=t.children,i=q().sdkState,o=R(Y.exports.useReducer((function(t,e){return E(E({},t),e)}),{location:{lat:(null===(e=i.options)||void 0===e?void 0:e.lat)||43.661337,lng:(null===(n=i.options)||void 0===n?void 0:n.lng)||-79.401903},scores:{checked:!1,include:[]},pois:{checked:!1,include:[],radius:5e3,limit:15},schools:{checked:!1,radius:5e3,limit:15},demographics:{checked:!1,radius:2500},profiles:{checked:!1}}),2),s=o[0],a=o[1],u=Y.exports.useMemo((function(){return{dataExplorerState:s,setDataExplorerState:a}}),[s,a]);return z(S.Provider,{value:u,children:r})},pt=V.div(t||(t=_(["\n height: 100vh;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n background-color: ",";\n"])),W["--ll-color-background"]),dt=V(O)(e||(e=_(["\n overflow-y: auto;\n padding: ",";\n"])),W["--ll-spacing-medium"]),gt=J({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),vt=J({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),yt=V.div(n||(n=_(["\n display: flex;\n flex-direction: column;\n"]))),mt=V.div(r||(r=_(["\n height: 20px;\n width: 20px;\n border: 2px solid ",";\n color: ",";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: ",";\n font-size: ",";\n"])),W["--ll-color-primary"],W["--ll-color-primary"],W["--ll-spacing-small"],W["--ll-font-size-p"]),bt=V(x)(i||(i=_(["\n all: unset;\n flex: 1;\n display: flex;\n align-items: center;\n font-family: ",";\n"])),W["--ll-font-family"]),wt=V.div(o||(o=_(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: "," 0;\n"])),W["--ll-spacing-x-small"]),_t=V(A)(s||(s=_(["\n background-color: ",";\n position: relative;\n z-index: 1;\n overflow: hidden;\n margin-left: calc(-1 * ",");\n margin-right: calc(-1 * ",');\n\n [data-state="open"] & {\n /* TODO: Re-implement this once StyledComponents is fixed. https://locallogic.atlassian.net/browse/LL22-1107 */\n /* animation: ',' 300ms cubic-bezier(0.87, 0, 0.13, 1); */\n visibility: visible;\n }\n\n [data-state="closed"] & {\n /* TODO: Re-implement this once StyledComponents is fixed. https://locallogic.atlassian.net/browse/LL22-1107 */\n /* animation: '," 300ms cubic-bezier(0.87, 0, 0.13, 1); */\n visibility: hidden;\n }\n"])),W["--ll-color-surface"],W["--ll-spacing-medium"],W["--ll-spacing-medium"],gt,vt),St=V.div(a||(a=_(["\n padding: ",";\n"])),W["--ll-spacing-medium"]),Et=V.span(u||(u=_(["\n margin-left: ",";\n ","[data-state=open] & {\n transform: rotate(90deg);\n } ;\n"])),W["--ll-spacing-x-small"],bt),kt=V.div(c||(c=_(["\n display: flex;\n"]))),Rt=function(t){var e=t.title,n=t.description,r=t.children,i=t.value,o=t.number,s=ft(),a=s.dataExplorerState,u=s.setDataExplorerState;return z(T,{value:i,children:G(yt,{children:[G(wt,{children:[G(bt,{children:[z(mt,{children:o}),z(H,{variant:"h6",noMargin:!0,weight:"--ll-font-weight-medium",children:e})]}),G(kt,{children:["checked"in a[i]&&z($,{checked:a[i].checked,onCheckedChange:function(t){return u(k({},i,E(E({},a[i]),{},{checked:t})))}}),z(bt,{children:z(Et,{children:z(X,{SVGElement:L,fill:W["--ll-color-on-background-variant1"]})})})]})]}),z(_t,{children:G(St,{children:[z(H,{color:"--ll-color-on-background-variant1",children:n}),r]})})]})})},Ot={exports:{}};!function(t,e){!function(t){var e;function n(){}function r(){r.init.call(this)}function i(t){return void 0===t._maxListeners?r.defaultMaxListeners:t._maxListeners}function o(t,e,n){if(e)t.call(n);else for(var r=t.length,i=g(t,r),o=0;o<r;++o)i[o].call(n)}function s(t,e,n,r){if(e)t.call(n,r);else for(var i=t.length,o=g(t,i),s=0;s<i;++s)o[s].call(n,r)}function a(t,e,n,r,i){if(e)t.call(n,r,i);else for(var o=t.length,s=g(t,o),a=0;a<o;++a)s[a].call(n,r,i)}function u(t,e,n,r,i,o){if(e)t.call(n,r,i,o);else for(var s=t.length,a=g(t,s),u=0;u<s;++u)a[u].call(n,r,i,o)}function c(t,e,n,r){if(e)t.apply(n,r);else for(var i=t.length,o=g(t,i),s=0;s<i;++s)o[s].apply(n,r)}function l(t,e,r,o){var s,a,u;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),u=a[e]):(a=t._events=new n,t._eventsCount=0),u){if("function"==typeof u?u=a[e]=o?[r,u]:[u,r]:o?u.unshift(r):u.push(r),!u.warned&&(s=i(t))&&s>0&&u.length>s){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=u.length,f(c)}}else u=a[e]=r,++t._eventsCount;return t}function f(t){"function"==typeof console.warn?console.warn(t):console.log(t)}function h(t,e,n){var r=!1;function i(){t.removeListener(e,i),r||(r=!0,n.apply(t,arguments))}return i.listener=n,i}function p(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 d(t,e){for(var n=e,r=n+1,i=t.length;r<i;n+=1,r+=1)t[n]=t[r];t.pop()}function g(t,e){for(var n=new Array(e);e--;)n[e]=t[e];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}n.prototype=Object.create(null),r.EventEmitter=r,r.usingDomains=!1,r.prototype.domain=void 0,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.init=function(){this.domain=null,r.usingDomains&&e.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new n,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},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 i(this)},r.prototype.emit=function(t){var e,n,r,i,l,f,h,p="error"===t;if(f=this._events)p=p&&null==f.error;else if(!p)return!1;if(h=this.domain,p){if(e=arguments[1],!h){if(e instanceof Error)throw e;var d=new Error('Uncaught, unspecified "error" event. ('+e+")");throw d.context=e,d}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=h,e.domainThrown=!1,h.emit("error",e),!1}if(!(n=f[t]))return!1;var g="function"==typeof n;switch(r=arguments.length){case 1:o(n,g,this);break;case 2:s(n,g,this,arguments[1]);break;case 3:a(n,g,this,arguments[1],arguments[2]);break;case 4:u(n,g,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),l=1;l<r;l++)i[l-1]=arguments[l];c(n,g,this,i)}return!0},r.prototype.addListener=function(t,e){return l(this,t,e,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(t,e){return l(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,h(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,h(this,t,e)),this},r.prototype.removeListener=function(t,e){var r,i,o,s,a;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[t]))return this;if(r===e||r.listener&&r.listener===e)0==--this._eventsCount?this._events=new n:(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,s=r.length;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){a=r[s].listener,o=s;break}if(o<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new n,this;delete i[t]}else d(r,o);i.removeListener&&this.emit("removeListener",t,a||e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new n,this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=new n:delete r[t]),this;if(0===arguments.length){for(var i,o=Object.keys(r),s=0;s<o.length;++s)"removeListener"!==(i=o[s])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=new n,this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},r.prototype.listeners=function(t){var e,n=this._events;return n&&(e=n[t])?"function"==typeof e?[e.listener||e]:v(e):[]},r.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},r.prototype.listenerCount=p,r.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var y=void 0!==Q?Q:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},m=[],b=[],_="undefined"!=typeof Uint8Array?Uint8Array:Array,S=!1;function E(){S=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,n=t.length;e<n;++e)m[e]=t[e],b[t.charCodeAt(e)]=e;b["-".charCodeAt(0)]=62,b["_".charCodeAt(0)]=63}function k(t){var e,n,r,i,o,s;S||E();var a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[a-2]?2:"="===t[a-1]?1:0,s=new _(3*a/4-o),r=o>0?a-4:a;var u=0;for(e=0,n=0;e<r;e+=4,n+=3)i=b[t.charCodeAt(e)]<<18|b[t.charCodeAt(e+1)]<<12|b[t.charCodeAt(e+2)]<<6|b[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=b[t.charCodeAt(e)]<<2|b[t.charCodeAt(e+1)]>>4,s[u++]=255&i):1===o&&(i=b[t.charCodeAt(e)]<<10|b[t.charCodeAt(e+1)]<<4|b[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function R(t){return m[t>>18&63]+m[t>>12&63]+m[t>>6&63]+m[63&t]}function O(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(R(r));return i.join("")}function x(t){var e;S||E();for(var n=t.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(O(t,a,a+s>u?u:a+s));return 1===r?(e=t[n-1],i+=m[e>>2],i+=m[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=m[e>>10],i+=m[e>>4&63],i+=m[e<<2&63],i+="="),o.push(i),o.join("")}function A(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)}function T(t,e,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+p]=255&s,p+=d,s/=256,c-=8);t[n+p-d]|=128*g}var L={}.toString,j=Array.isArray||function(t){return"[object Array]"==L.call(t)},C=50;function P(){return B.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function M(t,e){if(P()<e)throw new RangeError("Invalid typed array length");return B.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=B.prototype:(null===t&&(t=new B(e)),t.length=e),t}function B(t,e,n){if(!(B.TYPED_ARRAY_SUPPORT||this instanceof B))return new B(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return D(this,t)}return I(this,t,e,n)}function I(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?Y(t,e,n,r):"string"==typeof e?F(t,e,n):z(t,e)}function N(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function U(t,e,n,r){return N(e),e<=0?M(t,e):void 0!==n?"string"==typeof r?M(t,e).fill(n,r):M(t,e).fill(n):M(t,e)}function D(t,e){if(N(e),t=M(t,e<0?0:0|V(e)),!B.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function F(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!B.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|J(e,n),i=(t=M(t,r)).write(e,n);return i!==r&&(t=t.slice(0,i)),t}function q(t,e){var n=e.length<0?0:0|V(e.length);t=M(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function Y(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),B.TYPED_ARRAY_SUPPORT?(t=e).__proto__=B.prototype:t=q(t,e),t}function z(t,e){if(W(e)){var n=0|V(e.length);return 0===(t=M(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||At(e.length)?M(t,0):q(t,e);if("Buffer"===e.type&&j(e.data))return q(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function V(t){if(t>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return 0|t}function W(t){return!(null==t||!t._isBuffer)}function J(t,e){if(W(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Et(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Ot(t).length;default:if(r)return Et(t).length;e=(""+e).toLowerCase(),r=!0}}function G(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return lt(this,e,n);case"utf8":case"utf-8":return ot(this,e,n);case"ascii":return ut(this,e,n);case"latin1":case"binary":return ct(this,e,n);case"base64":return it(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ft(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function H(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function $(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=B.from(e,r)),W(e))return 0===e.length?-1:X(t,e,n,r,i);if("number"==typeof e)return e&=255,B.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):X(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function X(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(t,o+h)!==c(e,h)){f=!1;break}if(f)return o}return-1}function K(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function Z(t,e,n,r){return xt(Et(e,t.length-n),t,n,r)}function tt(t,e,n,r){return xt(kt(e),t,n,r)}function et(t,e,n,r){return tt(t,e,n,r)}function nt(t,e,n,r){return xt(Ot(e),t,n,r)}function rt(t,e,n,r){return xt(Rt(e,t.length-n),t,n,r)}function it(t,e,n){return 0===e&&n===t.length?x(t):x(t.slice(e,n))}function ot(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,u,c=t[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return at(r)}B.TYPED_ARRAY_SUPPORT=void 0===y.TYPED_ARRAY_SUPPORT||y.TYPED_ARRAY_SUPPORT,B.poolSize=8192,B._augment=function(t){return t.__proto__=B.prototype,t},B.from=function(t,e,n){return I(null,t,e,n)},B.TYPED_ARRAY_SUPPORT&&(B.prototype.__proto__=Uint8Array.prototype,B.__proto__=Uint8Array),B.alloc=function(t,e,n){return U(null,t,e,n)},B.allocUnsafe=function(t){return D(null,t)},B.allocUnsafeSlow=function(t){return D(null,t)},B.isBuffer=Tt,B.compare=function(t,e){if(!W(t)||!W(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},B.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},B.concat=function(t,e){if(!j(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return B.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=B.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!W(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},B.byteLength=J,B.prototype._isBuffer=!0,B.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)H(this,e,e+1);return this},B.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)H(this,e,e+3),H(this,e+1,e+2);return this},B.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)H(this,e,e+7),H(this,e+1,e+6),H(this,e+2,e+5),H(this,e+3,e+4);return this},B.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?ot(this,0,t):G.apply(this,arguments)},B.prototype.equals=function(t){if(!W(t))throw new TypeError("Argument must be a Buffer");return this===t||0===B.compare(this,t)},B.prototype.inspect=function(){var t="",e=C;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},B.prototype.compare=function(t,e,n,r,i){if(!W(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=t.slice(e,n),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},B.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},B.prototype.indexOf=function(t,e,n){return $(this,t,e,n,!0)},B.prototype.lastIndexOf=function(t,e,n){return $(this,t,e,n,!1)},B.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return K(this,t,e,n);case"utf8":case"utf-8":return Z(this,t,e,n);case"ascii":return tt(this,t,e,n);case"latin1":case"binary":return et(this,t,e,n);case"base64":return nt(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rt(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},B.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var st=4096;function at(t){var e=t.length;if(e<=st)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=st));return n}function ut(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function ct(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function lt(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=St(t[o]);return i}function ft(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function ht(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function pt(t,e,n,r,i,o){if(!W(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function dt(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function gt(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function vt(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function yt(t,e,n,r,i){return i||vt(t,e,n,4),T(t,e,n,r,23,4),n+4}function mt(t,e,n,r,i){return i||vt(t,e,n,8),T(t,e,n,r,52,8),n+8}B.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),B.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=B.prototype;else{var i=e-t;n=new B(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},B.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||ht(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},B.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||ht(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},B.prototype.readUInt8=function(t,e){return e||ht(t,1,this.length),this[t]},B.prototype.readUInt16LE=function(t,e){return e||ht(t,2,this.length),this[t]|this[t+1]<<8},B.prototype.readUInt16BE=function(t,e){return e||ht(t,2,this.length),this[t]<<8|this[t+1]},B.prototype.readUInt32LE=function(t,e){return e||ht(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},B.prototype.readUInt32BE=function(t,e){return e||ht(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},B.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||ht(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},B.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||ht(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},B.prototype.readInt8=function(t,e){return e||ht(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},B.prototype.readInt16LE=function(t,e){e||ht(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},B.prototype.readInt16BE=function(t,e){e||ht(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},B.prototype.readInt32LE=function(t,e){return e||ht(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},B.prototype.readInt32BE=function(t,e){return e||ht(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},B.prototype.readFloatLE=function(t,e){return e||ht(t,4,this.length),A(this,t,!0,23,4)},B.prototype.readFloatBE=function(t,e){return e||ht(t,4,this.length),A(this,t,!1,23,4)},B.prototype.readDoubleLE=function(t,e){return e||ht(t,8,this.length),A(this,t,!0,52,8)},B.prototype.readDoubleBE=function(t,e){return e||ht(t,8,this.length),A(this,t,!1,52,8)},B.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||pt(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},B.prototype.writeUIntBE=function(t,e,n,r){t=+t,e|=0,n|=0,r||pt(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},B.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,1,255,0),B.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},B.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,2,65535,0),B.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):dt(this,t,e,!0),e+2},B.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,2,65535,0),B.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):dt(this,t,e,!1),e+2},B.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,4,4294967295,0),B.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):gt(this,t,e,!0),e+4},B.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,4,4294967295,0),B.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):gt(this,t,e,!1),e+4},B.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);pt(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},B.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);pt(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},B.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,1,127,-128),B.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},B.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,2,32767,-32768),B.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):dt(this,t,e,!0),e+2},B.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,2,32767,-32768),B.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):dt(this,t,e,!1),e+2},B.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,4,2147483647,-2147483648),B.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):gt(this,t,e,!0),e+4},B.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||pt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),B.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):gt(this,t,e,!1),e+4},B.prototype.writeFloatLE=function(t,e,n){return yt(this,t,e,!0,n)},B.prototype.writeFloatBE=function(t,e,n){return yt(this,t,e,!1,n)},B.prototype.writeDoubleLE=function(t,e,n){return mt(this,t,e,!0,n)},B.prototype.writeDoubleBE=function(t,e,n){return mt(this,t,e,!1,n)},B.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!B.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},B.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!B.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=W(t)?t:Et(new B(t,r).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var bt=/[^+\/0-9A-Za-z-_]/g;function wt(t){if((t=_t(t).replace(bt,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function _t(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function St(t){return t<16?"0"+t.toString(16):t.toString(16)}function Et(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function kt(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function Rt(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=(n=t.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}function Ot(t){return k(wt(t))}function xt(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function At(t){return t!=t}function Tt(t){return null!=t&&(!!t._isBuffer||Lt(t)||jt(t))}function Lt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function jt(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Lt(t.slice(0,0))}function Ct(){throw new Error("setTimeout has not been defined")}function Pt(){throw new Error("clearTimeout has not been defined")}var Mt=Ct,Bt=Pt;function It(t){if(Mt===setTimeout)return setTimeout(t,0);if((Mt===Ct||!Mt)&&setTimeout)return Mt=setTimeout,setTimeout(t,0);try{return Mt(t,0)}catch(e){try{return Mt.call(null,t,0)}catch(e){return Mt.call(this,t,0)}}}function Nt(t){if(Bt===clearTimeout)return clearTimeout(t);if((Bt===Pt||!Bt)&&clearTimeout)return Bt=clearTimeout,clearTimeout(t);try{return Bt(t)}catch(e){try{return Bt.call(null,t)}catch(e){return Bt.call(this,t)}}}"function"==typeof y.setTimeout&&(Mt=setTimeout),"function"==typeof y.clearTimeout&&(Bt=clearTimeout);var Ut,Dt=[],Ft=!1,qt=-1;function Yt(){Ft&&Ut&&(Ft=!1,Ut.length?Dt=Ut.concat(Dt):qt=-1,Dt.length&&zt())}function zt(){if(!Ft){var t=It(Yt);Ft=!0;for(var e=Dt.length;e;){for(Ut=Dt,Dt=[];++qt<e;)Ut&&Ut[qt].run();qt=-1,e=Dt.length}Ut=null,Ft=!1,Nt(t)}}function Vt(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];Dt.push(new Wt(t,e)),1!==Dt.length||Ft||It(zt)}function Wt(t,e){this.fun=t,this.array=e}Wt.prototype.run=function(){this.fun.apply(null,this.array)};var Jt=y.performance||{};Jt.now||Jt.mozNow||Jt.msNow||Jt.oNow||Jt.webkitNow;var Gt="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},Ht=/%[sdj%]/g;function $t(t){if(!de(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(te(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(t).replace(Ht,(function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}})),s=r[n];n<i;s=r[++n])he(s)||!ye(s)?o+=" "+s:o+=" "+te(s);return o}function Xt(t,e){if(ge(y.process))return function(){return Xt(t,e).apply(this,arguments)};var n=!1;function r(){return n||(console.error(e),n=!0),t.apply(this,arguments)}return r}var Qt,Kt={};function Zt(t){if(ge(Qt)&&(Qt=""),t=t.toUpperCase(),!Kt[t])if(new RegExp("\\b"+t+"\\b","i").test(Qt)){var e=0;Kt[t]=function(){var n=$t.apply(null,arguments);console.error("%s %d: %s",t,e,n)}}else Kt[t]=function(){};return Kt[t]}function te(t,e){var n={seen:[],stylize:ne};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),fe(e)?n.showHidden=e:e&&Se(n,e),ge(n.showHidden)&&(n.showHidden=!1),ge(n.depth)&&(n.depth=2),ge(n.colors)&&(n.colors=!1),ge(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=ee),ie(n,t,n.depth)}function ee(t,e){var n=te.styles[e];return n?"["+te.colors[n][0]+"m"+t+"["+te.colors[n][1]+"m":t}function ne(t,e){return t}function re(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}function ie(t,e,n){if(t.customInspect&&e&&we(e.inspect)&&e.inspect!==te&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return de(r)||(r=ie(t,r,n)),r}var i=oe(t,e);if(i)return i;var o=Object.keys(e),s=re(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),be(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return se(e);if(0===o.length){if(we(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(ve(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(me(e))return t.stylize(Date.prototype.toString.call(e),"date");if(be(e))return se(e)}var u,c="",l=!1,f=["{","}"];return le(e)&&(l=!0,f=["[","]"]),we(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),ve(e)&&(c=" "+RegExp.prototype.toString.call(e)),me(e)&&(c=" "+Date.prototype.toUTCString.call(e)),be(e)&&(c=" "+se(e)),0!==o.length||l&&0!=e.length?n<0?ve(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=l?ae(t,e,n,s,o):o.map((function(r){return ue(t,e,n,s,r,l)})),t.seen.pop(),ce(u,c,f)):f[0]+c+f[1]}function oe(t,e){if(ge(e))return t.stylize("undefined","undefined");if(de(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return pe(e)?t.stylize(""+e,"number"):fe(e)?t.stylize(""+e,"boolean"):he(e)?t.stylize("null","null"):void 0}function se(t){return"["+Error.prototype.toString.call(t)+"]"}function ae(t,e,n,r,i){for(var o=[],s=0,a=e.length;s<a;++s)Ee(e,String(s))?o.push(ue(t,e,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(ue(t,e,n,r,i,!0))})),o}function ue(t,e,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),Ee(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=he(n)?ie(t,u.value,null):ie(t,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),ge(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function ce(t,e,n){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function le(t){return Array.isArray(t)}function fe(t){return"boolean"==typeof t}function he(t){return null===t}function pe(t){return"number"==typeof t}function de(t){return"string"==typeof t}function ge(t){return void 0===t}function ve(t){return ye(t)&&"[object RegExp]"===_e(t)}function ye(t){return"object"===w(t)&&null!==t}function me(t){return ye(t)&&"[object Date]"===_e(t)}function be(t){return ye(t)&&("[object Error]"===_e(t)||t instanceof Error)}function we(t){return"function"==typeof t}function _e(t){return Object.prototype.toString.call(t)}function Se(t,e){if(!e||!ye(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}function Ee(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ke(){this.head=null,this.tail=null,this.length=0}te.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},te.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},ke.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},ke.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},ke.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},ke.prototype.clear=function(){this.head=this.tail=null,this.length=0},ke.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},ke.prototype.concat=function(t){if(0===this.length)return B.alloc(0);if(1===this.length)return this.head.data;for(var e=B.allocUnsafe(t>>>0),n=this.head,r=0;n;)n.data.copy(e,r),r+=n.data.length,n=n.next;return e};var Re=B.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Oe(t){if(t&&!Re(t))throw new Error("Unknown encoding: "+t)}function xe(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),Oe(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Te;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Le;break;default:return void(this.write=Ae)}this.charBuffer=new B(6),this.charReceived=0,this.charLength=0}function Ae(t){return t.toString(this.encoding)}function Te(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function Le(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}xe.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";if(t=t.slice(n,t.length),!((r=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1))>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var r,i=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),i=(e+=t.toString(this.encoding,0,i)).length-1,(r=e.charCodeAt(i))>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},xe.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},xe.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e},Be.ReadableState=Me;var je=Zt("stream");function Ce(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}function Pe(t,e){return t.listeners(e).length}function Me(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof jn&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new ke,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new xe(t.encoding),this.encoding=t.encoding)}function Be(t){if(!(this instanceof Be))return new Be(t);this._readableState=new Me(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),r.call(this)}function Ie(t,e,n,r,i){var o=qe(e,n);if(o)t.emit("error",o);else if(null===n)e.reading=!1,Ye(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else{var u;!e.decoder||i||r||(n=e.decoder.write(n),u=!e.objectMode&&0===n.length),i||(e.reading=!1),u||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&ze(t))),We(t,e)}else i||(e.reading=!1);return Ne(e)}function Ne(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}Gt(Be,r),Be.prototype.push=function(t,e){var n=this._readableState;return n.objectMode||"string"!=typeof t||(e=e||n.defaultEncoding)!==n.encoding&&(t=B.from(t,e),e=""),Ie(this,n,t,e,!1)},Be.prototype.unshift=function(t){return Ie(this,this._readableState,t,"",!0)},Be.prototype.isPaused=function(){return!1===this._readableState.flowing},Be.prototype.setEncoding=function(t){return this._readableState.decoder=new xe(t),this._readableState.encoding=t,this};var Ue=8388608;function De(t){return t>=Ue?t=Ue:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Fe(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=De(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function qe(t,e){var n=null;return Tt(e)||"string"==typeof e||null==e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function Ye(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,ze(t)}}function ze(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(je("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Vt(Ve,t):Ve(t))}function Ve(t){je("emit readable"),t.emit("readable"),Qe(t)}function We(t,e){e.readingMore||(e.readingMore=!0,Vt(Je,t,e))}function Je(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(je("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function Ge(t){return function(){var e=t._readableState;je("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,Qe(t))}}function He(t){je("readable nexttick read 0"),t.read(0)}function $e(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Vt(Xe,t,e))}function Xe(t,e){e.reading||(je("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Qe(t),e.flowing&&!e.reading&&t.read(0)}function Qe(t){var e=t._readableState;for(je("flow",e.flowing);e.flowing&&null!==t.read(););}function Ke(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=Ze(t,e.buffer,e.decoder),n);var n}function Ze(t,e,n){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?tn(t,e):en(t,e),r}function tn(t,e){var n=e.head,r=1,i=n.data;for(t-=i.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0==(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}function en(t,e){var n=B.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0==(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}function nn(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,Vt(rn,e,t))}function rn(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function on(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}function sn(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function an(){}function un(t,e,n){this.chunk=t,this.encoding=e,this.callback=n,this.next=null}function cn(t,e){Object.defineProperty(this,"buffer",{get:Xt((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof jn&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){mn(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new On(this)}function ln(t){if(!(this instanceof ln||this instanceof jn))return new ln(t);this._writableState=new cn(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),r.call(this)}function fn(t,e){var n=new Error("write after end");t.emit("error",n),Vt(e,n)}function hn(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):B.isBuffer(n)||"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),Vt(r,o),i=!1),i}function pn(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=B.from(e,n)),e}function dn(t,e,n,r,i){n=pn(e,n,r),B.isBuffer(n)&&(r="buffer");var o=e.objectMode?1:n.length;e.length+=o;var s=e.length<e.highWaterMark;if(s||(e.needDrain=!0),e.writing||e.corked){var a=e.lastBufferedRequest;e.lastBufferedRequest=new un(n,r,i),a?a.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else gn(t,e,!1,o,n,r,i);return s}function gn(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function vn(t,e,n,r,i){--e.pendingcb,n?Vt(i,r):i(r),t._writableState.errorEmitted=!0,t.emit("error",r)}function yn(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function mn(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(yn(n),e)vn(t,n,r,e,i);else{var o=Sn(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||_n(t,n),r?Vt(bn,t,n,o,i):bn(t,n,o,i)}}function bn(t,e,n,r){n||wn(t,e),e.pendingcb--,r(),kn(t,e)}function wn(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function _n(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0;n;)i[s]=n,n=n.next,s+=1;gn(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new On(e)}else{for(;n;){var a=n.chunk,u=n.encoding,c=n.callback;if(gn(t,e,!1,e.objectMode?1:a.length,a,u,c),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function Sn(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function En(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function kn(t,e){var n=Sn(e);return n&&(0===e.pendingcb?(En(t,e),e.finished=!0,t.emit("finish")):En(t,e)),n}function Rn(t,e,n){e.ending=!0,kn(t,e),n&&(e.finished?Vt(n):t.once("finish",n)),e.ended=!0,t.writable=!1}function On(t){var e=this;this.next=null,this.entry=null,this.finish=function(n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}Be.prototype.read=function(t){je("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return je("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?nn(this):ze(this),null;if(0===(t=Fe(t,e))&&e.ended)return 0===e.length&&nn(this),null;var r,i=e.needReadable;return je("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&je("length less than watermark",i=!0),e.ended||e.reading?je("reading or ended",i=!1):i&&(je("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Fe(n,e))),null===(r=t>0?Ke(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&nn(this)),null!==r&&this.emit("data",r),r},Be.prototype._read=function(t){this.emit("error",new Error("not implemented"))},Be.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,je("pipe count=%d opts=%j",r.pipesCount,e);var i=e&&!1===e.end?c:s;function o(t){je("onunpipe"),t===n&&c()}function s(){je("onend"),t.end()}r.endEmitted?Vt(i):n.once("end",i),t.on("unpipe",o);var a=Ge(n);t.on("drain",a);var u=!1;function c(){je("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",a),t.removeListener("error",h),t.removeListener("unpipe",o),n.removeListener("end",s),n.removeListener("end",c),n.removeListener("data",f),u=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||a()}var l=!1;function f(e){je("ondata"),l=!1,!1!==t.write(e)||l||((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==sn(r.pipes,t))&&!u&&(je("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,l=!0),n.pause())}function h(e){je("onerror",e),g(),t.removeListener("error",h),0===Pe(t,"error")&&t.emit("error",e)}function p(){t.removeListener("finish",d),g()}function d(){je("onfinish"),t.removeListener("close",p),g()}function g(){je("unpipe"),n.unpipe(t)}return n.on("data",f),Ce(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",n),r.flowing||(je("pipe resume"),n.resume()),t},Be.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var o=sn(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},Be.prototype.on=function(t,e){var n=r.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&ze(this):Vt(He,this))}return n},Be.prototype.addListener=Be.prototype.on,Be.prototype.resume=function(){var t=this._readableState;return t.flowing||(je("resume"),t.flowing=!0,$e(this,t)),this},Be.prototype.pause=function(){return je("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(je("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Be.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;for(var i in t.on("end",(function(){if(je("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)})),t.on("data",(function(i){je("wrapped data"),e.decoder&&(i=e.decoder.write(i)),e.objectMode&&null==i||(e.objectMode||i&&i.length)&&(r.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));return on(["error","close","destroy","pause","resume"],(function(e){t.on(e,r.emit.bind(r,e))})),r._read=function(e){je("wrapped _read",e),n&&(n=!1,t.resume())},r},Be._fromList=Ke,ln.WritableState=cn,Gt(ln,r),cn.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},ln.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},ln.prototype.write=function(t,e,n){var r=this._writableState,i=!1;return"function"==typeof e&&(n=e,e=null),B.isBuffer(t)?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=an),r.ended?fn(this,n):hn(this,r,t,n)&&(r.pendingcb++,i=dn(this,r,t,e,n)),i},ln.prototype.cork=function(){this._writableState.corked++},ln.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_n(this,t))},ln.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},ln.prototype._write=function(t,e,n){n(new Error("not implemented"))},ln.prototype._writev=null,ln.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||Rn(this,r,n)},Gt(jn,Be);for(var xn,An=Object.keys(ln.prototype),Tn=0;Tn<An.length;Tn++){var Ln=An[Tn];jn.prototype[Ln]||(jn.prototype[Ln]=ln.prototype[Ln])}function jn(t){if(!(this instanceof jn))return new jn(t);Be.call(this,t),ln.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",Cn)}function Cn(){this.allowHalfOpen||this._writableState.ended||Vt(Pn,this)}function Pn(t){t.end()}function Mn(t){this.afterTransform=function(e,n){return Bn(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Bn(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!=n&&t.push(n),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}function In(t){if(!(this instanceof In))return new In(t);jn.call(this,t),this._transformState=new Mn(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){Nn(e,t)})):Nn(e)}))}function Nn(t,e){if(e)return t.emit("error",e);var n=t._writableState,r=t._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}function Un(t){if(!(this instanceof Un))return new Un(t);In.call(this,t)}function Dn(){r.call(this)}function Fn(t){return Fn="function"==typeof Symbol&&"symbol"===w(Symbol.iterator)?function(t){return w(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":w(t)},Fn(t)}function qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function zn(t,e,n){return e&&Yn(t.prototype,e),n&&Yn(t,n),t}function Vn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Vn(t,e,n[e])}))}return t}function Jn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Hn(t,e)}function Gn(t){return Gn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Gn(t)}function Hn(t,e){return Hn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Hn(t,e)}function $n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xn(t,e){return!e||"object"!==w(e)&&"function"!=typeof e?$n(t):e}function Qn(t){return tr(t)||er(t)||rr()}function Kn(t){return Zn(t)||er(t)||nr()}function Zn(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function tr(t){if(Array.isArray(t))return t}function er(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function nr(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function rr(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function ir(){if(void 0===xn){var t=new ArrayBuffer(2),e=new Uint8Array(t),n=new Uint16Array(t);if(e[0]=1,e[1]=2,258===n[0])xn="BE";else{if(513!==n[0])throw new Error("unable to figure out endianess");xn="LE"}}return xn}function or(){return void 0!==y.location?y.location.hostname:""}function sr(){return[]}function ar(){return 0}function ur(){return Number.MAX_VALUE}function cr(){return Number.MAX_VALUE}function lr(){return[]}function fr(){return"Browser"}function hr(){return void 0!==y.navigator?y.navigator.appVersion:""}function pr(){}function dr(){}function gr(){return"/tmp"}Gt(In,jn),In.prototype.push=function(t,e){return this._transformState.needTransform=!1,jn.prototype.push.call(this,t,e)},In.prototype._transform=function(t,e,n){throw new Error("Not implemented")},In.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},In.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},Gt(Un,In),Un.prototype._transform=function(t,e,n){n(null,t)},Gt(Dn,r),Dn.Readable=Be,Dn.Writable=ln,Dn.Duplex=jn,Dn.Transform=In,Dn.PassThrough=Un,Dn.Stream=Dn,Dn.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(l(),0===r.listenerCount(this,"error"))throw t}function l(){n.removeListener("data",i),t.removeListener("drain",o),n.removeListener("end",a),n.removeListener("close",u),n.removeListener("error",c),t.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),t.removeListener("close",l)}return n.on("error",c),t.on("error",c),n.on("end",l),n.on("close",l),t.on("close",l),t.emit("pipe",n),t};var vr={EOL:"\n",tmpdir:gr,tmpDir:gr,networkInterfaces:pr,getNetworkInterfaces:dr,release:hr,type:fr,cpus:lr,totalmem:cr,freemem:ur,uptime:ar,loadavg:sr,hostname:or,endianness:ir},yr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Q?Q:"undefined"!=typeof self?self:{},mr="Expected a function",br="__lodash_hash_undefined__",wr=1/0,_r="[object Function]",Sr="[object GeneratorFunction]",Er="[object Symbol]",kr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rr=/^\w*$/,Or=/^\./,xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ar=/[\\^$.*+?()[\]{}|]/g,Tr=/\\(\\)?/g,Lr=/^\[object .+?Constructor\]$/,jr="object"==w(yr)&&yr&&yr.Object===Object&&yr,Cr="object"==("undefined"==typeof self?"undefined":w(self))&&self&&self.Object===Object&&self,Pr=jr||Cr||Function("return this")();function Mr(t,e){return null==t?void 0:t[e]}function Br(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(n){}return e}var Ir,Nr=Array.prototype,Ur=Function.prototype,Dr=Object.prototype,Fr=Pr["__core-js_shared__"],qr=(Ir=/[^.]+$/.exec(Fr&&Fr.keys&&Fr.keys.IE_PROTO||""))?"Symbol(src)_1."+Ir:"",Yr=Ur.toString,zr=Dr.hasOwnProperty,Vr=Dr.toString,Wr=RegExp("^"+Yr.call(zr).replace(Ar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jr=Pr.Symbol,Gr=Nr.splice,Hr=Si(Pr,"Map"),$r=Si(Object,"create"),Xr=Jr?Jr.prototype:void 0,Qr=Xr?Xr.toString:void 0;function Kr(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Zr(){this.__data__=$r?$r(null):{}}function ti(t){return this.has(t)&&delete this.__data__[t]}function ei(t){var e=this.__data__;if($r){var n=e[t];return n===br?void 0:n}return zr.call(e,t)?e[t]:void 0}function ni(t){var e=this.__data__;return $r?void 0!==e[t]:zr.call(e,t)}function ri(t,e){return this.__data__[t]=$r&&void 0===e?br:e,this}function ii(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function oi(){this.__data__=[]}function si(t){var e=this.__data__,n=vi(e,t);return!(n<0||(n==e.length-1?e.pop():Gr.call(e,n,1),0))}function ai(t){var e=this.__data__,n=vi(e,t);return n<0?void 0:e[n][1]}function ui(t){return vi(this.__data__,t)>-1}function ci(t,e){var n=this.__data__,r=vi(n,t);return r<0?n.push([t,e]):n[r][1]=e,this}function li(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function fi(){this.__data__={hash:new Kr,map:new(Hr||ii),string:new Kr}}function hi(t){return _i(this,t).delete(t)}function pi(t){return _i(this,t).get(t)}function di(t){return _i(this,t).has(t)}function gi(t,e){return _i(this,t).set(t,e),this}function vi(t,e){for(var n=t.length;n--;)if(Li(t[n][0],e))return n;return-1}function yi(t,e){for(var n=0,r=(e=Ei(e,t)?[e]:wi(e)).length;null!=t&&n<r;)t=t[xi(e[n++])];return n&&n==r?t:void 0}function mi(t){return!(!Pi(t)||Ri(t))&&(Ci(t)||Br(t)?Wr:Lr).test(Ai(t))}function bi(t){if("string"==typeof t)return t;if(Bi(t))return Qr?Qr.call(t):"";var e=t+"";return"0"==e&&1/t==-wr?"-0":e}function wi(t){return ji(t)?t:Oi(t)}function _i(t,e){var n=t.__data__;return ki(e)?n["string"==typeof e?"string":"hash"]:n.map}function Si(t,e){var n=Mr(t,e);return mi(n)?n:void 0}function Ei(t,e){if(ji(t))return!1;var n=w(t);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Bi(t))||Rr.test(t)||!kr.test(t)||null!=e&&t in Object(e)}function ki(t){var e=w(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function Ri(t){return!!qr&&qr in t}Kr.prototype.clear=Zr,Kr.prototype.delete=ti,Kr.prototype.get=ei,Kr.prototype.has=ni,Kr.prototype.set=ri,ii.prototype.clear=oi,ii.prototype.delete=si,ii.prototype.get=ai,ii.prototype.has=ui,ii.prototype.set=ci,li.prototype.clear=fi,li.prototype.delete=hi,li.prototype.get=pi,li.prototype.has=di,li.prototype.set=gi;var Oi=Ti((function(t){t=Ii(t);var e=[];return Or.test(t)&&e.push(""),t.replace(xr,(function(t,n,r,i){e.push(r?i.replace(Tr,"$1"):n||t)})),e}));function xi(t){if("string"==typeof t||Bi(t))return t;var e=t+"";return"0"==e&&1/t==-wr?"-0":e}function Ai(t){if(null!=t){try{return Yr.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ti(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(mr);var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s),s};return n.cache=new(Ti.Cache||li),n}function Li(t,e){return t===e||t!=t&&e!=e}Ti.Cache=li;var ji=Array.isArray;function Ci(t){var e=Pi(t)?Vr.call(t):"";return e==_r||e==Sr}function Pi(t){var e=w(t);return!!t&&("object"==e||"function"==e)}function Mi(t){return!!t&&"object"==w(t)}function Bi(t){return"symbol"==w(t)||Mi(t)&&Vr.call(t)==Er}function Ii(t){return null==t?"":bi(t)}function Ni(t,e,n){var r=null==t?void 0:yi(t,e);return void 0===r?n:r}var Ui=Ni;function Di(t,e,n){return void 0===t[e]?n:t[e]}function Fi(t,e,n){var r=Array.isArray(e)?e:e.split("."),i=Qn(r),o=i[0],s=i.slice(1);return Wn({},t,Vn({},o,r.length>1?Fi(t[o]||{},s,n):n))}function qi(t,e){var n=Array.isArray(e)?e:e.split("."),r=Qn(n),i=r[0],o=r.slice(1);return"object"!==Fn(t[i])?t:1===n.length?Object.keys(t).filter((function(t){return t!==i})).reduce((function(e,n){return Object.assign(e,Vn({},n,t[n]))}),{}):Object.keys(t).reduce((function(e,n){return Wn({},e,Vn({},n,n!==i?t[n]:qi(t[i],o)))}),{})}function Yi(t,e){try{return t.push.apply(t,Kn(e)),t}catch(n){return t.concat(e)}}function zi(t,e){var n=!0;return t.reduce((function(t,r){return null==r&&(r=""),n?(n=!1,"".concat(r)):"".concat(t).concat(e).concat(r)}),"")}var Vi={getProp:Di,setProp:Fi,unsetProp:qi,fastJoin:zi,flattenReducer:Yi},Wi=Vi.getProp,Ji=Vi.fastJoin,Gi=Vi.flattenReducer,Hi=function(){function t(e){qn(this,t),this.opts=this.preprocessOpts(e)}return zn(t,[{key:"preprocessOpts",value:function(t){var e=Object.assign({},t);return e.transforms=Array.isArray(e.transforms)?e.transforms:e.transforms?[e.transforms]:[],e.delimiter=e.delimiter||",",e.eol=e.eol||vr.EOL,e.quote="string"==typeof e.quote?e.quote:'"',e.escapedQuote="string"==typeof e.escapedQuote?e.escapedQuote:"".concat(e.quote).concat(e.quote),e.header=!1!==e.header,e.includeEmptyRows=e.includeEmptyRows||!1,e.withBOM=e.withBOM||!1,e}},{key:"preprocessFieldsInfo",value:function(t){var e=this;return t.map((function(t){if("string"==typeof t)return{label:t,value:t.includes(".")||t.includes("[")?function(n){return Ui(n,t,e.opts.defaultValue)}:function(n){return Wi(n,t,e.opts.defaultValue)}};if("object"===Fn(t)){var n="default"in t?t.default:e.opts.defaultValue;if("string"==typeof t.value)return{label:t.label||t.value,value:t.value.includes(".")||t.value.includes("[")?function(e){return Ui(e,t.value,n)}:function(e){return Wi(e,t.value,n)}};if("function"==typeof t.value){var r=t.label||t.value.name||"",i={label:r,default:n};return{label:r,value:function(e){var r=t.value(e,i);return null==r?n:r}}}}throw new Error("Invalid field info option. "+JSON.stringify(t))}))}},{key:"getHeader",value:function(){var t=this;return Ji(this.opts.fields.map((function(e){return t.processValue(e.label)})),this.opts.delimiter)}},{key:"preprocessRow",value:function(t){return this.opts.transforms.reduce((function(t,e){return t.map((function(t){return e(t)})).reduce(Gi,[])}),[t])}},{key:"processRow",value:function(t){var e=this;if(t){var n=this.opts.fields.map((function(n){return e.processCell(t,n)}));if(this.opts.includeEmptyRows||!n.every((function(t){return void 0===t})))return Ji(n,this.opts.delimiter)}}},{key:"processCell",value:function(t,e){return this.processValue(e.value(t))}},{key:"processValue",value:function(t){if(null!=t){var e=Fn(t);if("boolean"!==e&&"number"!==e&&"string"!==e){if(void 0===(t=JSON.stringify(t)))return;'"'===t[0]&&(t=t.replace(/^"(.+)"$/,"$1"))}return"string"==typeof t&&(this.opts.excelStrings?(t.includes(this.opts.quote)&&(t=t.replace(new RegExp(this.opts.quote,"g"),"".concat(this.opts.escapedQuote).concat(this.opts.escapedQuote))),t='"=""'.concat(t,'"""')):(t.includes(this.opts.quote)&&(t=t.replace(new RegExp(this.opts.quote,"g"),this.opts.escapedQuote)),t="".concat(this.opts.quote).concat(t).concat(this.opts.quote))),t}}}]),t}(),$i=Vi.fastJoin,Xi=Vi.flattenReducer,Qi=function(t){function e(t){var n;return qn(this,e),(n=Xn(this,Gn(e).call(this,t))).opts.fields&&(n.opts.fields=n.preprocessFieldsInfo(n.opts.fields)),n}return Jn(e,t),zn(e,[{key:"parse",value:function(t){var e=this.preprocessData(t);this.opts.fields||(this.opts.fields=e.reduce((function(t,e){return Object.keys(e).forEach((function(e){t.includes(e)||t.push(e)})),t}),[]),this.opts.fields=this.preprocessFieldsInfo(this.opts.fields));var n=this.opts.header?this.getHeader():"",r=this.processData(e);return(this.opts.withBOM?"\ufeff":"")+n+(n&&r?this.opts.eol:"")+r}},{key:"preprocessData",value:function(t){var e=this,n=Array.isArray(t)?t:[t];if(!this.opts.fields&&(0===n.length||"object"!==Fn(n[0])))throw new Error('Data should not be empty or the "fields" option should be included');return 0===this.opts.transforms.length?n:n.map((function(t){return e.preprocessRow(t)})).reduce(Xi,[])}},{key:"processData",value:function(t){var e=this;return $i(t.map((function(t){return e.processRow(t)})).filter((function(t){return t})),this.opts.eol)}}]),e}(Hi),Ki={},Zi=Ki.LEFT_BRACE=1,to=Ki.RIGHT_BRACE=2,eo=Ki.LEFT_BRACKET=3,no=Ki.RIGHT_BRACKET=4,ro=Ki.COLON=5,io=Ki.COMMA=6,oo=Ki.TRUE=7,so=Ki.FALSE=8,ao=Ki.NULL=9,uo=Ki.STRING=10,co=Ki.NUMBER=11,lo=Ki.START=17,fo=Ki.STOP=18,ho=Ki.TRUE1=33,po=Ki.TRUE2=34,go=Ki.TRUE3=35,vo=Ki.FALSE1=49,yo=Ki.FALSE2=50,mo=Ki.FALSE3=51,bo=Ki.FALSE4=52,wo=Ki.NULL1=65,_o=Ki.NULL2=66,So=Ki.NULL3=67,Eo=Ki.NUMBER1=81,ko=Ki.NUMBER3=83,Ro=Ki.STRING1=97,Oo=Ki.STRING2=98,xo=Ki.STRING3=99,Ao=Ki.STRING4=100,To=Ki.STRING5=101,Lo=Ki.STRING6=102,jo=Ki.VALUE=113,Co=Ki.KEY=114,Po=Ki.OBJECT=129,Mo=Ki.ARRAY=130,Bo="\\".charCodeAt(0),Io="/".charCodeAt(0),No="\b".charCodeAt(0),Uo="\f".charCodeAt(0),Do="\n".charCodeAt(0),Fo="\r".charCodeAt(0),qo="\t".charCodeAt(0),Yo=65536;function zo(){this.tState=lo,this.value=void 0,this.string=void 0,this.stringBuffer=B.alloc?B.alloc(Yo):new B(Yo),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=jo,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new B(2),3:new B(3),4:new B(4)},this.offset=-1}zo.toknam=function(t){for(var e=Object.keys(Ki),n=0,r=e.length;n<r;n++){var i=e[n];if(Ki[i]===t)return i}return t&&"0x"+t.toString(16)};var Vo=zo.prototype;Vo.onError=function(t){throw t},Vo.charError=function(t,e){this.tState=fo,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(t[e]))+" at position "+e+" in state "+zo.toknam(this.tState)))},Vo.appendStringChar=function(t){this.stringBufferOffset>=Yo&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=t},Vo.appendStringBuf=function(t,e,n){var r=t.length;"number"==typeof e&&(r="number"==typeof n?n<0?t.length-e+n:n-e:t.length-e),r<0&&(r=0),this.stringBufferOffset+r>Yo&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),t.copy(this.stringBuffer,this.stringBufferOffset,e,n),this.stringBufferOffset+=r},Vo.write=function(t){var e;"string"==typeof t&&(t=new B(t));for(var n=0,r=t.length;n<r;n++)if(this.tState===lo){if(e=t[n],this.offset++,123===e)this.onToken(Zi,"{");else if(125===e)this.onToken(to,"}");else if(91===e)this.onToken(eo,"[");else if(93===e)this.onToken(no,"]");else if(58===e)this.onToken(ro,":");else if(44===e)this.onToken(io,",");else if(116===e)this.tState=ho;else if(102===e)this.tState=vo;else if(110===e)this.tState=wo;else if(34===e)this.string="",this.stringBufferOffset=0,this.tState=Ro;else if(45===e)this.string="-",this.tState=Eo;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=ko;else if(32!==e&&9!==e&&10!==e&&13!==e)return this.charError(t,n)}else if(this.tState===Ro)if(e=t[n],this.bytes_remaining>0){for(var i=0;i<this.bytes_remaining;i++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+i]=t[i];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,n=n+i-1}else if(0===this.bytes_remaining&&e>=128){if(e<=193||e>244)return this.onError(new Error("Invalid UTF-8 character at position "+n+" in state "+zo.toknam(this.tState)));if(e>=194&&e<=223&&(this.bytes_in_sequence=2),e>=224&&e<=239&&(this.bytes_in_sequence=3),e>=240&&e<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+n>t.length){for(var o=0;o<=t.length-1-n;o++)this.temp_buffs[this.bytes_in_sequence][o]=t[n+o];this.bytes_remaining=n+this.bytes_in_sequence-t.length,n=t.length-1}else this.appendStringBuf(t,n,n+this.bytes_in_sequence),n=n+this.bytes_in_sequence-1}else if(34===e)this.tState=lo,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(uo,this.string),this.offset+=B.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===e)this.tState=Oo;else{if(!(e>=32))return this.charError(t,n);this.appendStringChar(e)}else if(this.tState===Oo)if(34===(e=t[n]))this.appendStringChar(e),this.tState=Ro;else if(92===e)this.appendStringChar(Bo),this.tState=Ro;else if(47===e)this.appendStringChar(Io),this.tState=Ro;else if(98===e)this.appendStringChar(No),this.tState=Ro;else if(102===e)this.appendStringChar(Uo),this.tState=Ro;else if(110===e)this.appendStringChar(Do),this.tState=Ro;else if(114===e)this.appendStringChar(Fo),this.tState=Ro;else if(116===e)this.appendStringChar(qo),this.tState=Ro;else{if(117!==e)return this.charError(t,n);this.unicode="",this.tState=xo}else if(this.tState===xo||this.tState===Ao||this.tState===To||this.tState===Lo){if(!((e=t[n])>=48&&e<64||e>64&&e<=70||e>96&&e<=102))return this.charError(t,n);if(this.unicode+=String.fromCharCode(e),this.tState++===Lo){var s=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&s>=56320&&s<57344?(this.appendStringBuf(new B(String.fromCharCode(this.highSurrogate,s))),this.highSurrogate=void 0):void 0===this.highSurrogate&&s>=55296&&s<56320?this.highSurrogate=s:(void 0!==this.highSurrogate&&(this.appendStringBuf(new B(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new B(String.fromCharCode(s)))),this.tState=Ro}}else if(this.tState===Eo||this.tState===ko)switch(e=t[n]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(e),this.tState=ko;break;default:this.tState=lo;var a=Number(this.string);if(isNaN(a))return this.charError(t,n);this.string.match(/[0-9]+/)==this.string&&a.toString()!=this.string?this.onToken(uo,this.string):this.onToken(co,a),this.offset+=this.string.length-1,this.string=void 0,n--}else if(this.tState===ho){if(114!==t[n])return this.charError(t,n);this.tState=po}else if(this.tState===po){if(117!==t[n])return this.charError(t,n);this.tState=go}else if(this.tState===go){if(101!==t[n])return this.charError(t,n);this.tState=lo,this.onToken(oo,!0),this.offset+=3}else if(this.tState===vo){if(97!==t[n])return this.charError(t,n);this.tState=yo}else if(this.tState===yo){if(108!==t[n])return this.charError(t,n);this.tState=mo}else if(this.tState===mo){if(115!==t[n])return this.charError(t,n);this.tState=bo}else if(this.tState===bo){if(101!==t[n])return this.charError(t,n);this.tState=lo,this.onToken(so,!1),this.offset+=4}else if(this.tState===wo){if(117!==t[n])return this.charError(t,n);this.tState=_o}else if(this.tState===_o){if(108!==t[n])return this.charError(t,n);this.tState=So}else if(this.tState===So){if(108!==t[n])return this.charError(t,n);this.tState=lo,this.onToken(ao,null),this.offset+=3}},Vo.onToken=function(t,e){},Vo.parseError=function(t,e){this.tState=fo,this.onError(new Error("Unexpected "+zo.toknam(t)+(e?"("+JSON.stringify(e)+")":"")+" in state "+zo.toknam(this.state)))},Vo.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},Vo.pop=function(){var t=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(t),this.mode||(this.state=jo)},Vo.emit=function(t){this.mode&&(this.state=io),this.onValue(t)},Vo.onValue=function(t){},Vo.onToken=function(t,e){if(this.state===jo)if(t===uo||t===co||t===oo||t===so||t===ao)this.value&&(this.value[this.key]=e),this.emit(e);else if(t===Zi)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=Co,this.mode=Po;else if(t===eo)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=Mo,this.state=jo;else if(t===to){if(this.mode!==Po)return this.parseError(t,e);this.pop()}else{if(t!==no)return this.parseError(t,e);if(this.mode!==Mo)return this.parseError(t,e);this.pop()}else if(this.state===Co)if(t===uo)this.key=e,this.state=ro;else{if(t!==to)return this.parseError(t,e);this.pop()}else if(this.state===ro){if(t!==ro)return this.parseError(t,e);this.state=jo}else{if(this.state!==io)return this.parseError(t,e);if(t===io)this.mode===Mo?(this.key++,this.state=jo):this.mode===Po&&(this.state=Co);else{if(!(t===no&&this.mode===Mo||t===to&&this.mode===Po))return this.parseError(t,e);this.pop()}}},zo.C=Ki;var Wo=zo,Jo=function(t){function e(t,n){var r;return qn(this,e),r=Xn(this,Gn(e).call(this,n)),Object.getOwnPropertyNames(Hi.prototype).forEach((function(t){return r[t]=Hi.prototype[t]})),r.opts=r.preprocessOpts(t),r._data="",r._hasWritten=!1,r._readableState.objectMode?r.initObjectModeParse():r.opts.ndjson?r.initNDJSONParse():r.initJSONParser(),r.opts.withBOM&&r.push("\ufeff"),r.opts.fields&&(r.opts.fields=r.preprocessFieldsInfo(r.opts.fields),r.pushHeader()),r}return Jn(e,t),zn(e,[{key:"initObjectModeParse",value:function(){var t=this;this.parser={write:function(e){t.pushLine(e)},getPendingData:function(){}}}},{key:"initNDJSONParse",value:function(){var t=this;this.parser={_data:"",write:function(e){this._data+=e.toString();var n=this._data.split("\n").map((function(t){return t.trim()})).filter((function(t){return""!==t})),r=!1;n.forEach((function(e,i){try{t.pushLine(JSON.parse(e))}catch(o){i===n.length-1?r=!0:(o.message="Invalid JSON (".concat(e,")"),t.emit("error",o))}})),this._data=r?this._data.slice(this._data.lastIndexOf("\n")):""},getPendingData:function(){return this._data}}}},{key:"initJSONParser",value:function(){var t=this;this.parser=new Wo,this.parser.onValue=function(e){this.stack.length===this.depthToEmit&&t.pushLine(e)},this.parser._onToken=this.parser.onToken,this.parser.onToken=function(e,n){t.parser._onToken(e,n),0!==this.stack.length||t.opts.fields||this.mode===Wo.C.ARRAY||this.mode===Wo.C.OBJECT||this.onError(new Error('Data should not be empty or the "fields" option should be included')),1===this.stack.length&&(void 0===this.depthToEmit&&(this.depthToEmit=this.mode===Wo.C.ARRAY?1:0),0!==this.depthToEmit&&1===this.stack.length&&(this.value=void 0))},this.parser.getPendingData=function(){return this.value},this.parser.onError=function(e){e.message.includes("Unexpected")&&(e.message="Invalid JSON (".concat(e.message,")")),t.emit("error",e)}}},{key:"_transform",value:function(t,e,n){this.parser.write(t),n()}},{key:"_flush",value:function(t){this.parser.getPendingData()&&t(new Error("Invalid data received from stdin",this.parser.getPendingData())),t()}},{key:"pushHeader",value:function(){if(this.opts.header){var t=this.getHeader();this.emit("header",t),this.push(t),this._hasWritten=!0}}},{key:"pushLine",value:function(t){var e=this,n=this.preprocessRow(t);this._hasWritten||(this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(Object.keys(n[0])),this.pushHeader()),n.forEach((function(t){var n=e.processRow(t,e.opts);void 0!==n&&(e.emit("line",n),e.push(e._hasWritten?e.opts.eol+n:n),e._hasWritten=!0)}))}}]),e}(Dn.Transform),Go=Jo,Ho=Dn.Transform,$o=Vi.fastJoin,Xo=function(){function t(e,n){qn(this,t),this.input=new Ho(n),this.input._read=function(){},this.transform=new Go(e,n),this.processor=this.input.pipe(this.transform)}return zn(t,[{key:"fromInput",value:function(t){if(this._input)throw new Error("Async parser already has an input.");return this._input=t,this.input=this._input.pipe(this.processor),this}},{key:"throughTransform",value:function(t){if(this._output)throw new Error("Can't add transforms once an output has been added.");return this.processor=this.processor.pipe(t),this}},{key:"toOutput",value:function(t){if(this._output)throw new Error("Async parser already has an output.");return this._output=t,this.processor=this.processor.pipe(t),this}},{key:"promise",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise((function(n,r){if(e){var i=[];t.processor.on("data",(function(t){return i.push(t.toString())})).on("finish",(function(){return n($o(i,""))})).on("error",(function(t){return r(t)}))}else t.processor.on("finish",(function(){return n()})).on("error",(function(t){return r(t)}))}))}}]),t}(),Qo=Xo;function Ko(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.objects,n=void 0===e||e,r=t.arrays,i=void 0!==r&&r,o=t.separator,s=void 0===o?".":o;function a(t,e,r){return Object.keys(t).forEach((function(o){var u=r?"".concat(r).concat(s).concat(o):o,c=t[o];n&&"object"===Fn(c)&&null!==c&&!Array.isArray(c)&&"[object Function]"!==Object.prototype.toString.call(c.toJSON)&&Object.keys(c).length||i&&Array.isArray(c)?a(c,e,u):e[u]=c})),e}return function(t){return a(t,{})}}var Zo=Ko,ts=Vi.setProp,es=Vi.unsetProp,ns=Vi.flattenReducer;function rs(t,e){return Object.keys(t).reduce((function(n,r){var i=e?"".concat(e,".").concat(r):r,o=t[r];return"object"===Fn(o)&&null!==o&&!Array.isArray(o)&&"[object Function]"!==Object.prototype.toString.call(o.toJSON)&&Object.keys(o).length?n=n.concat(rs(o,i)):Array.isArray(o)&&(n.push(i),n=n.concat(o.map((function(t){return rs(t,i)})).reduce(ns,[]).filter((function(t,e,n){return n.indexOf(t)!==e})))),n}),[])}function is(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.paths,n=void 0===e?void 0:e,r=t.blankOut,i=void 0!==r&&r;function o(t,e){return t.map((function(t){var n=Ui(t,e);return Array.isArray(n)?n.length?n.map((function(n,r){return ts(i&&r>0?{}:t,e,n)})):es(t,e):t})).reduce(ns,[])}return n=Array.isArray(n)?n:n?[n]:void 0,function(t){return(n||rs(t)).reduce(o,[t])}}var os=is,ss=Dn.Readable,as=Qi,us=Qo,cs=Go,ls=function(t,e){return new Qi(e).parse(t)},fs=function(t,e,n){try{t instanceof ss||(n=Object.assign({},n,{objectMode:!0}));var r=new Qo(e,n),i=r.promise();return Array.isArray(t)?(t.forEach((function(t){return r.input.push(t)})),r.input.push(null)):t instanceof ss?r.fromInput(t):(r.input.push(t),r.input.push(null)),i}catch(o){return Promise.reject(o)}},hs={flatten:Zo,unwind:os},ps={Parser:as,AsyncParser:us,Transform:cs,parse:ls,parseAsync:fs,transforms:hs};t.AsyncParser=us,t.Parser=as,t.Transform=cs,t.default=ps,t.parse=ls,t.parseAsync=fs,t.transforms=hs,Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,Ot.exports);var xt={all:function(){return["demographics"]},list:function(t){return[].concat(v(xt.all()),[t])}};var At=V.div(l||(l=_(["\n padding: ",";\n display: flex;\n background-color: ",";\n box-shadow: ",";\n justify-content: flex-end;\n border-top: 1px solid ",";\n"])),W["--ll-spacing-medium"],W["--ll-color-surface"],W["--ll-shadow-medium"],W["--ll-color-border"]),Tt=V.div(f||(f=_(["\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: ",";\n"])),W["--ll-spacing-medium"]),Lt={all:function(){return["profiles"]},list:function(t){return[].concat(v(Lt.all()),[t])}};var jt=function(){var t,e,n,r,i,o,s,a=ft().dataExplorerState,u=Z().translations,c=(t={lat:a.location.lat,lng:a.location.lng,enabled:a.scores.checked,include:a.scores.include},e=t.lat,n=t.lng,r=t.include,i=t.enabled,o=K().client,s={lat:e,lng:n,geographyLevels:["10","30"],locationScoresRounding:!1,include:r},j(C.list(s),b(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.getScores(s));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!s&&i})),l=c.data,f=c.isFetching,h=function(t){var e=t.lat,n=t.lng,r=t.enabled,i=t.include,o=t.limit,s=t.radius,a=K().client,u={lat:e,lng:n,limit:o,radius:s,include:i};return j(M.list(u),b(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",a.getPois(u));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!u&&r})}({lat:a.location.lat,lng:a.location.lng,enabled:a.pois.checked,include:a.pois.include,limit:a.pois.limit,radius:a.pois.radius}),p=h.data,d=h.isFetching,g=function(t){var e=t.lat,n=t.lng,r=t.enabled,i=t.limit,o=t.radius,s=K().client,a={lat:e,lng:n,limit:i,radius:o};return j(P.list(a),b(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",s.getSchools(a));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!a&&r})}({lat:a.location.lat,lng:a.location.lng,enabled:a.schools.checked,limit:a.pois.limit,radius:a.pois.radius}),v=g.data,m=g.isFetching,w=function(t){var e=t.lat,n=t.lng,r=t.enabled,i=t.radius,o=K().client,s={lat:e,lng:n,radius:i};return j(xt.list(s),b(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.getDemographics(s));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!s&&r})}({lat:a.location.lat,lng:a.location.lng,enabled:a.demographics.checked,radius:a.demographics.radius}),_=w.data,S=w.isFetching,k=function(t){var e=t.lat,n=t.lng,r=t.enabled,i=K().client,o={lat:e,lng:n};return j(Lt.list(o),b(y().mark((function t(){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.getProfiles(o));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!o&&r})}({lat:a.location.lat,lng:a.location.lng,enabled:a.profiles.checked}),O=k.data,x=k.isFetching,A=Y.exports.useMemo((function(){return E(E(E(E(E({},l&&a.scores.checked&&{scores:l}),p&&a.pois.checked&&{pois:p}),v&&a.schools.checked&&{schools:v}),_&&a.demographics.checked&&{demographics:_}),O&&a.profiles.checked&&{profiles:O})}),[p,l,v,O,_,a]),T=f||d||m||S||x,L=Object.keys(A).length;return G(At,{children:[T&&z(Tt,{children:z(tt,{})}),G(et,{variant:"contained",onClick:function(t){t.preventDefault(),rt.downloadFile({data:JSON.stringify(A),fileName:"local-logic-data",fileType:"json"})},disabled:!Object.keys(A).length||T,children:[u.EXPORT," JSON"]}),z(nt,{spacing:"--ll-spacing-xx-small"}),G(et,{variant:"contained",onClick:function(t){var e,n,r,i;t.preventDefault(),l&&(e=l.location,n="scores",r=Object.entries(e).map((function(t){var e=R(t,2);return E({score:e[0]},e[1])})),(i=Ot.exports.parse(r))&&rt.downloadFile({data:i,fileName:n,fileType:"csv"})),function(){if(p){var t=Object.entries(p).map((function(t){var e=R(t,2),n=e[0];return e[1].map((function(t){return E({poi:n},t)}))})).flat(),e=Ot.exports.parse(t);e&&rt.downloadFile({data:e,fileName:"pois",fileType:"csv"})}}(),function(){if(v){var t=Object.entries(v).map((function(t){var e=R(t,2),n=e[0];return e[1].map((function(t){return E({school:n},t)}))})).flat(),e=Ot.exports.parse(t);e&&rt.downloadFile({data:e,fileName:"schools",fileType:"csv"})}}(),function(){if(_){var t=Object.entries(_).map((function(t){var e=R(t,2);return E({demographic:e[0]},e[1])})),e=Ot.exports.parse(t);e&&rt.downloadFile({data:e,fileName:"demographics",fileType:"csv"})}}(),function(){if(O){var t=[O],e=Ot.exports.parse(t,{fields:["id","intro","name","profiles.character","profiles.housing","profiles.services","profiles.transport"]});e&&rt.downloadFile({data:e,fileName:"profiles",fileType:"csv"})}}()},disabled:!L||T,children:[u.EXPORT," CSV (",L,")"]})]})},Ct=V.div(h||(h=_(["\n height: 400px;\n display: flex;\n border: 2px solid ",";\n position: relative;\n border-radius: ",";\n overflow: hidden;\n"])),W["--ll-color-on-background"],W["--ll-border-radius-small"]),Pt=V.div(p||(p=_(["\n position: absolute;\n color: ",";\n z-index: 1;\n padding: "," ",";\n font-family: ",';\n\n &:after {\n content: "";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n background-color: ',";\n opacity: 0.8;\n z-index: -1;\n }\n"])),W["--ll-color-on-background"],W["--ll-spacing-xx-small"],W["--ll-spacing-x-small"],W["--ll-font-family-mono"],W["--ll-color-background"]),Mt=function(){var t,e,n,r,i=Y.exports.useRef(),o=R(Y.exports.useState(!0),2),s=o[0],a=o[1],u=ft(),c=u.dataExplorerState,l=u.setDataExplorerState,f=q().sdkState,h=R(Y.exports.useState(!1),2),p=h[0],d=h[1],g=Y.exports.useRef(),v=Y.exports.useRef(!1),y=Z().translations,m="night"===(null==f||null===(t=f.globalOptions)||void 0===t||null===(e=t.appearance)||void 0===e?void 0:e.theme)?"basic-v2-dark":"600d69cb-288d-445e-9839-3dfe4d76b31a",b={position:"absolute",top:"0",left:"0",height:"100%",width:"100%"};return G("div",{children:[z(B,{placeholder:y.SEARCH_MAP,renderListAbove:!1,onSearch:function(t){var e;l({location:{lat:t.latitude,lng:t.longitude}}),null==i||null===(e=i.current)||void 0===e||e.flyTo({center:[t.longitude,t.latitude],duration:2e3,essential:!0})}}),z(nt,{vertical:!0,spacing:"--ll-spacing-small"}),G(Ct,{children:[s&&z(it,{height:"400px",width:"100%"}),G(I,{ref:i,style:s?E({visibility:"hidden"},b):b,onLoad:function(){return a(!1)},mapLib:N,mapStyle:"https://api.maptiler.com/maps/".concat(m,"/style.json?key=","9jNGatuzs05Q1oNlctEs"),initialViewState:{longitude:null===(n=f.options)||void 0===n?void 0:n.lng,latitude:null===(r=f.options)||void 0===r?void 0:r.lat,zoom:10},onMouseDown:function(t){g.current=setTimeout((function(){v.current||d(!0)}),1e3)},onMouseUp:function(t){p&&l({location:{lat:t.lngLat.lat,lng:t.lngLat.lng}}),clearTimeout(g.current),d(!1)},onDragStart:function(){v.current=!0},onDragEnd:function(){v.current=!1},children:[z(Pt,{children:G(H,{noMargin:!0,family:"mono",children:["Lat:"," ",Math.round(1e5*c.location.lat)/1e5,", Lng:"," ",Math.round(1e5*c.location.lng)/1e5]})}),z(U,{showCompass:!0,style:{marginTop:16,marginRight:16}}),z(D,{marker:E({icon:"pin"},c.location)})]})]})]})},Bt=V.div(d||(d=_(["\n margin: 2px;\n display: inline-block;\n"]))),It=function(){var t=ft(),e=t.dataExplorerState,n=t.setDataExplorerState,r=Object.keys(ot).filter((function(t){return Number.isNaN(Number(t))}));return z(st,{children:r.map((function(t){var r=e.scores.include.includes(t);return z(Bt,{children:z(at.Root,{options:{score:t,scoresData:void 0},children:z(et,{size:"small",variant:r?"contained":"outlined",onClick:function(){n(r?{scores:E(E({},e.scores),{},{include:e.scores.include.filter((function(e){return e!==t}))})}:{scores:E(E({},e.scores),{},{include:[].concat(v(e.scores.include),[t])})})},children:z(at.Title,{options:{isRawText:!0}})})})},t)}))})},Nt=V.div(g||(g=_(["\n margin: 2px;\n display: inline-block;\n"]))),Ut=function(){var t=Z().translations,e=ft(),n=e.dataExplorerState,r=e.setDataExplorerState,i=Object.keys(ut).filter((function(t){return Number.isNaN(Number(t))}));return G(st,{children:[i.map((function(t){var e=n.pois.include.includes(t);return z(Nt,{children:z(ct.Root,{options:{poi:t},children:z(et,{size:"small",variant:e?"contained":"outlined",onClick:function(){r(e?{pois:E(E({},n.pois),{},{include:n.pois.include.filter((function(e){return e!==t}))})}:{pois:E(E({},n.pois),{},{include:[].concat(v(n.pois.include),[t])})})},children:z(ct.Title,{options:{isRawText:!0}})})})},t)})),z(lt,{showValue:!0,label:"".concat(t.RADIUS," (m)"),min:100,max:25e3,step:100,value:[n.pois.radius],onValueChange:function(t){r({pois:E(E({},n.pois),{},{radius:t[0]})})}}),z(lt,{showValue:!0,label:t.LIMIT,min:1,max:30,step:1,value:[n.pois.limit],onValueChange:function(t){r({pois:E(E({},n.pois),{},{limit:t[0]})})}})]})},Dt=function(){var t=Z().translations,e=ft(),n=e.dataExplorerState,r=e.setDataExplorerState;return G(st,{children:[z(lt,{showValue:!0,label:"".concat(t.RADIUS," (m)"),min:100,max:25e3,step:100,value:[n.schools.radius],onValueChange:function(t){r({schools:E(E({},n.schools),{},{radius:t[0]})})}}),z(lt,{showValue:!0,label:t.LIMIT,min:1,max:30,step:1,value:[n.schools.limit],onValueChange:function(t){r({schools:E(E({},n.schools),{},{limit:t[0]})})}})]})},Ft=function(){var t=Z().translations,e=ft(),n=e.dataExplorerState,r=e.setDataExplorerState;return z(lt,{showValue:!0,label:"".concat(t.RADIUS," (m)"),min:500,max:5e3,step:100,value:[n.demographics.radius],onValueChange:function(t){r({demographics:E(E({},n.demographics),{},{radius:t[0]})})}})};m("default",(function(){var t=Z().translations,e=[{title:t.LOCATION,description:t.LOCATION_TEXT,value:"location",number:1,children:z(Mt,{})},{title:t.SCORES,description:t.SCORES_TEXT,value:"scores",number:2,children:z(It,{})},{title:t.POIS,description:t.POIS_TEXT,value:"pois",number:3,children:z(Ut,{})},{title:t.SCHOOLS,description:t.SCHOOLS_TEXT,value:"schools",number:4,children:z(Dt,{})},{title:t.DEMOGRAPHICS,description:t.DEMOGRAPHICS_TEXT,value:"demographics",number:5,children:z(Ft,{})},{title:t.PROFILES,description:t.PROFILES_TEXT,value:"profiles",number:6}];return z(ht,{children:G(pt,{children:[z(dt,{type:"single",defaultValue:"location",collapsible:!0,children:e.map((function(t){return z(Rt,{title:t.title,description:t.description,value:t.value,number:t.number,children:t.children},t.value)}))}),z(nt,{vertical:!0}),z(jt,{})]})})}))}}}))}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var e,t,n,r,o,i,a,l,c,s,u,d,p,f,h,v,m,g,y,b,x,w,C,M,S,k,O,P,L,E,I,j,_,z,A,T,R,N;function G(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||q(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function H(e,t,n){return t&&D(e.prototype,t),n&&D(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function F(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */F=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(O){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new M(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=x(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(O){return{type:"throw",arg:O}}}e.wrap=c;var u={};function d(){}function p(){}function f(){}var h={};l(h,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==t&&n.call(m,o)&&(h=m);var g=f.prototype=d.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(o,i,a,l){var c=s(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==W(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=f,l(g,"constructor",f),l(f,"constructor",p),p.displayName=l(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),l(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),l(g,a,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function U(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(s){return void n(s)}l.done?t(c):Promise.resolve(c).then(r,o)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){U(i,r,o,a,l,"next",e)}function l(e){U(i,r,o,a,l,"throw",e)}a(void 0)}))}}function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function $(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=q(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(c){l=!0,o=c}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||q(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){if(e){if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){X(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}System.register(["./index-legacy.6046cbcc.js","./index-legacy.fbe89b00.js"],(function(D,U){"use strict";var q,K,J,ee,te,ne,re,oe,ie,ae,le,ce,se,ue,de,pe,fe,he,ve,me,ge,ye,be,xe,we,Ce,Me,Se,ke,Oe,Pe,Le,Ee,Ie,je,_e,ze,Ae,Te,Re,Ne,Ge,Ze,Ve,De,He,Fe,Ue,Be,We,$e,Ye,qe,Ke,Je,Qe,Xe,et,tt,nt;return{setters:[function(e){q=e.M,K=e.d,J=e.u,ee=e.p,te=e.s,ne=e.a,re=e.b,oe=e.$,ie=e.c,ae=e.e,le=e.f,ce=e.S,se=e.g,ue=e.h,de=e.i,pe=e.A,fe=e.j,he=e.k,ve=e.m,me=e.l,ge=e.N,ye=e.P},function(e){be=e.R,xe=e.r,we=e.Z,Ce=e.j,Me=e.P,Se=e.c,ke=e.T,Oe=e.u,Pe=e.a,Le=e.b,Ee=e.s,Ie=e.m,je=e.y,_e=e.d,ze=e.e,Ae=e.C,Te=e.w,Re=e.I,Ne=e.f,Ge=e.g,Ze=e.h,Ve=e.i,De=e.F,He=e._,Fe=e.n,Ue=e.k,Be=e.L,We=e.l,$e=e.o,Ye=e.H,qe=e.J,Ke=e.p,Je=e.q,Qe=e.t,Xe=e.$,et=e.v,tt=e.x,nt=e.z}],execute:function(){var U=be.createContext({}),rt=function(){return xe.exports.useContext(U)},ot=function(e,t){switch(t.type){case"CATEGORY":return Q(Q({},e),{},{activeCategory:t.value});case"SCORE":var n=Me.find((function(n){return""===t.value?n.value===e.activeCategory:n.scores.includes(t.value)})).value;return{activeCategory:n,activeScoreByCategory:Q(Q({},e.activeScoreByCategory),{},X({},n,t.value))}}},it=function(e){var t=e.children,n=window.innerWidth<we.screenSizes.tablet?{activeCategory:"commute",activeScoreByCategory:{commute:"transit_friendly",amenities:"groceries",character:"quiet",nature:"parks",education:"primary_schools"}}:{activeCategory:"commute",activeScoreByCategory:{commute:"",amenities:"",character:"",nature:"",education:""}},r=Y(xe.exports.useReducer(ot,n),2),o=r[0],i=r[1],a=Y(xe.exports.useState(),2),l=a[0],c=a[1],s=Y(xe.exports.useState(),2),u=s[0],d=s[1],p=Y(xe.exports.useState(),2),f=p[0],h=p[1],v=Y(xe.exports.useState(),2),m=v[0],g=v[1],y=Y(xe.exports.useState(),2),b=y[0],x=y[1],w=Y(xe.exports.useState(!1),2),C=w[0],M=w[1],S=o.activeCategory,k=o.activeScoreByCategory[S],O=function(e){i({type:"SCORE",value:e})},P=function(e){i({type:"CATEGORY",value:e})},L=xe.exports.useMemo((function(){return{activeScore:k,setActiveScore:O,activeCategory:S,setActiveCategory:P,activePOI:l,setActivePOI:c,hoveredPOI:u,setHoveredPOI:d,commuteGeojson:f,setCommuteGeojson:h,destination:b,setDestination:x,showCommuteCalculator:C,setShowCommuteCalculator:M,schoolCatchment:m,setSchoolCatchment:g}}),[k,O,S,P,l,c,u,d,f,h,b,x,C,M,m,g]);return Ce(U.Provider,{value:L,children:t})};function at(e,t){if(!e)throw new Error(t)}var lt=0;function ct(e){var t=xe.exports.useContext(q).map.getMap(),n=xe.exports.useRef(e),r=Y(xe.exports.useState(0),2)[1],o=xe.exports.useMemo((function(){return e.id||"jsx-source-".concat(lt++)}),[]);xe.exports.useEffect((function(){if(t){var e=function(){return r((function(e){return e+1}))};return t.on("styledata",e),e(),function(){var n;if(t.off("styledata",e),t.style&&t.style._loaded&&t.getSource(o)){var r=null===(n=t.getStyle())||void 0===n?void 0:n.layers;if(r){var i,a=$(r);try{for(a.s();!(i=a.n()).done;){var l=i.value;l.source===o&&t.removeLayer(l.id)}}catch(c){a.e(c)}finally{a.f()}}t.removeSource(o)}}}}),[t]);var i=t&&t.style&&t.getSource(o);return i?function(e,t,n){at(t.id===n.id,"source id changed"),at(t.type===n.type,"source type changed");var r="",o=0;for(var i in t)"children"===i||"id"===i||K(n[i],t[i])||(r=i,o++);if(o){var a=t.type;if("geojson"===a)e.setData(t.data);else if("image"===a)e.updateImage({url:t.url,coordinates:t.coordinates});else if("canvas"!==a&&"video"!==a||1!==o||"coordinates"!==r)if("vector"===a&&"setUrl"in e)switch(r){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles)}else console.warn("Unable to update <Source> prop: ".concat(r));else e.setCoordinates(t.coordinates)}}(i,e,n.current):i=function(e,t,n){if(e.style&&e.style._loaded){var r=Q({},n);return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}(t,o,e),n.current=e,i&&xe.exports.Children.map(e.children,(function(e){return e&&xe.exports.cloneElement(e,{source:o})}))||null}var st=0;function ut(e){var t=xe.exports.useContext(q).map.getMap(),n=xe.exports.useRef(e),r=Y(xe.exports.useState(0),2)[1],o=xe.exports.useMemo((function(){return e.id||"jsx-layer-".concat(st++)}),[]);if(xe.exports.useEffect((function(){if(t){var e=function(){return r((function(e){return e+1}))};return t.on("styledata",e),e(),function(){t.off("styledata",e),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}}),[t]),t&&t.style&&t.getLayer(o))try{!function(e,t,n,r){if(at(n.id===r.id,"layer id changed"),at(n.type===r.type,"layer type changed"),"custom"!==n.type&&"custom"!==r.type){var o=n.layout,i=void 0===o?{}:o,a=n.paint,l=void 0===a?{}:a,c=n.filter,s=n.minzoom,u=n.maxzoom,d=n.beforeId;if(d!==r.beforeId&&e.moveLayer(t,d),i!==r.layout){var p=r.layout||{};for(var f in i)K(i[f],p[f])||e.setLayoutProperty(t,f,i[f]);for(var h in p)i.hasOwnProperty(h)||e.setLayoutProperty(t,h,void 0)}if(l!==r.paint){var v=r.paint||{};for(var m in l)K(l[m],v[m])||e.setPaintProperty(t,m,l[m]);for(var g in v)l.hasOwnProperty(g)||e.setPaintProperty(t,g,void 0)}K(c,r.filter)||e.setFilter(t,c),s===r.minzoom&&u===r.maxzoom||e.setLayerZoomRange(t,s,u)}}(t,o,e,n.current)}catch(i){console.warn(i)}else!function(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){var r=Q(Q({},n),{},{id:t});delete r.beforeId,e.addLayer(r,n.beforeId)}}(t,o,e);return n.current=e,null}function dt(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function pt(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ft(e[0])||!ft(e[1]))throw new Error("coordinates must contain numbers");return dt({type:"Point",coordinates:e},t,n)}function ft(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function ht(e,t,n){if(null!==e)for(var r,o,i,a,l,c,s,u,d=0,p=0,f=e.type,h="FeatureCollection"===f,v="Feature"===f,m=h?e.features.length:1,g=0;g<m;g++){l=(u=!!(s=h?e.features[g].geometry:v?e.geometry:e)&&"GeometryCollection"===s.type)?s.geometries.length:1;for(var y=0;y<l;y++){var b=0,x=0;if(null!==(a=u?s.geometries[y]:s)){c=a.coordinates;var w=a.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(c,p,g,b,x))return!1;p++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(!1===t(c[r],p,g,b,x))return!1;p++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-d;o++){if(!1===t(c[r][o],p,g,b,x))return!1;p++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(x=0,o=0;o<c[r].length;o++){for(i=0;i<c[r][o].length-d;i++){if(!1===t(c[r][o][i],p,g,b,x))return!1;p++}x++}b++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===ht(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function vt(e){var t=[1/0,1/0,-1/0,-1/0];return ht(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}vt.default=vt;var mt=/^\s+|\s+$/g,gt=/^[-+]0x[0-9a-f]+$/i,yt=/^0b[01]+$/i,bt=/^0o[0-7]+$/i,xt=parseInt,wt="object"==W(Se)&&Se&&Se.Object===Object&&Se,Ct="object"==("undefined"==typeof self?"undefined":W(self))&&self&&self.Object===Object&&self,Mt=wt||Ct||Function("return this")(),St=Object.prototype.toString,kt=Math.max,Ot=Math.min,Pt=function(){return Mt.Date.now()};function Lt(e){var t=W(e);return!!e&&("object"==t||"function"==t)}function Et(e){return"symbol"==W(e)||function(e){return!!e&&"object"==W(e)}(e)&&"[object Symbol]"==St.call(e)}function It(e){if("number"==typeof e)return e;if(Et(e))return NaN;if(Lt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Lt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(mt,"");var n=yt.test(e);return n||bt.test(e)?xt(e.slice(2),n?2:8):gt.test(e)?NaN:+e}var jt=function(e,t,n){var r,o,i,a,l,c,s=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=o;return r=o=void 0,s=t,a=e.apply(i,n)}function h(e){return s=e,l=setTimeout(m,t),u?f(e):a}function v(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-s>=i}function m(){var e=Pt();if(v(e))return g(e);l=setTimeout(m,function(e){var n=t-(e-c);return d?Ot(n,i-(e-s)):n}(e))}function g(e){return l=void 0,p&&r?f(e):(r=o=void 0,a)}function y(){var e=Pt(),n=v(e);if(r=arguments,o=this,c=e,n){if(void 0===l)return h(c);if(d)return l=setTimeout(m,t),f(c)}return void 0===l&&(l=setTimeout(m,t)),a}return t=It(t)||0,Lt(n)&&(u=!!n.leading,i=(d="maxWait"in n)?kt(It(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==l&&clearTimeout(l),s=0,r=c=o=l=void 0},y.flush=function(){return void 0===l?a:g(Pt())},y},_t=function(){var e=Y(xe.exports.useState(!1),2),t=e[0],n=e[1];return xe.exports.useLayoutEffect((function(){var e=function(){n(window.innerWidth<we.screenSizes.tablet)};return window.addEventListener("resize",jt(e,250)),e(),function(){return window.removeEventListener("resize",e)}}),[]),t};function zt(){var e,t=ke().client,n=Oe().sdkState,r=Pe(n.options,250),o=rt().activeScore,i=o?Le[o]:void 0,a=Q(Q({},xe.exports.useMemo((function(){return!(null==r||!r.marker)?r.marker:{lat:null==r?void 0:r.lat,lng:null==r?void 0:r.lng}}),[r])),{},{limit:10,radius:2e3,include:i});return J(ee.list(a),B(F().mark((function e(){return F().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.getPois(a));case 1:case"end":return e.stop()}}),e)}))),{enabled:!!(a&&null!==(e=a.include)&&void 0!==e&&e.length&&a.lat&&a.lng)})}function At(){var e=ke().client,t=Oe().sdkState,n=Pe(t.options,250),r=rt().activeScore,o="high_schools"===r||"primary_schools"===r,i=Q(Q({},xe.exports.useMemo((function(){return!(null==n||!n.marker)?n.marker:{lat:null==n?void 0:n.lat,lng:null==n?void 0:n.lng}}),[n])),{},{limit:10,radius:2e3,include_catchments:!1});return J(te.list(i),B(F().mark((function t(){return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getSchools(i));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!i&&!!i.lat&&!!i.lng&&o})}var Tt=be.createContext({}),Rt=function(){return xe.exports.useContext(Tt)},Nt=function(e){var t=e.children,n=e.mapRef,r=e.mapPadding;return Ce(Tt.Provider,{value:{mapRef:n,mapPadding:r},children:t})};function Gt(e,t,n,r,o,i){if(!(o-r<=n)){var a=r+o>>1;Zt(e,t,a,r,o,i%2),Gt(e,t,n,r,a-1,i+1),Gt(e,t,n,a+1,o,i+1)}}function Zt(e,t,n,r,o,i){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,c=Math.log(a),s=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*s*(a-s)/a)*(l-a/2<0?-1:1);Zt(e,t,n,Math.max(r,Math.floor(n-l*s/a+u)),Math.min(o,Math.floor(n+(a-l)*s/a+u)),i)}var d=t[2*n+i],p=r,f=o;for(Vt(e,t,r,n),t[2*o+i]>d&&Vt(e,t,r,o);p<f;){for(Vt(e,t,p,f),p++,f--;t[2*p+i]<d;)p++;for(;t[2*f+i]>d;)f--}t[2*r+i]===d?Vt(e,t,r,f):Vt(e,t,++f,o),f<=n&&(r=f+1),n<=f&&(o=f-1)}}function Vt(e,t,n,r){Dt(e,n,r),Dt(t,2*n,2*r),Dt(t,2*n+1,2*r+1)}function Dt(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Ht(e,t,n,r){var o=e-n,i=t-r;return o*o+i*i}var Ft,Ut=function(e){return e[0]},Bt=function(e){return e[1]},Wt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ut,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;V(this,e),this.nodeSize=o,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,l=this.ids=new a(t.length),c=this.coords=new i(2*t.length),s=0;s<t.length;s++)l[s]=s,c[2*s]=n(t[s]),c[2*s+1]=r(t[s]);Gt(l,c,o,0,l.length-1,0)}return H(e,[{key:"range",value:function(e,t,n,r){return function(e,t,n,r,o,i,a){for(var l,c,s=[0,e.length-1,0],u=[];s.length;){var d=s.pop(),p=s.pop(),f=s.pop();if(p-f<=a)for(var h=f;h<=p;h++)l=t[2*h],c=t[2*h+1],l>=n&&l<=o&&c>=r&&c<=i&&u.push(e[h]);else{var v=Math.floor((f+p)/2);l=t[2*v],c=t[2*v+1],l>=n&&l<=o&&c>=r&&c<=i&&u.push(e[v]);var m=(d+1)%2;(0===d?n<=l:r<=c)&&(s.push(f),s.push(v-1),s.push(m)),(0===d?o>=l:i>=c)&&(s.push(v+1),s.push(p),s.push(m))}}return u}(this.ids,this.coords,e,t,n,r,this.nodeSize)}},{key:"within",value:function(e,t,n){return function(e,t,n,r,o,i){for(var a=[0,e.length-1,0],l=[],c=o*o;a.length;){var s=a.pop(),u=a.pop(),d=a.pop();if(u-d<=i)for(var p=d;p<=u;p++)Ht(t[2*p],t[2*p+1],n,r)<=c&&l.push(e[p]);else{var f=Math.floor((d+u)/2),h=t[2*f],v=t[2*f+1];Ht(h,v,n,r)<=c&&l.push(e[f]);var m=(s+1)%2;(0===s?n-o<=h:r-o<=v)&&(a.push(d),a.push(f-1),a.push(m)),(0===s?n+o>=h:r+o>=v)&&(a.push(f+1),a.push(u),a.push(m))}}return l}(this.ids,this.coords,e,t,n,this.nodeSize)}}]),e}(),$t={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},Yt=Math.fround||(Ft=new Float32Array(1),function(e){return Ft[0]=+e,Ft[0]}),qt=function(){function e(t){V(this,e),this.options=rn(Object.create($t),t),this.trees=new Array(this.options.maxZoom+1)}return H(e,[{key:"load",value:function(e){var t=this.options,n=t.log,r=t.minZoom,o=t.maxZoom,i=t.nodeSize;n&&console.time("total time");var a="prepare ".concat(e.length," points");n&&console.time(a),this.points=e;for(var l=[],c=0;c<e.length;c++)e[c].geometry&&l.push(Jt(e[c],c));this.trees[o+1]=new Wt(l,on,an,i,Float32Array),n&&console.timeEnd(a);for(var s=o;s>=r;s--){var u=+Date.now();l=this._cluster(l,s),this.trees[s]=new Wt(l,on,an,i,Float32Array),n&&console.log("z%d: %d clusters in %dms",s,l.length,+Date.now()-u)}return n&&console.timeEnd("total time"),this}},{key:"getClusters",value:function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),o=180===e[2]?180:((e[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){var a=this.getClusters([n,r,180,i],t),l=this.getClusters([-180,r,o,i],t);return a.concat(l)}var c,s=this.trees[this._limitZoom(t)],u=[],d=$(s.range(en(n),tn(i),en(o),tn(r)));try{for(d.s();!(c=d.n()).done;){var p=c.value,f=s.points[p];u.push(f.numPoints?Qt(f):this.points[f.index])}}catch(h){d.e(h)}finally{d.f()}return u}},{key:"getChildren",value:function(e){var t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(r);var i=o.points[t];if(!i)throw new Error(r);var a,l=this.options.radius/(this.options.extent*Math.pow(2,n-1)),c=[],s=$(o.within(i.x,i.y,l));try{for(s.s();!(a=s.n()).done;){var u=a.value,d=o.points[u];d.parentId===e&&c.push(d.numPoints?Qt(d):this.points[d.index])}}catch(p){s.e(p)}finally{s.f()}if(0===c.length)throw new Error(r);return c}},{key:"getLeaves",value:function(e,t,n){t=t||10,n=n||0;var r=[];return this._appendLeaves(r,e,t,n,0),r}},{key:"getTile",value:function(e,t,n){var r=this.trees[this._limitZoom(e)],o=Math.pow(2,e),i=this.options,a=i.extent,l=i.radius/a,c=(n-l)/o,s=(n+1+l)/o,u={features:[]};return this._addTileFeatures(r.range((t-l)/o,c,(t+1+l)/o,s),r.points,t,n,o,u),0===t&&this._addTileFeatures(r.range(1-l/o,c,1,s),r.points,o,n,o,u),t===o-1&&this._addTileFeatures(r.range(0,c,l/o,s),r.points,-1,n,o,u),u.features.length?u:null}},{key:"getClusterExpansionZoom",value:function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t}},{key:"_appendLeaves",value:function(e,t,n,r,o){var i,a=$(this.getChildren(t));try{for(a.s();!(i=a.n()).done;){var l=i.value,c=l.properties;if(c&&c.cluster?o+c.point_count<=r?o+=c.point_count:o=this._appendLeaves(e,c.cluster_id,n,r,o):o<r?o++:e.push(l),e.length===n)break}}catch(s){a.e(s)}finally{a.f()}return o}},{key:"_addTileFeatures",value:function(e,t,n,r,o,i){var a,l=$(e);try{for(l.s();!(a=l.n()).done;){var c=t[a.value],s=c.numPoints,u=void 0,d=void 0,p=void 0;if(s)u=Xt(c),d=c.x,p=c.y;else{var f=this.points[c.index];u=f.properties,d=en(f.geometry.coordinates[0]),p=tn(f.geometry.coordinates[1])}var h={type:1,geometry:[[Math.round(this.options.extent*(d*o-n)),Math.round(this.options.extent*(p*o-r))]],tags:u},v=void 0;s?v=c.id:this.options.generateId?v=c.index:this.points[c.index].id&&(v=this.points[c.index].id),void 0!==v&&(h.id=v),i.features.push(h)}}catch(m){l.e(m)}finally{l.f()}}},{key:"_limitZoom",value:function(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}},{key:"_cluster",value:function(e,t){for(var n=[],r=this.options,o=r.radius,i=r.extent,a=r.reduce,l=r.minPoints,c=o/(i*Math.pow(2,t)),s=0;s<e.length;s++){var u=e[s];if(!(u.zoom<=t)){u.zoom=t;var d,p=this.trees[t+1],f=p.within(u.x,u.y,c),h=u.numPoints||1,v=h,m=$(f);try{for(m.s();!(d=m.n()).done;){var g=d.value,y=p.points[g];y.zoom>t&&(v+=y.numPoints||1)}}catch(_){m.e(_)}finally{m.f()}if(v>h&&v>=l){var b,x=u.x*h,w=u.y*h,C=a&&h>1?this._map(u,!0):null,M=(s<<5)+(t+1)+this.points.length,S=$(f);try{for(S.s();!(b=S.n()).done;){var k=b.value,O=p.points[k];if(!(O.zoom<=t)){O.zoom=t;var P=O.numPoints||1;x+=O.x*P,w+=O.y*P,O.parentId=M,a&&(C||(C=this._map(u,!0)),a(C,this._map(O)))}}}catch(_){S.e(_)}finally{S.f()}u.parentId=M,n.push(Kt(x/v,w/v,M,v,C))}else if(n.push(u),v>1){var L,E=$(f);try{for(E.s();!(L=E.n()).done;){var I=L.value,j=p.points[I];j.zoom<=t||(j.zoom=t,n.push(j))}}catch(_){E.e(_)}finally{E.f()}}}}return n}},{key:"_getOriginId",value:function(e){return e-this.points.length>>5}},{key:"_getOriginZoom",value:function(e){return(e-this.points.length)%32}},{key:"_map",value:function(e,t){if(e.numPoints)return t?rn({},e.properties):e.properties;var n=this.points[e.index].properties,r=this.options.map(n);return t&&r===n?rn({},r):r}}]),e}();function Kt(e,t,n,r,o){return{x:Yt(e),y:Yt(t),zoom:1/0,id:n,parentId:-1,numPoints:r,properties:o}}function Jt(e,t){var n=Y(e.geometry.coordinates,2),r=n[0],o=n[1];return{x:Yt(en(r)),y:Yt(tn(o)),zoom:1/0,index:t,parentId:-1}}function Qt(e){return{type:"Feature",id:e.id,properties:Xt(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),nn(e.y)]}};var t}function Xt(e){var t=e.numPoints,n=t>=1e4?"".concat(Math.round(t/1e3),"k"):t>=1e3?"".concat(Math.round(t/100)/10,"k"):t;return rn(rn({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function en(e){return e/360+.5}function tn(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function nn(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function rn(e,t){for(var n in t)e[n]=t[n];return e}function on(e){return e.x}function an(e){return e.y}var ln=Object.prototype.hasOwnProperty;function cn(e,t,n){var r,o=$(e.keys());try{for(o.s();!(r=o.n()).done;)if(sn(n=r.value,t))return n}catch(i){o.e(i)}finally{o.f()}}function sn(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&sn(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;var i,a=$(e);try{for(a.s();!(i=a.n()).done;){if((o=r=i.value)&&"object"===W(o)&&!(o=cn(t,o)))return!1;if(!t.has(o))return!1}}catch(s){a.e(s)}finally{a.f()}return!0}if(n===Map){if(e.size!==t.size)return!1;var l,c=$(e);try{for(c.s();!(l=c.n()).done;){if((o=(r=l.value)[0])&&"object"===W(o)&&!(o=cn(t,o)))return!1;if(!sn(r[1],t.get(o)))return!1}}catch(s){c.e(s)}finally{c.f()}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"===W(e)){for(n in r=0,e){if(ln.call(e,n)&&++r&&!ln.call(t,n))return!1;if(!(n in t)||!sn(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function un(e,t){return xe.exports.useEffect(e,(n=t,r=xe.exports.useRef(n),o=xe.exports.useRef(0),sn(n,r.current)||(r.current=n,o.current+=1),xe.exports.useMemo((function(){return r.current}),[o.current])));var n,r,o}var dn=Ee(Ie.div)(e||(e=Z(["\n border-radius: 50%;\n background: linear-gradient(\n to top,\n ",",\n ","\n );\n color: ",";\n height: ","px;\n width: ","px;\n display: flex;\n justify-content: center;\n align-items: center;\n line-height: 1;\n font-family: ",";\n font-size: ","px;\n border: 2px solid #fff;\n box-shadow: ",";\n cursor: default;\n"])),je["--ll-color-primary-variant1"],je["--ll-color-primary"],je["--ll-color-on-primary"],(function(e){return e.diameter}),(function(e){return e.diameter}),je["--ll-font-family"],(function(e){return e.diameter/2.5}),je["--ll-shadow-small"]),pn=Ee.ul(t||(t=Z(["\n list-style: none;\n padding: 0;\n margin: 0;\n"]))),fn=Ee.li(n||(n=Z(["\n font-family: ",";\n padding: ",";\n background-color: ",";\n border-radius: ",";\n border: 1px solid ",";\n cursor: default;\n\n &:not(:last-child) {\n margin-bottom: ",";\n }\n\n &:hover {\n background-color: ",";\n }\n"])),je["--ll-font-family"],je["--ll-spacing-x-small"],je["--ll-color-background"],je["--ll-border-radius-small"],je["--ll-color-border"],je["--ll-spacing-xx-small"],je["--ll-color-surface"]),hn={all:function(){return["commute-calculator"]},list:function(e){return[].concat(G(hn.all()),[e])}};function vn(e){var t=e.transportMode,n=e.origin,r=e.destination,o=e.isOpen,i={return:"polyline,summary,typicalDuration",transportMode:t,origin:n,destination:"".concat(null==r?void 0:r.lat,",").concat(null==r?void 0:r.lng),apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"};return J(hn.list(i),(function(){return fetch("https://router.hereapi.com/v8/routes?"+new URLSearchParams(i)).then((function(e){return e.json()})).then((function(e){return e.routes.length>0&&e.routes[0].sections.length>0?e.routes[0].sections[0]:[]})).catch((function(e){_e(e)}))}),{enabled:!!i&&!!r&&!!n&&o})}var mn=function(e){var t,n,r,o,i=e.poi,a=e.poiType,l=e.rect,c=e.activePOI,s=e.hoveredPOI,u=e.isMapMoving,d=e.setActivePOI,p=e.isMobile,f=Y(xe.exports.useState(!1),2),h=f[0],v=f[1],m=s===i,g=ze().translations,y=Oe().sdkState,b=rt(),x=b.setCommuteGeojson,w=b.setDestination,C=b.setShowCommuteCalculator,M=b.setSchoolCatchment,S=vn({destination:{lat:i.lat,lng:i.lng},transportMode:"pedestrian",origin:"".concat(null==y||null===(t=y.options)||void 0===t||null===(n=t.marker)||void 0===n?void 0:n.lat,",").concat(null==y||null===(r=y.options)||void 0===r||null===(o=r.marker)||void 0===o?void 0:o.lng),isOpen:h}).data;xe.exports.useEffect((function(){if(v(c===i),c===i){var e="high_schools"===a||"primary_schools"===a?"school":"poi";Ae.poi.isSchool(i,e)&&null!=i&&i.catchments&&Object.keys((null==i?void 0:i.catchments)||[]).length>0&&M(Te.formatGeometry.formatGeometry(i.catchments[0].geometry))}}),[c,i]);var k=xe.exports.useMemo((function(){if(null==S||!S.summary||!h)return null;var e=Math.floor(S.summary.typicalDuration/60/60),t=Math.floor(S.summary.typicalDuration/60%60);return 0===e?"".concat(t," ").concat(Re.pluralize(g.MINUTE,t)):"".concat(e," ").concat(Re.pluralize(g.HOUR,e)," ").concat(t," ").concat(Re.pluralize(g.MINUTE,t))}),[S,h]);return Ce(ne,{latitude:i.lat,longitude:i.lng,style:{zIndex:h?1:0},children:Ne(Ge.Root,{options:{type:a,poi:i,isOpen:!u&&h,isHovered:m,side:"top",size:["rapid_transit_stations"].includes(a)?"medium":"small",collisionPadding:p?{top:l.height+32,bottom:2*Ze,left:2*Ze,right:2*Ze}:{left:l.width+32,right:2*Ze,top:2*Ze,bottom:2*Ze},walkingTime:k,calculateRoute:function(){null!=S&&S.summary&&h&&(w({label:i.name,lat:i.lat,lng:i.lng}),x(Te.polyline.decode(S.polyline)),C(!0),v(!1))}},onChange:function(e){"open-change"===e.type&&(e.data?setTimeout((function(){d(i)}),0):h&&(d(void 0),M()))},children:[Ce(Ge.Marker,{}),Ce(Ge.Content,{})]})})},gn={default:{scale:1},hovered:{scale:1.2}},yn=function(e){var t=e.cluster,n=e.supercluster,r=e.pointsCount,o=e.onClick,i=e.zoom,a=e.activePOI,l=e.hoveredPOI,c=e.setActivePOI,s=e.rect,u=e.isMobile,d=e.isMapMoving,p=Y(xe.exports.useState(!1),2),f=p[0],h=p[1],v=20+t.properties.point_count/r*25,m=xe.exports.useMemo((function(){return null==n?void 0:n.getChildren(t.id).map((function(e){return e.properties})).filter((function(e){return!!e}))}),[n,t]),g=null==m?void 0:m.find((function(e){return!!a&&e.poi===a}));return g?Ce(mn,{rect:s,poi:g.poi,poiType:g.type,isMobile:u,activePOI:a,hoveredPOI:l,isMapMoving:d,setActivePOI:c}):Ne(Ve.Root,{open:!d&&f,onOpenChange:function(e){i<=17||h(e)},children:[Ce(Ve.Trigger,{children:Ce(dn,{diameter:v,onClick:function(){i>17?h(!0):o&&o(t)},variants:gn,animate:f?"hovered":"default",whileHover:{scale:1.2},transition:we.transitions.default,children:t.properties.point_count})}),Ce(Ve.Content,{side:"top",children:Ce(pn,{children:null==m?void 0:m.map((function(e,t){var n;return Ce(fn,{onClick:function(){return c(e.poi)},children:null===(n=e.poi)||void 0===n?void 0:n.name},t)}))})})]})};var bn=be.memo((function(e){var t,n=e.rect,r=e.zoom,o=e.mapRef,i=e.points,a=e.isMobile,l=e.activePOI,c=e.hoveredPOI,s=e.isMapMoving,u=e.setActivePOI,d=null==o||null===(t=o.current)||void 0===t?void 0:t.getMap().getBounds().toArray().flat(),p=function(e){var t=e.points,n=e.bounds,r=e.zoom,o=e.options,i=xe.exports.useRef(),a=xe.exports.useRef(),l=xe.exports.useState([]),c=l[0],s=l[1],u=Math.round(r);return un((function(){i.current&&sn(a.current,t)&&sn(i.current.options,o)||(i.current=new qt(o),i.current.load(t)),n&&s(i.current.getClusters(n,u)),a.current=t}),[t,n,u,o]),{clusters:c,supercluster:i.current}}({points:i,bounds:d,zoom:r,options:{radius:50,maxZoom:30}}),f=p.clusters,h=p.supercluster;return Ce(De,{children:f.map((function(e,t){var d=Y(e.geometry.coordinates,2),p=d[0],f=d[1];return function(e){return void 0!==e.properties.cluster}(e)?Ce(ne,{latitude:f,longitude:p,children:Ce(yn,{rect:n,zoom:r,cluster:e,supercluster:h,pointsCount:i.length,activePOI:l,setActivePOI:u,isMobile:a,isMapMoving:s,hoveredPOI:c,onClick:function(){var t,n=Math.min(h.getClusterExpansionZoom(e.id),20);null===(t=o.current)||void 0===t||t.flyTo({zoom:n,center:[p,f],duration:1e3,essential:!0})}})},"cluster-".concat(e.id)):Ce(mn,{rect:n,poi:e.properties.poi,poiType:e.properties.type,isMobile:a,activePOI:l,hoveredPOI:c,isMapMoving:s,setActivePOI:u},t)}))})}));bn.displayName="Markers";var xn=function(e){return xe.exports.createElement("svg",Q({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9C9.5 7.62 10.62 6.5 12 6.5C13.38 6.5 14.5 7.62 14.5 9C14.5 10.38 13.38 11.5 12 11.5Z"}))},wn=function(e){return xe.exports.createElement("svg",Q({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"}))};function Cn(e){var t=ke().client,n=Oe().sdkState,r=Pe(n.options,250),o=Q(Q({},xe.exports.useMemo((function(){return!(null==r||!r.marker)?r.marker:{lat:null==r?void 0:r.lat,lng:null==r?void 0:r.lng}}),[r])),{},{geographyLevels:["20","30"],locationScoresRounding:!1,include:e});return J(re.list(o),B(F().mark((function e(){return F().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.getScores(o));case 1:case"end":return e.stop()}}),e)}))),{enabled:!!o})}var Mn=Ee.div(r||(r=Z(["\n padding: "," ",";\n background-color: ",";\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex: 1;\n"])),je["--ll-spacing-small"],je["--ll-spacing-medium"],je["--ll-color-surface"]),Sn=Ee.div(o||(o=Z(["\n display: grid;\n grid-template-columns: min-content 1fr;\n grid-gap: ",";\n margin-bottom: ",";\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"]),kn=function(){var e,t,n=Oe().sdkState,r=rt(),o=r.activeCategory,i=r.activeScore,a=Cn(Me.find((function(e){return e.value===o})).scores),l=a.data,c=a.isLoading;return i&&null!=l&&l.location[i]?c?Ce("div",{children:"Loading"}):Ce(He.Root,{options:{score:i,scoresData:l},children:Ne(Mn,{children:[Ne(Sn,{children:[Ce(He.Badge,{}),Ce(He.BarChart,{options:{locationIcon:"pin"===(null===(e=n.options)||void 0===e||null===(t=e.marker)||void 0===t?void 0:t.icon)?xn:wn}})]}),Ce(He.Description,{})]})}):null},On=Ee.div(i||(i=Z(["\n display: flex;\n overflow-x: scroll;\n padding: "," ",";\n flex-shrink: 0;\n position: relative;\n"])),je["--ll-spacing-x-small"],je["--ll-spacing-medium"]),Pn=Ee.button(a||(a=Z(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n background: none;\n border: none;\n min-width: 60px;\n padding: 0;\n margin: 0 8px;\n flex-shrink: 0;\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n margin-right: 0;\n }\n"]))),Ln=Ee.div(l||(l=Z(["\n position: absolute;\n top: -6px;\n right: 4px;\n border: 2px solid ",";\n border-radius: 6px;\n"])),je["--ll-color-background"]),En=Ee.div(c||(c=Z(["\n flex: 1;\n display: flex;\n align-items: center;\n"]))),In=Ee.div(s||(s=Z(["\n margin: 0 2px;\n"]))),jn=function(e){var t=e.category,n=Cn(t.scores),r=n.data,o=n.isLoading,i=n.isFetching,a=rt(),l=a.activeScore,c=a.setActiveScore,s=a.setActiveCategory;return Ce(On,{children:t.scores.map((function(e){var n=e===l,a=n?"--ll-color-primary":"--ll-color-disabled";return o||i?Ce(In,{children:Ce(Fe,{height:"44px",width:"60px"})},e):Ce(He.Root,{options:{score:e,scoresData:r},children:Ne(Pn,{onClick:function(){s(t.value),c(e)},children:[Ce(He.Icon,{options:{color:a,height:28,width:28}}),Ce(En,{children:Ce(He.Title,{options:{variant:"caption1",color:a,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),Ce(Ln,{children:Ce(He.Badge,{options:{variant:"small",isPrimary:n}})})]})},e)}))})},_n=Ee.div(u||(u=Z(["\n display: flex;\n padding: "," ","\n "," ",";\n"])),je["--ll-spacing-x-small"],je["--ll-spacing-medium"],je["--ll-spacing-xx-small"],je["--ll-spacing-medium"]),zn=Ee.div(d||(d=Z(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 3;\n box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border: 1px solid ",";\n"])),je["--ll-color-background"],je["--ll-color-border"]),An=be.forwardRef((function(e,t){var n=rt(),r=n.activeCategory,o=n.setActiveCategory;return Ne(zn,{ref:t,children:[Ce(_n,{children:Ne(Ue.Root,{value:r,onValueChange:function(e){return o(e)},children:[Ce(Ue.Trigger,{size:"large",children:Ce(Be.Root,{options:{scoreCategory:r},children:Ce(Be.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},r)}),Ce(Ue.Content,{children:Me.map((function(e){return Ce(Be.Root,{options:{scoreCategory:e.value},children:Ce(Ue.Item,{value:e.value,children:Ce(Be.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},e.value)}))})]})}),Ce(jn,{category:Me.find((function(e){return e.value===r}))}),Ce(kn,{})]})}));An.displayName="MobileScores";var Tn=We({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Rn=We({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Nn=Ee(oe)(p||(p=Z(["\n margin: 0;\n z-index: 1;\n position: relative;\n margin: 0 calc(-1 * ",");\n padding: 0 ",";\n\n &:hover {\n background-color: ",";\n box-shadow: ",";\n }\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"],je["--ll-color-surface"],je["--ll-shadow-small"]),Gn=Ee(ie)(f||(f=Z(["\n background: none;\n border: none;\n display: flex;\n align-items: center;\n width: 100%;\n padding: "," 0;\n"])),je["--ll-spacing-x-small"]),Zn=Ee(ae)(h||(h=Z(["\n background-color: ",";\n position: relative;\n overflow: hidden;\n margin-left: calc(-1 * ",");\n margin-right: calc(-1 * ",');\n\n [data-state="open"] & {\n animation: ',' 300ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n\n [data-state="closed"] & {\n animation: '," 300ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n"])),je["--ll-color-surface"],je["--ll-spacing-medium"],je["--ll-spacing-medium"],Tn,Rn),Vn=Ee.div(v||(v=Z(["\n padding: ",";\n border-top: 1px solid ",";\n border-bottom: 1px solid ",";\n"])),je["--ll-spacing-medium"],je["--ll-color-border"],je["--ll-color-border"]),Dn=Ee.span(m||(m=Z(["\n ","[data-state=open] & {\n transform: rotate(90deg);\n } ;\n"])),Gn);Ee.div(g||(g=Z(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n"])));var Hn=Ee.div(y||(y=Z(["\n margin: "," 0;\n"])),je["--ll-spacing-small"]),Fn=Ee.div(b||(b=Z(["\n margin-top: ",";\n &:empty {\n margin: 0;\n }\n"])),je["--ll-spacing-large"]),Un=function(e){var t=e.score,n=At(),r=n.data,o=n.isLoading,i=rt(),a=i.activePOI,l=i.setActivePOI,c=i.hoveredPOI,s=i.setHoveredPOI,u=Rt(),d=u.mapRef,p=u.mapPadding;return o?Ce(De,{children:G(Array(10)).map((function(e,t){return Ce(Hn,{children:Ce(Fe,{height:"34px",width:"100%"})},t)}))}):r?Ce($e.Root,{options:{type:"school",data:null==r?void 0:r[t],activePOI:a,hoveredPOI:c},onChange:function(e){if("poi-click"===e.type){var t=e.data;l(t);var n,r=window.innerWidth-p.left,o=window.innerWidth/2,i=r/2+p.left-o;if(t)null===(n=d.current)||void 0===n||n.easeTo({zoom:18,center:[t.lng,t.lat],duration:1e3,offset:[i,0]})}"poi-hover"===e.type&&s(e.data)}}):null},Bn=be.memo((function(e){var t=e.result,n=e.poi,r=rt(),o=r.activePOI,i=r.setActivePOI,a=r.hoveredPOI,l=r.setHoveredPOI,c=Rt(),s=c.mapRef,u=c.mapPadding;return t.data&&t.data[n]?Ce(Ye.Content,{options:{value:n},children:Ce($e.Root,{options:{type:"poi",data:t.data[n],activePOI:o,hoveredPOI:a},onChange:function(e){if("poi-click"===e.type){var t=e.data;i(t);var n,r=window.innerWidth-u.left,o=window.innerWidth/2,a=r/2+u.left-o;if(t)null===(n=s.current)||void 0===n||n.flyTo({zoom:18,center:[t.lng,t.lat],duration:1e3,offset:[a,0],essential:!0})}"poi-hover"===e.type&&l(e.data)}})},n):null}));Bn.displayName="POI";var Wn=be.memo((function(e){var t=e.include,n=zt(),r=null==t?void 0:t.filter((function(e){var t;return((null==n||null===(t=n.data)||void 0===t?void 0:t[e])||[]).length>0}));return n.isLoading&&r.length?Ce(De,{children:G(Array(10)).map((function(e,t){return Ce(Hn,{children:Ce(Fe,{height:"34px",width:"100%"})},t)}))}):n.data?Ne(Ye.Root,{options:{include:r},children:[Ce(Ye.Tabs,{}),r.map((function(e){return Ce(Bn,{poi:e,result:n},e)}))]}):null}));Wn.displayName="POIs";var $n=be.memo((function(e){var t,n,r=e.score,o=e.isLoading,i=e.scoresData,a=Oe().sdkState,l=r===rt().activeScore;return o?Ce(Hn,{children:Ce(Fe,{height:"34px",width:"100%"},r)}):null!=i&&i.location[r]?Ce(le,{value:r,children:Ne(He.Root,{options:{score:r,scoresData:i},children:[Ce(Nn,{children:Ne(Gn,{children:[Ce(Dn,{children:Ce(qe,{SVGElement:ce,fill:je["--ll-color-on-background-variant1"]})}),Ce(Ke,{spacing:"--ll-spacing-small"}),Ce(He.Icon,{}),Ce(Ke,{spacing:"--ll-spacing-small"}),Ce(He.Title,{}),Ce(Ke,{}),Ce(He.Badge,{options:{isPrimary:l}})]})}),Ce(Zn,{children:Ne(Vn,{children:[Ce(He.Description,{}),Ce(Ke,{vertical:!0,spacing:"--ll-spacing-small"}),Ce(He.BarChart,{options:{locationIcon:"pin"===(null===(t=a.options)||void 0===t||null===(n=t.marker)||void 0===n?void 0:n.icon)?xn:wn}}),Ce(Fn,{children:"high_schools"===r||"primary_schools"===r?Ce(Un,{score:r}):Ce(Wn,{include:Le[r]})})]})})]})},r):null}));$n.displayName="Score";var Yn=Ee.div(x||(x=Z(["\n padding: "," ",";\n"])),je["--ll-spacing-small"],je["--ll-spacing-medium"]),qn=Ee.div(w||(w=Z(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]))),Kn=be.memo((function(e){var t=e.tabContent,n=Cn(t.scores),r=n.data,o=n.isLoading,i=n.isFetching,a=ze().translations;return Ne(Yn,{children:[Ne(qn,{children:[Ce(Je.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),i&&!o&&Ce(Qe,{size:"small"})]}),Ce(Ke,{spacing:"--ll-spacing-small",vertical:!0}),!i&&!Object.keys((null==r?void 0:r.location)||{}).length&&Ce(Xe,{color:"--ll-color-on-background-variant1",children:a.EMPTY_TEXT}),t.scores.map((function(e){return Ce($n,{score:e,isLoading:o,scoresData:r},e)}))]})}));Kn.displayName="ScoreCategory";var Jn=be.memo((function(e){var t=e.tabContent,n=rt(),r=n.activeScore,o=n.setActiveScore;return xe.exports.useEffect((function(){o(t.scores[0])}),[]),Ce(se,{value:r,onValueChange:function(e){o(e)},type:"single",collapsible:!0,children:Ce(Kn,{tabContent:t})})}));Jn.displayName="ScoreCategoryAccordion";var Qn=Ee.div(C||(C=Z(["\n overflow-y: auto;\n"]))),Xn=Ee.div(M||(M=Z(["\n position: absolute;\n top: ",";\n left: ",";\n width: 360px;\n max-height: calc(100% - 2 * ",");\n z-index: 1;\n border-radius: ",";\n box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;\n background-color: #fff;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border: 1px solid ",";\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"],je["--ll-spacing-medium"],je["--ll-border-radius-medium"],je["--ll-color-background"],je["--ll-color-border"]);Ee.div(S||(S=Z(["\n display: flex;\n justify-content: center;\n padding: ",";\n"])),je["--ll-spacing-small"]);var er=Ee.div(k||(k=Z(["\n padding: ",";\n border-bottom: 1px solid ",";\n"])),je["--ll-spacing-xx-small"],je["--ll-color-border"]),tr=Ee.div(O||(O=Z(["\n display: flex;\n justify-content: center;\n padding: ",";\n background-color: ",";\n"])),je["--ll-spacing-small"],je["--ll-color-background"]),nr=function(){return Ce(tr,{children:Ce(et.Root,{})})},rr=be.forwardRef((function(e,t){var n=rt(),r=n.activeCategory,o=n.setActiveCategory;return Ce(Je.Root,{options:{currentTab:r},onChange:function(e){o(e.data)},children:Ne(Xn,{ref:t,children:[Ce(er,{children:Ce(Je.Tabs,{})}),Ce(Qn,{children:Me.map((function(e){return Ce(Je.Content,{options:{value:e.value},children:Ce(Jn,{tabContent:e},e.value)},e.value)}))}),Ce(nr,{})]})})}));rr.displayName="DesktopScores";var or=Ee.div(P||(P=Z(["\n position: relative;\n display: flex;\n flex-direction: column;\n height: 100vh;\n"]))),ir=function(e){return xe.exports.createElement("svg",Q({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M22.4275 10.5938L13.4175 1.58383C12.6675 0.833834 11.3475 0.823834 10.5875 1.58383L1.58745 10.5838C0.807453 11.3638 0.807453 12.6238 1.58745 13.4038L10.5875 22.4038C10.9775 22.7938 11.4875 22.9838 11.9975 22.9838C12.5075 22.9838 13.0175 22.7938 13.4075 22.4038L22.3975 13.4138C23.1875 12.6538 23.1975 11.3938 22.4275 10.5938ZM12.0075 20.9938L3.00745 11.9938L12.0075 2.99383L21.0075 11.9938L12.0075 20.9938ZM7.99745 11.0038V15.0038H9.99745V12.0038H13.9975V14.5038L17.4975 11.0038L13.9975 7.50383V10.0038H8.99745C8.44745 10.0038 7.99745 10.4538 7.99745 11.0038Z"}))},ar=function(e){return xe.exports.createElement("svg",Q({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M13.5 5.5C14.6 5.5 15.5 4.6 15.5 3.5C15.5 2.4 14.6 1.5 13.5 1.5C12.4 1.5 11.5 2.4 11.5 3.5C11.5 4.6 12.4 5.5 13.5 5.5ZM9.8 8.9L7 23H9.1L10.9 15L13 17V23H15V15.5L12.9 13.5L13.5 10.5C14.8 12 16.8 13 19 13V11C17.1 11 15.5 10 14.7 8.6L13.7 7C13.14 6.11 12.02 5.75 11.05 6.16L6 8.3V13H8V9.6L9.8 8.9Z"}))},lr=function(e){return xe.exports.createElement("svg",Q({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5H6.5C5.84 5 5.29 5.42 5.08 6.01L3 12V20C3 20.55 3.45 21 4 21H5C5.55 21 6 20.55 6 20V19H18V20C18 20.55 18.45 21 19 21H20C20.55 21 21 20.55 21 20V12L18.92 6.01ZM6.85 7H17.14L18.22 10.11H5.77L6.85 7ZM19 17H5V12H19V17Z"}),xe.exports.createElement("path",{d:"M7.5 16C8.32843 16 9 15.3284 9 14.5C9 13.6716 8.32843 13 7.5 13C6.67157 13 6 13.6716 6 14.5C6 15.3284 6.67157 16 7.5 16Z"}),xe.exports.createElement("path",{d:"M16.5 16C17.3284 16 18 15.3284 18 14.5C18 13.6716 17.3284 13 16.5 13C15.6716 13 15 13.6716 15 14.5C15 15.3284 15.6716 16 16.5 16Z"}))},cr=function(e){return xe.exports.createElement("svg",Q({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10s10-4.47,10-10S17.53,2,12,2z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59 L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59z"}))},sr=Ee.div(L||(L=Z(["\n max-height: calc(100% - 2 * ",");\n border-radius: ",";\n box-shadow: ",";\n background-color: ",";\n border: 1px solid ",";\n padding: ",";\n"])),je["--ll-spacing-medium"],je["--ll-border-radius-medium"],je["--ll-shadow-small"],je["--ll-color-background"],je["--ll-color-border"],je["--ll-spacing-x-small"]),ur=Ee.div(E||(E=Z(["\n display: flex;\n justify-content: space-between;\n align-items: end;\n\n "," {\n // Adjust if text of commute transport mode changes\n width: 52%;\n margin-right: ",";\n }\n"])),ue,je["--ll-spacing-x-small"]),dr=Ee.div(I||(I=Z(["\n background-color: ",";\n padding: "," "," 0;\n border-radius: ",";\n"])),je["--ll-color-surface"],je["--ll-spacing-x-small"],je["--ll-spacing-small"],je["--ll-border-radius-medium"]),pr=Ee(tt)(j||(j=Z(["\n position: absolute;\n right: ",";\n top: ",";\n"])),je["--ll-spacing-xx-small"],je["--ll-spacing-xx-small"]),fr=function(e){var t,n,r,o,i=e.className,a=e.onClose,l=Oe().sdkState,c=rt(),s=c.setCommuteGeojson,u=c.destination,d=c.setDestination,p=Y(xe.exports.useState("pedestrian"),2),f=p[0],h=p[1],v=_t(),m=ze().translations,g=vn({destination:u,transportMode:f,origin:"".concat(null==l||null===(t=l.options)||void 0===t||null===(n=t.marker)||void 0===n?void 0:n.lat,",").concat(null==l||null===(r=l.options)||void 0===r||null===(o=r.marker)||void 0===o?void 0:o.lng),isOpen:!0}),y=g.data,b=g.isFetching,x=g.isFetched;xe.exports.useEffect((function(){null!=y&&y.summary&&s(Te.polyline.decode(y.polyline))}),[y]);var w={pedestrian:[m.WALKING,ar],car:[m.DRIVING,lr]},C=xe.exports.useMemo((function(){if(null==y||!y.summary)return null;var e=Math.floor(y.summary.typicalDuration/60/60),t=Math.floor(y.summary.typicalDuration/60%60);return 0===e?"".concat(t," ").concat(Re.pluralize(m.MINUTE,t)):"".concat(e," ").concat(Re.pluralize(m.HOUR,e)," ").concat(t," ").concat(Re.pluralize(m.MINUTE,t))}),[y]),M=xe.exports.useMemo((function(){if(null==y||!y.summary)return null;var e=Math.floor(y.summary.length/1e3);return 0===e?"".concat(y.summary.length," m"):"".concat(e," km")}),[y]);return Ne(sr,{className:i,children:[Ce(pr,{size:"medium",color:"neutral",onClick:a,SVGElement:cr}),Ne(ur,{children:[Ce(de,{label:m.CALCULATE_COMMUTE,placeholder:(null==u?void 0:u.label)||m.SEARCH_MAP,renderListAbove:v,renderListAbovePosition:30,onSearch:function(e){d({lat:e.latitude,lng:e.longitude})}}),Ce(Ue.Root,{value:f,onValueChange:function(e){h(e)},children:Ne(Ue.Trigger,{children:[Ce(qe,{SVGElement:w[f][1],fill:je["--ll-color-on-background-variant1"],width:16}),w[f][0],Ne(Ue.Content,{children:[Ce(Ue.Item,{value:"car",children:m.DRIVING}),Ce(Ue.Item,{value:"pedestrian",children:m.WALKING})]})]})})]}),(x||b)&&Ne(De,{children:[Ce(Ke,{vertical:!0,spacing:"--ll-spacing-x-small"}),Ce(pe,{open:!!y,children:b?Ce(Fe,{height:"70.4px",width:"100%"}):null!=y&&y.summary?Ne(dr,{children:[Ce(Xe,{variant:"h5",children:C}),Ne(Xe,{children:[M," – ",m.FAST_ROUTE]})]}):Ne(dr,{children:[Ce(Xe,{variant:"h5",children:m.NO_ROUTE}),Ce(Xe,{children:m.TRY_SUGGESTION})]})})]})]})},hr=Ee.div(_||(_=Z(["\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 3;\n"]))),vr=Ee.div(z||(z=Z(["\n position: absolute;\n top: ",";\n right: ",";\n z-index: 3;\n max-width: 356px;\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"]),mr=Ee(tt)(A||(A=Z(["\n box-shadow: ",";\n position: absolute;\n bottom: ",";\n right: ",";\n"])),je["--ll-shadow-medium"],je["--ll-spacing-medium"],je["--ll-spacing-medium"]),gr=Ee(fr)(T||(T=Z([""]))),yr=Ee(fr)(R||(R=Z(["\n border-radius: ","\n "," 0 0;\n border: 0;\n"])),je["--ll-border-radius-small"],je["--ll-border-radius-small"]),br=Ee(nt)(N||(N=Z(["\n box-shadow: ",";\n"])),je["--ll-shadow-small"]),xr=function(){var e=rt(),t=e.setCommuteGeojson,n=e.setDestination,r=e.showCommuteCalculator,o=e.setShowCommuteCalculator,i=ze().translations,a=function(){n(void 0),t(void 0),o(!1)},l=function(){o(!0)};return _t()?Ce(De,{children:r?Ce(hr,{children:Ce(yr,{onClose:a})}):Ce(mr,{size:"large",SVGElement:ir,onClick:l})}):Ce(vr,{children:r?Ce(gr,{onClose:a}):Ce(br,{onClick:l,startAdornment:Ce(ir,{}),children:i.CALCULATE_COMMUTE})})},wr=function(){var e,t,n,r=Oe(),o=r.sdkState,i=r.setSdkState,a=rt(),l=a.activeScore,c=a.activePOI,s=a.setActivePOI,u=a.hoveredPOI,d=a.commuteGeojson,p=a.destination,f=a.schoolCatchment,h=_t(),v=zt(),m=At(),g="night"===(null==o||null===(e=o.globalOptions)||void 0===e||null===(t=e.appearance)||void 0===t?void 0:t.theme)?"dd191599-2a92-49fc-9a33-e12391753ad5":"600d69cb-288d-445e-9839-3dfe4d76b31a",y={id:"point",type:"line",paint:{"line-width":6,"line-color":getComputedStyle(document.documentElement).getPropertyValue("--ll-color-link")}},b={id:"school",type:"line",source:"schoolCatchment",paint:{"line-width":3,"line-color":getComputedStyle(document.documentElement).getPropertyValue("--ll-color-on-background")}},x=Y(xe.exports.useState(!1),2),w=x[0],C=x[1],M=xe.exports.useMemo((function(){var e,t;return"high_schools"!==l&&"primary_schools"!==l||m.isFetching?Le&&l&&Le[l]&&null!==(e=Le[l])&&void 0!==e&&e.length||v.isFetching?v.data:X({},l,[]):X({},l,(null==m||null===(t=m.data)||void 0===t?void 0:t[l])||[])}),[v.data,m.data,l]),S=xe.exports.useMemo((function(){return M?Object.entries(M).map((function(e){var t=Y(e,2),n=t[0];return t[1].map((function(e){return pt([e.lng,e.lat],{poi:e,type:n})}))})).flat().filter((function(e,t,n){return n.findIndex((function(t){return["lat","lng","name"].every((function(n){return t.properties.poi[n]===e.properties.poi[n]}))}))===t})):[]}),[M]),k=xe.exports.useMemo((function(){var e,t,n,r=(null==o||null===(e=o.options)||void 0===e?void 0:e.marker)&&pt([null==o||null===(t=o.options)||void 0===t?void 0:t.marker.lng,null==o||null===(n=o.options)||void 0===n?void 0:n.marker.lat]);return[].concat(G(S),G(r?[r]:[]),G(p?[pt([null==p?void 0:p.lng,null==p?void 0:p.lat])]:[]))}),[S,null==o||null===(n=o.options)||void 0===n?void 0:n.marker,p]),O=xe.exports.useRef(),P=Y(fe(),2),L=P[0],E=P[1],I=xe.exports.useMemo((function(){return{top:25+E.height,bottom:25,left:25,right:25}}),[E.height]),j=xe.exports.useMemo((function(){return{top:50,bottom:50,left:E.width+32+50,right:50}}),[E.width]),_=h?I:j;return xe.exports.useEffect((function(){var e,t;if(k.length&&null!==(e=o.options)&&void 0!==e&&e.marker){var n,r,i,a=Y(vt((n=k.map((function(e){var t=e.geometry;return[t.coordinates[1],t.coordinates[0]]})),void 0===i&&(i={}),dt({type:"MultiPoint",coordinates:n},r,i))),4),l=a[0],c=a[1],s=a[2],u=a[3];null==O||null===(t=O.current)||void 0===t||t.fitBounds([[c,l],[u,s]],{maxZoom:17,padding:_,duration:1e3})}}),[k,_,f]),o.options?Ce(Nt,{mapRef:O,mapPadding:_,children:Ne(or,{children:[Ne(he,{ref:O,mapLib:ve,latitude:o.options.lat,longitude:o.options.lng,zoom:o.options.zoom,pitch:o.options.pitch,bearing:o.options.bearing,style:{flex:1,width:"100vw"},mapStyle:"https://api.maptiler.com/maps/".concat(g,"/style.json?key=","9jNGatuzs05Q1oNlctEs"),onMove:function(e){i(Q(Q({},o),{},{options:Q(Q({},o.options),{},{lat:e.viewState.latitude,lng:e.viewState.longitude,zoom:e.viewState.zoom,bearing:e.viewState.bearing,pitch:e.viewState.pitch})}))},cooperativeGestures:o.options.cooperativeGestures,onMoveStart:function(){return C(!0)},onMoveEnd:function(){return C(!1)},attributionControl:!1,children:[Ce(me,{compact:!0,position:h?"bottom-left":"bottom-right"}),Ce(ge,{position:h?"top-right":"bottom-right",showCompass:!0,style:{marginTop:h?16+E.height:16,marginRight:16}}),o.options.marker&&Ce(ye,{marker:o.options.marker}),Ce(bn,{rect:E,zoom:o.options.zoom,mapRef:O,points:S,isMobile:h,activePOI:c,hoveredPOI:u,isMapMoving:w,setActivePOI:s}),Ce(h?An:rr,{ref:L}),Ce(xr,{}),p&&Ce(ye,{marker:Q({icon:"pin"},p)}),d&&Ce(ct,{type:"geojson",data:d,children:Ce(ut,Q({},y))}),f&&Ce(ct,{type:"geojson",data:f,children:Ce(ut,Q({},b))})]}),h&&Ce(nr,{})]})}):Ce("div",{children:"No options provided."})};D("default",(function(){return Ce(it,{children:Ce(wr,{})})}))}}}))}();
|
|
1
|
+
!function(){var e,t,n,r,o,i,a,l,c,s,u,d,p,f,h,v,m,g,y,b,x,w,C,M,S,O,k,P,L,E,I,j,_,A,z,T,R,N;function G(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||q(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function H(e,t,n){return t&&V(e.prototype,t),n&&V(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function F(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */F=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(k){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof d?t:d,i=Object.create(o.prototype),a=new M(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return O()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=x(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(k){return{type:"throw",arg:k}}}e.wrap=c;var u={};function d(){}function p(){}function f(){}var h={};l(h,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==t&&n.call(m,o)&&(h=m);var g=f.prototype=d.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(o,i,a,l){var c=s(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==W(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=f,l(g,"constructor",f),l(f,"constructor",p),p.displayName=l(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(b.prototype),l(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(g),l(g,a,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function U(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(s){return void n(s)}l.done?t(c):Promise.resolve(c).then(r,o)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){U(i,r,o,a,l,"next",e)}function l(e){U(i,r,o,a,l,"throw",e)}a(void 0)}))}}function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function Y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=q(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(c){l=!0,o=c}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}(e,t)||q(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){if(e){if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach((function(t){J(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}System.register(["./index-legacy.eaf5a83c.js","./index-legacy.66e8a364.js"],(function(V,U){"use strict";var q,K,Q,ee,te,ne,re,oe,ie,ae,le,ce,se,ue,de,pe,fe,he,ve,me,ge,ye,be,xe,we,Ce,Me,Se,Oe,ke,Pe,Le,Ee,Ie,je,_e,Ae,ze,Te,Re,Ne,Ge,Ze,De,Ve,He,Fe,Ue,Be,We,Ye,$e,qe,Ke,Qe,Xe,Je,et,tt,nt;return{setters:[function(e){q=e.M,K=e.d,Q=e.u,ee=e.p,te=e.s,ne=e.a,re=e.b,oe=e.$,ie=e.c,ae=e.e,le=e.f,ce=e.S,se=e.g,ue=e.h,de=e.i,pe=e.A,fe=e.j,he=e.k,ve=e.m,me=e.l,ge=e.N,ye=e.P},function(e){be=e.R,xe=e.r,we=e.Z,Ce=e.j,Me=e.O,Se=e.c,Oe=e._,ke=e.u,Pe=e.a,Le=e.S,Ee=e.s,Ie=e.m,je=e.y,_e=e.b,Ae=e.d,ze=e.C,Te=e.w,Re=e.I,Ne=e.e,Ge=e.f,Ze=e.g,De=e.o,Ve=e.F,He=e.P,Fe=e.h,Ue=e.n,Be=e.L,We=e.k,Ye=e.i,$e=e.M,qe=e.q,Ke=e.T,Qe=e.l,Xe=e.A,Je=e.p,et=e.t,tt=e.Q,nt=e.v}],execute:function(){var U=be.createContext({}),rt=function(){return xe.exports.useContext(U)},ot=function(e,t){switch(t.type){case"CATEGORY":return X(X({},e),{},{activeCategory:t.value});case"SCORE":var n=Me.find((function(n){return""===t.value?n.value===e.activeCategory:n.scores.includes(t.value)})).value;return{activeCategory:n,activeScoreByCategory:X(X({},e.activeScoreByCategory),{},J({},n,t.value))}}},it=function(e){var t=e.children,n=window.innerWidth<we.screenSizes.tablet?{activeCategory:"commute",activeScoreByCategory:{commute:"transit_friendly",amenities:"groceries",character:"quiet",nature:"parks",education:"primary_schools"}}:{activeCategory:"commute",activeScoreByCategory:{commute:"",amenities:"",character:"",nature:"",education:""}},r=$(xe.exports.useReducer(ot,n),2),o=r[0],i=r[1],a=$(xe.exports.useState(),2),l=a[0],c=a[1],s=$(xe.exports.useState(),2),u=s[0],d=s[1],p=$(xe.exports.useState(),2),f=p[0],h=p[1],v=$(xe.exports.useState(),2),m=v[0],g=v[1],y=$(xe.exports.useState(),2),b=y[0],x=y[1],w=$(xe.exports.useState(!1),2),C=w[0],M=w[1],S=o.activeCategory,O=o.activeScoreByCategory[S],k=function(e){i({type:"SCORE",value:e})},P=function(e){i({type:"CATEGORY",value:e})},L=xe.exports.useMemo((function(){return{activeScore:O,setActiveScore:k,activeCategory:S,setActiveCategory:P,activePOI:l,setActivePOI:c,hoveredPOI:u,setHoveredPOI:d,commuteGeojson:f,setCommuteGeojson:h,destination:b,setDestination:x,showCommuteCalculator:C,setShowCommuteCalculator:M,schoolCatchment:m,setSchoolCatchment:g}}),[O,k,S,P,l,c,u,d,f,h,b,x,C,M,m,g]);return Ce(U.Provider,{value:L,children:t})};function at(e,t){if(!e)throw new Error(t)}var lt=0;function ct(e){var t=xe.exports.useContext(q).map.getMap(),n=xe.exports.useRef(e),r=$(xe.exports.useState(0),2)[1],o=xe.exports.useMemo((function(){return e.id||"jsx-source-".concat(lt++)}),[]);xe.exports.useEffect((function(){if(t){var e=function(){return r((function(e){return e+1}))};return t.on("styledata",e),e(),function(){var n;if(t.off("styledata",e),t.style&&t.style._loaded&&t.getSource(o)){var r=null===(n=t.getStyle())||void 0===n?void 0:n.layers;if(r){var i,a=Y(r);try{for(a.s();!(i=a.n()).done;){var l=i.value;l.source===o&&t.removeLayer(l.id)}}catch(c){a.e(c)}finally{a.f()}}t.removeSource(o)}}}}),[t]);var i=t&&t.style&&t.getSource(o);return i?function(e,t,n){at(t.id===n.id,"source id changed"),at(t.type===n.type,"source type changed");var r="",o=0;for(var i in t)"children"===i||"id"===i||K(n[i],t[i])||(r=i,o++);if(o){var a=t.type;if("geojson"===a)e.setData(t.data);else if("image"===a)e.updateImage({url:t.url,coordinates:t.coordinates});else if("canvas"!==a&&"video"!==a||1!==o||"coordinates"!==r)if("vector"===a&&"setUrl"in e)switch(r){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles)}else console.warn("Unable to update <Source> prop: ".concat(r));else e.setCoordinates(t.coordinates)}}(i,e,n.current):i=function(e,t,n){if(e.style&&e.style._loaded){var r=X({},n);return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}(t,o,e),n.current=e,i&&xe.exports.Children.map(e.children,(function(e){return e&&xe.exports.cloneElement(e,{source:o})}))||null}var st=0;function ut(e){var t=xe.exports.useContext(q).map.getMap(),n=xe.exports.useRef(e),r=$(xe.exports.useState(0),2)[1],o=xe.exports.useMemo((function(){return e.id||"jsx-layer-".concat(st++)}),[]);if(xe.exports.useEffect((function(){if(t){var e=function(){return r((function(e){return e+1}))};return t.on("styledata",e),e(),function(){t.off("styledata",e),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}}),[t]),t&&t.style&&t.getLayer(o))try{!function(e,t,n,r){if(at(n.id===r.id,"layer id changed"),at(n.type===r.type,"layer type changed"),"custom"!==n.type&&"custom"!==r.type){var o=n.layout,i=void 0===o?{}:o,a=n.paint,l=void 0===a?{}:a,c=n.filter,s=n.minzoom,u=n.maxzoom,d=n.beforeId;if(d!==r.beforeId&&e.moveLayer(t,d),i!==r.layout){var p=r.layout||{};for(var f in i)K(i[f],p[f])||e.setLayoutProperty(t,f,i[f]);for(var h in p)i.hasOwnProperty(h)||e.setLayoutProperty(t,h,void 0)}if(l!==r.paint){var v=r.paint||{};for(var m in l)K(l[m],v[m])||e.setPaintProperty(t,m,l[m]);for(var g in v)l.hasOwnProperty(g)||e.setPaintProperty(t,g,void 0)}K(c,r.filter)||e.setFilter(t,c),s===r.minzoom&&u===r.maxzoom||e.setLayerZoomRange(t,s,u)}}(t,o,e,n.current)}catch(i){console.warn(i)}else!function(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){var r=X(X({},n),{},{id:t});delete r.beforeId,e.addLayer(r,n.beforeId)}}(t,o,e);return n.current=e,null}function dt(e,t,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function pt(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ft(e[0])||!ft(e[1]))throw new Error("coordinates must contain numbers");return dt({type:"Point",coordinates:e},t,n)}function ft(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function ht(e,t,n){if(null!==e)for(var r,o,i,a,l,c,s,u,d=0,p=0,f=e.type,h="FeatureCollection"===f,v="Feature"===f,m=h?e.features.length:1,g=0;g<m;g++){l=(u=!!(s=h?e.features[g].geometry:v?e.geometry:e)&&"GeometryCollection"===s.type)?s.geometries.length:1;for(var y=0;y<l;y++){var b=0,x=0;if(null!==(a=u?s.geometries[y]:s)){c=a.coordinates;var w=a.type;switch(d=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(c,p,g,b,x))return!1;p++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(!1===t(c[r],p,g,b,x))return!1;p++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-d;o++){if(!1===t(c[r][o],p,g,b,x))return!1;p++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(x=0,o=0;o<c[r].length;o++){for(i=0;i<c[r][o].length-d;i++){if(!1===t(c[r][o][i],p,g,b,x))return!1;p++}x++}b++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===ht(a.geometries[r],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function vt(e){var t=[1/0,1/0,-1/0,-1/0];return ht(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}vt.default=vt;var mt=/^\s+|\s+$/g,gt=/^[-+]0x[0-9a-f]+$/i,yt=/^0b[01]+$/i,bt=/^0o[0-7]+$/i,xt=parseInt,wt="object"==W(Se)&&Se&&Se.Object===Object&&Se,Ct="object"==("undefined"==typeof self?"undefined":W(self))&&self&&self.Object===Object&&self,Mt=wt||Ct||Function("return this")(),St=Object.prototype.toString,Ot=Math.max,kt=Math.min,Pt=function(){return Mt.Date.now()};function Lt(e){var t=W(e);return!!e&&("object"==t||"function"==t)}function Et(e){return"symbol"==W(e)||function(e){return!!e&&"object"==W(e)}(e)&&"[object Symbol]"==St.call(e)}function It(e){if("number"==typeof e)return e;if(Et(e))return NaN;if(Lt(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Lt(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(mt,"");var n=yt.test(e);return n||bt.test(e)?xt(e.slice(2),n?2:8):gt.test(e)?NaN:+e}var jt=function(e,t,n){var r,o,i,a,l,c,s=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=o;return r=o=void 0,s=t,a=e.apply(i,n)}function h(e){return s=e,l=setTimeout(m,t),u?f(e):a}function v(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-s>=i}function m(){var e=Pt();if(v(e))return g(e);l=setTimeout(m,function(e){var n=t-(e-c);return d?kt(n,i-(e-s)):n}(e))}function g(e){return l=void 0,p&&r?f(e):(r=o=void 0,a)}function y(){var e=Pt(),n=v(e);if(r=arguments,o=this,c=e,n){if(void 0===l)return h(c);if(d)return l=setTimeout(m,t),f(c)}return void 0===l&&(l=setTimeout(m,t)),a}return t=It(t)||0,Lt(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Ot(It(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==l&&clearTimeout(l),s=0,r=c=o=l=void 0},y.flush=function(){return void 0===l?a:g(Pt())},y},_t=function(){var e=$(xe.exports.useState(!1),2),t=e[0],n=e[1];return xe.exports.useLayoutEffect((function(){var e=function(){n(window.innerWidth<we.screenSizes.tablet)};return window.addEventListener("resize",jt(e,250)),e(),function(){return window.removeEventListener("resize",e)}}),[]),t};function At(){var e,t=Oe().client,n=ke().sdkState,r=Pe(n.options,250),o=rt().activeScore,i=o?Le[o]:void 0,a=X(X({},xe.exports.useMemo((function(){return!(null==r||!r.marker)?r.marker:{lat:null==r?void 0:r.lat,lng:null==r?void 0:r.lng}}),[r])),{},{limit:10,radius:2e3,include:i});return Q(ee.list(a),B(F().mark((function e(){return F().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.getPois(a));case 1:case"end":return e.stop()}}),e)}))),{enabled:!!(a&&null!==(e=a.include)&&void 0!==e&&e.length&&a.lat&&a.lng)})}function zt(){var e=Oe().client,t=ke().sdkState,n=Pe(t.options,250),r=rt().activeScore,o="high_schools"===r||"primary_schools"===r,i=X(X({},xe.exports.useMemo((function(){return!(null==n||!n.marker)?n.marker:{lat:null==n?void 0:n.lat,lng:null==n?void 0:n.lng}}),[n])),{},{limit:10,radius:2e3,include_catchments:!1});return Q(te.list(i),B(F().mark((function t(){return F().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.getSchools(i));case 1:case"end":return t.stop()}}),t)}))),{enabled:!!i&&!!i.lat&&!!i.lng&&o})}var Tt=be.createContext({}),Rt=function(){return xe.exports.useContext(Tt)},Nt=function(e){var t=e.children,n=e.mapRef,r=e.mapPadding;return Ce(Tt.Provider,{value:{mapRef:n,mapPadding:r},children:t})};function Gt(e,t,n,r,o,i){if(!(o-r<=n)){var a=r+o>>1;Zt(e,t,a,r,o,i%2),Gt(e,t,n,r,a-1,i+1),Gt(e,t,n,a+1,o,i+1)}}function Zt(e,t,n,r,o,i){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,c=Math.log(a),s=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*s*(a-s)/a)*(l-a/2<0?-1:1);Zt(e,t,n,Math.max(r,Math.floor(n-l*s/a+u)),Math.min(o,Math.floor(n+(a-l)*s/a+u)),i)}var d=t[2*n+i],p=r,f=o;for(Dt(e,t,r,n),t[2*o+i]>d&&Dt(e,t,r,o);p<f;){for(Dt(e,t,p,f),p++,f--;t[2*p+i]<d;)p++;for(;t[2*f+i]>d;)f--}t[2*r+i]===d?Dt(e,t,r,f):Dt(e,t,++f,o),f<=n&&(r=f+1),n<=f&&(o=f-1)}}function Dt(e,t,n,r){Vt(e,n,r),Vt(t,2*n,2*r),Vt(t,2*n+1,2*r+1)}function Vt(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Ht(e,t,n,r){var o=e-n,i=t-r;return o*o+i*i}var Ft,Ut=function(e){return e[0]},Bt=function(e){return e[1]},Wt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ut,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Float64Array;D(this,e),this.nodeSize=o,this.points=t;for(var a=t.length<65536?Uint16Array:Uint32Array,l=this.ids=new a(t.length),c=this.coords=new i(2*t.length),s=0;s<t.length;s++)l[s]=s,c[2*s]=n(t[s]),c[2*s+1]=r(t[s]);Gt(l,c,o,0,l.length-1,0)}return H(e,[{key:"range",value:function(e,t,n,r){return function(e,t,n,r,o,i,a){for(var l,c,s=[0,e.length-1,0],u=[];s.length;){var d=s.pop(),p=s.pop(),f=s.pop();if(p-f<=a)for(var h=f;h<=p;h++)l=t[2*h],c=t[2*h+1],l>=n&&l<=o&&c>=r&&c<=i&&u.push(e[h]);else{var v=Math.floor((f+p)/2);l=t[2*v],c=t[2*v+1],l>=n&&l<=o&&c>=r&&c<=i&&u.push(e[v]);var m=(d+1)%2;(0===d?n<=l:r<=c)&&(s.push(f),s.push(v-1),s.push(m)),(0===d?o>=l:i>=c)&&(s.push(v+1),s.push(p),s.push(m))}}return u}(this.ids,this.coords,e,t,n,r,this.nodeSize)}},{key:"within",value:function(e,t,n){return function(e,t,n,r,o,i){for(var a=[0,e.length-1,0],l=[],c=o*o;a.length;){var s=a.pop(),u=a.pop(),d=a.pop();if(u-d<=i)for(var p=d;p<=u;p++)Ht(t[2*p],t[2*p+1],n,r)<=c&&l.push(e[p]);else{var f=Math.floor((d+u)/2),h=t[2*f],v=t[2*f+1];Ht(h,v,n,r)<=c&&l.push(e[f]);var m=(s+1)%2;(0===s?n-o<=h:r-o<=v)&&(a.push(d),a.push(f-1),a.push(m)),(0===s?n+o>=h:r+o>=v)&&(a.push(f+1),a.push(u),a.push(m))}}return l}(this.ids,this.coords,e,t,n,this.nodeSize)}}]),e}(),Yt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},$t=Math.fround||(Ft=new Float32Array(1),function(e){return Ft[0]=+e,Ft[0]}),qt=function(){function e(t){D(this,e),this.options=rn(Object.create(Yt),t),this.trees=new Array(this.options.maxZoom+1)}return H(e,[{key:"load",value:function(e){var t=this.options,n=t.log,r=t.minZoom,o=t.maxZoom,i=t.nodeSize;n&&console.time("total time");var a="prepare ".concat(e.length," points");n&&console.time(a),this.points=e;for(var l=[],c=0;c<e.length;c++)e[c].geometry&&l.push(Qt(e[c],c));this.trees[o+1]=new Wt(l,on,an,i,Float32Array),n&&console.timeEnd(a);for(var s=o;s>=r;s--){var u=+Date.now();l=this._cluster(l,s),this.trees[s]=new Wt(l,on,an,i,Float32Array),n&&console.log("z%d: %d clusters in %dms",s,l.length,+Date.now()-u)}return n&&console.timeEnd("total time"),this}},{key:"getClusters",value:function(e,t){var n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),o=180===e[2]?180:((e[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){var a=this.getClusters([n,r,180,i],t),l=this.getClusters([-180,r,o,i],t);return a.concat(l)}var c,s=this.trees[this._limitZoom(t)],u=[],d=Y(s.range(en(n),tn(i),en(o),tn(r)));try{for(d.s();!(c=d.n()).done;){var p=c.value,f=s.points[p];u.push(f.numPoints?Xt(f):this.points[f.index])}}catch(h){d.e(h)}finally{d.f()}return u}},{key:"getChildren",value:function(e){var t=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(r);var i=o.points[t];if(!i)throw new Error(r);var a,l=this.options.radius/(this.options.extent*Math.pow(2,n-1)),c=[],s=Y(o.within(i.x,i.y,l));try{for(s.s();!(a=s.n()).done;){var u=a.value,d=o.points[u];d.parentId===e&&c.push(d.numPoints?Xt(d):this.points[d.index])}}catch(p){s.e(p)}finally{s.f()}if(0===c.length)throw new Error(r);return c}},{key:"getLeaves",value:function(e,t,n){t=t||10,n=n||0;var r=[];return this._appendLeaves(r,e,t,n,0),r}},{key:"getTile",value:function(e,t,n){var r=this.trees[this._limitZoom(e)],o=Math.pow(2,e),i=this.options,a=i.extent,l=i.radius/a,c=(n-l)/o,s=(n+1+l)/o,u={features:[]};return this._addTileFeatures(r.range((t-l)/o,c,(t+1+l)/o,s),r.points,t,n,o,u),0===t&&this._addTileFeatures(r.range(1-l/o,c,1,s),r.points,o,n,o,u),t===o-1&&this._addTileFeatures(r.range(0,c,l/o,s),r.points,-1,n,o,u),u.features.length?u:null}},{key:"getClusterExpansionZoom",value:function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t}},{key:"_appendLeaves",value:function(e,t,n,r,o){var i,a=Y(this.getChildren(t));try{for(a.s();!(i=a.n()).done;){var l=i.value,c=l.properties;if(c&&c.cluster?o+c.point_count<=r?o+=c.point_count:o=this._appendLeaves(e,c.cluster_id,n,r,o):o<r?o++:e.push(l),e.length===n)break}}catch(s){a.e(s)}finally{a.f()}return o}},{key:"_addTileFeatures",value:function(e,t,n,r,o,i){var a,l=Y(e);try{for(l.s();!(a=l.n()).done;){var c=t[a.value],s=c.numPoints,u=void 0,d=void 0,p=void 0;if(s)u=Jt(c),d=c.x,p=c.y;else{var f=this.points[c.index];u=f.properties,d=en(f.geometry.coordinates[0]),p=tn(f.geometry.coordinates[1])}var h={type:1,geometry:[[Math.round(this.options.extent*(d*o-n)),Math.round(this.options.extent*(p*o-r))]],tags:u},v=void 0;s?v=c.id:this.options.generateId?v=c.index:this.points[c.index].id&&(v=this.points[c.index].id),void 0!==v&&(h.id=v),i.features.push(h)}}catch(m){l.e(m)}finally{l.f()}}},{key:"_limitZoom",value:function(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}},{key:"_cluster",value:function(e,t){for(var n=[],r=this.options,o=r.radius,i=r.extent,a=r.reduce,l=r.minPoints,c=o/(i*Math.pow(2,t)),s=0;s<e.length;s++){var u=e[s];if(!(u.zoom<=t)){u.zoom=t;var d,p=this.trees[t+1],f=p.within(u.x,u.y,c),h=u.numPoints||1,v=h,m=Y(f);try{for(m.s();!(d=m.n()).done;){var g=d.value,y=p.points[g];y.zoom>t&&(v+=y.numPoints||1)}}catch(_){m.e(_)}finally{m.f()}if(v>h&&v>=l){var b,x=u.x*h,w=u.y*h,C=a&&h>1?this._map(u,!0):null,M=(s<<5)+(t+1)+this.points.length,S=Y(f);try{for(S.s();!(b=S.n()).done;){var O=b.value,k=p.points[O];if(!(k.zoom<=t)){k.zoom=t;var P=k.numPoints||1;x+=k.x*P,w+=k.y*P,k.parentId=M,a&&(C||(C=this._map(u,!0)),a(C,this._map(k)))}}}catch(_){S.e(_)}finally{S.f()}u.parentId=M,n.push(Kt(x/v,w/v,M,v,C))}else if(n.push(u),v>1){var L,E=Y(f);try{for(E.s();!(L=E.n()).done;){var I=L.value,j=p.points[I];j.zoom<=t||(j.zoom=t,n.push(j))}}catch(_){E.e(_)}finally{E.f()}}}}return n}},{key:"_getOriginId",value:function(e){return e-this.points.length>>5}},{key:"_getOriginZoom",value:function(e){return(e-this.points.length)%32}},{key:"_map",value:function(e,t){if(e.numPoints)return t?rn({},e.properties):e.properties;var n=this.points[e.index].properties,r=this.options.map(n);return t&&r===n?rn({},r):r}}]),e}();function Kt(e,t,n,r,o){return{x:$t(e),y:$t(t),zoom:1/0,id:n,parentId:-1,numPoints:r,properties:o}}function Qt(e,t){var n=$(e.geometry.coordinates,2),r=n[0],o=n[1];return{x:$t(en(r)),y:$t(tn(o)),zoom:1/0,index:t,parentId:-1}}function Xt(e){return{type:"Feature",id:e.id,properties:Jt(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),nn(e.y)]}};var t}function Jt(e){var t=e.numPoints,n=t>=1e4?"".concat(Math.round(t/1e3),"k"):t>=1e3?"".concat(Math.round(t/100)/10,"k"):t;return rn(rn({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function en(e){return e/360+.5}function tn(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function nn(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function rn(e,t){for(var n in t)e[n]=t[n];return e}function on(e){return e.x}function an(e){return e.y}var ln=Object.prototype.hasOwnProperty;function cn(e,t,n){var r,o=Y(e.keys());try{for(o.s();!(r=o.n()).done;)if(sn(n=r.value,t))return n}catch(i){o.e(i)}finally{o.f()}}function sn(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&sn(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;var i,a=Y(e);try{for(a.s();!(i=a.n()).done;){if((o=r=i.value)&&"object"===W(o)&&!(o=cn(t,o)))return!1;if(!t.has(o))return!1}}catch(s){a.e(s)}finally{a.f()}return!0}if(n===Map){if(e.size!==t.size)return!1;var l,c=Y(e);try{for(c.s();!(l=c.n()).done;){if((o=(r=l.value)[0])&&"object"===W(o)&&!(o=cn(t,o)))return!1;if(!sn(r[1],t.get(o)))return!1}}catch(s){c.e(s)}finally{c.f()}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"===W(e)){for(n in r=0,e){if(ln.call(e,n)&&++r&&!ln.call(t,n))return!1;if(!(n in t)||!sn(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function un(e,t){return xe.exports.useEffect(e,(n=t,r=xe.exports.useRef(n),o=xe.exports.useRef(0),sn(n,r.current)||(r.current=n,o.current+=1),xe.exports.useMemo((function(){return r.current}),[o.current])));var n,r,o}var dn=Ee(Ie.div)(e||(e=Z(["\n border-radius: 50%;\n background: linear-gradient(\n to top,\n ",",\n ","\n );\n color: ",";\n height: ","px;\n width: ","px;\n display: flex;\n justify-content: center;\n align-items: center;\n line-height: 1;\n font-family: ",";\n font-size: ","px;\n border: 2px solid #fff;\n box-shadow: ",";\n cursor: default;\n"])),je["--ll-color-primary-variant1"],je["--ll-color-primary"],je["--ll-color-on-primary"],(function(e){return e.diameter}),(function(e){return e.diameter}),je["--ll-font-family"],(function(e){return e.diameter/2.5}),je["--ll-shadow-small"]),pn=Ee.ul(t||(t=Z(["\n list-style: none;\n padding: 0;\n margin: 0;\n"]))),fn=Ee.li(n||(n=Z(["\n font-family: ",";\n padding: ",";\n background-color: ",";\n border-radius: ",";\n border: 1px solid ",";\n cursor: default;\n\n &:not(:last-child) {\n margin-bottom: ",";\n }\n\n &:hover {\n background-color: ",";\n }\n"])),je["--ll-font-family"],je["--ll-spacing-x-small"],je["--ll-color-background"],je["--ll-border-radius-small"],je["--ll-color-border"],je["--ll-spacing-xx-small"],je["--ll-color-surface"]),hn={all:function(){return["commute-calculator"]},list:function(e){return[].concat(G(hn.all()),[e])}};function vn(e){var t=e.transportMode,n=e.origin,r=e.destination,o=e.isOpen,i={return:"polyline,summary,typicalDuration",transportMode:t,origin:n,destination:"".concat(null==r?void 0:r.lat,",").concat(null==r?void 0:r.lng),apiKey:"KDL0aAzsbOcv7p53P2ovno2izfDOe93hyzZRrayktbE"};return Q(hn.list(i),(function(){return fetch("https://router.hereapi.com/v8/routes?"+new URLSearchParams(i)).then((function(e){return e.json()})).then((function(e){return e.routes.length>0&&e.routes[0].sections.length>0?e.routes[0].sections[0]:[]})).catch((function(e){_e(e)}))}),{enabled:!!i&&!!r&&!!n&&o})}var mn=function(e){var t,n,r,o,i=e.poi,a=e.poiType,l=e.rect,c=e.activePOI,s=e.hoveredPOI,u=e.isMapMoving,d=e.setActivePOI,p=e.isMobile,f=$(xe.exports.useState(!1),2),h=f[0],v=f[1],m=s===i,g=Ae().translations,y=ke().sdkState,b=rt(),x=b.setCommuteGeojson,w=b.setDestination,C=b.setShowCommuteCalculator,M=b.setSchoolCatchment,S=vn({destination:{lat:i.lat,lng:i.lng},transportMode:"pedestrian",origin:"".concat(null==y||null===(t=y.options)||void 0===t||null===(n=t.marker)||void 0===n?void 0:n.lat,",").concat(null==y||null===(r=y.options)||void 0===r||null===(o=r.marker)||void 0===o?void 0:o.lng),isOpen:h}).data;xe.exports.useEffect((function(){if(v(c===i),c===i){var e="high_schools"===a||"primary_schools"===a?"school":"poi";ze.poi.isSchool(i,e)&&null!=i&&i.catchments&&Object.keys((null==i?void 0:i.catchments)||[]).length>0&&M(Te.formatGeometry.formatGeometry(i.catchments[0].geometry))}}),[c,i]);var O=xe.exports.useMemo((function(){if(null==S||!S.summary||!h)return null;var e=Math.floor(S.summary.typicalDuration/60/60),t=Math.floor(S.summary.typicalDuration/60%60);return 0===e?"".concat(t," ").concat(Re.pluralize(g.MINUTE,t)):"".concat(e," ").concat(Re.pluralize(g.HOUR,e)," ").concat(t," ").concat(Re.pluralize(g.MINUTE,t))}),[S,h]);return Ce(ne,{latitude:i.lat,longitude:i.lng,style:{zIndex:h?1:0},children:Ne(Ge.Root,{options:{type:a,poi:i,isOpen:!u&&h,isHovered:m,side:"top",size:["rapid_transit_stations"].includes(a)?"medium":"small",collisionPadding:p?{top:l.height+32,bottom:2*Ze,left:2*Ze,right:2*Ze}:{left:l.width+32,right:2*Ze,top:2*Ze,bottom:2*Ze},walkingTime:O,calculateRoute:function(){null!=S&&S.summary&&h&&(w({label:i.name,lat:i.lat,lng:i.lng}),x(Te.polyline.decode(S.polyline)),C(!0),v(!1))}},onChange:function(e){"open-change"===e.type&&(e.data?setTimeout((function(){d(i)}),0):h&&(d(void 0),M()))},children:[Ce(Ge.Marker,{}),Ce(Ge.Content,{})]})})},gn={default:{scale:1},hovered:{scale:1.2}},yn=function(e){var t=e.cluster,n=e.supercluster,r=e.pointsCount,o=e.onClick,i=e.zoom,a=e.activePOI,l=e.hoveredPOI,c=e.setActivePOI,s=e.rect,u=e.isMobile,d=e.isMapMoving,p=$(xe.exports.useState(!1),2),f=p[0],h=p[1],v=20+t.properties.point_count/r*25,m=xe.exports.useMemo((function(){return null==n?void 0:n.getChildren(t.id).map((function(e){return e.properties})).filter((function(e){return!!e}))}),[n,t]),g=null==m?void 0:m.find((function(e){return!!a&&e.poi===a}));return g?Ce(mn,{rect:s,poi:g.poi,poiType:g.type,isMobile:u,activePOI:a,hoveredPOI:l,isMapMoving:d,setActivePOI:c}):Ne(De.Root,{open:!d&&f,onOpenChange:function(e){i<=17||h(e)},children:[Ce(De.Trigger,{children:Ce(dn,{diameter:v,onClick:function(){i>17?h(!0):o&&o(t)},variants:gn,animate:f?"hovered":"default",whileHover:{scale:1.2},transition:we.transitions.default,children:t.properties.point_count})}),Ce(De.Content,{side:"top",children:Ce(pn,{children:null==m?void 0:m.map((function(e,t){var n;return Ce(fn,{onClick:function(){return c(e.poi)},children:null===(n=e.poi)||void 0===n?void 0:n.name},t)}))})})]})};var bn=be.memo((function(e){var t,n=e.rect,r=e.zoom,o=e.mapRef,i=e.points,a=e.isMobile,l=e.activePOI,c=e.hoveredPOI,s=e.isMapMoving,u=e.setActivePOI,d=null==o||null===(t=o.current)||void 0===t?void 0:t.getMap().getBounds().toArray().flat(),p=function(e){var t=e.points,n=e.bounds,r=e.zoom,o=e.options,i=xe.exports.useRef(),a=xe.exports.useRef(),l=xe.exports.useState([]),c=l[0],s=l[1],u=Math.round(r);return un((function(){i.current&&sn(a.current,t)&&sn(i.current.options,o)||(i.current=new qt(o),i.current.load(t)),n&&s(i.current.getClusters(n,u)),a.current=t}),[t,n,u,o]),{clusters:c,supercluster:i.current}}({points:i,bounds:d,zoom:r,options:{radius:50,maxZoom:30}}),f=p.clusters,h=p.supercluster;return Ce(Ve,{children:f.map((function(e,t){var d=$(e.geometry.coordinates,2),p=d[0],f=d[1];return function(e){return void 0!==e.properties.cluster}(e)?Ce(ne,{latitude:f,longitude:p,children:Ce(yn,{rect:n,zoom:r,cluster:e,supercluster:h,pointsCount:i.length,activePOI:l,setActivePOI:u,isMobile:a,isMapMoving:s,hoveredPOI:c,onClick:function(){var t,n=Math.min(h.getClusterExpansionZoom(e.id),20);null===(t=o.current)||void 0===t||t.flyTo({zoom:n,center:[p,f],duration:1e3,essential:!0})}})},"cluster-".concat(e.id)):Ce(mn,{rect:n,poi:e.properties.poi,poiType:e.properties.type,isMobile:a,activePOI:l,hoveredPOI:c,isMapMoving:s,setActivePOI:u},t)}))})}));bn.displayName="Markers";var xn=function(e){return xe.exports.createElement("svg",X({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2ZM12 11.5C10.62 11.5 9.5 10.38 9.5 9C9.5 7.62 10.62 6.5 12 6.5C13.38 6.5 14.5 7.62 14.5 9C14.5 10.38 13.38 11.5 12 11.5Z"}))},wn=function(e){return xe.exports.createElement("svg",X({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"}))};function Cn(e){var t=Oe().client,n=ke().sdkState,r=Pe(n.options,250),o=X(X({},xe.exports.useMemo((function(){return!(null==r||!r.marker)?r.marker:{lat:null==r?void 0:r.lat,lng:null==r?void 0:r.lng}}),[r])),{},{geographyLevels:["20","30"],locationScoresRounding:!1,include:e});return Q(re.list(o),B(F().mark((function e(){return F().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.getScores(o));case 1:case"end":return e.stop()}}),e)}))),{enabled:!!o})}var Mn=Ee.div(r||(r=Z(["\n padding: "," ",";\n background-color: ",";\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex: 1;\n"])),je["--ll-spacing-small"],je["--ll-spacing-medium"],je["--ll-color-surface"]),Sn=Ee.div(o||(o=Z(["\n display: grid;\n grid-template-columns: min-content 1fr;\n grid-gap: ",";\n margin-bottom: ",";\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"]),On=function(){var e,t,n=ke().sdkState,r=rt(),o=r.activeCategory,i=r.activeScore,a=Cn(Me.find((function(e){return e.value===o})).scores),l=a.data,c=a.isLoading;return i&&null!=l&&l.location[i]?c?Ce("div",{children:"Loading"}):Ce(He.Root,{options:{score:i,scoresData:l},children:Ne(Mn,{children:[Ne(Sn,{children:[Ce(He.Badge,{}),Ce(He.BarChart,{options:{locationIcon:"pin"===(null===(e=n.options)||void 0===e||null===(t=e.marker)||void 0===t?void 0:t.icon)?xn:wn}})]}),Ce(He.Description,{})]})}):null},kn=Ee.div(i||(i=Z(["\n display: flex;\n overflow-x: scroll;\n padding: "," ",";\n flex-shrink: 0;\n position: relative;\n"])),je["--ll-spacing-x-small"],je["--ll-spacing-medium"]),Pn=Ee.button(a||(a=Z(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n background: none;\n border: none;\n min-width: 60px;\n padding: 0;\n margin: 0 8px;\n flex-shrink: 0;\n\n &:first-child {\n margin-left: 0;\n }\n\n &:last-child {\n margin-right: 0;\n }\n"]))),Ln=Ee.div(l||(l=Z(["\n position: absolute;\n top: -6px;\n right: 4px;\n border: 2px solid ",";\n border-radius: 6px;\n"])),je["--ll-color-background"]),En=Ee.div(c||(c=Z(["\n flex: 1;\n display: flex;\n align-items: center;\n"]))),In=Ee.div(s||(s=Z(["\n margin: 0 2px;\n"]))),jn=function(e){var t=e.category,n=Cn(t.scores),r=n.data,o=n.isLoading,i=n.isFetching,a=rt(),l=a.activeScore,c=a.setActiveScore,s=a.setActiveCategory;return Ce(kn,{children:t.scores.map((function(e){var n=e===l,a=n?"--ll-color-primary":"--ll-color-disabled";return o||i?Ce(In,{children:Ce(Fe,{height:"44px",width:"60px"})},e):Ce(He.Root,{options:{score:e,scoresData:r},children:Ne(Pn,{onClick:function(){s(t.value),c(e)},children:[Ce(He.Icon,{options:{color:a,height:28,width:28}}),Ce(En,{children:Ce(He.Title,{options:{variant:"caption1",color:a,noWrap:!0,noMargin:!0,weight:"--ll-font-weight-bold"}})}),Ce(Ln,{children:Ce(He.Badge,{options:{variant:"small",isPrimary:n}})})]})},e)}))})},_n=Ee.div(u||(u=Z(["\n display: flex;\n padding: "," ","\n "," ",";\n"])),je["--ll-spacing-x-small"],je["--ll-spacing-medium"],je["--ll-spacing-xx-small"],je["--ll-spacing-medium"]),An=Ee.div(d||(d=Z(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 3;\n box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border: 1px solid ",";\n"])),je["--ll-color-background"],je["--ll-color-border"]),zn=be.forwardRef((function(e,t){var n=rt(),r=n.activeCategory,o=n.setActiveCategory;return Ne(An,{ref:t,children:[Ce(_n,{children:Ne(Ue.Root,{value:r,onValueChange:function(e){return o(e)},children:[Ce(Ue.Trigger,{size:"large",children:Ce(Be.Root,{options:{scoreCategory:r},children:Ce(Be.Title,{options:{color:"inherit",noMargin:!0,variant:"h6",lineHeight:1}})},r)}),Ce(Ue.Content,{children:Me.map((function(e){return Ce(Be.Root,{options:{scoreCategory:e.value},children:Ce(Ue.Item,{value:e.value,children:Ce(Be.Title,{options:{color:"inherit",noMargin:!0,variant:"h6"}})})},e.value)}))})]})}),Ce(jn,{category:Me.find((function(e){return e.value===r}))}),Ce(On,{})]})}));zn.displayName="MobileScores";var Tn=We({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Rn=We({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Nn=Ee(oe)(p||(p=Z(["\n margin: 0;\n z-index: 1;\n position: relative;\n margin: 0 calc(-1 * ",");\n padding: 0 ",";\n\n &:hover {\n background-color: ",";\n box-shadow: ",";\n }\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"],je["--ll-color-surface"],je["--ll-shadow-small"]),Gn=Ee(ie)(f||(f=Z(["\n background: none;\n border: none;\n display: flex;\n align-items: center;\n width: 100%;\n padding: "," 0;\n"])),je["--ll-spacing-x-small"]),Zn=Ee(ae)(h||(h=Z(["\n background-color: ",";\n position: relative;\n overflow: hidden;\n margin-left: calc(-1 * ",");\n margin-right: calc(-1 * ",');\n\n [data-state="open"] & {\n /* TODO: Re-implement this once StyledComponents is fixed. https://locallogic.atlassian.net/browse/LL22-1107 */\n /* animation: ',' 300ms cubic-bezier(0.87, 0, 0.13, 1); */\n visibility: visible;\n }\n\n [data-state="closed"] & {\n /* TODO: Re-implement this once StyledComponents is fixed. https://locallogic.atlassian.net/browse/LL22-1107 */\n /* animation: '," 300ms cubic-bezier(0.87, 0, 0.13, 1); */\n visibility: hidden;\n }\n"])),je["--ll-color-surface"],je["--ll-spacing-medium"],je["--ll-spacing-medium"],Tn,Rn),Dn=Ee.div(v||(v=Z(["\n padding: ",";\n border-top: 1px solid ",";\n border-bottom: 1px solid ",";\n"])),je["--ll-spacing-medium"],je["--ll-color-border"],je["--ll-color-border"]),Vn=Ee.span(m||(m=Z(["\n ","[data-state=open] & {\n transform: rotate(90deg);\n } ;\n"])),Gn);Ee.div(g||(g=Z(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n"])));var Hn=Ee.div(y||(y=Z(["\n margin: "," 0;\n"])),je["--ll-spacing-small"]),Fn=Ee.div(b||(b=Z(["\n margin-top: ",";\n &:empty {\n margin: 0;\n }\n"])),je["--ll-spacing-large"]),Un=function(e){var t=e.score,n=zt(),r=n.data,o=n.isLoading,i=rt(),a=i.activePOI,l=i.setActivePOI,c=i.hoveredPOI,s=i.setHoveredPOI,u=Rt(),d=u.mapRef,p=u.mapPadding;return o?Ce(Ve,{children:G(Array(10)).map((function(e,t){return Ce(Hn,{children:Ce(Fe,{height:"34px",width:"100%"})},t)}))}):r?Ce(Ye.Root,{options:{type:"school",data:null==r?void 0:r[t],activePOI:a,hoveredPOI:c},onChange:function(e){if("poi-click"===e.type){var t=e.data;l(t);var n,r=window.innerWidth-p.left,o=window.innerWidth/2,i=r/2+p.left-o;if(t)null===(n=d.current)||void 0===n||n.easeTo({zoom:18,center:[t.lng,t.lat],duration:1e3,offset:[i,0]})}"poi-hover"===e.type&&s(e.data)}}):null},Bn=be.memo((function(e){var t=e.result,n=e.poi,r=rt(),o=r.activePOI,i=r.setActivePOI,a=r.hoveredPOI,l=r.setHoveredPOI,c=Rt(),s=c.mapRef,u=c.mapPadding;return t.data&&t.data[n]?Ce($e.Content,{options:{value:n},children:Ce(Ye.Root,{options:{type:"poi",data:t.data[n],activePOI:o,hoveredPOI:a},onChange:function(e){if("poi-click"===e.type){var t=e.data;i(t);var n,r=window.innerWidth-u.left,o=window.innerWidth/2,a=r/2+u.left-o;if(t)null===(n=s.current)||void 0===n||n.flyTo({zoom:18,center:[t.lng,t.lat],duration:1e3,offset:[a,0],essential:!0})}"poi-hover"===e.type&&l(e.data)}})},n):null}));Bn.displayName="POI";var Wn=be.memo((function(e){var t=e.include,n=At(),r=null==t?void 0:t.filter((function(e){var t;return((null==n||null===(t=n.data)||void 0===t?void 0:t[e])||[]).length>0}));return n.isLoading&&r.length?Ce(Ve,{children:G(Array(10)).map((function(e,t){return Ce(Hn,{children:Ce(Fe,{height:"34px",width:"100%"})},t)}))}):n.data?Ne($e.Root,{options:{include:r},children:[Ce($e.Tabs,{}),r.map((function(e){return Ce(Bn,{poi:e,result:n},e)}))]}):null}));Wn.displayName="POIs";var Yn=be.memo((function(e){var t,n,r=e.score,o=e.isLoading,i=e.scoresData,a=ke().sdkState,l=r===rt().activeScore;return o?Ce(Hn,{children:Ce(Fe,{height:"34px",width:"100%"},r)}):null!=i&&i.location[r]?Ce(le,{value:r,children:Ne(He.Root,{options:{score:r,scoresData:i},children:[Ce(Nn,{children:Ne(Gn,{children:[Ce(Vn,{children:Ce(qe,{SVGElement:ce,fill:je["--ll-color-on-background-variant1"]})}),Ce(Ke,{spacing:"--ll-spacing-small"}),Ce(He.Icon,{}),Ce(Ke,{spacing:"--ll-spacing-small"}),Ce(He.Title,{}),Ce(Ke,{}),Ce(He.Badge,{options:{isPrimary:l}})]})}),Ce(Zn,{children:Ne(Dn,{children:[Ce(He.Description,{}),Ce(Ke,{vertical:!0,spacing:"--ll-spacing-small"}),Ce(He.BarChart,{options:{locationIcon:"pin"===(null===(t=a.options)||void 0===t||null===(n=t.marker)||void 0===n?void 0:n.icon)?xn:wn}}),Ce(Fn,{children:"high_schools"===r||"primary_schools"===r?Ce(Un,{score:r}):Ce(Wn,{include:Le[r]})})]})})]})},r):null}));Yn.displayName="Score";var $n=Ee.div(x||(x=Z(["\n padding: "," ",";\n"])),je["--ll-spacing-small"],je["--ll-spacing-medium"]),qn=Ee.div(w||(w=Z(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"]))),Kn=be.memo((function(e){var t=e.tabContent,n=Cn(t.scores),r=n.data,o=n.isLoading,i=n.isFetching,a=Ae().translations;return Ne($n,{children:[Ne(qn,{children:[Ce(Qe.Title,{options:{variant:"h4",noMargin:!0,weight:"--ll-font-weight-medium"}}),i&&!o&&Ce(Xe,{size:"small"})]}),Ce(Ke,{spacing:"--ll-spacing-small",vertical:!0}),!i&&!Object.keys((null==r?void 0:r.location)||{}).length&&Ce(Je,{color:"--ll-color-on-background-variant1",children:a.EMPTY_TEXT}),t.scores.map((function(e){return Ce(Yn,{score:e,isLoading:o,scoresData:r},e)}))]})}));Kn.displayName="ScoreCategory";var Qn=be.memo((function(e){var t=e.tabContent,n=rt(),r=n.activeScore,o=n.setActiveScore;return xe.exports.useEffect((function(){o(t.scores[0])}),[]),Ce(se,{value:r,onValueChange:function(e){o(e)},type:"single",collapsible:!0,children:Ce(Kn,{tabContent:t})})}));Qn.displayName="ScoreCategoryAccordion";var Xn=Ee.div(C||(C=Z(["\n overflow-y: auto;\n"]))),Jn=Ee.div(M||(M=Z(["\n position: absolute;\n top: ",";\n left: ",";\n width: 360px;\n max-height: calc(100% - 2 * ",");\n z-index: 1;\n border-radius: ",";\n box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 8px;\n background-color: #fff;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border: 1px solid ",";\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"],je["--ll-spacing-medium"],je["--ll-border-radius-medium"],je["--ll-color-background"],je["--ll-color-border"]);Ee.div(S||(S=Z(["\n display: flex;\n justify-content: center;\n padding: ",";\n"])),je["--ll-spacing-small"]);var er=Ee.div(O||(O=Z(["\n padding: ",";\n border-bottom: 1px solid ",";\n"])),je["--ll-spacing-xx-small"],je["--ll-color-border"]),tr=Ee.div(k||(k=Z(["\n display: flex;\n justify-content: center;\n padding: ",";\n background-color: ",";\n"])),je["--ll-spacing-small"],je["--ll-color-background"]),nr=function(){return Ce(tr,{children:Ce(et.Root,{})})},rr=be.forwardRef((function(e,t){var n=rt(),r=n.activeCategory,o=n.setActiveCategory;return Ce(Qe.Root,{options:{currentTab:r},onChange:function(e){o(e.data)},children:Ne(Jn,{ref:t,children:[Ce(er,{children:Ce(Qe.Tabs,{})}),Ce(Xn,{children:Me.map((function(e){return Ce(Qe.Content,{options:{value:e.value},children:Ce(Qn,{tabContent:e},e.value)},e.value)}))}),Ce(nr,{})]})})}));rr.displayName="DesktopScores";var or=Ee.div(P||(P=Z(["\n position: relative;\n display: flex;\n flex-direction: column;\n height: 100vh;\n"]))),ir=function(e){return xe.exports.createElement("svg",X({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M22.4275 10.5938L13.4175 1.58383C12.6675 0.833834 11.3475 0.823834 10.5875 1.58383L1.58745 10.5838C0.807453 11.3638 0.807453 12.6238 1.58745 13.4038L10.5875 22.4038C10.9775 22.7938 11.4875 22.9838 11.9975 22.9838C12.5075 22.9838 13.0175 22.7938 13.4075 22.4038L22.3975 13.4138C23.1875 12.6538 23.1975 11.3938 22.4275 10.5938ZM12.0075 20.9938L3.00745 11.9938L12.0075 2.99383L21.0075 11.9938L12.0075 20.9938ZM7.99745 11.0038V15.0038H9.99745V12.0038H13.9975V14.5038L17.4975 11.0038L13.9975 7.50383V10.0038H8.99745C8.44745 10.0038 7.99745 10.4538 7.99745 11.0038Z"}))},ar=function(e){return xe.exports.createElement("svg",X({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M13.5 5.5C14.6 5.5 15.5 4.6 15.5 3.5C15.5 2.4 14.6 1.5 13.5 1.5C12.4 1.5 11.5 2.4 11.5 3.5C11.5 4.6 12.4 5.5 13.5 5.5ZM9.8 8.9L7 23H9.1L10.9 15L13 17V23H15V15.5L12.9 13.5L13.5 10.5C14.8 12 16.8 13 19 13V11C17.1 11 15.5 10 14.7 8.6L13.7 7C13.14 6.11 12.02 5.75 11.05 6.16L6 8.3V13H8V9.6L9.8 8.9Z"}))},lr=function(e){return xe.exports.createElement("svg",X({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5H6.5C5.84 5 5.29 5.42 5.08 6.01L3 12V20C3 20.55 3.45 21 4 21H5C5.55 21 6 20.55 6 20V19H18V20C18 20.55 18.45 21 19 21H20C20.55 21 21 20.55 21 20V12L18.92 6.01ZM6.85 7H17.14L18.22 10.11H5.77L6.85 7ZM19 17H5V12H19V17Z"}),xe.exports.createElement("path",{d:"M7.5 16C8.32843 16 9 15.3284 9 14.5C9 13.6716 8.32843 13 7.5 13C6.67157 13 6 13.6716 6 14.5C6 15.3284 6.67157 16 7.5 16Z"}),xe.exports.createElement("path",{d:"M16.5 16C17.3284 16 18 15.3284 18 14.5C18 13.6716 17.3284 13 16.5 13C15.6716 13 15 13.6716 15 14.5C15 15.3284 15.6716 16 16.5 16Z"}))},cr=function(e){return xe.exports.createElement("svg",X({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),xe.exports.createElement("path",{d:"M12,2C6.47,2,2,6.47,2,12s4.47,10,10,10s10-4.47,10-10S17.53,2,12,2z M17,15.59L15.59,17L12,13.41L8.41,17L7,15.59 L10.59,12L7,8.41L8.41,7L12,10.59L15.59,7L17,8.41L13.41,12L17,15.59z"}))},sr=Ee.div(L||(L=Z(["\n max-height: calc(100% - 2 * ",");\n border-radius: ",";\n box-shadow: ",";\n background-color: ",";\n border: 1px solid ",";\n padding: ",";\n"])),je["--ll-spacing-medium"],je["--ll-border-radius-medium"],je["--ll-shadow-small"],je["--ll-color-background"],je["--ll-color-border"],je["--ll-spacing-x-small"]),ur=Ee.div(E||(E=Z(["\n display: flex;\n justify-content: space-between;\n align-items: end;\n\n "," {\n // Adjust if text of commute transport mode changes\n width: 52%;\n margin-right: ",";\n }\n"])),ue,je["--ll-spacing-x-small"]),dr=Ee.div(I||(I=Z(["\n background-color: ",";\n padding: "," "," 0;\n border-radius: ",";\n"])),je["--ll-color-surface"],je["--ll-spacing-x-small"],je["--ll-spacing-small"],je["--ll-border-radius-medium"]),pr=Ee(tt)(j||(j=Z(["\n position: absolute;\n right: ",";\n top: ",";\n"])),je["--ll-spacing-xx-small"],je["--ll-spacing-xx-small"]),fr=function(e){var t,n,r,o,i=e.className,a=e.onClose,l=ke().sdkState,c=rt(),s=c.setCommuteGeojson,u=c.destination,d=c.setDestination,p=$(xe.exports.useState("pedestrian"),2),f=p[0],h=p[1],v=_t(),m=Ae().translations,g=vn({destination:u,transportMode:f,origin:"".concat(null==l||null===(t=l.options)||void 0===t||null===(n=t.marker)||void 0===n?void 0:n.lat,",").concat(null==l||null===(r=l.options)||void 0===r||null===(o=r.marker)||void 0===o?void 0:o.lng),isOpen:!0}),y=g.data,b=g.isFetching,x=g.isFetched;xe.exports.useEffect((function(){null!=y&&y.summary&&s(Te.polyline.decode(y.polyline))}),[y]);var w={pedestrian:[m.WALKING,ar],car:[m.DRIVING,lr]},C=xe.exports.useMemo((function(){if(null==y||!y.summary)return null;var e=Math.floor(y.summary.typicalDuration/60/60),t=Math.floor(y.summary.typicalDuration/60%60);return 0===e?"".concat(t," ").concat(Re.pluralize(m.MINUTE,t)):"".concat(e," ").concat(Re.pluralize(m.HOUR,e)," ").concat(t," ").concat(Re.pluralize(m.MINUTE,t))}),[y]),M=xe.exports.useMemo((function(){if(null==y||!y.summary)return null;var e=Math.floor(y.summary.length/1e3);return 0===e?"".concat(y.summary.length," m"):"".concat(e," km")}),[y]);return Ne(sr,{className:i,children:[Ce(pr,{size:"medium",color:"neutral",onClick:a,SVGElement:cr}),Ne(ur,{children:[Ce(de,{label:m.CALCULATE_COMMUTE,placeholder:(null==u?void 0:u.label)||m.SEARCH_MAP,renderListAbove:v,renderListAbovePosition:30,onSearch:function(e){d({lat:e.latitude,lng:e.longitude})}}),Ce(Ue.Root,{value:f,onValueChange:function(e){h(e)},children:Ne(Ue.Trigger,{children:[Ce(qe,{SVGElement:w[f][1],fill:je["--ll-color-on-background-variant1"],width:16}),w[f][0],Ne(Ue.Content,{children:[Ce(Ue.Item,{value:"car",children:m.DRIVING}),Ce(Ue.Item,{value:"pedestrian",children:m.WALKING})]})]})})]}),(x||b)&&Ne(Ve,{children:[Ce(Ke,{vertical:!0,spacing:"--ll-spacing-x-small"}),Ce(pe,{open:!!y,children:b?Ce(Fe,{height:"70.4px",width:"100%"}):null!=y&&y.summary?Ne(dr,{children:[Ce(Je,{variant:"h5",children:C}),Ne(Je,{children:[M," – ",m.FAST_ROUTE]})]}):Ne(dr,{children:[Ce(Je,{variant:"h5",children:m.NO_ROUTE}),Ce(Je,{children:m.TRY_SUGGESTION})]})})]})]})},hr=Ee.div(_||(_=Z(["\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 3;\n"]))),vr=Ee.div(A||(A=Z(["\n position: absolute;\n top: ",";\n right: ",";\n z-index: 3;\n max-width: 356px;\n"])),je["--ll-spacing-medium"],je["--ll-spacing-medium"]),mr=Ee(tt)(z||(z=Z(["\n box-shadow: ",";\n position: absolute;\n bottom: ",";\n right: ",";\n"])),je["--ll-shadow-medium"],je["--ll-spacing-medium"],je["--ll-spacing-medium"]),gr=Ee(fr)(T||(T=Z([""]))),yr=Ee(fr)(R||(R=Z(["\n border-radius: ","\n "," 0 0;\n border: 0;\n"])),je["--ll-border-radius-small"],je["--ll-border-radius-small"]),br=Ee(nt)(N||(N=Z(["\n box-shadow: ",";\n"])),je["--ll-shadow-small"]),xr=function(){var e=rt(),t=e.setCommuteGeojson,n=e.setDestination,r=e.showCommuteCalculator,o=e.setShowCommuteCalculator,i=Ae().translations,a=function(){n(void 0),t(void 0),o(!1)},l=function(){o(!0)};return _t()?Ce(Ve,{children:r?Ce(hr,{children:Ce(yr,{onClose:a})}):Ce(mr,{size:"large",SVGElement:ir,onClick:l})}):Ce(vr,{children:r?Ce(gr,{onClose:a}):Ce(br,{onClick:l,startAdornment:Ce(ir,{}),children:i.CALCULATE_COMMUTE})})},wr=function(){var e,t,n,r=ke(),o=r.sdkState,i=r.setSdkState,a=rt(),l=a.activeScore,c=a.activePOI,s=a.setActivePOI,u=a.hoveredPOI,d=a.commuteGeojson,p=a.destination,f=a.schoolCatchment,h=_t(),v=At(),m=zt(),g="night"===(null==o||null===(e=o.globalOptions)||void 0===e||null===(t=e.appearance)||void 0===t?void 0:t.theme)?"dd191599-2a92-49fc-9a33-e12391753ad5":"600d69cb-288d-445e-9839-3dfe4d76b31a",y={id:"point",type:"line",paint:{"line-width":6,"line-color":getComputedStyle(document.documentElement).getPropertyValue("--ll-color-link")}},b={id:"school",type:"line",source:"schoolCatchment",paint:{"line-width":3,"line-color":getComputedStyle(document.documentElement).getPropertyValue("--ll-color-on-background")}},x=$(xe.exports.useState(!1),2),w=x[0],C=x[1],M=xe.exports.useMemo((function(){var e,t;return"high_schools"!==l&&"primary_schools"!==l||m.isFetching?Le&&l&&Le[l]&&null!==(e=Le[l])&&void 0!==e&&e.length||v.isFetching?v.data:J({},l,[]):J({},l,(null==m||null===(t=m.data)||void 0===t?void 0:t[l])||[])}),[v.data,m.data,l]),S=xe.exports.useMemo((function(){return M?Object.entries(M).map((function(e){var t=$(e,2),n=t[0];return t[1].map((function(e){return pt([e.lng,e.lat],{poi:e,type:n})}))})).flat().filter((function(e,t,n){return n.findIndex((function(t){return["lat","lng","name"].every((function(n){return t.properties.poi[n]===e.properties.poi[n]}))}))===t})):[]}),[M]),O=xe.exports.useMemo((function(){var e,t,n,r=(null==o||null===(e=o.options)||void 0===e?void 0:e.marker)&&pt([null==o||null===(t=o.options)||void 0===t?void 0:t.marker.lng,null==o||null===(n=o.options)||void 0===n?void 0:n.marker.lat]);return[].concat(G(S),G(r?[r]:[]),G(p?[pt([null==p?void 0:p.lng,null==p?void 0:p.lat])]:[]))}),[S,null==o||null===(n=o.options)||void 0===n?void 0:n.marker,p]),k=xe.exports.useRef(),P=$(fe(),2),L=P[0],E=P[1],I=xe.exports.useMemo((function(){return{top:25+E.height,bottom:25,left:25,right:25}}),[E.height]),j=xe.exports.useMemo((function(){return{top:50,bottom:50,left:E.width+32+50,right:50}}),[E.width]),_=h?I:j;return xe.exports.useEffect((function(){var e,t;if(O.length&&null!==(e=o.options)&&void 0!==e&&e.marker){var n,r,i,a=$(vt((n=O.map((function(e){var t=e.geometry;return[t.coordinates[1],t.coordinates[0]]})),void 0===i&&(i={}),dt({type:"MultiPoint",coordinates:n},r,i))),4),l=a[0],c=a[1],s=a[2],u=a[3];null==k||null===(t=k.current)||void 0===t||t.fitBounds([[c,l],[u,s]],{maxZoom:17,padding:_,duration:1e3})}}),[O,_,f]),o.options?Ce(Nt,{mapRef:k,mapPadding:_,children:Ne(or,{children:[Ne(he,{ref:k,mapLib:ve,latitude:o.options.lat,longitude:o.options.lng,zoom:o.options.zoom,pitch:o.options.pitch,bearing:o.options.bearing,style:{flex:1,width:"100vw"},mapStyle:"https://api.maptiler.com/maps/".concat(g,"/style.json?key=","9jNGatuzs05Q1oNlctEs"),onMove:function(e){i(X(X({},o),{},{options:X(X({},o.options),{},{lat:e.viewState.latitude,lng:e.viewState.longitude,zoom:e.viewState.zoom,bearing:e.viewState.bearing,pitch:e.viewState.pitch})}))},cooperativeGestures:o.options.cooperativeGestures,onMoveStart:function(){return C(!0)},onMoveEnd:function(){return C(!1)},attributionControl:!1,children:[Ce(me,{compact:!0,position:h?"bottom-left":"bottom-right"}),Ce(ge,{position:h?"top-right":"bottom-right",showCompass:!0,style:{marginTop:h?16+E.height:16,marginRight:16}}),o.options.marker&&Ce(ye,{marker:o.options.marker}),Ce(bn,{rect:E,zoom:o.options.zoom,mapRef:k,points:S,isMobile:h,activePOI:c,hoveredPOI:u,isMapMoving:w,setActivePOI:s}),Ce(h?zn:rr,{ref:L}),Ce(xr,{}),p&&Ce(ye,{marker:X({icon:"pin"},p)}),d&&Ce(ct,{type:"geojson",data:d,children:Ce(ut,X({},y))}),f&&Ce(ct,{type:"geojson",data:f,children:Ce(ut,X({},b))})]}),h&&Ce(nr,{})]})}):Ce("div",{children:"No options provided."})};V("default",(function(){return Ce(it,{children:Ce(wr,{})})}))}}}))}();
|