diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..5d84589 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @hoblin diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..af30eed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug Report +about: Create a report to help us improve +title: '' +labels: 'bug' +assignees: '' + +--- + +**Describe the Bug** +A clear and concise description of what the bug is. + +**Steps to Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected Behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] + +**Additional Context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..6425dc1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature Request +about: Suggest an idea for this project +title: '' +labels: 'enhancement' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..8c88668 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +**Describe the changes** +Clearly and concisely describe what you've changed and why. + +**Related Issue(s)** + +Fixes # + +**Checklist:** + +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed locally. +- [ ] Linter has passed locally. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0f1e1ff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: Continuous Integration + +on: + push: + branches: + - main + pull_request: + branches: + - main + - develop + +jobs: + test: + name: Run RSpec + runs-on: ubuntu-latest + + services: + postgres: + image: postgres:13 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: x_tracker_test + ports: + - 5432:5432 + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + + - name: Install dependencies + run: | + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + + - name: Create test credentials key file + run: echo "${{ secrets.RAILS_TEST_MASTER_KEY }}" > config/credentials/test.key + + - name: Precompile assets + run: bundle exec rails assets:precompile + env: + RAILS_ENV: test + + - name: Run tests + run: bundle exec rspec + - name: Display log + if: failure() + run: cat log/test.log + + lint: + name: Run StandardRB + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + + - name: Install dependencies + run: | + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + + - name: Run linter + run: bundle exec standardrb diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bde6ef6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Yevhenii Hurin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..875aa06 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# X-Tracker + +X-Tracker is an open-source platform aimed at bringing transparency to social media interactions, particularly on Twitter. It allows users to monitor and track the statistics of specific tweets, providing a visual representation of how tweets are performing over time. + +## Features + +- Real-time tracking of tweet metrics including: + - Likes + - Views + - Retweets + - Retweets with citation + - Comments + - Bookmarks +- User-friendly interface to add tweets to the tracking pool. +- Advanced charting experience with Highcharts, allowing users to zoom, scroll, select different periods, and see real-time updates. +- Tampermonkey script generation for users to run the tracker in their own browser and contribute to the data pool. +- Community-driven: Users can contribute by adding new tweets to the pool or by running the tracking script to gather data. + +## Tech Stack + +- Ruby on Rails +- Bulma for styling +- Highcharts for data visualization +- RSpec with FactoryBot for testing +- PostgreSQL as the database +- Hosted on Heroku + +## Setup and Installation + +1. Clone the repository: +```bash +git clone https://github.com/hoblin/x-tracker.git +cd x-tracker +``` +2. Install dependencies: +```bash +bundle install +yarn install +``` +3. Setup the database: +```bash +rails db:create db:migrate +``` +4. Start the Rails server: +```bash +rails s +``` +5. Open your browser and navigate to `http://localhost:3000`. + +## Contribution + +X-Tracker is an open-source project, and contributions are warmly welcomed. Whether you have suggestions, a bug report, or a feature request, feel free to open an issue or create a pull request. + +## License + +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. diff --git a/assets/application-5232e6bde3032b129dcce7c5d4f140bb78bf1134d294a9f4a7842d993d0f7080.js b/assets/application-5232e6bde3032b129dcce7c5d4f140bb78bf1134d294a9f4a7842d993d0f7080.js new file mode 100644 index 0000000..9666f82 --- /dev/null +++ b/assets/application-5232e6bde3032b129dcce7c5d4f140bb78bf1134d294a9f4a7842d993d0f7080.js @@ -0,0 +1,28 @@ +/*! For license information please see application.js.LICENSE.txt */ +(()=>{"use strict";var t={245:(t,e,i)=>{i.d(e,{createConsumer:()=>x});const s={logger:self.console,WebSocket:self.WebSocket},r={log(...t){this.enabled&&(t.push(Date.now()),s.logger.log("[ActionCable]",...t))}},n=()=>(new Date).getTime(),o=t=>(n()-t)/1e3;class a{constructor(t){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=t,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=n(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),r.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=n(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),r.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordPing(){this.pingedAt=n()}recordConnect(){this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,r.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=n(),r.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout((()=>{this.reconnectIfStale(),this.poll()}),this.getPollInterval())}getPollInterval(){const{staleThreshold:t,reconnectionBackoffRate:e}=this.constructor;return 1e3*t*Math.pow(1+e,Math.min(this.reconnectAttempts,10))*(1+(0===this.reconnectAttempts?1:e)*Math.random())}reconnectIfStale(){this.connectionIsStale()&&(r.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${o(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?r.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${o(this.disconnectedAt)} s`):(r.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return o(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&o(this.disconnectedAt){!this.connectionIsStale()&&this.connection.isOpen()||(r.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())}),200)}}a.staleThreshold=6,a.reconnectionBackoffRate=.15;const h=a,l={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},disconnect_reasons:{unauthorized:"unauthorized",invalid_request:"invalid_request",server_restart:"server_restart",remote:"remote"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},{message_types:c,protocols:d}=l,u=d.slice(0,d.length-1),p=[].indexOf;class m{constructor(t){this.open=this.open.bind(this),this.consumer=t,this.subscriptions=this.consumer.subscriptions,this.monitor=new h(this),this.disconnected=!0}send(t){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(t)),!0)}open(){if(this.isActive())return r.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1;{const t=[...d,...this.consumer.subprotocols||[]];return r.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${t}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new s.WebSocket(this.consumer.url,t),this.installEventHandlers(),this.monitor.start(),!0}}close({allowReconnect:t}={allowReconnect:!0}){if(t||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(r.log(`Reopening WebSocket, current state is ${this.getState()}`),!this.isActive())return this.open();try{return this.close()}catch(t){r.log("Failed to reopen WebSocket",t)}finally{r.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}triedToReconnect(){return this.monitor.reconnectAttempts>0}isProtocolSupported(){return p.call(u,this.getProtocol())>=0}isState(...t){return p.call(t,this.getState())>=0}getState(){if(this.webSocket)for(let t in s.WebSocket)if(s.WebSocket[t]===this.webSocket.readyState)return t.toLowerCase();return null}installEventHandlers(){for(let t in this.events){const e=this.events[t].bind(this);this.webSocket[`on${t}`]=e}}uninstallEventHandlers(){for(let t in this.events)this.webSocket[`on${t}`]=function(){}}}m.reopenDelay=500,m.prototype.events={message(t){if(!this.isProtocolSupported())return;const{identifier:e,message:i,reason:s,reconnect:n,type:o}=JSON.parse(t.data);switch(o){case c.welcome:return this.triedToReconnect()&&(this.reconnectAttempted=!0),this.monitor.recordConnect(),this.subscriptions.reload();case c.disconnect:return r.log(`Disconnecting. Reason: ${s}`),this.close({allowReconnect:n});case c.ping:return this.monitor.recordPing();case c.confirmation:return this.subscriptions.confirmSubscription(e),this.reconnectAttempted?(this.reconnectAttempted=!1,this.subscriptions.notify(e,"connected",{reconnected:!0})):this.subscriptions.notify(e,"connected",{reconnected:!1});case c.rejection:return this.subscriptions.reject(e);default:return this.subscriptions.notify(e,"received",i)}},open(){if(r.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return r.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(t){if(r.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){r.log("WebSocket onerror event")}};const g=m;class f{constructor(t,e={},i){this.consumer=t,this.identifier=JSON.stringify(e),function(t,e){if(null!=e)for(let i in e){const s=e[i];t[i]=s}}(this,i)}perform(t,e={}){return e.action=t,this.send(e)}send(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}const v=class{constructor(t){this.subscriptions=t,this.pendingSubscriptions=[]}guarantee(t){-1==this.pendingSubscriptions.indexOf(t)?(r.log(`SubscriptionGuarantor guaranteeing ${t.identifier}`),this.pendingSubscriptions.push(t)):r.log(`SubscriptionGuarantor already guaranteeing ${t.identifier}`),this.startGuaranteeing()}forget(t){r.log(`SubscriptionGuarantor forgetting ${t.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter((e=>e!==t))}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout((()=>{this.subscriptions&&"function"==typeof this.subscriptions.subscribe&&this.pendingSubscriptions.map((t=>{r.log(`SubscriptionGuarantor resubscribing ${t.identifier}`),this.subscriptions.subscribe(t)}))}),500)}};class b{constructor(t){this.consumer=t,this.guarantor=new v(this),this.subscriptions=[]}create(t,e){const i="object"==typeof t?t:{channel:t},s=new f(this.consumer,i,e);return this.add(s)}add(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.subscribe(t),t}remove(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t}reject(t){return this.findAll(t).map((t=>(this.forget(t),this.notify(t,"rejected"),t)))}forget(t){return this.guarantor.forget(t),this.subscriptions=this.subscriptions.filter((e=>e!==t)),t}findAll(t){return this.subscriptions.filter((e=>e.identifier===t))}reload(){return this.subscriptions.map((t=>this.subscribe(t)))}notifyAll(t,...e){return this.subscriptions.map((i=>this.notify(i,t,...e)))}notify(t,e,...i){let s;return s="string"==typeof t?this.findAll(t):[t],s.map((t=>"function"==typeof t[e]?t[e](...i):void 0))}subscribe(t){this.sendCommand(t,"subscribe")&&this.guarantor.guarantee(t)}confirmSubscription(t){r.log(`Subscription confirmed ${t}`),this.findAll(t).map((t=>this.guarantor.forget(t)))}sendCommand(t,e){const{identifier:i}=t;return this.consumer.send({command:e,identifier:i})}}class y{constructor(t){this._url=t,this.subscriptions=new b(this),this.connection=new g(this),this.subprotocols=[]}get url(){return function(t){if("function"==typeof t&&(t=t()),t&&!/^wss?:/i.test(t)){const e=document.createElement("a");return e.href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href}return t}(this._url)}send(t){return this.connection.send(t)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}addSubProtocol(t){this.subprotocols=[...this.subprotocols,t]}}function x(t=function(t){const e=document.head.querySelector("meta[name='action-cable-url']");if(e)return e.getAttribute("content")}()||l.default_mount_path){return new y(t)}},840:function(t,e,i){var s,r,n;r="undefined"!=typeof window?window:this,n=function(t){function e(e,i,s,r){e.hasOwnProperty(i)||(e[i]=r.apply(null,s),"function"==typeof CustomEvent&&t.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:e[i]}})))}var i={};return e(i,"Core/Globals.js",[],(function(){var e;return function(e){e.SVG_NS="http://www.w3.org/2000/svg",e.product="Highcharts",e.version="11.1.0",e.win=void 0!==t?t:{},e.doc=e.win.document,e.svg=e.doc&&e.doc.createElementNS&&!!e.doc.createElementNS(e.SVG_NS,"svg").createSVGRect,e.userAgent=e.win.navigator&&e.win.navigator.userAgent||"",e.isChrome=-1!==e.userAgent.indexOf("Chrome"),e.isFirefox=-1!==e.userAgent.indexOf("Firefox"),e.isMS=/(edge|msie|trident)/i.test(e.userAgent)&&!e.win.opera,e.isSafari=!e.isChrome&&-1!==e.userAgent.indexOf("Safari"),e.isTouchDevice=/(Mobile|Android|Windows Phone)/.test(e.userAgent),e.isWebKit=-1!==e.userAgent.indexOf("AppleWebKit"),e.deg2rad=2*Math.PI/360,e.hasBidiBug=e.isFirefox&&4>parseInt(e.userAgent.split("Firefox/")[1],10),e.hasTouch=!!e.win.TouchEvent,e.marginNames=["plotTop","marginRight","marginBottom","plotLeft"],e.noop=function(){},e.supportsPassiveEvents=function(){let t=!1;if(!e.isMS){const i=Object.defineProperty({},"passive",{get:function(){t=!0}});e.win.addEventListener&&e.win.removeEventListener&&(e.win.addEventListener("testPassive",e.noop,i),e.win.removeEventListener("testPassive",e.noop,i))}return t}(),e.charts=[],e.dateFormats={},e.seriesTypes={},e.symbolSizes={},e.chartCount=0}(e||(e={})),e})),e(i,"Core/Utilities.js",[i["Core/Globals.js"]],(function(t){function e(i,s,r,n){const o=s?"Highcharts error":"Highcharts warning";32===i&&(i=`${o}: Deprecated member`);const a=h(i);let l=a?`${o} #${i}: www.highcharts.com/errors/${i}/`:i.toString();if(void 0!==n){let t="";a&&(l+="?"),v(n,(function(e,i){t+=`\n - ${i}: ${e}`,a&&(l+=encodeURI(i)+"="+encodeURI(e))})),l+=t}y(t,"displayError",{chart:r,code:i,message:l,params:n},(function(){if(s)throw Error(l);S.console&&-1===e.messages.indexOf(l)&&console.warn(l)})),e.messages.push(l)}function i(t,e){return parseInt(t,e||10)}function s(t){return"string"==typeof t}function r(t){return"[object Array]"===(t=Object.prototype.toString.call(t))||"[object Array Iterator]"===t}function n(t,e){return!(!t||"object"!=typeof t||e&&r(t))}function o(t){return n(t)&&"number"==typeof t.nodeType}function a(t){const e=t&&t.constructor;return!(!n(t,!0)||o(t)||!e||!e.name||"Object"===e.name)}function h(t){return"number"==typeof t&&!isNaN(t)&&1/0>t&&-1/0{l(e)?t.setAttribute(i,e):r?(n=t.getAttribute(i))||"class"!==i||(n=t.getAttribute(i+"Name")):t.removeAttribute(i)};return s(e)?o(i,e):v(e,o),n}function d(t){return r(t)?t:[t]}function u(t,e){let i;for(i in t||(t={}),e)t[i]=e[i];return t}function p(){const t=arguments,e=t.length;for(let i=0;it.order-e.order)),n.forEach((t=>{!1===t.fn.call(e,s)&&s.preventDefault()}))}r&&!s.defaultPrevented&&r.call(e,s)}const{charts:x,doc:w,win:S}=t;(e||(e={})).messages=[],Math.easeInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)};var C=Array.prototype.find?function(t,e){return t.find(e)}:function(t,e){let i;const s=t.length;for(i=0;it.order-e.order)),function(){b(e,i,s)}},arrayMax:function(t){let e=t.length,i=t[0];for(;e--;)t[e]>i&&(i=t[e]);return i},arrayMin:function(t){let e=t.length,i=t[0];for(;e--;)t[e]e?t{if(1n&&!i?(null==e||e(),e=void 0):n&&(void 0===s||n=s-1&&(s=Math.floor(r)),Math.max(0,s-(t(e,"padding-left",!0)||0)-(t(e,"padding-right",!0)||0))):"height"===s?Math.max(0,Math.min(e.offsetHeight,e.scrollHeight)-(t(e,"padding-top",!0)||0)-(t(e,"padding-bottom",!0)||0)):((e=S.getComputedStyle(e,void 0))&&(n=e.getPropertyValue(s),p(r,"opacity"!==s)&&(n=i(n))),n)},inArray:function(t,i,s){return e(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),i.indexOf(t,s)},insertItem:function(t,e){const i=t.options.index,s=e.length;let r;for(r=t.options.isInternal?s:0;r=i&&(e=[1/i]))),s=0;s=t||!r&&o<=(e[s]+(e[s+1]||e[s]))/2));s++);return f(n*i,-Math.round(Math.log(.001)/Math.LN10))},objectEach:v,offset:function(t){const e=w.documentElement;return{top:(t=t.parentElement||t.parentNode?t.getBoundingClientRect():{top:0,left:0,width:0,height:0}).top+(S.pageYOffset||e.scrollTop)-(e.clientTop||0),left:t.left+(S.pageXOffset||e.scrollLeft)-(e.clientLeft||0),width:t.width,height:t.height}},pad:function(t,e,i){return Array((e||2)+1-String(t).replace("-","").length).join(i||"0")+t},pick:p,pInt:i,pushUnique:function(t,e){return 0>t.indexOf(e)&&!!t.push(e)},relativeLength:function(t,e,i){return/%$/.test(t)?e*parseFloat(t)/100+(i||0):parseFloat(t)},removeEvent:b,splat:d,stableSort:function(t,e){const i=t.length;let s,r;for(r=0;rnew n(t[1])));else if("string"==typeof t){if(this.input=t=n.names[t.toLowerCase()]||t,"#"===t.charAt(0)){var s=t.length,r=parseInt(t.substr(1),16);7===s?e=[(16711680&r)>>16,(65280&r)>>8,255&r,1]:4===s&&(e=[(3840&r)>>4|(3840&r)>>8,(240&r)>>4|240&r,(15&r)<<4|15&r,1])}if(!e)for(r=n.parsers.length;r--&&!e;)i=n.parsers[r],(s=i.regex.exec(t))&&(e=i.parse(s))}e&&(this.rgba=e)}get(t){const e=this.input,r=this.rgba;if("object"==typeof e&&void 0!==this.stops){const i=s(e);return i.stops=[].slice.call(i.stops),this.stops.forEach(((e,s)=>{i.stops[s]=[i.stops[s][0],e.get(t)]})),i}return r&&i(r[0])?"rgb"===t||!t&&1===r[3]?"rgb("+r[0]+","+r[1]+","+r[2]+")":"a"===t?`${r[3]}`:"rgba("+r.join(",")+")":e}brighten(t){const e=this.rgba;if(this.stops)this.stops.forEach((function(e){e.brighten(t)}));else if(i(t)&&0!==t)for(let i=0;3>i;i++)e[i]+=r(255*t),0>e[i]&&(e[i]=0),255d?"AM":"PM",P:12>d?"am":"pm",S:l(a.getSeconds()),L:l(Math.floor(i%1e3),3)},t.dateFormats),h(a,(function(t,s){for(;-1!==e.indexOf("%"+s);)e=e.replace("%"+s,"function"==typeof t?t.call(o,i):t)})),r?e.substr(0,1).toUpperCase()+e.substr(1):e}resolveDTLFormat(t){return o(t,!0)?t:{main:(t=d(t))[0],from:t[1],to:t[2]}}getTimeTicks(t,e,i,r){const o=this,a=[],h={};var l=new o.Date(e);const d=t.unitRange,p=t.count||1;let m;if(r=c(r,1),s(e)){if(o.set("Milliseconds",l,d>=u.second?0:p*Math.floor(o.get("Milliseconds",l)/p)),d>=u.second&&o.set("Seconds",l,d>=u.minute?0:p*Math.floor(o.get("Seconds",l)/p)),d>=u.minute&&o.set("Minutes",l,d>=u.hour?0:p*Math.floor(o.get("Minutes",l)/p)),d>=u.hour&&o.set("Hours",l,d>=u.day?0:p*Math.floor(o.get("Hours",l)/p)),d>=u.day&&o.set("Date",l,d>=u.month?1:Math.max(1,p*Math.floor(o.get("Date",l)/p))),d>=u.month){o.set("Month",l,d>=u.year?0:p*Math.floor(o.get("Month",l)/p));var g=o.get("FullYear",l)}d>=u.year&&o.set("FullYear",l,g-g%p),d===u.week&&(g=o.get("Day",l),o.set("Date",l,o.get("Date",l)-g+r+(g4*u.month||o.getTimezoneOffset(e)!==o.getTimezoneOffset(i)),e=l.getTime(),l=1;ea.length&&a.forEach((function(t){0==t%18e5&&"000000000"===o.dateFormat("%H%M%S%L",t)&&(h[t]="day")}))}return a.info=n(t,{higherRanks:h,totalRange:d*p}),a}getDateFormat(t,e,i,s){const r=this.dateFormat("%m-%d %H:%M:%S.%L",e),n={millisecond:15,second:12,minute:9,hour:6,day:3};let o,a="millisecond";for(o in u){if(t===u.week&&+this.dateFormat("%w",e)===i&&"00:00:00.000"===r.substr(6)){o="week";break}if(u[o]>t){o=a;break}if(n[o]&&r.substr(n[o])!=="01-01 00:00:00.000".substr(n[o]))break;"week"!==o&&(a=o)}return this.resolveDTLFormat(s[o]).main}}})),e(i,"Core/Defaults.js",[i["Core/Chart/ChartDefaults.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Color/Palettes.js"],i["Core/Time.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r,n){const{isTouchDevice:o,svg:a}=i,{merge:h}=n,l={colors:s.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:t,title:{style:{color:"#333333",fontWeight:"bold"},text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{style:{color:"#666666",fontSize:"0.8em"},text:"",align:"center",widthAdjust:-44},caption:{margin:15,style:{color:"#666666",fontSize:"0.8em"},text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",layout:"horizontal",itemMarginBottom:2,itemMarginTop:2,labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{style:{fontSize:"0.8em"},activeColor:"#0022ff",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"0.8em",textDecoration:"none",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#666666",textDecoration:"line-through"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontSize:"0.8em",fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:a,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %e %b, %H:%M:%S.%L",second:"%A, %e %b, %H:%M:%S",minute:"%A, %e %b, %H:%M",hour:"%A, %e %b, %H:%M",day:"%A, %e %b %Y",week:"Week from %A, %e %b %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:o?25:10,headerFormat:'{point.key}
',pointFormat:' {series.name}: {point.y}
',backgroundColor:"#ffffff",borderWidth:void 0,shadow:!0,stickOnContact:!1,style:{color:"#333333",cursor:"default",fontSize:"0.8em"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"0.6em"},text:"Highcharts.com"}};l.chart.styledMode=!1;const c=new r(l.time);return{defaultOptions:l,defaultTime:c,getOptions:function(){return l},setOptions:function(t){return h(!0,l,t),(t.time||t.global)&&(i.time?i.time.update(h(l.global,l.time,t.global,t.time)):i.time=c),l}}})),e(i,"Core/Animation/Fx.js",[i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){const{parse:s}=t,{win:r}=e,{isNumber:n,objectEach:o}=i;class a{constructor(t,e,i){this.pos=NaN,this.options=e,this.elem=t,this.prop=i}dSetter(){var t=this.paths;const e=t&&t[0];t=t&&t[1];const i=this.now||0;let s=[];if(1!==i&&e&&t)if(e.length===t.length&&1>i)for(let r=0;r=n+this.startTime?(this.now=this.end,this.pos=1,this.update(),h=a[this.prop]=!0,o(a,(function(t){!0!==t&&(h=!1)})),h&&r&&r.call(s),t=!1):(this.pos=i.easing((e-this.startTime)/n),this.now=this.start+(this.end-this.start)*this.pos,this.update(),t=!0),t}initPath(t,e,i){function s(t,e){for(;t.length{t=i(t.options.animation),o=e&&r(e.defer)?n.defer:Math.max(o,t.duration+t.defer),a=Math.min(n.duration,t.duration)})),t.renderer.forExport&&(o=0),{defer:Math.max(0,o-a),duration:Math.min(o,a)}},setAnimation:function(t,e){e.renderer.globalAnimation=d(t,e.options.chart.animation,!0)},stop:s}})),e(i,"Core/Renderer/HTML/AST.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){const{SVG_NS:i,win:s}=t,{attr:r,createElement:n,css:o,error:a,isFunction:h,isString:l,objectEach:c,splat:d}=e;({trustedTypes:e}=s);const u=e&&h(e.createPolicy)&&e.createPolicy("highcharts",{createHTML:t=>t});e=u?u.createHTML(""):"";try{var p=!!(new DOMParser).parseFromString(e,"text/html")}catch(t){p=!1}const m=p;class g{static filterUserAttributes(t){return c(t,((e,i)=>{let s=!0;-1===g.allowedAttributes.indexOf(i)&&(s=!1),-1!==["background","dynsrc","href","lowsrc","src"].indexOf(i)&&(s=l(e)&&g.allowedReferences.some((t=>0===e.indexOf(t)))),s||(a(33,!1,void 0,{"Invalid attribute in config":`${i}`}),delete t[i]),l(e)&&t[i]&&(t[i]=e.replace(/{const i=(e=e.split(":").map((t=>t.trim()))).shift();return i&&e.length&&(t[i.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))]=e.join(":")),t}),{})}static setElementHTML(t,e){t.innerHTML=g.emptyHTML,e&&new g(e).addToDOM(t)}constructor(t){this.nodes="string"==typeof t?this.parseMarkup(t):t}addToDOM(e){return function e(s,n){let h;return d(s).forEach((function(s){var l=s.tagName;const d=s.textContent?t.doc.createTextNode(s.textContent):void 0,u=g.bypassHTMLFiltering;let p;if(l)if("#text"===l)p=d;else if(-1!==g.allowedTags.indexOf(l)||u){l=t.doc.createElementNS("svg"===l?i:n.namespaceURI||i,l);const a=s.attributes||{};c(s,(function(t,e){"tagName"!==e&&"attributes"!==e&&"children"!==e&&"style"!==e&&"textContent"!==e&&(a[e]=t)})),r(l,u?a:g.filterUserAttributes(a)),s.style&&o(l,s.style),d&&l.appendChild(d),e(s.children||[],l),p=l}else a(33,!1,void 0,{"Invalid tagName in config":l});p&&n.appendChild(p),h=p})),h}(this.nodes,e)}parseMarkup(t){const e=[];if(t=t.trim().replace(/ style=(["'])/g," data-style=$1"),m)t=(new DOMParser).parseFromString(u?u.createHTML(t):t,"text/html");else{const e=n("div");e.innerHTML=t,t={body:e}}const i=(t,e)=>{var s=t.nodeName.toLowerCase();const r={tagName:s};if("#text"===s&&(r.textContent=t.textContent||""),s=t.attributes){const t={};[].forEach.call(s,(e=>{"data-style"===e.name?r.style=g.parseStyle(e.value):t[e.name]=e.value})),r.attributes=t}if(t.childNodes.length){const e=[];[].forEach.call(t.childNodes,(t=>{i(t,e)})),e.length&&(r.children=e)}e.push(r)};return[].forEach.call(t.body.childNodes,(t=>i(t,e))),e}}return g.allowedAttributes="alt aria-controls aria-describedby aria-expanded aria-haspopup aria-hidden aria-label aria-labelledby aria-live aria-pressed aria-readonly aria-roledescription aria-selected class clip-path color colspan cx cy d dx dy disabled fill flood-color flood-opacity height href id in markerHeight markerWidth offset opacity orient padding paddingLeft paddingRight patternUnits r refX refY role scope slope src startOffset stdDeviation stroke stroke-linecap stroke-width style tableValues result rowspan summary target tabindex text-align text-anchor textAnchor textLength title type valign width x x1 x2 xlink:href y y1 y2 zIndex".split(" "),g.allowedReferences="https:// http:// mailto: / ../ ./ #".split(" "),g.allowedTags="a abbr b br button caption circle clipPath code dd defs div dl dt em feComponentTransfer feDropShadow feFuncA feFuncB feFuncG feFuncR feGaussianBlur feOffset feMerge feMergeNode filter h1 h2 h3 h4 h5 h6 hr i img li linearGradient marker ol p path pattern pre rect small span stop strong style sub sup svg table text textPath thead title tbody tspan td th tr u ul #text".split(" "),g.emptyHTML=e,g.bypassHTMLFiltering=!1,g})),e(i,"Core/Templating.js",[i["Core/Defaults.js"],i["Core/Utilities.js"]],(function(t,e){function i(t="",e,o){const h=/\{([a-zA-Z0-9:\.,;\-\/<>%_@"'= #\(\)]+)\}/g,l=/\(([a-zA-Z0-9:\.,;\-\/<>%_@"'= ]+)\)/g,c=[],u=/f$/,m=/\.([0-9])/,g=r.lang,f=o&&o.time||n,v=o&&o.numberFormatter||s,b=(t="")=>{let i;return"true"===t||"false"!==t&&((i=Number(t)).toString()===t?i:a(t,e))};let y,x,w,S=0;for(;null!==(y=h.exec(t));){const i=l.exec(y[1]);i&&(y=i,w=!0),x&&x.isBlock||(x={ctx:e,expression:y[1],find:y[0],isBlock:"#"===y[1].charAt(0),start:y.index,startInner:y.index+y[0].length,length:y[0].length});var C=y[1].split(" ")[0].replace("#","");if(p[C]&&(x.isBlock&&C===x.fn&&S++,x.fn||(x.fn=C)),C="else"===y[1],x.isBlock&&x.fn&&(y[1]===`/${x.fn}`||C))if(S)C||S--;else{var k=x.startInner;k=t.substr(k,y.index-k),void 0===x.body?(x.body=k,x.startInner=y.index+y[0].length):x.elseBody=k,x.find+=k+y[0],C||(c.push(x),x=void 0)}else x.isBlock||c.push(x);if(i&&(null==x||!x.isBlock))break}return c.forEach((s=>{const{body:r,elseBody:n,expression:o,fn:a}=s;var h;if(a){var l=[s],c=o.split(" ");for(h=p[a].length;h--;)l.unshift(b(c[h+1]));h=p[a].apply(e,l),s.isBlock&&"boolean"==typeof h&&(h=i(h?r:n,e))}else l=o.split(":"),h=b(l.shift()||""),l.length&&"number"==typeof h&&(l=l.join(":"),u.test(l)?(c=parseInt((l.match(m)||["","-1"])[1],10),null!==h&&(h=v(h,c,g.decimalPoint,-1a[1]){var c=e+ +a[1];0<=c?(a[0]=(+a[0]).toExponential(c).split("e")[0],e=c):(a[0]=a[0].split(".")[0]||0,t=20>e?(a[0]*Math.pow(10,a[1])).toFixed(e):0,a[1]=0)}}else e=2;c=(Math.abs(a[1]?a[0]:t)+Math.pow(10,-Math.max(e,o)-1)).toFixed(e);const p=3<(o=String(u(c))).length?o.length%3:0;return i=d(i,n.decimalPoint),s=d(s,n.thousandsSep),t=(0>t?"-":"")+(p?o.substr(0,p)+s:""),t=0>+a[1]&&!h?"0":t+o.substr(p).replace(/(\d{3})(?=\d)/g,"$1"+s),e&&(t+=i+c.slice(-e)),a[1]&&0!=+t&&(t+="e"+a[1]),t}const{defaultOptions:r,defaultTime:n}=t,{extend:o,getNestedProperty:a,isArray:h,isNumber:l,isObject:c,pick:d,pInt:u}=e,p={add:(t,e)=>t+e,divide:(t,e)=>0!==e?t/e:"",eq:(t,e)=>t==e,each:function(t){const e=arguments[arguments.length-1];return!!h(t)&&t.map(((s,r)=>i(e.body,o(c(s)?s:{"@this":s},{"@index":r,"@first":0===r,"@last":r===t.length-1})))).join("")},ge:(t,e)=>t>=e,gt:(t,e)=>t>e,if:t=>!!t,le:(t,e)=>t<=e,lt:(t,e)=>tt*e,ne:(t,e)=>t!=e,subtract:(t,e)=>t-e,unless:t=>!t};return{dateFormat:function(t,e,i){return n.dateFormat(t,e,i)},format:i,helpers:p,numberFormat:s}})),e(i,"Core/Renderer/RendererUtilities.js",[i["Core/Utilities.js"]],(function(t){const{clamp:e,pick:i,stableSort:s}=t;var r;return function(t){t.distribute=function t(r,n,o){const a=r;var h=a.reducedLen||n,l=(t,e)=>(e.rank||0)-(t.rank||0);const c=(t,e)=>t.target-e.target;let d,u=!0,p=[],m=0;for(d=r.length;d--;)m+=r[d].size;if(m>h){for(s(r,l),m=d=0;m<=h;)m+=r[d].size,d++;p=r.splice(d-1,r.length)}for(s(r,c),r=r.map((t=>({size:t.size,targets:[t.target],align:i(t.align,.5)})));u;){for(d=r.length;d--;)h=r[d],l=(Math.min.apply(0,h.targets)+Math.max.apply(0,h.targets))/2,h.pos=e(l-h.size*h.align,0,n-h.size);for(d=r.length,u=!1;d--;)0r[d].pos&&(r[d-1].size+=r[d].size,r[d-1].targets=r[d-1].targets.concat(r[d].targets),r[d-1].align=.5,r[d-1].pos+r[d-1].size>n&&(r[d-1].pos=n-r[d-1].size),r.splice(d,1),u=!0)}return a.push.apply(a,p),d=0,r.some((e=>{let i=0;return(e.targets||[]).some((()=>(a[d].pos=e.pos+i,void 0!==o&&Math.abs(a[d].pos-a[d].target)>o?(a.slice(0,d+1).forEach((t=>delete t.pos)),a.reducedLen=(a.reducedLen||n)-.1*n,a.reducedLen>.1*n&&t(a,n,o),!0):(i+=a[d].size,d++,!1))))})),s(a,c),a}}(r||(r={})),r})),e(i,"Core/Renderer/SVG/SVGElement.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i,s){const{animate:r,animObject:n,stop:o}=t,{deg2rad:a,doc:h,svg:l,SVG_NS:c,win:d}=i,{addEvent:u,attr:p,createElement:m,css:g,defined:f,erase:v,extend:b,fireEvent:y,isArray:x,isFunction:w,isObject:S,isString:C,merge:k,objectEach:A,pick:M,pInt:E,syncTimeout:T,uniqueKey:L}=s;class O{constructor(){this.element=void 0,this.onEvents={},this.opacity=1,this.renderer=void 0,this.SVG_NS=c}_defaultGetter(t){return t=M(this[t+"Value"],this[t],this.element?this.element.getAttribute(t):null,0),/^[\-0-9\.]+$/.test(t)&&(t=parseFloat(t)),t}_defaultSetter(t,e,i){i.setAttribute(e,t)}add(t){const e=this.renderer,i=this.element;let s;return t&&(this.parentGroup=t),void 0!==this.textStr&&"text"===this.element.nodeName&&e.buildText(this),this.added=!0,(!t||t.handleZ||this.zIndex)&&(s=this.zIndexSetter()),s||(t?t.element:e.box).appendChild(i),this.onAdd&&this.onAdd(),this}addClass(t,e){const i=e?"":this.attr("class")||"";return t=(t||"").split(/ /g).reduce((function(t,e){return-1===i.indexOf(e)&&t.push(e),t}),i?[i]:[]).join(" "),t!==i&&this.attr("class",t),this}afterSetters(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)}align(t,e,i){const s={};var r,n=this.renderer,o=n.alignedObjects;let a,h;t?(this.alignOptions=t,this.alignByTranslate=e,(!i||C(i))&&(this.alignTo=r=i||"renderer",v(o,this),o.push(this),i=void 0)):(t=this.alignOptions,e=this.alignByTranslate,r=this.alignTo),i=M(i,n[r],"scrollablePlotBox"===r?n.plotBox:void 0,n),r=t.align;const l=t.verticalAlign;return n=(i.x||0)+(t.x||0),o=(i.y||0)+(t.y||0),"right"===r?a=1:"center"===r&&(a=2),a&&(n+=(i.width-(t.width||0))/a),s[e?"translateX":"x"]=Math.round(n),"bottom"===l?h=1:"middle"===l&&(h=2),h&&(o+=(i.height-(t.height||0))/h),s[e?"translateY":"y"]=Math.round(o),this[this.placed?"animate":"attr"](s),this.placed=!0,this.alignAttr=s,this}alignSetter(t){const e={left:"start",center:"middle",right:"end"};e[t]&&(this.alignValue=t,this.element.setAttribute("text-anchor",e[t]))}animate(t,e,i){const s=n(M(e,this.renderer.globalAnimation,!0));return e=s.defer,h.hidden&&(s.duration=0),0!==s.duration?(i&&(s.complete=i),T((()=>{this.element&&r(this,t,s)}),e)):(this.attr(t,void 0,i||s.complete),A(t,(function(t,e){s.step&&s.step.call(this,t,{prop:e,pos:1,elem:this})}),this)),this}applyTextOutline(t){const e=this.element;-1!==t.indexOf("contrast")&&(t=t.replace(/contrast/g,this.renderer.getContrast(e.style.fill)));var s=t.split(" ");if(t=s[s.length-1],(s=s[0])&&"none"!==s&&i.svg){this.fakeTS=!0,s=s.replace(/(^[\d\.]+)(.*?)$/g,(function(t,e,i){return 2*Number(e)+i})),this.removeTextOutline();const i=h.createElementNS(c,"tspan");p(i,{class:"highcharts-text-outline",fill:t,stroke:t,"stroke-width":s,"stroke-linejoin":"round"}),t=e.querySelector("textPath")||e,[].forEach.call(t.childNodes,(t=>{const e=t.cloneNode(!0);e.removeAttribute&&["fill","stroke","stroke-width","stroke"].forEach((t=>e.removeAttribute(t))),i.appendChild(e)}));let r=0;[].forEach.call(t.querySelectorAll("text tspan"),(t=>{r+=Number(t.getAttribute("dy"))})),(s=h.createElementNS(c,"tspan")).textContent="​",p(s,{x:Number(e.getAttribute("x")),dy:-r}),i.appendChild(s),t.insertBefore(i,t.firstChild)}}attr(t,e,i,s){const r=this.element,n=O.symbolCustomAttribs;let a,h,l,c,d=this;return"string"==typeof t&&void 0!==e&&(a=t,(t={})[a]=e),"string"==typeof t?d=(this[t+"Getter"]||this._defaultGetter).call(this,t,r):(A(t,(function(e,i){l=!1,s||o(this,i),this.symbolName&&-1!==n.indexOf(i)&&(h||(this.symbolAttr(t),h=!0),l=!0),!this.rotation||"x"!==i&&"y"!==i||(this.doTransform=!0),l||(c=this[i+"Setter"]||this._defaultSetter,c.call(this,e,i,r))}),this),this.afterSetters()),i&&i.call(this),d}clip(t){return this.attr("clip-path",t?"url("+this.renderer.url+"#"+t.id+")":"none")}crisp(t,e){e=e||t.strokeWidth||0;const i=Math.round(e)%2/2;return t.x=Math.floor(t.x||this.x||0)+i,t.y=Math.floor(t.y||this.y||0)+i,t.width=Math.floor((t.width||this.width||0)-2*i),t.height=Math.floor((t.height||this.height||0)-2*i),f(t.strokeWidth)&&(t.strokeWidth=e),t}complexColor(t,i,s){const r=this.renderer;let n,o,a,h,l,c,d,u,p,m,g,v=[];y(this.renderer,"complexColor",{args:arguments},(function(){if(t.radialGradient?o="radialGradient":t.linearGradient&&(o="linearGradient"),o){if(a=t[o],l=r.gradients,c=t.stops,p=s.radialReference,x(a)&&(t[o]=a={x1:a[0],y1:a[1],x2:a[2],y2:a[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===o&&p&&!f(a.gradientUnits)&&(h=a,a=k(a,r.getRadialAttr(p,h),{gradientUnits:"userSpaceOnUse"})),A(a,(function(t,e){"id"!==e&&v.push(e,t)})),A(c,(function(t){v.push(t)})),v=v.join(","),l[v])m=l[v].attr("id");else{a.id=m=L();const t=l[v]=r.createElement(o).attr(a).add(r.defs);t.radAttr=h,t.stops=[],c.forEach((function(i){0===i[1].indexOf("rgba")?(n=e.parse(i[1]),d=n.get("rgb"),u=n.get("a")):(d=i[1],u=1),i=r.createElement("stop").attr({offset:i[0],"stop-color":d,"stop-opacity":u}).add(t),t.stops.push(i)}))}g="url("+r.url+"#"+m+")",s.setAttribute(i,g),s.gradient=v,t.toString=function(){return g}}}))}css(t){const e=this.styles,i={},s=this.element;let r,n=!e;if(e&&A(t,(function(t,s){e&&e[s]!==t&&(i[s]=t,n=!0)})),n){e&&(t=b(e,i)),null===t.width||"auto"===t.width?delete this.textWidth:"text"===s.nodeName.toLowerCase()&&t.width&&(r=this.textWidth=E(t.width)),this.styles=t,r&&!l&&this.renderer.forExport&&delete t.width;const n=k(t);s.namespaceURI===this.SVG_NS&&(["textOutline","textOverflow","width"].forEach((t=>n&&delete n[t])),n.color&&(n.fill=n.color)),g(s,n)}return this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),t.textOutline&&this.applyTextOutline(t.textOutline)),this}dashstyleSetter(t){let e=this["stroke-width"];if("inherit"===e&&(e=1),t=t&&t.toLowerCase()){const i=t.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(t=i.length;t--;)i[t]=""+E(i[t])*M(e,NaN);t=i.join(",").replace(/NaN/g,"none"),this.element.setAttribute("stroke-dasharray",t)}}destroy(){const t=this;var e=t.element||{};const i=t.renderer;var s=e.ownerSVGElement;let r="SPAN"===e.nodeName&&t.parentGroup||void 0;if(e.onclick=e.onmouseout=e.onmouseover=e.onmousemove=e.point=null,o(t),t.clipPath&&s){const e=t.clipPath;[].forEach.call(s.querySelectorAll("[clip-path],[CLIP-PATH]"),(function(t){-1e&&e.join?(i?t+" ":"")+e.join(" "):(e||"").toString()),"")),/(NaN| {2}|^$)/.test(t)&&(t="M 0 0"),this[e]!==t&&(i.setAttribute(e,t),this[e]=t)}fadeOut(t){const e=this;e.animate({opacity:0},{duration:M(t,150),complete:function(){e.hide()}})}fillSetter(t,e,i){"string"==typeof t?i.setAttribute(e,t):t&&this.complexColor(t,e,i)}getBBox(t,e){const{alignValue:i,element:s,renderer:r,styles:n,textStr:o}=this,{cache:h,cacheKeys:l}=r;var c=s.namespaceURI===this.SVG_NS;e=M(e,this.rotation,0);var d=r.styledMode?s&&O.prototype.getStyle.call(s,"font-size"):n&&n.fontSize;let u,p;if(f(o)&&(p=o.toString(),-1===p.indexOf("<")&&(p=p.replace(/[0-9]/g,"0")),p+=["",r.rootFontSize,d,e,this.textWidth,i,n&&n.textOverflow,n&&n.fontWeight].join()),p&&!t&&(u=h[p]),!u){if(c||r.forExport){try{var m=this.fakeTS&&function(t){const e=s.querySelector(".highcharts-text-outline");e&&g(e,{display:t})};w(m)&&m("none"),u=s.getBBox?b({},s.getBBox()):{width:s.offsetWidth,height:s.offsetHeight,x:0,y:0},w(m)&&m("")}catch(t){}(!u||0>u.width)&&(u={x:0,y:0,width:0,height:0})}else u=this.htmlGetBBox();if(m=u.width,t=u.height,c&&(u.height=t={"11px,17":14,"13px,20":16}[`${d||""},${Math.round(t)}`]||t),e){c=Number(s.getAttribute("y")||0)-u.y,d={right:1,center:.5}[i||0]||0;var v=e*a,y=(e-90)*a,x=m*Math.cos(v);e=m*Math.sin(v);var S=Math.cos(y);v=Math.sin(y),x=(S=(y=(m=u.x+d*(m-x)+c*S)+x)-t*S)-x,e=(t=(d=(c=u.y+c-d*e+c*v)+e)-t*v)-e,u.x=Math.min(m,y,S,x),u.y=Math.min(c,d,t,e),u.width=Math.max(m,y,S,x)-u.x,u.height=Math.max(c,d,t,e)-u.y}}if(p&&(""===o||0{if(t&&o){let o=t.attr("id");o||t.attr("id",o=L());var r={x:0,y:0};f(n.dx)&&(r.dx=n.dx,delete n.dx),f(n.dy)&&(r.dy=n.dy,delete n.dy),s.attr(r),this.attr({transform:""}),this.box&&(this.box=this.box.destroy()),r=e.nodes.slice(0),e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:b(n,{"text-anchor":n.textAnchor,href:`${i}#${o}`}),children:r}}})),s.textPath={path:t,undo:e}):(s.attr({dx:0,dy:0}),delete s.textPath),this.added&&(s.textCache="",this.renderer.buildText(s)),this}shadow(t){var e;const{renderer:i}=this,s=k(90===(null===(e=this.parentGroup)||void 0===e?void 0:e.rotation)?{offsetX:-1,offsetY:-1}:{},S(t)?t:{});return e=i.shadowDefinition(s),this.attr({filter:t?`url(${i.url}#${e})`:"none"})}show(t=!0){return this.attr({visibility:t?"inherit":"visible"})}"stroke-widthSetter"(t,e,i){this[e]=t,i.setAttribute(e,t)}strokeWidth(){if(!this.renderer.styledMode)return this["stroke-width"]||0;const t=this.getStyle("stroke-width");let e,i=0;return t.indexOf("px")===t.length-2?i=E(t):""!==t&&(e=h.createElementNS(c,"rect"),p(e,{width:t,"stroke-width":0}),this.element.parentNode.appendChild(e),i=e.getBBox().width,e.parentNode.removeChild(e)),i}symbolAttr(t){const e=this;O.symbolCustomAttribs.forEach((function(i){e[i]=M(t[i],e[i])})),e.attr({d:e.renderer.symbols[e.symbolName](e.x,e.y,e.width,e.height,e)})}textSetter(t){t!==this.textStr&&(delete this.textPxLength,this.textStr=t,this.added&&this.renderer.buildText(this))}titleSetter(t){const e=this.element,i=e.getElementsByTagName("title")[0]||h.createElementNS(this.SVG_NS,"title");e.insertBefore?e.insertBefore(i,e.firstChild):e.appendChild(i),i.textContent=String(M(t,"")).replace(/<[^>]*>/g,"").replace(/</g,"<").replace(/>/g,">")}toFront(){const t=this.element;return t.parentNode.appendChild(t),this}translate(t,e){return this.attr({translateX:t,translateY:e})}updateTransform(){const{element:t,matrix:e,rotation:i=0,scaleX:s,scaleY:r,translateX:n=0,translateY:o=0}=this,a=["translate("+n+","+o+")"];f(e)&&a.push("matrix("+e.join(",")+")"),i&&a.push("rotate("+i+" "+M(this.rotationOriginX,t.getAttribute("x"),0)+" "+M(this.rotationOriginY,t.getAttribute("y")||0)+")"),(f(s)||f(r))&&a.push("scale("+M(s,1)+" "+M(r,1)+")"),a.length&&!(this.text||this).textPath&&t.setAttribute("transform",a.join(" "))}visibilitySetter(t,e,i){"inherit"===t?i.removeAttribute(e):this[e]!==t&&i.setAttribute(e,t),this[e]=t}xGetter(t){return"circle"===this.element.nodeName&&("x"===t?t="cx":"y"===t&&(t="cy")),this._defaultGetter(t)}zIndexSetter(t,e){var i=this.renderer,s=this.parentGroup;const r=(s||i).element||i.box,n=this.element;i=r===i.box;let o,a=!1;var h=this.added;let l;if(f(t)?(n.setAttribute("data-z-index",t),t=+t,this[e]===t&&(h=!1)):f(this[e])&&n.removeAttribute("data-z-index"),this[e]=t,h){for((t=this.zIndex)&&s&&(s.handleZ=!0),l=(e=r.childNodes).length-1;0<=l&&!a;l--)h=(s=e[l]).getAttribute("data-z-index"),o=!f(h),s!==n&&(0>t&&o&&!i&&!l?(r.insertBefore(n,e[l]),a=!0):(E(h)<=t||o&&(!f(t)||0<=t))&&(r.insertBefore(n,e[l+1]),a=!0));a||(r.insertBefore(n,e[i?3:0]),a=!0)}return a}}return O.symbolCustomAttribs="anchorX anchorY clockwise end height innerR r start width x y".split(" "),O.prototype.strokeSetter=O.prototype.fillSetter,O.prototype.yGetter=O.prototype.xGetter,O.prototype.matrixSetter=O.prototype.rotationOriginXSetter=O.prototype.rotationOriginYSetter=O.prototype.rotationSetter=O.prototype.scaleXSetter=O.prototype.scaleYSetter=O.prototype.translateXSetter=O.prototype.translateYSetter=O.prototype.verticalAlignSetter=function(t,e){this[e]=t,this.doTransform=!0},O})),e(i,"Core/Renderer/RendererRegistry.js",[i["Core/Globals.js"]],(function(t){var e;return function(e){let i;e.rendererTypes={},e.getRendererType=function(t=i){return e.rendererTypes[t]||e.rendererTypes[i]},e.registerRendererType=function(s,r,n){e.rendererTypes[s]=r,i&&!n||(i=s,t.Renderer=r)}}(e||(e={})),e})),e(i,"Core/Renderer/SVG/SVGLabel.js",[i["Core/Renderer/SVG/SVGElement.js"],i["Core/Utilities.js"]],(function(t,e){const{defined:i,extend:s,isNumber:r,merge:n,pick:o,removeEvent:a}=e;class h extends t{constructor(t,e,i,s,r,n,o,a,l,c){let d;super(),this.paddingRightSetter=this.paddingLeftSetter=this.paddingSetter,this.init(t,"g"),this.textStr=e,this.x=i,this.y=s,this.anchorX=n,this.anchorY=o,this.baseline=l,this.className=c,this.addClass("button"===c?"highcharts-no-tooltip":"highcharts-label"),c&&this.addClass("highcharts-"+c),this.text=t.text(void 0,0,0,a).attr({zIndex:1}),"string"==typeof r&&((d=/^url\((.*?)\)$/.test(r))||this.renderer.symbols[r])&&(this.symbolKey=r),this.bBox=h.emptyBBox,this.padding=3,this.baselineOffset=0,this.needsBox=t.styledMode||d,this.deferredAttr={},this.alignFactor=0}alignSetter(t){(t={left:0,center:.5,right:1}[t])!==this.alignFactor&&(this.alignFactor=t,this.bBox&&r(this.xSetting)&&this.attr({x:this.xSetting}))}anchorXSetter(t,e){this.anchorX=t,this.boxAttr(e,Math.round(t)-this.getCrispAdjust()-this.xSetting)}anchorYSetter(t,e){this.anchorY=t,this.boxAttr(e,t-this.ySetting)}boxAttr(t,e){this.box?this.box.attr(t,e):this.deferredAttr[t]=e}css(e){if(e){const t={};e=n(e),h.textProps.forEach((i=>{void 0!==e[i]&&(t[i]=e[i],delete e[i])})),this.text.css(t),"fontSize"in t||"fontWeight"in t?this.updateTextPadding():("width"in t||"textOverflow"in t)&&this.updateBoxSize()}return t.prototype.css.call(this,e)}destroy(){a(this.element,"mouseenter"),a(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),t.prototype.destroy.call(this)}fillSetter(t,e){t&&(this.needsBox=!0),this.fill=t,this.boxAttr(e,t)}getBBox(){this.textStr&&0===this.bBox.width&&0===this.bBox.height&&this.updateBoxSize();const t=this.padding,e=o(this.paddingLeft,t);return{width:this.width,height:this.height,x:this.bBox.x-e,y:this.bBox.y-t}}getCrispAdjust(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2}heightSetter(t){this.heightSetting=t}onAdd(){this.text.add(this),this.attr({text:o(this.textStr,""),x:this.x||0,y:this.y||0}),this.box&&i(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})}paddingSetter(t,e){r(t)?t!==this[e]&&(this[e]=t,this.updateTextPadding()):this[e]=void 0}rSetter(t,e){this.boxAttr(e,t)}strokeSetter(t,e){this.stroke=t,this.boxAttr(e,t)}"stroke-widthSetter"(t,e){t&&(this.needsBox=!0),this["stroke-width"]=t,this.boxAttr(e,t)}"text-alignSetter"(t){this.textAlign=t}textSetter(t){void 0!==t&&this.text.attr({text:t}),this.updateTextPadding()}updateBoxSize(){var t=this.text;const e={},n=this.padding,o=this.bBox=r(this.widthSetting)&&r(this.heightSetting)&&!this.textAlign||!i(t.textStr)?h.emptyBBox:t.getBBox();this.width=this.getPaddedWidth(),this.height=(this.heightSetting||o.height||0)+2*n;const a=this.renderer.fontMetrics(t);this.baselineOffset=n+Math.min((this.text.firstLineMetrics||a).b,o.height||1/0),this.heightSetting&&(this.baselineOffset+=(this.heightSetting-a.h)/2),this.needsBox&&!t.textPath&&(this.box||((t=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect()).addClass(("button"===this.className?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),t.add(this)),t=this.getCrispAdjust(),e.x=t,e.y=(this.baseline?-this.baselineOffset:0)+t,e.width=Math.round(this.width),e.height=Math.round(this.height),this.box.attr(s(e,this.deferredAttr)),this.deferredAttr={})}updateTextPadding(){const t=this.text;if(!t.textPath){this.updateBoxSize();const e=this.baseline?0:this.baselineOffset;let s=o(this.paddingLeft,this.padding);i(this.widthSetting)&&this.bBox&&("center"===this.textAlign||"right"===this.textAlign)&&(s+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width)),s===t.x&&e===t.y||(t.attr("x",s),t.hasBoxWidthChanged&&(this.bBox=t.getBBox(!0)),void 0!==e&&t.attr("y",e)),t.x=s,t.y=e}}widthSetter(t){this.widthSetting=r(t)?t:void 0}getPaddedWidth(){var t=this.padding;const e=o(this.paddingLeft,t);return t=o(this.paddingRight,t),(this.widthSetting||this.bBox.width||0)+e+t}xSetter(t){this.x=t,this.alignFactor&&(t-=this.alignFactor*this.getPaddedWidth(),this["forceAnimate:x"]=!0),this.xSetting=Math.round(t),this.attr("translateX",this.xSetting)}ySetter(t){this.ySetting=this.y=Math.round(t),this.attr("translateY",this.ySetting)}}return h.emptyBBox={width:0,height:0,x:0,y:0},h.textProps="color direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow whiteSpace width".split(" "),h})),e(i,"Core/Renderer/SVG/Symbols.js",[i["Core/Utilities.js"]],(function(t){function e(t,e,i,s,n){const a=[];if(n){const h=n.start||0,l=o(n.r,i);i=o(n.r,s||i),s=(n.end||0)-.001;const c=n.innerR,d=o(n.open,.001>Math.abs((n.end||0)-h-2*Math.PI)),u=Math.cos(h),p=Math.sin(h),m=Math.cos(s),g=Math.sin(s),f=o(n.longArc,.001>s-h-Math.PI?0:1);let v=["A",l,i,0,f,o(n.clockwise,1),t+l*m,e+i*g];v.params={start:h,end:s,cx:t,cy:e},a.push(["M",t+l*u,e+i*p],v),r(c)&&(v=["A",c,c,0,f,r(n.clockwise)?1-n.clockwise:0,t+c*u,e+c*p],v.params={start:s,end:h,cx:t,cy:e},a.push(d?["M",t+c*m,e+c*g]:["L",t+c*m,e+c*g],v)),d||a.push(["Z"])}return a}function i(t,e,i,r,n){return n&&n.r?s(t,e,i,r,n):[["M",t,e],["L",t+i,e],["L",t+i,e+r],["L",t,e+r],["Z"]]}function s(t,e,i,s,r){return[["M",t+(r=(null==r?void 0:r.r)||0),e],["L",t+i-r,e],["A",r,r,0,0,1,t+i,e+r],["L",t+i,e+s-r],["A",r,r,0,0,1,t+i-r,e+s],["L",t+r,e+s],["A",r,r,0,0,1,t,e+s-r],["L",t,e+r],["A",r,r,0,0,1,t+r,e],["Z"]]}const{defined:r,isNumber:n,pick:o}=t;return{arc:e,callout:function(t,e,i,r,o){const a=Math.min(o&&o.r||0,i,r),h=a+6,l=o&&o.anchorX;o=o&&o.anchorY||0;const c=s(t,e,i,r,{r:a});return n(l)?(t+l>=i?o>e+h&&o=t+l?o>e+h&&or&&l>t+h&&lo&&l>t+h&&l/g;var c=[n,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,e.getStyle("font-size"),this.width].join();if(c!==e.textCache){for(e.textCache=c,delete e.actualWidth,c=a.length;c--;)i.removeChild(a[c]);o||this.ellipsis||this.width||e.textPath||-1!==n.indexOf(" ")&&(!this.noWrap||h.test(n))?""!==n&&(r&&r.appendChild(i),n=new t(n),this.modifyTree(n.nodes),n.addToDOM(i),this.modifyDOM(),this.ellipsis&&-1!==(i.textContent||"").indexOf("…")&&e.attr("title",this.unescapeEntities(e.textStr||"",["<",">"])),r&&r.removeChild(i)):i.appendChild(s.createTextNode(this.unescapeEntities(n))),l(this.textOutline)&&e.applyTextOutline&&e.applyTextOutline(this.textOutline)}}modifyDOM(){const t=this.svgElement,e=o(t.element,"x");let i;for(t.firstLineMetrics=void 0;(i=t.element.firstChild)&&/^[\s\u200B]*$/.test(i.textContent||" ");)t.element.removeChild(i);[].forEach.call(t.element.querySelectorAll("tspan.highcharts-br"),((i,s)=>{i.nextSibling&&i.previousSibling&&(0===s&&1===i.previousSibling.nodeType&&(t.firstLineMetrics=t.renderer.fontMetrics(i.previousSibling)),o(i,{dy:this.getLineHeight(i.nextSibling),x:e}))}));const a=this.width||0;if(a){var h=(i,n)=>{var h=i.textContent||"";const l=h.replace(/([^\^])-/g,"$1- ").split(" ");var c=!this.noWrap&&(1t.substring(0,e)+"…"));else if(c){for(h=[],c=[];n.firstChild&&n.firstChild!==i;)c.push(n.firstChild),n.removeChild(n.firstChild);for(;l.length;)l.length&&!this.noWrap&&0l.slice(0,e).join(" ").replace(/- /g,"-"))),p=t.actualWidth,u++;c.forEach((t=>{n.insertBefore(t,i)})),h.forEach((t=>{n.insertBefore(s.createTextNode(t),i),(t=s.createElementNS(r,"tspan")).textContent="​",o(t,{dy:d,x:e}),n.insertBefore(t,i)}))}},l=e=>{[].slice.call(e.childNodes).forEach((i=>{i.nodeType===n.Node.TEXT_NODE?h(i,e):(-1!==i.className.baseVal.indexOf("highcharts-br")&&(t.actualWidth=0),l(i))}))};l(t.element)}}getLineHeight(t){return t=t.nodeType===n.Node.TEXT_NODE?t.parentElement:t,this.textLineHeight?parseInt(this.textLineHeight.toString(),10):this.renderer.fontMetrics(t||this.svgElement.element).h}modifyTree(t){const e=(i,s)=>{const{attributes:r={},children:n,style:o={},tagName:h}=i,l=this.renderer.styledMode;"b"===h||"strong"===h?l?r.class="highcharts-strong":o.fontWeight="bold":"i"!==h&&"em"!==h||(l?r.class="highcharts-emphasized":o.fontStyle="italic"),o&&o.color&&(o.fill=o.color),"br"===h?(r.class="highcharts-br",i.textContent="​",(s=t[s+1])&&s.textContent&&(s.textContent=s.textContent.replace(/^ +/gm,""))):"a"===h&&n&&n.some((t=>"#text"===t.tagName))&&(i.children=[{children:n,tagName:"tspan"}]),"#text"!==h&&"a"!==h&&(i.tagName="tspan"),a(i,{attributes:r,style:o}),n&&n.filter((t=>"#text"!==t.tagName)).forEach(e)};t.forEach(e),h(this.svgElement,"afterModifyTree",{nodes:t})}truncate(t,e,i,s,r,n){const o=this.svgElement,{rotation:a}=o,h=[];let l,c,d=i?1:0,u=(e||i||"").length,p=u;const m=function(e,r){if(e=r||e,(r=t.parentNode)&&void 0===h[e]&&r.getSubStringLength)try{h[e]=s+r.getSubStringLength(0,i?e+1:e)}catch(t){}return h[e]};if(o.rotation=0,c=m(t.textContent.length),s+c>r){for(;d<=u;)p=Math.ceil((d+u)/2),i&&(l=n(i,p)),c=m(p,l&&l.length-1),d===u?d=u+1:c>r?u=p-1:d=p;0===u?t.textContent="":e&&u===e.length-1||(t.textContent=l||n(e||i,p))}i&&i.splice(0,p),o.actualWidth=c,o.rotation=a}unescapeEntities(t,e){return c(this.renderer.escapes,(function(i,s){e&&-1!==e.indexOf(i)||(t=t.toString().replace(new RegExp(i,"g"),s))})),t}}})),e(i,"Core/Renderer/SVG/SVGRenderer.js",[i["Core/Renderer/HTML/AST.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Renderer/RendererRegistry.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Renderer/SVG/SVGLabel.js"],i["Core/Renderer/SVG/Symbols.js"],i["Core/Renderer/SVG/TextBuilder.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r,n,o,a,h){const{charts:l,deg2rad:c,doc:d,isFirefox:u,isMS:p,isWebKit:m,noop:g,SVG_NS:f,symbolSizes:v,win:b}=i,{addEvent:y,attr:x,createElement:w,css:S,defined:C,destroyObjectProperties:k,extend:A,isArray:M,isNumber:E,isObject:T,isString:L,merge:O,pick:P,pInt:D,uniqueKey:R}=h;let I;class B{constructor(t,e,i,s,r,n,o){this.width=this.url=this.style=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0,this.init(t,e,i,s,r,n,o)}init(t,e,i,s,r,n,o){const a=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"}),h=a.element;let l;o||a.css(this.getStyle(s)),t.appendChild(h),x(t,"dir","ltr"),-1===t.innerHTML.indexOf("xmlns")&&x(h,"xmlns",this.SVG_NS),this.box=h,this.boxWrapper=a,this.alignedObjects=[],this.url=this.getReferenceURL(),this.createElement("desc").add().element.appendChild(d.createTextNode("Created with Highcharts 11.1.0")),this.defs=this.createElement("defs").add(),this.allowHTML=n,this.forExport=r,this.styledMode=o,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.rootFontSize=a.getStyle("font-size"),this.setSize(e,i,!1),u&&t.getBoundingClientRect&&((e=function(){S(t,{left:0,top:0}),l=t.getBoundingClientRect(),S(t,{left:Math.ceil(l.left)-l.left+"px",top:Math.ceil(l.top)-l.top+"px"})})(),this.unSubPixelFix=y(b,"resize",e))}definition(e){return new t([e]).addToDOM(this.defs.element)}getReferenceURL(){if((u||m)&&d.getElementsByTagName("base").length){if(!C(I)){var e=R();e=new t([{tagName:"svg",attributes:{width:8,height:8},children:[{tagName:"defs",children:[{tagName:"clipPath",attributes:{id:e},children:[{tagName:"rect",attributes:{width:4,height:4}}]}]},{tagName:"rect",attributes:{id:"hitme",width:8,height:8,"clip-path":`url(#${e})`,fill:"rgba(0,0,0,0.001)"}}]}]).addToDOM(d.body),S(e,{position:"fixed",top:0,left:0,zIndex:9e5});const i=d.elementFromPoint(6,6);I="hitme"===(i&&i.id),d.body.removeChild(e)}if(I)return b.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20")}return""}getStyle(t){return this.style=A({fontFamily:"Helvetica, Arial, sans-serif",fontSize:"1rem"},t)}setStyle(t){this.boxWrapper.css(this.getStyle(t))}isHidden(){return!this.boxWrapper.getBBox().width}destroy(){const t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),k(this.gradients||{}),this.gradients=null,this.defs=t.destroy(),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null}createElement(t){const e=new this.Element;return e.init(this,t),e}getRadialAttr(t,e){return{cx:t[0]-t[2]/2+(e.cx||0)*t[2],cy:t[1]-t[2]/2+(e.cy||0)*t[2],r:(e.r||0)*t[2]}}shadowDefinition(t){const e=[`highcharts-drop-shadow-${this.chartIndex}`,...Object.keys(t).map((e=>t[e]))].join("-").replace(/[^a-z0-9\-]/g,""),i=O({color:"#000000",offsetX:1,offsetY:1,opacity:.15,width:5},t);return this.defs.element.querySelector(`#${e}`)||this.definition({tagName:"filter",attributes:{id:e},children:[{tagName:"feDropShadow",attributes:{dx:i.offsetX,dy:i.offsetY,"flood-color":i.color,"flood-opacity":Math.min(5*i.opacity,1),stdDeviation:i.width/2}}]}),e}buildText(t){new a(t).buildSVG()}getContrast(t){return 1.05/(.05+(t=.2126*(t=e.parse(t).rgba.map((t=>.03928>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4))))[0]+.7152*t[1]+.0722*t[2]))>(t+.05)/.05?"#FFFFFF":"#000000"}button(e,i,s,r,n={},o,a,h,l,c){const d=this.label(e,i,s,l,void 0,void 0,c,void 0,"button"),u=this.styledMode;e=n.states||{};let m=0;delete(n=O(n)).states;const g=O({color:"#333333",cursor:"pointer",fontSize:"0.8em",fontWeight:"normal"},n.style);delete n.style;let f,v,b,x=t.filterUserAttributes(n);return d.attr(O({padding:8,r:2},x)),u||(x=O({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1},x),o=O(x,{fill:"#e6e6e6"},t.filterUserAttributes(o||e.hover||{})),f=o.style,delete o.style,a=O(x,{fill:"#e6e9ff",style:{color:"#000000",fontWeight:"bold"}},t.filterUserAttributes(a||e.select||{})),v=a.style,delete a.style,h=O(x,{style:{color:"#cccccc"}},t.filterUserAttributes(h||e.disabled||{})),b=h.style,delete h.style),y(d.element,p?"mouseover":"mouseenter",(function(){3!==m&&d.setState(1)})),y(d.element,p?"mouseout":"mouseleave",(function(){3!==m&&d.setState(m)})),d.setState=function(t){1!==t&&(d.state=m=t),d.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][t||0]),u||(d.attr([x,o,a,h][t||0]),T(t=[g,f,v,b][t||0])&&d.css(t))},u||(d.attr(x).css(A({cursor:"default"},g)),c&&d.text.css({pointerEvents:"none"})),d.on("touchstart",(t=>t.stopPropagation())).on("click",(function(t){3!==m&&r.call(d,t)}))}crispLine(t,e,i="round"){const s=t[0],r=t[1];return C(s[1])&&s[1]===r[1]&&(s[1]=r[1]=Math[i](s[1])-e%2/2),C(s[2])&&s[2]===r[2]&&(s[2]=r[2]=Math[i](s[2])+e%2/2),t}path(t){const e=this.styledMode?{}:{fill:"none"};return M(t)?e.d=t:T(t)&&A(e,t),this.createElement("path").attr(e)}circle(t,e,i){return t=T(t)?t:void 0===t?{}:{x:t,y:e,r:i},(e=this.createElement("circle")).xSetter=e.ySetter=function(t,e,i){i.setAttribute("c"+e,t)},e.attr(t)}arc(t,e,i,s,r,n){return T(t)?(e=(s=t).y,i=s.r,t=s.x):s={innerR:s,start:r,end:n},(t=this.symbol("arc",t,e,i,i,s)).r=i,t}rect(t,e,i,s,r,n){t=T(t)?t:void 0===t?{}:{x:t,y:e,r,width:Math.max(i||0,0),height:Math.max(s||0,0)};const o=this.createElement("rect");return this.styledMode||(void 0!==n&&(t["stroke-width"]=n,A(t,o.crisp(t))),t.fill="none"),o.rSetter=function(t,e,i){o.r=t,x(i,{rx:t,ry:t})},o.rGetter=function(){return o.r||0},o.attr(t)}roundedRect(t){return this.symbol("roundedRect").attr(t)}setSize(t,e,i){this.width=t,this.height=e,this.boxWrapper.animate({width:t,height:e},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:P(i,!0)?void 0:0}),this.alignElements()}g(t){const e=this.createElement("g");return t?e.attr({class:"highcharts-"+t}):e}image(t,e,i,s,r,n){const o={preserveAspectRatio:"none"};E(e)&&(o.x=e),E(i)&&(o.y=i),E(s)&&(o.width=s),E(r)&&(o.height=r);const a=this.createElement("image").attr(o);return e=function(e){a.attr({href:t}),n.call(a,e)},n?(a.attr({href:"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}),i=new b.Image,y(i,"load",e),i.src=t,i.complete&&e({})):a.attr({href:t}),a}symbol(t,e,i,s,r,n){const o=this,a=/^url\((.*?)\)$/,h=a.test(t),c=!h&&(this.symbols[t]?t:"circle"),u=c&&this.symbols[c];let p,m,g,f;if(u)"number"==typeof e&&(m=u.call(this.symbols,Math.round(e||0),Math.round(i||0),s||0,r||0,n)),p=this.path(m),o.styledMode||p.attr("fill","none"),A(p,{symbolName:c||void 0,x:e,y:i,width:s,height:r}),n&&A(p,n);else if(h){g=t.match(a)[1];const s=p=this.image(g);s.imgwidth=P(n&&n.width,v[g]&&v[g].width),s.imgheight=P(n&&n.height,v[g]&&v[g].height),f=t=>t.attr({width:t.width,height:t.height}),["width","height"].forEach((function(t){s[t+"Setter"]=function(t,e){this[e]=t;const{alignByTranslate:i,element:s,width:r,height:o,imgwidth:a,imgheight:h}=this;if(t=this["img"+e],C(t)){let l=1;n&&"within"===n.backgroundSize&&r&&o?(l=Math.min(r/a,o/h),x(s,{width:Math.round(a*l),height:Math.round(h*l)})):s&&s.setAttribute(e,t),i||this.translate(((r||0)-a*l)/2,((o||0)-h*l)/2)}}})),C(e)&&s.attr({x:e,y:i}),s.isImg=!0,C(s.imgwidth)&&C(s.imgheight)?f(s):(s.attr({width:0,height:0}),w("img",{onload:function(){const t=l[o.chartIndex];0===this.width&&(S(this,{position:"absolute",top:"-999em"}),d.body.appendChild(this)),v[g]={width:this.width,height:this.height},s.imgwidth=this.width,s.imgheight=this.height,s.element&&f(s),this.parentNode&&this.parentNode.removeChild(this),o.imgCount--,o.imgCount||!t||t.hasLoaded||t.onload()},src:g}),this.imgCount++)}return p}clipRect(t,e,i,s){const r=R()+"-",n=this.createElement("clipPath").attr({id:r}).add(this.defs);return(t=this.rect(t,e,i,s,0).add(n)).id=r,t.clipPath=n,t.count=0,t}text(t,e,i,s){const r={};return!s||!this.allowHTML&&this.forExport?(r.x=Math.round(e||0),i&&(r.y=Math.round(i)),C(t)&&(r.text=t),t=this.createElement("text").attr(r),(!s||this.forExport&&!this.allowHTML)&&(t.xSetter=function(t,e,i){const s=i.getElementsByTagName("tspan"),r=i.getAttribute(e);for(let i,n=0;n(t=D(r.prototype.getStyle.call(t,"font-size")||0))?t+3:Math.round(1.2*t);return{h:e,b:Math.round(.8*e),f:t}}rotCorr(t,e,i){let s=t;return e&&i&&(s=Math.max(s*Math.cos(e*c),4)),{x:-t/3*Math.sin(e*c),y:s}}pathToSegments(t){const e=[],i=[],s={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2};for(let r=0;rt.align()))}}return A(B.prototype,{Element:r,SVG_NS:f,escapes:{"&":"&","<":"<",">":">","'":"'",'"':"""},symbols:o,draw:g}),s.registerRendererType("svg",B,!0),B})),e(i,"Core/Renderer/HTML/HTMLElement.js",[i["Core/Globals.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Utilities.js"]],(function(t,e,i){const{isFirefox:s,isMS:r,isWebKit:n,win:o}=t,{css:a,defined:h,extend:l,pick:c,pInt:d}=i,u=[];class p extends e{static compose(t){if(i.pushUnique(u,t)){const e=p.prototype,i=t.prototype;i.getSpanCorrection=e.getSpanCorrection,i.htmlCss=e.htmlCss,i.htmlGetBBox=e.htmlGetBBox,i.htmlUpdateTransform=e.htmlUpdateTransform,i.setSpanRotation=e.setSpanRotation}return t}getSpanCorrection(t,e,i){this.xCorr=-t*i,this.yCorr=-e}htmlCss(t){const e="SPAN"===this.element.tagName&&t&&"width"in t,i=c(e&&t.width,void 0);let s;return e&&(delete t.width,this.textWidth=i,s=!0),t&&"ellipsis"===t.textOverflow&&(t.whiteSpace="nowrap",t.overflow="hidden"),this.styles=l(this.styles,t),a(this.element,t),s&&this.htmlUpdateTransform(),this}htmlGetBBox(){const t=this.element;return{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}htmlUpdateTransform(){if(this.added){var t=this.renderer,e=this.element,i=this.x||0,s=this.y||0,r=this.textAlign||"left",n={left:0,center:.5,right:1}[r],o=this.styles,l=o&&o.whiteSpace;if(a(e,{marginLeft:this.translateX||0,marginTop:this.translateY||0}),"SPAN"===e.tagName){o=this.rotation;const u=this.textWidth&&d(this.textWidth),p=[o,r,e.innerHTML,this.textWidth,this.textAlign].join();let m=!1;if(u!==this.oldTextWidth){if(this.textPxLength)var c=this.textPxLength;else a(e,{width:"",whiteSpace:l||"nowrap"}),c=e.offsetWidth;(u>this.oldTextWidth||c>u)&&(/[ \-]/.test(e.textContent||e.innerText)||"ellipsis"===e.style.textOverflow)&&(a(e,{width:c>u||o?u+"px":"auto",display:"block",whiteSpace:l||"normal"}),this.oldTextWidth=u,m=!0)}this.hasBoxWidthChanged=m,p!==this.cTT&&(t=t.fontMetrics(e).b,!h(o)||o===(this.oldRotation||0)&&r===this.oldAlign||this.setSpanRotation(o,n,t),this.getSpanCorrection(!h(o)&&this.textPxLength||e.offsetWidth,t,n,o,r)),a(e,{left:i+(this.xCorr||0)+"px",top:s+(this.yCorr||0)+"px"}),this.cTT=p,this.oldRotation=o,this.oldAlign=r}}else this.alignOnAdd=!0}setSpanRotation(t,e,i){const h={},l=r&&!/Edge/.test(o.navigator.userAgent)?"-ms-transform":n?"-webkit-transform":s?"MozTransform":o.opera?"-o-transform":void 0;l&&(h[l]=h.transform="rotate("+t+"deg)",h[l+(s?"Origin":"-origin")]=h.transformOrigin=100*e+"% "+i+"px",a(this.element,h))}}return p})),e(i,"Core/Renderer/HTML/HTMLRenderer.js",[i["Core/Renderer/HTML/AST.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Renderer/SVG/SVGRenderer.js"],i["Core/Utilities.js"]],(function(t,e,i,s){const{attr:r,createElement:n,extend:o,pick:a}=s,h=[];class l extends i{static compose(t){return s.pushUnique(h,t)&&(t.prototype.html=l.prototype.html),t}html(i,s,h){const l=this.createElement("span"),c=l.element,d=l.renderer,u=function(t,i){["opacity","visibility"].forEach((function(s){t[s+"Setter"]=function(r,n,o){const a=t.div?t.div.style:i;e.prototype[s+"Setter"].call(this,r,n,o),a&&(a[n]=r)}})),t.addedSetters=!0};return l.textSetter=function(e){e!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,t.setElementHTML(this.element,a(e,"")),this.textStr=e,l.doTransform=!0)},u(l,l.element.style),l.xSetter=l.ySetter=l.alignSetter=l.rotationSetter=function(t,e){"align"===e?l.alignValue=l.textAlign=t:l[e]=t,l.doTransform=!0},l.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)},l.attr({text:i,x:Math.round(s),y:Math.round(h)}).css({position:"absolute"}),d.styledMode||l.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),c.style.whiteSpace="nowrap",l.css=l.htmlCss,l.add=function(t){const e=d.box.parentNode,i=[];let s;if(this.parentGroup=t){if(s=t.div,!s){for(;t;)i.push(t),t=t.parentGroup;i.reverse().forEach((function(t){function a(e,i){t[i]=e,"translateX"===i?d.left=e+"px":d.top=e+"px",t.doTransform=!0}const h=r(t.element,"class"),c=t.styles||{};s=t.div=t.div||n("div",h?{className:h}:void 0,{position:"absolute",left:(t.translateX||0)+"px",top:(t.translateY||0)+"px",display:t.display,opacity:t.opacity,visibility:t.visibility},s||e);const d=s.style;o(t,{classSetter:function(t){return function(e){this.element.setAttribute("class",e),t.className=e}}(s),css:function(e){return l.css.call(t,e),["cursor","pointerEvents"].forEach((t=>{e[t]&&(d[t]=e[t])})),t},on:function(){return i[0].div&&l.on.apply({element:i[0].div,onEvents:t.onEvents},arguments),t},translateXSetter:a,translateYSetter:a}),t.addedSetters||u(t),t.css(c)}))}}else s=e;return s.appendChild(c),l.added=!0,l.alignOnAdd&&l.htmlUpdateTransform(),l},l}}return l})),e(i,"Core/Axis/AxisDefaults.js",[],(function(){var t;return function(t){t.defaultXAxisOptions={alignTicks:!0,allowDecimals:void 0,panningEnabled:!0,zIndex:2,zoomEnabled:!0,dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e %b"},week:{main:"%e %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,gridLineDashStyle:"Solid",gridZIndex:1,labels:{autoRotation:void 0,autoRotationLimit:80,distance:15,enabled:!0,indentation:10,overflow:"justify",padding:5,reserveSpace:void 0,rotation:void 0,staggerLines:0,step:0,useHTML:!1,zIndex:7,style:{color:"#333333",cursor:"default",fontSize:"0.8em"}},maxPadding:.01,minorGridLineDashStyle:"Solid",minorTickLength:2,minorTickPosition:"outside",minorTicksPerMajor:5,minPadding:.01,offset:void 0,opposite:!1,reversed:void 0,reversedStacks:!1,showEmpty:!0,showFirstLabel:!0,showLastLabel:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",rotation:0,useHTML:!1,x:0,y:0,style:{color:"#666666",fontSize:"0.8em"}},type:"linear",uniqueNames:!0,visible:!0,minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#333333",lineWidth:1,gridLineColor:"#e6e6e6",gridLineWidth:void 0,tickColor:"#333333"},t.defaultYAxisOptions={reversedStacks:!0,endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:void 0},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){const{numberFormatter:t}=this.axis.chart;return t(this.total||0,-1)},style:{color:"#000000",fontSize:"0.7em",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},t.defaultLeftAxisOptions={title:{rotation:270}},t.defaultRightAxisOptions={title:{rotation:90}},t.defaultBottomAxisOptions={labels:{autoRotation:[-45]},margin:15,title:{rotation:0}},t.defaultTopAxisOptions={labels:{autoRotation:[-45]},margin:15,title:{rotation:0}}}(t||(t={})),t})),e(i,"Core/Foundation.js",[i["Core/Utilities.js"]],(function(t){const{addEvent:e,isFunction:i,objectEach:s,removeEvent:r}=t;var n;return function(t){t.registerEventOptions=function(t,n){t.eventOptions=t.eventOptions||{},s(n.events,(function(s,n){t.eventOptions[n]!==s&&(t.eventOptions[n]&&(r(t,n,t.eventOptions[n]),delete t.eventOptions[n]),i(s)&&(t.eventOptions[n]=s,e(t,n,s,{order:0})))}))}}(n||(n={})),n})),e(i,"Core/Axis/Tick.js",[i["Core/Templating.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){const{deg2rad:s}=e,{clamp:r,correctFloat:n,defined:o,destroyObjectProperties:a,extend:h,fireEvent:l,isNumber:c,merge:d,objectEach:u,pick:p}=i;return class{constructor(t,e,i,s,r){this.isNewLabel=this.isNew=!0,this.axis=t,this.pos=e,this.type=i||"",this.parameters=r||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,l(this,"init"),i||s||this.addLabel()}addLabel(){const e=this,i=e.axis;var s=i.options;const r=i.chart;var a=i.categories;const d=i.logarithmic,u=i.names,m=e.pos,g=p(e.options&&e.options.labels,s.labels);var f=i.tickPositions;const v=m===f[0],b=m===f[f.length-1],y=(!g.step||1===g.step)&&1===i.tickInterval;f=f.info;let x,w,S,C=e.label;a=this.parameters.category||(a?p(a[m],u[m],m):m),d&&c(a)&&(a=n(d.lin2log(a))),i.dateTime&&(f?(w=r.time.resolveDTLFormat(s.dateTimeLabelFormats[!s.grid&&f.higherRanks[m]||f.unitName]),x=w.main):c(a)&&(x=i.dateTime.getXDateFormat(a,s.dateTimeLabelFormats||{}))),e.isFirst=v,e.isLast=b;const k={axis:i,chart:r,dateTimeLabelFormat:x,isFirst:v,isLast:b,pos:m,tick:e,tickPositionInfo:f,value:a};l(this,"labelFormat",k);const A=e=>g.formatter?g.formatter.call(e,e):g.format?(e.text=i.defaultLabelFormatter.call(e,e),t.format(g.format,e,r)):i.defaultLabelFormatter.call(e,e);s=A.call(k,k);const M=w&&w.list;e.shortenLabel=M?function(){for(S=0;Sl&&r-c*do&&(g=Math.round((n-r)/Math.cos(l*s))):(n=r+(1-c)*d,r-c*do&&(f=o-t.x+f*c,v=-1),f=Math.min(u,f),ff||e.autoRotation&&(h.styles||{}).width)&&(g=f)),g&&(this.shortenLabel?this.shortenLabel():(m.width=Math.floor(g)+"px",(i.style||{}).textOverflow||(m.textOverflow="ellipsis"),h.css(m)))}moveLabel(t,e){const i=this;var s=i.label;const r=i.axis;let n=!1;s&&s.textStr===t?(i.movedLabel=s,n=!0,delete i.label):u(r.ticks,(function(e){n||e.isNew||e===i||!e.label||e.label.textStr!==t||(i.movedLabel=e.label,n=!0,e.labelPos=i.movedLabel.xy,delete e.label)})),n||!i.labelPos&&!s||(s=i.labelPos||s.xy,i.movedLabel=i.createLabel(s,t,e),i.movedLabel&&i.movedLabel.attr({opacity:0}))}render(t,e,i){var s=this.axis,r=s.horiz,n=this.pos,o=p(this.tickmarkOffset,s.tickmarkOffset);o=(n=this.getPosition(r,n,o,e)).x;const a=n.y;s=r&&o===s.pos+s.len||!r&&a===s.pos?-1:1,r=p(i,this.label&&this.label.newOpacity,1),i=p(i,1),this.isActive=!0,this.renderGridLine(e,i,s),this.renderMark(n,i,s),this.renderLabel(n,e,r,t),this.isNew=!1,l(this,"afterRender")}renderGridLine(t,e,i){const s=this.axis,r=s.options,n={},o=this.pos,a=this.type,h=p(this.tickmarkOffset,s.tickmarkOffset),l=s.chart.renderer;let c=this.gridLine,d=r.gridLineWidth,u=r.gridLineColor,m=r.gridLineDashStyle;"minor"===this.type&&(d=r.minorGridLineWidth,u=r.minorGridLineColor,m=r.minorGridLineDashStyle),c||(s.chart.styledMode||(n.stroke=u,n["stroke-width"]=d||0,n.dashstyle=m),a||(n.zIndex=1),t&&(e=0),this.gridLine=c=l.path().attr(n).addClass("highcharts-"+(a?a+"-":"")+"grid-line").add(s.gridGroup)),c&&(i=s.getPlotLinePath({value:o+h,lineWidth:c.strokeWidth()*i,force:"pass",old:t,acrossPanes:!1}))&&c[t||this.isNew?"attr":"animate"]({d:i,opacity:e})}renderMark(t,e,i){const s=this.axis;var r=s.options;const n=s.chart.renderer,o=this.type,a=s.tickSize(o?o+"Tick":"tick"),h=t.x;t=t.y;const l=p(r["minor"!==o?"tickWidth":"minorTickWidth"],!o&&s.isXAxis?1:0);r=r["minor"!==o?"tickColor":"minorTickColor"];let c=this.mark;const d=!c;a&&(s.opposite&&(a[0]=-a[0]),c||(this.mark=c=n.path().addClass("highcharts-"+(o?o+"-":"")+"tick").add(s.axisGroup),s.chart.styledMode||c.attr({stroke:r,"stroke-width":l})),c[d?"attr":"animate"]({d:this.getMarkPath(h,t,a[0],c.strokeWidth()*i,s.horiz,n),opacity:e}))}renderLabel(t,e,i,s){var r=this.axis;const n=r.horiz,o=r.options,a=this.label,h=o.labels,l=h.step;r=p(this.tickmarkOffset,r.tickmarkOffset);const d=t.x;t=t.y;let u=!0;a&&c(d)&&(a.xy=t=this.getLabelPosition(d,t,a,n,h,r,s,l),this.isFirst&&!this.isLast&&!o.showFirstLabel||this.isLast&&!this.isFirst&&!o.showLastLabel?u=!1:!n||h.step||h.rotation||e||0===i||this.handleOverflow(t),l&&s%l&&(u=!1),u&&c(t.y)?(t.opacity=i,a[this.isNewLabel?"attr":"animate"](t).show(!0),this.isNewLabel=!1):(a.hide(),this.isNewLabel=!0))}replaceMovedLabel(){const t=this.label,e=this.axis;t&&!this.isNew&&(t.animate({opacity:0},void 0,t.destroy),delete this.label),e.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel}}})),e(i,"Core/Axis/Axis.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Axis/AxisDefaults.js"],i["Core/Color/Color.js"],i["Core/Defaults.js"],i["Core/Foundation.js"],i["Core/Globals.js"],i["Core/Axis/Tick.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r,n,o,a){const{animObject:h}=t,{defaultOptions:l}=s,{registerEventOptions:c}=r,{deg2rad:d}=n,{arrayMax:u,arrayMin:p,clamp:m,correctFloat:g,defined:f,destroyObjectProperties:v,erase:b,error:y,extend:x,fireEvent:w,getClosestDistance:S,insertItem:C,isArray:k,isNumber:A,isString:M,merge:E,normalizeTickInterval:T,objectEach:L,pick:O,relativeLength:P,removeEvent:D,splat:R,syncTimeout:I}=a,B=(t,e)=>T(e,void 0,void 0,O(t.options.allowDecimals,.5>e||void 0!==t.tickAmount),!!t.tickAmount);class j{constructor(t,e,i){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.index=this.height=this.hasVisibleSeries=this.hasNames=this.eventOptions=this.coll=this.closestPointRange=this.chart=this.bottom=this.alternateBands=void 0,this.init(t,e,i)}init(t,e,i=this.coll){const s="xAxis"===i;this.chart=t,this.horiz=this.isZAxis||(t.inverted?!s:s),this.isXAxis=s,this.coll=i,w(this,"init",{userOptions:e}),this.opposite=O(e.opposite,this.opposite),this.side=O(e.side,this.side,this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(e);const r=(i=this.options).labels,n=i.type;this.userOptions=e,this.minPixelPadding=0,this.reversed=O(i.reversed,this.reversed),this.visible=i.visible,this.zoomEnabled=i.zoomEnabled,this.hasNames="category"===n||!0===i.categories,this.categories=i.categories||(this.hasNames?[]:void 0),this.names||(this.names=[],this.names.keys={}),this.plotLinesAndBandsGroups={},this.positiveValuesOnly=!!this.logarithmic,this.isLinked=f(i.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=i.minRange||i.maxZoom,this.range=i.range,this.offset=i.offset||0,this.min=this.max=null,e=O(i.crosshair,R(t.options.tooltip.crosshairs)[s?0:1]),this.crosshair=!0===e?{}:e,-1===t.axes.indexOf(this)&&(s?t.axes.splice(t.xAxis.length,0,this):t.axes.push(this),C(this,t[this.coll])),t.orderItems(this.coll),this.series=this.series||[],t.inverted&&!this.isZAxis&&s&&void 0===this.reversed&&(this.reversed=!0),this.labelRotation=A(r.rotation)?r.rotation:void 0,c(this,i),w(this,"afterInit")}setOptions(t){this.options=E(e.defaultXAxisOptions,"yAxis"===this.coll&&e.defaultYAxisOptions,[e.defaultTopAxisOptions,e.defaultRightAxisOptions,e.defaultBottomAxisOptions,e.defaultLeftAxisOptions][this.side],E(l[this.coll],t)),w(this,"afterSetOptions",{userOptions:t})}defaultLabelFormatter(t){var e=this.axis;({numberFormatter:t}=this.chart);const i=A(this.value)?this.value:NaN,s=e.chart.time,r=this.dateTimeLabelFormat;var n=l.lang;const o=n.numericSymbols;n=n.numericSymbolMagnitude||1e3;const a=e.logarithmic?Math.abs(i):e.tickInterval;let h,c=o&&o.length;if(e.categories)h=`${this.value}`;else if(r)h=s.dateFormat(r,i);else if(c&&1e3<=a)for(;c--&&void 0===h;)a>=(e=Math.pow(n,c+1))&&0==10*i%e&&null!==o[c]&&0!==i&&(h=t(i/e,-1)+o[c]);return void 0===h&&(h=1e4<=Math.abs(i)?t(i,-1):t(i,-1,void 0,"")),h}getSeriesExtremes(){const t=this,e=t.chart;let i;w(this,"getSeriesExtremes",null,(function(){t.hasVisibleSeries=!1,t.dataMin=t.dataMax=t.threshold=null,t.softThreshold=!t.isXAxis,t.series.forEach((function(s){if(s.visible||!e.options.chart.ignoreHiddenSeries){var r=s.options;let e,n,o=r.threshold;t.hasVisibleSeries=!0,t.positiveValuesOnly&&0>=o&&(o=null),t.isXAxis?(r=s.xData)&&r.length&&(r=t.logarithmic?r.filter((t=>0i)&&(y?t=m(t,e,i):v=!0),t}const i=this,s=i.chart,r=i.left,n=i.top,o=t.old,a=t.value,h=t.lineWidth,l=o&&s.oldChartHeight||s.chartHeight,c=o&&s.oldChartWidth||s.chartWidth,d=i.transB;let u,p,g,f,v,b=t.translatedValue,y=t.force;return t={value:a,lineWidth:h,old:o,force:y,acrossPanes:t.acrossPanes,translatedValue:b},w(this,"getPlotLinePath",t,(function(t){b=O(b,i.translate(a,void 0,void 0,o)),b=m(b,-1e5,1e5),u=g=Math.round(b+d),p=f=Math.round(l-b-d),A(b)?i.horiz?(p=n,f=l-i.bottom,u=g=e(u,r,r+i.width)):(u=r,g=c-i.right,p=f=e(p,n,n+i.height)):(v=!0,y=!1),t.path=v&&!y?null:s.renderer.crispLine([["M",u,p],["L",g,f]],h||1)})),t.path}getLinearTickPositions(t,e,i){const s=g(Math.floor(e/t)*t);i=g(Math.ceil(i/t)*t);const r=[];let n,o;if(g(s+t)===s&&(o=20),this.single)return[e];for(e=s;e<=i&&(r.push(e),(e=g(e+t,o))!==n);)n=e;return r}getMinorTickInterval(){const t=this.options;return!0===t.minorTicks?O(t.minorTickInterval,"auto"):!1===t.minorTicks?null:t.minorTickInterval}getMinorTickPositions(){var t=this.options;const e=this.tickPositions,i=this.minorTickInterval;var s=this.pointRangePadding||0;const r=this.min-s,n=(s=this.max+s)-r;let o=[];if(n&&n/i{var e;return(t.xIncrement?null===(e=t.xData)||void 0===e?void 0:e.slice(0,2):t.xData)||[]})))||0;this.minRange=Math.min(5*o,this.dataMax-this.dataMin)}s-i=this.minRange,n=this.minRange,r=[i-(s=(n-s+i)/2),O(t.min,i-s)],o&&(r[2]=e?e.log2lin(this.dataMin):this.dataMin),i=u(r),s=[i+n,O(t.max,i+n)],o&&(s[2]=e?e.log2lin(this.dataMax):this.dataMax),(s=p(s))-it-e)),t=S([i]))}return t&&e?Math.min(t,e):t||e}nameToX(t){const e=k(this.options.categories),i=e?this.categories:this.names;let s,r=t.options.x;return t.series.requireSorting=!1,f(r)||(r=this.options.uniqueNames&&i?e?i.indexOf(t.name):O(i.keys[t.name],-1):t.series.autoIncrement()),-1===r?!e&&i&&(s=i.length):s=r,void 0!==s?(this.names[s]=t.name,this.names.keys[t.name]=s):t.x&&(s=t.x),s}updateNames(){const t=this,e=this.names;0=v?(b=v,p=0):this.dataMax<=v&&(l=v,u=0)),this.min=O(c,b,this.dataMin),this.max=O(d,l,this.dataMax);if(i&&(this.positiveValuesOnly&&!t&&0>=Math.min(this.min,O(this.dataMin,this.min))&&y(10,1,e),this.min=g(i.log2lin(this.min),16),this.max=g(i.log2lin(this.max),16)),this.range&&f(this.max)&&(this.userMin=this.min=c=Math.max(this.dataMin,this.minFromRange()),this.userMax=d=this.max,this.range=null),w(this,"foundExtremes"),this.beforePadding&&this.beforePadding(),this.adjustForMinRange(),!A(this.userMin)&&A(s.softMin)&&s.softMinthis.max&&(this.max=d=s.softMax),!(a||this.axisPointRange||this.stacking&&this.stacking.usePercentage||n)&&f(this.min)&&f(this.max)&&(e=this.max-this.min)&&(!f(c)&&p&&(this.min-=e*p),!f(d)&&u&&(this.max+=e*u)),!A(this.userMin)&&A(s.floor)&&(this.min=Math.max(this.min,s.floor)),!A(this.userMax)&&A(s.ceiling)&&(this.max=Math.min(this.max,s.ceiling)),h&&f(this.dataMin)&&(v=v||0,!f(c)&&this.min=v?this.min=this.options.minRange?Math.min(v,this.max-this.minRange):v:!f(d)&&this.max>v&&this.dataMax<=v&&(this.max=this.options.minRange?Math.max(v,this.min+this.minRange):v)),A(this.min)&&A(this.max)&&!this.chart.polar&&this.min>this.max&&(f(this.options.min)?this.max=this.min:f(this.options.max)&&(this.min=this.max)),this.tickInterval=this.min===this.max||void 0===this.min||void 0===this.max?1:n&&this.linkedParent&&!m&&o===this.linkedParent.options.tickPixelInterval?m=this.linkedParent.tickInterval:O(m,this.tickAmount?(this.max-this.min)/Math.max(this.tickAmount-1,1):void 0,a?1:(this.max-this.min)*o/Math.max(this.len,o)),r&&!t){const t=this.min!==(this.old&&this.old.min)||this.max!==(this.old&&this.old.max);this.series.forEach((function(e){e.forceCrop=e.forceCropping&&e.forceCropping(),e.processData(t)})),w(this,"postProcessData",{hasExtremesChanged:t})}this.setAxisTranslation(),w(this,"initialAxisTranslation"),this.pointRange&&!m&&(this.tickInterval=Math.max(this.pointRange,this.tickInterval)),t=O(s.minTickInterval,this.dateTime&&!this.series.some((t=>t.noSharedTooltip))?this.closestPointRange:0),!m&&this.tickIntervalMath.max(2*this.len,200)))if(this.dateTime)n=this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,t.units),this.min,this.max,t.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0);else if(this.logarithmic)n=this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max);else for(s=t=this.tickInterval;s<=2*t&&(n=this.getLinearTickPositions(this.tickInterval,this.min,this.max),this.tickAmount&&n.length>this.tickAmount);)this.tickInterval=B(this,s*=1.1);else n=[this.min,this.max],y(19,!1,this.chart);n.length>this.len&&(n=[n[0],n[n.length-1]])[0]===n[1]&&(n.length=1),i&&(this.tickPositions=n,(a=i.apply(this,[this.min,this.max]))&&(n=a))}this.tickPositions=n,this.paddedTicks=n.slice(0),this.trimTicks(n,o,r),!this.isLinked&&A(this.min)&&A(this.max)&&(this.single&&2>n.length&&!this.categories&&!this.series.some((t=>t.is("heatmap")&&"between"===t.options.pointPlacement))&&(this.min-=.5,this.max+=.5),e||a||this.adjustTickAmount()),w(this,"afterSetTickPositions")}trimTicks(t,e,i){const s=t[0],r=t[t.length-1],n=!this.isOrdinal&&this.minPointOffset||0;if(w(this,"trimTicks"),!this.isLinked){if(e&&-1/0!==s)this.min=s;else for(;this.min-n>t[0];)t.shift();if(i)this.max=r;else for(;this.max+n{const{horiz:e,options:i}=t;return[e?i.left:i.top,i.width,i.height,i.pane].join()},s=i(this);this.chart[this.coll].forEach((function(r){const{series:o}=r;o.length&&o.some((t=>t.visible))&&r!==t&&i(r)===s&&(n=!0,e.push(r))}))}if(n&&s){e.forEach((e=>{e=e.getThresholdAlignment(t),A(e)&&r.push(e)}));const i=1t+e),0)/r.length:void 0;e.forEach((t=>{t.thresholdAlignment=i}))}return n}getThresholdAlignment(t){if((!A(this.dataMin)||this!==t&&this.series.some((t=>t.isDirty||t.isDirtyData)))&&this.getSeriesExtremes(),A(this.threshold))return t=m((this.threshold-(this.dataMin||0))/((this.dataMax||0)-(this.dataMin||0)),0,1),this.options.reversed&&(t=1-t),t}getTickAmount(){const t=this.options,e=t.tickPixelInterval;let i=t.tickAmount;!f(t.tickInterval)&&!i&&this.leni&&(this.finalTickAmt=i,i=5),this.tickAmount=i}adjustTickAmount(){const t=this,{finalTickAmt:e,max:i,min:s,options:r,tickPositions:n,tickAmount:o,thresholdAlignment:a}=t,h=n&&n.length;var l=O(t.threshold,t.softThreshold?0:null),c=t.tickInterval;let d;if(A(a)&&(d=.5>a?Math.ceil(a*(o-1)):Math.floor(a*(o-1)),r.reversed&&(d=o-1-d)),t.hasData()&&A(s)&&A(i)){const a=()=>{t.transA*=(h-1)/(o-1),t.min=r.startOnTick?n[0]:Math.min(s,n[0]),t.max=r.endOnTick?n[n.length-1]:Math.max(i,n[n.length-1])};if(A(d)&&A(t.threshold)){for(;n[d]!==l||n.length!==o||n[0]>s||n[n.length-1]t.threshold?n.unshift(g(n[0]-c)):n.push(g(n[n.length-1]+c));if(c>8*t.tickInterval)break;c*=2}a()}else if(h=e&&0a&&(e=a)),f(r)&&(na&&(n=a))),i.displayBtn=void 0!==e||void 0!==n,i.setExtremes(e,n,!1,void 0,{trigger:"zoom"})),t.zoomed=!0})),t.zoomed}setAxisSize(){const t=this.chart;var e=this.options;const i=e.offsets||[0,0,0,0],s=this.horiz,r=this.width=Math.round(P(O(e.width,t.plotWidth-i[3]+i[1]),t.plotWidth)),n=this.height=Math.round(P(O(e.height,t.plotHeight-i[0]+i[2]),t.plotHeight)),o=this.top=Math.round(P(O(e.top,t.plotTop+i[0]),t.plotHeight,t.plotTop));e=this.left=Math.round(P(O(e.left,t.plotLeft+i[3]),t.plotWidth,t.plotLeft)),this.bottom=t.chartHeight-n-o,this.right=t.chartWidth-r-e,this.len=Math.max(s?r:n,0),this.pos=s?e:o}getExtremes(){const t=this.logarithmic;return{min:t?g(t.lin2log(this.min)):this.min,max:t?g(t.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}}getThreshold(t){var e=this.logarithmic;const i=e?e.lin2log(this.min):this.min;return e=e?e.lin2log(this.max):this.max,null===t||-1/0===t?t=i:1/0===t?t=e:i>t?t=i:ee?t.align="right":195e&&(t.align="left")})),t.align}tickSize(t){const e=this.options,i=O(e["tick"===t?"tickWidth":"minorTickWidth"],"tick"===t&&this.isXAxis&&!this.categories?1:0);let s,r=e["tick"===t?"tickLength":"minorTickLength"];return i&&r&&("inside"===e[t+"Position"]&&(r=-r),s=[r,i]),w(this,"afterTickSize",t={tickSize:s}),t.tickSize}labelMetrics(){const t=this.chart.renderer;var e=this.ticks;return e=e[Object.keys(e)[0]]||{},this.chart.renderer.fontMetrics(e.label||e.movedLabel||t.box)}unsquish(){const t=this.options.labels;var e=this.horiz;const i=this.tickInterval,s=this.len/(((this.categories?1:0)+this.max-this.min)/i),r=t.rotation,n=.75*this.labelMetrics().h,o=Math.max(this.max-this.min,0),a=function(t){let e=t/(s||1);return e=1o&&1/0!==t&&1/0!==s&&o&&(e=Math.ceil(o/i)),g(e*i)};let h,l,c=i,u=Number.MAX_VALUE;if(e){if(t.staggerLines||(A(r)?l=[r]:s=i)&&(t=(e=a(Math.abs(n/Math.sin(d*i))))+Math.abs(i/360),ts.step)return s.rotation?0:(this.staggerLines||1)*this.len/r;if(!i){if(void 0!==(t=s.style.width))return parseInt(String(t),10);if(n)return n-e.spacing[3]}return.33*e.chartWidth}renderUnsquish(){const t=this.chart,e=t.renderer,i=this.tickPositions,s=this.ticks,r=this.options.labels,n=r.style,o=this.horiz,a=this.getSlotWidth();var h=Math.max(1,Math.round(a-2*r.padding));const l={},c=this.labelMetrics(),d=n.textOverflow;let u,p,m=0;if(M(r.rotation)||(l.rotation=r.rotation||0),i.forEach((function(t){(t=s[t]).movedLabel&&t.replaceMovedLabel(),t&&t.label&&t.label.textPxLength>m&&(m=t.label.textPxLength)})),this.maxLabelLength=m,this.autoRotation)m>h&&m>c.h?l.rotation=this.labelRotation:this.labelRotation=0;else if(a&&(u=h,!d))for(p="clip",h=i.length;!o&&h--;){var g=i[h];(g=s[g].label)&&(g.styles&&"ellipsis"===g.styles.textOverflow?g.css({textOverflow:"clip"}):g.textPxLength>a&&g.css({width:a+"px"}),g.getBBox().height>this.len/i.length-(c.h-c.f)&&(g.specificTextOverflow="ellipsis"))}l.rotation&&(u=m>.5*t.chartHeight?.33*t.chartHeight:m,d||(p="ellipsis")),(this.labelAlign=r.align||this.autoLabelAlign(this.labelRotation))&&(l.align=this.labelAlign),i.forEach((function(t){const e=(t=s[t])&&t.label,i=n.width,r={};e&&(e.attr(l),t.shortenLabel?t.shortenLabel():u&&!i&&"nowrap"!==n.whiteSpace&&(ul.g(t).attr({zIndex:i}).addClass(`highcharts-${a.toLowerCase()}${e} `+(this.isRadial?`highcharts-radial-axis${e} `:"")+(y||"")).add(h);t.gridGroup=e("grid","-grid",s.gridZIndex),t.axisGroup=e("axis","",s.zIndex),t.labelGroup=e("axis-labels","-labels",p.zIndex)}d||t.isLinked?(o.forEach((function(e){t.generateTick(e)})),t.renderUnsquish(),t.reserveSpaceDefault=0===r||2===r||{1:"left",3:"right"}[r]===t.labelAlign,O(p.reserveSpace,!m&&null,"center"===t.labelAlign||null,t.reserveSpaceDefault)&&o.forEach((function(t){M=Math.max(n[t].getLabelSize(),M)})),t.staggerLines&&(M*=t.staggerLines),t.labelOffset=M*(t.opposite?-1:1)):L(n,(function(t,e){t.destroy(),delete n[e]})),u&&u.text&&!1!==u.enabled&&(t.addTitle(x),x&&!m&&!1!==u.reserveSpace&&(t.titleOffset=C=t.axisTitle.getBBox()[i?"height":"width"],S=u.offset,k=f(S)?0:O(u.margin,i?5:10))),t.renderLine(),t.offset=b*O(s.offset,g[r]?g[r]+(s.margin||0):0),t.tickRotCorr=t.tickRotCorr||{x:0,y:0},d=0===r?-t.labelMetrics().h:2===r?t.tickRotCorr.y:0,k=Math.abs(M)+k,M&&(k=k-d+b*(i?O(p.y,t.tickRotCorr.y+b*p.distance):O(p.x,b*p.distance))),t.axisTitleMargin=O(S,k),t.getMaxLabelDimensions&&(t.maxLabelDimensions=t.getMaxLabelDimensions(n,o)),"colorAxis"!==a&&(p=this.tickSize("tick"),g[r]=Math.max(g[r],(t.axisTitleMargin||0)+C+b*t.offset,k,o&&o.length&&p?p[0]+b*t.offset:0),g=!t.axisLine||s.offset?0:2*Math.floor(t.axisLine.strokeWidth()/2),v[c]=Math.max(v[c],g)),w(this,"afterGetOffset")}getLinePath(t){const e=this.chart,i=this.opposite;var s=this.offset;const r=this.horiz,n=this.left+(i?this.width:0)+s;return s=e.chartHeight-this.bottom-(i?this.height:0)+s,i&&(t*=-1),e.renderer.crispLine([["M",r?this.left:n,r?s:this.top],["L",r?e.chartWidth-this.right:n,r?s:e.chartHeight-this.bottom]],t)}renderLine(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))}getTitlePosition(t){var e=this.horiz,i=this.left;const s=this.top;var r=this.len;const n=this.options.title,o=e?i:s,a=this.opposite,h=this.offset,l=n.x,c=n.y,d=this.chart.renderer.fontMetrics(t);return t=t?Math.max(t.getBBox(!1,0).height-d.h-1,0):0,r={low:o+(e?0:r),middle:o+r/2,high:o+(e?r:0)}[n.align],i=(e?s+this.height:i)+(e?1:-1)*(a?-1:1)*(this.axisTitleMargin||0)+[-t,t,d.f,-t][this.side],e={x:e?r+l:i+(a?this.width:0)+h+l,y:e?i+c-(a?this.height:0)+h:r+c},w(this,"afterGetTitlePosition",{titlePosition:e}),e}renderMinorTick(t,e){const i=this.minorTicks;i[t]||(i[t]=new o(this,t,"minor")),e&&i[t].isNew&&i[t].render(null,!0),i[t].render(null,!1,1)}renderTick(t,e,i){const s=this.ticks;(!this.isLinked||t>=this.min&&t<=this.max||this.grid&&this.grid.isColumn)&&(s[t]||(s[t]=new o(this,t)),i&&s[t].isNew&&s[t].render(e,!0,-1),s[t].render(e))}render(){const t=this,e=t.chart,i=t.logarithmic,s=t.options,r=t.isLinked,a=t.tickPositions,l=t.axisTitle,c=t.ticks,d=t.minorTicks,u=t.alternateBands,p=s.stackLabels,m=s.alternateGridColor;var g=s.crossing;const f=t.tickmarkOffset,v=t.axisLine,b=t.showAxis,y=h(e.renderer.globalAnimation);let x,S;if(t.labelEdge.length=0,t.overlap=!1,[c,d,u].forEach((function(t){L(t,(function(t){t.isActive=!1}))})),A(g)){const i=this.isXAxis?e.yAxis[0]:e.xAxis[0],s=[1,-1,-1,1][this.side];i&&(g=i.toPixels(g,!0),t.horiz&&(g=i.len-g),t.offset=s*g)}if(t.hasData()||r){const r=t.chart.hasRendered&&t.old&&A(t.old.min);t.minorTickInterval&&!t.categories&&t.getMinorTickPositions().forEach((function(e){t.renderMinorTick(e,r)})),a.length&&(a.forEach((function(e,i){t.renderTick(e,i,r)})),f&&(0===t.min||t.single)&&(c[-1]||(c[-1]=new o(t,-1,null,!0)),c[-1].render(-1))),m&&a.forEach((function(s,r){S=void 0!==a[r+1]?a[r+1]+f:t.max-f,0==r%2&&se&&(!n||c<=r)&&void 0!==c&&l.push(c),c>r&&(d=!0),c=o}else e=this.lin2log(e),r=this.lin2log(r),t=n?o.getMinorTickInterval():h.tickInterval,t=s("auto"===t?null:t,this.minorAutoInterval,h.tickPixelInterval/(n?5:1)*(r-e)/((n?a/o.tickPositions.length:a)||1)),t=i(t),l=o.getLinearTickPositions(t,e,r).map(this.log2lin),n||(this.minorAutoInterval=t/5);return n||(o.tickInterval=t),l}lin2log(t){return Math.pow(10,t)}log2lin(t){return Math.log(t)/Math.LN10}}r.Additions=h}(r||(r={})),r})),e(i,"Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js",[i["Core/Utilities.js"]],(function(t){const{erase:e,extend:i,isNumber:s}=t;var r;return function(r){function n(t){return this.addPlotBandOrLine(t,"plotBands")}function o(t,e){const i=this.userOptions;let s=new p(this,t);if(this.visible&&(s=s.render()),s){if(this._addedPlotLB||(this._addedPlotLB=!0,(i.plotLines||[]).concat(i.plotBands||[]).forEach((t=>{this.addPlotBandOrLine(t)}))),e){const s=i[e]||[];s.push(t),i[e]=s}this.plotLinesAndBands.push(s)}return s}function a(t){return this.addPlotBandOrLine(t,"plotLines")}function h(t,e,i=this.options){const r=this.getPlotLinePath({value:e,force:!0,acrossPanes:i.acrossPanes}),n=[],o=this.horiz;let a;if(e=!s(this.min)||!s(this.max)||tthis.max&&e>this.max,t=this.getPlotLinePath({value:t,force:!0,acrossPanes:i.acrossPanes}),i=1,t&&r)for(e&&(a=t.toString()===r.toString(),i=0),e=0;e{const o="x"===n;return[n,o?l:c,o?t:e].concat(a?[o?t*d.scaleX:e*d.scaleY,o?d.left-r+(i.plotX+s.plotLeft)*d.scaleX:d.top-r+(i.plotY+s.plotTop)*d.scaleY,0,o?l:c]:[o?t:e,o?i.plotX+s.plotLeft:i.plotY+s.plotTop,o?s.plotLeft:s.plotTop,o?s.plotLeft+s.plotWidth:s.plotTop+s.plotHeight])};let u,p=h("y"),m=h("x");h=!!i.negative,!s.polar&&s.hoverSeries&&s.hoverSeries.yAxis&&s.hoverSeries.yAxis.reversed&&(h=!h);const g=!this.followPointer&&y(i.ttBelow,!s.inverted===h),f=function(t,e,i,s,h,l,c){const u=a?"y"===t?r*d.scaleY:r*d.scaleX:r,p=(i-s)/2,m=sv-o?v:v-o);else{if(!f)return!1;n[t]=Math.max(l,h+o+i>e?h:h+o)}},v=function(t,e,i,s,o){let a;return oe-r?a=!1:n[t]=oe-s/2?e-s-2:o-i/2,a},b=function(t){const e=p;p=m,m=e,u=t},x=function(){!1!==f.apply(0,p)?!1!==v.apply(0,m)||u||(b(!0),x()):u?n.x=n.y=0:(b(!0),x())};return(s.inverted||1o.isDirectTouch||t.series.shouldShowTooltip(r,n))))return void this.hide();e=this.getLabel(),s.style.width&&!p||e.css({width:(this.outside?this.getPlayingField():i.spacingBox).width+"px"}),e.attr({text:c&&c.join?c.join(""):c}),e.addClass(this.getClassName(h),!0),p||e.attr({stroke:s.borderColor||h.color||d.color||"#666666"}),this.updatePosition({plotX:b,plotY:w,negative:h.negative,ttBelow:h.ttBelow,h:t[2]||0})}this.isHidden&&this.label&&this.label.attr({opacity:1}).show(),this.isHidden=!1}m(this,"refresh")}}renderSplit(t,e){function i(t,e,i,r,n=!0){return i?(e=L?0:I,t=c(t-r/2,M.left,M.right-r-(s.outside?O:0))):(e-=D,t=c(t=n?t-r-C:t+C,n?t:M.left,M.right)),{x:t,y:e}}const s=this,{chart:r,chart:{chartWidth:n,chartHeight:l,plotHeight:d,plotLeft:u,plotTop:m,pointer:g,scrollablePixelsY:f=0,scrollablePixelsX:b,scrollingContainer:{scrollLeft:x,scrollTop:w}={scrollLeft:0,scrollTop:0},styledMode:S},distance:C,options:k,options:{positioner:A}}=s,M=s.outside&&"number"!=typeof b?o.documentElement.getBoundingClientRect():{left:x,right:x+n,top:w,bottom:w+l},E=s.getLabel(),T=this.renderer||r.renderer,L=!(!r.xAxis[0]||!r.xAxis[0].opposite),{left:O,top:P}=g.getChartPosition();let D=m+w,R=0,I=d-f;v(t)&&(t=[!1,t]),t=t.slice(0,e.length+1).reduce((function(t,r,n){if(!1!==r&&""!==r){const g=(n=e[n-1]||{isHeader:!0,plotX:e[0].plotX,plotY:d,series:{}}).isHeader;var o,a=g?s:n.series;{var h=n;r=r.toString();var l=a.tt;const{isHeader:t,series:e}=h;l||(l={padding:k.padding,r:k.borderRadius},S||(l.fill=k.backgroundColor,l["stroke-width"]=null!==(o=k.borderWidth)&&void 0!==o?o:1),l=T.label("",0,0,k[t?"headerShape":"shape"],void 0,void 0,k.useHTML).addClass(s.getClassName(h,!0,t)).attr(l).add(E)),l.isActive=!0,l.attr({text:r}),S||l.css(k.style).attr({stroke:k.borderColor||h.color||e.color||"#333333"}),o=l}o=a.tt=o,a=(h=o.getBBox()).width+o.strokeWidth(),g&&(R=h.height,I+=R,L&&(D-=R));{const{isHeader:t,plotX:e=0,plotY:i=0,series:s}=n;if(t){r=u+e;var p=m+d/2}else{const{xAxis:t,yAxis:n}=s;r=t.pos+c(e,-C,t.len+C),s.shouldShowTooltip(0,n.pos-m+i,{ignoreX:!0})&&(p=n.pos+i)}p={anchorX:r=c(r,M.left-C,M.right+C),anchorY:p}}const{anchorX:f,anchorY:v}=p;"number"==typeof v?(p=h.height+1,h=A?A.call(s,a,p,n):i(f,v,g,a),t.push({align:A?0:void 0,anchorX:f,anchorY:v,boxWidth:a,point:n,rank:y(h.rank,g?1:0),size:p,target:h.y,tt:o,x:h.x})):o.isActive=!1}return t}),[]),!A&&t.some((t=>{var{outside:e}=s;return(e=(e?O:0)+t.anchorX)e}))&&(t=t.map((t=>{const{x:e,y:s}=i(t.anchorX,t.anchorY,t.point.isHeader,t.boxWidth,!1);return p(t,{target:s,x:e})}))),s.cleanSplit(),h(t,I);var B=O,j=O;t.forEach((function(t){const{x:e,boxWidth:i,isHeader:r}=t;r||(s.outside&&O+ej&&(j=O+e))})),t.forEach((function(t){const{x:e,anchorX:i,anchorY:r,pos:n,point:{isHeader:o}}=t,a={visibility:void 0===n?"hidden":"inherit",x:e,y:(n||0)+D,anchorX:i,anchorY:r};if(s.outside&&ei[0]?Math.max(Math.abs(i[0]),r.width-i[0]):Math.max(Math.abs(i[0]),r.width),s.height=0>i[1]?Math.max(Math.abs(i[1]),r.height-Math.abs(i[1])):Math.max(Math.abs(i[1]),r.height),this.tracker?this.tracker.attr(s):(this.tracker=e.renderer.rect(s).addClass("highcharts-tracker").add(e),t.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}else this.tracker&&(this.tracker=this.tracker.destroy())}styledModeFormat(t){return t.replace('style="font-size: 0.8em"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex} {series.options.className} {point.options.className}"')}tooltipFooterHeaderFormatter(t,e){const i=t.series,s=i.tooltipOptions;var r=i.xAxis;const o=r&&r.dateTime;r={isFooter:e,labelConfig:t};let a=s.xDateFormat,h=s[e?"footerFormat":"headerFormat"];return m(this,"headerFormatter",r,(function(e){o&&!a&&f(t.key)&&(a=o.getXDateFormat(t.key,s.dateTimeLabelFormats)),o&&a&&(t.point&&t.point.tooltipDateKeys||["key"]).forEach((function(t){h=h.replace("{point."+t+"}","{point."+t+":"+a+"}")})),i.chart.styledMode&&(h=this.styledModeFormat(h)),e.text=n(h,{point:t,series:i},this.chart)})),r.text}update(t){this.destroy(),this.init(this.chart,b(!0,this.options,t))}updatePosition(t){const{chart:e,distance:i,options:s}=this;var r=e.pointer;const n=this.getLabel(),{left:o,top:a,scaleX:h,scaleY:l}=r.getChartPosition();r=(s.positioner||this.getPosition).call(this,n.width,n.height,t);let c,u=(t.plotX||0)+e.plotLeft;t=(t.plotY||0)+e.plotTop,this.outside&&(s.positioner&&(r.x+=o-i,r.y+=a-i),c=(s.borderWidth||0)+2*i,this.renderer.setSize(n.width+c,n.height+c,!1),1===h&&1===l||(d(this.container,{transform:`scale(${h}, ${l})`}),u*=h,t*=l),u+=o-r.x,t+=a-r.y),this.move(Math.round(r.x),Math.round(r.y||0),u,t)}}return function(t){const e=[];t.compose=function(i){r.pushUnique(e,i)&&l(i,"afterInit",(function(){const e=this.chart;e.options.tooltip&&(e.tooltip=new t(e,e.options.tooltip))}))}}(S||(S={})),S})),e(i,"Core/Series/Point.js",[i["Core/Renderer/HTML/AST.js"],i["Core/Animation/AnimationUtilities.js"],i["Core/Defaults.js"],i["Core/Templating.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r){const{animObject:n}=e,{defaultOptions:o}=i,{format:a}=s,{addEvent:h,defined:l,erase:c,extend:d,fireEvent:u,getNestedProperty:p,isArray:m,isFunction:g,isNumber:f,isObject:v,merge:b,objectEach:y,pick:x,syncTimeout:w,removeEvent:S,uniqueKey:C}=r;class k{constructor(){this.category=void 0,this.destroyed=!1,this.formatPrefix="point",this.id=void 0,this.isNull=!1,this.percentage=this.options=this.name=void 0,this.selected=!1,this.total=this.shapeArgs=this.series=void 0,this.visible=!0,this.x=void 0}animateBeforeDestroy(){const t=this,e={x:t.startXPos,opacity:0},i=t.getGraphicalProps();i.singular.forEach((function(i){t[i]=t[i].animate("dataLabel"===i?{x:t[i].startXPos,y:t[i].startYPos,opacity:0}:e)})),i.plural.forEach((function(e){t[e].forEach((function(e){e.element&&e.animate(d({x:t.startXPos},e.startYPos?{x:e.startXPos,y:e.startYPos}:{}))}))}))}applyOptions(t,e){const i=this.series,s=i.options.pointValKey||i.pointValKey;return t=k.prototype.optionsToObject.call(this,t),d(this,t),this.options=this.options?d(this.options,t):t,t.group&&delete this.group,t.dataLabels&&delete this.dataLabels,s&&(this.y=k.prototype.getNestedProperty.call(this,s)),this.formatPrefix=(this.isNull=this.isValid&&!this.isValid())?"null":"point",this.selected&&(this.state="select"),"name"in this&&void 0===e&&i.xAxis&&i.xAxis.hasNames&&(this.x=i.xAxis.nameToX(this)),void 0===this.x&&i?this.x=void 0===e?i.autoIncrement():e:f(t.x)&&i.options.relativeXValue&&(this.x=i.autoIncrement(t.x)),this}destroy(){if(!this.destroyed){const e=this;var t=e.series;const i=t.chart;t=t.options.dataSorting;const s=i.hoverPoints,r=n(e.series.chart.renderer.globalAnimation),o=()=>{(e.graphic||e.graphics||e.dataLabel||e.dataLabels)&&(S(e),e.destroyElements());for(const t in e)delete e[t]};e.legendItem&&i.legend.destroyItem(e),s&&(e.setState(),c(s,e),s.length||(i.hoverPoints=null)),e===i.hoverPoint&&e.onMouseOut(),t&&t.enabled?(this.animateBeforeDestroy(),w(o,r.duration)):o(),i.pointCount--}this.destroyed=!0}destroyElements(t){const e=this;(t=e.getGraphicalProps(t)).singular.forEach((function(t){e[t]=e[t].destroy()})),t.plural.forEach((function(t){e[t].forEach((function(t){t&&t.element&&t.destroy()})),delete e[t]}))}firePointEvent(t,e,i){const s=this,r=this.series.options;(r.point.events[t]||s.options&&s.options.events&&s.options.events[t])&&s.importEvents(),"click"===t&&r.allowPointSelect&&(i=function(t){s.select&&s.select(null,t.ctrlKey||t.metaKey||t.shiftKey)}),u(s,t,e,i)}getClassName(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")}getGraphicalProps(t){const e=this,i=[],s={singular:[],plural:[]};let r,n;for((t=t||{graphic:1,dataLabel:1}).graphic&&i.push("graphic"),t.dataLabel&&i.push("dataLabel","dataLabelPath","dataLabelUpper","connector"),n=i.length;n--;)r=i[n],e[r]&&s.singular.push(r);return["graphic","dataLabel","connector"].forEach((function(i){const r=i+"s";t[i]&&e[r]&&s.plural.push(r)})),s}getLabelConfig(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}}getNestedProperty(t){if(t)return 0===t.indexOf("custom.")?p(t,this.options):this[t]}getZone(){var t=this.series;const e=t.zones;t=t.zoneAxis||"y";let i,s=0;for(i=e[s];this[t]>=i.value;)i=e[++s];return this.nonZonedColor||(this.nonZonedColor=this.color),this.color=i&&i.color&&!this.options.color?i.color:this.nonZonedColor,i}hasNewShapeType(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType}init(t,e,i){return this.series=t,this.applyOptions(e,i),this.id=l(this.id)?this.id:C(),this.resolveColor(),t.chart.pointCount++,u(this,"afterInit"),this}isValid(){return null!==this.x&&f(this.y)}optionsToObject(t){var e=this.series;const i=e.options.keys,s=i||e.pointArrayMap||["y"],r=s.length;let n={},o=0,a=0;if(f(t)||null===t)n[s[0]]=t;else if(m(t))for(!i&&t.length>r&&("string"==(e=typeof t[0])?n.name=t[0]:"number"===e&&(n.x=t[0]),o++);at())),this.eventsToUnbind=[],e.chartCount||(y.unbindDocumentMouseUp&&(y.unbindDocumentMouseUp=y.unbindDocumentMouseUp()),y.unbindDocumentTouchEnd&&(y.unbindDocumentTouchEnd=y.unbindDocumentTouchEnd())),clearInterval(t.tooltipTimeout),g(t,(function(e,i){t[i]=void 0}))}getSelectionMarkerAttrs(t,e){const i={args:{chartX:t,chartY:e},attrs:{},shapeType:"rect"};return u(this,"getSelectionMarkerAttrs",i,(i=>{const{chart:s,mouseDownX:r=0,mouseDownY:n=0,zoomHor:o,zoomVert:a}=this;let h;(i=i.attrs).x=s.plotLeft,i.y=s.plotTop,i.width=o?1:s.plotWidth,i.height=a?1:s.plotHeight,o&&(h=t-r,i.width=Math.abs(h),i.x=(0r+o&&(u=r+o),pn+a&&(p=n+a),this.hasDragged=Math.sqrt(Math.pow(h-u,2)+Math.pow(l-p,2)),10{e.result={x:t.attr?+t.attr("x"):t.x,y:t.attr?+t.attr("y"):t.y,width:t.attr?t.attr("width"):t.width,height:t.attr?t.attr("height"):t.height}})),e.result}drop(t){const e=this,i=this.chart,s=this.hasPinched;if(this.selectionMarker){const{x:r,y:n,width:o,height:a}=this.getSelectionBox(this.selectionMarker),h={originalEvent:t,xAxis:[],yAxis:[],x:r,y:n,width:o,height:a};let d=!!i.mapView;(this.hasDragged||s)&&(i.axes.forEach((function(i){if(i.zoomEnabled&&l(i.min)&&(s||e[{xAxis:"zoomX",yAxis:"zoomY"}[i.coll]])&&p(r)&&p(n)&&p(o)&&p(a)){var c=i.horiz;const e="touchend"===t.type?i.minPixelPadding:0,s=i.toValue((c?r:n)+e);c=i.toValue((c?r+o:n+a)-e),h[i.coll].push({axis:i,min:Math.min(s,c),max:Math.max(s,c)}),d=!0}})),d&&u(i,"selection",h,(function(t){i.zoom(c(t,s?{animation:!1}:null))}))),p(i.index)&&(this.selectionMarker=this.selectionMarker.destroy()),s&&this.scaleGroups()}i&&p(i.index)&&(h(i.container,{cursor:i._cursor}),i.cancelClick=10t.options.findNearestPointBy.indexOf("y");if(t=t.searchPoint(i,r),(r=m(t,!0)&&t.series)&&!(r=!m(s,!0))){{r=s.distX-t.distX;const i=s.dist-t.dist,n=(t.series.group&&t.series.group.zIndex)-(s.series.group&&s.series.group.zIndex);r=0!==r&&e?r:0!==i?i:0!==n?n:s.series.index>t.series.index?-1:1}r=0t.stickyTracking&&(l.filter||a)(t)));const c=s||!n?t:this.findNearestKDPoint(h,r,n);return e=c&&c.series,c&&(r&&!e.noSharedTooltip?(h=i.filter((function(t){return l.filter?l.filter(t):a(t)&&!t.noSharedTooltip})),h.forEach((function(t){let e=d(t.points,(function(t){return t.x===c.x&&!t.isNull}));m(e)&&(t.boosted&&t.boost&&(e=t.boost.getPoint(e)),o.push(e))}))):o.push(c)),l={hoverPoint:c},u(this,"afterGetHoverData",l),{hoverPoint:l.hoverPoint,hoverSeries:e,hoverPoints:o}}getPointFromEvent(t){let e;for(t=t.target;t&&!e;)e=t.point,t=t.parentNode;return e}onTrackerMouseOut(t){t=t.relatedTarget;const e=this.chart.hoverSeries;this.isDirectTouch=!1,!e||!t||e.stickyTracking||this.inClass(t,"highcharts-tooltip")||this.inClass(t,"highcharts-series-"+e.index)&&this.inClass(t,"highcharts-tracker")||e.onMouseOut()}inClass(t,e){let i;for(;t;){if(i=a(t,"class")){if(-1!==i.indexOf(e))return!0;if(-1!==i.indexOf("highcharts-container"))return!1}t=t.parentElement}}init(t,e){this.options=e,this.chart=t,this.runChartClick=!(!e.chart.events||!e.chart.events.click),this.pinchDown=[],this.lastValidTouch={},this.setDOMEvents(),u(this,"afterInit")}normalize(t,e){var i=t.touches,s=i?i.length?i.item(0):v(i.changedTouches,t.changedTouches)[0]:t;return e||(e=this.getChartPosition()),i=s.pageX-e.left,s=s.pageY-e.top,i/=e.scaleX,s/=e.scaleY,c(t,{chartX:Math.round(i),chartY:Math.round(s)})}onContainerClick(t){const e=this.chart,i=e.hoverPoint;t=this.normalize(t);const s=e.plotLeft,r=e.plotTop;e.cancelClick||(i&&this.inClass(t.target,"highcharts-tracker")?(u(i.series,"click",c(t,{point:i})),e.hoverPoint&&i.firePointEvent("click",t)):(c(t,this.getCoordinates(t)),e.isInsidePlot(t.chartX-s,t.chartY-r,{visiblePlotOnly:!0})&&u(e,"click",t)))}onContainerMouseDown(t){const i=1==(1&(t.buttons||t.button));t=this.normalize(t),e.isFirefox&&0!==t.button&&this.onContainerMouseMove(t),(void 0===t.button||i)&&(this.zoomOption(t),i&&t.preventDefault&&t.preventDefault(),this.dragStart(t))}onContainerMouseLeave(t){const e=r[v(y.hoverChartIndex,-1)];t=this.normalize(t),e&&t.relatedTarget&&!this.inClass(t.relatedTarget,"highcharts-tooltip")&&(e.pointer.reset(),e.pointer.chartPosition=void 0)}onContainerMouseEnter(t){delete this.chartPosition}onContainerMouseMove(t){const e=this.chart,i=e.tooltip;t=this.normalize(t),this.setHoverChartIndex(),("mousedown"===e.mouseIsDown||this.touchSelect(t))&&this.drag(t),e.openMenu||!this.inClass(t.target,"highcharts-tracker")&&!e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop,{visiblePlotOnly:!0})||i&&i.shouldStickOnContact(t)||(this.inClass(t.target,"highcharts-no-tooltip")?this.reset(!1,0):this.runPointActions(t))}onDocumentTouchEnd(t){const e=r[v(y.hoverChartIndex,-1)];e&&e.pointer.drop(t)}onContainerTouchMove(t){this.touchSelect(t)?this.onContainerMouseMove(t):this.touch(t)}onContainerTouchStart(t){this.touchSelect(t)?this.onContainerMouseDown(t):(this.zoomOption(t),this.touch(t,!0))}onDocumentMouseMove(t){const e=this.chart,i=e.tooltip,s=this.chartPosition;t=this.normalize(t,s),!s||e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop,{visiblePlotOnly:!0})||i&&i.shouldStickOnContact(t)||this.inClass(t.target,"highcharts-tracker")||this.reset()}onDocumentMouseUp(t){const e=r[v(y.hoverChartIndex,-1)];e&&e.pointer.drop(t)}pinch(t){const e=this,i=e.chart,s=e.pinchDown,r=t.touches||[],o=r.length,a=e.lastValidTouch,h=e.hasZoom,l={},d=1===o&&(e.inClass(t.target,"highcharts-tracker")&&i.runTrackerClick||e.runChartClick),p={};var m=e.chart.tooltip;m=1===o&&v(m&&m.options.followTouchMove,!0);let g=e.selectionMarker;1{g||(e.selectionMarker=g=c({destroy:n,touch:!0},i.plotBox)),e.pinchTranslate(s,r,l,g,p,a),e.hasPinched=h,e.scaleGroups(l,p)})),e.res&&(e.res=!1,this.reset(!1,0)))}pinchTranslate(t,e,i,s,r,n){this.zoomHor&&this.pinchTranslateDirection(!0,t,e,i,s,r,n),this.zoomVert&&this.pinchTranslateDirection(!1,t,e,i,s,r,n)}pinchTranslateDirection(t,e,i,s,r,n,o,a){const h=this.chart,l=t?"x":"y",c=t?"X":"Y",d="chart"+c,u=t?"width":"height",p=h["plot"+(t?"Left":"Top")],m=h.inverted,g=h.bounds[t?"h":"v"],f=1===e.length,v=e[0][d],b=!f&&e[1][d];e=function(){"number"==typeof k&&20g.max&&(i=g.max-y,w=!0),w?(C-=.8*(C-o[l][0]),"number"==typeof k&&(k-=.8*(k-o[l][1])),e()):o[l]=[C,k],m||(n[l]=x-p,n[u]=y),n=m?1/S:S,r[u]=y,r[l]=i,s[m?t?"scaleY":"scaleX":"scale"+c]=S,s["translate"+c]=n*p+(C-n*v)}reset(t,e){const i=this.chart,s=i.hoverSeries,r=i.hoverPoint,n=i.hoverPoints,o=i.tooltip,a=o&&o.shared?n:r;t&&a&&b(a).forEach((function(e){e.series.isCartesian&&void 0===e.plotX&&(t=!1)})),t?o&&a&&b(a).length&&(o.refresh(a),o.shared&&n?n.forEach((function(t){t.setState(t.state,!0),t.series.isCartesian&&(t.series.xAxis.crosshair&&t.series.xAxis.drawCrosshair(null,t),t.series.yAxis.crosshair&&t.series.yAxis.drawCrosshair(null,t))})):r&&(r.setState(r.state,!0),i.axes.forEach((function(t){t.crosshair&&r.series[t.coll]===t&&t.drawCrosshair(null,r)})))):(r&&r.onMouseOut(),n&&n.forEach((function(t){t.setState()})),s&&s.onMouseOut(),o&&o.hide(e),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),i.axes.forEach((function(t){t.hideCrosshair()})),this.hoverX=i.hoverPoints=i.hoverPoint=null)}runPointActions(t,e,i){const s=this.chart,n=s.tooltip&&s.tooltip.options.enabled?s.tooltip:void 0,a=!!n&&n.shared;let h=e||s.hoverPoint,l=h&&h.series||s.hoverSeries;e=this.getHoverData(h,l,s.series,(!t||"touchmove"!==t.type)&&(!!e||l&&l.directTouch&&this.isDirectTouch),a,t),h=e.hoverPoint,l=e.hoverSeries;const c=e.hoverPoints;e=l&&l.tooltipOptions.followPointer&&!l.tooltipOptions.split;const u=a&&l&&!l.noSharedTooltip;if(h&&(i||h!==s.hoverPoint||n&&n.isHidden)){if((s.hoverPoints||[]).forEach((function(t){-1===c.indexOf(t)&&t.setState()})),s.hoverSeries!==l&&l.onMouseOver(),this.applyInactiveState(c),(c||[]).forEach((function(t){t.setState("hover")})),s.hoverPoint&&s.hoverPoint.firePointEvent("mouseOut"),!h.series)return;s.hoverPoints=c,s.hoverPoint=h,h.firePointEvent("mouseOver",void 0,(()=>{n&&h&&n.refresh(u?c:h,t)}))}else e&&n&&!n.isHidden&&(i=n.getAnchor([{}],t),s.isInsidePlot(i[0],i[1],{visiblePlotOnly:!0})&&n.updatePosition({plotX:i[0],plotY:i[1]}));this.unDocMouseMove||(this.unDocMouseMove=o(s.container.ownerDocument,"mousemove",(function(t){const e=r[y.hoverChartIndex];e&&e.pointer.onDocumentMouseMove(t)})),this.eventsToUnbind.push(this.unDocMouseMove)),s.axes.forEach((function(e){const i=v((e.crosshair||{}).snap,!0);let r;i&&((r=s.hoverPoint)&&r.series[e.coll]===e||(r=d(c,(t=>t.series&&t.series[e.coll]===e)))),r||!i?e.drawCrosshair(t,r):e.hideCrosshair()}))}scaleGroups(t,e){const i=this.chart;i.series.forEach((function(s){const r=t||s.getPlotBox();s.group&&(s.xAxis&&s.xAxis.zoomEnabled||i.mapView)&&(s.group.attr(r),s.markerGroup&&(s.markerGroup.attr(r),s.markerGroup.clip(e?i.clipRect:null)),s.dataLabelsGroup&&s.dataLabelsGroup.attr(r))})),i.clipRect.attr(e||i.clipBox)}setDOMEvents(){const t=this.chart.container,i=t.ownerDocument;t.onmousedown=this.onContainerMouseDown.bind(this),t.onmousemove=this.onContainerMouseMove.bind(this),t.onclick=this.onContainerClick.bind(this),this.eventsToUnbind.push(o(t,"mouseenter",this.onContainerMouseEnter.bind(this))),this.eventsToUnbind.push(o(t,"mouseleave",this.onContainerMouseLeave.bind(this))),y.unbindDocumentMouseUp||(y.unbindDocumentMouseUp=o(i,"mouseup",this.onDocumentMouseUp.bind(this)));let s=this.chart.renderTo.parentElement;for(;s&&"BODY"!==s.tagName;)this.eventsToUnbind.push(o(s,"scroll",(()=>{delete this.chartPosition}))),s=s.parentElement;e.hasTouch&&(this.eventsToUnbind.push(o(t,"touchstart",this.onContainerTouchStart.bind(this),{passive:!1})),this.eventsToUnbind.push(o(t,"touchmove",this.onContainerTouchMove.bind(this),{passive:!1})),y.unbindDocumentTouchEnd||(y.unbindDocumentTouchEnd=o(i,"touchend",this.onDocumentTouchEnd.bind(this),{passive:!1})))}setHoverChartIndex(){const t=this.chart,i=e.charts[v(y.hoverChartIndex,-1)];i&&i!==t&&i.pointer.onContainerMouseLeave({relatedTarget:t.container}),i&&i.mouseIsDown||(y.hoverChartIndex=t.index)}touch(t,e){const i=this.chart;let s,r;this.setHoverChartIndex(),1===t.touches.length?(t=this.normalize(t),(r=i.isInsidePlot(t.chartX-i.plotLeft,t.chartY-i.plotTop,{visiblePlotOnly:!0}))&&!i.openMenu?(e&&this.runPointActions(t),"touchmove"===t.type&&(s=!!(e=this.pinchDown)[0]&&4<=Math.sqrt(Math.pow(e[0].chartX-t.chartX,2)+Math.pow(e[0].chartY-t.chartY,2))),v(s,!0)&&this.pinch(t)):e&&this.reset()):2===t.touches.length&&this.pinch(t)}touchSelect(t){return!(!this.chart.zooming.singleTouch||!t.touches||1!==t.touches.length)}zoomOption(t){const e=this.chart,i=e.inverted;var s=e.zooming.type||"";/touch/.test(t.type)&&(s=v(e.zooming.pinchType,s)),this.zoomX=t=/x/.test(s),this.zoomY=s=/y/.test(s),this.zoomHor=t&&!i||s&&i,this.zoomVert=s&&!i||t&&i,this.hasZoom=t||s}}return function(t){const e=[],s=[];t.compose=function(e){i.pushUnique(s,e)&&o(e,"beforeRender",(function(){this.pointer=new t(this,this.options)}))},t.dissolve=function(){for(let t=0,i=e.length;t{this.proximate&&(this.proximatePositions(),this.positionItems())})))}setOptions(t){const e=x(t.padding,8);this.options=t,this.chart.styledMode||(this.itemStyle=t.itemStyle,this.itemHiddenStyle=y(this.itemStyle,t.itemHiddenStyle)),this.itemMarginTop=t.itemMarginTop,this.itemMarginBottom=t.itemMarginBottom,this.padding=e,this.initialItemY=e-5,this.symbolWidth=x(t.symbolWidth,16),this.pages=[],this.proximate="proximate"===t.layout&&!this.chart.inverted,this.baseline=void 0}update(t,e){const i=this.chart;this.setOptions(y(!0,this.options,t)),this.destroy(),i.isDirtyLegend=i.isDirtyBox=!0,x(e,!0)&&i.redraw(),v(this,"afterUpdate")}colorizeItem(t,e){const{group:i,label:s,line:r,symbol:n}=t.legendItem||{};if(i&&i[e?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){const{itemHiddenStyle:i}=this,o=i.color,a=e&&t.color||o,h=t.options&&t.options.marker;let l={fill:a};null==s||s.css(y(e?this.itemStyle:i)),null==r||r.attr({stroke:a}),n&&(h&&n.isMarker&&(l=t.pointAttribs(),e||(l.stroke=l.fill=o)),n.attr(l))}v(this,"afterColorizeItem",{item:t,visible:e})}positionItems(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()}positionItem(t){const{group:e,x:i=0,y:s=0}=t.legendItem||{};var r=this.options,n=r.symbolPadding;const o=!r.rtl;r=t.checkbox,e&&e.element&&(n={translateX:o?i:this.legendWidth-i-2*n-4,translateY:s},e[m(e.translateY)?"animate":"attr"](n,void 0,(()=>{v(this,"afterPositionItem",{item:t})}))),r&&(r.x=i,r.y=s)}destroyItem(t){const e=t.checkbox,i=t.legendItem||{};for(const t of["group","label","line","symbol"])i[t]&&(i[t]=i[t].destroy());e&&g(e),t.legendItem=void 0}destroy(){for(const t of this.getAllItems())this.destroyItem(t);for(const t of"clipRect up down pager nav box title group".split(" "))this[t]&&(this[t]=this[t].destroy());this.display=null}positionCheckboxes(){const t=this.group&&this.group.alignAttr,e=this.clipHeight||this.legendHeight,i=this.titleHeight;let s;t&&(s=t.translateY,this.allItems.forEach((function(r){const n=r.checkbox;let o;n&&(o=s+i+n.y+(this.scrollOffset||0)+3,p(n,{left:t.translateX+r.checkboxOffset+n.x-20+"px",top:o+"px",display:this.proximate||o>s-6&&o1.5*s?i.height:s))}layoutItem(t){var e=this.options;const i=this.padding,s="horizontal"===e.layout,r=t.itemHeight,n=this.itemMarginBottom,o=this.itemMarginTop,a=s?x(e.itemDistance,20):0,h=this.maxLegendWidth;e=e.alignColumns&&this.totalItemWidth>h?this.maxItemWidth:t.itemWidth;const l=t.legendItem||{};s&&this.itemX-i+e>h&&(this.itemX=i,this.lastLineHeight&&(this.itemY+=o+this.lastLineHeight+n),this.lastLineHeight=0),this.lastItemY=o+this.itemY+n,this.lastLineHeight=Math.max(r,this.lastLineHeight),l.x=this.itemX,l.y=this.itemY,s?this.itemX+=e:(this.itemY+=o+r+n,this.lastLineHeight=r),this.offsetWidth=this.widthOption||Math.max((s?this.itemX-i-(t.checkbox?0:a):e)+i,this.offsetWidth)}getAllItems(){let t=[];return this.chart.series.forEach((function(e){const i=e&&e.options;e&&x(i.showInLegend,!m(i.linkedTo)&&void 0,!0)&&(t=t.concat((e.legendItem||{}).labels||("point"===i.legendType?e.data:e)))})),v(this,"afterGetAllItems",{allItems:t}),t}getAlignment(){const t=this.options;return this.proximate?t.align.charAt(0)+"tv":t.floating?"":t.align.charAt(0)+t.verticalAlign.charAt(0)+t.layout.charAt(0)}adjustMargins(t,e){const i=this.chart,s=this.options,r=this.getAlignment();r&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach((function(n,o){n.test(r)&&!m(t[o])&&(i[l[o]]=Math.max(i[l[o]],i.legend[(o+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][o]*s[o%2?"x":"y"]+x(s.margin,12)+e[o]+(i.titleOffset[o]||0)))}))}proximatePositions(){const t=this.chart,e=[],i="left"===this.options.align;let s;this.allItems.forEach((function(s){var r,n=i;let o;s.yAxis&&(s.xAxis.options.reversed&&(n=!n),s.points&&(r=f(n?s.points:s.points.slice(0).reverse(),(function(t){return b(t.plotY)}))),n=this.itemMarginTop+s.legendItem.label.getBBox().height+this.itemMarginBottom,o=s.yAxis.top-t.plotTop,s.visible?(r=r?r.plotY:s.yAxis.height,r+=o-.3*n):r=o+s.yAxis.height,e.push({target:r,size:n,item:s}))}),this);for(const i of c(e,t.plotHeight))s=i.item.legendItem||{},b(i.pos)&&(s.y=t.plotTop-t.spacing[0]+i.pos)}render(){const t=this.chart,e=t.renderer,i=this.options,s=this.padding;var r=this.getAllItems();let n,o=this.group,a=this.box;this.itemX=s,this.itemY=this.initialItemY,this.lastItemY=this.offsetWidth=0,this.widthOption=w(i.width,t.spacingBox.width-s);var h=t.spacingBox.width-2*s-i.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(h/=2),this.maxLegendWidth=this.widthOption||h,o||(this.group=o=e.g("legend").addClass(i.className||"").attr({zIndex:7}).add(),this.contentGroup=e.g().attr({zIndex:1}).add(o),this.scrollGroup=e.g().add(this.contentGroup)),this.renderTitle(),S(r,((t,e)=>(t.options&&t.options.legendIndex||0)-(e.options&&e.options.legendIndex||0))),i.reversed&&r.reverse(),this.allItems=r,this.display=h=!!r.length,this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0,r.forEach(this.renderItem,this),r.forEach(this.layoutItem,this),r=(this.widthOption||this.offsetWidth)+s,n=this.lastItemY+this.lastLineHeight+this.titleHeight,n=this.handleOverflow(n),n+=s,a||(this.box=a=e.rect().addClass("highcharts-legend-box").attr({r:i.borderRadius}).add(o)),t.styledMode||a.attr({stroke:i.borderColor,"stroke-width":i.borderWidth||0,fill:i.backgroundColor||"none"}).shadow(i.shadow),0n&&!1!==l.enabled?(this.clipHeight=f=Math.max(n-20-this.titleHeight-a,0),this.currentPage=x(this.currentPage,1),this.fullHeight=t,p.forEach(((t,e)=>{b=t.legendItem||{},t=b.y||0;const i=Math.round(b.label.getBBox().height);let s=u.length;(!s||t-u[s-1]>f&&(v||t)!==u[s-1])&&(u.push(v||t),s++),b.pageIx=s-1,v&&((p[e-1].legendItem||{}).pageIx=s-1),e===p.length-1&&t+i-u[s-1]>f&&t>u[s-1]&&(u.push(t),b.pageIx=s),t!==v&&(v=t)})),w||(w=e.clipRect=s.clipRect(0,a-2,9999,0),e.contentGroup.clip(w)),m(f),y||(this.nav=y=s.g().attr({zIndex:1}).add(this.group),this.up=s.symbol("triangle",0,0,d,d).add(y),g("upTracker").on("click",(function(){e.scroll(-1,c)})),this.pager=s.text("",15,10).addClass("highcharts-legend-navigation"),!i.styledMode&&l.style&&this.pager.css(l.style),this.pager.add(y),this.down=s.symbol("triangle-down",0,0,d,d).add(y),g("downTracker").on("click",(function(){e.scroll(1,c)}))),e.scroll(0),t=n):y&&(m(),this.nav=y.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),t}scroll(t,e){const i=this.chart,s=this.pages,r=s.length,n=this.clipHeight,h=this.options.navigation,l=this.pager,c=this.padding;let d=this.currentPage+t;d>r&&(d=r),0{v(this,"afterScroll",{currentPage:d})}),t.duration))}setItemEvents(t,e,i){const r=this,n=t.legendItem||{},o=r.chart.renderer.boxWrapper,a=t instanceof s,h="highcharts-legend-"+(a?"point":"series")+"-active",l=r.chart.styledMode;i=i?[e,n.symbol]:[n.group];const c=e=>{r.allItems.forEach((i=>{t!==i&&[i].concat(i.linkedSeries||[]).forEach((t=>{t.setState(e,!a)}))}))};for(const s of i)s&&s.on("mouseover",(function(){t.visible&&c("inactive"),t.setState("hover"),t.visible&&o.addClass(h),l||e.css(r.options.itemHoverStyle)})).on("mouseout",(function(){r.chart.styledMode||e.css(y(t.visible?r.itemStyle:r.itemHiddenStyle)),c(""),o.removeClass(h),t.setState()})).on("click",(function(e){const i=function(){t.setVisible&&t.setVisible(),c(t.visible?"inactive":"")};o.removeClass(h),e={browserEvent:e},t.firePointEvent?t.firePointEvent("legendItemClick",e,i):v(t,"legendItemClick",e,i)}))}createCheckboxForItem(t){t.checkbox=u("input",{type:"checkbox",className:"highcharts-legend-checkbox",checked:t.selected,defaultChecked:t.selected},this.options.itemCheckboxStyle,this.chart.container),d(t.checkbox,"click",(function(e){v(t.series||t,"checkboxClick",{checked:e.target.checked,item:t},(function(){t.select()}))}))}}return function(t){const e=[];t.compose=function(i){n.pushUnique(e,i)&&d(i,"beforeMargins",(function(){this.legend=new t(this,this.options.legend)}))}}(k||(k={})),k})),e(i,"Core/Legend/LegendSymbol.js",[i["Core/Utilities.js"]],(function(t){const{extend:e,merge:i,pick:s}=t;var r;return function(t){t.lineMarker=function(t,r){r=this.legendItem=this.legendItem||{};var n=this.options;const o=t.symbolWidth,a=t.symbolHeight,h=a/2,l=this.chart.renderer,c=r.group;t=t.baseline-Math.round(.3*t.fontMetrics.b);let d={},u=n.marker,p=0;this.chart.styledMode||(d={"stroke-width":Math.min(n.lineWidth||0,24)},n.dashStyle?d.dashstyle=n.dashStyle:"square"!==n.linecap&&(d["stroke-linecap"]="round")),r.line=l.path().addClass("highcharts-graph").attr(d).add(c),d["stroke-linecap"]&&(p=Math.min(r.line.strokeWidth(),o)/2),o&&r.line.attr({d:[["M",p,t],["L",o-p,t]]}),u&&!1!==u.enabled&&o&&(n=Math.min(s(u.radius,h),h),0===this.symbol.indexOf("url")&&(u=i(u,{width:a,height:a}),n=0),r.symbol=r=l.symbol(this.symbol,o/2-n,t-n,2*n,2*n,e({context:"legend"},u)).addClass("highcharts-point").add(c),r.isMarker=!0)},t.rectangle=function(t,e){e=e.legendItem||{};const i=t.symbolHeight,r=t.options.squareSymbol;e.symbol=this.chart.renderer.rect(r?(t.symbolWidth-i)/2:0,t.baseline-i+1,r?i:t.symbolWidth,i,s(t.options.symbolRadius,i/2)).addClass("highcharts-point").attr({zIndex:3}).add(e.group)}}(r||(r={})),r})),e(i,"Core/Series/SeriesDefaults.js",[],(function(){return{lineWidth:1,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},enableMouseTracking:!0,events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:150},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",borderWidth:0,defer:!0,formatter:function(){const{numberFormatter:t}=this.series.chart;return"number"!=typeof this.y?"":t(this.y,-1)},padding:5,style:{fontSize:"0.7em",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:150},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:150},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"}})),e(i,"Core/Series/SeriesRegistry.js",[i["Core/Globals.js"],i["Core/Defaults.js"],i["Core/Series/Point.js"],i["Core/Utilities.js"]],(function(t,e,i,s){const{defaultOptions:r}=e,{extendClass:n,merge:o}=s;var a;return function(e){function s(t,s){const n=r.plotOptions||{},o=s.defaultOptions,a=s.prototype;a.type=t,a.pointClass||(a.pointClass=i),o&&(n[t]=o),e.seriesTypes[t]=s}e.seriesTypes=t.seriesTypes,e.registerSeriesType=s,e.seriesType=function(t,a,h,l,c){const d=r.plotOptions||{};return a=a||"",d[t]=o(d[a],h),s(t,n(e.seriesTypes[a]||function(){},l)),e.seriesTypes[t].prototype.type=t,c&&(e.seriesTypes[t].prototype.pointClass=n(i,c)),e.seriesTypes[t]}}(a||(a={})),a})),e(i,"Core/Series/Series.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Defaults.js"],i["Core/Foundation.js"],i["Core/Globals.js"],i["Core/Legend/LegendSymbol.js"],i["Core/Series/Point.js"],i["Core/Series/SeriesDefaults.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r,n,o,a,h,l){const{animObject:c,setAnimation:d}=t,{defaultOptions:u}=e,{registerEventOptions:p}=i,{hasTouch:m,svg:g,win:f}=s,{seriesTypes:v}=a,{arrayMax:b,arrayMin:y,clamp:x,correctFloat:w,defined:S,diffObjects:C,erase:k,error:A,extend:M,find:E,fireEvent:T,getClosestDistance:L,getNestedProperty:O,insertItem:P,isArray:D,isNumber:R,isString:I,merge:B,objectEach:j,pick:F,removeEvent:N,splat:z,syncTimeout:H}=l;class W{constructor(){this.zones=this.yAxis=this.xAxis=this.userOptions=this.tooltipOptions=this.processedYData=this.processedXData=this.points=this.options=this.linkedSeries=this.index=this.eventsToUnbind=this.eventOptions=this.data=this.chart=this._i=void 0}init(t,e){T(this,"init",{options:e});const i=this,s=t.series;this.eventsToUnbind=[],i.chart=t,i.options=i.setOptions(e),e=i.options,i.linkedSeries=[],i.bindAxes(),M(i,{name:e.name,state:"",visible:!1!==e.visible,selected:!0===e.selected}),p(this,e);const r=e.events;let n;(r&&r.click||e.point&&e.point.events&&e.point.events.click||e.allowPointSelect)&&(t.runTrackerClick=!0),i.getColor(),i.getSymbol(),i.parallelArrays.forEach((function(t){i[t+"Data"]||(i[t+"Data"]=[])})),i.isCartesian&&(t.hasCartesianSeries=!0),s.length&&(n=s[s.length-1]),i._i=F(n&&n._i,-1)+1,i.opacity=i.options.opacity,t.orderItems("series",P(this,s)),e.dataSorting&&e.dataSorting.enabled?i.setDataSortingOptions():i.points||i.data||i.setData(e.data,!1),T(this,"afterInit")}is(t){return v[t]&&this instanceof v[t]}bindAxes(){const t=this,e=t.options,i=t.chart;let s;T(this,"bindAxes",null,(function(){(t.axisTypes||[]).forEach((function(r){i[r].forEach((function(i){s=i.options,(F(e[r],0)===i.index||void 0!==e[r]&&e[r]===s.id)&&(P(t,i.series),t[r]=i,i.isDirty=!0)})),t[r]||t.optionalAxis===r||A(18,!0,i)}))})),T(this,"afterBindAxes")}updateParallelArrays(t,e,i){const s=t.series,r=R(e)?function(i){const r="y"===i&&s.toYData?s.toYData(t):t[i];s[i+"Data"][e]=r}:function(t){Array.prototype[e].apply(s[t+"Data"],i)};s.parallelArrays.forEach(r)}hasData(){return this.visible&&void 0!==this.dataMax&&void 0!==this.dataMin||this.visible&&this.yData&&0!e.touched&&e.index===t.index,a&&a.matchByName?o=e=>!e.touched&&e.name===t.name:this.options.relativeXValue&&(o=e=>!e.touched&&e.options.x===t.x),!(o=E(r,o))))return;return o&&(l=o&&o.index,void 0!==l&&(h=!0)),void 0===l&&R(s)&&(l=this.xData.indexOf(s,e)),-1!==l&&void 0!==l&&this.cropped&&(l=l>=this.cropStart?l-this.cropStart:l),!h&&R(l)&&r[l]&&r[l].touched&&(l=void 0),l}updateData(t,e){const i=this.options,s=i.dataSorting,r=this.points,n=[],o=this.requireSorting,a=t.length===r.length;let h,l,c,d=!0;if(this.xIncrement=null,t.forEach((function(t,e){var l=S(t)&&this.pointClass.prototype.optionsToObject.call({series:this},t)||{};const d=l.x;l.id||R(d)?(-1===(l=this.findPointIndex(l,c))||void 0===l?n.push(t):r[l]&&t!==i.data[l]?(r[l].update(t,!1,null,!1),r[l].touched=!0,o&&(c=l+1)):r[l]&&(r[l].touched=!0),(!a||e!==l||s&&s.enabled||this.hasDerivedData)&&(h=!0)):n.push(t)}),this),h)for(t=r.length;t--;)(l=r[t])&&!l.touched&&l.remove&&l.remove(!1,e);else!a||s&&s.enabled?d=!1:(t.forEach((function(t,e){t===r[e].y||r[e].destroyed||r[e].update(t,!1,null,!1)})),n.length=0);return r.forEach((function(t){t&&(t.touched=!1)})),!!d&&(n.forEach((function(t){this.addPoint(t,!1,null,null,!1)}),this),null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=b(this.xData),this.autoIncrement()),!0)}setData(t,e=!0,i,s){var r;const n=this,o=n.points,a=o&&o.length||0,h=n.options,l=n.chart,c=h.dataSorting,d=n.xAxis,u=h.turboThreshold,p=this.xData,m=this.yData;var g=n.pointArrayMap;g=g&&g.length;const f=h.keys;let v,b=0,y=1,x=null;if(!l.options.chart.allowMutatingData){h.data&&delete n.options.data,n.userOptions.data&&delete n.userOptions.data;var w=B(!0,t)}if(w=(t=w||t||[]).length,c&&c.enabled&&(t=this.sortData(t)),l.options.chart.allowMutatingData&&!1!==s&&w&&a&&!n.cropped&&!n.hasGroupedData&&n.visible&&!n.boosted&&(v=this.updateData(t,i)),!v){if(n.xIncrement=null,n.colorCounter=0,this.parallelArrays.forEach((function(t){n[t+"Data"].length=0})),u&&w>u)if(x=n.getFirstValidPoint(t),R(x))for(i=0;i(t=O(i,t),(e=O(i,e))t?1:0))).forEach((function(t,e){t.x=e}),this),e.linkedSeries&&e.linkedSeries.forEach((function(e){const i=e.options,r=i.data;i.dataSorting&&i.dataSorting.enabled||!r||(r.forEach((function(i,n){r[n]=s(e,i),t[n]&&(r[n].x=t[n].x,r[n].index=n)})),e.setData(r,!1))})),t}getProcessedData(t){const e=this;var i=e.xAxis,s=e.options;const r=s.cropThreshold,n=t||e.getExtremesFromAll||s.getExtremesFromAll,o=null==i?void 0:i.logarithmic,a=e.isCartesian;let h,l=0;t=e.xData,s=e.yData;let c=!1;const d=t.length;if(i){var u=i.getExtremes();h=u.min,u=u.max,c=!(!i.categories||i.names.length)}if(a&&e.sorted&&!n&&(!r||d>r||e.forceCrop))if(t[d-1]u)t=[],s=[];else if(e.yData&&(t[0]u)){var p=this.cropData(e.xData,e.yData,h,u);t=p.xData,s=p.yData,l=p.start,p=!0}return i=L([o?t.map(o.log2lin):t],(()=>e.requireSorting&&!c&&A(15,!1,e.chart))),{xData:t,yData:s,cropped:p,cropStart:l,closestPointRange:i}}processData(t){const e=this.xAxis;if(this.isCartesian&&!this.isDirty&&!e.isDirty&&!this.yAxis.isDirty&&!t)return!1;t=this.getProcessedData(),this.cropped=t.cropped,this.cropStart=t.cropStart,this.processedXData=t.xData,this.processedYData=t.yData,this.closestPointRange=this.basePointRange=t.closestPointRange,T(this,"afterProcessData")}cropData(t,e,i,s,r){const n=t.length;let o,a=0,h=n;for(r=F(r,this.cropShoulder),o=0;o=i){a=Math.max(0,o-r);break}for(i=o;is){h=i+r;break}return{xData:t.slice(a,h),yData:e.slice(a,h),start:a,end:h}}generatePoints(){var t=this.options;const e=this.processedData||t.data,i=this.processedXData,s=this.processedYData,r=this.pointClass,n=i.length,o=this.cropStart||0,a=this.hasGroupedData,h=t.keys,l=[];let c;t=t.dataGrouping&&t.dataGrouping.groupAll?o:0;let d,u,p=this.data;if(!p&&!a){var m=[];m.length=e.length,p=this.data=m}for(h&&a&&(this.options.keys=!1),u=0;u=h&&(r[a-o]||p)<=l,m&&p)if(m=u.length)for(;m--;)R(u[m])&&(n[c++]=u[m]);else n[c++]=u}return t={activeYData:n,dataMin:y(n),dataMax:b(n)},T(this,"afterGetExtremes",{dataExtremes:t}),t}applyExtremes(){const t=this.getExtremes();return this.dataMin=t.dataMin,this.dataMax=t.dataMax,t}getFirstValidPoint(t){const e=t.length;let i=0,s=null;for(;null===s&&i=k&&(k=void 0),h.total=h.stackTotal=F(b.total),h.percentage=S(h.y)&&b.total?h.y/b.total*100:void 0,h.stackY=C,this.irregularWidths||b.setOffset(this.pointXOffset||0,this.barW||0,void 0,void 0,void 0,this.xAxis))),h.yBottom=S(k)?x(o.translate(k,!1,!0,!1,!0),-1e5,1e5):void 0,this.dataModify&&(C=this.dataModify.modifyValue(C,u)),R(C)&&void 0!==h.plotX&&(M=o.translate(C,!1,!0,!1,!0),M=R(M)?x(M,-1e5,1e5):void 0),h.plotY=M,h.isInside=this.isPointInside(h),h.clientX=c?w(s.translate(v,!1,!1,!1,!0,l)):p,h.negative=(h.y||0)<(d||0),h.category=F(r&&r[h.x],h.x),h.isNull||!1===h.visible||(void 0!==m&&(f=Math.min(f,Math.abs(p-m))),m=p),h.zone=this.zones.length?h.getZone():void 0,!h.graphic&&this.group&&n&&(h.isNew=!0)}this.closestPointRangePx=f,T(this,"afterTranslate")}getValidPoints(t,e,i){const s=this.chart;return(t||this.points||[]).filter((function(t){const{plotX:r,plotY:n}=t;return!(!(i||!t.isNull&&R(n))||e&&!s.isInsidePlot(r,n,{inverted:s.inverted}))&&!1!==t.visible}))}getClipBox(){const{chart:t,xAxis:e,yAxis:i}=this,s=B(t.clipBox);return e&&e.len!==t.plotSizeX&&(s.width=e.len),i&&i.len!==t.plotSizeY&&(s.height=i.len),s}getSharedClipKey(){return this.sharedClipKey=(this.options.xAxis||0)+","+(this.options.yAxis||0)}setClip(){const{chart:t,group:e,markerGroup:i}=this,s=t.sharedClips,r=t.renderer,n=this.getClipBox(),o=this.getSharedClipKey();let a=s[o];a?a.animate(n):s[o]=a=r.clipRect(n),e&&e.clip(!1===this.options.clip?void 0:a),i&&i.clip()}animate(t){const{chart:e,group:i,markerGroup:s}=this,r=e.inverted;var n=c(this.options.animation),o=[this.getSharedClipKey(),n.duration,n.easing,n.defer].join();let a=e.sharedClips[o],h=e.sharedClips[o+"m"];if(t&&i)n=this.getClipBox(),a?a.attr("height",n.height):(n.width=0,r&&(n.x=e.plotHeight),a=e.renderer.clipRect(n),e.sharedClips[o]=a,h=e.renderer.clipRect({x:-99,y:-99,width:r?e.plotWidth+199:99,height:r?99:e.plotHeight+199}),e.sharedClips[o+"m"]=h),i.clip(a),s&&s.clip(h);else if(a&&!a.hasClass("highcharts-animating")){o=this.getClipBox();const t=n.step;s&&s.element.childNodes.length&&(n.step=function(e,i){t&&t.apply(i,arguments),"width"===i.prop&&h&&h.element&&h.attr(r?"height":"width",e+99)}),a.addClass("highcharts-animating").animate(o,n)}}afterAnimate(){this.setClip(),j(this.chart.sharedClips,((t,e,i)=>{t&&!this.chart.container.querySelector(`[clip-path="url(#${t.id})"]`)&&(t.destroy(),delete i[e])})),this.finishedAnimating=!0,T(this,"afterAnimate")}drawPoints(t=this.points){const e=this.chart,i=e.styledMode,{colorAxis:s,options:r}=this,n=r.marker,o=this[this.specialGroup||"markerGroup"],a=this.xAxis,h=F(n.enabled,!(a&&!a.isRadial)||null,this.closestPointRangePx>=n.enabledThreshold*n.radius);let l,c,d,u,p,m;if(!1!==n.enabled||this._hasPointMarkers)for(l=0;lt.destroy())),l.clearTimeout(e.animationTimeout),j(e,(function(t,e){t instanceof h&&!t.survive&&(n=s&&"group"===e?"hide":"destroy",t[n]())})),i.hoverSeries===e&&(i.hoverSeries=void 0),k(i.series,e),i.orderItems("series"),j(e,(function(i,s){t&&"hcEvents"===s||delete e[s]}))}applyZones(){const t=this,e=this.chart,i=e.renderer,s=this.zones,r=this.clips||[],n=this.graph,o=this.area,a=Math.max(e.plotWidth,e.plotHeight),h=this[(this.zoneAxis||"y")+"Axis"],l=e.inverted;let c,d,u,p,m,g,f,v,b,y,w,S=!1;s.length&&(n||o)&&h&&void 0!==h.min?(m=h.reversed,g=h.horiz,n&&!this.showLine&&n.hide(),o&&o.hide(),p=h.getExtremes(),s.forEach((function(s,C){c=m?g?e.plotWidth:0:g?0:h.toPixels(p.min)||0,c=x(F(d,c),0,a),d=x(Math.round(h.toPixels(F(s.value,p.max),!0)||0),0,a),S&&(c=d=h.toPixels(p.max)),f=Math.abs(c-d),v=Math.min(c,d),b=Math.max(c,d),h.isXAxis?(u={x:l?b:v,y:0,width:f,height:a},g||(u.x=e.plotHeight-u.x)):(u={x:0,y:l?b:v,width:a,height:f},g&&(u.y=e.plotWidth-u.y)),r[C]?r[C].animate(u):r[C]=i.clipRect(u),y=t["zone-area-"+C],w=t["zone-graph-"+C],n&&w&&w.clip(r[C]),o&&y&&y.clip(r[C]),S=s.value>p.max,t.resetZones&&0===d&&(d=void 0)})),this.clips=r):t.visible&&(n&&n.show(),o&&o.show())}plotGroup(t,e,i,s,r){let n=this[t];const o=!n;return i={visibility:i,zIndex:s||.1},void 0===this.opacity||this.chart.styledMode||"inactive"===this.state||(i.opacity=this.opacity),o&&(this[t]=n=this.chart.renderer.g().add(r)),n.addClass("highcharts-"+e+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(S(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(n.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),n.attr(i)[o?"attr":"animate"](this.getPlotBox(e)),n}getPlotBox(t){let e=this.xAxis,i=this.yAxis;const s=this.chart;return t=s.inverted&&!s.polar&&e&&!1!==this.invertible&&"series"===t,s.inverted&&(e=i,i=this.xAxis),{translateX:e?e.left:s.plotLeft,translateY:i?i.top:s.plotTop,rotation:t?90:0,rotationOriginX:t?(e.len-i.len)/2:0,rotationOriginY:t?(e.len+i.len)/2:0,scaleX:t?-1:1,scaleY:1}}removeEvents(t){t||N(this),this.eventsToUnbind.length&&(this.eventsToUnbind.forEach((function(t){t()})),this.eventsToUnbind.length=0)}render(){const t=this;var e=t.chart;const i=t.options,s=c(i.animation),r=t.visible?"inherit":"hidden",n=i.zIndex,o=t.hasRendered;e=e.seriesGroup;let a=t.finishedAnimating?0:s.duration;T(this,"render"),t.plotGroup("group","series",r,n,e),t.markerGroup=t.plotGroup("markerGroup","markers",r,n,e),!1!==i.clip&&t.setClip(),t.animate&&a&&t.animate(!0),t.drawGraph&&(t.drawGraph(),t.applyZones()),t.visible&&t.drawPoints(),t.drawDataLabels&&t.drawDataLabels(),t.redrawPoints&&t.redrawPoints(),t.drawTracker&&i.enableMouseTracking&&t.drawTracker(),t.animate&&a&&t.animate(),o||(a&&s.defer&&(a+=s.defer),t.animationTimeout=H((function(){t.afterAnimate()}),a||0)),t.isDirty=!1,t.hasRendered=!0,T(t,"afterRender")}redraw(){const t=this.isDirty||this.isDirtyData;this.translate(),this.render(),t&&delete this.kdTree}searchPoint(t,e){const i=this.xAxis,s=this.yAxis,r=this.chart.inverted;return this.searchKDTree({clientX:r?i.len-t.chartY+i.pos:t.chartX-i.pos,plotY:r?s.len-t.chartX+s.pos:t.chartY-s.pos},e,t)}buildKDTree(t){function e(t,s,r){var n=t&&t.length;let o;if(n)return o=i.kdAxisArray[s%r],t.sort((function(t,e){return t[o]-e[o]})),{point:t[n=Math.floor(n/2)],left:e(t.slice(0,n),s+1,r),right:e(t.slice(n+1),s+1,r)}}this.buildingKdTree=!0;const i=this,s=-1(c=e[c]-l[c])?"right":"left",i[p=0>c?"left":"right"]&&(d=(p=t(e,i[p],a+1,h))[o]m;)u--;this.updateParallelArrays(p,"splice",[u,0,0]),this.updateParallelArrays(p,u),h&&p.name&&(h[m]=p.name),l.splice(u,0,t),(d||this.processedData)&&(this.data.splice(u,0,null),this.processData()),"point"===n.legendType&&this.generatePoints(),i&&(o[0]&&o[0].remove?o[0].remove(!1):(o.shift(),this.updateParallelArrays(p,"shift"),l.shift())),!1!==r&&T(this,"addPoint",{point:p}),this.isDirtyData=this.isDirty=!0,e&&a.redraw(s)}removePoint(t,e,i){const s=this,r=s.data,n=r[t],o=s.points,a=s.chart,h=function(){o&&o.length===r.length&&o.splice(t,1),r.splice(t,1),s.options.data.splice(t,1),s.updateParallelArrays(n||{series:s},"splice",[t,1]),n&&n.destroy(),s.isDirty=!0,s.isDirtyData=!0,e&&a.redraw()};d(i,a),e=F(e,!0),n?n.firePointEvent("remove",null,h):h()}remove(t,e,i,s){function r(){n.destroy(s),o.isDirtyLegend=o.isDirtyBox=!0,o.linkSeries(s),F(t,!0)&&o.redraw(e)}const n=this,o=n.chart;!1!==i?T(n,"remove",null,r):r()}update(t,e){t=C(t,this.userOptions),T(this,"update",{options:t});const i=this,s=i.chart;var r=i.userOptions;const n=i.initialType||i.type;var o=s.options.plotOptions;const a=v[n].prototype;var h=i.finishedAnimating&&{animation:!1};const l={};let c,d=["colorIndex","eventOptions","navigatorSeries","symbolIndex","baseSeries"],u=t.type||r.type||s.options.chart.type;const p=!(this.hasDerivedData||u&&u!==this.type||void 0!==t.pointStart||void 0!==t.pointInterval||void 0!==t.relativeXValue||t.joinBy||t.mapData||i.hasOptionChanged("dataGrouping")||i.hasOptionChanged("pointStart")||i.hasOptionChanged("pointInterval")||i.hasOptionChanged("pointIntervalUnit")||i.hasOptionChanged("keys"));if(u=u||n,p&&(d.push("data","isDirtyData","points","processedData","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","clips","nodes","layout","level","mapMap","mapData","minY","maxY","minX","maxX"),!1!==t.visible&&d.push("area","graph"),i.parallelArrays.forEach((function(t){d.push(t+"Data")})),t.data&&(t.dataSorting&&M(i.options.dataSorting,t.dataSorting),this.setData(t.data,!1))),t=B(r,h,{index:void 0===r.index?i.index:r.index,pointStart:F(o&&o.series&&o.series.pointStart,r.pointStart,i.xData[0])},!p&&{data:i.options.data},t),p&&t.data&&(t.data=i.options.data),d=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(d),d.forEach((function(t){d[t]=i[t],delete i[t]})),o=!1,v[u]){if(o=u!==i.type,i.remove(!1,!1,!1,!0),o)if(Object.setPrototypeOf)Object.setPrototypeOf(i,v[u].prototype);else{for(c in h=Object.hasOwnProperty.call(i,"hcEvents")&&i.hcEvents,a)i[c]=void 0;M(i,v[u].prototype),h?i.hcEvents=h:delete i.hcEvents}}else A(17,!0,s,{missingModuleFor:u});if(d.forEach((function(t){i[t]=d[t]})),i.init(s,t),p&&this.points){if(!1===(t=i.options).visible)l.graphic=1,l.dataLabel=1;else if(!i._hasPointLabels){const{marker:e,dataLabels:i}=t;r=r.marker||{},!e||!1!==e.enabled&&r.symbol===e.symbol&&r.height===e.height&&r.width===e.width||(l.graphic=1),i&&!1===i.enabled&&(l.dataLabel=1)}for(const e of this.points)e&&e.series&&(e.resolveColor(),Object.keys(l).length&&e.destroyElements(l),!1===t.showInLegend&&e.legendItem&&s.legend.destroyItem(e))}i.initialType=n,s.linkSeries(),o&&i.linkedSeries.length&&(i.isDirtyData=!0),T(this,"afterUpdate"),F(e,!0)&&s.redraw(!!p&&void 0)}setName(t){this.name=this.options.name=this.userOptions.name=t,this.chart.isDirtyLegend=!0}hasOptionChanged(t){const e=this.options[t],i=this.chart.options.plotOptions,s=this.userOptions[t];return s?e!==s:e!==F(i&&i[this.type]&&i[this.type][t],i&&i.series&&i.series[t],e)}onMouseOver(){const t=this.chart,e=t.hoverSeries;t.pointer.setHoverChartIndex(),e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&T(this,"mouseOver"),this.setState("hover"),t.hoverSeries=this}onMouseOut(){const t=this.options,e=this.chart,i=e.tooltip,s=e.hoverPoint;e.hoverSeries=null,s&&s.onMouseOut(),this&&t.events.mouseOut&&T(this,"mouseOut"),!i||this.stickyTracking||i.shared&&!this.noSharedTooltip||i.hide(),e.series.forEach((function(t){t.setState("",!0)}))}setState(t,e){const i=this;var s=i.options;const r=i.graph,n=s.inactiveOtherPoints,o=s.states,a=F(o[t||"normal"]&&o[t||"normal"].animation,i.chart.options.chart.animation);let h=s.lineWidth,l=0,c=s.opacity;if(t=t||"",i.state!==t&&([i.group,i.markerGroup,i.dataLabelsGroup].forEach((function(e){e&&(i.state&&e.removeClass("highcharts-series-"+i.state),t&&e.addClass("highcharts-series-"+t))})),i.state=t,!i.chart.styledMode)){if(o[t]&&!1===o[t].enabled)return;if(t&&(h=o[t].lineWidth||h+(o[t].lineWidthPlus||0),c=F(o[t].opacity,c)),r&&!r.dashstyle&&R(h))for(s={"stroke-width":h},r.animate(s,a);i["zone-graph-"+l];)i["zone-graph-"+l].animate(s,a),l+=1;n||[i.group,i.markerGroup,i.dataLabelsGroup,i.labelBySeries].forEach((function(t){t&&t.animate({opacity:c},a)}))}e&&n&&i.points&&i.setAllPointsToState(t||void 0)}setAllPointsToState(t){this.points.forEach((function(e){e.setState&&e.setState(t)}))}setVisible(t,e){const i=this,s=i.chart,r=s.options.chart.ignoreHiddenSeries,n=i.visible,o=(i.visible=t=i.options.visible=i.userOptions.visible=void 0===t?!n:t)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach((function(t){i[t]&&i[t][o]()})),s.hoverSeries!==i&&(s.hoverPoint&&s.hoverPoint.series)!==i||i.onMouseOut(),i.legendItem&&s.legend.colorizeItem(i,t),i.isDirty=!0,i.options.stacking&&s.series.forEach((function(t){t.options.stacking&&t.visible&&(t.isDirty=!0)})),i.linkedSeries.forEach((function(e){e.setVisible(t,!1)})),r&&(s.isDirtyBox=!0),T(i,o),!1!==e&&s.redraw()}show(){this.setVisible(!0)}hide(){this.setVisible(!1)}select(t){this.selected=t=this.options.selected=void 0===t?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),T(this,t?"select":"unselect")}shouldShowTooltip(t,e,i={}){return i.series=this,i.visiblePlotOnly=!0,this.chart.isInsidePlot(t,e,i)}drawLegendSymbol(t,e){var i;null===(i=r[this.options.legendSymbol||"rectangle"])||void 0===i||i.call(this,t,e)}}return W.defaultOptions=o,W.types=a.seriesTypes,W.registerType=a.registerSeriesType,M(W.prototype,{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,isCartesian:!0,kdAxisArray:["clientX","plotY"],parallelArrays:["x","y"],pointClass:n,requireSorting:!0,sorted:!0}),a.series=W,W})),e(i,"Core/Chart/Chart.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Axis/Axis.js"],i["Core/Defaults.js"],i["Core/Templating.js"],i["Core/Foundation.js"],i["Core/Globals.js"],i["Core/Renderer/RendererRegistry.js"],i["Core/Series/Series.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Renderer/SVG/SVGRenderer.js"],i["Core/Time.js"],i["Core/Utilities.js"],i["Core/Renderer/HTML/AST.js"]],(function(t,e,i,s,r,n,o,a,h,l,c,d,u){const{animate:p,animObject:m,setAnimation:g}=t,{defaultOptions:f,defaultTime:v}=i,{numberFormat:b}=s,{registerEventOptions:y}=r,{charts:x,doc:w,marginNames:S,svg:C,win:k}=n,{seriesTypes:A}=h,{addEvent:M,attr:E,createElement:T,css:L,defined:O,diffObjects:P,discardElement:D,erase:R,error:I,extend:B,find:j,fireEvent:F,getStyle:N,isArray:z,isNumber:H,isObject:W,isString:V,merge:G,objectEach:U,pick:X,pInt:_,relativeLength:Y,removeEvent:q,splat:$,syncTimeout:K,uniqueKey:Z}=d;class J{static chart(t,e,i){return new J(t,e,i)}constructor(t,e,i){this.series=this.renderTo=this.renderer=this.pointer=this.pointCount=this.plotWidth=this.plotTop=this.plotLeft=this.plotHeight=this.plotBox=this.options=this.numberFormatter=this.margin=this.labelCollectors=this.isResizing=this.index=this.eventOptions=this.container=this.colorCounter=this.clipBox=this.chartWidth=this.chartHeight=this.bounds=this.axisOffset=this.axes=void 0,this.sharedClips={},this.zooming=this.yAxis=this.xAxis=this.userOptions=this.titleOffset=this.time=this.symbolCounter=this.spacingBox=this.spacing=void 0,this.getArgs(t,e,i)}getArgs(t,e,i){V(t)||t.nodeName?(this.renderTo=t,this.init(e,i)):this.init(t,e)}setZoomOptions(){const t=this.options.chart,e=t.zooming;this.zooming=Object.assign(Object.assign({},e),{type:X(t.zoomType,e.type),key:X(t.zoomKey,e.key),pinchType:X(t.pinchType,e.pinchType),singleTouch:X(t.zoomBySingleTouch,e.singleTouch,!1),resetButton:G(e.resetButton,t.resetZoomButton)})}init(t,e){F(this,"init",{args:arguments},(function(){const i=G(f,t),s=i.chart;this.userOptions=B({},t),this.margin=[],this.spacing=[],this.bounds={h:{},v:{}},this.labelCollectors=[],this.callback=e,this.isResizing=0,this.options=i,this.axes=[],this.series=[],this.time=t.time&&Object.keys(t.time).length?new c(t.time):n.time,this.numberFormatter=s.numberFormatter||b,this.styledMode=s.styledMode,this.hasCartesianSeries=s.showAxes,this.index=x.length,x.push(this),n.chartCount++,y(this,s),this.xAxis=[],this.yAxis=[],this.pointCount=this.colorCounter=this.symbolCounter=0,this.setZoomOptions(),F(this,"afterInit"),this.firstRender()}))}initSeries(t){var e=this.options.chart;e=t.type||e.type;const i=A[e];return i||I(17,!0,this,{missingModuleFor:e}),"function"==typeof(e=new i).init&&e.init(this,t),e}setSeriesData(){this.getSeriesOrderByLinks().forEach((function(t){t.points||t.data||!t.enabledDataSorting||t.setData(t.options.data,!1)}))}getSeriesOrderByLinks(){return this.series.concat().sort((function(t,e){return t.linkedSeries.length||e.linkedSeries.length?e.linkedSeries.length-t.linkedSeries.length:0}))}orderItems(t,e=0){const i=this[t],s=this.options[t]=$(this.options[t]).slice();if(t=this.userOptions[t]=this.userOptions[t]?$(this.userOptions[t]).slice():[],this.hasRendered&&(s.splice(e),t.splice(e)),i)for(let r=e,n=i.length;r=Math.max(h+n,e.pos)&&u<=Math.min(h+n+d.width,e.pos+e.len)||(t.isInsidePlot=!1)}return!i.ignoreY&&t.isInsidePlot&&(h=!s&&i.axis&&!i.axis.isXAxis&&i.axis||c&&(s?c.xAxis:c.yAxis)||{pos:o,len:1/0},(i=i.paneCoordinates?h.pos+e:o+e)>=Math.max(l+o,h.pos)&&i<=Math.min(l+o+d.height,h.pos+h.len)||(t.isInsidePlot=!1)),F(this,"afterIsInsidePlot",t),t.isInsidePlot}redraw(t){F(this,"beforeRedraw");const e=this.hasCartesianSeries?this.axes:this.colorAxis||[],i=this.series,s=this.pointer,r=this.legend,n=this.userOptions.legend,o=this.renderer,a=o.isHidden(),h=[];let l,c,d,u=this.isDirtyBox,p=this.isDirtyLegend;for(o.rootFontSize=o.boxWrapper.getStyle("font-size"),this.setResponsive&&this.setResponsive(!1),g(!!this.hasRendered&&t,this),a&&this.temporaryDisplay(),this.layOutTitles(!1),t=i.length;t--;)if(d=i[t],(d.options.stacking||d.options.centerInCategory)&&(c=!0,d.isDirty)){l=!0;break}if(l)for(t=i.length;t--;)d=i[t],d.options.stacking&&(d.isDirty=!0);i.forEach((function(t){t.isDirty&&("point"===t.options.legendType?("function"==typeof t.updateTotals&&t.updateTotals(),p=!0):n&&(n.labelFormatter||n.labelFormat)&&(p=!0)),t.isDirtyData&&F(t,"updatedData")})),p&&r&&r.options.enabled&&(r.render(),this.isDirtyLegend=!1),c&&this.getStacks(),e.forEach((function(t){t.updateNames(),t.setScale()})),this.getMargins(),e.forEach((function(t){t.isDirty&&(u=!0)})),e.forEach((function(t){const e=t.min+","+t.max;t.extKey!==e&&(t.extKey=e,h.push((function(){F(t,"afterSetExtremes",B(t.eventArgs,t.getExtremes())),delete t.eventArgs}))),(u||c)&&t.redraw()})),u&&this.drawChartBox(),F(this,"predraw"),i.forEach((function(t){(u||t.isDirty)&&t.visible&&t.redraw(),t.isDirtyData=!1})),s&&s.reset(!0),o.draw(),F(this,"redraw"),F(this,"render"),a&&this.temporaryDisplay(!0),h.forEach((function(t){t.call()}))}get(t){function e(e){return e.id===t||e.options&&e.options.id===t}const i=this.series;let s=j(this.axes,e)||j(this.series,e);for(let t=0;!s&&t(e.getPointsCollection().forEach((e=>{X(e.selectedStaging,e.selected)&&t.push(e)})),t)),[])}getSelectedSeries(){return this.series.filter((function(t){return t.selected}))}setTitle(t,e,i){this.applyDescription("title",t),this.applyDescription("subtitle",e),this.applyDescription("caption",void 0),this.layOutTitles(i)}applyDescription(t,e){const i=this,s=this.options[t]=G(this.options[t],e);let r=this[t];r&&e&&(this[t]=r=r.destroy()),s&&!r&&(r=this.renderer.text(s.text,0,0,s.useHTML).attr({align:s.align,class:"highcharts-"+t,zIndex:s.zIndex||4}).add(),r.update=function(e,s){i.applyDescription(t,e),i.layOutTitles(s)},this.styledMode||r.css(B("title"===t?{fontSize:this.options.isStock?"1em":"1.2em"}:{},s.style)),this[t]=r)}layOutTitles(t=!0){const e=[0,0,0],i=this.renderer,s=this.spacingBox;["title","subtitle","caption"].forEach((function(t){const r=this[t],n=this.options[t],o=n.verticalAlign||"top";if(t="title"===t?"top"===o?-3:0:"top"===o?e[0]+2:0,r){r.css({width:(n.width||s.width+(n.widthAdjust||0))+"px"});const a=i.fontMetrics(r).b,h=Math.round(r.getBBox(n.useHTML).height);r.align(B({y:"bottom"===o?a:t+a,height:h},n),!1,"spacingBox"),n.floating||("top"===o?e[0]=Math.ceil(e[0]+h):"bottom"===o&&(e[2]=Math.ceil(e[2]+h)))}}),this),e[0]&&"top"===(this.options.title.verticalAlign||"top")&&(e[0]+=this.options.title.margin),e[2]&&"bottom"===this.options.caption.verticalAlign&&(e[2]+=this.options.caption.margin);const r=!this.titleOffset||this.titleOffset.join(",")!==e.join(",");this.titleOffset=e,F(this,"afterLayOutTitles"),!this.isDirtyBox&&r&&(this.isDirtyBox=this.isDirtyLegend=r,this.hasRendered&&t&&this.isDirtyBox&&this.redraw())}getContainerBox(){return{width:N(this.renderTo,"width",!0)||0,height:N(this.renderTo,"height",!0)||0}}getChartSize(){var t=this.options.chart;const e=t.width;t=t.height;const i=this.getContainerBox();this.chartWidth=Math.max(0,e||i.width||600),this.chartHeight=Math.max(0,Y(t,this.chartWidth)||(1{var i;null!==(i=t.options)&&void 0!==i&&i.chart.reflow&&t.hasLoaded&&t.reflow(e)};"function"==typeof ResizeObserver?new ResizeObserver(e).observe(t.renderTo):(e=M(k,"resize",e),M(this,"destroy",e))}setSize(t,e,i){const s=this,r=s.renderer;s.isResizing+=1,g(i,s),i=r.globalAnimation,s.oldChartHeight=s.chartHeight,s.oldChartWidth=s.chartWidth,void 0!==t&&(s.options.chart.width=t),void 0!==e&&(s.options.chart.height=e),s.getChartSize(),s.styledMode||(i?p:L)(s.container,{width:s.chartWidth+"px",height:s.chartHeight+"px"},i),s.setChartSize(!0),r.setSize(s.chartWidth,s.chartHeight,i),s.axes.forEach((function(t){t.isDirty=!0,t.setScale()})),s.isDirtyLegend=!0,s.isDirtyBox=!0,s.layOutTitles(),s.getMargins(),s.redraw(i),s.oldChartHeight=null,F(s,"resize"),K((function(){s&&F(s,"endResize",null,(function(){--s.isResizing}))}),m(i).duration)}setChartSize(t){var e=this.inverted;const i=this.renderer;var s=this.chartWidth,r=this.chartHeight;const n=this.options.chart,o=this.spacing,a=this.clipOffset;let h,l,c,d;this.plotLeft=h=Math.round(this.plotLeft),this.plotTop=l=Math.round(this.plotTop),this.plotWidth=c=Math.max(0,Math.round(s-h-this.marginRight)),this.plotHeight=d=Math.max(0,Math.round(r-l-this.marginBottom)),this.plotSizeX=e?d:c,this.plotSizeY=e?c:d,this.plotBorderWidth=n.plotBorderWidth||0,this.spacingBox=i.spacingBox={x:o[3],y:o[0],width:s-o[3]-o[1],height:r-o[0]-o[2]},this.plotBox=i.plotBox={x:h,y:l,width:c,height:d},e=2*Math.floor(this.plotBorderWidth/2),s=Math.ceil(Math.max(e,a[3])/2),r=Math.ceil(Math.max(e,a[0])/2),this.clipBox={x:s,y:r,width:Math.floor(this.plotSizeX-Math.max(e,a[1])/2-s),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(e,a[2])/2-r))},t||(this.axes.forEach((function(t){t.setAxisSize(),t.setAxisTranslation()})),i.alignElements()),F(this,"afterSetChartSize",{skipAxes:t})}resetMargins(){F(this,"resetMargins");const t=this,e=t.options.chart;["margin","spacing"].forEach((function(i){const s=e[i],r=W(s)?s:[s,s,s,s];["Top","Right","Bottom","Left"].forEach((function(s,n){t[i][n]=X(e[i+s],r[n])}))})),S.forEach((function(e,i){t[e]=X(t.margin[i],t.spacing[i])})),t.axisOffset=[0,0,0,0],t.clipOffset=[0,0,0,0]}drawChartBox(){const t=this.options.chart,e=this.renderer,i=this.chartWidth,s=this.chartHeight,r=this.styledMode,n=this.plotBGImage;var o=t.backgroundColor;const a=t.plotBackgroundColor,h=t.plotBackgroundImage,l=this.plotLeft,c=this.plotTop,d=this.plotWidth,u=this.plotHeight,p=this.plotBox,m=this.clipRect,g=this.clipBox;let f,v,b=this.chartBackground,y=this.plotBackground,x=this.plotBorder,w="animate";b||(this.chartBackground=b=e.rect().addClass("highcharts-background").add(),w="attr"),r?f=v=b.strokeWidth():(f=t.borderWidth||0,v=f+(t.shadow?8:0),o={fill:o||"none"},(f||b["stroke-width"])&&(o.stroke=t.borderColor,o["stroke-width"]=f),b.attr(o).shadow(t.shadow)),b[w]({x:v/2,y:v/2,width:i-v-f%2,height:s-v-f%2,r:t.borderRadius}),w="animate",y||(w="attr",this.plotBackground=y=e.rect().addClass("highcharts-plot-background").add()),y[w](p),r||(y.attr({fill:a||"none"}).shadow(t.plotShadow),h&&(n?(h!==n.attr("href")&&n.attr("href",h),n.animate(p)):this.plotBGImage=e.image(h,l,c,d,u).add())),m?m.animate({width:g.width,height:g.height}):this.clipRect=e.clipRect(g),w="animate",x||(w="attr",this.plotBorder=x=e.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add()),r||x.attr({stroke:t.plotBorderColor,"stroke-width":t.plotBorderWidth||0,fill:"none"}),x[w](x.crisp({x:l,y:c,width:d,height:u},-x.strokeWidth())),this.isDirtyBox=!1,F(this,"afterDrawChartBox")}propFromSeries(){const t=this,e=t.options.chart,i=t.options.series;let s,r,n;["inverted","angular","polar"].forEach((function(o){for(r=A[e.type],n=e[o]||r&&r.prototype[o],s=i&&i.length;!n&&s--;)(r=A[i[s].type])&&r.prototype[o]&&(n=!0);t[o]=n}))}linkSeries(t){const e=this,i=e.series;i.forEach((function(t){t.linkedSeries.length=0})),i.forEach((function(t){let i=t.options.linkedTo;V(i)&&(i=":previous"===i?e.series[t.index-1]:e.get(i))&&i.linkedParent!==t&&(i.linkedSeries.push(t),t.linkedParent=i,i.enabledDataSorting&&t.setDataSortingOptions(),t.visible=X(t.options.visible,i.options.visible,t.visible))})),F(this,"afterLinkSeries",{isUpdating:t})}renderSeries(){this.series.forEach((function(t){t.translate(),t.render()}))}render(){const t=this.axes,e=this.colorAxis,i=this.renderer,s=function(t){t.forEach((function(t){t.visible&&t.render()}))};let r=0;this.setTitle(),F(this,"beforeMargins"),this.getStacks&&this.getStacks(),this.getMargins(!0),this.setChartSize();const n=this.plotWidth;t.some((function(t){if(t.horiz&&t.visible&&t.options.labels.enabled&&t.series.length)return r=21,!0}));const o=this.plotHeight=Math.max(this.plotHeight-r,0);t.forEach((function(t){t.setScale()})),this.getAxisMargins();const a=1.1e.pointCount))}pan(t,e){const i=this,s=i.hoverPoints;e="object"==typeof e?e:{enabled:e,type:"x"};const r=i.options.chart;r&&r.panning&&(r.panning=e);const n=e.type;let o;F(this,"pan",{originalEvent:t},(function(){s&&s.forEach((function(t){t.setState()}));let e=i.xAxis;"xy"===n?e=e.concat(i.yAxis):"y"===n&&(e=i.yAxis);const r={};e.forEach((function(e){if(e.options.panningEnabled&&!e.options.isInternal){var s=e.horiz,a=t[s?"chartX":"chartY"],h=i[s=s?"mouseDownX":"mouseDownY"],l=e.minPointOffset||0,c=e.reversed&&!i.inverted||!e.reversed&&i.inverted?-1:1,d=e.getExtremes(),u=e.toValue(h-a,!0)+l*c,p=e.toValue(h+e.len-a,!0)-(l*c||e.isXAxis&&e.pointRangePadding||0),m=p=c&&u<=p&&(e.setExtremes(h,u,!1,!1,{trigger:"pan"}),!i.resetZoomButton&&h!==c&&u!==p&&n.match("y")&&(i.showResetZoom(),e.displayBtn=!1),o=!0),r[s]=a)}})),U(r,((t,e)=>{i[e]=t})),o&&i.redraw(!1),L(i.container,{cursor:"move"})}))}}return B(J.prototype,{callbacks:[],collectionsWithInit:{xAxis:[J.prototype.addAxis,[!0]],yAxis:[J.prototype.addAxis,[!1]],series:[J.prototype.addSeries]},collectionsWithUpdate:["xAxis","yAxis","series"],propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" ")}),J})),e(i,"Extensions/ScrollablePlotArea.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Axis/Axis.js"],i["Core/Chart/Chart.js"],i["Core/Series/Series.js"],i["Core/Renderer/RendererRegistry.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r,n){const{stop:o}=t,{addEvent:a,createElement:h,defined:l,merge:c,pick:d}=n;a(i,"afterSetChartSize",(function(t){var i=this.options.chart.scrollablePlotArea,s=i&&i.minWidth;let r;i=i&&i.minHeight,this.renderer.forExport||(s?(this.scrollablePixelsX=s=Math.max(0,s-this.chartWidth))&&(this.scrollablePlotBox=this.renderer.scrollablePlotBox=c(this.plotBox),this.plotBox.width=this.plotWidth+=s,this.inverted?this.clipBox.height+=s:this.clipBox.width+=s,r={1:{name:"right",value:s}}):i&&(this.scrollablePixelsY=s=Math.max(0,i-this.chartHeight),l(s)&&(this.scrollablePlotBox=this.renderer.scrollablePlotBox=c(this.plotBox),this.plotBox.height=this.plotHeight+=s,this.inverted?this.clipBox.width+=s:this.clipBox.height+=s,r={2:{name:"bottom",value:s}})),r&&!t.skipAxes&&this.axes.forEach((function(t){r[t.side]?t.getPlotLinePath=function(){let i,s=r[t.side].name,n=this[s];return this[s]=n-r[t.side].value,i=e.prototype.getPlotLinePath.apply(this,arguments),this[s]=n,i}:(t.setAxisSize(),t.setAxisTranslation())})))})),a(i,"render",(function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()})),i.prototype.setUpScrolling=function(){const t={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};let e;this.scrollablePixelsX&&(t.overflowX="auto"),this.scrollablePixelsY&&(t.overflowY="auto"),this.scrollingParent=h("div",{className:"highcharts-scrolling-parent"},{position:"relative"},this.renderTo),this.scrollingContainer=h("div",{className:"highcharts-scrolling"},t,this.scrollingParent),a(this.scrollingContainer,"scroll",(()=>{this.pointer&&(delete this.pointer.chartPosition,this.hoverPoint&&(e=this.hoverPoint),this.pointer.runPointActions(void 0,e,!0))})),this.innerContainer=h("div",{className:"highcharts-inner-container"},null,this.scrollingContainer),this.innerContainer.appendChild(this.container),this.setUpScrolling=null},i.prototype.moveFixedElements=function(){let t,e=this.container,i=this.fixedRenderer,s=".highcharts-breadcrumbs-group .highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-drillup-button .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" ");this.scrollablePixelsX&&!this.inverted?t=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted||this.scrollablePixelsY&&!this.inverted?t=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(t=".highcharts-yaxis"),t&&s.push(`${t}:not(.highcharts-radial-axis)`,`${t}-labels:not(.highcharts-radial-axis-labels)`),s.forEach((function(t){[].forEach.call(e.querySelectorAll(t),(function(t){(t.namespaceURI===i.SVG_NS?i.box:i.box.parentNode).appendChild(t),t.style.pointerEvents="auto"}))}))},i.prototype.applyFixed=function(){var t=!this.fixedDiv,e=this.options.chart,i=e.scrollablePlotArea,s=r.getRendererType();t?(this.fixedDiv=h("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:(e.style&&e.style.zIndex||0)+2,top:0},null,!0),this.scrollingContainer&&this.scrollingContainer.parentNode.insertBefore(this.fixedDiv,this.scrollingContainer),this.renderTo.style.overflow="visible",this.fixedRenderer=e=new s(this.fixedDiv,this.chartWidth,this.chartHeight,this.options.chart.style),this.scrollableMask=e.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":d(i.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),a(this,"afterShowResetZoom",this.moveFixedElements),a(this,"afterApplyDrilldown",this.moveFixedElements),a(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight),(this.scrollableDirty||t)&&(this.scrollableDirty=!1,this.moveFixedElements()),e=this.chartWidth+(this.scrollablePixelsX||0),s=this.chartHeight+(this.scrollablePixelsY||0),o(this.container),this.container.style.width=e+"px",this.container.style.height=s+"px",this.renderer.boxWrapper.attr({width:e,height:s,viewBox:[0,0,e,s].join(" ")}),this.chartBackground.attr({width:e,height:s}),this.scrollingContainer.style.height=this.chartHeight+"px",t&&(i.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*i.scrollPositionX),i.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*i.scrollPositionY)),s=this.axisOffset,t=this.plotTop-s[0]-1,i=this.plotLeft-s[3]-1,e=this.plotTop+this.plotHeight+s[2]+1,s=this.plotLeft+this.plotWidth+s[1]+1;let n=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),l=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);t=this.scrollablePixelsX?[["M",0,t],["L",this.plotLeft-1,t],["L",this.plotLeft-1,e],["L",0,e],["Z"],["M",n,t],["L",this.chartWidth,t],["L",this.chartWidth,e],["L",n,e],["Z"]]:this.scrollablePixelsY?[["M",i,0],["L",i,this.plotTop-1],["L",s,this.plotTop-1],["L",s,0],["Z"],["M",i,l],["L",i,this.chartHeight],["L",s,this.chartHeight],["L",s,l],["Z"]]:[["M",0,0]],"adjustHeight"!==this.redrawTrigger&&this.scrollableMask.attr({d:t})},a(e,"afterInit",(function(){this.chart.scrollableDirty=!0})),a(s,"show",(function(){this.chart.scrollableDirty=!0}))})),e(i,"Core/Axis/Stacking/StackItem.js",[i["Core/Templating.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Utilities.js"]],(function(t,e,i){const{format:s}=t,{series:r}=e,{destroyObjectProperties:n,fireEvent:o,isNumber:a,pick:h}=i;return class{constructor(t,e,i,s,r){const n=t.chart.inverted,o=t.reversed;this.axis=t,t=this.isNegative=!!i!=!!o,this.options=e=e||{},this.x=s,this.cumulative=this.total=null,this.points={},this.hasValidPoints=!1,this.stack=r,this.rightCliff=this.leftCliff=0,this.alignOptions={align:e.align||(n?t?"left":"right":"center"),verticalAlign:e.verticalAlign||(n?"middle":t?"bottom":"top"),y:e.y,x:e.x},this.textAlign=e.textAlign||(n?t?"right":"left":"center")}destroy(){n(this,this.axis)}render(t){const e=this.axis.chart,i=this.options;var r=i.format;r=r?s(r,this,e):i.formatter.call(this),this.label?this.label.attr({text:r,visibility:"hidden"}):(this.label=e.renderer.label(r,null,void 0,i.shape,void 0,void 0,i.useHTML,!1,"stack-labels"),r={r:i.borderRadius||0,text:r,padding:h(i.padding,5),visibility:"hidden"},e.styledMode||(r.fill=i.backgroundColor,r.stroke=i.borderColor,r["stroke-width"]=i.borderWidth,this.label.css(i.style||{})),this.label.attr(r),this.label.added||this.label.add(t)),this.label.labelrank=e.plotSizeY,o(this,"afterRender")}setOffset(t,e,i,s,n,l){const{alignOptions:c,axis:d,label:u,options:p,textAlign:m}=this,g=d.chart;i=this.getStackBox({xOffset:t,width:e,boxBottom:i,boxTop:s,defaultX:n,xAxis:l});var{verticalAlign:f}=c;if(u&&i){s=u.getBBox(),n=u.padding,l="justify"===h(p.overflow,"justify"),c.x=p.x||0,c.y=p.y||0;const{x:t,y:e}=this.adjustStackPosition({labelBox:s,verticalAlign:f,textAlign:m});i.x-=t,i.y-=e,u.align(c,!1,i),(f=g.isInsidePlot(u.alignAttr.x+c.x+t,u.alignAttr.y+c.y+e))||(l=!1),l&&r.prototype.justifyDataLabel.call(d,u,c,u.alignAttr,s,i),u.attr({x:u.alignAttr.x,y:u.alignAttr.y,rotation:p.rotation,rotationOriginX:s.width/2,rotationOriginY:s.height/2}),h(!l&&p.crop,!0)&&(f=a(u.x)&&a(u.y)&&g.isInsidePlot(u.x-n+u.width,u.y)&&g.isInsidePlot(u.x+n,u.y)),u[f?"show":"hide"]()}o(this,"afterSetOffset",{xOffset:t,width:e})}adjustStackPosition({labelBox:t,verticalAlign:e,textAlign:i}){const s={bottom:0,middle:1,top:2,right:1,center:0,left:-1};return{x:t.width/2+t.width/2*s[i],y:t.height/2*s[e]}}getStackBox(t){var e=this.axis;const i=e.chart,{boxTop:s,defaultX:r,xOffset:n,width:o,boxBottom:l}=t;var c=e.stacking.usePercentage?100:h(s,this.total,0);c=e.toPixels(c),t=t.xAxis||i.xAxis[0];const d=h(r,t.translate(this.x))+n;e=e.toPixels(l||a(e.min)&&e.logarithmic&&e.logarithmic.lin2log(e.min)||0),e=Math.abs(c-e);const u=this.isNegative;return i.inverted?{x:(u?c:c-e)-i.plotLeft,y:t.height-d-o,width:e,height:o}:{x:d+t.transB-i.plotLeft,y:(u?c-e:c)-i.plotTop,width:o,height:e}}}})),e(i,"Core/Axis/Stacking/StackingAxis.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Axis/Axis.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Axis/Stacking/StackItem.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r){function n(){const t=this,e=t.inverted;t.yAxis.forEach((t=>{t.stacking&&t.stacking.stacks&&t.hasVisibleSeries&&(t.stacking.oldStacks=t.stacking.stacks)})),t.series.forEach((i=>{const s=i.xAxis&&i.xAxis.options||{};!i.options.stacking||!0!==i.visible&&!1!==t.options.chart.ignoreHiddenSeries||(i.stackKey=[i.type,C(i.options.stack,""),e?s.top:s.left,e?s.height:s.width].join())}))}function o(){const t=this.stacking;if(t){var e=t.stacks;S(e,(function(t,i){b(t),e[i]=null})),t&&t.stackTotalGroup&&t.stackTotalGroup.destroy()}}function a(){"yAxis"!==this.coll||this.stacking||(this.stacking=new k(this))}function h(t,e,i,s){return!v(t)||t.x!==e||s&&t.stackKey!==s?t={x:e,index:0,key:s,stackKey:s}:t.index++,t.key=[i,e,t.index].join(),t}function l(){const t=this,e=t.stackKey,i=t.yAxis.stacking.stacks,s=t.processedXData,r=t[t.options.stacking+"Stacker"];let n;r&&[e,"-"+e].forEach((e=>{let o,a=s.length;for(;a--;){var h=s[a];n=t.getStackIndicator(n,h,t.index,e),(o=(h=i[e]&&i[e][h])&&h.points[n.key])&&r.call(t,o,h,a)}}))}function c(t,e,i){e=e.total?100/e.total:0,t[0]=f(t[0]*e),t[1]=f(t[1]*e),this.stackedYData[i]=t[1]}function d(){const t=this.yAxis.stacking;this.options.centerInCategory&&(this.is("column")||this.is("columnrange"))&&!this.options.stacking&&1{"group"===i.slice(-5)&&(S(e,(t=>t.destroy())),delete t.stacks[i])}))}function u(t){var e=this.chart;const i=t||this.options.stacking;if(i&&(!0===this.visible||!1===e.options.chart.ignoreHiddenSeries)){var r=this.processedXData,n=this.processedYData,o=[],a=n.length,h=this.options,l=h.threshold,c=C(h.startFromThreshold&&l,0);h=h.stack;var d,u,p="-"+(t=t?`${this.type},${i}`:this.stackKey),m=this.negStacks,g=(e="group"===i?e.yAxis[0]:this.yAxis).stacking.stacks,b=e.stacking.oldStacks;for(e.stacking.stacksTouched+=1,u=0;u{S(t,((e,i)=>{w(e.touched)&&e.touchedn&&e.shadow)),a&&(a.startX=i.xMap,a.isArea=i.isArea)}))}getGraphPath(t,e,i){const r=this,n=r.options,o=[],a=[];let h,l=n.step;const c=(t=t||r.points).reversed;return c&&t.reverse(),(l={right:1,center:2}[l]||l&&3)&&c&&(l=4-l),(t=this.getValidPoints(t,!1,!(n.connectNulls&&!e&&!i))).forEach((function(c,d){const u=c.plotX,p=c.plotY,m=t[d-1],g=c.isNull||"number"!=typeof p;(c.leftCliff||m&&m.rightCliff)&&!i&&(h=!0),g&&!s(e)&&0t.visible));s.forEach((function(t,o){let g,f,v=0;if(l[t]&&!l[t].isNull)i.push(l[t]),[-1,1].forEach((function(i){const r=1===i?"rightNull":"leftNull",n=h[s[o+i]];let a=0;if(n){let i=p;for(;0<=i&&it&&h>n?(h=Math.max(t,n),l=2*n-h):hi&&l>n?(l=Math.max(i,n),h=2*n-l):l=Math.abs(e)&&.5{if("number"==typeof i.x){const e=t[i.x.toString()];e&&(t=e.points[this.index],r?(t&&(o=a),e.hasValidPoints&&(n?a++:a--)):g(t)&&(t=Object.keys(e.points).filter((t=>!t.match(",")&&e.points[t]&&1e-t)),o=t.indexOf(this.index),a=t.length))}})),t=(i.plotX||0)+((a-1)*s.paddedWidth+e)/2-e-o*s.paddedWidth}return t}translate(){const t=this,e=t.chart,i=t.options;var s=t.dense=2>t.closestPointRange*t.xAxis.transA;s=t.borderWidth=b(i.borderWidth,s?0:1);const n=t.xAxis,o=t.yAxis,a=i.threshold,h=b(i.minPointLength,5),l=t.getColumnMetrics(),c=l.width,p=t.pointXOffset=l.offset,g=t.dataMin,v=t.dataMax;let y=t.barW=Math.max(c,1+2*s),x=t.translatedThreshold=o.getThreshold(a);e.inverted&&(x-=.5),i.pointPadding&&(y=Math.ceil(y)),r.prototype.translate.apply(t),t.points.forEach((function(s){const r=b(s.yBottom,x);var m=999+Math.abs(r),w=s.plotX||0;m=d(s.plotY,-m,o.len+m);let S=Math.min(m,r),C=Math.max(m,r)-S,k=c,A=w+p,M=y;h&&Math.abs(C)h?r-h:x-(w?h:0)),u(s.options.pointWidth)&&(k=M=Math.ceil(s.options.pointWidth),A-=Math.round((k-c)/2)),i.centerInCategory&&(A=t.adjustForMissingColumns(A,k,s,l)),s.barX=A,s.pointWidth=k,s.tooltipPos=e.inverted?[d(o.len+o.pos-e.plotLeft-m,o.pos-e.plotLeft,o.len+o.pos-e.plotLeft),n.len+n.pos-e.plotTop-A-M/2,C]:[n.left-e.plotLeft+A+M/2,d(m+o.pos-e.plotTop,o.pos-e.plotTop,o.len+o.pos-e.plotTop),C],s.shapeType=t.pointClass.prototype.shapeType||"roundedRect",s.shapeArgs=t.crispCol(A,s.isNull?x:S,M,s.isNull?0:C)})),m(this,"afterColumnTranslate")}drawGraph(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")}pointAttribs(t,e){const i=this.options;var s=this.pointAttrToOptions||{},r=s.stroke||"borderColor";const n=s["stroke-width"]||"borderWidth";let o,a=t&&t.color||this.color,l=t&&t[r]||i[r]||a;s=t&&t.options.dashStyle||i.dashStyle;let c=t&&t[n]||i[n]||this[n]||0,d=b(t&&t.opacity,i.opacity,1);return t&&this.zones.length&&(o=t.getZone(),a=t.options.color||o&&(o.color||t.nonZonedColor)||this.color,o&&(l=o.borderColor||l,s=o.dashStyle||s,c=o.borderWidth||c)),e&&t&&(e=(t=v(i.states[e],t.options.states&&t.options.states[e]||{})).brightness,a=t.color||void 0!==e&&h(a).brighten(t.brightness).get()||a,l=t[r]||l,c=t[n]||c,s=t.dashStyle||s,d=b(t.opacity,d)),r={fill:a,stroke:l,"stroke-width":c,opacity:d},s&&(r.dashstyle=s),r}drawPoints(t=this.points){const e=this,i=this.chart,s=e.options,r=i.renderer,n=s.animationLimit||250;let o;t.forEach((function(t){let a=t.graphic,h=!!a,l=a&&i.pointCount{var e;const i=t.dataLabels||[];for(w=p(b(C,t.dlOptions||(null===(e=t.options)||void 0===e?void 0:e.dataLabels))),w.forEach(((e,s)=>{var a,h=e.enabled&&(!t.isNull||t.dataLabelOnNull)&&function(t,e){var i=e.filter;return!i||(e=i.operator,t=t[i.property],i=i.value,">"===e&&t>i||"<"===e&&t="===e&&t>=i||"<="===e&&t<=i||"=="===e&&t==i||"==="===e&&t===i)}(t,e);const p=t.connectors?t.connectors[s]:t.connector,f=e.style||{};let v={},b=i[s],y=!b;const w=u(e.distance,t.labelDistance);if(h){var C=u(e[t.formatPrefix+"Format"],e.format),k=t.getLabelConfig();if(k=n(C)?r(C,k,c):(e[t.formatPrefix+"Formatter"]||e.formatter).call(k,e),C=e.rotation,c.styledMode||(f.color=u(e.color,f.color,l(o.color)?o.color:void 0,"#000000"),"contrast"===f.color?(t.contrastColor=g.getContrast(t.color||o.color),f.color=!n(w)&&e.inside||0>(w||0)||m.stacking?t.contrastColor:x):delete t.contrastColor,m.cursor&&(f.cursor=m.cursor)),v={r:e.borderRadius||0,rotation:C,padding:e.padding,zIndex:1},!c.styledMode){const{backgroundColor:i,borderColor:s}=e;v.fill="auto"===i?t.color:i,v.stroke="auto"===s?t.color:s,v["stroke-width"]=e.borderWidth}d(v,((t,e)=>{void 0===t&&delete v[e]}))}!b||h&&n(k)&&!!b.div==!!e.useHTML&&(b.rotation&&e.rotation||b.rotation===e.rotation)||(b=void 0,y=!0,p&&t.connector&&(t.connector=t.connector.destroy(),t.connectors&&(1===t.connectors.length?delete t.connectors:delete t.connectors[s]))),h&&n(k)&&(b?v.text=k:(b=C?g.text(k,0,0,e.useHTML).addClass("highcharts-data-label"):g.label(k,0,0,e.shape,void 0,void 0,e.useHTML,void 0,"data-label"))&&b.addClass(" highcharts-data-label-color-"+t.colorIndex+" "+(e.className||"")+(e.useHTML?" highcharts-tracker":"")),b&&(b.options=e,b.attr(v),c.styledMode||b.css(f).shadow(e.shadow),(h=e[t.formatPrefix+"TextPath"]||e.textPath)&&!e.useHTML&&(b.setTextPath((null===(a=t.getDataLabelPath)||void 0===a?void 0:a.call(t,b))||t.graphic,h),t.dataLabelPath&&!h.enabled&&(t.dataLabelPath=t.dataLabelPath.destroy())),b.added||b.add(S),o.alignDataLabel(t,b,e,void 0,y),b.isActive=!0,i[s]&&i[s]!==b&&i[s].destroy(),i[s]=b))})),e=i.length;e--;)i[e].isActive?i[e].isActive=!1:(i[e].destroy(),i.splice(e,1));t.dataLabel=i[0],t.dataLabels=i}))),a(this,"afterDrawDataLabels")}function v(t,e,i,s,r,n){const o=this.chart,a=e.align,h=e.verticalAlign,l=t.box?0:t.padding||0;let c,d,{x:u=0,y:p=0}=e;return c=(i.x||0)+l,0>c&&("right"===a&&0<=u?(e.align="left",e.inside=!0):u-=c,d=!0),c=(i.x||0)+s.width-l,c>o.plotWidth&&("left"===a&&0>=u?(e.align="right",e.inside=!0):u+=o.plotWidth-c,d=!0),c=i.y+l,0>c&&("bottom"===h&&0<=p?(e.verticalAlign="top",e.inside=!0):p-=c,d=!0),c=(i.y||0)+s.height-l,c>o.plotHeight&&("top"===h&&0>=p?(e.verticalAlign="bottom",e.inside=!0):p+=o.plotHeight-c,d=!0),d&&(e.x=u,e.y=p,t.placed=!n,t.align(e,void 0,r)),d}function b(t,e){let i,s=[];if(h(t)&&!h(e))s=t.map((function(t){return c(t,e)}));else if(h(e)&&!h(t))s=e.map((function(e){return c(t,e)}));else if(h(t)||h(e)){if(h(t)&&h(e))for(i=Math.max(t.length,e.length);i--;)s[i]=c(t[i],e[i])}else s=c(t,e);return s}function y(t,e,i,s,r){const n=this.chart,o=n.inverted,a=this.xAxis,h=a.reversed,l=o?e.height/2:e.width/2;t=(t=t.pointWidth)?t/2:0,e.startXPos=o?r.x:h?-l-t:a.width-l+t,e.startYPos=o?h?this.yAxis.height-l+t:-l-t:r.y,s?"hidden"===e.visibility&&(e.show(),e.attr({opacity:0}).animate({opacity:1})):e.attr({opacity:1}).animate({opacity:0},void 0,e.hide),n.hasRendered&&(i&&e.attr({x:e.startXPos,y:e.startYPos}),e.placed=!0)}const x=[];t.compose=function(t){i.pushUnique(x,t)&&((t=t.prototype).initDataLabelsGroup=m,t.initDataLabels=g,t.alignDataLabel=e,t.drawDataLabels=f,t.justifyDataLabel=v,t.setDataLabelStartPos=y)}}(m||(m={})),m})),e(i,"Series/Column/ColumnDataLabel.js",[i["Core/Series/DataLabel.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Utilities.js"]],(function(t,e,i){const{series:s}=e,{merge:r,pick:n}=i;var o;return function(e){function o(t,e,i,o,a){let h=this.chart.inverted;var l=t.series;let c=(l.xAxis?l.xAxis.len:this.chart.plotSizeX)||0;l=(l.yAxis?l.yAxis.len:this.chart.plotSizeY)||0;var d=t.dlBox||t.shapeArgs;let u=n(t.below,t.plotY>n(this.translatedThreshold,l)),p=n(i.inside,!!this.options.stacking);d&&(0>(o=r(d)).y&&(o.height+=o.y,o.y=0),0<(d=o.y+o.height-l)&&d {series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}}})),e(i,"Series/Scatter/ScatterSeries.js",[i["Series/Scatter/ScatterSeriesDefaults.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Utilities.js"]],(function(t,e,i){const{column:s,line:r}=e.seriesTypes,{addEvent:n,extend:o,merge:a}=i;class h extends r{constructor(){super(...arguments),this.points=this.options=this.data=void 0}applyJitter(){const t=this,e=this.options.jitter,i=this.points.length;e&&this.points.forEach((function(s,r){["x","y"].forEach((function(n,o){let a,h,l="plot"+n.toUpperCase();if(e[n]&&!s.isNull){var c=t[n+"Axis"];h=e[n]*c.transA,c&&!c.isLog&&(a=Math.max(0,s[l]-h),c=Math.min(c.len,s[l]+h),o=1e4*Math.sin(r+o*i),o-=Math.floor(o),s[l]=a+(c-a)*o,"x"===n&&(s.clientX=s.plotX))}}))}))}drawGraph(){this.options.lineWidth?super.drawGraph():this.graph&&(this.graph=this.graph.destroy())}}return h.defaultOptions=a(r.defaultOptions,t),o(h.prototype,{drawTracker:s.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1}),n(h,"afterTranslate",(function(){this.applyJitter()})),e.registerSeriesType("scatter",h),h})),e(i,"Series/CenteredUtilities.js",[i["Core/Globals.js"],i["Core/Series/Series.js"],i["Core/Utilities.js"]],(function(t,e,i){const{deg2rad:s}=t,{fireEvent:r,isNumber:n,pick:o,relativeLength:a}=i;var h;return function(t){t.getCenter=function(){var t=this.options,i=this.chart;const s=2*(t.slicedOffset||0),h=i.plotWidth-2*s,l=i.plotHeight-2*s;var c=t.center;const d=Math.min(h,l),u=t.thickness;var p=t.size;let m=t.innerSize||0;for("string"==typeof p&&(p=parseFloat(p)),"string"==typeof m&&(m=parseFloat(m)),t=[o(c[0],"50%"),o(c[1],"50%"),o(p&&0>p?void 0:t.size,"100%"),o(m&&0>m?void 0:t.innerSize||0,"0%")],!i.angular||this instanceof e||(t[3]=0),c=0;4>c;++c)p=t[c],i=2>c||2===c&&/%$/.test(p),t[c]=a(p,[h,l,d,t[2]][c])+(i?s:0);return t[3]>t[2]&&(t[3]=t[2]),n(u)&&2*ut&&360>e-t?e:t+360,{start:s*(t+-90),end:s*(e+-90)}}}(h||(h={})),h})),e(i,"Series/Pie/PiePoint.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Series/Point.js"],i["Core/Utilities.js"]],(function(t,e,i){const{setAnimation:s}=t,{addEvent:r,defined:n,extend:o,isNumber:a,pick:h,relativeLength:l}=i;class c extends e{constructor(){super(...arguments),this.series=this.options=this.labelDistance=void 0}getConnectorPath(){const t=this.labelPosition,e=this.series.options.dataLabels,i=this.connectorShapes;let s=e.connectorShape;return i[s]&&(s=i[s]),s.call(this,{x:t.computed.x,y:t.computed.y,alignment:t.alignment},t.connectorPosition,e)}getTranslate(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}}haloPath(t){const e=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(e.x,e.y,e.r+t,e.r+t,{innerR:e.r-1,start:e.start,end:e.end,borderRadius:e.borderRadius})}init(){super.init.apply(this,arguments),this.name=h(this.name,"Slice");const t=t=>{this.slice("select"===t.type)};return r(this,"select",t),r(this,"unselect",t),this}isValid(){return a(this.y)&&0<=this.y}setVisible(t,e){const i=this.series,s=i.chart,r=i.options.ignoreHiddenPoint;e=h(e,r),t!==this.visible&&(this.visible=this.options.visible=t=void 0===t?!this.visible:t,i.options.data[i.data.indexOf(this)]=this.options,["graphic","dataLabel","connector"].forEach((e=>{this[e]&&this[e][t?"show":"hide"](t)})),this.legendItem&&s.legend.colorizeItem(this,t),t||"hover"!==this.state||this.setState(""),r&&(i.isDirty=!0),e&&s.redraw())}slice(t,e,i){const r=this.series;s(i,r.chart),h(e,!0),this.sliced=this.options.sliced=n(t)?t:!this.sliced,r.options.data[r.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate())}}return o(c.prototype,{connectorShapes:{fixedOffset:function(t,e,i){const s=e.breakAt;return e=e.touchingSliceAt,[["M",t.x,t.y],i.softConnector?["C",t.x+("left"===t.alignment?-5:5),t.y,2*s.x-e.x,2*s.y-e.y,s.x,s.y]:["L",s.x,s.y],["L",e.x,e.y]]},straight:function(t,e){return e=e.touchingSliceAt,[["M",t.x,t.y],["L",e.x,e.y]]},crookedLine:function(t,e,i){const{breakAt:s,touchingSliceAt:r}=e;({series:e}=this);const[n,o,a]=e.center,h=a/2,c=e.chart.plotWidth,d=e.chart.plotLeft;e="left"===t.alignment;const{x:u,y:p}=t;return i.crookDistance?(t=l(i.crookDistance,1),t=e?n+h+(c+d-n-h)*(1-t):d+(n-h)*t):t=n+(o-p)*Math.tan((this.angle||0)-Math.PI/2),i=[["M",u,p]],(e?t<=u&&t>=s.x:t>=u&&t<=s.x)&&i.push(["L",t,p]),i.push(["L",s.x,s.y],["L",r.x,r.y]),i}}}),c})),e(i,"Series/Pie/PieSeriesDefaults.js",[],(function(){return{borderRadius:3,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0,connectorPadding:5,connectorShape:"crookedLine",crookDistance:void 0,distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}}})),e(i,"Series/Pie/PieSeries.js",[i["Series/CenteredUtilities.js"],i["Series/Column/ColumnSeries.js"],i["Core/Globals.js"],i["Series/Pie/PiePoint.js"],i["Series/Pie/PieSeriesDefaults.js"],i["Core/Series/Series.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Renderer/SVG/Symbols.js"],i["Core/Utilities.js"]],(function(t,e,i,s,r,n,o,a,h){const{getStartAndEndRadians:l}=t;({noop:i}=i);const{clamp:c,extend:d,fireEvent:u,merge:p,pick:m,relativeLength:g}=h;class f extends n{constructor(){super(...arguments),this.points=this.options=this.maxLabelDistance=this.data=this.center=void 0}animate(t){const e=this,i=e.points,s=e.startAngleRad;t||i.forEach((function(t){const i=t.graphic,r=t.shapeArgs;i&&r&&(i.attr({r:m(t.startR,e.center&&e.center[3]/2),start:s,end:s}),i.animate({r:r.r,start:r.start,end:r.end},e.options.animation))}))}drawEmpty(){const t=this.startAngleRad,e=this.endAngleRad,i=this.options;let s,r;0===this.total&&this.center?(s=this.center[0],r=this.center[1],this.graph||(this.graph=this.chart.renderer.arc(s,r,this.center[1]/2,0,t,e).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:a.arc(s,r,this.center[2]/2,0,{start:t,end:e,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":i.borderWidth,fill:i.fillColor||"none",stroke:i.color||"#cccccc"})):this.graph&&(this.graph=this.graph.destroy())}drawPoints(){const t=this.chart.renderer;this.points.forEach((function(e){e.graphic&&e.hasNewShapeType()&&(e.graphic=e.graphic.destroy()),e.graphic||(e.graphic=t[e.shapeType](e.shapeArgs).add(e.series.group),e.delayedRendering=!0)}))}generatePoints(){super.generatePoints(),this.updateTotals()}getX(t,e,i){const s=this.center,r=this.radii?this.radii[i.index]||0:s[2]/2;return t=Math.asin(c((t-s[1])/(r+i.labelDistance),-1,1)),s[0]+(e?-1:1)*Math.cos(t)*(r+i.labelDistance)+(01.5*Math.PI?b-=2*Math.PI:b<-Math.PI/2&&(b+=2*Math.PI),p.slicedTranslation={translateX:Math.round(Math.cos(b)*i),translateY:Math.round(Math.sin(b)*i)},y=Math.cos(b)*t[2]/2,c=Math.sin(b)*t[2]/2,p.tooltipPos=[t[0]+.7*y,t[1]+.7*c],p.half=b<-Math.PI/2||b>Math.PI/2?1:0,p.angle=b,v=Math.min(s,p.labelDistance/5),p.labelPosition={natural:{x:t[0]+y+Math.cos(b)*p.labelDistance,y:t[1]+c+Math.sin(b)*p.labelDistance},computed:{},alignment:0>p.labelDistance?"center":p.half?"right":"left",connectorPosition:{breakAt:{x:t[0]+y+Math.cos(b)*v,y:t[1]+c+Math.sin(b)*v},touchingSliceAt:{x:t[0]+y,y:t[1]+c}}}}u(this,"afterTranslate")}updateTotals(){const t=this.points,e=t.length,i=this.options.ignoreHiddenPoint;let s,r,n=0;for(s=0;sm&&(t.dataLabel.css({width:Math.round(.7*m)+"px"}),t.dataLabel.shortened=!0)):(t.dataLabel=t.dataLabel.destroy(),t.dataLabels&&1===t.dataLabels.length&&delete t.dataLabels))})),b.forEach(((e,a)=>{const h=e.length,d=[];let m,b=0;if(h){if(t.sortByAngle(e,a-.5),0n-r&&0===a&&(S=Math.round(T+A-n+r),y[1]=Math.max(S,y[1])),0>L-E/2?y[0]=Math.max(Math.round(E/2-L),y[0]):L+E/2>l&&(y[2]=Math.max(Math.round(L+E/2-l),y[2])),k.sideOverflow=S)}}})),0===h(y)||this.verifyDataLabelOverflow(y))&&(this.placeDataLabels(),this.points.forEach((function(e){if(D=d(s,e.options.dataLabels),S=u(D.connectorWidth,1)){let s;C=e.connector,(k=e.dataLabel)&&k._pos&&e.visible&&0e.bottom-2?s:i,e.half,e)},justify:function(t,e,i){return i[0]+(t.half?-1:1)*(e+t.labelDistance)},alignToPlotEdges:function(t,e,i,s){return t=t.getBBox().width,e?t+s:i-t-s},alignToConnectors:function(t,e,i,s){let r,n=0;return t.forEach((function(t){r=t.dataLabel.getBBox().width,r>n&&(n=r)})),e?n+s:i-n-s}};e.compose=function(e){t.compose(a),r.pushUnique(g,e)&&((e=e.prototype).dataLabelPositioners=f,e.alignDataLabel=n,e.drawDataLabels=i,e.placeDataLabels=s,e.verifyDataLabelOverflow=m)}}(m||(m={})),m})),e(i,"Extensions/OverlappingDataLabels.js",[i["Core/Chart/Chart.js"],i["Core/Utilities.js"]],(function(t,e){function i(t,e){let i,s=!1;return t&&(i=t.newOpacity,t.oldOpacity!==i&&(t.alignAttr&&t.placed?(t[i?"removeClass":"addClass"]("highcharts-data-label-hidden"),s=!0,t.alignAttr.opacity=i,t[t.isOld?"animate":"attr"](t.alignAttr,null,(function(){e.styledMode||t.css({pointerEvents:i?"auto":"none"})})),r(e,"afterHideOverlappingLabel")):t.attr({opacity:i})),t.isOld=!0),s}const{addEvent:s,fireEvent:r,isArray:n,isNumber:o,objectEach:a,pick:h}=e;s(t,"render",(function(){let t=this,e=[];(this.labelCollectors||[]).forEach((function(t){e=e.concat(t())})),(this.yAxis||[]).forEach((function(t){t.stacking&&t.options.stackLabels&&!t.options.stackLabels.allowOverlap&&a(t.stacking.stacks,(function(t){a(t,(function(t){t.label&&e.push(t.label)}))}))})),(this.series||[]).forEach((function(s){var r=s.options.dataLabels;s.visible&&(!1!==r.enabled||s._hasPointLabels)&&((r=s=>s.forEach((s=>{s.visible&&(n(s.dataLabels)?s.dataLabels:s.dataLabel?[s.dataLabel]:[]).forEach((function(r){const n=r.options;r.labelrank=h(n.labelrank,s.labelrank,s.shapeArgs&&s.shapeArgs.height),n.allowOverlap?(r.oldOpacity=r.opacity,r.newOpacity=1,i(r,t)):e.push(r)}))})))(s.nodes||[]),r(s.points))})),this.hideOverlappingLabels(e)})),t.prototype.hideOverlappingLabels=function(t){let e=this,s=t.length,n=e.renderer;var a;let h,l,c,d,u=!1;var p=function(t){let e,i;var s;let r,a,h=t.box?0:t.padding||0,l=s=0;if(t&&(!t.alignAttr||t.placed))return e=t.alignAttr||{x:t.attr("x"),y:t.attr("y")},i=t.parentGroup,t.width||(s=t.getBBox(),t.width=s.width,t.height=s.height,s=n.fontMetrics(t.element).h),r=t.width-2*h,(a={left:"0",center:"0.5",right:"1"}[t.alignValue])?l=+a*r:o(t.x)&&Math.round(t.x)!==t.translateX&&(l=t.x-t.translateX),{x:e.x+(i.translateX||0)+h-(l||0),y:e.y+(i.translateY||0)+h-s,width:t.width-2*h,height:t.height-2*h}};for(h=0;h=c.x+c.width||d.x+d.width<=c.x||d.y>=c.y+c.height||d.y+d.height<=c.y||((p.labelrank(l(t)||(t={radius:t||0}),c(u,e,t));if(-1===s.symbolCustomAttribs.indexOf("borderRadius")){s.symbolCustomAttribs.push("borderRadius","brBoxHeight","brBoxY");const i=r.prototype.symbols.arc;r.prototype.symbols.arc=function(t,e,s,r,n={}){t=i(t,e,s,r,n);const{innerR:o=0,r:a=s,start:h=0,end:l=0}=n;if(n.open||!n.borderRadius)return t;for(s=l-h,e=Math.sin(s/2),n=Math.max(Math.min(d(n.borderRadius||0,a-o),(a-o)/2,a*e/(1+e)),0),s=Math.min(n,s/Math.PI*2*o),e=t.length-1;e--;){let i,o,a;var c=e,u=1this.borderWidth&&(g="all"),g||(g="end");const f=Math.min(d(t.radius,l),l/2,"all"===g?u/2:1/0)||0;"end"===g&&(m&&(s-=f),r+=f),h(i,{brBoxHeight:r,brBoxY:s,r:f})}}}),{order:9})}return{optionsToObject:p}})),e(i,"Core/Responsive.js",[i["Core/Utilities.js"]],(function(t){const{diffObjects:e,extend:i,find:s,merge:r,pick:n,uniqueKey:o}=t;var a;return function(a){function h(t,e){const i=t.condition;(i.callback||function(){return this.chartWidth<=n(i.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=n(i.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=n(i.minWidth,0)&&this.chartHeight>=n(i.minHeight,0)}).call(this)&&e.push(t._id)}function l(t,i){const n=this.options.responsive;var a=this.currentResponsive;let h=[];!i&&n&&n.rules&&n.rules.forEach((t=>{void 0===t._id&&(t._id=o()),this.matchResponsiveRule(t,h)}),this),i=r(...h.map((t=>s((n||{}).rules||[],(e=>e._id===t)))).map((t=>t&&t.chartOptions))),i.isResponsiveOptions=!0,h=h.toString()||void 0,h!==(a&&a.ruleIds)&&(a&&this.update(a.undoOptions,t,!0),h?((a=e(i,this.options,!0,this.collectionsWithUpdate)).isResponsiveOptions=!0,this.currentResponsive={ruleIds:h,mergedOptions:i,undoOptions:a},this.update(i,t,!0)):this.currentResponsive=void 0)}const c=[];a.compose=function(e){return t.pushUnique(c,e)&&i(e.prototype,{matchResponsiveRule:h,setResponsive:l}),e}}(a||(a={})),a})),e(i,"masters/highcharts.src.js",[i["Core/Globals.js"],i["Core/Utilities.js"],i["Core/Defaults.js"],i["Core/Animation/Fx.js"],i["Core/Animation/AnimationUtilities.js"],i["Core/Renderer/HTML/AST.js"],i["Core/Templating.js"],i["Core/Renderer/RendererUtilities.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Renderer/SVG/SVGRenderer.js"],i["Core/Renderer/HTML/HTMLElement.js"],i["Core/Renderer/HTML/HTMLRenderer.js"],i["Core/Axis/Axis.js"],i["Core/Axis/DateTimeAxis.js"],i["Core/Axis/LogarithmicAxis.js"],i["Core/Axis/PlotLineOrBand/PlotLineOrBand.js"],i["Core/Axis/Tick.js"],i["Core/Tooltip.js"],i["Core/Series/Point.js"],i["Core/Pointer.js"],i["Core/Legend/Legend.js"],i["Core/Chart/Chart.js"],i["Core/Axis/Stacking/StackingAxis.js"],i["Core/Axis/Stacking/StackItem.js"],i["Core/Series/Series.js"],i["Core/Series/SeriesRegistry.js"],i["Series/Column/ColumnSeries.js"],i["Series/Column/ColumnDataLabel.js"],i["Series/Pie/PieSeries.js"],i["Series/Pie/PieDataLabel.js"],i["Core/Series/DataLabel.js"],i["Core/Responsive.js"],i["Core/Color/Color.js"],i["Core/Time.js"]],(function(t,e,i,s,r,n,o,a,h,l,c,d,u,p,m,g,f,v,b,y,x,w,S,C,k,A,M,E,T,L,O,P,D,R){return t.animate=r.animate,t.animObject=r.animObject,t.getDeferredAnimation=r.getDeferredAnimation,t.setAnimation=r.setAnimation,t.stop=r.stop,t.timers=s.timers,t.AST=n,t.Axis=u,t.Chart=w,t.chart=w.chart,t.Fx=s,t.Legend=x,t.PlotLineOrBand=g,t.Point=b,t.Pointer=y,t.Series=k,t.StackItem=C,t.SVGElement=h,t.SVGRenderer=l,t.Templating=o,t.Tick=f,t.Time=R,t.Tooltip=v,t.Color=D,t.color=D.parse,d.compose(l),c.compose(h),y.compose(w),x.compose(w),t.defaultOptions=i.defaultOptions,t.getOptions=i.getOptions,t.time=i.defaultTime,t.setOptions=i.setOptions,t.dateFormat=o.dateFormat,t.format=o.format,t.numberFormat=o.numberFormat,t.addEvent=e.addEvent,t.arrayMax=e.arrayMax,t.arrayMin=e.arrayMin,t.attr=e.attr,t.clearTimeout=e.clearTimeout,t.correctFloat=e.correctFloat,t.createElement=e.createElement,t.css=e.css,t.defined=e.defined,t.destroyObjectProperties=e.destroyObjectProperties,t.discardElement=e.discardElement,t.distribute=a.distribute,t.erase=e.erase,t.error=e.error,t.extend=e.extend,t.extendClass=e.extendClass,t.find=e.find,t.fireEvent=e.fireEvent,t.getMagnitude=e.getMagnitude,t.getStyle=e.getStyle,t.inArray=e.inArray,t.isArray=e.isArray,t.isClass=e.isClass,t.isDOMElement=e.isDOMElement,t.isFunction=e.isFunction,t.isNumber=e.isNumber,t.isObject=e.isObject,t.isString=e.isString,t.keys=e.keys,t.merge=e.merge,t.normalizeTickInterval=e.normalizeTickInterval,t.objectEach=e.objectEach,t.offset=e.offset,t.pad=e.pad,t.pick=e.pick,t.pInt=e.pInt,t.relativeLength=e.relativeLength,t.removeEvent=e.removeEvent,t.seriesType=A.seriesType,t.splat=e.splat,t.stableSort=e.stableSort,t.syncTimeout=e.syncTimeout,t.timeUnits=e.timeUnits,t.uniqueKey=e.uniqueKey,t.useSerialIds=e.useSerialIds,t.wrap=e.wrap,E.compose(M),O.compose(k),p.compose(u),m.compose(u),L.compose(T),g.compose(u),P.compose(w),S.compose(u,w,k),v.compose(y),t})),i["masters/highcharts.src.js"]._modules=i,i["masters/highcharts.src.js"]},t.exports?(n.default=n,t.exports=r.document?n(r):n):void 0===(s=function(){return n(r)}.call(e,i,e,t))||(t.exports=s)}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s].call(n.exports,n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{!function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const t=HTMLElement;window.HTMLElement=function(){return Reflect.construct(t,[],this.constructor)},HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}(),function(t){function e(t,e,i){throw new t("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+e+".",i)}"function"!=typeof t.requestSubmit&&(t.requestSubmit=function(t){t?(function(t,i){t instanceof HTMLElement||e(TypeError,"parameter 1 is not of type 'HTMLElement'"),"submit"==t.type||e(TypeError,"The specified element is not a submit button"),t.form==i||e(DOMException,"The specified element is not owned by this form element","NotFoundError")}(t,this),t.click()):((t=document.createElement("input")).type="submit",t.hidden=!0,this.appendChild(t),t.click(),this.removeChild(t))})}(HTMLFormElement.prototype);const t=new WeakMap;function e(e){const i=function(t){const e=t instanceof Element?t:t instanceof Node?t.parentElement:null,i=e?e.closest("input, button"):null;return"submit"==(null==i?void 0:i.type)?i:null}(e.target);i&&i.form&&t.set(i.form,i)}var s,r,n,o,a,h;!function(){if("submitter"in Event.prototype)return;let i=window.Event.prototype;if("SubmitEvent"in window&&/Apple Computer/.test(navigator.vendor))i=window.SubmitEvent.prototype;else if("SubmitEvent"in window)return;addEventListener("click",e,!0),Object.defineProperty(i,"submitter",{get(){if("submit"==this.type&&this.target instanceof HTMLFormElement)return t.get(this.target)}})}(),function(t){t.eager="eager",t.lazy="lazy"}(s||(s={}));class l extends HTMLElement{static get observedAttributes(){return["disabled","complete","loading","src"]}constructor(){super(),this.loaded=Promise.resolve(),this.delegate=new l.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(t){"loading"==t?this.delegate.loadingStyleChanged():"complete"==t?this.delegate.completeChanged():"src"==t?this.delegate.sourceURLChanged():this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loading(){return"lazy"===(this.getAttribute("loading")||"").toLowerCase()?s.lazy:s.eager}set loading(t){t?this.setAttribute("loading",t):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(t){t?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){var t,e;return null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.documentElement)||void 0===e?void 0:e.hasAttribute("data-turbo-preview")}}function c(t){return new URL(t.toString(),document.baseURI)}function d(t){let e;return t.hash?t.hash.slice(1):(e=t.href.match(/#(.*)$/))?e[1]:void 0}function u(t,e){return c((null==e?void 0:e.getAttribute("formaction"))||t.getAttribute("action")||t.action)}function p(t,e){return function(t,e){const i=function(t){return(e=t.origin+t.pathname).endsWith("/")?e:e+"/";var e}(e);return t.href===c(i).href||t.href.startsWith(i)}(t,e)&&!!(i=t,(function(t){return function(t){return t.pathname.split("/").slice(1)}(t).slice(-1)[0]}(i).match(/\.[^.]*$/)||[])[0]||"").match(/^(?:|\.(?:htm|html|xhtml|php))$/);var i}function m(t){const e=d(t);return null!=e?t.href.slice(0,-(e.length+1)):t.href}function g(t){return m(t)}class f{constructor(t){this.response=t}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return c(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(t){return this.response.headers.get(t)}}function v(t){if("false"==t.getAttribute("data-turbo-eval"))return t;{const e=document.createElement("script"),i=O("csp-nonce");return i&&(e.nonce=i),e.textContent=t.textContent,e.async=!1,function(t,e){for(const{name:i,value:s}of e.attributes)t.setAttribute(i,s)}(e,t),e}}function b(t,{target:e,cancelable:i,detail:s}={}){const r=new CustomEvent(t,{cancelable:i,bubbles:!0,composed:!0,detail:s});return e&&e.isConnected?e.dispatchEvent(r):document.documentElement.dispatchEvent(r),r}function y(){return new Promise((t=>requestAnimationFrame((()=>t()))))}function x(t=""){return(new DOMParser).parseFromString(t,"text/html")}function w(t,...e){const i=function(t,e){return t.reduce(((t,i,s)=>t+i+(null==e[s]?"":e[s])),"")}(t,e).replace(/^\n/,"").split("\n"),s=i[0].match(/^\s+/),r=s?s[0].length:0;return i.map((t=>t.slice(r))).join("\n")}function S(){return Array.from({length:36}).map(((t,e)=>8==e||13==e||18==e||23==e?"-":14==e?"4":19==e?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16))).join("")}function C(t,...e){for(const i of e.map((e=>null==e?void 0:e.getAttribute(t))))if("string"==typeof i)return i;return null}function k(...t){for(const e of t)"turbo-frame"==e.localName&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function A(...t){for(const e of t)"turbo-frame"==e.localName&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function M(t,e=2e3){return new Promise((i=>{const s=()=>{t.removeEventListener("error",s),t.removeEventListener("load",s),i()};t.addEventListener("load",s,{once:!0}),t.addEventListener("error",s,{once:!0}),setTimeout(i,e)}))}function E(t){switch(t){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function T(...t){const e=C("data-turbo-action",...t);return function(t){return"advance"==t||"replace"==t||"restore"==t}(e)?e:null}function L(t){return document.querySelector(`meta[name="${t}"]`)}function O(t){const e=L(t);return e&&e.content}function P(t,e){var i;if(t instanceof Element)return t.closest(e)||P(t.assignedSlot||(null===(i=t.getRootNode())||void 0===i?void 0:i.host),e)}!function(t){t[t.get=0]="get",t[t.post=1]="post",t[t.put=2]="put",t[t.patch=3]="patch",t[t.delete=4]="delete"}(r||(r={}));class D{constructor(t,e,i,s=new URLSearchParams,r=null){this.abortController=new AbortController,this.resolveRequestPromise=t=>{},this.delegate=t,this.method=e,this.headers=this.defaultHeaders,this.body=s,this.url=i,this.target=r}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:t}=this;this.delegate.prepareRequest(this),await this.allowRequestToBeIntercepted(t);try{this.delegate.requestStarted(this);const e=await fetch(this.url.href,t);return await this.receive(e)}catch(t){if("AbortError"!==t.name)throw this.willDelegateErrorHandling(t)&&this.delegate.requestErrored(this,t),t}finally{this.delegate.requestFinished(this)}}async receive(t){const e=new f(t);return b("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:e},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,e):e.succeeded?this.delegate.requestSucceededWithResponse(this,e):this.delegate.requestFailedWithResponse(this,e),e}get fetchOptions(){var t;return{method:r[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.isSafe?null:this.body,signal:this.abortSignal,referrer:null===(t=this.delegate.referrer)||void 0===t?void 0:t.href}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return this.method===r.get}get abortSignal(){return this.abortController.signal}acceptResponseType(t){this.headers.Accept=[t,this.headers.Accept].join(", ")}async allowRequestToBeIntercepted(t){const e=new Promise((t=>this.resolveRequestPromise=t));b("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:t,url:this.url,resume:this.resolveRequestPromise},target:this.target}).defaultPrevented&&await e}willDelegateErrorHandling(t){return!b("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:t}}).defaultPrevented}}class R{constructor(t,e){this.started=!1,this.intersect=t=>{const e=t.slice(-1)[0];(null==e?void 0:e.isIntersecting)&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=t,this.element=e,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}}class I{static wrap(t){return"string"==typeof t?new this(function(t){const e=document.createElement("template");return e.innerHTML=t,e.content}(t)):t}constructor(t){this.fragment=function(t){for(const e of t.querySelectorAll("turbo-stream")){const t=document.importNode(e,!0);for(const e of t.templateElement.content.querySelectorAll("script"))e.replaceWith(v(e));e.replaceWith(t)}return t}(t)}}I.contentType="text/vnd.turbo-stream.html",function(t){t[t.initialized=0]="initialized",t[t.requesting=1]="requesting",t[t.waiting=2]="waiting",t[t.receiving=3]="receiving",t[t.stopping=4]="stopping",t[t.stopped=5]="stopped"}(n||(n={})),function(t){t.urlEncoded="application/x-www-form-urlencoded",t.multipart="multipart/form-data",t.plain="text/plain"}(o||(o={}));class B{static confirmMethod(t,e,i){return Promise.resolve(confirm(t))}constructor(t,e,i,s=!1){this.state=n.initialized,this.delegate=t,this.formElement=e,this.submitter=i,this.formData=function(t,e){const i=new FormData(t),s=null==e?void 0:e.getAttribute("name"),r=null==e?void 0:e.getAttribute("value");return s&&i.append(s,r||""),i}(e,i),this.location=c(this.action),this.method==r.get&&function(t,e){const i=new URLSearchParams;for(const[t,s]of e)s instanceof File||i.append(t,s);t.search=i.toString()}(this.location,[...this.body.entries()]),this.fetchRequest=new D(this,this.method,this.location,this.body,this.formElement),this.mustRedirect=s}get method(){var t;return function(t){switch(t.toLowerCase()){case"get":return r.get;case"post":return r.post;case"put":return r.put;case"patch":return r.patch;case"delete":return r.delete}}(((null===(t=this.submitter)||void 0===t?void 0:t.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"").toLowerCase())||r.get}get action(){var t;const e="string"==typeof this.formElement.action?this.formElement.action:null;return(null===(t=this.submitter)||void 0===t?void 0:t.hasAttribute("formaction"))?this.submitter.getAttribute("formaction")||"":this.formElement.getAttribute("action")||e||""}get body(){return this.enctype==o.urlEncoded||this.method==r.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var t;return function(t){switch(t.toLowerCase()){case o.multipart:return o.multipart;case o.plain:return o.plain;default:return o.urlEncoded}}((null===(t=this.submitter)||void 0===t?void 0:t.getAttribute("formenctype"))||this.formElement.enctype)}get isSafe(){return this.fetchRequest.isSafe}get stringFormData(){return[...this.formData].reduce(((t,[e,i])=>t.concat("string"==typeof i?[[e,i]]:[])),[])}async start(){const{initialized:t,requesting:e}=n,i=C("data-turbo-confirm",this.submitter,this.formElement);if("string"!=typeof i||await B.confirmMethod(i,this.formElement,this.submitter))return this.state==t?(this.state=e,this.fetchRequest.perform()):void 0}stop(){const{stopping:t,stopped:e}=n;if(this.state!=t&&this.state!=e)return this.state=t,this.fetchRequest.cancel(),!0}prepareRequest(t){if(!t.isSafe){const e=function(t){if(null!=t){const e=(document.cookie?document.cookie.split("; "):[]).find((e=>e.startsWith(t)));if(e){const t=e.split("=").slice(1).join("=");return t?decodeURIComponent(t):void 0}}}(O("csrf-param"))||O("csrf-token");e&&(t.headers["X-CSRF-Token"]=e)}this.requestAcceptsTurboStreamResponse(t)&&t.acceptResponseType(I.contentType)}requestStarted(t){var e;this.state=n.waiting,null===(e=this.submitter)||void 0===e||e.setAttribute("disabled",""),this.setSubmitsWith(),b("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(t,e){this.result={success:e.succeeded,fetchResponse:e}}requestSucceededWithResponse(t,e){if(e.clientError||e.serverError)this.delegate.formSubmissionFailedWithResponse(this,e);else if(this.requestMustRedirect(t)&&function(t){return 200==t.statusCode&&!t.redirected}(e)){const t=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,t)}else this.state=n.receiving,this.result={success:!0,fetchResponse:e},this.delegate.formSubmissionSucceededWithResponse(this,e)}requestFailedWithResponse(t,e){this.result={success:!1,fetchResponse:e},this.delegate.formSubmissionFailedWithResponse(this,e)}requestErrored(t,e){this.result={success:!1,error:e},this.delegate.formSubmissionErrored(this,e)}requestFinished(t){var e;this.state=n.stopped,null===(e=this.submitter)||void 0===e||e.removeAttribute("disabled"),this.resetSubmitterText(),b("turbo:submit-end",{target:this.formElement,detail:Object.assign({formSubmission:this},this.result)}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(this.submitter&&this.submitsWith)if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const t=this.submitter;this.originalSubmitText=t.value,t.value=this.submitsWith}}resetSubmitterText(){this.submitter&&this.originalSubmitText&&(this.submitter.matches("button")?this.submitter.innerHTML=this.originalSubmitText:this.submitter.matches("input")&&(this.submitter.value=this.originalSubmitText))}requestMustRedirect(t){return!t.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(t){return!t.isSafe||function(t,...e){return e.some((e=>e&&e.hasAttribute(t)))}("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){var t;return null===(t=this.submitter)||void 0===t?void 0:t.getAttribute("data-turbo-submits-with")}}class j{constructor(t){this.element=t}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(t){return null!=this.getElementForAnchor(t)}getElementForAnchor(t){return t?this.element.querySelector(`[id='${t}'], a[name='${t}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){for(const t of this.element.querySelectorAll("[autofocus]"))if(null==t.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])"))return t;return null}get permanentElements(){return N(this.element)}getPermanentElementById(t){return F(this.element,t)}getPermanentElementMapForSnapshot(t){const e={};for(const i of this.permanentElements){const{id:s}=i,r=t.getPermanentElementById(s);r&&(e[s]=[i,r])}return e}}function F(t,e){return t.querySelector(`#${e}[data-turbo-permanent]`)}function N(t){return t.querySelectorAll("[id][data-turbo-permanent]")}class z{constructor(t,e){this.started=!1,this.submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=t=>{if(!t.defaultPrevented){const e=t.target instanceof HTMLFormElement?t.target:void 0,i=t.submitter||void 0;e&&function(t,e){return"dialog"!=((null==e?void 0:e.getAttribute("formmethod"))||t.getAttribute("method"))}(e,i)&&function(t,e){if((null==e?void 0:e.hasAttribute("formtarget"))||t.hasAttribute("target")){const i=(null==e?void 0:e.getAttribute("formtarget"))||t.target;for(const t of document.getElementsByName(i))if(t instanceof HTMLIFrameElement)return!1;return!0}return!0}(e,i)&&this.delegate.willSubmitForm(e,i)&&(t.preventDefault(),t.stopImmediatePropagation(),this.delegate.formSubmitted(e,i))}},this.delegate=t,this.eventTarget=e}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}}class H{constructor(t,e){this.resolveRenderPromise=t=>{},this.resolveInterceptionPromise=t=>{},this.delegate=t,this.element=e}scrollToAnchor(t){const e=this.snapshot.getElementForAnchor(t);e?(this.scrollToElement(e),this.focusElement(e)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(t){this.scrollToAnchor(d(t))}scrollToElement(t){t.scrollIntoView()}focusElement(t){t instanceof HTMLElement&&(t.hasAttribute("tabindex")?t.focus():(t.setAttribute("tabindex","-1"),t.focus(),t.removeAttribute("tabindex")))}scrollToPosition({x:t,y:e}){this.scrollRoot.scrollTo(t,e)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(t){const{isPreview:e,shouldRender:i,newSnapshot:s}=t;if(i)try{this.renderPromise=new Promise((t=>this.resolveRenderPromise=t)),this.renderer=t,await this.prepareToRenderSnapshot(t);const i=new Promise((t=>this.resolveInterceptionPromise=t)),r={resume:this.resolveInterceptionPromise,render:this.renderer.renderElement};this.delegate.allowsImmediateRender(s,r)||await i,await this.renderSnapshot(t),this.delegate.viewRenderedSnapshot(s,e),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(t)}finally{delete this.renderer,this.resolveRenderPromise(void 0),delete this.renderPromise}else this.invalidate(t.reloadReason)}invalidate(t){this.delegate.viewInvalidated(t)}async prepareToRenderSnapshot(t){this.markAsPreview(t.isPreview),await t.prepareToRender()}markAsPreview(t){t?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}async renderSnapshot(t){await t.render()}finishRenderingSnapshot(t){t.finishRendering()}}class W extends H{missing(){this.element.innerHTML='Content missing'}get snapshot(){return new j(this.element)}}class V{constructor(t,e){this.clickBubbled=t=>{this.respondsToEventTarget(t.target)?this.clickEvent=t:delete this.clickEvent},this.linkClicked=t=>{this.clickEvent&&this.respondsToEventTarget(t.target)&&t.target instanceof Element&&this.delegate.shouldInterceptLinkClick(t.target,t.detail.url,t.detail.originalEvent)&&(this.clickEvent.preventDefault(),t.preventDefault(),this.delegate.linkClickIntercepted(t.target,t.detail.url,t.detail.originalEvent)),delete this.clickEvent},this.willVisit=t=>{delete this.clickEvent},this.delegate=t,this.element=e}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}respondsToEventTarget(t){const e=t instanceof Element?t:t instanceof Node?t.parentElement:null;return e&&e.closest("turbo-frame, html")==this.element}}class G{constructor(t,e){this.started=!1,this.clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=t=>{if(t instanceof MouseEvent&&this.clickEventIsSignificant(t)){const e=t.composedPath&&t.composedPath()[0]||t.target,i=this.findLinkFromClickTarget(e);if(i&&function(t){if(t.hasAttribute("target")){for(const e of document.getElementsByName(t.target))if(e instanceof HTMLIFrameElement)return!1;return!0}return!0}(i)){const e=this.getLocationForLink(i);this.delegate.willFollowLinkToLocation(i,e,t)&&(t.preventDefault(),this.delegate.followedLinkToLocation(i,e))}}},this.delegate=t,this.eventTarget=e}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(t){return!(t.target&&t.target.isContentEditable||t.defaultPrevented||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)}findLinkFromClickTarget(t){return P(t,"a[href]:not([target^=_]):not([download])")}getLocationForLink(t){return c(t.getAttribute("href")||"")}}class U{constructor(t,e){this.delegate=t,this.linkInterceptor=new G(this,e)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}willFollowLinkToLocation(t,e,i){return this.delegate.willSubmitFormLinkToLocation(t,e,i)&&t.hasAttribute("data-turbo-method")}followedLinkToLocation(t,e){const i=document.createElement("form");for(const[t,s]of e.searchParams)i.append(Object.assign(document.createElement("input"),{type:"hidden",name:t,value:s}));const s=Object.assign(e,{search:""});i.setAttribute("data-turbo","true"),i.setAttribute("action",s.href),i.setAttribute("hidden","");const r=t.getAttribute("data-turbo-method");r&&i.setAttribute("method",r);const n=t.getAttribute("data-turbo-frame");n&&i.setAttribute("data-turbo-frame",n);const o=T(t);o&&i.setAttribute("data-turbo-action",o);const a=t.getAttribute("data-turbo-confirm");a&&i.setAttribute("data-turbo-confirm",a),t.hasAttribute("data-turbo-stream")&&i.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(t,e,i),document.body.appendChild(i),i.addEventListener("turbo:submit-end",(()=>i.remove()),{once:!0}),requestAnimationFrame((()=>i.requestSubmit()))}}class X{static async preservingPermanentElements(t,e,i){const s=new this(t,e);s.enter(),await i(),s.leave()}constructor(t,e){this.delegate=t,this.permanentElementMap=e}enter(){for(const t in this.permanentElementMap){const[e,i]=this.permanentElementMap[t];this.delegate.enteringBardo(e,i),this.replaceNewPermanentElementWithPlaceholder(i)}}leave(){for(const t in this.permanentElementMap){const[e]=this.permanentElementMap[t];this.replaceCurrentPermanentElementWithClone(e),this.replacePlaceholderWithPermanentElement(e),this.delegate.leavingBardo(e)}}replaceNewPermanentElementWithPlaceholder(t){const e=function(t){const e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",t.id),e}(t);t.replaceWith(e)}replaceCurrentPermanentElementWithClone(t){const e=t.cloneNode(!0);t.replaceWith(e)}replacePlaceholderWithPermanentElement(t){const e=this.getPlaceholderById(t.id);null==e||e.replaceWith(t)}getPlaceholderById(t){return this.placeholders.find((e=>e.content==t))}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}class _{constructor(t,e,i,s,r=!0){this.activeElement=null,this.currentSnapshot=t,this.newSnapshot=e,this.isPreview=s,this.willRender=r,this.renderElement=i,this.promise=new Promise(((t,e)=>this.resolvingFunctions={resolve:t,reject:e}))}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(t){await X.preservingPermanentElements(this,this.permanentElementMap,t)}focusFirstAutofocusableElement(){const t=this.connectedSnapshot.firstAutofocusableElement;(function(t){return t&&"function"==typeof t.focus})(t)&&t.focus()}enteringBardo(t){this.activeElement||t.contains(this.currentSnapshot.activeElement)&&(this.activeElement=this.currentSnapshot.activeElement)}leavingBardo(t){t.contains(this.activeElement)&&this.activeElement instanceof HTMLElement&&(this.activeElement.focus(),this.activeElement=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}}class Y extends _{static renderElement(t,e){var i;const s=document.createRange();s.selectNodeContents(t),s.deleteContents();const r=e,n=null===(i=r.ownerDocument)||void 0===i?void 0:i.createRange();n&&(n.selectNodeContents(r),t.appendChild(n.extractContents()))}constructor(t,e,i,s,r,n=!0){super(e,i,s,r,n),this.delegate=t}get shouldRender(){return!0}async render(){await y(),this.preservingPermanentElements((()=>{this.loadFrameElement()})),this.scrollFrameIntoView(),await y(),this.focusFirstAutofocusableElement(),await y(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const e=this.currentElement.firstElementChild,i=("end","end"==(t=this.currentElement.getAttribute("data-autoscroll-block"))||"start"==t||"center"==t||"nearest"==t?t:"end"),s=function(t,e){return"auto"==t||"smooth"==t?t:"auto"}(this.currentElement.getAttribute("data-autoscroll-behavior"));if(e)return e.scrollIntoView({block:i,behavior:s}),!0}var t;return!1}activateScriptElements(){for(const t of this.newScriptElements){const e=v(t);t.replaceWith(e)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}class q{static get defaultCSS(){return w` + .turbo-progress-bar { + position: fixed; + display: block; + top: 0; + left: 0; + height: 3px; + background: #0076ff; + z-index: 2147483647; + transition: + width ${q.animationDuration}ms ease-out, + opacity ${q.animationDuration/2}ms ${q.animationDuration/2}ms ease-in; + transform: translate3d(0, 0, 0); + } + `}constructor(){this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)},this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement((()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1})))}setValue(t){this.value=t,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(t){this.progressElement.style.opacity="0",setTimeout(t,1.5*q.animationDuration)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,q.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame((()=>{this.progressElement.style.width=10+90*this.value+"%"}))}createStylesheetElement(){const t=document.createElement("style");return t.type="text/css",t.textContent=q.defaultCSS,this.cspNonce&&(t.nonce=this.cspNonce),t}createProgressElement(){const t=document.createElement("div");return t.className="turbo-progress-bar",t}get cspNonce(){return O("csp-nonce")}}q.animationDuration=300;class $ extends j{constructor(){super(...arguments),this.detailsByOuterHTML=this.children.filter((t=>!function(t){return"noscript"==t.localName}(t))).map((t=>function(t){return t.hasAttribute("nonce")&&t.setAttribute("nonce",""),t}(t))).reduce(((t,e)=>{const{outerHTML:i}=e,s=i in t?t[i]:{type:K(e),tracked:Z(e),elements:[]};return Object.assign(Object.assign({},t),{[i]:Object.assign(Object.assign({},s),{elements:[...s.elements,e]})})}),{})}get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter((t=>this.detailsByOuterHTML[t].tracked)).join("")}getScriptElementsNotInSnapshot(t){return this.getElementsMatchingTypeNotInSnapshot("script",t)}getStylesheetElementsNotInSnapshot(t){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",t)}getElementsMatchingTypeNotInSnapshot(t,e){return Object.keys(this.detailsByOuterHTML).filter((t=>!(t in e.detailsByOuterHTML))).map((t=>this.detailsByOuterHTML[t])).filter((({type:e})=>e==t)).map((({elements:[t]})=>t))}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce(((t,e)=>{const{type:i,tracked:s,elements:r}=this.detailsByOuterHTML[e];return null!=i||s?r.length>1?[...t,...r.slice(1)]:t:[...t,...r]}),[])}getMetaValue(t){const e=this.findMetaElementByName(t);return e?e.getAttribute("content"):null}findMetaElementByName(t){return Object.keys(this.detailsByOuterHTML).reduce(((e,i)=>{const{elements:[s]}=this.detailsByOuterHTML[i];return function(t,e){return"meta"==t.localName&&t.getAttribute("name")==e}(s,t)?s:e}),void 0)}}function K(t){return function(t){return"script"==t.localName}(t)?"script":function(t){const e=t.localName;return"style"==e||"link"==e&&"stylesheet"==t.getAttribute("rel")}(t)?"stylesheet":void 0}function Z(t){return"reload"==t.getAttribute("data-turbo-track")}class J extends j{static fromHTMLString(t=""){return this.fromDocument(x(t))}static fromElement(t){return this.fromDocument(t.ownerDocument)}static fromDocument({head:t,body:e}){return new this(e,new $(t))}constructor(t,e){super(t),this.headSnapshot=e}clone(){const t=this.element.cloneNode(!0),e=this.element.querySelectorAll("select"),i=t.querySelectorAll("select");for(const[t,s]of e.entries()){const e=i[t];for(const t of e.selectedOptions)t.selected=!1;for(const t of s.selectedOptions)e.options[t.index].selected=!0}for(const e of t.querySelectorAll('input[type="password"]'))e.value="";return new J(t,this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var t;return c(null!==(t=this.getSetting("root"))&&void 0!==t?t:"/")}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return"no-preview"!=this.cacheControlValue}get isCacheable(){return"no-cache"!=this.cacheControlValue}get isVisitable(){return"reload"!=this.getSetting("visit-control")}getSetting(t){return this.headSnapshot.getMetaValue(`turbo-${t}`)}}!function(t){t.visitStart="visitStart",t.requestStart="requestStart",t.requestEnd="requestEnd",t.visitEnd="visitEnd"}(a||(a={})),function(t){t.initialized="initialized",t.started="started",t.canceled="canceled",t.failed="failed",t.completed="completed"}(h||(h={}));const Q={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1};var tt,et;!function(t){t[t.networkFailure=0]="networkFailure",t[t.timeoutFailure=-1]="timeoutFailure",t[t.contentTypeMismatch=-2]="contentTypeMismatch"}(tt||(tt={}));class it{constructor(t,e,i,s={}){this.identifier=S(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.shouldCacheSnapshot=!0,this.acceptsStreamResponse=!1,this.snapshotCached=!1,this.state=h.initialized,this.delegate=t,this.location=e,this.restorationIdentifier=i||S();const{action:r,historyChanged:n,referrer:o,snapshot:a,snapshotHTML:l,response:c,visitCachedSnapshot:d,willRender:u,updateHistory:p,shouldCacheSnapshot:m,acceptsStreamResponse:g}=Object.assign(Object.assign({},Q),s);this.action=r,this.historyChanged=n,this.referrer=o,this.snapshot=a,this.snapshotHTML=l,this.response=c,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.visitCachedSnapshot=d,this.willRender=u,this.updateHistory=p,this.scrolled=!u,this.shouldCacheSnapshot=m,this.acceptsStreamResponse=g}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==h.initialized&&(this.recordTimingMetric(a.visitStart),this.state=h.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==h.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=h.canceled)}complete(){this.state==h.started&&(this.recordTimingMetric(a.visitEnd),this.state=h.completed,this.followRedirect(),this.followedRedirect||(this.adapter.visitCompleted(this),this.delegate.visitCompleted(this)))}fail(){this.state==h.started&&(this.state=h.failed,this.adapter.visitFailed(this))}changeHistory(){var t;if(!this.historyChanged&&this.updateHistory){const e=E(this.location.href===(null===(t=this.referrer)||void 0===t?void 0:t.href)?"replace":this.action);this.history.update(e,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new D(this,r.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(a.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(t=this.response){if(this.response=t,t){const{statusCode:e}=t;st(e)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,e)}}finishRequest(){this.recordTimingMetric(a.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:t,responseHTML:e}=this.response;this.render((async()=>{this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,st(t)&&null!=e?(await this.view.renderPage(J.fromHTMLString(e),!1,this.willRender,this),this.performScroll(),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(J.fromHTMLString(e),this),this.adapter.visitRendered(this),this.fail())}))}}getCachedSnapshot(){const t=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(t&&(!d(this.location)||t.hasAnchor(d(this.location)))&&("restore"==this.action||t.isPreviewable))return t}getPreloadedSnapshot(){if(this.snapshotHTML)return J.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return null!=this.getCachedSnapshot()}loadCachedSnapshot(){const t=this.getCachedSnapshot();if(t){const e=this.shouldIssueRequest();this.render((async()=>{this.cacheSnapshot(),this.isSamePage?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.view.renderPage(t,e,this.willRender,this),this.performScroll(),this.adapter.visitRendered(this),e||this.complete())}))}}followRedirect(){var t;this.redirectedToLocation&&!this.followedRedirect&&(null===(t=this.response)||void 0===t?void 0:t.redirected)&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render((async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)}))}prepareRequest(t){this.acceptsStreamResponse&&t.acceptResponseType(I.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(t,e){}async requestSucceededWithResponse(t,e){const i=await e.responseHTML,{redirected:s,statusCode:r}=e;null==i?this.recordResponse({statusCode:tt.contentTypeMismatch,redirected:s}):(this.redirectedToLocation=e.redirected?e.location:void 0,this.recordResponse({statusCode:r,responseHTML:i,redirected:s}))}async requestFailedWithResponse(t,e){const i=await e.responseHTML,{redirected:s,statusCode:r}=e;null==i?this.recordResponse({statusCode:tt.contentTypeMismatch,redirected:s}):this.recordResponse({statusCode:r,responseHTML:i,redirected:s})}requestErrored(t,e){this.recordResponse({statusCode:tt.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||this.view.forceReloaded||("restore"==this.action?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:t}=this.restorationData;if(t)return this.view.scrollToPosition(t),!0}scrollToAnchor(){const t=d(this.location);if(null!=t)return this.view.scrollToAnchor(t),!0}recordTimingMetric(t){this.timingMetrics[t]=(new Date).getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(t){switch(t){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return"object"==typeof this.response}shouldIssueRequest(){return!this.isSamePage&&("restore"==this.action?!this.hasCachedSnapshot():this.willRender)}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then((t=>t&&this.visitCachedSnapshot(t))),this.snapshotCached=!0)}async render(t){this.cancelRender(),await new Promise((t=>{this.frame=requestAnimationFrame((()=>t()))})),await t(),delete this.frame}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function st(t){return t>=200&&t<300}class rt{constructor(t){this.progressBar=new q,this.showProgressBar=()=>{this.progressBar.show()},this.session=t}visitProposedToLocation(t,e){this.navigator.startVisit(t,(null==e?void 0:e.restorationIdentifier)||S(),e)}visitStarted(t){this.location=t.location,t.loadCachedSnapshot(),t.issueRequest(),t.goToSamePageAnchor()}visitRequestStarted(t){this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!=t.action?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(t){t.loadResponse()}visitRequestFailedWithStatusCode(t,e){switch(e){case tt.networkFailure:case tt.timeoutFailure:case tt.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:e}});default:return t.loadResponse()}}visitRequestFinished(t){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitCompleted(t){}pageInvalidated(t){this.reload(t)}visitFailed(t){}visitRendered(t){}formSubmissionStarted(t){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(t){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),null!=this.visitProgressBarTimeout&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){null==this.formProgressBarTimeout&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),null!=this.formProgressBarTimeout&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(t){var e;b("turbo:reload",{detail:t}),window.location.href=(null===(e=this.location)||void 0===e?void 0:e.toString())||window.location.href}get navigator(){return this.session.navigator}}class nt{constructor(){this.selector="[data-turbo-temporary]",this.deprecatedSelector="[data-turbo-cache=false]",this.started=!1,this.removeTemporaryElements=t=>{for(const t of this.temporaryElements)t.remove()}}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){const t=document.querySelectorAll(this.deprecatedSelector);return t.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...t]}}class ot{constructor(t,e){this.session=t,this.element=e,this.linkInterceptor=new V(this,e),this.formSubmitObserver=new z(this,e)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(t,e,i){return this.shouldRedirect(t)}linkClickIntercepted(t,e,i){const s=this.findFrameElement(t);s&&s.delegate.linkClickIntercepted(t,e,i)}willSubmitForm(t,e){return null==t.closest("turbo-frame")&&this.shouldSubmit(t,e)&&this.shouldRedirect(t,e)}formSubmitted(t,e){const i=this.findFrameElement(t,e);i&&i.delegate.formSubmitted(t,e)}shouldSubmit(t,e){var i;const s=u(t,e),r=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=c(null!==(i=null==r?void 0:r.content)&&void 0!==i?i:"/");return this.shouldRedirect(t,e)&&p(s,n)}shouldRedirect(t,e){if(t instanceof HTMLFormElement?this.session.submissionIsNavigatable(t,e):this.session.elementIsNavigatable(t)){const i=this.findFrameElement(t,e);return!!i&&i!=t.closest("turbo-frame")}return!1}findFrameElement(t,e){const i=(null==e?void 0:e.getAttribute("data-turbo-frame"))||t.getAttribute("data-turbo-frame");if(i&&"_top"!=i){const t=this.element.querySelector(`#${i}:not([disabled])`);if(t instanceof l)return t}}}class at{constructor(t){this.restorationIdentifier=S(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=t=>{if(this.shouldHandlePopState()){const{turbo:e}=t.state||{};if(e){this.location=new URL(window.location.href);const{restorationIdentifier:t}=e;this.restorationIdentifier=t,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,t)}}},this.onPageLoad=async t=>{await Promise.resolve(),this.pageLoaded=!0},this.delegate=t}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(t,e){this.update(history.pushState,t,e)}replace(t,e){this.update(history.replaceState,t,e)}update(t,e,i=S()){const s={turbo:{restorationIdentifier:i}};t.call(history,s,"",e.href),this.location=e,this.restorationIdentifier=i}getRestorationDataForIdentifier(t){return this.restorationData[t]||{}}updateRestorationData(t){const{restorationIdentifier:e}=this,i=this.restorationData[e];this.restorationData[e]=Object.assign(Object.assign({},i),t)}assumeControlOfScrollRestoration(){var t;this.previousScrollRestoration||(this.previousScrollRestoration=null!==(t=history.scrollRestoration)&&void 0!==t?t:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||"complete"==document.readyState}}class ht{constructor(t){this.delegate=t}proposeVisit(t,e={}){this.delegate.allowsVisitingLocationWithAction(t,e.action)&&(p(t,this.view.snapshot.rootLocation)?this.delegate.visitProposedToLocation(t,e):window.location.href=t.toString())}startVisit(t,e,i={}){this.stop(),this.currentVisit=new it(this,c(t),e,Object.assign({referrer:this.location},i)),this.currentVisit.start()}submitForm(t,e){this.stop(),this.formSubmission=new B(this,t,e,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}formSubmissionStarted(t){"function"==typeof this.adapter.formSubmissionStarted&&this.adapter.formSubmissionStarted(t)}async formSubmissionSucceededWithResponse(t,e){if(t==this.formSubmission){const i=await e.responseHTML;if(i){const s=t.isSafe;s||this.view.clearSnapshotCache();const{statusCode:r,redirected:n}=e,o={action:this.getActionForFormSubmission(t),shouldCacheSnapshot:s,response:{statusCode:r,responseHTML:i,redirected:n}};this.proposeVisit(e.location,o)}}}async formSubmissionFailedWithResponse(t,e){const i=await e.responseHTML;if(i){const t=J.fromHTMLString(i);e.serverError?await this.view.renderError(t,this.currentVisit):await this.view.renderPage(t,!1,!0,this.currentVisit),this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(t,e){console.error(e)}formSubmissionFinished(t){"function"==typeof this.adapter.formSubmissionFinished&&this.adapter.formSubmissionFinished(t)}visitStarted(t){this.delegate.visitStarted(t)}visitCompleted(t){this.delegate.visitCompleted(t)}locationWithActionIsSamePage(t,e){const i=d(t),s=d(this.view.lastRenderedLocation),r="restore"===e&&void 0===i;return"replace"!==e&&m(t)===m(this.view.lastRenderedLocation)&&(r||null!=i&&i!==s)}visitScrolledToSamePageLocation(t,e){this.delegate.visitScrolledToSamePageLocation(t,e)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission({submitter:t,formElement:e}){return T(t,e)||"advance"}}!function(t){t[t.initial=0]="initial",t[t.loading=1]="loading",t[t.interactive=2]="interactive",t[t.complete=3]="complete"}(et||(et={}));class lt{constructor(t){this.stage=et.initial,this.started=!1,this.interpretReadyState=()=>{const{readyState:t}=this;"interactive"==t?this.pageIsInteractive():"complete"==t&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=t}start(){this.started||(this.stage==et.initial&&(this.stage=et.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==et.loading&&(this.stage=et.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==et.interactive&&(this.stage=et.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class ct{constructor(t){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=t}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(t){this.delegate.scrollPositionChanged(t)}}class dt{render({fragment:t}){X.preservingPermanentElements(this,function(t){const e=N(document.documentElement),i={};for(const s of e){const{id:e}=s;for(const r of t.querySelectorAll("turbo-stream")){const t=F(r.templateElement.content,e);t&&(i[e]=[s,t])}}return i}(t),(()=>document.documentElement.appendChild(t)))}enteringBardo(t,e){e.replaceWith(t.cloneNode(!0))}leavingBardo(){}}class ut{constructor(t){this.sources=new Set,this.started=!1,this.inspectFetchResponse=t=>{const e=function(t){var e;const i=null===(e=t.detail)||void 0===e?void 0:e.fetchResponse;if(i instanceof f)return i}(t);e&&function(t){var e;return(null!==(e=t.contentType)&&void 0!==e?e:"").startsWith(I.contentType)}(e)&&(t.preventDefault(),this.receiveMessageResponse(e))},this.receiveMessageEvent=t=>{this.started&&"string"==typeof t.data&&this.receiveMessageHTML(t.data)},this.delegate=t}start(){this.started||(this.started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(t){this.streamSourceIsConnected(t)||(this.sources.add(t),t.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(t){this.streamSourceIsConnected(t)&&(this.sources.delete(t),t.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(t){return this.sources.has(t)}async receiveMessageResponse(t){const e=await t.responseHTML;e&&this.receiveMessageHTML(e)}receiveMessageHTML(t){this.delegate.receivedMessageFromStream(I.wrap(t))}}class pt extends _{static renderElement(t,e){const{documentElement:i,body:s}=document;i.replaceChild(e,s)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:t,head:e}=document;t.replaceChild(this.newHead,e),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const t of this.scriptElements){const e=t.parentNode;if(e){const i=v(t);e.replaceChild(i,t)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}class mt extends _{static renderElement(t,e){document.body&&e instanceof HTMLBodyElement?document.body.replaceWith(e):document.documentElement.appendChild(e)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){return this.newSnapshot.isVisitable?this.trackedElementsAreIdentical?void 0:{reason:"tracked_element_mismatch"}:{reason:"turbo_visit_control_is_reload"}}async prepareToRender(){await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}async mergeHead(){const t=this.mergeProvisionalElements(),e=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await t,await e}async replaceBody(){await this.preservingPermanentElements((async()=>{this.activateNewBody(),await this.assignNewBody()}))}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const t=[];for(const e of this.newHeadStylesheetElements)t.push(M(e)),document.head.appendChild(e);await Promise.all(t)}copyNewHeadScriptElements(){for(const t of this.newHeadScriptElements)document.head.appendChild(v(t))}async mergeProvisionalElements(){const t=[...this.newHeadProvisionalElements];for(const e of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(e,t)||document.head.removeChild(e);for(const e of t)document.head.appendChild(e)}isCurrentElementInElementList(t,e){for(const[i,s]of e.entries()){if("TITLE"==t.tagName){if("TITLE"!=s.tagName)continue;if(t.innerHTML==s.innerHTML)return e.splice(i,1),!0}if(s.isEqualNode(t))return e.splice(i,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const t of this.currentHeadProvisionalElements)document.head.removeChild(t)}copyNewHeadProvisionalElements(){for(const t of this.newHeadProvisionalElements)document.head.appendChild(t)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const t of this.newBodyScriptElements){const e=v(t);t.replaceWith(e)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}}class gt{constructor(t){this.keys=[],this.snapshots={},this.size=t}has(t){return g(t)in this.snapshots}get(t){if(this.has(t)){const e=this.read(t);return this.touch(t),e}}put(t,e){return this.write(t,e),this.touch(t),e}clear(){this.snapshots={}}read(t){return this.snapshots[g(t)]}write(t,e){this.snapshots[g(t)]=e}touch(t){const e=g(t),i=this.keys.indexOf(e);i>-1&&this.keys.splice(i,1),this.keys.unshift(e),this.trim()}trim(){for(const t of this.keys.splice(this.size))delete this.snapshots[t]}}class ft extends H{constructor(){super(...arguments),this.snapshotCache=new gt(10),this.lastRenderedLocation=new URL(location.href),this.forceReloaded=!1}renderPage(t,e=!1,i=!0,s){const r=new mt(this.snapshot,t,mt.renderElement,e,i);return r.shouldRender?null==s||s.changeHistory():this.forceReloaded=!0,this.render(r)}renderError(t,e){null==e||e.changeHistory();const i=new pt(this.snapshot,t,pt.renderElement,!1);return this.render(i)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(t=this.snapshot){if(t.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:e}=this;await new Promise((t=>setTimeout((()=>t()),0)));const i=t.clone();return this.snapshotCache.put(e,i),i}}getCachedSnapshotForLocation(t){return this.snapshotCache.get(t)}get snapshot(){return J.fromElement(this.element)}}class vt{constructor(t){this.selector="a[data-turbo-preload]",this.delegate=t}get snapshotCache(){return this.delegate.navigator.view.snapshotCache}start(){if("loading"===document.readyState)return document.addEventListener("DOMContentLoaded",(()=>{this.preloadOnLoadLinksForView(document.body)}));this.preloadOnLoadLinksForView(document.body)}preloadOnLoadLinksForView(t){for(const e of t.querySelectorAll(this.selector))this.preloadURL(e)}async preloadURL(t){const e=new URL(t.href);if(!this.snapshotCache.has(e))try{const t=await fetch(e.toString(),{headers:{"VND.PREFETCH":"true",Accept:"text/html"}}),i=await t.text(),s=J.fromHTMLString(i);this.snapshotCache.put(e,s)}catch(t){}}}function bt(t){Object.defineProperties(t,yt)}const yt={absoluteURL:{get(){return this.toString()}}},xt={after(){this.targetElements.forEach((t=>{var e;return null===(e=t.parentElement)||void 0===e?void 0:e.insertBefore(this.templateContent,t.nextSibling)}))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach((t=>t.append(this.templateContent)))},before(){this.targetElements.forEach((t=>{var e;return null===(e=t.parentElement)||void 0===e?void 0:e.insertBefore(this.templateContent,t)}))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach((t=>t.prepend(this.templateContent)))},remove(){this.targetElements.forEach((t=>t.remove()))},replace(){this.targetElements.forEach((t=>t.replaceWith(this.templateContent)))},update(){this.targetElements.forEach((t=>{t.innerHTML="",t.append(this.templateContent)}))}},wt=new class{constructor(){this.navigator=new ht(this),this.history=new at(this),this.preloader=new vt(this),this.view=new ft(this,document.documentElement),this.adapter=new rt(this),this.pageObserver=new lt(this),this.cacheObserver=new nt,this.linkClickObserver=new G(this,window),this.formSubmitObserver=new z(this,document),this.scrollObserver=new ct(this),this.streamObserver=new ut(this),this.formLinkClickObserver=new U(this,document.documentElement),this.frameRedirector=new ot(this,document.documentElement),this.streamMessageRenderer=new dt,this.drive=!0,this.enabled=!0,this.progressBarDelay=500,this.started=!1,this.formMode="on"}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.started=!1)}registerAdapter(t){this.adapter=t}visit(t,e={}){const i=e.frame?document.getElementById(e.frame):null;i instanceof l?(i.src=t.toString(),i.loaded):this.navigator.proposeVisit(c(t),e)}connectStreamSource(t){this.streamObserver.connectStreamSource(t)}disconnectStreamSource(t){this.streamObserver.disconnectStreamSource(t)}renderStreamMessage(t){this.streamMessageRenderer.render(I.wrap(t))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(t){this.progressBarDelay=t}setFormMode(t){this.formMode=t}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}historyPoppedToLocationWithRestorationIdentifier(t,e){this.enabled?this.navigator.startVisit(t,e,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(t){this.history.updateRestorationData({scrollPosition:t})}willSubmitFormLinkToLocation(t,e){return this.elementIsNavigatable(t)&&p(e,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}willFollowLinkToLocation(t,e,i){return this.elementIsNavigatable(t)&&p(e,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(t,e,i)}followedLinkToLocation(t,e){const i=this.getActionForLink(t),s=t.hasAttribute("data-turbo-stream");this.visit(e.href,{action:i,acceptsStreamResponse:s})}allowsVisitingLocationWithAction(t,e){return this.locationWithActionIsSamePage(t,e)||this.applicationAllowsVisitingLocation(t)}visitProposedToLocation(t,e){bt(t),this.adapter.visitProposedToLocation(t,e)}visitStarted(t){t.acceptsStreamResponse||k(document.documentElement),bt(t.location),t.silent||this.notifyApplicationAfterVisitingLocation(t.location,t.action)}visitCompleted(t){A(document.documentElement),this.notifyApplicationAfterPageLoad(t.getTimingMetrics())}locationWithActionIsSamePage(t,e){return this.navigator.locationWithActionIsSamePage(t,e)}visitScrolledToSamePageLocation(t,e){this.notifyApplicationAfterVisitingSamePageLocation(t,e)}willSubmitForm(t,e){const i=u(t,e);return this.submissionIsNavigatable(t,e)&&p(c(i),this.snapshot.rootLocation)}formSubmitted(t,e){this.navigator.submitForm(t,e)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(t){this.renderStreamMessage(t)}viewWillCacheSnapshot(){var t;(null===(t=this.navigator.currentVisit)||void 0===t?void 0:t.silent)||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:t},e){const i=this.notifyApplicationBeforeRender(t,e),{defaultPrevented:s,detail:{render:r}}=i;return this.view.renderer&&r&&(this.view.renderer.renderElement=r),!s}viewRenderedSnapshot(t,e){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}preloadOnLoadLinksForView(t){this.preloader.preloadOnLoadLinksForView(t)}viewInvalidated(t){this.adapter.pageInvalidated(t)}frameLoaded(t){this.notifyApplicationAfterFrameLoad(t)}frameRendered(t,e){this.notifyApplicationAfterFrameRender(t,e)}applicationAllowsFollowingLinkToLocation(t,e,i){return!this.notifyApplicationAfterClickingLinkToLocation(t,e,i).defaultPrevented}applicationAllowsVisitingLocation(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(t,e,i){return b("turbo:click",{target:t,detail:{url:e.href,originalEvent:i},cancelable:!0})}notifyApplicationBeforeVisitingLocation(t){return b("turbo:before-visit",{detail:{url:t.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(t,e){return b("turbo:visit",{detail:{url:t.href,action:e}})}notifyApplicationBeforeCachingSnapshot(){return b("turbo:before-cache")}notifyApplicationBeforeRender(t,e){return b("turbo:before-render",{detail:Object.assign({newBody:t},e),cancelable:!0})}notifyApplicationAfterRender(){return b("turbo:render")}notifyApplicationAfterPageLoad(t={}){return b("turbo:load",{detail:{url:this.location.href,timing:t}})}notifyApplicationAfterVisitingSamePageLocation(t,e){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:t.toString(),newURL:e.toString()}))}notifyApplicationAfterFrameLoad(t){return b("turbo:frame-load",{target:t})}notifyApplicationAfterFrameRender(t,e){return b("turbo:frame-render",{detail:{fetchResponse:t},target:e,cancelable:!0})}submissionIsNavigatable(t,e){if("off"==this.formMode)return!1;{const i=!e||this.elementIsNavigatable(e);return"optin"==this.formMode?i&&null!=t.closest('[data-turbo="true"]'):i&&this.elementIsNavigatable(t)}}elementIsNavigatable(t){const e=P(t,"[data-turbo]"),i=P(t,"turbo-frame");return this.drive||i?!e||"false"!=e.getAttribute("data-turbo"):!!e&&"true"==e.getAttribute("data-turbo")}getActionForLink(t){return T(t)||"advance"}get snapshot(){return this.view.snapshot}},St=new class{constructor(t){this.session=t}clear(){this.session.clearCache()}resetCacheControl(){this.setCacheControl("")}exemptPageFromCache(){this.setCacheControl("no-cache")}exemptPageFromPreview(){this.setCacheControl("no-preview")}setCacheControl(t){!function(t,e){let i=L(t);i||(i=document.createElement("meta"),i.setAttribute("name",t),document.head.appendChild(i)),i.setAttribute("content",e)}("turbo-cache-control",t)}}(wt),{navigator:Ct}=wt;function kt(){wt.start()}function At(t){wt.connectStreamSource(t)}function Mt(t){wt.disconnectStreamSource(t)}var Et=Object.freeze({__proto__:null,navigator:Ct,session:wt,cache:St,PageRenderer:mt,PageSnapshot:J,FrameRenderer:Y,start:kt,registerAdapter:function(t){wt.registerAdapter(t)},visit:function(t,e){wt.visit(t,e)},connectStreamSource:At,disconnectStreamSource:Mt,renderStreamMessage:function(t){wt.renderStreamMessage(t)},clearCache:function(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),wt.clearCache()},setProgressBarDelay:function(t){wt.setProgressBarDelay(t)},setConfirmMethod:function(t){B.confirmMethod=t},setFormMode:function(t){wt.setFormMode(t)},StreamActions:xt});class Tt extends Error{}function Lt(t){if(null!=t){const e=document.getElementById(t);if(e instanceof l)return e}}function Ot(t,e){if(t){const s=t.getAttribute("src");if(null!=s&&null!=e&&(i=e,c(s).href==c(i).href))throw new Error(`Matching element has a source URL which references itself`);if(t.ownerDocument!==document&&(t=document.importNode(t,!0)),t instanceof l)return t.connectedCallback(),t.disconnectedCallback(),t}var i}class Pt extends HTMLElement{static async renderElement(t){await t.performAction()}async connectedCallback(){try{await this.render()}catch(t){console.error(t)}finally{this.disconnect()}}async render(){var t;return null!==(t=this.renderPromise)&&void 0!==t?t:this.renderPromise=(async()=>{const t=this.beforeRenderEvent;this.dispatchEvent(t)&&(await y(),await t.detail.render(this))})()}disconnect(){try{this.remove()}catch(t){}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach((t=>t.remove()))}get duplicateChildren(){var t;const e=this.targetElements.flatMap((t=>[...t.children])).filter((t=>!!t.id)),i=[...(null===(t=this.templateContent)||void 0===t?void 0:t.children)||[]].filter((t=>!!t.id)).map((t=>t.id));return e.filter((t=>i.includes(t.id)))}get performAction(){if(this.action){const t=xt[this.action];if(t)return t;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElements(){return this.target?this.targetElementsById:this.targets?this.targetElementsByQuery:void this.raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(null===this.firstElementChild){const t=this.ownerDocument.createElement("template");return this.appendChild(t),t}if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("first child element must be a