@perses-dev/table-plugin 0.13.0 → 0.14.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/{Table.73b9cec1.js → Table.646f97de.js} +3 -3
- package/__mf/js/async/11.976870d0.js +7 -0
- package/__mf/js/async/11.976870d0.js.LICENSE.txt +102 -0
- package/__mf/js/async/121.b3a4c6cf.js +2 -0
- package/__mf/js/async/153.fa68a9e4.js +1 -0
- package/__mf/js/async/186.ab1e0cb3.js +2 -0
- package/__mf/js/async/192.942516a2.js +1 -0
- package/__mf/js/async/2.6b27d33f.js +1 -0
- package/__mf/js/async/235.c5bac291.js +1 -0
- package/__mf/js/async/274.f7dabfa6.js +2 -0
- package/__mf/js/async/321.96f362a6.js +1 -0
- package/__mf/js/async/35.ba7c1b06.js +1 -0
- package/__mf/js/async/356.d7fe5d24.js +1 -0
- package/__mf/js/async/392.e853a818.js +2 -0
- package/__mf/js/async/413.d44db4b1.js +1 -0
- package/__mf/js/async/465.8425c17a.js +1 -0
- package/__mf/js/async/470.21434f20.js +2 -0
- package/__mf/js/async/522.d6a7c203.js +22 -0
- package/__mf/js/async/534.aff242e9.js +1 -0
- package/__mf/js/async/54.e77ec040.js +1 -0
- package/__mf/js/async/587.0ff26337.js +1 -0
- package/__mf/js/async/616.4e891cf9.js +1 -0
- package/__mf/js/async/663.b3778d4c.js +1 -0
- package/__mf/js/async/700.ccacc909.js +3 -0
- package/__mf/js/async/{868.507e984c.js → 741.7feaa0ba.js} +6 -6
- package/__mf/js/async/862.4c658639.js +2 -0
- package/__mf/js/async/865.b9eb3de4.js +1 -0
- package/__mf/js/async/923.87e55609.js +1 -0
- package/__mf/js/async/941.08c16cb2.js +2 -0
- package/__mf/js/async/968.b7fe9818.js +1 -0
- package/__mf/js/async/985.6129a36c.js +37 -0
- package/__mf/js/async/__federation_expose_Table.f8d0feb7.js +1 -0
- package/__mf/js/async/lib-router.020a2a16.js +2 -0
- package/__mf/js/{main.7b15c841.js → main.276cd542.js} +2 -2
- package/lib/Table.d.ts +3 -3
- package/lib/Table.d.ts.map +1 -1
- package/lib/Table.js +4 -4
- package/lib/Table.js.map +1 -1
- package/lib/TableExportAction.d.ts +3 -3
- package/lib/TableExportAction.d.ts.map +1 -1
- package/lib/TableExportAction.js +6 -6
- package/lib/TableExportAction.js.map +1 -1
- package/lib/bootstrap.js +2 -2
- package/lib/components/CellsEditor/CellsEditor.d.ts +2 -2
- package/lib/components/CellsEditor/CellsEditor.d.ts.map +1 -1
- package/lib/components/CellsEditor/CellsEditor.js +1 -1
- package/lib/components/CellsEditor/CellsEditor.js.map +1 -1
- package/lib/components/CellsEditor/index.js +1 -1
- package/lib/components/CellsEditor/index.js.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditor.d.ts +5 -4
- package/lib/components/ColumnsEditor/ColumnEditor.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditor.js +29 -15
- package/lib/components/ColumnsEditor/ColumnEditor.js.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts +3 -3
- package/lib/components/ColumnsEditor/ColumnEditorContainer.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/ColumnEditorContainer.js +11 -10
- package/lib/components/ColumnsEditor/ColumnEditorContainer.js.map +1 -1
- package/lib/components/ColumnsEditor/ColumnsEditor.d.ts +4 -3
- package/lib/components/ColumnsEditor/ColumnsEditor.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/ColumnsEditor.js +7 -6
- package/lib/components/ColumnsEditor/ColumnsEditor.js.map +1 -1
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.d.ts +2 -2
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.js +4 -4
- package/lib/components/ColumnsEditor/DataLinkEditorDialog.js.map +1 -1
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts +2 -2
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.d.ts.map +1 -1
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +4 -4
- package/lib/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js.map +1 -1
- package/lib/components/ColumnsEditor/index.js +3 -3
- package/lib/components/ColumnsEditor/index.js.map +1 -1
- package/lib/components/ConditionalPanel.d.ts +3 -3
- package/lib/components/ConditionalPanel.d.ts.map +1 -1
- package/lib/components/ConditionalPanel.js +7 -7
- package/lib/components/ConditionalPanel.js.map +1 -1
- package/lib/components/EmbeddedPanel.d.ts +3 -3
- package/lib/components/EmbeddedPanel.d.ts.map +1 -1
- package/lib/components/EmbeddedPanel.js +4 -4
- package/lib/components/EmbeddedPanel.js.map +1 -1
- package/lib/components/TableCellsEditor.d.ts +3 -3
- package/lib/components/TableCellsEditor.d.ts.map +1 -1
- package/lib/components/TableCellsEditor.js +1 -1
- package/lib/components/TableCellsEditor.js.map +1 -1
- package/lib/components/TableColumnsEditor.d.ts +3 -3
- package/lib/components/TableColumnsEditor.d.ts.map +1 -1
- package/lib/components/TableColumnsEditor.js +3 -2
- package/lib/components/TableColumnsEditor.js.map +1 -1
- package/lib/components/TableItemSelectionActionsEditor.d.ts +2 -2
- package/lib/components/TableItemSelectionActionsEditor.d.ts.map +1 -1
- package/lib/components/TableItemSelectionActionsEditor.js +2 -2
- package/lib/components/TableItemSelectionActionsEditor.js.map +1 -1
- package/lib/components/TablePanel.d.ts +4 -4
- package/lib/components/TablePanel.d.ts.map +1 -1
- package/lib/components/TablePanel.js +196 -99
- package/lib/components/TablePanel.js.map +1 -1
- package/lib/components/TableSettingsEditor.d.ts +2 -2
- package/lib/components/TableSettingsEditor.d.ts.map +1 -1
- package/lib/components/TableSettingsEditor.js +16 -2
- package/lib/components/TableSettingsEditor.js.map +1 -1
- package/lib/components/TableTransformsEditor.d.ts +2 -2
- package/lib/components/TableTransformsEditor.d.ts.map +1 -1
- package/lib/components/TableTransformsEditor.js +2 -2
- package/lib/components/TableTransformsEditor.js.map +1 -1
- package/lib/components/index.js +9 -9
- package/lib/components/index.js.map +1 -1
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/models/index.js +2 -2
- package/lib/models/index.js.map +1 -1
- package/lib/models/model.d.ts +1 -1
- package/lib/models/model.d.ts.map +1 -1
- package/lib/models/model.js.map +1 -1
- package/lib/models/table-model.d.ts +4 -3
- package/lib/models/table-model.d.ts.map +1 -1
- package/lib/models/table-model.js +2 -2
- package/lib/models/table-model.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +8 -2
- package/lib/setup-tests.js.map +1 -1
- package/lib/table-data-utils.d.ts +3 -3
- package/lib/table-data-utils.d.ts.map +1 -1
- package/lib/table-data-utils.js.map +1 -1
- package/lib/test/mock-query-results.d.ts +1 -1
- package/lib/test/mock-query-results.d.ts.map +1 -1
- package/lib/test/mock-query-results.js.map +1 -1
- package/mf-manifest.json +42 -84
- package/mf-stats.json +46 -93
- package/package.json +11 -11
- package/__mf/js/async/1432.4e515509.js +0 -1
- package/__mf/js/async/1589.124ce93d.js +0 -2
- package/__mf/js/async/1589.124ce93d.js.LICENSE.txt +0 -37
- package/__mf/js/async/1616.4828085d.js +0 -1
- package/__mf/js/async/2043.1f09864b.js +0 -2
- package/__mf/js/async/2043.1f09864b.js.LICENSE.txt +0 -24
- package/__mf/js/async/2082.231e8397.js +0 -1
- package/__mf/js/async/2842.a52597e6.js +0 -1
- package/__mf/js/async/392.b6035b41.js +0 -2
- package/__mf/js/async/3981.52e94742.js +0 -3
- package/__mf/js/async/4014.cf88a118.js +0 -7
- package/__mf/js/async/4014.cf88a118.js.LICENSE.txt +0 -39
- package/__mf/js/async/4121.e7df36d6.js +0 -2
- package/__mf/js/async/5002.3eb39a8c.js +0 -1
- package/__mf/js/async/5021.c663603d.js +0 -1
- package/__mf/js/async/5071.839a8f1a.js +0 -1
- package/__mf/js/async/5481.6496fac9.js +0 -2
- package/__mf/js/async/5587.a8a428db.js +0 -1
- package/__mf/js/async/6274.8edae86d.js +0 -2
- package/__mf/js/async/629.8cff215d.js +0 -1
- package/__mf/js/async/6811.9d4b123a.js +0 -38
- package/__mf/js/async/7177.e0e5ba2f.js +0 -1
- package/__mf/js/async/7192.692181c8.js +0 -1
- package/__mf/js/async/7413.c9310b8a.js +0 -1
- package/__mf/js/async/7968.3a9a982e.js +0 -1
- package/__mf/js/async/7978.116e4d81.js +0 -1
- package/__mf/js/async/7984.a8edc213.js +0 -22
- package/__mf/js/async/8356.152d5686.js +0 -1
- package/__mf/js/async/8470.b9762117.js +0 -2
- package/__mf/js/async/873.264fedc9.js +0 -1
- package/__mf/js/async/9051.c4deebd7.js +0 -1
- package/__mf/js/async/9235.c67cdb1d.js +0 -1
- package/__mf/js/async/941.cc458a98.js +0 -2
- package/__mf/js/async/9588.d23e2ed3.js +0 -1
- package/__mf/js/async/9701.9c4cea02.js +0 -1
- package/__mf/js/async/__federation_expose_Table.5d0cfb46.js +0 -1
- package/__mf/js/async/lib-router.3493bbf9.js +0 -2
- package/lib/cjs/Table.js +0 -62
- package/lib/cjs/TableExportAction.js +0 -180
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/components/CellsEditor/CellsEditor.js +0 -30
- package/lib/cjs/components/CellsEditor/index.js +0 -30
- package/lib/cjs/components/ColumnsEditor/ColumnEditor.js +0 -289
- package/lib/cjs/components/ColumnsEditor/ColumnEditorContainer.js +0 -152
- package/lib/cjs/components/ColumnsEditor/ColumnsEditor.js +0 -108
- package/lib/cjs/components/ColumnsEditor/DataLinkEditorDialog.js +0 -139
- package/lib/cjs/components/ColumnsEditor/EmbeddedPanelOptionsEditor.js +0 -124
- package/lib/cjs/components/ColumnsEditor/index.js +0 -32
- package/lib/cjs/components/ConditionalPanel.js +0 -367
- package/lib/cjs/components/EmbeddedPanel.js +0 -52
- package/lib/cjs/components/TableCellsEditor.js +0 -36
- package/lib/cjs/components/TableColumnsEditor.js +0 -36
- package/lib/cjs/components/TableItemSelectionActionsEditor.js +0 -44
- package/lib/cjs/components/TablePanel.js +0 -845
- package/lib/cjs/components/TableSettingsEditor.js +0 -144
- package/lib/cjs/components/TableTransformsEditor.js +0 -36
- package/lib/cjs/components/index.js +0 -38
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -39
- package/lib/cjs/models/index.js +0 -31
- package/lib/cjs/models/model.js +0 -16
- package/lib/cjs/models/table-model.js +0 -278
- package/lib/cjs/setup-tests.js +0 -19
- package/lib/cjs/table-data-utils.js +0 -84
- package/lib/cjs/test/mock-query-results.js +0 -524
- /package/__mf/css/async/{4014.85c2cbf6.css → 11.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{4121.e7df36d6.js.LICENSE.txt → 121.b3a4c6cf.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.8edae86d.js.LICENSE.txt → 274.f7dabfa6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.b6035b41.js.LICENSE.txt → 392.e853a818.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.b9762117.js.LICENSE.txt → 470.21434f20.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{7984.a8edc213.js.LICENSE.txt → 522.d6a7c203.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{868.507e984c.js.LICENSE.txt → 741.7feaa0ba.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5481.6496fac9.js.LICENSE.txt → 862.4c658639.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.cc458a98.js.LICENSE.txt → 941.08c16cb2.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{lib-router.3493bbf9.js.LICENSE.txt → lib-router.020a2a16.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! For license information please see 11.976870d0.js.LICENSE.txt */
|
|
2
|
+
(self.chunk_Table_0_14_0_beta_1=self.chunk_Table_0_14_0_beta_1||[]).push([["11"],{70158(e,t,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindAll=void 0;var r=n(96844);function o(e){if(void 0!==e)return"boolean"==typeof e?{capture:e}:e}t.bindAll=function(e,t,n){var a=t.map(function(t){var a=null==n?t:i(i({},t),{options:i(i({},o(n)),o(t.options))});return(0,r.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}},96844(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bind=void 0,t.bind=function(e,t){var n=t.type,i=t.listener,r=t.options;return e.addEventListener(n,i,r),function(){e.removeEventListener(n,i,r)}}},96907(e,t,n){"use strict";t.bindAll=t.bind=void 0;var i=n(96844);Object.defineProperty(t,"bind",{enumerable:!0,get:function(){return i.bind}});var r=n(70158);Object.defineProperty(t,"bindAll",{enumerable:!0,get:function(){return r.bindAll}})},1416(e,t,n){e.exports=n(99138)(n(41433),"DataView")},42616(e,t,n){e.exports=n(99138)(n(41433),"Promise")},60157(e,t,n){e.exports=n(99138)(n(41433),"Set")},61527(e,t,n){var i=n(90369),r=n(79912),o=n(23767);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=o,e.exports=a},78499(e,t,n){e.exports=n(99138)(n(41433),"WeakMap")},61414(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o}},78740(e){e.exports=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}},57260(e){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}},74403(e,t,n){var i=n(78740),r=n(6397);e.exports=function(e,t,n){var o=t(e);return r(e)?o:i(o,n(e))}},22122(e,t,n){var i=n(42032),r=n(22934);e.exports=function e(t,n,o,a,s){return t===n||(null!=t&&null!=n&&(r(t)||r(n))?i(t,n,o,a,e,s):t!=t&&n!=n)}},42032(e,t,n){var i=n(86469),r=n(44075),o=n(64622),a=n(62677),s=n(31201),l=n(6397),u=n(30492),c=n(47995),h="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,v){var y=l(e),x=l(t),b=y?d:s(e),w=x?d:s(t);b=b==h?f:b,w=w==h?f:w;var S=b==f,_=w==f,C=b==w;if(C&&u(e)){if(!u(t))return!1;y=!0,S=!1}if(C&&!S)return v||(v=new i),y||c(e)?r(e,t,n,g,m,v):o(e,t,b,n,g,m,v);if(!(1&n)){var M=S&&p.call(e,"__wrapped__"),A=_&&p.call(t,"__wrapped__");if(M||A){var k=M?e.value():e,T=A?t.value():t;return v||(v=new i),m(k,T,n,g,v)}}return!!C&&(v||(v=new i),a(e,t,n,g,m,v))}},81452(e,t,n){var i=n(67499),r=n(9566),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!i(e))return r(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},68812(e,t,n){var i=n(62140),r=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(r,""):e}},79151(e){e.exports=function(e,t){return e.has(t)}},44075(e,t,n){var i=n(61527),r=n(57260),o=n(79151);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,h=t.length;if(c!=h&&!(u&&h>c))return!1;var d=l.get(e),f=l.get(t);if(d&&f)return d==t&&f==e;var p=-1,g=!0,m=2&n?new i:void 0;for(l.set(e,t),l.set(t,e);++p<c;){var v=e[p],y=t[p];if(a)var x=u?a(y,v,p,t,e,l):a(v,y,p,e,t,l);if(void 0!==x){if(x)continue;g=!1;break}if(m){if(!r(t,function(e,t){if(!o(m,t)&&(v===e||s(v,e,n,a,l)))return m.push(t)})){g=!1;break}}else if(!(v===y||s(v,y,n,a,l))){g=!1;break}}return l.delete(e),l.delete(t),g}},64622(e,t,n){var i=n(32781),r=n(28944),o=n(39316),a=n(44075),s=n(90953),l=n(15851),u=i?i.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,i,u,h,d){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!h(new r(e),new r(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=s;case"[object Set]":var p=1&i;if(f||(f=l),e.size!=t.size&&!p)break;var g=d.get(e);if(g)return g==t;i|=2,d.set(e,t);var m=a(f(e),f(t),i,u,h,d);return d.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},62677(e,t,n){var i=n(90966),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=i(e),c=u.length;if(c!=i(t).length&&!l)return!1;for(var h=c;h--;){var d=u[h];if(!(l?d in t:r.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=l;++h<c;){var v=e[d=u[h]],y=t[d];if(o)var x=l?o(y,v,d,t,e,s):o(v,y,d,e,t,s);if(!(void 0===x?v===y||a(v,y,n,o,s):x)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(e),s.delete(t),g}},90966(e,t,n){var i=n(74403),r=n(88876),o=n(31178);e.exports=function(e){return i(e,o,r)}},88876(e,t,n){var i=n(61414),r=n(53629),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;e.exports=a?function(e){return null==e?[]:i(a(e=Object(e)),function(t){return o.call(e,t)})}:r},31201(e,t,n){var i=n(1416),r=n(91955),o=n(42616),a=n(60157),s=n(78499),l=n(87148),u=n(81485),c="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",g=u(i),m=u(r),v=u(o),y=u(a),x=u(s),b=l;(i&&b(new i(new ArrayBuffer(1)))!=p||r&&b(new r)!=c||o&&b(o.resolve())!=h||a&&b(new a)!=d||s&&b(new s)!=f)&&(b=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,i=n?u(n):"";if(i)switch(i){case g:return p;case m:return c;case v:return h;case y:return d;case x:return f}return t}),e.exports=b},90953(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}},9566(e,t,n){e.exports=n(51019)(Object.keys,Object)},79912(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},23767(e){e.exports=function(e){return this.__data__.has(e)}},15851(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},62140(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},46177(e,t,n){var i=n(58953),r=n(43664),o=n(95378),a=Math.max,s=Math.min;e.exports=function(e,t,n){var l,u,c,h,d,f,p=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=l,i=u;return l=u=void 0,p=t,h=e.apply(i,n)}function x(e){var n=e-f,i=e-p;return void 0===f||n>=t||n<0||m&&i>=c}function b(){var e,n,i,o=r();if(x(o))return w(o);d=setTimeout(b,(e=o-f,n=o-p,i=t-e,m?s(i,c-n):i))}function w(e){return(d=void 0,v&&l)?y(e):(l=u=void 0,h)}function S(){var e,n=r(),i=x(n);if(l=arguments,u=this,f=n,i){if(void 0===d)return p=e=f,d=setTimeout(b,t),g?y(e):h;if(m)return clearTimeout(d),d=setTimeout(b,t),y(f)}return void 0===d&&(d=setTimeout(b,t)),h}return t=o(t)||0,i(n)&&(g=!!n.leading,c=(m="maxWait"in n)?a(o(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==d&&clearTimeout(d),p=0,l=f=u=d=void 0},S.flush=function(){return void 0===d?h:w(r())},S}},18264(e,t,n){var i=n(22122);e.exports=function(e,t){return i(e,t)}},75414(e,t,n){var i=n(87148),r=n(22934);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==i(e)}},31178(e,t,n){var i=n(31163),r=n(81452),o=n(18330);e.exports=function(e){return o(e)?i(e):r(e)}},43664(e,t,n){var i=n(41433);e.exports=function(){return i.Date.now()}},53629(e){e.exports=function(){return[]}},95378(e,t,n){var i=n(68812),r=n(58953),o=n(75414),a=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return a;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var n=l.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?a:+e}},24300(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z","Calendar")},29618(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Circle")},98029(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z","Delete")},53064(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z","Drag")},26684(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","Earth")},98599(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z","Magnify")},4491(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z","Pin")},16979(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z","UnfoldLessHorizontal")},9323(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z","UnfoldMoreHorizontal")},12933(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=(0,((i=n(1448))&&i.__esModule?i:{default:i}).default)("M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z","ViewColumn")},77440(e,t,n){!function(e,t){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(t);function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var r={error:null},o=function(e){function t(){for(var t,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))||this).state=r,t.resetErrorBoundary=function(){for(var e,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];null==t.props.onReset||(e=t.props).onReset.apply(e,i),t.reset()},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var o=t.prototype;return o.reset=function(){this.setState(r)},o.componentDidCatch=function(e,t){var n,i;null==(n=(i=this.props).onError)||n.call(i,e,t)},o.componentDidUpdate=function(e,t){var n,i,r,o,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(n=e.resetKeys)&&(n=[]),void 0===(i=s)&&(i=[]),n.length!==i.length||n.some(function(e,t){return!Object.is(e,i[t])}))&&(null==(r=(o=this.props).onResetKeysChange)||r.call(o,e.resetKeys,s),this.reset())},o.render=function(){var e=this.state.error,t=this.props,i=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof i)return i(a);if(r)return n.createElement(r,a);else throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(n.Component);e.ErrorBoundary=o,e.useErrorHandler=function(e){var t=n.useState(null),i=t[0],r=t[1];if(null!=e)throw e;if(null!=i)throw i;return r},e.withErrorBoundary=function(e,t){var i=function(i){return n.createElement(o,t,n.createElement(e,i))};return i.displayName="withErrorBoundary("+(e.displayName||e.name||"Unknown")+")",i},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(70451))},23420(e){function t(){}t.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var i=this;function r(){i.off(e,r),t.apply(n,arguments)}return r._=t,this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],r=[];if(i&&t)for(var o=0,a=i.length;o<a;o++)i[o].fn!==t&&i[o].fn._!==t&&r.push(i[o]);return r.length?n[e]=r:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t},42915(e){"use strict";var t;t=function(){function e(){return!0}function t(){return!1}function n(){}return function i(){var r=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],o={name:"any",test:e},a=[],s=[],l={types:r,conversions:s,ignore:a};function u(e){var t=N(l.types,function(t){return t.name===e});if(t)return t;if("any"===e)return o;var n=N(l.types,function(t){return t.name.toLowerCase()===e.toLowerCase()});throw TypeError('Unknown type "'+e+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function c(e){return e===o?999:l.types.indexOf(e)}function h(e){var t=N(l.types,function(t){return t.test(e)});if(t)return t.name;throw TypeError("Value has unknown type. Value: "+e)}function d(e){return e.map(function(e){var t=e.types.map(y);return(e.restParam?"...":"")+t.join("|")}).join(",")}function f(e){var t=E(e);return!!t&&t.restParam}function p(e){return e.types.some(function(e){return null!=e.conversion})}function g(t){if(!t||0===t.types.length)return e;if(1===t.types.length)return u(t.types[0].name).test;if(2===t.types.length){var n=u(t.types[0].name).test,i=u(t.types[1].name).test;return function(e){return n(e)||i(e)}}var r=t.types.map(function(e){return u(e.name).test});return function(e){for(var t=0;t<r.length;t++)if(r[t](e))return!0;return!1}}function m(e,t){return t<e.params.length?e.params[t]:f(e.params)?E(e.params):null}function v(e,t,n){var i=m(e,t);return(i?n?i.types.filter(x):i.types:[]).map(y)}function y(e){return e.name}function x(e){return null===e.conversion||void 0===e.conversion}function b(e,t){var n=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return Object.keys(t)}(B(e,function(e){return v(e,t,!1)}));return -1!==n.indexOf("any")?["any"]:n}function w(e,t,n){var i,r,o,a=e||"unnamed",s=n;for(o=0;o<t.length;o++){var l=s.filter(function(e){var n=g(m(e,o));return(o<e.params.length||f(e.params))&&n(t[o])});if(0===l.length){if((r=b(s,o)).length>0){var u=h(t[o]);return(i=TypeError("Unexpected type of argument in function "+a+" (expected: "+r.join(" or ")+", actual: "+u+", index: "+o+")")).data={category:"wrongType",fn:a,index:o,actual:u,expected:r},i}}else s=l}var c=s.map(function(e){return f(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return(i=TypeError("Too few arguments in function "+a+" (expected: "+(r=b(s,o)).join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:a,index:t.length,expected:r},i;var d=Math.max.apply(null,c);return t.length>d?(i=TypeError("Too many arguments in function "+a+" (expected: "+d+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:d}:(i=TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+a+".")).data={category:"mismatch",actual:t.map(h)},i}function S(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function _(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function C(e,t){var n,i,r=Math.min(e.params.length,t.params.length);if(0!=(i=e.params.some(p)-t.params.some(p)))return i;for(n=0;n<r;n++)if(0!=(i=p(e.params[n])-p(t.params[n])))return i;for(n=0;n<r;n++)if(0!==(i=function(e,t){var n;return 0!=(n=e.restParam-t.restParam)||0!=(n=p(e)-p(t))||0!=(n=S(e)-S(t))?n:_(e)-_(t)}(e.params[n],t.params[n])))return i;return e.params.length-t.params.length}function M(e){var t,n,i,r,o=[],a=[];switch(e.types.forEach(function(e){e.conversion&&(o.push(u(e.conversion.from).test),a.push(e.conversion.convert))}),a.length){case 0:return function(e){return e};case 1:return t=o[0],i=a[0],function(e){return t(e)?i(e):e};case 2:return t=o[0],n=o[1],i=a[0],r=a[1],function(e){return t(e)?i(e):n(e)?r(e):e};default:return function(e){for(var t=0;t<a.length;t++)if(o[t](e))return a[t](e);return e}}}function A(e,t){return function e(n,i,r){if(!(i<n.length))return[r.map(function(e,t){return{types:e,restParam:t===n.length-1&&f(n)}})];var o,a=n[i],s=t?a.types.filter(x):a.types;if(a.restParam){var l=s.filter(x);o=l.length<s.length?[l,s]:[s]}else o=s.map(function(e){return[e]});return B(o,function(t){return e(n,i+1,r.concat([t]))})}(e,0,[])}function k(e,i){if(0===Object.keys(i).length)throw SyntaxError("No signatures provided");var r,o=[];Object.keys(i).map(function(e){var t,n,r;return t=i[e],n=l.conversions,r=[],(""!==e.trim()&&(r=e.split(",").map(D).map(function(e,t,i){var r,o,a,s,l,h,d,f,p=(r=n,o=l=((s=0===e.indexOf("..."))?e.length>3?e.slice(3):"any":e).split("|").map(D).filter(O).filter(I),a={},r.forEach(function(e){-1!==o.indexOf(e.from)||-1===o.indexOf(e.to)||a[e.from]||(a[e.from]=e)}),h=Object.keys(a).map(function(e){return a[e]}),d=l.map(function(e){var t=u(e);return{name:e,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}}),f=h.map(function(e){var t=u(e.from);return{name:e.from,typeIndex:c(t),test:t.test,conversion:e,conversionIndex:n.indexOf(e)}}),{types:d.concat(f),restParam:s});if(p.restParam&&t!==i.length-1)throw SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return p})),r.some(R))?null:{params:r,fn:t}}).filter(P).forEach(function(e){var t=N(o,function(t){return function(e,t){for(var n=Math.max(e.params.length,t.params.length),i=0;i<n;i++)if(!function(e,t){for(var n,i=0;i<e.length;i++)if(n=e[i],-1!==t.indexOf(n))return!0;return!1}(v(e,i,!0),v(t,i,!0)))return!1;var r=e.params.length,o=t.params.length,a=f(e.params),s=f(t.params);return a?s?r===o:o>=r:s?r>=o:r===o}(t,e)});if(t)throw TypeError('Conflicting signatures "'+d(t.params)+'" and "'+d(e.params)+'".');o.push(e)});var a=B(o,function(e){return(e?A(e.params,!1):[]).map(function(t){return{params:t,fn:e.fn}})}).filter(P);a.sort(C);var s=a[0]&&a[0].params.length<=2&&!f(a[0].params),h=a[1]&&a[1].params.length<=2&&!f(a[1].params),m=a[2]&&a[2].params.length<=2&&!f(a[2].params),y=a[3]&&a[3].params.length<=2&&!f(a[3].params),x=a[4]&&a[4].params.length<=2&&!f(a[4].params),b=a[5]&&a[5].params.length<=2&&!f(a[5].params),w=a.map(function(e){return function(e){var t,n,i;if(f(e)){var r,o=(t=(r=e).slice(0,r.length-1).map(g)).length,a=g(E(e)),s=function(e){for(var t=o;t<e.length;t++)if(!a(e[t]))return!1;return!0};return function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return s(e)&&e.length>=o+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=g(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=g(e[0]),i=g(e[1]),function(e){return n(e[0])&&i(e[1])&&2===e.length}):(t=e.map(g),function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}(e.params)}),S=s?g(a[0].params[0]):t,_=h?g(a[1].params[0]):t,k=m?g(a[2].params[0]):t,T=y?g(a[3].params[0]):t,F=x?g(a[4].params[0]):t,z=b?g(a[5].params[0]):t,V=s?g(a[0].params[1]):t,j=h?g(a[1].params[1]):t,H=m?g(a[2].params[1]):t,W=y?g(a[3].params[1]):t,G=x?g(a[4].params[1]):t,$=b?g(a[5].params[1]):t,U=a.map(function(e){return function(e,t){var n=t;if(e.some(p)){var i=f(e),r=e.map(M);n=function(){for(var e=[],n=i?arguments.length-1:arguments.length,o=0;o<n;o++)e[o]=r[o](arguments[o]);return i&&(e[n]=arguments[n].map(r[n])),t.apply(this,e)}}var o=n;if(f(e)){var a=e.length-1;o=function(){return n.apply(this,L(arguments,0,a).concat([L(arguments,a)]))}}return o}(e.params,e.fn)}),q=s?U[0]:n,Y=h?U[1]:n,Z=m?U[2]:n,X=y?U[3]:n,K=x?U[4]:n,Q=b?U[5]:n,J=s?a[0].params.length:-1,ee=h?a[1].params.length:-1,et=m?a[2].params.length:-1,en=y?a[3].params.length:-1,ei=x?a[4].params.length:-1,er=b?a[5].params.length:-1,eo=6*!!(s&&h&&m&&y&&x&&b),ea=a.length,es=function(){for(var t=eo;t<ea;t++)if(w[t](arguments))return U[t].apply(this,arguments);return l.onMismatch(e,arguments,a)},el=function e(t,n){return arguments.length===J&&S(t)&&V(n)?q.apply(e,arguments):arguments.length===ee&&_(t)&&j(n)?Y.apply(e,arguments):arguments.length===et&&k(t)&&H(n)?Z.apply(e,arguments):arguments.length===en&&T(t)&&W(n)?X.apply(e,arguments):arguments.length===ei&&F(t)&&G(n)?K.apply(e,arguments):arguments.length===er&&z(t)&&$(n)?Q.apply(e,arguments):es.apply(e,arguments)};try{Object.defineProperty(el,"name",{value:e})}catch(e){}return r={},a.forEach(function(e){e.params.some(p)||A(e.params,!0).forEach(function(t){r[d(t)]=e.fn})}),el.signatures=r,el}function T(e,t,n){throw w(e,t,n)}function I(e){return -1===l.ignore.indexOf(e)}function D(e){return e.trim()}function O(e){return!!e}function P(e){return null!==e}function R(e){return 0===e.types.length}function E(e){return e[e.length-1]}function L(e,t,n){return Array.prototype.slice.call(e,t,n)}function N(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function B(e,t){return Array.prototype.concat.apply([],e.map(t))}function F(e){for(var t="",n=0;n<e.length;n++){var i=e[n];if(("object"==typeof i.signatures||"string"==typeof i.signature)&&""!==i.name){if(""===t)t=i.name;else if(t!==i.name){var r=Error("Function names do not match (expected: "+t+", actual: "+i.name+")");throw r.data={actual:i.name,expected:t},r}}}return t}function z(e){var t,n={};function i(e,i){if(n.hasOwnProperty(e)&&i!==n[e])throw(t=Error('Signature "'+e+'" is defined twice')).data={signature:e},t}for(var r=0;r<e.length;r++){var o=e[r];if("object"==typeof o.signatures)for(var a in o.signatures)o.signatures.hasOwnProperty(a)&&(i(a,o.signatures[a]),n[a]=o.signatures[a]);else if("string"==typeof o.signature)i(o.signature,o),n[o.signature]=o;else throw(t=TypeError("Function is no typed-function (index: "+r+")")).data={index:r},t}return n}return(l=k("typed",{"string, Object":k,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return k(F(t),e)},"...Function":function(e){return k(F(e),z(e))},"string, ...Function":function(e,t){return k(e,z(t))}})).create=i,l.types=r,l.conversions=s,l.ignore=a,l.onMismatch=T,l.throwMismatchError=T,l.createError=w,l.convert=function(e,t){var n=h(e);if(t===n)return e;for(var i=0;i<l.conversions.length;i++){var r=l.conversions[i];if(r.from===n&&r.to===t)return r.convert(e)}throw Error("Cannot convert from "+n+" to "+t)},l.find=function(e,t){if(!e.signatures)throw TypeError("Function is no typed-function");if("string"==typeof t){n=t.split(",");for(var n,i=0;i<n.length;i++)n[i]=n[i].trim()}else if(Array.isArray(t))n=t;else throw TypeError("String array or a comma separated string expected");var r=n.join(","),o=e.signatures[r];if(o)return o;throw TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+n.join(", ")+"))")},l.addType=function(e,t){if(!e||"string"!=typeof e.name||"function"!=typeof e.test)throw TypeError("Object with properties {name: string, test: function} expected");if(!1!==t){for(var n=0;n<l.types.length;n++)if("Object"===l.types[n].name)return void l.types.splice(n,0,e)}l.types.push(e)},l.addConversion=function(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw TypeError("Object with properties {from: string, to: string, convert: function} expected");l.conversions.push(e)},l}()},"function"==typeof define&&define.amd?define([],t):e.exports=t()},27627(e,t,n){"use strict";let i,r;n.r(t),n.d(t,{generateChartsTheme:()=>oi,DensitySelector:()=>gl,applyMergeIndexedColumnsTransform:()=>os,interpolateSelectionIndividual:()=>ot,DragButton:()=>mr,TimeRangeSelector:()=>eia,getFormatterStats:()=>nU,OptionsEditorGrid:()=>gn,TOOLTIP_MAX_HEIGHT:()=>eid,useMousePosition:()=>ei_,TextOverlay:()=>Ku,isValidLegendSize:()=>nz,isValidLegendMode:()=>nF,isDateUnit:()=>rr,parseVariables:()=>rM,UnitSelector:()=>ei0,PERCENT_UNIT_CONFIG:()=>iz,RepeatGrid:()=>er_,PERCENT_GROUP_CONFIG:()=>iB,YAxisLabel:()=>ei5,replaceVariablesForDisplay:()=>rT,TOOLTIP_MIN_WIDTH:()=>eic,useId:()=>rx,getTitleAction:()=>nP,getYBuffer:()=>eiG,PINNED_CROSSHAIR_SERIES_NAME:()=>nA,getPixelXFromGrid:()=>eiP,getFormattedAxisLabel:()=>r2,clearHighlightedSeries:()=>rd,FALLBACK_CHART_WIDTH:()=>eim,restoreChart:()=>rh,FormatControls:()=>ei2,transformData:()=>ou,getTimeSeriesValues:()=>l4,DEFAULT_LEGEND:()=>nV,OptionsEditorControl:()=>gt,formatDecimal:()=>iq,DiscardChangesConfirmationDialog:()=>p1,formatTime:()=>n2,SelectionProvider:()=>th,TimeChartTooltip:()=>eiX,legendModes:()=>nL,EMPTY_TOOLTIP_DATA:()=>eiS,isThroughputUnit:()=>rn,applyJoinTransform:()=>oo,TextField:()=>pP,SeriesInfo:()=>eik,getClosestTimestamp:()=>rm,DropIndicator:()=>gu,applyMergeColumnsTransform:()=>oa,isTemperatureUnit:()=>ro,limitDecimalPlaces:()=>nZ,useSnackbar:()=>n_,dateFormatOptionsWithTimeZone:()=>rJ,calculateBarYBounds:()=>eiN,DEFAULT_COLUMN_HEIGHT:()=>40,parseVariablesAndFormat:()=>rA,getCommonTimeScale:()=>l6,isBytesUnit:()=>i9,ModeSelector:()=>Ks,OptionsEditorColumn:()=>p5,DECIMAL_UNIT_CONFIG:()=>iU,DEFAULT_PINNED_CROSSHAIR:()=>nk,TEMPERATURE_GROUP_CONFIG:()=>iH,NoDataOverlay:()=>Kc,getResourceExtendedDisplayName:()=>l7,InterpolationFormat:()=>rb,ErrorBoundary:()=>FV.ErrorBoundary,hasDataFieldPatterns:()=>rV,CURRENCY_UNIT_CONFIG:()=>iL,ToolbarIconButton:()=>eiQ,DEFAULT_TOOLTIP_CONFIG:()=>eiC,TRANSFORM_TEXT:()=>ra,calculateBarBandwidth:()=>eiE,ItemActionsProvider:()=>to,isWithinPercentageRange:()=>eiW,OPTIMIZED_MODE_SERIES_LIMIT:()=>1e3,legendPositions:()=>nE,TIME_GROUP_CONFIG:()=>nK,defaultCursorData:()=>eiw,createTimezoneAwareAxisFormatter:()=>FB,RefreshIntervalPicker:()=>erS,legendSizes:()=>nN,BITS_GROUP_CONFIG:()=>iA,TOOLTIP_LABELS_MAX_WIDTH:()=>eif,applyValueMapping:()=>or,UNIT_GROUP_CONFIG:()=>iJ,batchDispatchNearbySeriesActions:()=>rp,DEFAULT_COLUMN_WIDTH:()=>150,getGMTOffset:()=>r1,getPointInGrid:()=>rf,InfoTooltip:()=>p9,AlignSelector:()=>e_,JSONEditor:()=>Ki,CURRENCY_GROUP_CONFIG:()=>iE,TooltipHeader:()=>eiZ,SeriesMarker:()=>eil,FontSizeSelector:()=>FH,THROUGHPUT_UNIT_CONFIG:()=>iX,DEFAULT_COLUMN_MAX_WIDTH:()=>1e3,TOOLTIP_PADDING:()=>eig,TimeZoneContext:()=>ue,TimeZoneProvider:()=>ut,useDeepMemo:()=>r6,TransformsEditor:()=>erw,combineSx:()=>ry,getFormatterFromCache:()=>n$,applyMergeSeriesTransform:()=>ol,Legend:()=>p$,Dialog:()=>p0,getFormattedMultipleYAxes:()=>rl,replaceVariables:()=>rk,DECIMAL_GROUP_CONFIG:()=>i$,getResourceDisplayName:()=>l9,SnackbarProvider:()=>nS,formatBytes:()=>iO,getUnitConfig:()=>i2,LoadingOverlay:()=>Kh,formatWithTimeZone:()=>r0,legacyCheckforNearbySeries:()=>eij,replaceVariable:()=>r_,UNIT_CONFIG:()=>i0,testChartsTheme:()=>ei4,TOOLTIP_ADJUST_Y_POS_MULTIPLIER:()=>eip,interpolate:()=>rS,THROUGHPUT_GROUP_CONFIG:()=>iY,BYTES_UNIT_CONFIG:()=>iD,useChartsTheme:()=>ti,calculateBarSegmentBounds:()=>eiL,checkCrosshairPinnedStatus:()=>rg,mockChartsContext:()=>ei6,checkforNearbyTimeSeries:()=>eiV,TOOLTIP_DATE_FORMAT:()=>eib,hasDecimalPlaces:()=>nY,isCurrencyUnit:()=>ri,DEFAULT_COLUMN_MIN_WIDTH:()=>60,handleMoveUp:()=>mn,ContentWithLegend:()=>pq,OptionsEditorGroup:()=>gi,isUnitWithDecimalPlaces:()=>re,SeriesLabelsStack:()=>eiu,getDateAndTime:()=>r5,getTableCellLayout:()=>f_,ChartsThemeContext:()=>tt,TooltipContent:()=>ei$,isValidTraceId:()=>l8,formatCurrency:()=>iN,ValueMappingsEditor:()=>erk,BYTES_GROUP_CONFIG:()=>iI,interpolateSelectionBatch:()=>on,isLegendItemVisuallySelected:()=>ul,getFormattedAxis:()=>rs,getClosestTimestampInFullDataset:()=>rv,ChartsProvider:()=>te,TimeZoneSelector:()=>eis,LinkEditorForm:()=>Ko,SortSelector:()=>Kf,formatValue:()=>i1,persesColumnsToTanstackColumns:()=>fC,NEARBY_SERIES_DESCRIPTION:()=>eiv,calculateVisualYForSeries:()=>eiR,hasIndexedPatterns:()=>rz,ColorPicker:()=>e6,useItemActions:()=>tl,getUnitGroup:()=>i5,formatThroughput:()=>iK,getTheme:()=>erc,shouldShortenValues:()=>nq,MIN_STEP_INTERVAL_MS:()=>l3,buildRelativeTimeOption:()=>nD,useSelection:()=>tp,TEMPERATURE_UNIT_CONFIG:()=>iW,SortSelectorButtons:()=>Kp,formatBits:()=>iT,getTimeZoneOptions:()=>nO,DYNAMIC_NEARBY_SERIES_MULTIPLIER:()=>eiF,isUnitWithShortValues:()=>rt,getTooltipStyles:()=>eiO,interpolateHeaders:()=>r7,ErrorAlert:()=>Fz,OptionsColorPicker:()=>ui,getUnitGroupConfig:()=>i3,TOOLTIP_BG_COLOR_FALLBACK:()=>eix,TOOLTIP_MAX_WIDTH:()=>eih,DragAndDropElement:()=>me,extractFieldNames:()=>rj,isBitsUnit:()=>i7,SHOW_FEWER_SERIES_LIMIT:()=>eiz,TIME_UNIT_CONFIG:()=>nQ,INCREASE_NEARBY_SERIES_MULTIPLIER:()=>eiB,isPercentUnit:()=>i6,getLegendSize:()=>nW,getSubmitText:()=>nR,handleMoveDown:()=>mi,PIN_TOOLTIP_HELP_TEXT:()=>eiM,Table:()=>pV,typography:()=>erl,formatPercent:()=>iV,assembleTransform:()=>eiD,formatTemperature:()=>iG,useTimeZone:()=>un,createRegexFromString:()=>r9,hasBatchPatterns:()=>rF,PersesTimeToIntlTime:()=>nJ,parseFormat:()=>rL,FormActions:()=>FW,getNearbySeriesData:()=>eiH,useMemoized:()=>r4,isValidLegendPosition:()=>nB,getLegendMode:()=>nH,EMPHASIZED_SERIES_DESCRIPTION:()=>eiy,replaceDataFields:()=>rN,Drawer:()=>m_,getLegendPosition:()=>nj,BITS_UNIT_CONFIG:()=>ik,EChart:()=>FL,isTimeUnit:()=>i4,useChartsContext:()=>tn,interpolateQueryParams:()=>oe,UNPIN_TOOLTIP_HELP_TEXT:()=>eiA,DateTimeRangePicker:()=>eio,SettingsAutocomplete:()=>ga,ThresholdsEditor:()=>Kw,isDecimalUnit:()=>i8,enableDataZoom:()=>rc,replaceDataFieldsBatch:()=>rB,useDragAndDropMonitor:()=>g7,useLocalStorage:()=>ru,isRegexPattern:()=>r8});var o,a,s,l,u,c,h,d,f,p,g,m,v,y,x,b,w,S,_,C,M,A,k,T,I,D,O,P,R,E,L,N,B,F,z,V,j,H,W,G,$,U,q,Y,Z,X,K,Q,J,ee,et,en,ei,er,eo,ea,es,el,eu,ec,eh,ed,ef,ep,eg,em,ev,ey,ex={};n.r(ex),n.d(ex,{Arc:()=>AR,BezierCurve:()=>AD,BoundingRect:()=>xd,Circle:()=>M3,CompoundPath:()=>AE,Ellipse:()=>M8,Group:()=>MF,Image:()=>wU,IncrementalDisplayable:()=>AG,Line:()=>AM,LinearGradient:()=>AN,OrientedBoundingRect:()=>AH,Path:()=>wV,Point:()=>xi,Polygon:()=>Ay,Polyline:()=>Aw,RadialGradient:()=>AB,Rect:()=>w0,Ring:()=>Ap,Sector:()=>Ah,Text:()=>Sr,applyTransform:()=>A9,clipPointsByRect:()=>kt,clipRectByRect:()=>kn,createIcon:()=>ki,extendPath:()=>AX,extendShape:()=>AY,getShapeClass:()=>AQ,getTransform:()=>A8,groupTransition:()=>ke,initProps:()=>SJ,isElementRemoved:()=>S0,lineLineIntersect:()=>ko,linePolygonIntersect:()=>kr,makeImage:()=>A0,makePath:()=>AJ,mergePath:()=>A2,registerShape:()=>AK,removeElement:()=>S1,removeElementWithFadeOut:()=>S5,resizePath:()=>A5,setTooltipConfig:()=>ka,subPixelOptimize:()=>A6,subPixelOptimizeLine:()=>A3,subPixelOptimizeRect:()=>A4,transformDirection:()=>A7,traverseElements:()=>kl,updateProps:()=>SQ});var eb=n(62540),ew=n(12138),eS=n(7013);function e_({onChange:e,value:t="left",...n}){let i=t=>{e(t)};return(0,eb.jsxs)(ew.A,{"aria-label":"Alignement",...n,children:[(0,eb.jsx)(eS.A,{onClick:()=>i("left"),variant:"left"===t?"contained":"outlined",children:"Left"},"left"),(0,eb.jsx)(eS.A,{onClick:()=>i("center"),variant:"center"===t?"contained":"outlined",children:"Center"},"center"),(0,eb.jsx)(eS.A,{onClick:()=>i("right"),variant:"right"===t?"contained":"outlined",children:"Right"},"right")]})}var eC=n(315),eM=n(47095),eA=n(93648),ek=n(29618),eT=n(98029),eI=n(70451),eD=n.n(eI);function eO(){return(eO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function eP(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(n=o[i])>=0||(r[n]=e[n]);return r}function eR(e){var t=(0,eI.useRef)(e),n=(0,eI.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var eE,eL=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},eN=function(e){return"touches"in e},eB=function(e){return e&&e.ownerDocument.defaultView||self},eF=function(e,t,n){var i=e.getBoundingClientRect(),r=eN(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:eL((r.pageX-(i.left+eB(e).pageXOffset))/i.width),top:eL((r.pageY-(i.top+eB(e).pageYOffset))/i.height)}},ez=function(e){eN(e)||e.preventDefault()},eV=eD().memo(function(e){var t=e.onMove,n=e.onKey,i=e.onEnd,r=eP(e,["onMove","onKey","onEnd"]),o=(0,eI.useRef)(null),a=eR(t),s=eR(n),l=eR(i),u=(0,eI.useRef)(null),c=(0,eI.useRef)(!1),h=(0,eI.useMemo)(function(){var e=function(e){ez(e),(eN(e)?e.touches.length>0:e.buttons>0)&&o.current?a(eF(o.current,e,u.current)):(n(!1),l())},t=function(){n(!1),l()};function n(n){var i=c.current,r=eB(o.current),a=n?r.addEventListener:r.removeEventListener;a(i?"touchmove":"mousemove",e),a(i?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,i=o.current;if(i&&(ez(t),(!c.current||eN(t))&&i)){if(eN(t)){c.current=!0;var r=t.changedTouches||[];r.length&&(u.current=r[0].identifier)}i.focus(),a(eF(i,t,u.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&l()},n]},[s,a,l]),d=h[0],f=h[1],p=h[2],g=h[3];return(0,eI.useEffect)(function(){return g},[g]),eD().createElement("div",eO({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:f,onKeyUp:p,tabIndex:0,role:"slider"}))}),ej=function(e){return e.filter(Boolean).join(" ")},eH=function(e){var t=e.color,n=e.left,i=e.top,r=ej(["react-colorful__pointer",e.className]);return eD().createElement("div",{className:r,style:{top:100*(void 0===i?.5:i)+"%",left:100*n+"%"}},eD().createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},eW=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},eG=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?eW(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?eW(parseInt(e.substring(6,8),16)/255,2):1}},e$=function(e){var t=e.s,n=e.v,i=e.a,r=(200-t)*n/100;return{h:eW(e.h),s:eW(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:eW(r/2),a:eW(i,2)}},eU=function(e){var t=e$(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},eq=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),a=i*(1-n),s=i*(1-(t-o)*n),l=i*(1-(1-t+o)*n),u=o%6;return{r:eW(255*[i,s,a,a,l,i][u]),g:eW(255*[l,i,i,s,a,a][u]),b:eW(255*[a,a,l,i,i,s][u]),a:eW(r,2)}},eY=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},eZ=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=r<1?eY(eW(255*r)):"";return"#"+eY(t)+eY(n)+eY(i)+o},eX=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),a=o-Math.min(t,n,i),s=a?o===t?(n-i)/a:o===n?2+(i-t)/a:4+(t-n)/a:0;return{h:eW(60*(s<0?s+6:s)),s:eW(o?a/o*100:0),v:eW(o/255*100),a:r}},eK=eD().memo(function(e){var t=e.hue,n=e.onChange,i=e.onChangeEnd,r=ej(["react-colorful__hue",e.className]);return eD().createElement("div",{className:r},eD().createElement(eV,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:eL(t+360*e.left,0,360)})},onEnd:i,"aria-label":"Hue","aria-valuenow":eW(t),"aria-valuemax":"360","aria-valuemin":"0"},eD().createElement(eH,{className:"react-colorful__hue-pointer",left:t/360,color:eU({h:t,s:100,v:100,a:1})})))}),eQ=eD().memo(function(e){var t=e.hsva,n=e.onChange,i=e.onChangeEnd,r={backgroundColor:eU({h:t.h,s:100,v:100,a:1})};return eD().createElement("div",{className:"react-colorful__saturation",style:r},eD().createElement(eV,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:eL(t.s+100*e.left,0,100),v:eL(t.v-100*e.top,0,100)})},onEnd:i,"aria-label":"Color","aria-valuetext":"Saturation "+eW(t.s)+"%, Brightness "+eW(t.v)+"%"},eD().createElement(eH,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:eU(t)})))}),eJ=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},e0="u">typeof window?eI.useLayoutEffect:eI.useEffect,e1=new Map,e2=function(e){e0(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!e1.has(t)){var i=t.createElement("style");i.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',e1.set(t,i);var r=eE||n.nc;r&&i.setAttribute("nonce",r),t.head.appendChild(i)}},[])},e5=function(e){var t,n,i,r,o,a,s,l=e.className,u=e.colorModel,c=e.color,h=void 0===c?u.defaultColor:c,d=e.onChange,f=e.onChangeEnd,p=eP(e,["className","colorModel","color","onChange","onChangeEnd"]),g=(0,eI.useRef)(null);e2(g);var m=(t=eR(d),n=eR(f),r=(i=(0,eI.useState)(function(){return u.toHsva(h)}))[0],o=i[1],a=(0,eI.useRef)({color:h,hsva:r}),s=(0,eI.useRef)(!1),(0,eI.useEffect)(function(){if(!u.equal(h,a.current.color)){var e=u.toHsva(h);a.current={hsva:e,color:h},o(e),s.current=!1}},[h,u]),(0,eI.useEffect)(function(){var e;eJ(r,a.current.hsva)||u.equal(e=u.fromHsva(r),a.current.color)||(a.current={hsva:r,color:e},t(e),s.current=!0)},[r,u,t]),[r,(0,eI.useCallback)(function(e){o(function(t){return Object.assign({},t,e)})},[]),(0,eI.useCallback)(function(){s.current&&(s.current=!1,n(a.current.color))},[n])]),v=m[0],y=m[1],x=m[2],b=ej(["react-colorful",l]);return eD().createElement("div",eO({},p,{ref:g,className:b}),eD().createElement(eQ,{hsva:v,onChange:y,onChangeEnd:x}),eD().createElement(eK,{hue:v.h,onChange:y,onChangeEnd:x,className:"react-colorful__last-control"}))},e3={defaultColor:"000",toHsva:function(e){return eX(eG(e))},fromHsva:function(e){return eZ(eq({h:e.h,s:e.s,v:e.v,a:1}))},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||eJ(eG(e),eG(t))}},e4=function(e){return eD().createElement(e5,eO({},e,{colorModel:e3}))};let e6=({color:e,onChange:t,onClear:n,palette:i})=>{let[r,o]=(0,eI.useState)(e),a=e=>{o(e),t?.(e)};return(0,eb.jsxs)(eC.A,{spacing:1,children:[(0,eb.jsx)(e4,{color:e,onChange:a,style:{width:"100%"}}),(0,eb.jsx)(eC.A,{direction:"row",flexWrap:"wrap",justifyContent:"space-evenly",width:"200px",children:i&&i.map((e,t)=>(0,eb.jsx)(eM.A,{size:"small","aria-label":`change color to ${e}`,sx:{color:e},onClick:()=>a(e),children:(0,eb.jsx)(ek,{})},t))}),(0,eb.jsxs)(eC.A,{direction:"row",gap:1,alignItems:"center",children:[(0,eb.jsx)(eA.A,{inputProps:{"aria-label":"enter hex color"},fullWidth:!0,value:r,onChange:e=>{let n=e.target.value.replace(/([^0-9A-F]+)/gi,"").substring(0,8);o(`#${n}`),e8(e.target.value)&&t?.(e.target.value)}}),n&&(0,eb.jsx)(eM.A,{onClick:n,children:(0,eb.jsx)(eT,{})})]})]})},e8=(e,t)=>{let n=/^#?([0-9A-F]{3,8})$/i.exec(e),i=n&&n[1]?n[1].length:0;return 3===i||6===i||!!t&&4===i||!!t&&8===i};var e9=n(91823),e7=n(77308);function te(e){let{children:t,chartsTheme:n,enablePinning:i=!1,enableSyncGrouping:r=!0}=e,[o,a]=(0,eI.useState)(null),s=(0,eI.useMemo)(()=>({chartsTheme:n,enablePinning:i,lastTooltipPinnedCoords:o,enableSyncGrouping:r,setLastTooltipPinnedCoords:a}),[n,i,r,o,a]);return(0,eb.jsx)(tt.Provider,{value:s,children:t})}let tt=(0,eI.createContext)(void 0);function tn(){let e=(0,eI.useContext)(tt);if(void 0===e)throw Error("No ChartsThemeContext found. Did you forget a Provider?");return e}function ti(){return tn().chartsTheme}let tr=(0,eI.createContext)(void 0);function to({children:e}){let[t,n]=(0,eI.useState)(new Map),i=(0,eI.useCallback)((e,t,i)=>{n(n=>{let r=new Map(n),o=r.get(e)||{loading:!1};if(void 0!==i){let n=new Map(o.itemStatuses||new Map),a=n.get(i)||{loading:!1};n.set(i,{...a,...t}),r.set(e,{...o,itemStatuses:n})}else r.set(e,{...o,...t});return r})},[]),r=(0,eI.useCallback)(e=>{n(t=>{if(void 0===e)return new Map;if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),o=(0,eI.useMemo)(()=>({actionStatuses:t,setActionStatus:i,clearActionStatus:r}),[t,i,r]);return(0,eb.jsx)(tr.Provider,{value:o,children:e})}let ta=()=>{},ts={actionStatuses:new Map,setActionStatus:ta,clearActionStatus:ta,hasContext:!1};function tl(){let e=(0,eI.useContext)(tr);return(0,eI.useMemo)(()=>e?{...e,hasContext:!0}:ts,[e])}let tu=(0,eI.createContext)(void 0),tc=(e,t)=>t;function th({children:e}){let[t,n]=(0,eI.useState)(new Map),i=(0,eI.useRef)(tc),r=(0,eI.useCallback)(e=>{i.current=e},[]),o=(0,eI.useCallback)(e=>{let t=new Map;e.forEach(({item:e,id:n})=>t.set(n,e)),n(t)},[]),a=(0,eI.useCallback)((e,t)=>{n(n=>{let i=new Map(n);return i.has(t)?i.delete(t):i.set(t,e),i})},[]),s=(0,eI.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),l=(0,eI.useCallback)(()=>n(new Map),[]),u=(0,eI.useCallback)((e,n)=>t.has(i.current(e,n)),[t]),c=(0,eI.useMemo)(()=>({selectionMap:t,setSelection:o,toggleSelection:a,removeFromSelection:s,clearSelection:l,isSelected:u,registerGetId:r}),[t,o,a,s,l,u,r]);return(0,eb.jsx)(tu.Provider,{value:c,children:e})}let td=()=>{},tf={selectionMap:new Map,setSelection:td,toggleSelection:td,removeFromSelection:td,clearSelection:td,isSelected:()=>!1,hasContext:!1};function tp(e){let t=(0,eI.useContext)(tu);return(0,eI.useEffect)(()=>{t&&e?.getId&&t.registerGetId(e.getId)},[t,e?.getId]),(0,eI.useMemo)(()=>{if(!t)return tf;let{registerGetId:e,...n}=t;return{...n,hasContext:!0}},[t])}var tg=n(20231),tm=n.n(tg);let tv=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(i=e(t[n]))&&(r&&(r+=" "),r+=i);else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}(e))&&(i&&(i+=" "),i+=t);return i},ty={data:""},tx=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,tb=/\/\*[^]*?\*\/| +/g,tw=/\n+/g,tS=(e,t)=>{let n="",i="",r="";for(let o in e){let a=e[o];"@"==o[0]?"i"==o[1]?n=o+" "+a+";":i+="f"==o[1]?tS(a,o):o+"{"+tS(a,"k"==o[1]?"":t)+"}":"object"==typeof a?i+=tS(a,t?t.replace(/([^,])+/g,e=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=a&&(o="-"==o[1]?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=tS.p?tS.p(o,a):o+":"+a+";")}return n+(t&&r?t+"{"+r+"}":r)+i},t_={},tC=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+tC(e[n]);return t}return e};function tM(e){let t,n,i=this||{},r=e.call?e(i.p):e;return((e,t,n,i,r)=>{var o;let a=tC(e),s=t_[a]||(t_[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(a));if(!t_[s]){let t=a!==e?e:(e=>{let t,n,i=[{}];for(;t=tx.exec(e.replace(tb,""));)t[4]?i.shift():t[3]?(n=t[3].replace(tw," ").trim(),i.unshift(i[0][n]=i[0][n]||{})):i[0][t[1]]=t[2].replace(tw," ").trim();return i[0]})(e);t_[s]=tS(r?{["@keyframes "+s]:t}:t,n?"":"."+s)}let l=n&&t_.g;return n&&(t_.g=t_[s]),o=t_[s],l?t.data=t.data.replace(l,o):-1===t.data.indexOf(o)&&(t.data=i?o+t.data:t.data+o),s})(r.unshift?r.raw?(t=[].slice.call(arguments,1),n=i.p,r.reduce((e,i,r)=>{let o=t[r];if(o&&o.call){let e=o(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":tS(e,""):!1===e?"":e}return e+i+(null==o?"":o)},"")):r.reduce((e,t)=>Object.assign(e,t&&t.call?t(i.p):t),{}):r,(e=>{if("object"==typeof window){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||ty})(i.target),i.g,i.o,i.k)}function tA(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function tk(e,t,n){return t&&tA(e.prototype,t),n&&tA(e,n),e}function tT(){return(tT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function tI(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function tD(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}function tO(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}tM.bind({g:1}),tM.bind({k:1});var tP=function(){return""},tR=eD().createContext({enqueueSnackbar:tP,closeSnackbar:tP}),tE="@media (max-width:599.95px)",tL="@media (min-width:600px)",tN=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},tB=function(e){return""+tN(e.vertical)+tN(e.horizontal)},tF=function(e){return!!e||0===e},tz="unmounted",tV="exited",tj="entering",tH="entered",tW="exiting",tG=function(e){function t(t){var n,i=e.call(this,t)||this,r=t.appear;return i.appearStatus=null,t.in?r?(n=tV,i.appearStatus=tj):n=tH:n=t.unmountOnExit||t.mountOnEnter?tz:tV,i.state={status:n},i.nextCallback=null,i}tI(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===tz?{status:tV}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==tj&&n!==tH&&(t=tj):(n===tj||n===tH)&&(t=tW)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return null!=e&&"number"!=typeof e&&"string"!=typeof e&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===tj?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===tV&&this.setState({status:tz})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.getTimeouts();e||n?(this.props.onEnter&&this.props.onEnter(this.node,e),this.safeSetState({status:tj},function(){t.props.onEntering&&t.props.onEntering(t.node,e),t.onTransitionEnd(i.enter,function(){t.safeSetState({status:tH},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})})})):this.safeSetState({status:tH},function(){t.props.onEntered&&t.props.onEntered(t.node,e)})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();t?(this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:tW},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:tV},function(){e.props.onExited&&e.props.onExited(e.node)})})})):this.safeSetState({status:tV},function(){e.props.onExited&&e.props.onExited(e.node)})},n.cancelNextCallback=function(){null!==this.nextCallback&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=null==e&&!this.props.addEndListener;!this.node||n?setTimeout(this.nextCallback,0):(this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e))},n.render=function(){var e=this.state.status;if(e===tz)return null;var t=this.props;return(0,t.children)(e,tD(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]))},tk(t,[{key:"node",get:function(){var e,t=null==(e=this.props.nodeRef)?void 0:e.current;if(!t)throw Error("notistack - Custom snackbar is not refForwarding");return t}}]),t}(eD().Component);function t$(){}function tU(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function tq(e,t){return(0,eI.useMemo)(function(){return null==e&&null==t?null:function(n){tU(e,n),tU(t,n)}},[e,t])}function tY(e){var t=e.timeout,n=e.style,i=void 0===n?{}:n,r=e.mode;return{duration:"object"==typeof t?t[r]||0:t,easing:i.transitionTimingFunction,delay:i.transitionDelay}}tG.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:t$,onEntering:t$,onEntered:t$,onExit:t$,onExiting:t$,onExited:t$};var tZ=function(e){e.scrollTop=e.scrollTop},tX=function(e){return Math.round(e)+"ms"};function tK(e,t){void 0===e&&(e=["all"]);var n=t||{},i=n.duration,r=void 0===i?300:i,o=n.easing,a=void 0===o?"cubic-bezier(0.4, 0, 0.2, 1)":o,s=n.delay,l=void 0===s?0:s;return(Array.isArray(e)?e:[e]).map(function(e){return e+" "+("string"==typeof r?r:tX(r))+" "+a+" "+("string"==typeof l?l:tX(l))}).join(",")}function tQ(e){return(e&&e.ownerDocument||document).defaultView||window}function tJ(e,t){if(t){var n=function(e,t){var n,i=t.getBoundingClientRect(),r=tQ(t);if(t.fakeTransform)n=t.fakeTransform;else{var o=r.getComputedStyle(t);n=o.getPropertyValue("-webkit-transform")||o.getPropertyValue("transform")}var a=0,s=0;if(n&&"none"!==n&&"string"==typeof n){var l=n.split("(")[1].split(")")[0].split(",");a=parseInt(l[4],10),s=parseInt(l[5],10)}switch(e){case"left":return"translateX("+(r.innerWidth+a-i.left)+"px)";case"right":return"translateX(-"+(i.left+i.width-a)+"px)";case"up":return"translateY("+(r.innerHeight+s-i.top)+"px)";default:return"translateY(-"+(i.top+i.height-s)+"px)"}}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var t0=(0,eI.forwardRef)(function(e,t){var n=e.children,i=e.direction,r=void 0===i?"down":i,o=e.in,a=e.style,s=e.timeout,l=void 0===s?0:s,u=e.onEnter,c=e.onEntered,h=e.onExit,d=e.onExited,f=tD(e,["children","direction","in","style","timeout","onEnter","onEntered","onExit","onExited"]),p=(0,eI.useRef)(null),g=tq(n.ref,p),m=tq(g,t),v=(0,eI.useCallback)(function(){p.current&&tJ(r,p.current)},[r]);return(0,eI.useEffect)(function(){if(!o&&"down"!==r&&"right"!==r){var e=function(e,t){var n;function i(){for(var i=this,r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(n),n=setTimeout(function(){e.apply(i,o)},t)}return void 0===t&&(t=166),i.clear=function(){clearTimeout(n)},i}(function(){p.current&&tJ(r,p.current)}),t=tQ(p.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}},[r,o]),(0,eI.useEffect)(function(){o||v()},[o,v]),(0,eI.createElement)(tG,Object.assign({appear:!0,nodeRef:p,onEnter:function(e,t){tJ(r,e),tZ(e),u&&u(e,t)},onEntered:c,onEntering:function(e){var t=(null==a?void 0:a.transitionTimingFunction)||"cubic-bezier(0.0, 0, 0.2, 1)",n=tY({timeout:l,mode:"enter",style:tT({},a,{transitionTimingFunction:t})});e.style.webkitTransition=tK("-webkit-transform",n),e.style.transition=tK("transform",n),e.style.webkitTransform="none",e.style.transform="none"},onExit:function(e){var t=(null==a?void 0:a.transitionTimingFunction)||"cubic-bezier(0.4, 0, 0.6, 1)",n=tY({timeout:l,mode:"exit",style:tT({},a,{transitionTimingFunction:t})});e.style.webkitTransition=tK("-webkit-transform",n),e.style.transition=tK("transform",n),tJ(r,e),h&&h(e)},onExited:function(e){e.style.webkitTransition="",e.style.transition="",d&&d(e)},in:o,timeout:l},f),function(e,t){return(0,eI.cloneElement)(n,tT({ref:m,style:tT({visibility:"exited"!==e||o?void 0:"hidden"},a,{},n.props.style)},t))})});t0.displayName="Slide";var t1=function(e){return eD().createElement("svg",Object.assign({viewBox:"0 0 24 24",focusable:"false",style:{fontSize:20,marginInlineEnd:8,userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0}},e))},t2={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:"default",autoHideDuration:5e3,iconVariant:{default:void 0,success:eD().createElement(function(){return eD().createElement(t1,null,eD().createElement("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41\n 10.59L10 14.17L17.59 6.58L19 8L10 17Z"}))},null),warning:eD().createElement(function(){return eD().createElement(t1,null,eD().createElement("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"}))},null),error:eD().createElement(function(){return eD().createElement(t1,null,eD().createElement("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,\n 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,\n 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"}))},null),info:eD().createElement(function(){return eD().createElement(t1,null,eD().createElement("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,\n 0 22,12A10,10 0 0,0 12,2Z"}))},null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},TransitionComponent:t0,transitionDuration:{enter:225,exit:195}},t5=function(e,t){var n=function(e){return"number"==typeof e||null===e};return n(e)?e:n(t)?t:t2.autoHideDuration},t3=function(e,t){var n=function(e,t){return t.some(function(t){return typeof e===t})};return n(e,["string","number"])?e:n(e,["object"])?tT({},t2.transitionDuration,{},n(t,["object"])&&t,{},e):n(t,["string","number"])?t:n(t,["object"])?tT({},t2.transitionDuration,{},t):t2.transitionDuration};function t4(e){return Object.entries(e).reduce(function(e,t){var n,i=t[0],r=t[1];return tT({},e,((n={})[i]=tM(r),n))},{})}var t6="notistack-CollapseWrapper",t8=t4({root:{height:0},entered:{height:"auto"}}),t9=(0,eI.forwardRef)(function(e,t){var n=e.children,i=e.in,r=e.onExited,o=(0,eI.useRef)(null),a=(0,eI.useRef)(null),s=tq(t,a),l=function(){return o.current?o.current.clientHeight:0};return(0,eI.createElement)(tG,{in:i,unmountOnExit:!0,onEnter:function(e){e.style.height="0px"},onEntered:function(e){e.style.height="auto"},onEntering:function(e){var t=l(),n=tY({timeout:175,mode:"enter"}),i=n.duration,r=n.easing;e.style.transitionDuration="string"==typeof i?i:i+"ms",e.style.height=t+"px",e.style.transitionTimingFunction=r||""},onExit:function(e){e.style.height=l()+"px"},onExited:r,onExiting:function(e){tZ(e);var t=tY({timeout:175,mode:"exit"}),n=t.duration,i=t.easing;e.style.transitionDuration="string"==typeof n?n:n+"ms",e.style.height="0px",e.style.transitionTimingFunction=i||""},nodeRef:a,timeout:175},function(e,t){return(0,eI.createElement)("div",Object.assign({ref:s,className:tv(t8.root,"entered"===e&&t8.entered),style:tT({pointerEvents:"all",overflow:"hidden",minHeight:"0px",transition:tK("height")},"entered"===e&&{overflow:"visible"},{},"exited"===e&&!i&&{visibility:"hidden"})},t),(0,eI.createElement)("div",{ref:o,className:t6,style:{display:"flex",width:"100%"}},n))})});t9.displayName="Collapse";var t7={right:"left",left:"right",bottom:"up",top:"down"},ne=function(e){void 0===e&&(e={});var t={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!t[e]}).reduce(function(t,n){var i;return tT({},t,((i={})[n]=e[n],i))},{})},nt=function(){};function nn(e,t){return e.reduce(function(e,n){return null==n?e:function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];var a=[].concat(r);t&&-1===a.indexOf(t)&&a.push(t),e.apply(this,a),n.apply(this,a)}},nt)}var ni="u">typeof window?eI.useLayoutEffect:eI.useEffect;function nr(e){var t=(0,eI.useRef)(e);return ni(function(){t.current=e}),(0,eI.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var no=(0,eI.forwardRef)(function(e,t){var n=e.children,i=e.className,r=e.autoHideDuration,o=e.disableWindowBlurListener,a=void 0!==o&&o,s=e.onClose,l=e.id,u=e.open,c=e.SnackbarProps,h=void 0===c?{}:c,d=(0,eI.useRef)(),f=nr(function(){s&&s.apply(void 0,arguments)}),p=nr(function(e){s&&null!=e&&(d.current&&clearTimeout(d.current),d.current=setTimeout(function(){f(null,"timeout",l)},e))});(0,eI.useEffect)(function(){return u&&p(r),function(){d.current&&clearTimeout(d.current)}},[u,r,p]);var g=function(){d.current&&clearTimeout(d.current)},m=(0,eI.useCallback)(function(){null!=r&&p(.5*r)},[r,p]);return(0,eI.useEffect)(function(){if(!a&&u)return window.addEventListener("focus",m),window.addEventListener("blur",g),function(){window.removeEventListener("focus",m),window.removeEventListener("blur",g)}},[a,m,u]),(0,eI.createElement)("div",Object.assign({ref:t},h,{className:tv("notistack-Snackbar",i),onMouseEnter:function(e){h.onMouseEnter&&h.onMouseEnter(e),g()},onMouseLeave:function(e){h.onMouseLeave&&h.onMouseLeave(e),m()}}),n)});no.displayName="Snackbar";var na=t4({root:((aT={display:"flex",flexWrap:"wrap",flexGrow:1})[tL]={flexGrow:"initial",minWidth:"288px"},aT)}),ns=(0,eI.forwardRef)(function(e,t){var n=e.className,i=tD(e,["className"]);return eD().createElement("div",Object.assign({ref:t,className:tv(na.root,n)},i))});ns.displayName="SnackbarContent";var nl=t4({root:{backgroundColor:"#313131",fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},lessPadding:{paddingLeft:"20px"},default:{backgroundColor:"#313131"},success:{backgroundColor:"#43a047"},error:{backgroundColor:"#d32f2f"},warning:{backgroundColor:"#ff9800"},info:{backgroundColor:"#2196f3"},message:{display:"flex",alignItems:"center",padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:"16px",marginRight:"-8px"}}),nu="notistack-snackbar",nc=(0,eI.forwardRef)(function(e,t){var n=e.id,i=e.message,r=e.action,o=e.iconVariant,a=e.variant,s=e.hideIconVariant,l=e.style,u=e.className,c=o[a],h=r;return"function"==typeof h&&(h=h(n)),eD().createElement(ns,{ref:t,role:"alert","aria-describedby":nu,style:l,className:tv("notistack-MuiContent","notistack-MuiContent-"+a,nl.root,nl[a],u,!s&&c&&nl.lessPadding)},eD().createElement("div",{id:nu,className:nl.message},s?null:c,i),h&&eD().createElement("div",{className:nl.action},h))});nc.displayName="MaterialDesignContent";var nh=(0,eI.memo)(nc),nd=t4({wrappedRoot:{width:"100%",position:"relative",transform:"translateX(0)",top:0,right:0,bottom:0,left:0,minWidth:"288px"}}),nf=function(e){var t,n=(0,eI.useRef)(),i=(0,eI.useState)(!0),r=i[0],o=i[1],a=nn([e.snack.onClose,e.onClose]),s=(0,eI.useCallback)(function(){n.current=setTimeout(function(){o(function(e){return!e})},125)},[]);(0,eI.useEffect)(function(){return function(){n.current&&clearTimeout(n.current)}},[]);var l=e.snack,u=e.classes,c=e.Component,h=(0,eI.useMemo)(function(){return ne(u)},[u]),d=l.open,f=l.SnackbarProps,p=l.TransitionComponent,g=l.TransitionProps,m=l.transitionDuration,v=l.disableWindowBlurListener,y=l.content,x=tD(l,["open","SnackbarProps","TransitionComponent","TransitionProps","transitionDuration","disableWindowBlurListener","content","entered","requestClose","onEnter","onEntered","onExit","onExited"]),b=tT({direction:"center"!==(t=x.anchorOrigin).horizontal?t7[t.horizontal]:t7[t.vertical],timeout:m},g),w=y;"function"==typeof w&&(w=w(x.id,x.message));var S=["onEnter","onEntered","onExit","onExited"].reduce(function(t,n){var i;return tT({},t,((i={})[n]=nn([e.snack[n],e[n]],x.id),i))},{});return eD().createElement(t9,{in:r,onExited:S.onExited},eD().createElement(no,{open:d,id:x.id,disableWindowBlurListener:v,autoHideDuration:x.autoHideDuration,className:tv(nd.wrappedRoot,h.root,h["anchorOrigin"+tB(x.anchorOrigin)]),SnackbarProps:f,onClose:a},eD().createElement(p,Object.assign({},b,{appear:!0,in:d,onExit:S.onExit,onExited:s,onEnter:S.onEnter,onEntered:nn([S.onEntered,function(){e.snack.requestClose&&a(null,"instructed",e.snack.id)}],x.id)}),w||eD().createElement(void 0===c?nh:c,Object.assign({},x)))))},np=20,ng=6,nm=2,nv="."+t6,ny=t4({root:((aI={boxSizing:"border-box",display:"flex",maxHeight:"100%",position:"fixed",zIndex:1400,height:"auto",width:"auto",transition:tK(["top","right","bottom","left","max-width"],{duration:300,easing:"ease"}),pointerEvents:"none"})[nv]={padding:ng+"px 0px",transition:"padding 300ms ease 0ms"},aI.maxWidth="calc(100% - "+2*np+"px)",aI[tE]={width:"100%",maxWidth:"calc(100% - 32px)"},aI),rootDense:((aD={})[nv]={padding:nm+"px 0px"},aD),top:{top:np-ng+"px",flexDirection:"column"},bottom:{bottom:np-ng+"px",flexDirection:"column-reverse"},left:((aO={left:np+"px"})[tL]={alignItems:"flex-start"},aO[tE]={left:"16px"},aO),right:((aP={right:np+"px"})[tL]={alignItems:"flex-end"},aP[tE]={right:"16px"},aP),center:((aR={left:"50%",transform:"translateX(-50%)"})[tL]={alignItems:"center"},aR)}),nx=(0,eI.memo)(function(e){var t=e.classes,n=void 0===t?{}:t,i=e.anchorOrigin,r=e.dense,o=e.children,a=tv("notistack-SnackbarContainer",ny[i.vertical],ny[i.horizontal],ny.root,n.containerRoot,n["containerAnchorOrigin"+tB(i)],r&&ny.rootDense);return eD().createElement("div",{className:a},o)}),nb=function(e){return!("string"==typeof e||(0,eI.isValidElement)(e))},nw=function(e){function t(t){var n;return(n=e.call(this,t)||this).enqueueSnackbar=function(e,t){if(void 0===t&&(t={}),null==e)throw Error("enqueueSnackbar called with invalid argument");var i,r=nb(e)?e:t,o=nb(e)?e.message:e,a=r.key,s=r.preventDuplicate,l=tD(r,["key","preventDuplicate"]),u=tF(a),c=u?a:new Date().getTime()+Math.random(),h=(i=n.props,function(e,t){return(void 0===t&&(t=!1),t)?tT({},t2[e],{},i[e],{},l[e]):"autoHideDuration"===e?t5(l.autoHideDuration,i.autoHideDuration):"transitionDuration"===e?t3(l.transitionDuration,i.transitionDuration):l[e]||i[e]||t2[e]}),d=tT({id:c},l,{message:o,open:!0,entered:!1,requestClose:!1,persist:h("persist"),action:h("action"),content:h("content"),variant:h("variant"),anchorOrigin:h("anchorOrigin"),disableWindowBlurListener:h("disableWindowBlurListener"),autoHideDuration:h("autoHideDuration"),hideIconVariant:h("hideIconVariant"),TransitionComponent:h("TransitionComponent"),transitionDuration:h("transitionDuration"),TransitionProps:h("TransitionProps",!0),iconVariant:h("iconVariant",!0),style:h("style",!0),SnackbarProps:h("SnackbarProps",!0),className:tv(n.props.className,l.className)});return d.persist&&(d.autoHideDuration=void 0),n.setState(function(e){if(void 0===s&&n.props.preventDuplicate||s){var t=function(e){return u?e.id===c:e.message===o},i=e.queue.findIndex(t)>-1,r=e.snacks.findIndex(t)>-1;if(i||r)return e}return n.handleDisplaySnack(tT({},e,{queue:[].concat(e.queue,[d])}))}),c},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?tT({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var t=!1,i=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(i=!0);var r=e.snacks.map(function(e){return t||e.persist&&!i?tT({},e):(t=!0,e.entered)?(e.onClose&&e.onClose(null,"maxsnack",e.id),n.props.onClose&&n.props.onClose(null,"maxsnack",e.id),tT({},e,{open:!1})):tT({},e,{requestClose:!0})});return tT({},e,{snacks:r})},n.handleEnteredSnack=function(e,t,i){if(!tF(i))throw Error("handleEnteredSnack Cannot be called with undefined key");n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===i?tT({},e,{entered:!0}):tT({},e)})}})},n.handleCloseSnack=function(e,t,i){n.props.onClose&&n.props.onClose(e,t,i);var r=void 0===i;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return r||e.id===i?e.entered?tT({},e,{open:!1}):tT({},e,{requestClose:!0}):tT({},e)}),queue:n.filter(function(e){return e.id!==i})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});tF(e)&&t&&t.onClose&&t.onClose(null,"instructed",e),n.handleCloseSnack(null,"instructed",e)},n.handleExitedSnack=function(e,t){if(!tF(t))throw Error("handleExitedSnack Cannot be called with undefined key");n.setState(function(e){var i=n.processQueue(tT({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return 0===i.queue.length?i:n.handleDismissOldest(i)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(tO(n)),closeSnackbar:n.closeSnackbar.bind(tO(n))}},n}return tI(t,e),t.prototype.render=function(){var e=this,t=this.state.contextValue,n=this.props,i=n.domRoot,r=n.children,o=n.dense,a=void 0!==o&&o,s=n.Components,l=void 0===s?{}:s,u=n.classes,c=this.state.snacks.reduce(function(e,t){var n,i=tB(t.anchorOrigin),r=e[i]||[];return tT({},e,((n={})[i]=[].concat(r,[t]),n))},{}),h=Object.keys(c).map(function(t){var n=c[t],i=n[0];return eD().createElement(nx,{key:t,dense:a,anchorOrigin:i.anchorOrigin,classes:u},n.map(function(t){return eD().createElement(nf,{key:t.id,snack:t,classes:u,Component:l[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:nn([e.handleExitedSnack,e.props.onExited],t.id),onEntered:nn([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return eD().createElement(tR.Provider,{value:t},r,i?(0,tg.createPortal)(h,i):h)},tk(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||t2.maxSnack}}]),t}(eI.Component);function nS({children:e,...t}){return(0,eb.jsx)(nw,{...t,Components:{error:(0,e7.A)(nh)(()=>({"&.notistack-MuiContent-error":{whiteSpace:"pre-wrap"}}))},children:e})}function n_(){let{enqueueSnackbar:e,closeSnackbar:t}=(0,eI.useContext)(tR),n=nC(e,"error"),i=nC(e,"info"),r=nC(e,"warning"),o=nC(e,"success"),a=(0,eI.useCallback)((e,t)=>n(e instanceof Error?e.message:`An unexpected error occurred: ${e}`,t),[n]);return{enqueueSnackbar:e,closeSnackbar:t,errorSnackbar:n,infoSnackbar:i,warningSnackbar:r,successSnackbar:o,exceptionSnackbar:a}}function nC(e,t){return(0,eI.useCallback)((n,i)=>e(n,{...i,variant:t}),[e,t])}var nM=n(25632);let nA="Pinned Crosshair",nk={name:nA,type:"line",markLine:{data:[],lineStyle:{type:"dashed",width:2},emphasis:{lineStyle:{width:2,opacity:1}},blur:{lineStyle:{width:2,opacity:1}}}};var nT=n(42636),nI=n(94461);function nD(e){return{value:{pastDuration:e},display:`Last ${(0,nI.formatDuration)((0,nT.parseDurationString)(e),{delimiter:", "})}`}}function nO(){return["local","UTC",...Intl.supportedValuesOf?.("timeZone")??[]].filter((e,t,n)=>n.indexOf(e)===t).map(e=>({value:e,display:"local"===e?"Local":e.replace(/_/g," ")}))}function nP(e,t){return"read"===e?"View":t&&"create"===e?"Add":t||"create"!==e?"update"===e?"Edit":"":"Create"}function nR(e,t){return t&&"create"===e?"Add":t&&"update"===e?"Apply":t?"":"Save"}let nE=["bottom","right"],nL=["list","table"],nN=["small","medium"];function nB(e){return nE.includes(e)}function nF(e){return nL.includes(e)}function nz(e){return nN.includes(e)}let nV={position:"bottom",mode:"list",size:"medium"};function nj(e){return void 0===e?nV.position:nB(e)?e:nV.position}function nH(e){return e&&nF(e)?e:nV.mode}function nW(e){return e&&nz(e)?e:nV.size}let nG=new Map([["time",new Map],["decimal",new Map],["bits",new Map],["bytes",new Map],["currency",new Map],["percent",new Map],["temperature",new Map],["throughput",new Map]]);function n$(e,t,n,i="en-US"){let r=`${e.filter(e=>![void 0,null,"",NaN].includes(e)).join("|")}|${i}`,o=nG.get(t);if(!o)throw Error("No formatter found for the input type");let a=o.get(r);if(a)return a.format;let s=Intl.NumberFormat(i,n);return o?.set(`${r}`,s),s.format}let nU=()=>({countCacheItems:e=>"all"!==e?nG.get(e)?.size??0:Array.from(nG.values()).reduce((e,t)=>e+(t?.size??0),0),getKeys:e=>[...nG.get(e)?.keys()||[]]});function nq(e){return!1!==e}function nY(e){return"number"==typeof e}function nZ(e){return e&&(e<0?e=0:e>20&&(e=20)),e}let nX="Time",nK={label:"Time",decimalPlaces:!0},nQ={nanoseconds:{group:nX,label:"Nanoseconds"},microseconds:{group:nX,label:"Microseconds"},milliseconds:{group:nX,label:"Milliseconds"},seconds:{group:nX,label:"Seconds"},minutes:{group:nX,label:"Minutes"},hours:{group:nX,label:"Hours"},days:{group:nX,label:"Days"},weeks:{group:nX,label:"Weeks"},months:{group:nX,label:"Months"},years:{group:nX,label:"Years"}};var nJ=((aA={}).nanoseconds="nanosecond",aA.microseconds="microsecond",aA.milliseconds="millisecond",aA.seconds="second",aA.minutes="minute",aA.hours="hour",aA.days="day",aA.weeks="week",aA.months="month",aA.years="year",aA);let n0={years:31536e3,months:2592e3,weeks:604800,days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001,microseconds:1e-6,nanoseconds:1e-9},n1=["years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds"];function n2(e,{unit:t,decimalPlaces:n}){var i;if(0===e)return"0s";let r=function(e,t){let n=e*n0[t],i=n1[0]||"years",r=i,o=n/n0[i];for(r of n1)if((o=n/n0[r])>=1)break;return{value:o,unit:r}}(e,t??"seconds"),o={style:"unit",unit:nJ[r.unit],unitDisplay:"months"===(i=r.unit)||"years"===i?"long":"narrow"};return nY(n)?(o.minimumFractionDigits=nZ(n),o.maximumFractionDigits=nZ(n)):o.maximumSignificantDigits=3,n$([o.style,o.unit,o.unitDisplay,o.maximumSignificantDigits,n,t??"seconds"],"time",o,"en-US")(r.value)}var n5="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:"u">typeof self?self:{};function n3(){if(aB)return aN;aB=1;let e=[{key:"ZiB",factor:11805916207174113e5},{key:"ZB",factor:1e21},{key:"YiB",factor:12089258196146292e8},{key:"YB",factor:1e24},{key:"TiB",factor:0x10000000000},{key:"TB",factor:1e12},{key:"PiB",factor:0x4000000000000},{key:"PB",factor:1e15},{key:"MiB",factor:1048576},{key:"MB",factor:1e6},{key:"KiB",factor:1024},{key:"KB",factor:1e3},{key:"GiB",factor:0x40000000},{key:"GB",factor:1e9},{key:"EiB",factor:0x1000000000000000},{key:"EB",factor:1e18},{key:"B",factor:1}];function t(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}return aN={unformat:function(n,i){let r,o=n8(),a=o.currentDelimiters(),s=o.currentCurrency().symbol,l=o.currentOrdinal(),u=o.getZeroFormat(),c=o.currentAbbreviations();if("string"==typeof n)if(function(e,t){if(!(e.indexOf(":")&&":"!==t.thousands))return!1;let n=e.split(":");if(3!==n.length)return!1;let i=+n[0],r=+n[1],o=+n[2];return!isNaN(i)&&!isNaN(r)&&!isNaN(o)}(n,a)){let e,t,i;t=+(e=n.split(":"))[0],i=+e[1],r=+e[2]+60*i+3600*t}else r=function(n,i,r="",o,a,s){if(""!==n)return n===a?0:function n(i,r,o,a,s,l,u){if(!isNaN(+i))return+i;let c="",h=i.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(h!==i)return -1*n(h,r,o,a,s,l);for(let t=0;t<e.length;t++){let u=e[t];if((c=i.replace(RegExp(`([0-9 ])(${u.key})$`),"$1"))!==i)return n(c,r,o,a,s,l)*u.factor}if((c=i.replace("%",""))!==i)return n(c,r,o,a,s,l)/100;let d=parseFloat(i);if(isNaN(d))return;let f=a(d);if(f&&"."!==f&&(c=i.replace(RegExp(`${t(f)}$`),""))!==i)return n(c,r,o,a,s,l);let p={};Object.keys(l).forEach(e=>{p[l[e]]=e});let g=Object.keys(p).sort().reverse(),m=g.length;for(let e=0;e<m;e++){let t=g[e],u=p[t];if((c=i.replace(t,""))!==i){let e;switch(u){case"thousand":e=1e3;break;case"million":e=1e6;break;case"billion":e=1e9;break;case"trillion":e=1e12}return n(c,r,o,a,s,l)*e}}}(n.replace(r,"").replace(RegExp(`([0-9])${t(i.thousands)}([0-9])`,"g"),"$1$2").replace(i.decimal,"."),i,r,o,a,s)}(n,a,s,l,u,c);else{if("number"!=typeof n)return;r=n}if(void 0!==r)return r}}}function n4(){if(az)return aF;az=1;let e=n3(),t=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:(e,t)=>"byte"===t.output,message:"`base` must be provided only when the output is `byte`",mandatory:e=>"byte"===e.output},characteristic:{type:"number",restriction:e=>e>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",lowPrecision:{type:"boolean",restriction:(e,t)=>!0===t.average,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:e=>e>=0,message:"value must be positive"},{restriction:(e,t)=>!t.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:e=>e>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(e,t)=>"percent"===t.output,message:"`prefixSymbol` can be provided only when the output is `percent`"}},i={languageTag:{type:"string",mandatory:!0,restriction:e=>e.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function r(t){return void 0!==e.unformat(t)}function o(e,t,i,r=!1){let a=Object.keys(e).map(r=>{if(!t[r])return console.error(`${i} Invalid key: ${r}`),!1;let a=e[r],s=t[r];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!o(a,n,`[Validate ${r}]`,!0))return!1}else if(typeof a!==s.type)return console.error(`${i} ${r} type mismatched: "${s.type}" expected, "${typeof a}" provided`),!1;if(s.restrictions&&s.restrictions.length){let t=s.restrictions.length;for(let n=0;n<t;n++){let{restriction:t,message:o}=s.restrictions[n];if(!t(a,e))return console.error(`${i} ${r} invalid value: ${o}`),!1}}return s.restriction&&!s.restriction(a,e)?(console.error(`${i} ${r} invalid value: ${s.message}`),!1):s.validValues&&-1===s.validValues.indexOf(a)?(console.error(`${i} ${r} invalid value: must be among ${JSON.stringify(s.validValues)}, "${a}" provided`),!1):(!s.children||!!o(a,s.children,`[Validate ${r}]`))&&!0});return r||a.push(...Object.keys(t).map(n=>{let r=t[n];if("string"==typeof r&&(r={type:r}),r.mandatory){let t=r.mandatory;if("function"==typeof t&&(t=t(e)),t&&void 0===e[n])return console.error(`${i} Missing mandatory key "${n}"`),!1}return!0})),a.reduce((e,t)=>e&&t,!0)}function a(e){return o(e,n,"[Validate format]")}return aF={validate:function(e,t){let n=r(e),i=a(t);return n&&i},validateFormat:a,validateInput:r,validateLanguage:function(e){return o(e,i,"[Validate language]")}}}var n6=function(e,t={}){var n,i,r,o,a,s;let l,u,c,h,d;if("string"!=typeof e)return e;i=e=(l=(n=e).match(/^{([^}]*)}/))?(t.prefix=l[1],n.slice(l[0].length)):n,function(e,t){if(-1!==e.indexOf("$")){t.output="currency";return}if(-1!==e.indexOf("%")){t.output="percent";return}if(-1!==e.indexOf("bd")){t.output="byte",t.base="general";return}if(-1!==e.indexOf("b")){t.output="byte",t.base="binary";return}if(-1!==e.indexOf("d")){t.output="byte",t.base="decimal";return}if(-1!==e.indexOf(":")){t.output="time";return}-1!==e.indexOf("o")&&(t.output="ordinal")}(e=(u=i.match(/{([^}]*)}$/))?(t.postfix=u[1],i.slice(0,-u[0].length)):i,t),(c=e.match(/[1-9]+[0-9]*/))&&(t.totalLength=+c[0]),(h=e.split(".")[0].match(/0+/))&&(t.characteristic=h[0].length),-1!==(r=e).indexOf(".")&&(t.optionalCharacteristic=-1===r.split(".")[0].indexOf("0")),-1!==e.indexOf("a")&&(t.average=!0),-1!==(o=e).indexOf("K")?t.forceAverage="thousand":-1!==o.indexOf("M")?t.forceAverage="million":-1!==o.indexOf("B")?t.forceAverage="billion":-1!==o.indexOf("T")&&(t.forceAverage="trillion");let f=e.split(".")[1];if(f){let e=f.match(/0+/);e&&(t.mantissa=e[0].length)}return(a=e).match(/\[\.]/)?t.optionalMantissa=!0:a.match(/\./)&&(t.optionalMantissa=!1),(d=e.split(".")[1])&&(t.trimMantissa=-1!==d.indexOf("[")),-1!==e.indexOf(",")&&(t.thousandSeparated=!0),-1!==e.indexOf(" ")&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0)),(s=e).match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),s.match(/^\+?-/)&&(t.negative="sign"),e.match(/^\+/)&&(t.forceSign=!0),t};function n8(){let e;if(aj)return aV;aj=1;let t=aL?aE:(aL=1,aE={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){let t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),n=n4(),i={},r={},o=null,a={};function s(){return r[e]}return i.languages=()=>Object.assign({},r),i.currentLanguage=()=>e,i.currentBytes=()=>s().bytes||{},i.currentCurrency=()=>s().currency,i.currentAbbreviations=()=>s().abbreviations,i.currentDelimiters=()=>s().delimiters,i.currentOrdinal=()=>s().ordinal,i.currentDefaults=()=>Object.assign({},s().defaults,a),i.currentOrdinalDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().ordinalFormat),i.currentByteDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().byteFormat),i.currentPercentageDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().percentageFormat),i.currentCurrencyDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().currencyFormat),i.currentTimeDefaultFormat=()=>Object.assign({},i.currentDefaults(),s().timeFormat),i.setDefaults=e=>{e=n6(e),n.validateFormat(e)&&(a=e)},i.getZeroFormat=()=>o,i.setZeroFormat=e=>o="string"==typeof e?e:null,i.hasZeroFormat=()=>null!==o,i.languageData=e=>{if(e){if(r[e])return r[e];throw Error(`Unknown tag "${e}"`)}return s()},i.registerLanguage=(t,i=!1)=>{if(!n.validateLanguage(t))throw Error("Invalid language data");r[t.languageTag]=t,i&&(e=t.languageTag)},i.setLanguage=(n,i=t.languageTag)=>{if(!r[n]){let t=n.split("-")[0],o=Object.keys(r).find(e=>e.split("-")[0]===t);return r[o]?void(e=o):void(e=i)}e=n},i.registerLanguage(t),e=t.languageTag,aV=i}var n9={exports:{}};(function(e){var t,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,r=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",s=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13];function l(e){var t=0|e;return e>0||e===t?t:t-1}function u(e){for(var t,n,i=1,r=e.length,o=e[0]+"";i<r;){for(n=14-(t=e[i++]+"").length;n--;t="0"+t);o+=t}for(r=o.length;48===o.charCodeAt(--r););return o.slice(0,r+1||1)}function c(e,t){var n,i,r=e.c,o=t.c,a=e.s,s=t.s,l=e.e,u=t.e;if(!a||!s)return null;if(n=r&&!r[0],i=o&&!o[0],n||i)return n?i?0:-s:a;if(a!=s)return a;if(n=a<0,i=l==u,!r||!o)return i?0:!r^n?1:-1;if(!i)return l>u^n?1:-1;for(a=0,s=(l=r.length)<(u=o.length)?l:u;a<s;a++)if(r[a]!=o[a])return r[a]>o[a]^n?1:-1;return l==u?0:l>u^n?1:-1}function h(e,t,n,i){if(e<t||e>n||e!==r(e))throw Error(o+(i||"Argument")+("number"==typeof e?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function d(e){var t=e.c.length-1;return l(e.e/14)==t&&e.c[t]%2!=0}function f(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function p(e,t,n){var i,r;if(t<0){for(r=n+".";++t;r+=n);e=r+e}else if(i=e.length,++t>i){for(r=n,t-=i;--t;r+=n);e+=r}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}(t=function e(t){var g,m,v,y,x,b,w,S,_,C=F.prototype={constructor:F,toString:null,valueOf:null},M=new F(1),A=20,k=4,T=-7,I=21,D=-1e7,O=1e7,P=!1,R=1,E=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},N="0123456789abcdefghijklmnopqrstuvwxyz",B=!0;function F(e,t){var i,o,s,l,u,c,d,f,p=this;if(!(p instanceof F))return new F(e,t);if(null==t){if(e&&!0===e._isBigNumber){p.s=e.s,!e.c||e.e>O?p.c=p.e=null:e.e<D?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice());return}if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,u=e;u>=10;u/=10,l++);l>O?p.c=p.e=null:(p.e=l,p.c=[e]);return}f=String(e)}else{if(!n.test(f=String(e)))return _(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(l=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(l<0&&(l=u),l+=+f.slice(u+1),f=f.substring(0,u)):l<0&&(l=f.length)}else{if(h(t,2,N.length,"Base"),10==t&&B)return H(p=new F(e),A+p.e+1,k);if(f=String(e),c="number"==typeof e){if(0*e!=0)return _(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,F.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(i=N.slice(0,t),l=u=0,d=f.length;u<d;u++)if(0>i.indexOf(o=f.charAt(u))){if("."==o){if(u>l){l=d;continue}}else if(!s&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){s=!0,u=-1,l=0;continue}return _(p,String(e),c,t)}c=!1,(l=(f=S(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):l=f.length}for(u=0;48===f.charCodeAt(u);u++);for(d=f.length;48===f.charCodeAt(--d););if(f=f.slice(u,++d)){if(d-=u,c&&F.DEBUG&&d>15&&(e>0x1fffffffffffff||e!==r(e)))throw Error(a+p.s*e);if((l=l-u-1)>O)p.c=p.e=null;else if(l<D)p.c=[p.e=0];else{if(p.e=l,p.c=[],u=(l+1)%14,l<0&&(u+=14),u<d){for(u&&p.c.push(+f.slice(0,u)),d-=14;u<d;)p.c.push(+f.slice(u,u+=14));u=14-(f=f.slice(u)).length}else u-=d;for(;u--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function z(e,t,n,i){var r,o,a,s,l;if(null==n?n=k:h(n,0,8),!e.c)return e.toString();if(r=e.c[0],a=e.e,null==t)l=u(e.c),l=1==i||2==i&&(a<=T||a>=I)?f(l,a):p(l,a,"0");else if(o=(e=H(new F(e),t,n)).e,s=(l=u(e.c)).length,1==i||2==i&&(t<=o||o<=T)){for(;s<t;l+="0",s++);l=f(l,o)}else if(t-=a,l=p(l,o,"0"),o+1>s){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=o-s)>0)for(o+1==s&&(l+=".");t--;l+="0");return e.s<0&&r?"-"+l:l}function V(e,t){for(var n,i,r=1,o=new F(e[0]);r<e.length;r++)(i=new F(e[r])).s&&(n=c(o,i))!==t&&(0!==n||o.s!==t)||(o=i);return o}function j(e,t,n){for(var i=1,r=t.length;!t[--r];t.pop());for(r=t[0];r>=10;r/=10,i++);return(n=i+14*n-1)>O?e.c=e.e=null:n<D?e.c=[e.e=0]:(e.e=n,e.c=t),e}function H(e,t,n,o){var a,l,u,c,h,d,f,p=e.c;if(p){e:{for(a=1,c=p[0];c>=10;c/=10,a++);if((l=t-a)<0)l+=14,u=t,f=r((h=p[d=0])/s[a-u-1]%10);else if((d=i((l+1)/14))>=p.length)if(o){for(;p.length<=d;p.push(0));h=f=0,a=1,l%=14,u=l-14+1}else break e;else{for(a=1,h=c=p[d];c>=10;c/=10,a++);l%=14,f=(u=l-14+a)<0?0:r(h/s[a-u-1]%10)}if(o=o||t<0||null!=p[d+1]||(u<0?h:h%s[a-u-1]),o=n<4?(f||o)&&(0==n||n==(e.s<0?3:2)):f>5||5==f&&(4==n||o||6==n&&(l>0?u>0?h/s[a-u]:0:p[d-1])%10&1||n==(e.s<0?8:7)),t<1||!p[0])return p.length=0,o?(t-=e.e+1,p[0]=s[(14-t%14)%14],e.e=-t||0):p[0]=e.e=0,e;if(0==l?(p.length=d,c=1,d--):(p.length=d+1,c=s[14-l],p[d]=u>0?r(h/s[a-u]%s[u])*c:0),o)for(;;)if(0==d){for(l=1,u=p[0];u>=10;u/=10,l++);for(u=p[0]+=c,c=1;u>=10;u/=10,c++);l!=c&&(e.e++,1e14==p[0]&&(p[0]=1));break}else{if(p[d]+=c,1e14!=p[d])break;p[d--]=0,c=1}for(l=p.length;0===p[--l];p.pop());}e.e>O?e.c=e.e=null:e.e<D&&(e.c=[e.e=0])}return e}function W(e){var t,n=e.e;return null===n?e.toString():(t=u(e.c),t=n<=T||n>=I?f(t,n):p(t,n,"0"),e.s<0?"-"+t:t)}return F.clone=e,F.ROUND_UP=0,F.ROUND_DOWN=1,F.ROUND_CEIL=2,F.ROUND_FLOOR=3,F.ROUND_HALF_UP=4,F.ROUND_HALF_DOWN=5,F.ROUND_HALF_EVEN=6,F.ROUND_HALF_CEIL=7,F.ROUND_HALF_FLOOR=8,F.EUCLID=9,F.config=F.set=function(e){var t,n;if(null!=e)if("object"==typeof e){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(h(n=e[t],0,1e9,t),A=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(h(n=e[t],0,8,t),k=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(h(n[0],-1e9,0,t),h(n[1],0,1e9,t),T=n[0],I=n[1]):(h(n,-1e9,1e9,t),T=-(I=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)h(n[0],-1e9,-1,t),h(n[1],1,1e9,t),D=n[0],O=n[1];else if(h(n,-1e9,1e9,t),n)D=-(O=n<0?-n:n);else throw Error(o+t+" cannot be zero: "+n);if(e.hasOwnProperty(t="CRYPTO"))if(!!(n=e[t])===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=n;else throw P=!n,Error(o+"crypto unavailable");else P=n;else throw Error(o+t+" not true or false: "+n);if(e.hasOwnProperty(t="MODULO_MODE")&&(h(n=e[t],0,9,t),R=n),e.hasOwnProperty(t="POW_PRECISION")&&(h(n=e[t],0,1e9,t),E=n),e.hasOwnProperty(t="FORMAT"))if("object"==typeof(n=e[t]))L=n;else throw Error(o+t+" not an object: "+n);if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(o+t+" invalid: "+n);B="0123456789"==n.slice(0,10),N=n}}else throw Error(o+"Object expected: "+e);return{DECIMAL_PLACES:A,ROUNDING_MODE:k,EXPONENTIAL_AT:[T,I],RANGE:[D,O],CRYPTO:P,MODULO_MODE:R,POW_PRECISION:E,FORMAT:L,ALPHABET:N}},F.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!F.DEBUG)return!0;var t,n,i=e.c,a=e.e,s=e.s;e:if("[object Array]"==({}).toString.call(i)){if((1===s||-1===s)&&a>=-1e9&&a<=1e9&&a===r(a)){if(0===i[0]){if(0===a&&1===i.length)return!0;break e}if((t=(a+1)%14)<1&&(t+=14),String(i[0]).length==t){for(t=0;t<i.length;t++)if((n=i[t])<0||n>=1e14||n!==r(n))break e;if(0!==n)return!0}}}else if(null===i&&null===a&&(null===s||1===s||-1===s))return!0;throw Error(o+"Invalid BigNumber: "+e)},F.maximum=F.max=function(){return V(arguments,-1)},F.minimum=F.min=function(){return V(arguments,1)},g=0x20000000000000*Math.random()&2097151?function(){return r(0x20000000000000*Math.random())}:function(){return(0x40000000*Math.random()|0)*8388608+(8388608*Math.random()|0)},F.random=function(e){var t,n,a,l,u,c=0,d=[],f=new F(M);if(null==e?e=A:h(e,0,1e9),l=i(e/14),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(l*=2));c<l;)(u=131072*t[c]+(t[c+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(d.push(u%1e14),c+=2);c=l/2}else if(crypto.randomBytes){for(t=crypto.randomBytes(l*=7);c<l;)(u=(31&t[c])*0x1000000000000+0x10000000000*t[c+1]+0x100000000*t[c+2]+0x1000000*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(d.push(u%1e14),c+=7);c=l/7}else throw P=!1,Error(o+"crypto unavailable");if(!P)for(;c<l;)(u=g())<9e15&&(d[c++]=u%1e14);for(l=d[--c],e%=14,l&&e&&(u=s[14-e],d[c]=r(l/u)*u);0===d[c];d.pop(),c--);if(c<0)d=[a=0];else{for(a=-1;0===d[0];d.splice(0,1),a-=14);for(c=1,u=d[0];u>=10;u/=10,c++);c<14&&(a-=14-c)}return f.e=a,f.c=d,f},F.sum=function(){for(var e=1,t=arguments,n=new F(t[0]);e<t.length;)n=n.plus(t[e++]);return n},S=function(){var e="0123456789";function t(e,t,n,i){for(var r,o,a=[0],s=0,l=e.length;s<l;){for(o=a.length;o--;a[o]*=t);for(a[0]+=i.indexOf(e.charAt(s++)),r=0;r<a.length;r++)a[r]>n-1&&(null==a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}return function(n,i,r,o,a){var s,l,c,h,d,f,g,m,v=n.indexOf("."),y=A,x=k;for(v>=0&&(h=E,E=0,n=n.replace(".",""),f=(m=new F(i)).pow(n.length-v),E=h,m.c=t(p(u(f.c),f.e,"0"),10,r,e),m.e=m.c.length),c=h=(g=t(n,i,r,a?(s=N,e):(s=e,N))).length;0==g[--h];g.pop());if(!g[0])return s.charAt(0);if(v<0?--c:(f.c=g,f.e=c,f.s=o,g=(f=w(f,m,y,x,r)).c,d=f.r,c=f.e),v=g[l=c+y+1],h=r/2,d=d||l<0||null!=g[l+1],d=x<4?(null!=v||d)&&(0==x||x==(f.s<0?3:2)):v>h||v==h&&(4==x||d||6==x&&1&g[l-1]||x==(f.s<0?8:7)),l<1||!g[0])n=d?p(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(g.length=l,d)for(--r;++g[--l]>r;)g[l]=0,l||(++c,g=[1].concat(g));for(h=g.length;!g[--h];);for(v=0,n="";v<=h;n+=s.charAt(g[v++]));n=p(n,c,s.charAt(0))}return n}}(),w=function(){function e(e,t,n){var i,r,o,a,s=0,l=e.length,u=t%1e7,c=t/1e7|0;for(e=e.slice();l--;)i=c*(o=e[l]%1e7)+(a=e[l]/1e7|0)*u,s=((r=u*o+i%1e7*1e7+s)/n|0)+(i/1e7|0)+c*a,e[l]=r%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,i){var r,o;if(n!=i)o=n>i?1:-1;else for(r=o=0;r<n;r++)if(e[r]!=t[r]){o=e[r]>t[r]?1:-1;break}return o}function n(e,t,n,i){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*i+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,o,a,s,u){var c,h,d,f,p,g,m,v,y,x,b,w,S,_,C,M,A,k=i.s==o.s?1:-1,T=i.c,I=o.c;if(!T||!T[0]||!I||!I[0])return new F(!i.s||!o.s||(T?I&&T[0]==I[0]:!I)?NaN:T&&0==T[0]||!I?0*k:k/0);for(y=(v=new F(k)).c=[],k=a+(h=i.e-o.e)+1,u||(u=1e14,h=l(i.e/14)-l(o.e/14),k=k/14|0),d=0;I[d]==(T[d]||0);d++);if(I[d]>(T[d]||0)&&h--,k<0)y.push(1),f=!0;else{for(_=T.length,M=I.length,d=0,k+=2,(p=r(u/(I[0]+1)))>1&&(I=e(I,p,u),T=e(T,p,u),M=I.length,_=T.length),S=M,b=(x=T.slice(0,M)).length;b<M;x[b++]=0);A=[0].concat(A=I.slice()),C=I[0],I[1]>=u/2&&C++;do{if(p=0,(c=t(I,x,M,b))<0){if(w=x[0],M!=b&&(w=w*u+(x[1]||0)),(p=r(w/C))>1)for(p>=u&&(p=u-1),m=(g=e(I,p,u)).length,b=x.length;1==t(g,x,m,b);)p--,n(g,M<m?A:I,m,u),m=g.length,c=1;else 0==p&&(c=p=1),m=(g=I.slice()).length;if(m<b&&(g=[0].concat(g)),n(x,g,b,u),b=x.length,-1==c)for(;1>t(I,x,M,b);)p++,n(x,M<b?A:I,b,u),b=x.length}else 0===c&&(p++,x=[0]);y[d++]=p,x[0]?x[b++]=T[S]||0:(x=[T[S]],b=1)}while((S++<_||null!=x[0])&&k--);f=null!=x[0],y[0]||y.splice(0,1)}if(1e14==u){for(d=1,k=y[0];k>=10;k/=10,d++);H(v,a+(v.e=d+14*h-1)+1,s,f)}else v.e=h,v.r=+f;return v}}(),m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,y=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,b=/^\s*\+(?=[\w.])|^\s+|\s+$/g,_=function(e,t,n,i){var r,a=n?t:t.replace(b,"");if(x.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!n&&(a=a.replace(m,function(e,t,n){return r="x"==(n=n.toLowerCase())?16:"b"==n?2:8,i&&i!=r?e:t}),i&&(r=i,a=a.replace(v,"$1").replace(y,"0.$1")),t!=a))return new F(a,r);if(F.DEBUG)throw Error(o+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},C.absoluteValue=C.abs=function(){var e=new F(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return c(this,new F(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,i,r;if(null!=e)return h(e,0,1e9),null==t?t=k:h(t,0,8),H(new F(this),e+this.e+1,t);if(!(n=this.c))return null;if(i=((r=n.length-1)-l(this.e/14))*14,r=n[r])for(;r%10==0;r/=10,i--);return i<0&&(i=0),i},C.dividedBy=C.div=function(e,t){return w(this,new F(e,t),A,k)},C.dividedToIntegerBy=C.idiv=function(e,t){return w(this,new F(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,a,s,l,u,c,h,f,p,g=this;if((e=new F(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+W(e));if(null!=t&&(t=new F(t)),c=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return p=new F(Math.pow(+W(g),c?e.s*(2-d(e)):+W(e))),t?p.mod(t):p;if(h=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new F(NaN);(a=!h&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||c&&g.c[1]>=24e7:g.c[0]<8e13||c&&g.c[0]<=9999975e7)))return l=g.s<0&&d(e)?-0:0,g.e>-1&&(l=1/l),new F(h?1/l:l);E&&(l=i(E/14+2))}for(c?(n=new F(.5),h&&(e.s=1),f=d(e)):f=(s=Math.abs(+W(e)))%2,p=new F(M);;){if(f){if(!(p=p.times(g)).c)break;l?p.c.length>l&&(p.c.length=l):a&&(p=p.mod(t))}if(s){if(0===(s=r(s/2)))break;f=s%2}else if(H(e=e.times(n),e.e+1,1),e.e>14)f=d(e);else{if(0==(s=+W(e)))break;f=s%2}g=g.times(g),l?g.c&&g.c.length>l&&(g.c.length=l):a&&(g=g.mod(t))}return a?p:(h&&(p=M.div(p)),t?p.mod(t):l?H(p,E,k,u):p)},C.integerValue=function(e){var t=new F(this);return null==e?e=k:h(e,0,8),H(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return 0===c(this,new F(e,t))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return c(this,new F(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return 1===(t=c(this,new F(e,t)))||0===t},C.isInteger=function(){return!!this.c&&l(this.e/14)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return 0>c(this,new F(e,t))},C.isLessThanOrEqualTo=C.lte=function(e,t){return -1===(t=c(this,new F(e,t)))||0===t},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(e,t){var n,i,r,o,a=this.s;if(t=(e=new F(e,t)).s,!a||!t)return new F(NaN);if(a!=t)return e.s=-t,this.plus(e);var s=this.e/14,u=e.e/14,c=this.c,h=e.c;if(!s||!u){if(!c||!h)return c?(e.s=-t,e):new F(h?this:NaN);if(!c[0]||!h[0])return h[0]?(e.s=-t,e):new F(c[0]?this:3==k?-0:0)}if(s=l(s),u=l(u),c=c.slice(),a=s-u){for((o=a<0)?(a=-a,r=c):(u=s,r=h),r.reverse(),t=a;t--;r.push(0));r.reverse()}else for(i=(o=(a=c.length)<(t=h.length))?a:t,a=t=0;t<i;t++)if(c[t]!=h[t]){o=c[t]<h[t];break}if(o&&(r=c,c=h,h=r,e.s=-e.s),(t=(i=h.length)-(n=c.length))>0)for(;t--;c[n++]=0);for(t=1e14-1;i>a;){if(c[--i]<h[i]){for(n=i;n&&!c[--n];c[n]=t);--c[n],c[i]+=1e14}c[i]-=h[i]}for(;0==c[0];c.splice(0,1),--u);return c[0]?j(e,c,u):(e.s=3==k?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var n,i;return(e=new F(e,t),this.c&&e.s&&(!e.c||e.c[0]))?e.c&&(!this.c||this.c[0])?(9==R?(i=e.s,e.s=1,n=w(this,e,0,3),e.s=i,n.s*=i):n=w(this,e,0,R),(e=this.minus(n.times(e))).c[0]||1!=R||(e.s=this.s),e):new F(this):new F(NaN)},C.multipliedBy=C.times=function(e,t){var n,i,r,o,a,s,u,c,h,d,f,p,g,m=this.c,v=(e=new F(e,t)).c;if(!m||!v||!m[0]||!v[0])return this.s&&e.s&&(!m||m[0]||v)&&(!v||v[0]||m)?(e.s*=this.s,m&&v?(e.c=[0],e.e=0):e.c=e.e=null):e.c=e.e=e.s=null,e;for(i=l(this.e/14)+l(e.e/14),e.s*=this.s,(u=m.length)<(d=v.length)&&(g=m,m=v,v=g,r=u,u=d,d=r),r=u+d,g=[];r--;g.push(0));for(r=d;--r>=0;){for(n=0,f=v[r]%1e7,p=v[r]/1e7|0,o=r+(a=u);o>r;)s=p*(c=m[--a]%1e7)+(h=m[a]/1e7|0)*f,n=((c=f*c+s%1e7*1e7+g[o]+n)/1e14|0)+(s/1e7|0)+p*h,g[o--]=c%1e14;g[o]=n}return n?++i:g.splice(0,1),j(e,g,i)},C.negated=function(){var e=new F(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,i=this.s;if(t=(e=new F(e,t)).s,!i||!t)return new F(NaN);if(i!=t)return e.s=-t,this.minus(e);var r=this.e/14,o=e.e/14,a=this.c,s=e.c;if(!r||!o){if(!a||!s)return new F(i/0);if(!a[0]||!s[0])return s[0]?e:new F(a[0]?this:0*i)}if(r=l(r),o=l(o),a=a.slice(),i=r-o){for(i>0?(o=r,n=s):(i=-i,n=a),n.reverse();i--;n.push(0));n.reverse()}for((i=a.length)-(t=s.length)<0&&(n=s,s=a,a=n,t=i),i=0;t;)i=(a[--t]=a[t]+s[t]+i)/1e14|0,a[t]=1e14===a[t]?0:a[t]%1e14;return i&&(a=[i].concat(a),++o),j(e,a,o)},C.precision=C.sd=function(e,t){var n,i,r;if(null!=e&&!!e!==e)return h(e,1,1e9),null==t?t=k:h(t,0,8),H(new F(this),e,t);if(!(n=this.c))return null;if(i=14*(r=n.length-1)+1,r=n[r]){for(;r%10==0;r/=10,i--);for(r=n[0];r>=10;r/=10,i++);}return e&&this.e+1>i&&(i=this.e+1),i},C.shiftedBy=function(e){return h(e,-0x1fffffffffffff,0x1fffffffffffff),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,n,i,r,o=this.c,a=this.s,s=this.e,c=A+4,h=new F("0.5");if(1!==a||!o||!o[0])return new F(!a||a<0&&(!o||o[0])?NaN:o?this:1/0);if(0==(a=Math.sqrt(+W(this)))||a==1/0?(((t=u(o)).length+s)%2==0&&(t+="0"),a=Math.sqrt(+t),s=l((s+1)/2)-(s<0||s%2),n=new F(t=a==1/0?"5e"+s:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new F(a+""),n.c[0]){for((a=(s=n.e)+c)<3&&(a=0);;)if(r=n,n=h.times(r.plus(w(this,r,c,1))),u(r.c).slice(0,a)===(t=u(n.c)).slice(0,a)){if(n.e<s&&--a,"9999"!=(t=t.slice(a-3,a+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(n,n.e+A+2,1),e=!n.times(n).eq(this));break}if(!i&&(H(r,r.e+A+2,0),r.times(r).eq(this))){n=r;break}c+=4,a+=4,i=1}}return H(n,n.e+A+1,k,e)},C.toExponential=function(e,t){return null!=e&&(h(e,0,1e9),e++),z(this,e,t,1)},C.toFixed=function(e,t){return null!=e&&(h(e,0,1e9),e=e+this.e+1),z(this,e,t)},C.toFormat=function(e,t,n){var i;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=L;else if("object"!=typeof n)throw Error(o+"Argument not an object: "+n);if(i=this.toFixed(e,t),this.c){var r,a=i.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=a[0],h=a[1],d=this.s<0,f=d?c.slice(1):c,p=f.length;if(l&&(r=s,s=l,l=r,p-=r),s>0&&p>0){for(r=p%s||s,c=f.substr(0,r);r<p;r+=s)c+=u+f.substr(r,s);l>0&&(c+=u+f.slice(r)),d&&(c="-"+c)}i=h?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?h.replace(RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):c}return(n.prefix||"")+i+(n.suffix||"")},C.toFraction=function(e){var t,n,i,r,a,l,c,h,d,f,p,g,m=this.c;if(null!=e&&(!(c=new F(e)).isInteger()&&(c.c||1!==c.s)||c.lt(M)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!m)return new F(this);for(t=new F(M),d=n=new F(M),i=h=new F(M),g=u(m),a=t.e=g.length-this.e-1,t.c[0]=s[(l=a%14)<0?14+l:l],e=!e||c.comparedTo(t)>0?a>0?t:d:c,l=O,O=1/0,c=new F(g),h.c[0]=0;f=w(c,t,0,1),1!=(r=n.plus(f.times(i))).comparedTo(e);)n=i,i=r,d=h.plus(f.times(r=d)),h=r,t=c.minus(f.times(r=t)),c=r;return r=w(e.minus(n),i,0,1),h=h.plus(r.times(d)),n=n.plus(r.times(i)),h.s=d.s=this.s,a*=2,p=1>w(d,i,a,k).minus(this).abs().comparedTo(w(h,n,a,k).minus(this).abs())?[d,i]:[h,n],O=l,p},C.toNumber=function(){return+W(this)},C.toPrecision=function(e,t){return null!=e&&h(e,1,1e9),z(this,e,t,2)},C.toString=function(e){var t,n=this,i=n.s,r=n.e;return null===r?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=r<=T||r>=I?f(u(n.c),r):p(u(n.c),r,"0"):10===e&&B?t=p(u((n=H(new F(n),A+r+1,k)).c),n.e,"0"):(h(e,2,N.length,"Base"),t=S(p(u(n.c),r,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},C.valueOf=C.toJSON=function(){return W(this)},C._isBigNumber=!0,null!=t&&F.set(t),F}()).default=t.BigNumber=t,n9.exports?n9.exports=t:(e||(e="u">typeof self&&self?self:window),e.BigNumber=t)})(n5);var n7=n9.exports;let ie=n8(),it=n4(),ii={trillion:1e12,billion:1e9,million:1e6,thousand:1e3},ir={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:io,decimalSuffixes:ia}=ie.currentBytes(),is={scale:1024,suffixes:ia,marker:"bd"},il={scale:1024,suffixes:io,marker:"b"},iu={scale:1e3,suffixes:ia,marker:"d"};function ic(e,t,n){let i=t[0],r=Math.abs(e);if(r>=n){for(let o=1;o<t.length;++o){let a=Math.pow(n,o),s=Math.pow(n,o+1);if(r>=a&&r<s){i=t[o],e/=a;break}}i===t[0]&&(e/=Math.pow(n,t.length-1),i=t[t.length-1])}return{value:e,suffix:i}}function ih(e){let t="";for(let n=0;n<e;n++)t+="0";return t}function id({instance:e,providedFormat:t,state:n=ie,decimalSeparator:i,defaults:r=n.currentDefaults()}){var o,a,s,l,u;let c,h,d,f,p,g,m,v=e._value;if(0===v&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(v))return v.toString();let y=Object.assign({},ir,r,t),x=y.totalLength,b=x?0:y.characteristic,w=y.optionalCharacteristic,S=y.forceAverage,_=y.lowPrecision,C=!!x||!!S||y.average,M=x?-1:C&&void 0===t.mantissa?0:y.mantissa,A=!x&&(void 0===t.optionalMantissa?-1===M:y.optionalMantissa),k=y.trimMantissa,T=y.thousandSeparated,I=y.spaceSeparated,D=y.negative,O=y.forceSign,P=y.exponential,R=y.roundingFunction,E="";if(C){let e=function({value:e,forceAverage:t,lowPrecision:n=!0,abbreviations:i,spaceSeparated:r=!1,totalLength:o=0,roundingFunction:a=Math.round}){let s="",l=Math.abs(e),u=-1;if(t&&i[t]&&ii[t]?(s=i[t],e/=ii[t]):l>=ii.trillion||n&&1===a(l/ii.trillion)?(s=i.trillion,e/=ii.trillion):l<ii.trillion&&l>=ii.billion||n&&1===a(l/ii.billion)?(s=i.billion,e/=ii.billion):l<ii.billion&&l>=ii.million||n&&1===a(l/ii.million)?(s=i.million,e/=ii.million):(l<ii.million&&l>=ii.thousand||n&&1===a(l/ii.thousand))&&(s=i.thousand,e/=ii.thousand),s&&(s=(r?" ":"")+s),o){let t=e<0,n=e.toString().split(".")[0];u=Math.max(o-(t?n.length-1:n.length),0)}return{value:e,abbreviation:s,mantissaPrecision:u}}({value:v,forceAverage:S,lowPrecision:_,abbreviations:n.currentAbbreviations(),spaceSeparated:I,roundingFunction:R,totalLength:x});v=e.value,E+=e.abbreviation,x&&(M=e.mantissaPrecision)}if(P){let e=function({value:e,characteristicPrecision:t}){let[n,i]=e.toExponential().split("e"),r=+n;return t&&1<t&&(r*=Math.pow(10,t-1),i-=t-1,i=i>=0?`+${i}`:i),{value:r,abbreviation:`e${i}`}}({value:v,characteristicPrecision:b});v=e.value,E=e.abbreviation+E}let L=function(e,t,n,i,r,o){if(-1===i)return e;let a=function(e,t,n=Math.round){return -1!==e.toString().indexOf("e")?function(e,t){let n=e.toString(),[i,r]=n.split("e"),[o,a=""]=i.split(".");if(+r>0)n=o+a+ih(r-a.length);else{let e=".";e=0>+o?`-0${e}`:`0${e}`;let i=(ih(-r-1)+Math.abs(o)+a).substr(0,t);i.length<t&&(i+=ih(t-i.length)),n=e+i}return+r>0&&t>0&&(n+=`.${ih(t)}`),n}(e,t):new n7(n(+`${e}e+${t}`)/Math.pow(10,t)).toFixed(t)}(t,i,o),[s,l=""]=a.toString().split(".");if(l.match(/^0+$/)&&(n||r))return s;let u=l.match(/0+$/);return r&&u?`${s}.${l.toString().slice(0,u.index)}`:a.toString()}(v.toString(),v,A,M,k,R);return o=L=function(e,t,n,i){let r=e,[o,a]=r.toString().split(".");if(o.match(/^-?0$/)&&n)return a?`${o.replace("0","")}.${a}`:o.replace("0","");let s=t<0&&0===o.indexOf("-");if(s&&(o=o.slice(1),r=r.slice(1)),o.length<i){let e=i-o.length;for(let t=0;t<e;t++)r=`0${r}`}return s&&(r=`-${r}`),r.toString()}(L,v,w,b),a=v,s=i,h=(c=n.currentDelimiters()).thousands,s=s||c.decimal,d=c.thousandsSize||3,p=(f=o.toString()).split(".")[0],g=f.split(".")[1],m=a<0&&0===p.indexOf("-"),T&&(m&&(p=p.slice(1)),(function(e,t){let n=[],i=0;for(let r=e;r>0;r--)i===t&&(n.unshift(r),i=0),i++;return n})(p.length,d).forEach((e,t)=>{p=p.slice(0,e+t)+h+p.slice(e+t)}),m&&(p=`-${p}`)),L=f=g?p+s+g:p,(C||P)&&(L+=E),(O||v<0)&&(l=L,L=0===(u=v)?l:0==+l?l.replace("-",""):u>0?`+${l}`:"sign"===D?l:`(${l.replace("-","")})`),L}function ip(e,t){if(!e)return t;let n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}function ig(e,t,n){let i=new n7(e._value),r=t;return n.isNumbro(t)&&(r=t._value),r=new n7(r),e._value=i.minus(r).toNumber(),e}let im=n8(),iv=n4(),iy={loadLanguagesInNode:e=>{e.forEach(e=>{let t;try{t=function(e){throw Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`)}catch(t){console.error(`Unable to load "${e}". No matching language file found.`)}t&&iC.registerLanguage(t)})}},ix=n3(),ib={format:(...e)=>(function(e,t={},n){if("string"==typeof t&&(t=n6(t)),!it.validateFormat(t))return"ERROR: invalid format";let i=t.prefix||"",r=t.postfix||"",o=function(e,t,n){var i,r,o;switch(t.output){case"currency":let a,s,l,u,c,h,d,f,p,g;return i=t=ip(t,ie.currentCurrencyDefaultFormat()),a=ie.currentCurrency(),l=Object.assign({},ir,s=Object.assign({},i)),c="",h=!!l.totalLength||!!l.forceAverage||l.average,d=s.currencyPosition||a.position,f=s.currencySymbol||a.symbol,p=void 0!==l.spaceSeparatedCurrency?l.spaceSeparatedCurrency:l.spaceSeparated,void 0===s.lowPrecision&&(s.lowPrecision=!1),p&&(c=" "),"infix"===d&&(u=c+f+c),g=id({instance:e,providedFormat:s,state:ie,decimalSeparator:u}),"prefix"===d&&(g=e._value<0&&"sign"===l.negative?`-${c}${f}${g.slice(1)}`:e._value>0&&l.forceSign?`+${c}${f}${g.slice(1)}`:f+c+g),d&&"postfix"!==d||(g=g+(c=!l.spaceSeparatedAbbreviation&&h?"":c)+f),g;case"percent":let m,v,y;return r=t=ip(t,ie.currentPercentageDefaultFormat()),m=r.prefixSymbol,v=id({instance:n(100*e._value),providedFormat:r,state:ie}),y=Object.assign({},ir,r),m?`%${y.spaceSeparated?" ":""}${v}`:`${v}${y.spaceSeparated?" ":""}%`;case"byte":return function(e,t,n,i){let r=t.base||"binary",o=Object.assign({},ir,t),{binarySuffixes:a,decimalSuffixes:s}=n.currentBytes(),l={general:{scale:1024,suffixes:s||ia,marker:"bd"},binary:{scale:1024,suffixes:a||io,marker:"b"},decimal:{scale:1e3,suffixes:s||ia,marker:"d"}}[r],{value:u,suffix:c}=ic(e._value,l.suffixes,l.scale),h=id({instance:i(u),providedFormat:t,state:n,defaults:n.currentByteDefaultFormat()});return`${h}${o.spaceSeparated?" ":""}${c}`}(e,t=ip(t,ie.currentByteDefaultFormat()),ie,n);case"time":let x,b,w;return t=ip(t,ie.currentTimeDefaultFormat()),x=Math.floor(e._value/60/60),b=Math.floor((e._value-60*x*60)/60),w=Math.round(e._value-60*x*60-60*b),`${x}:${b<10?"0":""}${b}:${w<10?"0":""}${w}`;case"ordinal":let S,_,C,M;return o=t=ip(t,ie.currentOrdinalDefaultFormat()),S=ie.currentOrdinal(),_=Object.assign({},ir,o),C=id({instance:e,providedFormat:o,state:ie}),M=S(e._value),`${C}${_.spaceSeparated?" ":""}${M}`;default:return id({instance:e,providedFormat:t,numbro:n})}}(e,t,n);return(o=i+o)+r})(...e,iC),getByteUnit:(...e)=>(function(e){return ic(e._value,is.suffixes,is.scale).suffix})(...e),getBinaryByteUnit:(...e)=>(function(e){return ic(e._value,il.suffixes,il.scale).suffix})(...e),getDecimalByteUnit:(...e)=>(function(e){return ic(e._value,iu.suffixes,iu.scale).suffix})(...e),formatOrDefault:ip},iw={add:(e,t)=>{let n,i;return n=new n7(e._value),i=t,iC.isNumbro(t)&&(i=t._value),i=new n7(i),e._value=n.plus(i).toNumber(),e},subtract:(e,t)=>ig(e,t,iC),multiply:(e,t)=>{let n,i;return n=new n7(e._value),i=t,iC.isNumbro(t)&&(i=t._value),i=new n7(i),e._value=n.times(i).toNumber(),e},divide:(e,t)=>{let n,i;return n=new n7(e._value),i=t,iC.isNumbro(t)&&(i=t._value),i=new n7(i),e._value=n.dividedBy(i).toNumber(),e},set:(e,t)=>{let n;return n=t,iC.isNumbro(t)&&(n=t._value),e._value=n,e},difference:(e,t)=>{let n;return ig(n=iC(e._value),t,iC),Math.abs(n._value)},BigNumber:n7};class iS{constructor(e){this._value=e}clone(){return iC(this._value)}format(e={}){return ib.format(this,e)}formatCurrency(e){return"string"==typeof e&&(e=n6(e)),(e=ib.formatOrDefault(e,im.currentCurrencyDefaultFormat())).output="currency",ib.format(this,e)}formatTime(e={}){return e.output="time",ib.format(this,e)}binaryByteUnits(){return ib.getBinaryByteUnit(this)}decimalByteUnits(){return ib.getDecimalByteUnit(this)}byteUnits(){return ib.getByteUnit(this)}difference(e){return iw.difference(this,e)}add(e){return iw.add(this,e)}subtract(e){return iw.subtract(this,e)}multiply(e){return iw.multiply(this,e)}divide(e){return iw.divide(this,e)}set(e){return iw.set(this,i_(e))}value(){return this._value}valueOf(){return this._value}}function i_(e){let t=e;return iC.isNumbro(e)?t=e._value:"string"==typeof e?t=iC.unformat(e):isNaN(e)&&(t=NaN),t}function iC(e){return new iS(i_(e))}iC.version="2.5.0",iC.isNumbro=function(e){return e instanceof iS},iC.language=im.currentLanguage,iC.registerLanguage=im.registerLanguage,iC.setLanguage=im.setLanguage,iC.languages=im.languages,iC.languageData=im.languageData,iC.zeroFormat=im.setZeroFormat,iC.defaultFormat=im.currentDefaults,iC.setDefaults=im.setDefaults,iC.defaultCurrencyFormat=im.currentCurrencyDefaultFormat,iC.validate=iv.validate,iC.loadLanguagesInNode=iy.loadLanguagesInNode,iC.unformat=ix.unformat,iC.BigNumber=iw.BigNumber;var iM=iC&&iC.__esModule&&Object.prototype.hasOwnProperty.call(iC,"default")?iC.default:iC;let iA={label:"Bits",decimalPlaces:!0,shortValues:!0},ik={bits:{group:"Bits",label:"Bits (IEC)"},decbits:{group:"Bits",label:"Bits (SI)"}};function iT(e,{unit:t="bits",shortValues:n,decimalPlaces:i}){let r="decbits"===t;if(!nq(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"decimal",useGrouping:!0};nY(i)?(r.minimumFractionDigits=nZ(i),r.maximumFractionDigits=nZ(i)):nq(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.maximumSignificantDigits,i,n,t];return`${n$(o,"bits",r,"en-US")(e)} bits`}return iM(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:nY(i)?i:2,trimMantissa:!nY(i),optionalMantissa:!nY(i)}).replace(/KB/g,"Kb").replace(/MB/g,"Mb").replace(/GB/g,"Gb").replace(/TB/g,"Tb").replace(/PB/g,"Pb").replace(/EB/g,"Eb").replace(/KiB/g,"Kib").replace(/MiB/g,"Mib").replace(/GiB/g,"Gib").replace(/TiB/g,"Tib").replace(/PiB/g,"Pib").replace(/EiB/g,"Eib")}let iI={label:"Bytes",decimalPlaces:!0,shortValues:!0},iD={bytes:{group:"Bytes",label:"Bytes (IEC)"},decbytes:{group:"Bytes",label:"Bytes (SI)"}};function iO(e,{unit:t="bytes",shortValues:n,decimalPlaces:i}){let r="decbytes"===t;if(!nq(n)||Math.abs(e)<(r?1e3:1024)){let r={style:"unit",unit:"byte",unitDisplay:"long",useGrouping:!0};return nY(i)?(r.minimumFractionDigits=nZ(i),r.maximumFractionDigits=nZ(i)):nq(n)&&(r.maximumSignificantDigits=3),n$([r.style,r.unit,r.unitDisplay,r.useGrouping,r.maximumSignificantDigits,i,n,t],"bytes",r,"en-US")(e)}return iM(e).format({output:"byte",base:r?"decimal":"binary",spaceSeparated:!0,mantissa:nY(i)?i:2,trimMantissa:!nY(i),optionalMantissa:!nY(i)})}var iP=n(40224);let iR="Currency",iE={label:"Currency",decimalPlaces:!0},iL={aud:{group:iR,label:"Australian Dollar (A$)"},cad:{group:iR,label:"Canadian Dollar (CA$)"},chf:{group:iR,label:"Swiss Franc (CHF)"},cny:{group:iR,label:"Renminbi (CN\xa5)"},eur:{group:iR,label:"Euro (€)"},gbp:{group:iR,label:"Pound (\xa3)"},hkd:{group:iR,label:"Hong Kong Dollar (HK$)"},inr:{group:iR,label:"Indian Rupee (₹)"},jpy:{group:iR,label:"Yen (\xa5)"},krw:{group:iR,label:"South Korean Won (₩)"},nok:{group:iR,label:"Norwegian Krone (NOK)"},nzd:{group:iR,label:"New Zealand Dollar (NZ$)"},sek:{group:iR,label:"Swedish Krona (SEK)"},sgd:{group:iR,label:"Singapore Dollar (S$)"},usd:{group:iR,label:"US Dollar ($)"}};function iN(e,{unit:t,decimalPlaces:n}){let i={style:"currency",currency:(0,iP.toUpper)(t),currencyDisplay:"symbol"};return nY(n)?(i.minimumFractionDigits=nZ(n),i.maximumFractionDigits=nZ(n)):i.maximumSignificantDigits=3,n$([i.style,i.currency,i.currencyDisplay,i.maximumSignificantDigits,n,t],"currency",i,"en-US")(e)}let iB={label:"percent",decimalPlaces:!0},iF="Percent",iz={percent:{group:iF,label:"Percent (0-100)"},"percent-decimal":{group:iF,label:"Percent (0.0-1.0)"},"%":{disableSelectorOption:!0,group:iF,label:"%"}};function iV(e,{unit:t,decimalPlaces:n}){let i={style:"percent",useGrouping:!0};return nY(n)?(i.minimumFractionDigits=nZ(n),i.maximumFractionDigits=nZ(n)):i.maximumSignificantDigits=3,"percent"===t&&(e/=100),n$([i.style,i.useGrouping,i.maximumSignificantDigits,n,t],"percent",i,"en-US")(e)}let ij="Temperature",iH={label:ij,decimalPlaces:!0},iW={celsius:{group:ij,label:"Celsius (\xb0C)"},fahrenheit:{group:ij,label:"Fahrenheit (\xb0F)"}},iG=(e,{unit:t,decimalPlaces:n})=>{let i={unit:t,style:"unit"};nY(n)?(i.minimumFractionDigits=nZ(n),i.maximumFractionDigits=nZ(n)):i.maximumSignificantDigits=3;let r="celsius"===t?"en-GB":"en-US";return n$([i.style,i.unit,i.maximumSignificantDigits,n,r],"temperature",i,r)(e)},i$={label:"Decimal",decimalPlaces:!0,shortValues:!0},iU={decimal:{group:"Decimal",label:"Decimal"}};function iq(e,{shortValues:t,decimalPlaces:n}){let i={style:"decimal",useGrouping:!0};return nq(t)&&(i.notation="compact"),nY(n)?(i.minimumFractionDigits=nZ(n),i.maximumFractionDigits=nZ(n)):nq(t)&&(i.maximumSignificantDigits=3),n$([i.style,i.useGrouping,i.notation,i.maximumSignificantDigits,n],"decimal",i,"en-US")(e)}let iY={label:"Throughput",decimalPlaces:!0},iZ="Throughput",iX={"bits/sec":{group:iZ,label:"Bits/sec (IEC)"},"decbits/sec":{group:iZ,label:"Bits/sec (SI)"},"bytes/sec":{group:iZ,label:"Bytes/sec (IEC)"},"decbytes/sec":{group:iZ,label:"Bytes/sec (SI)"},"counts/sec":{group:iZ,label:"Counts/sec"},"events/sec":{group:iZ,label:"Events/sec"},"messages/sec":{group:iZ,label:"Messages/sec"},"ops/sec":{group:iZ,label:"Ops/sec"},"packets/sec":{group:iZ,label:"Packets/sec"},"reads/sec":{group:iZ,label:"Reads/sec"},"requests/sec":{group:iZ,label:"Requests/sec"},"records/sec":{group:iZ,label:"Records/sec"},"rows/sec":{group:iZ,label:"Rows/sec"},"writes/sec":{group:iZ,label:"Writes/sec"}};function iK(e,{unit:t,shortValues:n,decimalPlaces:i}){if("bits/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return iT(e,{unit:"bits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbits/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return iT(e,{unit:"decbits",shortValues:n,decimalPlaces:i})+"/"+t}if("decbytes/sec"===t){let t=1e3>Math.abs(e)?"sec":"s";return iO(e,{unit:"decbytes",shortValues:n,decimalPlaces:i})+"/"+t}if("bytes/sec"===t){let t=1024>Math.abs(e)?"sec":"s";return iO(e,{unit:"bytes",shortValues:n,decimalPlaces:i})+"/"+t}let r={style:"decimal",useGrouping:!0};nq(n)&&(r.notation="compact"),nY(i)?(r.minimumFractionDigits=nZ(i),r.maximumFractionDigits=nZ(i)):nq(n)&&(r.maximumSignificantDigits=3);let o=[r.style,r.useGrouping,r.notation,r.maximumSignificantDigits,i,n,t];return`${n$(o,"throughput",r,"en-US")(e)} ${t}`}let iQ="Date",iJ={Time:nK,Percent:iB,Decimal:i$,Bytes:iI,Bits:iA,Throughput:iY,Currency:iE,Temperature:iH,Date:{label:"Date & Time"}},i0={...nQ,...iz,...iU,...iD,...ik,...iX,...iL,...iW,"datetime-iso":{group:iQ,label:"DateTime (GMT)"},"datetime-us":{group:iQ,label:"DateTime (US-East)"},"datetime-local":{group:iQ,label:"DateTime (Browser Local)"},"date-iso":{group:iQ,label:"Date (GMT)"},"date-us":{group:iQ,label:"Date (US-East)"},"date-local":{group:iQ,label:"Date (Browser Local)"},"time-local":{group:iQ,label:"Time (Browser Local)"},"time-iso":{group:iQ,label:"Time (GMT)"},"time-us":{group:iQ,label:"Time (US-East)"},"relative-time":{group:iQ,label:"Relative Time"},"unix-timestamp":{group:iQ,label:"Unix Timestamp (s)"},"unix-timestamp-ms":{group:iQ,label:"Unix Timestamp (ms)"}};function i1(e,t){if(!t)return e.toString();if(i9(t))return iO(e,t);if(i7(t))return iT(e,t);if(i8(t))return iq(e,t);if(i6(t))return iV(e,t);if(i4(t))return n2(e,t);if(rn(t))return iK(e,t);if(ri(t))return iN(e,t);if(rr(t))return function(e,t={}){let n=Intl.DateTimeFormat().resolvedOptions().timeZone,{unit:i="datetime-local",locale:r=(()=>{if("u">typeof navigator){if(navigator.language)return navigator.language;if(navigator.languages&&navigator.languages.length>0){let e=navigator.languages[0];if(e)return e}let e=navigator;if(e.userLanguage)return e.userLanguage;if(e.browserLanguage)return e.browserLanguage;if(e.systemLanguage)return e.systemLanguage}return Intl.DateTimeFormat().resolvedOptions().locale||"en-US"})(),timeZone:o=n,referenceTime:a=Date.now()}=t;if("unix-timestamp"===i)return(e>1e12?Math.floor(e/1e3):e).toString();if("unix-timestamp-ms"===i)return Math.floor(e<1e11?1e3*e:e).toString();let s=function(e){if(e<0)if(Math.abs(e)>1e10)return new Date(e);else return new Date(1e3*e);if(e>=25e10&&e<=26e10){let t=new Date(1e3*e);if(t.getUTCFullYear()>=9999)return t}return new Date(e<1e10?1e3*e:e)}(e);if("relative-time"===i){let e=new Date(a),t=s.getTime()-e.getTime();for(let{unit:e,ms:n}of[{unit:"year",ms:31536e6},{unit:"month",ms:2592e6},{unit:"week",ms:6048e5},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}]){let i=Math.round(t/n);if(Math.abs(i)>=1)return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(i,e)}return new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"second")}let l={timeZone:o};switch(i){case"datetime-iso":return s.toISOString();case"datetime-us":return l.timeZone="America/New_York",l.year="numeric",l.month="2-digit",l.day="2-digit",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!0,new Intl.DateTimeFormat("en-US",l).format(s);case"datetime-local":l.year="numeric",l.month="2-digit",l.day="2-digit",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!1;break;case"date-iso":return s.toISOString().split("T")[0];case"date-us":return l.timeZone="America/New_York",l.year="numeric",l.month="2-digit",l.day="2-digit",new Intl.DateTimeFormat("en-US",l).format(s);case"date-local":l.year="numeric",l.month="2-digit",l.day="2-digit";break;case"time-local":l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!1;break;case"time-iso":return s.toISOString().split("T")[1].replace("Z","");case"time-us":return l.timeZone="America/New_York",l.hour="2-digit",l.minute="2-digit",l.second="2-digit",l.hour12=!0,new Intl.DateTimeFormat("en-US",l).format(s);default:throw Error(`Unknown date unit: ${i}`)}return new Intl.DateTimeFormat(r,l).format(s)}(e,t);if(ro(t))return iG(e,t);throw Error(`Unknown unit options ${t}`)}function i2(e){return i0[e.unit??"decimal"]}function i5(e){return i2(e).group??"Decimal"}function i3(e){return iJ[i2(e).group??"Decimal"]}function i4(e){return"Time"===i5(e)}function i6(e){return"Percent"===i5(e)}function i8(e){return"Decimal"===i5(e)}function i9(e){return"Bytes"===i5(e)}function i7(e){return"Bits"===i5(e)}function re(e){return!!i3(e).decimalPlaces}function rt(e){return!!i3(e).shortValues}function rn(e){return"Throughput"===i5(e)}function ri(e){return"Currency"===i5(e)}function rr(e){return"Date"===i5(e)}function ro(e){return"Temperature"===i5(e)}let ra={JoinByColumnValue:"Join by column value",MergeColumns:"Merge columns",MergeIndexedColumns:"Merge indexed columns",MergeSeries:"Merge series",ExtractColumnFields:"Extract column fields"};function rs(e,t){return[nM({type:"value",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>i1(e,t)}},e)]}function rl(e,t,n,i){let r=[],o=nM({type:"value",position:"left",boundaryGap:[0,"10%"],axisLabel:{formatter:e=>i1(e,t),overflow:"truncate"}},e);r.push(o);let a=0;return n.forEach((t,n)=>{let o,s,l={type:"value",position:"right",offset:a,boundaryGap:[0,"10%"],axisLabel:{formatter:e=>i1(e,t)},splitLine:{show:!1},show:e?.show};r.push(l),i&&(a+=(o=i1(i[n]??1e3,t),((s=document.createElement("canvas").getContext("2d"))?(s.font="12px sans-serif",s.measureText(o).width):6*o.length)+10))}),r}function ru(e,t){let{value:n,setValueAndStore:i}=function(e,t,n){let[i,r]=(0,eI.useState)(()=>{try{let n=e.getItem(t);if(null!==n)return JSON.parse(n)}catch{}return e.setItem(t,JSON.stringify(n)),n}),o=(0,eI.useCallback)(n=>{r(n),e.setItem(t,JSON.stringify(n))},[r,e,t]);return{value:i,setValue:r,setValueAndStore:o}}(window.localStorage,e,t);return[n,i]}function rc(e){let t=e._model;void 0!==t&&void 0!==t.option.toolbox&&t.option.toolbox.length>0&&"normal"===t.option.toolbox[0].feature.dataZoom.iconStatus.zoom&&e.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:!0})}function rh(e){e.dispatchAction({type:"restore"})}function rd(e){void 0!==e.dispatchAction&&(e.dispatchAction({type:"unselect"}),e.dispatchAction({type:"downplay"}))}function rf(e,t,n){if(void 0===n)return null;let i=[e,t];return n.containPixel("grid",i)?n.convertFromPixel("grid",i):null}function rp(e,t,n,i,r,o){let a=o.length>0?o[o.length-1]:r[r.length-1];void 0!==a&&e.dispatchAction({type:"select",seriesIndex:a.seriesIndex,dataIndex:a.dataIndex,escapeConnect:!0}),e.dispatchAction({type:"downplay"}),i.length>0&&e.dispatchAction({type:"downplay",seriesIndex:i}),n.length>0?e.dispatchAction({type:"highlight",seriesIndex:n,notBlur:!1,escapeConnect:!0}):(e.dispatchAction({type:"highlight",seriesIndex:t,notBlur:!0,escapeConnect:!0}),e.dispatchAction({type:"toggleSelect"}))}function rg(e){return e[e.length-1]?.name===nA}function rm(e,t){if(void 0===e||void 0===t)return null;let n=null,i=1/0;for(let[r]of e){let e=Math.abs(r-t);e<i&&(n=r,i=e)}return n}function rv(e,t){if(void 0===t)return null;let n=e.length,i=null;for(let r=0;r<n;r++){let o=n>0?e[r]:null;if(!o)break;i=rm(o.values,t)}return i}function ry(...e){return e.flatMap(e=>void 0===e?[]:Array.isArray(e)?e:[e])}function rx(e){void 0===globalThis.useIdValue&&(globalThis.useIdValue=0);let t=(0,eI.useRef)(void 0);return void 0===t.current&&(t.current=`${e}-${globalThis.useIdValue++}`),t.current}var rb=((ak={}).CSV="csv",ak.DISTRIBUTED="distributed",ak.DOUBLEQUOTE="doublequote",ak.GLOB="glob",ak.JSON="json",ak.LUCENE="lucene",ak.PERCENTENCODE="percentencode",ak.PIPE="pipe",ak.PROMETHEUS="prometheus",ak.RAW="raw",ak.REGEX="regex",ak.SINGLEQUOTE="singlequote",ak.SQLSTRING="sqlstring",ak.TEXT="text",ak.QUERYPARAM="queryparam",ak.REGEX_LITERAL="regexliteral",ak);function rw(e){if(!e)return;let t=e.toLowerCase();return Object.values(rb).find(e=>e===t)||void 0}function rS(e,t,n){switch(n){case"csv":case"raw":return e.join(",");case"distributed":{let[n,...i]=e;return`${[n,...i.map(e=>`${t}=${e}`)].join(",")}`}case"doublequote":return e.map(e=>`"${e}"`).join(",");case"glob":return`{${e.join(",")}}`;case"json":return JSON.stringify(e.map(e=>{try{return JSON.parse(e)}catch{return e}}));case"lucene":return`(${e.map(e=>`"${e}"`).join(" OR ")})`;case"percentencode":return encodeURIComponent(e.join(","));case"pipe":return e.join("|");case"regex":{let t=e.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"));return`(${t.join("|")})`}case"regexliteral":{let t=e.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\\\$&"));return`(${t.join("|")})`}case"singlequote":return e.map(e=>`'${e}'`).join(",");case"sqlstring":return e.map(e=>`'${e.replace(/'/g,"''")}'`).join(",");case"text":return e.join(" + ");case"queryparam":return e.map(e=>`${t}=${encodeURIComponent(e)}`).join("&");default:return`(${e.join("|")})`}}function r_(e,t,n,i){let r="$"+t,o="${"+t+(i?":"+i:"")+"}",a="";return Array.isArray(n)&&(a=rS(n,t,i||"prometheus")),"string"==typeof n&&(a=rS([n],t,i||"raw")),(e=e.replaceAll(r,a)).replaceAll(o,a)}let rC=/\$(\w+)|\${(\w+)(?:\.([^:^}]+))?(?::([^}]+))?}/gm;function rM(e){let t,n=new Set;for(;null!==(t=rC.exec(e));)t&&(t[1]?n.add(t[1]):t[2]&&n.add(t[2]));return Array.from(n.values())}function rA(e){let t,n=new Map;for(;null!==(t=rC.exec(e));)if(t){let e;t[4]&&(e=t[4]),t[1]?n.set(t[1],rw(e)):t[2]&&n.set(t[2],rw(e))}return n}function rk(e,t){let n=rA(e),i=Array.from(n.keys()),r=e;return i.sort((e,t)=>t.length-e.length).forEach(e=>{let i=t[e];i&&void 0!==i.value&&(r=r_(r,e,i?.value,n.get(e)))}),r}function rT(e,t){let n={};for(let[e,i]of Object.entries(t))n[e]=void 0===i.displayValue?i:{...i,value:i.displayValue};return rk(e,n)}let rI=/\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g,rD=/\$\{__data\[(\d+)\]\.fields\[(?:"|')([^"']+)(?:"|')\]\}/g,rO=/\$\{__data\.index\}/g,rP=/\$\{__data\.count\}/g,rR=/("|')?\$\{__data(?::([a-z]+))?\}("|')?/g;function rE(e,t){if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];return null==n?"":"object"==typeof n?JSON.stringify(n):String(n)}if(t.includes(".")){let n=t.split("."),i=e;for(let e of n){if(null==i||"object"!=typeof i)return"";i=i[e]}return null==i?"":"object"==typeof i?JSON.stringify(i):String(i)}return""}function rL(e){if(!e)return;let t=e.toLowerCase();return Object.values(rb).find(e=>e===t)}function rN(e,t,n={}){let{urlEncode:i=!0,index:r,count:o}=n,a=e,s=[];return void 0!==r&&(a=a.replaceAll(rO,String(r))),void 0!==o&&(a=a.replaceAll(rP,String(o))),a=a.replaceAll(rR,(e,n,i,r)=>{let o=rL(i)??rb.RAW;return o===rb.JSON?JSON.stringify(t):rS(Object.values(t).map(e=>JSON.stringify(e)),"",o)}),rI.lastIndex=0,{text:a=a.replaceAll(rI,(e,n,r,o)=>{let a=n??r??"",l=rE(t,a);""===l&&void 0===t[a]&&s.push(`Field "${a}" not found in data`);let u=rL(o);if(u)return rS([l],a,u);if(i){if(u===rb.RAW)return l;if(u!==rb.QUERYPARAM&&u!==rb.PERCENTENCODE)return encodeURIComponent(l)}return l}),errors:s.length>0?s:void 0}}function rB(e,t,n={}){let{urlEncode:i=!0}=n,r=e,o=[];return r=r.replaceAll(rP,String(t.length)),rD.lastIndex=0,rI.lastIndex=0,{text:r=(r=(r=r.replaceAll(rR,(e,n,i,r)=>{let o=rL(i)??rb.RAW,a=rS(Object.values(t).map(e=>JSON.stringify(e)),"",o);return n&&r?a:`${n??""}${a}${r??""}`})).replaceAll(rD,(e,n,r)=>{let a=parseInt(n,10);if(a<0||a>=t.length)return o.push(`Index ${a} out of bounds (0-${t.length-1})`),e;let s=rE(t[a],r);return""===s&&void 0===t[a][r]&&o.push(`Field "${r}" not found in data at index ${a}`),i?encodeURIComponent(s):s})).replaceAll(rI,(e,n,i,r)=>{let o=n??i??"";return rS(t.map(e=>rE(e,o)),o,rL(r)||rb.CSV)}),errors:o.length>0?o:void 0}}function rF(e){return rD.lastIndex=0,rD.test(e)||/\$\{__data\.fields(?:\[["'][^"']+["']\]|\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\}/.test(e)}function rz(e){return rD.lastIndex=0,rD.test(e)}function rV(e){return rI.lastIndex=0,rD.lastIndex=0,rI.test(e)||rD.test(e)}function rj(e){let t,n=new Set;for(rI.lastIndex=0,rD.lastIndex=0;null!==(t=rI.exec(e));)n.add(t[1]??t[2]);for(;null!==(t=rD.exec(e));)n.add(t[2]);return Array.from(n)}Symbol.for("constructDateFrom");let rH={},rW={};function rG(e,t){try{let n=(rH[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];if(n in rW)return rW[n];return rU(n,n.split(":"))}catch{if(e in rW)return rW[e];let t=e?.match(r$);if(t)return rU(e,t.slice(1));return NaN}}let r$=/([+-]\d\d):?(\d\d)?/;function rU(e,t){let n=+(t[0]||0),i=+(t[1]||0),r=(t[2]||0)/60;return rW[e]=60*n+i>0?60*n+i+r:60*n-i-r}class rq extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(rG(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),rX(this,e)):this.setTime(Date.now())}static tz(e,...t){return t.length?new rq(...t,e):new rq(Date.now(),e)}withTimeZone(e){return new rq(+this,e)}getTimezoneOffset(){let e=-rG(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),rZ(this),+this}[Symbol.for("constructDateFrom")](e){return new rq(+new Date(e),this.timeZone)}}let rY=/^(get|set)(?!UTC)/;function rZ(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-(60*rG(e.timeZone,e))))}function rX(e,t){var n;let i=Array.isArray(t)?Date.UTC((n=t)[0],n.length>1?n[1]:0,n.length>2?n[2]:1,...n.slice(3)):+e.internal,r=rG(e.timeZone,e),o=r>0?Math.floor(r):Math.ceil(r),a=new Date(+e);a.setUTCHours(a.getUTCHours()-1);let s=-new Date(+e).getTimezoneOffset(),l=-new Date(+a).getTimezoneOffset(),u=s;if(s-l&&s!==o&&Date.prototype.getHours.apply(e)!==(Array.isArray(t)?t[3]||0:e.internal.getUTCHours())){let t=new Date(+e),n=s-o;n&&t.setUTCMinutes(t.getUTCMinutes()+n);let i=rG(e.timeZone,t);(i>0?Math.floor(i):Math.ceil(i))===o&&(u=l)}let c=u-o;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);let h=new Date(+e);h.setUTCSeconds(0);let d=s>0?h.getSeconds():(h.getSeconds()-60)%60,f=Math.round(-(60*rG(e.timeZone,e)))%60;(f||d)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+d);let p=rG(e.timeZone,e),g=p>0?Math.floor(p):Math.ceil(p),m=-new Date(+e).getTimezoneOffset()-g-c,v=g-o,y=v>0&&rK(e)-i==60*v*1e3&&rK(e,i-60*g*1e3)!==i;if(g!==o&&m&&!y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);let t=rG(e.timeZone,e),n=g-(t>0?Math.floor(t):Math.ceil(t));n&&m<0&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n)}rZ(e);let x=(t?i:i+1e3*f)-e.internal;x&&18e5>Math.abs(x)&&(Date.prototype.setTime.call(e,+e+x),rZ(e))}function rK(e,t){let n=new Date(t??+e);return n.setUTCSeconds(n.getUTCSeconds()-Math.round(-(60*rG(e.timeZone,n)))),+n}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!rY.test(e))return;let t=e.replace(rY,"$1UTC");rq.prototype[t]&&(e.startsWith("get")?rq.prototype[e]=function(){return this.internal[t]()}:(rq.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),rX(e),+this},rq.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),rZ(this),+this}))});class rQ extends rq{static tz(e,...t){return t.length?new rQ(...t,e):new rQ(Date.now(),e)}toISOString(){let[e,t,n]=this.tzComponents(),i=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,i]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${i}`}toTimeString(){let e=this.internal.toUTCString().split(" ")[4],[t,n,i]=this.tzComponents();return`${e} GMT${t}${n}${i} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),n=String(Math.abs(e)%60).padStart(2,"0");return[e>0?"-":"+",t,n]}withTimeZone(e){return new rQ(+this,e)}[Symbol.for("constructDateFrom")](e){return new rQ(+new Date(e),this.timeZone)}}function rJ(e,t){if(t){let n=t.toLowerCase();if("local"!==n&&"browser"!==n)return{...e,timeZone:"utc"===n?"UTC":t}}return e}function r0(e,t,n){let i,r=n?.toLowerCase();if(!n||"local"===r||"browser"===r)return(0,nI.format)(e,t);return(0,nI.format)(e,t,{in:(i="utc"===r?"UTC":n,e=>rQ.tz(i,+new Date(e)))})}function r1(e){let t=e?.toLowerCase(),n=e;e&&"local"!==t&&"browser"!==t?"utc"===t&&(n="UTC"):n=Intl.DateTimeFormat().resolvedOptions().timeZone;try{let e=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"shortOffset"}).formatToParts(new Date).find(e=>"timeZoneName"===e.type),t=e?.value??"";if("GMT"===t)return"GMT+0";return t}catch{return"GMT+0"}}function r2(e){return e>15768e7?"{yyyy}":e>63072e6?"{MMM} {yyyy}":e>432e6&&e<1577664e4?"{MM}/{dd}":e>1728e5&&e<=432e6?"{MM}/{dd} {HH}:{mm}":{year:"{yearStyle|{yyyy}}\n{monthStyle|{MMM}}",month:"{MMM}",day:"{MM}/{dd}"}}let r5=(e,t)=>{if(!e)return{formattedDate:"",formattedTime:""};let n=new Date(e);return{formattedDate:t?t(n,"MMM dd, yyyy"):(0,nI.format)(n,"MMM dd, yyyy"),formattedTime:t?t(n,"HH:mm:ss"):(0,nI.format)(n,"HH:mm:ss")}};var r3=n(18264);function r4(e,t){let n=(0,eI.useRef)(),i=!0;for(let e=0;e<t.length;e++)if(n.current?.deps[e]!==t[e]){i=!1;break}return(void 0===n.current||!1===i)&&(n.current={value:e(),deps:t}),n.current.value}function r6(e,t){let n=(0,eI.useRef)();return(void 0===n.current||!1===r3(t,n.current.deps))&&(n.current={value:e(),deps:t}),n.current.value}function r8(e){return!!e?.startsWith("/")}function r9(e){if(!e)throw Error("Input string cannot be empty");if(!r8(e))return RegExp(`^${e}$`);let t=e.match(/^\/(.+)\/([gimy]*)$/);if(!t)throw Error(`Invalid regular expression format: ${e}`);let[,n="",i=""]=t;try{return new RegExp(n,i)}catch(e){throw Error(`Failed to create RegExp ${e}`)}}function r7(e,t){let n={};for(let[i,r]of Object.entries(e))n[i]=rk(r,t);return n}function oe(e,t){let n={};for(let[i,r]of Object.entries(e))Array.isArray(r)?n[i]=r.map(e=>rk(e,t)):n[i]=function e(t,n){if(Array.isArray(t))return t.map(t=>e(t,n));for(let[e,i]of rA(t)){let r,o=n[e];if(!o)continue;let a=o.options??[],s=a.map(e=>e.value),l=Array.isArray(o.value),u=void 0!==o.customAllValue;if(l)r=o.value;else if(u)try{let e=r9(o.customAllValue),t=a.filter(t=>e.test(t.value)).map(e=>e.value);r=t.length>0?t:s}catch{r=s}if(r&&(!i||i===rb.QUERYPARAM)){let o="$"+e,a=i?"${"+e+":"+i+"}":"${"+e+"}";return r.map(e=>{let i=t;return rk(i=(i=i.replaceAll(a,e)).replaceAll(o,e),n)})}}return rk(t,n)}(r,t);return n}function ot(e,t,n,i,r){let o=rN(e,t,{index:n,count:i}),a=o.text,s=[];return o.errors&&s.push(...o.errors.map(e=>e.replace("in data","in selection data"))),r&&(a=rk(a,r)),{text:a,errors:s.length>0?s:void 0}}function on(e,t,n){let i=rB(e,t),r=i.text,o=[];return i.errors&&o.push(...i.errors.map(e=>e.replace("in data","in selection data"))),n&&(r=rk(r,n)),{text:r,errors:o.length>0?o:void 0}}function oi(e,t){let n=e.palette.text?.primary??"#222";return nM({echartsTheme:{title:{show:!1},textStyle:{color:n,fontFamily:e.typography.fontFamily,fontSize:12},grid:{top:5,right:20,bottom:0,left:20,containLabel:!0},color:["#56B4E9","#009E73","#0072B2","#CC79A7","#F0E442","#E69F00","#D55E00"],categoryAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},timeAxis:{show:!0,axisLabel:{show:!0,color:n,margin:15},axisTick:{show:!1,length:6,lineStyle:{color:e.palette.grey[600]}},axisLine:{show:!0,lineStyle:{color:e.palette.grey[600]}},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.4}},splitArea:{show:!1,areaStyle:{color:[e.palette.grey[300]]}}},valueAxis:{show:!0,axisLabel:{color:n,margin:12},axisLine:{show:!1},splitLine:{show:!0,lineStyle:{width:.5,color:e.palette.grey[300],opacity:.6}}},legend:{orient:"horizontal",textStyle:{color:n},pageTextStyle:{color:e.palette.grey[600]},pageIconColor:e?.palette?.action?.active,pageIconInactiveColor:e?.palette?.action?.disabled},toolbox:{show:!0,top:10,right:10,iconStyle:{borderColor:n}},tooltip:{backgroundColor:e.palette.designSystem?.grey[800],borderColor:e.palette.designSystem?.grey[800],textStyle:{color:"#fff",fontSize:11}},axisPointer:{lineStyle:{color:e.palette.grey[500]}},markLine:{symbol:"none",symbolSize:0,itemStyle:{color:e.palette.grey[500]},lineStyle:{type:"dashed",width:1}},line:{showSymbol:!1,symbol:"circle",symbolSize:4,smooth:!1,lineStyle:{width:1},emphasis:{lineStyle:{width:1.5}}},bar:{barMaxWidth:150,itemStyle:{borderWidth:0,borderRadius:0,borderColor:e.palette.grey[300]},label:{show:!1,color:n}},gauge:{detail:{fontSize:18,fontWeight:600,valueAnimation:!1},splitLine:{distance:0,length:4,lineStyle:{width:1}},splitNumber:12}},noDataOption:{title:{show:!0,textStyle:{color:n,fontSize:16,fontWeight:400},text:"No data",left:"center",top:"center"},xAxis:{show:!1},yAxis:{show:!1}},sparkline:{width:2,color:"#1976d2"},container:{padding:{default:parseInt(e.spacing(1.5),10)}},thresholds:{defaultColor:e.palette.success.main,palette:["#FFCC00",e.palette.warning.main,e.palette.error.main]}},t)}function or(e,t=[]){if(!t.length)return{value:e};let n={value:e};return t.forEach(t=>{switch(t.kind){case"Value":{let i=t.spec;String(i.value)===String(e)&&(n.value=i.result.value||n.value,n.color=i.result.color);break}case"Range":{let i=t.spec;if(void 0===i.from&&void 0===i.to)break;let r=void 0!==i.from?i.from:-1/0,o=void 0!==i.to?i.to:1/0;e>=r&&e<=o&&(n.value=i.result.value||n.value,n.color=i.result.color);break}case"Regex":{let i=t.spec,r=e.toString();if(!i.pattern)break;let o=r9(i.pattern);r.match(o)&&null!==i.result.value&&(n.value=r.replace(o,i.result.value.toString()||"")||n.value,n.color=i.result.color);break}case"Misc":{let i=t.spec;(function(e,t){switch(e){case"empty":return""===t;case"null":return null==t;case"NaN":return Number.isNaN(t);case"true":return!0===t;case"false":return!1===t;default:return!1}})(i.value,e)&&(n.value=i.result.value||n.value,n.color=i.result.color)}}}),n}function oo(e,t){if(0===t.length)return e;let n={};for(let i of e){let e=Object.keys(i).filter(e=>t.includes(e)).map(e=>i[e]).join("|"),r=n[e];r?n[e]={...r,...i}:n[e]={...i}}return Object.values(n)}function oa(e,t,n){let i=[];for(let r of e){let e=Object.keys(r).filter(e=>t.includes(e)),o={};for(let t of e)o[t]=r[t],delete r[t];for(let t of e)i.push({...r,[n]:o[t]});0===e.length&&i.push(r)}return i}function os(e,t){let n=[];for(let i of e){let e=Object.keys(i).filter(e=>RegExp("^(("+t+" #\\d+)|("+t+"))$").test(e)),r={};for(let t of e)r[t]=i[t],delete i[t];for(let o of e)n.push({...i,[t]:r[o]});0===e.length&&n.push(i)}return n}function ol(e){let t=[...e],n=Array.from(new Set(e.flatMap(Object.keys).map(e=>e.replace(/ #\d+/,"")).filter(e=>"value"!==e)));for(let e of n)t=os(t,e);return oo(t,n)}function ou(e,t){let n=e;for(let e of t??[])if(!e.spec.disabled)switch(e.kind){case"JoinByColumnValue":e.spec.columns&&e.spec.columns.length>0&&(n=oo(n,e.spec.columns));break;case"MergeIndexedColumns":e.spec.column&&(n=os(n,e.spec.column));break;case"MergeColumns":e.spec.columns&&e.spec.columns.length>0&&e.spec.name&&(n=oa(n,e.spec.columns,e.spec.name));break;case"MergeSeries":n=ol(n)}return n.map(e=>Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{}))}var oc=n(68102);function oh(e){return"number"==typeof e}function od(e){return!!e&&"object"==typeof e&&"function"==typeof e.constructor&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function of(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function op(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function og(e){return e&&!0===e.constructor.prototype.isUnit||!1}function om(e){return"string"==typeof e}var ov=Array.isArray;function oy(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function ox(e){return Array.isArray(e)||oy(e)}function ob(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function ow(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function oS(e){return e&&!0===e.constructor.prototype.isRange||!1}function o_(e){return e&&!0===e.constructor.prototype.isIndex||!1}function oC(e){return"boolean"==typeof e}function oM(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function oA(e){return e&&!0===e.constructor.prototype.isHelp||!1}function ok(e){return"function"==typeof e}function oT(e){return e instanceof Date}function oI(e){return e instanceof RegExp}function oD(e){return!!(e&&"object"==typeof e&&e.constructor===Object&&!of(e)&&!op(e))}function oO(e){return null===e}function oP(e){return void 0===e}function oR(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function oE(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function oL(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function oN(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function oB(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function oF(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function oz(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function oV(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function oj(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function oH(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function oW(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function oG(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function o$(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function oU(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function oq(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function oY(e){return e&&!0===e.constructor.prototype.isChain||!1}function oZ(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":od(e)?"BigNumber":of(e)?"Complex":op(e)?"Fraction":oy(e)?"Matrix":og(e)?"Unit":o_(e)?"Index":oS(e)?"Range":oM(e)?"ResultSet":oH(e)?e.type:oY(e)?"Chain":oA(e)?"Help":"Object":"function"===t?"Function":t}function oX(e){var t=typeof e;if("number"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(function(e){return oX(e)});if(e instanceof Date)return new Date(e.valueOf());if(od(e))return e;if(e instanceof RegExp)throw TypeError("Cannot clone "+e);return oK(e,oX)}function oK(e,t){var n={};for(var i in e)o0(e,i)&&(n[i]=t(e[i]));return n}function oQ(e,t){var n,i,r;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(i=0,r=e.length;i<r;i++)if(!oQ(e[i],t[i]))return!1;return!0}if("function"==typeof e)return e===t;if(!(e instanceof Object))return e===t;if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!oQ(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}function oJ(e,t,n){var i,r=!0;Object.defineProperty(e,t,{get:function(){return r&&(i=n(),r=!1),i},set:function(e){i=e,r=!1},configurable:!0,enumerable:!0})}function o0(e,t){return e&&Object.hasOwnProperty.call(e,t)}function o1(e){return Object.keys(e).map(t=>e[t])}var o2=n(23420);function o5(e,t,n,i){function r(i){var r=function(e,t){for(var n={},i=0;i<t.length;i++){var r=t[i],o=e[r];void 0!==o&&(n[r]=o)}return n}(i,t.map(o4));return function(e,t,n){if(!t.filter(e=>{var t;return!((t=e)&&"?"===t[0])}).every(e=>void 0!==n[e])){var i=t.filter(e=>void 0===n[e]);throw Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(e=>'"'.concat(e,'"')).join(", "),"."))}}(e,t,i),n(r)}return r.isFactory=!0,r.fn=e,r.dependencies=t.slice().sort(),i&&(r.meta=i),r}function o3(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function o4(e){return e&&"?"===e[0]?e.slice(1):e}function o6(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function o8(e,t,n){var i="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!o6(n))throw Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!o6(e))throw Error("Value must be an integer");e<0&&(e+=2**n),i="i".concat(n)}var r="";return e<0&&(e=-e,r="-"),"".concat(r).concat({2:"0b",8:"0o",16:"0x"}[t]).concat(e.toString(t)).concat(i)}function o9(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n,i,r="auto";if(t&&(t.notation&&(r=t.notation),oh(t)?n=t:oh(t.precision)&&(n=t.precision),t.wordSize)&&"number"!=typeof(i=t.wordSize))throw Error('Option "wordSize" must be a number');switch(r){case"fixed":return ae(e,n);case"exponential":return at(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=an(o7(e),t),i=n.exponent,r=n.coefficients,o=i%3==0?i:i<0?i-3-i%3:i-i%3;if(oh(t))for(;t>r.length||i-o+1>r.length;)r.push(0);else for(var a=Math.abs(i-o)-(r.length-1),s=0;s<a;s++)r.push(0);for(var l=Math.abs(i-o),u=1;l>0;)u++,l--;var c=r.slice(u).join(""),h=oh(t)&&c.length||c.match(/[1-9]/)?"."+c:"",d=r.slice(0,u).join("")+h+"e"+(i>=0?"+":"")+o.toString();return n.sign+d}(e,n);case"bin":return o8(e,2,i);case"oct":return o8(e,8,i);case"hex":return o8(e,16,i);case"auto":return(function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var i=n&&void 0!==n.lowerExp?n.lowerExp:-3,r=n&&void 0!==n.upperExp?n.upperExp:5,o=o7(e),a=t?an(o,t):o;if(a.exponent<i||a.exponent>=r)return at(e,t);var s=a.coefficients,l=a.exponent;s.length<t&&(s=s.concat(ai(t-s.length))),s=s.concat(ai(l-s.length+1+(s.length<t?t-s.length:0))),s=ai(-l).concat(s);var u=l>0?l:0;return u<s.length-1&&s.splice(u+1,0,"."),a.sign+s.join("")})(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function o7(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError("Invalid number "+e);var n=t[1],i=t[2],r=parseFloat(t[4]||"0"),o=i.indexOf(".");r+=-1!==o?o-1:i.length-1;var a=i.replace(".","").replace(/^0*/,function(e){return r-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===a.length&&(a.push(0),r++),{sign:n,coefficients:a,exponent:r}}function ae(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=o7(e),i="number"==typeof t?an(n,n.exponent+1+t):n,r=i.coefficients,o=i.exponent+1,a=o+(t||0);return r.length<a&&(r=r.concat(ai(a-r.length))),o<0&&(r=ai(-o+1).concat(r),o=1),o<r.length&&r.splice(o,0,0===o?"0.":"."),i.sign+r.join("")}function at(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=o7(e),i=t?an(n,t):n,r=i.coefficients,o=i.exponent;r.length<t&&(r=r.concat(ai(t-r.length)));var a=r.shift();return i.sign+a+(r.length>0?"."+r.join(""):"")+"e"+(o>=0?"+":"")+o}function an(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},i=n.coefficients;t<=0;)i.unshift(0),n.exponent++,t++;if(i.length>t&&i.splice(t,i.length-t)[0]>=5){var r=t-1;for(i[r]++;10===i[r];)i.pop(),0===r&&(i.unshift(0),n.exponent++,r++),r--,i[r]++}return n}function ai(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}var ar=Number.EPSILON||2220446049250313e-31;function ao(e,t,n){if(null==n)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var i=Math.abs(e-t);return i<ar||i<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function aa(e,t,n){var i=new e.constructor(2),r="";if(n){if(n<1)throw Error("size must be in greater than 0");if(!o6(n))throw Error("size must be an integer");if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(n))),r="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(r);case 8:return"".concat(e.toOctal()).concat(r);case 16:return"".concat(e.toHexadecimal()).concat(r);default:throw Error("Base ".concat(t," not supported "))}}function as(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function al(e,t){var n=function(e,t){var n;if("number"==typeof e)return o9(e,t);if(od(e))return function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n="auto";if(void 0!==t&&(t.notation&&(n=t.notation),"number"==typeof t?h=t:t.precision&&(h=t.precision),t.wordSize)&&"number"!=typeof(d=t.wordSize))throw Error('Option "wordSize" must be a number');switch(n){case"fixed":return i=e,r=h,i.toFixed(r);case"exponential":return as(e,h);case"engineering":return o=e,a=h,l=(s=o.e)%3==0?s:s<0?s-3-s%3:s-s%3,-1!==(c=(u=o.mul(Math.pow(10,-l))).toPrecision(a)).indexOf("e")&&(c=u.toString()),c+"e"+(s>=0?"+":"")+l.toString();case"bin":return aa(e,2,d);case"oct":return aa(e,8,d);case"hex":return aa(e,16,d);case"auto":var i,r,o,a,s,l,u,c,h,d,f=t&&void 0!==t.lowerExp?t.lowerExp:-3,p=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var g=e.toSignificantDigits(h),m=g.e;return(m>=f&&m<p?g.toFixed():as(e,h)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(e,t);if((n=e)&&"object"==typeof n&&"number"==typeof n.s&&"number"==typeof n.n&&"number"==typeof n.d)if(!t||"decimal"!==t.fraction)return e.s*e.n+"/"+e.d;else return e.toString();if(Array.isArray(e))return function e(t,n){if(!Array.isArray(t))return al(t,n);for(var i="[",r=t.length,o=0;o<r;o++)0!==o&&(i+=", "),i+=e(t[o],n);return i+"]"}(e,t);if(om(e))return'"'+e+'"';if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e)if("function"==typeof e.format)return e.format(t);else return e&&e.toString(t)!==({}).toString()?e.toString(t):"{"+Object.keys(e).map(n=>'"'+n+'": '+al(e[n],t)).join(", ")+"}";return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function au(e,t,n){if(!(this instanceof au))throw SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=Error().stack}function ac(e,t,n){if(!(this instanceof ac))throw SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=Error().stack}function ah(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function ad(e,t){if(0===t.length){if(Array.isArray(e))throw new au(e.length,0)}else!function e(t,n,i){var r,o=t.length;if(o!==n[i])throw new au(o,n[i]);if(i<n.length-1){var a=i+1;for(r=0;r<o;r++){if(!Array.isArray(t[r]))throw new au(n.length-1,n.length,"<");e(t[r],n,a)}}else for(r=0;r<o;r++)if(Array.isArray(t[r]))throw new au(n.length+1,n.length,">")}(e,t,0)}function af(e,t){if(!oh(e)||!o6(e))throw TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new ac(e,t)}function ap(e,t,n){if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!oh(e)||!o6(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+al(t)+")")}),function e(t,n,i,r){var o,a,s=t.length,l=n[i],u=Math.min(s,l);if(t.length=l,i<n.length-1){var c=i+1;for(o=0;o<u;o++)Array.isArray(a=t[o])||(a=[a],t[o]=a),e(a,n,c,r);for(o=u;o<l;o++)a=[],t[o]=a,e(a,n,c,r)}else{for(o=0;o<u;o++)for(;Array.isArray(t[o]);)t[o]=t[o][0];for(o=u;o<l;o++)t[o]=r}}(e,t,0,void 0!==n?n:0),e}function ag(e,t){var n=am(e),i=e.slice(),r=e.indexOf(-1);if(e.indexOf(-1,r+1)>=0)throw Error("More than one wildcard in sizes");if(r>=0)if(t%n==0)i[r]=-t/n;else throw Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return i}function am(e){return e.reduce((e,t)=>e*t,1)}function av(e,t,n,i){var r=i||ah(e);if(n)for(var o=0;o<n;o++)e=[e],r.unshift(1);for(e=function e(t,n,i){var r,o;if(Array.isArray(t)){var a=i+1;for(r=0,o=t.length;r<o;r++)t[r]=e(t[r],n,a)}else for(var s=i;s<n;s++)t=[t];return t}(e,t,0);r.length<t;)r.push(1);return e}function ay(e,t){for(var n,i=0,r=0;r<e.length;r++){var o=e[r],a=Array.isArray(o);if(0===r&&a&&(i=o.length),a&&o.length!==i)return;var s=a?ay(o,t):t(o);if(void 0===n)n=s;else if(n!==s)return"mixed"}return n}function ax(e,t){return -1!==e.indexOf(t)}function ab(e,t,n,i){if(!(this instanceof ab))throw SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=i,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(null!=i?"-"+i:"")+" expected)",this.stack=Error().stack}au.prototype=RangeError(),au.prototype.constructor=RangeError,au.prototype.name="DimensionError",au.prototype.isDimensionError=!0,ac.prototype=RangeError(),ac.prototype.constructor=RangeError,ac.prototype.name="IndexError",ac.prototype.isIndexError=!0,ab.prototype=Error(),ab.prototype.constructor=Error,ab.prototype.name="ArgumentsError",ab.prototype.isArgumentsError=!0;var aw={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},aS=["Matrix","Array"],a_=["number","BigNumber","Fraction"];function aC(e,t,n){var i;void 0!==e[t]&&(i=e[t],-1===n.indexOf(i))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}function aM(e,t){var n,i,r,o=(0,oc.A)({},aw,t);if("function"!=typeof Object.create)throw Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var a=((n={isNumber:oh,isComplex:of,isBigNumber:od,isFraction:op,isUnit:og,isString:om,isArray:ov,isMatrix:oy,isCollection:ox,isDenseMatrix:ob,isSparseMatrix:ow,isRange:oS,isIndex:o_,isBoolean:oC,isResultSet:oM,isHelp:oA,isFunction:ok,isDate:oT,isRegExp:oI,isObject:oD,isNull:oO,isUndefined:oP,isAccessorNode:oR,isArrayNode:oE,isAssignmentNode:oL,isBlockNode:oN,isConditionalNode:oB,isConstantNode:oF,isFunctionAssignmentNode:oz,isFunctionNode:oV,isIndexNode:oj,isNode:oH,isObjectNode:oW,isOperatorNode:oG,isParenthesisNode:o$,isRangeNode:oU,isSymbolNode:oq,isChain:oY}).on=(i=new o2).on.bind(i),n.off=i.off.bind(i),n.once=i.once.bind(i),n.emit=i.emit.bind(i),n);a.config=function(e,t){function n(n){if(!n)return oK(e,oX);var i=oK(e,oX);aC(n,"matrix",aS),aC(n,"number",a_),function e(t,n){if(Array.isArray(n))throw TypeError("Arrays are not supported by deepExtend");for(var i in n)if(o0(n,i)&&!(i in Object.prototype)&&!(i in Function.prototype))if(n[i]&&n[i].constructor===Object)void 0===t[i]&&(t[i]={}),t[i]&&t[i].constructor===Object?e(t[i],n[i]):t[i]=n[i];else if(Array.isArray(n[i]))throw TypeError("Arrays are not supported by deepExtend");else t[i]=n[i];return t}(e,n);var r=oK(e,oX);return t("config",r,i,oK(n,oX)),r}return n.MATRIX_OPTIONS=aS,n.NUMBER_OPTIONS=a_,Object.keys(aw).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}(o,a.emit),a.expression={transform:{},mathWithTransform:{config:a.config}};var s={},l=function(e,t,n){function i(e,n){n&&"function"==typeof n.transform?(t.expression.transform[e]=n.transform,o0(a,e)||(t.expression.mathWithTransform[e]=n.transform)):(delete t.expression.transform[e],o0(a,e)||(t.expression.mathWithTransform[e]=n))}function r(e){return"function"==typeof e&&"object"==typeof e.signatures}function o(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction}var a={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(s,l){var u=arguments.length;if(1!==u&&2!==u)throw new ab("import",u,1,2);l||(l={});var c={};for(var h in!function e(t,n,i){if(Array.isArray(n))n.forEach(n=>e(t,n));else if("object"==typeof n)for(var r in n)o0(n,r)&&e(t,n[r],r);else if(o3(n)||void 0!==i){var a=o3(n)?o(n)?n.fn+".transform":n.fn:i;if(o0(t,a)&&t[a]!==n&&!l.silent)throw Error('Cannot import "'+a+'" twice');t[a]=n}else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}(c,s),c)if(o0(c,h)){var d,f=c[h];if(o3(f))!function(i,s){var l,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.fn;if(ax(u,"."))throw Error("Factory name should not contain a nested path. Name: "+JSON.stringify(u));var c=o(i)?t.expression.transform:t,h=u in t.expression.transform,d=o0(c,u)?c[u]:void 0,f=function(){var n={};i.dependencies.map(o4).forEach(e=>{if(ax(e,"."))throw Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=t:"mathWithTransform"===e?n.mathWithTransform=t.expression.mathWithTransform:"classes"===e?n.classes=t:n[e]=t[e]});var o=i(n);if(o&&"function"==typeof o.transform)throw Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===d||s.override)return o;if(r(d)&&r(o))return e(d,o);if(s.silent)return d;throw Error('Cannot import "'+u+'": already exists')};i.meta&&!1===i.meta.lazy?c[u]=f():oJ(c,u,f),d&&h?function(e){delete t.expression.transform[e],o0(a,e)?delete t.expression.mathWithTransform[e]:t.expression.mathWithTransform[e]=t[e]}(u):!o(i)&&(-1!==(l=i).fn.indexOf(".")||o0(a,l.fn)||l.meta&&l.meta.isClass)||oJ(t.expression.mathWithTransform,u,()=>c[u]),n[u]=i,t.emit("import",u,f)}(f,l);else{if("function"==typeof(d=f)||"number"==typeof d||"string"==typeof d||"boolean"==typeof d||null===d||og(d)||of(d)||od(d)||op(d)||oy(d)||Array.isArray(d))!function(o,a,s){var l;if(s.wrap&&"function"==typeof a&&(a=function(e){var n=function(){for(var n=[],i=0,r=arguments.length;i<r;i++){var o=arguments[i];n[i]=o&&o.valueOf()}return e.apply(t,n)};return e.transform&&(n.transform=e.transform),n}(a)),"function"==typeof(l=a)&&"string"==typeof l.signature&&(a=e(o,{[a.signature]:a})),r(t[o])&&r(a)){a=s.override?e(o,a.signatures):e(t[o],a),t[o]=a,delete n[o],i(o,a),t.emit("import",o,function(){return a});return}if(void 0===t[o]||s.override){t[o]=a,delete n[o],i(o,a),t.emit("import",o,function(){return a});return}if(!s.silent)throw Error('Cannot import "'+o+'": already exists')}(h,f,l);else if(!l.silent)throw TypeError("Factory, Object, or Array expected")}}}}(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return a.typed.apply(a.typed,t)},a,s);return a.import=l,a.on("config",()=>{o1(s).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&l(e,{override:!0})})}),a.create=aM.bind(null,e),a.factory=o5,a.import(o1((function e(t,n){for(var i in t)if(o0(t,i)){var r=t[i];"object"==typeof r&&null!==r?e(r,n):n[i]=r}}(e,r={}),r))),a.ArgumentsError=ab,a.DimensionError=au,a.IndexError=ac,a}var aA,ak,aT,aI,aD,aO,aP,aR,aE,aL,aN,aB,aF,az,aV,aj,aH,aW,aG="0123456789abcdef",a$="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",aU="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",aq={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},aY=!0,aZ="[DecimalError] ",aX=aZ+"Invalid argument: ",aK=aZ+"Precision limit exceeded",aQ=aZ+"crypto unavailable",aJ="[object Decimal]",a0=Math.floor,a1=Math.pow,a2=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,a5=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,a3=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,a4=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,a6=a$.length-1,a8=aU.length-1,a9={toStringTag:aJ};function a7(e){var t,n,i,r=e.length-1,o="",a=e[0];if(r>0){for(o+=a,t=1;t<r;t++)(n=7-(i=e[t]+"").length)&&(o+=sc(n)),o+=i;(n=7-(i=(a=e[t])+"").length)&&(o+=sc(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function se(e,t,n){if(e!==~~e||e<t||e>n)throw Error(aX+e)}function st(e,t,n,i){var r,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,r=0):(r=Math.ceil((t+1)/7),t%=7),o=a1(10,7-t),s=e[r]%o|0,null==i?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[r+1]/o/100|0)==a1(10,t-2)-1||(s==o/2||0==s)&&(e[r+1]/o/100|0)==0:t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(i||n<4)&&9999==s||!i&&n>3&&4999==s):a=((i||n<4)&&s+1==o||!i&&n>3&&s+1==o/2)&&(e[r+1]/o/1e3|0)==a1(10,t-3)-1,a}function sn(e,t,n){for(var i,r,o=[0],a=0,s=e.length;a<s;){for(r=o.length;r--;)o[r]*=t;for(o[0]+=aG.indexOf(e.charAt(a++)),i=0;i<o.length;i++)o[i]>n-1&&(void 0===o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/n|0,o[i]%=n)}return o.reverse()}a9.absoluteValue=a9.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),sr(e)},a9.ceil=function(){return sr(new this.constructor(this),this.e+1,2)},a9.clampedTo=a9.clamp=function(e,t){var n=this.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(aX+t);return 0>this.cmp(e)?e:this.cmp(t)>0?t:new n(this)},a9.comparedTo=a9.cmp=function(e){var t,n,i,r,o=this.d,a=(e=new this.constructor(e)).d,s=this.s,l=e.s;if(!o||!a)return s&&l?s!==l?s:o===a?0:!o^s<0?1:-1:NaN;if(!o[0]||!a[0])return o[0]?s:a[0]?-l:0;if(s!==l)return s;if(this.e!==e.e)return this.e>e.e^s<0?1:-1;for(t=0,n=(i=o.length)<(r=a.length)?i:r;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^s<0?1:-1;return i===r?0:i>r^s<0?1:-1},a9.cosine=a9.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+7,i.rounding=1,n=function(e,t){var n,i,r;if(t.isZero())return t;(i=t.d.length)<32?r=(1/sx(4,n=Math.ceil(i/3))).toString():(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=sy(e,1,t.times(r),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(i,sb(i,n)),i.precision=e,i.rounding=t,sr(2==aW||3==aW?n.neg():n,e,t,!0)):new i(1):new i(NaN)},a9.cubeRoot=a9.cbrt=function(){var e,t,n,i,r,o,a,s,l,u,c=this.constructor;if(!this.isFinite()||this.isZero())return new c(this);for(aY=!1,(o=this.s*a1(this.s*this,1/3))&&Math.abs(o)!=1/0?i=new c(o.toString()):(n=a7(this.d),(o=((e=this.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=a1(n,1/3),e=a0((e+1)/3)-(e%3==(e<0?-1:2)),(i=new c(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=this.s),a=(e=c.precision)+3;;)if(i=si((u=(l=(s=i).times(s).times(s)).plus(this)).plus(this).times(s),u.plus(l),a+2,1),a7(s.d).slice(0,a)===(n=a7(i.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(r||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(sr(i,e+1,1),t=!i.times(i).times(i).eq(this));break}if(!r&&(sr(s,e+1,0),s.times(s).times(s).eq(this))){i=s;break}a+=4,r=1}return aY=!0,sr(i,e,c.rounding,t)},a9.decimalPlaces=a9.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-a0(this.e/7))*7,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},a9.dividedBy=a9.div=function(e){return si(this,new this.constructor(e))},a9.dividedToIntegerBy=a9.divToInt=function(e){var t=this.constructor;return sr(si(this,new t(e),0,1,1),t.precision,t.rounding)},a9.equals=a9.eq=function(e){return 0===this.cmp(e)},a9.floor=function(){return sr(new this.constructor(this),this.e+1,3)},a9.greaterThan=a9.gt=function(e){return this.cmp(e)>0},a9.greaterThanOrEqualTo=a9.gte=function(e){var t=this.cmp(e);return 1==t||0===t},a9.hyperbolicCosine=a9.cosh=function(){var e,t,n,i,r,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,i=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(r=o.d.length)<32?t=(1/sx(4,e=Math.ceil(r/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=sy(a,1,o.times(t),new a(1),!0);for(var l,u=e,c=new a(8);u--;)l=o.times(o),o=s.minus(l.times(c.minus(l.times(c))));return sr(o,a.precision=n,a.rounding=i,!0)},a9.hyperbolicSine=a9.sinh=function(){var e,t,n,i,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(r.e,r.sd())+4,o.rounding=1,(i=r.d.length)<3)r=sy(o,2,r,r,!0);else{e=(e=1.4*Math.sqrt(i))>16?16:0|e,r=sy(o,2,r=r.times(1/sx(5,e)),r,!0);for(var a,s=new o(5),l=new o(16),u=new o(20);e--;)a=r.times(r),r=r.times(s.plus(a.times(l.times(a).plus(u))))}return o.precision=t,o.rounding=n,sr(r,t,n,!0)},a9.hyperbolicTangent=a9.tanh=function(){var e,t,n=this.constructor;return this.isFinite()?this.isZero()?new n(this):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,si(this.sinh(),this.cosh(),n.precision=e,n.rounding=t)):new n(this.s)},a9.inverseCosine=a9.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),i=t.precision,r=t.rounding;return -1!==n?0===n?e.isNeg()?sl(t,i,r):new t(0):new t(NaN):e.isZero()?sl(t,i+4,r).times(.5):(t.precision=i+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=i,t.rounding=r,e.times(2))},a9.inverseHyperbolicCosine=a9.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,aY=!1,n=n.times(n).minus(1).sqrt().plus(n),aY=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},a9.inverseHyperbolicSine=a9.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,aY=!1,n=n.times(n).plus(1).sqrt().plus(n),aY=!0,i.precision=e,i.rounding=t,n.ln())},a9.inverseHyperbolicTangent=a9.atanh=function(){var e,t,n,i,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=o.precision,t=o.rounding,Math.max(i=r.sd(),e)<-(2*r.e)-1)?sr(new o(r),e,t,!0):(o.precision=n=i-r.e,r=si(r.plus(1),new o(1).minus(r),n+e,1),o.precision=e+4,o.rounding=1,r=r.ln(),o.precision=e,o.rounding=t,r.times(.5)):new o(NaN)},a9.inverseSine=a9.asin=function(){var e,t,n,i,r=this,o=r.constructor;return r.isZero()?new o(r):(t=r.abs().cmp(1),n=o.precision,i=o.rounding,-1!==t)?0===t?((e=sl(o,n+4,i).times(.5)).s=r.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=i,r.times(2))},a9.inverseTangent=a9.atan=function(){var e,t,n,i,r,o,a,s,l,u=this,c=u.constructor,h=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);else if(u.abs().eq(1)&&h+4<=a8)return(a=sl(c,h+4,d).times(.25)).s=u.s,a}else{if(!u.s)return new c(NaN);if(h+4<=a8)return(a=sl(c,h+4,d).times(.5)).s=u.s,a}for(c.precision=s=h+10,c.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(aY=!1,t=Math.ceil(s/7),i=1,l=u.times(u),a=new c(u),r=u;-1!==e;)if(r=r.times(l),o=a.minus(r.div(i+=2)),r=r.times(l),void 0!==(a=o.plus(r.div(i+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),aY=!0,sr(a,c.precision=h,c.rounding=d,!0)},a9.isFinite=function(){return!!this.d},a9.isInteger=a9.isInt=function(){return!!this.d&&a0(this.e/7)>this.d.length-2},a9.isNaN=function(){return!this.s},a9.isNegative=a9.isNeg=function(){return this.s<0},a9.isPositive=a9.isPos=function(){return this.s>0},a9.isZero=function(){return!!this.d&&0===this.d[0]},a9.lessThan=a9.lt=function(e){return 0>this.cmp(e)},a9.lessThanOrEqualTo=a9.lte=function(e){return 1>this.cmp(e)},a9.logarithm=a9.log=function(e){var t,n,i,r,o,a,s,l=this.constructor,u=l.precision,c=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new l(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(t)if(n.length>1)r=!0;else{for(i=n[0];i%10==0;)i/=10;r=1!==i}if(aY=!1,st((s=si(o=sg(this,a=u+5),t?ss(l,a+10):sg(e,a),a,1)).d,i=u,c))do if(a+=10,s=si(o=sg(this,a),t?ss(l,a+10):sg(e,a),a,1),!r){+a7(s.d).slice(i+1,i+15)+1==1e14&&(s=sr(s,u+1,0));break}while(st(s.d,i+=10,c));return aY=!0,sr(s,u,c)},a9.minus=a9.sub=function(e){var t,n,i,r,o,a,s,l,u,c,h,d,f=this.constructor;if(e=new f(e),!this.d||!e.d)return this.s&&e.s?this.d?e.s=-e.s:e=new f(e.d||this.s!==e.s?this:NaN):e=new f(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.plus(e);if(u=this.d,d=e.d,s=f.precision,l=f.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else{if(!u[0])return new f(3===l?-0:0);e=new f(this)}return aY?sr(e,s,l):e}if(n=a0(e.e/7),c=a0(this.e/7),u=u.slice(),o=c-n){for((h=o<0)?(t=u,o=-o,a=d.length):(t=d,n=c,a=u.length),o>(i=Math.max(Math.ceil(s/7),a)+2)&&(o=i,t.length=1),t.reverse(),i=o;i--;)t.push(0);t.reverse()}else{for((h=(i=u.length)<(a=d.length))&&(a=i),i=0;i<a;i++)if(u[i]!=d[i]){h=u[i]<d[i];break}o=0}for(h&&(t=u,u=d,d=t,e.s=-e.s),a=u.length,i=d.length-a;i>0;--i)u[a++]=0;for(i=d.length;i>o;){if(u[--i]<d[i]){for(r=i;r&&0===u[--r];)u[r]=1e7-1;--u[r],u[i]+=1e7}u[i]-=d[i]}for(;0===u[--a];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(e.d=u,e.e=sa(u,n),aY?sr(e,s,l):e):new f(3===l?-0:0)},a9.modulo=a9.mod=function(e){var t,n=this.constructor;return(e=new n(e),this.d&&e.s&&(!e.d||e.d[0]))?e.d&&(!this.d||this.d[0])?(aY=!1,9==n.modulo?(t=si(this,e.abs(),0,3,1),t.s*=e.s):t=si(this,e,0,n.modulo,1),t=t.times(e),aY=!0,this.minus(t)):sr(new n(this),n.precision,n.rounding):new n(NaN)},a9.naturalExponential=a9.exp=function(){return sp(this)},a9.naturalLogarithm=a9.ln=function(){return sg(this)},a9.negated=a9.neg=function(){var e=new this.constructor(this);return e.s=-e.s,sr(e)},a9.plus=a9.add=function(e){var t,n,i,r,o,a,s,l,u,c,h=this.constructor;if(e=new h(e),!this.d||!e.d)return this.s&&e.s?this.d||(e=new h(e.d||this.s===e.s?this:NaN)):e=new h(NaN),e;if(this.s!=e.s)return e.s=-e.s,this.minus(e);if(u=this.d,c=e.d,s=h.precision,l=h.rounding,!u[0]||!c[0])return c[0]||(e=new h(this)),aY?sr(e,s,l):e;if(o=a0(this.e/7),i=a0(e.e/7),u=u.slice(),r=o-i){for(r<0?(n=u,r=-r,a=c.length):(n=c,i=o,a=u.length),r>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(r=a,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for((a=u.length)-(r=c.length)<0&&(r=a,n=c,c=u,u=n),t=0;r;)t=(u[--r]=u[r]+c[r]+t)/1e7|0,u[r]%=1e7;for(t&&(u.unshift(t),++i),a=u.length;0==u[--a];)u.pop();return e.d=u,e.e=sa(u,i),aY?sr(e,s,l):e},a9.precision=a9.sd=function(e){var t;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(aX+e);return this.d?(t=su(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},a9.round=function(){var e=this.constructor;return sr(new e(this),this.e+1,e.rounding)},a9.sine=a9.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+7,i.rounding=1,n=function(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:sy(e,2,t,t);n=(n=1.4*Math.sqrt(i))>16?16:0|n,t=sy(e,2,t=t.times(1/sx(5,n)),t);for(var r,o=new e(5),a=new e(16),s=new e(20);n--;)r=t.times(t),t=t.times(o.plus(r.times(a.times(r).minus(s))));return t}(i,sb(i,n)),i.precision=e,i.rounding=t,sr(aW>2?n.neg():n,e,t,!0)):new i(NaN)},a9.squareRoot=a9.sqrt=function(){var e,t,n,i,r,o,a=this.d,s=this.e,l=this.s,u=this.constructor;if(1!==l||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?this:1/0);for(aY=!1,0==(l=Math.sqrt(+this))||l==1/0?(((t=a7(a)).length+s)%2==0&&(t+="0"),l=Math.sqrt(t),s=a0((s+1)/2)-(s<0||s%2),i=new u(t=l==1/0?"5e"+s:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+s)):i=new u(l.toString()),n=(s=u.precision)+3;;)if(i=(o=i).plus(si(this,o,n+2,1)).times(.5),a7(o.d).slice(0,n)===(t=a7(i.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(sr(i,s+1,1),e=!i.times(i).eq(this));break}if(!r&&(sr(o,s+1,0),o.times(o).eq(this))){i=o;break}n+=4,r=1}return aY=!0,sr(i,s,u.rounding,e)},a9.tangent=a9.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,(n=n.sin()).s=1,n=si(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,sr(2==aW||4==aW?n.neg():n,e,t,!0)):new i(NaN)},a9.times=a9.mul=function(e){var t,n,i,r,o,a,s,l,u,c=this.constructor,h=this.d,d=(e=new c(e)).d;if(e.s*=this.s,!h||!h[0]||!d||!d[0])return new c(!e.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:!h||!d?e.s/0:0*e.s);for(n=a0(this.e/7)+a0(e.e/7),(l=h.length)<(u=d.length)&&(o=h,h=d,d=o,a=l,l=u,u=a),o=[],i=a=l+u;i--;)o.push(0);for(i=u;--i>=0;){for(t=0,r=l+i;r>i;)s=o[r]+d[i]*h[r-i-1]+t,o[r--]=s%1e7|0,t=s/1e7|0;o[r]=(o[r]+t)%1e7|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=sa(o,n),aY?sr(e,c.precision,c.rounding):e},a9.toBinary=function(e,t){return sw(this,2,e,t)},a9.toDecimalPlaces=a9.toDP=function(e,t){var n=this,i=n.constructor;return(n=new i(n),void 0===e)?n:(se(e,0,1e9),void 0===t?t=i.rounding:se(t,0,8),sr(n,e+n.e+1,t))},a9.toExponential=function(e,t){var n,i=this,r=i.constructor;return void 0===e?n=so(i,!0):(se(e,0,1e9),void 0===t?t=r.rounding:se(t,0,8),n=so(i=sr(new r(i),e+1,t),!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},a9.toFixed=function(e,t){var n,i,r=this.constructor;return void 0===e?n=so(this):(se(e,0,1e9),void 0===t?t=r.rounding:se(t,0,8),n=so(i=sr(new r(this),e+this.e+1,t),!1,e+i.e+1)),this.isNeg()&&!this.isZero()?"-"+n:n},a9.toFraction=function(e){var t,n,i,r,o,a,s,l,u,c,h,d,f=this.d,p=this.constructor;if(!f)return new p(this);if(u=n=new p(1),i=l=new p(0),a=(o=(t=new p(i)).e=su(f)-this.e-1)%7,t.d[0]=a1(10,a<0?7+a:a),null==e)e=o>0?t:u;else{if(!(s=new p(e)).isInt()||s.lt(u))throw Error(aX+s);e=s.gt(t)?o>0?t:u:s}for(aY=!1,s=new p(a7(f)),c=p.precision,p.precision=o=7*f.length*2;h=si(s,t,0,1,1),1!=(r=n.plus(h.times(i))).cmp(e);)n=i,i=r,r=u,u=l.plus(h.times(r)),l=r,r=t,t=s.minus(h.times(r)),s=r;return r=si(e.minus(n),i,0,1,1),l=l.plus(r.times(u)),n=n.plus(r.times(i)),l.s=u.s=this.s,d=1>si(u,i,o,1).minus(this).abs().cmp(si(l,n,o,1).minus(this).abs())?[u,i]:[l,n],p.precision=c,aY=!0,d},a9.toHexadecimal=a9.toHex=function(e,t){return sw(this,16,e,t)},a9.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),null==e){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),void 0===t?t=i.rounding:se(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(aY=!1,n=si(n,e,0,t,1).times(e),aY=!0,sr(n)):(e.s=n.s,n=e),n},a9.toNumber=function(){return+this},a9.toOctal=function(e,t){return sw(this,8,e,t)},a9.toPower=a9.pow=function(e){var t,n,i,r,o,a,s=this,l=s.constructor,u=+(e=new l(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new l(a1(+s,u));if((s=new l(s)).eq(1))return s;if(i=l.precision,o=l.rounding,e.eq(1))return sr(s,i,o);if((t=a0(e.e/7))>=e.d.length-1&&(n=u<0?-u:u)<=0x1fffffffffffff)return r=sh(l,s,n,i),e.s<0?new l(1).div(r):sr(r,i,o);if((a=s.s)<0){if(t<e.d.length-1)return new l(NaN);if((1&e.d[t])==0&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(n=a1(+s,u))&&isFinite(n)?new l(n+"").e:a0(u*(Math.log("0."+a7(s.d))/Math.LN10+s.e+1)))>l.maxE+1||t<l.minE-1?new l(t>0?a/0:0):(aY=!1,l.rounding=s.s=1,n=Math.min(12,(t+"").length),(r=sp(e.times(sg(s,i+n)),i)).d&&st((r=sr(r,i+5,1)).d,i,o)&&(t=i+10,+a7((r=sr(sp(e.times(sg(s,t+n)),t),t+5,1)).d).slice(i+1,i+15)+1==1e14&&(r=sr(r,i+1,0))),r.s=a,aY=!0,l.rounding=o,sr(r,i,o))},a9.toPrecision=function(e,t){var n,i=this,r=i.constructor;return void 0===e?n=so(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(se(e,1,1e9),void 0===t?t=r.rounding:se(t,0,8),n=so(i=sr(new r(i),e,t),e<=i.e||i.e<=r.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},a9.toSignificantDigits=a9.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(se(e,1,1e9),void 0===t?t=n.rounding:se(t,0,8)),sr(new n(this),e,t)},a9.toString=function(){var e=this.constructor,t=so(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+t:t},a9.truncated=a9.trunc=function(){return sr(new this.constructor(this),this.e+1,1)},a9.valueOf=a9.toJSON=function(){var e=this.constructor,t=so(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+t:t};var si=function(){function e(e,t,n){var i,r=0,o=e.length;for(e=e.slice();o--;)i=e[o]*t+r,e[o]=i%n|0,r=i/n|0;return r&&e.unshift(r),e}function t(e,t,n,i){var r,o;if(n!=i)o=n>i?1:-1;else for(r=o=0;r<n;r++)if(e[r]!=t[r]){o=e[r]>t[r]?1:-1;break}return o}function n(e,t,n,i){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*i+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(i,r,o,a,s,l){var u,c,h,d,f,p,g,m,v,y,x,b,w,S,_,C,M,A,k,T,I=i.constructor,D=i.s==r.s?1:-1,O=i.d,P=r.d;if(!O||!O[0]||!P||!P[0])return new I(!i.s||!r.s||(O?P&&O[0]==P[0]:!P)?NaN:O&&0==O[0]||!P?0*D:D/0);for(l?(f=1,c=i.e-r.e):(l=1e7,f=7,c=a0(i.e/f)-a0(r.e/f)),k=P.length,M=O.length,y=(v=new I(D)).d=[],h=0;P[h]==(O[h]||0);h++);if(P[h]>(O[h]||0)&&c--,null==o?(S=o=I.precision,a=I.rounding):S=s?o+(i.e-r.e)+1:o,S<0)y.push(1),p=!0;else{if(S=S/f+2|0,h=0,1==k){for(d=0,P=P[0],S++;(h<M||d)&&S--;h++)_=d*l+(O[h]||0),y[h]=_/P|0,d=_%P|0;p=d||h<M}else{for((d=l/(P[0]+1)|0)>1&&(P=e(P,d,l),O=e(O,d,l),k=P.length,M=O.length),C=k,b=(x=O.slice(0,k)).length;b<k;)x[b++]=0;(T=P.slice()).unshift(0),A=P[0],P[1]>=l/2&&++A;do d=0,(u=t(P,x,k,b))<0?(w=x[0],k!=b&&(w=w*l+(x[1]||0)),(d=w/A|0)>1?(d>=l&&(d=l-1),m=(g=e(P,d,l)).length,b=x.length,1==(u=t(g,x,m,b))&&(d--,n(g,k<m?T:P,m,l))):(0==d&&(u=d=1),g=P.slice()),(m=g.length)<b&&g.unshift(0),n(x,g,b,l),-1==u&&(b=x.length,(u=t(P,x,k,b))<1&&(d++,n(x,k<b?T:P,b,l))),b=x.length):0===u&&(d++,x=[0]),y[h++]=d,u&&x[0]?x[b++]=O[C]||0:(x=[O[C]],b=1);while((C++<M||void 0!==x[0])&&S--);p=void 0!==x[0]}y[0]||y.shift()}if(1==f)v.e=c,aH=p;else{for(h=1,d=y[0];d>=10;d/=10)h++;v.e=h+c*f-1,sr(v,s?o+v.e+1:o,a,p)}return v}}();function sr(e,t,n,i){var r,o,a,s,l,u,c,h,d,f=e.constructor;e:if(null!=t){if(!(h=e.d))return e;for(r=1,s=h[0];s>=10;s/=10)r++;if((o=t-r)<0)o+=7,a=t,l=(c=h[d=0])/a1(10,r-a-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(s=h.length))if(i){for(;s++<=d;)h.push(0);c=l=0,r=1,o%=7,a=o-7+1}else break e;else{for(r=1,c=s=h[d];s>=10;s/=10)r++;o%=7,l=(a=o-7+r)<0?0:c/a1(10,r-a-1)%10|0}if(i=i||t<0||void 0!==h[d+1]||(a<0?c:c%a1(10,r-a-1)),u=n<4?(l||i)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||i||6==n&&(o>0?a>0?c/a1(10,r-a):0:h[d-1])%10&1||n==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=a1(10,(7-t%7)%7),e.e=-t||0):h[0]=e.e=0,e;if(0==o?(h.length=d,s=1,d--):(h.length=d+1,s=a1(10,7-o),h[d]=a>0?(c/a1(10,r-a)%a1(10,a)|0)*s:0),u)for(;;)if(0==d){for(o=1,a=h[0];a>=10;a/=10)o++;for(a=h[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,1e7==h[0]&&(h[0]=1));break}else{if(h[d]+=s,1e7!=h[d])break;h[d--]=0,s=1}for(o=h.length;0===h[--o];)h.pop()}return aY&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function so(e,t,n){if(!e.isFinite())return sm(e);var i,r=e.e,o=a7(e.d),a=o.length;return t?(n&&(i=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+sc(i):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):r<0?(o="0."+sc(-r-1)+o,n&&(i=n-a)>0&&(o+=sc(i))):r>=a?(o+=sc(r+1-a),n&&(i=n-r-1)>0&&(o=o+"."+sc(i))):((i=r+1)<a&&(o=o.slice(0,i)+"."+o.slice(i)),n&&(i=n-a)>0&&(r+1===a&&(o+="."),o+=sc(i))),o}function sa(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function ss(e,t,n){if(t>a6)throw aY=!0,n&&(e.precision=n),Error(aK);return sr(new e(a$),t,1,!0)}function sl(e,t,n){if(t>a8)throw Error(aK);return sr(new e(aU),t,n,!0)}function su(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function sc(e){for(var t="";e--;)t+="0";return t}function sh(e,t,n,i){var r,o=new e(1),a=Math.ceil(i/7+4);for(aY=!1;;){if(n%2&&sS((o=o.times(t)).d,a)&&(r=!0),0===(n=a0(n/2))){n=o.d.length-1,r&&0===o.d[n]&&++o.d[n];break}sS((t=t.times(t)).d,a)}return aY=!0,o}function sd(e){return 1&e.d[e.d.length-1]}function sf(e,t,n){for(var i,r,o=new e(t[0]),a=0;++a<t.length;){if(!(r=new e(t[a])).s){o=r;break}((i=o.cmp(r))===n||0===i&&o.s===n)&&(o=r)}return o}function sp(e,t){var n,i,r,o,a,s,l,u=0,c=0,h=0,d=e.constructor,f=d.rounding,p=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?!e.d[0]?1:e.s<0?0:1/0:e.s?e.s<0?0:e:0/0);for(null==t?(aY=!1,l=p):l=t,s=new d(.03125);e.e>-2;)e=e.times(s),h+=5;for(l+=i=Math.log(a1(2,h))/Math.LN10*2+5|0,n=o=a=new d(1),d.precision=l;;){if(o=sr(o.times(e),l,1),n=n.times(++c),a7((s=a.plus(si(o,n,l,1))).d).slice(0,l)===a7(a.d).slice(0,l)){for(r=h;r--;)a=sr(a.times(a),l,1);if(null!=t)return d.precision=p,a;if(!(u<3&&st(a.d,l-i,f,u)))return sr(a,d.precision=p,f,aY=!0);d.precision=l+=10,n=o=s=new d(1),c=0,u++}a=s}}function sg(e,t){var n,i,r,o,a,s,l,u,c,h,d,f=1,p=e,g=p.d,m=p.constructor,v=m.rounding,y=m.precision;if(p.s<0||!g||!g[0]||!p.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=p.s?NaN:g?0:p);if(null==t?(aY=!1,c=y):c=t,m.precision=c+=10,i=(n=a7(g)).charAt(0),!(15e14>Math.abs(o=p.e)))return u=ss(m,c+2,y).times(o+""),p=sg(new m(i+"."+n.slice(1)),c-10).plus(u),m.precision=y,null==t?sr(p,y,v,aY=!0):p;for(;i<7&&1!=i||1==i&&n.charAt(1)>3;)i=(n=a7((p=p.times(e)).d)).charAt(0),f++;for(o=p.e,i>1?(p=new m("0."+n),o++):p=new m(i+"."+n.slice(1)),h=p,l=a=p=si(p.minus(1),p.plus(1),c,1),d=sr(p.times(p),c,1),r=3;;){if(a=sr(a.times(d),c,1),a7((u=l.plus(si(a,new m(r),c,1))).d).slice(0,c)===a7(l.d).slice(0,c)){if(l=l.times(2),0!==o&&(l=l.plus(ss(m,c+2,y).times(o+""))),l=si(l,new m(f),c,1),null!=t)return m.precision=y,l;if(!st(l.d,c-10,v,s))return sr(l,m.precision=y,v,aY=!0);m.precision=c+=10,u=a=p=si(h.minus(1),h.plus(1),c,1),d=sr(p.times(p),c,1),r=s=1}l=u,r+=2}}function sm(e){return String(e.s*e.s/0)}function sv(e,t){var n,i,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;48===t.charCodeAt(i);i++);for(r=t.length;48===t.charCodeAt(r-1);--r);if(t=t.slice(i,r)){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%7,n<0&&(i+=7),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=7;i<r;)e.d.push(+t.slice(i,i+=7));i=7-(t=t.slice(i)).length}else i-=r;for(;i--;)t+="0";e.d.push(+t),aY&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function sy(e,t,n,i,r){var o,a,s,l,u=e.precision,c=Math.ceil(u/7);for(aY=!1,l=n.times(n),s=new e(i);;){if(a=si(s.times(l),new e(t++*t++),u,1),s=r?i.plus(a):i.minus(a),i=si(a.times(l),new e(t++*t++),u,1),void 0!==(a=s.plus(i)).d[c]){for(o=c;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=i,i=a,a=o}return aY=!0,a.d.length=c+1,a}function sx(e,t){for(var n=e;--t;)n*=e;return n}function sb(e,t){var n,i=t.s<0,r=sl(e,e.precision,1),o=r.times(.5);if((t=t.abs()).lte(o))return aW=i?4:1,t;if((n=t.divToInt(r)).isZero())aW=i?3:2;else{if((t=t.minus(n.times(r))).lte(o))return aW=sd(n)?i?2:3:i?4:1,t;aW=sd(n)?i?1:4:i?3:2}return t.minus(r).abs()}function sw(e,t,n,i){var r,o,a,s,l,u,c,h,d,f=e.constructor,p=void 0!==n;if(p?(se(n,1,1e9),void 0===i?i=f.rounding:se(i,0,8)):(n=f.precision,i=f.rounding),e.isFinite()){for(a=(c=so(e)).indexOf("."),p?(r=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):r=t,a>=0&&(c=c.replace(".",""),(d=new f(1)).e=c.length-a,d.d=sn(so(d),10,r),d.e=d.d.length),o=l=(h=sn(c,10,r)).length;0==h[--l];)h.pop();if(h[0]){if(a<0?o--:((e=new f(e)).d=h,e.e=o,h=(e=si(e,d,n,i,0,r)).d,o=e.e,u=aH),a=h[n],s=r/2,u=u||void 0!==h[n+1],u=i<4?(void 0!==a||u)&&(0===i||i===(e.s<0?3:2)):a>s||a===s&&(4===i||u||6===i&&1&h[n-1]||i===(e.s<0?8:7)),h.length=n,u)for(;++h[--n]>r-1;)h[n]=0,n||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(a=0,c="";a<l;a++)c+=aG.charAt(h[a]);if(p){if(l>1)if(16==t||8==t){for(a=16==t?4:3,--l;l%a;l++)c+="0";for(l=(h=sn(c,r,t)).length;!h[l-1];--l);for(a=1,c="1.";a<l;a++)c+=aG.charAt(h[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}else c=p?"0p+0":"0";c=(16==t?"0x":2==t?"0b":8==t?"0o":"")+c}else c=sm(e);return e.s<0?"-"+c:c}function sS(e,t){if(e.length>t)return e.length=t,!0}function s_(e){return new this(e).abs()}function sC(e){return new this(e).acos()}function sM(e){return new this(e).acosh()}function sA(e,t){return new this(e).plus(t)}function sk(e){return new this(e).asin()}function sT(e){return new this(e).asinh()}function sI(e){return new this(e).atan()}function sD(e){return new this(e).atanh()}function sO(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,o=i+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?sl(this,i,r):new this(0)).s=e.s:!e.d||t.isZero()?(n=sl(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(si(e,t,o,1)),t=sl(this,o,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(si(e,t,o,1)):(n=sl(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function sP(e){return new this(e).cbrt()}function sR(e){return sr(e=new this(e),e.e+1,2)}function sE(e,t,n){return new this(e).clamp(t,n)}function sL(e){if(!e||"object"!=typeof e)throw Error(aZ+"Object expected");var t,n,i,r=!0===e.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],r&&(this[n]=aq[n]),void 0!==(i=e[n]))if(a0(i)===i&&i>=o[t+1]&&i<=o[t+2])this[n]=i;else throw Error(aX+n+": "+i);if(n="crypto",r&&(this[n]=aq[n]),void 0!==(i=e[n]))if(!0===i||!1===i||0===i||1===i)if(i)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(aQ);else this[n]=!1;else throw Error(aX+n+": "+i);return this}function sN(e){return new this(e).cos()}function sB(e){return new this(e).cosh()}function sF(e,t){return new this(e).div(t)}function sz(e){return new this(e).exp()}function sV(e){return sr(e=new this(e),e.e+1,3)}function sj(){var e,t,n=new this(0);for(e=0,aY=!1;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return aY=!0,new this(1/0);n=t}return aY=!0,n.sqrt()}function sH(e){return e instanceof s7||e&&e.toStringTag===aJ||!1}function sW(e){return new this(e).ln()}function sG(e,t){return new this(e).log(t)}function s$(e){return new this(e).log(2)}function sU(e){return new this(e).log(10)}function sq(){return sf(this,arguments,-1)}function sY(){return sf(this,arguments,1)}function sZ(e,t){return new this(e).mod(t)}function sX(e,t){return new this(e).mul(t)}function sK(e,t){return new this(e).pow(t)}function sQ(e){var t,n,i,r,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:se(e,1,1e9),i=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));o<i;)(r=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);o<i;)(r=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(r%1e7),o+=4);o=i/4}else throw Error(aQ);else for(;o<i;)s[o++]=1e7*Math.random()|0;for(i=s[--o],e%=7,i&&e&&(r=a1(10,7-e),s[o]=(i/r|0)*r);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(i=1,r=s[0];r>=10;r/=10)i++;i<7&&(n-=7-i)}return a.e=n,a.d=s,a}function sJ(e){return sr(e=new this(e),e.e+1,this.rounding)}function s0(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function s1(e){return new this(e).sin()}function s2(e){return new this(e).sinh()}function s5(e){return new this(e).sqrt()}function s3(e,t){return new this(e).sub(t)}function s4(){var e=0,t=arguments,n=new this(t[0]);for(aY=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return aY=!0,sr(n,this.precision,this.rounding)}function s6(e){return new this(e).tan()}function s8(e){return new this(e).tanh()}function s9(e){return sr(e=new this(e),e.e+1,1)}a9[Symbol.for("nodejs.util.inspect.custom")]=a9.toString,a9[Symbol.toStringTag]="Decimal";var s7=a9.constructor=function e(t){var n,i,r;function o(e){var t,n,i;if(!(this instanceof o))return new o(e);if(this.constructor=o,sH(e)){this.s=e.s,aY?!e.d||e.e>o.maxE?(this.e=NaN,this.d=null):e.e<o.minE?(this.e=0,this.d=[0]):(this.e=e.e,this.d=e.d.slice()):(this.e=e.e,this.d=e.d?e.d.slice():e.d);return}if("number"==(i=typeof e)){if(0===e){this.s=1/e<0?-1:1,this.e=0,this.d=[0];return}if(e<0?(e=-e,this.s=-1):this.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;aY?t>o.maxE?(this.e=NaN,this.d=null):t<o.minE?(this.e=0,this.d=[0]):(this.e=t,this.d=[e]):(this.e=t,this.d=[e]);return}if(0*e!=0){e||(this.s=NaN),this.e=NaN,this.d=null;return}return sv(this,e.toString())}if("string"===i)return 45===(n=e.charCodeAt(0))?(e=e.slice(1),this.s=-1):(43===n&&(e=e.slice(1)),this.s=1),a4.test(e)?sv(this,e):function(e,t){var n,i,r,o,a,s,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),a4.test(t))return sv(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(a5.test(t))n=16,t=t.toLowerCase();else if(a2.test(t))n=2;else if(a3.test(t))n=8;else throw Error(aX+t);for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,i=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,r=sh(i,new i(n),o,2*o)),o=c=(u=sn(t,n,1e7)).length-1;0===u[o];--o)u.pop();return o<0?new i(0*e.s):(e.e=sa(u,c),e.d=u,aY=!1,a&&(e=si(e,r,4*s)),l&&(e=e.times(54>Math.abs(l)?a1(2,l):s7.pow(2,l))),aY=!0,e)}(this,e);if("bigint"===i)return e<0?(e=-e,this.s=-1):this.s=1,sv(this,e.toString());throw Error(aX+e)}if(o.prototype=a9,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=sL,o.clone=e,o.isDecimal=sH,o.abs=s_,o.acos=sC,o.acosh=sM,o.add=sA,o.asin=sk,o.asinh=sT,o.atan=sI,o.atanh=sD,o.atan2=sO,o.cbrt=sP,o.ceil=sR,o.clamp=sE,o.cos=sN,o.cosh=sB,o.div=sF,o.exp=sz,o.floor=sV,o.hypot=sj,o.ln=sW,o.log=sG,o.log10=sU,o.log2=s$,o.max=sq,o.min=sY,o.mod=sZ,o.mul=sX,o.pow=sK,o.random=sQ,o.round=sJ,o.sign=s0,o.sin=s1,o.sinh=s2,o.sqrt=s5,o.sub=s3,o.sum=s4,o.tan=s6,o.tanh=s8,o.trunc=s9,void 0===t&&(t={}),t&&!0!==t.defaults)for(n=0,r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];n<r.length;)t.hasOwnProperty(i=r[n++])||(t[i]=this[i]);return o.config(t),o}(aq);a$=new s7(a$),aU=new s7(aU);var le={createBigNumberClass:o5("BigNumber",["?on","config"],e=>{var{on:t,config:n}=e,i=s7.clone({precision:n.precision,modulo:s7.EUCLID});return i.prototype=Object.create(i.prototype),i.prototype.type="BigNumber",i.prototype.isBigNumber=!0,i.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},i.fromJSON=function(e){return new i(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&i.config({precision:e.precision})}),i},{isClass:!0})},lt={createMatrixClass:o5("Matrix",[],()=>{function e(){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0})},ln={MatrixDependencies:lt,createDenseMatrixClass:o5("DenseMatrix",["Matrix"],e=>{var{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");if(t&&!om(t))throw Error("Invalid datatype: "+t);if(oy(e))"DenseMatrix"===e.type?(this._data=oX(e._data),this._size=oX(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&ov(e.data)&&ov(e.size))this._data=e.data,this._size=e.size,ad(this._data,this._size),this._datatype=t||e.datatype;else if(ov(e))this._data=function e(t){for(var n=0,i=t.length;n<i;n++){var r=t[n];ov(r)?t[n]=e(r):r&&!0===r.isMatrix&&(t[n]=e(r.valueOf()))}return t}(e),this._size=ah(this._data),ad(this._data,this._size),this._datatype=t;else if(e)throw TypeError("Unsupported type of data ("+oZ(e)+")");else this._data=[],this._size=[0],this._datatype=t}function i(e,t,n){if(0===t.length){for(var i=e._data;ov(i);)i=i[0];return i}return e._size=t.slice(0),e._data=ap(e._data,e._size,n),e}function r(e,t,n){for(var r=e._size.slice(0),o=!1;r.length<t.length;)r.push(0),o=!0;for(var a=0,s=t.length;a<s;a++)t[a]>r[a]&&(r[a]=t[a],o=!0);o&&i(e,r,n)}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return ay(this._data,oZ)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,i){switch(arguments.length){case 1:return function(e,t){if(!o_(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var i=t.size();if(i.length!==e._size.length)throw new au(i.length,e._size.length);for(var r=t.min(),o=t.max(),a=0,s=e._size.length;a<s;a++)af(r[a],e._size[a]),af(o[a],e._size[a]);return new n(function e(t,n,i,r){var o=r===i-1,a=n.dimension(r);return o?a.map(function(e){return af(e,t.length),t[e]}).valueOf():a.map(function(o){return af(o,t.length),e(t[o],n,i,r+1)}).valueOf()}(e._data,t,i.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,n,i){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var o,a=t.size(),s=t.isScalar();if(oy(n)?(o=n.size(),n=n.valueOf()):o=ah(n),s){if(0!==o.length)throw TypeError("Scalar expected");e.set(t.min(),n,i)}else{if(a.length<e._size.length)throw new au(a.length,e._size.length,"<");if(o.length<a.length){for(var l=0,u=0;1===a[l]&&1===o[l];)l++;for(;1===a[l];)u++,l++;n=av(n,a.length,u,o)}if(!oQ(a,o))throw new au(a,o,">");r(e,t.max().map(function(e){return e+1}),i);var c=a.length;!function e(t,n,i,r,o){var a=o===r-1,s=n.dimension(o);a?s.forEach(function(e,n){af(e),t[e]=i[n[0]]}):s.forEach(function(a,s){af(a),e(t[a],n,i[s[0]],r,o+1)})}(e._data,t,n,c,0)}return e}(this,e,t,i);default:throw SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){if(!ov(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new au(e.length,this._size.length);for(var t=0;t<e.length;t++)af(e[t],this._size[t]);for(var n=this._data,i=0,r=e.length;i<r;i++){var o=e[i];af(o,n.length),n=n[o]}return n},n.prototype.set=function(e,t,n){if(!ov(e))throw TypeError("Array expected");if(e.length<this._size.length)throw new au(e.length,this._size.length,"<");r(this,e.map(function(e){return e+1}),n);var i,o,a,s=this._data;for(i=0,o=e.length-1;i<o;i++)af(a=e[i],s.length),s=s[a];return af(a=e[e.length-1],s.length),s[a]=t,this},n.prototype.resize=function(e,t,n){if(!ox(e))throw TypeError("Array or Matrix expected");var r=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);return i(n?this.clone():this,r,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;n._data=function(e,t){var n=function(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}(e),i=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError("Array expected");if(0===t.length)throw new au(0,i,"!=");var r=am(t=ag(t,i));if(i!==r)throw new au(r,i,"!=");try{return function(e,t){for(var n,i=e,r=t.length-1;r>0;r--){var o=t[r];n=[];for(var a=i.length/o,s=0;s<a;s++)n.push(i.slice(s*o,(s+1)*o));i=n}return i}(n,t)}catch(e){if(e instanceof au)throw new au(r,i,"!=");throw e}}(n._data,e);var i=n._size.reduce((e,t)=>e*t);return n._size=ag(e,i),n},n.prototype.clone=function(){return new n({data:oX(this._data),size:oX(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,i=function n(i,r){return ov(i)?i.map(function(e,t){return n(e,r.concat(t))}):e(i,r,t)}(this._data,[]),r=void 0!==this._datatype?ay(i,oZ):void 0;return new n(i,r)},n.prototype.forEach=function(e){var t=this;!function n(i,r){ov(i)?i.forEach(function(e,t){n(e,r.concat(t))}):e(i,r,t)}(this._data,[])},n.prototype[Symbol.iterator]=function*(){var e=function* e(t,n){if(ov(t))for(var i=0;i<t.length;i++)yield*e(t[i],n.concat(i));else yield{value:t,index:n}};yield*e(this._data,[])},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var t of this._data)e.push(new n([t],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],i=this.size();if(2!==i.length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var r=this._data,o=function(i){var o=r.map(e=>[e[i]]);t.push(new n(o,e._datatype))},a=0;a<i[1];a++)o(a);return t},n.prototype.toArray=function(){return oX(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return al(this._data,e)},n.prototype.toString=function(){return al(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(od(e)&&(e=e.toNumber()),!oh(e)||!o6(e))throw TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,i=e<0?-e:0,r=Math.min(this._size[0]-i,this._size[1]-t),o=[],a=0;a<r;a++)o[a]=this._data[a+i][a+t];return new n({data:o,size:[r],datatype:this._datatype})},n.diagonal=function(e,t,i,r){if(!ov(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(od(e)&&(e=e.toNumber()),!oh(e)||!o6(e)||e<1)throw Error("Size values must be positive integers");return e}),i){if(od(i)&&(i=i.toNumber()),!oh(i)||!o6(i))throw TypeError("The parameter k must be an integer number")}else i=0;var o,a=i>0?i:0,s=i<0?-i:0,l=e[0],u=e[1],c=Math.min(l-s,u-a);if(ov(t)){if(t.length!==c)throw Error("Invalid value array length");o=function(e){return t[e]}}else if(oy(t)){var h=t.size();if(1!==h.length||h[0]!==c)throw Error("Invalid matrix length");o=function(e){return t.get([e])}}else o=function(){return t};r||(r=od(o(0))?o(0).mul(0):0);var d=[];if(e.length>0){d=ap(d,e,r);for(var f=0;f<c;f++)d[f+s][f+a]=o(f)}return new n({data:d,size:[l,u]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!oh(e)||!o6(e)||!oh(t)||!o6(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return af(e,this._size[0]),af(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var i=n[e];n[e]=n[t],n[t]=i},n},{isClass:!0})};let li=Math.cosh||function(e){return 1e-9>Math.abs(e)?1-e:(Math.exp(e)+Math.exp(-e))*.5},lr=Math.sinh||function(e){return 1e-9>Math.abs(e)?e:(Math.exp(e)-Math.exp(-e))*.5},lo=function(e,t){return((e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8)?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},la=function(){throw SyntaxError("Invalid Param")};function ls(e,t){let n=Math.abs(e),i=Math.abs(t);return 0===e?Math.log(i):0===t?Math.log(n):n<3e3&&i<3e3?.5*Math.log(e*e+t*t):.5*Math.log((e*=.5)*e+(t*=.5)*t)+Math.LN2}let ll={re:0,im:0},lu=function(e,t){if(null==e)ll.re=ll.im=0;else if(void 0!==t)ll.re=e,ll.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)ll.re=e.re,ll.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return lc.INFINITY;ll.re=e.abs*Math.cos(e.arg),ll.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return lc.INFINITY;ll.re=e.r*Math.cos(e.phi),ll.im=e.r*Math.sin(e.phi)}else 2===e.length?(ll.re=e[0],ll.im=e[1]):la();break;case"string":ll.im=ll.re=0;let n=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,r=0;null===n&&la();for(let e=0;e<n.length;e++){let t=n[e];" "===t||" "===t||"\n"===t||("+"===t?i++:"-"===t?r++:("i"===t||"I"===t?(i+r===0&&la()," "===n[e+1]||isNaN(n[e+1])?ll.im+=parseFloat((r%2?"-":"")+"1"):(ll.im+=parseFloat((r%2?"-":"")+n[e+1]),e++)):((i+r===0||isNaN(t))&&la(),"i"===n[e+1]||"I"===n[e+1]?(ll.im+=parseFloat((r%2?"-":"")+t),e++):ll.re+=parseFloat((r%2?"-":"")+t)),i=r=0))}i+r>0&&la();break;case"number":ll.im=0,ll.re=e;break;default:la()}return isNaN(ll.re)||isNaN(ll.im),ll};function lc(e,t){if(!(this instanceof lc))return new lc(e,t);let n=lu(e,t);this.re=n.re,this.im=n.im}lc.prototype={re:0,im:0,sign:function(){let e=lo(this.re,this.im);return new lc(this.re/e,this.im/e)},add:function(e,t){let n=lu(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im));return i||r?i&&r?lc.NAN:lc.INFINITY:new lc(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=lu(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im));return i||r?i&&r?lc.NAN:lc.INFINITY:new lc(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=lu(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;return i&&a||r&&o?lc.NAN:i||r?lc.INFINITY:0===n.im&&0===this.im?new lc(this.re*n.re,0):new lc(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=lu(e,t),i=this.isInfinite(),r=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;if(o&&a||i&&r)return lc.NAN;if(a||i)return lc.INFINITY;if(o||r)return lc.ZERO;if(0===n.im)return new lc(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new lc((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{let e=n.im/n.re,t=n.im*e+n.re;return new lc((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=lu(e,t),i=0===this.re&&0===this.im;if(0===n.re&&0===n.im)return lc.ONE;if(0===n.im){if(0===this.im&&this.re>0)return new lc(Math.pow(this.re,n.re),0);else if(0===this.re)switch((n.re%4+4)%4){case 0:return new lc(Math.pow(this.im,n.re),0);case 1:return new lc(0,Math.pow(this.im,n.re));case 2:return new lc(-Math.pow(this.im,n.re),0);case 3:return new lc(0,-Math.pow(this.im,n.re))}}if(i&&n.re>0)return lc.ZERO;let r=Math.atan2(this.im,this.re),o=ls(this.re,this.im),a=Math.exp(n.re*o-n.im*r),s=n.im*o+n.re*r;return new lc(a*Math.cos(s),a*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(0===t)if(e>=0)return new lc(Math.sqrt(e),0);else return new lc(0,Math.sqrt(-e));let n=Math.sqrt(.5*(lo(e,t)+Math.abs(e))),i=Math.abs(t)/(2*n);return e>=0?new lc(n,t<0?-i:i):new lc(i,t<0?-n:n)},exp:function(){let e=Math.exp(this.re);return 0===this.im?new lc(e,0):new lc(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e,t=this.re,n=this.im;return new lc(Math.expm1(t)*Math.cos(n)+-2*(e=Math.sin(.5*n))*e,Math.exp(t)*Math.sin(n))},log:function(){let e=this.re,t=this.im;return 0===t&&e>0?new lc(Math.log(e),0):new lc(ls(e,t),Math.atan2(t,e))},abs:function(){return lo(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new lc(Math.sin(e)*li(t),Math.cos(e)*lr(t))},cos:function(){let e=this.re,t=this.im;return new lc(Math.cos(e)*li(t),-Math.sin(e)*lr(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+li(t);return new lc(Math.sin(e)/n,lr(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-li(t);return new lc(-Math.sin(e)/n,lr(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*li(2*t)+.5*Math.cos(2*e);return new lc(Math.cos(e)*li(t)/n,Math.sin(e)*lr(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*li(2*t)-.5*Math.cos(2*e);return new lc(Math.sin(e)*li(t)/n,-Math.cos(e)*lr(t)/n)},asin:function(){let e=this.re,t=this.im,n=new lc(t*t-e*e+1,-2*e*t).sqrt(),i=new lc(n.re-t,n.im+e).log();return new lc(i.im,-i.re)},acos:function(){let e=this.re,t=this.im,n=new lc(t*t-e*e+1,-2*e*t).sqrt(),i=new lc(n.re-t,n.im+e).log();return new lc(Math.PI/2-i.im,i.re)},atan:function(){let e=this.re,t=this.im;if(0===e){if(1===t)return new lc(0,1/0);if(-1===t)return new lc(0,-1/0)}let n=e*e+(1-t)*(1-t),i=new lc((1-t*t-e*e)/n,-2*e/n).log();return new lc(-.5*i.im,.5*i.re)},acot:function(){let e=this.re,t=this.im;if(0===t)return new lc(Math.atan2(1,e),0);let n=e*e+t*t;return 0!==n?new lc(e/n,-t/n).atan():new lc(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lc(0,1/0);let n=e*e+t*t;return 0!==n?new lc(e/n,-t/n).acos():new lc(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lc(Math.PI/2,1/0);let n=e*e+t*t;return 0!==n?new lc(e/n,-t/n).asin():new lc(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){let e=this.re,t=this.im;return new lc(lr(e)*Math.cos(t),li(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new lc(li(e)*Math.cos(t),lr(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=li(e)+Math.cos(t);return new lc(lr(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=li(e)-Math.cos(t);return new lc(lr(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-li(2*e);return new lc(-2*lr(e)*Math.cos(t)/n,2*li(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+li(2*e);return new lc(2*li(e)*Math.cos(t)/n,-2*lr(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new lc(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new lc(e<0?-n:n,0)}let n=new lc(e*e-t*t+1,2*e*t).sqrt();return new lc(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(0===t){if(e>1)return new lc(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new lc(Math.log(-e+t),Math.PI)}return new lc(0,Math.acos(e))}let n=new lc(e-1,t).sqrt(),i=new lc(e+1,t).sqrt();return new lc(e+n.re*i.re-n.im*i.im,t+n.re*i.im+n.im*i.re).log()},atanh:function(){let e=this.re,t=this.im;if(0===t)return 0===e?new lc(0,0):1===e?new lc(1/0,0):-1===e?new lc(-1/0,0):-1<e&&e<1?new lc(.5*Math.log((1+e)/(1-e)),0):e>1?new lc(.5*Math.log((e+1)/(e-1)),-Math.PI/2):new lc(.5*Math.log(-((1+e)/(1-e))),Math.PI/2);let n=1-e,i=1+e,r=n*n+t*t;if(0===r)return new lc(-1!==e?e/0:0,0!==t?t/0:0);let o=(i*n-t*t)/r,a=(t*n+i*t)/r;return new lc(ls(o,a)/2,Math.atan2(a,o)/2)},acoth:function(){let e=this.re,t=this.im;if(0===e&&0===t)return new lc(0,Math.PI/2);let n=e*e+t*t;return 0!==n?new lc(e/n,-t/n).atanh():new lc(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){let e=this.re,t=this.im;if(0===t){if(0===e)return new lc(1/0,0);let t=1/e;return new lc(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return 0!==n?new lc(e/n,-t/n).asinh():new lc(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return lc.INFINITY;let n=e*e+t*t;return 0!==n?new lc(e/n,-t/n).acosh():new lc(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return lc.INFINITY;if(this.isInfinite())return lc.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new lc(e/n,-t/n)},conjugate:function(){return new lc(this.re,-this.im)},neg:function(){return new lc(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new lc(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new lc(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new lc(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=lu(e,t);return Math.abs(n.re-this.re)<=lc.EPSILON&&Math.abs(n.im-this.im)<=lc.EPSILON},clone:function(){return new lc(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<lc.EPSILON&&(e=0),Math.abs(t)<lc.EPSILON&&(t=0),0===t)?n+e:(0!==e?(n+=e,n+=" ",t<0?(t=-t,n+="-"):n+="+",n+=" "):t<0&&(t=-t,n+="-"),1!==t&&(n+=t),n+"i")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},lc.ZERO=new lc(0,0),lc.ONE=new lc(1,0),lc.I=new lc(0,1),lc.PI=new lc(Math.PI,0),lc.E=new lc(Math.E,0),lc.INFINITY=new lc(1/0,1/0),lc.NAN=new lc(NaN,NaN),lc.EPSILON=1e-15;var lh=o5("Complex",[],()=>(lc.prototype.type="Complex",lc.prototype.isComplex=!0,lc.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},lc.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},lc.prototype.format=function(e){var t=this.im,n=this.re,i=o9(this.re,e),r=o9(this.im,e),o=oh(e)?e:e?e.precision:null;if(null!==o){var a=Math.pow(10,-o);Math.abs(n/t)<a&&(n=0),Math.abs(t/n)<a&&(t=0)}return 0===t?i:0===n?1===t?"i":-1===t?"-i":r+"i":t<0?-1===t?i+" - i":i+" - "+r.substring(1)+"i":1===t?i+" + i":i+" + "+r+"i"},lc.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return lc(t);throw TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],i=arguments[1];if(oh(n)){if(og(i)&&i.hasBase("ANGLE")&&(i=i.toNumber("rad")),oh(i))return new lc({r:n,phi:i});throw TypeError("Phi is not a number nor an angle unit.")}throw TypeError("Radius r is not a number.");default:throw SyntaxError("Wrong number of arguments in function fromPolar")}},lc.prototype.valueOf=lc.prototype.toString,lc.fromJSON=function(e){return new lc(e)},lc.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},lc),{isClass:!0}),ld={s:1,n:0,d:1};function lf(e,t){if(isNaN(e=parseInt(e,10)))throw lb();return e*t}function lp(e,t){if(0===t)throw lx();var n=Object.create(ly.prototype);n.s=e<0?-1:1;var i=lv(e=e<0?-e:e,t);return n.n=e/i,n.d=t/i,n}function lg(e){for(var t={},n=e,i=2,r=4;r<=n;){for(;n%i==0;)n/=i,t[i]=(t[i]||0)+1;r+=1+2*i++}return n!==e?n>1&&(t[n]=(t[n]||0)+1):t[e]=(t[e]||0)+1,t}var lm=function(e,t){var n,i=0,r=1,o=1,a=0,s=0,l=0,u=1,c=1,h=0,d=1,f=1,p=1;if(null==e);else if(void 0!==t){if(o=(i=e)*(r=t),i%1!=0||r%1!=0)throw lw()}else switch(typeof e){case"object":if("d"in e&&"n"in e)i=e.n,r=e.d,"s"in e&&(i*=e.s);else if(0 in e)i=e[0],1 in e&&(r=e[1]);else throw lb();o=i*r;break;case"number":if(e<0&&(o=e,e=-e),e%1==0)i=e;else if(e>0){for(e>=1&&(c=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=c);d<=1e7&&p<=1e7;){if(e===(n=(h+f)/(d+p))){d+p<=1e7?(i=h+f,r=d+p):p>d?(i=f,r=p):(i=h,r=d);break}e>n?(h+=f,d+=p):(f+=h,p+=d),d>1e7?(i=f,r=p):(i=h,r=d)}i*=c}else(isNaN(e)||isNaN(t))&&(r=i=NaN);break;case"string":if(null===(d=e.match(/\d+|./g)))throw lb();if("-"===d[h]?(o=-1,h++):"+"===d[h]&&h++,d.length===h+1?s=lf(d[h++],o):"."===d[h+1]||"."===d[h]?("."!==d[h]&&(a=lf(d[h++],o)),(++h+1===d.length||"("===d[h+1]&&")"===d[h+3]||"'"===d[h+1]&&"'"===d[h+3])&&(s=lf(d[h],o),u=Math.pow(10,d[h].length),h++),("("===d[h]&&")"===d[h+2]||"'"===d[h]&&"'"===d[h+2])&&(l=lf(d[h+1],o),c=Math.pow(10,d[h+1].length)-1,h+=3)):"/"===d[h+1]||":"===d[h+1]?(s=lf(d[h],o),u=lf(d[h+2],1),h+=3):"/"===d[h+3]&&" "===d[h+1]&&(a=lf(d[h],o),s=lf(d[h+2],o),u=lf(d[h+4],1),h+=5),d.length<=h){o=i=l+(r=u*c)*a+c*s;break}default:throw lb()}if(0===r)throw lx();ld.s=o<0?-1:1,ld.n=Math.abs(i),ld.d=Math.abs(r)};function lv(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function ly(e,t){if(lm(e,t),!(this instanceof ly))return lp(ld.s*ld.n,ld.d);e=lv(ld.d,ld.n),this.s=ld.s,this.n=ld.n/e,this.d=ld.d/e}var lx=function(){return Error("Division by Zero")},lb=function(){return Error("Invalid argument")},lw=function(){return Error("Parameters must be integer")};ly.prototype={s:1,n:0,d:1,abs:function(){return lp(this.n,this.d)},neg:function(){return lp(-this.s*this.n,this.d)},add:function(e,t){return lm(e,t),lp(this.s*this.n*ld.d+ld.s*this.d*ld.n,this.d*ld.d)},sub:function(e,t){return lm(e,t),lp(this.s*this.n*ld.d-ld.s*this.d*ld.n,this.d*ld.d)},mul:function(e,t){return lm(e,t),lp(this.s*ld.s*this.n*ld.n,this.d*ld.d)},div:function(e,t){return lm(e,t),lp(this.s*ld.s*this.n*ld.d,this.d*ld.n)},clone:function(){return lp(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new ly(NaN);if(void 0===e)return lp(this.s*this.n%this.d,1);if(lm(e,t),0===ld.n&&0===this.d)throw lx();return lp(this.s*(ld.d*this.n)%(ld.n*this.d),ld.d*this.d)},gcd:function(e,t){return lm(e,t),lp(lv(ld.n,this.n)*lv(ld.d,this.d),ld.d*this.d)},lcm:function(e,t){return(lm(e,t),0===ld.n&&0===this.n)?lp(0,1):lp(ld.n*this.n,lv(ld.n,this.n)*lv(ld.d,this.d))},ceil:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new ly(NaN):lp(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new ly(NaN):lp(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return(e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d))?new ly(NaN):lp(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,t){return lm(e,t),lp(this.s*Math.round(this.n*ld.d/(this.d*ld.n))*ld.n,ld.d)},inverse:function(){return lp(this.s*this.d,this.n)},pow:function(e,t){if(lm(e,t),1===ld.d)if(ld.s<0)return lp(Math.pow(this.s*this.d,ld.n),Math.pow(this.n,ld.n));else return lp(Math.pow(this.s*this.n,ld.n),Math.pow(this.d,ld.n));if(this.s<0)return null;var n=lg(this.n),i=lg(this.d),r=1,o=1;for(var a in n)if("1"!==a){if("0"===a){r=0;break}if(n[a]*=ld.n,n[a]%ld.d!=0)return null;n[a]/=ld.d,r*=Math.pow(a,n[a])}for(var a in i)if("1"!==a){if(i[a]*=ld.n,i[a]%ld.d!=0)return null;i[a]/=ld.d,o*=Math.pow(a,i[a])}return ld.s<0?lp(o,r):lp(r,o)},equals:function(e,t){return lm(e,t),this.s*this.n*ld.d==ld.s*ld.n*this.d},compare:function(e,t){lm(e,t);var n=this.s*this.n*ld.d-ld.s*ld.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),n=t.toContinued(),i=1;i<n.length;i++){for(var r=lp(n[i-1],1),o=i-2;o>=0;o--)r=r.inverse().add(n[o]);if(Math.abs(r.sub(t).valueOf())<e)return r.mul(this.s)}return this},divisible:function(e,t){return lm(e,t),!(!(ld.n*this.d)||this.n*ld.d%(ld.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",i=this.n,r=this.d;return this.s<0&&(n+="-"),1===r?n+=i:(e&&(t=Math.floor(i/r))>0&&(n+=t,n+=" ",i%=r),n+=i,n+="/",n+=r),n},toLatex:function(e){var t,n="",i=this.n,r=this.d;return this.s<0&&(n+="-"),1===r?n+=i:(e&&(t=Math.floor(i/r))>0&&(n+=t,i%=r),n+="\\frac{",n+=i,n+="}{",n+=r,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,i=[];if(isNaN(t)||isNaN(n))return i;do i.push(Math.floor(t/n)),e=t%n,t=n,n=e;while(1!==t);return i},toString:function(e){var t=this.n,n=this.d;if(isNaN(t)||isNaN(n))return"NaN";e=e||15;var i=function(e){for(;e%2==0;e/=2);for(;e%5==0;e/=5);if(1===e)return 0;for(var t=10%e,n=1;1!==t;n++)if(t=10*t%e,n>2e3)return 0;return n}(n),r=function(e,t){for(var n=1,i=function(e,t,n){for(var i=1;t>0;e=e*e%n,t>>=1)1&t&&(i=i*e%n);return i}(10,t,e),r=0;r<300;r++){if(n===i)return r;n=10*n%e,i=10*i%e}return 0}(n,i),o=this.s<0?"-":"";if(o+=t/n|0,t%=n,(t*=10)&&(o+="."),i){for(var a=r;a--;)o+=t/n|0,t%=n,t*=10;o+="(";for(var a=i;a--;)o+=t/n|0,t%=n,t*=10;o+=")"}else for(var a=e;t&&a--;)o+=t/n|0,t%=n,t*=10;return o}};var lS=o5("Fraction",[],()=>(ly.prototype.type="Fraction",ly.prototype.isFraction=!0,ly.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},ly.fromJSON=function(e){return new ly(e)},ly),{isClass:!0}),l_=n(42915);function lC(e,t){return!!e&&"object"==typeof e&&(!!o0(lA,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function lM(e){return"object"==typeof e&&e&&e.constructor===Object}var lA={length:!0,name:!0},lk={toString:!0,valueOf:!0,toLocaleString:!0};class lT{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){var t,n,i=this.wrappedObject;if(lM(i)&&lC(i,e))return i[e];if("function"==typeof i[e]&&(t=i,n=e,!(null==t||"function"!=typeof t[n]||o0(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(o0(lk,n)||!(n in Object.prototype)&&!(n in Function.prototype))))throw Error('Cannot access method "'+e+'" as a property');throw Error('No access to property "'+e+'"')}set(e,t){return!function(e,t,n){if(lM(e)&&lC(e,t))return e[t]=n;throw Error('No access to property "'+t+'"')}(this.wrappedObject,e,t),this}has(e){return e in this.wrappedObject}}function lI(e){return!!e&&(e instanceof Map||e instanceof lT||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}var lD=function(){return lD=l_.create,l_};function lO(e){throw Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function lP(e){throw Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function lR(e){throw Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var lE={BigNumberDependencies:le,ComplexDependencies:{createComplexClass:lh},DenseMatrixDependencies:ln,FractionDependencies:{createFractionClass:lS},createTyped:o5("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:r}=e,o=lD();return o.types=[{name:"number",test:oh},{name:"Complex",test:of},{name:"BigNumber",test:od},{name:"Fraction",test:op},{name:"Unit",test:og},{name:"string",test:om},{name:"Chain",test:oY},{name:"Array",test:ov},{name:"Matrix",test:oy},{name:"DenseMatrix",test:ob},{name:"SparseMatrix",test:ow},{name:"Range",test:oS},{name:"Index",test:o_},{name:"boolean",test:oC},{name:"ResultSet",test:oM},{name:"Help",test:oA},{name:"function",test:ok},{name:"Date",test:oT},{name:"RegExp",test:oI},{name:"null",test:oO},{name:"undefined",test:oP},{name:"AccessorNode",test:oR},{name:"ArrayNode",test:oE},{name:"AssignmentNode",test:oL},{name:"BlockNode",test:oN},{name:"ConditionalNode",test:oB},{name:"ConstantNode",test:oF},{name:"FunctionNode",test:oV},{name:"FunctionAssignmentNode",test:oz},{name:"IndexNode",test:oj},{name:"Node",test:oH},{name:"ObjectNode",test:oW},{name:"OperatorNode",test:oG},{name:"ParenthesisNode",test:o$},{name:"RangeNode",test:oU},{name:"SymbolNode",test:oq},{name:"Map",test:lI},{name:"Object",test:oD}],o.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||lO(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||lP(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||lP(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||lP(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){r||lR(e);var t=new r(e);if(t.valueOf()!==e)throw TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||lO(e);try{return new t(e)}catch(t){throw Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){r||lR(e);try{return new r(e)}catch(t){throw Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||lP(e);try{return new n(e)}catch(t){throw Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||lO(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return r||lR(e),new r(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return i||function(){throw Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new i(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],o})},lL="equalScalar",lN=o5(lL,["typed","config"],e=>{var{typed:t,config:n}=e;return t(lL,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return ao(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||function(e,t,n){if(null==n)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var i=e.minus(t).abs();if(i.isZero())return!0;var r=e.constructor.max(e.abs(),t.abs());return i.lte(r.times(n))}return!1}(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){var i;return i=n.epsilon,ao(e.re,t.re,i)&&ao(e.im,t.im,i)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw Error("Cannot compare units with different base");return this(e.value,t.value)}})});o5(lL,["typed","config"],e=>{var{typed:t,config:n}=e;return t(lL,{"number, number":function(e,t){return ao(e,t,n.epsilon)}})});var lB={typedDependencies:lE,createEqualScalar:lN},lF=o5("SparseMatrix",["typed","equalScalar","Matrix"],e=>{var{typed:t,equalScalar:n,Matrix:i}=e;function r(e,t){if(!(this instanceof r))throw SyntaxError("Constructor must be called with the new operator");if(t&&!om(t))throw Error("Invalid datatype: "+t);if(oy(e)){var n,i,a;n=this,i=e,a=t,"SparseMatrix"===i.type?(n._values=i._values?oX(i._values):void 0,n._index=oX(i._index),n._ptr=oX(i._ptr),n._size=oX(i._size),n._datatype=a||i._datatype):o(n,i.valueOf(),a||i._datatype)}else if(e&&ov(e.index)&&ov(e.ptr)&&ov(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(ov(e))o(this,e,t);else if(e)throw TypeError("Unsupported type of data ("+oZ(e)+")");else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}function o(e,i,r){e._values=[],e._index=[],e._ptr=[],e._datatype=r;var o=i.length,a=0,s=n,l=0;if(om(r)&&(s=t.find(n,[r,r])||n,l=t.convert(0,r)),o>0){var u=0;do{e._ptr.push(e._index.length);for(var c=0;c<o;c++){var h=i[c];if(ov(h)){if(0===u&&a<h.length&&(a=h.length),u<h.length){var d=h[u];s(d,l)||(e._values.push(d),e._index.push(c))}}else 0===u&&a<1&&(a=1),s(h,l)||(e._values.push(h),e._index.push(c))}u++}while(u<a)}e._ptr.push(e._index.length),e._size=[o,a]}function a(e,t,n,i){if(n-t==0)return n;for(var r=t;r<n;r++)if(i[r]===e)return r;return t}function s(e,t,n,i,r,o,a){r.splice(e,0,i),o.splice(e,0,t);for(var s=n+1;s<a.length;s++)a[s]++}function l(e,i,r,o){var a,s,l,u=o||0,c=n,h=0;om(e._datatype)&&(c=t.find(n,[e._datatype,e._datatype])||n,h=t.convert(0,e._datatype),u=t.convert(u,e._datatype));var d=!c(u,h),f=e._size[0],p=e._size[1];if(r>p){for(s=p;s<r;s++)if(e._ptr[s]=e._values.length,d)for(a=0;a<f;a++)e._values.push(u),e._index.push(a);e._ptr[r]=e._values.length}else r<p&&(e._ptr.splice(r+1,p-r),e._values.splice(e._ptr[r],e._values.length),e._index.splice(e._ptr[r],e._index.length));if(p=r,i>f){if(d){var g=0;for(s=0;s<p;s++){e._ptr[s]=e._ptr[s]+g,l=e._ptr[s+1]+g;var m=0;for(a=f;a<i;a++,m++)e._values.splice(l+m,0,u),e._index.splice(l+m,0,a),g++}e._ptr[p]=e._values.length}}else if(i<f){var v=0;for(s=0;s<p;s++){e._ptr[s]=e._ptr[s]-v;var y=e._ptr[s],x=e._ptr[s+1]-v;for(l=y;l<x;l++)(a=e._index[l])>i-1&&(e._values.splice(l,1),e._index.splice(l,1),v++)}e._ptr[s]=e._values.length}return e._size[0]=i,e._size[1]=r,e}function u(e,t,n,i,r){var o,a,s=i[0],l=i[1],u=[];for(o=0;o<s;o++)for(a=0,u[o]=[];a<l;a++)u[o][a]=0;for(a=0;a<l;a++)for(var c=n[a],h=n[a+1],d=c;d<h;d++)u[o=t[d]][a]=e?r?oX(e[d]):e[d]:1;return u}return r.prototype=new i,r.prototype.createSparseMatrix=function(e,t){return new r(e,t)},r.prototype.type="SparseMatrix",r.prototype.isSparseMatrix=!0,r.prototype.getDataType=function(){return ay(this._values,oZ)},r.prototype.storage=function(){return"sparse"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(e,t){return new r(e,t)},r.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},r.prototype.subset=function(e,t,n){if(!this._values)throw Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!o_(t))throw TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,i,o,a,s=t.size();if(s.length!==e._size.length)throw new au(s.length,e._size.length);var l=t.min(),u=t.max();for(n=0,i=e._size.length;n<i;n++)af(l[n],e._size[n]),af(u[n],e._size[n]);var c=e._values,h=e._index,d=e._ptr,f=t.dimension(0),p=t.dimension(1),g=[],m=[];f.forEach(function(e,t){m[e]=t[0],g[e]=!0});var v=c?[]:void 0,y=[],x=[];return p.forEach(function(e){for(x.push(y.length),o=d[e],a=d[e+1];o<a;o++)!0===g[n=h[o]]&&(y.push(m[n]),v&&v.push(c[o]))}),x.push(y.length),new r({values:v,index:y,ptr:x,size:s,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,n,i){if(!t||!0!==t.isIndex)throw TypeError("Invalid index");var r,o=t.size(),a=t.isScalar();if(oy(n)?(r=n.size(),n=n.toArray()):r=ah(n),a){if(0!==r.length)throw TypeError("Scalar expected");e.set(t.min(),n,i)}else{if(1!==o.length&&2!==o.length)throw new au(o.length,e._size.length,"<");if(r.length<o.length){for(var s=0,l=0;1===o[s]&&1===r[s];)s++;for(;1===o[s];)l++,s++;n=av(n,o.length,l,r)}if(!oQ(o,r))throw new au(o,r,">");if(1===o.length)t.dimension(0).forEach(function(t,r){af(t),e.set([t,0],n[r[0]],i)});else{var u=t.dimension(0),c=t.dimension(1);u.forEach(function(t,r){af(t),c.forEach(function(o,a){af(o),e.set([t,o],n[r[0]][a[0]],i)})})}}return e}(this,e,t,n);default:throw SyntaxError("Wrong number of arguments")}},r.prototype.get=function(e){if(!ov(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new au(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke get on a Pattern only matrix");var t=e[0],n=e[1];af(t,this._size[0]),af(n,this._size[1]);var i=a(t,this._ptr[n],this._ptr[n+1],this._index);return i<this._ptr[n+1]&&this._index[i]===t?this._values[i]:0},r.prototype.set=function(e,i,r){if(!ov(e))throw TypeError("Array expected");if(e.length!==this._size.length)throw new au(e.length,this._size.length);if(!this._values)throw Error("Cannot invoke set on a Pattern only matrix");var o=e[0],u=e[1],c=this._size[0],h=this._size[1],d=n,f=0;om(this._datatype)&&(d=t.find(n,[this._datatype,this._datatype])||n,f=t.convert(0,this._datatype)),(o>c-1||u>h-1)&&(l(this,Math.max(o+1,c),Math.max(u+1,h),r),c=this._size[0],h=this._size[1]),af(o,c),af(u,h);var p=a(o,this._ptr[u],this._ptr[u+1],this._index);return p<this._ptr[u+1]&&this._index[p]===o?d(i,f)?function(e,t,n,i,r){n.splice(e,1),i.splice(e,1);for(var o=t+1;o<r.length;o++)r[o]--}(p,u,this._values,this._index,this._ptr):this._values[p]=i:s(p,o,u,i,this._values,this._index,this._ptr),this},r.prototype.resize=function(e,t,n){if(!ox(e))throw TypeError("Array or Matrix expected");var i=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);if(2!==i.length)throw Error("Only two dimensions matrix are supported");return i.forEach(function(e){if(!oh(e)||!o6(e)||e<0)throw TypeError("Invalid size, must contain positive integers (size: "+al(i)+")")}),l(n?this.clone():this,i[0],i[1],t)},r.prototype.reshape=function(e,t){if(!ov(e))throw TypeError("Array expected");if(2!==e.length)throw Error("Sparse matrices can only be reshaped in two dimensions");e.forEach(function(t){if(!oh(t)||!o6(t)||t<=-2||0===t)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+al(e)+")")});var n=this._size[0]*this._size[1],i=(e=ag(e,n))[0]*e[1];if(n!==i)throw Error("Reshaping sparse matrix will result in the wrong number of elements");var r=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return r;for(var o=[],l=0;l<r._ptr.length;l++)for(var u=0;u<r._ptr[l+1]-r._ptr[l];u++)o.push(l);for(var c=r._values.slice(),h=r._index.slice(),d=0;d<r._index.length;d++){var f=h[d],p=o[d],g=f*r._size[1]+p;o[d]=g%e[1],h[d]=Math.floor(g/e[1])}r._values.length=0,r._index.length=0,r._ptr.length=e[1]+1,r._size=e.slice();for(var m=0;m<r._ptr.length;m++)r._ptr[m]=0;for(var v=0;v<c.length;v++){var y=h[v],x=o[v],b=c[v];s(a(y,r._ptr[x],r._ptr[x+1],r._index),y,x,b,r._values,r._index,r._ptr)}return r},r.prototype.clone=function(){return new r({values:this._values?oX(this._values):void 0,index:oX(this._index),ptr:oX(this._ptr),size:oX(this._size),datatype:this._datatype})},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(e,i){if(!this._values)throw Error("Cannot invoke map on a Pattern only matrix");var o=this;return function(e,i,o,a,s){var l=[],u=[],c=[],h=n,d=0;om(e._datatype)&&(h=t.find(n,[e._datatype,e._datatype])||n,d=t.convert(0,e._datatype));for(var f=function(e,t,n){e=a(e,t,n),h(e,d)||(l.push(e),u.push(t))},p=0;p<=o;p++){c.push(l.length);var g=e._ptr[p],m=e._ptr[p+1];if(s)for(var v=g;v<m;v++){var y=e._index[v];y>=0&&y<=i&&f(e._values[v],y-0,p-0)}else{for(var x={},b=g;b<m;b++)x[e._index[b]]=e._values[b];for(var w=0;w<=i;w++)f(w in x?x[w]:0,w-0,p-0)}}return c.push(l.length),new r({values:l,index:u,ptr:c,size:[i-0+1,o-0+1]})}(this,this._size[0]-1,this._size[1]-1,function(t,n,i){return e(t,[n,i],o)},i)},r.prototype.forEach=function(e,t){if(!this._values)throw Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],i=this._size[1],r=0;r<i;r++){var o=this._ptr[r],a=this._ptr[r+1];if(t)for(var s=o;s<a;s++){var l=this._index[s];e(this._values[s],[l,r],this)}else{for(var u={},c=o;c<a;c++)u[this._index[c]]=this._values[c];for(var h=0;h<n;h++)e(h in u?u[h]:0,[h,r],this)}}},r.prototype[Symbol.iterator]=function*(){if(!this._values)throw Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var n=this._ptr[t],i=this._ptr[t+1],r=n;r<i;r++){var o=this._index[r];yield{value:this._values[r],index:[o,t]}}},r.prototype.toArray=function(){return u(this._values,this._index,this._ptr,this._size,!0)},r.prototype.valueOf=function(){return u(this._values,this._index,this._ptr,this._size,!1)},r.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],i=this.density(),r="Sparse Matrix ["+al(t,e)+" x "+al(n,e)+"] density: "+al(i,e)+"\n",o=0;o<n;o++)for(var a=this._ptr[o],s=this._ptr[o+1],l=a;l<s;l++)r+="\n ("+al(this._index[l],e)+", "+al(o,e)+") ==> "+(this._values?al(this._values[l],e):"X");return r},r.prototype.toString=function(){return al(this.toArray())},r.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(e){if(e){if(od(e)&&(e=e.toNumber()),!oh(e)||!o6(e))throw TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,i=this._size[0],o=this._size[1],a=Math.min(i-n,o-t),s=[],l=[],u=[];u[0]=0;for(var c=t;c<o&&s.length<a;c++)for(var h=this._ptr[c],d=this._ptr[c+1],f=h;f<d;f++){var p=this._index[f];if(p===c-t+n){s.push(this._values[f]),l[s.length-1]=p-n;break}}return u.push(s.length),new r({values:s,index:l,ptr:u,size:[a,1]})},r.fromJSON=function(e){return new r(e)},r.diagonal=function(e,i,o,a,s){if(!ov(e))throw TypeError("Array expected, size parameter");if(2!==e.length)throw Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(od(e)&&(e=e.toNumber()),!oh(e)||!o6(e)||e<1)throw Error("Size values must be positive integers");return e}),o){if(od(o)&&(o=o.toNumber()),!oh(o)||!o6(o))throw TypeError("The parameter k must be an integer number")}else o=0;var l,u=n,c=0;om(s)&&(u=t.find(n,[s,s])||n,c=t.convert(0,s));var h=o>0?o:0,d=o<0?-o:0,f=e[0],p=e[1],g=Math.min(f-d,p-h);if(ov(i)){if(i.length!==g)throw Error("Invalid value array length");l=function(e){return i[e]}}else if(oy(i)){var m=i.size();if(1!==m.length||m[0]!==g)throw Error("Invalid matrix length");l=function(e){return i.get([e])}}else l=function(){return i};for(var v=[],y=[],x=[],b=0;b<p;b++){x.push(v.length);var w=b-h;if(w>=0&&w<g){var S=l(w);u(S,c)||(y.push(w+d),v.push(S))}}return x.push(v.length),new r({values:v,index:y,ptr:x,size:[f,p]})},r.prototype.swapRows=function(e,t){if(!oh(e)||!o6(e)||!oh(t)||!o6(t))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return af(e,this._size[0]),af(t,this._size[0]),r._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},r._forEachRow=function(e,t,n,i,r){for(var o=i[e],a=i[e+1],s=o;s<a;s++)r(n[s],t[s])},r._swapRows=function(e,t,n,i,r,o){for(var s=0;s<n;s++){var l=o[s],u=o[s+1],c=a(e,l,u,r),h=a(t,l,u,r);if(c<u&&h<u&&r[c]===e&&r[h]===t){if(i){var d=i[c];i[c]=i[h],i[h]=d}continue}if(c<u&&r[c]===e&&(h>=u||r[h]!==t)){var f=i?i[c]:void 0;r.splice(h,0,t),i&&i.splice(h,0,f),r.splice(h<=c?c+1:c,1),i&&i.splice(h<=c?c+1:c,1);continue}if(h<u&&r[h]===t&&(c>=u||r[c]!==e)){var p=i?i[h]:void 0;r.splice(c,0,e),i&&i.splice(c,0,p),r.splice(c<=h?h+1:h,1),i&&i.splice(c<=h?h+1:h,1)}}},r},{isClass:!0}),lz="matrix",lV={DenseMatrixDependencies:ln,MatrixDependencies:lt,SparseMatrixDependencies:{MatrixDependencies:lt,equalScalarDependencies:lB,typedDependencies:lE,createSparseMatrixClass:lF},typedDependencies:lE,createMatrix:o5(lz,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:n,DenseMatrix:i,SparseMatrix:r}=e;return t(lz,{"":function(){return o([])},string:function(e){return o([],e)},"string, string":function(e,t){return o([],e,t)},Array:function(e){return o(e)},Matrix:function(e){return o(e,e.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(e,t,n){if("dense"===t||"default"===t||void 0===t)return new i(e,n);if("sparse"===t)return new r(e,n);throw TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})},lj="zeros",lH=o5(lj,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:n,matrix:i,BigNumber:r}=e;return t(lj,{"":function(){return"Array"===n.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===n.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var n,o=(n=!1,e.forEach(function(e,t,i){od(e)&&(n=!0,i[t]=e.toNumber())}),n)?new r(0):0;if(e.forEach(function(e){if("number"!=typeof e||!o6(e)||e<0)throw Error("Parameters in function zeros must be positive integers")}),t){var a=i(t);return e.length>0?a.resize(e,o):a}var s=[];return e.length>0?ap(s,e,o):s}}),lW=o5("algorithm11",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,i,r,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=n,g=0,m=r;"string"==typeof h&&(a=h,p=t.find(n,[a,a]),g=t.convert(0,a),i=t.convert(i,a),m=t.find(r,[a,a]));for(var v=[],y=[],x=[],b=0;b<f;b++){x[b]=y.length;for(var w=u[b],S=u[b+1],_=w;_<S;_++){var C=l[_],M=o?m(i,s[_]):m(s[_],i);p(M,g)||(y.push(C),v.push(M))}}return x[f]=y.length,e.createSparseMatrix({values:v,index:y,ptr:x,size:[d,f],datatype:a})}}),lG=o5("algorithm12",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,i,r,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=r;"string"==typeof h&&(a=h,i=t.convert(i,a),p=t.find(r,[a,a]));for(var g=[],m=[],v=[],y=0;y<f;y++){for(var x=y+1,b=u[y],w=u[y+1],S=b;S<w;S++){var _=l[S];m[_]=s[S],v[_]=x}for(var C=0;C<d;C++)0===y&&(g[C]=[]),v[C]===x?g[C][y]=o?p(i,m[C]):p(m[C],i):g[C][y]=o?p(i,0):p(0,i)}return new n({data:g,size:[d,f],datatype:a})}}),l$=o5("algorithm14",["typed"],e=>{var{typed:t}=e;return function(e,n,i,r){var o,a=e._data,s=e._size,l=e._datatype,u=i;"string"==typeof l&&(o=l,n=t.convert(n,o),u=t.find(i,[o,o]));var c=s.length>0?function e(t,n,i,r,o,a,s){var l=[];if(n===i.length-1)for(var u=0;u<r;u++)l[u]=s?t(a,o[u]):t(o[u],a);else for(var c=0;c<r;c++)l[c]=e(t,n+1,i,i[n+1],o[c],a,s);return l}(u,0,s,s[0],a,n,r):[];return e.createDenseMatrix({data:c,size:oX(s),datatype:o})}});function lU(e,t){var n;if(!o6(e)||!o6(t))throw Error("Parameters in function gcd must be integer numbers");for(;0!==t;)n=e%t,e=t,t=n;return e<0?-e:e}function lq(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o6(t)||t<0||t>15)throw Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(ae(e,t))}lU.signature="number, number";var lY="Number of decimals in function round must be an integer",lZ="round",lX=o5(lZ,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:i,zeros:r,BigNumber:o,DenseMatrix:a}=e,s=lW({typed:t,equalScalar:i}),l=lG({typed:t,DenseMatrix:a}),u=l$({typed:t});return t(lZ,{number:lq,"number, number":lq,"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lY);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(lY);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lY);var n=t.toNumber();return e.round(n)},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lY);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(lY);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(lY);return e.round(t.toNumber())},"Array | Matrix":function(e){return function e(t,n,i){return t&&"function"==typeof t.map?t.map(function(t){return e(t,n,i)}):n(t)}(e,this,!0)},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"Array, number | BigNumber":function(e,t){return u(n(e),t,this,!1).valueOf()},"number | Complex | BigNumber | Fraction, SparseMatrix":function(e,t){return i(e,0)?r(t.size(),t.storage()):l(t,e,this,!0)},"number | Complex | BigNumber | Fraction, DenseMatrix":function(e,t){return i(e,0)?r(t.size(),t.storage()):u(t,e,this,!0)},"number | Complex | BigNumber | Fraction, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})}),lK=o5("algorithm01",["typed"],e=>{var{typed:t}=e;return function(e,n,i,r){var o,a,s=e._data,l=e._size,u=e._datatype,c=n._values,h=n._index,d=n._ptr,f=n._size,p=n._datatype;if(l.length!==f.length)throw new au(l.length,f.length);if(l[0]!==f[0]||l[1]!==f[1])throw RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");if(!c)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],m=l[1],v="string"==typeof u&&u===p?u:void 0,y=v?t.find(i,[v,v]):i,x=[];for(o=0;o<g;o++)x[o]=[];var b=[],w=[];for(a=0;a<m;a++){for(var S=a+1,_=d[a],C=d[a+1],M=_;M<C;M++)b[o=h[M]]=r?y(c[M],s[o][a]):y(s[o][a],c[M]),w[o]=S;for(o=0;o<g;o++)w[o]===S?x[o][a]=b[o]:x[o][a]=s[o][a]}return e.createDenseMatrix({data:x,size:[g,m],datatype:v})}}),lQ=o5("algorithm04",["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return function(e,i,r){var o,a,s,l,u,c,h=e._values,d=e._index,f=e._ptr,p=e._size,g=e._datatype,m=i._values,v=i._index,y=i._ptr,x=i._size,b=i._datatype;if(p.length!==x.length)throw new au(p.length,x.length);if(p[0]!==x[0]||p[1]!==x[1])throw RangeError("Dimension mismatch. Matrix A ("+p+") must match Matrix B ("+x+")");var w=p[0],S=p[1],_=n,C=0,M=r;"string"==typeof g&&g===b&&(o=g,_=t.find(n,[o,o]),C=t.convert(0,o),M=t.find(r,[o,o]));var A=h&&m?[]:void 0,k=[],T=[],I=h&&m?[]:void 0,D=h&&m?[]:void 0,O=[],P=[];for(s=0;s<S;s++){T[s]=k.length;var R=s+1;for(u=f[s],c=f[s+1],l=u;l<c;l++)a=d[l],k.push(a),O[a]=R,I&&(I[a]=h[l]);for(u=y[s],c=y[s+1],l=u;l<c;l++)if(O[a=v[l]]===R){if(I){var E=M(I[a],m[l]);_(E,C)?O[a]=null:I[a]=E}}else k.push(a),P[a]=R,D&&(D[a]=m[l]);if(I&&D)for(l=T[s];l<k.length;)O[a=k[l]]===R?(A[l]=I[a],l++):P[a]===R?(A[l]=D[a],l++):k.splice(l,1)}return T[S]=k.length,e.createSparseMatrix({values:A,index:k,ptr:T,size:[w,S],datatype:o})}}),lJ=o5("algorithm10",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,i,r,o){var a,s=e._values,l=e._index,u=e._ptr,c=e._size,h=e._datatype;if(!s)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var d=c[0],f=c[1],p=r;"string"==typeof h&&(a=h,i=t.convert(i,a),p=t.find(r,[a,a]));for(var g=[],m=[],v=[],y=0;y<f;y++){for(var x=y+1,b=u[y],w=u[y+1],S=b;S<w;S++){var _=l[S];m[_]=s[S],v[_]=x}for(var C=0;C<d;C++)0===y&&(g[C]=[]),v[C]===x?g[C][y]=o?p(i,m[C]):p(m[C],i):g[C][y]=i}return new n({data:g,size:[d,f],datatype:a})}}),l0=o5("algorithm13",["typed"],e=>{var{typed:t}=e;return function(e,n,i){var r,o=e._data,a=e._size,s=e._datatype,l=n._data,u=n._size,c=n._datatype,h=[];if(a.length!==u.length)throw new au(a.length,u.length);for(var d=0;d<a.length;d++){if(a[d]!==u[d])throw RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+u+")");h[d]=a[d]}var f=i;"string"==typeof s&&s===c&&(r=s,f=t.find(i,[r,r]));var p=h.length>0?function e(t,n,i,r,o,a){var s=[];if(n===i.length-1)for(var l=0;l<r;l++)s[l]=t(o[l],a[l]);else for(var u=0;u<r;u++)s[u]=e(t,n+1,i,i[n+1],o[u],a[u]);return s}(f,0,h,h[0],o,l):[];return e.createDenseMatrix({data:p,size:h,datatype:r})}}),l1=o5("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],e=>{var{typed:t,matrix:n,equalScalar:i,BigNumber:r,DenseMatrix:o}=e,a=lK({typed:t}),s=lQ({typed:t,equalScalar:i}),l=lJ({typed:t,DenseMatrix:o}),u=l0({typed:t}),c=l$({typed:t});return t("gcd",{"number, number":lU,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw Error("Parameters in function gcd must be integer numbers");for(var n=new r(0);!t.isZero();){var i=e.mod(t);e=t,t=i}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var i=this(e,t),r=0;r<n.length;r++)i=this(i,n[r]);return i}})});let{round:l2}=aM({roundDependencies:{BigNumberDependencies:le,DenseMatrixDependencies:ln,equalScalarDependencies:lB,matrixDependencies:lV,typedDependencies:lE,zerosDependencies:{BigNumberDependencies:le,matrixDependencies:lV,typedDependencies:lE,createZeros:lH},createRound:lX}}),{gcd:l5}=aM({gcdDependencies:{BigNumberDependencies:le,DenseMatrixDependencies:ln,equalScalarDependencies:lB,matrixDependencies:lV,typedDependencies:lE,createGcd:l1}}),l3=10;function l4(e,t){let n=t.startMs,i=e.values,r=[];for(let e of i){for(;n<e[0];)r.push([n,null]),n+=t.stepMs;r.push([n,e[1]]),n+=t.stepMs}for(;n<=t.endMs;)r.push([n,null]),n+=t.stepMs;return r}function l6(e){let t,n,i=[];for(let t of e)if(t&&"timeRange"in t){if(void 0===t||void 0===t.timeRange||void 0===t.stepMs)continue;if(i.push(t.stepMs),void 0===n){n=t.timeRange;continue}t.timeRange.start<n.start&&(n.start=t.timeRange.start),t.timeRange.end>n.end&&(n.end=t.timeRange.end)}else if(t&&"values"in t){for(let e=0;e<t.values.length;e++){let i=t.values[e];if(void 0===i)continue;let[r]=i,o=new Date(r),a=new Date(r);if(void 0===n){n={start:o,end:a};continue}o<n.start&&(n.start=o),a>n.end&&(n.end=a)}if(void 0===n)return;let e=n.start.valueOf(),i=n.end.valueOf(),r=i-e;return{startMs:e,endMs:i,rangeMs:r,stepMs:l3}}if(void 0===n)return;if(1===i.length)t=i[0];else{let e=l5(...i);t=e<l3?l3:e}let r=n.start.valueOf(),o=n.end.valueOf();return{startMs:r,endMs:o,stepMs:t,rangeMs:o-r}}function l8(e){return/^[0-9a-fA-F]+$/.test(e)}function l9(e){return e.spec?.spec?.display?.name?e.spec.spec.display.name:e.spec?.display?.name?e.spec.display.name:e.metadata.name}function l7(e){return e.spec?.spec?.display?.name?`${e.spec.spec.display.name} (ID: ${e.metadata.name})`:e.spec?.display?.name?`${e.spec.display.name} (ID: ${e.metadata.name})`:e.metadata.name}let ue=(0,eI.createContext)(void 0);function ut(e){let{children:t,timeZone:n}=e;return(0,eb.jsx)(ue.Provider,{value:n,children:t})}function un(){let e=(0,eI.useContext)(ue);return{timeZone:e??"local",formatWithUserTimeZone:(t,n)=>r0(t,n,e),dateFormatOptionsWithUserTimeZone:t=>rJ(t,e)}}function ui({label:e,color:t,size:n="small",onColorChange:i,onClear:r}){let[o,a]=(0,eI.useState)(null),s=!!o,{thresholds:{defaultColor:l,palette:u}}=ti();return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(ur,{size:n,"aria-label":`change ${e} color`,isSelected:s,iconColor:t,onClick:e=>{a(e.currentTarget)},children:(0,eb.jsx)(ek,{})}),(0,eb.jsx)(e9.Ay,{"data-testid":"options color picker",open:s,anchorEl:o,onClose:()=>{a(null)},slotProps:{paper:{sx:{padding:e=>e.spacing(2)}}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},children:(0,eb.jsx)(e6,{color:t,palette:[l,...u],onChange:i,onClear:r})})]})}let ur=(0,e7.A)(eM.A,{shouldForwardProp:e=>"isSelected"!==e&&"iconColor"!==e})(({iconColor:e,isSelected:t})=>({backgroundColor:t&&e?`${e}3F`:"undefined",color:e}));var uo=n(56599),ua=n(74628),us=n(38662);function ul(e,t){return"ALL"!==t&&!!t[e.id]}var uu=n(11750),uc=n(81023),uh=n(59238),ud=n(23434),uf=n(72052),up=n(83926),ug=n(1337),um=n(54382),uv=n(29424),uy=n(67214),ux=n(29009),ub=n(46733);function uw(e){return(0,ub.Ay)("MuiListItemButton",e)}let uS=(0,ux.A)("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),u_=(0,e7.A)(ug.A,{shouldForwardProp:e=>(0,up.A)(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,ud.A)(({theme:e})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${uS.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,uh.X4)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${uS.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,uh.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${uS.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,uh.X4)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,uh.X4)(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${uS.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${uS.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),uC=eI.forwardRef(function(e,t){let n=(0,uf.b)({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:r=!1,component:o="div",children:a,dense:s=!1,disableGutters:l=!1,divider:u=!1,focusVisibleClassName:c,selected:h=!1,className:d,...f}=n,p=eI.useContext(uy.A),g=eI.useMemo(()=>({dense:s||p.dense||!1,alignItems:i,disableGutters:l}),[i,p.dense,s,l]),m=eI.useRef(null);(0,um.A)(()=>{r&&m.current&&m.current.focus()},[r]);let v={...n,alignItems:i,dense:g.dense,disableGutters:l,divider:u,selected:h},y=(e=>{let{alignItems:t,classes:n,dense:i,disabled:r,disableGutters:o,divider:a,selected:s}=e,l=(0,uc.A)({root:["root",i&&"dense",!o&&"gutters",a&&"divider",r&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},uw,n);return{...n,...l}})(v),x=(0,uv.A)(m,t);return(0,eb.jsx)(uy.A.Provider,{value:g,children:(0,eb.jsx)(u_,{ref:x,href:f.href||f.to,component:(f.href||f.to)&&"div"===o?"button":o,focusVisibleClassName:(0,uu.A)(y.focusVisible,c),ownerState:v,className:(0,uu.A)(y.root,d),...f,classes:y,children:a})})});var uM=n(14045);let uA=(0,eI.memo)(function({color:e,sx:t,...n}){return(0,eb.jsx)(ua.A,{...n,sx:ry({height:4,width:16,margin:e=>e.spacing(.5)},t),style:{backgroundColor:e}})}),uk=(0,eI.forwardRef)(function({item:e,sx:t,truncateLabel:n,onClick:i,isVisuallySelected:r,onMouseOver:o,onMouseOut:a,index:s,...l},u){let[c,h]=(0,eI.useState)(n);return(0,eb.jsxs)(uC,{...l,role:"listitem",sx:ry({padding:0,cursor:"pointer"},t),dense:!0,onClick:t=>{i(t,e.id),e.onClick?.(t)},onMouseOver:t=>o?.(t,{id:e.id,index:s}),onMouseOut:t=>a?.(t,{id:e.id,index:s}),selected:r,ref:u,children:[(0,eb.jsx)(ua.A,{sx:{display:"flex",alignItems:"center"},children:(0,eb.jsx)(uA,{color:e.color})}),(0,eb.jsx)(uM.A,{primary:e.label,primaryTypographyProps:{noWrap:c},onMouseOver:function(){n&&h(!1)},onMouseOut:function(){n&&h(!0)}})]})}),uT=(0,eI.memo)(uk);function uI({height:e,items:t,selectedItems:n,onLegendItemClick:i,onItemMouseOver:r,onItemMouseOut:o}){return(0,eb.jsx)(ua.A,{component:"ul",sx:{width:"100%",height:e,padding:[0,1,0,0],overflowY:"scroll",margin:0},children:t.map((e,t)=>(0,eb.jsx)(uT,{item:e,index:t,isVisuallySelected:ul(e,n),onMouseOver:r,onMouseOut:o,onClick:i,sx:{width:"auto",float:"left",paddingRight:1.5}},e.id))})}function uD(e){e()}function uO(e,t){return n=>e(t(n))}function uP(e){return void 0!==e}function uR(){}function uE(e,t){return t(e)}function uL(...e){return e}function uN(e){e(2)}function uB(e){return e(4)}function uF(e,t){return e(1,e=>t(0,e))}function uz(e,t){let n=e(1,e=>{n(),t(e)});return n}function uV(e){let t,n;return i=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{i(t)},e)}}function uj(e,t){return e===t}function uH(e=uj){let t;return n=>i=>{e(t,i)||(t=i,n(i))}}function uW(e){return t=>n=>{e(n)&&t(n)}}function uG(e){return t=>uO(t,e)}function u$(e){return t=>()=>{t(e)}}function uU(e,...t){let n=function(...e){return t=>e.reduceRight(uE,t)}(...t);return(t,i)=>{switch(t){case 2:uN(e);return;case 1:return e(1,n(i))}}}function uq(e,t){return n=>i=>{n(t=e(t,i))}}function uY(e){return t=>n=>{e>0?e--:t(n)}}function uZ(e){let t=null,n;return i=>r=>{t=r,n||(n=setTimeout(()=>{n=void 0,i(t)},e))}}function uX(...e){let t=Array.from({length:e.length}),n=0,i=null,r=2**e.length-1;return e.forEach((e,o)=>{let a=2**o;e(1,e=>{let s=n;n|=a,t[o]=e,s!==r&&n===r&&i&&(i(),i=null)})}),e=>o=>{let a=()=>{e([o].concat(t))};n===r?a():i=a}}function uK(e){let t=e,n=uJ();return(e,i)=>{switch(e){case 0:t=i;break;case 1:i(t);break;case 4:return t}return n(e,i)}}function uQ(e,t){var n;return n=uK(t),uF(e,n),n}function uJ(){let e=[];return(t,n)=>{switch(t){case 0:e.slice().forEach(e=>{e(n)});return;case 2:e.splice(0);return;case 1:return e.push(n),()=>{let t=e.indexOf(n);t>-1&&e.splice(t,1)}}}}function u0(e){var t;return t=uJ(),uF(e,t),t}let u1={singleton:!0};function u2(e,t=[],n=u1){let{singleton:i}=n;return{constructor:e,dependencies:t,id:u5(),singleton:i}}let u5=()=>Symbol("id");function u3(...e){let t=uJ(),n=Array.from({length:e.length}),i=0,r=2**e.length-1;return e.forEach((e,o)=>{let a=2**o;e(1,e=>{n[o]=e,(i|=a)===r&&t(0,n)})}),function(e,o){switch(e){case 2:return void uN(t);case 1:return i===r&&o(n),t(1,o)}}}function u4(e,t=uj){return uU(e,uH(t))}function u6(...e){return function(t,n){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(uD)}}(...e.map(e=>e(1,n)))}}}let u8=1,u9={0:"debug",3:"error",[u8]:"log",2:"warn"},u7=u2(()=>{let e=uK(3);return{log:uK((t,n,i=u8)=>{i>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??uB(e))&&console[u9[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0}),ce=new WeakMap;function ct(e){return"self"in e?e.document.documentElement:e}function cn(e){ce.delete(ct(e))}function ci(e,t){return!function(e){let t=ct(e),n=ce.get(t);if(void 0!==n)return n;let i="rtl"===t.ownerDocument.defaultView.getComputedStyle(t).direction;return ce.set(t,i),i}(e)?t:-t}function cr(e,t,n){return co(e,t,n).callbackRef}function co(e,t,n){let i=eD().useRef(null),r=eD().useMemo(()=>"u">typeof ResizeObserver?new ResizeObserver(t=>{let i=()=>{let n=t[0].target;null!==n.offsetParent&&e(n)};n?i():requestAnimationFrame(i)}):null,[e,n]);return{callbackRef:e=>{e&&t?(r?.observe(e),i.current=e):(i.current&&r?.unobserve(i.current),i.current=null)},ref:i}}function ca(e,t,n,i,r,o,a,s,l){return co(eD().useCallback(n=>{let l,u=function(e,t,n,i){let r=e.length;if(0===r)return null;let o=[];for(let a=0;a<r;a++){let r=e.item(a);if(void 0===r.dataset.index)continue;let s=parseInt(r.dataset.index,10),l=parseFloat(r.dataset.knownSize),u=t(r,n);if(0===u&&i("Zero-sized element, this should not happen",{child:r},3),u===l)continue;let c=o[o.length-1];0===o.length||c.size!==u||c.endIndex!==s-1?o.push({endIndex:s,size:u,startIndex:s}):o[o.length-1].endIndex++}return o}(n.children,t,s?"offsetWidth":"offsetHeight",r),c=n.parentElement;for(;void 0===c.dataset.virtuosoScroller;)c=c.parentElement;let h=c.lastElementChild?.dataset.viewportType==="window";h&&(l=c.ownerDocument.defaultView);let d=a?s?a.scrollWidth:a.scrollHeight:h?s?l.document.documentElement.scrollWidth:l.document.documentElement.scrollHeight:s?c.scrollWidth:c.scrollHeight,f=a?s?a.offsetWidth:a.offsetHeight:h?s?l.innerWidth:l.innerHeight:s?c.offsetWidth:c.offsetHeight;i({scrollHeight:d,scrollTop:Math.max(a?s?ci(a,a.scrollLeft):a.scrollTop:h?s?ci(l,l.scrollX||l.document.documentElement.scrollLeft):l.scrollY||l.document.documentElement.scrollTop:s?ci(c,c.scrollLeft):c.scrollTop,0),viewportHeight:f}),o?.(s?cs("column-gap",getComputedStyle(n).columnGap,r):cs("row-gap",getComputedStyle(n).rowGap,r)),null!==u&&e(u)},[e,t,r,o,a,i,s]),n,l)}function cs(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}function cl(e,t,n){let i=eD().useRef(null),r=eD().useCallback(n=>{let r,o;if(!n?.offsetParent)return;let s=n.getBoundingClientRect(),l=s.width;if(t){let e=t.getBoundingClientRect(),n=s.top-e.top;o=e.height-Math.max(0,n),r=n+t.scrollTop}else{let e=a.current.ownerDocument.defaultView;o=e.innerHeight-Math.max(0,s.top),r=s.top+e.scrollY}i.current={listHeight:s.height,offsetTop:r,visibleHeight:o,visibleWidth:l},e(i.current)},[e,t]),{callbackRef:o,ref:a}=co(r,!0,n),s=eD().useCallback(()=>{r(a.current)},[r,a]);return eD().useEffect(()=>{if(t){t.addEventListener("scroll",s);let e=new ResizeObserver(()=>{requestAnimationFrame(s)});return e.observe(t),()=>{t.removeEventListener("scroll",s),e.unobserve(t)}}let e=a.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",s),e?.addEventListener("resize",s),()=>{e?.removeEventListener("scroll",s),e?.removeEventListener("resize",s)}},[s,t,a]),o}let cu=u2(()=>{let e=uJ(),t=uJ(),n=uK(0),i=uJ(),r=uK(0),o=uJ(),a=uJ(),s=uK(0),l=uK(0),u=uK(0),c=uK(0),h=uJ(),d=uJ(),f=uK(!1),p=uK(!1),g=uK(!1);return uF(uU(e,uG(({scrollTop:e})=>e)),t),uF(uU(e,uG(({scrollHeight:e})=>e)),a),uF(t,r),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:c,headerHeight:s,horizontalDirection:p,scrollBy:d,scrollContainerState:e,scrollHeight:a,scrollingInProgress:f,scrollTo:h,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:i,statefulScrollTop:r,viewportHeight:o}},[],{singleton:!0}),cc={lvl:0};function ch(e,t){let n=e.length;if(0===n)return[];let{index:i,value:r}=t(e[0]),o=[];for(let a=1;a<n;a++){let{index:n,value:s}=t(e[a]);o.push({end:n-1,start:i,value:r}),i=n,r=s}return o.push({end:1/0,start:i,value:r}),o}function cd(e){return e===cc}function cf(e,t){if(!cd(e))return t===e.k?e.v:t<e.k?cf(e.l,t):cf(e.r,t)}function cp(e,t,n="k"){if(cd(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){let i=cp(e.r,t,n);return i[0]===-1/0?[e.k,e.v]:i}return cp(e.l,t,n)}function cg(e,t,n){return cd(e)?cw(t,n,1):t===e.k?cx(e,{k:t,v:n}):t<e.k?c_(cS(cx(e,{l:cg(e.l,t,n)}))):c_(cS(cx(e,{r:cg(e.r,t,n)})))}function cm(e,t,n){if(cd(e))return[];let i=cp(e,t)[0];return ch(function e(t,n,i){if(cd(t))return[];let{k:r,l:o,r:a,v:s}=t,l=[];return r>n&&(l=l.concat(e(o,n,i))),r>=n&&r<=i&&l.push({k:r,v:s}),r<=i&&(l=l.concat(e(a,n,i))),l}(e,i,n),({k:e,v:t})=>({index:e,value:t}))}function cv(e){return cd(e)?[]:[...cv(e.l),{k:e.k,v:e.v},...cv(e.r)]}function cy(e){let{l:t,lvl:n,r:i}=e;if(i.lvl>=n-1&&t.lvl>=n-1)return e;if(n>i.lvl+1){if(cb(t))return cS(cx(e,{lvl:n-1}));if(!cd(t)&&!cd(t.r))return cx(t.r,{l:cx(t,{r:t.r.l}),lvl:n,r:cx(e,{l:t.r.r,lvl:n-1})});throw Error("Unexpected empty nodes")}if(cb(e))return c_(cx(e,{lvl:n-1}));if(!cd(i)&&!cd(i.l)){let t=i.l,r=cb(t)?i.lvl-1:i.lvl;return cx(t,{l:cx(e,{lvl:n-1,r:t.l}),lvl:t.lvl+1,r:c_(cx(i,{l:t.r,lvl:r}))})}throw Error("Unexpected empty nodes")}function cx(e,t){return cw(void 0===t.k?e.k:t.k,void 0===t.v?e.v:t.v,void 0===t.lvl?e.lvl:t.lvl,void 0===t.l?e.l:t.l,void 0===t.r?e.r:t.r)}function cb(e){return cd(e)||e.lvl>e.r.lvl}function cw(e,t,n,i=cc,r=cc){return{k:e,l:i,lvl:n,r,v:t}}function cS(e){let{l:t}=e;return cd(t)||t.lvl!==e.lvl?e:cx(t,{r:cx(e,{l:t.r})})}function c_(e){let{lvl:t,r:n}=e;return cd(n)||cd(n.r)||n.lvl!==t||n.r.lvl!==t?e:cx(n,{l:cx(e,{r:n.l}),lvl:t+1})}function cC(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function cM(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}let cA=u2(()=>({recalcInProgress:uK(!1)}),[],{singleton:!0});function ck(e,t,n,i=0){let r=e.length-1;for(;i<=r;){let o=Math.floor((i+r)/2),a=n(e[o],t);if(0===a)return o;if(-1===a){if(r-i<2)return o-1;r=o-1}else{if(r===i)return o;i=o+1}}throw Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function cT(e,t){return Math.round(e.getBoundingClientRect()[t])}function cI(e){return!cd(e.groupOffsetTree)}function cD({index:e},t){return t===e?0:t<e?-1:1}function cO({offset:e},t){return t===e?0:t<e?-1:1}function cP(e,t,n){if(0===t.length)return 0;let{index:i,offset:r,size:o}=t[ck(t,e,cD)],a=e-i,s=o*a+(a-1)*n+r;return s>0?s+n:s}function cR(e,t){if(!cI(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function cE(e,t,n){if(void 0!==e.groupIndex)return t.groupIndices[e.groupIndex]+1;let i=cR("LAST"===e.index?n:e.index,t);return Math.max(0,Math.min(n,i))}function cL(e,[t,n,i,r]){t.length>0&&i("received item sizes",t,0);let o=e.sizeTree,a=o,s=0;if(n.length>0&&cd(o)&&2===t.length){let e=t[0].size,i=t[1].size;a=n.reduce((t,n)=>cg(cg(t,n,e),n+1,i),a)}else[a,s]=function(e,t){let n=cd(e)?0:1/0;for(let i of t){let{endIndex:t,size:r,startIndex:o}=i;if(n=Math.min(n,o),cd(e)){e=cg(e,0,r);continue}let a=cm(e,o-1,t+1);if(a.some(function(e){let{endIndex:t,size:n,startIndex:i}=e;return e=>e.start===i&&(e.end===t||e.end===1/0)&&e.value===n}(i)))continue;let s=!1,l=!1;for(let{end:n,start:i,value:o}of a)s?(t>=i||r===o)&&(e=function e(t,n){if(cd(t))return cc;let{k:i,l:r,r:o}=t;if(n===i){if(cd(r))return o;if(cd(o))return r;let[e,n]=function e(t){return cd(t.r)?[t.k,t.v]:e(t.r)}(r);return cy(cx(t,{k:e,l:function e(t){return cd(t.r)?t.l:cy(cx(t,{r:e(t.r)}))}(r),v:n}))}return n<i?cy(cx(t,{l:e(r,n)})):cy(cx(t,{r:e(o,n)}))}(e,i)):(l=o!==r,s=!0),n>t&&t>=i&&o!==r&&(e=cg(e,t+1,o));l&&(e=cg(e,o,r))}return[e,n]}(a,t);if(a===o)return e;let{lastIndex:l,lastOffset:u,lastSize:c,offsetTree:h}=cB(e.offsetTree,s,a,r);return{groupIndices:n,groupOffsetTree:n.reduce((e,t)=>cg(e,t,cP(t,h,r)),cc),lastIndex:l,lastOffset:u,lastSize:c,offsetTree:h,sizeTree:a}}function cN(e,t){let n=0,i=0;for(;n<e;)n+=t[i+1]-t[i]-1,i++;return i-(n!==e)}function cB(e,t,n,i){let r=e,o=0,a=0,s=0,l=0;if(0===t)r=[];else{l=ck(r,t-1,cD),s=r[l].offset;let e=cp(n,t-1);o=e[0],a=e[1],r.length&&r[l].size===cp(n,t)[1]&&(l-=1),r=r.slice(0,l+1)}for(let{start:e,value:l}of cm(n,t,1/0)){let t=e-o,n=t*a+s+t*i;r.push({index:e,offset:n,size:l}),o=e,s=n,a=l}return{lastIndex:o,lastOffset:s,lastSize:a,offsetTree:r}}function cF(e){return{index:e.index,value:e}}let cz={offsetHeight:"height",offsetWidth:"width"},cV=u2(([{log:e},{recalcInProgress:t}])=>{let n=uJ(),i=uJ(),r=uQ(i,0),o=uJ(),a=uJ(),s=uK(0),l=uK([]),u=uK(void 0),c=uK(void 0),h=uK(void 0),d=uK(void 0),f=uK((e,t)=>cT(e,cz[t])),p=uK(void 0),g=uK(0),m={groupIndices:[],groupOffsetTree:cc,lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:cc},v=uQ(uU(n,uX(l,e,g),uq(cL,m),uH()),m),y=uQ(uU(l,uH(),uq((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),uG(({prev:e})=>e)),[]);uF(uU(l,uW(e=>e.length>0),uX(v,g),uG(([e,t,n])=>{let i=e.reduce((e,i,r)=>cg(e,i,cP(i,t.offsetTree,n)||r),cc);return{...t,groupIndices:e,groupOffsetTree:i}})),v),uF(uU(i,uX(v),uW(([e,{lastIndex:t}])=>e<t),uG(([e,{lastIndex:t,lastSize:n}])=>[{endIndex:t,size:n,startIndex:e}])),n),uF(u,c);let x=uQ(uU(u,uG(e=>void 0===e)),!0);uF(uU(c,uW(e=>void 0!==e&&cd(uB(v).sizeTree)),uG(e=>{let t=uB(h),n=uB(l).length>0;return void 0!==t&&0!==t?n?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),n),uF(uU(d,uW(e=>void 0!==e&&e.length>0&&cd(uB(v).sizeTree)),uG(e=>{let t=[],n=e[0],i=0;for(let r=1;r<e.length;r++){let o=e[r];o!==n&&(t.push({endIndex:r-1,size:n,startIndex:i}),n=o,i=r)}return t.push({endIndex:e.length-1,size:n,startIndex:i}),t})),n),uF(uU(l,uX(h,c),uW(([,e,t])=>void 0!==e&&void 0!==t),uG(([e,t,n])=>{let i=[];for(let r=0;r<e.length;r++){let o=e[r],a=e[r+1];i.push({startIndex:o,endIndex:o,size:t}),void 0!==a&&i.push({startIndex:o+1,endIndex:a-1,size:n})}return i})),n);let b=u0(uU(n,uX(v),uq(({sizes:e},[t,n])=>({changed:n!==e,sizes:n}),{changed:!1,sizes:m}),uG(e=>e.changed)));uU(s,uq((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),uG(e=>e.diff))(1,e=>{let{groupIndices:n}=uB(v);if(e>0)t(0,!0),o(0,e+cN(e,n));else if(e<0){let t=uB(y);t.length>0&&(e-=cN(-e,t)),a(0,e)}}),uU(s,uX(e))(1,([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:s},3)});let w=u0(o);uF(uU(o,uX(v),uG(([e,t])=>{let n=t.groupIndices.length>0,i=[],r=t.lastSize;if(n){let n=cf(t.sizeTree,0),o=0,a=0;for(;o<e;){let e=t.groupIndices[a],s=t.groupIndices.length===a+1?1/0:t.groupIndices[a+1]-e-1;i.push({endIndex:e,size:n,startIndex:e}),i.push({endIndex:e+1+s-1,size:r,startIndex:e+1}),a++,o+=s+1}let s=cv(t.sizeTree);return o!==e&&s.shift(),s.reduce((t,{k:n,v:i})=>{let r=t.ranges;return 0!==t.prevSize&&(r=[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:n+e,prevSize:i,ranges:r}},{prevIndex:e,prevSize:0,ranges:i}).ranges}return cv(t.sizeTree).reduce((t,{k:n,v:i})=>({prevIndex:n+e,prevSize:i,ranges:[...t.ranges,{endIndex:n+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:r,ranges:[]}).ranges})),n);let S=u0(uU(a,uX(v,g),uG(([e,{offsetTree:t},n])=>cP(-e,t,n))));return uF(uU(a,uX(v,g),uG(([e,t,n])=>{if(t.groupIndices.length>0){if(cd(t.sizeTree))return t;let i=cc,r=uB(y),o=0,a=0,s=0;for(;o<-e;){s=r[a];let e=r[a+1]-s-1;a++,o+=e+1}return i=cv(t.sizeTree).reduce((t,{k:n,v:i})=>cg(t,Math.max(0,n+e),i),i),o!==-e&&(i=cg(i,0,cf(t.sizeTree,s)),i=cg(i,1,cp(t.sizeTree,-e+1)[1])),{...t,sizeTree:i,...cB(t.offsetTree,0,i,n)}}let i=cv(t.sizeTree).reduce((t,{k:n,v:i})=>cg(t,Math.max(0,n+e),i),cc);return{...t,sizeTree:i,...cB(t.offsetTree,0,i,n)}})),v),{beforeUnshiftWith:w,data:p,defaultItemSize:c,firstItemIndex:s,fixedItemSize:u,fixedGroupSize:h,gap:g,groupIndices:l,heightEstimates:d,itemSize:f,listRefresh:b,shiftWith:a,shiftWithOffset:S,sizeRanges:n,sizes:v,statefulTotalCount:r,totalCount:i,trackItemSizes:x,unshiftWith:o}},uL(u7,cA),{singleton:!0});function cj(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}let cH=u2(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:i,scrollTop:r}])=>{let o=uJ(),a=uJ(),s=u0(uU(o,uG(cj)));return uF(uU(s,uG(e=>e.totalCount)),n),uF(uU(s,uG(e=>e.groupIndices)),e),uF(uU(u3(r,t,i),uW(([e,t])=>cI(t)),uG(([e,t,n])=>cp(t.groupOffsetTree,Math.max(e-n,0),"v")[0]),uH(),uG(e=>[e])),a),{groupCounts:o,topItemsIndexes:a}},uL(cV,cu)),cW=u2(([{log:e}])=>{let t=uK(!1),n=u0(uU(t,uW(e=>e),uH()));return t(1,t=>{t&&uB(e)("props updated",{},0)}),{didMount:n,propsReady:t}},uL(u7),{singleton:!0}),cG="u">typeof document&&"scrollBehavior"in document.documentElement.style;function c$(e){let t="number"==typeof e?{index:e}:{...e};return t.align||(t.align="start"),t.behavior&&cG||(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}let cU=u2(([{gap:e,listRefresh:t,sizes:n,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:o,footerHeight:a,headerHeight:s,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:c,viewportHeight:h},{log:d}])=>{let f=uJ(),p=uJ(),g=uK(0),m=null,v=null,y=null;function x(){null!==m&&(m(),m=null),null!==y&&(y(),y=null),v&&(clearTimeout(v),v=null),l(0,!1)}return uF(uU(f,uX(n,h,i,g,s,a,d),uX(e,o,r),uG(([[e,n,i,r,o,a,s,u],h,d,g])=>{let b=c$(e),{align:w,behavior:S,offset:_}=b,C=r-1,M=cE(b,n,C),A=cP(M,n.offsetTree,h)+a;"end"===w?(A+=d+cp(n.sizeTree,M)[1]-i+g,M===C&&(A+=s)):"center"===w?A+=(d+cp(n.sizeTree,M)[1]-i+g)/2:A-=o,void 0!==_&&0!==_&&(A+=_);let k=t=>{x(),t?(u("retrying to scroll to",{location:e},0),f(0,e)):(p(0,!0),u("list did not change, scroll successful",{},0))};if(x(),"smooth"===S){let e=!1;y=t(1,t=>{e=e||t}),m=uz(c,()=>{k(e)})}else m=uz(uU(t,e=>{let t=setTimeout(()=>{e(!1)},150);return n=>{n&&(e(!0),clearTimeout(t))}}),k);return v=setTimeout(()=>{x()},1200),l(0,!0),u("scrolling from index to",{behavior:S,index:M,top:A},0),{behavior:S,top:A}})),u),{scrollTargetReached:p,scrollToIndex:f,topListHeight:g}},uL(cV,cu,u7),{singleton:!0});function cq(e,t){0===e?t():requestAnimationFrame(()=>{cq(e-1,t)})}function cY(e,t){if(void 0===e)return 0;let n=t-1;return Math.max(0,Math.min("number"==typeof e?e:"LAST"===e.index?n:e.index,n))}function cZ(e){return void 0===e||("number"==typeof e?0===e:0===e.index&&(void 0===e.align||"start"===e.align)&&(void 0===e.offset||0===e.offset))}let cX=u2(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:i},{scrollTargetReached:r,scrollToIndex:o},{didMount:a}])=>{let s=uK(!0),l=uK(0),u=uK(!0);return uF(uU(a,uX(l),uW(([e,t])=>!cZ(t)),u$(!1)),s),uF(uU(a,uX(l),uW(([e,t])=>!cZ(t)),u$(!1)),u),uU(u3(t,a),uX(s,n,e,u),uW(([[,e],t,{sizeTree:n},i,r])=>e&&(!cd(n)||uP(i))&&!t&&!r),uX(l))(1,([,e])=>{if(void 0===e){s(0,!0),u(0,!0);return}uz(r,()=>{u(0,!0)}),cq(4,()=>{uz(i,()=>{s(0,!0)}),o(0,e)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:s}},uL(cV,cu,cU,cW),{singleton:!0});function cK(e,t){return 1.01>Math.abs(e-t)}let cQ="down",cJ={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},c0=u2(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:i,scrollTop:r,viewportHeight:o}])=>{let a=uK(!1),s=uK(!0),l=uJ(),u=uJ(),c=uK(4),h=uK(0),d=uQ(uU(u6(uU(u4(r),uY(1),u$(!0)),uU(u4(r),uY(1),u$(!1),uV(100))),uH()),!1),f=uQ(uU(u6(uU(n,u$(!0)),uU(n,u$(!1),uV(200))),uH()),!1);uF(uU(u3(u4(r),u4(h)),uG(([e,t])=>e<=t),uH()),s),uF(uU(s,uZ(50)),u);let p=u0(uU(u3(i,u4(o),u4(t),u4(e),u4(c)),uq((e,[{scrollHeight:t,scrollTop:n},i,r,o,a])=>{let s={scrollHeight:t,scrollTop:n,viewportHeight:i};if(n+i-t>-a){let t,i;return n>e.state.scrollTop?(t="SCROLLED_DOWN",i=e.state.scrollTop-n):(t="SIZE_DECREASED",i=e.state.scrollTop-n||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:i,state:s}}return{atBottom:!1,notAtBottomBecause:s.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":i<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":n<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",state:s}},cJ),uH((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),g=uQ(uU(i,uq((e,{scrollHeight:t,scrollTop:n,viewportHeight:i})=>{if(!cK(e.scrollHeight,t)){let r=t-(n+i)<1;return e.scrollTop!==n&&r?{changed:!0,jump:e.scrollTop-n,scrollHeight:t,scrollTop:n}:{changed:!0,jump:0,scrollHeight:t,scrollTop:n}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:n}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),uW(e=>e.changed),uG(e=>e.jump)),0);uF(uU(p,uG(e=>e.atBottom)),a),uF(uU(a,uZ(50)),l);let m=uK(cQ);uF(uU(i,uG(({scrollTop:e})=>e),uH(),uq((e,t)=>uB(f)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?"up":cQ,prevScrollTop:t},{direction:cQ,prevScrollTop:0}),uG(e=>e.direction)),m),uF(uU(i,uZ(50),u$("none")),m);let v=uK(0);return uF(uU(d,uW(e=>!e),u$(0)),v),uF(uU(r,uZ(100),uX(d),uW(([e,t])=>t),uq(([e,t],[n])=>[t,n],[0,0]),uG(([e,t])=>t-e)),v),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:u,atTopThreshold:h,isAtBottom:a,isAtTop:s,isScrolling:d,lastJumpDueToItemResize:g,scrollDirection:m,scrollVelocity:v}},uL(cu)),c1="bottom",c2="none";function c5(e,t,n){return"number"==typeof e?"up"===n&&"top"===t||n===cQ&&t===c1?e:0:"up"===n?"top"===t?e.main:e.reverse:t===c1?e.main:e.reverse}function c3(e,t){return"number"==typeof e?e:e[t]??0}let c4=u2(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:i,viewportHeight:r}])=>{let o=uJ(),a=uK(0),s=uK(0),l=uK(0),u=uQ(uU(u3(u4(i),u4(r),u4(n),u4(o,cM),u4(l),u4(a),u4(t),u4(e),u4(s)),uG(([e,t,n,[i,r],o,a,s,l,u])=>{let c=e-l,h=Math.max(n-c,0),d=c2,f=c3(u,"top"),p=c3(u,c1);return i-=l,i+=n+s,r+=n+s,i>e+(a+s)-f&&(d="up"),(r-=l)<e-h+t+p&&(d=cQ),d!==c2?[Math.max(c-n-c5(o,"top",d)-f,0),c-h-s+t+c5(o,c1,d)+p]:null}),uW(e=>null!==e),uH(cM)),[0,0]);return{increaseViewportBy:s,listBoundary:o,overscan:l,topListHeight:a,visibleRange:u}},uL(cu),{singleton:!0}),c6={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function c8(e,t,n,i,r,o){let{lastIndex:a,lastOffset:s,lastSize:l}=r,u=0,c=0;if(e.length>0){u=e[0].offset;let t=e[e.length-1];c=t.offset+t.size}let h=n-a,d=u,f=s+h*l+(h-1)*i-c;return{bottom:c,firstItemIndex:o,items:c7(e,r,o),offsetBottom:f,offsetTop:u,top:d,topItems:c7(t,r,o),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:n}}function c9(e,t,n,i,r,o){let a=0;if(n.groupIndices.length>0)for(let t of n.groupIndices){if(t-a>=e)break;a++}let s=e+a,l=cY(t,s);return c8(Array.from({length:s}).map((e,t)=>({data:o[t+l],index:t+l,offset:0,size:0})),[],s,r,n,i)}function c7(e,t,n){if(0===e.length)return[];if(!cI(t))return e.map(e=>({...e,index:e.index+n,originalIndex:e.index}));let i=e[0].index,r=e[e.length-1].index,o=[],a=cm(t.groupOffsetTree,i,r),s,l=0;for(let i of e){let e;(!s||s.end<i.index)&&(s=a.shift(),l=t.groupIndices.indexOf(s.start)),e=i.index===s.start?{index:l,type:"group"}:{groupIndex:l,index:i.index-(l+1)+n},o.push({...e,data:i.data,offset:i.offset,originalIndex:i.index,size:i.size})}return o}function he(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}let ht=u2(([{data:e,firstItemIndex:t,gap:n,sizes:i,totalCount:r},o,{listBoundary:a,topListHeight:s,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:c},{topListHeight:h},d,{didMount:f},{recalcInProgress:p}])=>{let g=uK([]),m=uK(0),v=uJ(),y=uK(0);uF(o.topItemsIndexes,g);let x=uQ(uU(u3(f,p,u4(l,cM),u4(r),u4(i),u4(u),c,u4(g),u4(t),u4(n),u4(y),e),uW(([e,t,,n,,,,,,,,i])=>{let r=void 0!==i&&i.length!==n;return e&&!t&&!r}),uG(([,,[e,t],n,i,r,o,a,s,l,u,c])=>{var h;let{offsetTree:d,sizeTree:f}=i,p=uB(m);if(0===n)return{...c6,totalCount:n};if(0===e&&0===t)return 0===p?{...c6,totalCount:n}:c9(p,r,i,s,l,c||[]);if(cd(f))return p>0?null:c8(function(e,t,n){if(cI(t)){let i=cR(e,t);return[{index:cp(t.groupOffsetTree,i)[0],offset:0,size:0},{data:n?.[0],index:i,offset:0,size:0}]}return[{data:n?.[0],index:e,offset:0,size:0}]}(cY(r,n),i,c),[],n,l,i,s);let g=[];if(a.length>0){let e=a[0],t=a[a.length-1],n=0;for(let i of cm(f,e,t)){let r=i.value,o=Math.max(i.start,e),a=Math.min(i.end,t);for(let e=o;e<=a;e++)g.push({data:c?.[e],index:e,offset:n,size:r}),n+=r}}if(!o)return c8([],g,n,l,i,s);let v=a.length>0?a[a.length-1]+1:0,y=function(e,t,n,i=0){let r,o;return i>0&&(t=Math.max(t,e[ck(e,i,cD)].offset)),ch((r=ck(e,t,cO),o=ck(e,n,cO,r),e.slice(r,o+1)),cF)}(d,e,t,v);if(0===y.length)return null;let x=n-1,b=((n=>{for(let i of y){let r=i.value,o=r.offset,a=i.start,s=r.size;if(r.offset<e){let t=(a+=Math.floor((e-r.offset+l)/(s+l)))-i.start;o+=t*s+t*l}a<v&&(o+=(v-a)*s,a=v);let u=Math.min(i.end,x);for(let e=a;e<=u&&!(o>=t);e++)n.push({data:c?.[e],index:e,offset:o,size:s}),o+=s+l}})(h=[]),h),w=he(u,"top"),S=he(u,c1);if(b.length>0&&(w>0||S>0)){let e=b[0],t=b[b.length-1];if(w>0&&e.index>v){let t=Math.min(w,e.index-v),n=[],i=e.offset;for(let r=e.index-1;r>=e.index-t;r--){let t=cm(f,r,r)[0]?.value??e.size;i-=t+l,n.unshift({data:c?.[r],index:r,offset:i,size:t})}b.unshift(...n)}if(S>0&&t.index<x){let e=Math.min(S,x-t.index),n=t.offset+t.size+l;for(let i=t.index+1;i<=t.index+e;i++){let e=cm(f,i,i)[0]?.value??t.size;b.push({data:c?.[i],index:i,offset:n,size:e}),n+=e+l}}}return c8(b,g,n,l,i,s)}),uW(e=>null!==e),uH()),c6);uF(uU(e,uW(uP),uG(e=>e?.length)),r),uF(uU(x,uG(e=>e.topListHeight)),h),uF(h,s),uF(uU(x,uG(e=>[e.top,e.bottom])),a),uF(uU(x,uG(e=>e.items)),v);let b=u0(uU(x,uW(({items:e})=>e.length>0),uX(r,e),uW(([{items:e},t])=>e[e.length-1].originalIndex===t-1),uG(([,e,t])=>[e-1,t]),uH(cM),uG(([e])=>e))),w=u0(uU(x,uZ(200),uW(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),uG(({items:e})=>e[0].index),uH())),S=u0(uU(x,uW(({items:e})=>e.length>0),uG(({items:e})=>{let t=0,n=e.length-1;for(;"group"===e[t].type&&t<n;)t++;for(;"group"===e[n].type&&n>t;)n--;return{endIndex:e[n].index,startIndex:e[t].index}}),uH(cC)));return{endReached:b,initialItemCount:m,itemsRendered:v,listState:x,minOverscanItemCount:y,rangeChanged:S,startReached:w,topItemsIndexes:g,...d}},uL(cV,cH,c4,cX,cU,c0,cW,cA),{singleton:!0}),hn=u2(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:i},{listState:r}])=>{let o=uJ(),a=uQ(uU(u3(n,e,i,t,r),uG(([e,t,n,i,r])=>e+t+n+i+r.offsetBottom+r.bottom)),0);return uF(u4(a),o),{totalListHeight:a,totalListHeightChanged:o}},uL(cu,ht),{singleton:!0}),hi=u2(([{viewportHeight:e},{totalListHeight:t}])=>{let n=uK(!1),i=uQ(uU(u3(n,e,t),uW(([e])=>e),uG(([,e,t])=>Math.max(0,e-t)),uZ(0),uH()),0);return{alignToBottom:n,paddingTopAddition:i}},uL(cu,hn),{singleton:!0}),hr=u2(()=>({context:uK(null)})),ho=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:i,...r},viewportBottom:o,viewportTop:a})=>t<a?{...r,align:n??"start",...void 0===i?{}:{behavior:i}}:e>o?{...r,align:n??"end",...void 0===i?{}:{behavior:i}}:null,ha=u2(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:r,headerHeight:o,scrollingInProgress:a,scrollTop:s,viewportHeight:l},{scrollToIndex:u}])=>{let c=uJ();return uF(uU(c,uX(t,l,n,o,r,i,s),uX(e),uG(([[e,t,n,i,r,o,s,l],u])=>{let{calculateViewLocation:c=ho,done:h,...d}=e,f=cE(e,t,i-1),p=cP(f,t.offsetTree,u)+r+o,g=c({itemBottom:p+cp(t.sizeTree,f)[1],itemTop:p,locationParams:d,viewportBottom:l+n-s,viewportTop:l+o});return null===g?h?.():h&&uz(uU(a,uW(e=>!e),uY(uB(a)?1:2)),h),g}),uW(e=>null!==e)),u),{scrollIntoView:c}},uL(cV,cu,cU,ht,u7),{singleton:!0});function hs(e){return!1!==e&&("smooth"===e?"smooth":"auto")}let hl=u2(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:i},{atBottomState:r,isAtBottom:o},{scrollToIndex:a},{scrolledToInitialItem:s},{didMount:l,propsReady:u},{log:c},{scrollingInProgress:h},{context:d},{scrollIntoView:f}])=>{let p=uK(!1),g=uJ(),m=null;function v(e){a(0,{align:"end",behavior:e,index:"LAST"})}function y(e){setTimeout(uz(r,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(uB(c)("scrolling to bottom due to increased size",{},0),v("auto"))}),100)}uU(u3(uU(u4(t),uY(1)),l),uX(u4(p),o,s,h),uG(([[e,t],n,i,r,o])=>{let a,s=t&&r,l="auto";return s&&(a=i||o,l="function"==typeof n?hs(n(a)):a&&hs(n),s=s&&!1!==l),{followOutputBehavior:l,shouldFollow:s,totalCount:e}}),uW(({shouldFollow:e})=>e))(1,({followOutputBehavior:t,totalCount:i})=>{null!==m&&(m(),m=null),void 0===uB(n)?m=uz(e,()=>{uB(c)("following output to ",{totalCount:i},0),v(t),m=null}):requestAnimationFrame(()=>{uB(c)("following output to ",{totalCount:i},0),v(t)})}),uU(u3(u4(p),t,u),uW(([e,,t])=>!1!==e&&t),uq(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),uW(({refreshed:e})=>e),uX(p,t))(1,([,e])=>{uB(s)&&y(!1!==e)}),g(1,()=>{y(!1!==uB(p))}),u3(u4(p),r)(1,([e,t])=>{!1===e||t.atBottom||"VIEWPORT_HEIGHT_DECREASING"!==t.notAtBottomBecause||v("auto")});let x=uK(null),b=uJ();return uF(u6(uU(u4(i),uG(e=>e?.length??0)),uU(u4(t))),b),uU(u3(uU(b,uY(1)),l),uX(u4(x),s,h,d),uG(([[e,t],n,i,r,o])=>t&&i&&n?.({context:o,totalCount:e,scrollingInProgress:r})),uW(e=>!!e),uZ(0))(1,t=>{null!==m&&(m(),m=null),void 0===uB(n)?m=uz(e,()=>{uB(c)("scrolling into view",{}),f(0,t),m=null}):requestAnimationFrame(()=>{uB(c)("scrolling into view",{}),f(0,t)})}),{autoscrollToBottom:g,followOutput:p,scrollIntoViewOnChange:x}},uL(cV,c0,cU,cX,cW,u7,cu,hr,ha)),hu=u2(([{data:e,firstItemIndex:t,gap:n,sizes:i},{initialTopMostItemIndex:r},{initialItemCount:o,listState:a},{didMount:s}])=>(uF(uU(s,uX(o),uW(([,e])=>0!==e),uX(r,i,t,n,e),uG(([[,e],t,n,i,r,o=[]])=>c9(e,t,n,i,r,o))),a),{}),uL(cV,cX,ht,cW),{singleton:!0}),hc=u2(([{didMount:e},{scrollTo:t},{listState:n}])=>{let i=uK(0);return uU(e,uX(i),uW(([,e])=>0!==e),uG(([,e])=>({top:e})))(1,e=>{uz(uU(n,uY(1),uW(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{t(0,e)})})}),{initialScrollTop:i}},uL(cW,cu,ht),{singleton:!0}),hh=u2(([{scrollVelocity:e}])=>{let t=uK(!1),n=uJ(),i=uK(!1);return uF(uU(e,uX(i,t,n),uW(([e,t])=>!1!==t&&void 0!==t),uG(([e,t,n,i])=>{let{enter:r,exit:o}=t;if(n){if(o(e,i))return!1}else if(r(e,i))return!0;return n}),uH()),t),uU(u3(t,e,n),uX(i))(1,([[e,t,n],i])=>{e&&!1!==i&&void 0!==i&&i.change&&i.change(t,n)}),{isSeeking:t,scrollSeekConfiguration:i,scrollSeekRangeChanged:n,scrollVelocity:e}},uL(c0),{singleton:!0}),hd=u2(([{scrollContainerState:e,scrollTo:t}])=>{let n=uJ(),i=uJ(),r=uJ(),o=uK(!1),a=uK(void 0);return uF(uU(u3(n,i),uG(([{scrollTop:e,viewportHeight:t},{offsetTop:n,listHeight:i}])=>({scrollHeight:i,scrollTop:Math.max(0,e-n),viewportHeight:t}))),e),uF(uU(t,uX(i),uG(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),r),{customScrollParent:a,useWindowScroll:o,windowScrollContainerState:n,windowScrollTo:r,windowViewportRect:i}},uL(cu)),hf=u2(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:i},{initialTopMostItemIndex:r},{didMount:o},{useWindowScroll:a,windowScrollContainerState:s,windowViewportRect:l}])=>{let u=uJ(),c=uK(void 0),h=uK(null),d=uK(null);return uF(s,h),uF(l,d),uU(u,uX(t,i,a,h,d,n))(1,([e,t,n,i,r,o,a])=>{let s=cv(t.sizeTree).map(({k:e,v:t},n,i)=>{let r=i[n+1];return{endIndex:void 0===r?1/0:r.k-1,size:t,startIndex:e}});i&&null!==r&&null!==o&&(n=r.scrollTop-o.offsetTop),e({ranges:s,scrollTop:n-=a})}),uF(uU(c,uW(uP),uG(hp)),r),uF(uU(o,uX(c),uW(([,e])=>void 0!==e),uH(),uG(([,e])=>e.ranges)),e),{getState:u,restoreStateFrom:c}},uL(cV,cu,cX,cW,hd));function hp(e){return{align:"start",index:0,offset:e.scrollTop}}let hg=u2(([{topItemsIndexes:e}])=>{let t=uK(0);return uF(uU(t,uW(e=>e>=0),uG(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},uL(ht));function hm(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}let hv=hm(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),hy=u2(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:i},{isAtBottom:r,isScrolling:o,lastJumpDueToItemResize:a,scrollDirection:s},{listState:l},{beforeUnshiftWith:u,gap:c,shiftWithOffset:h,sizes:d},{log:f},{recalcInProgress:p}])=>{let g=u0(uU(l,uX(a),uq(([,e,t,n],[{bottom:i,items:r,offsetBottom:o,totalCount:a},s])=>{let l=i+o,u=0;return t===a&&e.length>0&&r.length>0&&(0===r[0].originalIndex&&0===e[0].originalIndex||0!=(u=l-n)&&(u+=s)),[u,r,a,l]},[0,[],0,0]),uW(([e])=>0!==e),uX(i,s,n,r,f,p),uW(([,e,t,n,,,i])=>!i&&!n&&0!==e&&"up"===t),uG(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},0),e))));function m(n){n>0?(t(0,{behavior:"auto",top:-n}),e(0,0)):(e(0,0),t(0,{behavior:"auto",top:-n}))}return uU(g,uX(e,o))(1,([t,n,i])=>{i&&hv()?e(0,n-t):m(-t)}),uU(u3(uQ(o,!1),e,p),uW(([e,t,n])=>!e&&!n&&0!==t),uG(([e,t])=>t),uZ(1))(1,m),uF(uU(h,uG(e=>({top:-e}))),t),uU(u,uX(d,c),uG(([e,{groupIndices:t,lastSize:n,sizeTree:i},r])=>{if(0===t.length)return e*(n+r);let o=0,a=cf(i,0),s=0,l=0;for(;s<e;){s++,o+=a;let i=t.length===l+1?1/0:t[l+1]-t[l]-1;s+i>e&&(o-=a,i=e-s+1),s+=i,o+=i*(n+r),l++}return o}))(1,n=>{e(0,n),requestAnimationFrame(()=>{t(0,{top:n}),requestAnimationFrame(()=>{e(0,0),p(0,!1)})})}),{deviation:e}},uL(cu,c0,ht,cV,u7,cA)),hx=u2(([e,t,n,i,r,o,a,s,l,u,c])=>({...e,...t,...n,...i,...r,...o,...a,...s,...l,...u,...c}),uL(c4,hu,cW,hh,hn,hc,hi,hd,ha,u7,hr)),hb=u2(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:i,fixedGroupSize:r,gap:o,groupIndices:a,heightEstimates:s,itemSize:l,sizeRanges:u,sizes:c,statefulTotalCount:h,totalCount:d,trackItemSizes:f},{initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:m},v,y,x,b,{scrollToIndex:w},S,{topItemCount:_},{groupCounts:C},M])=>{let{listState:A,minOverscanItemCount:k,topItemsIndexes:T,rangeChanged:I,...D}=b;return uF(I,M.scrollSeekRangeChanged),uF(uU(M.windowViewportRect,uG(e=>e.visibleHeight)),v.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:i,fixedGroupHeight:r,gap:o,groupCounts:C,heightEstimates:s,initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:m,sizeRanges:u,topItemCount:_,topItemsIndexes:T,totalCount:d,...x,groupIndices:a,itemSize:l,listState:A,minOverscanItemCount:k,scrollToIndex:w,statefulTotalCount:h,trackItemSizes:f,rangeChanged:I,...D,...M,...v,sizes:c,...y}},uL(cV,cX,cu,hf,hl,ht,cU,hy,hg,cH,hx)),hw=typeof document>"u"?eD().useEffect:eD().useLayoutEffect;function hS(e,t,n){let i=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),s=eD().createContext({});function l(e,n){for(let r of(void 0!==e.propsReady&&(0,e.propsReady)(0,!1),i))(0,e[t.required[r]])(0,n[r]);for(let i of r)i in n&&(0,e[t.optional[i]])(0,n[i]);void 0!==e.propsReady&&(0,e.propsReady)(0,!0)}function u(e){return a.reduce((n,i)=>{var r;let o,a,s;return n[i]=(r=e[t.events[i]],s=()=>o?.(),function(e,t){switch(e){case 1:return t?a===t?void 0:(s(),a=t,o=r(1,t)):(s(),uR);case 2:s(),a=null;return}}),n},{})}return{Component:eD().forwardRef(function(c,h){var d;let{children:f,...p}=c,[g]=eD().useState(()=>{var t;let n,i;return n=new Map,l(t=(i=({constructor:e,dependencies:t,id:r,singleton:o})=>{if(o&&n.has(r))return n.get(r);let a=e(t.map(e=>i(e)));return o&&n.set(r,a),a})(e),p),t}),[m]=eD().useState(()=>u(g));return hw(()=>{for(let e of a)e in p&&(0,m[e])(1,p[e]);return()=>{Object.values(m).map(uN)}},[p,m,g]),hw(()=>{l(g,p)}),eD().useImperativeHandle(h,(d=o.reduce((e,n)=>(e[n]=e=>{(0,g[t.methods[n]])(0,e)},e),{}),()=>d)),(0,eb.jsx)(s.Provider,{value:g,children:void 0===n?f:(0,eb.jsx)(n,{...function(e,t){let n={},i={},r=0,o=e.length;for(;r<o;)i[e[r]]=1,r+=1;for(let e in t)Object.hasOwn(i,e)||(n[e]=t[e]);return n}([...i,...r,...a],p),children:f})})}),useEmitter:(e,t)=>{let n=eD().useContext(s)[e];hw(()=>n(1,t),[t,n])},useEmitterValue:parseInt(eD().version,10)>=18?e=>{let t=eD().useContext(s)[e],n=eD().useCallback(e=>t(1,e),[t]);return eD().useSyncExternalStore(n,()=>uB(t),()=>uB(t))}:e=>{let t=eD().useContext(s)[e],[n,i]=eD().useState(()=>uB(t));return hw(()=>t(1,e=>{e!==n&&i(()=>e)}),[t,n]),n},usePublisher:e=>{let t=eD().useContext(s);return eD().useCallback(n=>{(0,t[e])(0,n)},[t,e])}}}let h_=eD().createContext(void 0),hC=eD().createContext(void 0),hM="-webkit-sticky",hA="sticky",hk=hm(()=>{if(typeof document>"u")return hA;let e=document.createElement("div");return e.style.position=hM,e.style.position===hM?hM:hA}),hT=typeof document>"u"?eD().useEffect:eD().useLayoutEffect;function hI(e){return"self"in e}function hD(e,t,n,i=uR,r,o){let a=eD().useRef(null),s=eD().useRef(null),l=eD().useRef(null),u=eD().useCallback(n=>{let i,r,a,u=n.target;if("body"in u||hI(u)){let e=hI(u)?u:u.defaultView;a=!0===o?ci(e,e.scrollX):e.scrollY,i=!0===o?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,r=!0===o?e.innerWidth:e.innerHeight}else a=!0===o?ci(u,u.scrollLeft):u.scrollTop,i=!0===o?u.scrollWidth:u.scrollHeight,r=!0===o?u.offsetWidth:u.offsetHeight;let c=()=>{e({scrollHeight:i,scrollTop:Math.max(a,0),viewportHeight:r})};!0===n.suppressFlushSync?c():tm().flushSync(c),null!==s.current&&(a===s.current||a<=0||a===i-r)&&(s.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,o]);return eD().useEffect(()=>{let e=r??a.current;return cn(e),i(r??a.current),u({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",u,{passive:!0}),()=>{cn(e),i(null),e.removeEventListener("scroll",u)}},[a,u,n,i,r]),{scrollByCallback:function(e){!0===o&&(e={...void 0===e.behavior?{}:{behavior:e.behavior},...void 0===e.top?{}:{left:ci(a.current,e.top)}}),a.current.scrollBy(e)},scrollerRef:a,scrollToCallback:function(n){let i,r,u,c=a.current;if(!c||(!0===o?"offsetWidth"in c&&0===c.offsetWidth:"offsetHeight"in c&&0===c.offsetHeight))return;let h="smooth"===n.behavior;hI(c)?(r=Math.max(cT(c.document.documentElement,!0===o?"width":"height"),!0===o?c.document.documentElement.scrollWidth:c.document.documentElement.scrollHeight),i=!0===o?c.innerWidth:c.innerHeight,u=!0===o?ci(c,c.scrollX):c.scrollY):(r=c[!0===o?"scrollWidth":"scrollHeight"],i=cT(c,!0===o?"width":"height"),u=!0===o?ci(c,c.scrollLeft):c.scrollTop);let d=r-i;if(void 0===n.top)return void c.scrollTo(n);let f=Math.ceil(Math.max(Math.min(d,n.top),0));if(n.top=f,cK(i,r)||f===u){e({scrollHeight:r,scrollTop:u,viewportHeight:i}),h&&t(!0);return}h?(s.current=f,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,s.current=null,t(!0)},1e3)):s.current=null,!0===o&&(n={...void 0===n.behavior?{}:{behavior:n.behavior},left:ci(c,f)}),c.scrollTo(n)}}}function hO(e){return e}let hP=u2(()=>{let e=uK(e=>`Item ${e}`),t=uK(e=>`Group ${e}`),n=uK({}),i=uK(hO),r=uK("div"),o=uK(uR),a=(e,t=null)=>uQ(uU(n,uG(t=>t[e]),uH()),t);return{components:n,computeItemKey:i,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:t,HeaderComponent:a("Header"),HeaderFooterTag:r,ItemComponent:a("Item","div"),itemContent:e,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),hR=u2(([e,t])=>({...e,...t}),uL(hb,hP)),hE=({height:e})=>(0,eb.jsx)("div",{style:{height:e}}),hL={overflowAnchor:"none",position:hk(),zIndex:1},hN={overflowAnchor:"none"},hB={...hN,display:"inline-block",height:"100%"},hF=eD().memo(function({showTopList:e=!1}){let t=h1("listState"),n=h2("sizeRanges"),i=h1("useWindowScroll"),r=h1("customScrollParent"),o=h2("windowScrollContainerState"),a=h2("scrollContainerState"),s=h1("itemContent"),l=h1("context"),u=h1("groupContent"),c=h1("trackItemSizes"),h=h1("itemSize"),d=h1("log"),f=h2("gap"),p=h1("horizontalDirection"),{callbackRef:g}=ca(n,h,c,e?uR:r||i?o:a,d,f,r,p,h1("skipAnimationFrameInResizeObserver")),[m,v]=eD().useState(0);h0("deviation",e=>{m!==e&&v(e)});let y=h1("EmptyPlaceholder"),x=h1("ScrollSeekPlaceholder")??hE,b=h1("ListComponent"),w=h1("ItemComponent"),S=h1("GroupComponent"),_=h1("computeItemKey"),C=h1("isSeeking"),M=h1("groupIndices").length>0,A=h1("alignToBottom"),k=h1("initialItemFinalLocationReached"),T=e?{}:{boxSizing:"border-box",...p?{display:"inline-block",height:"100%",marginInlineStart:0===m?A?"auto":0:m,paddingInlineEnd:t.offsetBottom,paddingInlineStart:t.offsetTop,whiteSpace:"nowrap"}:{marginTop:0===m?A?"auto":0:m,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...k?{}:{visibility:"hidden"}};return e||0!==t.totalCount||null==y?(0,eb.jsx)(b,{...hG(b,l),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:T,children:(e?t.topItems:t.items).map(e=>{let n=e.originalIndex,i=_(n+t.firstItemIndex,e.data,l);return C?(0,eI.createElement)(x,{...hG(x,l),height:e.size,index:e.index,key:i,type:e.type||"item",..."group"===e.type?{}:{groupIndex:e.groupIndex}}):"group"===e.type?(0,eI.createElement)(S,{...hG(S,l),"data-index":n,"data-item-index":e.index,"data-known-size":e.size,key:i,style:hL},u(e.index,l)):(0,eI.createElement)(w,{...hG(w,l),...h$(w,e.data),"data-index":n,"data-item-group-index":e.groupIndex,"data-item-index":e.index,"data-known-size":e.size,key:i,style:p?hB:hN},M?s(e.index,e.groupIndex,e.data,l):s(e.index,e.data,l))})}):(0,eb.jsx)(y,{...hG(y,l)})}),hz={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},hV={outline:"none",overflowX:"auto",position:"relative"},hj=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),hH=(e,t,n=0)=>({...hj(e),position:t?"relative":"absolute",top:t?-n:0}),hW={position:hk(),top:0,width:"100%",zIndex:1};function hG(e,t){if("string"!=typeof e)return{context:t}}function h$(e,t){return{item:"string"==typeof e?void 0:t}}let hU=eD().memo(function(){let e=h1("HeaderComponent"),t=h2("headerHeight"),n=h1("HeaderFooterTag"),i=cr(eD().useMemo(()=>e=>{t(cT(e,"height"))},[t]),!0,h1("skipAnimationFrameInResizeObserver")),r=h1("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hG(e,r)})}):null}),hq=eD().memo(function(){let e=h1("FooterComponent"),t=h2("footerHeight"),n=h1("HeaderFooterTag"),i=cr(eD().useMemo(()=>e=>{t(cT(e,"height"))},[t]),!0,h1("skipAnimationFrameInResizeObserver")),r=h1("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hG(e,r)})}):null});function hY({useEmitter:e,useEmitterValue:t,usePublisher:n}){return eD().memo(function({children:i,style:r,context:o,...a}){let s=n("scrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("scrollerRef"),h=t("horizontalDirection")||!1,{scrollByCallback:d,scrollerRef:f,scrollToCallback:p}=hD(s,u,l,c,void 0,h);return e("scrollTo",p),e("scrollBy",d),(0,eb.jsx)(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...h?hV:hz,...r},tabIndex:0,...a,...hG(l,o),children:i})})}function hZ({useEmitter:e,useEmitterValue:t,usePublisher:n}){return eD().memo(function({children:i,style:r,context:o,...a}){let s=n("windowScrollContainerState"),l=t("ScrollerComponent"),u=n("smoothScrollTargetReached"),c=t("totalListHeight"),h=t("deviation"),d=t("customScrollParent"),f=eD().useRef(null),{scrollByCallback:p,scrollerRef:g,scrollToCallback:m}=hD(s,u,l,t("scrollerRef"),d);return hT(()=>(g.current=d??f.current?.ownerDocument.defaultView,()=>{g.current=null}),[g,d]),e("windowScrollTo",m),e("scrollBy",p),(0,eb.jsx)(l,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...0===c?void 0:{height:c+h}},...a,...hG(l,o),children:i})})}let hX=({children:e})=>{let t=eD().useContext(h_),n=h2("viewportHeight"),i=h2("fixedItemHeight"),r=h1("alignToBottom"),o=h1("horizontalDirection"),a=cr(eD().useMemo(()=>uO(n,e=>cT(e,o?"width":"height")),[n,o]),!0,h1("skipAnimationFrameInResizeObserver"));return eD().useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"element",ref:a,style:hj(r),children:e})},hK=({children:e})=>{let t=eD().useContext(h_),n=h2("windowViewportRect"),i=h2("fixedItemHeight"),r=h1("customScrollParent"),o=h1("useWindowScroll"),a=h1("topListHeight"),s=cl(n,r,h1("skipAnimationFrameInResizeObserver")),l=h1("alignToBottom");return eD().useEffect(()=>{t&&(i(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"window",ref:s,style:hH(l,o,a),children:e})},hQ=({children:e})=>{let t=h1("TopItemListComponent")??"div",n=h1("headerHeight"),i={...hW,marginTop:`${n}px`},r=h1("context");return(0,eb.jsx)(t,{style:i,...hG(t,r),children:e})},{Component:hJ,useEmitter:h0,useEmitterValue:h1,usePublisher:h2}=hS(hR,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},eD().memo(function(e){let t=h1("useWindowScroll"),n=h1("topItemsIndexes").length>0,i=h1("customScrollParent"),r=h1("context");return(0,eb.jsxs)(i||t?h3:h5,{...e,context:r,children:[n&&(0,eb.jsx)(hQ,{children:(0,eb.jsx)(hF,{showTopList:!0})}),(0,eb.jsxs)(i||t?hK:hX,{children:[(0,eb.jsx)(hU,{}),(0,eb.jsx)(hF,{}),(0,eb.jsx)(hq,{})]})]})})),h5=hY({useEmitter:h0,useEmitterValue:h1,usePublisher:h2}),h3=hZ({useEmitter:h0,useEmitterValue:h1,usePublisher:h2}),h4=u2(()=>{let e=uK(e=>(0,eb.jsxs)("td",{children:["Item $",e]})),t=uK(null),n=uK(e=>(0,eb.jsxs)("td",{colSpan:1e3,children:["Group ",e]})),i=uK(null),r=uK(null),o=uK({}),a=uK(hO),s=uK(uR),l=(e,t=null)=>uQ(uU(o,uG(t=>t[e]),uH()),t);return{components:o,computeItemKey:a,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:i,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}}),h6=u2(([e,t])=>({...e,...t}),uL(hb,h4)),h8=({height:e})=>(0,eb.jsx)("tr",{children:(0,eb.jsx)("td",{style:{height:e}})}),h9=({height:e})=>(0,eb.jsx)("tr",{children:(0,eb.jsx)("td",{style:{border:0,height:e,padding:0}})}),h7={overflowAnchor:"none"},de={position:hk(),zIndex:2,overflowAnchor:"none"},dt=eD().memo(function({showTopList:e=!1}){let t=dl("listState"),n=dl("computeItemKey"),i=dl("firstItemIndex"),r=dl("context"),o=dl("isSeeking"),a=dl("fixedHeaderHeight"),s=dl("groupIndices").length>0,l=dl("itemContent"),u=dl("groupContent"),c=dl("ScrollSeekPlaceholder")??h8,h=dl("GroupComponent"),d=dl("TableRowComponent"),f=(e?t.topItems:[]).reduce((e,t,n)=>(0===n?e.push(t.size):e.push(e[n-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{let p=t.originalIndex,g=n(p+i,t.data,r),m=e?0===p?0:f[p-1]:0;return o?(0,eI.createElement)(c,{...hG(c,r),height:t.size,index:t.index,key:g,type:t.type||"item"}):"group"===t.type?(0,eI.createElement)(h,{...hG(h,r),"data-index":p,"data-item-index":t.index,"data-known-size":t.size,key:g,style:{...de,top:a}},u(t.index,r)):(0,eI.createElement)(d,{...hG(d,r),...h$(d,t.data),"data-index":p,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:g,style:e?{...de,top:a+m}:h7},s?l(t.index,t.groupIndex,t.data,r):l(t.index,t.data,r))})}),dn=eD().memo(function(){let e=dl("listState"),t=dl("topItemsIndexes").length>0,n=du("sizeRanges"),i=dl("useWindowScroll"),r=dl("customScrollParent"),o=du("windowScrollContainerState"),a=du("scrollContainerState"),s=dl("trackItemSizes"),{callbackRef:l,ref:u}=ca(n,dl("itemSize"),s,r||i?o:a,dl("log"),void 0,r,!1,dl("skipAnimationFrameInResizeObserver")),[c,h]=eD().useState(0);ds("deviation",e=>{c!==e&&(u.current.style.marginTop=`${e}px`,h(e))});let d=dl("EmptyPlaceholder"),f=dl("FillerRow")??h9,p=dl("TableBodyComponent"),g=dl("paddingTopAddition"),m=dl("statefulTotalCount"),v=dl("context");if(0===m&&null!=d)return(0,eb.jsx)(d,{...hG(d,v)});let y=(t?e.topItems:[]).reduce((e,t)=>e+t.size,0),x=e.offsetTop+g+c-y,b=e.offsetBottom,w=x>0?(0,eb.jsx)(f,{context:v,height:x},"padding-top"):null,S=b>0?(0,eb.jsx)(f,{context:v,height:b},"padding-bottom"):null;return(0,eb.jsxs)(p,{"data-testid":"virtuoso-item-list",ref:l,...hG(p,v),children:[w,t&&(0,eb.jsx)(dt,{showTopList:!0}),(0,eb.jsx)(dt,{}),S]})}),di=({children:e})=>{let t=eD().useContext(h_),n=du("viewportHeight"),i=du("fixedItemHeight"),r=cr(eD().useMemo(()=>uO(n,e=>cT(e,"height")),[n]),!0,dl("skipAnimationFrameInResizeObserver"));return eD().useEffect(()=>{t&&(n(t.viewportHeight),i(t.itemHeight))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"element",ref:r,style:hj(!1),children:e})},dr=({children:e})=>{let t=eD().useContext(h_),n=du("windowViewportRect"),i=du("fixedItemHeight"),r=dl("customScrollParent"),o=dl("useWindowScroll"),a=cl(n,r,dl("skipAnimationFrameInResizeObserver"));return eD().useEffect(()=>{t&&(i(t.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,i]),(0,eb.jsx)("div",{"data-viewport-type":"window",ref:a,style:hH(!1,o),children:e})},{Component:da,useEmitter:ds,useEmitterValue:dl,usePublisher:du}=hS(h6,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},eD().memo(function(e){let t=dl("useWindowScroll"),n=dl("customScrollParent"),i=du("fixedHeaderHeight"),r=du("fixedFooterHeight"),o=dl("fixedHeaderContent"),a=dl("fixedFooterContent"),s=dl("context"),l=cr(eD().useMemo(()=>uO(i,e=>cT(e,"height")),[i]),!0,dl("skipAnimationFrameInResizeObserver")),u=cr(eD().useMemo(()=>uO(r,e=>cT(e,"height")),[r]),!0,dl("skipAnimationFrameInResizeObserver")),c=n||t?dh:dc,h=n||t?dr:di,d=dl("TableComponent"),f=dl("TableHeadComponent"),p=dl("TableFooterComponent"),g=o?(0,eb.jsx)(f,{ref:l,style:{position:"sticky",top:0,zIndex:2},...hG(f,s),children:o()},"TableHead"):null,m=a?(0,eb.jsx)(p,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...hG(p,s),children:a()},"TableFoot"):null;return(0,eb.jsx)(c,{...e,...hG(c,s),children:(0,eb.jsx)(h,{children:(0,eb.jsxs)(d,{style:{borderSpacing:0,overflowAnchor:"none"},...hG(d,s),children:[g,(0,eb.jsx)(dn,{},"TableBody"),m]})})})})),dc=hY({useEmitter:ds,useEmitterValue:dl,usePublisher:du}),dh=hZ({useEmitter:ds,useEmitterValue:dl,usePublisher:du}),dd={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},df={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:dp,floor:dg,max:dm,min:dv,round:dy}=Math;function dx(e,t,n){return Array.from({length:t-e+1}).map((t,i)=>({data:null===n?null:n[i+e],index:i+e}))}function db(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function dw(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}let dS=u2(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:i},{footerHeight:r,headerHeight:o,scrollBy:a,scrollContainerState:s,scrollTo:l,scrollTop:u,smoothScrollTargetReached:c,viewportHeight:h},d,f,{didMount:p,propsReady:g},{customScrollParent:m,useWindowScroll:v,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b},w])=>{let S=uK(0),_=uK(0),C=uK(dd),M=uK({height:0,width:0}),A=uK({height:0,width:0}),k=uJ(),T=uJ(),I=uK(0),D=uK(null),O=uK({column:0,row:0}),P=uJ(),R=uJ(),E=uK(!1),L=uK(0),N=uK(!0),B=uK(!1),F=uK(!1);uU(p,uX(L),uW(([e,t])=>!cZ(t)))(1,()=>{N(0,!1)}),uU(u3(p,N,A,M,L,B),uW(([e,t,n,i,,r])=>e&&!t&&0!==n.height&&0!==i.height&&!r))(1,([,,,,e])=>{void 0===e?N(0,!0):(B(0,!0),cq(1,()=>{k(0,e)}),uz(uU(u),()=>{t(0,[0,0]),N(0,!0)}))}),uF(uU(R,uW(e=>null!=e&&e.scrollTop>0),u$(0)),_),uU(p,uX(R),uW(([,e])=>null!=e))(1,([,e])=>{e&&(M(0,e.viewport),A(0,e.item),O(0,e.gap),e.scrollTop>0&&(E(0,!0),uz(uU(u,uY(1)),e=>{E(0,!1)}),l(0,{top:e.scrollTop})))}),uF(uU(M,uG(({height:e})=>e)),h),uF(uU(u3(u4(M,db),u4(A,db),u4(O,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),u4(u)),uG(([e,t,n,i])=>({gap:n,item:t,scrollTop:i,viewport:e}))),P),uF(uU(u3(u4(S),i,u4(O,dw),u4(A,db),u4(M,db),u4(D),u4(_),u4(E),u4(N),u4(L)),uW(([,,,,,,,e])=>!e),uG(([e,[t,n],i,r,o,a,s,,l,u])=>{let c,h,{column:d,row:f}=i,{height:p,width:g}=r,{width:m}=o;if(0===s&&(0===e||0===m))return dd;if(0===g){var v;let t=cY(u,e),n=t+Math.max(s-1,0);return v=dx(t,n,a),{...df,items:v}}let y=d_(m,g,d);l?0===t&&0===n&&s>0?(c=0,h=s-1):(c=y*dg((t+f)/(p+f)),h=dv(e-1,dm(h=y*dp((n+f)/(p+f))-1,y-1)),c=dv(h,dm(0,c))):(c=0,h=-1);let x=dx(c,h,a),{bottom:b,top:w}=dC(o,i,r,x),S=dp(e/y);return{bottom:b,itemHeight:p,items:x,itemWidth:g,offsetBottom:S*p+(S-1)*f-b,offsetTop:w,top:w}})),C),uF(uU(D,uW(e=>null!==e),uG(e=>e.length)),S),uF(uU(u3(M,A,C,O),uW(([e,t,{items:n}])=>n.length>0&&0!==t.height&&0!==e.height),uG(([e,t,{items:n},i])=>{let{bottom:r,top:o}=dC(e,i,t,n);return[o,r]}),uH(cM)),t);let z=uK(!1);uF(uU(u,uX(z),uG(([e,t])=>t||0!==e)),z);let V=u0(uU(u3(C,S),uW(([{items:e}])=>e.length>0),uX(z),uW(([[e,t],n])=>{let i=e.items[e.items.length-1].index===t-1;return(n||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&i}),uG(([[,e]])=>e-1),uH())),j=u0(uU(u4(C),uW(({items:e})=>e.length>0&&0===e[0].index),u$(0),uH())),H=u0(uU(u4(C),uX(E),uW(([{items:e},t])=>e.length>0&&!t),uG(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),uH(cC),uZ(0)));uF(H,f.scrollSeekRangeChanged),uF(uU(k,uX(M,A,S,O),uG(([e,t,n,i,r])=>{let o=c$(e),{align:a,behavior:s,offset:l}=o,u=o.index;"LAST"===u&&(u=i-1);let c=dM(t,r,n,u=dm(0,u,dv(i-1,u)));return"end"===a?c=dy(c-t.height+n.height):"center"===a&&(c=dy(c-t.height/2+n.height/2)),void 0!==l&&0!==l&&(c+=l),{behavior:s,top:c}})),l);let W=uQ(uU(C,uG(e=>e.offsetBottom+e.bottom)),0);return uF(uU(b,uG(e=>({height:e.visibleHeight,width:e.visibleWidth}))),M),{customScrollParent:m,data:D,deviation:I,footerHeight:r,gap:O,headerHeight:o,increaseViewportBy:e,initialItemCount:_,itemDimensions:A,overscan:n,restoreStateFrom:R,scrollBy:a,scrollContainerState:s,scrollHeight:T,scrollTo:l,scrollToIndex:k,scrollTop:u,smoothScrollTargetReached:c,totalCount:S,useWindowScroll:v,viewportDimensions:M,windowScrollContainerState:y,windowScrollTo:x,windowViewportRect:b,...f,gridState:C,horizontalDirection:F,initialTopMostItemIndex:L,totalListHeight:W,...d,endReached:V,propsReady:g,rangeChanged:H,startReached:j,stateChanged:P,stateRestoreInProgress:E,...w}},uL(c4,cu,c0,hh,cW,hd,u7));function d_(e,t,n){return dm(1,dg((e+n)/(dg(t)+n)))}function dC(e,t,n,i){let{height:r}=n;if(void 0===r||0===i.length)return{bottom:0,top:0};let o=dM(e,t,n,i[0].index);return{bottom:dM(e,t,n,i[i.length-1].index)+r,top:o}}function dM(e,t,n,i){let r=dg(i/d_(e.width,n.width,t.column)),o=r*n.height+dm(0,r-1)*t.row;return o>0?o+t.row:o}let dA=u2(()=>{let e=uK(e=>`Item ${e}`),t=uK({}),n=uK(null),i=uK("virtuoso-grid-item"),r=uK("virtuoso-grid-list"),o=uK(hO),a=uK("div"),s=uK(uR),l=(e,n=null)=>uQ(uU(t,uG(t=>t[e]),uH()),n),u=uK(!1),c=uK(!1);return uF(u4(c),u),{components:t,computeItemKey:o,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:a,itemClassName:i,ItemComponent:l("Item","div"),itemContent:e,listClassName:r,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),dk=u2(([e,t])=>({...e,...t}),uL(dS,dA)),dT=eD().memo(function(){let e=dE("gridState"),t=dE("listClassName"),n=dE("itemClassName"),i=dE("itemContent"),r=dE("computeItemKey"),o=dE("isSeeking"),a=dL("scrollHeight"),s=dE("ItemComponent"),l=dE("ListComponent"),u=dE("ScrollSeekPlaceholder"),c=dE("context"),h=dL("itemDimensions"),d=dL("gap"),f=dE("log"),p=dE("stateRestoreInProgress"),g=dL("reportReadyState"),m=cr(eD().useMemo(()=>e=>{a(e.parentElement.parentElement.scrollHeight);let t=e.firstChild;if(null!==t){let{height:e,width:n}=t.getBoundingClientRect();h({height:e,width:n})}d({column:dF("column-gap",getComputedStyle(e).columnGap,f),row:dF("row-gap",getComputedStyle(e).rowGap,f)})},[a,h,d,f]),!0,!1);return hT(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),p?null:(0,eb.jsx)(l,{className:t,ref:m,...hG(l,c),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(t=>{let a=r(t.index,t.data,c);return o?(0,eb.jsx)(u,{...hG(u,c),height:e.itemHeight,index:t.index,width:e.itemWidth},a):(0,eI.createElement)(s,{...hG(s,c),className:n,"data-index":t.index,key:a},i(t.index,t.data,c))})})}),dI=eD().memo(function(){let e=dE("HeaderComponent"),t=dL("headerHeight"),n=dE("headerFooterTag"),i=cr(eD().useMemo(()=>e=>{t(cT(e,"height"))},[t]),!0,!1),r=dE("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hG(e,r)})}):null}),dD=eD().memo(function(){let e=dE("FooterComponent"),t=dL("footerHeight"),n=dE("headerFooterTag"),i=cr(eD().useMemo(()=>e=>{t(cT(e,"height"))},[t]),!0,!1),r=dE("context");return null!=e?(0,eb.jsx)(n,{ref:i,children:(0,eb.jsx)(e,{...hG(e,r)})}):null}),dO=({children:e})=>{let t=eD().useContext(hC),n=dL("itemDimensions"),i=dL("viewportDimensions"),r=cr(eD().useMemo(()=>e=>{i(e.getBoundingClientRect())},[i]),!0,!1);return eD().useEffect(()=>{t&&(i({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,i,n]),(0,eb.jsx)("div",{ref:r,style:hj(!1),children:e})},dP=({children:e})=>{let t=eD().useContext(hC),n=dL("windowViewportRect"),i=dL("itemDimensions"),r=dE("customScrollParent"),o=dE("useWindowScroll"),a=cl(n,r,!1);return eD().useEffect(()=>{t&&(i({height:t.itemHeight,width:t.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,i]),(0,eb.jsx)("div",{ref:a,style:hH(!1,o),children:e})},{useEmitter:dR,useEmitterValue:dE,usePublisher:dL}=hS(dk,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},eD().memo(function({...e}){let t=dE("useWindowScroll"),n=dE("customScrollParent"),i=n||t?dB:dN,r=n||t?dP:dO,o=dE("context");return(0,eb.jsx)(i,{...e,...hG(i,o),children:(0,eb.jsxs)(r,{children:[(0,eb.jsx)(dI,{}),(0,eb.jsx)(dT,{}),(0,eb.jsx)(dD,{})]})})})),dN=hY({useEmitter:dR,useEmitterValue:dE,usePublisher:dL}),dB=hZ({useEmitter:dR,useEmitterValue:dE,usePublisher:dL});function dF(e,t,n){return"normal"!==t&&t?.endsWith("px")!==!0&&n(`${e} was not resolved to pixel value correctly`,t,2),"normal"===t?0:parseInt(t??"0",10)}function dz({items:e,height:t,width:n,selectedItems:i,onLegendItemClick:r,onItemMouseOver:o,onItemMouseOut:a}){let s=e.length>5;return(0,eb.jsx)(hJ,{style:{height:t,width:n},data:e,itemContent:(e,t)=>(0,eb.jsx)(uT,{item:t,index:e,truncateLabel:s,isVisuallySelected:ul(t,i),onClick:r,onMouseOver:o,onMouseOut:a,sx:{width:"100%",wordBreak:"break-word",overflow:"hidden"}},t.id),role:"list"})}function dV(e,t){return"function"==typeof e?e(t):e}function dj(e,t){return n=>{t.setState(t=>({...t,[e]:dV(n,t[e])}))}}function dH(e){return e instanceof Function}function dW(e,t,n){let i,r=[];return o=>{let a,s;n.key&&n.debug&&(a=Date.now());let l=e(o);if(!(l.length!==r.length||l.some((e,t)=>r[t]!==e)))return i;if(r=l,n.key&&n.debug&&(s=Date.now()),i=t(...l),null==n||null==n.onChange||n.onChange(i),n.key&&n.debug&&null!=n&&n.debug()){let e=Math.round((Date.now()-a)*100)/100,t=Math.round((Date.now()-s)*100)/100,i=t/16,r=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${r(t,5)} /${r(e,5)} ms`,`
|
|
3
|
+
font-size: .6rem;
|
|
4
|
+
font-weight: bold;
|
|
5
|
+
color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return i}}function dG(e,t,n,i){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:i}}let d$="debugHeaders";function dU(e,t,n){var i;let r={id:null!=(i=n.id)?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(r,e)}),r}function dq(e,t,n,i){var r,o;let a=0,s=function(e,t){void 0===t&&(t=1),a=Math.max(a,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&s(e.columns,t+1)},0)};s(e);let l=[],u=(e,t)=>{let r={depth:t,id:[i,`${t}`].filter(Boolean).join("_"),headers:[]},o=[];e.forEach(e=>{let a,s=[...o].reverse()[0],l=e.column.depth===r.depth,u=!1;if(l&&e.column.parent?a=e.column.parent:(a=e.column,u=!0),s&&(null==s?void 0:s.column)===a)s.subHeaders.push(e);else{let r=dU(n,a,{id:[i,t,a.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${o.filter(e=>e.column===a).length}`:void 0,depth:t,index:o.length});r.subHeaders.push(e),o.push(r)}r.headers.push(e),e.headerGroup=r}),l.push(r),t>0&&u(o,t-1)};u(t.map((e,t)=>dU(n,e,{depth:a,index:t})),a-1),l.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,i=[0];return e.subHeaders&&e.subHeaders.length?(i=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:r}=e;t+=n,i.push(r)})):t=1,n+=Math.min(...i),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(r=null==(o=l[0])?void 0:o.headers)?r:[]),l}let dY=(e,t,n,i,r,o,a)=>{let s={id:t,index:i,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,i),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(null!=n&&n.accessorFn)return n.columnDef.getUniqueValues?s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,i):s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]},renderValue:t=>{var n;return null!=(n=s.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=o?o:[],getLeafRows:()=>{var e,t;let n,i;return e=s.subRows,t=e=>e.subRows,n=[],(i=e=>{e.forEach(e=>{n.push(e);let r=t(e);null!=r&&r.length&&i(r)})})(e),n},getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:dW(()=>[e.getAllLeafColumns()],t=>t.map(t=>{var n;let i;return n=t.id,i={id:`${s.id}_${t.id}`,row:s,column:t,getValue:()=>s.getValue(n),renderValue:()=>{var t;return null!=(t=i.getValue())?t:e.options.renderFallbackValue},getContext:dW(()=>[e,t,s,i],(e,t,n,i)=>({table:e,column:t,row:n,cell:i,getValue:i.getValue,renderValue:i.renderValue}),dG(e.options,"debugCells","cell.getContext"))},e._features.forEach(n=>{null==n.createCell||n.createCell(i,t,s,e)},{}),i}),dG(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:dW(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),dG(e.options,"debugRows","getAllCellsByColumnId"))};for(let t=0;t<e._features.length;t++){let n=e._features[t];null==n||null==n.createRow||n.createRow(s,e)}return s},dZ=(e,t,n)=>{var i,r;let o=null==n||null==(i=n.toString())?void 0:i.toLowerCase();return!!(null==(r=e.getValue(t))||null==(r=r.toString())||null==(r=r.toLowerCase())?void 0:r.includes(o))};dZ.autoRemove=e=>d4(e);let dX=(e,t,n)=>{var i;return!!(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.includes(n))};dX.autoRemove=e=>d4(e);let dK=(e,t,n)=>{var i;return(null==(i=e.getValue(t))||null==(i=i.toString())?void 0:i.toLowerCase())===(null==n?void 0:n.toLowerCase())};dK.autoRemove=e=>d4(e);let dQ=(e,t,n)=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)};dQ.autoRemove=e=>d4(e);let dJ=(e,t,n)=>!n.some(n=>{var i;return!(null!=(i=e.getValue(t))&&i.includes(n))});dJ.autoRemove=e=>d4(e)||!(null!=e&&e.length);let d0=(e,t,n)=>n.some(n=>{var i;return null==(i=e.getValue(t))?void 0:i.includes(n)});d0.autoRemove=e=>d4(e)||!(null!=e&&e.length);let d1=(e,t,n)=>e.getValue(t)===n;d1.autoRemove=e=>d4(e);let d2=(e,t,n)=>e.getValue(t)==n;d2.autoRemove=e=>d4(e);let d5=(e,t,n)=>{let[i,r]=n,o=e.getValue(t);return o>=i&&o<=r};d5.resolveFilterValue=e=>{let[t,n]=e,i="number"!=typeof t?parseFloat(t):t,r="number"!=typeof n?parseFloat(n):n,o=null===t||Number.isNaN(i)?-1/0:i,a=null===n||Number.isNaN(r)?1/0:r;if(o>a){let e=o;o=a,a=e}return[o,a]},d5.autoRemove=e=>d4(e)||d4(e[0])&&d4(e[1]);let d3={includesString:dZ,includesStringSensitive:dX,equalsString:dK,arrIncludes:dQ,arrIncludesAll:dJ,arrIncludesSome:d0,equals:d1,weakEquals:d2,inNumberRange:d5};function d4(e){return null==e||""===e}function d6(e,t,n){return!!e&&!!e.autoRemove&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}let d8={sum:(e,t,n)=>n.reduce((t,n)=>{let i=n.getValue(e);return t+("number"==typeof i?i:0)},0),min:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i>n||void 0===i&&n>=n)&&(i=n)}),i},max:(e,t,n)=>{let i;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(i<n||void 0===i&&n>=n)&&(i=n)}),i},extent:(e,t,n)=>{let i,r;return n.forEach(t=>{let n=t.getValue(e);null!=n&&(void 0===i?n>=n&&(i=r=n):(i>n&&(i=n),r<n&&(r=n)))}),[i,r]},mean:(e,t)=>{let n=0,i=0;if(t.forEach(t=>{let r=t.getValue(e);null!=r&&(r*=1)>=r&&(++n,i+=r)}),n)return i/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!(Array.isArray(n)&&n.every(e=>"number"==typeof e)))return;if(1===n.length)return n[0];let i=Math.floor(n.length/2),r=n.sort((e,t)=>e-t);return n.length%2!=0?r[i]:(r[i-1]+r[i])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},d9=()=>({left:[],right:[]}),d7={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},fe=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ft=null;function fn(e){return"touchstart"===e.type}function fi(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}let fr=()=>({pageIndex:0,pageSize:10}),fo=()=>({top:[],bottom:[]}),fa=(e,t,n,i,r)=>{var o;let a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),a.getCanSelect()&&(e[t]=!0)):delete e[t],i&&null!=(o=a.subRows)&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(t=>fa(e,t.id,n,i,r))};function fs(e,t){let n=e.getState().rowSelection,i=[],r={},o=function(e,t){return e.map(e=>{var t;let a=fl(e,n);if(a&&(i.push(e),r[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:o(e.subRows)}),a)return e}).filter(Boolean)};return{rows:o(t.rows),flatRows:i,rowsById:r}}function fl(e,t){var n;return null!=(n=t[e.id])&&n}function fu(e,t,n){var i;if(!(null!=(i=e.subRows)&&i.length))return!1;let r=!0,o=!1;return e.subRows.forEach(e=>{if((!o||r)&&(e.getCanSelect()&&(fl(e,t)?o=!0:r=!1),e.subRows&&e.subRows.length)){let n=fu(e,t);"all"===n?o=!0:("some"===n&&(o=!0),r=!1)}}),r?"all":!!o&&"some"}let fc=/([0-9]+)/gm;function fh(e,t){return e===t?0:e>t?1:-1}function fd(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function ff(e,t){let n=e.split(fc).filter(Boolean),i=t.split(fc).filter(Boolean);for(;n.length&&i.length;){let e=n.shift(),t=i.shift(),r=parseInt(e,10),o=parseInt(t,10),a=[r,o].sort();if(isNaN(a[0])){if(e>t)return 1;if(t>e)return -1;continue}if(isNaN(a[1]))return isNaN(r)?-1:1;if(r>o)return 1;if(o>r)return -1}return n.length-i.length}let fp={alphanumeric:(e,t,n)=>ff(fd(e.getValue(n)).toLowerCase(),fd(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>ff(fd(e.getValue(n)),fd(t.getValue(n))),text:(e,t,n)=>fh(fd(e.getValue(n)).toLowerCase(),fd(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>fh(fd(e.getValue(n)),fd(t.getValue(n))),datetime:(e,t,n)=>{let i=e.getValue(n),r=t.getValue(n);return i>r?1:i<r?-1:0},basic:(e,t,n)=>fh(e.getValue(n),t.getValue(n))},fg=[{createTable:e=>{e.getHeaderGroups=dW(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>{var o,a;let s=null!=(o=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?o:[],l=null!=(a=null==r?void 0:r.map(e=>n.find(t=>t.id===e)).filter(Boolean))?a:[];return dq(t,[...s,...n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),...l],e)},dG(e.options,d$,"getHeaderGroups")),e.getCenterHeaderGroups=dW(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,r)=>dq(t,n=n.filter(e=>!(null!=i&&i.includes(e.id))&&!(null!=r&&r.includes(e.id))),e,"center"),dG(e.options,d$,"getCenterHeaderGroups")),e.getLeftHeaderGroups=dW(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var r;return dq(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"left")},dG(e.options,d$,"getLeftHeaderGroups")),e.getRightHeaderGroups=dW(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var r;return dq(t,null!=(r=null==i?void 0:i.map(e=>n.find(t=>t.id===e)).filter(Boolean))?r:[],e,"right")},dG(e.options,d$,"getRightHeaderGroups")),e.getFooterGroups=dW(()=>[e.getHeaderGroups()],e=>[...e].reverse(),dG(e.options,d$,"getFooterGroups")),e.getLeftFooterGroups=dW(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),dG(e.options,d$,"getLeftFooterGroups")),e.getCenterFooterGroups=dW(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),dG(e.options,d$,"getCenterFooterGroups")),e.getRightFooterGroups=dW(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),dG(e.options,d$,"getRightFooterGroups")),e.getFlatHeaders=dW(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),dG(e.options,d$,"getFlatHeaders")),e.getLeftFlatHeaders=dW(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),dG(e.options,d$,"getLeftFlatHeaders")),e.getCenterFlatHeaders=dW(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),dG(e.options,d$,"getCenterFlatHeaders")),e.getRightFlatHeaders=dW(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),dG(e.options,d$,"getRightFlatHeaders")),e.getCenterLeafHeaders=dW(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),dG(e.options,d$,"getCenterLeafHeaders")),e.getLeftLeafHeaders=dW(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),dG(e.options,d$,"getLeftLeafHeaders")),e.getRightLeafHeaders=dW(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),dG(e.options,d$,"getRightLeafHeaders")),e.getLeafHeaders=dW(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var i,r,o,a,s,l;return[...null!=(i=null==(r=e[0])?void 0:r.headers)?i:[],...null!=(o=null==(a=t[0])?void 0:a.headers)?o:[],...null!=(s=null==(l=n[0])?void 0:l.headers)?s:[]].map(e=>e.getLeafHeaders()).flat()},dG(e.options,d$,"getLeafHeaders"))}},{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:dj("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,i;let r=e.columns;return null==(n=r.length?r.some(e=>e.getIsVisible()):null==(i=t.getState().columnVisibility)?void 0:i[e.id])||n},e.getCanHide=()=>{var n,i;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(i=t.options.enableHiding)||i)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=dW(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),dG(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=dW(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],dG(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(t,n)=>dW(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),dG(e.options,"debugColumns",t));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},{getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:dj("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=dW(e=>[fi(t,e)],t=>t.findIndex(t=>t.id===e.id),dG(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var i;return(null==(i=fi(t,n)[0])?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;let r=fi(t,n);return(null==(i=r[r.length-1])?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=dW(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>i=>{let r=[];if(null!=e&&e.length){let t=[...e],n=[...i];for(;n.length&&t.length;){let e=t.shift(),i=n.findIndex(t=>t.id===e);i>-1&&r.push(n.splice(i,1)[0])}r=[...r,...n]}else r=i;var o=r;if(!(null!=t&&t.length)||!n)return o;let a=o.filter(e=>!t.includes(e.id));return"remove"===n?a:[...t.map(e=>o.find(t=>t.id===e)).filter(Boolean),...a]},dG(e.options,"debugTable","_getOrderColumnsFn"))}},{getInitialState:e=>({columnPinning:d9(),...e}),getDefaultOptions:e=>({onColumnPinningChange:dj("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let i=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,r,o,a,s,l;return"right"===n?{left:(null!=(o=null==e?void 0:e.left)?o:[]).filter(e=>!(null!=i&&i.includes(e))),right:[...(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=i&&i.includes(e))),...i]}:"left"===n?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter(e=>!(null!=i&&i.includes(e))),...i],right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=i&&i.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=i&&i.includes(e))),right:(null!=(r=null==e?void 0:e.right)?r:[]).filter(e=>!(null!=i&&i.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,i,r;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(i=null!=(r=t.options.enableColumnPinning)?r:t.options.enablePinning)||i)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:i,right:r}=t.getState().columnPinning,o=n.some(e=>null==i?void 0:i.includes(e)),a=n.some(e=>null==r?void 0:r.includes(e));return o?"left":!!a&&"right"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();return r?null!=(n=null==(i=t.getState().columnPinning)||null==(i=i[r])?void 0:i.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=dW(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.column.id))},dG(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=dW(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),dG(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=dW(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),dG(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,i;return e.setColumnPinning(t?d9():null!=(n=null==(i=e.initialState)?void 0:i.columnPinning)?n:d9())},e.getIsSomeColumnsPinned=t=>{var n,i,r;let o=e.getState().columnPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.left)?void 0:i.length)||(null==(r=o.right)?void 0:r.length))},e.getLeftLeafColumns=dW(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),dG(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=dW(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),dG(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=dW(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let i=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!i.includes(e.id))},dG(e.options,"debugColumns","getCenterLeafColumns"))}},{createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},{getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:dj("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"string"==typeof i?d3.includesString:"number"==typeof i?d3.inNumberRange:"boolean"==typeof i||null!==i&&"object"==typeof i?d3.equals:Array.isArray(i)?d3.arrIncludes:d3.weakEquals},e.getFilterFn=()=>{var n,i;return dH(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(i=t.options.filterFns)?void 0:i[e.columnDef.filterFn])?n:d3[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,i,r;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(i=t.options.enableColumnFilters)||i)&&(null==(r=t.options.enableFilters)||r)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().columnFilters)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{var i,r;let o=e.getFilterFn(),a=null==t?void 0:t.find(t=>t.id===e.id),s=dV(n,a?a.value:void 0);if(d6(o,s,e))return null!=(i=null==t?void 0:t.filter(t=>t.id!==e.id))?i:[];let l={id:e.id,value:s};return a?null!=(r=null==t?void 0:t.map(t=>t.id===e.id?l:t))?r:[]:null!=t&&t.length?[...t,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var i;return null==(i=dV(t,e))?void 0:i.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&d6(t.getFilterFn(),e.value,t))&&!0})})},e.resetColumnFilters=t=>{var n,i;e.setColumnFilters(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel)?e.getPreFilteredRowModel():e._getFilteredRowModel()}},{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:dj("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let i=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof i||"number"==typeof i}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,i,r,o;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(i=t.options.enableGlobalFilter)||i)&&(null==(r=t.options.enableFilters)||r)&&(null==(o=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||o)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>d3.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:i}=e.options;return dH(i)?i:"auto"===i?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[i])?t:d3[i]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:dj("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),i=!1;for(let t of n){let n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return fp.datetime;if("string"==typeof n&&(i=!0,n.split(fc).length>1))return fp.alphanumeric}return i?fp.text:fp.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,i;if(!e)throw Error();return dH(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(i=t.options.sortingFns)?void 0:i[e.columnDef.sortingFn])?n:fp[e.columnDef.sortingFn]},e.toggleSorting=(n,i)=>{let r=e.getNextSortingOrder(),o=null!=n;t.setSorting(a=>{let s,l=null==a?void 0:a.find(t=>t.id===e.id),u=null==a?void 0:a.findIndex(t=>t.id===e.id),c=[],h=o?n:"desc"===r;if("toggle"!=(s=null!=a&&a.length&&e.getCanMultiSort()&&i?l?"toggle":"add":null!=a&&a.length&&u!==a.length-1?"replace":l?"toggle":"replace")||o||r||(s="remove"),"add"===s){var d;(c=[...a,{id:e.id,desc:h}]).splice(0,c.length-(null!=(d=t.options.maxMultiSortColCount)?d:Number.MAX_SAFE_INTEGER))}else c="toggle"===s?a.map(t=>t.id===e.id?{...t,desc:h}:t):"remove"===s?a.filter(t=>t.id!==e.id):[{id:e.id,desc:h}];return c})},e.getFirstSortDir=()=>{var n,i;return(null!=(n=null!=(i=e.columnDef.sortDescFirst)?i:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var i,r;let o=e.getFirstSortDir(),a=e.getIsSorted();return a?(a===o||null!=(i=t.options.enableSortingRemoval)&&!i||!!n&&null!=(r=t.options.enableMultiRemove)&&!r)&&("desc"===a?"asc":"desc"):o},e.getCanSort=()=>{var n,i;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(i=t.options.enableSorting)||i)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,i;return null!=(n=null!=(i=e.columnDef.enableMultiSort)?i:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let i=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!i&&(i.desc?"desc":"asc")},e.getSortIndex=()=>{var n,i;return null!=(n=null==(i=t.getState().sorting)?void 0:i.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return i=>{n&&(null==i.persist||i.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(i))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,i;e.setSorting(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel)?e.getPreSortedRowModel():e._getSortedRowModel()}},{getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:dj("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,i;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(i=t.options.enableGrouping)||i)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],i=null==n?void 0:n.getValue(e.id);return"number"==typeof i?d8.sum:"[object Date]"===Object.prototype.toString.call(i)?d8.extent:void 0},e.getAggregationFn=()=>{var n,i;if(!e)throw Error();return dH(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(i=t.options.aggregationFns)?void 0:i[e.columnDef.aggregationFn])?n:d8[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,i;e.setGrouping(t?[]:null!=(n=null==(i=e.initialState)?void 0:i.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel)?e.getPreGroupedRowModel():e._getGroupedRowModel()},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let i=t.getColumn(n);return null!=i&&i.columnDef.getGroupingValue?(e._groupingValuesCache[n]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!(null!=(t=n.subRows)&&t.length)}}},{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:dj("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var i,r;if(!t)return void e._queue(()=>{t=!0});if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetExpanded)?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,i;e.setExpanded(t?{}:null!=(n=null==(i=e.initialState)?void 0:i.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return"boolean"==typeof t?!0===t:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel)?e.getPreExpandedRowModel():e._getExpandedRowModel()},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(i=>{var r;let o=!0===i||!!(null!=i&&i[e.id]),a={};if(!0===i?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=i,n=null!=(r=n)?r:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){let{[e.id]:t,...n}=a;return n}return i})},e.getIsExpanded=()=>{var n;let i=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===i||(null==i?void 0:i[e.id]))},e.getCanExpand=()=>{var n,i,r;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(i=t.options.enableExpanding)||i)&&!!(null!=(r=e.subRows)&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,i=e;for(;n&&i.parentId;)n=(i=t.getRow(i.parentId,!0)).getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{...fr(),...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:dj("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var i,r;if(!t)return void e._queue(()=>{t=!0});if(null!=(i=null!=(r=e.options.autoResetAll)?r:e.options.autoResetPageIndex)?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>dV(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?fr():null!=(n=e.initialState.pagination)?n:fr())},e.setPageIndex=t=>{e.setPagination(n=>{let i=dV(t,n.pageIndex);return i=Math.max(0,Math.min(i,void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1)),{...n,pageIndex:i}})},e.resetPageIndex=t=>{var n,i;e.setPageIndex(t?0:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageIndex)?n:0)},e.resetPageSize=t=>{var n,i;e.setPageSize(t?10:null!=(n=null==(i=e.initialState)||null==(i=i.pagination)?void 0:i.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,dV(t,e.pageSize)),i=Math.floor(e.pageSize*e.pageIndex/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var i;let r=dV(t,null!=(i=e.options.pageCount)?i:-1);return"number"==typeof r&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=dW(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},dG(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return -1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel)?e.getPrePaginationRowModel():e._getPaginationRowModel(),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:fo(),...e}),getDefaultOptions:e=>({onRowPinningChange:dj("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,i,r)=>{let o=i?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],a=new Set([...r?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],e.id,...o]);t.setRowPinning(e=>{var t,i,r,o,s,l;return"bottom"===n?{top:(null!=(r=null==e?void 0:e.top)?r:[]).filter(e=>!(null!=a&&a.has(e))),bottom:[...(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).filter(e=>!(null!=a&&a.has(e))),...Array.from(a)],bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter(e=>!(null!=a&&a.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=a&&a.has(e))),bottom:(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=a&&a.has(e)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:i,enablePinning:r}=t.options;return"function"==typeof i?i(e):null==(n=null!=i?i:r)||n},e.getIsPinned=()=>{let n=[e.id],{top:i,bottom:r}=t.getState().rowPinning,o=n.some(e=>null==i?void 0:i.includes(e)),a=n.some(e=>null==r?void 0:r.includes(e));return o?"top":!!a&&"bottom"},e.getPinnedIndex=()=>{var n,i;let r=e.getIsPinned();if(!r)return -1;let o=null==(n="top"===r?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(i=null==o?void 0:o.indexOf(e.id))?i:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,i;return e.setRowPinning(t?fo():null!=(n=null==(i=e.initialState)?void 0:i.rowPinning)?n:fo())},e.getIsSomeRowsPinned=t=>{var n,i,r;let o=e.getState().rowPinning;return t?!!(null==(n=o[t])?void 0:n.length):!!((null==(i=o.top)?void 0:i.length)||(null==(r=o.bottom)?void 0:r.length))},e._getPinnedRows=(t,n,i)=>{var r;return(null==(r=e.options.keepPinnedRows)||r?(null!=n?n:[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:i}))},e.getTopRows=dW(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),dG(e.options,"debugRows","getTopRows")),e.getBottomRows=dW(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),dG(e.options,"debugRows","getBottomRows")),e.getCenterRows=dW(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let i=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!i.has(e.id))},dG(e.options,"debugRows","getCenterRows"))}},{getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:dj("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();let i={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(e=>{e.getCanSelect()&&(i[e.id]=!0)}):r.forEach(e=>{delete i[e.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let i=void 0!==t?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(t=>{fa(r,t.id,i,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=dW(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?fs(e,n):{rows:[],flatRows:[],rowsById:{}},dG(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=dW(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?fs(e,n):{rows:[],flatRows:[],rowsById:{}},dG(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=dW(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?fs(e,n):{rows:[],flatRows:[],rowsById:{}},dG(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),i=!!(t.length&&Object.keys(n).length);return i&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),i=!!t.length;return i&&t.some(e=>!n[e.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,i)=>{let r=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=void 0!==n?n:!r,e.getCanSelect()&&r===n)return o;let s={...o};return fa(s,e.id,n,null==(a=null==i?void 0:i.selectChildren)||a,t),s})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return fl(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return"some"===fu(e,n)},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return"all"===fu(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected(null==(i=n.target)?void 0:i.checked)}}}},{getDefaultColumnDef:()=>d7,getInitialState:e=>({columnSizing:{},columnSizingInfo:fe(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:dj("columnSizing",e),onColumnSizingInfoChange:dj("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,i,r;let o=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:d7.minSize,null!=(i=null!=o?o:e.columnDef.size)?i:d7.size),null!=(r=e.columnDef.maxSize)?r:d7.maxSize)},e.getStart=dW(e=>[e,fi(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),dG(t.options,"debugColumns","getStart")),e.getAfter=dW(e=>[e,fi(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),dG(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var n,i;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(i=t.options.enableColumnResizing)||i)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{if(e.subHeaders.length)e.subHeaders.forEach(n);else{var i;t+=null!=(i=e.column.getSize())?i:0}};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let i=t.getColumn(e.column.id),r=null==i?void 0:i.getCanResize();return o=>{if(!i||!r||(null==o.persist||o.persist(),fn(o)&&o.touches&&o.touches.length>1))return;let a=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[i.id,i.getSize()]],l=fn(o)?Math.round(o.touches[0].clientX):o.clientX,u={},c=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var i,r;let o="rtl"===t.options.columnResizeDirection?-1:1,a=(n-(null!=(i=null==e?void 0:e.startOffset)?i:0))*o,s=Math.max(a/(null!=(r=null==e?void 0:e.startSize)?r:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*s,0))/100}),{...e,deltaOffset:a,deltaPercentage:s}}),("onChange"===t.options.columnResizeMode||"end"===e)&&t.setColumnSizing(e=>({...e,...u})))},h=e=>{c("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=n||("u">typeof document?document:null),f={moveHandler:e=>c("move",e.clientX),upHandler:e=>{null==d||d.removeEventListener("mousemove",f.moveHandler),null==d||d.removeEventListener("mouseup",f.upHandler),h(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c("move",e.touches[0].clientX),!1),upHandler:e=>{var t;null==d||d.removeEventListener("touchmove",p.moveHandler),null==d||d.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),h(null==(t=e.touches[0])?void 0:t.clientX)}},g=!!function(){if("boolean"==typeof ft)return ft;let e=!1;try{let t=()=>{};window.addEventListener("test",t,{get passive(){return e=!0,!1}}),window.removeEventListener("test",t)}catch(t){e=!1}return ft=e}()&&{passive:!1};fn(o)?(null==d||d.addEventListener("touchmove",p.moveHandler,g),null==d||d.addEventListener("touchend",p.upHandler,g)):(null==d||d.addEventListener("mousemove",f.moveHandler,g),null==d||d.addEventListener("mouseup",f.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:l,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?fe():null!=(n=e.initialState.columnSizingInfo)?n:fe())},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}}];function fm(e){let t=[],n=e=>{var i;t.push(e),null!=(i=e.subRows)&&i.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}let fv={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},fy=RegExp(Object.keys(fv).join("|"),"g"),fx={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function fb(e,t,n){let i;return(e=fw(e,n),(t=fw(t,n)).length>e.length)?fx.NO_MATCH:e===t?fx.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(t=t.toLowerCase())?fx.EQUAL:e.startsWith(t)?fx.STARTS_WITH:e.includes(` ${t}`)?fx.WORD_STARTS_WITH:e.includes(t)?fx.CONTAINS:1===t.length?fx.NO_MATCH:(i="",e.split(" ").forEach(e=>{e.split("-").forEach(e=>{i+=e.substr(0,1)})}),i).includes(t)?fx.ACRONYM:function(e,t){var n;let i,r=0,o=0;function a(e,t,n){for(let i=n,o=t.length;i<o;i++)if(t[i]===e)return r+=1,i+1;return -1}let s=a(t[0],e,0);if(s<0)return fx.NO_MATCH;o=s;for(let n=1,i=t.length;n<i;n++)if(!((o=a(t[n],e,o))>-1))return fx.NO_MATCH;return n=o-s,i=r/t.length,fx.MATCHES+1/n*i}(e,t)}function fw(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(fy,e=>fv[e])),e}let fS={maxRanking:1/0,minRanking:-1/0};function f_(e,t,{isHeader:n,isLastColumn:i,isFirstColumn:r,defaultColumnHeight:o}={}){var a,s;let l=e.spacing(1),u=e.spacing(1.25),c=e.spacing(2),h=r?c:u,d=i?c:u,f=e.typography.body1.lineHeight,p=e.typography.body1.fontSize;"compact"===t&&(l=e.spacing(.5),u=e.spacing(.5),c=e.spacing(1),h=r?c:u,d=i?c:u,f=e.typography.body2.lineHeight,p=e.typography.body2.fontSize),"comfortable"===t&&(l=e.spacing(2),u=e.spacing(1.5),c=e.spacing(2),h=r?c:u,d=i?c:u,f=e.typography.body1.lineHeight,p=e.typography.body1.fontSize);let g=n||!o||"auto"===o?(a=f,s=l,("string"==typeof a?parseInt(a,10):a??0)+2*("string"==typeof s?parseInt(s,10):s)):o;return{padding:`${l} ${d} ${l} ${h}`,height:g,fontSize:p,lineHeight:f}}function fC(e,t){return e.map(({width:e,align:n,headerDescription:i,cellDescription:r,enableSorting:o,dataLink:a,enableResizing:s,...l})=>{var u,c,h,d,f,p,g;let m=s??t?.enableResizing??!1,v="auto"===e||void 0===e?(u=m,c=t?.minWidth,h=t?.maxWidth,u?{size:150,minSize:c??60,maxSize:h??1e3}:{size:0,minSize:0,maxSize:0}):(d=m,f=e,p=t?.minWidth,g=t?.maxWidth,d?{size:f,minSize:p??60,maxSize:g??1e3}:{size:f});return{...l,...v,enableSorting:!!o,enableResizing:m,meta:{align:n,headerDescription:i,cellDescription:r,dataLink:a}}})}var fM=n(42927);function fA({color:e,density:t,...n}){let i="compact"===t;return(0,eb.jsx)(fM.A,{size:i?"small":"medium",...n,focusRipple:!1,tabIndex:-1,sx:{color:e,padding:e=>e.spacing(i?.25:.5),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)","&.Mui-checked":{color:e},"&.Mui-focusVisible":{background:e?(0,uh.X4)(e,.5):void 0},"& .MuiSvgIcon-root":{fontSize:i?16:18}}})}var fk=n(3399),fT=n(76746),fI=n(97653),fD=n(76795),fO=n(45271);function fP(e){return(0,ub.Ay)("MuiToolbar",e)}(0,ux.A)("MuiToolbar",["root","gutters","regular","dense"]);let fR=(0,e7.A)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})((0,ud.A)(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),fE=eI.forwardRef(function(e,t){let n=(0,uf.b)({props:e,name:"MuiToolbar"}),{className:i,component:r="div",disableGutters:o=!1,variant:a="regular",...s}=n,l={...n,component:r,disableGutters:o,variant:a},u=(e=>{let{classes:t,disableGutters:n,variant:i}=e;return(0,uc.A)({root:["root",!n&&"gutters",i]},fP,t)})(l);return(0,eb.jsx)(fR,{as:r,className:(0,uu.A)(u.root,i),ref:t,ownerState:l,...s})});var fL=n(35216),fN=n(96913),fB=n(70776),fF=n(22402);let fz=(0,fF.A)((0,eb.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),fV=(0,fF.A)((0,eb.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),fj=eI.forwardRef(function(e,t){let{backIconButtonProps:n,count:i,disabled:r=!1,getItemAriaLabel:o,nextIconButtonProps:a,onPageChange:s,page:l,rowsPerPage:u,showFirstButton:c,showLastButton:h,slots:d={},slotProps:f={},...p}=e,g=(0,fL.I)(),m=d.firstButton??eM.A,v=d.lastButton??eM.A,y=d.nextButton??eM.A,x=d.previousButton??eM.A,b=d.firstButtonIcon??fV,w=d.lastButtonIcon??fz,S=d.nextButtonIcon??fB.A,_=d.previousButtonIcon??fN.A,C=g?v:m,M=g?y:x,A=g?x:y,k=g?m:v,T=g?f.lastButton:f.firstButton,I=g?f.nextButton:f.previousButton,D=g?f.previousButton:f.nextButton,O=g?f.firstButton:f.lastButton;return(0,eb.jsxs)("div",{ref:t,...p,children:[c&&(0,eb.jsx)(C,{onClick:e=>{s(e,0)},disabled:r||0===l,"aria-label":o("first",l),title:o("first",l),...T,children:g?(0,eb.jsx)(w,{...f.lastButtonIcon}):(0,eb.jsx)(b,{...f.firstButtonIcon})}),(0,eb.jsx)(M,{onClick:e=>{s(e,l-1)},disabled:r||0===l,color:"inherit","aria-label":o("previous",l),title:o("previous",l),...I??n,children:g?(0,eb.jsx)(S,{...f.nextButtonIcon}):(0,eb.jsx)(_,{...f.previousButtonIcon})}),(0,eb.jsx)(A,{onClick:e=>{s(e,l+1)},disabled:r||-1!==i&&l>=Math.ceil(i/u)-1,color:"inherit","aria-label":o("next",l),title:o("next",l),...D??a,children:g?(0,eb.jsx)(_,{...f.previousButtonIcon}):(0,eb.jsx)(S,{...f.nextButtonIcon})}),h&&(0,eb.jsx)(k,{onClick:e=>{s(e,Math.max(0,Math.ceil(i/u)-1))},disabled:r||l>=Math.ceil(i/u)-1,"aria-label":o("last",l),title:o("last",l),...O,children:g?(0,eb.jsx)(b,{...f.firstButtonIcon}):(0,eb.jsx)(w,{...f.lastButtonIcon})})]})});var fH=n(63392);function fW(e){return(0,ub.Ay)("MuiTablePagination",e)}let fG=(0,ux.A)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var f$=n(73397);let fU=(0,e7.A)(fO.A,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})((0,ud.A)(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),fq=(0,e7.A)(fE,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${fG.actions}`]:t.actions,...t.toolbar})})((0,ud.A)(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${fG.actions}`]:{flexShrink:0,marginLeft:20}}))),fY=(0,e7.A)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),fZ=(0,e7.A)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})((0,ud.A)(({theme:e})=>({...e.typography.body2,flexShrink:0}))),fX=(0,e7.A)(fD.A,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${fG.selectIcon}`]:t.selectIcon,[`& .${fG.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${fG.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),fK=(0,e7.A)(fI.A,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),fQ=(0,e7.A)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})((0,ud.A)(({theme:e})=>({...e.typography.body2,flexShrink:0})));function fJ({from:e,to:t,count:n}){return`${e}–${t} of ${-1!==n?n:`more than ${t}`}`}function f0(e){return`Go to ${e} page`}let f1=eI.forwardRef(function(e,t){let n,i=(0,uf.b)({props:e,name:"MuiTablePagination"}),{ActionsComponent:r=fj,backIconButtonProps:o,colSpan:a,component:s=fO.A,count:l,disabled:u=!1,getItemAriaLabel:c=f0,labelDisplayedRows:h=fJ,labelRowsPerPage:d="Rows per page:",nextIconButtonProps:f,onPageChange:p,onRowsPerPageChange:g,page:m,rowsPerPage:v,rowsPerPageOptions:y=[10,25,50,100],SelectProps:x={},showFirstButton:b=!1,showLastButton:w=!1,slotProps:S={},slots:_={},...C}=i,M=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},fW,t)})(i),A=S?.select??x,k=A.native?"option":fK;(s===fO.A||"td"===s)&&(n=a||1e3);let T=(0,fH.A)(A.id),I=(0,fH.A)(A.labelId),D={slots:_,slotProps:S},[O,P]=(0,f$.A)("root",{ref:t,className:M.root,elementType:fU,externalForwardedProps:{...D,component:s,...C},ownerState:i,additionalProps:{colSpan:n}}),[R,L]=(0,f$.A)("toolbar",{className:M.toolbar,elementType:fq,externalForwardedProps:D,ownerState:i}),[N,B]=(0,f$.A)("spacer",{className:M.spacer,elementType:fY,externalForwardedProps:D,ownerState:i}),[F,z]=(0,f$.A)("selectLabel",{className:M.selectLabel,elementType:fZ,externalForwardedProps:D,ownerState:i,additionalProps:{id:I}}),[V,j]=(0,f$.A)("select",{className:M.select,elementType:fX,externalForwardedProps:D,ownerState:i}),[H,W]=(0,f$.A)("menuItem",{className:M.menuItem,elementType:k,externalForwardedProps:D,ownerState:i}),[G,$]=(0,f$.A)("displayedRows",{className:M.displayedRows,elementType:fQ,externalForwardedProps:D,ownerState:i});return(0,eb.jsx)(O,{...P,children:(0,eb.jsxs)(R,{...L,children:[(0,eb.jsx)(N,{...B}),y.length>1&&(0,eb.jsx)(F,{...z,children:d}),y.length>1&&(0,eb.jsx)(V,{variant:"standard",...!A.variant&&{input:E||(E=(0,eb.jsx)(fT.Ay,{}))},value:v,onChange:g,id:T,labelId:I,...A,classes:{...A.classes,root:(0,uu.A)(M.input,M.selectRoot,(A.classes||{}).root),select:(0,uu.A)(M.select,(A.classes||{}).select),icon:(0,uu.A)(M.selectIcon,(A.classes||{}).icon)},disabled:u,...j,children:y.map(e=>(0,eI.createElement)(H,{...W,key:e.label?e.label:e,value:e.value?e.value:e},e.label?e.label:e))}),(0,eb.jsx)(G,{...$,children:h({from:0===l?0:m*v+1,to:-1===l?(m+1)*v:-1===v?l:Math.min(l,(m+1)*v),count:-1===l?-1:l,page:m})}),(0,eb.jsx)(r,{className:M.actions,backIconButtonProps:o,count:l,nextIconButtonProps:f,onPageChange:p,page:m,rowsPerPage:v,showFirstButton:b,showLastButton:w,slotProps:S.actions,slots:_.actions,getItemAriaLabel:c,disabled:u})]})})}),f2={row:0,column:0},f5=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"];var f3=n(91394);let f4=(0,e7.A)(f3.A)(({theme:e})=>({tableLayout:"fixed",borderCollapse:"separate",backgroundColor:e.palette.background.default})),f6={compact:"small",standard:"medium",comfortable:"medium"},f8=(0,eI.forwardRef)(function({density:e,...t},n){return(0,eb.jsx)(f4,{...t,tabIndex:-1,size:f6[e],ref:n,sx:{width:"100%"}})});var f9=n(5139);let f7=(0,eI.forwardRef)(function(e,t){return(0,eb.jsx)(f9.A,{...e,ref:t})});var pe=n(57438);let pt=(0,e7.A)(fO.A)(({theme:e})=>({padding:0,backgroundColor:"inherit","&.MuiTableCell-head":{backgroundColor:e.palette.background.default},"&:focus-visible":{outline:`solid 1px ${e.palette.primary.main}`,outlineOffset:"-1px",borderRadius:0}}));function pn({children:e,density:t,variant:n,width:i,defaultColumnHeight:r,focusState:o="none",onFocusTrigger:a,isFirstColumn:s,isLastColumn:l,description:u,align:c,color:h,backgroundColor:d,dataLink:f,adjacentCellsValuesMap:p,...g}){let m=(0,uo.A)(),v=(0,eI.useRef)(),y="head"===n;(0,eI.useEffect)(()=>{"trigger-focus"===o&&v.current&&v.current.focus()},[o]);let x=e=>{a?.(e)},b=(0,eI.useMemo)(()=>{if(f){if(p&&rV(f.url)){let{text:e}=rN(f.url,p,{urlEncode:!0});return{...f,url:e}}return f}},[f,p]);return(0,eb.jsx)(pt,{...g,tabIndex:"none"!==o?0:-1,onFocus:e=>{let t=e.currentTarget?.querySelector('a[href], button, input, textarea, select, details,[role="button"]');t&&t.focus()},onClick:x,onKeyUp:x,style:{width:i},sx:{position:"relative",borderBottom:y?`solid 1px ${m.palette.grey[100]}`:`solid 1px ${m.palette.grey[50]}`,"&:hover #original-cell":{position:"absolute",top:0,left:0,zIndex:10,width:"fit-content",minWidth:"100%",whiteSpace:"nowrap",overflow:"visible",backgroundColor:`${d??m.palette.background.default} !important`,outline:`solid 1px ${m.palette.info.main}`,outlineOffset:"-1px"}},ref:v,children:(0,eb.jsx)(ua.A,{id:"original-cell",sx:{...f_(m,t,{isHeader:y,isLastColumn:l,isFirstColumn:s,defaultColumnHeight:r}),position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexDirection:"inherit"},style:{backgroundColor:d??"inherit",color:h??"inherit"},title:u,"aria-label":u,textAlign:c,children:b?(0,eb.jsx)(pe.A,{href:b.url,target:b.targetBlank?"_blank":"_self",rel:b.targetBlank?"noopener noreferrer":void 0,children:e}):e})})}var pi=n(91644);function pr(e){return(0,ub.Ay)("MuiTableFooter",e)}(0,ux.A)("MuiTableFooter",["root"]);let po=(0,e7.A)("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),pa={variant:"footer"},ps="tfoot",pl=eI.forwardRef(function(e,t){let n=(0,uf.b)({props:e,name:"MuiTableFooter"}),{className:i,component:r=ps,...o}=n,a={...n,component:r},s=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"]},pr,t)})(a);return(0,eb.jsx)(pi.A.Provider,{value:pa,children:(0,eb.jsx)(po,{as:r,className:(0,uu.A)(s.root,i),ref:t,role:r===ps?null:"rowgroup",ownerState:a,...o})})}),pu=(0,eI.forwardRef)(function(e,t){return(0,eb.jsx)(pl,{...e,ref:t})});var pc=n(70561);let ph=(0,eI.forwardRef)(function(e,t){return(0,eb.jsx)(pc.A,{...e,ref:t})});var pd=n(88091);let pf=(0,fF.A)((0,eb.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");var pp=n(24726);function pg(e){return(0,ub.Ay)("MuiTableSortLabel",e)}let pm=(0,ux.A)("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]),pv=(0,e7.A)(ug.A,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.active&&t.active]}})((0,ud.A)(({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${pm.icon}`]:{opacity:.5}},[`&.${pm.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${pm.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}}))),py=(0,e7.A)("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,t[`iconDirection${(0,pp.A)(n.direction)}`]]}})((0,ud.A)(({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]}))),px=eI.forwardRef(function(e,t){let n=(0,uf.b)({props:e,name:"MuiTableSortLabel"}),{active:i=!1,children:r,className:o,direction:a="asc",hideSortIcon:s=!1,IconComponent:l=pf,slots:u={},slotProps:c={},...h}=n,d={...n,active:i,direction:a,hideSortIcon:s,IconComponent:l},f=(e=>{let{classes:t,direction:n,active:i}=e,r={root:["root",i&&"active",`direction${(0,pp.A)(n)}`],icon:["icon",`iconDirection${(0,pp.A)(n)}`]};return(0,uc.A)(r,pg,t)})(d),p={slots:u,slotProps:c},[g,m]=(0,f$.A)("root",{elementType:pv,externalForwardedProps:p,ownerState:d,className:(0,uu.A)(f.root,o),ref:t}),[v,y]=(0,f$.A)("icon",{elementType:py,externalForwardedProps:p,ownerState:d,className:f.icon});return(0,eb.jsxs)(g,{disableRipple:!0,component:"span",...m,...h,children:[r,s&&!i?null:(0,eb.jsx)(v,{as:l,...y})]})});var pb=n(6227);function pw({onSort:e,sortDirection:t,nextSortDirection:n,children:i,resizeConfig:r,...o}){let a=!!e,s=(0,eb.jsx)(pd.A,{noWrap:!0,variant:"inherit",component:"div",color:"inherit",children:i}),l=!!t;return(0,eb.jsxs)(pn,{...o,children:[a?(0,eb.jsx)(px,{onClick:e,direction:l?t:n,active:l,sx:{verticalAlign:"unset",maxWidth:"100%","&:focus-visible":{[`& .${pm.icon}`]:{opacity:l?1:.5}}},children:s}):s,r&&(0,eb.jsx)(ua.A,{onMouseDown:e=>{2===e.detail?r.resetSizeHandler():r.resizeHandler(e)},onTouchStart:r.resizeHandler,sx:{position:"absolute",height:"100%",top:0,right:"4px",cursor:"col-resize"},children:(0,eb.jsx)(pb.A,{flexItem:!0,orientation:"vertical",sx:e=>({backgroundColor:r.isResizing?e.palette.action.active:e.palette.divider,borderRadius:"2px",borderWidth:"2px",height:"100%",touchAction:"none",transform:"translateX(4px)",userSelect:"none"})})})]})}let pS=(0,eI.forwardRef)(function(e,t){return(0,eb.jsx)(fk.A,{...e,ref:t,sx:{backgroundColor:e=>e.palette.background.default,"&:hover":{backgroundColor:e=>(0,uh.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}}})});var p_=n(2582),pC=n(65211),pM=n(30145),pA=n(7800),pk=n(98599),pT=n(16979),pI=n(9323),pD=n(12933),pO=n(46177);let pP=(0,eI.forwardRef)(function({debounceMs:e=250,value:t,onChange:n,...i},r){let[o,a]=(0,eI.useState)(t),s=(0,eI.useCallback)(e=>{n?.(e)},[n]),l=(0,eI.useMemo)(()=>pO(s,e),[e,s]);return(0,eb.jsx)(eA.A,{ref:r,value:o,onChange:function(e){a(e.target.value),l(e.target.value)},...i})});function pR({isSearchEnabled:e,globalFilter:t,onGlobalFilterChange:n,isColumnFilterEnabled:i,columns:r,width:o,columnFilterMenuMaxHeight:a=400,isExpandAllEnabled:s,isAllExpanded:l,onExpandAllChange:u}){let[c,h]=(0,eI.useState)(null),d=!!c,[f,p]=(0,eI.useState)(0),g=(0,eI.useCallback)(()=>{n(""),p(e=>e+1)},[n]);return e||i||s?(0,eb.jsxs)(eC.A,{direction:"row",gap:1,alignItems:"center",justifyContent:"flex-end",width:o,padding:"0.5rem",sx:{backgroundColor:e=>e.palette.background.default},children:[e&&(0,eb.jsx)(pP,{placeholder:"Search...",value:t,onChange:n,variant:"standard",slotProps:{htmlInput:{"aria-label":"search table"},input:{startAdornment:(0,eb.jsx)(p_.A,{position:"start",children:(0,eb.jsx)(pk,{fontSize:"small"})}),endAdornment:""!==t&&(0,eb.jsx)(p_.A,{position:"end",children:(0,eb.jsx)(eM.A,{onClick:g,children:(0,eb.jsx)(pA,{fontSize:"small"})})})}},sx:{flexGrow:1}},f),s&&(0,eb.jsx)(pC.A,{title:l?"Collapse all":"Expand all",children:(0,eb.jsx)(eM.A,{onClick:u,color:"info","aria-label":l?"collapse all rows":"expand all rows",children:l?(0,eb.jsx)(pT,{}):(0,eb.jsx)(pI,{})})}),i&&(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(eM.A,{onClick:e=>h(e.currentTarget),"aria-haspopup":"listbox","aria-expanded":d,color:"info",children:(0,eb.jsx)(pD,{})}),(0,eb.jsx)(pM.A,{anchorEl:c,open:d,onClose:()=>h(null),slotProps:{list:{dense:!0}},sx:{maxHeight:a},children:r.map(e=>{let t=e.columnDef.header,n="string"==typeof t?t:e.id;return(0,eb.jsxs)(fI.A,{disabled:!e.getCanHide(),onClick:e.getCanHide()?e.getToggleVisibilityHandler():void 0,dense:!0,children:[(0,eb.jsx)(fM.A,{checked:e.getIsVisible(),disabled:!e.getCanHide(),size:"small",disableRipple:!0,sx:{p:0,mr:1}}),(0,eb.jsx)(uM.A,{primary:n})]},e.id)})})]})]}):null}pP.displayName="TextField";var pE=n(347);let pL=(0,eI.forwardRef)(function(e,t){return(0,eb.jsx)(pE.A,{...e,tabIndex:-1,ref:t,sx:ry({flexGrow:1},e.sx)})});function pN({width:e,height:t,density:n,defaultColumnWidth:i,defaultColumnHeight:r,onRowClick:o,onRowMouseOver:a,onRowMouseOut:s,rows:l,columns:u,headers:c,columnSizing:h,columnSizingInfo:d,cellConfigs:f,pagination:p,onPaginationChange:g,rowCount:m,toolbarConfig:v}){let y=(0,eI.useRef)(null),x=(0,eI.useRef)({startIndex:0,endIndex:0}),b=function({visibleRange:e,virtualTable:t,maxRows:n,maxColumns:i}){return function({maxRows:e,maxColumns:t,onActiveCellChange:n}){let[i,r]=(0,eI.useState)(f2),[o,a]=(0,eI.useState)(!1);return{activeCell:i,isActive:o,onTableKeyDown:(0,eI.useCallback)(i=>{let o=i.key;(f5.includes(o)||"Home"===o||"End"===o||"PageDown"===o||"PageUp"===o)&&r(r=>{let a=r.row,s=r.column;"ArrowRight"===o&&s<t-1?(i.preventDefault(),s+=1):"ArrowLeft"===o&&s>0?(i.preventDefault(),s-=1):"ArrowDown"===o&&a<e-1?(i.preventDefault(),a+=1):"ArrowUp"===o&&a>0?(i.preventDefault(),a-=1):"Home"===o?(i.preventDefault(),a=0,s=0):"End"===o&&(i.preventDefault(),a=e-1,s=t-1);let l={column:s,row:a},u=n?.(i,r,l)||l;return u.row===r.row&&u.column===r.column?r:u})},[t,e,n]),onCellFocus:e=>{e.column===i.column&&e.row===i.row&&o||(a(!0),r(e))},onTableBlur:(0,eI.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||(a(!1),r(f2))},[])}}({maxRows:n,maxColumns:i,onActiveCellChange:(i,r,o)=>{let a=i.key,s=o&&(r.column!==o.column||r.row!==o.row),l=o?.row??r.row;if("ArrowDown"===a&&s)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"end"});else if("ArrowUp"===a&&s)(l-1<e.current.startIndex||l-1>e.current.endIndex)&&t.current?.scrollToIndex({index:l-1,align:"start"});else if(s&&("Home"===a||"End"===a))t.current?.scrollToIndex({index:Math.max(l-1,0),align:"start"});else if("PageDown"===a){i.preventDefault();let o=r.row;return o=Math.min(n-1,e.current.endIndex+1),t.current?.scrollToIndex({index:o-1,align:"start"}),{row:o,column:r.column}}else if("PageUp"===a){let n=r.row;return n=Math.max(0,e.current.startIndex-1),t.current?.scrollToIndex({index:n-1,align:"end"}),{row:n,column:r.column}}return o}})}({visibleRange:x,virtualTable:y,maxRows:l.length+1,maxColumns:u.length}),w=e=>e.row===b.activeCell.row&&e.column===b.activeCell.column?b.isActive?"trigger-focus":"focus-next":"none",S=(0,eI.useMemo)(()=>({Scroller:pL,Table:t=>(0,eb.jsx)(f8,{...t,width:e,density:n,onKeyDown:b.onTableKeyDown,onBlur:b.onTableBlur}),TableHead:ph,TableFoot:pu,TableRow:({item:e,...t})=>{let i=l[t["data-index"]];if(!i)return null;let r={id:i.id,index:i.index};return(0,eb.jsx)(pS,{...t,onClick:e=>o(e,i.id),density:n,onMouseOver:e=>{a?.(e,r)},onMouseOut:e=>{s?.(e,r)}})},TableBody:f7}),[n,b.onTableKeyDown,b.onTableBlur,o,s,a,l,e]),_=(e,t)=>{p&&g&&g({...p,pageIndex:t})},C=e=>{p&&g&&g({pageIndex:0,pageSize:parseInt(e.target.value,10)})},M=(0,eI.useMemo)(()=>{let e={};return c.forEach(t=>{t.headers.filter(e=>e.column.getCanResize()).forEach(t=>{e[`--header-${t.id}-size`]=t.getSize(),e[`--col-${t.column.id}-size`]=t.column.getSize()})}),e},[d,h,c]);return(0,eb.jsxs)(ua.A,{style:{width:e,height:t,...M},children:[(0,eb.jsx)(pR,{...v,width:e}),(0,eb.jsx)(da,{ref:y,totalCount:l.length,components:S,rangeChanged:e=>{x.current=e},fixedHeaderContent:()=>(0,eb.jsx)(eb.Fragment,{children:c.map(e=>(0,eb.jsx)(pS,{density:n,children:e.headers.map((e,t,o)=>{var a,s,l,u,c;let h,d=e.column,f={row:0,column:t},p=d.getIsSorted(),g=d.getNextSortingOrder();return(0,eb.jsx)(pw,{onSort:d.getCanSort()?d.getToggleSortingHandler():void 0,sortDirection:"string"==typeof p?p:void 0,nextSortDirection:"string"==typeof g?g:void 0,width:e.column.getCanResize()?`calc(var(--header-${e?.id}-size) * 1px)`:d.getSize()||i,defaultColumnHeight:r,align:d.columnDef.meta?.align,variant:"head",density:n,description:d.columnDef.meta?.headerDescription,focusState:w(f),onFocusTrigger:()=>b.onCellFocus(f),isFirstColumn:0===t,isLastColumn:t===o.length-1,resizeConfig:e.column.getCanResize()?{resizeHandler:e.getResizeHandler(),resetSizeHandler:e.column.resetSize,isResizing:e.column.getIsResizing()}:void 0,children:(a=d.columnDef.header,s=e.getContext(),a?"function"==typeof(u=l=a)&&(h=Object.getPrototypeOf(u)).prototype&&h.prototype.isReactComponent||"function"==typeof l||"object"==typeof(c=l)&&"symbol"==typeof c.$$typeof&&["react.memo","react.forward_ref"].includes(c.$$typeof.description)?eI.createElement(a,s):a:null)},e.id)})},e.id))}),fixedFooterContent:p?()=>(0,eb.jsx)(fk.A,{sx:{backgroundColor:e=>e.palette.background.default},children:(0,eb.jsx)(f1,{colSpan:u.length,count:m,page:p.pageIndex,rowsPerPage:p.pageSize,onPageChange:_,onRowsPerPageChange:C})}):void 0,itemContent:e=>{let t=l[e];return t?(0,eb.jsx)(eb.Fragment,{children:t.getVisibleCells().map((o,a,s)=>{let l,u={row:e+1,column:a},c=o.getContext(),h=f?.[c.cell.id],d=o.column.columnDef.cell,p="function"==typeof d?d(c):null,g=o.column.columnDef.meta?.cellDescription;"function"==typeof g?l=g(c):g&&"string"==typeof p&&(l=p);let m=Object.entries(t.original)?.filter(([e,t])=>["string","number"].includes(typeof t)).reduce((e,[t,n])=>({...e,[t]:String(n)}),{});return(0,eb.jsx)(pn,{"data-testid":o.id,title:l||h?.text||p,width:o.column.getCanResize()?`calc(var(--col-${o.column.id}-size) * 1px)`:o.column.getSize()||i,defaultColumnHeight:r,align:o.column.columnDef.meta?.align,density:n,focusState:w(u),onFocusTrigger:()=>b.onCellFocus(u),isFirstColumn:0===a,isLastColumn:a===s.length-1,description:l,color:h?.textColor??void 0,backgroundColor:h?.backgroundColor??void 0,dataLink:o.column.columnDef.meta?.dataLink,adjacentCellsValuesMap:m,children:h?.text||p},o.id)})}):null}})]})}let pB=(e,t)=>`${t}`,pF={},pz=[];function pV({data:e,columns:t,cellConfigs:n,density:i="standard",defaultColumnWidth:r=150,defaultColumnHeight:o="auto",checkboxSelection:a,onRowSelectionChange:s,onSortingChange:l,getCheckboxColor:u,getRowId:c=pB,rowSelection:h=pF,sorting:d=pz,getItemActions:f,hasItemActions:p,pagination:g,onPaginationChange:m,rowSelectionVariant:v="standard",getSubRows:y,hiddenColumns:x,tableToolbarConfig:b,columnResizeMode:w="onChange",defaultColumnConfig:S,..._}){let C=(0,uo.A)(),M=!!y,[A,k]=(0,eI.useState)({}),{globalFilter:T,setGlobalFilter:I,fuzzySearchOptions:D}=function(e,t,n,i){let[r,o]=(0,eI.useState)(""),[a,s]=(0,eI.useState)(n),l=(0,eI.useCallback)(e=>{o(t=>(t?t&&!e&&i(a):(s(n),i(!0)),e))},[n,a,i]);return{globalFilter:r,setGlobalFilter:l,fuzzySearchOptions:{filterFns:{fuzzy:(e,n,i,r)=>{let o=function(e,t,n){var i;if((n=n||{}).threshold=null!=(i=n.threshold)?i:fx.MATCHES,!n.accessors){let i=fb(e,t,n);return{rankedValue:e,rank:i,accessorIndex:-1,accessorThreshold:n.threshold,passed:i>=n.threshold}}let r=function(e,t){let n=[];for(let i=0,r=t.length;i<r;i++){let r=t[i],o="function"==typeof r?fS:{...fS,...r},a=function(e,t){let n=t;"object"==typeof t&&(n=t.accessor);let i=n(e);return null==i?[]:Array.isArray(i)?i:[String(i)]}(e,r);for(let e=0,t=a.length;e<t;e++)n.push({itemValue:a[e],attributes:o})}return n}(e,n.accessors),o={rankedValue:e,rank:fx.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<r.length;e++){let i=r[e],a=fb(i.itemValue,t,n),{minRanking:s,maxRanking:l,threshold:u=n.threshold}=i.attributes;a<s&&a>=fx.MATCHES?a=s:a>l&&(a=l),(a=Math.min(a,l))>=u&&a>o.rank&&(o.rank=a,o.passed=!0,o.accessorIndex=e,o.accessorThreshold=u,o.rankedValue=i.itemValue)}return o}(e.getValue(n),i,{threshold:fx[t]});return r({itemRank:o}),o.passed}},globalFilterFn:e?"fuzzy":void 0,getFilteredRowModel:e?e=>dW(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,i)=>{var r,o,a,s,l,u,c,h,d,f;let p,g,m,v,y,x,b,w,S,_;if(!t.rows.length||!(null!=n&&n.length)&&!i){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let C=[],M=[];(null!=n?n:[]).forEach(t=>{var n;let i=e.getColumn(t.id);if(!i)return;let r=i.getFilterFn();r&&C.push({id:t.id,filterFn:r,resolvedValue:null!=(n=null==r.resolveFilterValue?void 0:r.resolveFilterValue(t.value))?n:t.value})});let A=(null!=n?n:[]).map(e=>e.id),k=e.getGlobalFilterFn(),T=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());i&&k&&T.length&&(A.push("__global__"),T.forEach(e=>{var t;M.push({id:e.id,filterFn:k,resolvedValue:null!=(t=null==k.resolveFilterValue?void 0:k.resolveFilterValue(i))?t:i})}));for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},C.length)for(let e=0;e<C.length;e++){let t=(p=C[e]).id;n.columnFilters[t]=p.filterFn(n,t,p.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(M.length){for(let e=0;e<M.length;e++){let t=(g=M[e]).id;if(g.filterFn(n,t,g.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return r=t.rows,o=e=>{for(let t=0;t<A.length;t++)if(!1===e.columnFilters[A[t]])return!1;return!0},e.options.filterFromLeafRows?(a=r,s=o,m=[],v={},y=null!=(u=(l=e).options.maxLeafRowFilterDepth)?u:100,{rows:(x=function(e,t){void 0===t&&(t=0);let n=[];for(let r=0;r<e.length;r++){var i;let o=e[r],a=dY(l,o.id,o.original,o.index,o.depth,void 0,o.parentId);if(a.columnFilters=o.columnFilters,null!=(i=o.subRows)&&i.length&&t<y){if(a.subRows=x(o.subRows,t+1),s(o=a)&&!a.subRows.length||s(o)||a.subRows.length){n.push(o),v[o.id]=o,m.push(o);continue}}else s(o=a)&&(n.push(o),v[o.id]=o,m.push(o))}return n})(a),flatRows:m,rowsById:v}):(c=r,h=o,b=[],w={},S=null!=(f=(d=e).options.maxLeafRowFilterDepth)?f:100,{rows:(_=function(e,t){void 0===t&&(t=0);let n=[];for(let r=0;r<e.length;r++){let o=e[r];if(h(o)){var i;if(null!=(i=o.subRows)&&i.length&&t<S){let e=dY(d,o.id,o.original,o.index,o.depth,void 0,o.parentId);e.subRows=_(o.subRows,t+1),o=e}n.push(o),b.push(o),w[o.id]=o}}return n})(c),flatRows:b,rowsById:w})},dG(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex())):void 0,filterFromLeafRows:e,onGlobalFilterChange:l}}}(b?.isSearchEnabled,b?.fuzzyMatchThreshold??"CONTAINS",A,k),[O,P]=(0,eI.useState)(x?.reduce((e,t)=>({...e,[t]:!1}),{})??{}),R=(0,eI.useCallback)((e,t,n)=>{"standard"===v||n?t.toggleSelected():t.getIsSelected()&&!e.getIsAllRowsSelected()?e.toggleAllRowsSelected():s?.({[t.id]:!0})},[s,v]),E=(0,eI.useCallback)((e,t,n)=>{let i=e.nativeEvent&&(e.nativeEvent instanceof MouseEvent||e.nativeEvent instanceof KeyboardEvent)?e.nativeEvent:void 0;R(t,n,!!i?.metaKey||!!i?.shiftKey)},[R]),L=(0,eI.useMemo)(()=>({id:"itemActions",header:"Actions",cell:({row:e})=>(0,eb.jsx)(eC.A,{direction:"row",alignItems:"center",children:f?.({id:e.id,data:e.original})}),enableSorting:!1,enableResizing:!1}),[f]),N=(0,eI.useMemo)(()=>({id:"checkboxRowSelect",size:28,header:({table:e})=>(0,eb.jsx)(fA,{checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler(),color:C.palette.text.primary,density:i}),cell:({row:e,table:t})=>(0,eb.jsx)(fA,{checked:e.getIsSelected(),indeterminate:e.getIsSomeSelected(),onChange:n=>{E(n,t,e)},color:u?.(e.original),density:i}),enableSorting:!1,enableResizing:!1}),[C.palette.text.primary,i,u,E]),B=function(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=eI.useState(()=>({current:function(e){var t,n;let i=[...fg,...null!=(t=e._features)?t:[]],r={_features:i},o=r._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(r)),{}),a={...null!=(n=e.initialState)?n:{}};r._features.forEach(e=>{var t;a=null!=(t=null==e.getInitialState?void 0:e.getInitialState(a))?t:a});let s=[],l=!1,u={_features:i,options:{...o,...e},initialState:a,_queue:e=>{s.push(e),l||(l=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();l=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{r.setState(r.initialState)},setOptions:e=>{var t;t=dV(e,r.options),r.options=r.options.mergeOptions?r.options.mergeOptions(o,t):{...o,...t}},getState:()=>r.options.state,setState:e=>{null==r.options.onStateChange||r.options.onStateChange(e)},_getRowId:(e,t,n)=>{var i;return null!=(i=null==r.options.getRowId?void 0:r.options.getRowId(e,t,n))?i:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?r.getPrePaginationRowModel():r.getRowModel()).rowsById[e];if(!n&&!(n=r.getCoreRowModel().rowsById[e]))throw Error();return n},_getDefaultColumnDef:dW(()=>[r.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...r._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},dG(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:dW(()=>[r._getColumnDefs()],e=>{let t=function(e,n,i){return void 0===i&&(i=0),e.map(e=>{let o=function(e,t,n,i){var r,o;let a,s={...e._getDefaultColumnDef(),...t},l=s.accessorKey,u=null!=(r=null!=(o=s.id)?o:l?"function"==typeof String.prototype.replaceAll?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)?r:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?a=s.accessorFn:l&&(a=l.includes(".")?e=>{let t=e;for(let e of l.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!u)throw Error();let c={id:`${String(u)}`,accessorFn:a,parent:i,depth:n,columnDef:s,columns:[],getFlatColumns:dW(()=>[!0],()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},dG(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:dW(()=>[e._getOrderColumnsFn()],e=>{var t;return null!=(t=c.columns)&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},dG(e.options,"debugColumns","column.getLeafColumns"))};for(let t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(r,e,i,n);return o.columns=e.columns?t(e.columns,o,i+1):[],o})};return t(e)},dG(e,"debugColumns","getAllColumns")),getAllFlatColumns:dW(()=>[r.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),dG(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:dW(()=>[r.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),dG(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:dW(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),dG(e,"debugColumns","getAllLeafColumns")),getColumn:e=>r._getAllFlatColumnsById()[e]};Object.assign(r,u);for(let e=0;e<r._features.length;e++){let t=r._features[e];null==t||null==t.createTable||t.createTable(r)}return r}(t)})),[i,r]=eI.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...i,...e.state},onStateChange:t=>{r(t),null==e.onStateChange||e.onStateChange(t)}})),n.current}({data:e,columns:(0,eI.useMemo)(()=>{let e=fC(t,S);return p&&e.unshift(L),a&&e.unshift(N),e},[t,S,p,a,L,N]),getRowId:c,getCoreRowModel:e=>dW(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},i=function(t,r,o){void 0===r&&(r=0);let a=[];for(let l=0;l<t.length;l++){let u=dY(e,e._getRowId(t[l],l,o),t[l],l,r,void 0,null==o?void 0:o.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var s;u.originalSubRows=e.options.getSubRows(t[l],l),null!=(s=u.originalSubRows)&&s.length&&(u.subRows=i(u.originalSubRows,r+1,u))}}return a};return n.rows=i(t),n},dG(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex())),getSortedRowModel:e=>dW(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(null!=t&&t.length))return n;let i=e.getState().sorting,r=[],o=i.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),a={};o.forEach(t=>{let n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let i=0;i<o.length;i+=1){var n;let r=o[i],s=a[r.id],l=s.sortUndefined,u=null!=(n=null==r?void 0:r.desc)&&n,c=0;if(l){let n=e.getValue(r.id),i=t.getValue(r.id),o=void 0===n,a=void 0===i;if(o||a){if("first"===l)return o?-1:1;if("last"===l)return o?1:-1;c=o&&a?0:o?l:-l}}if(0===c&&(c=s.sortingFn(e,t,r.id)),0!==c)return u&&(c*=-1),s.invertSorting&&(c*=-1),c}return e.index-t.index}),t.forEach(e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:r,rowsById:n.rowsById}},dG(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex())),getPaginationRowModel:g?e=>dW(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{let i;if(!n.rows.length)return n;let{pageSize:r,pageIndex:o}=t,{rows:a,flatRows:s,rowsById:l}=n,u=r*o;a=a.slice(u,u+r),(i=e.options.paginateExpandedRows?{rows:a,flatRows:s,rowsById:l}:fm({rows:a,flatRows:s,rowsById:l})).flatRows=[];let c=e=>{i.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return i.rows.forEach(c),i},dG(e.options,"debugTable","getPaginationRowModel")):void 0,manualPagination:!g,enableRowSelection:!!a,onRowSelectionChange:e=>{let t="function"==typeof e?e(h):e;s?.(t)},onSortingChange:e=>{let t="function"==typeof e?e(d):e;l?.(t)},onColumnVisibilityChange:P,getSubRows:y,getExpandedRowModel:M?e=>dW(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>t.rows.length&&(!0===e||Object.keys(null!=e?e:{}).length)&&n?fm(t):t,dG(e.options,"debugTable","getExpandedRowModel")):void 0,...D,sortDescFirst:!0,columnResizeMode:w,onExpandedChange:k,state:{rowSelection:h,sorting:d,globalFilter:b?.isSearchEnabled?T:void 0,columnVisibility:O,...g?{pagination:g}:{},expanded:A}}),F=(0,eI.useCallback)((e,t)=>{let n=B.getRow(t);R(B,n,e.metaKey||e.shiftKey)},[R,B]);return(0,eb.jsx)(pN,{..._,density:i,defaultColumnWidth:r,defaultColumnHeight:o,onRowClick:F,rows:B.getRowModel().rows,columns:B.getVisibleFlatColumns(),columnSizing:B.getState().columnSizing,columnSizingInfo:B.getState().columnSizingInfo,headers:B.getHeaderGroups(),cellConfigs:n,pagination:g,onPaginationChange:m,rowCount:B.getRowCount(),toolbarConfig:{isSearchEnabled:b?.isSearchEnabled,globalFilter:T,onGlobalFilterChange:I,isColumnFilterEnabled:b?.isColumnFilterEnabled,columns:B.getAllColumns(),columnFilterMenuMaxHeight:b?.columnFilterMenuMaxHeight,isExpandAllEnabled:M,isAllExpanded:B.getIsAllRowsExpanded(),onExpandAllChange:B.getToggleAllRowsExpandedHandler()}})}let pj=[{accessorKey:"label",header:"Name",enableSorting:!0,enableResizing:!0,cell:({getValue:e})=>(0,eb.jsx)("span",{title:e(),children:e()})}],pH=e=>e.id,pW=e=>e.color;function pG({items:e,selectedItems:t,onSelectedItemsChange:n,onItemMouseOver:i,onItemMouseOut:r,height:o,width:a,columns:s=[],sorting:l,onSortingChange:u}){let c=(0,eI.useMemo)(()=>"string"!=typeof t?t:e.reduce((e,t,n)=>(e[pH(t,n)]=!0,e),{}),[t,e]),h=(0,eI.useMemo)(()=>{let e=Math.max(a-(s?.reduce((e,t)=>e+("number"==typeof t.width?t.width:150),0)??0)-45,60*pj.length)/pj.length;return[...pj.map(t=>({...t,width:e})),...s]},[s,a]);return(0,eb.jsx)(pV,{height:o,width:a,rowSelection:c,onRowSelectionChange:n,onRowMouseOver:i,onRowMouseOut:r,sorting:l,onSortingChange:u,data:e,columns:h,density:"compact",defaultColumnWidth:"auto",getRowId:pH,getCheckboxColor:pW,checkboxSelection:!0,rowSelectionVariant:"legend"})}function p$({width:e,height:t,options:n,data:i,selectedItems:r,onSelectedItemsChange:o,onItemMouseOver:a,onItemMouseOut:s,tableProps:l}){let u,c=(e,t)=>{let n=e.metaKey||e.shiftKey;o((0,us.jM)(r,e=>{if("ALL"===e)return{[t]:!0};let i=!!e[t];return n?(i?delete e[t]:e[t]=!0,e):i?"ALL":{[t]:!0}}))},h=nH(n.mode),d=i.length>=500,f={height:t,items:i,selectedItems:r,onLegendItemClick:c,onItemMouseOver:a,onItemMouseOut:s};return(u="table"===h?(0,eb.jsx)(pG,{...f,onSelectedItemsChange:o,width:e,...l}):"right"===n.position||d?(0,eb.jsx)(dz,{...f,width:e,onLegendItemClick:c}):(0,eb.jsx)(uI,{...f,onLegendItemClick:c}),"right"===n.position)?(0,eb.jsx)(ua.A,{style:{width:e,height:t},sx:{position:"absolute",top:0,right:0,backgroundColor:e=>`${e.palette.background.default}`},children:u}):(0,eb.jsx)(ua.A,{style:{width:e,height:t},sx:{position:"absolute",bottom:0,backgroundColor:e=>`${e.palette.background.default}`},children:u})}let pU={medium:{bottom:6,right:250},small:{bottom:4,right:150}};function pq({children:e,legendProps:t,width:n,height:i,spacing:r=0,legendSize:o,minChildrenWidth:a=100,minChildrenHeight:s=100}){let{content:l,legend:u,margin:c}=function({width:e,height:t,legendProps:n,legendSize:i,minChildrenHeight:r,minChildrenWidth:o,spacing:a,theme:s}){let l,u,c=n?.options,h={legend:{show:!1,width:0,height:0},content:{width:e,height:t},margin:{right:0,bottom:0}};if(!c)return h;let{position:d}=c;if("list"===nH(c.mode))l="right"===d?200:e,u=40,"right"===d?u=t:t>=300&&(u=100);else{let r=f_(s,"compact"),o=(n?.tableProps?.columns||[]).reduce((e,t)=>("number"==typeof t.width&&(e+=t.width),e),0);l="right"===d?pU[i].right+o:e;let a=Math.min(pU[i].bottom,n.data.length+1);u="bottom"===d?a*r.height:t}let f="right"===d?e-l-a:e,p="bottom"===d?t-u-a:t;return"right"===d&&f<o||"bottom"===d&&p<r?h:{legend:{width:l,height:u,show:!0},content:{width:f,height:p},margin:{right:"right"===d?a:0,bottom:"bottom"===d?a:0}}}({width:n,height:i,legendProps:t,minChildrenHeight:s,minChildrenWidth:a,spacing:r,theme:(0,uo.A)(),legendSize:nW(o)});return(0,eb.jsxs)(ua.A,{style:{width:n,height:i},sx:{position:"relative",overflow:"hidden"},children:[(0,eb.jsx)(ua.A,{style:{width:l.width,height:l.height},sx:{marginRight:`${c.right}px`,marginBottom:`${c.bottom}px`},children:"function"==typeof e?e({width:l.width,height:l.height}):e}),t&&u.show&&(0,eb.jsx)(p$,{...t,height:u.height,width:u.width})]})}var pY=n(91467),pZ=n(66834),pX=n(92890),pK=n(39750);let pQ=(0,e7.A)("form")({overflowY:"auto",display:"flex",flexDirection:"column"}),pJ=e=>({position:"absolute",top:e.spacing(.5),right:e.spacing(.5)}),p0=({children:e,...t})=>(0,eb.jsx)(pX.A,{...t,children:e});p0.Header=({children:e,onClose:t,...n})=>(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(pY.A,{style:{textOverflow:"ellipsis",overflow:"hidden"},...n,children:e}),t&&(0,eb.jsx)(eM.A,{"aria-label":"Close",onClick:t,sx:pJ,children:(0,eb.jsx)(pA,{})})]}),p0.Form=pQ,p0.Content=({children:e,sx:t,...n})=>(0,eb.jsx)(pZ.A,{dividers:!0,...n,sx:ry({minWidth:"500px",textWrap:"balance"},t),children:e}),p0.PrimaryButton=({children:e,...t})=>(0,eb.jsx)(eS.A,{variant:"contained",type:"submit",...t,children:e}),p0.SecondaryButton=({children:e,...t})=>(0,eb.jsx)(eS.A,{variant:"outlined",color:"secondary",...t,children:e}),p0.Actions=pK.A;let p1=e=>{let{description:t,isOpen:n,onCancel:i,onDiscardChanges:r}=e;return(0,eb.jsxs)(p0,{open:n,"aria-labelledby":"discard-dialog",children:[(0,eb.jsx)(p0.Header,{children:"Discard Changes"}),(0,eb.jsx)(p0.Content,{children:t}),(0,eb.jsxs)(p0.Actions,{children:[(0,eb.jsx)(eS.A,{variant:"contained",onClick:r,children:"Discard Changes"}),(0,eb.jsx)(eS.A,{variant:"outlined",color:"secondary",onClick:i,children:"Cancel"})]})]})};var p2=n(66395);let p5=({children:e})=>(0,eb.jsx)(p2.Ay,{item:!0,xs:4,children:(0,eb.jsx)(eC.A,{spacing:3,children:e})});var p3=n(67987),p4=n(9799),p6=n(17366),p8=n(32751);let p9=({id:e,title:t,description:n,placement:i,children:r,enterDelay:o,enterNextDelay:a})=>{let s=(0,eb.jsx)("span",{children:r});return(0,eb.jsx)(ge,{arrow:!0,id:e,placement:i??"top",title:(0,eb.jsx)(p7,{title:t,description:n}),enterDelay:o??500,enterNextDelay:a??500,children:s})},p7=({title:e,description:t})=>(0,eb.jsxs)(eb.Fragment,{children:[e&&(0,eb.jsx)(pd.A,{variant:"body2",sx:e=>({color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium}),children:e}),(0,eb.jsx)(pd.A,{variant:"caption",sx:e=>({color:e.palette.text.primary,whiteSpace:"pre-line"}),children:t})]}),ge=(0,e7.A)(({className:e,...t})=>(0,eb.jsx)(pC.A,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${p8.A.tooltip}`]:{backgroundColor:e.palette.background.tooltip,color:e.palette.text.primary,maxWidth:"300px",padding:e.spacing(1),boxShadow:e.shadows[1]},[`& .${p8.A.arrow}`]:{color:e.palette.background.tooltip}})),gt=({label:e,control:t,description:n})=>{let i=rx("EditorSectionControl"),r=`${i}-control`,o=`${i}-label`;return(0,eb.jsx)(p3.A,{children:(0,eb.jsxs)(eC.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,eb.jsxs)(eC.A,{direction:"row",alignItems:"center",justifyContent:"center",children:[(0,eb.jsx)(p4.A,{id:o,htmlFor:r,children:e}),n&&(0,eb.jsx)(p9,{description:n,enterDelay:100,children:(0,eb.jsx)(eM.A,{size:"small",sx:e=>({borderRadius:e.shape.borderRadius,padding:"4x",margin:"0 2px"}),children:(0,eb.jsx)(p6,{"aria-describedby":"info-tooltip","aria-hidden":!1,fontSize:"inherit",sx:{color:e=>e.palette.grey[700]}})})})]}),(0,eb.jsxs)(ua.A,{sx:{width:"180px",textAlign:"right"},children:[" ",eD().cloneElement(t,{id:r,"aria-labelledby":o})]})]})})},gn=({children:e})=>(0,eb.jsx)(p2.Ay,{container:!0,spacing:8,children:e}),gi=({title:e,children:t,icon:n})=>(0,eb.jsxs)(ua.A,{children:[(0,eb.jsxs)(ua.A,{display:"flex",borderBottom:1,borderColor:"grey.300",marginBottom:e=>e.spacing(1),children:[(0,eb.jsx)(pd.A,{variant:"overline",component:"h4",children:e}),n&&(0,eb.jsx)(ua.A,{sx:{marginLeft:"auto"},children:n})]}),(0,eb.jsx)(eC.A,{spacing:1,children:t})]});var gr=n(31271),go=n(81227);function ga({options:e,renderInput:t=e=>(0,eb.jsx)(eA.A,{...e}),id:n,"aria-labelledby":i,...r}){let o=e=>e.label??e.id;return(0,eb.jsx)(gr.A,{isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionDisabled:e=>!!e.disabled,getOptionLabel:o,options:e,renderInput:e=>t({...e,inputProps:{...e.inputProps,id:n,"aria-labelledby":i}}),renderOption:({key:e,...t},n)=>(0,eb.jsx)("li",{...t,children:(0,eb.jsxs)("div",{children:[(0,eb.jsx)(pd.A,{variant:"body1",component:"div",children:o(n)}),n.description&&(0,eb.jsx)(pd.A,{variant:"body2",component:"div",sx:{color:e=>e.palette.text.secondary},children:n.description})]})},e),filterOptions:(0,go.Z)({stringify:e=>`${o(e)} ${e.description||""}`}),...r})}let gs=[{id:"compact",label:"Compact"},{id:"standard",label:"Standard"},{id:"comfortable",label:"Comfortable"}];function gl({onChange:e,value:t="standard"}){return(0,eb.jsx)(gt,{label:"Density",control:(0,eb.jsx)(ga,{value:gs.find(e=>e.id===t),options:gs,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function gu(){return(0,eb.jsxs)(eC.A,{direction:"row",alignItems:"center",children:[(0,eb.jsx)(ua.A,{sx:{content:'""',width:8,height:8,boxSizing:"border-box",position:"absolute",backgroundColor:e=>e.palette.background.default,border:e=>`2px solid ${e.palette.info.main}`,borderRadius:"50%"}}),(0,eb.jsx)(ua.A,{sx:{content:'""',height:2,background:e=>e.palette.info.main,width:"100%"}})]})}function gc(e){return(gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gh(e,t,n){var i;return(i=function(e,t){if("object"!=gc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=gc(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==gc(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function gf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gd(Object(n),!0).forEach(function(t){gh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gp={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},gg=Symbol("closestEdge");function gm(e){var t;return null!=(t=e[gg])?t:null}function gv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function gy(e,t){if(e){if("string"==typeof e)return gv(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gv(e,t):void 0}}function gx(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(e,t)||gy(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gb(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(e){return e()})}}var gw=n(96907),gS="data-pdnd-honey-pot";function g_(e){return e instanceof Element&&e.hasAttribute(gS)}function gC(e){var t=gx(document.elementsFromPoint(e.x,e.y),2),n=t[0],i=t[1];return n?g_(n)?null!=i?i:null:n:null}var gM={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent"};function gA(e){var t=null;return function(){if(!t){for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];t={result:e.apply(this,i)}}return t.result}}var gk=gA(function(){return"u">typeof HTMLElement&&"function"==typeof HTMLElement.prototype.showPopover});function gT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function gI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gT(Object(n),!0).forEach(function(t){gh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gD(e){var t,n,i,r,o={x:Math.min((r={x:Math.max((i={x:(n={x:Math.floor((t=e.client).x),y:Math.floor(t.y)}).x-1,y:n.y-1}).x,0),y:Math.max(i.y,0)}).x,window.innerWidth-2),y:Math.min(r.y,window.innerHeight-2)};return DOMRect.fromRect({x:o.x,y:o.y,width:2,height:2})}function gO(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function gP(e){return function(e){if(Array.isArray(e))return gv(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||gy(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var gR=gA(function(){return navigator.userAgent.includes("Firefox")}),gE=gA(function(){var e=navigator.userAgent;return e.includes("AppleWebKit")&&!e.includes("Chrome")}),gL={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};if(!("u"<typeof window)&&gE()){var gN=gB();(0,gw.bindAll)(window,[{type:"dragstart",listener:function(){gN.enterCount=0,gN.isOverWindow=!0}},{type:"drop",listener:gF},{type:"dragend",listener:gF},{type:"dragenter",listener:function(e){gN.isOverWindow||0!==gN.enterCount||(e[gL.isEnteringWindow]=!0),gN.isOverWindow=!0,gN.enterCount++}},{type:"dragleave",listener:function(e){gN.enterCount--,gN.isOverWindow&&0===gN.enterCount&&(e[gL.isLeavingWindow]=!0,gN.isOverWindow=!1)}}],{capture:!0})}function gB(){return{enterCount:0,isOverWindow:!1}}function gF(){gN=gB()}function gz(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var gV=(f=function(e){return e()},p=[],g=null,(m=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];p=t,g||(g=requestAnimationFrame(function(){g=null,f.apply(void 0,p)}))}).cancel=function(){g&&(cancelAnimationFrame(g),g=null)},m),gj=(v=null,{schedule:function(e){v={frameId:requestAnimationFrame(function(){v=null,e()}),fn:e}},flush:function(){v&&(cancelAnimationFrame(v.frameId),v.fn(),v=null)}}),gH={isActive:!1};function gW(){return!gH.isActive}function gG(e){var t,n=e.event,i=null==(t=e.current[0])?void 0:t.dropEffect;null!=i&&n.dataTransfer&&(n.dataTransfer.dropEffect=i)}var g$=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=e.dispatchEvent;if(gW()){var o,a,s=function(e){var t=e.event,n=e.dragType,i=e.getDropTargetsOver,r=gz(t);if("external"===n.startedFrom)return{input:r,dropTargets:[]};var o=i({input:r,source:n.payload,target:t.target,current:[]});return{input:r,dropTargets:o}}({event:t,dragType:n,getDropTargetsOver:i});gH.isActive=!0;var l={current:s};gG({event:t,current:s.dropTargets});var u=function(e){var t=e.source,n=e.initial,i=e.dispatchEvent,r={dropTargets:[]};function o(e){i(e),r={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var i=e.nativeSetDragImage,a={current:n,previous:r,initial:n};o({eventName:"onGenerateDragPreview",payload:{source:t,location:a,nativeSetDragImage:i}}),gj.schedule(function(){o({eventName:"onDragStart",payload:{source:t,location:a}})})},dragUpdate:function(e){var i=e.current;gj.flush(),gV.cancel(),o({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:r,current:i}}})},drag:function(e){var i=e.current;gV(function(){gj.flush(),o({eventName:"onDrag",payload:{source:t,location:{initial:n,previous:r,current:i}}})})},drop:function(e){var i=e.current,a=e.updatedSourcePayload;gj.flush(),gV.cancel(),o({eventName:"onDrop",payload:{source:null!=a?a:t,location:{current:i,previous:r,initial:n}}})}}}({source:n.payload,dispatchEvent:r,initial:s}),c=(0,gw.bindAll)(window,[{type:"dragover",listener:function(e){d(e),u.drag({current:l.current})}},{type:"dragenter",listener:d},{type:"dragleave",listener:function(e){(function(e){var t=e.dragLeave,n=t.type,i=t.relatedTarget;return"dragleave"===n&&(gE()?!!gE()&&t.hasOwnProperty(gL.isLeavingWindow):null==i||(gR()?"nodeName"in i&&i.ownerDocument!==document:i instanceof HTMLIFrameElement))})({dragLeave:e})&&(h({input:l.current.input,dropTargets:[]}),"external"===n.startedFrom&&f())}},{type:"drop",listener:function(e){(l.current={dropTargets:l.current.dropTargets,input:gz(e)},l.current.dropTargets.length)?(e.preventDefault(),gG({event:e,current:l.current.dropTargets}),u.drop({current:l.current,updatedSourcePayload:"external"===n.type?n.getDropPayload(e):null}),p()):f()}},{type:"dragend",listener:function(e){l.current={dropTargets:l.current.dropTargets,input:gz(e)},f()}}].concat(gP([{type:"pointermove",listener:(a=0,function(){a<20?a++:o()})},{type:"pointerdown",listener:o=f}])),{capture:!0});u.start({nativeSetDragImage:t.dataTransfer?t.dataTransfer.setDragImage.bind(t.dataTransfer):null})}function h(e){var t=function(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var i=0;i<t.length;i++)if(t[i].element!==n[i].element)return!0;return!1}({current:l.current.dropTargets,next:e.dropTargets});l.current=e,t&&u.dragUpdate({current:l.current})}function d(e){var t=gz(e),r=i({target:g_(e.target)?gC({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:l.current.dropTargets});r.length&&(e.preventDefault(),gG({event:e,current:r})),h({dropTargets:r,input:t})}function f(){l.current.dropTargets.length&&h({dropTargets:[],input:l.current.input}),u.drop({current:l.current,updatedSourcePayload:null}),p()}function p(){gH.isActive=!1,c()}},gU=new Map;function gq(e,t){var n=t.attribute,i=t.value;return e.setAttribute(n,i),function(){return e.removeAttribute(n)}}function gY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function gZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gY(Object(n),!0).forEach(function(t){gh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gX(e,t){var n="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e){if(e){if("string"==typeof e)return gK(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gK(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function gK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function gQ(e){return e.slice(0).reverse()}function gJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function g0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}var g1=gA(function(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),g2="text/plain",g5=new WeakMap,g3=(y=null,{bindEvents:function(){return y=null,(0,gw.bind)(window,{type:"pointermove",listener:function(e){y={x:e.clientX,y:e.clientY}},options:{capture:!0}})},getOnPostDispatch:function(){var e=null;return function(t){var n=t.eventName,i=t.payload;if("onDragStart"===n){var r,o,a,s=i.location.initial.input,l=null!=y?y:{x:s.clientX,y:s.clientY};(r=document.createElement("div")).setAttribute(gS,"true"),gk()&&r.setAttribute("popover","manual"),o=gD({client:l}),Object.assign(r.style,gI(gI({position:"fixed"},gk()?gM:{zIndex:0x7fffffff}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},gO({clientRect:o}))),document.body.appendChild(r),gk()&&r.showPopover(),a=(0,gw.bind)(window,{type:"pointermove",listener:function(e){o=gD({client:{x:e.clientX,y:e.clientY}}),Object.assign(r.style,gO({clientRect:o}))},options:{capture:!0}}),e=function(e){var t,n,i,s=e.current;if(a(),n=(t={client:s,clientRect:o}).client,i=t.clientRect,n.x>=i.x&&n.x<=i.x+i.width&&n.y>=i.y&&n.y<=i.y+i.height)return void r.remove();function l(){u(),r.remove()}var u=(0,gw.bindAll)(window,[{type:"pointerdown",listener:l},{type:"pointermove",listener:l},{type:"focusin",listener:l},{type:"focusout",listener:l},{type:"dragstart",listener:l},{type:"dragenter",listener:l},{type:"dragover",listener:l}],{capture:!0})}}if("onDrop"===n){var u,c=i.location.current.input;null==(u=e)||u({current:{x:c.clientX,y:c.clientY}}),e=null,y=null}}}}),g4=function(e){var t=e.typeKey,n=e.mount,i=e.dispatchEventToSource,r=e.onPostDispatch,o=e.defaultDropEffect,a=function(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}return{dispatchEvent:function(i){var r=i.eventName,o=i.payload;if("onGenerateDragPreview"===r){t={canMonitorArgs:{initial:o.location.initial,source:o.source},active:new Set};var a,s=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return gJ(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gJ(e,void 0):void 0}}(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,r=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw r}}}}(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;n(l)}}catch(e){s.e(e)}finally{s.f()}}if(t){for(var u=Array.from(t.active),c=0;c<u.length;c++){var h,d=u[c];t.active.has(d)&&(null==(h=d[r])||h.call(d,o))}"onDrop"===r&&(t.active.clear(),t=null)}},monitorForConsumers:function(i){var r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g0(Object(n),!0).forEach(function(t){gh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},i);return e.add(r),n(r),gA(function(){e.delete(r),t&&t.active.delete(r)})}}}(),s=function(e){var t=e.typeKey,n=e.defaultDropEffect,i=new WeakMap,r="data-drop-target-for-".concat(t),o="[".concat(r,"]");function a(e){var t,n=e.eventName,r=e.payload,o=gX(r.location.current.dropTargets);try{for(o.s();!(t=o.n()).done;){var a,s=t.value,l=i.get(s.element),u=gZ(gZ({},r),{},{self:s});null==l||null==(a=l[n])||a.call(l,u)}}catch(e){o.e(e)}finally{o.f()}}var s={onGenerateDragPreview:a,onDrag:a,onDragStart:a,onDrop:a,onDropTargetChange:function(e){var t,n=e.payload,r=new Set(n.location.current.dropTargets.map(function(e){return e.element})),o=new Set,a=gX(n.location.previous.dropTargets);try{for(a.s();!(t=a.n()).done;){var s,l,u=t.value;o.add(u.element);var c=i.get(u.element),h=r.has(u.element),d=gZ(gZ({},n),{},{self:u});null==c||null==(s=c.onDropTargetChange)||s.call(c,d),h||null==c||null==(l=c.onDragLeave)||l.call(c,d)}}catch(e){a.e(e)}finally{a.f()}var f,p=gX(n.location.current.dropTargets);try{for(p.s();!(f=p.n()).done;){var g,m,v=f.value;if(!o.has(v.element)){var y=gZ(gZ({},n),{},{self:v}),x=i.get(v.element);null==x||null==(g=x.onDropTargetChange)||g.call(x,y),null==x||null==(m=x.onDragEnter)||m.call(x,y)}}}catch(e){p.e(e)}finally{p.f()}}};return{dropTargetForConsumers:function(e){return gA(gb(gq(e.element,{attribute:r,value:"true"}),(i.set(e.element,e),function(){return i.delete(e.element)})))},getIsOver:function(e){var t=e.source,r=e.target,a=e.input,s=e.current,l=function e(t){var r,a,s,l,u=t.source,c=t.target,h=t.input,d=t.result,f=void 0===d?[]:d;if(null==c)return f;if(!(c instanceof Element))return c instanceof Node?e({source:u,target:c.parentElement,input:h,result:f}):f;var p=c.closest(o);if(null==p)return f;var g=i.get(p);if(null==g)return f;var m={input:h,source:u,element:g.element};if(g.canDrop&&!g.canDrop(m))return e({source:u,target:g.element.parentElement,input:h,result:f});var v=null!=(r=null==(a=g.getData)?void 0:a.call(g,m))?r:{},y=null!=(s=null==(l=g.getDropEffect)?void 0:l.call(g,m))?s:n,x={data:v,element:g.element,dropEffect:y,isActiveDueToStickiness:!1};return e({source:u,target:g.element.parentElement,input:h,result:[].concat(gP(f),[x])})}({source:t,target:r,input:a});if(l.length>=s.length)return l;for(var u=gQ(s),c=gQ(l),h=[],d=0;d<u.length;d++){var f,p=u[d],g=c[d];if(null!=g){h.push(g);continue}var m=h[d-1],v=u[d-1];if((null==m?void 0:m.element)!==(null==v?void 0:v.element))break;var y=i.get(p.element);if(!y)break;var x={input:a,source:t,element:y.element};if(y.canDrop&&!y.canDrop(x)||!(null!=(f=y.getIsSticky)&&f.call(y,x)))break;h.push(gZ(gZ({},p),{},{isActiveDueToStickiness:!0}))}return gQ(h)},dispatchEvent:function(e){s[e.eventName](e)}}}({typeKey:t,defaultDropEffect:o});function l(e){null==i||i(e),s.dispatchEvent(e),a.dispatchEvent(e),null==r||r(e)}function u(e){g$({event:e.event,dragType:e.dragType,getDropTargetsOver:s.getIsOver,dispatchEvent:l})}return{registerUsage:function(){var e,i;return i=function(e){var t=e.typeKey,n=e.mount,i=gU.get(t);if(i)return i.usageCount++,i;var r={typeKey:t,unmount:n(),usageCount:1};return gU.set(t,r),r}(e={typeKey:t,mount:function(){return n({canStart:gW,start:u})}}),function(){i.usageCount--,i.usageCount>0||(i.unmount(),gU.delete(e.typeKey))}},dropTarget:s.dropTargetForConsumers,monitor:a.monitorForConsumers}}({typeKey:"element",defaultDropEffect:"move",mount:function(e){return gb(g3.bindEvents(),(0,gw.bind)(document,{type:"dragstart",listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n,i,r,o,a,s,l=t.target;if(l instanceof HTMLElement){var u=g5.get(l);if(u){var c=gz(t),h={element:u.element,dragHandle:null!=(n=u.dragHandle)?n:null,input:c};if(u.canDrag&&!u.canDrag(h))return void t.preventDefault();if(u.dragHandle){var d=gC({x:c.clientX,y:c.clientY});if(!u.dragHandle.contains(d))return void t.preventDefault()}var f=null!=(i=null==(r=u.getInitialDataForExternal)?void 0:r.call(u,h))?i:null;if(f)for(var p=0,g=Object.entries(f);p<g.length;p++){var m=gx(g[p],2),v=m[0],y=m[1];t.dataTransfer.setData(v,null!=y?y:"")}!g1()||t.dataTransfer.types.includes(g2)||t.dataTransfer.types.includes("text/uri-list")||t.dataTransfer.setData(g2,"pdnd:android-fallback"),t.dataTransfer.setData("application/vnd.pdnd","");var x={element:u.element,dragHandle:null!=(o=u.dragHandle)?o:null,data:null!=(a=null==(s=u.getInitialData)?void 0:s.call(u,h))?a:{}};e.start({event:t,dragType:{type:"element",payload:x,startedFrom:"internal"}})}}}}}))},dispatchEventToSource:function(e){var t,n,i=e.eventName,r=e.payload;null==(t=g5.get(r.source.element))||null==(n=t[i])||n.call(t,r)},onPostDispatch:g3.getOnPostDispatch()}),g6=g4.dropTarget,g8=g4.monitor;let g9={type:"idle"};function g7({elements:e,accessKey:t,axis:n="vertical",onChange:i}){return(0,eI.useEffect)(()=>g8({onDrop({location:r,source:o}){var a,s;let l=r.current.dropTargets[0];if(!l)return;let u=o.data,c=l.data,h=e.findIndex(e=>e[t]===u[t]),d=e.findIndex(e=>e[t]===c[t]);d<0||h<0||i(function(e){var t=e.list,n=e.startIndex,i=e.finishIndex;if(-1===n||-1===i)return Array.from(t);var r=Array.from(t),o=gx(r.splice(n,1),1)[0];return r.splice(i,0,o),r}({list:(a={list:e,startIndex:h,indexOfTarget:d,closestEdgeOfTarget:gm(c),axis:n}).list,startIndex:s=a.startIndex,finishIndex:function(e){var t=e.startIndex,n=e.closestEdgeOfTarget,i=e.indexOfTarget,r=e.axis;if(-1===t||-1===i||t===i)return t;if(null==n)return i;var o="vertical"===r&&"bottom"===n||"horizontal"===r&&"right"===n;return t<i?o?i:i-1:o?i+1:i}({closestEdgeOfTarget:a.closestEdgeOfTarget,startIndex:s,indexOfTarget:a.indexOfTarget,axis:a.axis})}))}}),[t,n,e,i])}function me({children:e,data:t}){let n=(0,eI.useRef)(null),[i,r]=(0,eI.useState)(g9);return(0,eI.useEffect)(()=>{let e=n.current;if(e){var i;return gb((i={element:e,getInitialData:()=>t,onDragStart(){r({type:"is-dragging"})},onDrop(){r(g9)}},gA(gb(g4.registerUsage(),(g5.set(i.element,i),function(){g5.delete(i.element)}),gq(i.element,{attribute:"draggable",value:"true"})))),g6({element:e,canDrop:({source:t})=>t.element!==e,getData:({input:n})=>{var i,r,o,a,s,l,u,c,h;return a=(i={element:e,input:n,allowedEdges:["top","bottom"]}).element,s=i.input,l=i.allowedEdges,u={x:s.clientX,y:s.clientY},c=a.getBoundingClientRect(),h=null!=(r=null==(o=l.map(function(e){return{edge:e,value:gp[e](c,u)}}).sort(function(e,t){return e.value-t.value})[0])?void 0:o.edge)?r:null,gf(gf({},t),{},gh({},gg,h))},getIsSticky:()=>!0,onDragEnter({self:e}){r({type:"is-dragging-over",closestEdge:gm(e.data)})},onDrag({self:e}){let t=gm(e.data);r(e=>"is-dragging-over"===e.type&&e.closestEdge===t?e:{type:"is-dragging-over",closestEdge:t})},onDragLeave(){r(g9)},onDrop(){r(g9)}}))}},[t]),(0,eb.jsxs)(eC.A,{ref:n,spacing:1,style:{opacity:"is-dragging"===i.type?.5:"unset"},children:["is-dragging-over"===i.type&&"top"===i.closestEdge?(0,eb.jsx)(gu,{}):null,e,"is-dragging-over"===i.type&&"bottom"===i.closestEdge?(0,eb.jsx)(gu,{}):null]})}var mt=n(53064);function mn(e,t){let n=t.indexOf(e);if(0===n)return t;let i=[...t];return i.splice(n,1),i.splice(n-1,0,e),i}function mi(e,t){let n=t.indexOf(e);if(n===t.length-1)return t;let i=[...t];return i.splice(n,1),i.splice(n+1,0,e),i}let mr=(0,eI.forwardRef)(function({onMoveUp:e,onMoveDown:t,onMoveLeft:n,onMoveRight:i,menuSx:r,...o},a){let[s,l]=(0,eI.useState)(null),u=!!s;function c(e){l(null),e?.()}return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(eM.A,{...o,ref:a,"aria-label":"move","aria-haspopup":!0,"aria-expanded":u,size:"small",onClick:function(e){l(e.currentTarget)},children:(0,eb.jsx)(mt,{})}),(e||t||n||i)&&(0,eb.jsxs)(pM.A,{id:"drag-button-menu",MenuListProps:{"aria-labelledby":"drag-button-menu"},anchorEl:s,open:u,onClose:()=>c(void 0),sx:r,children:[e&&(0,eb.jsx)(fI.A,{onClick:()=>c(e),children:"Move Up"}),t&&(0,eb.jsx)(fI.A,{onClick:()=>c(t),children:"Move Down"}),n&&(0,eb.jsx)(fI.A,{onClick:()=>c(n),children:"Move Left"}),i&&(0,eb.jsx)(fI.A,{onClick:()=>c(i),children:"Move Right"}),i&&(0,eb.jsx)(fI.A,{onClick:()=>c(i),children:"Move Right"})]})]})});var mo=n(8072),ma=n(10972),ms=n(46477),ml=n(30443),mu=n(55403),mc=n(32494),mh=n(63025);function md(e,t,n){let i=function(e,t,n){let i,r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),a=(0,mh.A)(t);if(t.fakeTransform)i=t.fakeTransform;else{let e=a.getComputedStyle(t);i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let s=0,l=0;if(i&&"none"!==i&&"string"==typeof i){let e=i.split("(")[1].split(")")[0].split(",");s=parseInt(e[4],10),l=parseInt(e[5],10)}return"left"===e?o?`translateX(${o.right+s-r.left}px)`:`translateX(${a.innerWidth+s-r.left}px)`:"right"===e?o?`translateX(-${r.right-o.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:"up"===e?o?`translateY(${o.bottom+l-r.top}px)`:`translateY(${a.innerHeight+l-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}(e,t,"function"==typeof n?n():n);i&&(t.style.webkitTransform=i,t.style.transform=i)}let mf=eI.forwardRef(function(e,t){let n=(0,uo.A)(),i={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,container:l,direction:u="down",easing:c=i,in:h,onEnter:d,onEntered:f,onEntering:p,onExit:g,onExited:m,onExiting:v,style:y,timeout:x=r,TransitionComponent:b=ms.Ay,...w}=e,S=eI.useRef(null),_=(0,uv.A)((0,ml.A)(s),S,t),C=e=>t=>{e&&(void 0===t?e(S.current):e(S.current,t))},M=C((e,t)=>{md(u,e,l),(0,mc.q)(e),d&&d(e,t)}),A=C((e,t)=>{let i=(0,mc.c)({timeout:x,style:y,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...i}),e.style.transition=n.transitions.create("transform",{...i}),e.style.webkitTransform="none",e.style.transform="none",p&&p(e,t)}),k=C(f),T=C(v),I=C(e=>{let t=(0,mc.c)({timeout:x,style:y,easing:c},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),md(u,e,l),g&&g(e)}),D=C(e=>{e.style.webkitTransition="",e.style.transition="",m&&m(e)}),O=eI.useCallback(()=>{S.current&&md(u,S.current,l)},[u,l]);return eI.useEffect(()=>{if(h||"down"===u||"right"===u)return;let e=(0,mu.A)(()=>{S.current&&md(u,S.current,l)}),t=(0,mh.A)(S.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[u,h,l]),eI.useEffect(()=>{h||O()},[h,O]),(0,eb.jsx)(b,{nodeRef:S,onEnter:M,onEntered:k,onEntering:A,onExit:I,onExited:D,onExiting:T,addEndListener:e=>{o&&o(S.current,e)},appear:a,in:h,timeout:x,...w,children:(e,{ownerState:t,...n})=>eI.cloneElement(s,{ref:_,style:{visibility:"exited"!==e||h?void 0:"hidden",...y,...s.props.style},...n})})});var mp=n(11502);function mg(e){return(0,ub.Ay)("MuiDrawer",e)}(0,ux.A)("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);var mm=n(64606);let mv=(e,t)=>{let{ownerState:n}=e;return[t.root,("permanent"===n.variant||"persistent"===n.variant)&&t.docked,t.modal]},my=(0,e7.A)(ma.A,{name:"MuiDrawer",slot:"Root",overridesResolver:mv})((0,ud.A)(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),mx=(0,e7.A)("div",{shouldForwardProp:up.A,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:mv})({flex:"0 0 auto"}),mb=(0,e7.A)(mp.A,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperAnchor${(0,pp.A)(n.anchor)}`],"temporary"!==n.variant&&t[`paperAnchorDocked${(0,pp.A)(n.anchor)}`]]}})((0,ud.A)(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:e})=>"left"===e.anchor&&"temporary"!==e.variant,style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"top"===e.anchor&&"temporary"!==e.variant,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"right"===e.anchor&&"temporary"!==e.variant,style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>"bottom"===e.anchor&&"temporary"!==e.variant,style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),mw={left:"right",right:"left",top:"down",bottom:"up"},mS=eI.forwardRef(function(e,t){let n=(0,uf.b)({props:e,name:"MuiDrawer"}),i=(0,uo.A)(),r=(0,fL.I)(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:s,children:l,className:u,elevation:c=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:d,...f}={},onClose:p,open:g=!1,PaperProps:m={},SlideProps:v,TransitionComponent:y,transitionDuration:x=o,variant:b="temporary",slots:w={},slotProps:S={},..._}=n,C=eI.useRef(!1);eI.useEffect(()=>{C.current=!0},[]);let M=function({direction:e},t){return"rtl"===e&&["left","right"].includes(t)?mw[t]:t}({direction:r?"rtl":"ltr"},a),A={...n,anchor:a,elevation:c,open:g,variant:b,..._},k=(e=>{let{classes:t,anchor:n,variant:i}=e,r={root:["root",`anchor${(0,pp.A)(n)}`],docked:[("permanent"===i||"persistent"===i)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${(0,pp.A)(n)}`,"temporary"!==i&&`paperAnchorDocked${(0,pp.A)(n)}`]};return(0,uc.A)(r,mg,t)})(A),T={slots:{transition:y,...w},slotProps:{paper:m,transition:v,...S,backdrop:(0,mm.A)(S.backdrop||{...s,...d},{transitionDuration:x})}},[I,D]=(0,f$.A)("root",{ref:t,elementType:my,className:(0,uu.A)(k.root,k.modal,u),shouldForwardComponentProp:!0,ownerState:A,externalForwardedProps:{...T,..._,...f},additionalProps:{open:g,onClose:p,hideBackdrop:h,slots:{backdrop:T.slots.backdrop},slotProps:{backdrop:T.slotProps.backdrop}}}),[O,P]=(0,f$.A)("paper",{elementType:mb,shouldForwardComponentProp:!0,className:(0,uu.A)(k.paper,m.className),ownerState:A,externalForwardedProps:T,additionalProps:{elevation:"temporary"===b?c:0,square:!0}}),[R,E]=(0,f$.A)("docked",{elementType:mx,ref:t,className:(0,uu.A)(k.root,k.docked,u),ownerState:A,externalForwardedProps:T,additionalProps:_}),[L,N]=(0,f$.A)("transition",{elementType:mf,ownerState:A,externalForwardedProps:T,additionalProps:{in:g,direction:mw[M],timeout:x,appear:C.current}}),B=(0,eb.jsx)(O,{...P,children:l});if("permanent"===b)return(0,eb.jsx)(R,{...E,children:B});let F=(0,eb.jsx)(L,{...N,children:B});return"persistent"===b?(0,eb.jsx)(R,{...E,children:F}):(0,eb.jsx)(I,{...D,children:F})}),m_=({anchor:e="right",isOpen:t,onClose:n,PaperProps:i,children:r,...o})=>{let a=(0,mo.A)("(max-width:1080px)");return(0,eb.jsx)(mS,{...o,open:t,onClose:n,anchor:e,PaperProps:{...i,sx:ry({width:a?"100%":"1080px",overflow:"hidden"},i?.sx)},"aria-hidden":!t,children:r})};var mC="12px sans-serif",mM=function(e){var t={};if("u"<typeof JSON)return t;for(var n=0;n<e.length;n++){var i=String.fromCharCode(n+32),r=(e.charCodeAt(n)-20)/100;t[i]=r}return t}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),mA={createCanvas:function(){return"u">typeof document&&document.createElement("canvas")},measureText:function(e,t){if(!x){var n=mA.createCanvas();x=n&&n.getContext("2d")}if(x)return b!==t&&(b=x.font=t||mC),x.measureText(e);e=e||"",t=t||mC;var i=/(\d+)px/.exec(t),r=i&&+i[1]||12,o=0;if(t.indexOf("mono")>=0)o=r*e.length;else for(var a=0;a<e.length;a++){var s=mM[e[a]];o+=null==s?r:s*r}return{width:o}},loadImage:function(e,t,n){var i=new Image;return i.onload=t,i.onerror=n,i.src=e,i}},mk=mZ(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(e,t){return e["[object "+t+"]"]=!0,e},{}),mT=mZ(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(e,t){return e["[object "+t+"Array]"]=!0,e},{}),mI=Object.prototype.toString,mD=Array.prototype,mO=mD.forEach,mP=mD.filter,mR=mD.slice,mE=mD.map,mL=(function(){}).constructor,mN=mL?mL.prototype:null,mB="__proto__",mF=2311;function mz(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];"u">typeof console&&console.error.apply(console,e)}function mV(e){if(null==e||"object"!=typeof e)return e;var t=e,n=mI.call(e);if("[object Array]"===n){if(!e[vs]){t=[];for(var i=0,r=e.length;i<r;i++)t[i]=mV(e[i])}}else if(mT[n]){if(!e[vs]){var o=e.constructor;if(o.from)t=o.from(e);else{t=new o(e.length);for(var i=0,r=e.length;i<r;i++)t[i]=e[i]}}}else if(!mk[n]&&!e[vs]&&!m9(e))for(var a in t={},e)e.hasOwnProperty(a)&&a!==mB&&(t[a]=mV(e[a]));return t}function mj(e,t,n){if(!m4(t)||!m4(e))return n?mV(t):e;for(var i in t)if(t.hasOwnProperty(i)&&i!==mB){var r=e[i],o=t[i];!(m4(o)&&m4(r))||m0(o)||m0(r)||m9(o)||m9(r)||m6(o)||m6(r)||o[vs]||r[vs]?!n&&i in e||(e[i]=mV(t[i])):mj(r,o,n)}return e}function mH(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==mB&&(e[n]=t[n]);return e}function mW(e,t,n){for(var i=mK(t),r=0;r<i.length;r++){var o=i[r];(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}return e}function mG(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n}return -1}function m$(e,t,n){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(t),r=0;r<i.length;r++){var o=i[r];"constructor"!==o&&(n?null!=t[o]:null==e[o])&&(e[o]=t[o])}else mW(e,t,n)}function mU(e){return!!e&&"string"!=typeof e&&"number"==typeof e.length}function mq(e,t,n){if(e&&t)if(e.forEach&&e.forEach===mO)e.forEach(t,n);else if(e.length===+e.length)for(var i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e);else for(var o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o,e)}function mY(e,t,n){if(!e)return[];if(!t)return vi(e);if(e.map&&e.map===mE)return e.map(t,n);for(var i=[],r=0,o=e.length;r<o;r++)i.push(t.call(n,e[r],r,e));return i}function mZ(e,t,n,i){if(e&&t){for(var r=0,o=e.length;r<o;r++)n=t.call(i,n,e[r],r,e);return n}}function mX(e,t,n){if(!e)return[];if(!t)return vi(e);if(e.filter&&e.filter===mP)return e.filter(t,n);for(var i=[],r=0,o=e.length;r<o;r++)t.call(n,e[r],r,e)&&i.push(e[r]);return i}function mK(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}mA.createCanvas;var mQ=mN&&m1(mN.bind)?mN.call.bind(mN.bind):function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return function(){return e.apply(t,n.concat(mR.call(arguments)))}};function mJ(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(mR.call(arguments)))}}function m0(e){return Array.isArray?Array.isArray(e):"[object Array]"===mI.call(e)}function m1(e){return"function"==typeof e}function m2(e){return"string"==typeof e}function m5(e){return"[object String]"===mI.call(e)}function m3(e){return"number"==typeof e}function m4(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function m6(e){return!!mk[mI.call(e)]}function m8(e){return!!mT[mI.call(e)]}function m9(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}function m7(e){return null!=e.colorStops}function ve(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,i=e.length;n<i;n++)if(null!=e[n])return e[n]}function vt(e,t){return null!=e?e:t}function vn(e,t,n){return null!=e?e:null!=t?t:n}function vi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return mR.apply(e,t)}function vr(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e}function vo(e,t){if(!e)throw Error(t)}function va(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var vs="__ec_primitive__",vl=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},e.prototype.has=function(e){return this.data.hasOwnProperty(e)},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){return this.data[e]=t,this},e.prototype.keys=function(){return mK(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),vu="function"==typeof Map,vc=function(){function e(t){var n=m0(t);this.data=vu?new Map:new vl;var i=this;function r(e,t){n?i.set(e,t):i.set(t,e)}t instanceof e?t.each(r):t&&mq(t,r)}return e.prototype.hasKey=function(e){return this.data.has(e)},e.prototype.get=function(e){return this.data.get(e)},e.prototype.set=function(e,t){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach(function(n,i){e.call(t,n,i)})},e.prototype.keys=function(){var e=this.data.keys();return vu?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}();function vh(e){return new vc(e)}function vd(e,t){var n;if(Object.create)n=Object.create(e);else{var i=function(){};i.prototype=e,n=new i}return t&&mH(n,t),n}function vf(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function vp(e,t){return e.hasOwnProperty(t)}function vg(){}var vm=180/Math.PI;function vv(e,t,n,i){var r=t[0],o=t[1],a=n[0],s=n[1],l=o-r,u=s-a;if(0===l)return 0===u?a:(a+s)/2;if(i){if(l>0){if(e<=r)return a;else if(e>=o)return s}else if(e>=r)return a;else if(e<=o)return s}else{if(e===r)return a;if(e===o)return s}return(e-r)/l*u+a}function vy(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return m2(e)?e.replace(/^\s+|\s+$/g,"").match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e}function vx(e,t,n){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),n?e:+e}function vb(e){return e.sort(function(e,t){return e-t}),e}function vw(e){if(isNaN(e*=1))return 0;if(e>1e-14){for(var t,n,i,r,o,a=1,s=0;s<15;s++,a*=10)if(Math.round(e*a)/a===e)return s}return i=(n=(t=e.toString().toLowerCase()).indexOf("e"))>0?+t.slice(n+1):0,r=n>0?n:t.length,Math.max(0,((o=t.indexOf("."))<0?0:r-1-o)-i)}function vS(e,t){var n=Math.log,i=Math.LN10,r=Math.min(Math.max(-Math.floor(n(e[1]-e[0])/i)+Math.round(n(Math.abs(t[1]-t[0]))/i),0),20);return isFinite(r)?r:20}function v_(e){var t=2*Math.PI;return(e%t+t)%t}function vC(e){return e>-1e-4&&e<1e-4}var vM=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function vA(e){if(e instanceof Date)return e;if(m2(e)){var t=vM.exec(e);if(!t)return new Date(NaN);if(!t[8])return new Date(+t[1],(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0);var n=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(n-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}return null==e?new Date(NaN):new Date(Math.round(e))}function vk(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}function vT(e,t){var n=vk(e),i=Math.pow(10,n),r=e/i;return e=(t?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+e.toFixed(n<0?-n:0):e}function vI(e){e.sort(function(e,t){return!function e(t,n,i){return t.interval[i]<n.interval[i]||t.interval[i]===n.interval[i]&&(t.close[i]-n.close[i]==(i?-1:1)||!i&&e(t,n,1))}(e,t,0)?1:-1});for(var t=-1/0,n=1,i=0;i<e.length;){for(var r=e[i].interval,o=e[i].close,a=0;a<2;a++)r[a]<=t&&(r[a]=t,o[a]=a?1:1-n),t=r[a],n=o[a];r[0]===r[1]&&o[0]*o[1]!=1?e.splice(i,1):i++}return e}function vD(e){var t=parseFloat(e);return t==e&&(0!==t||!m2(e)||0>=e.indexOf("x"))?t:NaN}function vO(){return Math.round(9*Math.random())}function vP(e,t){return null==e?t:null==t?e:e*t/function e(t,n){return 0===n?t:e(n,t%n)}(e,t)}var vR=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},vE=new function(){this.browser=new vR,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="u">typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(vE.wxa=!0,vE.touchEventsSupported=!0):"u"<typeof document&&"u">typeof self?vE.worker=!0:"u"<typeof navigator||0===navigator.userAgent.indexOf("Node.js")?(vE.node=!0,vE.svgSupported=!0):(o=navigator.userAgent,s=(a=vE).browser,l=o.match(/Firefox\/([\d.]+)/),u=o.match(/MSIE\s([\d.]+)/)||o.match(/Trident\/.+?rv:(([\d.]+))/),c=o.match(/Edge?\/([\d.]+)/),h=/micromessenger/i.test(o),l&&(s.firefox=!0,s.version=l[1]),u&&(s.ie=!0,s.version=u[1]),c&&(s.edge=!0,s.version=c[1],s.newEdge=+c[1].split(".")[0]>18),h&&(s.weChat=!0),a.svgSupported="u">typeof SVGRect,a.touchEventsSupported="ontouchstart"in window&&!s.ie&&!s.edge,a.pointerEventsSupported="onpointerdown"in window&&(s.edge||s.ie&&+s.version>=11),a.domSupported="u">typeof document,d=document.documentElement.style,a.transform3dSupported=(s.ie&&"transition"in d||s.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in d)&&!("OTransition"in d),a.transformSupported=a.transform3dSupported||s.ie&&+s.version>=9);var vL="series\0",vN="\0_ec_\0";function vB(e){return e instanceof Array?e:null==e?[]:[e]}function vF(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var i=0,r=n.length;i<r;i++){var o=n[i];!e.emphasis[t].hasOwnProperty(o)&&e[t].hasOwnProperty(o)&&(e.emphasis[t][o]=e[t][o])}}}var vz=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function vV(e){return!m4(e)||m0(e)||e instanceof Date?e:e.value}function vj(e,t,n){var i=vW(t[e],null),r=vW(n[e],null);return null!=i&&null!=r&&i===r}function vH(e){return vW(e,"")}function vW(e,t){return null==e?t:m2(e)?e:m3(e)||m5(e)?e+"":t}function vG(e){var t=e.name;return!!(t&&t.indexOf(vL))}function v$(e){return e&&null!=e.id&&0===vH(e.id).indexOf(vN)}function vU(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?m0(t.dataIndex)?mY(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?m0(t.name)?mY(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function vq(){var e="__ec_inner_"+vY++;return function(t){return t[e]||(t[e]={})}}var vY=vO();function vZ(e,t,n){var i=vX(t,n),r=i.mainTypeSpecified,o=i.queryOptionMap,a=i.others,s=n?n.defaultMainType:null;return!r&&s&&o.set(s,{}),o.each(function(t,i){var r=vJ(e,i,t,{useDefault:s===i,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[i+"Models"]=r.models,a[i+"Model"]=r.models[0]}),a}function vX(e,t){if(m2(e)){var n,i={};i[e+"Index"]=0,n=i}else n=e;var r=vh(),o={},a=!1;return mq(n,function(e,n){if("dataIndex"===n||"dataIndexInside"===n){o[n]=e;return}var i=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=i[1],l=(i[2]||"").toLowerCase();!s||!l||t&&t.includeMainTypes&&0>mG(t.includeMainTypes,s)||(a=a||!!s,(r.get(s)||r.set(s,{}))[l]=e)}),{mainTypeSpecified:a,queryOptionMap:r,others:o}}var vK={useDefault:!0,enableAll:!1,enableNone:!1},vQ={useDefault:!1,enableAll:!0,enableNone:!0};function vJ(e,t,n,i){i=i||vK;var r=n.index,o=n.id,a=n.name,s={models:null,specified:null!=r||null!=o||null!=a};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=e.getComponent(t))?[l]:[],s}return"none"===r||!1===r?(vo(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[]):("all"===r&&(vo(i.enableAll,'`"all"` is not a valid value on index option.'),r=o=a=null),s.models=e.queryComponents({mainType:t,index:r,id:o,name:a})),s}function v0(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function v1(e,t,n,i,r){var o=null==t||"auto"===t;if(null==i)return i;if(m3(i)){var a,s=(i-(a=n||0))*r+a;return vx(s,o?Math.max(vw(n||0),vw(i)):t)}if(m2(i))return r<1?n:i;for(var l=[],u=Math.max(n?n.length:0,i.length),c=0;c<u;++c){var h=e.getDimensionInfo(c);if(h&&"ordinal"===h.type)l[c]=(r<1&&n?n:i)[c];else{var d=n&&n[c]?n[c]:0,f=i[c],s=(f-d)*r+d;l[c]=vx(s,o?Math.max(vw(d),vw(f)):t)}}return l}var v2=vh(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),v5="original",v3="arrayRows",v4="objectRows",v6="keyedColumns",v8="typedArray",v9="unknown",v7="column",ye=vq();function yt(e,t,n){var i,r,o={},a=yi(t);if(!a||!e)return o;var s=[],l=[],u=ye(t.ecModel).datasetMap,c=a.uid+"_"+n.seriesLayoutBy;mq(e=e.slice(),function(t,n){var a=m4(t)?t:e[n]={name:t};"ordinal"===a.type&&null==i&&(i=n,r=f(a)),o[a.name]=[]});var h=u.get(c)||u.set(c,{categoryWayDim:r,valueWayDim:0});function d(e,t,n){for(var i=0;i<n;i++)e.push(t+i)}function f(e){var t=e.dimsDef;return t?t.length:1}return mq(e,function(e,t){var n=e.name,r=f(e);if(null==i){var a=h.valueWayDim;d(o[n],a,r),d(l,a,r),h.valueWayDim+=r}else if(i===t)d(o[n],0,r),d(s,0,r);else{var a=h.categoryWayDim;d(o[n],a,r),d(l,a,r),h.categoryWayDim+=r}}),s.length&&(o.itemName=s),l.length&&(o.seriesName=l),o}function yn(e,t,n){var i,r={};if(!yi(e))return r;var o=t.sourceFormat,a=t.dimensionsDefine;(o===v4||o===v6)&&mq(a,function(e,t){(m4(e)?e.name:e)==="name"&&(i=t)});var s=function(){for(var e={},r={},s=[],l=0,u=Math.min(5,n);l<u;l++){var c=yo(t.data,o,t.seriesLayoutBy,a,t.startIndex,l);s.push(c);var h=3===c;if(h&&null==e.v&&l!==i&&(e.v=l),null!=e.n&&e.n!==e.v&&(h||3!==s[e.n])||(e.n=l),d(e)&&3!==s[e.n])return e;h||(2===c&&null==r.v&&l!==i&&(r.v=l),(null==r.n||r.n===r.v)&&(r.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(r)?r:null}();if(s){r.value=[s.v];var l=null!=i?i:s.n;r.itemName=[l],r.seriesName=[l]}return r}function yi(e){if(!e.get("data",!0))return vJ(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},vK).models[0]}function yr(e,t){return yo(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function yo(e,t,n,i,r,o){var a,s,l;if(m8(e))return 3;if(i){var u=i[o];m4(u)?(s=u.name,l=u.type):m2(u)&&(s=u)}if(null!=l)return"ordinal"===l?1:3;if(t===v3)if("row"===n){for(var c=e[o],h=0;h<(c||[]).length&&h<5;h++)if(null!=(a=g(c[r+h])))return a}else for(var h=0;h<e.length&&h<5;h++){var d=e[r+h];if(d&&null!=(a=g(d[o])))return a}else if(t===v4){if(!s)return 3;for(var h=0;h<e.length&&h<5;h++){var f=e[h];if(f&&null!=(a=g(f[s])))return a}}else if(t===v6){if(!s)return 3;var c=e[s];if(!c||m8(c))return 3;for(var h=0;h<c.length&&h<5;h++)if(null!=(a=g(c[h])))return a}else if(t===v5)for(var h=0;h<e.length&&h<5;h++){var f=e[h],p=vV(f);if(!m0(p))return 3;if(null!=(a=g(p[o])))return a}function g(e){var t=m2(e);return null!=e&&isFinite(e)&&""!==e?t?2:3:t&&"-"!==e?1:void 0}return 3}var ya=function(e){this.data=e.data||(e.sourceFormat===v6?{}:[]),this.sourceFormat=e.sourceFormat||v9,this.seriesLayoutBy=e.seriesLayoutBy||v7,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var i=t[n];null==i.type&&1===yr(this,n)&&(i.type="ordinal")}};function ys(e){return e instanceof ya}function yl(e,t,n){n=n||yc(e);var i=t.seriesLayoutBy,r=function(e,t,n,i,r){if(!e)return{dimensionsDefine:yh(r),startIndex:a,dimensionsDetectedCount:o};if(t===v3){var o,a;"auto"===i||null==i?yd(function(e){null!=e&&"-"!==e&&(m2(e)?null==a&&(a=1):a=0)},n,e,10):a=m3(i)?i:+!!i,r||1!==a||(r=[],yd(function(e,t){r[t]=null!=e?e+"":""},n,e,1/0)),o=r?r.length:"row"===n?e.length:e[0]?e[0].length:null}else if(t===v4)r||(r=function(e){for(var t,n=0;n<e.length&&!(t=e[n++]););if(t)return mK(t)}(e));else if(t===v6)r||(r=[],mq(e,function(e,t){r.push(t)}));else if(t===v5){var s=vV(e[0]);o=m0(s)&&s.length||1}return{startIndex:a,dimensionsDefine:yh(r),dimensionsDetectedCount:o}}(e,n,i,t.sourceHeader,t.dimensions);return new ya({data:e,sourceFormat:n,seriesLayoutBy:i,dimensionsDefine:r.dimensionsDefine,startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount,metaRawOption:mV(t)})}function yu(e){return new ya({data:e,sourceFormat:m8(e)?v8:v5})}function yc(e){var t=v9;if(m8(e))t=v8;else if(m0(e)){0===e.length&&(t=v3);for(var n=0,i=e.length;n<i;n++){var r=e[n];if(null!=r){if(m0(r)||m8(r)){t=v3;break}else if(m4(r)){t=v4;break}}}}else if(m4(e)){for(var o in e)if(vp(e,o)&&mU(e[o])){t=v6;break}}return t}function yh(e){if(e){var t=vh();return mY(e,function(e,n){var i={name:(e=m4(e)?e:{name:e}).name,displayName:e.displayName,type:e.type};if(null==i.name)return i;i.name+="",null==i.displayName&&(i.displayName=i.name);var r=t.get(i.name);return r?i.name+="-"+r.count++:t.set(i.name,{count:1}),i})}}function yd(e,t,n,i){if("row"===t)for(var r=0;r<n.length&&r<i;r++)e(n[r]?n[r][0]:null,r);else for(var o=n[0]||[],r=0;r<o.length&&r<i;r++)e(o[r],r)}function yf(e){var t=e.sourceFormat;return t===v4||t===v6}var yp=vq(),yg={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},ym=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=yx(this.source)))},e.prototype.getSourceDimensionIndex=function(e){return vt(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=yf(this.source),n=!(e>30),i="",r=[],o=0,a=0;o<e;o++){var s=void 0,l=void 0,u=void 0,c=this.dimensions[a];if(c&&c.storeDimIndex===o)s=t?c.name:null,l=c.type,u=c.ordinalMeta,a++;else{var h=this.getSourceDimension(o);h&&(s=t?h.name:null,l=h.type)}r.push({property:s,type:l,ordinalMeta:u}),!t||null==s||c&&c.isCalculationCoord||(i+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),i+="$",i+=yg[l]||"f",u&&(i+=u.uid),i+="$"}var d=this.source;return{dimensions:r,hash:[d.seriesLayoutBy,d.startIndex,i].join("$$")}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var i=void 0,r=this.dimensions[n];if(r&&r.storeDimIndex===t)r.isCalculationCoord||(i=r.name),n++;else{var o=this.getSourceDimension(t);o&&(i=o.name)}e.push(i)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}();function yv(e){return e instanceof ym}function yy(e){for(var t=vh(),n=0;n<(e||[]).length;n++){var i=e[n],r=m4(i)?i.name:i;null!=r&&null==t.get(r)&&t.set(r,n)}return t}function yx(e){var t=yp(e);return t.dimNameMap||(t.dimNameMap=yy(e.dimensionsDefine))}function yb(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function yw(e,t){return yb(e,t)?e.getCalculationInfo("stackResultDimension"):t}function yS(){var e=vq();return function(t){var n=e(t),i=t.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!!(i&&i.large),s=n.progressiveRender=!!(i&&i.progressiveRender);return(r!==a||o!==s)&&"reset"}}var y_="u">typeof Float32Array,yC=y_?Float32Array:Array;function yM(e){return m0(e)?y_?new Float32Array(e):e:new yC(e)}var yA="__ec_stack_";function yk(e){return e.get("stack")||yA+e.seriesIndex}function yT(e){return e.dim+e.index}function yI(e,t){var n=[];return t.eachSeriesByType(e,function(e){yR(e)&&n.push(e)}),n}function yD(e){var t=function(e){var t={};mq(e,function(e){var n=e.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=e.getData(),r=n.dim+"_"+n.index,o=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s<l;++s){var u=a.get(o,s);t[r]?t[r].push(u):t[r]=[u]}});var n={};for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(r){r.sort(function(e,t){return e-t});for(var o=null,a=1;a<r.length;++a){var s=r[a]-r[a-1];s>0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}(e),n=[];return mq(e,function(e){var i,r=e.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var a=t[r.dim+"_"+r.index],s=Math.abs(o[1]-o[0]),l=r.scale.getExtent(),u=Math.abs(l[1]-l[0]);i=a?s/u*a:s}else{var c=e.getData();i=Math.abs(o[1]-o[0])/c.count()}var h=vy(e.get("barWidth"),i),d=vy(e.get("barMaxWidth"),i),f=vy(e.get("barMinWidth")||(yE(e)?.5:1),i),p=e.get("barGap"),g=e.get("barCategoryGap");n.push({bandWidth:i,barWidth:h,barMaxWidth:d,barMinWidth:f,barGap:p,barCategoryGap:g,axisKey:yT(r),stackId:yk(e)})}),yO(n)}function yO(e){var t={};mq(e,function(e,n){var i=e.axisKey,r=e.bandWidth,o=t[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;t[i]=o;var s=e.stackId;!a[s]&&o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var u=e.barMaxWidth;u&&(a[s].maxWidth=u);var c=e.barMinWidth;c&&(a[s].minWidth=c);var h=e.barGap;null!=h&&(o.gap=h);var d=e.barCategoryGap;null!=d&&(o.categoryGap=d)});var n={};return mq(t,function(e,t){n[t]={};var i,r=e.stacks,o=e.bandWidth,a=e.categoryGap;null==a&&(a=Math.max(35-4*mK(r).length,15)+"%");var s=vy(a,o),l=vy(e.gap,1),u=e.remainedWidth,c=e.autoWidthCount,h=(u-s)/(c+(c-1)*l);h=Math.max(h,0),mq(r,function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){var i=e.width;t&&(i=Math.min(i,t)),n&&(i=Math.max(i,n)),e.width=i,u-=i+l*i,c--}else{var i=h;t&&t<i&&(i=Math.min(t,u)),n&&n>i&&(i=n),i!==h&&(e.width=i,u-=i+l*i,c--)}}),h=Math.max(h=(u-s)/(c+(c-1)*l),0);var d=0;mq(r,function(e,t){e.width||(e.width=h),i=e,d+=e.width*(1+l)}),i&&(d-=i.width*l);var f=-d/2;mq(r,function(e,i){n[t][i]=n[t][i]||{bandWidth:o,offset:f,width:e.width},f+=e.width*(1+l)})}),n}function yP(e,t){var n=yI(e,t),i=yD(n);mq(n,function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),r=yk(e),o=i[yT(n)][r],a=o.offset,s=o.width;t.setLayout({bandWidth:o.bandWidth,offset:a,size:s})})}function yR(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function yE(e){return e.pipelineContext&&e.pipelineContext.large}var yL={average:function(e){for(var t=0,n=0,i=0;i<e.length;i++)!isNaN(e[i])&&(t+=e[i],n++);return 0===n?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},minmax:function(e){for(var t=-1/0,n=-1/0,i=0;i<e.length;i++){var r=e[i],o=Math.abs(r);o>t&&(t=o,n=r)}return isFinite(n)?n:NaN},nearest:function(e){return e[0]}},yN=function(e){return Math.round(e.length/2)};function yB(e){return{seriesType:e,reset:function(e,t,n){var i=e.getData(),r=e.get("sampling"),o=e.coordinateSystem,a=i.count();if(a>10&&"cartesian2d"===o.type&&r){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),c=n.getDevicePixelRatio(),h=Math.round(a/(Math.abs(u[1]-u[0])*(c||1)));if(isFinite(h)&&h>1){"lttb"===r&&e.setData(i.lttbDownSample(i.mapDimension(l.dim),1/h));var d=void 0;m2(r)?d=yL[r]:m1(r)&&(d=r),d&&e.setData(i.downSample(i.mapDimension(l.dim),1/h,d,yN))}}}}}var yF=function(e,t){return(yF=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function yz(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}yF(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var yV="___EC__COMPONENT__CONTAINER___",yj="___EC__EXTENDED_CLASS___";function yH(e){var t={main:"",sub:""};if(e){var n=e.split(".");t.main=n[0]||"",t.sub=n[1]||""}return t}function yW(e,t){e.$constructor=e,e.extend=function(e){var t,n,i=this;if(m1(t=i)&&/^class\s/.test(Function.prototype.toString.call(t)))n=function(e){function t(){return e.apply(this,arguments)||this}return yz(t,e),t}(i);else{var r=n=function(){(e.$constructor||i).apply(this,arguments)},o=r.prototype;function a(){}for(var s in a.prototype=this.prototype,r.prototype=new a,o)o.hasOwnProperty(s)&&(r.prototype[s]=o[s]);r.prototype.constructor=r,r.superClass=this}return mH(n.prototype,e),n[yj]=!0,n.extend=this.extend,n.superCall=yU,n.superApply=yq,n.superClass=i,n}}function yG(e,t){e.extend=t.extend}var y$=Math.round(10*Math.random());function yU(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return this.superClass.prototype[t].apply(e,n)}function yq(e,t,n){return this.superClass.prototype[t].apply(e,n)}function yY(e){var t={};e.registerClass=function(e){var n=e.type||e.prototype.type;if(n){vo(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n),'componentType "'+n+'" illegal'),e.prototype.type=n;var i,r,o=yH(n);o.sub?o.sub!==yV&&(((r=t[(i=o).main])&&r[yV]||((r=t[i.main]={})[yV]=!0),r)[o.sub]=e):t[o.main]=e}return e},e.getClass=function(e,n,i){var r=t[e];if(r&&r[yV]&&(r=n?r[n]:null),i&&!r)throw Error(n?"Component "+e+"."+(n||"")+" is used but not imported.":e+".type should be specified.");return r},e.getClassesByMainType=function(e){var n=yH(e),i=[],r=t[n.main];return r&&r[yV]?mq(r,function(e,t){t!==yV&&i.push(e)}):i.push(r),i},e.hasClass=function(e){return!!t[yH(e).main]},e.getAllClassMainTypes=function(){var e=[];return mq(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[yH(e).main];return n&&n[yV]}}function yZ(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t=t||!1,function(n,i,r){for(var o={},a=0;a<e.length;a++){var s=e[a][1];if(!(i&&mG(i,s)>=0||r&&0>mG(r,s))){var l=n.getShallow(s,t);null!=l&&(o[e[a][0]]=l)}}return o}}var yX=yZ([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),yK=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return yX(this,e,t)},e}(),yQ=function(e,t){return(yQ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function yJ(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}yQ(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var y0=function(e){this.value=e},y1=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new y0(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),y2=function(){function e(e){this._list=new y1,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,i=this._map,r=null;if(null==i[e]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=t:a=new y0(t),a.key=e,n.insertEntry(a),i[e]=a}return r},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(null!=t)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),y5=new y2(50);function y3(e,t,n,i,r){if(!e)return t;if("string"!=typeof e)return e;if(t&&t.__zrImageSrc===e||!n)return t;var o=y5.get(e),a={hostEl:n,cb:i,cbPayload:r};return o?y6(t=o.image)||o.pending.push(a):((t=mA.loadImage(e,y4,y4)).__zrImageSrc=e,y5.put(e,t.__cachedImgObj={image:t,pending:[a]})),t}function y4(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],i=n.cb;i&&i(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function y6(e){return e&&e.width&&e.height}function y8(){return[1,0,0,1,0,0]}function y9(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function y7(e,t,n){var i=t[0]*n[0]+t[2]*n[1],r=t[1]*n[0]+t[3]*n[1],o=t[0]*n[2]+t[2]*n[3],a=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],l=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=i,e[1]=r,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e}function xe(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function xt(e,t,n,i){void 0===i&&(i=[0,0]);var r=t[0],o=t[2],a=t[4],s=t[1],l=t[3],u=t[5],c=Math.sin(n),h=Math.cos(n);return e[0]=r*h+s*c,e[1]=-r*c+s*h,e[2]=o*h+l*c,e[3]=-o*c+h*l,e[4]=h*(a-i[0])+c*(u-i[1])+i[0],e[5]=h*(u-i[1])-c*(a-i[0])+i[1],e}function xn(e,t){var n=t[0],i=t[2],r=t[4],o=t[1],a=t[3],s=t[5],l=n*a-o*i;return l?(l=1/l,e[0]=a*l,e[1]=-o*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-a*r)*l,e[5]=(o*r-n*s)*l,e):null}let xi=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},e.lerp=function(e,t,n,i){var r=1-i;e.x=r*t.x+i*n.x,e.y=r*t.y+i*n.y},e}();var xr=Math.min,xo=Math.max,xa=new xi,xs=new xi,xl=new xi,xu=new xi,xc=new xi,xh=new xi;let xd=function(){function e(e,t,n,i){n<0&&(e+=n,n=-n),i<0&&(t+=i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return e.prototype.union=function(e){var t=xr(e.x,this.x),n=xr(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=xo(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=xo(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t,n,i,r=e.width/this.width,o=e.height/this.height,a=y8();return xe(a,a,[-this.x,-this.y]),n=(t=[r,o])[0],i=t[1],a[0]=a[0]*n,a[1]=a[1]*i,a[2]=a[2]*n,a[3]=a[3]*i,a[4]=a[4]*n,a[5]=a[5]*i,xe(a,a,[e.x,e.y]),a},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this.x,r=this.x+this.width,o=this.y,a=this.y+this.height,s=t.x,l=t.x+t.width,u=t.y,c=t.y+t.height,h=!(r<s||l<i||a<u||c<o);if(n){var d=1/0,f=0,p=Math.abs(r-s),g=Math.abs(l-i),m=Math.abs(a-u),v=Math.abs(c-o),y=Math.min(p,g),x=Math.min(m,v);r<s||l<i?y>f&&(f=y,p<g?xi.set(xh,-p,0):xi.set(xh,g,0)):y<d&&(d=y,p<g?xi.set(xc,p,0):xi.set(xc,-g,0)),a<u||c<o?x>f&&(f=x,m<v?xi.set(xh,0,-m):xi.set(xh,0,v)):y<d&&(d=y,m<v?xi.set(xc,0,m):xi.set(xc,0,-v))}return n&&xi.copy(n,h?xc:xh),h},e.prototype.contain=function(e,t){return e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return 0===this.width||0===this.height},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,i){if(!i){t!==n&&e.copy(t,n);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];t.x=n.x*r+a,t.y=n.y*o+s,t.width=n.width*r,t.height=n.height*o,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}xa.x=xl.x=n.x,xa.y=xu.y=n.y,xs.x=xu.x=n.x+n.width,xs.y=xl.y=n.y+n.height,xa.transform(i),xu.transform(i),xs.transform(i),xl.transform(i),t.x=xr(xa.x,xs.x,xl.x,xu.x),t.y=xr(xa.y,xs.y,xl.y,xu.y);var l=xo(xa.x,xs.x,xl.x,xu.x),u=xo(xa.y,xs.y,xl.y,xu.y);t.width=l-t.x,t.height=u-t.y},e}();var xf={};function xp(e,t){var n=xf[t=t||mC];n||(n=xf[t]=new y2(500));var i=n.get(e);return null==i&&(i=mA.measureText(e,t).width,n.put(e,i)),i}function xg(e,t,n,i){var r=xp(e,t),o=xx(t);return new xd(xv(0,r,n),xy(0,o,i),r,o)}function xm(e,t,n,i){var r=((e||"")+"").split("\n");if(1===r.length)return xg(r[0],t,n,i);for(var o=new xd(0,0,0,0),a=0;a<r.length;a++){var s=xg(r[a],t,n,i);0===a?o.copy(s):o.union(s)}return o}function xv(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function xy(e,t,n){return"middle"===n?e-=t/2:"bottom"===n&&(e-=t),e}function xx(e){return xp("国",e)}function xb(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function xw(e,t,n){var i=t.position||"inside",r=null!=t.distance?t.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,c="left",h="top";if(i instanceof Array)l+=xb(i[0],n.width),u+=xb(i[1],n.height),c=null,h=null;else switch(i){case"left":l-=r,u+=s,c="right",h="middle";break;case"right":l+=r+a,u+=s,h="middle";break;case"top":l+=a/2,u-=r,c="center",h="bottom";break;case"bottom":l+=a/2,u+=o+r,c="center";break;case"inside":l+=a/2,u+=s,c="center",h="middle";break;case"insideLeft":l+=r,u+=s,h="middle";break;case"insideRight":l+=a-r,u+=s,c="right",h="middle";break;case"insideTop":l+=a/2,u+=r,c="center";break;case"insideBottom":l+=a/2,u+=o-r,c="center",h="bottom";break;case"insideTopLeft":l+=r,u+=r;break;case"insideTopRight":l+=a-r,u+=r,c="right";break;case"insideBottomLeft":l+=r,u+=o-r,h="bottom";break;case"insideBottomRight":l+=a-r,u+=o-r,c="right",h="bottom"}return(e=e||{}).x=l,e.y=u,e.align=c,e.verticalAlign=h,e}var xS=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function x_(e,t,n,i){var r=mH({},i=i||{});r.font=t,n=vt(n,"..."),r.maxIterations=vt(i.maxIterations,2);var o=r.minChar=vt(i.minChar,0);r.cnCharWidth=xp("国",t);var a=r.ascCharWidth=xp("a",t);r.placeholder=vt(i.placeholder,"");for(var s=e=Math.max(0,e-1),l=0;l<o&&s>=a;l++)s-=a;var u=xp(n,t);return u>s&&(n="",u=0),s=e-u,r.ellipsis=n,r.ellipsisWidth=u,r.contentWidth=s,r.containerWidth=e,r}function xC(e,t){var n=t.containerWidth,i=t.font,r=t.contentWidth;if(!n)return"";var o=xp(e,i);if(o<=n)return e;for(var a=0;;a++){if(o<=r||a>=t.maxIterations){e+=t.ellipsis;break}var s=0===a?function(e,t,n,i){for(var r=0,o=0,a=e.length;o<a&&r<t;o++){var s=e.charCodeAt(o);r+=0<=s&&s<=127?n:i}return o}(e,r,t.ascCharWidth,t.cnCharWidth):o>0?Math.floor(e.length*r/o):0;o=xp(e=e.substr(0,s),i)}return""===e&&(e=t.placeholder),e}var xM=function(){},xA=function(e){this.tokens=[],e&&(this.tokens=e)},xk=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function xT(e,t,n,i,r){var o,a,s=""===t,l=r&&n.rich[r]||{},u=e.lines,c=l.font||n.font,h=!1;if(i){var d=l.padding,f=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var p=xb(l.width,i.width)+f;u.length>0&&p+i.accumWidth>i.width&&(o=t.split("\n"),h=!0),i.accumWidth=p}else{var g=xD(t,c,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+f,a=g.linesWidths,o=g.lines}}else o=t.split("\n");for(var m=0;m<o.length;m++){var v=o[m],y=new xM;if(y.styleName=r,y.text=v,y.isLineHolder=!v&&!s,"number"==typeof l.width?y.width=l.width:y.width=a?a[m]:xp(v,c),m||h)u.push(new xA([y]));else{var x=(u[u.length-1]||(u[0]=new xA)).tokens,b=x.length;1===b&&x[0].isLineHolder?x[0]=y:(v||!b||s)&&x.push(y)}}}var xI=mZ(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function xD(e,t,n,i,r){for(var o=[],a=[],s="",l="",u=0,c=0,h=0;h<e.length;h++){var d=e.charAt(h);if("\n"===d){l&&(s+=l,c+=u),o.push(s),a.push(c),s="",l="",u=0,c=0;continue}var f=xp(d,t),p=!i&&!function(e){var t;return(!((t=e.charCodeAt(0))>=32)||!(t<=591))&&(!(t>=880)||!(t<=4351))&&(!(t>=4608)||!(t<=5119))&&(!(t>=7680)||!(t<=8303))||!!xI[e]}(d);if(o.length?c+f>n:r+c+f>n){c?(s||l)&&(p?(s||(s=l,l="",c=u=0),o.push(s),a.push(c-u),l+=d,u+=f,s="",c=u):(l&&(s+=l,l="",u=0),o.push(s),a.push(c),s=d,c=f)):p?(o.push(l),a.push(u),l=d,u=f):(o.push(d),a.push(f));continue}c+=f,p?(l+=d,u+=f):(l&&(s+=l,l="",u=0),s+=d)}return o.length||s||(s=e,l="",u=0),l&&(s+=l),s&&(o.push(s),a.push(c)),1===o.length&&(c+=r),{accumWidth:c,lines:o,linesWidths:a}}function xO(e,t){return null==e&&(e=0),null==t&&(t=0),[e,t]}function xP(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function xR(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function xE(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function xL(e,t){var n,i=Math.sqrt((n=t)[0]*n[0]+n[1]*n[1]);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e}function xN(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var xB=function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])};function xF(e,t,n,i){return e[0]=t[0]+i*(n[0]-t[0]),e[1]=t[1]+i*(n[1]-t[1]),e}function xz(e,t,n){var i=t[0],r=t[1];return e[0]=n[0]*i+n[2]*r+n[4],e[1]=n[1]*i+n[3]*r+n[5],e}function xV(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function xj(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}function xH(e){return e>5e-5||e<-5e-5}var xW=[],xG=[],x$=y8(),xU=Math.abs,xq=function(){var e;function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return xH(this.rotation)||xH(this.x)||xH(this.y)||xH(this.scaleX-1)||xH(this.scaleY-1)||xH(this.skewX)||xH(this.skewY)},t.prototype.updateTransform=function(){var e,t=this.parent&&this.parent.transform,n=this.needLocalTransform(),i=this.transform;if(!(n||t)){i&&(y9(i),this.invTransform=null);return}i=i||y8(),n?this.getLocalTransform(i):y9(i),t&&(n?y7(i,t,i):((e=i)[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5])),this.transform=i,this._resolveGlobalScaleRatio(i)},t.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(null!=t&&1!==t){this.getGlobalScale(xW);var n=xW[0]<0?-1:1,i=xW[1]<0?-1:1,r=((xW[0]-n)*t+n)/xW[0]||0,o=((xW[1]-i)*t+i)/xW[1]||0;e[0]*=r,e[1]*=r,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||y8(),xn(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),r=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(r),t=Math.sqrt(t),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||y8(),y7(xG,e.invTransform,t),t=xG);var n=this.originX,i=this.originY;(n||i)&&(x$[4]=n,x$[5]=i,y7(xG,t,x$),xG[4]-=n,xG[5]-=i,t=xG),this.setLocalTransform(t)}},t.prototype.getGlobalScale=function(e){var t=this.transform;return(e=e||[],t)?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1])):(e[0]=1,e[1]=1),e},t.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&xz(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&xz(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&xU(e[0]-1)>1e-10&&xU(e[3]-1)>1e-10?Math.sqrt(xU(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){for(var t=this,n=e,i=0;i<xY.length;i++){var r=xY[i];t[r]=n[r]}},t.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,i=e.originY||0,r=e.scaleX,o=e.scaleY,a=e.anchorX,s=e.anchorY,l=e.rotation||0,u=e.x,c=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||i||a||s){var f=n+a,p=i+s;t[4]=-f*r-h*p*o,t[5]=-p*o-d*f*r}else t[4]=t[5]=0;return t[0]=r,t[3]=o,t[1]=d*r,t[2]=h*o,l&&xt(t,t,l),t[4]+=n+u,t[5]+=i+c,t},t.initDefaultProps=void((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0),t}(),xY=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"],xZ={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin(2*Math.PI*(e-t)/.4)))},elasticOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin(2*Math.PI*(e-t)/.4)+1)},elasticInOut:function(e){var t,n=.1;return 0===e?0:1===e?1:(!n||n<1?(n=1,t=.1):t=.4*Math.asin(1/n)/(2*Math.PI),(e*=2)<1)?-.5*(n*Math.pow(2,10*(e-=1))*Math.sin(2*Math.PI*(e-t)/.4)):n*Math.pow(2,-10*(e-=1))*Math.sin(2*Math.PI*(e-t)/.4)*.5+1},backIn:function(e){return e*e*(2.70158*e-1.70158)},backOut:function(e){return--e*e*(2.70158*e+1.70158)+1},backInOut:function(e){return(e*=2)<1?e*e*(3.5949095*e-2.5949095)*.5:.5*((e-=2)*e*(3.5949095*e+2.5949095)+2)},bounceIn:function(e){return 1-xZ.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*xZ.bounceIn(2*e):.5*xZ.bounceOut(2*e-1)+.5}},xX=Math.pow,xK=Math.sqrt,xQ=xK(3),xJ=1/3,x0=xO(),x1=xO(),x2=xO();function x5(e){return e>-1e-8&&e<1e-8}function x3(e){return e>1e-8||e<-1e-8}function x4(e,t,n,i,r){var o=1-r;return o*o*(o*e+3*r*t)+r*r*(r*i+3*o*n)}function x6(e,t,n,i,r){var o=1-r;return 3*(((t-e)*o+2*(n-t)*r)*o+(i-n)*r*r)}function x8(e,t,n,i,r,o){var a=i+3*(t-n)-e,s=3*(n-2*t+e),l=3*(t-e),u=e-r,c=s*s-3*a*l,h=s*l-9*a*u,d=l*l-3*s*u,f=0;if(x5(c)&&x5(h))if(x5(s))o[0]=0;else{var p=-l/s;p>=0&&p<=1&&(o[f++]=p)}else{var g=h*h-4*c*d;if(x5(g)){var m=h/c,p=-s/a+m,v=-m/2;p>=0&&p<=1&&(o[f++]=p),v>=0&&v<=1&&(o[f++]=v)}else if(g>0){var y=xK(g),x=c*s+1.5*a*(-h+y),b=c*s+1.5*a*(-h-y),p=(-s-((x=x<0?-xX(-x,xJ):xX(x,xJ))+(b=b<0?-xX(-b,xJ):xX(b,xJ))))/(3*a);p>=0&&p<=1&&(o[f++]=p)}else{var w=Math.acos((2*c*s-3*a*h)/(2*xK(c*c*c)))/3,S=xK(c),_=Math.cos(w),p=(-s-2*S*_)/(3*a),v=(-s+S*(_+xQ*Math.sin(w)))/(3*a),C=(-s+S*(_-xQ*Math.sin(w)))/(3*a);p>=0&&p<=1&&(o[f++]=p),v>=0&&v<=1&&(o[f++]=v),C>=0&&C<=1&&(o[f++]=C)}}return f}function x9(e,t,n,i,r){var o=6*n-12*t+6*e,a=9*t+3*i-3*e-9*n,s=3*t-3*e,l=0;if(x5(a)){if(x3(o)){var u=-s/o;u>=0&&u<=1&&(r[l++]=u)}}else{var c=o*o-4*a*s;if(x5(c))r[0]=-o/(2*a);else if(c>0){var h=xK(c),u=(-o+h)/(2*a),d=(-o-h)/(2*a);u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function x7(e,t,n,i,r,o){var a=(t-e)*r+e,s=(n-t)*r+t,l=(i-n)*r+n,u=(s-a)*r+a,c=(l-s)*r+s,h=(c-u)*r+u;o[0]=e,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=i}function be(e,t,n,i){var r=1-i;return r*(r*e+2*i*t)+i*i*n}function bt(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function bn(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function bi(e,t,n,i,r){var o=(t-e)*i+e,a=(n-t)*i+t,s=(a-o)*i+o;r[0]=e,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=n}var br=/cubic-bezier\(([0-9,\.e ]+)\)/;function bo(e){var t=e&&br.exec(e);if(t){var n=t[1].split(","),i=+va(n[0]),r=+va(n[1]),o=+va(n[2]),a=+va(n[3]);if(isNaN(i+r+o+a))return;var s=[];return function(e){return e<=0?0:e>=1?1:x8(0,i,o,1,e,s)&&x4(0,r,a,1,s[0])}}}var ba=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||vg,this.ondestroy=e.ondestroy||vg,this.onrestart=e.onrestart||vg,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var n=this._life,i=e-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r)if(!this.loop)return!0;else this._startTime=e-i%n,this._pausedTime=0,this.onrestart();return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=m1(e)?e:xZ[e]||bo(e)},e}(),bs={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function bl(e){return(e=Math.round(e))<0?0:e>255?255:e}function bu(e){return e<0?0:e>1?1:e}function bc(e){return e.length&&"%"===e.charAt(e.length-1)?bl(parseFloat(e)/100*255):bl(parseInt(e,10))}function bh(e){return e.length&&"%"===e.charAt(e.length-1)?bu(parseFloat(e)/100):bu(parseFloat(e))}function bd(e,t,n){return(n<0?n+=1:n>1&&(n-=1),6*n<1)?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function bf(e,t,n,i,r){return e[0]=t,e[1]=n,e[2]=i,e[3]=r,e}function bp(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var bg=new y2(20),bm=null;function bv(e,t){bm&&bp(bm,t),bm=bg.put(e,bm||t.slice())}function by(e,t){if(e){t=t||[];var n=bg.get(e);if(n)return bp(t,n);var i=(e+="").replace(/ /g,"").toLowerCase();if(i in bs)return bp(t,bs[i]),bv(e,t),t;var r=i.length;if("#"===i.charAt(0)){if(4===r||5===r){var o=parseInt(i.slice(1,4),16);return o>=0&&o<=4095?(bf(t,(3840&o)>>4|(3840&o)>>8,240&o|(240&o)>>4,15&o|(15&o)<<4,5===r?parseInt(i.slice(4),16)/15:1),bv(e,t),t):void bf(t,0,0,0,1)}if(7===r||9===r){var o=parseInt(i.slice(1,7),16);return o>=0&&o<=0xffffff?(bf(t,(0xff0000&o)>>16,(65280&o)>>8,255&o,9===r?parseInt(i.slice(7),16)/255:1),bv(e,t),t):void bf(t,0,0,0,1)}return}var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===r){var l=i.substr(0,a),u=i.substr(a+1,s-(a+1)).split(","),c=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?bf(t,+u[0],+u[1],+u[2],1):bf(t,0,0,0,1);c=bh(u.pop());case"rgb":if(u.length>=3)return bf(t,bc(u[0]),bc(u[1]),bc(u[2]),3===u.length?c:bh(u[3])),bv(e,t),t;return void bf(t,0,0,0,1);case"hsla":if(4!==u.length)return void bf(t,0,0,0,1);return u[3]=bh(u[3]),bx(u,t),bv(e,t),t;case"hsl":if(3!==u.length)return void bf(t,0,0,0,1);return bx(u,t),bv(e,t),t;default:return}}bf(t,0,0,0,1)}}function bx(e,t){var n=(parseFloat(e[0])%360+360)%360/360,i=bh(e[1]),r=bh(e[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return bf(t=t||[],bl(255*bd(a,o,n+1/3)),bl(255*bd(a,o,n)),bl(255*bd(a,o,n-1/3)),1),4===e.length&&(t[3]=e[3]),t}function bb(e,t){var n=by(e);if(n){for(var i=0;i<3;i++)t<0?n[i]=n[i]*(1-t)|0:n[i]=(255-n[i])*t+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return bC(n,4===n.length?"rgba":"rgb")}}function bw(e,t,n){if(t&&t.length&&e>=0&&e<=1){n=n||[];var i,r,o,a,s=e*(t.length-1),l=Math.floor(s),u=Math.ceil(s),c=t[l],h=t[u],d=s-l;return n[0]=bl((i=c[0],i+(h[0]-i)*d)),n[1]=bl((r=c[1],r+(h[1]-r)*d)),n[2]=bl((o=c[2],o+(h[2]-o)*d)),n[3]=bu((a=c[3],a+(h[3]-a)*d)),n}}function bS(e,t,n,i){var r,o=by(e);if(e)return o=function(e){if(e){var t,n,i=e[0]/255,r=e[1]/255,o=e[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,u=(s+a)/2;if(0===l)t=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?t=d-h:r===s?t=1/3+c-d:o===s&&(t=2/3+h-c),t<0&&(t+=1),t>1&&(t-=1)}var f=[360*t,n,u];return null!=e[3]&&f.push(e[3]),f}}(o),null!=t&&(o[0]=(r=Math.round(r=t))<0?0:r>360?360:r),null!=n&&(o[1]=bh(n)),null!=i&&(o[2]=bh(i)),bC(bx(o),"rgba")}function b_(e,t){var n=by(e);if(n&&null!=t)return n[3]=bu(t),bC(n,"rgba")}function bC(e,t){if(e&&e.length){var n=e[0]+","+e[1]+","+e[2];return("rgba"===t||"hsva"===t||"hsla"===t)&&(n+=","+e[3]),t+"("+n+")"}}function bM(e,t){var n=by(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var bA=new y2(100);function bk(e){if(m2(e)){var t=bA.get(e);return t||(t=bb(e,-.1),bA.put(e,t)),t}if(m7(e)){var n=mH({},e);return n.colorStops=mY(e.colorStops,function(e){return{offset:e.offset,color:bb(e.color,-.1)}}),n}return e}vE.hasGlobalWindow&&m1(window.btoa);var bT=Array.prototype.slice;function bI(e,t,n,i){for(var r,o=t.length,a=0;a<o;a++)e[a]=(r=t[a],(n[a]-r)*i+r);return e}function bD(e,t,n,i){for(var r=t.length,o=0;o<r;o++)e[o]=t[o]+n[o]*i;return e}function bO(e,t,n,i){for(var r=t.length,o=r&&t[0].length,a=0;a<r;a++){e[a]||(e[a]=[]);for(var s=0;s<o;s++)e[a][s]=t[a][s]+n[a][s]*i}return e}function bP(e){if(mU(e)){var t=e.length;if(mU(e[0])){for(var n=[],i=0;i<t;i++)n.push(bT.call(e[i]));return n}return bT.call(e)}return e}function bR(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=null==e[3]?1:e[3],"rgba("+e.join(",")+")"}function bE(e){return 4===e||5===e}function bL(e){return 1===e||2===e}var bN=[0,0,0,0],bB=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=6,s=t;if(mU(t)){var l=mU(t&&t[0])?2:1;a=l,(1!==l||m3(t[0]))&&(2!==l||m3(t[0][0]))||(o=!0)}else if(m3(t)&&t==t)a=0;else if(m2(t))if(isNaN(+t)){var u=by(t);u&&(s=u,a=3)}else a=0;else if(m7(t)){var c=mH({},s);(c.colorStops=mY(t.colorStops,function(e){return{offset:e.offset,color:by(e.color)}}),"linear"===t.type)?a=4:"radial"===t.type&&(a=5),s=c}0===r?this.valType=a:(a!==this.valType||6===a)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:s,rawValue:t,percent:0};return n&&(h.easing=n,h.easingFunc=m1(n)?n:xZ[n]||bo(n)),i.push(h),h},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=bL(i),l=bE(i),u=0;u<r;u++){var c=n[u],h=c.value,d=o.value;c.percent=c.time/e,!a&&(s&&u!==r-1?function(e,t,n){if(e.push&&t.push){var i=e.length,r=t.length;if(i!==r)if(i>r)e.length=r;else for(var o=i;o<r;o++)e.push(1===n?t[o]:bT.call(t[o]));for(var a=e[0]&&e[0].length,o=0;o<e.length;o++)if(1===n)isNaN(e[o])&&(e[o]=t[o]);else for(var s=0;s<a;s++)isNaN(e[o][s])&&(e[o][s]=t[o][s])}}(h,d,i):l&&function(e,t){for(var n=e.length,i=t.length,r=n>i?t:e,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(n,i);s++)r.push({offset:a.offset,color:a.color.slice()})}(h.colorStops,d.colorStops))}if(!a&&5!==i&&t&&this.needsAnimate()&&t.needsAnimate()&&i===t.valType&&!t._finished){this._additiveTrack=t;for(var f=n[0].value,u=0;u<r;u++)0===i?n[u].additiveValue=n[u].value-f:3===i?n[u].additiveValue=bD([],n[u].value,f,-1):bL(i)&&(n[u].additiveValue=1===i?bD([],n[u].value,f,-1):bO([],n[u].value,f,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,i,r,o=null!=this._additiveTrack,a=o?"additiveValue":"value",s=this.valType,l=this.keyframes,u=l.length,c=this.propName,h=3===s,d=this._lastFr,f=Math.min;if(1===u)i=r=l[0];else{if(t<0)n=0;else if(t<this._lastFrP){for(n=f(d+1,u-1);n>=0&&!(l[n].percent<=t);n--);n=f(n,u-2)}else{for(n=d;n<u&&!(l[n].percent>t);n++);n=f(n-1,u-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=t;var p=r.percent-i.percent,g=0===p?1:f((t-i.percent)/p,1);r.easingFunc&&(g=r.easingFunc(g));var m=o?this._additiveValue:h?bN:e[c];if((bL(s)||h)&&!m&&(m=this._additiveValue=[]),this.discrete)e[c]=g<1?i.rawValue:r.rawValue;else if(bL(s))1===s?bI(m,i[a],r[a],g):function(e,t,n,i){for(var r=t.length,o=r&&t[0].length,a=0;a<r;a++){e[a]||(e[a]=[]);for(var s,l=0;l<o;l++)e[a][l]=(s=t[a][l],(n[a][l]-s)*i+s)}}(m,i[a],r[a],g);else if(bE(s)){var v,y,x,b,w,S=i[a],_=r[a],C=4===s;(e[c]={type:C?"linear":"radial",x:(v=S.x,(_.x-v)*g+v),y:(y=S.y,(_.y-y)*g+y),colorStops:mY(S.colorStops,function(e,t){var n,i=_.colorStops[t];return{offset:(n=e.offset,(i.offset-n)*g+n),color:bR(bI([],e.color,i.color,g))}}),global:_.global},C)?(e[c].x2=(x=S.x2,(_.x2-x)*g+x),e[c].y2=(b=S.y2,(_.y2-b)*g+b)):e[c].r=(w=S.r,(_.r-w)*g+w)}else if(h)bI(m,i[a],r[a],g),o||(e[c]=bR(m));else{var M,A=(M=i[a],(r[a]-M)*g+M);o?this._additiveValue=A:e[c]=A}o&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,i=this._additiveValue;0===t?e[n]=e[n]+i:3===t?(by(e[n],bN),bD(bN,bN,i,1),e[n]=bR(bN)):1===t?bD(e[n],e[n],i,1):2===t&&bO(e[n],e[n],i,1)},e}(),bF=function(){function e(e,t,n,i){(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i)?mz("Can' use additive animation on looped animation."):(this._additiveAnimators=i,this._allowDiscrete=n)}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,mK(t),n)},e.prototype.whenWithKeys=function(e,t,n,i){for(var r=this._tracks,o=0;o<n.length;o++){var a=n[o],s=r[a];if(!s){s=r[a]=new bB(a);var l=void 0,u=this._getAdditiveTrack(a);if(u){var c=u.keyframes,h=c[c.length-1];l=h&&h.value,3===u.valType&&l&&(l=bR(l))}else l=this._target[a];if(null==l)continue;e>0&&s.addKeyframe(0,bP(l),i),this._trackKeys.push(a)}s.addKeyframe(e,bP(t[a]),i)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var i=0;i<n.length;i++){var r=n[i].getTrack(e);r&&(t=r)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],i=this._maxTime||0,r=0;r<this._trackKeys.length;r++){var o=this._trackKeys[r],a=this._tracks[o],s=this._getAdditiveTrack(o),l=a.keyframes,u=l.length;if(a.prepare(i,s),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var c=l[u-1];c&&(t._target[a.propName]=c.rawValue),a.setFinished()}else n.push(a)}if(n.length||this._force){var h=new ba({life:i,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var i=t._additiveAnimators;if(i){for(var r=!1,o=0;o<i.length;o++)if(i[o]._clip){r=!0;break}r||(t._additiveAnimators=null)}for(var o=0;o<n.length;o++)n[o].step(t._target,e);var a=t._onframeCbs;if(a)for(var o=0;o<a.length;o++)a[o](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return mY(this._trackKeys,function(t){return e._tracks[t]})},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,i=this._trackKeys,r=0;r<e.length;r++){var o=n[e[r]];o&&!o.isFinished()&&(t?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}for(var a=!0,r=0;r<i.length;r++)if(!n[i[r]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},e.prototype.saveTo=function(e,t,n){if(e){t=t||this._trackKeys;for(var i=0;i<t.length;i++){var r=t[i],o=this._tracks[r];if(!(!o||o.isFinished())){var a=o.keyframes,s=a[n?0:a.length-1];s&&(e[r]=bP(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t=t||mK(e);for(var n=0;n<t.length;n++){var i=t[n],r=this._tracks[i];if(r){var o=r.keyframes;if(o.length>1){var a=o.pop();r.addKeyframe(a.time,e[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},e}(),bz=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,i){this._$handlers||(this._$handlers={});var r=this._$handlers;if("function"==typeof t&&(i=n,n=t,t=null),!n||!e)return this;var o=this._$eventProcessor;null!=t&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),r[e]||(r[e]=[]);for(var a=0;a<r[e].length;a++)if(r[e][a].h===n)return this;var s={h:n,query:t,ctx:i||this,callAtLast:n.zrEventfulCallAtLast},l=r[e].length-1,u=r[e][l];return u&&u.callAtLast?r[e].splice(l,0,s):r[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var i=[],r=0,o=n[e].length;r<o;r++)n[e][r].h!==t&&i.push(n[e][r]);n[e]=i}n[e]&&0===n[e].length&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[e],r=this._$eventProcessor;if(i)for(var o=t.length,a=i.length,s=0;s<a;s++){var l=i[s];if(!r||!r.filter||null==l.query||r.filter(e,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,t[0]);break;case 2:l.h.call(l.ctx,t[0],t[1]);break;default:l.h.apply(l.ctx,t)}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[e],r=this._$eventProcessor;if(i)for(var o=t.length,a=t[o-1],s=i.length,l=0;l<s;l++){var u=i[l];if(!r||!r.filter||null==u.query||r.filter(e,u.query))switch(o){case 0:u.h.call(a);break;case 1:u.h.call(a,t[0]);break;case 2:u.h.call(a,t[0],t[1]);break;default:u.h.apply(a,t.slice(1,o-1))}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e}(),bV=1;vE.hasGlobalWindow&&(bV=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var bj=bV,bH="#333",bW="#ccc",bG="__zr_normal__",b$=xY.concat(["ignore"]),bU=mZ(xY,function(e,t){return e[t]=!0,e},{ignore:!1}),bq={},bY=new xd(0,0,0,0),bZ=function(){function e(e){this.id=mF++,this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=t.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(t),null!=n.position){n.layoutRect?bY.copy(n.layoutRect):bY.copy(this.getBoundingRect()),i||bY.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(bq,n,bY):xw(bq,n,bY),r.x=bq.x,r.y=bq.y,o=bq.align,a=bq.verticalAlign;var u=n.origin;if(u&&null!=n.rotation){var c=void 0,h=void 0;"center"===u?(c=.5*bY.width,h=.5*bY.height):(c=xb(u[0],bY.width),h=xb(u[1],bY.height)),l=!0,r.originX=-r.x+c+(i?0:bY.x),r.originY=-r.y+h+(i?0:bY.y)}}null!=n.rotation&&(r.rotation=n.rotation);var d=n.offset;d&&(r.x+=d[0],r.y+=d[1],l||(r.originX=-d[0],r.originY=-d[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,p=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),g=void 0,m=void 0,v=void 0;f&&this.canBeInsideText()?(g=n.insideFill,m=n.insideStroke,(null==g||"auto"===g)&&(g=this.getInsideTextFill()),(null==m||"auto"===m)&&(m=this.getInsideTextStroke(g),v=!0)):(g=n.outsideFill,m=n.outsideStroke,(null==g||"auto"===g)&&(g=this.getOutsideFill()),(null==m||"auto"===m)&&(m=this.getOutsideStroke(g),v=!0)),((g=g||"#000")!==p.fill||m!==p.stroke||v!==p.autoStroke||o!==p.align||a!==p.verticalAlign)&&(s=!0,p.fill=g,p.stroke=m,p.autoStroke=v,p.align=o,p.verticalAlign=a,t.setDefaultTextStyle(p)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(e){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?bW:bH},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof t&&by(t);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+255*!r*(1-i);return n[3]=1,bC(n,"rgba")},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){"textConfig"===e?this.setTextConfig(t):"textContent"===e?this.setTextContent(t):"clipPath"===e?this.setClipPath(t):"extra"===e?(this.extra=this.extra||{},mH(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(m4(e))for(var n=mK(e),i=0;i<n.length;i++){var r=n[i];this.attrKV(r,e[r])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var i=this.animators[n],r=i.__fromStateTransition;if(!i.getLoop()&&(!r||r===bG)){var o=i.targetName,a=o?t[o]:t;i.saveTo(a)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,b$)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var i=0;i<n.length;i++){var r=n[i];null==e[r]||r in t||(t[r]=this[r])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(bG,!1,e)},e.prototype.useState=function(e,t,n,i){var r,o=e===bG;if(this.hasState()||!o){var a=this.currentStates,s=this.stateTransition;if(!(mG(a,e)>=0)||!t&&1!==a.length){if(this.stateProxy&&!o&&(r=this.stateProxy(e)),r||(r=this.states&&this.states[e]),!r&&!o)return void mz("State "+e+" not exists.");o||this.saveCurrentToNormalState(r);var l=!!(r&&r.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,r,this._normalState,t,!n&&!this.__inHover&&s&&s.duration>0,s);var u=this._textContent,c=this._textGuide;return u&&u.useState(e,t,n,l),c&&c.useState(e,t,n,l),o?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),r}}},e.prototype.useStates=function(e,t,n){if(e.length){var i=[],r=this.currentStates,o=e.length,a=o===r.length;if(a){for(var s=0;s<o;s++)if(e[s]!==r[s]){a=!1;break}}if(!a){for(var s=0;s<o;s++){var l=e[s],u=void 0;this.stateProxy&&(u=this.stateProxy(l,e)),u||(u=this.states[l]),u&&i.push(u)}var c=i[o-1],h=!!(c&&c.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(i),f=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!t&&!this.__inHover&&f&&f.duration>0,f);var p=this._textContent,g=this._textGuide;p&&p.useStates(e,t,h),g&&g.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}}else this.clearStates()},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=mG(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),r=mG(i,e),o=mG(i,t)>=0;r>=0?o?i.splice(r,1):i[r]=t:n&&!o&&i.push(t),this.useStates(i)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t,n={},i=0;i<e.length;i++){var r=e[i];mH(n,r),r.textConfig&&mH(t=t||{},r.textConfig)}return t&&(n.textConfig=t),n},e.prototype._applyStateObj=function(e,t,n,i,r,o){var a=!(t&&i);t&&t.textConfig?(this.textConfig=mH({},i?this.textConfig:n.textConfig),mH(this.textConfig,t.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<b$.length;u++){var c=b$[u],h=r&&bU[c];t&&null!=t[c]?h?(l=!0,s[c]=t[c]):this[c]=t[c]:a&&null!=n[c]&&(h?(l=!0,s[c]=n[c]):this[c]=n[c])}if(!r)for(var u=0;u<this.animators.length;u++){var d=this.animators[u],f=d.targetName;d.getLoop()||d.__changeFinalValue(f?(t||n)[f]:t||n)}l&&this._transitionState(e,s,o)},e.prototype._attachComponent=function(e){if((!e.__zr||e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new xq,this._attachComponent(e),this._textContent=e,this.markRedraw())},e.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),mH(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,n=this._textGuide;t&&(t.__inHover=e),n&&(n.__inHover=e)},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var i=new bF(e?this[e]:this,t,n);return e&&(i.targetName=e),this.addAnimator(i,e),i},e.prototype.addAnimator=function(e,t){var n=this.__zr,i=this;e.during(function(){i.updateDuringAnimation(t)}).done(function(){var t=i.animators,n=mG(t,e);n>=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,r=[],o=0;o<i;o++){var a=n[o];e&&e!==a.scope?r.push(a):a.stop(t)}return this.animators=r,this},e.prototype.animateTo=function(e,t,n){bX(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){bX(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,i){for(var r=bX(this,t,n,i),o=0;o<r.length;o++)r[o].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=function(){var t=e.prototype;function n(e,n,i,r){Object.defineProperty(t,e,{get:function(){return this[n]||o(this,this[n]=[]),this[n]},set:function(e){this[i]=e[0],this[r]=e[1],this[n]=e,o(this,e)}});function o(e,t){Object.defineProperty(t,0,{get:function(){return e[i]},set:function(t){e[i]=t}}),Object.defineProperty(t,1,{get:function(){return e[r]},set:function(t){e[r]=t}})}}t.type="element",t.name="",t.ignore=t.silent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=1,Object.defineProperty&&(n("position","_legacyPos","x","y"),n("scale","_legacyScale","scaleX","scaleY"),n("origin","_legacyOrigin","originX","originY"))}(),e}();function bX(e,t,n,i,r){var o=[];!function e(t,n,i,r,o,a,s,l){for(var u=mK(r),c=o.duration,h=o.delay,d=o.additive,f=o.setToFinal,p=!m4(a),g=t.animators,m=[],v=0;v<u.length;v++){var y=u[v],x=r[y];if(null!=x&&null!=i[y]&&(p||a[y]))if(!m4(x)||mU(x)||m7(x))m.push(y);else{if(n){l||(i[y]=x,t.updateDuringAnimation(n));continue}e(t,y,i[y],x,o,a&&a[y],s,l)}else l||(i[y]=x,t.updateDuringAnimation(n),m.push(y))}var b=m.length;if(!d&&b)for(var w=0;w<g.length;w++){var S=g[w];if(S.targetName===n&&S.stopTracks(m)){var _=mG(g,S);g.splice(_,1)}}if(o.force||(b=(m=mX(m,function(e){var t,n;return!((t=r[e])===(n=i[e])||mU(t)&&mU(n)&&function(e,t){var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}(t,n))})).length),b>0||o.force&&!s.length){var C=void 0,M=void 0,A=void 0;if(l){M={},f&&(C={});for(var w=0;w<b;w++){var y=m[w];M[y]=i[y],f?C[y]=r[y]:i[y]=r[y]}}else if(f){A={};for(var w=0;w<b;w++){var y=m[w];A[y]=bP(i[y]),function(e,t,n){if(mU(t[n]))if(mU(e[n])||(e[n]=[]),m8(t[n])){var i=t[n].length;e[n].length!==i&&(e[n]=new t[n].constructor(i),bK(e[n],t[n],i))}else{var r=t[n],o=e[n],a=r.length;if(mU(r[0]))for(var s=r[0].length,l=0;l<a;l++)o[l]?bK(o[l],r[l],s):o[l]=Array.prototype.slice.call(r[l]);else bK(o,r,a);o.length=r.length}else e[n]=t[n]}(i,r,y)}}var S=new bF(i,!1,!1,d?mX(g,function(e){return e.targetName===n}):null);S.targetName=n,o.scope&&(S.scope=o.scope),f&&C&&S.whenWithKeys(0,C,m),A&&S.whenWithKeys(0,A,m),S.whenWithKeys(null==c?500:c,l?M:r,m).delay(h||0),t.addAnimator(S,n),s.push(S)}}(e,"",e,t,n=n||{},i,o,r);var a=o.length,s=!1,l=n.done,u=n.aborted,c=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},h=function(){--a<=0&&(s?l&&l():u&&u())};!a&&l&&l(),o.length>0&&n.during&&o[0].during(function(e,t){n.during(t)});for(var d=0;d<o.length;d++){var f=o[d];c&&f.done(c),h&&f.aborted(h),n.force&&f.duration(n.duration),f.start(n.easing)}return o}function bK(e,t,n){for(var i=0;i<n;i++)e[i]=t[i]}m$(bZ,bz),m$(bZ,xq);var bQ="__zr_style_"+Math.round(10*Math.random()),bJ={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},b0={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};bJ[bQ]=!0;var b1=["z","z2","invisible"],b2=["invisible"],b5=function(e){var t;function n(t){return e.call(this,t)||this}return yJ(n,e),n.prototype._init=function(t){for(var n=mK(t),i=0;i<n.length;i++){var r=n[i];"style"===r?this.useStyle(t[r]):e.prototype.attrKV.call(this,r,t[r])}this.style||this.useStyle({})},n.prototype.beforeBrush=function(){},n.prototype.afterBrush=function(){},n.prototype.innerBeforeBrush=function(){},n.prototype.innerAfterBrush=function(){},n.prototype.shouldBePainted=function(e,t,n,i){var r,o,a,s=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&(r=this,o=e,a=t,b3.copy(r.getBoundingRect()),r.transform&&b3.applyTransform(r.transform),b4.width=o,b4.height=a,!b3.intersect(b4))||s&&!s[0]&&!s[3])return!1;if(n&&this.__clipPaths){for(var l=0;l<this.__clipPaths.length;++l)if(this.__clipPaths[l].isZeroArea())return!1}if(i&&this.parent)for(var u=this.parent;u;){if(u.ignore)return!1;u=u.parent}return!0},n.prototype.contain=function(e,t){return this.rectContain(e,t)},n.prototype.traverse=function(e,t){e.call(t,this)},n.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},n.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),i=this.style,r=i.shadowBlur||0,o=i.shadowOffsetX||0,a=i.shadowOffsetY||0;e=this._paintRect||(this._paintRect=new xd(0,0,0,0)),t?xd.applyTransform(e,n,t):e.copy(n),(r||o||a)&&(e.width+=2*r+Math.abs(o),e.height+=2*r+Math.abs(a),e.x=Math.min(e.x,e.x+o-r),e.y=Math.min(e.y,e.y+a-r));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+2*s),e.height=Math.ceil(e.height+1+2*s))}return e},n.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new xd(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},n.prototype.getPrevPaintRect=function(){return this._prevPaintRect},n.prototype.animateStyle=function(e){return this.animate("style",e)},n.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():this.markRedraw()},n.prototype.attrKV=function(t,n){"style"!==t?e.prototype.attrKV.call(this,t,n):this.style?this.setStyle(n):this.useStyle(n)},n.prototype.setStyle=function(e,t){return"string"==typeof e?this.style[e]=t:mH(this.style,e),this.dirtyStyle(),this},n.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},n.prototype.dirty=function(){this.dirtyStyle()},n.prototype.styleChanged=function(){return!!(2&this.__dirty)},n.prototype.styleUpdated=function(){this.__dirty&=-3},n.prototype.createStyle=function(e){return vd(bJ,e)},n.prototype.useStyle=function(e){e[bQ]||(e=this.createStyle(e)),this.__inHover?this.__hoverStyle=e:this.style=e,this.dirtyStyle()},n.prototype.isStyleObject=function(e){return e[bQ]},n.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,b1)},n.prototype._applyStateObj=function(t,n,i,r,o,a){e.prototype._applyStateObj.call(this,t,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.style?o?r?s=n.style:(s=this._mergeStyle(this.createStyle(),i.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),r?this.style:i.style),this._mergeStyle(s,n.style)):l&&(s=i.style),s)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var c=mK(u),h=0;h<c.length;h++){var d=c[h];d in s&&(s[d]=s[d],this.style[d]=u[d])}for(var f=mK(s),h=0;h<f.length;h++){var d=f[h];this.style[d]=this.style[d]}this._transitionState(t,{style:s},a,this.getAnimationStyleProps())}else this.useStyle(s);for(var p=this.__inHover?b2:b1,h=0;h<p.length;h++){var d=p[h];n&&null!=n[d]?this[d]=n[d]:l&&null!=i[d]&&(this[d]=i[d])}},n.prototype._mergeStates=function(t){for(var n,i=e.prototype._mergeStates.call(this,t),r=0;r<t.length;r++){var o=t[r];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},n.prototype._mergeStyle=function(e,t){return mH(e,t),e},n.prototype.getAnimationStyleProps=function(){return b0},n.initDefaultProps=void((t=n.prototype).type="displayable",t.invisible=!1,t.z=0,t.z2=0,t.zlevel=0,t.culling=!1,t.cursor="pointer",t.rectHover=!1,t.incremental=!1,t._rect=null,t.dirtyRectTolerance=0,t.__dirty=3),n}(bZ),b3=new xd(0,0,0,0),b4=new xd(0,0,0,0),b6=Math.min,b8=Math.max,b9=Math.sin,b7=Math.cos,we=2*Math.PI,wt=xO(),wn=xO(),wi=xO();function wr(e,t,n,i,r,o){r[0]=b6(e,n),r[1]=b6(t,i),o[0]=b8(e,n),o[1]=b8(t,i)}var wo=[],wa=[],ws={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},wl=[],wu=[],wc=[],wh=[],wd=[],wf=[],wp=Math.min,wg=Math.max,wm=Math.cos,wv=Math.sin,wy=Math.abs,wb=Math.PI,ww=2*wb,wS="u">typeof Float32Array,w_=[];function wC(e){return Math.round(e/wb*1e8)/1e8%2*wb}function wM(e,t){var n=wC(e[0]);n<0&&(n+=ww);var i=n-e[0],r=e[1];r+=i,!t&&r-n>=ww?r=n+ww:t&&n-r>=ww?r=n-ww:!t&&n>r?r=n+(ww-wC(n-r)):t&&n<r&&(r=n-(ww-wC(r-n))),e[0]=n,e[1]=r}var wA=function(){var e;function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,t,n){(n=n||0)>0&&(this._ux=wy(n/bj/e)||0,this._uy=wy(n/bj/t)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(ws.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},t.prototype.lineTo=function(e,t){var n=wy(e-this._xi),i=wy(t-this._yi),r=n>this._ux||i>this._uy;if(this.addData(ws.L,e,t),this._ctx&&r&&this._ctx.lineTo(e,t),r)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,t,n,i,r,o){return this._drawPendingPt(),this.addData(ws.C,e,t,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,t,n,i){return this._drawPendingPt(),this.addData(ws.Q,e,t,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(e,t,n,i,r,o){this._drawPendingPt(),w_[0]=i,w_[1]=r,wM(w_,o),i=w_[0];var a=(r=w_[1])-i;return this.addData(ws.A,e,t,n,n,i,a,0,+!o),this._ctx&&this._ctx.arc(e,t,n,i,r,o),this._xi=wm(r)*n+e,this._yi=wv(r)*n+t,this},t.prototype.arcTo=function(e,t,n,i,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,i,r),this},t.prototype.rect=function(e,t,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,i),this.addData(ws.R,e,t,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(ws.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&wS&&(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var t=e.length,n=0,i=this._len,r=0;r<t;r++)n+=e[r].len();wS&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+n));for(var r=0;r<t;r++)for(var o=e[r].data,a=0;a<o.length;a++)this.data[i++]=o[a];this._len=i},t.prototype.addData=function(e,t,n,i,r,o,a,s,l){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var c=0;c<arguments.length;c++)u[this._len++]=arguments[c]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,wS&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){wc[0]=wc[1]=wd[0]=wd[1]=Number.MAX_VALUE,wh[0]=wh[1]=wf[0]=wf[1]=-Number.MAX_VALUE;var e,t=this.data,n=0,i=0,r=0,o=0;for(e=0;e<this._len;){var a=t[e++],s=1===e;switch(s&&(n=t[e],i=t[e+1],r=n,o=i),a){case ws.M:n=r=t[e++],i=o=t[e++],wd[0]=r,wd[1]=o,wf[0]=r,wf[1]=o;break;case ws.L:wr(n,i,t[e],t[e+1],wd,wf),n=t[e++],i=t[e++];break;case ws.C:!function(e,t,n,i,r,o,a,s,l,u){var c=x9(e,n,r,a,wo);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var h=0;h<c;h++){var d=x4(e,n,r,a,wo[h]);l[0]=b6(d,l[0]),u[0]=b8(d,u[0])}c=x9(t,i,o,s,wa);for(var h=0;h<c;h++){var f=x4(t,i,o,s,wa[h]);l[1]=b6(f,l[1]),u[1]=b8(f,u[1])}l[0]=b6(e,l[0]),u[0]=b8(e,u[0]),l[0]=b6(a,l[0]),u[0]=b8(a,u[0]),l[1]=b6(t,l[1]),u[1]=b8(t,u[1]),l[1]=b6(s,l[1]),u[1]=b8(s,u[1])}(n,i,t[e++],t[e++],t[e++],t[e++],t[e],t[e+1],wd,wf),n=t[e++],i=t[e++];break;case ws.Q:!function(e,t,n,i,r,o,a,s){var l=b8(b6(bn(e,n,r),1),0),u=b8(b6(bn(t,i,o),1),0),c=be(e,n,r,l),h=be(t,i,o,u);a[0]=b6(e,r,c),a[1]=b6(t,o,h),s[0]=b8(e,r,c),s[1]=b8(t,o,h)}(n,i,t[e++],t[e++],t[e],t[e+1],wd,wf),n=t[e++],i=t[e++];break;case ws.A:var l=t[e++],u=t[e++],c=t[e++],h=t[e++],d=t[e++],f=t[e++]+d;e+=1;var p=!t[e++];s&&(r=wm(d)*c+l,o=wv(d)*h+u),function(e,t,n,i,r,o,a,s,l){var u=Math.abs(r-o);if(u%we<1e-4&&u>1e-4){s[0]=e-n,s[1]=t-i,l[0]=e+n,l[1]=t+i;return}if(wt[0]=b7(r)*n+e,wt[1]=b9(r)*i+t,wn[0]=b7(o)*n+e,wn[1]=b9(o)*i+t,xV(s,wt,wn),xj(l,wt,wn),(r%=we)<0&&(r+=we),(o%=we)<0&&(o+=we),r>o&&!a?o+=we:r<o&&a&&(r+=we),a){var c=o;o=r,r=c}for(var h=0;h<o;h+=Math.PI/2)h>r&&(wi[0]=b7(h)*n+e,wi[1]=b9(h)*i+t,xV(s,wi,s),xj(l,wi,l))}(l,u,c,h,d,f,p,wd,wf),n=wm(f)*c+l,i=wv(f)*h+u;break;case ws.R:wr(r=n=t[e++],o=i=t[e++],r+t[e++],o+t[e++],wd,wf);break;case ws.Z:n=r,i=o}xV(wc,wc,wd),xj(wh,wh,wf)}return 0===e&&(wc[0]=wc[1]=wh[0]=wh[1]=0),new xd(wc[0],wc[1],wh[0]-wc[0],wh[1]-wc[1])},t.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,i=this._uy,r=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,u=0,c=0,h=0;h<t;){var d=e[h++],f=1===h;f&&(r=e[h],o=e[h+1],a=r,s=o);var p=-1;switch(d){case ws.M:r=a=e[h++],o=s=e[h++];break;case ws.L:var g=e[h++],m=e[h++],v=g-r,y=m-o;(wy(v)>n||wy(y)>i||h===t-1)&&(p=Math.sqrt(v*v+y*y),r=g,o=m);break;case ws.C:var x=e[h++],b=e[h++],g=e[h++],m=e[h++],w=e[h++],S=e[h++];p=function(e,t,n,i,r,o,a,s){for(var l=e,u=t,c=0,h=1;h<=10;h++){var d=.1*h,f=x4(e,n,r,a,d),p=x4(t,i,o,s,d),g=f-l,m=p-u;c+=Math.sqrt(g*g+m*m),l=f,u=p}return c}(r,o,x,b,g,m,w,S),r=w,o=S;break;case ws.Q:var x=e[h++],b=e[h++],g=e[h++],m=e[h++];p=function(e,t,n,i,r,o){for(var a=e,s=t,l=0,u=1;u<=10;u++){var c=.1*u,h=be(e,n,r,c),d=be(t,i,o,c),f=h-a,p=d-s;l+=Math.sqrt(f*f+p*p),a=h,s=d}return l}(r,o,x,b,g,m),r=g,o=m;break;case ws.A:var _=e[h++],C=e[h++],M=e[h++],A=e[h++],k=e[h++],T=e[h++],I=T+k;h+=1,f&&(a=wm(k)*M+_,s=wv(k)*A+C),p=wg(M,A)*wp(ww,Math.abs(T)),r=wm(I)*M+_,o=wv(I)*A+C;break;case ws.R:a=r=e[h++],s=o=e[h++],p=2*e[h++]+2*e[h++];break;case ws.Z:var v=a-r,y=s-o;p=Math.sqrt(v*v+y*y),r=a,o=s}p>=0&&(l[c++]=p,u+=p)}return this._pathLen=u,u},t.prototype.rebuildPath=function(e,t){var n,i,r,o,a,s,l,u,c,h,d=this.data,f=this._ux,p=this._uy,g=this._len,m=t<1,v=0,y=0,x=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=t*this._pathLen))t:for(var b=0;b<g;){var w=d[b++],S=1===b;switch(S&&(r=d[b],o=d[b+1],n=r,i=o),w!==ws.L&&x>0&&(e.lineTo(c,h),x=0),w){case ws.M:n=r=d[b++],i=o=d[b++],e.moveTo(r,o);break;case ws.L:a=d[b++],s=d[b++];var _=wy(a-r),C=wy(s-o);if(_>f||C>p){if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;e.lineTo(r*(1-A)+a*A,o*(1-A)+s*A);break t}v+=M}e.lineTo(a,s),r=a,o=s,x=0}else{var k=_*_+C*C;k>x&&(c=a,h=s,x=k)}break;case ws.C:var T=d[b++],I=d[b++],D=d[b++],O=d[b++],P=d[b++],R=d[b++];if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;x7(r,T,D,P,A,wl),x7(o,I,O,R,A,wu),e.bezierCurveTo(wl[1],wu[1],wl[2],wu[2],wl[3],wu[3]);break t}v+=M}e.bezierCurveTo(T,I,D,O,P,R),r=P,o=R;break;case ws.Q:var T=d[b++],I=d[b++],D=d[b++],O=d[b++];if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;bi(r,T,D,A,wl),bi(o,I,O,A,wu),e.quadraticCurveTo(wl[1],wu[1],wl[2],wu[2]);break t}v+=M}e.quadraticCurveTo(T,I,D,O),r=D,o=O;break;case ws.A:var E=d[b++],L=d[b++],N=d[b++],B=d[b++],F=d[b++],z=d[b++],V=d[b++],j=!d[b++],H=N>B?N:B,W=wy(N-B)>.001,G=F+z,$=!1;if(m){var M=l[y++];v+M>u&&(G=F+z*(u-v)/M,$=!0),v+=M}if(W&&e.ellipse?e.ellipse(E,L,N,B,V,F,G,j):e.arc(E,L,H,F,G,j),$)break t;S&&(n=wm(F)*N+E,i=wv(F)*B+L),r=wm(G)*N+E,o=wv(G)*B+L;break;case ws.R:n=r=d[b],i=o=d[b+1],a=d[b++],s=d[b++];var U=d[b++],q=d[b++];if(m){var M=l[y++];if(v+M>u){var Y=u-v;e.moveTo(a,s),e.lineTo(a+wp(Y,U),s),(Y-=U)>0&&e.lineTo(a+U,s+wp(Y,q)),(Y-=q)>0&&e.lineTo(a+wg(U-Y,0),s+q),(Y-=U)>0&&e.lineTo(a,s+wg(q-Y,0));break t}v+=M}e.rect(a,s,U,q);break;case ws.Z:if(m){var M=l[y++];if(v+M>u){var A=(u-v)/M;e.lineTo(r*(1-A)+n*A,o*(1-A)+i*A);break t}v+=M}e.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=ws,t.initDefaultProps=void((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0),t}();function wk(e,t,n,i,r,o,a){if(0===r)return!1;var s=0,l=e;if(a>t+r&&a>i+r||a<t-r&&a<i-r||o>e+r&&o>n+r||o<e-r&&o<n-r)return!1;if(e===n)return Math.abs(o-e)<=r/2;s=(t-i)/(e-n);var u=s*o-a+(l=(e*i-n*t)/(e-n));return u*u/(s*s+1)<=r/2*r/2}var wT=2*Math.PI;function wI(e){return(e%=wT)<0&&(e+=wT),e}var wD=2*Math.PI;function wO(e,t,n,i,r,o){if(o>t&&o>i||o<t&&o<i||i===t)return 0;var a=(o-t)/(i-t),s=i<t?1:-1;(1===a||0===a)&&(s=i<t?.5:-.5);var l=a*(n-e)+e;return l===r?1/0:l>r?s:0}var wP=wA.CMD,wR=2*Math.PI,wE=[-1,-1,-1],wL=[-1,-1];function wN(e,t,n,i,r){for(var o,a,s=e.data,l=e.len(),u=0,c=0,h=0,d=0,f=0,p=0;p<l;){var g,m,v,y,x,b,w,S,_,C,M,A,k,T,I=s[p++],D=1===p;switch(I===wP.M&&p>1&&!n&&(u+=wO(c,h,d,f,i,r)),D&&(c=s[p],h=s[p+1],d=c,f=h),I){case wP.M:d=s[p++],f=s[p++],c=d,h=f;break;case wP.L:if(n){if(wk(c,h,s[p],s[p+1],t,i,r))return!0}else u+=wO(c,h,s[p],s[p+1],i,r)||0;c=s[p++],h=s[p++];break;case wP.C:if(n){if(g=c,m=h,v=s[p++],y=s[p++],x=s[p++],b=s[p++],w=s[p],S=s[p+1],0!==t&&(!(r>m+t)||!(r>y+t)||!(r>b+t)||!(r>S+t))&&(!(r<m-t)||!(r<y-t)||!(r<b-t)||!(r<S-t))&&(!(i>g+t)||!(i>v+t)||!(i>x+t)||!(i>w+t))&&(!(i<g-t)||!(i<v-t)||!(i<x-t)||!(i<w-t))&&function(e,t,n,i,r,o,a,s,l,u){var c,h,d,f,p,g=.005,m=1/0;x0[0]=l,x0[1]=u;for(var v=0;v<1;v+=.05)x1[0]=x4(e,n,r,a,v),x1[1]=x4(t,i,o,s,v),(f=xB(x0,x1))<m&&(c=v,m=f);m=1/0;for(var y=0;y<32&&!(g<1e-4);y++)h=c-g,d=c+g,x1[0]=x4(e,n,r,a,h),x1[1]=x4(t,i,o,s,h),f=xB(x1,x0),h>=0&&f<m?(c=h,m=f):(x2[0]=x4(e,n,r,a,d),x2[1]=x4(t,i,o,s,d),p=xB(x2,x0),d<=1&&p<m?(c=d,m=p):g*=.5);return xK(m)}(g,m,v,y,x,b,w,S,i,r)<=t/2)return!0}else u+=function(e,t,n,i,r,o,a,s,l,u){if(u>t&&u>i&&u>o&&u>s||u<t&&u<i&&u<o&&u<s)return 0;var c=x8(t,i,o,s,u,wE);if(0===c)return 0;for(var h=0,d=-1,f=void 0,p=void 0,g=0;g<c;g++){var m=wE[g],v=0===m||1===m?.5:1;x4(e,n,r,a,m)<l||(d<0&&(d=x9(t,i,o,s,wL),wL[1]<wL[0]&&d>1&&function(){var e=wL[0];wL[0]=wL[1],wL[1]=e}(),f=x4(t,i,o,s,wL[0]),d>1&&(p=x4(t,i,o,s,wL[1]))),2===d?m<wL[0]?h+=f<t?v:-v:m<wL[1]?h+=p<f?v:-v:h+=s<p?v:-v:m<wL[0]?h+=f<t?v:-v:h+=s<f?v:-v)}return h}(c,h,s[p++],s[p++],s[p++],s[p++],s[p],s[p+1],i,r)||0;c=s[p++],h=s[p++];break;case wP.Q:if(n){if(_=c,C=h,M=s[p++],A=s[p++],k=s[p],T=s[p+1],0!==t&&(!(r>C+t)||!(r>A+t)||!(r>T+t))&&(!(r<C-t)||!(r<A-t)||!(r<T-t))&&(!(i>_+t)||!(i>M+t)||!(i>k+t))&&(!(i<_-t)||!(i<M-t)||!(i<k-t))&&function(e,t,n,i,r,o,a,s){var l,u=.005,c=1/0;x0[0]=a,x0[1]=s;for(var h=0;h<1;h+=.05){x1[0]=be(e,n,r,h),x1[1]=be(t,i,o,h);var d=xB(x0,x1);d<c&&(l=h,c=d)}c=1/0;for(var f=0;f<32&&!(u<1e-4);f++){var p=l-u,g=l+u;x1[0]=be(e,n,r,p),x1[1]=be(t,i,o,p);var d=xB(x1,x0);if(p>=0&&d<c)l=p,c=d;else{x2[0]=be(e,n,r,g),x2[1]=be(t,i,o,g);var m=xB(x2,x0);g<=1&&m<c?(l=g,c=m):u*=.5}}return xK(c)}(_,C,M,A,k,T,i,r)<=t/2)return!0}else u+=function(e,t,n,i,r,o,a,s){if(s>t&&s>i&&s>o||s<t&&s<i&&s<o)return 0;var l=function(e,t,n,i,r){var o=e-2*t+n,a=2*(t-e),s=e-i,l=0;if(x5(o)){if(x3(a)){var u=-s/a;u>=0&&u<=1&&(r[l++]=u)}}else{var c=a*a-4*o*s;if(x5(c)){var u=-a/(2*o);u>=0&&u<=1&&(r[l++]=u)}else if(c>0){var h=xK(c),u=(-a+h)/(2*o),d=(-a-h)/(2*o);u>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}(t,i,o,s,wE);if(0===l)return 0;var u=bn(t,i,o);if(u>=0&&u<=1){for(var c=0,h=be(t,i,o,u),d=0;d<l;d++){var f=0===wE[d]||1===wE[d]?.5:1,p=be(e,n,r,wE[d]);p<a||(wE[d]<u?c+=h<t?f:-f:c+=o<h?f:-f)}return c}var f=0===wE[0]||1===wE[0]?.5:1,p=be(e,n,r,wE[0]);return p<a?0:o<t?f:-f}(c,h,s[p++],s[p++],s[p],s[p+1],i,r)||0;c=s[p++],h=s[p++];break;case wP.A:var O=s[p++],P=s[p++],R=s[p++],E=s[p++],L=s[p++],N=s[p++];p+=1;var B=!!(1-s[p++]);o=Math.cos(L)*R+O,a=Math.sin(L)*E+P,D?(d=o,f=a):u+=wO(c,h,o,a,i,r);var F=(i-O)*E/R+O;if(n){if(function(e,t,n,i,r,o,a,s,l){if(0===a)return!1;var u=Math.sqrt((s-=e)*s+(l-=t)*l);if(u-a>n||u+a<n)return!1;if(Math.abs(i-r)%wD<1e-4)return!0;if(o){var c=i;i=wI(r),r=wI(c)}else i=wI(i),r=wI(r);i>r&&(r+=wD);var h=Math.atan2(l,s);return h<0&&(h+=wD),h>=i&&h<=r||h+wD>=i&&h+wD<=r}(O,P,E,L,L+N,B,t,F,r))return!0}else u+=function(e,t,n,i,r,o,a,s){if((s-=t)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);wE[0]=-l,wE[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=wR-1e-4){i=0,r=wR;var c=o?1:-1;return a>=wE[0]+e&&a<=wE[1]+e?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=wR,r+=wR);for(var d=0,f=0;f<2;f++){var p=wE[f];if(p+e>a){var g=Math.atan2(s,p),c=o?1:-1;g<0&&(g=wR+g),(g>=i&&g<=r||g+wR>=i&&g+wR<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(c=-c),d+=c)}}return d}(O,P,E,L,L+N,B,F,r);c=Math.cos(L+N)*R+O,h=Math.sin(L+N)*E+P;break;case wP.R:d=c=s[p++],f=h=s[p++];var z=s[p++],V=s[p++];if(o=d+z,a=f+V,n){if(wk(d,f,o,f,t,i,r)||wk(o,f,o,a,t,i,r)||wk(o,a,d,a,t,i,r)||wk(d,a,d,f,t,i,r))return!0}else u+=wO(o,f,o,a,i,r),u+=wO(d,a,d,f,i,r);break;case wP.Z:if(n){if(wk(c,h,d,f,t,i,r))return!0}else u+=wO(c,h,d,f,i,r);c=d,h=f}}return n||1e-4>Math.abs(h-f)||(u+=wO(c,h,d,f,i,r)||0),0!==u}var wB=mW({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},bJ),wF={style:mW({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},b0.style)},wz=xY.concat(["invisible","culling","z","z2","zlevel","parent"]);let wV=function(e){var t;function n(t){return e.call(this,t)||this}return yJ(n,e),n.prototype.update=function(){var t=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new n;r.buildPath===n.prototype.buildPath&&(r.buildPath=function(e){t.buildPath(e,t.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s<wz.length;++s)r[wz[s]]=this[wz[s]];r.__dirty|=1}else this._decalEl&&(this._decalEl=null)},n.prototype.getDecalElement=function(){return this._decalEl},n.prototype._init=function(t){var n=mK(t);this.shape=this.getDefaultShape();var i=this.getDefaultStyle();i&&this.useStyle(i);for(var r=0;r<n.length;r++){var o=n[r],a=t[o];"style"===o?this.style?mH(this.style,a):this.useStyle(a):"shape"===o?mH(this.shape,a):e.prototype.attrKV.call(this,o,a)}this.style||this.useStyle({})},n.prototype.getDefaultStyle=function(){return null},n.prototype.getDefaultShape=function(){return{}},n.prototype.canBeInsideText=function(){return this.hasFill()},n.prototype.getInsideTextFill=function(){var e=this.style.fill;if("none"!==e){if(m2(e)){var t=bM(e,0);return t>.5?bH:t>.2?"#eee":bW}else if(e)return bW}return bH},n.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(m2(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==.4>bM(e,0))return t}},n.prototype.buildPath=function(e,t,n){},n.prototype.pathUpdated=function(){this.__dirty&=-5},n.prototype.getUpdatedPathProxy=function(e){return this.path||this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},n.prototype.createPathProxy=function(){this.path=new wA(!1)},n.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0},n.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},n.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||4&this.__dirty)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),e=r.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){o.copy(e);var a=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return e},n.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect(),r=this.style;if(e=n[0],t=n[1],i.contain(e,t)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),wN(o,a/s,!0,e,t)))return!0}if(this.hasFill())return wN(o,0,!1,e,t)}return!1},n.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},n.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},n.prototype.animateShape=function(e){return this.animate("shape",e)},n.prototype.updateDuringAnimation=function(e){"style"===e?this.dirtyStyle():"shape"===e?this.dirtyShape():this.markRedraw()},n.prototype.attrKV=function(t,n){"shape"===t?this.setShape(n):e.prototype.attrKV.call(this,t,n)},n.prototype.setShape=function(e,t){var n=this.shape;return n||(n=this.shape={}),"string"==typeof e?n[e]=t:mH(n,e),this.dirtyShape(),this},n.prototype.shapeChanged=function(){return!!(4&this.__dirty)},n.prototype.createStyle=function(e){return vd(wB,e)},n.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=mH({},this.shape))},n.prototype._applyStateObj=function(t,n,i,r,o,a){e.prototype._applyStateObj.call(this,t,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=mH({},i.shape),mH(s,n.shape)):(s=mH({},r?this.shape:i.shape),mH(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=mH({},this.shape);for(var u={},c=mK(s),h=0;h<c.length;h++){var d=c[h];"object"==typeof s[d]?this.shape[d]=s[d]:u[d]=s[d]}this._transitionState(t,{shape:u},a)}else this.shape=s,this.dirtyShape()},n.prototype._mergeStates=function(t){for(var n,i=e.prototype._mergeStates.call(this,t),r=0;r<t.length;r++){var o=t[r];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(i.shape=n),i},n.prototype.getAnimationStyleProps=function(){return wF},n.prototype.isZeroArea=function(){return!1},n.extend=function(e){var t=function(t){function n(n){var i=t.call(this,n)||this;return e.init&&e.init.call(i,n),i}return yJ(n,t),n.prototype.getDefaultStyle=function(){return mV(e.style)},n.prototype.getDefaultShape=function(){return mV(e.shape)},n}(n);for(var i in e)"function"==typeof e[i]&&(t.prototype[i]=e[i]);return t},n.initDefaultProps=void((t=n.prototype).type="path",t.strokeContainThreshold=5,t.segmentIgnoreThreshold=0,t.subPixelOptimize=!1,t.autoBatch=!1,t.__dirty=7),n}(b5);var wj=mW({strokeFirst:!0,font:mC,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},wB),wH=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yJ(t,e),t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0},t.prototype.hasFill=function(){var e=this.style.fill;return null!=e&&"none"!==e},t.prototype.createStyle=function(e){return vd(wj,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;null!=t?t+="":t="";var n=xm(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var i=e.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},t.initDefaultProps=void(t.prototype.dirtyRectTolerance=10),t}(b5);wH.prototype.type="tspan";var wW=mW({x:0,y:0},bJ),wG={style:mW({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},b0.style)},w$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yJ(t,e),t.prototype.createStyle=function(e){return vd(wW,e)},t.prototype._getSize=function(e){var t,n=this.style,i=n[e];if(null!=i)return i;var r=(t=n.image)&&"string"!=typeof t&&t.width&&t.height?n.image:this.__image;if(!r)return 0;var o="width"===e?"height":"width",a=n[o];return null==a?r[e]:r[e]/r[o]*a},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return wG},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new xd(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(b5);w$.prototype.type="image";let wU=w$;var wq=Math.round;function wY(e,t,n){if(t){var i=t.x1,r=t.x2,o=t.y1,a=t.y2;e.x1=i,e.x2=r,e.y1=o,e.y2=a;var s=n&&n.lineWidth;return s&&(wq(2*i)===wq(2*r)&&(e.x1=e.x2=wX(i,s,!0)),wq(2*o)===wq(2*a)&&(e.y1=e.y2=wX(o,s,!0))),e}}function wZ(e,t,n){if(t){var i=t.x,r=t.y,o=t.width,a=t.height;e.x=i,e.y=r,e.width=o,e.height=a;var s=n&&n.lineWidth;return s&&(e.x=wX(i,s,!0),e.y=wX(r,s,!0),e.width=Math.max(wX(i+o,s,!1)-e.x,+(0!==o)),e.height=Math.max(wX(r+a,s,!1)-e.y,+(0!==a))),e}}function wX(e,t,n){if(!t)return e;var i=wq(2*e);return(i+wq(t))%2==0?i/2:(i+(n?1:-1))/2}var wK=function(){this.x=0,this.y=0,this.width=0,this.height=0},wQ={},wJ=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultShape=function(){return new wK},t.prototype.buildPath=function(e,t){if(this.subPixelOptimize){var n,i,r,o,a,s,l,u,c,h,d,f,p,g,m,v=wZ(wQ,t,this.style);f=v.x,p=v.y,g=v.width,m=v.height,v.r=t.r,t=v}else f=t.x,p=t.y,g=t.width,m=t.height;t.r?(l=(n=t).x,u=n.y,c=n.width,h=n.height,d=n.r,c<0&&(l+=c,c=-c),h<0&&(u+=h,h=-h),"number"==typeof d?i=r=o=a=d:d instanceof Array?1===d.length?i=r=o=a=d[0]:2===d.length?(i=o=d[0],r=a=d[1]):3===d.length?(i=d[0],r=a=d[1],o=d[2]):(i=d[0],r=d[1],o=d[2],a=d[3]):i=r=o=a=0,i+r>c&&(s=i+r,i*=c/s,r*=c/s),o+a>c&&(s=o+a,o*=c/s,a*=c/s),r+o>h&&(s=r+o,r*=h/s,o*=h/s),i+a>h&&(s=i+a,i*=h/s,a*=h/s),e.moveTo(l+i,u),e.lineTo(l+c-r,u),0!==r&&e.arc(l+c-r,u+r,r,-Math.PI/2,0),e.lineTo(l+c,u+h-o),0!==o&&e.arc(l+c-o,u+h-o,o,0,Math.PI/2),e.lineTo(l+a,u+h),0!==a&&e.arc(l+a,u+h-a,a,Math.PI/2,Math.PI),e.lineTo(l,u+i),0!==i&&e.arc(l+i,u+i,i,Math.PI,1.5*Math.PI)):e.rect(f,p,g,m)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(wV);wJ.prototype.type="rect";let w0=wJ;var w1={fill:"#000"},w2={style:mW({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},b0.style)},w5=function(e){function t(t){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=w1,n.attr(t),n}return yJ(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){var e;this._childCursor=0,w9(e=this.style),mq(e.rich,w9),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new xd(0,0,0,0),t=this._children,n=[],i=null,r=0;r<t.length;r++){var o=t[r],a=o.getBoundingRect(),s=o.getLocalTransform(n);s?(e.copy(a),e.applyTransform(s),(i=i||e.clone()).union(e)):(i=i||a.clone()).union(a)}this._rect=i||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||w1},t.prototype.setTextContent=function(e){},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,i=e.rich||n&&{};return mH(e,t),n&&i?(this._mergeRich(i,n),e.rich=i):i&&(e.rich=i),e},t.prototype._mergeRich=function(e,t){for(var n=mK(t),i=0;i<n.length;i++){var r=n[i];e[r]=e[r]||{},mH(e[r],t[r])}},t.prototype.getAnimationStyleProps=function(){return w2},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return t&&t instanceof e||(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||mC,n=e.padding,i=function(e,t){null!=e&&(e+="");var n,i=t.overflow,r=t.padding,o=t.font,a=xx(o),s=vt(t.lineHeight,a),l=!!t.backgroundColor,u="truncate"===t.lineOverflow,c=t.width,h=(n=null!=c&&("break"===i||"breakAll"===i)?e?xD(e,t.font,c,"breakAll"===i,0).lines:[]:e?e.split("\n"):[]).length*s,d=vt(t.height,h);if(h>d&&u){var f=Math.floor(d/s);n=n.slice(0,f)}if(e&&"truncate"===i&&null!=c)for(var p=x_(c,o,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),g=0;g<n.length;g++)n[g]=xC(n[g],p);for(var m=d,v=0,g=0;g<n.length;g++)v=Math.max(xp(n[g],o),v);null==c&&(c=v);var y=v;return r&&(m+=r[0]+r[2],y+=r[1]+r[3],c+=r[1]+r[3]),l&&(y=c),{lines:n,height:d,outerWidth:y,outerHeight:m,lineHeight:s,calculatedLineHeight:a,contentWidth:v,contentHeight:h,width:c}}(Sn(e),e),r=Si(e),o=!!e.backgroundColor,a=i.outerHeight,s=i.outerWidth,l=i.contentWidth,u=i.lines,c=i.lineHeight,h=this._defaultStyle,d=e.x||0,f=e.y||0,p=e.align||h.align||"left",g=e.verticalAlign||h.verticalAlign||"top",m=d,v=xy(f,i.contentHeight,g);if(r||n){var y=xv(d,s,p),x=xy(f,a,g);r&&this._renderBackground(e,e,y,x,s,a)}v+=c/2,n&&(m=St(d,p,n),"top"===g?v+=n[0]:"bottom"===g&&(v-=n[2]));for(var b=0,w=!1,S=Se("fill"in e?e.fill:(w=!0,h.fill)),_=w7("stroke"in e?e.stroke:o||h.autoStroke&&!w?null:(b=2,h.stroke)),C=e.textShadowBlur>0,M=null!=e.width&&("truncate"===e.overflow||"break"===e.overflow||"breakAll"===e.overflow),A=i.calculatedLineHeight,k=0;k<u.length;k++){var T=this._getOrCreateChild(wH),I=T.createStyle();T.useStyle(I),I.text=u[k],I.x=m,I.y=v,p&&(I.textAlign=p),I.textBaseline="middle",I.opacity=e.opacity,I.strokeFirst=!0,C&&(I.shadowBlur=e.textShadowBlur||0,I.shadowColor=e.textShadowColor||"transparent",I.shadowOffsetX=e.textShadowOffsetX||0,I.shadowOffsetY=e.textShadowOffsetY||0),I.stroke=_,I.fill=S,_&&(I.lineWidth=e.lineWidth||b,I.lineDash=e.lineDash,I.lineDashOffset=e.lineDashOffset||0),I.font=t,w8(I,e),v+=c,M&&T.setBoundingRect(new xd(xv(I.x,e.width,I.textAlign),xy(I.y,A,I.textBaseline),l,A))}},t.prototype._updateRichTexts=function(){var e=this.style,t=function(e,t){var n,i=new xk;if(null!=e&&(e+=""),!e)return i;for(var r=t.width,o=t.height,a=t.overflow,s=("break"===a||"breakAll"===a)&&null!=r?{width:r,accumWidth:0,breakAll:"breakAll"===a}:null,l=xS.lastIndex=0;null!=(n=xS.exec(e));){var u=n.index;u>l&&xT(i,e.substring(l,u),t,s),xT(i,n[2],t,s,n[1]),l=xS.lastIndex}l<e.length&&xT(i,e.substring(l,e.length),t,s);var c=[],h=0,d=0,f=t.padding,p="truncate"===a,g="truncate"===t.lineOverflow;function m(e,t,n){e.width=t,e.lineHeight=n,h+=n,d=Math.max(d,t)}n:for(var v=0;v<i.lines.length;v++){for(var y=i.lines[v],x=0,b=0,w=0;w<y.tokens.length;w++){var S=y.tokens[w],_=S.styleName&&t.rich[S.styleName]||{},C=S.textPadding=_.padding,M=C?C[1]+C[3]:0,A=S.font=_.font||t.font;S.contentHeight=xx(A);var k=vt(_.height,S.contentHeight);if(S.innerHeight=k,C&&(k+=C[0]+C[2]),S.height=k,S.lineHeight=vn(_.lineHeight,t.lineHeight,k),S.align=_&&_.align||t.align,S.verticalAlign=_&&_.verticalAlign||"middle",g&&null!=o&&h+S.lineHeight>o){w>0?(y.tokens=y.tokens.slice(0,w),m(y,b,x),i.lines=i.lines.slice(0,v+1)):i.lines=i.lines.slice(0,v);break n}var T=_.width,I=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))S.percentWidth=T,c.push(S),S.contentWidth=xp(S.text,A);else{if(I){var D=_.backgroundColor,O=D&&D.image;O&&y6(O=function(e){if("string"!=typeof e)return e;var t=y5.get(e);return t&&t.image}(O))&&(S.width=Math.max(S.width,O.width*k/O.height))}var P=p&&null!=r?r-b:null;null!=P&&P<S.width?!I||P<M?(S.text="",S.width=S.contentWidth=0):(S.text=function(e,t,n,i,r){if(!t)return"";var o=(e+"").split("\n");r=x_(t,n,i,r);for(var a=0,s=o.length;a<s;a++)o[a]=xC(o[a],r);return o.join("\n")}(S.text,P-M,A,t.ellipsis,{minChar:t.truncateMinChar}),S.width=S.contentWidth=xp(S.text,A)):S.contentWidth=xp(S.text,A)}S.width+=M,b+=S.width,_&&(x=Math.max(x,S.lineHeight))}m(y,b,x)}i.outerWidth=i.width=vt(r,d),i.outerHeight=i.height=vt(o,h),i.contentHeight=h,i.contentWidth=d,f&&(i.outerWidth+=f[1]+f[3],i.outerHeight+=f[0]+f[2]);for(var v=0;v<c.length;v++){var S=c[v],R=S.percentWidth;S.width=parseInt(R,10)/100*i.width}return i}(Sn(e),e),n=t.width,i=t.outerWidth,r=t.outerHeight,o=e.padding,a=e.x||0,s=e.y||0,l=this._defaultStyle,u=e.align||l.align,c=e.verticalAlign||l.verticalAlign,h=xv(a,i,u),d=xy(s,r,c),f=h,p=d;o&&(f+=o[3],p+=o[0]);var g=f+n;Si(e)&&this._renderBackground(e,e,h,d,i,r);for(var m=!!e.backgroundColor,v=0;v<t.lines.length;v++){for(var y=t.lines[v],x=y.tokens,b=x.length,w=y.lineHeight,S=y.width,_=0,C=f,M=g,A=b-1,k=void 0;_<b&&(!(k=x[_]).align||"left"===k.align);)this._placeToken(k,e,w,p,C,"left",m),S-=k.width,C+=k.width,_++;for(;A>=0&&"right"===(k=x[A]).align;)this._placeToken(k,e,w,p,M,"right",m),S-=k.width,M-=k.width,A--;for(C+=(n-(C-f)-(g-M)-S)/2;_<=A;)k=x[_],this._placeToken(k,e,w,p,C+k.width/2,"center",m),C+=k.width,_++;p+=w}},t.prototype._placeToken=function(e,t,n,i,r,o,a){var s=t.rich[e.styleName]||{};s.text=e.text;var l=e.verticalAlign,u=i+n/2;"top"===l?u=i+e.height/2:"bottom"===l&&(u=i+n-e.height/2),!e.isLineHolder&&Si(s)&&this._renderBackground(s,t,"right"===o?r-e.width:"center"===o?r-e.width/2:r,u-e.height/2,e.width,e.height);var c=!!s.backgroundColor,h=e.textPadding;h&&(r=St(r,o,h),u-=e.height/2-h[0]-e.innerHeight/2);var d=this._getOrCreateChild(wH),f=d.createStyle();d.useStyle(f);var p=this._defaultStyle,g=!1,m=0,v=Se("fill"in s?s.fill:"fill"in t?t.fill:(g=!0,p.fill)),y=w7("stroke"in s?s.stroke:"stroke"in t?t.stroke:c||a||p.autoStroke&&!g?null:(m=2,p.stroke)),x=s.textShadowBlur>0||t.textShadowBlur>0;f.text=e.text,f.x=r,f.y=u,x&&(f.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,f.shadowColor=s.textShadowColor||t.textShadowColor||"transparent",f.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,f.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=e.font||mC,f.opacity=vn(s.opacity,t.opacity,1),w8(f,s),y&&(f.lineWidth=vn(s.lineWidth,t.lineWidth,m),f.lineDash=vt(s.lineDash,t.lineDash),f.lineDashOffset=t.lineDashOffset||0,f.stroke=y),v&&(f.fill=v);var b=e.contentWidth,w=e.contentHeight;d.setBoundingRect(new xd(xv(f.x,b,f.textAlign),xy(f.y,w,f.textBaseline),b,w))},t.prototype._renderBackground=function(e,t,n,i,r,o){var a,s,l=e.backgroundColor,u=e.borderWidth,c=e.borderColor,h=l&&l.image,d=l&&!h,f=e.borderRadius,p=this;if(d||e.lineHeight||u&&c){(a=this._getOrCreateChild(w0)).useStyle(a.createStyle()),a.style.fill=null;var g=a.shape;g.x=n,g.y=i,g.width=r,g.height=o,g.r=f,a.dirtyShape()}if(d){var m=a.style;m.fill=l||null,m.fillOpacity=vt(e.fillOpacity,1)}else if(h){(s=this._getOrCreateChild(wU)).onload=function(){p.dirtyStyle()};var v=s.style;v.image=l.image,v.x=n,v.y=i,v.width=r,v.height=o}if(u&&c){var m=a.style;m.lineWidth=u,m.stroke=c,m.strokeOpacity=vt(e.strokeOpacity,1),m.lineDash=e.borderDash,m.lineDashOffset=e.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(m.strokeFirst=!0,m.lineWidth*=2)}var y=(a||s).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=vn(e.opacity,t.opacity,1)},t.makeFont=function(e){var t,n,i="";return(null!=(t=e).fontSize||t.fontFamily||t.fontWeight)&&(i=[e.fontStyle,e.fontWeight,"string"==typeof(n=e.fontSize)&&(-1!==n.indexOf("px")||-1!==n.indexOf("rem")||-1!==n.indexOf("em"))?n:isNaN(+n)?"12px":n+"px",e.fontFamily||"sans-serif"].join(" ")),i&&va(i)||e.textFont||e.font},t}(b5),w3={left:!0,right:1,center:1},w4={top:1,bottom:1,middle:1},w6=["fontStyle","fontWeight","fontSize","fontFamily"];function w8(e,t){for(var n=0;n<w6.length;n++){var i=w6[n],r=t[i];null!=r&&(e[i]=r)}}function w9(e){if(e){e.font=w5.makeFont(e);var t=e.align;"middle"===t&&(t="center"),e.align=null==t||w3[t]?t:"left";var n=e.verticalAlign;"center"===n&&(n="middle"),e.verticalAlign=null==n||w4[n]?n:"top",e.padding&&(e.padding=vr(e.padding))}}function w7(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function Se(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function St(e,t,n){return"right"===t?e-n[1]:"center"===t?e+n[3]/2-n[1]/2:e+n[3]}function Sn(e){var t=e.text;return null!=t&&(t+=""),t}function Si(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}let Sr=w5;var So=vq(),Sa=function(e,t,n,i){if(i){var r=So(i);r.dataIndex=n,r.dataType=t,r.seriesIndex=e,r.ssrType="chart","group"===i.type&&i.traverse(function(i){var r=So(i);r.seriesIndex=e,r.dataIndex=n,r.dataType=t,r.ssrType="chart"})}},Ss=1,Sl={},Su=vq(),Sc=vq(),Sh=["emphasis","blur","select"],Sd=["normal","emphasis","blur","select"],Sf="highlight",Sp="downplay",Sg="select",Sm="unselect",Sv="toggleSelect";function Sy(e){return null!=e&&"none"!==e}function Sx(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function Sb(e){Sx(e,"emphasis",2)}function Sw(e){2===e.hoverState&&Sx(e,"normal",0)}function SS(e){Sx(e,"blur",1)}function S_(e){1===e.hoverState&&Sx(e,"normal",0)}function SC(e){e.selected=!0}function SM(e){e.selected=!1}function SA(e,t,n){t(e,n),e.isGroup&&e.traverse(function(e){t(e,n)})}function Sk(e,t){switch(t){case"emphasis":e.hoverState=2;break;case"normal":e.hoverState=0;break;case"blur":e.hoverState=1;break;case"select":e.selected=!0}}function ST(e,t){var n,i,r,o,a,s=this.states[e];if(this.style){if("emphasis"===e)return function(e,t,n){var i=t&&mG(t,"select")>=0,r=!1;if(e instanceof wV){var o=Su(e),a=i&&o.selectFill||o.normalFill,s=i&&o.selectStroke||o.normalStroke;if(Sy(a)||Sy(s)){var l=(n=n||{}).style||{};"inherit"===l.fill?(r=!0,n=mH({},n),(l=mH({},l)).fill=a):!Sy(l.fill)&&Sy(a)?(r=!0,n=mH({},n),(l=mH({},l)).fill=bk(a)):!Sy(l.stroke)&&Sy(s)&&(r||(n=mH({},n),l=mH({},l)),l.stroke=bk(s)),n.style=l}}if(n&&null==n.z2){r||(n=mH({},n));var u=e.z2EmphasisLift;n.z2=e.z2+(null!=u?u:10)}return n}(this,t,s);else if("blur"===e)return n=s,i=mG(this.currentStates,e)>=0,r=this.style.opacity,o=i?null:function(e,t,n,i){for(var r=e.style,o={},a=0;a<t.length;a++){var s=t[a],l=r[s];o[s]=null==l?i&&i[s]:l}for(var a=0;a<e.animators.length;a++){var u=e.animators[a];u.__fromStateTransition&&0>u.__fromStateTransition.indexOf(n)&&"style"===u.targetName&&u.saveTo(o,t)}return o}(this,["opacity"],e,{opacity:1}),null==(a=(n=n||{}).style||{}).opacity&&(n=mH({},n),a=mH({opacity:i?r:.1*o.opacity},a),n.style=a),n;else if("select"===e){var l=s;if(l&&null==l.z2){l=mH({},l);var u=this.z2SelectLift;l.z2=this.z2+(null!=u?u:9)}return l}}return s}function SI(e){e.stateProxy=ST;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=ST),n&&(n.stateProxy=ST)}function SD(e,t){SE(e,t)||e.__highByOuter||SA(e,Sb)}function SO(e,t){SE(e,t)||e.__highByOuter||SA(e,Sw)}function SP(e,t){e.__highByOuter|=1<<(t||0),SA(e,Sb)}function SR(e,t){(e.__highByOuter&=~(1<<(t||0)))||SA(e,Sw)}function SE(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function SL(e){var t=e.getModel(),n=[],i=[];t.eachComponent(function(t,r){var o=Sc(r),a="series"===t,s=a?e.getViewOfSeriesModel(r):e.getViewOfComponentModel(r);a||i.push(s),o.isBlured&&(s.group.traverse(function(e){S_(e)}),a&&n.push(r)),o.isBlured=!1}),mq(i,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function SN(e,t,n,i){var r=i.getModel();function o(e,t){for(var n=0;n<t.length;n++){var i=e.getItemGraphicEl(t[n]);i&&SA(i,S_)}}if((n=n||"coordinateSystem",null!=e)&&t&&"none"!==t){var a=r.getSeriesByIndex(e),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];r.eachSeries(function(e){var r=a===e,u=e.coordinateSystem;u&&u.master&&(u=u.master);var c=u&&s?u===s:r;if(!("series"===n&&!r||"coordinateSystem"===n&&!c||"series"===t&&r)){if(i.getViewOfSeriesModel(e).group.traverse(function(e){e.__highByOuter&&r&&"self"===t||SS(e)}),mU(t))o(e.getData(),t);else if(m4(t))for(var h=mK(t),d=0;d<h.length;d++)o(e.getData(h[d]),t[h[d]]);l.push(e),Sc(e).isBlured=!0}}),r.eachComponent(function(e,t){if("series"!==e){var n=i.getViewOfComponentModel(t);n&&n.toggleBlurSeries&&n.toggleBlurSeries(l,!0,r)}})}}function SB(e,t,n){if(null!=e&&null!=t){var i=n.getModel().getComponent(e,t);if(i){Sc(i).isBlured=!0;var r=n.getViewOfComponentModel(i);r&&r.focusBlurEnabled&&r.group.traverse(function(e){SS(e)})}}}function SF(e,t,n,i){var r,o={focusSelf:!1,dispatchers:null};if(null==e||"series"===e||null==t||null==n)return o;var a=i.getModel().getComponent(e,t);if(!a)return o;var s=i.getViewOfComponentModel(a);if(!s||!s.findHighDownDispatchers)return o;for(var l=s.findHighDownDispatchers(n),u=0;u<l.length;u++)if("self"===So(l[u]).focus){r=!0;break}return{focusSelf:r,dispatchers:l}}function Sz(e){mq(e.getAllData(),function(t){var n=t.data,i=t.type;n.eachItemGraphicEl(function(t,n){e.isSelected(n,i)?SA(t,SC):SA(t,SM)})})}function SV(e,t,n){var i,r,o,a;S$(e,!0),SA(e,SI),i=e,r=t,o=n,a=So(i),null!=r?(a.focus=r,a.blurScope=o):a.focus&&(a.focus=null)}function Sj(e,t,n,i){i?S$(e,!1):SV(e,t,n)}var SH=["emphasis","blur","select"],SW={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function SG(e,t,n,i){n=n||"itemStyle";for(var r=0;r<SH.length;r++){var o=SH[r],a=t.getModel([o,n]);e.ensureState(o).style=i?i(a):a[SW[n]]()}}function S$(e,t){var n=!1===t;e.highDownSilentOnTouch&&(e.__highDownSilentOnTouch=e.highDownSilentOnTouch),(!n||e.__highDownDispatcher)&&(e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!n)}function SU(e){return!!(e&&e.__highDownDispatcher)}function Sq(e){var t=e.type;return t===Sg||t===Sm||t===Sv}function SY(e){var t=e.type;return t===Sf||t===Sp}var SZ=vq();function SX(e,t,n,i,r){if(t&&t.ecModel){var o,a=t.ecModel.getUpdatePayload();o=a&&a.animation}var s=t&&t.isAnimationEnabled(),l="update"===e;if(!s)return null;var u=void 0,c=void 0,h=void 0;return i?(u=vt(i.duration,200),c=vt(i.easing,"cubicOut"),h=0):(u=t.getShallow(l?"animationDurationUpdate":"animationDuration"),c=t.getShallow(l?"animationEasingUpdate":"animationEasing"),h=t.getShallow(l?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(u=o.duration),null!=o.easing&&(c=o.easing),null!=o.delay&&(h=o.delay)),m1(h)&&(h=h(n,r)),m1(u)&&(u=u(n)),{duration:u||0,delay:h,easing:c}}function SK(e,t,n,i,r,o,a){var s,l=!1;m1(r)?(a=o,o=r,r=null):m4(r)&&(o=r.cb,a=r.during,l=r.isFrom,s=r.removeOpt,r=r.dataIndex);var u="leave"===e;u||t.stopAnimation("leave");var c=SX(e,i,r,u?s||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(t,r):null);if(c&&c.duration>0){var h={duration:c.duration,delay:c.delay||0,easing:c.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:e,during:a};l?t.animateFrom(n,h):t.animateTo(n,h)}else t.stopAnimation(),l||t.attr(n),a&&a(1),o&&o()}function SQ(e,t,n,i,r,o){SK("update",e,t,n,i,r,o)}function SJ(e,t,n,i,r,o){SK("enter",e,t,n,i,r,o)}function S0(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++)if("leave"===e.animators[t].scope)return!0;return!1}function S1(e,t,n,i,r,o){S0(e)||SK("leave",e,t,n,i,r,o)}function S2(e,t,n,i){e.removeTextContent(),e.removeTextGuideLine(),S1(e,{style:{opacity:0}},t,n,i)}function S5(e,t,n){function i(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse(function(e){e.isGroup||S2(e,t,n,i)}):S2(e,t,n,i)}function S3(e){SZ(e).oldStyle=e.style}var S4={};function S6(e,t){for(var n=0;n<Sh.length;n++){var i=Sh[n],r=t[i],o=e.ensureState(i);o.style=o.style||{},o.style.text=r}var a=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(a,!0)}function S8(e,t,n){var i,r=e.labelFetcher,o=e.labelDataIndex,a=e.labelDimIndex,s=t.normal;r&&(i=r.getFormattedLabel(o,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=m1(e.defaultText)?e.defaultText(o,e,n):e.defaultText);for(var l={normal:i},u=0;u<Sh.length;u++){var c=Sh[u],h=t[c];l[c]=vt(r?r.getFormattedLabel(o,c,null,a,h&&h.get("formatter")):null,i)}return l}function S9(e,t,n,i){n=n||S4;for(var r=e instanceof Sr,o=!1,a=0;a<Sd.length;a++){var s=t[Sd[a]];if(s&&s.getShallow("show")){o=!0;break}}var l=r?e:e.getTextContent();if(o){!r&&(l||(l=new Sr,e.setTextContent(l)),e.stateProxy&&(l.stateProxy=e.stateProxy));var u=S8(n,t),c=t.normal,h=!!c.getShallow("show"),d=_e(c,i&&i.normal,n,!1,!r);d.text=u.normal,r||e.setTextConfig(_t(c,n,!1));for(var a=0;a<Sh.length;a++){var f=Sh[a],s=t[f];if(s){var p=l.ensureState(f),g=!!vt(s.getShallow("show"),h);g!==h&&(p.ignore=!g),p.style=_e(s,i&&i[f],n,!0,!r),p.style.text=u[f],r||(e.ensureState(f).textConfig=_t(s,n,!0))}}l.silent=!!c.getShallow("silent"),null!=l.style.x&&(d.x=l.style.x),null!=l.style.y&&(d.y=l.style.y),l.ignore=!h,l.useStyle(d),l.dirty(),n.enableTextSetter&&(_s(l).setLabelText=function(e){var i=S8(n,t,e);S6(l,i)})}else l&&(l.ignore=!0);e.dirty()}function S7(e,t){t=t||"label";for(var n={normal:e.getModel(t)},i=0;i<Sh.length;i++){var r=Sh[i];n[r]=e.getModel([r,t])}return n}function _e(e,t,n,i,r){var o={};return function(e,t,n,i,r){n=n||S4;var o,a=t.ecModel,s=a&&a.option.textStyle,l=function(e){for(var t;e&&e!==e.ecModel;){var n=(e.option||S4).rich;if(n){t=t||{};for(var i=mK(n),r=0;r<i.length;r++)t[i[r]]=1}e=e.parentModel}return t}(t);if(l){for(var u in o={},l)if(l.hasOwnProperty(u)){var c=t.getModel(["rich",u]);_o(o[u]={},c,s,n,i,r,!1,!0)}}o&&(e.rich=o);var h=t.get("overflow");h&&(e.overflow=h);var d=t.get("minMargin");null!=d&&(e.margin=d),_o(e,t,s,n,i,r,!0,!1)}(o,e,n,i,r),t&&mH(o,t),o}function _t(e,t,n){t=t||{};var i,r={},o=e.getShallow("rotate"),a=vt(e.getShallow("distance"),n?null:5),s=e.getShallow("offset");return"outside"===(i=e.getShallow("position")||(n?null:"inside"))&&(i=t.defaultOutsidePosition||"top"),null!=i&&(r.position=i),null!=s&&(r.offset=s),null!=o&&(r.rotation=o*=Math.PI/180),null!=a&&(r.distance=a),r.outsideFill="inherit"===e.get("color")?t.inheritColor||null:"auto",r}var _n=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],_i=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],_r=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function _o(e,t,n,i,r,o,a,s){n=!r&&n||S4;var l=i&&i.inheritColor,u=t.getShallow("color"),c=t.getShallow("textBorderColor"),h=vt(t.getShallow("opacity"),n.opacity);("inherit"===u||"auto"===u)&&(u=l||null),("inherit"===c||"auto"===c)&&(c=l||null),o||(u=u||n.color,c=c||n.textBorderColor),null!=u&&(e.fill=u),null!=c&&(e.stroke=c);var d=vt(t.getShallow("textBorderWidth"),n.textBorderWidth);null!=d&&(e.lineWidth=d);var f=vt(t.getShallow("textBorderType"),n.textBorderType);null!=f&&(e.lineDash=f);var p=vt(t.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=p&&(e.lineDashOffset=p),r||null!=h||s||(h=i&&i.defaultOpacity),null!=h&&(e.opacity=h),r||o||null!=e.fill||!i.inheritColor||(e.fill=i.inheritColor);for(var g=0;g<_n.length;g++){var m=_n[g],v=vt(t.getShallow(m),n[m]);null!=v&&(e[m]=v)}for(var g=0;g<_i.length;g++){var m=_i[g],v=t.getShallow(m);null!=v&&(e[m]=v)}if(null==e.verticalAlign){var y=t.getShallow("baseline");null!=y&&(e.verticalAlign=y)}if(!a||!i.disableBox){for(var g=0;g<_r.length;g++){var m=_r[g],v=t.getShallow(m);null!=v&&(e[m]=v)}var x=t.getShallow("borderType");null!=x&&(e.borderDash=x),("auto"===e.backgroundColor||"inherit"===e.backgroundColor)&&l&&(e.backgroundColor=l),("auto"===e.borderColor||"inherit"===e.borderColor)&&l&&(e.borderColor=l)}}function _a(e,t){var n=t&&t.getModel("textStyle");return va([e.fontStyle||n&&n.getShallow("fontStyle")||"",e.fontWeight||n&&n.getShallow("fontWeight")||"",(e.fontSize||n&&n.getShallow("fontSize")||12)+"px",e.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var _s=vq();function _l(e,t,n,i){if(e){var r=_s(e);r.prevValue=r.value,r.value=n;var o=t.normal;r.valueAnimation=o.get("valueAnimation"),r.valueAnimation&&(r.precision=o.get("precision"),r.defaultInterpolatedText=i,r.statesModels=t)}}var _u=["textStyle","color"],_c=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],_h=new Sr,_d=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(_u):null)},e.prototype.getFont=function(){return _a({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<_c.length;n++)t[_c[n]]=this.getShallow(_c[n]);return _h.useStyle(t),_h.update(),_h.getBoundingRect()},e}(),_f=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],_p=yZ(_f),_g=function(){function e(){}return e.prototype.getLineStyle=function(e){return _p(this,e)},e}(),_m=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],_v=yZ(_m),_y=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return _v(this,e,t)},e}(),_x=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){for(var i=[],r=3;r<arguments.length;r++)i[r-3]=arguments[r]},e.prototype.mergeOption=function(e,t){mj(this.option,e,!0)},e.prototype.get=function(e,t){return null==e?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,i=null==n?n:n[e];if(null==i&&!t){var r=this.parentModel;r&&(i=r.getShallow(e))}return i},e.prototype.getModel=function(t,n){var i=null!=t,r=i?this.parsePath(t):null;return new e(i?this._doGet(r):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(r)),this.ecModel)},e.prototype.isEmpty=function(){return null==this.option},e.prototype.restoreData=function(){},e.prototype.clone=function(){return new this.constructor(mV(this.option))},e.prototype.parsePath=function(e){return"string"==typeof e?e.split("."):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!vE.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;else if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var i=0;i<e.length&&(!e[i]||null!=(n=n&&"object"==typeof n?n[e[i]]:null));i++);return null==n&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}();yW(_x),w=["__\0is_clz",y$++].join("_"),_x.prototype[w]=!0,_x.isInstance=function(e){return!!(e&&e[w])},m$(_x,_g),m$(_x,_y),m$(_x,yK),m$(_x,_d);var _b=Math.round(10*Math.random());function _w(e){return[e||"",_b++].join("_")}function _S(e,t){return mj(mj({},e,!0),t,!0)}var __=Math.log(2);function _C(e,t,n,i,r,o){var a=i+"-"+r,s=e.length;if(o.hasOwnProperty(a))return o[a];if(1===t){var l=Math.round(Math.log((1<<s)-1&~r)/__);return e[n][l]}for(var u=i|1<<n,c=n+1;i&1<<c;)c++;for(var h=0,d=0,f=0;d<s;d++){var p=1<<d;!(p&r)&&(h+=(f%2?-1:1)*e[n][d]*_C(e,t-1,c,u,r|p,o),f++)}return o[a]=h,h}function _M(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],i={},r=_C(n,8,0,0,0,i);if(0!==r){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*_C(n,7,+(0===a),1<<a,1<<s,i)/r*t[a];return function(e,t,n){var i=t*o[6]+n*o[7]+1;e[0]=(t*o[0]+n*o[1]+o[2])/i,e[1]=(t*o[3]+n*o[4]+o[5])/i}}}var _A="___zrEVENTSAVED",_k=[];function _T(e,t,n,i,r){if(t.getBoundingClientRect&&vE.domSupported&&!_I(t)){var o=t[_A]||(t[_A]={}),a=function(e,t,n){for(var i=n?"invTrans":"trans",r=t[i],o=t.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=e[u].getBoundingClientRect(),h=2*u,d=c.left,f=c.top;a.push(d,f),l=l&&o&&d===o[h]&&f===o[h+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&r?r:(t.srcCoords=a,t[i]=n?_M(s,a):_M(a,s))}(function(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var i=["left","right"],r=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=a.style,l=o%2,u=(o>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),e.appendChild(a),n.push(a)}return n}(t,o),o,r);if(a)return a(e,n,i),!0}return!1}function _I(e){return"CANVAS"===e.nodeName.toUpperCase()}var _D=/([&<>"'])/g,_O={"&":"&","<":"<",">":">",'"':""","'":"'"};function _P(e){return null==e?"":(e+"").replace(_D,function(e,t){return _O[t]})}var _R={},_E={},_L=vE.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||"EN").toUpperCase().indexOf("ZH")>-1?"ZH":"EN";function _N(e,t){_E[e=e.toUpperCase()]=new _x(t),_R[e]=t}_N("EN",{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),_N("ZH",{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var _B={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},_F="{yyyy}-{MM}-{dd}",_z={year:"{yyyy}",month:"{yyyy}-{MM}",day:_F,hour:_F+" "+_B.hour,minute:_F+" "+_B.minute,second:_F+" "+_B.second,millisecond:_B.none},_V=["year","month","day","hour","minute","second","millisecond"],_j=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function _H(e,t){return e+="","0000".substr(0,t-e.length)+e}function _W(e){switch(e){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return e}}function _G(e,t,n,i){var r=vA(e),o=r[_q(n)](),a=r[_Y(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[_Z(n)](),u=r["get"+(n?"UTC":"")+"Day"](),c=r[_X(n)](),h=(c-1)%12+1,d=r[_K(n)](),f=r[_Q(n)](),p=r[_J(n)](),g=(i instanceof _x?i:_E[i||_L]||_E.EN).getModel("time"),m=g.get("month"),v=g.get("monthAbbr"),y=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(t||"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,_H(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[a-1]).replace(/{MMM}/g,v[a-1]).replace(/{MM}/g,_H(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,_H(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,_H(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,_H(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,_H(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,_H(f,2)).replace(/{s}/g,f+"").replace(/{SSS}/g,_H(p,3)).replace(/{S}/g,p+"")}function _$(e,t){var n=vA(e),i=n[_Y(t)]()+1,r=n[_Z(t)](),o=n[_X(t)](),a=n[_K(t)](),s=n[_Q(t)](),l=0===n[_J(t)](),u=l&&0===s,c=u&&0===a,h=c&&0===o,d=h&&1===r;if(d&&1===i)return"year";if(d)return"month";if(h)return"day";if(c)return"hour";if(u)return"minute";else if(l)return"second";else return"millisecond"}function _U(e,t,n){var i=m3(e)?vA(e):e;switch(t=t||_$(e,n)){case"year":return i[_q(n)]();case"half-year":return+(i[_Y(n)]()>=6);case"quarter":return Math.floor((i[_Y(n)]()+1)/4);case"month":return i[_Y(n)]();case"day":return i[_Z(n)]();case"half-day":return i[_X(n)]()/24;case"hour":return i[_X(n)]();case"minute":return i[_K(n)]();case"second":return i[_Q(n)]();case"millisecond":return i[_J(n)]()}}function _q(e){return e?"getUTCFullYear":"getFullYear"}function _Y(e){return e?"getUTCMonth":"getMonth"}function _Z(e){return e?"getUTCDate":"getDate"}function _X(e){return e?"getUTCHours":"getHours"}function _K(e){return e?"getUTCMinutes":"getMinutes"}function _Q(e){return e?"getUTCSeconds":"getSeconds"}function _J(e){return e?"getUTCMilliseconds":"getMilliseconds"}function _0(e){return e?"setUTCMonth":"setMonth"}function _1(e){return e?"setUTCDate":"setDate"}function _2(e){return e?"setUTCHours":"setHours"}function _5(e){return e?"setUTCMinutes":"setMinutes"}function _3(e){return e?"setUTCSeconds":"setSeconds"}function _4(e){return e?"setUTCMilliseconds":"setMilliseconds"}function _6(e){if(isNaN(vD(e)))return m2(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function _8(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}function _9(e,t,n){function i(e){return e&&va(e)?e:"-"}function r(e){return!!(null!=e&&!isNaN(e)&&isFinite(e))}var o="time"===t,a=e instanceof Date;if(o||a){var s=o?vA(e):e;if(!isNaN(+s))return _G(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===t)return m5(e)?i(e):m3(e)&&r(e)?e+"":"-";var l=vD(e);return r(l)?_6(l):m5(e)?i(e):"boolean"==typeof e?e+"":"-"}var _7=["a","b","c","d","e","f","g"],Ce=function(e,t){return"{"+e+(null==t?"":t)+"}"};function Ct(e,t,n){m0(t)||(t=[t]);var i=t.length;if(!i)return"";for(var r=t[0].$vars||[],o=0;o<r.length;o++){var a=_7[o];e=e.replace(Ce(a),Ce(a,0))}for(var s=0;s<i;s++)for(var l=0;l<r.length;l++){var u=t[s][r[l]];e=e.replace(Ce(_7[l],s),n?_P(u):u)}return e}function Cn(e,t){return t=t||"transparent",m2(e)?e:m4(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function Ci(e,t){if("_blank"===t||"blank"===t){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var Cr=["left","right","top","bottom","width","height"],Co=[["width","left","right"],["height","top","bottom"]];function Ca(e,t,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;t.eachChild(function(l,u){var c,h,d=l.getBoundingRect(),f=t.childAt(u+1),p=f&&f.getBoundingRect();if("horizontal"===e){var g=d.width+(p?-p.x+d.x:0);(c=o+g)>i||l.newline?(o=0,c=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(p?-p.y+d.y:0);(h=a+m)>r||l.newline?(o+=s+n,a=0,h=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===e?o=c+n:a=h+n)})}function Cs(e,t,n){n=vr(n||0);var i=t.width,r=t.height,o=vy(e.left,i),a=vy(e.top,r),s=vy(e.right,i),l=vy(e.bottom,r),u=vy(e.width,i),c=vy(e.height,r),h=n[2]+n[0],d=n[1]+n[3],f=e.aspect;switch(isNaN(u)&&(u=i-s-d-o),isNaN(c)&&(c=r-l-h-a),null!=f&&(isNaN(u)&&isNaN(c)&&(f>i/r?u=.8*i:c=.8*r),isNaN(u)&&(u=f*c),isNaN(c)&&(c=u/f)),isNaN(o)&&(o=i-s-u-d),isNaN(a)&&(a=r-l-c-h),e.left||e.right){case"center":o=i/2-u/2-n[3];break;case"right":o=i-u-d}switch(e.top||e.bottom){case"middle":case"center":a=r/2-c/2-n[0];break;case"bottom":a=r-c-h}o=o||0,a=a||0,isNaN(u)&&(u=i-d-o-(s||0)),isNaN(c)&&(c=r-h-a-(l||0));var p=new xd(o+n[3],a+n[0],u,c);return p.margin=n,p}function Cl(e,t,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],u=r&&r.boundingMode||"all";if((o=o||e).x=e.x,o.y=e.y,!s&&!l)return!1;if("raw"===u)a="group"===e.type?new xd(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(a=e.getBoundingRect(),e.needLocalTransform()){var c=e.getLocalTransform();(a=a.clone()).applyTransform(c)}var h=Cs(mW({width:a.width,height:a.height},t),n,i),d=s?h.x-a.x:0,f=l?h.y-a.y:0;return"raw"===u?(o.x=d,o.y=f):(o.x+=d,o.y+=f),o===e&&e.markRedraw(),!0}function Cu(e){var t=e.layoutMode||e.constructor.layoutMode;return m4(t)?t:t?{type:t}:null}function Cc(e,t,n){var i=n&&n.ignoreSize;m0(i)||(i=[i,i]);var r=a(Co[0],0),o=a(Co[1],1);function a(n,r){var o={},a=0,u={},c=0;if(mq(n,function(t){u[t]=e[t]}),mq(n,function(e){s(t,e)&&(o[e]=u[e]=t[e]),l(o,e)&&a++,l(u,e)&&c++}),i[r])return l(t,n[1])?u[n[2]]=null:l(t,n[2])&&(u[n[1]]=null),u;if(2===c||!a)return u;if(a>=2)return o;for(var h=0;h<n.length;h++){var d=n[h];if(!s(o,d)&&s(e,d)){o[d]=e[d];break}}return o}function s(e,t){return e.hasOwnProperty(t)}function l(e,t){return null!=e[t]&&"auto"!==e[t]}function u(e,t,n){mq(e,function(e){t[e]=n[e]})}u(Co[0],e,r),u(Co[1],e,o)}function Ch(e){var t,n;return t={},(n=e)&&t&&mq(Cr,function(e){n.hasOwnProperty(e)&&(t[e]=n[e])}),t}mJ(Ca,"vertical"),mJ(Ca,"horizontal");var Cd=vq(),Cf=function(e){var t;function n(t,n,i){var r=e.call(this,t,n,i)||this;return r.uid=_w("ec_cpt_model"),r}return yz(n,e),n.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},n.prototype.mergeDefaultAndTheme=function(e,t){var n=Cu(this),i=n?Ch(e):{};mj(e,t.getTheme().get(this.mainType)),mj(e,this.getDefaultOption()),n&&Cc(e,i,n)},n.prototype.mergeOption=function(e,t){mj(this.option,e,!0);var n=Cu(this);n&&Cc(this.option,e,n)},n.prototype.optionUpdated=function(e,t){},n.prototype.getDefaultOption=function(){var e=this.constructor;if(!(e&&e[yj]))return e.defaultOption;var t=Cd(this);if(!t.defaultOption){for(var n=[],i=e;i;){var r=i.prototype.defaultOption;r&&n.push(r),i=i.superClass}for(var o={},a=n.length-1;a>=0;a--)o=mj(o,n[a],!0);t.defaultOption=o}return t.defaultOption},n.prototype.getReferringComponents=function(e,t){return vJ(this.ecModel,e,{index:this.get(e+"Index",!0),id:this.get(e+"Id",!0)},t)},n.prototype.getBoxLayoutParams=function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(e){this.option.zlevel=e},n.protoInitialize=void((t=n.prototype).type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0),n}(_x);yG(Cf,_x),yY(Cf),S={},Cf.registerSubTypeDefaulter=function(e,t){S[yH(e).main]=t},Cf.determineSubType=function(e,t){var n=t.type;if(!n){var i=yH(e).main;Cf.hasSubTypes(e)&&S[i]&&(n=S[i](t))}return n};var Cp=function(e){var t=[];return mq(Cf.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=mY(t,function(e){return yH(e).main}),"dataset"!==e&&0>=mG(t,"dataset")&&t.unshift("dataset"),t};function Cg(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}Cf.topologicalTravel=function(e,t,n,i){if(e.length){var r,o,a,s=(o={},a=[],mq(r=t,function(e){var t,n,i,s=Cg(o,e),l=(t=s.originalDeps=Cp(e),n=r,i=[],mq(t,function(e){mG(n,e)>=0&&i.push(e)}),i);s.entryCount=l.length,0===s.entryCount&&a.push(e),mq(l,function(t){0>mG(s.predecessor,t)&&s.predecessor.push(t);var n=Cg(o,t);0>mG(n.successor,t)&&n.successor.push(e)})}),{graph:o,noEntryList:a}),l=s.graph,u=s.noEntryList,c={};for(mq(e,function(e){c[e]=!0});u.length;){var h=u.pop(),d=l[h],f=!!c[h];f&&(n.call(i,h,d.originalDeps.slice()),delete c[h]),mq(d.successor,f?g:p)}mq(c,function(){throw Error("")})}function p(e){l[e].entryCount--,0===l[e].entryCount&&u.push(e)}function g(e){c[e]=!0,p(e)}};var Cm=vq();vq();var Cv=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){return function(e,t,n,i,r,o,a){var s=t(o=o||e),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(r))return u[r];var c=null!=a&&i?function(e,t){for(var n=e.length,i=0;i<n;i++)if(e[i].length>t)return e[i];return e[n-1]}(i,a):n;if((c=c||n)&&c.length){var h=c[l];return r&&(u[r]=h),s.paletteIdx=(l+1)%c.length,h}}(this,Cm,vB(this.get("color",!0)),this.get("colorLayer",!0),e,t,n)},e.prototype.clearColorPalette=function(){var e,t;e=this,(t=Cm)(e).paletteIdx=0,t(e).paletteNameMap={}},e}(),Cy=function(){var e;function t(e,t){var n=ys(e)?e:yu(e);this._source=n;var i=this._data=n.data;n.sourceFormat===v8&&(this._offset=0,this._dimSize=t,this._data=i),z(this,i,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,t){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=void((e=t.prototype).pure=!1,e.persistent=!0),t.internalField=function(){z=function(e,r,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,u=o.dimensionsDefine;mH(e,F[CM(a,s)]),a===v8?(e.getItem=t,e.count=i,e.fillStorage=n):(e.getItem=mQ(function(e,t){return Cb[CM(e,t)]}(a,s),null,r,l,u),e.count=mQ(function(e,t){return CS[CM(e,t)]}(a,s),null,r,l,u))};var e,t=function(e,t){e-=this._offset,t=t||[];for(var n=this._data,i=this._dimSize,r=i*e,o=0;o<i;o++)t[o]=n[r+o];return t},n=function(e,t,n,i){for(var r=this._data,o=this._dimSize,a=0;a<o;a++){for(var s=i[a],l=null==s[0]?1/0:s[0],u=null==s[1]?-1/0:s[1],c=t-e,h=n[a],d=0;d<c;d++){var f=r[d*o+a];h[e+d]=f,f<l&&(l=f),f>u&&(u=f)}s[0]=l,s[1]=u}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}(e={})[v3+"_"+v7]={pure:!0,appendData:r},e[v3+"_row"]={pure:!0,appendData:function(){throw Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[v4]={pure:!0,appendData:r},e[v6]={pure:!0,appendData:function(e){var t=this._data;mq(e,function(e,n){for(var i=t[n]||(t[n]=[]),r=0;r<(e||[]).length;r++)i.push(e[r])})}},e[v5]={appendData:r},e[v8]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},F=e}(),t}(),Cx=function(e,t,n,i){return e[i]},Cb=((L={})[v3+"_"+v7]=function(e,t,n,i){return e[i+t]},L[v3+"_row"]=function(e,t,n,i,r){i+=t;for(var o=r||[],a=0;a<e.length;a++){var s=e[a];o[a]=s?s[i]:null}return o},L[v4]=Cx,L[v6]=function(e,t,n,i,r){for(var o=r||[],a=0;a<n.length;a++){var s=e[n[a].name];o[a]=s?s[i]:null}return o},L[v5]=Cx,L),Cw=function(e,t,n){return e.length},CS=((N={})[v3+"_"+v7]=function(e,t,n){return Math.max(0,e.length-t)},N[v3+"_row"]=function(e,t,n){var i=e[0];return i?Math.max(0,i.length-t):0},N[v4]=Cw,N[v6]=function(e,t,n){var i=e[n[0].name];return i?i.length:0},N[v5]=Cw,N),C_=function(e,t,n){return e[t]},CC=((B={})[v3]=C_,B[v4]=function(e,t,n){return e[n]},B[v6]=C_,B[v5]=function(e,t,n){var i=vV(e);return i instanceof Array?i[t]:i},B[v8]=C_,B);function CM(e,t){return e===v3?e+"_"+t:e}function CA(e,t,n){if(e){var i=e.getRawDataItem(t);if(null!=i){var r=e.getStore(),o=r.getSource().sourceFormat;if(null!=n){var a=e.getDimensionIndex(n),s=r.getDimensionProperty(a);return CC[o](i,a,s)}var l=i;return o===v5&&(l=vV(i)),l}}}var Ck=/\{@(.+?)\}/g,CT=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),i=this.getRawValue(e,t),r=n.getRawIndex(e),o=n.getName(e),a=n.getRawDataItem(e),s=n.getItemVisual(e,"style"),l=s&&s[n.getItemVisual(e,"drawType")||"fill"],u=s&&s.stroke,c=this.mainType,h="series"===c,d=n.userOutput&&n.userOutput.get();return{componentType:c,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:r,data:a,dataType:t,value:i,color:l,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},e.prototype.getFormattedLabel=function(e,t,n,i,r,o){t=t||"normal";var a=this.getData(n),s=this.getDataParams(e,n);return(o&&(s.value=o.interpolatedValue),null!=i&&m0(s.value)&&(s.value=s.value[i]),r||(r=a.getItemModel(e).get("normal"===t?["label","formatter"]:[t,"label","formatter"])),m1(r))?(s.status=t,s.dimensionIndex=i,r(s)):m2(r)?Ct(r,s).replace(Ck,function(t,n){var i=n.length,r=n;"["===r.charAt(0)&&"]"===r.charAt(i-1)&&(r=+r.slice(1,i-1));var s=CA(a,e,r);if(o&&m0(o.interpolatedValue)){var l=a.getDimensionIndex(r);l>=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""}):void 0},e.prototype.getRawValue=function(e,t){return CA(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function CI(e){var t,n;return m4(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function CD(e){return new CO(e)}var CO=function(){function e(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t,n,i,r,o=this._upstream,a=e&&e.skip;if(this._dirty&&o){var s=this.context;s.data=s.outputData=o.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!a&&(i=this._plan(this.context));var l=((t=this._modBy)>=1||(t=1),t),u=this._modDataCount||0,c=((n=e&&e.modBy)>=1||(n=1),n),h=e&&e.modDataCount||0;(l!==c||u!==h)&&(i="reset"),(this._dirty||"reset"===i)&&(this._dirty=!1,r=this._doReset(a)),this._modBy=c,this._modDataCount=h;var d=e&&e.step;if(o?this._dueEnd=o._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(null!=d?this._dueIndex+d:1/0,this._dueEnd);if(!a&&(r||f<p)){var g=this._progress;if(m0(g))for(var m=0;m<g.length;m++)this._doProgress(g[m],f,p,c,h);else this._doProgress(g,f,p,c,h)}this._dueIndex=p;var v=null!=this._settedOutputEnd?this._settedOutputEnd:p;this._outputDueEnd=v}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,i,r){CP.reset(t,n,i,r),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:CP.next},this.context)},e.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!e&&this._reset&&((t=this._reset(this.context))&&t.progress&&(n=t.forceFirstProgress,t=t.progress),m0(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var t,n,i=this._downstream;return i&&i.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),CP=function(){var e,t,n,i,r,o={reset:function(l,u,c,h){t=l,e=u,n=c,r=Math.ceil((i=h)/n),o.next=n>1&&i>0?s:a}};return o;function a(){return t<e?t++:null}function s(){var o=t%r*n+Math.ceil(t/r),a=t>=e?null:o<i?o:t;return t++,a}}();function CR(e){throw Error(e)}function CE(e,t){var n=t&&t.type;return"ordinal"===n?e:("time"!==n||m3(e)||null==e||"-"===e||(e=+vA(e)),null==e||""===e?NaN:+e)}vh({number:function(e){return parseFloat(e)},time:function(e){return+vA(e)},trim:function(e){return m2(e)?va(e):e}});var CL={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}};(function(e,t){m3(t)||CR(""),this._opFn=CL[e],this._rvalFloat=vD(t)}).prototype.evaluate=function(e){return m3(e)?this._opFn(e,this._rvalFloat):this._opFn(vD(e),this._rvalFloat)};var CN=function(){function e(e,t){var n="desc"===e;this._resultLT=n?1:-1,null==t&&(t=n?"min":"max"),this._incomparable="min"===t?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=m3(e)?e:vD(e),i=m3(t)?t:vD(t),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=m2(e),s=m2(t);a&&(n=s?e:0),s&&(i=a?t:0)}return n<i?this._resultLT:n>i?-this._resultLT:0},e}();(function(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=vD(t)}).prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&("number"===n||"number"===this._rvalTypeof)&&(t=vD(e)===this._rvalFloat)}return this._isEQ?t:!t};var CB=function(){function e(){}return e.prototype.getRawData=function(){throw Error("not supported")},e.prototype.getRawDataItem=function(e){throw Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return CE(e,t)},e}();function CF(e){return CW(e.sourceFormat)||CR(""),e.data}function Cz(e){var t=e.sourceFormat,n=e.data;if(CW(t)||CR(""),t===v3){for(var i=[],r=0,o=n.length;r<o;r++)i.push(n[r].slice());return i}if(t===v4){for(var i=[],r=0,o=n.length;r<o;r++)i.push(mH({},n[r]));return i}}function CV(e,t,n){if(null!=n){if(m3(n)||!isNaN(n)&&!vp(t,n))return e[n];else if(vp(t,n))return t[n]}}function Cj(e){return mV(e)}var CH=vh();function CW(e){return e===v3||e===v4}var CG="undefined",C$=typeof Uint32Array===CG?Array:Uint32Array,CU=typeof Uint16Array===CG?Array:Uint16Array,Cq=typeof Int32Array===CG?Array:Int32Array,CY=typeof Float64Array===CG?Array:Float64Array,CZ={float:CY,int:Cq,ordinal:Array,number:Array,time:CY};function CX(e){return e>65535?C$:CU}function CK(){return[1/0,-1/0]}function CQ(e,t,n,i,r){var o=CZ[n||"float"];if(r){var a=e[t],s=a&&a.length;if(s!==i){for(var l=new o(i),u=0;u<s;u++)l[u]=a[u];e[t]=l}}else e[t]=new o(i)}var CJ=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=vh()}return e.prototype.initData=function(e,t,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=e.getSource(),r=this.defaultDimValueGetter=V[i.sourceFormat];this._dimValueGetter=n||r,this._rawExtent=[],yf(i),this._dimensions=mY(t,function(e){return{type:e.type,property:e.property}}),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,i=this._dimensions,r=n.get(e);if(null!=r){if(i[r].type===t)return r}else r=i.length;return i[r]={type:t},n.set(e,r),this._chunks[r]=new CZ[t||"float"](this._rawCount),this._rawExtent[r]=CK(),r},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],i=this._dimensions[e],r=this._rawExtent,o=i.ordinalOffset||0,a=n.length;0===o&&(r[e]=CK());for(var s=r[e],l=o;l<a;l++){var u=n[l]=t.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}i.ordinalMeta=t,i.ordinalOffset=a,i.type="ordinal"},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){var t=this._provider,n=this.count();t.appendData(e);var i=t.count();return t.persistent||(i+=n),n<i&&this._initDataFromProvider(n,i,!0),[n,i]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,i=this._dimensions,r=i.length,o=this._rawExtent,a=this.count(),s=a+Math.max(e.length,t||0),l=0;l<r;l++){var u=i[l];CQ(n,l,u.type,s,!0)}for(var c=[],h=a;h<s;h++)for(var d=h-a,f=0;f<r;f++){var u=i[f],p=V.arrayRows.call(this,e[d]||c,u.property,d,f);n[f][h]=p;var g=o[f];p<g[0]&&(g[0]=p),p>g[1]&&(g[1]=p)}return this._rawCount=this._count=s,{start:a,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=mY(o,function(e){return e.property}),u=0;u<a;u++){var c=o[u];s[u]||(s[u]=CK()),CQ(r,u,c.type,t,n)}if(i.fillStorage)i.fillStorage(e,t,r,s);else for(var h=[],d=e;d<t;d++){h=i.getItem(d,h);for(var f=0;f<a;f++){var p=r[f],g=this._dimValueGetter(h,l[f],d,f);p[d]=g;var m=s[f];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],i=[];if(null==t){t=e,e=[];for(var r=0;r<this._dimensions.length;r++)i.push(r)}else i=e;for(var r=0,o=i.length;r<o;r++)n.push(this.get(i[r],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=this._chunks[e],n=0;if(t)for(var i=0,r=this.count();i<r;i++){var o=this.get(e,i);isNaN(o)||(n+=o)}return n},e.prototype.getMedian=function(e){var t=[];this.each([e],function(e){isNaN(e)||t.push(e)});var n=t.sort(function(e,t){return e-t}),i=this.count();return 0===i?0:i%2==1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return -1;if(!this._indices)return e;var t=this._indices,n=t[e];if(null!=n&&n<this._count&&n===e)return e;for(var i=0,r=this._count-1;i<=r;){var o=(i+r)/2|0;if(t[o]<e)i=o+1;else{if(!(t[o]>e))return o;r=o-1}}return -1},e.prototype.indicesOfNearest=function(e,t,n){var i=this._chunks[e],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,u=this.count();l<u;l++){var c=t-i[this.getRawIndex(l)],h=Math.abs(c);h<=n&&((h<o||h===o&&c>=0&&a<0)&&(o=h,a=c,s=0),c===a&&(r[s++]=l))}return r.length=s,r},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var r=0;r<i;r++)e[r]=t[r]}else e=new n(t.buffer,0,i)}else{var n=CX(this._rawCount);e=new n(this.count());for(var r=0;r<e.length;r++)e[r]=r}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),i=n.count(),r=new(CX(n._rawCount))(i),o=[],a=e.length,s=0,l=e[0],u=n._chunks,c=0;c<i;c++){var h=void 0,d=n.getRawIndex(c);if(0===a)h=t(c);else if(1===a)h=t(u[l][d],c);else{for(var f=0;f<a;f++)o[f]=u[e[f]][d];o[f]=c,h=t.apply(null,o)}h&&(r[s++]=d)}return s<i&&(n._indices=r),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var i=mK(e),r=i.length;if(!r)return this;var o=t.count(),a=new(CX(t._rawCount))(o),s=0,l=i[0],u=e[l][0],c=e[l][1],h=t._chunks,d=!1;if(!t._indices){var f=0;if(1===r){for(var p=h[i[0]],g=0;g<n;g++){var m=p[g];(m>=u&&m<=c||isNaN(m))&&(a[s++]=f),f++}d=!0}else if(2===r){for(var p=h[i[0]],v=h[i[1]],y=e[i[1]][0],x=e[i[1]][1],g=0;g<n;g++){var m=p[g],b=v[g];(m>=u&&m<=c||isNaN(m))&&(b>=y&&b<=x||isNaN(b))&&(a[s++]=f),f++}d=!0}}if(!d)if(1===r)for(var g=0;g<o;g++){var w=t.getRawIndex(g),m=h[i[0]][w];(m>=u&&m<=c||isNaN(m))&&(a[s++]=w)}else for(var g=0;g<o;g++){for(var S=!0,w=t.getRawIndex(g),_=0;_<r;_++){var C=i[_],m=h[C][w];(m<e[C][0]||m>e[C][1])&&(S=!1)}S&&(a[s++]=t.getRawIndex(g))}return s<o&&(t._indices=a),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var i=e._chunks,r=[],o=t.length,a=e.count(),s=[],l=e._rawExtent,u=0;u<t.length;u++)l[t[u]]=CK();for(var c=0;c<a;c++){for(var h=e.getRawIndex(c),d=0;d<o;d++)s[d]=i[t[d]][h];s[o]=c;var f=n&&n.apply(null,s);if(null!=f){"object"!=typeof f&&(r[0]=f,f=r);for(var u=0;u<f.length;u++){var p=t[u],g=f[u],m=l[p],v=i[p];v&&(v[h]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},e.prototype.lttbDownSample=function(e,t){var n,i,r,o=this.clone([e],!0),a=o._chunks[e],s=this.count(),l=0,u=Math.floor(1/t),c=this.getRawIndex(0),h=new(CX(this._rawCount))(Math.min((Math.ceil(s/u)+2)*2,s));h[l++]=c;for(var d=1;d<s-1;d+=u){for(var f=Math.min(d+u,s-1),p=Math.min(d+2*u,s),g=(p+f)/2,m=0,v=f;v<p;v++){var y=this.getRawIndex(v),x=a[y];isNaN(x)||(m+=x)}m/=p-f;var b=d,w=Math.min(d+u,s),S=d-1,_=a[c];n=-1,r=b;for(var C=-1,M=0,v=b;v<w;v++){var y=this.getRawIndex(v),x=a[y];if(isNaN(x)){M++,C<0&&(C=y);continue}(i=Math.abs((S-g)*(x-_)-(S-v)*(m-_)))>n&&(n=i,r=y)}M>0&&M<w-b&&(h[l++]=Math.min(C,r),r=Math.max(C,r)),h[l++]=r,c=r}return h[l++]=this.getRawIndex(s-1),o._count=l,o._indices=h,o.getRawIndex=this._getRawIdx,o},e.prototype.downSample=function(e,t,n,i){for(var r=this.clone([e],!0),o=r._chunks,a=[],s=Math.floor(1/t),l=o[e],u=this.count(),c=r._rawExtent[e]=CK(),h=new(CX(this._rawCount))(Math.ceil(u/s)),d=0,f=0;f<u;f+=s){s>u-f&&(a.length=s=u-f);for(var p=0;p<s;p++){var g=this.getRawIndex(f+p);a[p]=l[g]}var m=n(a),v=this.getRawIndex(Math.min(f+i(a,m)||0,u-1));l[v]=m,m<c[0]&&(c[0]=m),m>c[1]&&(c[1]=m),h[d++]=v}return r._count=d,r._indices=h,r._updateGetRawIdx(),r},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,r=0,o=this.count();r<o;r++){var a=this.getRawIndex(r);switch(n){case 0:t(r);break;case 1:t(i[e[0]][a],r);break;case 2:t(i[e[0]][a],i[e[1]][a],r);break;default:for(var s=0,l=[];s<n;s++)l[s]=i[e[s]][a];l[s]=r,t.apply(null,l)}}},e.prototype.getDataExtent=function(e){var t,n=this._chunks[e],i=CK();if(!n)return i;var r=this.count();if(!this._indices)return this._rawExtent[e].slice();if(t=this._extent[e])return t.slice();for(var o=(t=i)[0],a=t[1],s=0;s<r;s++){var l=n[this.getRawIndex(s)];l<o&&(o=l),l>a&&(a=l)}return t=[o,a],this._extent[e]=t,t},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,r=0;r<i.length;r++)n.push(i[r][t]);return n},e.prototype.clone=function(t,n){var i=new e,r=this._chunks,o=t&&mZ(t,function(e,t){return e[t]=!0,e},{});if(o)for(var a=0;a<r.length;a++)i._chunks[a]=o[a]?function(e){var t=e.constructor;return t===Array?e.slice():new t(e)}(r[a]):r[a];else i._chunks=r;return this._copyCommonProps(i),n||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=mV(this._extent),e._rawExtent=mV(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var i=0;i<n;i++)t[i]=this._indices[i]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,i){return CE(e[i],this._dimensions[i])}V={arrayRows:e,objectRows:function(e,t,n,i){return CE(e[t],this._dimensions[i])},keyedColumns:e,original:function(e,t,n,i){var r=e&&(null==e.value?e:e.value);return CE(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(e,t,n,i){return e[i]}}}(),e}(),C0=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e,t,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(C2(n)){var o=void 0,a=void 0,s=void 0;if(r){var l=i[0];l.prepareSource(),o=(s=l.getSource()).data,a=s.sourceFormat,t=[l._getVersionSign()]}else a=m8(o=n.get("data",!0))?v8:v5,t=[];var u=this._getSourceMetaRawOption()||{},c=s&&s.metaRawOption||{},h=vt(u.seriesLayoutBy,c.seriesLayoutBy)||null,d=vt(u.sourceHeader,c.sourceHeader),f=vt(u.dimensions,c.dimensions);e=h!==c.seriesLayoutBy||!!d!=!!c.sourceHeader||f?[yl(o,{seriesLayoutBy:h,sourceHeader:d,dimensions:f},a)]:[]}else if(r){var p=this._applyTransform(i);e=p.sourceList,t=p.upstreamSignList}else e=[yl(n.get("source",!0),this._getSourceMetaRawOption(),null)],t=[];this._setLocalSource(e,t)},e.prototype._applyTransform=function(e){var t,n,i=this._sourceHost,r=i.get("transform",!0),o=i.get("fromTransformResult",!0);null!=o&&1!==e.length&&C5("");var a=[],s=[];return(mq(e,function(e){e.prepareSource();var t=e.getSource(o||0);null==o||t||C5(""),a.push(t),s.push(e._getVersionSign())}),r)?n=function(e,t,n){var i=vB(e),r=i.length;r||CR("");for(var o=0;o<r;o++)t=function(e,t){t.length||CR(""),m4(e)||CR("");var n=e.type,i=CH.get(n);i||CR("");var r=mY(t,function(e){return function(e,t){var n=new CB,i=e.data,r=n.sourceFormat=e.sourceFormat,o=e.startIndex;e.seriesLayoutBy!==v7&&CR("");var a=[],s={},l=e.dimensionsDefine;if(l)mq(l,function(e,t){var n=e.name,i={index:t,name:n,displayName:e.displayName};a.push(i),null!=n&&(vp(s,n)&&CR(""),s[n]=i)});else for(var u=0;u<e.dimensionsDetectedCount||0;u++)a.push({index:u});var c=Cb[CM(r,v7)];t.__isBuiltIn&&(n.getRawDataItem=function(e){return c(i,o,a,e)},n.getRawData=mQ(CF,null,e)),n.cloneRawData=mQ(Cz,null,e),n.count=mQ(CS[CM(r,v7)],null,i,o,a);var h=CC[r];n.retrieveValue=function(e,t){return d(c(i,o,a,e),t)};var d=n.retrieveValueFromItem=function(e,t){if(null!=e){var n=a[t];if(n)return h(e,t,n.name)}};return n.getDimensionInfo=mQ(CV,null,a,s),n.cloneAllDimensionInfo=mQ(Cj,null,a),n}(e,i)});return mY(vB(i.transform({upstream:r[0],upstreamList:r,config:mV(e.config)})),function(e,n){m4(e)||CR(""),e.data||CR(""),CW(yc(e.data))||CR("");var i,r=t[0];if(r&&0===n&&!e.dimensions){var o=r.startIndex;o&&(e.data=r.data.slice(0,o).concat(e.data)),i={seriesLayoutBy:v7,sourceHeader:o,dimensions:r.metaRawOption.dimensions}}else i={seriesLayoutBy:v7,sourceHeader:0,dimensions:e.dimensions};return yl(e.data,i,null)})}(i[o],t),o!==r-1&&(t.length=Math.max(t.length,1));return t}(r,a,{datasetIndex:i.componentIndex}):null!=o&&(n=[new ya({data:(t=a[0]).data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:mV(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})]),{sourceList:n,upstreamSignList:s}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e=e||0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var i=this._storeList,r=i[0];r||(r=i[0]={});var o=r[n];if(!o){var a=this._getUpstreamSourceManagers()[0];C2(this._sourceHost)&&a?o=a._innerGetDataStore(e,t,n):(o=new CJ).initData(new Cy(t,e.length),e),r[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(C2(e)){var t=yi(e);return t?[t.getSourceManager()]:[]}return mY(e.get("transform",!0)||e.get("fromTransformResult",!0)?vJ(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},vK).models:[],function(e){return e.getSourceManager()})},e.prototype._getSourceMetaRawOption=function(){var e,t,n,i=this._sourceHost;return C2(i)?(e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0)):this._getUpstreamSourceManagers().length||(e=i.get("seriesLayoutBy",!0),t=i.get("sourceHeader",!0),n=i.get("dimensions",!0)),{seriesLayoutBy:e,sourceHeader:t,dimensions:n}},e}();function C1(e){e.option.transform&&(e.option.transform[vs]=!0)}function C2(e){return"series"===e.mainType}function C5(e){throw Error(e)}var C3="line-height:1";function C4(e,t){var n=e.color||"#6e7079",i=e.fontSize||12,r=e.fontWeight||"400",o=e.color||"#464646",a=e.fontSize||14,s=e.fontWeight||"900";return"html"===t?{nameStyle:"font-size:"+_P(i+"")+"px;color:"+_P(n)+";font-weight:"+_P(r+""),valueStyle:"font-size:"+_P(a+"")+"px;color:"+_P(o)+";font-weight:"+_P(s+"")}:{nameStyle:{fontSize:i,fill:n,fontWeight:r},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var C6=[0,10,20,30],C8=["","\n","\n\n","\n\n\n"];function C9(e,t){return t.type=e,t}function C7(e){return"section"===e.type}function Me(e,t,n,i){var r,o=t.noHeader,a={html:C6[r=function e(t){if(C7(t)){var n=0,i=t.blocks.length,r=i>1||i>0&&!t.noHeader;return mq(t.blocks,function(t){var i=e(t);i>=n&&(n=i+ +(r&&(!i||C7(t)&&!t.noHeader)))}),n}return 0}(t)],richText:C8[r]},s=[],l=t.blocks||[];vo(!l||m0(l)),l=l||[];var u=e.orderMode;if(t.sortBlocks&&u){l=l.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(vp(c,u)){var h=new CN(c[u],null);l.sort(function(e,t){return h.evaluate(e.sortParam,t.sortParam)})}else"seriesDesc"===u&&l.reverse()}mq(l,function(n,r){var o=t.valueFormatter,l=(C7(n)?Me:Mt)(o?mH(mH({},e),{valueFormatter:o}):e,n,r>0?a.html:0,i);null!=l&&s.push(l)});var d="richText"===e.renderMode?s.join(a.richText):Mi(s.join(""),o?n:a.html);if(o)return d;var f=_9(t.header,"ordinal",e.useUTC),p=C4(i,e.renderMode).nameStyle;return"richText"===e.renderMode?Mr(e,f,p)+a.richText+d:Mi('<div style="'+p+";"+C3+';">'+_P(f)+"</div>"+d,n)}function Mt(e,t,n,i){var r=e.renderMode,o=t.noName,a=t.noValue,s=!t.markerType,l=t.name,u=e.useUTC,c=t.valueFormatter||e.valueFormatter||function(e){return mY(e=m0(e)?e:[e],function(e,t){return _9(e,m0(w)?w[t]:w,u)})};if(!o||!a){var h,d,f,p,g,m,v,y,x=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||"#333",r),b=o?"":_9(l,"ordinal",u),w=t.valueType,S=a?[]:c(t.value,t.dataIndex),_=!s||!o,C=!s&&o,M=C4(i,r),A=M.nameStyle,k=M.valueStyle;return"richText"===r?(s?"":x)+(o?"":Mr(e,b,A))+(a?"":(h=e,d=S,f=_,p=C,g=[k],f&&g.push({padding:[0,0,0,p?10:20],align:"right"}),h.markupStyleCreator.wrapRichTextStyle(m0(d)?d.join(" "):d,g))):Mi((s?"":x)+(o?"":'<span style="'+A+";"+(s?"":"margin-left:2px")+'">'+_P(b)+"</span>")+(a?"":(m=S,v=_,y=C,'<span style="'+(v?"float:right;margin-left:"+(y?"10px":"20px"):"")+";"+k+'">'+mY(m=m0(m)?m:[m],function(e){return _P(e)}).join(" ")+"</span>")),n)}}function Mn(e,t,n,i,r,o){if(e)return(C7(e)?Me:Mt)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,o)}function Mi(e,t){return'<div style="margin: '+t+"px 0 0;"+C3+';">'+e+'<div style="clear:both"></div></div>'}function Mr(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function Mo(e,t){var n=e.get("padding");return null!=n?n:"richText"===t?[8,10]:10}var Ma=function(){function e(){this.richTextStyles={},this._nextStyleNameId=vO()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var i,r,o,a,s,l,u="richText"===n?this._generateStyleName():null,c=(a=(o=m2(i={color:t,type:e,renderMode:n,markerId:u})?{color:i,extraCssText:r}:i||{}).color,s=o.type,r=o.extraCssText,l=o.renderMode||"html",a?"html"===l?"subItem"===s?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+_P(a)+";"+(r||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+_P(a)+";"+(r||"")+'"></span>':{renderMode:l,content:"{"+(o.markerId||"markerX")+"|} ",style:"subItem"===s?{width:4,height:4,borderRadius:2,backgroundColor:a}:{width:10,height:10,borderRadius:5,backgroundColor:a}}:"");return m2(c)?c:(this.richTextStyles[u]=c.style,c.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};m0(t)?mq(t,function(e){return mH(n,e)}):mH(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},e}(),Ms=vq();function Ml(e,t){return e.getName(t)||e.getId(t)}var Mu=function(e){var t;function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return yz(n,e),n.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=CD({count:Mh,reset:Md}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(Ms(this).sourceManager=new C0(this)).prepareSource();var i=this.getInitialData(e,n);Mp(i,this),this.dataTask.context.data=i,Ms(this).dataBeforeProcessed=i,Mc(this),this._initSelectedMapFromData(i)},n.prototype.mergeDefaultAndTheme=function(e,t){var n=Cu(this),i=n?Ch(e):{},r=this.subType;Cf.hasClass(r)&&(r+="Series"),mj(e,t.getTheme().get(this.subType)),mj(e,this.getDefaultOption()),vF(e,"label",["show"]),this.fillDataTextStyle(e.data),n&&Cc(e,i,n)},n.prototype.mergeOption=function(e,t){e=mj(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Cu(this);n&&Cc(this.option,e,n);var i=Ms(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(e,t);Mp(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,Ms(this).dataBeforeProcessed=r,Mc(this),this._initSelectedMapFromData(r)},n.prototype.fillDataTextStyle=function(e){if(e&&!m8(e))for(var t=["show"],n=0;n<e.length;n++)e[n]&&e[n].label&&vF(e[n],"label",t)},n.prototype.getInitialData=function(e,t){},n.prototype.appendData=function(e){this.getRawData().appendData(e.data)},n.prototype.getData=function(e){var t=Mm(this);if(!t)return Ms(this).data;var n=t.context.data;return null==e?n:n.getLinkedData(e)},n.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},n.prototype.setData=function(e){var t=Mm(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}Ms(this).data=e},n.prototype.getEncode=function(){var e=this.get("encode",!0);if(e)return vh(e)},n.prototype.getSourceManager=function(){return Ms(this).sourceManager},n.prototype.getSource=function(){return this.getSourceManager().getSource()},n.prototype.getRawData=function(){return Ms(this).dataBeforeProcessed},n.prototype.getColorBy=function(){return this.get("colorBy")||"series"},n.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},n.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},n.prototype.formatTooltip=function(e,t,n){return function(e){var t,n,i,r,o=e.series,a=e.dataIndex,s=e.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),c=u.length,h=o.getRawValue(a),d=m0(h),f=Cn(o.getData().getItemVisual(a,"style")[o.visualDrawType]);if(c>1||d&&!c){var p=function(e,t,n,i,r){var o=t.getData(),a=mZ(e,function(e,t,n){var i=o.getDimensionInfo(n);return e||i&&!1!==i.tooltip&&null!=i.displayName},!1),s=[],l=[],u=[];function c(e,t){var n=o.getDimensionInfo(t);n&&!1!==n.otherDims.tooltip&&(a?u.push(C9("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:e,valueType:n.type})):(s.push(e),l.push(n.type)))}return i.length?mq(i,function(e){c(CA(o,n,e),e)}):mq(e,c),{inlineValues:s,inlineValueTypes:l,blocks:u}}(h,o,a,u,f);t=p.inlineValues,n=p.inlineValueTypes,i=p.blocks,r=p.inlineValues[0]}else if(c){var g=l.getDimensionInfo(u[0]);r=t=CA(l,a,u[0]),n=g.type}else r=t=d?h[0]:h;var m=vG(o),v=m&&o.name||"",y=l.getName(a),x=s?v:y;return C9("section",{header:v,noHeader:s||!m,sortParam:r,blocks:[C9("nameValue",{markerType:"item",markerColor:f,name:x,noName:!va(x),value:t,valueType:n,dataIndex:a})].concat(i||[])})}({series:this,dataIndex:e,multipleSeries:t})},n.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(vE.node&&!(e&&e.ssr))return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),!!t},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(e,t,n){var i=this.ecModel,r=Cv.prototype.getColorFromPalette.call(this,e,t,n);return r||(r=i.getColorFromPalette(e,t,n)),r},n.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},n.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(t);if("series"===i||"all"===n){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var o=0;o<e.length;o++){var a=Ml(r,e[o]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},n.prototype.toggleSelect=function(e,t){for(var n=[],i=0;i<e.length;i++)n[0]=e[i],this.isSelected(e[i],t)?this.unselect(n,t):this.select(n,t)},n.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,t=mK(e),n=[],i=0;i<t.length;i++){var r=e[t[i]];r>=0&&n.push(r)}return n},n.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(t);return("all"===n||n[Ml(i,e)])&&!i.getItemModel(e).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return!!e&&(!0===e||e&&e.enabled)},n.prototype._innerSelect=function(e,t){var n,i,r=this.option,o=r.selectedMode,a=t.length;if(o&&a){if("series"===o)r.selectedMap="all";else if("multiple"===o){m4(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l<a;l++){var u=t[l],c=Ml(e,u);s[c]=!0,this._selectedDataIndicesMap[c]=e.getRawIndex(u)}}else if("single"===o||!0===o){var h=t[a-1],c=Ml(e,h);(n={})[c]=!0,r.selectedMap=n,this._selectedDataIndicesMap=((i={})[c]=e.getRawIndex(h),i)}}},n.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each(function(n){var i=e.getRawDataItem(n);i&&i.selected&&t.push(n)}),t.length>0&&this._innerSelect(e,t)}},n.registerClass=function(e){return Cf.registerClass(e)},n.protoInitialize=void((t=n.prototype).type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"),n}(Cf);function Mc(e){var t,n,i,r=e.name;vG(e)||(e.name=(n=(t=e.getRawData()).mapDimensionsAll("seriesName"),i=[],mq(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&i.push(n.displayName)}),i.join(" ")||r))}function Mh(e){return e.model.getRawData().count()}function Md(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Mf}function Mf(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Mp(e,t){mq(function(e,t){for(var n=new e.constructor(e.length+t.length),i=0;i<e.length;i++)n[i]=e[i];for(var r=e.length,i=0;i<t.length;i++)n[i+r]=t[i];return n}(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,mJ(Mg,t))})}function Mg(e,t){var n=Mm(e);return n&&n.setOutputEnd((t||this).count()),t}function Mm(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(e.uid))}return i}}function Mv(e){return null==e?0:e.length||1}function My(e){return e}m$(Mu,CT),m$(Mu,Cv),yG(Mu,Cf);var Mx=function(){function e(e,t,n,i,r,o){this._old=e,this._new=t,this._oldKeyGetter=n||My,this._newKeyGetter=i||My,this.context=r,this._diffModeMultiple="multiple"===o}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},i=Array(e.length),r=Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,r,"_newKeyGetter");for(var o=0;o<e.length;o++){var a=i[o],s=n[a],l=Mv(s);if(l>1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},r=[],o=[];this._initIndexMap(e,n,r,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var a=0;a<r.length;a++){var s=r[a],l=n[s],u=i[s],c=Mv(l),h=Mv(u);if(c>1&&1===h)this._updateManyToOne&&this._updateManyToOne(u,l),i[s]=null;else if(1===c&&h>1)this._updateOneToMany&&this._updateOneToMany(u,l),i[s]=null;else if(1===c&&1===h)this._update&&this._update(u,l),i[s]=null;else if(c>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,l),i[s]=null;else if(c>1)for(var d=0;d<c;d++)this._remove&&this._remove(l[d]);else this._remove&&this._remove(l)}this._performRestAdd(o,i)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=t[i],o=Mv(r);if(o>1)for(var a=0;a<o;a++)this._add&&this._add(r[a]);else 1===o&&this._add&&this._add(r);t[i]=null}},e.prototype._initIndexMap=function(e,t,n,i){for(var r=this._diffModeMultiple,o=0;o<e.length;o++){var a="_ec_"+this[i](e[o],o);if(r||(n[o]=a),t){var s=t[a],l=Mv(s);0===l?(t[a]=o,r&&n.push(a)):1===l?t[a]=[s,o]:s.push(o)}}},e}(),Mb=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},e}();function Mw(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}let MS=function(e){this.otherDims={},null!=e&&mH(this,e)};var M_=m4,MC="u"<typeof Int32Array?Array:Int32Array,MM=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],MA=["_approximateExtent"],Mk=function(){function e(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var n,i=!1;yv(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},u=0;u<n.length;u++){var c=n[u],h=m2(c)?new MS({name:c}):c instanceof MS?c:new MS(c),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var f=h.otherDims=h.otherDims||{};o.push(d),r[d]=h,null!=l[d]&&(s=!0),h.createInvertedIndices&&(a[d]=[]),0===f.itemName&&(this._nameDimIdx=u),0===f.itemId&&(this._idDimIdx=u),i&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=r,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=a,this._dimOmitted){var p=this._dimIdxToName=vh();mq(o,function(e){p.set(r[e].storeDimIndex,e)})}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(null==t)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(null!=n)return n;var i=this._schema.getSourceDimension(t);if(i)return i.name},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(null!=t)return t;if(null==e)return -1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(m3(e)||null!=e&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||0>this._schema.getSourceDimensionIndex(e)))return+e},e.prototype._getStoreDimIndex=function(e){return this.getDimensionIndex(e)},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(null==t)return n.encodeFirstDimNotExtra[e];var i=n.encode[e];return i?i[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var i,r,o,a,s,l,u,c,h,d,f,p,g,m=this;if(e instanceof CJ&&(g=e),!g){var v=this.dimensions,y=ys(e)||mU(e)?new Cy(e,v.length):e;g=new CJ;var x=mY(v,function(e){return{type:m._dimInfos[e].type,property:e}});g.initData(y,x,n)}this._store=g,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,g.count()),this._dimSummary=(i=this,r=this._schema,a=(o={}).encode={},s=vh(),l=[],u=[],c={},mq(i.dimensions,function(e){var t=i.getDimensionInfo(e),n=t.coordDim;if(n){var r,o=t.coordDimIndex;Mw(a,n)[o]=e,t.isExtraCoord||(s.set(n,1),"ordinal"!==(r=t.type)&&"time"!==r&&(l[0]=e),Mw(c,n)[o]=i.getDimensionIndex(t.name)),t.defaultTooltip&&u.push(e)}v2.each(function(e,n){var i=Mw(a,n),r=t.otherDims[n];null!=r&&!1!==r&&(i[r]=t.name)})}),h=[],d={},s.each(function(e,t){var n=a[t];d[t]=n[0],h=h.concat(n)}),o.dataDimsOnCoord=h,o.dataDimIndicesOnCoord=mY(h,function(e){return i.getDimensionInfo(e).storeDimIndex}),o.encodeFirstDimNotExtra=d,(f=a.label)&&f.length&&(l=f.slice()),(p=a.tooltip)&&p.length?u=p.slice():u.length||(u=l.slice()),a.defaultedLabel=l,a.defaultedTooltip=u,o.userOutput=new Mb(c,r),o),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t.length),i=n.start,r=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var a=i;a<r;a++){var s=a-i;this._nameList[a]=t[s],o&&q(this,a)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var i=this._dimInfos[t[n]];i.ordinalMeta&&e.collectOrdinalMeta(i.storeDimIndex,i.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return null==this._idDimIdx&&e.getSource().sourceFormat!==v8&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,r=this._idList;if(n.getSource().sourceFormat===v5&&!n.pure)for(var o=[],a=e;a<t;a++){var s,l=n.getItem(a,o);if(!(!this.hasItemOption&&m4(s=l))||s instanceof Array||(this.hasItemOption=!0),l){var u=l.name;null==i[a]&&null!=u&&(i[a]=vW(u,null));var c=l.id;null==r[a]&&null!=c&&(r[a]=vW(c,null))}}if(this._shouldMakeIdFromName())for(var a=e;a<t;a++)q(this,a);j(this)}},e.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){M_(e)?mH(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return null==n&&null!=this._nameDimIdx&&(n=W(this,this._nameDimIdx,t)),null==n&&(n=""),n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),i=this._store.getOrdinalMeta(e);return i?i.categories[n]:n},e.prototype.getId=function(e){return H(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,i=this._dimInfos[e];if(i)return n.get(i.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,i=this._dimInfos[e];if(i)return n.getByRawIndex(i.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,i=this._store;return m0(e)?i.getValues(mY(e,function(e){return n._getStoreDimIndex(e)}),t):i.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,i=t.length;n<i;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return -1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=(e&&this._invertedIndicesMap[e])[t];return null==n||isNaN(n)?-1:n},e.prototype.indicesOfNearest=function(e,t,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),t,n)},e.prototype.each=function(e,t,n){m1(e)&&(n=t,t=e,e=[]);var i=n||this,r=mY(G(e),this._getStoreDimIndex,this);this._store.each(r,i?mQ(t,i):t)},e.prototype.filterSelf=function(e,t,n){m1(e)&&(n=t,t=e,e=[]);var i=n||this,r=mY(G(e),this._getStoreDimIndex,this);return this._store=this._store.filter(r,i?mQ(t,i):t),this},e.prototype.selectRange=function(e){var t=this,n={},i=mK(e),r=[];return mq(i,function(i){var o=t._getStoreDimIndex(i);n[o]=e[i],r.push(o)}),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){m1(e)&&(n=t,t=e,e=[]),n=n||this;var i=[];return this.each(e,function(){i.push(t&&t.apply(this,arguments))},n),i},e.prototype.map=function(e,t,n,i){var r=n||i||this,o=mY(G(e),this._getStoreDimIndex,this),a=U(this);return a._store=this._store.map(o,r?mQ(t,r):t),a},e.prototype.modify=function(e,t,n,i){var r=n||i||this,o=mY(G(e),this._getStoreDimIndex,this);this._store.modify(o,r?mQ(t,r):t)},e.prototype.downSample=function(e,t,n,i){var r=U(this);return r._store=this._store.downSample(this._getStoreDimIndex(e),t,n,i),r},e.prototype.lttbDownSample=function(e,t){var n=U(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel;return new _x(this.getRawDataItem(e),t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new Mx(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(t){return H(e,t)},function(e){return H(t,e)})},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},M_(e)?mH(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e],i=n&&n[t];return null==i?this.getVisual(t):i},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var r=i[t];return null==r&&(m0(r=this.getVisual(t))?r=r.slice():M_(r)&&(r=mH({},r)),i[t]=r),r},e.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,M_(t)?mH(i,t):i[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){M_(e)?mH(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?mH(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){Sa(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){mq(this._graphicEls,function(n,i){n&&e&&e.call(t,n,i)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:mY(this.dimensions,this._getDimInfo,this),this.hostModel)),$(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];m1(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(vi(arguments)))})},e.internalField=void(j=function(e){var t=e._invertedIndicesMap;mq(t,function(n,i){var r=e._dimInfos[i],o=r.ordinalMeta,a=e._store;if(o){n=t[i]=new MC(o.categories.length);for(var s=0;s<n.length;s++)n[s]=-1;for(var s=0;s<a.count();s++)n[a.get(r.storeDimIndex,s)]=s}})},W=function(e,t,n){return vW(e._getCategory(t,n),null)},H=function(e,t){var n=e._idList[t];return null==n&&null!=e._idDimIdx&&(n=W(e,e._idDimIdx,t)),null==n&&(n="e\0\0"+t),n},G=function(e){return m0(e)||(e=null!=e?[e]:[]),e},U=function(t){var n=new e(t._schema?t._schema:mY(t.dimensions,t._getDimInfo,t),t.hostModel);return $(n,t),n},$=function(e,t){mq(MM.concat(t.__wrappedMethods||[]),function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e.__wrappedMethods=t.__wrappedMethods,mq(MA,function(n){e[n]=mV(t[n])}),e._calculationInfo=mH({},t._calculationInfo)},q=function(e,t){var n=e._nameList,i=e._idList,r=e._nameDimIdx,o=e._idDimIdx,a=n[t],s=i[t];if(null==a&&null!=r&&(n[t]=a=W(e,r,t)),null==s&&null!=o&&(i[t]=s=W(e,o,t)),null==s&&null!=a){var l=e._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),i[t]=s}}),e}();function MT(e,t){ys(e)||(e=yu(e));var n,i,r,o,a,s=(t=t||{}).coordDimensions||[],l=t.dimensionsDefine||e.dimensionsDefine||[],u=vh(),c=[],h=(n=e,i=s,r=l,o=t.dimensionsCount,a=Math.max(n.dimensionsDetectedCount||1,i.length,r.length,o||0),mq(i,function(e){var t;m4(e)&&(t=e.dimsDef)&&(a=Math.max(a,t.length))}),a),d=t.canOmitUnusedDimensions&&h>30,f=l===e.dimensionsDefine,p=f?yx(e):yy(l),g=t.encodeDefine;!g&&t.encodeDefaulter&&(g=t.encodeDefaulter(e,h));for(var m=vh(g),v=new Cq(h),y=0;y<v.length;y++)v[y]=-1;function x(e){var t=v[e];if(t<0){var n=l[e],i=m4(n)?n:{name:n},r=new MS,o=i.name;null!=o&&null!=p.get(o)&&(r.name=r.displayName=o),null!=i.type&&(r.type=i.type),null!=i.displayName&&(r.displayName=i.displayName);var a=c.length;return v[e]=a,r.storeDimIndex=e,c.push(r),r}return c[t]}if(!d)for(var y=0;y<h;y++)x(y);m.each(function(e,t){var n=vB(e).slice();if(1===n.length&&!m2(n[0])&&n[0]<0)return void m.set(t,!1);var i=m.set(t,[]);mq(n,function(e,n){var r=m2(e)?p.get(e):e;null!=r&&r<h&&(i[n]=r,w(x(r),t,n))})});var b=0;function w(e,t,n){null!=v2.get(t)?e.otherDims[t]=n:(e.coordDim=t,e.coordDimIndex=n,u.set(t,!0))}mq(s,function(e){if(m2(e))r=e,i={};else{var t,n,i,r=(i=e).name,o=i.ordinalMeta;i.ordinalMeta=null,(i=mH({},i)).ordinalMeta=o,t=i.dimsDef,n=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var a=m.get(r);if(!1!==a){if(!(a=vB(a)).length)for(var s=0;s<(t&&t.length||1);s++){for(;b<h&&null!=x(b).coordDim;)b++;b<h&&a.push(b++)}mq(a,function(e,o){var a=x(e);if(f&&null!=i.type&&(a.type=i.type),w(mW(a,i),r,o),null==a.name&&t){var s=t[o];m4(s)||(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}n&&mW(a.otherDims,n)})}});var S=t.generateCoord,_=t.generateCoordCount,C=null!=_;_=S?_||1:0;var M=S||"value";function A(e){null==e.name&&(e.name=e.coordDim)}if(d)mq(c,function(e){A(e)}),c.sort(function(e,t){return e.storeDimIndex-t.storeDimIndex});else for(var k=0;k<h;k++){var T=x(k);null==T.coordDim&&(T.coordDim=function(e,t,n){if(n||t.hasKey(e)){for(var i=0;t.hasKey(e+i);)i++;e+=i}return t.set(e,!0),e}(M,u,C),T.coordDimIndex=0,(!S||_<=0)&&(T.isExtraCoord=!0),_--),A(T),null==T.type&&(1===yr(e,k)||T.isExtraCoord&&(null!=T.otherDims.itemName||null!=T.otherDims.seriesName))&&(T.type="ordinal")}return function(e){for(var t=vh(),n=0;n<e.length;n++){var i=e[n],r=i.name,o=t.get(r)||0;o>0&&(i.name=r+(o-1)),o++,t.set(r,o)}}(c),new ym({source:e,dimensions:c,fullDimensionCount:h,dimensionOmitted:d})}var MI={},MD=function(){function e(){this._coordinateSystems=[]}return e.prototype.create=function(e,t){var n=[];mq(MI,function(i,r){var o=i.create(e,t);n=n.concat(o||[])}),this._coordinateSystems=n},e.prototype.update=function(e,t){mq(this._coordinateSystems,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},e.register=function(e,t){MI[e]=t},e.get=function(e){return MI[e]},e}(),MO=function(e){this.coordSysDims=[],this.axisMap=vh(),this.categoryAxisMap=vh(),this.coordSysName=e},MP={cartesian2d:function(e,t,n,i){var r=e.getReferringComponents("xAxis",vK).models[0],o=e.getReferringComponents("yAxis",vK).models[0];t.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),MR(r)&&(i.set("x",r),t.firstCategoryDimIndex=0),MR(o)&&(i.set("y",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,n,i){var r=e.getReferringComponents("singleAxis",vK).models[0];t.coordSysDims=["single"],n.set("single",r),MR(r)&&(i.set("single",r),t.firstCategoryDimIndex=0)},polar:function(e,t,n,i){var r=e.getReferringComponents("polar",vK).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),MR(o)&&(i.set("radius",o),t.firstCategoryDimIndex=0),MR(a)&&(i.set("angle",a),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,n,i){t.coordSysDims=["lng","lat"]},parallel:function(e,t,n,i){var r=e.ecModel,o=r.getComponent("parallel",e.get("parallelIndex")),a=t.coordSysDims=o.dimensions.slice();mq(o.parallelAxisIndex,function(e,o){var s=r.getComponent("parallelAxis",e),l=a[o];n.set(l,s),MR(s)&&(i.set(l,s),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=o))})}};function MR(e){return"category"===e.get("type")}let ME=function(e,t,n){n=n||{};var i,r,o,a,s,l,u,c,h=t.getSourceManager(),d=!1;e?(d=!0,c=yu(e)):d=(c=h.getSource()).sourceFormat===v5;var f=function(e){var t=e.get("coordinateSystem"),n=new MO(t),i=MP[t];if(i)return i(e,n,n.axisMap,n.categoryAxisMap),n}(t),p=(r=t.get("coordinateSystem"),o=MD.get(r),f&&f.coordSysDims&&(i=mY(f.coordSysDims,function(e){var t,n={name:e},i=f.axisMap.get(e);return i&&(n.type="category"===(t=i.get("type"))?"ordinal":"time"===t?"time":"float"),n})),i||(i=o&&(o.getDimensionsInfo?o.getDimensionsInfo():o.dimensions.slice())||["x","y"]),i),g=n.useEncodeDefaulter,m=m1(g)?g:g?mJ(yt,p,t):null,v=MT(c,{coordDimensions:p,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:m,canOmitUnusedDimensions:!d}),y=(a=v.dimensions,s=n.createInvertedIndices,f&&mq(a,function(e,t){var n=e.coordDim,i=f.categoryAxisMap.get(n);i&&(null==l&&(l=t),e.ordinalMeta=i.getOrdinalMeta(),s&&(e.createInvertedIndices=!0)),null!=e.otherDims.itemName&&(u=!0)}),u||null==l||(a[l].otherDims.itemName=0),l),x=d?null:h.getSharedDataStore(v),b=function(e,t,n){var i,r,o,a,s,l,u,c=(n=n||{}).byIndex,h=n.stackedCoordDimension;yv(t.schema)?(i=(r=t.schema).dimensions,o=t.store):i=t;var d=!!(e&&e.get("stack"));if(mq(i,function(e,t){m2(e)&&(i[t]=e={name:e}),d&&!e.isExtraCoord&&(c||a||!e.ordinalMeta||(a=e),s||"ordinal"===e.type||"time"===e.type||h&&h!==e.coordDim||(s=e))}),!s||c||a||(c=!0),s){l="__\0ecstackresult_"+e.id,u="__\0ecstackedover_"+e.id,a&&(a.createInvertedIndices=!0);var f=s.coordDim,p=s.type,g=0;mq(i,function(e){e.coordDim===f&&g++});var m={name:l,coordDim:f,coordDimIndex:g,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:u,coordDim:u,coordDimIndex:g+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(m.storeDimIndex=o.ensureCalculationDimension(u,p),v.storeDimIndex=o.ensureCalculationDimension(l,p)),r.appendCalculationDimension(m),r.appendCalculationDimension(v)):(i.push(m),i.push(v))}return{stackedDimension:s&&s.name,stackedByDimension:a&&a.name,isStackedByIndex:c,stackedOverDimension:u,stackResultDimension:l}}(t,{schema:v,store:x}),w=new Mk(v,t);w.setCalculationInfo(b);var S=null!=y&&function(e){if(e.sourceFormat===v5)return!m0(vV(function(e){for(var t=0;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[])))}(c)?function(e,t,n,i){return i===y?n:this.defaultDimValueGetter(e,t,n,i)}:null;return w.hasItemOption=!1,w.initData(d?c:x,null,S),w};var ML=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.getInitialData=function(e,t){return ME(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var i=this.coordinateSystem;if(i&&i.clampData){var r=i.clampData(e),o=i.dataToPoint(r);if(n)mq(i.getAxes(),function(e,n){if("category"===e.type&&null!=t){var i=e.getTicksCoords(),a=e.getTickModel().get("alignWithLabel"),s=r[n],l="x1"===t[n]||"y1"===t[n];if(l&&!a&&(s+=1),!(i.length<2)){if(2===i.length){o[n]=e.toGlobalCoord(e.getExtent()[+!!l]);return}for(var u=void 0,c=void 0,h=1,d=0;d<i.length;d++){var f=i[d].coord,p=d===i.length-1?i[d-1].tickValue+h:i[d].tickValue;if(p===s){c=f;break}if(p<s)u=f;else if(null!=u&&p>s){c=(f+u)/2;break}1===d&&(h=p-i[0].tickValue)}null==c&&(u?u&&(c=i[i.length-1].coord):c=i[0].coord),o[n]=e.toGlobalCoord(c)}}});else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=+!i.getBaseAxis().isHorizontal();o[u]+=s+l/2}return o}return[NaN,NaN]},t.type="series.__base_bar__",t.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},t}(Mu);Mu.registerClass(ML);var MN=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.getInitialData=function(){return ME(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},t.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},t.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type="series.bar",t.dependencies=["grid","polar"],t.defaultOption=_S(ML.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),t}(ML),MB=function(e){function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return yJ(t,e),t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,i=n.indexOf(t);i>=0&&(n.splice(i,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=mG(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,i=n[t];if(e&&e!==this&&e.parent!==this&&e!==i){n[t]=e,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,i=mG(n,e);return i<0||(n.splice(i,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var i=e[n];t&&i.removeSelfFromZr(t),i.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,i=0;i<n.length;i++){var r=n[i];e.call(t,r,i)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var i=this._children[n],r=e.call(t,i);i.isGroup&&!r&&i.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].addSelfToZr(t)},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].removeSelfFromZr(t)},t.prototype.getBoundingRect=function(e){for(var t=new xd(0,0,0,0),n=e||this._children,i=[],r=null,o=0;o<n.length;o++){var a=n[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(i);l?(xd.applyTransform(t,s,l),(r=r||t.clone()).union(t)):(r=r||s.clone()).union(s)}}return r||t},t}(bZ);MB.prototype.type="group";let MF=MB;var Mz=wA.CMD,MV=[[],[],[]],Mj=Math.sqrt,MH=Math.atan2,MW=Math.sqrt,MG=Math.sin,M$=Math.cos,MU=Math.PI;function Mq(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function MY(e,t){return(e[0]*t[0]+e[1]*t[1])/(Mq(e)*Mq(t))}function MZ(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(MY(e,t))}function MX(e,t,n,i,r,o,a,s,l,u,c){var h=MU/180*l,d=M$(h)*(e-n)/2+MG(h)*(t-i)/2,f=-1*MG(h)*(e-n)/2+M$(h)*(t-i)/2,p=d*d/(a*a)+f*f/(s*s);p>1&&(a*=MW(p),s*=MW(p));var g=(r===o?-1:1)*MW((a*a*(s*s)-a*a*(f*f)-s*s*(d*d))/(a*a*(f*f)+s*s*(d*d)))||0,m=g*a*f/s,v=-(g*s)*d/a,y=(e+n)/2+M$(h)*m-MG(h)*v,x=(t+i)/2+MG(h)*m+M$(h)*v,b=MZ([1,0],[(d-m)/a,(f-v)/s]),w=[(d-m)/a,(f-v)/s],S=[(-1*d-m)/a,(-1*f-v)/s],_=MZ(w,S);if(-1>=MY(w,S)&&(_=MU),MY(w,S)>=1&&(_=0),_<0){var C=Math.round(_/MU*1e6)/1e6;_=2*MU+C%2*MU}c.addData(u,y,x,a,s,b,_,h,o)}var MK=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,MQ=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,MJ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yJ(t,e),t.prototype.applyTransform=function(e){},t}(wV);function M0(e){return null!=e.setData}function M1(e,t){var n=function(e){var t,n=new wA;if(!e)return n;var i=0,r=0,o=0,a=0,s=wA.CMD,l=e.match(MK);if(!l)return n;for(var u=0;u<l.length;u++){for(var c=l[u],h=c.charAt(0),d=void 0,f=c.match(MQ)||[],p=f.length,g=0;g<p;g++)f[g]=parseFloat(f[g]);for(var m=0;m<p;){var v=void 0,y=void 0,x=void 0,b=void 0,w=void 0,S=void 0,_=void 0,C=i,M=r,A=void 0,k=void 0;switch(h){case"l":i+=f[m++],r+=f[m++],d=s.L,n.addData(d,i,r);break;case"L":i=f[m++],r=f[m++],d=s.L,n.addData(d,i,r);break;case"m":i+=f[m++],r+=f[m++],d=s.M,n.addData(d,i,r),o=i,a=r,h="l";break;case"M":i=f[m++],r=f[m++],d=s.M,n.addData(d,i,r),o=i,a=r,h="L";break;case"h":i+=f[m++],d=s.L,n.addData(d,i,r);break;case"H":i=f[m++],d=s.L,n.addData(d,i,r);break;case"v":r+=f[m++],d=s.L,n.addData(d,i,r);break;case"V":r=f[m++],d=s.L,n.addData(d,i,r);break;case"C":d=s.C,n.addData(d,f[m++],f[m++],f[m++],f[m++],f[m++],f[m++]),i=f[m-2],r=f[m-1];break;case"c":d=s.C,n.addData(d,f[m++]+i,f[m++]+r,f[m++]+i,f[m++]+r,f[m++]+i,f[m++]+r),i+=f[m-2],r+=f[m-1];break;case"S":v=i,y=r,A=n.len(),k=n.data,t===s.C&&(v+=i-k[A-4],y+=r-k[A-3]),d=s.C,C=f[m++],M=f[m++],i=f[m++],r=f[m++],n.addData(d,v,y,C,M,i,r);break;case"s":v=i,y=r,A=n.len(),k=n.data,t===s.C&&(v+=i-k[A-4],y+=r-k[A-3]),d=s.C,C=i+f[m++],M=r+f[m++],i+=f[m++],r+=f[m++],n.addData(d,v,y,C,M,i,r);break;case"Q":C=f[m++],M=f[m++],i=f[m++],r=f[m++],d=s.Q,n.addData(d,C,M,i,r);break;case"q":C=f[m++]+i,M=f[m++]+r,i+=f[m++],r+=f[m++],d=s.Q,n.addData(d,C,M,i,r);break;case"T":v=i,y=r,A=n.len(),k=n.data,t===s.Q&&(v+=i-k[A-4],y+=r-k[A-3]),i=f[m++],r=f[m++],d=s.Q,n.addData(d,v,y,i,r);break;case"t":v=i,y=r,A=n.len(),k=n.data,t===s.Q&&(v+=i-k[A-4],y+=r-k[A-3]),i+=f[m++],r+=f[m++],d=s.Q,n.addData(d,v,y,i,r);break;case"A":x=f[m++],b=f[m++],w=f[m++],S=f[m++],_=f[m++],C=i,M=r,i=f[m++],MX(C,M,i,r=f[m++],S,_,x,b,w,d=s.A,n);break;case"a":x=f[m++],b=f[m++],w=f[m++],S=f[m++],_=f[m++],C=i,M=r,i+=f[m++],MX(C,M,i,r+=f[m++],S,_,x,b,w,d=s.A,n)}}("z"===h||"Z"===h)&&(d=s.Z,n.addData(d),i=o,r=a),t=d}return n.toStatic(),n}(e),i=mH({},t);return i.buildPath=function(e){if(M0(e)){e.setData(n.data);var t=e.getContext();t&&e.rebuildPath(t,1)}else{var t=e;n.rebuildPath(t,1)}},i.applyTransform=function(e){!function(e,t){if(t){var n,i,r,o,a,s,l=e.data,u=e.len(),c=Mz.M,h=Mz.C,d=Mz.L,f=Mz.R,p=Mz.A,g=Mz.Q;for(r=0,o=0;r<u;){switch(n=l[r++],o=r,i=0,n){case c:case d:i=1;break;case h:i=3;break;case g:i=2;break;case p:var m=t[4],v=t[5],y=Mj(t[0]*t[0]+t[1]*t[1]),x=Mj(t[2]*t[2]+t[3]*t[3]),b=MH(-t[1]/x,t[0]/y);l[r]*=y,l[r++]+=m,l[r]*=x,l[r++]+=v,l[r++]*=y,l[r++]*=x,l[r++]+=b,l[r++]+=b,r+=2,o=r;break;case f:s[0]=l[r++],s[1]=l[r++],xz(s,s,t),l[o++]=s[0],l[o++]=s[1],s[0]+=l[r++],s[1]+=l[r++],xz(s,s,t),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<i;a++){var w=MV[a];w[0]=l[r++],w[1]=l[r++],xz(w,w,t),l[o++]=w[0],l[o++]=w[1]}}e.increaseVersion()}}(n,e),this.dirtyShape()},i}var M2=function(){this.cx=0,this.cy=0,this.r=0},M5=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultShape=function(){return new M2},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI)},t}(wV);M5.prototype.type="circle";let M3=M5;var M4=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},M6=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultShape=function(){return new M4},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=t.rx,o=t.ry,a=.5522848*r,s=.5522848*o;e.moveTo(n-r,i),e.bezierCurveTo(n-r,i-s,n-a,i-o,n,i-o),e.bezierCurveTo(n+a,i-o,n+r,i-s,n+r,i),e.bezierCurveTo(n+r,i+s,n+a,i+o,n,i+o),e.bezierCurveTo(n-a,i+o,n-r,i+s,n-r,i),e.closePath()},t}(wV);M6.prototype.type="ellipse";let M8=M6;var M9=Math.PI,M7=2*M9,Ae=Math.sin,At=Math.cos,An=Math.acos,Ai=Math.atan2,Ar=Math.abs,Ao=Math.sqrt,Aa=Math.max,As=Math.min;function Al(e,t,n,i,r,o,a){var s=e-n,l=t-i,u=(a?o:-o)/Ao(s*s+l*l),c=u*l,h=-u*s,d=e+c,f=t+h,p=n+c,g=i+h,m=(d+p)/2,v=(f+g)/2,y=p-d,x=g-f,b=y*y+x*x,w=r-o,S=d*g-p*f,_=(x<0?-1:1)*Ao(Aa(0,w*w*b-S*S)),C=(S*x-y*_)/b,M=(-S*y-x*_)/b,A=(S*x+y*_)/b,k=(-S*y+x*_)/b,T=C-m,I=M-v,D=A-m,O=k-v;return T*T+I*I>D*D+O*O&&(C=A,M=k),{cx:C,cy:M,x0:-c,y0:-h,x1:C*(r/w-1),y1:M*(r/w-1)}}var Au=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},Ac=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultShape=function(){return new Au},t.prototype.buildPath=function(e,t){!function(e,t){var n,i=Aa(t.r,0),r=Aa(t.r0||0,0),o=i>0,a=r>0;if(o||a){if(o||(i=r,r=0),r>i){var s=i;i=r,r=s}var l=t.startAngle,u=t.endAngle;if(!(isNaN(l)||isNaN(u))){var c=t.cx,h=t.cy,d=!!t.clockwise,f=Ar(u-l),p=f>M7&&f%M7;if(p>1e-4&&(f=p),i>1e-4)if(f>M7-1e-4)e.moveTo(c+i*At(l),h+i*Ae(l)),e.arc(c,h,i,l,u,!d),r>1e-4&&(e.moveTo(c+r*At(u),h+r*Ae(u)),e.arc(c,h,r,u,l,d));else{var g=void 0,m=void 0,v=void 0,y=void 0,x=void 0,b=void 0,w=void 0,S=void 0,_=void 0,C=void 0,M=void 0,A=void 0,k=void 0,T=void 0,I=void 0,D=void 0,O=i*At(l),P=i*Ae(l),R=r*At(u),E=r*Ae(u),L=f>1e-4;if(L){var N=t.cornerRadius;N&&(g=(n=function(e){var t;if(m0(e)){var n=e.length;if(!n)return e;t=1===n?[e[0],e[0],0,0]:2===n?[e[0],e[0],e[1],e[1]]:3===n?e.concat(e[2]):e}else t=[e,e,e,e];return t}(N))[0],m=n[1],v=n[2],y=n[3]);var B=Ar(i-r)/2;if(x=As(B,v),b=As(B,y),w=As(B,g),S=As(B,m),M=_=Aa(x,b),A=C=Aa(w,S),(_>1e-4||C>1e-4)&&(k=i*At(u),T=i*Ae(u),I=r*At(l),D=r*Ae(l),f<M9)){var F=function(e,t,n,i,r,o,a,s){var l=n-e,u=i-t,c=a-r,h=s-o,d=h*l-c*u;if(!(d*d<1e-4))return d=(c*(t-o)-h*(e-r))/d,[e+d*l,t+d*u]}(O,P,I,D,k,T,R,E);if(F){var z=O-F[0],V=P-F[1],j=k-F[0],H=T-F[1],W=1/Ae(An((z*j+V*H)/(Ao(z*z+V*V)*Ao(j*j+H*H)))/2),G=Ao(F[0]*F[0]+F[1]*F[1]);M=As(_,(i-G)/(W+1)),A=As(C,(r-G)/(W-1))}}}if(L)if(M>1e-4){var $=As(v,M),U=As(y,M),q=Al(I,D,O,P,i,$,d),Y=Al(k,T,R,E,i,U,d);e.moveTo(c+q.cx+q.x0,h+q.cy+q.y0),M<_&&$===U?e.arc(c+q.cx,h+q.cy,M,Ai(q.y0,q.x0),Ai(Y.y0,Y.x0),!d):($>0&&e.arc(c+q.cx,h+q.cy,$,Ai(q.y0,q.x0),Ai(q.y1,q.x1),!d),e.arc(c,h,i,Ai(q.cy+q.y1,q.cx+q.x1),Ai(Y.cy+Y.y1,Y.cx+Y.x1),!d),U>0&&e.arc(c+Y.cx,h+Y.cy,U,Ai(Y.y1,Y.x1),Ai(Y.y0,Y.x0),!d))}else e.moveTo(c+O,h+P),e.arc(c,h,i,l,u,!d);else e.moveTo(c+O,h+P);if(r>1e-4&&L)if(A>1e-4){var $=As(g,A),U=As(m,A),q=Al(R,E,k,T,r,-U,d),Y=Al(O,P,I,D,r,-$,d);e.lineTo(c+q.cx+q.x0,h+q.cy+q.y0),A<C&&$===U?e.arc(c+q.cx,h+q.cy,A,Ai(q.y0,q.x0),Ai(Y.y0,Y.x0),!d):(U>0&&e.arc(c+q.cx,h+q.cy,U,Ai(q.y0,q.x0),Ai(q.y1,q.x1),!d),e.arc(c,h,r,Ai(q.cy+q.y1,q.cx+q.x1),Ai(Y.cy+Y.y1,Y.cx+Y.x1),d),$>0&&e.arc(c+Y.cx,h+Y.cy,$,Ai(Y.y1,Y.x1),Ai(Y.y0,Y.x0),!d))}else e.lineTo(c+R,h+E),e.arc(c,h,r,u,l,d);else e.lineTo(c+R,h+E)}else e.moveTo(c,h);e.closePath()}}}(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(wV);Ac.prototype.type="sector";let Ah=Ac;var Ad=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Af=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultShape=function(){return new Ad},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=2*Math.PI;e.moveTo(n+t.r,i),e.arc(n,i,t.r,0,r,!1),e.moveTo(n+t.r0,i),e.arc(n,i,t.r0,0,r,!0)},t}(wV);Af.prototype.type="ring";let Ap=Af;function Ag(e,t,n){var i=t.smooth,r=t.points;if(r&&r.length>=2){if(i){var o=function(e,t,n,i){var r,o,a,s,l=[],u=[],c=[],h=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=e.length;d<f;d++)xV(a,a,e[d]),xj(s,s,e[d]);xV(a,a,i[0]),xj(s,s,i[1])}for(var d=0,f=e.length;d<f;d++){var p,g=e[d];if(n)r=e[d?d-1:f-1],o=e[(d+1)%f];else if(0===d||d===f-1){l.push([(p=e[d])[0],p[1]]);continue}else r=e[d-1],o=e[d+1];xR(u,o,r),xE(u,u,t);var m=xN(g,r),v=xN(g,o),y=m+v;0!==y&&(m/=y,v/=y),xE(c,u,-m),xE(h,u,v);var x=xP([],g,c),b=xP([],g,h);i&&(xj(x,x,a),xV(x,x,s),xj(b,b,a),xV(b,b,s)),l.push(x),l.push(b)}return n&&l.push(l.shift()),l}(r,i,n,t.smoothConstraint);e.moveTo(r[0][0],r[0][1]);for(var a=r.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],c=r[(s+1)%a];e.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{e.moveTo(r[0][0],r[0][1]);for(var s=1,h=r.length;s<h;s++)e.lineTo(r[s][0],r[s][1])}n&&e.closePath()}}var Am=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},Av=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultShape=function(){return new Am},t.prototype.buildPath=function(e,t){Ag(e,t,!0)},t}(wV);Av.prototype.type="polygon";let Ay=Av;var Ax=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},Ab=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Ax},t.prototype.buildPath=function(e,t){Ag(e,t,!1)},t}(wV);Ab.prototype.type="polyline";let Aw=Ab;var AS={},A_=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},AC=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new A_},t.prototype.buildPath=function(e,t){if(this.subPixelOptimize){var n,i,r,o,a=wY(AS,t,this.style);n=a.x1,i=a.y1,r=a.x2,o=a.y2}else n=t.x1,i=t.y1,r=t.x2,o=t.y2;var s=t.percent;0!==s&&(e.moveTo(n,i),s<1&&(r=n*(1-s)+r*s,o=i*(1-s)+o*s),e.lineTo(r,o))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(wV);AC.prototype.type="line";let AM=AC;var AA=[],Ak=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function AT(e,t,n){var i=e.cpx2,r=e.cpy2;return null!=i||null!=r?[(n?x6:x4)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?x6:x4)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?bt:be)(e.x1,e.cpx1,e.x2,t),(n?bt:be)(e.y1,e.cpy1,e.y2,t)]}var AI=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Ak},t.prototype.buildPath=function(e,t){var n=t.x1,i=t.y1,r=t.x2,o=t.y2,a=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,c=t.percent;0!==c&&(e.moveTo(n,i),null==l||null==u?(c<1&&(bi(n,a,r,c,AA),a=AA[1],r=AA[2],bi(i,s,o,c,AA),s=AA[1],o=AA[2]),e.quadraticCurveTo(a,s,r,o)):(c<1&&(x7(n,a,l,r,c,AA),a=AA[1],l=AA[2],r=AA[3],x7(i,s,u,o,c,AA),s=AA[1],u=AA[2],o=AA[3]),e.bezierCurveTo(a,s,l,u,r,o)))},t.prototype.pointAt=function(e){return AT(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=AT(this.shape,e,!0);return xL(t,t)},t}(wV);AI.prototype.type="bezier-curve";let AD=AI;var AO=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},AP=function(e){function t(t){return e.call(this,t)||this}return yJ(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new AO},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r,0),o=t.startAngle,a=t.endAngle,s=t.clockwise,l=Math.cos(o),u=Math.sin(o);e.moveTo(l*r+n,u*r+i),e.arc(n,i,r,o,a,!s)},t}(wV);AP.prototype.type="arc";let AR=AP,AE=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="compound",t}return yJ(t,e),t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t=t||e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],i=0;i<n.length;i++)n[i].buildPath(e,n[i].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),wV.prototype.getBoundingRect.call(this)},t}(wV);var AL=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}();let AN=function(e){function t(t,n,i,r,o,a){var s=e.call(this,o)||this;return s.x=null==t?0:t,s.y=null==n?0:n,s.x2=null==i?1:i,s.y2=null==r?0:r,s.type="linear",s.global=a||!1,s}return yJ(t,e),t}(AL),AB=function(e){function t(t,n,i,r,o){var a=e.call(this,r)||this;return a.x=null==t?.5:t,a.y=null==n?.5:n,a.r=null==i?.5:i,a.type="radial",a.global=o||!1,a}return yJ(t,e),t}(AL);var AF=[0,0],Az=[0,0],AV=new xi,Aj=new xi;let AH=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new xi;for(var n=0;n<2;n++)this._axes[n]=new xi;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,i=this._axes,r=e.x,o=e.y,a=r+e.width,s=o+e.height;if(n[0].set(r,o),n[1].set(a,o),n[2].set(a,s),n[3].set(r,s),t)for(var l=0;l<4;l++)n[l].transform(t);xi.sub(i[0],n[1],n[0]),xi.sub(i[1],n[3],n[0]),i[0].normalize(),i[1].normalize();for(var l=0;l<2;l++)this._origin[l]=i[l].dot(n[0])},e.prototype.intersect=function(e,t){var n=!0,i=!t;return(AV.set(1/0,1/0),Aj.set(0,0),!this._intersectCheckOneSide(this,e,AV,Aj,i,1)&&(n=!1,i)||!this._intersectCheckOneSide(e,this,AV,Aj,i,-1)&&(n=!1,i))?n:(i||xi.copy(t,n?AV:Aj),n)},e.prototype._intersectCheckOneSide=function(e,t,n,i,r,o){for(var a=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,e._corners,AF),this._getProjMinMaxOnAxis(s,t._corners,Az),AF[1]<Az[0]||AF[0]>Az[1]){if(a=!1,r)return a;var u=Math.abs(Az[0]-AF[1]),c=Math.abs(AF[0]-Az[1]);Math.min(u,c)>i.len()&&(u<c?xi.scale(i,l,-u*o):xi.scale(i,l,c*o))}else if(n){var u=Math.abs(Az[0]-AF[1]),c=Math.abs(AF[0]-Az[1]);Math.min(u,c)<n.len()&&(u<c?xi.scale(n,l,u*o):xi.scale(n,l,-c*o))}}return a},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var i=this._axes[e],r=this._origin,o=t[0].dot(i)+r[e],a=o,s=o,l=1;l<t.length;l++){var u=t[l].dot(i)+r[e];a=Math.min(u,a),s=Math.max(u,s)}n[0]=a,n[1]=s},e}();var AW=[];let AG=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return yJ(t,e),t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t=t||!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(var t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){var t=this._displayables[e];t.parent=this,t.update(),t.parent=null}for(var e=0;e<this._temporaryDisplayables.length;e++){var t=this._temporaryDisplayables[e];t.parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new xd(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],i=n.getBoundingRect().clone();n.needLocalTransform()&&i.applyTransform(n.getLocalTransform(AW)),e.union(i)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1])){for(var i=0;i<this._displayables.length;i++)if(this._displayables[i].contain(e,t))return!0}return!1},t}(b5);var A$=Math.max,AU=Math.min,Aq={};function AY(e){return wV.extend(e)}var AZ=function(e,t){var n=M1(e,t),i=MJ;function r(e){var t=i.call(this,e)||this;return t.applyTransform=n.applyTransform,t.buildPath=n.buildPath,t}return yJ(r,i),r};function AX(e,t){return AZ(e,t)}function AK(e,t){Aq[e]=t}function AQ(e){if(Aq.hasOwnProperty(e))return Aq[e]}function AJ(e,t,n,i){var r=new MJ(M1(e,t));return n&&("center"===i&&(n=A1(n,r.getBoundingRect())),A5(r,n)),r}function A0(e,t,n){var i=new wU({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===n){var r={width:e.width,height:e.height};i.setStyle(A1(t,r))}}});return i}function A1(e,t){var n,i=t.width/t.height,r=e.height*i;return n=r<=e.width?e.height:(r=e.width)/i,{x:e.x+e.width/2-r/2,y:e.y+e.height/2-n/2,width:r,height:n}}var A2=function(e,t){for(var n=[],i=e.length,r=0;r<i;r++){var o=e[r];n.push(o.getUpdatedPathProxy(!0))}var a=new wV(t);return a.createPathProxy(),a.buildPath=function(e){if(M0(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},a};function A5(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function A3(e,t){return wY(e,e,{lineWidth:t}),e}function A4(e){return wZ(e.shape,e.shape,e.style),e}var A6=wX;function A8(e,t){for(var n=y9([]);e&&e!==t;)y7(n,e.getLocalTransform(),n),e=e.parent;return n}function A9(e,t,n){return t&&!mU(t)&&(t=xq.getLocalTransform(t)),n&&(t=xn([],t)),xz([],e,t)}function A7(e,t,n){var i=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),r=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),o=["left"===e?-i:"right"===e?i:0,"top"===e?-r:"bottom"===e?r:0];return Math.abs((o=A9(o,t,n))[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function ke(e,t,n){if(e&&t){var i,r=(i={},e.traverse(function(e){!e.isGroup&&e.anid&&(i[e.anid]=e)}),i);t.traverse(function(e){if(!e.isGroup&&e.anid){var t=r[e.anid];if(t){var i=o(e);e.attr(o(t)),SQ(e,i,n,So(e).dataIndex)}}})}function o(e){var t={x:e.x,y:e.y,rotation:e.rotation};return null!=e.shape&&(t.shape=mH({},e.shape)),t}}function kt(e,t){return mY(e,function(e){var n=e[0];n=AU(n=A$(n,t.x),t.x+t.width);var i=e[1];return[n,i=AU(i=A$(i,t.y),t.y+t.height)]})}function kn(e,t){var n=A$(e.x,t.x),i=AU(e.x+e.width,t.x+t.width),r=A$(e.y,t.y),o=AU(e.y+e.height,t.y+t.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function ki(e,t,n){var i=mH({rectHover:!0},t),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(r.image=e.slice(8),mW(r,n),new wU(i)):AJ(e.replace("path://",""),i,n,"center")}function kr(e,t,n,i,r){for(var o=0,a=r[r.length-1];o<r.length;o++){var s=r[o];if(ko(e,t,n,i,s[0],s[1],a[0],a[1]))return!0;a=s}}function ko(e,t,n,i,r,o,a,s){var l,u=n-e,c=i-t,h=a-r,d=s-o,f=h*c-u*d;if((l=f)<=1e-6&&l>=-1e-6)return!1;var p=e-r,g=t-o,m=(p*c-u*g)/f;if(m<0||m>1)return!1;var v=(p*d-h*g)/f;return!(v<0)&&!(v>1)}function ka(e){var t=e.itemTooltipOption,n=e.componentModel,i=e.itemName,r=m2(t)?{formatter:t}:t,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=e.formatterParamsExtra;l&&mq(mK(l),function(e){vp(s,e)||(s[e]=l[e],s.$vars.push(e))});var u=So(e.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:i,option:mW({content:i,formatterParams:s},r)}}function ks(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function kl(e,t){if(e)if(m0(e))for(var n=0;n<e.length;n++)ks(e[n],t);else ks(e,t)}Aq.circle=M3,Aq.ellipse=M8,Aq.sector=Ah,Aq.ring=Ap,Aq.polygon=Ay,Aq.polyline=Aw,Aq.rect=w0,Aq.line=AM,Aq.bezierCurve=AD,Aq.arc=AR;var ku="\0__throttleOriginMethod",kc="\0__throttleRate",kh="\0__throttleType";function kd(e,t,n){var i,r,o,a,s,l=0,u=0,c=null;function h(){u=new Date().getTime(),c=null,e.apply(o,a||[])}t=t||0;var d=function(){for(var e=[],d=0;d<arguments.length;d++)e[d]=arguments[d];i=new Date().getTime(),o=this,a=e;var f=s||t,p=s||n;s=null,r=i-(p?l:u)-f,clearTimeout(c),p?c=setTimeout(h,f):r>=0?h():c=setTimeout(h,-r),l=i};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(e){s=e},d}function kf(e,t,n,i){var r=e[t];if(r){var o=r[ku]||r,a=r[kh];if(r[kc]!==n||a!==i){if(null==n||!i)return e[t]=o;(r=e[t]=kd(o,n,"debounce"===i))[ku]=o,r[kh]=i,r[kc]=n}return r}}function kp(e,t){var n=e[t];n&&n[ku]&&(n.clear&&n.clear(),e[t]=n[ku])}function kg(e,t,n,i,r){var o=e.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,c=n.get(["lineStyle","width"])||2;a-=c/2,s-=c/2,l+=c,u+=c,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var h=new w0({shape:{x:a,y:s,width:l,height:u}});if(t){var d=e.getBaseAxis(),f=d.isHorizontal(),p=d.inverse;f?(p&&(h.shape.x+=l),h.shape.width=0):(p||(h.shape.y+=u),h.shape.height=0);var g=m1(r)?function(e){r(e,h)}:null;SJ(h,{shape:{width:l,height:u,x:a,y:s}},n,null,i,g)}return h}function km(e,t,n){var i=e.getArea(),r=vx(i.r0,1),o=vx(i.r,1),a=new Ah({shape:{cx:vx(e.cx,1),cy:vx(e.cy,1),r0:r,r:o,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});return t&&("angle"===e.getBaseAxis().dim?a.shape.endAngle=i.startAngle:a.shape.r=r,SJ(a,{shape:{endAngle:i.endAngle,r:o}},n)),a}function kv(e,t,n,i,r){if(e){if("polar"===e.type)return km(e,t,n);else if("cartesian2d"===e.type)return kg(e,t,n,i,r)}return null}var ky=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},kx=function(e){function t(t){var n=e.call(this,t)||this;return n.type="sausage",n}return yz(t,e),t.prototype.getDefaultShape=function(){return new ky},t.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,r=Math.max(t.r0||0,0),o=Math.max(t.r,0),a=(o-r)*.5,s=r+a,l=t.startAngle,u=t.endAngle,c=t.clockwise,h=2*Math.PI,d=c?u-l<h:l-u<h;d||(l=u-(c?h:-h));var f=Math.cos(l),p=Math.sin(l),g=Math.cos(u),m=Math.sin(u);d?(e.moveTo(f*r+n,p*r+i),e.arc(f*s+n,p*s+i,a,-Math.PI+l,l,!c)):e.moveTo(f*o+n,p*o+i),e.arc(n,i,o,l,u,!c),e.arc(g*s+n,m*s+i,a,u-2*Math.PI,u-Math.PI,!c),0!==r&&e.arc(n,i,r,u,l,c)},t}(wV),kb=vq(),kw=yS(),kS=function(){function e(){this.group=new MF,this.uid=_w("viewChart"),this.renderTask=CD({plan:kM,reset:kA}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.highlight=function(e,t,n,i){var r=e.getData(i&&i.dataType);r&&kC(r,i,"emphasis")},e.prototype.downplay=function(e,t,n,i){var r=e.getData(i&&i.dataType);r&&kC(r,i,"normal")},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},e.prototype.eachRendered=function(e){kl(this.group,e)},e.markUpdateMethod=function(e,t){kb(e).updateMethod=t},e.protoInitialize=void(e.prototype.type="chart"),e}();function k_(e,t,n){e&&SU(e)&&("emphasis"===t?SP:SR)(e,n)}function kC(e,t,n){var i,r,o=vU(e,t),a=t&&null!=t.highlightKey?(null==(r=Sl[i=t.highlightKey])&&Ss<=32&&(r=Sl[i]=Ss++),r):null;null!=o?mq(vB(o),function(t){k_(e.getItemGraphicEl(t),n,a)}):e.eachItemGraphicEl(function(e){k_(e,n,a)})}function kM(e){return kw(e.model)}function kA(e){var t=e.model,n=e.ecModel,i=e.api,r=e.payload,o=t.pipelineContext.progressiveRender,a=e.view,s=r&&kb(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](t,n,i,r),kk[l]}yW(kS,["dispose"]),yY(kS);var kk={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}};function kT(e,t){return e.type===t}function kI(e,t){var n=e.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=CA(e,t,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a<n.length;a++)o.push(CA(e,t,n[a]));return o.join(" ")}}function kD(e,t){var n=e.mapDimensionsAll("defaultedLabel");if(!m0(t))return t+"";for(var i=[],r=0;r<n.length;r++){var o=e.getDimensionIndex(n[r]);o>=0&&i.push(t[o])}return i.join(" ")}function kO(e,t,n){return t*Math.sin(e)*(n?-1:1)}function kP(e,t,n){return t*Math.cos(e)*(n?1:-1)}function kR(e,t,n){var i=e.get("borderRadius");if(null==i)return n?{cornerRadius:0}:null;m0(i)||(i=[i,i,i,i]);var r=Math.abs(t.r||0-t.r0||0);return{cornerRadius:mY(i,function(e){return xb(e,r)})}}var kE=Math.max,kL=Math.min,kN=function(e){function t(){var n=e.call(this)||this;return n.type=t.type,n._isFirstFrame=!0,n}return yz(t,e),t.prototype.render=function(e,t,n,i){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var r=e.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,i))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){kl(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,i){var r,o=this.group,a=e.getData(),s=this._data,l=e.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?r=u.isHorizontal():"polar"===l.type&&(r="angle"===u.dim);var c=e.isAnimationEnabled()?e:null,h=function(e,t){var n=e.get("realtimeSort",!0),i=t.getBaseAxis();if(n&&"category"===i.type&&"cartesian2d"===t.type)return{baseAxis:i,otherAxis:t.getOtherAxis(i)}}(e,l);h&&this._enableRealtimeSort(h,a,n);var d=e.get("clip",!0)||h,f=function(e,t){var n=e.getArea&&e.getArea();if(kT(e,"cartesian2d")){var i=e.getBaseAxis();if("category"!==i.type||!i.onBand){var r=t.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}(l,a);o.removeClipPath();var p=e.get("roundCap",!0),g=e.get("showBackground",!0),m=e.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],x=this._backgroundEls,b=i&&i.isInitSort,w=i&&"changeAxisOrder"===i.type;function S(e){var t,n,i,o=kG[l.type](a,e),s=(t=l,n=r,i=o,new("polar"===t.type?Ah:w0)({shape:kK(n,i,t),silent:!0,z2:0}));return s.useStyle(m.getItemStyle()),"cartesian2d"===l.type?s.setShape("r",v):s.setShape("cornerRadius",v),y[e]=s,s}a.diff(s).add(function(t){var n=a.getItemModel(t),i=kG[l.type](a,t,n);if(g&&S(t),a.hasValue(t)&&kW[l.type](i)){var s=!1;d&&(s=kB[l.type](f,i));var m=kF[l.type](e,a,t,i,r,c,u.model,!1,p);h&&(m.forceLabelAnimation=!0),kU(m,a,t,n,i,e,r,"polar"===l.type),b?m.attr({shape:i}):h?kz(h,c,m,i,t,r,!1,!1):SJ(m,{shape:i},e,t),a.setItemGraphicEl(t,m),o.add(m),m.ignore=s}}).update(function(t,n){var i=a.getItemModel(t),_=kG[l.type](a,t,i);if(g){var C=void 0;0===x.length?C=S(n):((C=x[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?C.setShape("r",v):C.setShape("cornerRadius",v),y[t]=C);var M=kG[l.type](a,t);SQ(C,{shape:kK(r,M,l)},c,t)}var A=s.getItemGraphicEl(n);if(!a.hasValue(t)||!kW[l.type](_))return void o.remove(A);var k=!1;if(d&&(k=kB[l.type](f,_))&&o.remove(A),A?S3(A):A=kF[l.type](e,a,t,_,r,c,u.model,!!A,p),h&&(A.forceLabelAnimation=!0),w){var T=A.getTextContent();if(T){var I=_s(T);null!=I.prevValue&&(I.prevValue=I.value)}}else kU(A,a,t,i,_,e,r,"polar"===l.type);b?A.attr({shape:_}):h?kz(h,c,A,_,t,r,!0,w):SQ(A,{shape:_},e,t,null),a.setItemGraphicEl(t,A),A.ignore=k,o.add(A)}).remove(function(t){var n=s.getItemGraphicEl(t);n&&S5(n,e,t)}).execute();var _=this._backgroundGroup||(this._backgroundGroup=new MF);_.removeAll();for(var C=0;C<y.length;++C)_.add(y[C]);o.add(_),this._backgroundEls=y,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),kZ(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),kZ(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&kv(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var i=this;if(t.count()){var r=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var o=function(e){var n=t.getItemGraphicEl(e),i=n&&n.shape;return i&&Math.abs(r.isHorizontal()?i.height:i.width)||0};this._onRendered=function(){i._updateSortWithinSameData(t,o,r,n)},n.getZr().on("rendered",this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var i=[];return e.each(e.mapDimension(t.dim),function(e,t){var r=n(t);r=null==r?NaN:r,i.push({dataIndex:t,mappedValue:r,ordinalNumber:e})}),i.sort(function(e,t){return t.mappedValue-e.mappedValue}),{ordinalNumbers:mY(i,function(e){return e.ordinalNumber})}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var i=n.scale,r=e.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=i.getOrdinalMeta().categories.length;a<s;++a){var l=e.rawIndexOf(r,i.getRawOrdinalNumber(a)),u=l<0?5e-324:t(e.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,i=n.getExtent(),r=Math.max(0,i[0]),o=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=o;++r)if(e.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,i){if(this._isOrderChangedWithinSameData(e,t,n)){var r=this._dataSort(e,n,t);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},t.prototype._dispatchInitSort=function(e,t,n){var i=t.baseAxis,r=this._dataSort(e,i,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){S5(t,e,So(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type="bar",t}(kS),kB={cartesian2d:function(e,t){var n=t.width<0?-1:1,i=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height);var r=e.x+e.width,o=e.y+e.height,a=kE(t.x,e.x),s=kL(t.x+t.width,r),l=kE(t.y,e.y),u=kL(t.y+t.height,o),c=s<a,h=u<l;return t.x=c&&a>r?s:a,t.y=h&&l>o?u:l,t.width=c?0:s-a,t.height=h?0:u-l,n<0&&(t.x+=t.width,t.width=-t.width),i<0&&(t.y+=t.height,t.height=-t.height),c||h},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var i=t.r;t.r=t.r0,t.r0=i}var r=kL(t.r,e.r),o=kE(t.r0,e.r0);t.r=r,t.r0=o;var a=r-o<0;if(n<0){var i=t.r;t.r=t.r0,t.r0=i}return a}},kF={cartesian2d:function(e,t,n,i,r,o,a,s,l){var u=new w0({shape:mH({},i),z2:1});return u.__dataIndex=n,u.name="item",o&&(u.shape[r?"height":"width"]=0),u},polar:function(e,t,n,i,r,o,a,s,l){var u,c,h=!r&&l?kx:Ah,d=new h({shape:i,z2:1});if(d.name="item",u=k$(r),c=h===kx,d.calculateTextPosition=function(e,t,n){var i=t.position;if(!i||i instanceof Array)return xw(e,t,n);var r=u(i),o=null!=t.distance?t.distance:5,a=this.shape,s=a.cx,l=a.cy,h=a.r,d=a.r0,f=(h+d)/2,p=a.startAngle,g=a.endAngle,m=(p+g)/2,v=c?Math.abs(h-d)/2:0,y=Math.cos,x=Math.sin,b=s+h*y(p),w=l+h*x(p),S="left",_="top";switch(r){case"startArc":b=s+(d-o)*y(m),w=l+(d-o)*x(m),S="center",_="top";break;case"insideStartArc":b=s+(d+o)*y(m),w=l+(d+o)*x(m),S="center",_="bottom";break;case"startAngle":b=s+f*y(p)+kO(p,o+v,!1),w=l+f*x(p)+kP(p,o+v,!1),S="right",_="middle";break;case"insideStartAngle":b=s+f*y(p)+kO(p,-o+v,!1),w=l+f*x(p)+kP(p,-o+v,!1),S="left",_="middle";break;case"middle":b=s+f*y(m),w=l+f*x(m),S="center",_="middle";break;case"endArc":b=s+(h+o)*y(m),w=l+(h+o)*x(m),S="center",_="bottom";break;case"insideEndArc":b=s+(h-o)*y(m),w=l+(h-o)*x(m),S="center",_="top";break;case"endAngle":b=s+f*y(g)+kO(g,o+v,!0),w=l+f*x(g)+kP(g,o+v,!0),S="left",_="middle";break;case"insideEndAngle":b=s+f*y(g)+kO(g,-o+v,!0),w=l+f*x(g)+kP(g,-o+v,!0),S="right",_="middle";break;default:return xw(e,t,n)}return(e=e||{}).x=b,e.y=w,e.align=S,e.verticalAlign=_,e},o){var f=d.shape,p=r?"r":"endAngle",g={};f[p]=r?i.r0:i.startAngle,g[p]=i[p],(s?SQ:SJ)(d,{shape:g},o)}return d}};function kz(e,t,n,i,r,o,a,s){var l,u;o?(u={x:i.x,width:i.width},l={y:i.y,height:i.height}):(u={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?SQ:SJ)(n,{shape:l},t,r,null),(a?SQ:SJ)(n,{shape:u},t?e.baseAxis.model:null,r)}function kV(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}var kj=["x","y","width","height"],kH=["cx","cy","r","startAngle","endAngle"],kW={cartesian2d:function(e){return!kV(e,kj)},polar:function(e){return!kV(e,kH)}},kG={cartesian2d:function(e,t,n){var i,r,o,a=e.getItemLayout(t),s=n?(i=n,r=a,(o=i.get(["itemStyle","borderColor"]))&&"none"!==o?Math.min(i.get(["itemStyle","borderWidth"])||0,isNaN(r.width)?Number.MAX_VALUE:Math.abs(r.width),isNaN(r.height)?Number.MAX_VALUE:Math.abs(r.height)):0):0,l=a.width>0?1:-1,u=a.height>0?1:-1;return{x:a.x+l*s/2,y:a.y+u*s/2,width:a.width-l*s,height:a.height-u*s}},polar:function(e,t,n){var i=e.getItemLayout(t);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function k$(e){var t;return t=e?"Arc":"Angle",function(e){switch(e){case"start":case"insideStart":case"end":case"insideEnd":return e+t;default:return e}}}function kU(e,t,n,i,r,o,a,s){var l=t.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=e.shape,c=kR(i.getModel("itemStyle"),u,!0);mH(u,c),e.setShape(u)}}else{var h=i.get(["itemStyle","borderRadius"])||0;e.setShape("r",h)}e.useStyle(l);var d=i.getShallow("cursor");d&&e.attr("cursor",d);var f=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",p=S7(i);S9(e,p,{labelFetcher:o,labelDataIndex:n,defaultText:kI(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:f});var g=e.getTextContent();if(s&&g){var m=i.get(["label","position"]);e.textConfig.inside="middle"===m||null,function(e,t,n,i){if(m3(i))return e.setTextConfig({rotation:i});if(m0(t))return e.setTextConfig({rotation:0});var r,o=e.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=n(t);switch(l){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=(a+s)/2;break;case"startAngle":case"insideStartAngle":r=a;break;case"endAngle":case"insideEndAngle":r=s;break;default:e.setTextConfig({rotation:0});return}var u=1.5*Math.PI-r;"middle"===l&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),e.setTextConfig({rotation:u})}(e,"outside"===m?f:m,k$(a),i.get(["label","rotate"]))}_l(g,p,o.getRawValue(n),function(e){return kD(t,e)});var v=i.getModel(["emphasis"]);Sj(e,v.get("focus"),v.get("blurScope"),v.get("disabled")),SG(e,i),null!=r.startAngle&&null!=r.endAngle&&r.startAngle===r.endAngle&&(e.style.fill="none",e.style.stroke="none",mq(e.states,function(e){e.style&&(e.style.fill=e.style.stroke="none")}))}var kq=function(){},kY=function(e){function t(t){var n=e.call(this,t)||this;return n.type="largeBar",n}return yz(t,e),t.prototype.getDefaultShape=function(){return new kq},t.prototype.buildPath=function(e,t){for(var n=t.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[i]=s,a[r]=n[l+2],o[i]=n[l+i],o[r]=n[l+r],e.rect(o[0],o[1],a[0],a[1])},t}(wV);function kZ(e,t,n,i){var r=e.getData(),o=+!!r.getLayout("valueAxisHorizontal"),a=r.getLayout("largeDataIndices"),s=r.getLayout("size"),l=e.getModel("backgroundStyle"),u=r.getLayout("largeBackgroundPoints");if(u){var c=new kY({shape:{points:u},incremental:!!i,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),t.add(c),n&&n.push(c)}var h=new kY({shape:{points:r.getLayout("largePoints")},incremental:!!i,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=a,h.barWidth=s,t.add(h),h.useStyle(r.getVisual("style")),So(h).seriesIndex=e.seriesIndex,e.get("silent")||(h.on("mousedown",kX),h.on("mousemove",kX)),n&&n.push(h)}var kX=kd(function(e){var t=function(e,t,n){for(var i=e.baseDimIdx,r=1-i,o=e.shape.points,a=e.largeDataIndices,s=[],l=[],u=e.barWidth,c=0,h=o.length/3;c<h;c++){var d=3*c;if(l[i]=u,l[r]=o[d+2],s[i]=o[d+i],s[r]=o[d+r],l[r]<0&&(s[r]+=l[r],l[r]=-l[r]),t>=s[0]&&t<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[c]}return -1}(this,e.offsetX,e.offsetY);So(this).dataIndex=t>=0?t:null},30,!1);function kK(e,t,n){if(kT(n,"cartesian2d")){var i=n.getArea();return{x:e?t.x:i.x,y:e?i.y:t.y,width:e?t.width:i.width,height:e?i.height:t.height}}var i=n.getArea();return{cx:i.cx,cy:i.cy,r0:e?i.r0:t.r0,r:e?i.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}}var kQ=wV.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,i=t.cy,r=t.width/2,o=t.height/2;e.moveTo(n,i-o),e.lineTo(n+r,i+o),e.lineTo(n-r,i+o),e.closePath()}}),kJ=wV.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,i=t.cy,r=t.width/2,o=t.height/2;e.moveTo(n,i-o),e.lineTo(n+r,i),e.lineTo(n,i+o),e.lineTo(n-r,i),e.closePath()}}),k0=wV.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,i=t.y,r=t.width/5*3,o=Math.max(r,t.height),a=r/2,s=a*a/(o-a),l=i-o+a+s,u=Math.asin(s/a),c=Math.cos(u)*a,h=Math.sin(u),d=Math.cos(u),f=.6*a,p=.7*a;e.moveTo(n-c,l+s),e.arc(n,l,a,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(n+c-h*f,l+s+d*f,n,i-p,n,i),e.bezierCurveTo(n,i-p,n-c+h*f,l+s+d*f,n-c,l+s),e.closePath()}}),k1=wV.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,i=t.width,r=t.x,o=t.y,a=i/3*2;e.moveTo(r,o),e.lineTo(r+a,o+n),e.lineTo(r,o+n/4*3),e.lineTo(r-a,o+n),e.lineTo(r,o),e.closePath()}}),k2={line:function(e,t,n,i,r){r.x1=e,r.y1=t+i/2,r.x2=e+n,r.y2=t+i/2},rect:function(e,t,n,i,r){r.x=e,r.y=t,r.width=n,r.height=i},roundRect:function(e,t,n,i,r){r.x=e,r.y=t,r.width=n,r.height=i,r.r=Math.min(n,i)/4},square:function(e,t,n,i,r){var o=Math.min(n,i);r.x=e,r.y=t,r.width=o,r.height=o},circle:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.r=Math.min(n,i)/2},diamond:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.width=n,r.height=i},pin:function(e,t,n,i,r){r.x=e+n/2,r.y=t+i/2,r.width=n,r.height=i},arrow:function(e,t,n,i,r){r.x=e+n/2,r.y=t+i/2,r.width=n,r.height=i},triangle:function(e,t,n,i,r){r.cx=e+n/2,r.cy=t+i/2,r.width=n,r.height=i}},k5={};mq({line:AM,rect:w0,roundRect:w0,square:w0,circle:M3,diamond:kJ,pin:k0,arrow:k1,triangle:kQ},function(e,t){k5[t]=new e});var k3=wV.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var i=xw(e,t,n),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===t.position&&(i.y=n.y+.4*n.height),i},buildPath:function(e,t,n){var i=t.symbolType;if("none"!==i){var r=k5[i];r||(r=k5[i="rect"]),k2[i](t.x,t.y,t.width,t.height,r.shape),r.buildPath(e,r.shape,n)}}});function k4(e,t){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||"#fff",n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=e:n.fill=e,this.markRedraw()}}function k6(e,t,n,i,r,o,a){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?A0(e.slice(8),new xd(t,n,i,r),a?"center":"cover"):0===e.indexOf("path://")?AJ(e.slice(7),{},new xd(t,n,i,r),a?"center":"cover"):new k3({shape:{symbolType:e,x:t,y:n,width:i,height:r}})).__isEmptyBrush=l,s.setColor=k4,o&&s.setColor(o),s}function k8(e){return m0(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function k9(e,t){if(null!=e)return m0(e)||(e=[e,e]),[vy(e[0],t[0])||0,vy(vt(e[1],e[0]),t[1])||0]}var k7=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return yz(t,e),t.prototype.getInitialData=function(e){return ME(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new MF,n=k6("line",0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var i=this.getData().getVisual("symbol"),r=this.getData().getVisual("symbolRotate"),o="none"===i?"circle":i,a=.8*e.itemHeight,s=k6(o,(e.itemWidth-a)/2,(e.itemHeight-a)/2,a,a,e.itemStyle.fill);return t.add(s),s.setStyle(e.itemStyle),s.rotation=("inherit"===e.iconRotate?r:e.iconRotate||0)*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),t},t.type="series.line",t.dependencies=["grid","polar"],t.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},t}(Mu),Te=function(e){function t(t,n,i,r){var o=e.call(this)||this;return o.updateData(t,n,i,r),o}return yz(t,e),t.prototype._createSymbol=function(e,t,n,i,r){this.removeAll();var o=k6(e,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=Tt,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){SP(this.childAt(0))},t.prototype.downplay=function(){SR(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?"move":n.cursor},t.prototype.updateData=function(e,n,i,r){this.silent=!1;var o=e.getItemVisual(n,"symbol")||"circle",a=e.hostModel,s=t.getSymbolSize(e,n),l=o!==this._symbolType,u=r&&r.disableAnimation;if(l){var c=e.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,e,n,s,c)}else{var h=this.childAt(0);h.silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};u?h.attr(d):SQ(h,d,a,n),S3(h)}if(this._updateCommon(e,n,s,i,r),l){var h=this.childAt(0);if(!u){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,SJ(h,d,a,n)}}u&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(e,t,n,i,r){var o,a,s,l,u,c,h,d,f,p=this.childAt(0),g=e.hostModel;if(i&&(o=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,u=i.blurScope,h=i.labelStatesModels,d=i.hoverScale,f=i.cursorStyle,c=i.emphasisDisabled),!i||e.hasItemOption){var m=i&&i.itemModel?i.itemModel:e.getItemModel(t),v=m.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),c=v.get("disabled"),h=S7(m),d=v.getShallow("scale"),f=m.getShallow("cursor")}var y=e.getItemVisual(t,"symbolRotate");p.attr("rotation",(y||0)*Math.PI/180||0);var x=k9(e.getItemVisual(t,"symbolOffset"),n);x&&(p.x=x[0],p.y=x[1]),f&&p.attr("cursor",f);var b=e.getItemVisual(t,"style"),w=b.fill;if(p instanceof wU){var S=p.style;p.useStyle(mH({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else p.__isEmptyBrush?p.useStyle(mH({},b)):p.useStyle(b),p.style.decal=null,p.setColor(w,r&&r.symbolInnerColor),p.style.strokeNoScale=!0;var _=e.getItemVisual(t,"liftZ"),C=this._z2;null!=_?null==C&&(this._z2=p.z2,p.z2+=_):null!=C&&(p.z2=C,this._z2=null);var M=r&&r.useNameLabel;S9(p,h,{labelFetcher:g,labelDataIndex:t,defaultText:function(t){return M?e.getName(t):kI(e,t)},inheritColor:w,defaultOpacity:b.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var A=p.ensureState("emphasis");A.style=o,p.ensureState("select").style=s,p.ensureState("blur").style=a;var k=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;A.scaleX=this._sizeX*k,A.scaleY=this._sizeY*k,this.setSymbolScale(1),Sj(this,l,u,c)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var i=this.childAt(0),r=So(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&S1(a,{style:{opacity:0}},t,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();S1(i,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:r,cb:e,removeOpt:o})},t.getSymbolSize=function(e,t){return k8(e.getItemVisual(t,"symbolSize"))},t}(MF);function Tt(e,t){this.parent.drift(e,t)}function Tn(e,t,n,i){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(n,"symbol")}function Ti(e){return null==e||m4(e)||(e={isIgnore:e}),e||{}}function Tr(e){var t=e.hostModel,n=t.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:t.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:t.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:S7(t),cursorStyle:t.get("cursor")}}var To=function(){function e(e){this.group=new MF,this._SymbolCtor=e||Te}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=Ti(t);var n=this.group,i=e.hostModel,r=this._data,o=this._SymbolCtor,a=t.disableAnimation,s=Tr(e),l={disableAnimation:a},u=t.getSymbolPoint||function(t){return e.getItemLayout(t)};r||n.removeAll(),e.diff(r).add(function(i){var r=u(i);if(Tn(e,r,i,t)){var a=new o(e,i,s,l);a.setPosition(r),e.setItemGraphicEl(i,a),n.add(a)}}).update(function(c,h){var d=r.getItemGraphicEl(h),f=u(c);if(!Tn(e,f,c,t))return void n.remove(d);var p=e.getItemVisual(c,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==p)n.remove(d),(d=new o(e,c,s,l)).setPosition(f);else{d.updateData(e,c,s,l);var m={x:f[0],y:f[1]};a?d.attr(m):SQ(d,m,i)}n.add(d),e.setItemGraphicEl(c,d)}).remove(function(e){var t=r.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},i)}).execute(),this._getSymbolPoint=u,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(t,n){var i=e._getSymbolPoint(n);t.setPosition(i),t.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=Tr(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){function i(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=Ti(n);for(var r=e.start;r<e.end;r++){var o=t.getItemLayout(r);if(Tn(t,o,r,n)){var a=new this._SymbolCtor(t,r,this._seriesScope);a.traverse(i),a.setPosition(o),this.group.add(a),t.setItemGraphicEl(r,a),this._progressiveEls.push(a)}}},e.prototype.eachRendered=function(e){kl(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(e){e.fadeOut(function(){t.remove(e)},n.hostModel)}):t.removeAll()},e}();function Ta(e,t,n){var i,r,o,a,s=e.getBaseAxis(),l=e.getOtherAxis(s),u=(i=l,r=n,o=0,a=i.scale.getExtent(),"start"===r?o=a[0]:"end"===r?o=a[1]:m3(r)&&!isNaN(r)?o=r:a[0]>0?o=a[0]:a[1]<0&&(o=a[1]),o),c=s.dim,h=l.dim,d=t.mapDimension(h),f=t.mapDimension(c),p=+("x"===h||"radius"===h),g=mY(e.dimensions,function(e){return t.mapDimension(e)}),m=!1,v=t.getCalculationInfo("stackResultDimension");return yb(t,g[0])&&(m=!0,g[0]=v),yb(t,g[1])&&(m=!0,g[1]=v),{dataDimsForPoint:g,valueStart:u,valueAxisDim:h,baseAxisDim:c,stacked:!!m,valueDim:d,baseDim:f,baseDataOffset:p,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}}function Ts(e,t,n,i){var r=NaN;e.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=e.valueStart);var o=e.baseDataOffset,a=[];return a[o]=n.get(e.baseDim,i),a[1-o]=r,t.dataToPoint(a)}var Tl=Math.min,Tu=Math.max;function Tc(e,t){return isNaN(e)||isNaN(t)}function Th(e,t,n,i,r,o,a,s,l){for(var u,c,h,d,f,p,g=n,m=0;m<i;m++){var v=t[2*g],y=t[2*g+1];if(g>=r||g<0)break;if(Tc(v,y)){if(l){g+=o;continue}break}if(g===n)e[o>0?"moveTo":"lineTo"](v,y),h=v,d=y;else{var x=v-u,b=y-c;if(x*x+b*b<.5){g+=o;continue}if(a>0){for(var w=g+o,S=t[2*w],_=t[2*w+1];S===v&&_===y&&m<i;)m++,w+=o,g+=o,S=t[2*w],_=t[2*w+1],v=t[2*g],y=t[2*g+1],x=v-u,b=y-c;var C=m+1;if(l)for(;Tc(S,_)&&C<i;)C++,w+=o,S=t[2*w],_=t[2*w+1];var M=.5,A=0,k=0,T=void 0,I=void 0;if(C>=i||Tc(S,_))f=v,p=y;else{A=S-u,k=_-c;var D=v-u,O=S-v,P=y-c,R=_-y,E=void 0,L=void 0;if("x"===s){E=Math.abs(D),L=Math.abs(O);var N=A>0?1:-1;f=v-N*E*a,p=y,T=v+N*L*a,I=y}else if("y"===s){E=Math.abs(P),L=Math.abs(R);var B=k>0?1:-1;f=v,p=y-B*E*a,T=v,I=y+B*L*a}else E=Math.sqrt(D*D+P*P),f=v-A*a*(1-(M=(L=Math.sqrt(O*O+R*R))/(L+E))),p=y-k*a*(1-M),T=v+A*a*M,I=y+k*a*M,T=Tl(T,Tu(S,v)),I=Tl(I,Tu(_,y)),T=Tu(T,Tl(S,v)),I=Tu(I,Tl(_,y)),A=T-v,k=I-y,f=v-A*E/L,p=y-k*E/L,f=Tl(f,Tu(u,v)),p=Tl(p,Tu(c,y)),f=Tu(f,Tl(u,v)),p=Tu(p,Tl(c,y)),A=v-f,k=y-p,T=v+A*L/E,I=y+k*L/E}e.bezierCurveTo(h,d,f,p,v,y),h=T,d=I}else e.lineTo(v,y)}u=v,c=y,g+=o}return m}var Td=function(){this.smooth=0,this.smoothConstraint=!0},Tf=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polyline",n}return yz(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Td},t.prototype.buildPath=function(e,t){var n=t.points,i=0,r=n.length/2;if(t.connectNulls){for(;r>0&&Tc(n[2*r-2],n[2*r-1]);r--);for(;i<r&&Tc(n[2*i],n[2*i+1]);i++);}for(;i<r;)i+=Th(e,n,i,r,r,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,i,r=this.path.data,o=wA.CMD,a="x"===t,s=[],l=0;l<r.length;){var u=r[l++],c=void 0,h=void 0,d=void 0,f=void 0,p=void 0,g=void 0,m=void 0;switch(u){case o.M:n=r[l++],i=r[l++];break;case o.L:if(c=r[l++],h=r[l++],(m=a?(e-n)/(c-n):(e-i)/(h-i))<=1&&m>=0){var v=a?(h-i)*m+i:(c-n)*m+n;return a?[e,v]:[v,e]}n=c,i=h;break;case o.C:c=r[l++],h=r[l++],d=r[l++],f=r[l++],p=r[l++],g=r[l++];var y=a?x8(n,c,d,p,e,s):x8(i,h,f,g,e,s);if(y>0)for(var x=0;x<y;x++){var b=s[x];if(b<=1&&b>=0){var v=a?x4(i,h,f,g,b):x4(n,c,d,p,b);return a?[e,v]:[v,e]}}n=p,i=g}}},t}(wV),Tp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t}(Td),Tg=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-polygon",n}return yz(t,e),t.prototype.getDefaultShape=function(){return new Tp},t.prototype.buildPath=function(e,t){var n=t.points,i=t.stackedOnPoints,r=0,o=n.length/2,a=t.smoothMonotone;if(t.connectNulls){for(;o>0&&Tc(n[2*o-2],n[2*o-1]);o--);for(;r<o&&Tc(n[2*r],n[2*r+1]);r++);}for(;r<o;){var s=Th(e,n,r,o,o,1,t.smooth,a,t.connectNulls);Th(e,i,r+s-1,s,o,-1,t.stackedOnSmooth,a,t.connectNulls),r+=s+1,e.closePath()}},t}(wV);function Tm(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function Tv(e){for(var t=1/0,n=1/0,i=-1/0,r=-1/0,o=0;o<e.length;){var a=e[o++],s=e[o++];isNaN(a)||(t=Math.min(a,t),i=Math.max(a,i)),isNaN(s)||(n=Math.min(s,n),r=Math.max(s,r))}return[[t,n],[i,r]]}function Ty(e,t){var n=Tv(e),i=n[0],r=n[1],o=Tv(t),a=o[0],s=o[1];return Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(r[0]-s[0]),Math.abs(r[1]-s[1]))}function Tx(e){return m3(e)?e:.5*!!e}function Tb(e,t,n,i){var r=t.getBaseAxis(),o=+("x"!==r.dim&&"radius"!==r.dim),a=[],s=0,l=[],u=[],c=[],h=[];if(i){for(s=0;s<e.length;s+=2)isNaN(e[s])||isNaN(e[s+1])||h.push(e[s],e[s+1]);e=h}for(s=0;s<e.length-2;s+=2)switch(c[0]=e[s+2],c[1]=e[s+3],u[0]=e[s],u[1]=e[s+1],a.push(u[0],u[1]),n){case"end":l[o]=c[o],l[1-o]=u[1-o],a.push(l[0],l[1]);break;case"middle":var d=(u[o]+c[o])/2,f=[];l[o]=f[o]=d,l[1-o]=u[1-o],f[1-o]=c[1-o],a.push(l[0],l[1]),a.push(f[0],f[1]);break;default:l[o]=u[o],l[1-o]=c[1-o],a.push(l[0],l[1])}return a.push(e[s++],e[s++]),a}function Tw(e,t){return[e[2*t],e[2*t+1]]}function TS(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t<Sh.length;t++)if(e.get([Sh[t],"endLabel","show"]))return!0;return!1}function T_(e,t,n,i){if(!kT(t,"cartesian2d"))return km(t,n,i);var r=i.getModel("endLabel"),o=r.get("valueAnimation"),a=i.getData(),s={lastFrameIndex:0},l=TS(i)?function(n,i){e._endLabelOnDuring(n,i,a,s,o,r,t)}:null,u=t.getBaseAxis().isHorizontal(),c=kg(t,n,i,function(){var t=e._endLabel;t&&n&&null!=s.originalX&&t.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var h=c.shape,d=Math.max(h.width,h.height);u?(h.y-=d,h.height+=2*d):(h.x-=d,h.width+=2*d)}return l&&l(1,c),c}var TC=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.init=function(){var e=new MF,t=new To;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},t.prototype.render=function(e,t,n){var i,r=this,o=e.coordinateSystem,a=this.group,s=e.getData(),l=e.getModel("lineStyle"),u=e.getModel("areaStyle"),c=s.getLayout("points")||[],h="polar"===o.type,d=this._coordSys,f=this._symbolDraw,p=this._polyline,g=this._polygon,m=this._lineGroup,v=!t.ssr&&e.get("animation"),y=!u.isEmpty(),x=u.get("origin"),b=Ta(o,s,x),w=y&&function(e,t,n){if(!n.valueDim)return[];for(var i=t.count(),r=yM(2*i),o=0;o<i;o++){var a=Ts(n,e,t,o);r[2*o]=a[0],r[2*o+1]=a[1]}return r}(o,s,b),S=e.get("showSymbol"),_=e.get("connectNulls"),C=S&&!h&&function(e,t,n){var i=e.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&!(r&&function(e,t){var n=e.getExtent(),i=Math.abs(n[1]-n[0])/e.scale.count();isNaN(i)&&(i=0);for(var r=t.count(),o=Math.max(1,Math.round(r/5)),a=0;a<r;a+=o)if(1.5*Te.getSymbolSize(t,a)[+!!e.isHorizontal()]>i)return!1;return!0}(o,t))){var a=t.mapDimension(o.dim),s={};return mq(o.getViewLabels(),function(e){s[o.scale.getRawOrdinalNumber(e.tickValue)]=1}),function(e){return!s.hasOwnProperty(t.get(a,e))}}}}(e,s,o),M=this._data;M&&M.eachItemGraphicEl(function(e,t){e.__temp&&(a.remove(e),M.setItemGraphicEl(t,null))}),S||f.remove(),a.add(m);var A=!h&&e.get("step");o&&o.getArea&&e.get("clip",!0)&&(null!=(i=o.getArea()).width?(i.x-=.1,i.y-=.1,i.width+=.2,i.height+=.2):i.r0&&(i.r0-=.5,i.r+=.5)),this._clipShapeForSymbol=i;var k=function(e,t,n){var i,r,o=e.getVisual("visualMeta");if(o&&o.length&&e.count()){if("cartesian2d"!==t.type)return;for(var a=o.length-1;a>=0;a--){var s=e.getDimensionInfo(o[a].dimension);if("x"===(i=s&&s.coordDim)||"y"===i){r=o[a];break}}if(!r)return;var l=t.getAxis(i),u=mY(r.stops,function(e){return{coord:l.toGlobalCoord(l.dataToCoord(e.value)),color:e.color}}),c=u.length,h=r.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),h.reverse());var d=function(e,t){var n,i,r=[],o=e.length;function a(e,t,n){var i=e.coord,r=function(e,t){if(t&&t.length&&e>=0&&e<=1){var n,i,r,o,a=e*(t.length-1),s=Math.floor(a),l=Math.ceil(a),u=by(t[s]),c=by(t[l]),h=a-s;return bC([bl((n=u[0],n+(c[0]-n)*h)),bl((i=u[1],i+(c[1]-i)*h)),bl((r=u[2],r+(c[2]-r)*h)),bu((o=u[3],o+(c[3]-o)*h))],"rgba")}}((n-i)/(t.coord-i),[e.color,t.color]);return{coord:n,color:r}}for(var s=0;s<o;s++){var l=e[s],u=l.coord;if(u<0)n=l;else if(u>t){i?r.push(a(i,l,t)):n&&r.push(a(n,l,0),a(n,l,t));break}else n&&(r.push(a(n,l,0)),n=null),r.push(l),i=l}return r}(u,"x"===i?n.getWidth():n.getHeight()),f=d.length;if(!f&&c)return u[0].coord<0?h[1]?h[1]:u[c-1].color:h[0]?h[0]:u[0].color;var p=d[0].coord-10,g=d[f-1].coord+10,m=g-p;if(m<.001)return"transparent";mq(d,function(e){e.offset=(e.coord-p)/m}),d.push({offset:f?d[f-1].offset:.5,color:h[1]||"transparent"}),d.unshift({offset:f?d[0].offset:.5,color:h[0]||"transparent"});var v=new AN(0,0,0,0,d,!0);return v[i]=p,v[i+"2"]=g,v}}(s,o,n)||s.getVisual("style")[s.getVisual("drawType")];if(p&&d.type===o.type&&A===this._step){y&&!g?g=this._newPolygon(c,w):g&&!y&&(m.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(e,o,Cn(k));var T=m.getClipPath();T?SJ(T,{shape:T_(this,o,!1,e).shape},e):m.setClipPath(T_(this,o,!0,e)),S&&f.updateData(s,{isIgnore:C,clipShape:i,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),Tm(this._stackedOnPoints,w)&&Tm(this._points,c)||(v?this._doUpdateAnimation(s,w,o,n,A,x,_):(A&&(c=Tb(c,o,A,_),w&&(w=Tb(w,o,A,_))),p.setShape({points:c}),g&&g.setShape({points:c,stackedOnPoints:w})))}else S&&f.updateData(s,{isIgnore:C,clipShape:i,disableAnimation:!0,getSymbolPoint:function(e){return[c[2*e],c[2*e+1]]}}),v&&this._initSymbolLabelAnimation(s,o,i),A&&(c=Tb(c,o,A,_),w&&(w=Tb(w,o,A,_))),p=this._newPolyline(c),y?g=this._newPolygon(c,w):g&&(m.remove(g),g=this._polygon=null),h||this._initOrUpdateEndLabel(e,o,Cn(k)),m.setClipPath(T_(this,o,!0,e));var I=e.getModel("emphasis"),D=I.get("focus"),O=I.get("blurScope"),P=I.get("disabled");p.useStyle(mW(l.getLineStyle(),{fill:"none",stroke:k,lineJoin:"bevel"})),SG(p,e,"lineStyle"),p.style.lineWidth>0&&"bolder"===e.get(["emphasis","lineStyle","width"])&&(p.getState("emphasis").style.lineWidth=+p.style.lineWidth+1),So(p).seriesIndex=e.seriesIndex,Sj(p,D,O,P);var R=Tx(e.get("smooth")),E=e.get("smoothMonotone");if(p.setShape({smooth:R,smoothMonotone:E,connectNulls:_}),g){var L=s.getCalculationInfo("stackedOnSeries"),N=0;g.useStyle(mW(u.getAreaStyle(),{fill:k,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),L&&(N=Tx(L.get("smooth"))),g.setShape({smooth:R,stackedOnSmooth:N,smoothMonotone:E,connectNulls:_}),SG(g,e,"areaStyle"),So(g).seriesIndex=e.seriesIndex,Sj(g,D,O,P)}var B=function(e){r._changePolyState(e)};s.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=B)}),this._polyline.onHoverStateChange=B,this._data=s,this._coordSys=o,this._stackedOnPoints=w,this._points=c,this._step=A,this._valueOrigin=x,e.get("triggerLineEvent")&&(this.packEventData(e,p),g&&this.packEventData(e,g))},t.prototype.packEventData=function(e,t){So(t).eventData={componentType:"series",componentSubType:"line",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"line"}},t.prototype.highlight=function(e,t,n,i){var r=e.getData(),o=vU(r,i);if(this._changePolyState("emphasis"),o instanceof Array||null==o||!(o>=0))kS.prototype.highlight.call(this,e,t,n,i);else{var a=r.getLayout("points"),s=r.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(isNaN(l)||isNaN(u)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var c=e.get("zlevel")||0,h=e.get("z")||0;(s=new Te(r,o)).x=l,s.y=u,s.setZ(c,h);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=c,d.z=h,d.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}},t.prototype.downplay=function(e,t,n,i){var r=e.getData(),o=vU(r,i);if(this._changePolyState("normal"),null!=o&&o>=0){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else kS.prototype.downplay.call(this,e,t,n,i)},t.prototype._changePolyState=function(e){var t=this._polygon;Sk(this._polyline,e),t&&Sk(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new Tf({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new Tg({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var i,r,o=t.getBaseAxis(),a=o.inverse;"cartesian2d"===t.type?(i=o.isHorizontal(),r=!1):"polar"===t.type&&(i="angle"===o.dim,r=!0);var s=e.hostModel,l=s.get("animationDuration");m1(l)&&(l=l(null));var u=s.get("animationDelay")||0,c=m1(u)?u(null):u;e.eachItemGraphicEl(function(e,o){if(e){var s=[e.x,e.y],h=void 0,d=void 0,f=void 0;if(n)if(r){var p=t.pointToCoord(s);i?(h=n.startAngle,d=n.endAngle,f=-p[1]/180*Math.PI):(h=n.r0,d=n.r,f=p[0])}else i?(h=n.x,d=n.x+n.width,f=e.x):(h=n.y+n.height,d=n.y,f=e.y);var g=d===h?0:(f-h)/(d-h);a&&(g=1-g);var m=m1(u)?u(o):l*g+c,v=e.getSymbolPath(),y=v.getTextContent();e.attr({scaleX:0,scaleY:0}),e.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:m}),y&&y.animateFrom({style:{opacity:0}},{duration:300,delay:m}),v.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var i=e.getModel("endLabel");if(TS(e)){var r,o,a,s=e.getData(),l=this._polyline,u=s.getLayout("points");if(!u){l.removeTextContent(),this._endLabel=null;return}var c=this._endLabel;c||((c=this._endLabel=new Sr({z2:200})).ignoreClip=!0,l.setTextContent(this._endLabel),l.disableLabelAnimation=!0);var h=function(e){for(var t,n,i=e.length/2;i>0&&(t=e[2*i-2],n=e[2*i-1],isNaN(t)||isNaN(n));i--);return i-1}(u);h>=0&&(S9(l,S7(e,"endLabel"),{inheritColor:n,labelFetcher:e,labelDataIndex:h,defaultText:function(e,t,n){return null!=n?kD(s,n):kI(s,e)},enableTextSetter:!0},(o=(r=t.getBaseAxis()).isHorizontal(),a=r.inverse,{normal:{align:i.get("align")||(o?a?"right":"left":"center"),verticalAlign:i.get("verticalAlign")||(o?"middle":a?"top":"bottom")}})),l.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},t.prototype._endLabelOnDuring=function(e,t,n,i,r,o,a){var s=this._endLabel,l=this._polyline;if(s){e<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var u=n.getLayout("points"),c=n.hostModel,h=c.get("connectNulls"),d=o.get("precision"),f=o.get("distance")||0,p=a.getBaseAxis(),g=p.isHorizontal(),m=p.inverse,v=t.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,x=(g?f:0)*(m?-1:1),b=(g?0:-f)*(m?-1:1),w=g?"x":"y",S=function(e,t,n){for(var i,r,o=e.length/2,a=+("x"!==n),s=0,l=-1,u=0;u<o;u++)if(!(isNaN(r=e[2*u+a])||isNaN(e[2*u+1-a]))){if(0===u){i=r;continue}if(i<=t&&r>=t||i>=t&&r<=t){l=u;break}s=u,i=r}return{range:[s,l],t:(t-i)/(r-i)}}(u,y,w),_=S.range,C=_[1]-_[0],M=void 0;if(C>=1){if(C>1&&!h){var A=Tw(u,_[0]);s.attr({x:A[0]+x,y:A[1]+b}),r&&(M=c.getRawValue(_[0]))}else{var A=l.getPointOn(y,w);A&&s.attr({x:A[0]+x,y:A[1]+b});var k=c.getRawValue(_[0]),T=c.getRawValue(_[1]);r&&(M=v1(n,d,k,T,S.t))}i.lastFrameIndex=_[0]}else{var I=1===e||i.lastFrameIndex>0?_[0]:0,A=Tw(u,I);r&&(M=c.getRawValue(I)),s.attr({x:A[0]+x,y:A[1]+b})}if(r){var D=_s(s);"function"==typeof D.setLabelText&&D.setLabelText(M)}}},t.prototype._doUpdateAnimation=function(e,t,n,i,r,o,a){var s=this._polyline,l=this._polygon,u=e.hostModel,c=function(e,t,n,i,r,o){for(var a,s=(a=[],t.diff(e).add(function(e){a.push({cmd:"+",idx:e})}).update(function(e,t){a.push({cmd:"=",idx:t,idx1:e})}).remove(function(e){a.push({cmd:"-",idx:e})}).execute(),a),l=[],u=[],c=[],h=[],d=[],f=[],p=[],g=Ta(r,t,o),m=e.getLayout("points")||[],v=t.getLayout("points")||[],y=0;y<s.length;y++){var x=s[y],b=!0,w=void 0,S=void 0;switch(x.cmd){case"=":w=2*x.idx,S=2*x.idx1;var _=m[w],C=m[w+1],M=v[S],A=v[S+1];(isNaN(_)||isNaN(C))&&(_=M,C=A),l.push(_,C),u.push(M,A),c.push(n[w],n[w+1]),h.push(i[S],i[S+1]),p.push(t.getRawIndex(x.idx1));break;case"+":var k=x.idx,T=g.dataDimsForPoint,I=r.dataToPoint([t.get(T[0],k),t.get(T[1],k)]);S=2*k,l.push(I[0],I[1]),u.push(v[S],v[S+1]);var D=Ts(g,r,t,k);c.push(D[0],D[1]),h.push(i[S],i[S+1]),p.push(t.getRawIndex(k));break;case"-":b=!1}b&&(d.push(x),f.push(f.length))}f.sort(function(e,t){return p[e]-p[t]});for(var O=l.length,P=yM(O),R=yM(O),E=yM(O),L=yM(O),N=[],y=0;y<f.length;y++){var B=f[y],F=2*y,z=2*B;P[F]=l[z],P[F+1]=l[z+1],R[F]=u[z],R[F+1]=u[z+1],E[F]=c[z],E[F+1]=c[z+1],L[F]=h[z],L[F+1]=h[z+1],N[y]=d[B]}return{current:P,next:R,stackedOnCurrent:E,stackedOnNext:L,status:N}}(this._data,e,this._stackedOnPoints,t,this._coordSys,this._valueOrigin),h=c.current,d=c.stackedOnCurrent,f=c.next,p=c.stackedOnNext;if(r&&(h=Tb(c.current,n,r,a),d=Tb(c.stackedOnCurrent,n,r,a),f=Tb(c.next,n,r,a),p=Tb(c.stackedOnNext,n,r,a)),Ty(h,f)>3e3||l&&Ty(d,p)>3e3){s.stopAnimation(),s.setShape({points:f}),l&&(l.stopAnimation(),l.setShape({points:f,stackedOnPoints:p}));return}s.shape.__points=c.current,s.shape.points=h;var g={shape:{points:f}};c.current!==h&&(g.shape.__points=c.next),s.stopAnimation(),SQ(s,g,u),l&&(l.setShape({points:h,stackedOnPoints:d}),l.stopAnimation(),SQ(l,{shape:{stackedOnPoints:p}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],v=c.status,y=0;y<v.length;y++)if("="===v[y].cmd){var x=e.getItemGraphicEl(v[y].idx1);x&&m.push({el:x,ptIdx:y})}s.animators&&s.animators.length&&s.animators[0].during(function(){l&&l.dirtyShape();for(var e=s.shape.__points,t=0;t<m.length;t++){var n=m[t].el,i=2*m[t].ptIdx;n.x=e[i],n.y=e[i+1],n.markRedraw()}})},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(e,i){e.__temp&&(t.remove(e),n.setItemGraphicEl(i,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type="line",t}(kS);function TM(e,t){return{seriesType:e,plan:yS(),reset:function(e){var n=e.getData(),i=e.coordinateSystem,r=e.pipelineContext,o=t||r.large;if(i){var a=mY(i.dimensions,function(e){return n.mapDimension(e)}).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");yb(n,a[0])&&(a[0]=l),yb(n,a[1])&&(a[1]=l);var u=n.getStore(),c=n.getDimensionIndex(a[0]),h=n.getDimensionIndex(a[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,r=o&&yM(n*s),a=[],l=[],d=e.start,f=0;d<e.end;d++){var p=void 0;if(1===s){var g=u.get(c,d);p=i.dataToPoint(g,null,l)}else a[0]=u.get(c,d),a[1]=u.get(h,d),p=i.dataToPoint(a,null,l);o?(r[f++]=p[0],r[f++]=p[1]):t.setItemLayout(d,p.slice())}o&&t.setLayout("points",r)}}}}}}var TA=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},Tk=function(e){function t(t){var n=e.call(this,t)||this;return n.type="pointer",n}return yz(t,e),t.prototype.getDefaultShape=function(){return new TA},t.prototype.buildPath=function(e,t){var n=Math.cos,i=Math.sin,r=t.r,o=t.width,a=t.angle,s=t.x-n(a)*o*(o>=r/3?1:2),l=t.y-i(a)*o*(o>=r/3?1:2);a=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+n(a)*o,t.y+i(a)*o),e.lineTo(t.x+n(t.angle)*r,t.y+i(t.angle)*r),e.lineTo(t.x-n(a)*o,t.y-i(a)*o),e.lineTo(s,l)},t}(wV);function TT(e,t){var n=null==e?"":e+"";return t&&(m2(t)?n=t.replace("{value}",n):m1(t)&&(n=t(e))),n}var TI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(e,t,n){this.group.removeAll();var i,r,o=e.get(["axisLine","lineStyle","color"]),a=(i=e.get("center"),r=Math.min(n.getWidth(),n.getHeight()),{cx:vy(i[0],n.getWidth()),cy:vy(i[1],n.getHeight()),r:vy(e.get("radius"),r/2)});this._renderMain(e,t,n,o,a),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,i,r){var o=this.group,a=e.get("clockwise"),s=-e.get("startAngle")/180*Math.PI,l=-e.get("endAngle")/180*Math.PI,u=e.getModel("axisLine"),c=u.get("roundCap")?kx:Ah,h=u.get("show"),d=u.getModel("lineStyle"),f=d.get("width"),p=[s,l];wM(p,!a),s=p[0];for(var g=(l=p[1])-s,m=s,v=[],y=0;h&&y<i.length;y++){var x=new c({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(i[y][0],0),1),cx:r.cx,cy:r.cy,clockwise:a,r0:r.r-f,r:r.r},silent:!0});x.setStyle({fill:i[y][1]}),x.setStyle(d.getLineStyle(["color","width"])),v.push(x),m=l}v.reverse(),mq(v,function(e){return o.add(e)});var b=function(e){var t;if(e<=0)return i[0][1];for(t=0;t<i.length;t++)if(i[t][0]>=e&&(0===t?0:i[t-1][0])<e)return i[t][1];return i[t-1][1]};this._renderTicks(e,t,n,b,r,s,l,a,f),this._renderTitleAndDetail(e,t,n,b,r),this._renderAnchor(e,r),this._renderPointer(e,t,n,b,r,s,l,a,f)},t.prototype._renderTicks=function(e,t,n,i,r,o,a,s,l){for(var u,c,h=this.group,d=r.cx,f=r.cy,p=r.r,g=+e.get("min"),m=+e.get("max"),v=e.getModel("splitLine"),y=e.getModel("axisTick"),x=e.getModel("axisLabel"),b=e.get("splitNumber"),w=y.get("splitNumber"),S=vy(v.get("length"),p),_=vy(y.get("length"),p),C=o,M=(a-o)/b,A=M/w,k=v.getModel("lineStyle").getLineStyle(),T=y.getModel("lineStyle").getLineStyle(),I=v.get("distance"),D=0;D<=b;D++){if(u=Math.cos(C),c=Math.sin(C),v.get("show")){var O=I?I+l:l,P=new AM({shape:{x1:u*(p-O)+d,y1:c*(p-O)+f,x2:u*(p-S-O)+d,y2:c*(p-S-O)+f},style:k,silent:!0});"auto"===k.stroke&&P.setStyle({stroke:i(D/b)}),h.add(P)}if(x.get("show")){var O=x.get("distance")+I,R=TT(vx(D/b*(m-g)+g),x.get("formatter")),E=i(D/b),L=u*(p-S-O)+d,N=c*(p-S-O)+f,B=x.get("rotate"),F=0;"radial"===B?(F=-C+2*Math.PI)>Math.PI/2&&(F+=Math.PI):"tangential"===B?F=-C-Math.PI/2:m3(B)&&(F=B*Math.PI/180),0===F?h.add(new Sr({style:_e(x,{text:R,x:L,y:N,verticalAlign:c<-.8?"top":c>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:E}),silent:!0})):h.add(new Sr({style:_e(x,{text:R,x:L,y:N,verticalAlign:"middle",align:"center"},{inheritColor:E}),silent:!0,originX:L,originY:N,rotation:F}))}if(y.get("show")&&D!==b){var O=y.get("distance");O=O?O+l:l;for(var z=0;z<=w;z++){var V=new AM({shape:{x1:(u=Math.cos(C))*(p-O)+d,y1:(c=Math.sin(C))*(p-O)+f,x2:u*(p-_-O)+d,y2:c*(p-_-O)+f},silent:!0,style:T});"auto"===T.stroke&&V.setStyle({stroke:i((D+z/w)/b)}),h.add(V),C+=A}C-=A}else C+=M}},t.prototype._renderPointer=function(e,t,n,i,r,o,a,s,l){var u=this.group,c=this._data,h=this._progressEls,d=[],f=e.get(["pointer","show"]),p=e.getModel("progress"),g=p.get("show"),m=e.getData(),v=m.mapDimension("value"),y=+e.get("min"),x=+e.get("max"),b=[y,x],w=[o,a];function S(t,n){var i,o=m.getItemModel(t).getModel("pointer"),a=vy(o.get("width"),r.r),s=vy(o.get("length"),r.r),l=e.get(["pointer","icon"]),u=o.get("offsetCenter"),c=vy(u[0],r.r),h=vy(u[1],r.r),d=o.get("keepAspect");return(i=l?k6(l,c-a/2,h-s,a,s,null,d):new Tk({shape:{angle:-Math.PI/2,width:a,r:s,x:c,y:h}})).rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function _(e,t){var n=p.get("roundCap")?kx:Ah,i=p.get("overlap"),a=i?p.get("width"):l/m.count(),u=i?r.r-a:r.r-(e+1)*a,c=i?r.r:r.r-e*a,h=new n({shape:{startAngle:o,endAngle:t,cx:r.cx,cy:r.cy,clockwise:s,r0:u,r:c}});return i&&(h.z2=x-m.get(v,e)%x),h}(g||f)&&(m.diff(c).add(function(t){var n=m.get(v,t);if(f){var i=S(t,o);SJ(i,{rotation:-((isNaN(+n)?w[0]:vv(n,b,w,!0))+Math.PI/2)},e),u.add(i),m.setItemGraphicEl(t,i)}if(g){var r=_(t,o);SJ(r,{shape:{endAngle:vv(n,b,w,p.get("clip"))}},e),u.add(r),Sa(e.seriesIndex,m.dataType,t,r),d[t]=r}}).update(function(t,n){var i=m.get(v,t);if(f){var r=c.getItemGraphicEl(n),a=r?r.rotation:o,s=S(t,a);s.rotation=a,SQ(s,{rotation:-((isNaN(+i)?w[0]:vv(i,b,w,!0))+Math.PI/2)},e),u.add(s),m.setItemGraphicEl(t,s)}if(g){var l=h[n],y=_(t,l?l.shape.endAngle:o);SQ(y,{shape:{endAngle:vv(i,b,w,p.get("clip"))}},e),u.add(y),Sa(e.seriesIndex,m.dataType,t,y),d[t]=y}}).execute(),m.each(function(e){var t=m.getItemModel(e),n=t.getModel("emphasis"),r=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(f){var s=m.getItemGraphicEl(e),l=m.getItemVisual(e,"style"),u=l.fill;if(s instanceof wU){var c=s.style;s.useStyle(mH({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(u);s.setStyle(t.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(vv(m.get(v,e),b,[0,1],!0))),s.z2EmphasisLift=0,SG(s,t),Sj(s,r,o,a)}if(g){var h=d[e];h.useStyle(m.getItemVisual(e,"style")),h.setStyle(t.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,SG(h,t),Sj(h,r,o,a)}}),this._progressEls=d)},t.prototype._renderAnchor=function(e,t){var n=e.getModel("anchor");if(n.get("show")){var i=n.get("size"),r=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=k6(r,t.cx-i/2+vy(o[0],t.r),t.cy-i/2+vy(o[1],t.r),i,i,null,a);s.z2=+!!n.get("showAbove"),s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,i,r){var o=this,a=e.getData(),s=a.mapDimension("value"),l=+e.get("min"),u=+e.get("max"),c=new MF,h=[],d=[],f=e.isAnimationEnabled(),p=e.get(["pointer","showAbove"]);a.diff(this._data).add(function(e){h[e]=new Sr({silent:!0}),d[e]=new Sr({silent:!0})}).update(function(e,t){h[e]=o._titleEls[t],d[e]=o._detailEls[t]}).execute(),a.each(function(t){var n=a.getItemModel(t),o=a.get(s,t),g=new MF,m=i(vv(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),x=r.cx+vy(y[0],r.r),b=r.cy+vy(y[1],r.r),w=h[t];w.attr({z2:2*!p,style:_e(v,{x:x,y:b,text:a.getName(t),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(w)}var S=n.getModel("detail");if(S.get("show")){var _=S.get("offsetCenter"),C=r.cx+vy(_[0],r.r),M=r.cy+vy(_[1],r.r),A=vy(S.get("width"),r.r),k=vy(S.get("height"),r.r),T=e.get(["progress","show"])?a.getItemVisual(t,"style").fill:m,w=d[t],I=S.get("formatter");w.attr({z2:2*!p,style:_e(S,{x:C,y:M,text:TT(o,I),width:isNaN(A)?null:A,height:isNaN(k)?null:k,align:"center",verticalAlign:"middle"},{inheritColor:T})}),_l(w,{normal:S},o,function(e){return TT(e,I)}),f&&function(e,t,n,i,r){var o=_s(e);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=vt(o.interpolatedValue,o.prevValue),l=o.value;e.percent=0,(null==o.prevValue?SJ:SQ)(e,{percent:1},i,t,null,function(i){var u=v1(n,o.precision,s,l,i);o.interpolatedValue=1===i?null:u,S6(e,S8({labelDataIndex:t,labelFetcher:r,defaultText:a?a(u):u+""},o.statesModels,u))})}}(w,t,a,e,{getFormattedLabel:function(e,t,n,i,r,a){return TT(a?a.interpolatedValue:o,I)}}),g.add(w)}c.add(g)}),this.group.add(c),this._titleEls=h,this._detailEls=d},t.type="gauge",t}(kS);function TD(e,t,n){t=m0(t)&&{coordDimensions:t}||mH({encodeDefine:e.getEncode()},t);var i=e.getSource(),r=new Mk(MT(i,t).dimensions,e);return r.initData(i,n),r}var TO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath="itemStyle",n}return yz(t,e),t.prototype.getInitialData=function(e,t){return TD(this,["value"])},t.type="series.gauge",t.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Mu);function TP(e,t,n,i,r){var o=e+t;n.isSilent(o)||i.eachComponent({mainType:"series",subType:"pie"},function(e){for(var t=e.seriesIndex,i=e.option.selectedMap,a=r.selected,s=0;s<a.length;s++)if(a[s].seriesIndex===t){var l=e.getData(),u=vU(l,r.fromActionPayload);n.trigger(o,{type:o,seriesId:e.id,name:m0(u)?l.getName(u[0]):l.getName(u),selected:m2(i)?i:mH({},i)})}})}var TR=2*Math.PI,TE=Math.PI/180;function TL(e,t){return Cs(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function TN(e,t){var n,i,r=TL(e,t),o=e.get("center"),a=e.get("radius");m0(a)||(a=[0,a]);var s=vy(r.width,t.getWidth()),l=vy(r.height,t.getHeight()),u=Math.min(s,l),c=vy(a[0],u/2),h=vy(a[1],u/2),d=e.coordinateSystem;if(d){var f=d.dataToPoint(o);n=f[0]||0,i=f[1]||0}else m0(o)||(o=[o,o]),n=vy(o[0],s)+r.x,i=vy(o[1],l)+r.y;return{cx:n,cy:i,r0:c,r:h}}function TB(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),i=t.mapDimension("value"),r=TL(e,n),o=TN(e,n),a=o.cx,s=o.cy,l=o.r,u=o.r0,c=-e.get("startAngle")*TE,h=e.get("endAngle"),d=e.get("padAngle")*TE;h="auto"===h?c-TR:-h*TE;var f=e.get("minAngle")*TE+d,p=0;t.each(i,function(e){!isNaN(e)&&p++});var g=t.getSum(i),m=Math.PI/(g||p)*2,v=e.get("clockwise"),y=e.get("roseType"),x=e.get("stillShowZeroSum"),b=t.getDataExtent(i);b[0]=0;var w=v?1:-1,S=[c,h],_=w*d/2;wM(S,!v),c=S[0];var C=Math.abs((h=S[1])-c),M=C,A=0,k=c;if(t.setLayout({viewRect:r,r:l}),t.each(i,function(e,n){if(isNaN(e))return void t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:a,cy:s,r0:u,r:y?NaN:l});(i="area"!==y?0===g&&x?m:e*m:C/p)<f?(i=f,M-=f):A+=e;var i,r=k+w*i,o=0,c=0;d>i?c=o=k+w*i/2:(o=k+_,c=r-_),t.setItemLayout(n,{angle:i,startAngle:o,endAngle:c,clockwise:v,cx:a,cy:s,r0:u,r:y?vv(e,b,[u,l]):l}),k=r}),M<TR&&p)if(M<=.001){var T=C/p;t.each(i,function(e,n){if(!isNaN(e)){var i=t.getItemLayout(n);i.angle=T;var r=0,o=0;T<d?o=r=c+w*(n+.5)*T:(r=c+w*n*T+_,o=c+w*(n+1)*T-_),i.startAngle=r,i.endAngle=o}})}else m=M/A,k=c,t.each(i,function(e,n){if(!isNaN(e)){var i=t.getItemLayout(n),r=i.angle===f?f:e*m,o=0,a=0;r<d?a=o=k+w*r/2:(o=k+_,a=k+w*r-_),i.startAngle=o,i.endAngle=a,k+=w*r}})})}function TF(e,t,n,i,r,o,a,s){var l=n-e,u=i-t,c=Math.sqrt(l*l+u*u),h=((r-e)*(l/=c)+(o-t)*(u/=c))/c;s&&(h=Math.min(Math.max(h,0),1)),h*=c;var d=a[0]=e+h*l,f=a[1]=t+h*u;return Math.sqrt((d-r)*(d-r)+(f-o)*(f-o))}wA.CMD;var Tz=new xi,TV=new xi,Tj=new xi,TH=new xi,TW=new xi,TG=[],T$=new xi;function TU(e,t,n,i){var r="normal"===n,o=r?e:e.ensureState(n);o.ignore=t;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?e.useStyle(s):o.style=s}function Tq(e,t){var n=t.smooth,i=t.points;if(i)if(e.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=xN(i[0],i[1]),o=xN(i[1],i[2]);if(!r||!o){e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]);return}var a=Math.min(r,o)*n,s=xF([],i[1],i[0],a/r),l=xF([],i[1],i[2],a/o),u=xF([],s,l,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),e.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var c=1;c<i.length;c++)e.lineTo(i[c][0],i[c][1])}var TY=Math.PI/180;function TZ(e,t,n,i,r,o,a,s,l,u){if(!(e.length<2)){for(var c=e.length,h=0;h<c;h++)if("outer"===e[h].position&&"labelLine"===e[h].labelAlignTo){var d=e[h].label.x-u;e[h].linePoints[1][0]+=d,e[h].label.x=u}(function(e,t,n,i,r){var o,a,s,l=e.length;if(!(l<2)){e.sort(function(e,t){return e.rect.y-t.rect.y});for(var u=0,c=!1,h=[],d=0,f=0;f<l;f++){var p=e[f],g=p.rect;(o=g.y-u)<0&&(g.y-=o,p.label.y-=o,c=!0);var m=Math.max(-o,0);h.push(m),d+=m,u=g.y+g[t]}d>0&&r&&w(-d/l,0,l);var v=e[0],y=e[l-1];return x(),a<0&&S(-a,.8),s<0&&S(s,.8),x(),b(a,s,1),b(s,a,-1),x(),a<0&&_(-a),s<0&&_(s),c}function x(){a=v.rect.y-n,s=i-y.rect.y-y.rect[t]}function b(e,t,n){if(e<0){var i=Math.min(t,-e);if(i>0){w(i*n,0,l);var r=i+e;r<0&&S(-r*n,1)}else S(-e*n,1)}}function w(t,n,i){0!==t&&(c=!0);for(var r=n;r<i;r++){var o=e[r],a=o.rect;a.y+=t,o.label.y+=t}}function S(n,i){for(var r=[],o=0,a=1;a<l;a++){var s=e[a-1].rect,u=Math.max(e[a].rect.y-s.y-s[t],0);r.push(u),o+=u}if(o){var c=Math.min(Math.abs(n)/o,i);if(n>0)for(var a=0;a<l-1;a++){var h=r[a]*c;w(h,0,a+1)}else for(var a=l-1;a>0;a--){var h=r[a-1]*c;w(-h,a,l)}}}function _(e){for(var t=e<0?-1:1,n=Math.ceil((e=Math.abs(e))/(l-1)),i=0;i<l-1;i++)if(t>0?w(n,0,i+1):w(-n,l-i-1,l),(e-=n)<=0)return}})(e,"height",l,l+a,void 0)&&function(e){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<e.length;s++)if("none"===e[s].labelAlignTo){var l=e[s],u=l.label.y>n?a:o,c=Math.abs(l.label.y-n);if(c>=u.maxY){var h=l.label.x-t-l.len2*r,d=i+l.len;u.rB=Math.abs(h)<d?Math.sqrt(c*c/(1-h*h/d/d)):d,u.maxY=c}u.list.push(l)}f(o),f(a)}(e)}function f(e){for(var o=e.rB,a=o*o,s=0;s<e.list.length;s++){var l=e.list[s],u=Math.abs(l.label.y-n),c=i+l.len,h=t+(Math.sqrt(c*c*(1-Math.abs(u*u/a)))+l.len2)*r,d=h-l.label.x,f=l.targetTextWidth-d*r;TX(l,f,!0),l.label.x=h}}}function TX(e,t,n){if(void 0===n&&(n=!1),null==e.labelStyleWidth){var i=e.label,r=i.style,o=e.rect,a=r.backgroundColor,s=r.padding,l=s?s[1]+s[3]:0,u=r.overflow,c=o.width+(a?0:l);if(t<c||n){var h=o.height;if(u&&u.match("break")){i.setStyle("backgroundColor",null),i.setStyle("width",t-l);var d=i.getBoundingRect();i.setStyle("width",Math.ceil(d.width)),i.setStyle("backgroundColor",a)}else{var f=t-l,p=t<c?f:n?f>e.unconstrainedWidth?null:f:null;i.setStyle("width",p)}var g=i.getBoundingRect();o.width=g.width;var m=(i.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-h)/2}}}function TK(e){return"center"===e.position}var TQ=function(e){function t(t,n,i){var r=e.call(this)||this;r.z2=2;var o=new Sr;return r.setTextContent(o),r.updateData(t,n,i,!0),r}return yz(t,e),t.prototype.updateData=function(e,t,n,i){var r=e.hostModel,o=e.getItemModel(t),a=o.getModel("emphasis"),s=e.getItemLayout(t),l=mH(kR(o.getModel("itemStyle"),s,!0),s);if(isNaN(l.startAngle))return void this.setShape(l);if(i){this.setShape(l);var u=r.getShallow("animationType");r.ecModel.ssr?(SJ(this,{scaleX:0,scaleY:0},r,{dataIndex:t,isFrom:!0}),this.originX=l.cx,this.originY=l.cy):"scale"===u?(this.shape.r=s.r0,SJ(this,{shape:{r:s.r}},r,t)):null!=n?(this.setShape({startAngle:n,endAngle:n}),SJ(this,{shape:{startAngle:s.startAngle,endAngle:s.endAngle}},r,t)):(this.shape.endAngle=s.startAngle,SQ(this,{shape:{endAngle:s.endAngle}},r,t))}else S3(this),SQ(this,{shape:l},r,t);this.useStyle(e.getItemVisual(t,"style")),SG(this,o);var c=(s.startAngle+s.endAngle)/2,h=r.get("selectedOffset"),d=Math.cos(c)*h,f=Math.sin(c)*h,p=o.getShallow("cursor");p&&this.attr("cursor",p),this._updateLabel(r,e,t),this.ensureState("emphasis").shape=mH({r:s.r+(a.get("scale")&&a.get("scaleSize")||0)},kR(a.getModel("itemStyle"),s)),mH(this.ensureState("select"),{x:d,y:f,shape:kR(o.getModel(["select","itemStyle"]),s)}),mH(this.ensureState("blur"),{shape:kR(o.getModel(["blur","itemStyle"]),s)});var g=this.getTextGuideLine(),m=this.getTextContent();g&&mH(g.ensureState("select"),{x:d,y:f}),mH(m.ensureState("select"),{x:d,y:f}),Sj(this,a.get("focus"),a.get("blurScope"),a.get("disabled"))},t.prototype._updateLabel=function(e,t,n){var i=t.getItemModel(n),r=i.getModel("labelLine"),o=t.getItemVisual(n,"style"),a=o&&o.fill,s=o&&o.opacity;S9(this,S7(i),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:a,defaultOpacity:s,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var l=this.getTextContent();this.setTextConfig({position:null,rotation:null}),l.attr({z2:10});var u=e.get(["label","position"]);if("outside"!==u&&"outer"!==u)this.removeTextGuideLine();else{var c=this.getTextGuideLine();c||(c=new Aw,this.setTextGuideLine(c)),function(e,t,n){var i=e.getTextGuideLine(),r=e.getTextContent();if(!r){i&&e.removeTextGuideLine();return}for(var o=t.normal,a=o.get("show"),s=r.ignore,l=0;l<Sd.length;l++){var u=Sd[l],c=t[u],h="normal"===u;if(c){var d=c.get("show");if((h?s:vt(r.states[u]&&r.states[u].ignore,s))||!vt(d,a)){var f=h?i:i&&i.states[u];f&&(f.ignore=!0),i&&TU(i,!0,u,c);continue}!i&&(i=new Aw,e.setTextGuideLine(i),h||!s&&a||TU(i,!0,"normal",t.normal),e.stateProxy&&(i.stateProxy=e.stateProxy)),TU(i,!1,u,c)}}if(i){mW(i.style,n),i.style.fill=null;var p=o.get("showAbove");(e.textGuideLineConfig=e.textGuideLineConfig||{}).showAbove=p||!1,i.buildPath=Tq}}(this,function(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},i=0;i<Sh.length;i++){var r=Sh[i];n[r]=e.getModel([r,t])}return n}(i),{stroke:a,opacity:vn(r.get(["lineStyle","opacity"]),s,1)})}},t}(Ah),TJ=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ignoreLabelLineUpdate=!0,t}return yz(t,e),t.prototype.render=function(e,t,n,i){var r,o=e.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(r=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&e.get("showEmptyCircle")){var c=new Ah({shape:TN(e,n)});c.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,s.add(c)}o.diff(a).add(function(e){var t=new TQ(o,e,r);o.setItemGraphicEl(e,t),s.add(t)}).update(function(e,t){var n=a.getItemGraphicEl(t);n.updateData(o,e,r),n.off("click"),s.add(n),o.setItemGraphicEl(e,n)}).remove(function(t){S5(a.getItemGraphicEl(t),e,t)}).execute(),function(e){var t,n,i=e.getData(),r=[],o=!1,a=(e.get("minShowLabelAngle")||0)*TY,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,c=s.x,h=s.y,d=s.height;function f(e){e.ignore=!0}i.each(function(e){var s,h,d,p,g=i.getItemGraphicEl(e),m=g.shape,v=g.getTextContent(),y=g.getTextGuideLine(),x=i.getItemModel(e),b=x.getModel("label"),w=b.get("position")||x.get(["emphasis","label","position"]),S=b.get("distanceToLabelLine"),_=b.get("alignTo"),C=vy(b.get("edgeDistance"),u),M=b.get("bleedMargin"),A=x.getModel("labelLine"),k=A.get("length");k=vy(k,u);var T=A.get("length2");if(T=vy(T,u),Math.abs(m.endAngle-m.startAngle)<a){mq(v.states,f),v.ignore=!0,y&&(mq(y.states,f),y.ignore=!0);return}if(function(e){if(!e.ignore)return!0;for(var t in e.states)if(!1===e.states[t].ignore)return!0;return!1}(v)){var I=(m.startAngle+m.endAngle)/2,D=Math.cos(I),O=Math.sin(I);t=m.cx,n=m.cy;var P="inside"===w||"inner"===w;if("center"===w)s=m.cx,h=m.cy,p="center";else{var R=(P?(m.r+m.r0)/2*D:m.r*D)+t,E=(P?(m.r+m.r0)/2*O:m.r*O)+n;if(s=R+3*D,h=E+3*O,!P){var L=R+D*(k+l-m.r),N=E+O*(k+l-m.r),B=L+(D<0?-1:1)*T;s="edge"===_?D<0?c+C:c+u-C:B+(D<0?-S:S),h=N,d=[[R,E],[L,N],[B,N]]}p=P?"center":"edge"===_?D>0?"right":"left":D>0?"left":"right"}var F=Math.PI,z=0,V=b.get("rotate");if(m3(V))z=F/180*V;else if("center"===w)z=0;else if("radial"===V||!0===V)z=D<0?-I+F:-I;else if("tangential"===V&&"outside"!==w&&"outer"!==w){var j=Math.atan2(D,O);j<0&&(j=2*F+j),O>0&&(j=F+j),z=j-F}if(o=!!z,v.x=s,v.y=h,v.rotation=z,v.setStyle({verticalAlign:"middle"}),P){v.setStyle({align:p});var H=v.states.select;H&&(H.x+=v.x,H.y+=v.y)}else{var W=v.getBoundingRect().clone();W.applyTransform(v.getComputedTransform());var G=(v.style.margin||0)+2.1;W.y-=G/2,W.height+=G,r.push({label:v,labelLine:y,position:w,len:k,len2:T,minTurnAngle:A.get("minTurnAngle"),maxSurfaceAngle:A.get("maxSurfaceAngle"),surfaceNormal:new xi(D,O),linePoints:d,textAlign:p,labelDistance:S,labelAlignTo:_,edgeDistance:C,bleedMargin:M,rect:W,unconstrainedWidth:W.width,labelStyleWidth:v.style.width})}g.setTextConfig({inside:P})}}),!o&&e.get("avoidLabelOverlap")&&function(e,t,n,i,r,o,a,s){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<e.length;d++){var f=e[d].label;TK(e[d])||(f.x<t?(c=Math.min(c,f.x),l.push(e[d])):(h=Math.max(h,f.x),u.push(e[d])))}for(var d=0;d<e.length;d++){var p=e[d];if(!TK(p)&&p.linePoints){if(null!=p.labelStyleWidth)continue;var f=p.label,g=p.linePoints,m=void 0;m="edge"===p.labelAlignTo?f.x<t?g[2][0]-p.labelDistance-a-p.edgeDistance:a+r-p.edgeDistance-g[2][0]-p.labelDistance:"labelLine"===p.labelAlignTo?f.x<t?c-a-p.bleedMargin:a+r-h-p.bleedMargin:f.x<t?f.x-a-p.bleedMargin:a+r-f.x-p.bleedMargin,p.targetTextWidth=m,TX(p,m)}}TZ(u,t,n,i,1,r,o,a,s,h),TZ(l,t,n,i,-1,r,o,a,s,c);for(var d=0;d<e.length;d++){var p=e[d];if(!TK(p)&&p.linePoints){var f=p.label,g=p.linePoints,v="edge"===p.labelAlignTo,y=f.style.padding,x=y?y[1]+y[3]:0,b=f.style.backgroundColor?0:x,w=p.rect.width+b,S=g[1][0]-g[2][0];v?f.x<t?g[2][0]=a+p.edgeDistance+w+p.labelDistance:g[2][0]=a+r-p.edgeDistance-w-p.labelDistance:(f.x<t?g[2][0]=f.x+p.labelDistance:g[2][0]=f.x-p.labelDistance,g[1][0]=g[2][0]+S),g[1][1]=g[2][1]=f.y}}}(r,t,n,l,u,d,c,h);for(var p=0;p<r.length;p++){var g=r[p],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&(mq(m.states,f),m.ignore=!0);var x=m.states.select;x&&(x.x+=m.x,x.y+=m.y)}if(v){var b=g.linePoints;y||!b?(mq(v.states,f),v.ignore=!0):(!function(e,t){if(t<=180&&t>0){t=t/180*Math.PI,Tz.fromArray(e[0]),TV.fromArray(e[1]),Tj.fromArray(e[2]),xi.sub(TH,Tz,TV),xi.sub(TW,Tj,TV);var n=TH.len(),i=TW.len();if(!(n<.001)&&!(i<.001)&&(TH.scale(1/n),TW.scale(1/i),Math.cos(t)<TH.dot(TW))){var r=TF(TV.x,TV.y,Tj.x,Tj.y,Tz.x,Tz.y,TG,!1);T$.fromArray(TG),T$.scaleAndAdd(TW,r/Math.tan(Math.PI-t));var o=Tj.x!==TV.x?(T$.x-TV.x)/(Tj.x-TV.x):(T$.y-TV.y)/(Tj.y-TV.y);if(isNaN(o))return;o<0?xi.copy(T$,TV):o>1&&xi.copy(T$,Tj),T$.toArray(e[1])}}}(b,g.minTurnAngle),function(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,Tz.fromArray(e[0]),TV.fromArray(e[1]),Tj.fromArray(e[2]),xi.sub(TH,TV,Tz),xi.sub(TW,Tj,TV);var i=TH.len(),r=TW.len();if(!(i<.001)&&!(r<.001)&&(TH.scale(1/i),TW.scale(1/r),TH.dot(t)<Math.cos(n))){var o=TF(TV.x,TV.y,Tj.x,Tj.y,Tz.x,Tz.y,TG,!1);T$.fromArray(TG);var a=Math.PI/2,s=a+Math.acos(TW.dot(t))-n;if(s>=a)xi.copy(T$,Tj);else{T$.scaleAndAdd(TW,o/Math.tan(Math.PI/2-s));var l=Tj.x!==TV.x?(T$.x-TV.x)/(Tj.x-TV.x):(T$.y-TV.y)/(Tj.y-TV.y);if(isNaN(l))return;l<0?xi.copy(T$,TV):l>1&&xi.copy(T$,Tj)}T$.toArray(e[1])}}}(b,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:b}),m.__hostTarget.textGuideLineConfig={anchor:new xi(b[0][0],b[0][1])})}}}(e),"expansion"!==e.get("animationTypeUpdate")&&(this._data=o)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var i=e[0]-n.cx,r=e[1]-n.cy,o=Math.sqrt(i*i+r*r);return o<=n.r&&o>=n.r0}},t.type="pie",t}(kS),T0=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),T1=vq(),T2=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new T0(mQ(this.getData,this),mQ(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return TD(this,{coordDimensions:["value"],encodeDefaulter:mJ(yn,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),i=T1(n),r=i.seats;if(!r){var o=[];n.each(n.mapDimension("value"),function(e){o.push(e)}),r=i.seats=function(e,t){var n=mZ(e,function(e,t){return e+(isNaN(t)?0:t)},0);if(0===n)return[];for(var i=Math.pow(10,t),r=mY(e,function(e){return(isNaN(e)?0:e)/n*i*100}),o=100*i,a=mY(r,function(e){return Math.floor(e)}),s=mZ(a,function(e,t){return e+t},0),l=mY(r,function(e,t){return e-a[t]});s<o;){for(var u=-1/0,c=null,h=0,d=l.length;h<d;++h)l[h]>u&&(u=l[h],c=h);++a[c],l[c]=0,++s}return mY(a,function(e){return e/i})}(o,n.hostModel.get("percentPrecision"))}var a=e.prototype.getDataParams.call(this,t);return a.percent=r[t]||0,a.$vars.push("percent"),a},t.prototype._defaultLabelLine=function(e){vF(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(Mu),T5=function(e,t){this.target=e,this.topTarget=t&&t.topTarget},T3=function(){function e(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new T5(t,e),"dragstart",e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,i=e.offsetY,r=n-this._x,o=i-this._y;this._x=n,this._y=i,t.drift(r,o,e),this.handler.dispatchToElement(new T5(t,e),"drag",e.event);var a=this.handler.findHover(n,i,t).target,s=this._dropTarget;this._dropTarget=a,t!==a&&(s&&a!==s&&this.handler.dispatchToElement(new T5(s,e),"dragleave",e.event),a&&a!==s&&this.handler.dispatchToElement(new T5(a,e),"dragenter",e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new T5(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new T5(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},e}(),T4=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,T6=[],T8=vE.browser.firefox&&39>+vE.browser.version.split(".")[0];function T9(e,t,n,i){return n=n||{},i?T7(e,t,n):T8&&null!=t.layerX&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):null!=t.offsetX?(n.zrX=t.offsetX,n.zrY=t.offsetY):T7(e,t,n),n}function T7(e,t,n){if(vE.domSupported&&e.getBoundingClientRect){var i=t.clientX,r=t.clientY;if(_I(e)){var o=e.getBoundingClientRect();n.zrX=i-o.left,n.zrY=r-o.top;return}if(_T(T6,e,i,r)){n.zrX=T6[0],n.zrY=T6[1];return}}n.zrX=n.zrY=0}function Ie(e){return e||window.event}function It(e,t,n){if(null!=(t=Ie(t)).zrX)return t;var i=t.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?t.targetTouches[0]:t.changedTouches[0];r&&T9(e,r,t,n)}else{T9(e,t,t,n);var o=function(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,i=e.deltaY;return null==n||null==i?t:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(t);t.zrDelta=o?o/120:-(t.detail||0)/3}var a=t.button;return null==t.which&&void 0!==a&&T4.test(t.type)&&(t.which=1&a?1:2&a?3:4&a?2:0),t}function In(e,t,n,i){e.addEventListener(t,n,i)}var Ii=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function Ir(e){return 2===e.which||3===e.which}var Io=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var r={points:[],touches:[],target:t,event:e},o=0,a=i.length;o<a;o++){var s=i[o],l=T9(n,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},e.prototype._recognize=function(e){for(var t in Is)if(Is.hasOwnProperty(t)){var n=Is[t](this._track,e);if(n)return n}},e}();function Ia(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}var Is={pinch:function(e,t){var n=e.length;if(n){var i=(e[n-1]||{}).points,r=(e[n-2]||{}).points||i;if(r&&r.length>1&&i&&i.length>1){var o=Ia(i)/Ia(r);isFinite(o)||(o=1),t.pinchScale=o;var a=[(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return t.pinchX=a[0],t.pinchY=a[1],{type:"pinch",target:e[0].target,event:t}}}}},Il="silent";function Iu(){Ii(this.event)}var Ic=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return yJ(t,e),t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(bz),Ih=function(e,t){this.x=e,this.y=t},Id=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],If=new xd(0,0,0,0),Ip=function(e){function t(t,n,i,r,o){var a=e.call(this)||this;return a._hovered=new Ih(0,0),a.storage=t,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new Ic,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new T3(a),a}return yJ(t,e),t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(mq(Id,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,i=Im(this,t,n),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var a=this._hovered=i?new Ih(t,n):this.findHover(t,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",e),this.dispatchToElement(a,"mousemove",e),s&&s!==o&&this.dispatchToElement(a,"mouseover",e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new Ih(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){var i=(e=e||{}).target;if(!i||!i.silent){for(var r,o="on"+t,a={type:t,event:n,target:(r=e).target,topTarget:r.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Iu};i&&(i[o]&&(a.cancelBubble=!!i[o].call(i,a)),i.trigger(t,a),i=i.__hostTarget?i.__hostTarget:i.parent,!a.cancelBubble););!a.cancelBubble&&(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){"function"==typeof e[o]&&e[o].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var i=this.storage.getDisplayList(),r=new Ih(e,t);if(Ig(i,r,e,t,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new xd(e-s,t-s,a,a),u=i.length-1;u>=0;u--){var c=i[u];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||(If.copy(c.getBoundingRect()),c.transform&&If.applyTransform(c.transform),If.intersect(l)&&o.push(c))}if(o.length){for(var h=Math.PI/12,d=2*Math.PI,f=0;f<s;f+=4)for(var p=0;p<d;p+=h)if(Ig(o,r,e+f*Math.cos(p),t+f*Math.sin(p),n),r.target)return r}}return r},t.prototype.processGesture=function(e,t){this._gestureMgr||(this._gestureMgr=new Io);var n=this._gestureMgr;"start"===t&&n.clear();var i=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&n.clear(),i){var r=i.type;e.gestureEvent=r;var o=new Ih;o.target=i.target,this.dispatchToElement(o,r,i.event)}},t}(bz);function Ig(e,t,n,i,r){for(var o=e.length-1;o>=0;o--){var a=e[o],s=void 0;if(a!==r&&!a.ignore&&(s=function(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var i=e,r=void 0,o=!1;i;){if(i.ignoreClip&&(o=!0),!o){var a=i.getClipPath();if(a&&!a.contain(t,n))return!1}i.silent&&(r=!0),i=i.__hostTarget||i.parent}return!r||Il}return!1}(a,n,i))&&(t.topTarget||(t.topTarget=a),s!==Il)){t.target=a;break}}}function Im(e,t,n){var i=e.painter;return t<0||t>i.getWidth()||n<0||n>i.getHeight()}function Iv(e,t,n,i){var r=t+1;if(r===n)return 1;if(0>i(e[r++],e[t])){for(;r<n&&0>i(e[r],e[r-1]);)r++;var o=e,a=t,s=r;for(s--;a<s;){var l=o[a];o[a++]=o[s],o[s--]=l}}else for(;r<n&&i(e[r],e[r-1])>=0;)r++;return r-t}function Iy(e,t,n,i,r){for(i===t&&i++;i<n;i++){for(var o,a=e[i],s=t,l=i;s<l;)0>r(a,e[o=s+l>>>1])?l=o:s=o+1;var u=i-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=a}}function Ix(e,t,n,i,r,o){var a=0,s=0,l=1;if(o(e,t[n+r])>0){for(s=i-r;l<s&&o(e,t[n+r+l])>0;)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;l<s&&0>=o(e,t[n+r-l]);)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s);var u=a;a=r-l,l=r-u}for(a++;a<l;){var c=a+(l-a>>>1);o(e,t[n+c])>0?a=c+1:l=c}return l}function Ib(e,t,n,i,r,o){var a=0,s=0,l=1;if(0>o(e,t[n+r])){for(s=r+1;l<s&&0>o(e,t[n+r-l]);)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l<s&&o(e,t[n+r+l])>=0;)a=l,(l=(l<<1)+1)<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a<l;){var c=a+(l-a>>>1);0>o(e,t[n+c])?l=c:a=c+1}return l}function Iw(e,t,n,i){n||(n=0),i||(i=e.length);var r=i-n;if(!(r<2)){var o=0;if(r<32){o=Iv(e,n,i,t),Iy(e,n,i,n+o,t);return}var a=function(e,t){var n,i,r=7,o=0,a=[];function s(s){var l=n[s],u=i[s],c=n[s+1],h=i[s+1];i[s]=u+h,s===o-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),o--;var d=Ib(e[c],e,l,u,0,t);l+=d,0==(u-=d)||0!==(h=Ix(e[l+u-1],e,c,h,h-1,t))&&(u<=h?function(n,i,o,s){var l,u,c,h=0;for(h=0;h<i;h++)a[h]=e[n+h];var d=0,f=o,p=n;if(e[p++]=e[f++],0==--s){for(h=0;h<i;h++)e[p+h]=a[d+h];return}if(1===i){for(h=0;h<s;h++)e[p+h]=e[f+h];e[p+s]=a[d];return}for(var g=r;;){l=0,u=0,c=!1;do if(0>t(e[f],a[d])){if(e[p++]=e[f++],u++,l=0,0==--s){c=!0;break}}else if(e[p++]=a[d++],l++,u=0,1==--i){c=!0;break}while((l|u)<g);if(c)break;do{if(0!==(l=Ib(e[f],a,d,i,0,t))){for(h=0;h<l;h++)e[p+h]=a[d+h];if(p+=l,d+=l,(i-=l)<=1){c=!0;break}}if(e[p++]=e[f++],0==--s){c=!0;break}if(0!==(u=Ix(a[d],e,f,s,0,t))){for(h=0;h<u;h++)e[p+h]=e[f+h];if(p+=u,f+=u,0==(s-=u)){c=!0;break}}if(e[p++]=a[d++],1==--i){c=!0;break}g--}while(l>=7||u>=7);if(c)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(h=0;h<s;h++)e[p+h]=e[f+h];e[p+s]=a[d]}else if(0===i)throw Error();else for(h=0;h<i;h++)e[p+h]=a[d+h]}(l,u,c,h):function(n,i,o,s){var l=0;for(l=0;l<s;l++)a[l]=e[o+l];var u=n+i-1,c=s-1,h=o+s-1,d=0,f=0;if(e[h--]=e[u--],0==--i){for(l=0,d=h-(s-1);l<s;l++)e[d+l]=a[l];return}if(1===s){for(h-=i,u-=i,f=h+1,d=u+1,l=i-1;l>=0;l--)e[f+l]=e[d+l];e[h]=a[c];return}for(var p=r;;){var g=0,m=0,v=!1;do if(0>t(a[c],e[u])){if(e[h--]=e[u--],g++,m=0,0==--i){v=!0;break}}else if(e[h--]=a[c--],m++,g=0,1==--s){v=!0;break}while((g|m)<p);if(v)break;do{if(0!=(g=i-Ib(a[c],e,n,i,i-1,t))){for(h-=g,u-=g,i-=g,f=h+1,d=u+1,l=g-1;l>=0;l--)e[f+l]=e[d+l];if(0===i){v=!0;break}}if(e[h--]=a[c--],1==--s){v=!0;break}if(0!=(m=s-Ix(e[u],a,0,s,s-1,t))){for(h-=m,c-=m,s-=m,f=h+1,d=c+1,l=0;l<m;l++)e[f+l]=a[d+l];if(s<=1){v=!0;break}}if(e[h--]=e[u--],0==--i){v=!0;break}p--}while(g>=7||m>=7);if(v)break;p<0&&(p=0),p+=2}if((r=p)<1&&(r=1),1===s){for(h-=i,u-=i,f=h+1,d=u+1,l=i-1;l>=0;l--)e[f+l]=e[d+l];e[h]=a[c]}else if(0===s)throw Error();else for(l=0,d=h-(s-1);l<s;l++)e[d+l]=a[l]}(l,u,c,h))}return n=[],i=[],{mergeRuns:function(){for(;o>1;){var e=o-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]<i[e+1]&&e--;else if(i[e]>i[e+1])break;s(e)}},forceMergeRuns:function(){for(;o>1;){var e=o-2;e>0&&i[e-1]<i[e+1]&&e--,s(e)}},pushRun:function(e,t){n[o]=e,i[o]=t,o+=1}}}(e,t),s=function(e){for(var t=0;e>=32;)t|=1&e,e>>=1;return e+t}(r);do{if((o=Iv(e,n,i,t))<s){var l=r;l>s&&(l=s),Iy(e,n,n+l,n+o,t),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}mq(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(e){Ip.prototype[e]=function(t){var n,i,r=t.zrX,o=t.zrY,a=Im(this,r,o);if("mouseup"===e&&a||(i=(n=this.findHover(r,o)).target),"mousedown"===e)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===e)this._upEl=i;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||xN(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}});var IS=!1;function I_(){IS||(IS=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function IC(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var IM=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=IC}return e.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},e.prototype.getDisplayList=function(e,t){t=t||!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(t),n},e.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,i=0,r=t.length;i<r;i++)this._updateAndAddDisplayable(t[i],null,e);n.length=this._displayListLen,Iw(n,IC)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!e.ignore||n){e.beforeUpdate(),e.update(),e.afterUpdate();var i=e.getClipPath();if(e.ignoreClip)t=null;else if(i){t=t?t.slice():[];for(var r=i,o=e;r;)r.parent=o,r.updateTransform(),t.push(r),o=r,r=r.getClipPath()}if(e.childrenRef){for(var a=e.childrenRef(),s=0;s<a.length;s++){var l=a[s];e.__dirty&&(l.__dirty|=1),this._updateAndAddDisplayable(l,t,n)}e.__dirty=0}else t&&t.length?e.__clipPaths=t:e.__clipPaths&&e.__clipPaths.length>0&&(e.__clipPaths=[]),isNaN(e.z)&&(I_(),e.z=0),isNaN(e.z2)&&(I_(),e.z2=0),isNaN(e.zlevel)&&(I_(),e.zlevel=0),this._displayList[this._displayListLen++]=e;var u=e.getDecalElement&&e.getDecalElement();u&&this._updateAndAddDisplayable(u,t,n);var c=e.getTextGuideLine();c&&this._updateAndAddDisplayable(c,t,n);var h=e.getTextContent();h&&this._updateAndAddDisplayable(h,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);return}var i=mG(this._roots,e);i>=0&&this._roots.splice(i,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}();function IA(){return new Date().getTime()}Y=vE.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var Ik=function(e){function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,n.stage=(t=t||{}).stage||{},n}return yJ(t,e),t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=IA()-this._pausedTime,n=t-this._time,i=this._head;i;){var r=i.next;i.step(t,n)&&(i.ondestroy(),this.removeClip(i)),i=r}this._time=t,!e&&(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0,Y(function t(){e._running&&(Y(t),e._paused||e.update())})},t.prototype.start=function(){this._running||(this._time=IA(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=IA(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=IA()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return null==this._head},t.prototype.animate=function(e,t){t=t||{},this.start();var n=new bF(e,t.loop);return this.addAnimator(n),n},t}(bz),IT=vE.domSupported,II=(C={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},M=mY(_=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],function(e){var t=e.replace("mouse","pointer");return C.hasOwnProperty(t)?t:e}),{mouse:_,touch:["touchstart","touchend","touchmove"],pointer:M}),ID=["mousemove","mouseup"],IO=["pointermove","pointerup"],IP=!1;function IR(e){var t=e.pointerType;return"pen"===t||"touch"===t}function IE(e){e&&(e.zrByTouch=!0)}function IL(e,t){for(var n=t,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return i}var IN=function(e,t){this.stopPropagation=vg,this.stopImmediatePropagation=vg,this.preventDefault=vg,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY},IB={mousedown:function(e){e=It(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=It(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=It(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){IL(this,(e=It(this.dom,e)).toElement||e.relatedTarget)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){IP=!0,e=It(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){IP||(e=It(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){IE(e=It(this.dom,e)),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),IB.mousemove.call(this,e),IB.mousedown.call(this,e)},touchmove:function(e){IE(e=It(this.dom,e)),this.handler.processGesture(e,"change"),IB.mousemove.call(this,e)},touchend:function(e){IE(e=It(this.dom,e)),this.handler.processGesture(e,"end"),IB.mouseup.call(this,e),new Date-this.__lastTouchMoment<300&&IB.click.call(this,e)},pointerdown:function(e){IB.mousedown.call(this,e)},pointermove:function(e){IR(e)||IB.mousemove.call(this,e)},pointerup:function(e){IB.mouseup.call(this,e)},pointerout:function(e){IR(e)||IB.mouseout.call(this,e)}};mq(["click","dblclick","contextmenu"],function(e){IB[e]=function(t){t=It(this.dom,t),this.trigger(e,t)}});var IF={pointermove:function(e){IR(e)||IF.mousemove.call(this,e)},pointerup:function(e){IF.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function Iz(e,t,n,i){e.mounted[t]=n,e.listenerOpts[t]=i,In(e.domTarget,t,n,i)}function IV(e){var t,n,i,r=e.mounted;for(var o in r)r.hasOwnProperty(o)&&(t=e.domTarget,n=r[o],i=e.listenerOpts[o],t.removeEventListener(o,n,i));e.mounted={}}var Ij=function(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t},IH=function(e){function t(t,n){var i,r,o=e.call(this)||this;return o.__pointerCapturing=!1,o.dom=t,o.painterRoot=n,o._localHandlerScope=new Ij(t,IB),IT&&(o._globalHandlerScope=new Ij(document,IF)),r=(i=o._localHandlerScope).domHandlers,vE.pointerEventsSupported?mq(II.pointer,function(e){Iz(i,e,function(t){r[e].call(o,t)})}):(vE.touchEventsSupported&&mq(II.touch,function(e){Iz(i,e,function(t){r[e].call(o,t),i.touching=!0,null!=i.touchTimer&&(clearTimeout(i.touchTimer),i.touchTimer=null),i.touchTimer=setTimeout(function(){i.touching=!1,i.touchTimer=null},700)})}),mq(II.mouse,function(e){Iz(i,e,function(t){t=Ie(t),i.touching||r[e].call(o,t)})})),o}return yJ(t,e),t.prototype.dispose=function(){IV(this._localHandlerScope),IT&&IV(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,IT&&this.__pointerCapturing^e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?function(e,t){vE.pointerEventsSupported?mq(IO,n):vE.touchEventsSupported||mq(ID,n);function n(n){Iz(t,n,function(i){if(!IL(e,(i=Ie(i)).target)){var r;r=i,i=It(e.dom,new IN(e,r),!0),t.domHandlers[n].call(e,i)}},{capture:!0})}}(this,t):IV(t)}},t}(bz),IW={},IG={},I$=function(){function e(e,t,n){var i,r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=t,this.id=e;var o=new IM,a=n.renderer||"canvas";IW[a]||(a=mK(IW)[0]),n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var s=new IW[a](t,o,n,e),l=n.ssr||s.ssrOnly;this.storage=o,this.painter=s;var u=vE.node||vE.worker||l?null:new IH(s.getViewportRoot(),s.root),c=n.useCoarsePointer;(null==c||"auto"===c?vE.touchEventsSupported:!!c)&&(i=vt(n.pointerSize,44)),this.handler=new Ip(o,s,u,s.root,i),this.animation=new Ik({stage:{update:l?null:function(){return r._flush(!0)}}}),l||this.animation.start()}return e.prototype.add=function(e){!this._disposed&&e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){!this._disposed&&e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},e.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=function(e){if(!e)return!1;if("string"==typeof e)return .4>bM(e,1);if(e.colorStops){for(var t=e.colorStops,n=0,i=t.length,r=0;r<i;r++)n+=bM(t[r].color,1);return(n/=i)<.4}return!1}(e))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(e){this._darkMode=e},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!1)},e.prototype._flush=function(e){var t,n=IA();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var i=IA();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:i-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){!this._disposed&&(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof MF&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){if(!this._disposed){var e;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,e=this.id,delete IG[e]}},e}();function IU(e,t){var n=new I$(mF++,e,t);return IG[n.id]=n,n}var Iq="";"u">typeof navigator&&(Iq=navigator.platform||"");var IY="rgba(0, 0, 0, 0.2)";let IZ={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:IY,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:IY,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:IY,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:IY,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:IY,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:IY,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Iq.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var IX=vh(),IK="\0_ec_inner",IQ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.init=function(e,t,n,i,r,o){i=i||{},this.option=null,this._theme=new _x(i),this._locale=new _x(r),this._optionManager=o},t.prototype.setOption=function(e,t,n){var i=I1(t);this._optionManager.setOption(e,n,i),this._resetOption(null,i)},t.prototype.resetOption=function(e,t){return this._resetOption(e,I1(t))},t.prototype._resetOption=function(e,t){var n=!1,i=this._optionManager;if(!e||"recreate"===e){var r=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this._mergeOption(r,t)):K(this,r),n=!0}if(("timeline"===e||"media"===e)&&this.restoreData(),!e||"recreate"===e||"timeline"===e){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,t))}if(!e||"recreate"===e||"media"===e){var a=i.getMediaOption(this);a.length&&mq(a,function(e){n=!0,this._mergeOption(e,t)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=vh(),s=t&&t.replaceMergeMainTypeMap;ye(this).datasetMap=vh(),mq(e,function(e,t){null!=e&&(Cf.hasClass(t)?t&&(o.push(t),a.set(t,!0)):n[t]=null==n[t]?mV(e):mj(n[t],e,!0))}),s&&s.each(function(e,t){Cf.hasClass(t)&&!a.get(t)&&(o.push(t),a.set(t,!0))}),Cf.topologicalTravel(o,Cf.getAllClassMainTypes(),function(t){var o,a,l,u,c,h,d,f,p,g,m,v,y,x,b,w,S,_,C,M,A=function(e,t,n){var i=IX.get(t);if(!i)return n;var r=i(e);return r?n.concat(r):n}(this,t,vB(e[t])),k=i.get(t),T=k?s&&s.get(t)?"replaceMerge":"normalMerge":"replaceAll",I=(y=k,x=A,b="normalMerge"===T,w="replaceMerge"===T,S="replaceAll"===T,y=y||[],x=(x||[]).slice(),_=vh(),mq(x,function(e,t){if(!m4(e)){x[t]=null;return}}),C=function(e,t,n){var i=[];if("replaceAll"===n)return i;for(var r=0;r<e.length;r++){var o=e[r];o&&null!=o.id&&t.set(o.id,r),i.push({existing:"replaceMerge"===n||v$(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return i}(y,_,T),(b||w)&&(o=C,a=y,l=_,mq(u=x,function(e,t){if(e&&null!=e.id){var n=vH(e.id),i=l.get(n);if(null!=i){var r=o[i];vo(!r.newOption,'Duplicated option on id "'+n+'".'),r.newOption=e,r.existing=a[i],u[t]=null}}})),b&&(c=C,mq(h=x,function(e,t){if(e&&null!=e.name)for(var n=0;n<c.length;n++){var i=c[n].existing;if(!c[n].newOption&&i&&(null==i.id||null==e.id)&&!v$(e)&&!v$(i)&&vj("name",i,e)){c[n].newOption=e,h[t]=null;return}}})),b||w?(d=C,f=x,p=w,mq(f,function(e){if(e){for(var t,n=0;(t=d[n])&&(t.newOption||v$(t.existing)||t.existing&&null!=e.id&&!vj("id",e,t.existing));)n++;t?(t.newOption=e,t.brandNew=p):d.push({newOption:e,brandNew:p,existing:null,keyInfo:null}),n++}})):S&&(g=C,mq(x,function(e){g.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})})),m=C,v=vh(),mq(m,function(e){var t=e.existing;t&&v.set(t.id,e)}),mq(m,function(e){var t=e.newOption;vo(!t||null==t.id||!v.get(t.id)||v.get(t.id)===e,"id duplicates: "+(t&&t.id)),t&&null!=t.id&&v.set(t.id,e),e.keyInfo||(e.keyInfo={})}),mq(m,function(e,t){var n=e.existing,i=e.newOption,r=e.keyInfo;if(m4(i)){if(r.name=null!=i.name?vH(i.name):n?n.name:vL+t,n)r.id=vH(n.id);else if(null!=i.id)r.id=vH(i.id);else{var o=0;do r.id="\0"+r.name+"\0"+o++;while(v.get(r.id))}v.set(r.id,e)}}),C);mq(I,function(e){var n,i,r,o,a=e.newOption;m4(a)&&(e.keyInfo.mainType=t,e.keyInfo.subType=(n=t,i=a,r=e.existing,o=Cf,i.type?i.type:r?r.subType:o.determineSubType(n,i)))}),n[t]=null,i.set(t,null),r.set(t,0);var D=[],O=[],P=0;mq(I,function(e,n){var i=e.existing,r=e.newOption;if(r){var o="series"===t,a=Cf.getClass(t,e.keyInfo.subType,!o);if(!a)return;if("tooltip"===t){if(M)return;M=!0}if(i&&i.constructor===a)i.name=e.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=mH({componentIndex:n},e.keyInfo);mH(i=new a(r,this,this,s),s),e.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(D.push(i.option),O.push(i),P++):(D.push(void 0),O.push(void 0))},this),n[t]=D,i.set(t,O),r.set(t,P),"series"===t&&Z(this)},this),this._seriesIndices||Z(this)},t.prototype.getOption=function(){var e=mV(this.option);return mq(e,function(t,n){if(Cf.hasClass(n)){for(var i=vB(t),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!v$(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,e[n]=i}}),delete e[IK],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var i=n[t||0];if(i)return i;if(null==t){for(var r=0;r<n.length;r++)if(n[r])return n[r]}}},t.prototype.queryComponents=function(e){var t,n=e.mainType;if(!n)return[];var i=e.index,r=e.id,o=e.name,a=this._componentsMap.get(n);return a&&a.length?(null!=i?(t=[],mq(vB(i),function(e){a[e]&&t.push(a[e])})):t=null!=r?IJ("id",r,a):null!=o?IJ("name",o,a):mX(a,function(e){return!!e}),I0(t,e)):[]},t.prototype.findComponents=function(e){var t,n,i,r,o,a=e.query,s=e.mainType,l=(t=a,n=s+"Index",i=s+"Id",r=s+"Name",t&&(null!=t[n]||null!=t[i]||null!=t[r])?{mainType:s,index:t[n],id:t[i],name:t[r]}:null);return o=I0(l?this.queryComponents(l):mX(this._componentsMap.get(s),function(e){return!!e}),e),e.filter?mX(o,e.filter):o},t.prototype.eachComponent=function(e,t,n){var i=this._componentsMap;if(m1(e))i.each(function(n,i){for(var r=0;n&&r<n.length;r++){var o=n[r];o&&e.call(t,i,o,o.componentIndex)}});else for(var r=m2(e)?i.get(e):m4(e)?this.findComponents(e):null,o=0;r&&o<r.length;o++){var a=r[o];a&&t.call(n,a,a.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=vW(e,null);return mX(this._componentsMap.get("series"),function(e){return!!e&&null!=t&&e.name===t})},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get("series")[e]},t.prototype.getSeriesByType=function(e){return mX(this._componentsMap.get("series"),function(t){return!!t&&t.subType===e})},t.prototype.getSeries=function(){return mX(this._componentsMap.get("series"),function(e){return!!e})},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(e,t){X(this),mq(this._seriesIndices,function(n){var i=this._componentsMap.get("series")[n];e.call(t,i,n)},this)},t.prototype.eachRawSeries=function(e,t){mq(this._componentsMap.get("series"),function(n){n&&e.call(t,n,n.componentIndex)})},t.prototype.eachSeriesByType=function(e,t,n){X(this),mq(this._seriesIndices,function(i){var r=this._componentsMap.get("series")[i];r.subType===e&&t.call(n,r,i)},this)},t.prototype.eachRawSeriesByType=function(e,t,n){return mq(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return X(this),null==this._seriesIndicesMap.get(e.componentIndex)},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){X(this);var n=[];mq(this._seriesIndices,function(i){var r=this._componentsMap.get("series")[i];e.call(t,r,i)&&n.push(i)},this),this._seriesIndices=n,this._seriesIndicesMap=vh(n)},t.prototype.restoreData=function(e){Z(this);var t=this._componentsMap,n=[];t.each(function(e,t){Cf.hasClass(t)&&n.push(t)}),Cf.topologicalTravel(n,Cf.getAllClassMainTypes(),function(n){mq(t.get(n),function(t){t&&("series"!==n||!function(e,t){if(t){var n=t.seriesIndex,i=t.seriesId,r=t.seriesName;return null!=n&&e.componentIndex!==n||null!=i&&e.id!==i||null!=r&&e.name!==r}}(t,e))&&t.restoreData()})})},t.internalField=void(Z=function(e){var t=e._seriesIndices=[];mq(e._componentsMap.get("series"),function(e){e&&t.push(e.componentIndex)}),e._seriesIndicesMap=vh(t)},X=function(e){},K=function(e,t){e.option={},e.option[IK]=1,e._componentsMap=vh({series:[]}),e._componentsCount=vh();var n,i,r,o=t.aria;m4(o)&&null==o.enabled&&(o.enabled=!0),n=t,i=e._theme.option,r=n.color&&!n.colorLayer,mq(i,function(e,t){("colorLayer"!==t||!r)&&(Cf.hasClass(t)||("object"==typeof e?n[t]=n[t]?mj(n[t],e,!1):mV(e):null==n[t]&&(n[t]=e)))}),mj(t,IZ,!1),e._mergeOption(t,null)}),t}(_x);function IJ(e,t,n){if(m0(t)){var i=vh();return mq(t,function(e){null!=e&&null!=vW(e,null)&&i.set(e,!0)}),mX(n,function(t){return t&&i.get(t[e])})}var r=vW(t,null);return mX(n,function(t){return t&&null!=r&&t[e]===r})}function I0(e,t){return t.hasOwnProperty("subType")?mX(e,function(e){return e&&e.subType===t.subType}):e}function I1(e){var t=vh();return e&&mq(vB(e.replaceMerge),function(e){t.set(e,!0)}),{replaceMergeMainTypeMap:t}}m$(IQ,Cv);var I2=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"];let I5=function(e){mq(I2,function(t){this[t]=mQ(e[t],e)},this)};var I3=/^(min|max)?(.+)$/,I4=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(mq(vB(e.series),function(e){e&&e.data&&m8(e.data)&&(e.data[vs]=!0)}),mq(vB(e.dataset),function(e){e&&e.source&&m8(e.source)&&(e.source[vs]=!0)})),e=mV(e);var i=this._optionBackup,r=function(e,t,n){var i,r,o=[],a=e.baseOption,s=e.timeline,l=e.options,u=e.media,c=!!e.media,h=!!(l||s||a&&a.timeline);function d(e){mq(t,function(t){t(e,n)})}return a?(r=a).timeline||(r.timeline=s):((h||c)&&(e.options=e.media=null),r=e),c&&m0(u)&&mq(u,function(e){e&&e.option&&(e.query?o.push(e):i||(i=e))}),d(r),mq(l,function(e){return d(e)}),mq(o,function(e){return d(e.option)}),{baseOption:r,timelineOptions:l||[],mediaDefault:i,mediaList:o}}(e,t,!i);this._newBaseOption=r.baseOption,i?(r.timelineOptions.length&&(i.timelineOptions=r.timelineOptions),r.mediaList.length&&(i.mediaList=r.mediaList),r.mediaDefault&&(i.mediaDefault=r.mediaDefault)):this._optionBackup=r},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],mV(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var i=e.getComponent("timeline");i&&(t=mV(n[i.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t,n,i=this._api.getWidth(),r=this._api.getHeight(),o=this._mediaList,a=this._mediaDefault,s=[],l=[];if(!o.length&&!a)return l;for(var u=0,c=o.length;u<c;u++)(function(e,t,n){var i={width:t,height:n,aspectratio:t/n},r=!0;return mq(e,function(e,t){var n=t.match(I3);if(n&&n[1]&&n[2]){var o,a,s,l=n[1];o=i[n[2].toLowerCase()],a=e,("min"===(s=l)?o>=a:"max"===s?o<=a:o===a)||(r=!1)}}),r})(o[u].query,i,r)&&s.push(u);return!s.length&&a&&(s=[-1]),s.length&&(t=s,n=this._currentMediaIndices,t.join(",")!==n.join(","))&&(l=mY(s,function(e){return mV(-1===e?a.option:o[e].option)})),this._currentMediaIndices=s,l},e}(),I6=m4,I8=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function I9(e){var t=e&&e.itemStyle;if(t)for(var n=0,i=I8.length;n<i;n++){var r=I8[n],o=t.normal,a=t.emphasis;o&&o[r]&&(e[r]=e[r]||{},e[r].normal?mj(e[r].normal,o[r]):e[r].normal=o[r],o[r]=null),a&&a[r]&&(e[r]=e[r]||{},e[r].emphasis?mj(e[r].emphasis,a[r]):e[r].emphasis=a[r],a[r]=null)}}function I7(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var i=e[t].normal,r=e[t].emphasis;i&&(n?(e[t].normal=e[t].emphasis=null,mW(e[t],i)):e[t]=i),r&&(e.emphasis=e.emphasis||{},e.emphasis[t]=r,r.focus&&(e.emphasis.focus=r.focus),r.blurScope&&(e.emphasis.blurScope=r.blurScope))}}function De(e){I7(e,"itemStyle"),I7(e,"lineStyle"),I7(e,"areaStyle"),I7(e,"label"),I7(e,"labelLine"),I7(e,"upperLabel"),I7(e,"edgeLabel")}function Dt(e,t){var n=I6(e)&&e[t],i=I6(n)&&n.textStyle;if(i)for(var r=0,o=vz.length;r<o;r++){var a=vz[r];i.hasOwnProperty(a)&&(n[a]=i[a])}}function Dn(e){e&&(De(e),Dt(e,"label"),e.emphasis&&Dt(e.emphasis,"label"))}function Di(e){return m0(e)?e:e?[e]:[]}function Dr(e){return(m0(e)?e[0]:e)||{}}function Do(e){e&&mq(Da,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}var Da=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Ds=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Dl=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Du(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<Dl.length;n++){var i=Dl[n][1],r=Dl[n][0];null!=t[i]&&(t[r]=t[i])}}function Dc(e){e&&"edge"===e.alignTo&&null!=e.margin&&null==e.edgeDistance&&(e.edgeDistance=e.margin)}function Dh(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay)}function Dd(e,t){var n;mq(Di(e.series),function(e){I6(e)&&function(e){if(I6(e)){I9(e),De(e),Dt(e,"label"),Dt(e,"upperLabel"),Dt(e,"edgeLabel"),e.emphasis&&(Dt(e.emphasis,"label"),Dt(e.emphasis,"upperLabel"),Dt(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(I9(t),Dn(t));var n=e.markLine;n&&(I9(n),Dn(n));var i=e.markArea;i&&Dn(i);var r=e.data;if("graph"===e.type){r=r||e.nodes;var o=e.links||e.edges;if(o&&!m8(o))for(var a=0;a<o.length;a++)Dn(o[a]);mq(e.categories,function(e){De(e)})}if(r&&!m8(r))for(var a=0;a<r.length;a++)Dn(r[a]);if((t=e.markPoint)&&t.data)for(var s=t.data,a=0;a<s.length;a++)Dn(s[a]);if((n=e.markLine)&&n.data)for(var l=n.data,a=0;a<l.length;a++)m0(l[a])?(Dn(l[a][0]),Dn(l[a][1])):Dn(l[a]);"gauge"===e.type?(Dt(e,"axisLabel"),Dt(e,"title"),Dt(e,"detail")):"treemap"===e.type?(I7(e.breadcrumb,"itemStyle"),mq(e.levels,function(e){De(e)})):"tree"===e.type&&De(e.leaves)}}(e)}),n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"],t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),mq(n,function(t){mq(Di(e[t]),function(e){e&&(Dt(e,"axisLabel"),Dt(e.axisPointer,"label"))})}),mq(Di(e.parallel),function(e){var t=e&&e.parallelAxisDefault;Dt(t,"axisLabel"),Dt(t&&t.axisPointer,"label")}),mq(Di(e.calendar),function(e){I7(e,"itemStyle"),Dt(e,"dayLabel"),Dt(e,"monthLabel"),Dt(e,"yearLabel")}),mq(Di(e.radar),function(e){Dt(e,"name"),e.name&&null==e.axisName&&(e.axisName=e.name,delete e.name),null!=e.nameGap&&null==e.axisNameGap&&(e.axisNameGap=e.nameGap,delete e.nameGap)}),mq(Di(e.geo),function(e){I6(e)&&(Dn(e),mq(Di(e.regions),function(e){Dn(e)}))}),mq(Di(e.timeline),function(e){Dn(e),I7(e,"label"),I7(e,"itemStyle"),I7(e,"controlStyle",!0);var t=e.data;m0(t)&&mq(t,function(e){m4(e)&&(I7(e,"label"),I7(e,"itemStyle"))})}),mq(Di(e.toolbox),function(e){I7(e,"iconStyle"),mq(e.feature,function(e){I7(e,"iconStyle")})}),Dt(Dr(e.axisPointer),"label"),Dt(Dr(e.tooltip).axisPointer,"label"),e.series=vB(e.series),mq(e.series,function(e){if(m4(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow);else if("pie"===t||"gauge"===t){null!=e.clockWise&&(e.clockwise=e.clockWise),Dc(e.label);var n=e.data;if(n&&!m8(n))for(var i=0;i<n.length;i++)Dc(n[i]);null!=e.hoverOffset&&(e.emphasis=e.emphasis||{},e.emphasis.scaleSize=null)}else if("gauge"===t){var r=function(e,t){for(var n=t.split(","),i=e,r=0;r<n.length&&null!=(i=i&&i[n[r]]);r++);return i}(e,"pointer.color");null!=r&&function(e,t,n){for(var i,r=t.split(","),o=e,a=0;a<r.length-1;a++)null==o[i=r[a]]&&(o[i]={}),o=o[i];null==o[r[a]]&&(o[r[a]]=n)}(e,"itemStyle.color",r)}else if("bar"===t){Du(e),Du(e.backgroundStyle),Du(e.emphasis);var n=e.data;if(n&&!m8(n))for(var i=0;i<n.length;i++)"object"==typeof n[i]&&(Du(n[i]),Du(n[i]&&n[i].emphasis))}else if("sunburst"===t){var o=e.highlightPolicy;o&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=o)),Dh(e),function e(t,n){if(t)for(var i=0;i<t.length;i++)n(t[i]),t[i]&&e(t[i].children,n)}(e.data,Dh)}else"graph"===t||"sankey"===t?e&&null!=e.focusNodeAdjacency&&(e.emphasis=e.emphasis||{},null==e.emphasis.focus&&(e.emphasis.focus="adjacency")):"map"===t&&(e.mapType&&!e.map&&(e.map=e.mapType),e.mapLocation&&mW(e,e.mapLocation));null!=e.hoverAnimation&&(e.emphasis=e.emphasis||{},e.emphasis&&null==e.emphasis.scale&&(e.emphasis.scale=e.hoverAnimation)),Do(e)}}),e.dataRange&&(e.visualMap=e.dataRange),mq(Ds,function(t){var n=e[t];n&&(m0(n)||(n=[n]),mq(n,function(e){Do(e)}))})}function Df(e){mq(e,function(t,n){var i=[],r=[NaN,NaN],o=[t.stackResultDimension,t.stackedOverDimension],a=t.data,s=t.isStackedByIndex,l=t.seriesModel.get("stackStrategy")||"samesign";a.modify(o,function(o,u,c){var h,d,f=a.get(t.stackedDimension,c);if(isNaN(f))return r;s?d=a.getRawIndex(c):h=a.get(t.stackedByDimension,c);for(var p=NaN,g=n-1;g>=0;g--){var m=e[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,h)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&f>=0&&v>0||"samesign"===l&&f<=0&&v<0){f=function(e,t){var n=Math.max(vw(e),vw(t)),i=e+t;return n>20?i:vx(i,n)}(f,v),p=v;break}}}return i[0]=f,i[1]=p,i})})}var Dp=function(){function e(){this.group=new MF,this.uid=_w("viewComponent")}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,i){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,i){},e.prototype.updateLayout=function(e,t,n,i){},e.prototype.updateVisual=function(e,t,n,i){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();yW(Dp),yY(Dp);var Dg=vq(),Dm={itemStyle:yZ(_m,!0),lineStyle:yZ(_f,!0)},Dv={lineStyle:"stroke",itemStyle:"fill"};function Dy(e,t){var n=e.visualStyleMapper||Dm[t];return n||(console.warn("Unknown style type '"+t+"'."),Dm.itemStyle)}function Dx(e,t){var n=e.visualDrawType||Dv[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var Db=new _x,Dw=Math.PI,DS=function(){function e(e,t,n,i){this._stageTaskMap=vh(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,r=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,o=i&&i.modDataCount,a=null!=o?Math.ceil(o/r):null;return{step:r,modBy:a,modDataCount:o}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData().count(),r=n.progressiveEnabled&&t.incrementalPrepareRender&&i>=n.threshold,o=e.get("large")&&i>=e.get("largeThreshold"),a="mod"===e.get("progressiveChunkMode")?i:null;e.pipelineContext=n.context={progressiveRender:r,modDataCount:a,large:o}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=vh();e.eachSeries(function(e){var i=e.getProgressive(),r=e.uid;n.set(r,{id:r,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),t._pipe(e,e.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;mq(this._allHandlers,function(i){var r=e.get(i.uid)||e.set(i.uid,{});vo(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,r,t,n),i.overallReset&&this._createOverallStageTask(i,r,t,n)},this)},e.prototype.prepareView=function(e,t,n,i){var r=e.renderTask,o=r.context;o.model=t,o.ecModel=n,o.api=i,r.__block=!e.incrementalPrepareRender,this._pipe(t,r)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,i){i=i||{};var r=!1,o=this;function a(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}mq(e,function(e,s){if(!i.visualType||i.visualType===e.visualType){var l=o._stageTaskMap.get(e.uid),u=l.seriesTaskMap,c=l.overallTask;if(c){var h,d=c.agentStubMap;d.each(function(e){a(i,e)&&(e.dirty(),h=!0)}),h&&c.dirty(),o.updatePayload(c,n);var f=o.getPerformArgs(c,i.block);d.each(function(e){e.perform(f)}),c.perform(f)&&(r=!0)}else u&&u.each(function(s,l){a(i,s)&&s.dirty();var u=o.getPerformArgs(s,i.block);u.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(r=!0)})}}),this.unfinished=r||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,i){var r=this,o=t.seriesTaskMap,a=t.seriesTaskMap=vh(),s=e.seriesType,l=e.getTargetSeries;function u(t){var s=t.uid,l=a.set(s,o&&o.get(s)||CD({plan:Dk,reset:DT,count:DO}));l.context={model:t,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:r},r._pipe(t,l)}e.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,i).each(u)},e.prototype._createOverallStageTask=function(e,t,n,i){var r=this,o=t.overallTask=t.overallTask||CD({reset:D_});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=vh(),l=e.seriesType,u=e.getTargetSeries,c=!0,h=!1;function d(e){var t=e.uid,n=s.set(t,a&&a.get(t)||(h=!0,CD({reset:DC,onDirty:DA})));n.context={model:e,overallProgress:c},n.agent=o,n.__block=c,r._pipe(e,n)}vo(!e.createOnAllSeries,""),l?n.eachRawSeriesByType(l,d):u?u(n,i).each(d):(c=!1,mq(n.getSeries(),d)),h&&o.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);i.head||(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},e.wrapStageHandler=function(e,t){return m1(e)&&(e={overallReset:e,seriesType:function(e){Q=null;try{e(DP,DR)}catch(e){}return Q}(e)}),e.uid=_w("stageHandler"),t&&(e.visualType=t),e},e}();function D_(e){e.overallReset(e.ecModel,e.api,e.payload)}function DC(e){return e.overallProgress&&DM}function DM(){this.agent.dirty(),this.getDownstream().dirty()}function DA(){this.agent&&this.agent.dirty()}function Dk(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function DT(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=vB(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?mY(t,function(e,t){return DD(t)}):DI}var DI=DD(0);function DD(e){return function(t,n){var i=n.data,r=n.resetDefines[e];if(r&&r.dataEach)for(var o=t.start;o<t.end;o++)r.dataEach(i,o);else r&&r.progress&&r.progress(t,i)}}function DO(e){return e.data.count()}var DP={},DR={};function DE(e,t){for(var n in t.prototype)e[n]=vg}DE(DP,IQ),DE(DR,I5),DP.eachSeriesByType=DP.eachRawSeriesByType=function(e){Q=e},DP.eachComponent=function(e){"series"===e.mainType&&e.subType&&(Q=e.subType)};var DL=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],DN="#B9B8CE",DB="#100C2A",DF=function(){return{axisLine:{lineStyle:{color:DN}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},Dz=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],DV={darkMode:!0,color:Dz,backgroundColor:DB,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:DN}},textStyle:{color:DN},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:DN}},dataZoom:{borderColor:"#71708A",textStyle:{color:DN},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:DN}},timeline:{lineStyle:{color:DN},label:{color:DN},controlStyle:{color:DN,borderColor:DN}},calendar:{itemStyle:{color:DB},dayLabel:{color:DN},monthLabel:{color:DN},yearLabel:{color:DN}},timeAxis:DF(),logAxis:DF(),valueAxis:DF(),categoryAxis:DF(),line:{symbol:"circle"},graph:{color:Dz},gauge:{title:{color:DN},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:DN},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};DV.categoryAxis.splitLine.show=!1;var Dj=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},i={};if(m2(e)){var r=yH(e);t.mainType=r.main||null,t.subType=r.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};mq(e,function(e,r){for(var s=!1,l=0;l<o.length;l++){var u=o[l],c=r.lastIndexOf(u);if(c>0&&c===r.length-u.length){var h=r.slice(0,c);"data"!==h&&(t.mainType=h,t[u.toLowerCase()]=e,s=!0)}}a.hasOwnProperty(r)&&(n[r]=e,s=!0),s||(i[r]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:i}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=t.cptQuery,l=t.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,r,"name")&&u(l,r,"dataIndex")&&u(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(e,t.otherQuery,i,r));function u(e,t,n,i){return null==e[n]||t[i||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),DH=["symbol","symbolSize","symbolRotate","symbolOffset"],DW=DH.concat(["symbolKeepAspect"]);function DG(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n)}}function D$(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t)}}function DU(e,t,n){for(var i;e&&(!t(e)||(i=e,!n));)e=e.__hostTarget||e.parent;return i}var Dq=Math.round(9*Math.random()),DY="function"==typeof Object.defineProperty,DZ=function(){function e(){this._id="__ec_inner_"+Dq++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return DY?Object.defineProperty(n,this._id,{value:t,enumerable:!1,configurable:!0}):n[this._id]=t,this},e.prototype.delete=function(e){return!!this.has(e)&&(delete this._guard(e)[this._id],!0)},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},e}();function DX(e){return isFinite(e)}function DK(e,t,n){for(var i,r,o,a,s,l,u,c,h,d,f="radial"===t.type?(o=Math.min(i=n.width,r=n.height),a=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r,t.global||(a=a*i+n.x,s=s*r+n.y,l*=o),a=DX(a)?a:.5,s=DX(s)?s:.5,l=l>=0&&DX(l)?l:.5,e.createRadialGradient(a,s,0,a,s,l)):(u=null==t.x?0:t.x,c=null==t.x2?1:t.x2,h=null==t.y?0:t.y,d=null==t.y2?0:t.y2,t.global||(u=u*n.width+n.x,c=c*n.width+n.x,h=h*n.height+n.y,d=d*n.height+n.y),u=DX(u)?u:0,c=DX(c)?c:1,h=DX(h)?h:0,d=DX(d)?d:0,e.createLinearGradient(u,h,c,d)),p=t.colorStops,g=0;g<p.length;g++)f.addColorStop(p[g].offset,p[g].color);return f}function DQ(e){return parseInt(e,10)}function DJ(e,t,n){var i=["width","height"][t],r=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=n[i]&&"auto"!==n[i])return parseFloat(n[i]);var s=document.defaultView.getComputedStyle(e);return(e[r]||DQ(s[i])||DQ(e.style[i]))-(DQ(s[o])||0)-(DQ(s[a])||0)|0}function D0(e){var t,n,i=e.style,r=i.lineDash&&i.lineWidth>0&&(t=i.lineDash,n=i.lineWidth,t&&"solid"!==t&&n>0?"dashed"===t?[4*n,2*n]:"dotted"===t?[n]:m3(t)?[t]:m0(t)?t:null:null),o=i.lineDashOffset;if(r){var a=i.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&1!==a&&(r=mY(r,function(e){return e/a}),o/=a)}return[r,o]}var D1=new wA(!0);function D2(e){var t=e.stroke;return null!=t&&"none"!==t&&e.lineWidth>0}function D5(e){return"string"==typeof e&&"none"!==e}function D3(e){var t=e.fill;return null!=t&&"none"!==t}function D4(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function D6(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function D8(e,t,n){var i=y3(t.image,t.__image,n);if(y6(i)){var r=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(t.x||0,t.y||0),o.rotateSelf(0,0,(t.rotation||0)*vm),o.scaleSelf(t.scaleX||1,t.scaleY||1),r.setTransform(o)}return r}}var D9=["shadowBlur","shadowOffsetX","shadowOffsetY"],D7=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Oe(e,t,n,i,r){var o=!1;if(!i&&t===(n=n||{}))return!1;if(i||t.opacity!==n.opacity){Oi(e,r),o=!0;var a=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(a)?bJ.opacity:a}(i||t.blend!==n.blend)&&(o||(Oi(e,r),o=!0),e.globalCompositeOperation=t.blend||bJ.blend);for(var s=0;s<D9.length;s++){var l=D9[s];(i||t[l]!==n[l])&&(o||(Oi(e,r),o=!0),e[l]=e.dpr*(t[l]||0))}return(i||t.shadowColor!==n.shadowColor)&&(o||(Oi(e,r),o=!0),e.shadowColor=t.shadowColor||bJ.shadowColor),o}function Ot(e,t,n,i,r){var o=Or(t,r.inHover),a=i?null:n&&Or(n,r.inHover)||{};if(o===a)return!1;var s=Oe(e,o,a,i,r);if((i||o.fill!==a.fill)&&(s||(Oi(e,r),s=!0),D5(o.fill)&&(e.fillStyle=o.fill)),(i||o.stroke!==a.stroke)&&(s||(Oi(e,r),s=!0),D5(o.stroke)&&(e.strokeStyle=o.stroke)),(i||o.opacity!==a.opacity)&&(s||(Oi(e,r),s=!0),e.globalAlpha=null==o.opacity?1:o.opacity),t.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==l&&(s||(Oi(e,r),s=!0),e.lineWidth=l)}for(var u=0;u<D7.length;u++){var c=D7[u],h=c[0];(i||o[h]!==a[h])&&(s||(Oi(e,r),s=!0),e[h]=o[h]||c[1])}return s}function On(e,t){var n=t.transform,i=e.dpr||1;n?e.setTransform(i*n[0],i*n[1],i*n[2],i*n[3],i*n[4],i*n[5]):e.setTransform(i,0,0,i,0,0)}function Oi(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function Or(e,t){return t&&e.__hoverStyle||e.style}function Oo(e,t){Oa(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function Oa(e,t,n,i){var r,o=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1)){t.__dirty&=-2,t.__isRendered=!1;return}var a=t.__clipPaths,s=n.prevElClipPaths,l=!1,u=!1;if(!s||function(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}(a,s)){if(s&&s.length&&(Oi(e,n),e.restore(),u=l=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),a&&a.length){Oi(e,n),e.save();for(var c=!1,h=0;h<a.length;h++){var d=a[h];c=c||d.isZeroArea(),On(e,d),e.beginPath(),d.buildPath(e,d.shape),e.clip()}n.allClipped=c,l=!0}n.prevElClipPaths=a}if(n.allClipped){t.__isRendered=!1;return}t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var f=n.prevEl;f||(u=l=!0);var p=t instanceof wV&&t.autoBatch&&(v=D3(m=t.style),y=D2(m),!(m.lineDash||!(v^y)||v&&"string"!=typeof m.fill||y&&"string"!=typeof m.stroke||m.strokePercent<1||m.strokeOpacity<1||m.fillOpacity<1));!l&&(x=f.transform,o&&x?o[0]===x[0]&&o[1]===x[1]&&o[2]===x[2]&&o[3]===x[3]&&o[4]===x[4]&&o[5]===x[5]:+(!o&&!x))?p||Oi(e,n):(Oi(e,n),On(e,t));var g=Or(t,n.inHover);if(t instanceof wV)1!==n.lastDrawType&&(u=!0,n.lastDrawType=1),Ot(e,t,f,u,n),p&&(n.batchFill||n.batchStroke)||e.beginPath(),function(e,t,n,i){var r,o,a,s=D2(n),l=D3(n),u=n.strokePercent,c=u<1,h=!t.path;(!t.silent||c)&&h&&t.createPathProxy();var d=t.path||D1,f=t.__dirty;if(!i){var p=n.fill,g=n.stroke,m=l&&!!p.colorStops,v=s&&!!g.colorStops,y=l&&!!p.image,x=s&&!!g.image,b=void 0,w=void 0,S=void 0,_=void 0,C=void 0;(m||v)&&(C=t.getBoundingRect()),m&&(b=f?DK(e,p,C):t.__canvasFillGradient,t.__canvasFillGradient=b),v&&(w=f?DK(e,g,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=w),y&&(S=f||!t.__canvasFillPattern?D8(e,p,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(_=f||!t.__canvasStrokePattern?D8(e,g,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),m?e.fillStyle=b:y&&(S?e.fillStyle=S:l=!1),v?e.strokeStyle=w:x&&(_?e.strokeStyle=_:s=!1)}var M=t.getGlobalScale();d.setScale(M[0],M[1],t.segmentIgnoreThreshold),e.setLineDash&&n.lineDash&&(o=(r=D0(t))[0],a=r[1]);var A=!0;(h||4&f)&&(d.setDPR(e.dpr),c?d.setContext(null):(d.setContext(e),A=!1),d.reset(),t.buildPath(d,t.shape,i),d.toStatic(),t.pathUpdated()),A&&d.rebuildPath(e,c?u:1),o&&(e.setLineDash(o),e.lineDashOffset=a),!i&&(n.strokeFirst?(s&&D6(e,n),l&&D4(e,n)):(l&&D4(e,n),s&&D6(e,n))),o&&e.setLineDash([])}(e,t,g,p),p&&(n.batchFill=g.fill||"",n.batchStroke=g.stroke||"");else if(t instanceof wH){3!==n.lastDrawType&&(u=!0,n.lastDrawType=3),Ot(e,t,f,u,n);var m,v,y,x,b,w=g.text;if(null!=w&&(w+=""),w){e.font=g.font||mC,e.textAlign=g.textAlign,e.textBaseline=g.textBaseline;var S=void 0,_=void 0;e.setLineDash&&g.lineDash&&(S=(b=D0(t))[0],_=b[1]),S&&(e.setLineDash(S),e.lineDashOffset=_),g.strokeFirst?(D2(g)&&e.strokeText(w,g.x,g.y),D3(g)&&e.fillText(w,g.x,g.y)):(D3(g)&&e.fillText(w,g.x,g.y),D2(g)&&e.strokeText(w,g.x,g.y)),S&&e.setLineDash([])}}else t instanceof wU?(2!==n.lastDrawType&&(u=!0,n.lastDrawType=2),r=u,Oe(e,Or(t,n.inHover),f&&Or(f,n.inHover),r,n),function(e,t,n){var i=t.__image=y3(n.image,t.__image,t,t.onload);if(i&&y6(i)){var r=n.x||0,o=n.y||0,a=t.getWidth(),s=t.getHeight(),l=i.width/i.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=i.width,s=i.height),n.sWidth&&n.sHeight){var u=n.sx||0,c=n.sy||0;e.drawImage(i,u,c,n.sWidth,n.sHeight,r,o,a,s)}else if(n.sx&&n.sy){var u=n.sx,c=n.sy,h=a-u,d=s-c;e.drawImage(i,u,c,h,d,r,o,a,s)}else e.drawImage(i,r,o,a,s)}}(e,t,g)):t.getTemporalDisplayables&&(4!==n.lastDrawType&&(u=!0,n.lastDrawType=4),function(e,t,n){var i,r,o=t.getDisplayables(),a=t.getTemporalDisplayables();e.save();var s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(i=t.getCursor(),r=o.length;i<r;i++){var l=o[i];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),Oa(e,l,s,i===r-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),s.prevEl=l}for(var u=0,c=a.length;u<c;u++){var l=a[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),Oa(e,l,s,u===c-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),s.prevEl=l}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}(e,t,n));p&&i&&Oi(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}var Os=new DZ,Ol=new y2(100),Ou=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Oc(e,t){if("none"===e)return null;var n=t.getDevicePixelRatio(),i=t.getZr(),r="svg"===i.painter.type;e.dirty&&Os.delete(e);var o=Os.get(e);if(o)return o;var a=mW(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===a.backgroundColor&&(a.backgroundColor=null);var s={repeat:"repeat"};return function(e){for(var t,o,s=[n],l=!0,u=0;u<Ou.length;++u){var c=a[Ou[u]];if(null!=c&&!m0(c)&&!m2(c)&&!m3(c)&&"boolean"!=typeof c){l=!1;break}s.push(c)}if(l){t=s.join(",")+(r?"-svg":"");var h=Ol.get(t);h&&(r?e.svgElement=h:e.image=h)}var d=function e(t){if(!t||0===t.length)return[[0,0]];if(m3(t)){var n=Math.ceil(t);return[[n,n]]}for(var i=!0,r=0;r<t.length;++r)if(!m3(t[r])){i=!1;break}if(i)return e([t]);for(var o=[],r=0;r<t.length;++r)if(m3(t[r])){var n=Math.ceil(t[r]);o.push([n,n])}else{var n=mY(t[r],function(e){return Math.ceil(e)});n.length%2==1?o.push(n.concat(n)):o.push(n)}return o}(a.dashArrayX),f=function(e){if(!e||"object"==typeof e&&0===e.length)return[0,0];if(m3(e)){var t=Math.ceil(e);return[t,t]}var n=mY(e,function(e){return Math.ceil(e)});return e.length%2?n.concat(n):n}(a.dashArrayY),p=function e(t){if(!t||0===t.length)return[["rect"]];if(m2(t))return[[t]];for(var n=!0,i=0;i<t.length;++i)if(!m2(t[i])){n=!1;break}if(n)return e([t]);for(var r=[],i=0;i<t.length;++i)m2(t[i])?r.push([t[i]]):r.push(t[i]);return r}(a.symbol),g=mY(d,function(e){return Oh(e)}),m=Oh(f),v=!r&&mA.createCanvas(),y=r&&{tag:"g",attrs:{},key:"dcl",children:[]},x=function(){for(var e=1,t=0,n=g.length;t<n;++t)e=vP(e,g[t]);for(var i=1,t=0,n=p.length;t<n;++t)i=vP(i,p[t].length);e*=i;var r=m*g.length*p.length;return{width:Math.max(1,Math.min(e,a.maxTileWidth)),height:Math.max(1,Math.min(r,a.maxTileHeight))}}();v&&(v.width=x.width*n,v.height=x.height*n,o=v.getContext("2d")),function(){o&&(o.clearRect(0,0,v.width,v.height),a.backgroundColor&&(o.fillStyle=a.backgroundColor,o.fillRect(0,0,v.width,v.height)));for(var e=0,t=0;t<f.length;++t)e+=f[t];if(!(e<=0))for(var s=-m,l=0,u=0,c=0;s<x.height;){if(l%2==0){for(var h=u/2%p.length,g=0,b=0,w=0;g<2*x.width;){for(var S=0,t=0;t<d[c].length;++t)S+=d[c][t];if(S<=0)break;if(b%2==0){var _=(1-a.symbolSize)*.5,C=g+d[c][b]*_,M=s+f[l]*_,A=d[c][b]*a.symbolSize,k=f[l]*a.symbolSize,T=w/2%p[h].length;!function(e,t,s,l,u){var c=r?1:n,h=k6(u,e*c,t*c,s*c,l*c,a.color,a.symbolKeepAspect);if(r){var d=i.painter.renderOneToVNode(h);d&&y.children.push(d)}else Oo(o,h)}(C,M,A,k,p[h][T])}g+=d[c][b],++w,++b===d[c].length&&(b=0)}++c===d.length&&(c=0)}s+=f[l],++u,++l===f.length&&(l=0)}}(),l&&Ol.put(t,v||y),e.image=v,e.svgElement=y,e.svgWidth=x.width,e.svgHeight=x.height}(s),s.rotation=a.rotation,s.scaleX=s.scaleY=r?1:1/n,Os.set(e,s),e.dirty=!1,s}function Oh(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?2*t:t}var Od=new bz,Of={},Op="__flagInMainProcess",Og="__pendingUpdate",Om="__needsUpdateStatus",Ov=/^[a-zA-Z0-9_]+$/,Oy="__connectUpdateStatus";function Ox(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.isDisposed()?void this.id:Ow(this,e,t)}}function Ob(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Ow(this,e,t)}}function Ow(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),bz.prototype[t].apply(e,n)}var OS=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t}(bz),O_=OS.prototype;O_.on=Ob("on"),O_.off=Ob("off");var OC=function(e){function t(t,n,i){var r=e.call(this,new Dj)||this;r._chartsViews=[],r._chartsMap={},r._componentsViews=[],r._componentsMap={},r._pendingActions=[],i=i||{},m2(n)&&(n=OP[n]),r._dom=t,i.ssr;var o=r._zr=IU(t,{renderer:i.renderer||"canvas",devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height,ssr:i.ssr,useDirtyRect:vt(i.useDirtyRect,!1),useCoarsePointer:vt(i.useCoarsePointer,"auto"),pointerSize:i.pointerSize});r._ssr=i.ssr,r._throttledZrFlush=kd(mQ(o.flush,o),17),(n=mV(n))&&Dd(n,!0),r._theme=n,r._locale=function(e){if(!m2(e))return mj(mV(e),mV(_R.EN),!1);var t=_R[e.toUpperCase()]||{};return"ZH"===e||"EN"===e?mV(t):mj(mV(t),mV(_R.EN),!1)}(i.locale||_L),r._coordSysMgr=new MD;var a=r._api=ef(r);function s(e,t){return e.__prio-t.__prio}return Iw(OO,s),Iw(OI,s),r._scheduler=new DS(r,a,OI,OO),r._messageCenter=new OS,r._initEvents(),r.resize=mQ(r.resize,r),o.animation.on("frame",r._onframe,r),el(o,r),eu(o,r),r[vs]=!0,r}return yz(t,e),t.prototype._onframe=function(){if(!this._disposed){em(this);var e=this._scheduler;if(this[Og]){var t=this[Og].silent;this[Op]=!0;try{J(this),en.update.call(this,null,this[Og].updateParams)}catch(e){throw this[Op]=!1,this[Og]=null,e}this._zr.flush(),this[Op]=!1,this[Og]=null,ea.call(this,t),es.call(this,t)}else if(e.unfinished){var n=1,i=this._model,r=this._api;e.unfinished=!1;do{var o=+new Date;e.performSeriesTasks(i),e.performDataProcessorTasks(i),er(this,i),e.performVisualTasks(i),ed(this,this._model,r,"remain",{}),n-=new Date-o}while(n>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[Op]){if(this._disposed)return void this.id;if(m4(t)&&(n=t.lazyUpdate,i=t.silent,r=t.replaceMerge,o=t.transition,t=t.notMerge),this[Op]=!0,!this._model||t){var i,r,o,a=new I4(this._api),s=this._theme,l=this._model=new IQ;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(e,{replaceMerge:r},OD);var u={seriesTransition:o,optionChanged:!0};if(n)this[Og]={silent:i,updateParams:u},this[Op]=!1,this.getZr().wakeUp();else{try{J(this),en.update.call(this,null,u)}catch(e){throw this[Og]=null,this[Op]=!1,e}this._ssr||this._zr.flush(),this[Og]=null,this[Op]=!1,ea.call(this,i),es.call(this,i)}}},t.prototype.setTheme=function(){},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||vE.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e=e||{},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get("backgroundColor"),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e=e||{},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(vE.svgSupported){var e=this._zr;return mq(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(this._disposed)return void this.id;var t=(e=e||{}).excludeComponents,n=this._model,i=[],r=this;mq(t,function(e){n.eachComponent({mainType:e},function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(i.push(t),t.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return mq(i,function(e){e.group.ignore=!1}),o},t.prototype.getConnectedDataURL=function(e){if(this._disposed)return void this.id;var t="svg"===e.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(!OL[n])return this.getDataURL(e);var a=o,s=o,l=-o,u=-o,c=[],h=e&&e.pixelRatio||this.getDevicePixelRatio();mq(OE,function(o,h){if(o.group===n){var d=t?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(mV(e)),f=o.getDom().getBoundingClientRect();a=i(f.left,a),s=i(f.top,s),l=r(f.right,l),u=r(f.bottom,u),c.push({dom:d,left:f.left,top:f.top})}}),a*=h,s*=h,l*=h,u*=h;var d=l-a,f=u-s,p=mA.createCanvas(),g=IU(p,{renderer:t?"svg":"canvas"});if(g.resize({width:d,height:f}),!t)return e.connectedBackgroundColor&&g.add(new w0({shape:{x:0,y:0,width:d,height:f},style:{fill:e.connectedBackgroundColor}})),mq(c,function(e){var t=new wU({style:{x:e.left*h-a,y:e.top*h-s,image:e.dom}});g.add(t)}),g.refreshImmediately(),p.toDataURL("image/"+(e&&e.type||"png"));var m="";return mq(c,function(e){var t=e.left-a,n=e.top-s;m+='<g transform="translate('+t+","+n+')">'+e.dom+"</g>"}),g.painter.getSvgRoot().innerHTML=m,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()},t.prototype.convertToPixel=function(e,t){return ei(this,"convertToPixel",e,t)},t.prototype.convertFromPixel=function(e,t){return ei(this,"convertFromPixel",e,t)},t.prototype.containPixel=function(e,t){var n;return this._disposed?void this.id:(mq(vZ(this._model,e),function(e,i){i.indexOf("Models")>=0&&mq(e,function(e){var r=e.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(t);else if("seriesModels"===i){var o=this._chartsMap[e.__viewId];o&&o.containPoint&&(n=n||o.containPoint(t,e))}},this)},this),!!n)},t.prototype.getVisual=function(e,t){var n=vZ(this._model,e,{defaultMainType:"series"}),i=n.seriesModel.getData(),r=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=r?DG(i,r,t):D$(i,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e,t,n,i=this;mq(OA,function(e){var t=function(t){var n,r=i.getModel(),o=t.target;if("globalout"===e?n={}:o&&DU(o,function(e){var t=So(e);if(t&&null!=t.dataIndex){var i=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return n=i&&i.getDataParams(t.dataIndex,t.dataType,o)||{},!0}if(t.eventData)return n=mH({},t.eventData),!0},!0),n){var a=n.componentType,s=n.componentIndex;("markLine"===a||"markPoint"===a||"markArea"===a)&&(a="series",s=n.seriesIndex);var l=a&&null!=s&&r.getComponent(a,s),u=l&&i["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];n.event=t,n.type=e,i._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:l,view:u},i.trigger(e,n)}};t.zrEventfulCallAtLast=!0,i._zr.on(e,t,i)}),mq(OT,function(e,t){i._messageCenter.on(t,function(e){this.trigger(t,e)},i)}),mq(["selectchanged"],function(e){i._messageCenter.on(e,function(t){this.trigger(e,t)},i)}),e=this._messageCenter,t=this,n=this._api,e.on("selectchanged",function(e){var i=n.getModel();e.isFromClick?(TP("map","selectchanged",t,i,e),TP("pie","selectchanged",t,i,e)):"select"===e.fromAction?(TP("map","selected",t,i,e),TP("pie","selected",t,i,e)):"unselect"===e.fromAction&&(TP("map","unselected",t,i,e),TP("pie","unselected",t,i,e))})},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)return void this.id;this._disposed=!0,this.getDom()&&v0(this.getDom(),OF,"");var e=this._api,t=this._model;mq(this._componentsViews,function(n){n.dispose(t,e)}),mq(this._chartsViews,function(n){n.dispose(t,e)}),this._zr.dispose(),this._dom=this._model=this._chartsMap=this._componentsMap=this._chartsViews=this._componentsViews=this._scheduler=this._api=this._zr=this._throttledZrFlush=this._theme=this._coordSysMgr=this._messageCenter=null,delete OE[this.id]},t.prototype.resize=function(e){if(!this[Op]){if(this._disposed)return void this.id;this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption("media"),i=e&&e.silent;this[Og]&&(null==i&&(i=this[Og].silent),n=!0,this[Og]=null),this[Op]=!0;try{n&&J(this),en.update.call(this,{type:"resize",animation:mH({duration:0},e&&e.animation)})}catch(e){throw this[Op]=!1,e}this[Op]=!1,ea.call(this,i),es.call(this,i)}}},t.prototype.showLoading=function(e,t){if(this._disposed)return void this.id;if(m4(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),OR[e]){var n=OR[e](this._api,t),i=this._zr;this._loadingFX=n,i.add(n)}},t.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=mH({},e);return t.type=OT[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)return void this.id;if((m4(t)||(t={silent:!!t}),Ok[e.type])&&this._model){if(this[Op])return void this._pendingActions.push(e);var n=t.silent;eo.call(this,e,n);var i=t.flush;i?this._zr.flush():!1!==i&&vE.browser.weChat&&this._throttledZrFlush(),ea.call(this,n),es.call(this,n)}},t.prototype.updateLabelLayout=function(){Od.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)return void this.id;var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){function e(e){e.clearColorPalette(),e.eachSeries(function(e){e.clearColorPalette()})}function t(e){for(var t=[],n=e.currentStates,i=0;i<n.length;i++){var r=n[i];"emphasis"!==r&&"blur"!==r&&"select"!==r&&t.push(r)}e.selected&&e.states.select&&t.push("select"),2===e.hoverState&&e.states.emphasis?t.push("emphasis"):1===e.hoverState&&e.states.blur&&t.push("blur"),e.useStates(t)}function n(e,t){if(!e.preventAutoZ){var n=e.get("z")||0,i=e.get("zlevel")||0;t.eachRendered(function(e){return function e(t,n,i,r){var o=t.getTextContent(),a=t.getTextGuideLine();if(t.isGroup)for(var s=t.childrenRef(),l=0;l<s.length;l++)r=Math.max(e(s[l],n,i,r),r);else t.z=n,t.zlevel=i,r=Math.max(t.z2,r);if(o&&(o.z=n,o.zlevel=i,isFinite(r)&&(o.z2=r+2)),a){var u=t.textGuideLineConfig;a.z=n,a.zlevel=i,isFinite(r)&&(a.z2=r+(u&&u.showAbove?1:-1))}return r}(e,n,i,-1/0),!0})}}function i(e,t){t.eachRendered(function(e){if(!S0(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&(e.stateTransition=null),t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&(e.prevStates=null)}})}function r(e,n){var i=e.getModel("stateAnimation"),r=e.isAnimationEnabled(),o=i.get("duration"),a=o>0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered(function(e){if(e.states&&e.states.emphasis&&!S0(e)){if(e instanceof wV&&((n=Su(e)).normalFill=e.style.fill,n.normalStroke=e.style.stroke,n.selectFill=(i=e.states.select||{}).style&&i.style.fill||null,n.selectStroke=i.style&&i.style.stroke||null),e.__dirty){var n,i,o=e.prevStates;o&&e.useStates(o)}if(r){e.stateTransition=a;var s=e.getTextContent(),l=e.getTextGuideLine();s&&(s.stateTransition=a),l&&(l.stateTransition=a)}e.__dirty&&t(e)}})}J=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),ee(e,!0),ee(e,!1),t.plan()},ee=function(e,t){for(var n=e._model,i=e._scheduler,r=t?e._componentsViews:e._chartsViews,o=t?e._componentsMap:e._chartsMap,a=e._zr,s=e._api,l=0;l<r.length;l++)r[l].__alive=!1;function u(e){var l=e.__requireNewView;e.__requireNewView=!1;var u="_ec_"+e.id+"_"+e.type,c=!l&&o[u];if(!c){var h=yH(e.type);(c=new(t?Dp.getClass(h.main,h.sub):kS.getClass(h.sub))).init(n,s),o[u]=c,r.push(c),a.add(c.group)}e.__viewId=c.__id=u,c.__alive=!0,c.__model=e,c.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},t||i.prepareView(c,e,n,s)}t?n.eachComponent(function(e,t){"series"!==e&&u(t)}):n.eachSeries(u);for(var l=0;l<r.length;){var c=r[l];c.__alive?l++:(t||c.renderTask.dispose(),a.remove(c.group),c.dispose(n,s),r.splice(l,1),o[c.__id]===c&&delete o[c.__id],c.__id=c.group.__ecComponentInfo=null)}},et=function(e,t,n,i,r){var o,a=e._model;if(a.setUpdatePayload(n),!i)return void mq([].concat(e._componentsViews).concat(e._chartsViews),c);var s={};s[i+"Id"]=n[i+"Id"],s[i+"Index"]=n[i+"Index"],s[i+"Name"]=n[i+"Name"];var l={mainType:i,query:s};r&&(l.subType=r);var u=n.excludeSeriesId;function c(i){i&&i.__alive&&i[t]&&i[t](i.__model,a,e._api,n)}null!=u&&(o=vh(),mq(vB(u),function(e){var t=vW(e,null);null!=t&&o.set(t,!0)})),a&&a.eachComponent(l,function(t){if(!(o&&null!=o.get(t.id))){if(SY(n))if(t instanceof Mu)n.type!==Sf||n.notBlur||t.get(["emphasis","disabled"])||function(e,t,n){var i=e.seriesIndex,r=e.getData(t.dataType);if(r){var o=vU(r,t);o=(m0(o)?o[0]:o)||0;var a=r.getItemGraphicEl(o);if(!a)for(var s=r.count(),l=0;!a&&l<s;)a=r.getItemGraphicEl(l++);if(a){var u=So(a);SN(i,u.focus,u.blurScope,n)}else{var c=e.get(["emphasis","focus"]),h=e.get(["emphasis","blurScope"]);null!=c&&SN(i,c,h,n)}}}(t,n,e._api);else{var i=SF(t.mainType,t.componentIndex,n.name,e._api),r=i.focusSelf,a=i.dispatchers;n.type===Sf&&r&&!n.notBlur&&SB(t.mainType,t.componentIndex,e._api),a&&mq(a,function(e){n.type===Sf?SP(e):SR(e)})}else if(Sq(n)&&t instanceof Mu){if(e._api,Sq(n)){var s=n.dataType,l=vU(t.getData(s),n);m0(l)||(l=[l]),t[n.type===Sv?"toggleSelect":n.type===Sg?"select":"unselect"](l,s)}Sz(t),eg(e)}}},e),a&&a.eachComponent(l,function(t){o&&null!=o.get(t.id)||c(e["series"===i?"_chartsMap":"_componentsMap"][t.__viewId])},e)},en={prepareAndUpdate:function(e){J(this),en.update.call(this,e,{optionChanged:null!=e.newOption})},update:function(t,n){var i=this._model,r=this._api,o=this._zr,a=this._coordSysMgr,s=this._scheduler;if(i){i.setUpdatePayload(t),s.restoreData(i,t),s.performSeriesTasks(i),a.create(i,r),s.performDataProcessorTasks(i,t),er(this,i),a.update(i,r),e(i),s.performVisualTasks(i,t),ec(this,i,r,t,n);var l=i.get("backgroundColor")||"transparent",u=i.get("darkMode");o.setBackgroundColor(l),null!=u&&"auto"!==u&&o.setDarkMode(u),Od.trigger("afterupdate",i,r)}},updateTransform:function(t){var n=this,i=this._model,r=this._api;if(i){i.setUpdatePayload(t);var o=[];i.eachComponent(function(e,a){if("series"!==e){var s=n.getViewOfComponentModel(a);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(a,i,r,t);l&&l.update&&o.push(s)}else o.push(s)}});var a=vh();i.eachSeries(function(e){var o=n._chartsMap[e.__viewId];if(o.updateTransform){var s=o.updateTransform(e,i,r,t);s&&s.update&&a.set(e.uid,1)}else a.set(e.uid,1)}),e(i),this._scheduler.performVisualTasks(i,t,{setDirty:!0,dirtyMap:a}),ed(this,i,r,t,{},a),Od.trigger("afterupdate",i,r)}},updateView:function(t){var n=this._model;n&&(n.setUpdatePayload(t),kS.markUpdateMethod(t,"updateView"),e(n),this._scheduler.performVisualTasks(n,t,{setDirty:!0}),ec(this,n,this._api,t,{}),Od.trigger("afterupdate",n,this._api))},updateVisual:function(t){var n=this,i=this._model;i&&(i.setUpdatePayload(t),i.eachSeries(function(e){e.getData().clearAllVisual()}),kS.markUpdateMethod(t,"updateVisual"),e(i),this._scheduler.performVisualTasks(i,t,{visualType:"visual",setDirty:!0}),i.eachComponent(function(e,r){if("series"!==e){var o=n.getViewOfComponentModel(r);o&&o.__alive&&o.updateVisual(r,i,n._api,t)}}),i.eachSeries(function(e){n._chartsMap[e.__viewId].updateVisual(e,i,n._api,t)}),Od.trigger("afterupdate",i,this._api))},updateLayout:function(e){en.update.call(this,e)}},ei=function(e,t,n,i){if(e._disposed)return void e.id;for(var r,o=e._model,a=e._coordSysMgr.getCoordinateSystems(),s=vZ(o,n),l=0;l<a.length;l++){var u=a[l];if(u[t]&&null!=(r=u[t](o,s,i)))return r}},er=function(e,t){var n=e._chartsMap,i=e._scheduler;t.eachSeries(function(e){i.updateStreamModes(e,n[e.__viewId])})},eo=function(e,t){var n,i=this,r=this.getModel(),o=e.type,a=e.escapeConnect,s=Ok[o],l=s.actionInfo,u=(l.update||"update").split(":"),c=u.pop(),h=null!=u[0]&&yH(u[0]);this[Op]=!0;var d=[e],f=!1;e.batch&&(f=!0,d=mY(e.batch,function(t){return(t=mW(mH({},t),e)).batch=null,t}));var p=[],g=Sq(e),m=SY(e);if(m&&SL(this._api),mq(d,function(t){if((n=(n=s.action(t,i._model,i._api))||mH({},t)).type=l.event||n.type,p.push(n),m){var r=vX(e),o=r.queryOptionMap;et(i,c,t,r.mainTypeSpecified?o.keys()[0]:"series"),eg(i)}else g?(et(i,c,t,"series"),eg(i)):h&&et(i,c,t,h.main,h.sub)}),"none"!==c&&!m&&!g&&!h)try{this[Og]?(J(this),en.update.call(this,e),this[Og]=null):en[c].call(this,e)}catch(e){throw this[Op]=!1,e}if(n=f?{type:l.event||o,escapeConnect:a,batch:p}:p[0],this[Op]=!1,!t){var v=this._messageCenter;if(v.trigger(n.type,n),g){var y,x={type:"selectchanged",escapeConnect:a,selected:(y=[],r.eachSeries(function(e){mq(e.getAllData(),function(t){t.data;var n=t.type,i=e.getSelectedDataIndices();if(i.length>0){var r={dataIndex:i,seriesIndex:e.seriesIndex};null!=n&&(r.dataType=n),y.push(r)}})}),y),isFromClick:e.isFromClick||!1,fromAction:e.type,fromActionPayload:e};v.trigger(x.type,x)}}},ea=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();eo.call(this,n,e)}},es=function(e){e||this.trigger("updated")},el=function(e,t){e.on("rendered",function(n){t.trigger("rendered",n),!e.animation.isFinished()||t[Og]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")})},eu=function(e,t){e.on("mouseover",function(e){var n,i,r,o,a,s=DU(e.target,SU);s&&(n=t._api,o=(r=SF((i=So(s)).componentMainType,i.componentIndex,i.componentHighDownName,n)).dispatchers,a=r.focusSelf,o?(a&&SB(i.componentMainType,i.componentIndex,n),mq(o,function(t){return SD(t,e)})):(SN(i.seriesIndex,i.focus,i.blurScope,n),"self"===i.focus&&SB(i.componentMainType,i.componentIndex,n),SD(s,e)),eg(t))}).on("mouseout",function(e){var n,i,r,o=DU(e.target,SU);o&&(SL(n=t._api),(r=SF((i=So(o)).componentMainType,i.componentIndex,i.componentHighDownName,n).dispatchers)?mq(r,function(t){return SO(t,e)}):SO(o,e),eg(t))}).on("click",function(e){var n=DU(e.target,function(e){return null!=So(e).dataIndex},!0);if(n){var i=n.selected?"unselect":"select",r=So(n);t._api.dispatchAction({type:i,dataType:r.dataType,dataIndexInside:r.dataIndex,seriesIndex:r.seriesIndex,isFromClick:!0})}})},ec=function(e,t,n,i,r){!function(e){var t=[],n=[],i=!1;if(e.eachComponent(function(e,r){var o=r.get("zlevel")||0,a=r.get("z")||0,s=r.getZLevelKey();i=i||!!s,("series"===e?n:t).push({zlevel:o,z:a,idx:r.componentIndex,type:e,key:s})}),i){var r,o,a=t.concat(n);Iw(a,function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel}),mq(a,function(t){var n=e.getComponent(t.type,t.idx),i=t.zlevel,a=t.key;null!=r&&(i=Math.max(r,i)),a?(i===r&&a!==o&&i++,o=a):o&&(i===r&&i++,o=""),r=i,n.setZLevel(i)})}}(t),eh(e,t,n,i,r),mq(e._chartsViews,function(e){e.__alive=!1}),ed(e,t,n,i,r),mq(e._chartsViews,function(e){e.__alive||e.remove(t,n)})},eh=function(e,t,o,a,s,l){mq(l||e._componentsViews,function(e){var s=e.__model;i(s,e),e.render(s,t,o,a),n(s,e),r(s,e)})},ed=function(e,t,o,a,s,l){var u,c,h,d,f=e._scheduler;s=mH(s||{},{updatedSeries:t.getSeries()}),Od.trigger("series:beforeupdate",t,o,s);var p=!1;t.eachSeries(function(t){var n,r,o,s=e._chartsMap[t.__viewId];s.__alive=!0;var u=s.renderTask;f.updatePayload(u,a),i(t,s),l&&l.get(t.uid)&&u.dirty(),u.perform(f.getPerformArgs(u))&&(p=!0),s.group.silent=!!t.get("silent"),n=t,r=s,o=n.get("blendMode")||null,r.eachRendered(function(e){e.isGroup||(e.style.blend=o)}),Sz(t)}),f.unfinished=p||f.unfinished,Od.trigger("series:layoutlabels",t,o,s),Od.trigger("series:transition",t,o,s),t.eachSeries(function(t){var i=e._chartsMap[t.__viewId];n(t,i),r(t,i)}),u=e,c=t,h=u._zr.storage,d=0,h.traverse(function(e){!e.isGroup&&d++}),!(d>c.get("hoverLayerThreshold"))||vE.node||vE.worker||c.eachSeries(function(e){if(!e.preventUsingHoverLayer){var t=u._chartsMap[e.__viewId];t.__alive&&t.eachRendered(function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)})}}),Od.trigger("series:afterupdate",t,o,s)},eg=function(e){e[Om]=!0,e.getZr().wakeUp()},em=function(e){e[Om]&&(e.getZr().storage.traverse(function(e){S0(e)||t(e)}),e[Om]=!1)},ef=function(e){return new(function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return yz(n,t),n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(null!=n)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){SP(t,n),eg(e)},n.prototype.leaveEmphasis=function(t,n){SR(t,n),eg(e)},n.prototype.enterBlur=function(t){SA(t,SS),eg(e)},n.prototype.leaveBlur=function(t){SA(t,S_),eg(e)},n.prototype.enterSelect=function(t){SA(t,SC),eg(e)},n.prototype.leaveSelect=function(t){SA(t,SM),eg(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(I5))(e)},ep=function(e){function t(e,t){for(var n=0;n<e.length;n++)e[n][Oy]=t}mq(OT,function(n,i){e._messageCenter.on(i,function(n){if(OL[e.group]&&0!==e[Oy]&&(!n||!n.escapeConnect)){var i=e.makeActionFromEvent(n),r=[];mq(OE,function(t){t!==e&&t.group===e.group&&r.push(t)}),t(r,0),mq(r,function(e){1!==e[Oy]&&e.dispatchAction(i)}),t(r,2)}})})}}(),t}(bz),OM=OC.prototype;OM.on=Ox("on"),OM.off=Ox("off"),OM.one=function(e,t,n){var i=this;this.on.call(this,e,function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];t&&t.apply&&t.apply(this,r),i.off(e,n)},n)};var OA=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"],Ok={},OT={},OI=[],OD=[],OO=[],OP={},OR={},OE={},OL={},ON=new Date-0,OB=new Date-0,OF="_echarts_instance_";function Oz(e){0>mG(OD,e)&&OD.push(e)}function OV(e,t){O$(OI,e,t,2e3)}function Oj(e,t){Od.on(e,t)}function OH(e,t,n){m1(t)&&(n=t,t="");var i=m4(e)?e.type:[e,e={event:t}][0];e.event=(e.event||i).toLowerCase(),OT[t=e.event]||(vo(Ov.test(i)&&Ov.test(t)),Ok[i]||(Ok[i]={action:n,actionInfo:e}),OT[t]=i)}function OW(e,t){O$(OO,e,t,3e3,"visual")}var OG=[];function O$(e,t,n,i,r){if((m1(t)||m4(t))&&(n=t,t=i),!(mG(OG,n)>=0)){OG.push(n);var o=DS.wrapStageHandler(n,r);o.__prio=t,o.__raw=n,e.push(o)}}OW(2e3,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=e.getModel(i),o=Dy(e,i)(r),a=r.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=Dx(e,i),l=o[s],u=m1(l)?l:null,c="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||c){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[s]||(o[s]=h,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||m1(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||m1(o.stroke)?h:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(t,n){var i=e.getDataParams(n),r=mH({},o);r[s]=u(i),t.setItemVisual(n,"style",r)}}}}),OW(4500,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var n=e.getData(),i=e.visualStyleAccessPath||"itemStyle",r=Dy(e,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[i]){Db.option=n[i];var a=r(Db);mH(e.ensureUniqueItemVisual(t,"style"),a),Db.option.decal&&(e.setItemVisual(t,"decal",Db.option.decal),Db.option.decal.dirty=!0),o in a&&e.setItemVisual(t,"colorFromPalette",!1)}}:null}}}}),OW(4500,{performRawSeries:!0,overallReset:function(e){var t=vh();e.eachSeries(function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var i=e.type+"-"+n,r=t.get(i);r||(r={},t.set(i,r)),Dg(e).scope=r}}),e.eachSeries(function(t){if(!(t.isColorBySeries()||e.isSeriesFiltered(t))){var n=t.getRawData(),i={},r=t.getData(),o=Dg(t).scope,a=t.visualStyleAccessPath||"itemStyle",s=Dx(t,a);r.each(function(e){i[r.getRawIndex(e)]=e}),n.each(function(e){var a=i[e];if(r.getItemVisual(a,"colorFromPalette")){var l=r.ensureUniqueItemVisual(a,"style"),u=n.getName(e)||e+"",c=n.count();l[s]=t.getColorFromPalette(u,o,c)}})}})}}),OW(2e3,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),e.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a<DH.length;a++){var s=DH[a],l=e.get(s);m1(l)?(o=!0,r[s]=l):i[s]=l}if(i.symbol=i.symbol||e.defaultSymbol,n.setVisual(mH({legendIcon:e.legendIcon||i.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},i)),!t.isSeriesFiltered(e)){var u=mK(r);return{dataEach:o?function(t,n){for(var i=e.getRawValue(n),o=e.getDataParams(n),a=0;a<u.length;a++){var s=u[a];t.setItemVisual(n,s,r[s](i,o))}}:null}}}}}),OW(4500,{createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(e.hasSymbolVisual&&!t.isSeriesFiltered(e))return{dataEach:e.getData().hasItemOption?function(e,t){for(var n=e.getItemModel(t),i=0;i<DW.length;i++){var r=DW[i],o=n.getShallow(r,!0);null!=o&&e.setItemVisual(t,r,o)}}:null}}}),OW(7e3,function(e,t){e.eachRawSeries(function(n){if(!e.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each(function(e){var n=i.getItemVisual(e,"decal");n&&(i.ensureUniqueItemVisual(e,"style").decal=Oc(n,t))});var r=i.getVisual("decal");r&&(i.getVisual("style").decal=Oc(r,t))}})}),Oz(Dd),OV(900,function(e){var t=vh();e.eachSeries(function(e){var n=e.get("stack");if(n){var i=t.get(n)||t.set(n,[]),r=e.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:e};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(o)}}),t.each(Df)}),OR.default=function(e,t){mW(t=t||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n,i=new MF,r=new w0({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(r);var o=new Sr({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new w0({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});return i.add(a),t.showSpinner&&((n=new AR({shape:{startAngle:-Dw/2,endAngle:-Dw/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*Dw/2}).start("circularInOut"),n.animateShape(!0).when(1e3,{startAngle:3*Dw/2}).delay(300).start("circularInOut"),i.add(n)),i.resize=function(){var i=o.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&i?10:0)-i)/2-(t.showSpinner&&i?0:5+i/2)+(t.showSpinner?0:i/2)+(i?0:s),u=e.getHeight()/2;t.showSpinner&&n.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},i.resize(),i},OH({type:Sf,event:Sf,update:Sf},vg),OH({type:Sp,event:Sp,update:Sp},vg),OH({type:Sg,event:Sg,update:Sg},vg),OH({type:Sm,event:Sm,update:Sm},vg),OH({type:Sv,event:Sv,update:Sv},vg),OP.light={color:DL,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],DL]},OP.dark=DV;var OU=[],Oq={registerPreprocessor:Oz,registerProcessor:OV,registerPostInit:function(e){Oj("afterinit",e)},registerPostUpdate:function(e){Oj("afterupdate",e)},registerUpdateLifecycle:Oj,registerAction:OH,registerCoordinateSystem:function(e,t){MD.register(e,t)},registerLayout:function(e,t){O$(OO,e,t,1e3,"layout")},registerVisual:OW,registerTransform:function(e){var t=(e=mV(e)).type;t||CR("");var n=t.split(":");2!==n.length&&CR("");var i=!1;"echarts"===n[0]&&(t=n[1],i=!0),e.__isBuiltIn=i,CH.set(t,e)},registerLoading:function(e,t){OR[e]=t},registerMap:function(e,t,n){var i=Of.registerMap;i&&i(e,t,n)},registerImpl:function(e,t){Of[e]=t},PRIORITY:{PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:4500,ARIA:6e3,DECAL:7e3}},ComponentModel:Cf,ComponentView:Dp,SeriesModel:Mu,ChartView:kS,registerComponentModel:function(e){Cf.registerClass(e)},registerComponentView:function(e){Dp.registerClass(e)},registerSeriesModel:function(e){Mu.registerClass(e)},registerChartView:function(e){kS.registerClass(e)},registerSubTypeDefaulter:function(e,t){Cf.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){IW[e]=t}};function OY(e){m0(e)?mq(e,function(e){OY(e)}):mG(OU,e)>=0||(OU.push(e),m1(e)&&(e={install:e}),e.install(Oq))}var OZ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return yz(t,e),t.prototype.getInitialData=function(e,t){return ME(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},t.prototype.getProgressiveThreshold=function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(Mu),OX=function(){},OK=function(e){function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return yz(t,e),t.prototype.getDefaultShape=function(){return new OX},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n,i=t.points,r=t.size,o=this.symbolProxy,a=o.shape,s=e.getContext?e.getContext():e,l=s&&r[0]<4,u=this.softClipShape;if(l){this._ctx=s;return}for(this._ctx=null,n=this._off;n<i.length;){var c=i[n++],h=i[n++];!(isNaN(c)||isNaN(h))&&(!u||u.contain(c,h))&&(a.x=c-r[0]/2,a.y=h-r[1]/2,a.width=r[0],a.height=r[1],o.buildPath(e,a,!0))}this.incremental&&(this._off=n,this.notClear=!0)},t.prototype.afterBrush=function(){var e,t=this.shape,n=t.points,i=t.size,r=this._ctx,o=this.softClipShape;if(r){for(e=this._off;e<n.length;){var a=n[e++],s=n[e++];!(isNaN(a)||isNaN(s))&&(!o||o.contain(a,s))&&r.fillRect(a-i[0]/2,s-i[1]/2,i[0],i[1])}this.incremental&&(this._off=e,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,i=n.points,r=n.size,o=Math.max(r[0],4),a=Math.max(r[1],4),s=i.length/2-1;s>=0;s--){var l=2*s,u=i[l]-o/2,c=i[l+1]-a/2;if(e>=u&&t>=c&&e<=u+o&&t<=c+a)return s}return -1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),i=this.getBoundingRect();return(e=n[0],t=n[1],i.contain(e,t))?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,i=t.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,u=-1/0,c=0;c<n.length;){var h=n[c++],d=n[c++];a=Math.min(h,a),l=Math.max(h,l),s=Math.min(d,s),u=Math.max(d,u)}e=this._rect=new xd(a-r/2,s-o/2,l-a+r,u-s+o)}return e},t}(wV),OQ=function(){function e(){this.group=new MF}return e.prototype.updateData=function(e,t){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=e.getLayout("points");this.group.eachChild(function(e){if(null!=e.startIndex){var n=(e.endIndex-e.startIndex)*2,i=4*e.startIndex*2;t=new Float32Array(t.buffer,i,n)}e.setShape("points",t),e.reset()})},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n){var i=this._newAdded[0],r=t.getLayout("points"),o=i&&i.shape.points;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+r.length);s.set(o),s.set(r,a),i.endIndex=e.end,i.setShape({points:s})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=!0,l.setShape({points:r}),this._setCommon(l,t,n)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new OK({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var i=t.hostModel;n=n||{};var r=t.getVisual("symbolSize");e.setShape("size",r instanceof Array?r:[r,r]),e.softClipShape=n.clipShape||null,e.symbolProxy=k6(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=t.getVisual("style"),s=a&&a.fill;s&&e.setColor(s);var l=So(e);l.seriesIndex=i.seriesIndex,e.on("mousemove",function(t){l.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(l.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),OJ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).updateData(i,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var i=e.getData();this._updateSymbolDraw(i,e).incrementalPrepareUpdate(i),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var i=e.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=TM("").reset(e,t,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get("clip",!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,i=t.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new OQ:new To,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(kS),O0=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.type="grid",t.dependencies=["xAxis","yAxis"],t.layoutMode="box",t.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},t}(Cf),O1=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),O2=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",vK).models[0]},t.type="cartesian2dAxis",t}(Cf);m$(O2,O1);var O5={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},O3=mj({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},O5),O4=mj({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},O5),O6=mj({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},O4),O8=mW({logBase:10},O4);let O9={category:O3,value:O4,time:O6,log:O8};var O7=0,Pe=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++O7}return e.createByAxisModel=function(t){var n=t.option,i=n.data,r=i&&mY(i,Pt);return new e({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!m2(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return null==(t=i.get(e))&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||(this._map=vh(this.categories))},e}();function Pt(e){return m4(e)&&null!=e.value?e.value:e+""}var Pn={value:1,category:1,time:1,log:1};function Pi(e,t,n,i){mq(Pn,function(r,o){var a=mj(mj({},O9[o],!0),i,!0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t+"Axis."+o,n}return yz(n,e),n.prototype.mergeDefaultAndTheme=function(e,t){var n=Cu(this),i=n?Ch(e):{};mj(e,t.getTheme().get(o+"Axis")),mj(e,this.getDefaultOption()),e.type=Pr(e),n&&Cc(e,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=Pe.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=t+"Axis."+o,n.defaultOption=a,n}(n);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",Pr)}function Pr(e){return e.type||(e.data?"category":"value")}var Po=function(){function e(e){this._setting=e||{},this._extent=[1/0,-1/0]}return e.prototype.getSetting=function(e){return this._setting[e]},e.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();function Pa(e){return"interval"===e.type||"log"===e.type}function Ps(e){var t=Math.pow(10,vk(e)),n=e/t;return n?2===n?n=3:3===n?n=5:n*=2:n=1,vx(n*t)}yY(Po);function Pl(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function Pu(e,t){return e>=t[0]&&e<=t[1]}function Pc(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function Ph(e,t){return e*(t[1]-t[0])+t[0]}var Pd=function(e){function t(t){var n=e.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new Pe({})),m0(i)&&(i=new Pe({categories:mY(i,function(e){return m4(e)?e.value:e})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return yz(t,e),t.prototype.parse=function(e){return null==e?NaN:m2(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return Pu(e=this.parse(e),this._extent)&&null!=this._ordinalMeta.categories[e]},t.prototype.normalize=function(e){return Pc(e=this._getTickNumber(this.parse(e)),this._extent)},t.prototype.scale=function(e){return e=Math.round(Ph(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(null==e){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,t.length);r<a;++r){var s=t[r];n[r]=s,i[s]=r}for(var l=0;r<o;++r){for(;null!=i[l];)l++;n.push(l),i[l]=r}},t.prototype._getTickNumber=function(e){var t=this._ticksByOrdinalNumber;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getRawOrdinalNumber=function(e){var t=this._ordinalNumbersByTick;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[t];return null==n?"":n+""}},t.prototype.count=function(){return this._extent[1]-this._extent[0]+1},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.isInExtentRange=function(e){return e=this._getTickNumber(e),this._extent[0]<=e&&this._extent[1]>=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type="ordinal",t}(Po);Po.registerClass(Pd);var Pf=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return yz(t,e),t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return Pu(e,this._extent)},t.prototype.normalize=function(e){return Pc(e,this._extent)},t.prototype.scale=function(e){return Ph(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=vw(e)+2},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!t)return o;n[0]<i[0]&&(e?o.push({value:vx(i[0]-t,r)}):o.push({value:n[0]}));for(var a=i[0];a<=i[1]&&(o.push({value:a}),(a=vx(a+t,r))!==o[o.length-1].value);)if(o.length>1e4)return[];var s=o.length?o[o.length-1].value:i[1];return n[1]>s&&(e?o.push({value:vx(s+t,r)}):o.push({value:n[1]})),o},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],i=this.getExtent(),r=1;r<t.length;r++){for(var o=t[r],a=t[r-1],s=0,l=[],u=(o.value-a.value)/e;s<e-1;){var c=vx(a.value+(s+1)*u);c>i[0]&&c<i[1]&&l.push(c),s++}n.push(l)}return n},t.prototype.getLabel=function(e,t){if(null==e)return"";var n=t&&t.precision;return null==n?n=vw(e.value)||0:"auto"===n&&(n=this._intervalPrecision),_6(vx(e.value,n,!0))},t.prototype.calcNiceTicks=function(e,t,n){e=e||5;var i=this._extent,r=i[1]-i[0];if(isFinite(r)){r<0&&(r=-r,i.reverse());var o,a,s,l,u,c,h=(s=e,u=(l={}).interval=vT((i[1]-i[0])/s,!0),null!=t&&u<t&&(u=l.interval=t),null!=n&&u>n&&(u=l.interval=n),c=l.intervalPrecision=vw(u)+2,o=l.niceTickExtent=[vx(Math.ceil(i[0]/u)*u,c),vx(Math.floor(i[1]/u)*u,c)],a=i,isFinite(o[0])||(o[0]=a[0]),isFinite(o[1])||(o[1]=a[1]),Pl(o,0,a),Pl(o,1,a),o[0]>o[1]&&(o[0]=o[1]),l);this._intervalPrecision=h.intervalPrecision,this._interval=h.interval,this._niceExtent=h.niceTickExtent}},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var n=Math.abs(t[0]);e.fixMax||(t[1]+=n/2),t[0]-=n/2}else t[1]=1;isFinite(t[1]-t[0])||(t[0]=0,t[1]=1),this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval);var i=this._interval;e.fixMin||(t[0]=vx(Math.floor(t[0]/i)*i)),e.fixMax||(t[1]=vx(Math.ceil(t[1]/i)*i))},t.prototype.setNiceExtent=function(e,t){this._niceExtent=[e,t]},t.type="interval",t}(Po);Po.registerClass(Pf);var Pp=function(e,t,n,i){for(;n<i;){var r=n+i>>>1;e[r][1]<t?n=r+1:i=r}return n},Pg=function(e){function t(t){var n=e.call(this,t)||this;return n.type="time",n}return yz(t,e),t.prototype.getLabel=function(e){var t=this.getSetting("useUTC");return _G(e.value,_z[function(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(_W(this._minLevelUnit))]||_z.second,t,this.getSetting("locale"))},t.prototype.getFormattedLabel=function(e,t,n){var i=this.getSetting("useUTC");return function(e,t,n,i,r){var o=null;if(m2(n))o=n;else if(m1(n))o=n(e.value,t,{level:e.level});else{var a=mH({},_B);if(e.level>0)for(var s=0;s<_V.length;++s)a[_V[s]]="{primary|"+a[_V[s]]+"}";var l=n?!1===n.inherit?n:mW(n,a):a,u=_$(e.value,r);if(l[u])o=l[u];else if(l.inherit){for(var c=_j.indexOf(u),s=c-1;s>=0;--s)if(l[u]){o=l[u];break}o=o||a.none}if(m0(o)){var h=null==e.level?0:e.level>=0?e.level:o.length+e.level;h=Math.min(h,o.length-1),o=o[h]}}return _G(new Date(e.value),o,r,i)}(e,t,n,this.getSetting("locale"),i)},t.prototype.getTicks=function(){var e=this._interval,t=this._extent,n=[];if(!e)return n;n.push({value:t[0],level:0});var i=this.getSetting("useUTC"),r=function(e,t,n,i){for(var r=0,o=[],a=[],s=0,l=0,u=0;u<_j.length&&r++<1e4;++u){var c,h=_W(_j[u]);if((c=_j[u])===_W(c)&&(!function(e,r,o){var a=[],s=!r.length;if(!function(e,t,n,i){var r=vA(t),o=vA(n),a=function(e){return _U(r,e,i)===_U(o,e,i)},s=function(){return a("year")},l=function(){return s()&&a("month")},u=function(){return l()&&a("day")},c=function(){return u()&&a("hour")},h=function(){return c()&&a("minute")},d=function(){return h()&&a("second")};switch(e){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return h();case"second":return d();case"millisecond":return d()&&a("millisecond")}}(_W(e),i[0],i[1],n)){s&&(r=[{value:function(e,t,n){var i=new Date(e);switch(_W(t)){case"year":case"month":i[_0(n)](0);case"day":i[_1(n)](1);case"hour":i[_2(n)](0);case"minute":i[_5(n)](0);case"second":i[_3(n)](0),i[_4(n)](0)}return i.getTime()}(new Date(i[0]),e,n)},{value:i[1]}]);for(var l=0;l<r.length-1;l++){var u=r[l].value,c=r[l+1].value;if(u!==c){var h,d,f,p=void 0,g=void 0,m=void 0;switch(e){case"year":p=Math.max(1,Math.round(t/864e5/365)),g=_q(n),m=n?"setUTCFullYear":"setFullYear";break;case"half-year":case"quarter":case"month":p=(h=t/2592e6)>6?6:h>3?3:h>2?2:1,g=_Y(n),m=_0(n);break;case"week":case"half-week":case"day":p=(d=t/864e5)>16?16:d>7.5?7:d>3.5?4:d>1.5?2:1,g=_Z(n),m=_1(n);break;case"half-day":case"quarter-day":case"hour":p=(f=t/36e5)>12?12:f>6?6:f>3.5?4:f>2?2:1,g=_X(n),m=_2(n);break;case"minute":p=Pv(t,!0),g=_K(n),m=_5(n);break;case"second":p=Pv(t,!1),g=_Q(n),m=_3(n);break;case"millisecond":p=vT(t,!0),g=_J(n),m=_4(n)}!function(e,t,n,r,o,a){for(var s=new Date(t),l=t,u=s[r]();l<n&&l<=i[1];)a.push({value:l}),u+=e,s[o](u),l=s.getTime();a.push({value:l,notAdd:!0})}(p,u,c,g,m,a),"year"===e&&o.length>1&&0===l&&o.unshift({value:o[0].value-p})}}for(var l=0;l<a.length;l++)o.push(a[l])}}(_j[u],o[o.length-1]||[],a),h!==(_j[u+1]?_W(_j[u+1]):null))){if(a.length){l=s,a.sort(function(e,t){return e.value-t.value});for(var d=[],f=0;f<a.length;++f){var p=a[f].value;(0===f||a[f-1].value!==p)&&(d.push(a[f]),p>=i[0]&&p<=i[1]&&s++)}var g=(i[1]-i[0])/t;if(s>1.5*g&&l>g/1.5||(o.push(d),s>g||e===_j[u]))break}a=[]}}for(var m=mX(mY(o,function(e){return mX(e,function(e){return e.value>=i[0]&&e.value<=i[1]&&!e.notAdd})}),function(e){return e.length>0}),v=[],y=m.length-1,u=0;u<m.length;++u)for(var x=m[u],b=0;b<x.length;++b)v.push({value:x[b].value,level:y-u});v.sort(function(e,t){return e.value-t.value});for(var w=[],u=0;u<v.length;++u)(0===u||v[u].value!==v[u-1].value)&&w.push(v[u]);return w}(this._minLevelUnit,this._approxInterval,i,t);return(n=n.concat(r)).push({value:t[1],level:0}),n},t.prototype.calcNiceExtent=function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=864e5,t[1]+=864e5),t[1]===-1/0&&t[0]===1/0){var n=new Date;t[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),t[0]=t[1]-864e5}this.calcNiceTicks(e.splitNumber,e.minInterval,e.maxInterval)},t.prototype.calcNiceTicks=function(e,t,n){e=e||10;var i=this._extent,r=i[1]-i[0];this._approxInterval=r/e,null!=t&&this._approxInterval<t&&(this._approxInterval=t),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var o=Pm.length,a=Math.min(Pp(Pm,this._approxInterval,0,o),o-1);this._interval=Pm[a][1],this._minLevelUnit=Pm[Math.max(a-1,0)][0]},t.prototype.parse=function(e){return m3(e)?e:+vA(e)},t.prototype.contain=function(e){return Pu(this.parse(e),this._extent)},t.prototype.normalize=function(e){return Pc(this.parse(e),this._extent)},t.prototype.scale=function(e){return Ph(e,this._extent)},t.type="time",t}(Pf),Pm=[["second",1e3],["minute",6e4],["hour",36e5],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",15768e6],["year",31536e6]];function Pv(e,t){return(e/=t?6e4:1e3)>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}Po.registerClass(Pg);var Py=Po.prototype,Px=Pf.prototype,Pb=Math.floor,Pw=Math.ceil,PS=Math.pow,P_=Math.log,PC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="log",t.base=10,t._originalScale=new Pf,t._interval=0,t}return yz(t,e),t.prototype.getTicks=function(e){var t=this._originalScale,n=this._extent,i=t.getExtent();return mY(Px.getTicks.call(this,e),function(e){var t=e.value,r=vx(PS(this.base,t));return r=t===n[0]&&this._fixMin?vx(r,vw(i[0])):r,{value:r=t===n[1]&&this._fixMax?vx(r,vw(i[1])):r}},this)},t.prototype.setExtent=function(e,t){var n=P_(this.base);e=P_(Math.max(0,e))/n,t=P_(Math.max(0,t))/n,Px.setExtent.call(this,e,t)},t.prototype.getExtent=function(){var e,t,n=this.base,i=Py.getExtent.call(this);i[0]=PS(n,i[0]),i[1]=PS(n,i[1]);var r=this._originalScale.getExtent();return this._fixMin&&(i[0]=(e=i[0],vx(e,vw(r[0])))),this._fixMax&&(i[1]=(t=i[1],vx(t,vw(r[1])))),i},t.prototype.unionExtent=function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=P_(e[0])/P_(t),e[1]=P_(e[1])/P_(t),Py.unionExtent.call(this,e)},t.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},t.prototype.calcNiceTicks=function(e){e=e||10;var t=this._extent,n=t[1]-t[0];if(n!==1/0&&!(n<=0)){var i=Math.pow(10,vk(n));for(e/n*i<=.5&&(i*=10);!isNaN(i)&&1>Math.abs(i)&&Math.abs(i)>0;)i*=10;var r=[vx(Pw(t[0]/i)*i),vx(Pb(t[1]/i)*i)];this._interval=i,this._niceExtent=r}},t.prototype.calcNiceExtent=function(e){Px.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return Pu(e=P_(e)/P_(this.base),this._extent)},t.prototype.normalize=function(e){return Pc(e=P_(e)/P_(this.base),this._extent)},t.prototype.scale=function(e){return e=Ph(e,this._extent),PS(this.base,e)},t.type="log",t}(Po),PM=PC.prototype;PM.getMinorTicks=Px.getMinorTicks,PM.getLabel=Px.getLabel,Po.registerClass(PC);var PA=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var i=this._isOrdinal="ordinal"===e.type;this._needCrossZero="interval"===e.type&&t.getNeedCrossZero&&t.getNeedCrossZero();var r=this._modelMinRaw=t.get("min",!0);m1(r)?this._modelMinNum=PD(e,r({min:n[0],max:n[1]})):"dataMin"!==r&&(this._modelMinNum=PD(e,r));var o=this._modelMaxRaw=t.get("max",!0);if(m1(o)?this._modelMaxNum=PD(e,o({min:n[0],max:n[1]})):"dataMax"!==o&&(this._modelMaxNum=PD(e,o)),i)this._axisDataLen=t.getCategories().length;else{var a=t.get("boundaryGap"),s=m0(a)?a:[a||0,a||0];"boolean"==typeof s[0]||"boolean"==typeof s[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[xb(s[0],1),xb(s[1],1)]}},e.prototype.calculate=function(){var e,t,n=this._isOrdinal,i=this._dataMin,r=this._dataMax,o=this._axisDataLen,a=this._boundaryGapInner,s=n?null:r-i||Math.abs(i),l="dataMin"===this._modelMinRaw?i:this._modelMinNum,u="dataMax"===this._modelMaxRaw?r:this._modelMaxNum,c=null!=l,h=null!=u;null==l&&(l=n?o?0:NaN:i-a[0]*s),null==u&&(u=n?o?o-1:NaN:r+a[1]*s),null!=l&&isFinite(l)||(l=NaN),null!=u&&isFinite(u)||(u=NaN);var d=(e=l)!=e||(t=u)!=t||n&&!o;this._needCrossZero&&(l>0&&u>0&&!c&&(l=0),l<0&&u<0&&!h&&(u=0));var f=this._determinedMin,p=this._determinedMax;return null!=f&&(l=f,c=!0),null!=p&&(u=p,h=!0),{min:l,max:u,minFixed:c,maxFixed:h,isBlank:d}},e.prototype.modifyDataMinMax=function(e,t){this[PT[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){this[Pk[e]]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),Pk={min:"_determinedMin",max:"_determinedMax"},PT={min:"_dataMin",max:"_dataMax"};function PI(e,t,n){var i=e.rawExtentInfo;return i||(i=new PA(e,t,n),e.rawExtentInfo=i),i}function PD(e,t){return null==t?null:t!=t?NaN:e.parse(t)}function PO(e,t){var n=e.type,i=PI(e,t,e.getExtent()).calculate();e.setBlank(i.isBlank);var r=i.min,o=i.max,a=t.ecModel;if(a&&"time"===n){var s=yI("bar",a),l=!1;if(mq(s,function(e){l=l||e.getBaseAxis()===t.axis}),l){var u=function(e,t,n,i){var r=n.axis.getExtent(),o=r[1]-r[0],a=function(e,t){if(e&&t)return e[yT(t)]}(i,n.axis);if(void 0===a)return{min:e,max:t};var s=1/0;mq(a,function(e){s=Math.min(e.offset,s)});var l=-1/0;mq(a,function(e){l=Math.max(e.offset+e.width,l)});var u=(s=Math.abs(s))+(l=Math.abs(l)),c=t-e,h=c/(1-(s+l)/o)-c;return t+=l/u*h,{min:e-=s/u*h,max:t}}(r,o,t,yD(s));r=u.min,o=u.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function PP(e,t){var n=PO(e,t),i=n.extent,r=t.get("splitNumber");e instanceof PC&&(e.base=t.get("logBase"));var o=e.type,a=t.get("interval"),s="interval"===o||"time"===o;e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:r,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:s?t.get("minInterval"):null,maxInterval:s?t.get("maxInterval"):null}),null!=a&&e.setInterval&&e.setInterval(a)}function PR(e){var t=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"time"===e.scale.type?function(n,i){return e.scale.getFormattedLabel(n,i,t)}:m2(t)?function(n){var i=e.scale.getLabel(n);return t.replace("{value}",null!=i?i:"")}:m1(t)?function(i,r){return null!=n&&(r=i.value-n),t(PE(e,i),r,null!=i.level?{level:i.level}:null)}:function(t){return e.scale.getLabel(t)}}function PE(e,t){return"category"===e.type?e.scale.getLabel(t):t.value}function PL(e){var t=e.get("interval");return null==t?"auto":t}function PN(e){return"category"===e.type&&0===PL(e.getLabelModel())}function PB(e,t){var n={};return mq(e.mapDimensionsAll(t),function(t){n[yw(e,t)]=!0}),mK(n)}var PF=function(){function e(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return mY(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),mX(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),Pz=["x","y"];function PV(e){return"interval"===e.type||"time"===e.type}var Pj=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=Pz,t}return yz(t,e),t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis("x").scale,t=this.getAxis("y").scale;if(PV(e)&&PV(t)){var n=e.getExtent(),i=t.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,u=(o[1]-r[1])/s,c=r[0]-n[0]*l,h=r[1]-i[0]*u,d=this._transform=[l,0,0,u,c,h];this._invTransform=xn([],d)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},t.prototype.containPoint=function(e){var t=this.getAxis("x"),n=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),i=this.dataToPoint(t),r=this.getArea(),o=new xd(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},t.prototype.dataToPoint=function(e,t,n){n=n||[];var i=e[0],r=e[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return xz(n,e,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,t)),n[1]=a.toGlobalCoord(a.dataToCoord(r,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(e[0]),s=i.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),t[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return xz(n,e,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(e[0]),t),n[1]=r.coordToData(r.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis("x"===e.dim?"y":"x")},t.prototype.getArea=function(e){e=e||0;var t=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(t[0],t[1])-e,r=Math.min(n[0],n[1])-e,o=Math.max(t[0],t[1])-i+e,a=Math.max(n[0],n[1])-r+e;return new xd(i,r,o,a)},t}(PF),PH=vq();function PW(e,t){var n,i,r,o,a=PG(e,"labels"),s=PL(t),l=P$(a,s);return l||(m1(s)?r=PY(e,s):(o="auto"===s?null!=(i=PH(n=e).autoInterval)?i:PH(n).autoInterval=n.calculateCategoryInterval():s,r=Pq(e,o)),PU(a,s,{labels:r,labelCategoryInterval:o}))}function PG(e,t){return PH(e)[t]||(PH(e)[t]=[])}function P$(e,t){for(var n=0;n<e.length;n++)if(e[n].key===t)return e[n].value}function PU(e,t,n){return e.push({key:t,value:n}),n}function Pq(e,t,n){var i=PR(e),r=e.scale,o=r.getExtent(),a=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=o[0],c=r.count();0!==u&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=PN(e),d=a.get("showMinLabel")||h,f=a.get("showMaxLabel")||h;d&&u!==o[0]&&g(o[0]);for(var p=u;p<=o[1];p+=l)g(p);function g(e){var t={value:e};s.push(n?e:{formattedLabel:i(t),rawLabel:r.getLabel(t),tickValue:e})}return f&&p-l!==o[1]&&g(o[1]),s}function PY(e,t,n){var i=e.scale,r=PR(e),o=[];return mq(i.getTicks(),function(e){var a=i.getLabel(e),s=e.value;t(e.value,a)&&o.push(n?s:{formattedLabel:r(e),rawLabel:a,tickValue:s})}),o}var PZ=[0,1];function PX(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}var PK=function(e){function t(t,n,i,r,o){var a=e.call(this,t,n,i)||this;return a.index=0,a.type=r||"value",a.position=o||"bottom",a}return yz(t,e),t.prototype.isHorizontal=function(){var e=this.position;return"top"===e||"bottom"===e},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[+("x"!==this.dim)]),t)},t.prototype.setCategorySortInfo=function(e){if("category"!==this.type)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return vS(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&"ordinal"===i.type&&PX(n=n.slice(),i.count()),vv(e,PZ,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&PX(n=n.slice(),i.count());var r=vv(e,n,PZ,t);return this.scale.scale(r)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){var t=(e=e||{}).tickModel||this.getTickModel(),n=("category"===this.type?function(e,t){var n,i,r=PG(e,"ticks"),o=PL(t),a=P$(r,o);if(a)return a;if((!t.get("show")||e.scale.isBlank())&&(n=[]),m1(o))n=PY(e,o,!0);else if("auto"===o){var s=PW(e,e.getLabelModel());i=s.labelCategoryInterval,n=mY(s.labels,function(e){return e.tickValue})}else n=Pq(e,i=o,!0);return PU(r,o,{ticks:n,tickCategoryInterval:i})}(this,t):{ticks:mY(this.scale.getTicks(),function(e){return e.value})}).ticks,i=mY(n,function(e){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(e):e),tickValue:e}},this);return function(e,t,n,i){var r,o,a=t.length;if(e.onBand&&!n&&a){var s=e.getExtent();if(1===a)t[0].coord=s[0],r=t[1]={coord:s[1]};else{var l=t[a-1].tickValue-t[0].tickValue,u=(t[a-1].coord-t[0].coord)/l;mq(t,function(e){e.coord-=u/2}),o=1+e.scale.getExtent()[1]-t[a-1].tickValue,r={coord:t[a-1].coord+u*o},t.push(r)}var c=s[0]>s[1];h(t[0].coord,s[0])&&(i?t[0].coord=s[0]:t.shift()),i&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]}),h(s[1],r.coord)&&(i?r.coord=s[1]:t.pop()),i&&h(r.coord,s[1])&&t.push({coord:s[1]})}function h(e,t){return e=vx(e),t=vx(t),c?e>t:e<t}}(this,i,t.get("alignWithLabel"),e.clamp),i},e.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");return e>0&&e<100||(e=5),mY(this.scale.getMinorTicks(e),function(e){return mY(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(){var e,t,n,i,r,o;return("category"===this.type?(e=this,t=e.getLabelModel(),n=PW(e,t),!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n):(i=this,r=i.scale.getTicks(),o=PR(i),{labels:mY(r,function(e,t){return{level:e.level,formattedLabel:o(e,t),rawLabel:i.scale.getLabel(e),tickValue:e.value}})})).labels},e.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},e.prototype.getTickModel=function(){return this.model.getModel("axisTick")},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+ +!!this.onBand;return 0===n&&(n=1),Math.abs(Math.abs(e[1]-e[0]))/n},e.prototype.calculateCategoryInterval=function(){return function(e){var t,n,i=(n=(t=e).getLabelModel(),{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:n.get("rotate")||0,font:n.getFont()}),r=PR(e),o=(i.axisRotate-i.labelRotate)/180*Math.PI,a=e.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var c=s[0],h=e.dataToCoord(c+1)-e.dataToCoord(c),d=Math.abs(h*Math.cos(o)),f=Math.abs(h*Math.sin(o)),p=0,g=0;c<=s[1];c+=u){var m=0,v=0,y=xm(r({value:c}),i.font,"center","top");m=1.3*y.width,v=1.3*y.height,p=Math.max(p,m,7),g=Math.max(g,v,7)}var x=p/d,b=g/f;isNaN(x)&&(x=1/0),isNaN(b)&&(b=1/0);var w=Math.max(0,Math.floor(Math.min(x,b))),S=PH(e.model),_=e.getExtent(),C=S.lastAutoInterval,M=S.lastTickCount;return null!=C&&null!=M&&1>=Math.abs(C-w)&&1>=Math.abs(M-l)&&C>w&&S.axisExtent0===_[0]&&S.axisExtent1===_[1]?w=C:(S.lastTickCount=l,S.lastAutoInterval=w,S.axisExtent0=_[0],S.axisExtent1=_[1]),w}(this)},e}());function PQ(e,t,n){n=n||{};var i=e.coordinateSystem,r=t.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,u=r.dim,c=i.getRect(),h=[c.x,c.x+c.width,c.y,c.y+c.height],d={left:0,right:1,top:0,bottom:1,onZero:2},f=t.get("offset")||0,p="x"===u?[h[2]-f,h[3]+f]:[h[0]-f,h[1]+f];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));p[d.onZero]=Math.max(Math.min(g,p[1]),p[0])}o.position=["y"===u?p[d[l]]:h[0],"x"===u?p[d[l]]:h[3]],o.rotation=Math.PI/2*("x"!==u),o.labelDirection=o.tickDirection=o.nameDirection=({top:-1,bottom:1,left:-1,right:1})[s],o.labelOffset=a?p[d[s]]-p[d.onZero]:0,t.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),ve(n.labelInside,t.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=t.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function PJ(e){return"cartesian2d"===e.get("coordinateSystem")}function P0(e){var t={xAxisModel:null,yAxisModel:null};return mq(t,function(n,i){var r=i.replace(/Model$/,""),o=e.getReferringComponents(r,vK).models[0];t[i]=o}),t}var P1=Math.log,P2=function(){function e(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Pz,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;function i(e){var t,n=mK(e),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=e[+n[o]],s=a.model,l=a.scale;Pa(l)&&s.get("alignTicks")&&null==s.get("interval")?r.push(a):(PP(l,s),Pa(l)&&(t=a))}r.length&&(t||PP((t=r.pop()).scale,t.model),mq(r,function(e){!function(e,t,n){var i=Pf.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=PO(e,t),u=l.extent,c=l.fixMin,h=l.fixMax;if("log"===e.type){var d=P1(e.base);u=[P1(u[0])/d,P1(u[1])/d]}e.setExtent(u[0],u[1]),e.calcNiceExtent({splitNumber:a,fixMin:c,fixMax:h});var f=i.getExtent.call(e);c&&(u[0]=f[0]),h&&(u[1]=f[1]);var p=i.getInterval.call(e),g=u[0],m=u[1];if(c&&h)p=(m-g)/a;else if(c)for(m=u[0]+p*a;m<u[1]&&isFinite(m)&&isFinite(u[1]);)p=Ps(p),m=u[0]+p*a;else if(h)for(g=u[1]-p*a;g>u[0]&&isFinite(g)&&isFinite(u[0]);)p=Ps(p),g=u[1]-p*a;else{e.getTicks().length-1>a&&(p=Ps(p));var v=p*a;(g=vx((m=Math.ceil(u[1]/p)*p)-v))<0&&u[0]>=0?(g=0,m=vx(v)):m>0&&u[1]<=0&&(m=0,g=-vx(v))}var y=(r[0].value-o[0].value)/s,x=(r[a].value-o[a].value)/s;i.setExtent.call(e,g+p*y,m+p*x),i.setInterval.call(e,p),(y||x)&&i.setNiceExtent.call(e,g+p,m-p)}(e.scale,e.model,t.scale)}))}}this._updateScale(e,this.model),i(n.x),i(n.y);var r={};mq(n.x,function(e){P3(n,"y",e,r)}),mq(n.y,function(e){P3(n,"x",e,r)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),r=!n&&e.get("containLabel"),o=Cs(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var a=this._axesList;function s(){mq(a,function(e){var t,n,i,r,a=e.isHorizontal(),s=a?[0,o.width]:[0,o.height],l=+!!e.inverse;e.setExtent(s[l],s[1-l]),t=e,n=a?o.x:o.y,r=(i=t.getExtent())[0]+i[1],t.toGlobalCoord="x"===t.dim?function(e){return e+n}:function(e){return r-e+n},t.toLocalCoord="x"===t.dim?function(e){return e-n}:function(e){return r-e+n}})}s(),r&&(mq(a,function(e){if(!e.model.get(["axisLabel","inside"])){var t=function(e){var t,n,i,r=e.model,o=e.scale;if(!(!r.get(["axisLabel","show"])||o.isBlank())){var a=o.getExtent();n=o instanceof Pd?o.count():(t=o.getTicks()).length;var s=e.getLabelModel(),l=PR(e),u=1;n>40&&(u=Math.ceil(n/40));for(var c=0;c<n;c+=u){var h=l(t?t[c]:{value:a[0]+c},c),d=function(e,t){var n=t*Math.PI/180,i=e.width,r=e.height,o=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new xd(e.x,e.y,o,a)}(s.getTextRect(h),s.get("rotate")||0);i?i.union(d):i=d}return i}}(e);if(t){var n=e.isHorizontal()?"height":"width",i=e.model.get(["axisLabel","margin"]);o[n]-=t[n]+i,"top"===e.position?o.y+=t.height+i:"left"===e.position&&(o.x+=t.width+i)}}}),s()),mq(this._coordsList,function(e){e.calcAffineTransform()})},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(null!=n)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(null!=e&&null!=t){var n="x"+e+"y"+t;return this._coordsMap[n]}m4(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,r=this._coordsList;i<r.length;i++)if(r[i].getAxis("x").index===e||r[i].getAxis("y").index===t)return r[i]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.dataToPoint(n):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var i=this._findConvertTarget(t);return i.cartesian?i.cartesian.pointToData(n):i.axis?i.axis.coordToData(i.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t,n,i=e.seriesModel,r=e.xAxisModel||i&&i.getReferringComponents("xAxis",vK).models[0],o=e.yAxisModel||i&&i.getReferringComponents("yAxis",vK).models[0],a=e.gridModel,s=this._coordsList;return i?0>mG(s,t=i.coordinateSystem)&&(t=null):r&&o?t=this.getCartesian(r.componentIndex,o.componentIndex):r?n=this.getAxis("x",r.componentIndex):o?n=this.getAxis("y",o.componentIndex):a&&a.coordinateSystem===this&&(t=this._coordsList[0]),{cartesian:t,axis:n}},e.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},e.prototype._initCartesian=function(e,t,n){var i=this,r=this,o={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},s={x:0,y:0};if(t.eachComponent("xAxis",l("x"),this),t.eachComponent("yAxis",l("y"),this),!s.x||!s.y){this._axesMap={},this._axesList=[];return}function l(t){return function(n,i){if(P5(n,e)){var l=n.get("position");"x"===t?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var u=new PK(t,function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new Pd({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new Pg({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(Po.getClass(t)||Pf)}}(n),[0,0],n.get("type"),l),c="category"===u.type;u.onBand=c&&n.get("boundaryGap"),u.inverse=n.get("inverse"),n.axis=u,u.model=n,u.grid=r,u.index=i,r._axesList.push(u),a[t][i]=u,s[t]++}}}this._axesMap=a,mq(a.x,function(t,n){mq(a.y,function(r,o){var a="x"+n+"y"+o,s=new Pj(a);s.master=i,s.model=e,i._coordsMap[a]=s,i._coordsList.push(s),s.addAxis(t),s.addAxis(r)})})},e.prototype._updateScale=function(e,t){function n(e,t){mq(PB(e,t.dim),function(n){t.scale.unionExtentFromData(e,n)})}mq(this._axesList,function(e){if(e.scale.setExtent(1/0,-1/0),"category"===e.type){var t=e.model.get("categorySortInfo");e.scale.setSortInfo(t)}}),e.eachSeries(function(e){if(PJ(e)){var i=P0(e),r=i.xAxisModel,o=i.yAxisModel;if(P5(r,t)&&P5(o,t)){var a=this.getCartesian(r.componentIndex,o.componentIndex),s=e.getData(),l=a.getAxis("x"),u=a.getAxis("y");n(s,l),n(s,u)}}},this)},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return mq(this.getCartesians(),function(i){var r=null!=e&&"auto"!==e?i.getAxis(e):i.getBaseAxis(),o=i.getOtherAxis(r);0>mG(t,r)&&t.push(r),0>mG(n,o)&&n.push(o)}),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var i=[];return t.eachComponent("grid",function(r,o){var a=new e(r,t,n);a.name="grid_"+o,a.resize(r,n,!0),r.coordinateSystem=a,i.push(a)}),t.eachSeries(function(e){if(PJ(e)){var t=P0(e),n=t.xAxisModel,i=t.yAxisModel;e.coordinateSystem=n.getCoordSysModel().coordinateSystem.getCartesian(n.componentIndex,i.componentIndex)}}),i},e.dimensions=Pz,e}();function P5(e,t){return e.getCoordSysModel()===t}function P3(e,t,n,i){n.getAxesOnZeroOf=function(){return r?[r]:[]};var r,o=e[t],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)P4(o[l])&&(r=o[l]);else for(var u in o)if(o.hasOwnProperty(u)&&P4(o[u])&&!i[c(o[u])]){r=o[u];break}r&&(i[c(r)]=!0)}function c(e){return e.dim+"_"+e.index}}function P4(e){var t,n,i;return e&&"category"!==e.type&&"time"!==e.type&&(n=(t=e.scale.getExtent())[0],i=t[1],!(n>0&&i>0||n<0&&i<0))}var P6=Math.PI,P8=function(){function e(e,t){this.group=new MF,this.opt=t,this.axisModel=e,mW(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new MF({x:t.position[0],y:t.position[1],rotation:t.rotation});n.updateTransform(),this._transformGroup=n}return e.prototype.hasBuilder=function(e){return!!P9[e]},e.prototype.add=function(e){P9[e](this.opt,this.axisModel,this.group,this._transformGroup)},e.prototype.getGroup=function(){return this.group},e.innerTextLayout=function(e,t,n){var i,r,o=v_(t-e);return vC(o)?(r=n>0?"top":"bottom",i="center"):vC(o-P6)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o<P6?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},e}(),P9={axisLine:function(e,t,n,i){var r=t.get(["axisLine","show"]);if("auto"===r&&e.handleAutoShown&&(r=e.handleAutoShown("axisLine")),r){var o=t.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],u=s[0]>l[0];a&&(xz(s,s,a),xz(l,l,a));var c=mH({lineCap:"round"},t.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new AM({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});A3(h.shape,h.style.lineWidth),h.anid="line",n.add(h);var d=t.get(["axisLine","symbol"]);if(null!=d){var f=t.get(["axisLine","symbolSize"]);m2(d)&&(d=[d,d]),(m2(f)||m3(f))&&(f=[f,f]);var p=k9(t.get(["axisLine","symbolOffset"])||0,f),g=f[0],m=f[1];mq([{rotate:e.rotation+Math.PI/2,offset:p[0],r:0},{rotate:e.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(t,i){if("none"!==d[i]&&null!=d[i]){var r=k6(d[i],-g/2,-m/2,g,m,c.stroke,!0),o=t.r+t.offset,a=u?l:s;r.attr({rotation:t.rotate,x:a[0]+o*Math.cos(e.rotation),y:a[1]-o*Math.sin(e.rotation),silent:!0,z2:11}),n.add(r)}})}}},axisTickLabel:function(e,t,n,i){var r=function(e,t,n,i){var r=n.axis,o=n.getModel("axisTick"),a=o.get("show");if("auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick")),!(!a||r.scale.isBlank())){for(var s=o.getModel("lineStyle"),l=i.tickDirection*o.get("length"),u=Rn(r.getTicksCoords(),t.transform,l,mW(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),c=0;c<u.length;c++)e.add(u[c]);return u}}(n,i,t,e),o=function(e,t,n,i){var r=n.axis;if(!(!ve(i.axisLabelShow,n.get(["axisLabel","show"]))||r.scale.isBlank())){var o=n.getModel("axisLabel"),a=o.get("margin"),s=r.getViewLabels(),l=(ve(i.labelRotate,o.get("rotate"))||0)*P6/180,u=P8.innerTextLayout(i.rotation,l,i.labelDirection),c=n.getCategories&&n.getCategories(!0),h=[],d=P8.isLabelSilent(n),f=n.get("triggerEvent");return mq(s,function(l,p){var g="ordinal"===r.scale.type?r.scale.getRawOrdinalNumber(l.tickValue):l.tickValue,m=l.formattedLabel,v=l.rawLabel,y=o;if(c&&c[g]){var x=c[g];m4(x)&&x.textStyle&&(y=new _x(x.textStyle,o,n.ecModel))}var b=y.getTextColor()||n.get(["axisLine","lineStyle","color"]),w=r.dataToCoord(g),S=y.getShallow("align",!0)||u.textAlign,_=vt(y.getShallow("alignMinLabel",!0),S),C=vt(y.getShallow("alignMaxLabel",!0),S),M=y.getShallow("verticalAlign",!0)||y.getShallow("baseline",!0)||u.textVerticalAlign,A=vt(y.getShallow("verticalAlignMinLabel",!0),M),k=vt(y.getShallow("verticalAlignMaxLabel",!0),M),T=new Sr({x:w,y:i.labelOffset+i.labelDirection*a,rotation:u.rotation,silent:d,z2:10+(l.level||0),style:_e(y,{text:m,align:0===p?_:p===s.length-1?C:S,verticalAlign:0===p?A:p===s.length-1?k:M,fill:m1(b)?b("category"===r.type?v:"value"===r.type?g+"":g,p):b})});if(T.anid="label_"+g,f){var I=P8.makeAxisEventDataBase(n);I.targetType="axisLabel",I.value=v,I.tickIndex=p,"category"===r.type&&(I.dataIndex=g),So(T).eventData=I}t.add(T),T.updateTransform(),h.push(T),e.add(T),T.decomposeTransform()}),h}}(n,i,t,e);(function(e,t,n){if(!PN(e.axis)){var i=e.get(["axisLabel","showMinLabel"]),r=e.get(["axisLabel","showMaxLabel"]);n=n||[];var o=(t=t||[])[0],a=t[1],s=t[t.length-1],l=t[t.length-2],u=n[0],c=n[1],h=n[n.length-1],d=n[n.length-2];!1===i?(P7(o),P7(u)):Re(o,a)&&(i?(P7(a),P7(c)):(P7(o),P7(u))),!1===r?(P7(s),P7(h)):Re(l,s)&&(r?(P7(l),P7(d)):(P7(s),P7(h)))}})(t,o,r),function(e,t,n,i){var r=n.axis,o=n.getModel("minorTick");if(!(!o.get("show")||r.scale.isBlank())){var a=r.getMinorTicksCoords();if(a.length)for(var s=o.getModel("lineStyle"),l=i*o.get("length"),u=mW(s.getLineStyle(),mW(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),c=0;c<a.length;c++)for(var h=Rn(a[c],t.transform,l,u,"minorticks_"+c),d=0;d<h.length;d++)e.add(h[d])}}(n,i,t,e.tickDirection),t.get(["axisLabel","hideOverlap"])&&function(e){var t=[];e.sort(function(e,t){return t.priority-e.priority});var n=new xd(0,0,0,0);function i(e){if(!e.ignore){var t=e.ensureState("emphasis");null==t.ignore&&(t.ignore=!1)}e.ignore=!0}for(var r=0;r<e.length;r++){var o=e[r],a=o.axisAligned,s=o.localRect,l=o.transform,u=o.label,c=o.labelLine;n.copy(o.rect),n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var h=o.obb,d=!1,f=0;f<t.length;f++){var p=t[f];if(n.intersect(p.rect)&&(a&&p.axisAligned||(p.obb||(p.obb=new AH(p.localRect,p.transform)),h||(h=new AH(s,l)),h.intersect(p.obb)))){d=!0;break}}d?(i(u),c&&i(c)):(u.attr("ignore",o.defaultAttr.ignore),c&&c.attr("ignore",o.defaultAttr.labelGuideIgnore),t.push(o))}}(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if(!i.defaultAttr.ignore){var r=i.label,o=r.getComputedTransform(),a=r.getBoundingRect(),s=!o||o[1]<1e-5&&o[2]<1e-5,l=r.style.margin||0,u=a.clone();u.applyTransform(o),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var c=s?new AH(a,o):null;t.push({label:r,labelLine:i.labelLine,rect:u,localRect:a,obb:c,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:o})}}return t}(mY(o,function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}})))},axisName:function(e,t,n,i){var r,o,a=ve(e.axisName,t.get("name"));if(a){var s,l,u,c,h,d,f,p,g,m=t.get("nameLocation"),v=e.nameDirection,y=t.getModel("nameTextStyle"),x=t.get("nameGap")||0,b=t.axis.getExtent(),w=b[0]>b[1]?-1:1,S=["start"===m?b[0]-w*x:"end"===m?b[1]+w*x:(b[0]+b[1])/2,Rt(m)?e.labelOffset+v*x:0],_=t.get("nameRotate");null!=_&&(_=_*P6/180),Rt(m)?r=P8.innerTextLayout(e.rotation,null!=_?_:e.rotation,v):(s=e.rotation,l=m,u=_||0,c=b,f=v_(u-s),p=c[0]>c[1],g="start"===l&&!p||"start"!==l&&p,vC(f-P6/2)?(d=g?"bottom":"top",h="center"):vC(f-1.5*P6)?(d=g?"top":"bottom",h="center"):(d="middle",h=f<1.5*P6&&f>P6/2?g?"left":"right":g?"right":"left"),r={rotation:f,textAlign:h,textVerticalAlign:d},null!=(o=e.axisNameAvailableWidth)&&(isFinite(o=Math.abs(o/Math.sin(r.rotation)))||(o=null)));var C=y.getFont(),M=t.get("nameTruncate",!0)||{},A=M.ellipsis,k=ve(e.nameTruncateMaxWidth,M.maxWidth,o),T=new Sr({x:S[0],y:S[1],rotation:r.rotation,silent:P8.isLabelSilent(t),style:_e(y,{text:a,font:C,overflow:"truncate",width:k,ellipsis:A,fill:y.getTextColor()||t.get(["axisLine","lineStyle","color"]),align:y.get("align")||r.textAlign,verticalAlign:y.get("verticalAlign")||r.textVerticalAlign}),z2:1});if(ka({el:T,componentModel:t,itemName:a}),T.__fullText=a,T.anid="name",t.get("triggerEvent")){var I=P8.makeAxisEventDataBase(t);I.targetType="axisName",I.name=a,So(T).eventData=I}i.add(T),T.updateTransform(),n.add(T),T.decomposeTransform()}}};function P7(e){e&&(e.ignore=!0)}function Re(e,t){var n=e&&e.getBoundingRect().clone(),i=t&&t.getBoundingRect().clone();if(n&&i){var r=y9([]);return xt(r,r,-e.rotation),n.applyTransform(y7([],r,e.getLocalTransform())),i.applyTransform(y7([],r,t.getLocalTransform())),n.intersect(i)}}function Rt(e){return"middle"===e||"center"===e}function Rn(e,t,n,i,r){for(var o=[],a=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,t&&(xz(a,a,t),xz(s,s,t));var c=new AM({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});A3(c.shape,c.style.lineWidth),c.anid=r+"_"+e[l].tickValue,o.push(c)}return o}function Ri(e,t){return"all"===e||m0(e)&&mG(e,t)>=0||e===t}function Rr(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[Ra(e)]}function Ro(e){return!!e.get(["handle","show"])}function Ra(e){return e.type+"||"+e.id}var Rs={},Rl=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(t,n,i,r){this.axisPointerClass&&function(e){var t=Rr(e);if(t){var n=t.axisPointerModel,i=t.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=Ro(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),r.value=a,s&&(r.status=t.axis.scale.isBlank()?"hide":"show")}}(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,i,!0)},t.prototype.updateAxisPointer=function(e,t,n,i){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,t){var n=this._axisPointer;n&&n.remove(t)},t.prototype.dispose=function(t,n){this._disposeAxisPointer(n),e.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,n,i){var r=t.getAxisPointerClass(this.axisPointerClass);if(r){var o,a=(o=Rr(e))&&o.axisPointerModel;a?(this._axisPointer||(this._axisPointer=new r)).render(e,a,n,i):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){Rs[e]=t},t.getAxisPointerClass=function(e){return e&&Rs[e]},t.type="axis",t}(Dp),Ru=vq(),Rc=["axisLine","axisTickLabel","axisName"],Rh=["splitArea","splitLine","minorSplitLine"],Rd=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass="CartesianAxisPointer",n}return yz(t,e),t.prototype.render=function(t,n,i,r){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new MF,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),s=PQ(a,t),l=new P8(t,mH({handleAutoShown:function(e){for(var n=a.coordinateSystem.getCartesians(),i=0;i<n.length;i++)if(Pa(n[i].getOtherAxis(t.axis).scale))return!0;return!1}},s));mq(Rc,l.add,l),this._axisGroup.add(l.getGroup()),mq(Rh,function(e){t.get([e,"show"])&&Rf[e](this,this._axisGroup,t,a)},this),r&&"changeAxisOrder"===r.type&&r.isInitSort||ke(o,this._axisGroup,t),e.prototype.render.call(this,t,n,i,r)}},t.prototype.remove=function(){Ru(this).splitAreaColors=null},t.type="cartesianAxis",t}(Rl),Rf={splitLine:function(e,t,n,i){var r=n.axis;if(!r.scale.isBlank()){var o=n.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=m0(s)?s:[s];for(var l=i.coordinateSystem.getRect(),u=r.isHorizontal(),c=0,h=r.getTicksCoords({tickModel:o}),d=[],f=[],p=a.getLineStyle(),g=0;g<h.length;g++){var m=r.toGlobalCoord(h[g].coord);u?(d[0]=m,d[1]=l.y,f[0]=m,f[1]=l.y+l.height):(d[0]=l.x,d[1]=m,f[0]=l.x+l.width,f[1]=m);var v=c++%s.length,y=new AM({anid:null!=h[g].tickValue?"line_"+h[g].tickValue:null,autoBatch:!0,shape:{x1:d[0],y1:d[1],x2:f[0],y2:f[1]},style:mW({stroke:s[v]},p),silent:!0});A3(y.shape,p.lineWidth),t.add(y)}}},minorSplitLine:function(e,t,n,i){var r=n.axis,o=n.getModel("minorSplitLine").getModel("lineStyle"),a=i.coordinateSystem.getRect(),s=r.isHorizontal(),l=r.getMinorTicksCoords();if(l.length)for(var u=[],c=[],h=o.getLineStyle(),d=0;d<l.length;d++)for(var f=0;f<l[d].length;f++){var p=r.toGlobalCoord(l[d][f].coord);s?(u[0]=p,u[1]=a.y,c[0]=p,c[1]=a.y+a.height):(u[0]=a.x,u[1]=p,c[0]=a.x+a.width,c[1]=p);var g=new AM({anid:"minor_line_"+l[d][f].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:c[0],y2:c[1]},style:h,silent:!0});A3(g.shape,h.lineWidth),t.add(g)}},splitArea:function(e,t,n,i){!function(e,t,n,i){var r=n.axis;if(!r.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=i.coordinateSystem.getRect(),u=r.getTicksCoords({tickModel:o,clamp:!0});if(u.length){var c=s.length,h=Ru(e).splitAreaColors,d=vh(),f=0;if(h)for(var p=0;p<u.length;p++){var g=h.get(u[p].tickValue);if(null!=g){f=(g+(c-1)*p)%c;break}}var m=r.toGlobalCoord(u[0].coord),v=a.getAreaStyle();s=m0(s)?s:[s];for(var p=1;p<u.length;p++){var y=r.toGlobalCoord(u[p].coord),x=void 0,b=void 0,w=void 0,S=void 0;r.isHorizontal()?(x=m,b=l.y,w=y-x,S=l.height,m=x+w):(x=l.x,b=m,w=l.width,S=y-b,m=b+S);var _=u[p-1].tickValue;null!=_&&d.set(_,f),t.add(new w0({anid:null!=_?"area_"+_:null,shape:{x:x,y:b,width:w,height:S},style:mW({fill:s[f]},v),autoBatch:!0,silent:!0})),f=(f+1)%c}Ru(e).splitAreaColors=d}}}(e,t,n,i)}},Rp=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.type="xAxis",t}(Rd),Rg=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=Rp.type,t}return yz(t,e),t.type="yAxis",t}(Rd),Rm=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="grid",t}return yz(t,e),t.prototype.render=function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new w0({shape:e.coordinateSystem.getRect(),style:mW({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))},t.type="grid",t}(Dp),Rv={offset:0};function Ry(e){e.registerComponentView(Rm),e.registerComponentModel(O0),e.registerCoordinateSystem("cartesian2d",P2),Pi(e,"x",O2,Rv),Pi(e,"y",O2,Rv),e.registerComponentView(Rp),e.registerComponentView(Rg),e.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var Rx={color:"fill",borderColor:"stroke"},Rb={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Rw=vq(),RS=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},t.prototype.getInitialData=function(e,t){return ME(null,this)},t.prototype.getDataParams=function(t,n,i){var r=e.prototype.getDataParams.call(this,t,n);return i&&(r.info=Rw(i).info),r},t.type="series.custom",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},t}(Mu);function R_(e,t){return t=t||[0,0],mY(["x","y"],function(n,i){var r=this.getAxis(n),o=t[i],a=e[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a))},this)}function RC(e,t){return t=t||[0,0],mY([0,1],function(n){var i=t[n],r=e[n]/2,o=[],a=[];return o[n]=i-r,a[n]=i+r,o[1-n]=a[1-n]=t[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])},this)}function RM(e,t){var n=this.getAxis(),i=t instanceof Array?t[0]:t,r=(e instanceof Array?e[0]:e)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function RA(e,t){return t=t||[0,0],mY(["Radius","Angle"],function(n,i){var r=this["get"+n+"Axis"](),o=t[i],a=e[i]/2,s="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s},this)}function Rk(e,t){t&&(t.font=t.textFont||t.font,vp(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),vp(t,"textAlign")&&(e.align=t.textAlign),vp(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),vp(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),vp(t,"textWidth")&&(e.width=t.textWidth),vp(t,"textHeight")&&(e.height=t.textHeight),vp(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),vp(t,"textPadding")&&(e.padding=t.textPadding),vp(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),vp(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),vp(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),vp(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),vp(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),vp(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),vp(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function RT(e,t,n){e.textPosition=e.textPosition||n.position||"inside",null!=n.offset&&(e.textOffset=n.offset),null!=n.rotation&&(e.textRotation=n.rotation),null!=n.distance&&(e.textDistance=n.distance);var i=e.textPosition.indexOf("inside")>=0,r=e.fill||"#000";RI(e,t);var o=null==e.textFill;return i?o&&(e.textFill=n.insideFill||"#fff",!e.textStroke&&n.insideStroke&&(e.textStroke=n.insideStroke),e.textStroke||(e.textStroke=r),null==e.textStrokeWidth&&(e.textStrokeWidth=2)):(o&&(e.textFill=e.fill||n.outsideFill||"#000"),!e.textStroke&&n.outsideStroke&&(e.textStroke=n.outsideStroke)),e.text=t.text,e.rich=t.rich,mq(t.rich,function(e){RI(e,e)}),e}function RI(e,t){t&&(vp(t,"fill")&&(e.textFill=t.fill),vp(t,"stroke")&&(e.textStroke=t.fill),vp(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),vp(t,"font")&&(e.font=t.font),vp(t,"fontStyle")&&(e.fontStyle=t.fontStyle),vp(t,"fontWeight")&&(e.fontWeight=t.fontWeight),vp(t,"fontSize")&&(e.fontSize=t.fontSize),vp(t,"fontFamily")&&(e.fontFamily=t.fontFamily),vp(t,"align")&&(e.textAlign=t.align),vp(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),vp(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),vp(t,"width")&&(e.textWidth=t.width),vp(t,"height")&&(e.textHeight=t.height),vp(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),vp(t,"padding")&&(e.textPadding=t.padding),vp(t,"borderColor")&&(e.textBorderColor=t.borderColor),vp(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),vp(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),vp(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),vp(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),vp(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),vp(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),vp(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),vp(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),vp(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),vp(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var RD={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},RO=mK(RD);mZ(xY,function(e,t){return e[t]=1,e},{}),xY.join(", ");var RP=["","style","shape","extra"],RR=vq();function RE(e,t,n,i,r){var o=e+"Animation",a=SX(e,i,r)||{},s=RR(t).userDuring;return a.duration>0&&(a.during=s?mQ(Rz,{el:t,userDuring:s}):null,a.setToFinal=!0,a.scope=e),mH(a,n[o]),a}function RL(e,t,n,i){if(e){var r=e.parent,o=RR(e).leaveToProps;if(o){var a=RE("update",e,t,n,0);a.done=function(){r.remove(e),i&&i()},e.animateTo(o,a)}else r.remove(e),i&&i()}}function RN(e){return"all"===e}var RB={},RF={setTransform:function(e,t){return RB.el[e]=t,this},getTransform:function(e){return RB.el[e]},setShape:function(e,t){var n=RB.el;return(n.shape||(n.shape={}))[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=RB.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=RB.el,i=n.style;return i&&(i[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=RB.el.style;if(t)return t[e]},setExtra:function(e,t){return(RB.el.extra||(RB.el.extra={}))[e]=t,this},getExtra:function(e){var t=RB.el.extra;if(t)return t[e]}};function Rz(){var e=this.el;if(e){var t=RR(e).userDuring,n=this.userDuring;if(t!==n){this.el=this.userDuring=null;return}RB.el=e,n(RF)}}function RV(e,t,n,i){var r,o=n[e];if(o){var a=t[e];if(a){var s=n.transition,l=o.transition;if(l)if(r||(r=i[e]={}),RN(l))mH(r,a);else for(var u=vB(l),c=0;c<u.length;c++){var h=u[c],d=a[h];r[h]=d}else if(RN(s)||mG(s,e)>=0){r||(r=i[e]={});for(var f=mK(a),c=0;c<f.length;c++){var p,g,h=f[c],d=a[h];p=o[h],g=d,(mU(p)?p!==g:null!=p&&isFinite(p))&&(r[h]=d)}}}}}function Rj(e,t,n){var i=t[e];if(i)for(var r=n[e]={},o=mK(i),a=0;a<o.length;a++){var s=o[a];r[s]=bP(i[s])}}var RH=vq(),RW=["percent","easing","shape","style","extra"],RG="emphasis",R$="normal",RU="blur",Rq="select",RY=[R$,RG,RU,Rq],RZ={normal:["itemStyle"],emphasis:[RG,"itemStyle"],blur:[RU,"itemStyle"],select:[Rq,"itemStyle"]},RX={normal:["label"],emphasis:[RG,"label"],blur:[RU,"label"],select:[Rq,"label"]},RK=["x","y"],RQ={normal:{},emphasis:{},blur:{},select:{}},RJ={cartesian2d:function(e){var t=e.master.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:mQ(R_,e)}}},geo:function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:mQ(RC,e)}}},single:function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:mQ(RM,e)}}},polar:function(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),i=t.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=t.dataToRadius(i[0]),o=n.dataToAngle(i[1]),a=e.coordToPoint([r,o]);return a.push(r,o*Math.PI/180),a},size:mQ(RA,e)}}},calendar:function(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}};function R0(e){return e instanceof wV}function R1(e){return e instanceof b5}var R2=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(e,t,n,i){this._progressiveEls=null;var r=this._data,o=e.getData(),a=this.group,s=R6(e,o,t,n);r||a.removeAll(),o.diff(r).add(function(t){R8(n,null,t,s(t,i),e,a,o)}).remove(function(t){var n=r.getItemGraphicEl(t);n&&RL(n,Rw(n).option,e)}).update(function(t,l){R8(n,r.getItemGraphicEl(l),t,s(t,i),e,a,o)}).execute();var l=e.get("clip",!0)?kv(e.coordinateSystem,!1,e):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll(),this._data=null},t.prototype.incrementalRender=function(e,t,n,i,r){var o=t.getData(),a=R6(t,o,n,i),s=this._progressiveEls=[];function l(e){e.isGroup||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}for(var u=e.start;u<e.end;u++){var c=R8(null,null,u,a(u,r),t,this.group,o);c&&(c.traverse(l),s.push(c))}},t.prototype.eachRendered=function(e){kl(this._progressiveEls||this.group,e)},t.prototype.filterForExposedEvent=function(e,t,n,i){var r=t.element;if(null==r||n.name===r)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===r)return!0;return!1},t.type="custom",t}(kS);function R5(e){var t,n=e.type;if("path"===n){var i=e.shape,r=null!=i.width&&null!=i.height?{x:i.x||0,y:i.y||0,width:i.width,height:i.height}:null,o=Ea(i);Rw(t=AJ(o,null,r,i.layout||"center")).customPathData=o}else if("image"===n)Rw(t=new wU({})).customImagePath=e.style.image;else if("text"===n)t=new Sr({});else if("group"===n)t=new MF;else if("compoundPath"===n)throw Error('"compoundPath" is not supported yet.');else{var a=AQ(n);a||CR(""),t=new a}return Rw(t).customGraphicType=n,t.name=e.name,t.z2EmphasisLift=1,t.z2SelectLift=1,t}function R3(e,t,n,i,r,o,a){t.stopAnimation("keyframe"),t.attr(RH(t));var s=r&&r.normal.cfg;s&&t.setTextConfig(s),i&&null==i.transition&&(i.transition=RK);var l=i&&i.style;if(l){"text"===t.type&&(vp(l,"textFill")&&(l.fill=l.textFill),vp(l,"textStroke")&&(l.stroke=l.textStroke));var u=void 0,c=R0(t)?l.decal:null;e&&c&&(c.dirty=!0,u=Oc(c,e)),l.__decalPattern=u}if(R1(t)&&l){var u=l.__decalPattern;u&&(l.decal=u)}!function(e,t,n,i){var r,o,a=(i=i||{}).dataIndex,s=i.isInit,l=i.clearStyle,u=n.isAnimationEnabled(),c=RR(e),h=t.style;c.userDuring=t.during;var d={},f={};if(function(e,t){for(var n=0;n<RO.length;n++){var i=RO[n],r=RD[i],o=e[i];o&&(t[r[0]]=o[0],t[r[1]]=o[1])}for(var n=0;n<xY.length;n++){var a=xY[n];null!=e[a]&&(t[a]=e[a])}}(t,f),Rj("shape",t,f),Rj("extra",t,f),!s&&u&&(function(e,t,n){for(var i=t.transition,r=RN(i)?xY:vB(i||[]),o=0;o<r.length;o++){var a=r[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=e[a];n[a]=s}}}(e,t,d),RV("shape",e,t,d),RV("extra",e,t,d),function(e,t,n,i){if(n){var r,o=e.style;if(o){var a=n.transition,s=t.transition;if(a&&!RN(a)){var l=vB(a);r||(r=i.style={});for(var u=0;u<l.length;u++){var c=l[u],h=o[c];r[c]=h}}else if(e.getAnimationStyleProps&&(RN(s)||RN(a)||mG(s,"style")>=0)){var d=e.getAnimationStyleProps(),f=d?d.style:null;if(f){r||(r=i.style={});for(var p=mK(n),u=0;u<p.length;u++){var c=p[u];if(f[c]){var h=o[c];r[c]=h}}}}}}}(e,t,h,d)),f.style=h,function(e,t,n){var i=t.style;if(!e.isGroup&&i){if(n){e.useStyle({});for(var r=e.animators,o=0;o<r.length;o++){var a=r[o];"style"===a.targetName&&a.changeTarget(e.style)}}e.setStyle(i)}t&&(t.style=null,t&&e.attr(t),t.style=i)}(e,f,l),r=e,vp(o=t,"silent")&&(r.silent=o.silent),vp(o,"ignore")&&(r.ignore=o.ignore),r instanceof b5&&vp(o,"invisible")&&(r.invisible=o.invisible),r instanceof wV&&vp(o,"autoBatch")&&(r.autoBatch=o.autoBatch),u)if(s){var p={};mq(RP,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(p[e]=p[e]||{}),mH(e?p[e]:p,n.enterFrom))});var g=RE("enter",e,t,n,a);g.duration>0&&e.animateFrom(p,g)}else{var m=e,v=t,y=a||0,x=n,b=d;if(b){var w=RE("update",m,v,x,y);w.duration>0&&m.animateFrom(b,w)}}(function(e,t){for(var n=RR(e).leaveToProps,i=0;i<RP.length;i++){var r=RP[i],o=r?t[r]:t;o&&o.leaveTo&&(n||(n=RR(e).leaveToProps={}),r&&(n[r]=n[r]||{}),mH(r?n[r]:n,o.leaveTo))}})(e,t),h?e.dirty():e.markRedraw()}(t,i,o,{dataIndex:n,isInit:a,clearStyle:!0}),function e(t,n,i){if(i.isAnimationEnabled()&&n){if(m0(n))return void mq(n,function(n){e(t,n,i)});var r=n.keyframes,o=n.duration;if(i&&null==o){var a=SX("enter",i,0);o=a&&a.duration}if(r&&o){var s=RH(t);mq(RP,function(e){var i;e&&!t[e]||(r.sort(function(e,t){return e.percent-t.percent}),mq(r,function(r){var a=t.animators,l=e?r[e]:r;if(l){var u=mK(l);if(e||(u=mX(u,function(e){return 0>mG(RW,e)})),u.length){i||((i=t.animate(e,n.loop,!0)).scope="keyframe");for(var c=0;c<a.length;c++)a[c]!==i&&a[c].targetName===i.targetName&&a[c].stopTracks(u);e&&(s[e]=s[e]||{});var h=e?s[e]:s;mq(u,function(n){h[n]=((e?t[e]:t)||{})[n]}),i.whenWithKeys(o*r.percent,l,u,r.easing)}}}),i&&i.delay(n.delay||0).duration(o).start(n.easing))})}}}(t,i.keyframeAnimation,o)}function R4(e,t,n,i,r){var o=t.isGroup?null:t,a=r&&r[e].cfg;if(o){var s=o.ensureState(e);if(!1===i){var l=o.getState(e);l&&(l.style=null)}else s.style=i||null;a&&(s.textConfig=a),SI(o)}}function R6(e,t,n,i){var r,o,a,s,l=e.get("renderItem"),u=e.coordinateSystem,c={};u&&(c=u.prepareCustoms?u.prepareCustoms(u):RJ[u.type](u));for(var h=mW({getWidth:i.getWidth,getHeight:i.getHeight,getZr:i.getZr,getDevicePixelRatio:i.getDevicePixelRatio,value:function(e,n){return null==n&&(n=a),t.getStore().get(t.getDimensionIndex(e||0),n)},style:function(n,i){null==i&&(i=a);var r=t.getItemVisual(i,"style"),o=r&&r.fill,s=r&&r.opacity,l=b(i,R$).getItemStyle();null!=o&&(l.fill=o),null!=s&&(l.opacity=s);var u={inheritColor:m2(o)?o:"#000"},c=w(i,R$),h=_e(c,null,u,!1,!0);h.text=c.getShallow("show")?vt(e.getFormattedLabel(i,R$),kI(t,i)):null;var d=_t(c,u,!1);return _(n,l),l=RT(l,h,d),n&&S(l,n),l.legacy=!0,l},ordinalRawValue:function(e,n){null==n&&(n=a),e=e||0;var i=t.getDimensionInfo(e);if(!i){var r=t.getDimensionIndex(e);return r>=0?t.getStore().get(r,n):void 0}var o=t.get(i.name,n),s=i&&i.ordinalMeta;return s?s.categories[o]:o},styleEmphasis:function(n,i){null==i&&(i=a);var r=b(i,RG).getItemStyle(),o=w(i,RG),s=_e(o,null,null,!0,!0);s.text=o.getShallow("show")?vn(e.getFormattedLabel(i,RG),e.getFormattedLabel(i,R$),kI(t,i)):null;var l=_t(o,null,!0);return _(n,r),r=RT(r,s,l),n&&S(r,n),r.legacy=!0,r},visual:function(e,n){if(null==n&&(n=a),vp(Rx,e)){var i=t.getItemVisual(n,"style");return i?i[Rx[e]]:null}if(vp(Rb,e))return t.getItemVisual(n,e)},barLayout:function(e){if("cartesian2d"===u.type)return function(e){var t=[],n=e.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),o=0;o<e.count||0;o++)t.push(mW({bandWidth:r,axisKey:i,stackId:yA+o},e));for(var a=yO(t),s=[],o=0;o<e.count;o++){var l=a[i][yA+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(mW({axis:u.getBaseAxis()},e))},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(e){return _a(e,n)}},c.api||{}),d={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:c.coordSys,dataInsideLength:t.count(),encode:(r=e.getData(),o={},mq(r.dimensions,function(e){var t=r.getDimensionInfo(e);if(!t.isExtraCoord){var n=t.coordDim;(o[n]=o[n]||[])[t.coordDimIndex]=r.getDimensionIndex(e)}}),o)},f={},p={},g={},m={},v=0;v<RY.length;v++){var y=RY[v];g[y]=e.getModel(RZ[y]),m[y]=e.getModel(RX[y])}function x(e){return e===a?s||(s=t.getItemModel(e)):t.getItemModel(e)}function b(e,n){return t.hasItemOption?e===a?f[n]||(f[n]=x(e).getModel(RZ[n])):x(e).getModel(RZ[n]):g[n]}function w(e,n){return t.hasItemOption?e===a?p[n]||(p[n]=x(e).getModel(RX[n])):x(e).getModel(RX[n]):m[n]}return function(e,n){return a=e,s=null,f={},p={},l&&l(mW({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:n?n.type:null},d),h)};function S(e,t){for(var n in t)vp(t,n)&&(e[n]=t[n])}function _(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}}function R8(e,t,n,i,r,o,a){if(!i)return void o.remove(t);var s=R9(e,t,n,i,r,o);return s&&a.setItemGraphicEl(n,s),s&&Sj(s,i.focus,i.blurScope,i.emphasisDisabled),s}function R9(e,t,n,i,r,o){var a,s=-1,l=t;t&&R7(t,i,r)&&(s=mG(o.childrenRef(),t),t=null);var u=!t,c=t;c?c.clearStates():(c=R5(i),l&&((a=c).copyTransform(l),R1(a)&&R1(l)&&(a.setStyle(l.style),a.z=l.z,a.z2=l.z2,a.zlevel=l.zlevel,a.invisible=l.invisible,a.ignore=l.ignore,R0(a)&&R0(l)&&a.setShape(l.shape)))),!1===i.morph?c.disableMorphing=!0:c.disableMorphing&&(c.disableMorphing=!1),RQ.normal.cfg=RQ.normal.conOpt=RQ.emphasis.cfg=RQ.emphasis.conOpt=RQ.blur.cfg=RQ.blur.conOpt=RQ.select.cfg=RQ.select.conOpt=null,RQ.isLegacy=!1,function(e,t,n,i,r,o){if(!e.isGroup){Ee(n,null,o),Ee(n,RG,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var c=e.getTextContent();if(!1===a)c&&e.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},c?c.clearStates():(c=R5(a),e.setTextContent(c)),R3(null,c,t,a,null,i,r);for(var h=a&&a.style,d=0;d<RY.length;d++){var f=RY[d];if(f!==R$){var p=o[f].conOpt;R4(f,c,p,En(a,p,f),null)}}h?c.dirty():c.markRedraw()}}}}(c,n,i,r,u,RQ),function(e,t,n,i,r){var o=n.clipPath;if(!1===o)e&&e.getClipPath()&&e.removeClipPath();else if(o){var a=e.getClipPath();a&&R7(a,o,i)&&(a=null),a||(a=R5(o),e.setClipPath(a)),R3(null,a,t,o,null,i,r)}}(c,n,i,r,u),R3(e,c,n,i,RQ,r,u),vp(i,"info")&&(Rw(c).info=i.info);for(var h=0;h<RY.length;h++){var d=RY[h];if(d!==R$){var f=Et(i,d),p=En(i,f,d);R4(d,c,f,p,RQ)}}var g=c;if(!g.isGroup){var m=r.currentZ,v=r.currentZLevel;g.z=m,g.zlevel=v;var y=i.z2;null!=y&&(g.z2=y||0);for(var x=0;x<RY.length;x++)!function(e,t,n){var i=n===R$,r=i?t:Et(t,n),o=r?r.z2:null;null!=o&&((i?e:e.ensureState(n)).z2=o||0)}(g,i,RY[x])}return"group"===i.type&&function(e,t,n,i,r){var o=i.children,a=o?o.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(a||l||u){if(l){return new Mx((p={api:e,oldChildren:t.children()||[],newChildren:o||[],dataIndex:n,seriesModel:r,group:t}).oldChildren,p.newChildren,Ei,Ei,p).add(Er).update(Er).remove(Eo).execute()}u&&t.removeAll();for(var c=0;c<a;c++){var h=o[c],d=t.childAt(c);h?(null==h.ignore&&(h.ignore=!1),R9(e,d,n,h,r,t)):d.ignore=!0}for(var f=t.childCount()-1;f>=c;f--){var p,g,m,v,y=t.childAt(f);g=t,m=y,v=r,m&&RL(m,Rw(g).option,v)}}}(e,c,n,i,r),s>=0?o.replaceAt(c,s):o.add(c),c}function R7(e,t,n){var i,r=Rw(e),o=t.type,a=t.shape,s=t.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==r.customGraphicType||"path"===o&&(i=a)&&(vp(i,"pathData")||vp(i,"d"))&&Ea(a)!==r.customPathData||"image"===o&&vp(s,"image")&&s.image!==r.customImagePath}function Ee(e,t,n){var i,r,o=t?Et(e,t):e,a=t?En(e,o,RG):e.style,s=e.type,l=o?o.textConfig:null,u=e.textContent,c=u?t?Et(u,t):u:null;if(a&&(n.isLegacy||(i=!!l,r=!!c,a&&(a.legacy||!1!==a.legacy&&!i&&!r&&"tspan"!==s&&("text"===s||vp(a,"text")))))){n.isLegacy=!0;var h=function(e,t,n){var i,r,o;if("text"===t)o=e;else{o={},vp(e,"text")&&(o.text=e.text),vp(e,"rich")&&(o.rich=e.rich),vp(e,"textFill")&&(o.fill=e.textFill),vp(e,"textStroke")&&(o.stroke=e.textStroke),vp(e,"fontFamily")&&(o.fontFamily=e.fontFamily),vp(e,"fontSize")&&(o.fontSize=e.fontSize),vp(e,"fontStyle")&&(o.fontStyle=e.fontStyle),vp(e,"fontWeight")&&(o.fontWeight=e.fontWeight),r={type:"text",style:o,silent:!0},i={};var a=vp(e,"textPosition");n?i.position=a?e.textPosition:"inside":a&&(i.position=e.textPosition),vp(e,"textPosition")&&(i.position=e.textPosition),vp(e,"textOffset")&&(i.offset=e.textOffset),vp(e,"textRotation")&&(i.rotation=e.textRotation),vp(e,"textDistance")&&(i.distance=e.textDistance)}return Rk(o,e),mq(o.rich,function(e){Rk(e,e)}),{textConfig:i,textContent:r}}(a,s,!t);!l&&h.textConfig&&(l=h.textConfig),!c&&h.textContent&&(c=h.textContent)}if(!t&&c){var d=c;d.type||(d.type="text")}var f=t?n[t]:n.normal;f.cfg=l,f.conOpt=c}function Et(e,t){return t?e?e[t]:null:e}function En(e,t,n){var i=t&&t.style;return null==i&&n===RG&&e&&(i=e.styleEmphasis),i}function Ei(e,t){var n=e&&e.name;return null!=n?n:"e\0\0"+t}function Er(e,t){var n=this.context,i=null!=e?n.newChildren[e]:null,r=null!=t?n.oldChildren[t]:null;R9(n.api,r,n.dataIndex,i,n.seriesModel,n.group)}function Eo(e){var t=this.context,n=t.oldChildren[e];n&&RL(n,Rw(n).option,t.seriesModel)}function Ea(e){return e&&(e.pathData||e.d)}var Es=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=mA.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,i,r,o){var a=this._getBrush(),s=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),u=this.pointSize+this.blurSize,c=this.canvas,h=c.getContext("2d"),d=e.length;c.width=t,c.height=n;for(var f=0;f<d;++f){var p=e[f],g=p[0],m=p[1],v=i(p[2]);h.globalAlpha=v,h.drawImage(a,g-u,m-u)}if(!c.width||!c.height)return c;for(var y=h.getImageData(0,0,c.width,c.height),x=y.data,b=0,w=x.length,S=this.minOpacity,_=this.maxOpacity-S;b<w;){var v=x[b+3]/256,C=4*Math.floor(255*v);if(v>0){var M=o(v)?s:l;v>0&&(v=v*_+S),x[b++]=M[C],x[b++]=M[C+1],x[b++]=M[C+2],x[b++]=M[C+3]*v*256}else b+=4}return h.putImageData(y,0,0),c},e.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=mA.createCanvas()),t=this.pointSize+this.blurSize,n=2*t;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,a=0;a<256;a++)e[t](a/255,!0,r),i[o++]=r[0],i[o++]=r[1],i[o++]=r[2],i[o++]=r[3];return i},e}();function El(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}var Eu=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(e,t,n){t.eachComponent("visualMap",function(t){t.eachTargetSeries(function(n){n===e&&(i=t)})}),this._progressiveEls=null,this.group.removeAll();var i,r=e.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):El(r)&&this._renderOnGeo(r,e,i,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,i){var r=t.coordinateSystem;r&&(El(r)?this.render(t,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,i,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){kl(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,i,r){var o,a,s,l,u=e.coordinateSystem,c=kT(u,"cartesian2d");if(c){var h=u.getAxis("x"),d=u.getAxis("y");o=h.getBandWidth()+.5,a=d.getBandWidth()+.5,s=h.scale.getExtent(),l=d.scale.getExtent()}for(var f=this.group,p=e.getData(),g=e.getModel(["emphasis","itemStyle"]).getItemStyle(),m=e.getModel(["blur","itemStyle"]).getItemStyle(),v=e.getModel(["select","itemStyle"]).getItemStyle(),y=e.get(["itemStyle","borderRadius"]),x=S7(e),b=e.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),_=b.get("disabled"),C=c?[p.mapDimension("x"),p.mapDimension("y"),p.mapDimension("value")]:[p.mapDimension("time"),p.mapDimension("value")],M=n;M<i;M++){var A=void 0,k=p.getItemVisual(M,"style");if(c){var T=p.get(C[0],M),I=p.get(C[1],M);if(isNaN(p.get(C[2],M))||isNaN(T)||isNaN(I)||T<s[0]||T>s[1]||I<l[0]||I>l[1])continue;var D=u.dataToPoint([T,I]);A=new w0({shape:{x:D[0]-o/2,y:D[1]-a/2,width:o,height:a},style:k})}else{if(isNaN(p.get(C[1],M)))continue;A=new w0({z2:1,shape:u.dataToRect([p.get(C[0],M)]).contentShape,style:k})}if(p.hasItemOption){var O=p.getItemModel(M),P=O.getModel("emphasis");g=P.getModel("itemStyle").getItemStyle(),m=O.getModel(["blur","itemStyle"]).getItemStyle(),v=O.getModel(["select","itemStyle"]).getItemStyle(),y=O.get(["itemStyle","borderRadius"]),w=P.get("focus"),S=P.get("blurScope"),_=P.get("disabled"),x=S7(O)}A.shape.r=y;var R=e.getRawValue(M),E="-";R&&null!=R[2]&&(E=R[2]+""),S9(A,x,{labelFetcher:e,labelDataIndex:M,defaultOpacity:k.opacity,defaultText:E}),A.ensureState("emphasis").style=g,A.ensureState("blur").style=m,A.ensureState("select").style=v,Sj(A,w,S,_),A.incremental=r,r&&(A.states.emphasis.hoverLayer=!0),f.add(A),p.setItemGraphicEl(M,A),this._progressiveEls&&this._progressiveEls.push(A)}},t.prototype._renderOnGeo=function(e,t,n,i){var r,o,a,s,l,u,c,h=n.targetVisuals.inRange,d=n.targetVisuals.outOfRange,f=t.getData(),p=this._hmLayer||this._hmLayer||new Es;p.blurSize=t.get("blurSize"),p.pointSize=t.get("pointSize"),p.minOpacity=t.get("minOpacity"),p.maxOpacity=t.get("maxOpacity");var g=e.getViewRect().clone(),m=e.getRoamTransform();g.applyTransform(m);var v=Math.max(g.x,0),y=Math.max(g.y,0),x=Math.min(g.width+g.x,i.getWidth()),b=Math.min(g.height+g.y,i.getHeight()),w=x-v,S=b-y,_=[f.mapDimension("lng"),f.mapDimension("lat"),f.mapDimension("value")],C=f.mapArray(_,function(t,n,i){var r=e.dataToPoint([t,n]);return r[0]-=v,r[1]-=y,r.push(i),r}),M=n.getExtent(),A="visualMap.continuous"===n.type?(r=n.option.range,o=M[1]-M[0],r=[(r[0]-M[0])/o,(r[1]-M[0])/o],function(e){return e>=r[0]&&e<=r[1]}):(a=n.getPieceList(),s=n.option.selected,l=M[1]-M[0],u=(a=mY(a,function(e){return{interval:[(e.interval[0]-M[0])/l,(e.interval[1]-M[0])/l]}})).length,c=0,function(e){var t;for(t=c;t<u;t++){var n=a[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}if(t===u)for(t=c-1;t>=0;t--){var n=a[t].interval;if(n[0]<=e&&e<=n[1]){c=t;break}}return t>=0&&t<u&&s[t]});p.update(C,w,S,h.color.getNormalizer(),{inRange:h.color.getColorMapper(),outOfRange:d.color.getColorMapper()},A);var k=new wU({style:{width:w,height:S,x:v,y:y,image:p.canvas},silent:!0});this.group.add(k)},t.type="heatmap",t}(kS),Ec=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.getInitialData=function(e,t){return ME(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var e=MD.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},t.type="series.heatmap",t.dependencies=["grid","geo","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},t}(Mu),Eh=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return yz(t,e),t.prototype.init=function(t,n,i){e.prototype.init.call(this,t,n,i),this._sourceManager=new C0(this),C1(this)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),C1(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:v7},t}(Cf),Ed=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataset",t}return yz(t,e),t.type="dataset",t}(Dp),Ef=["x","y","radius","angle","single"],Ep=["cartesian2d","polar","singleAxis"];function Eg(e){return e+"Axis"}function Em(e){var t=e.ecModel,n={infoList:[],infoMap:vh()};return e.eachTargetAxis(function(e,i){var r=t.getComponent(Eg(e),i);if(r){var o=r.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(r)}}}),n}var Ev=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),Ey=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return yz(t,e),t.prototype.init=function(e,t,n){var i=Ex(e);this.settledOption=i,this.mergeDefaultAndTheme(e,n),this._doInit(i)},t.prototype.mergeOption=function(e){var t=Ex(e);mj(this.option,e,!0),mj(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;mq([["start","startValue"],["end","endValue"]],function(e,i){"value"===this._rangePropMode[i]&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get("orient",!0),t=this._targetAxisInfoMap=vh();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||"horizontal",this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return mq(Ef,function(n){var i=this.getReferringComponents(Eg(n),vQ);if(i.specified){t=!0;var r=new Ev;mq(i.models,function(e){r.add(e.componentIndex)}),e.set(n,r)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,i=!0,r="vertical"===t?"y":"x",o=n.findComponents({mainType:r+"Axis"});if(a(o,r),i){var o=n.findComponents({mainType:"singleAxis",filter:function(e){return e.get("orient",!0)===t}});a(o,"single")}function a(t,n){var r=t[0];if(r){var o=new Ev;if(o.add(r.componentIndex),e.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",vK).models[0];a&&mq(t,function(e){r.componentIndex!==e.componentIndex&&a===e.getReferringComponents("grid",vK).models[0]&&o.add(e.componentIndex)})}}}i&&mq(Ef,function(t){if(i){var r=n.findComponents({mainType:Eg(t),filter:function(e){return"category"===e.get("type",!0)}});if(r[0]){var o=new Ev;o.add(r[0].componentIndex),e.set(t,o),i=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){e||(e=t)},this),"y"===e?"vertical":"horizontal"},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get("rangeMode");mq([["start","startValue"],["end","endValue"]],function(i,r){var o=null!=e[i[0]],a=null!=e[i[1]];o&&!a?t[r]="percent":!o&&a?t[r]="value":n?t[r]=n[r]:o&&(t[r]="percent")})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){null==e&&(e=this.ecModel.getComponent(Eg(t),n))},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,i){mq(n.indexList,function(n){e.call(t,i,n)})})},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(Eg(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;mq([["start","startValue"],["end","endValue"]],function(i){(null!=e[i[0]]||null!=e[i[1]])&&(t[i[0]]=n[i[0]]=e[i[0]],t[i[1]]=n[i[1]]=e[i[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;mq(["start","startValue","end","endValue"],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),i=0;i<n.length;i++)for(var r=n[i],o=this._targetAxisInfoMap.get(r),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(r,o.indexList[a]);if(s.hostedBy(this))return s;t||(t=s)}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return this._orient},t.type="dataZoom",t.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],t.defaultOption={z:4,filterMode:"filter",start:0,end:100},t}(Cf);function Ex(e){var t={};return mq(["start","end","startValue","endValue","throttle"],function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}var Eb=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.type="dataZoom.inside",t.defaultOption=_S(Ey.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(Ey),Ew=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(e,t,n,i){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type="dataZoom",t}(Dp);function ES(e,t,n,i,r,o){e=e||0;var a,s=n[1]-n[0];if(null!=r&&(r=EC(r,[0,s])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var l=Math.abs(t[1]-t[0]);l=EC(l,[0,s]),r=o=EC(l,[r,o]),i=0}t[0]=EC(t[0],n),t[1]=EC(t[1],n);var u=E_(t,i);t[i]+=e;var c=r||0,h=n.slice();return u.sign<0?h[0]+=c:h[1]-=c,t[i]=EC(t[i],h),a=E_(t,i),null!=r&&(a.sign!==u.sign||a.span<r)&&(t[1-i]=t[i]+u.sign*r),a=E_(t,i),null!=o&&a.span>o&&(t[1-i]=t[i]+a.sign*o),t}function E_(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function EC(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var EM="\0_ec_interaction_mutex";function EA(e){return e[EM]||(e[EM]={})}OH({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},vg);var Ek=function(e){function t(t){var n=e.call(this)||this;n._zr=t;var i=mQ(n._mousedownHandler,n),r=mQ(n._mousemoveHandler,n),o=mQ(n._mouseupHandler,n),a=mQ(n._mousewheelHandler,n),s=mQ(n._pinchHandler,n);return n.enable=function(e,n){this.disable(),this._opt=mW(mV(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),(!0===e||"move"===e||"pan"===e)&&(t.on("mousedown",i),t.on("mousemove",r),t.on("mouseup",o)),(!0===e||"scale"===e||"zoom"===e)&&(t.on("mousewheel",a),t.on("pinch",s))},n.disable=function(){t.off("mousedown",i),t.off("mousemove",r),t.off("mouseup",o),t.off("mousewheel",a),t.off("pinch",s)},n}return yz(t,e),t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype.setPointerChecker=function(e){this.pointerChecker=e},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!Ir(e)){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,n,i)&&(this._x=n,this._y=i,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){if(!(!this._dragging||!ED("moveOnMouseMove",e,this._opt)||"pinch"===e.gestureEvent||EA(this._zr).globalPan)){var t=e.offsetX,n=e.offsetY,i=this._x,r=this._y;this._x=t,this._y=n,this._opt.preventDefaultMouseMove&&Ii(e.event),EI(this,"pan","moveOnMouseMove",e,{dx:t-i,dy:n-r,oldX:i,oldY:r,newX:t,newY:n,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){Ir(e)||(this._dragging=!1)},t.prototype._mousewheelHandler=function(e){var t=ED("zoomOnMouseWheel",e,this._opt),n=ED("moveOnMouseWheel",e,this._opt),i=e.wheelDelta,r=Math.abs(i),o=e.offsetX,a=e.offsetY;if(0!==i&&(t||n)){if(t){var s=r>3?1.4:r>1?1.2:1.1;ET(this,"zoom","zoomOnMouseWheel",e,{scale:i>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);ET(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){if(!EA(this._zr).globalPan){var t=e.pinchScale>1?1.1:1/1.1;ET(this,"zoom",null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t}(bz);function ET(e,t,n,i,r){e.pointerChecker&&e.pointerChecker(i,r.originX,r.originY)&&(Ii(i.event),EI(e,t,n,i,r))}function EI(e,t,n,i,r){r.isAvailableBehavior=mQ(ED,null,n,i),e.trigger(t,r)}function ED(e,t,n){var i=n[e];return!e||i&&(!m2(i)||t.event[i+"Key"])}var EO=vq();function EP(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function ER(e,t){e.isDisposed()||e.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:t})}function EE(e,t,n,i){return e.coordinateSystem.containPoint([n,i])}var EL=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return yz(t,e),t.prototype.render=function(t,n,i){var r;(e.prototype.render.apply(this,arguments),t.noTarget())?this._clear():(this.range=t.getPercentRange(),r={pan:mQ(EN.pan,this),zoom:mQ(EN.zoom,this),scrollMove:mQ(EN.scrollMove,this)},EO(i).coordSysRecordMap.each(function(e){var n=e.dataZoomInfoMap.get(t.uid);n&&(n.getRange=r)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){!function(e,t){for(var n=EO(e).coordSysRecordMap,i=n.keys(),r=0;r<i.length;r++){var o=i[r],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=t.uid;s.get(l)&&(s.removeKey(l),s.keys().length||EP(n,a))}}}(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(Ew),EN={zoom:function(e,t,n,i){var r=this.range,o=r.slice(),a=e.axisModels[0];if(a){var s=EF[t](null,[i.originX,i.originY],a,n,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/i.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(ES(0,o,[0,100],0,c.minSpan,c.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1])return o}},pan:EB(function(e,t,n,i,r,o){var a=EF[i]([o.oldX,o.oldY],[o.newX,o.newY],t,r,n);return a.signal*(e[1]-e[0])*a.pixel/a.pixelLength}),scrollMove:EB(function(e,t,n,i,r,o){return EF[i]([0,0],[o.scrollDelta,o.scrollDelta],t,r,n).signal*(e[1]-e[0])*o.scrollDelta})};function EB(e){return function(t,n,i,r){var o=this.range,a=o.slice(),s=t.axisModels[0];if(s&&(ES(e(a,s,t,n,i,r),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]))return a}}var EF={grid:function(e,t,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return e=e||[0,0],"x"===o.dim?(a.pixel=t[0]-e[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(e,t,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===n.mainType?(a.pixel=t[0]-e[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=t[1]-e[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(e,t,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===o.orient?(s.pixel=t[0]-e[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}},Ez=function(){function e(e,t,n,i){this._dimName=e,this._axisIndex=t,this.ecModel=i,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},e.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(mG(Ep,t.get("coordinateSystem"))>=0){var n=Eg(this._dimName),i=t.getReferringComponents(n,vK).models[0];i&&this._axisIndex===i.componentIndex&&e.push(t)}},this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},e.prototype.getMinMaxSpan=function(){return mV(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t,n=this._dataExtent,i=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];mq(["start","end"],function(l,u){var c=e[l],h=e[l+"Value"];"percent"===r[u]?(null==c&&(c=o[u]),h=i.parse(vv(c,o,n))):(t=!0,c=vv(h=null==h?n[u]:i.parse(h),n,o)),s[u]=null==h||isNaN(h)?n[u]:h,a[u]=null==c||isNaN(c)?o[u]:c}),vb(s),vb(a);var l=this._minMaxSpan;function u(e,t,n,r,o){var a=o?"Span":"ValueSpan";ES(0,e,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)t[s]=vv(e[s],n,r,!0),o&&(t[s]=i.parse(t[s]))}return t?u(s,a,n,o,!1):u(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},e.prototype.reset=function(e){if(e===this._dataZoomModel){var t,n,i,r,o,a=this.getTargetSeriesModels();this._dataExtent=(t=this,n=this._dimName,i=[1/0,-1/0],mq(a,function(e){var t;t=e.getData(),t&&mq(PB(t,n),function(e){var n=t.getApproximateExtent(e);n[0]<i[0]&&(i[0]=n[0]),n[1]>i[1]&&(i[1]=n[1])})}),[(o=PI((r=t.getAxisModel()).axis.scale,r,i).calculate()).min,o.max]),this._updateMinMaxSpan();var s=this.calculateDataWindow(e.settledOption);this._valueWindow=s.valueWindow,this._percentWindow=s.percentWindow,this._setAxisModel()}},e.prototype.filterData=function(e,t){if(e===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),r=e.get("filterMode"),o=this._valueWindow;"none"!==r&&mq(i,function(e){var t=e.getData(),i=t.mapDimensionsAll(n);if(i.length){if("weakFilter"===r){var a=t.getStore(),s=mY(i,function(e){return t.getDimensionIndex(e)},t);t.filterSelf(function(e){for(var t,n,r,l=0;l<i.length;l++){var u=a.get(s[l],e),c=!isNaN(u),h=u<o[0],d=u>o[1];if(c&&!h&&!d)return!0;c&&(r=!0),h&&(t=!0),d&&(n=!0)}return r&&t&&n})}else mq(i,function(n){if("empty"===r)e.setData(t=t.map(n,function(e){var t;return(t=e)>=o[0]&&t<=o[1]?e:NaN}));else{var i={};i[n]=o,t.selectRange(i)}});mq(i,function(e){t.setApproximateExtent(o,e)})}})}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;mq(["min","max"],function(i){var r=t.get(i+"Span"),o=t.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=vv(n[0]+o,n,[0,100],!0):null!=r&&(o=vv(r,[0,100],n,!0)-n[0]),e[i+"Span"]=r,e[i+"ValueSpan"]=o},this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=vS(n,[0,500]);i=Math.min(i,20);var r=e.axis.scale.rawExtentInfo;0!==t[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==t[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},e}();let EV={getTargetSeries:function(e){function t(t){e.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,r){var o=e.getComponent(Eg(i),r);t(i,r,o,n)})})}t(function(e,t,n,i){n.__dzAxisProxy=null});var n=[];t(function(t,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new Ez(t,i,o,e),n.push(r.__dzAxisProxy))});var i=vh();return mq(n,function(e){mq(e.getTargetSeriesModels(),function(e){i.set(e.uid,e)})}),i},overallReset:function(e,t){e.eachComponent("dataZoom",function(e){e.eachTargetAxis(function(t,n){e.getAxisProxy(t,n).reset(e)}),e.eachTargetAxis(function(n,i){e.getAxisProxy(n,i).filterData(e,t)})}),e.eachComponent("dataZoom",function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),i=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var Ej=!1;function EH(e){Ej||(Ej=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,EV),e.registerAction("dataZoom",function(e,t){mq(function(e,t){var n,i=vh(),r=[],o=vh();e.eachComponent({mainType:"dataZoom",query:t},function(e){o.get(e.uid)||s(e)});do n=!1,e.eachComponent("dataZoom",a);while(n);function a(e){var t;!o.get(e.uid)&&(t=!1,e.eachTargetAxis(function(e,n){var r=i.get(e);r&&r[n]&&(t=!0)}),t)&&(s(e),n=!0)}function s(e){o.set(e.uid,!0),r.push(e),e.eachTargetAxis(function(e,t){(i.get(e)||i.set(e,[]))[t]=!0})}return r}(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})}),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function EW(e){EH(e),e.registerComponentModel(Eb),e.registerComponentView(EL),e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=EO(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=vh());i.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(e){mq(Em(e).infoList,function(n){var r,o,a,s=n.model.uid,l=i.get(s)||i.set(s,(a=(o={model:r=n.model,containsPoint:mJ(EE,r),dispatchAction:mJ(ER,t),dataZoomInfoMap:null,controller:null}).controller=new Ek(t.getZr()),mq(["pan","zoom","scrollMove"],function(e){a.on(e,function(t){var n=[];o.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var r=(i.getRange||{})[e],a=r&&r(i.dzReferCoordSysInfo,o.model.mainType,o.controller,t);!i.model.get("disabled",!0)&&a&&n.push({dataZoomId:i.model.id,start:a[0],end:a[1]})}}),n.length&&o.dispatchAction(n)})}),o));(l.dataZoomInfoMap||(l.dataZoomInfoMap=vh())).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),i.each(function(e){var t,n,r,o,a,s=e.controller,l=e.dataZoomInfoMap;if(l){var u=l.keys()[0];null!=u&&(a=l.get(u))}if(!a)return void EP(i,e);var c=(n="type_",r={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0,l.each(function(e){var i=e.model,a=!i.get("disabled",!0)&&(!i.get("zoomLock",!0)||"move");r[n+a]>r[n+t]&&(t=a),o=o&&i.get("preventDefaultMouseMove",!0)}),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o}});s.enable(c.controlType,c.opt),s.setPointerChecker(e.containsPoint),kf(e,"dispatchAction",a.model.get("throttle",!0),"fixRate")})})}var EG=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.type="dataZoom.slider",t.layoutMode="box",t.defaultOption=_S(Ey.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),t}(Ey),E$="horizontal",EU="vertical",Eq=["line","bar","candlestick","scatter"],EY={easing:"cubicOut",duration:100,delay:0},EZ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return yz(t,e),t.prototype.init=function(e,t){this.api=t,this._onBrush=mQ(this._onBrush,this),this._onBrushEnd=mQ(this._onBrushEnd,this)},t.prototype.render=function(t,n,i,r){if(e.prototype.render.apply(this,arguments),kf(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),!1===t.get("show"))return void this.group.removeAll();if(t.noTarget()){this._clear(),this.group.removeAll();return}r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){kp(this,"_dispatchZoomAction");var e=this.api.getZr();e.off("mousemove",this._onBrush),e.off("mouseup",this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new MF;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get("brushSelect"),i=this._findCoordRect(),r={width:t.getWidth(),height:t.getHeight()},o=this._orient===E$?{right:r.width-i.x-i.width,top:r.height-30-7-7*!!n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=Ch(e.option);mq(["right","top","width","height"],function(e){"ph"===a[e]&&(a[e]=o[e])});var s=Cs(a,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===EU&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==E$||r?n===E$&&r?{scaleY:a?1:-1,scaleX:-1}:n!==EU||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=e.getBoundingRect([o]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,i=e.get("brushSelect");n.add(new w0({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40}));var r=new w0({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:mQ(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],e){var t=this._size,n=this._shadowSize||[],i=e.series,r=i.getRawData(),o=i.getShadowDim&&i.getShadowDim(),a=o&&r.getDimensionInfo(o)?i.getShadowDim():e.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var u,c=r.getDataExtent(a),h=(c[1]-c[0])*.3;c=[c[0]-h,c[1]+h];var d=[0,t[1]],f=[0,t[0]],p=[[t[0],0],[0,0]],g=[],m=f[1]/(r.count()-1),v=0,y=Math.round(r.count()/t[0]);r.each([a],function(e,t){if(y>0&&t%y){v+=m;return}var n=null==e||isNaN(e)||""===e,i=n?0:vv(e,c,d,!0);n&&!u&&t?(p.push([p[p.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&u&&(p.push([v,0]),g.push([v,0])),p.push([v,i]),g.push([v,i]),v+=m,u=n}),s=this._shadowPolygonPts=p,l=this._shadowPolylinePts=g}this._shadowData=r,this._shadowDim=a,this._shadowSize=[t[0],t[1]];for(var x=this.dataZoomModel,b=0;b<3;b++){var w=function(e){var t=x.getModel(e?"selectedDataBackground":"dataBackground"),n=new MF,i=new Ay({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new Aw({shape:{points:l},segmentIgnoreThreshold:1,style:t.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}(1===b);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}}}},t.prototype._prepareDataShadowInfo=function(){var e,t=this.dataZoomModel,n=t.get("showDataShadow");if(!1!==n){var i=this.ecModel;return t.eachTargetAxis(function(r,o){mq(t.getAxisProxy(r,o).getTargetSeriesModels(),function(t){if(!e&&!(!0!==n&&0>mG(Eq,t.get("type")))){var a,s=i.getComponent(Eg(r),o).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r],u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),e={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}},this)},this),e}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],i=t.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),c=t.filler=new w0({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(c),r.add(new w0({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),mq([0,1],function(t){var o=a.get("handleIcon");!k5[o]&&0>o.indexOf("path://")&&0>o.indexOf("image://")&&(o="path://"+o);var s=k6(o,-1,0,2,2,null,!0);s.attr({cursor:EX(this._orient),draggable:!0,drift:mQ(this._onDragMove,this,t),ondragend:mQ(this._onDragEnd,this),onmouseover:mQ(this._showDataInfo,this,!0),onmouseout:mQ(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),u=a.get("handleSize");this._handleHeight=vy(u,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),SV(s);var c=a.get("handleColor");null!=c&&(s.style.fill=c),r.add(n[t]=s);var h=a.getModel("textStyle");e.add(i[t]=new Sr({silent:!0,invisible:!0,style:_e(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))},this);var h=c;if(u){var d=vy(a.get("moveHandleSize"),o[1]),f=t.moveHandle=new w0({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),p=.8*d,g=t.moveHandleIcon=k6(a.get("moveHandleIcon"),-p/2,-p/2,p,p,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,f.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(h=t.moveZone=new w0({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",function(){s.enterEmphasis(f)}).on("mouseout",function(){s.leaveEmphasis(f)}),r.add(f),r.add(g),r.add(h)}h.attr({draggable:!0,cursor:EX(this._orient),drift:mQ(this._onDragMove,this,"all"),ondragstart:mQ(this._showDataInfo,this,!0),ondragend:mQ(this._onDragEnd,this),onmouseover:mQ(this._showDataInfo,this,!0),onmouseout:mQ(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[vv(e[0],[0,100],t,!0),vv(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];ES(t,i,r,n.get("zoomLock")?"all":e,null!=o.minSpan?vv(o.minSpan,a,r,!0):null,null!=o.maxSpan?vv(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=vb([vv(i[0],r,a,!0),vv(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,i=vb(n.slice()),r=this._size;mq([0,1],function(e){var i=t.handles[e],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[e]+(e?-1:1),y:r[1]/2-o/2})},this),t.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};t.moveHandle&&(t.moveHandle.setShape(o),t.moveZone.setShape(o),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=t.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;l<a.length;l++){var u=a[l],c=u.getClipPath();c||(c=new w0,u.setClipPath(c)),c.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:r[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,i=n.handleLabels,r=this._orient,o=["",""];if(t.get("showDetail")){var a=t.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,u=e?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();o=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var c=vb(this._handleEnds.slice());function h(e){var t=A8(n.handles[e].parent,this.group),a=A7(0===e?"right":"left",t),s=this._handleWidth/2+5,l=A9([c[e]+(0===e?-s:s),this._size[1]/2],t);i[e].setStyle({x:l[0],y:l[1],verticalAlign:r===E$?"middle":a,align:r===E$?a:"center",text:o[e]})}h.call(this,0),h.call(this,1)},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,i=n.get("labelFormatter"),r=n.get("labelPrecision");(null==r||"auto"===r)&&(r=t.getPixelPrecision());var o=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(r,20));return m1(i)?i(e,o):m2(i)?i.replace("{value}",o):o},t.prototype._showDataInfo=function(e){e=this._dragging||e;var t=this._displayables,n=t.handleLabels;n[0].attr("invisible",!e),n[1].attr("invisible",!e),t.moveHandle&&this.api[e?"enterEmphasis":"leaveEmphasis"](t.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,i){this._dragging=!0,Ii(i.event);var r=A9([t,n],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(e,r[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),this.dataZoomModel.get("realtime")||this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0)&&!(n[0]>t[0])&&!(n[1]<0)&&!(n[1]>t[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new xi(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr("ignore",!0);var n=t.shape;if(!(new Date-this._brushStartTime<200&&5>Math.abs(n.width))){var i=this._getViewExtent(),r=[0,100];this._range=vb([vv(n.x,i,r,!0),vv(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(Ii(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new w0({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(e,t),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?EY:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=Em(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var i=this.api.getWidth(),r=this.api.getHeight();e={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return e},t.type="dataZoom.slider",t}(Ew);function EX(e){return"vertical"===e?"ns-resize":"ew-resize"}function EK(e){e.registerComponentModel(EG),e.registerComponentView(EZ),EH(e)}var EQ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return yz(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;!0===t&&(t=e.selector=["all","inverse"]),m0(t)&&mq(t,function(e,i){var r;m2(e)&&(e={type:e}),t[i]=mj(e,"all"===(r=e.type)?{type:"all",title:n.getLocaleModel().get(["legend","selector","all"])}:"inverse"===r?{type:"inverse",title:n.getLocaleModel().get(["legend","selector","inverse"])}:void 0)})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,n=0;n<e.length;n++){var i=e[n].get("name");if(this.isSelected(i)){this.select(i),t=!0;break}}t||this.select(e[0].get("name"))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(i){var r,o=i.name;if(n.push(o),i.legendVisualProvider){var a=i.legendVisualProvider.getAllNames();e.isSeriesFiltered(i)||(n=n.concat(a)),a.length?t=t.concat(a):r=!0}else r=!0;r&&vG(i)&&t.push(i.name)}),this._availableNames=n;var i=this.get("data")||t,r=vh(),o=mY(i,function(e){return((m2(e)||m3(e))&&(e={name:e}),r.get(e.name))?null:(r.set(e.name,!0),new _x(e,this,this.ecModel))},this);this._data=mX(o,function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;"single"===this.get("selectedMode")&&mq(this._data,function(e){t[e.get("name")]=!1}),t[e]=!0},t.prototype.unSelect=function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;mq(e,function(e){t[e.get("name",!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;mq(e,function(e){var n=e.get("name",!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&mG(this._availableNames,e)>=0},t.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(Cf);function EJ(e,t){var n=vr(t.get("padding")),i=t.getItemStyle(["color","opacity"]);return i.fill=t.get("backgroundColor"),e=new w0({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get("borderRadius")},style:i,silent:!0,z2:-1})}var E0=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return yz(t,e),t.prototype.init=function(){this.group.add(this._contentGroup=new MF),this.group.add(this._selectorGroup=new MF),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var r=e.get("align"),o=e.get("orient");r&&"auto"!==r||(r="right"===e.get("left")&&"vertical"===o?"right":"left");var a=e.get("selector",!0),s=e.get("selectorPosition",!0);a&&(!s||"auto"===s)&&(s="horizontal"===o?"end":"start"),this.renderInner(r,e,t,n,a,o,s);var l=e.getBoxLayoutParams(),u={width:n.getWidth(),height:n.getHeight()},c=e.get("padding"),h=Cs(l,u,c),d=this.layoutInner(e,r,h,i,a,s),f=Cs(mW({width:d.width,height:d.height},l),u,c);this.group.x=f.x-d.x,this.group.y=f.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=EJ(d,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,i,r,o,a){var s=this.getContentGroup(),l=vh(),u=t.get("selectedMode"),c=[];n.eachRawSeries(function(e){e.get("legendHoverLink")||c.push(e.id)}),mq(t.getData(),function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new MF;h.newline=!0,s.add(h);return}var d=n.getSeriesByName(a)[0];if(!l.get(a))if(d){var f=d.getData(),p=f.getVisual("legendLineStyle")||{},g=f.getVisual("legendIcon"),m=f.getVisual("style"),v=this._createItem(d,a,o,r,t,e,p,m,g,u,i);v.on("click",mJ(E1,a,null,i,c)).on("mouseover",mJ(E5,d.name,null,i,c)).on("mouseout",mJ(E3,d.name,null,i,c)),n.ssr&&v.eachChild(function(e){var t=So(e);t.seriesIndex=d.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(a,!0)}else n.eachRawSeries(function(s){if(!l.get(a)&&s.legendVisualProvider){var h=s.legendVisualProvider;if(h.containName(a)){var d=h.indexOfName(a),f=h.getItemVisual(d,"style"),p=h.getItemVisual(d,"legendIcon"),g=by(f.fill);g&&0===g[3]&&(g[3]=.2,f=mH(mH({},f),{fill:bC(g,"rgba")}));var m=this._createItem(s,a,o,r,t,e,{},f,p,u,i);m.on("click",mJ(E1,null,a,i,c)).on("mouseover",mJ(E5,null,a,i,c)).on("mouseout",mJ(E3,null,a,i,c)),n.ssr&&m.eachChild(function(e){var t=So(e);t.seriesIndex=s.seriesIndex,t.dataIndex=o,t.ssrType="legend"}),l.set(a,!0)}}},this)},this),r&&this._createSelector(r,t,i,o,a)},t.prototype._createSelector=function(e,t,n,i,r){var o=this.getSelectorGroup();mq(e,function(e){var i=e.type,r=new Sr({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect"})}});o.add(r),S9(r,{normal:t.getModel("selectorLabel"),emphasis:t.getModel(["emphasis","selectorLabel"])},{defaultText:e.title}),SV(r)})},t.prototype._createItem=function(e,t,n,i,r,o,a,s,l,u,c){var h=e.visualDrawType,d=r.get("itemWidth"),f=r.get("itemHeight"),p=r.isSelected(t),g=i.get("symbolRotate"),m=i.get("symbolKeepAspect"),v=i.get("icon"),y=function(e,t,n,i,r,o,a){function s(e,t){"auto"===e.lineWidth&&(e.lineWidth=2*(t.lineWidth>0)),mq(e,function(n,i){"inherit"===e[i]&&(e[i]=t[i])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=0===e.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");u.decal=h&&"inherit"!==h?Oc(h,a):i.decal,"inherit"===u.fill&&(u.fill=i[r]),"inherit"===u.stroke&&(u.stroke=i[c]),"inherit"===u.opacity&&(u.opacity=("fill"===r?i:n).opacity),s(u,i);var d=t.getModel("lineStyle"),f=d.getLineStyle();if(s(f,n),"auto"===u.fill&&(u.fill=i.fill),"auto"===u.stroke&&(u.stroke=i.fill),"auto"===f.stroke&&(f.stroke=i.fill),!o){var p=t.get("inactiveBorderWidth"),g=u[c];u.lineWidth="auto"===p?i.lineWidth>0&&g?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),f.stroke=d.get("inactiveColor"),f.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:f}}(l=v||l||"roundRect",i,a,s,h,p,c),x=new MF,b=i.getModel("textStyle");if(m1(e.getLegendIcon)&&(!v||"inherit"===v))x.add(e.getLegendIcon({itemWidth:d,itemHeight:f,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));else{var w,S,_,C="inherit"===v&&e.getData().getVisual("symbol")?"inherit"===g?e.getData().getVisual("symbolRotate"):g:0;x.add(((_=k6(S=(w={itemWidth:d,itemHeight:f,icon:l,iconRotate:C,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}).icon||"roundRect",0,0,w.itemWidth,w.itemHeight,w.itemStyle.fill,w.symbolKeepAspect)).setStyle(w.itemStyle),_.rotation=(w.iconRotate||0)*Math.PI/180,_.setOrigin([w.itemWidth/2,w.itemHeight/2]),S.indexOf("empty")>-1&&(_.style.stroke=_.style.fill,_.style.fill="#fff",_.style.lineWidth=2),_))}var M=r.get("formatter"),A=t;m2(M)&&M?A=M.replace("{name}",null!=t?t:""):m1(M)&&(A=M(t));var k=p?b.getTextColor():i.get("inactiveColor");x.add(new Sr({style:_e(b,{text:A,x:"left"===o?d+5:-5,y:f/2,fill:k,align:o,verticalAlign:"middle"},{inheritColor:k})}));var T=new w0({shape:x.getBoundingRect(),style:{fill:"transparent"}}),I=i.getModel("tooltip");return I.get("show")&&ka({el:T,componentModel:r,itemName:t,itemTooltipOption:I.option}),x.add(T),x.eachChild(function(e){e.silent=!0}),T.silent=!u,this.getContentGroup().add(x),SV(x),x.__legendDataIndex=n,x},t.prototype.layoutInner=function(e,t,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Ca(e.get("orient"),a,e.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),!r)return a.x=u[0],a.y=u[1],this.group.getBoundingRect();Ca("horizontal",s,e.get("selectorItemGap",!0));var c=s.getBoundingRect(),h=[-c.x,-c.y],d=e.get("selectorButtonGap",!0),f=e.getOrient().index,p=0===f?"width":"height",g=0===f?"height":"width",m=0===f?"y":"x";"end"===o?h[f]+=l[p]+d:u[f]+=c[p]+d,h[1-f]+=l[g]/2-c[g]/2,s.x=h[0],s.y=h[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[p]=l[p]+d+c[p],v[g]=Math.max(l[g],c[g]),v[m]=Math.min(0,c[m]+h[1-f]),v},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Dp);function E1(e,t,n,i){E3(e,t,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),E5(e,t,n,i)}function E2(e){for(var t,n=e.getZr().storage.getDisplayList(),i=0,r=n.length;i<r&&!(t=n[i].states.emphasis);)i++;return t&&t.hoverLayer}function E5(e,t,n,i){E2(n)||n.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:i})}function E3(e,t,n,i){E2(n)||n.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:i})}function E4(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function E6(e,t,n){var i,r={},o="toggleSelected"===e;return n.eachComponent("legend",function(n){o&&null!=i?n[i?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?n[e]():(n[e](t.name),i=n.isSelected(t.name)),mq(n.getData(),function(e){var t=e.get("name");if("\n"!==t&&""!==t){var i=n.isSelected(t);r.hasOwnProperty(t)?r[t]=r[t]&&i:r[t]=i}})}),"allSelect"===e||"inverseSelect"===e?{selected:r}:{name:t.name,selected:r}}function E8(e){e.registerComponentModel(EQ),e.registerComponentView(E0),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,E4),e.registerSubTypeDefaulter("legend",function(){return"plain"}),e.registerAction("legendToggleSelect","legendselectchanged",mJ(E6,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",mJ(E6,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",mJ(E6,"inverseSelect")),e.registerAction("legendSelect","legendselected",mJ(E6,"select")),e.registerAction("legendUnSelect","legendunselected",mJ(E6,"unSelect"))}var E9=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,i){var r=Ch(t);e.prototype.init.call(this,t,n,i),E7(this,t,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),E7(this,this.option,t)},t.type="legend.scroll",t.defaultOption=_S(EQ.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(EQ);function E7(e,t,n){var i=e.getOrient(),r=[1,1];r[i.index]=0,Cc(t,n,{type:"box",ignoreSize:!!r})}var Le=["width","height"],Lt=["x","y"],Ln=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return yz(t,e),t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new MF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new MF)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,i,r,o,a,s){var l=this;e.prototype.renderInner.call(this,t,n,i,r,o,a,s);var u=this._controllerGroup,c=n.get("pageIconSize",!0),h=m0(c)?c:[c,c];f("pagePrev",0);var d=n.getModel("pageTextStyle");function f(e,t){var i=ki(n.get("pageIcons",!0)[n.getOrient().name][t],{onclick:mQ(l._pageGo,l,e+"DataIndex",n,r)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});i.name=e,u.add(i)}u.add(new Sr({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),f("pageNext",1)},t.prototype.layoutInner=function(e,t,n,i,r,o){var a=this.getSelectorGroup(),s=e.getOrient().index,l=Le[s],u=Lt[s],c=Le[1-s],h=Lt[1-s];r&&Ca("horizontal",a,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),f=a.getBoundingRect(),p=[-f.x,-f.y],g=mV(n);r&&(g[l]=n[l]-f[l]-d);var m=this._layoutContentAndController(e,i,g,s,l,c,h,u);if(r){if("end"===o)p[s]+=m[l]+d;else{var v=f[l]+d;p[s]-=v,m[u]-=v}m[l]+=f[l]+d,p[1-s]+=m[h]+m[c]/2-f[c]/2,m[c]=Math.max(m[c],f[c]),m[h]=Math.min(m[h],f[h]+p[1-s]),a.x=p[0],a.y=p[1],a.markRedraw()}return m},t.prototype._layoutContentAndController=function(e,t,n,i,r,o,a,s){var l=this.getContentGroup(),u=this._containerGroup,c=this._controllerGroup;Ca(e.get("orient"),l,e.get("itemGap"),i?n.width:null,i?null:n.height),Ca("horizontal",c,e.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),d=c.getBoundingRect(),f=this._showController=h[r]>n[r],p=[-h.x,-h.y];t||(p[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],v=vt(e.get("pageButtonGap",!0),e.get("itemGap",!0));f&&("end"===e.get("pageButtonPosition",!0)?m[i]+=n[r]-d[r]:g[i]+=d[r]+v),m[1-i]+=h[o]/2-d[o]/2,l.setPosition(p),u.setPosition(g),c.setPosition(m);var y={x:0,y:0};if(y[r]=f?n[r]:h[r],y[o]=Math.max(h[o],d[o]),y[a]=Math.min(0,d[a]+m[1-i]),u.__rectSize=n[r],f){var x={x:0,y:0};x[r]=Math.max(n[r]-d[r]-v,0),x[o]=y[o],u.setClipPath(new w0({shape:x})),u.__rectSize=x[r]}else c.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return null!=b.pageIndex&&SQ(l,{x:b.contentPosition[0],y:b.contentPosition[1]},f?e:null),this._updatePageInfoView(e,b),y},t.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;mq(["pagePrev","pageNext"],function(i){var r=null!=t[i+"DataIndex"],o=n.childOfName(i);o&&(o.setStyle("fill",r?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")});var i=n.childOfName("pageText"),r=e.get("pageFormatter"),o=t.pageIndex,a=null!=o?o+1:0,s=t.pageCount;i&&r&&i.setStyle("text",m2(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=e.getOrient().index,o=Le[r],a=Lt[r],s=this._findTargetItemIndex(t),l=n.children(),u=l[s],c=l.length,h=+!!c,d={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[r]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=c;++p)(!(v=y(l[p]))&&m.e>g.s+i||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(var p=s-1,g=f,m=f,v=null;p>=-1;--p)(!(v=y(l[p]))||!x(m,v.s))&&g.i<m.i&&(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(e){if(e){var t=e.getBoundingRect(),n=t[a]+e[a];return{s:n,e:n+t[o],i:e.__legendDataIndex}}}function x(e,t){return e.e>=t&&e.s<=t+i}},t.prototype._findTargetItemIndex=function(e){var t,n;return this._showController?(this.getContentGroup().eachChild(function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===e&&(t=r)}),null!=t?t:n):0},t.type="legend.scroll",t}(E0);function Li(e){OY(E8),e.registerComponentModel(E9),e.registerComponentView(Ln),e.registerAction("legendScroll","legendscroll",function(e,t){var n=e.scrollDataIndex;null!=n&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(e){e.setScrollDataIndex(n)})})}var Lr=vq();function Lo(e,t,n,i){!function e(t,n){if(!(m4(t)&&m4(n)))return t===n;var i=!0;return mq(n,function(n,r){i=i&&e(t[r],n)}),!!i}(Lr(n).lastProp,i)&&(Lr(n).lastProp=i,t?SQ(n,i,e):(n.stopAnimation(),n.attr(i)))}function La(e,t){e[t.get(["label","show"])?"show":"hide"]()}function Ls(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function Ll(e,t,n){var i=t.get("z"),r=t.get("zlevel");e&&e.traverse(function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=r&&(e.zlevel=r),e.silent=n)})}function Lu(e,t,n,i,r){e=t.scale.parse(e);var o=t.scale.getLabel({value:e},{precision:r.precision}),a=r.formatter;if(a){var s={value:PE(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};mq(i,function(e){var t=n.getSeriesByIndex(e.seriesIndex),i=e.dataIndexInside,r=t&&t.getDataParams(i);r&&s.seriesData.push(r)}),m2(a)?o=a.replace("{value}",o):m1(a)&&(o=a(s))}return o}function Lc(e,t,n){var i=y8();return xt(i,i,n.rotation),xe(i,i,n.position),A9([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}var Lh=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.makeElOption=function(e,t,n,i,r){var o,a,s,l,u,c,h,d,f,p,g,m,v,y,x,b,w,S,_,C=n.axis,M=C.grid,A=i.get("type"),k=Ld(M,C).getOtherAxis(C).getGlobalExtent(),T=C.toGlobalCoord(C.dataToCoord(t,!0));if(A&&"none"!==A){var I,D,O,P=(D=i.get("type"),O=i.getModel(D+"Style"),"line"===D?(I=O.getLineStyle()).fill=null:"shadow"===D&&((I=O.getAreaStyle()).stroke=null),I),R=Lf[A](C,T,k);R.style=P,e.graphicKey=R.type,e.pointer=R}var E=PQ(M.model,n);h=P8.innerTextLayout(E.rotation,0,E.labelDirection),E.labelMargin=i.get(["label","margin"]),d={position:Lc(n.axis,t,E),align:h.textAlign,verticalAlign:h.textVerticalAlign},f=Lu(i.get("value"),n.axis,n.ecModel,i.get("seriesDataIndices"),{precision:i.get(["label","precision"]),formatter:i.get(["label","formatter"])}),g=vr((p=i.getModel("label")).get("padding")||0),v=xm(f,m=p.getFont()),y=d.position,x=v.width+g[1]+g[3],b=v.height+g[0]+g[2],"right"===(w=d.align)&&(y[0]-=x),"center"===w&&(y[0]-=x/2),"bottom"===(S=d.verticalAlign)&&(y[1]-=b),"middle"===S&&(y[1]-=b/2),o=y,a=x,s=b,u=(l=r).getWidth(),c=l.getHeight(),o[0]=Math.min(o[0]+a,u)-a,o[1]=Math.min(o[1]+s,c)-s,o[0]=Math.max(o[0],0),o[1]=Math.max(o[1],0),(_=p.get("backgroundColor"))&&"auto"!==_||(_=n.get(["axisLine","lineStyle","color"])),e.label={x:y[0],y:y[1],style:_e(p,{text:f,font:m,fill:p.getTextColor(),padding:g,backgroundColor:_}),z2:10}},t.prototype.getHandleTransform=function(e,t,n){var i=PQ(t.axis.grid.model,t,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=Lc(t.axis,e,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=Ld(o,r).getOtherAxis(r).getGlobalExtent(),l=+("x"!==r.dim),u=[e.x,e.y];u[l]+=t[l],u[l]=Math.min(a[1],u[l]),u[l]=Math.max(a[0],u[l]);var c=(s[1]+s[0])/2,h=[c,c];return h[l]=u[l],{x:u[0],y:u[1],rotation:e.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},t}(function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,i){var r=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,i||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o){a&&a.hide(),s&&s.hide();return}a&&a.show(),s&&s.show();var l={};this.makeElOption(l,r,e,t,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var c=this._moveAnimation=this.determineAnimation(e,t);if(a){var h=mJ(Lo,t,c);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,t)}else a=this._group=new MF,this.createPointerEl(a,l,e,t),this.createLabelEl(a,l,e,t),n.getZr().add(a);Ll(a,t,!0),this._renderHandle(r)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,r="category"===i.type,o=t.get("snap");if(!o&&!r)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(r&&i.getBandWidth()>a)return!0;if(o){var s=Rr(e).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},e.prototype.makeElOption=function(e,t,n,i,r){},e.prototype.createPointerEl=function(e,t,n,i){var r=t.pointer;if(r){var o=Lr(e).pointerEl=new ex[r.type](mV(t.pointer));e.add(o)}},e.prototype.createLabelEl=function(e,t,n,i){if(t.label){var r=Lr(e).labelEl=new Sr(mV(t.label));e.add(r),La(r,i)}},e.prototype.updatePointerEl=function(e,t,n){var i=Lr(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,i){var r=Lr(e).labelEl;r&&(r.setStyle(t.label.style),n(r,{x:t.label.x,y:t.label.y}),La(r,i))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a){r&&i.remove(r),this._handle=null;return}this._handle||(t=!0,r=this._handle=ki(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){Ii(e.event)},onmousedown:mQ(this._onHandleDragMove,this,0,0),drift:mQ(this._onHandleDragMove,this),ondragend:mQ(this._onHandleDragEnd,this)}),i.add(r)),Ll(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");m0(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,kf(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},e.prototype._moveHandleToValue=function(e,t){Lo(this._axisPointerModel,!t&&this._moveAnimation,this._handle,Ls(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(Ls(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(Ls(i)),Lr(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),kp(this,"_doDispatchAxisPointer")},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return{x:e[n=n||0],y:e[1-n],width:t[n],height:t[1-n]}},e}());function Ld(e,t){var n={};return n[t.dim+"AxisIndex"]=t.index,e.getCartesian(n)}var Lf={line:function(e,t,n){var i,r,o;return{type:"Line",subPixelOptimize:!0,shape:(i=[t,n[0]],r=[t,n[1]],{x1:i[o=(o=Lp(e))||0],y1:i[1-o],x2:r[o],y2:r[1-o]})}},shadow:function(e,t,n){var i,r,o,a=Math.max(1,e.getBandWidth()),s=n[1]-n[0];return{type:"Rect",shape:(i=[t-a/2,n[0]],r=[a,s],{x:i[o=(o=Lp(e))||0],y:i[1-o],width:r[o],height:r[1-o]})}}};function Lp(e){return+("x"!==e.dim)}var Lg=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.type="axisPointer",t.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(Cf),Lm=vq();function Lv(e,t,n){if(!vE.node){var i=t.getZr();Lm(i).records||(Lm(i).records={}),function(e,t){Lm(e).initialized||(Lm(e).initialized=!0,n("click",mJ(Lx,"click")),n("mousemove",mJ(Lx,"mousemove")),n("globalout",Ly));function n(n,i){e.on(n,function(n){var r,o,a,s,l,u,c,h,d=(r=t,o={showTip:[],hideTip:[]},{dispatchAction:a=function(e){var t=o[e.type];t?t.push(e):(e.dispatchAction=a,r.dispatchAction(e))},pendings:o});mq(Lm(e).records,function(e){e&&i(e,n,d.dispatchAction)}),s=d.pendings,l=t,c=s.showTip.length,h=s.hideTip.length,c?u=s.showTip[c-1]:h&&(u=s.hideTip[h-1]),u&&(u.dispatchAction=null,l.dispatchAction(u))})}}(i,t),(Lm(i).records[e]||(Lm(i).records[e]={})).handler=n}}function Ly(e,t,n){e.handler("leave",null,n)}function Lx(e,t,n,i){t.handler(e,n,i)}function Lb(e,t){if(!vE.node){var n=t.getZr();(Lm(n).records||{})[e]&&(Lm(n).records[e]=null)}}var Lw=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(e,t,n){var i=t.getComponent("tooltip"),r=e.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";Lv("axisPointer",n,function(e,t,n){"none"!==r&&("leave"===e||r.indexOf(e)>=0)&&n({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){Lb("axisPointer",t)},t.prototype.dispose=function(e,t){Lb("axisPointer",t)},t.type="axisPointer",t}(Dp);function LS(e,t){var n,i=[],r=e.seriesIndex;if(null==r||!(n=t.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=vU(o,e);if(null==a||a<0||m0(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(e.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u).dim,h=u.dim,d=+("x"===c||"radius"===c),f=o.mapDimension(h),p=[];p[d]=o.get(f,a),p[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(p)||[]}else i=l.dataToPoint(o.getValues(mY(l.dimensions,function(e){return o.mapDimension(e)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var L_=vq();function LC(e,t,n){var i=e.currTrigger,r=[e.x,e.y],o=e.dispatchAction||mQ(n.dispatchAction,n),a=t.getComponent("axisPointer").coordSysAxesInfo;if(a){LI(r)&&(r=LS({seriesIndex:e.seriesIndex,dataIndex:e.dataIndex},t).point);var s,l,u,c,h,d,f,p,g,m,v,y=LI(r),x=e.axesInfo,b=a.axesInfo,w="leave"===i||LI(r),S={},_={},C={list:[],map:{}},M={showPointer:mJ(LA,_),showTooltip:mJ(Lk,C)};mq(a.coordSysMap,function(e,t){var n=y||e.containPoint(r);mq(a.coordSysAxesInfo[t],function(e,t){var i=e.axis,o=function(e,t){for(var n=0;n<(e||[]).length;n++){var i=e[n];if(t.axis.dim===i.axisDim&&t.axis.model.componentIndex===i.axisIndex)return i}}(x,e);if(!w&&n&&(!x||o)){var a=o&&o.value;null!=a||y||(a=i.pointToData(r)),null!=a&&LM(e,a,M,!1,S)}})});var A={};return mq(b,function(e,t){var n=e.linkGroup;n&&!_[t]&&mq(n.axesInfo,function(t,i){var r=_[i];if(t!==e&&r){var o=r.value;n.mapper&&(o=e.axis.scale.parse(n.mapper(o,LT(t),LT(e)))),A[e.key]=o}})}),mq(A,function(e,t){LM(b[t],e,M,!0,S)}),s=_,l=b,u=S.axesInfo=[],mq(l,function(e,t){var n=e.axisPointerModel.option,i=s[t];i?(e.useHandle||(n.status="show"),n.value=i.value,n.seriesDataIndices=(i.payloadBatch||[]).slice()):e.useHandle||(n.status="hide"),"show"===n.status&&u.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:n.value})}),function(e,t,n,i){if(LI(t)||!e.list.length)return i({type:"hideTip"});var r=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:e.list})}(C,r,e,o),c=b,d=(h=n).getZr(),f="axisPointerLastHighlights",p=L_(d)[f]||{},g=L_(d)[f]={},mq(c,function(e,t){var n=e.axisPointerModel.option;"show"===n.status&&e.triggerEmphasis&&mq(n.seriesDataIndices,function(e){g[e.seriesIndex+" | "+e.dataIndex]=e})}),m=[],v=[],mq(p,function(e,t){g[t]||v.push(e)}),mq(g,function(e,t){p[t]||m.push(e)}),v.length&&h.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:v}),m.length&&h.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:m}),S}}function LM(e,t,n,i,r){var o=e.axis;if(!o.scale.isBlank()&&o.containData(t)){if(!e.involveSeries)return void n.showPointer(e,t);var a,s,l,u,c,h,d,f,p=(a=t,u=(l=(s=e).axis).dim,c=a,h=[],d=Number.MAX_VALUE,f=-1,mq(s.seriesModels,function(e,t){var n,i,r=e.getData().mapDimensionsAll(u);if(e.getAxisTooltipData){var o=e.getAxisTooltipData(r,a,l);i=o.dataIndices,n=o.nestestValue}else{if(!(i=e.getData().indicesOfNearest(r[0],a,"category"===l.type?.5:null)).length)return;n=e.getData().get(r[0],i[0])}if(null!=n&&isFinite(n)){var s=a-n,p=Math.abs(s);p<=d&&((p<d||s>=0&&f<0)&&(d=p,f=s,c=n,h.length=0),mq(i,function(t){h.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:h,snapToValue:c}),g=p.payloadBatch,m=p.snapToValue;g[0]&&null==r.seriesIndex&&mH(r,g[0]),!i&&e.snap&&o.containData(m)&&null!=m&&(t=m),n.showPointer(e,t,g),n.showTooltip(e,p,m)}}function LA(e,t,n,i){e[t.key]={value:n,payloadBatch:i}}function Lk(e,t,n,i){var r=n.payloadBatch,o=t.axis,a=o.model,s=t.axisPointerModel;if(t.triggerTooltip&&r.length){var l=t.coordSys.model,u=Ra(l),c=e.map[u];c||(c=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(c)),c.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function LT(e){var t=e.axis.model,n={},i=n.axisDim=e.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=t.componentIndex,n.axisName=n[i+"AxisName"]=t.name,n.axisId=n[i+"AxisId"]=t.id,n}function LI(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}function LD(e){Rl.registerAxisPointerClass("CartesianAxisPointer",Lh),e.registerComponentModel(Lg),e.registerComponentView(Lw),e.registerPreprocessor(function(e){if(e){e.axisPointer&&0!==e.axisPointer.length||(e.axisPointer={});var t=e.axisPointer.link;t&&!m0(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(e,t){var n,i,r,o,a,s,l,u,c;e.getComponent("axisPointer").coordSysAxesInfo=(i=n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}},r=e,o=t,a=r.getComponent("tooltip"),l=(s=r.getComponent("axisPointer")).get("link",!0)||[],u=[],mq(o.getCoordinateSystems(),function(e){if(e.axisPointerEnabled){var t=Ra(e.model),n=i.coordSysAxesInfo[t]={};i.coordSysMap[t]=e;var o=e.model.getModel("tooltip",a);if(mq(e.getAxes(),mJ(f,!1,null)),e.getTooltipAxes&&a&&o.get("show")){var c="axis"===o.get("trigger"),h="cross"===o.get(["axisPointer","type"]),d=e.getTooltipAxes(o.get(["axisPointer","axis"]));(c||h)&&mq(d.baseAxes,mJ(f,!h||"cross",c)),h&&mq(d.otherAxes,mJ(f,"cross",!1))}}function f(t,a,c){var h=c.model.getModel("axisPointer",s),d=h.get("show");if(d&&("auto"!==d||t||Ro(h))){null==a&&(a=h.get("triggerTooltip"));var f=(h=t?function(e,t,n,i,r,o){var a=t.getModel("axisPointer"),s={};mq(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(e){s[e]=mV(a.get(e))}),s.snap="category"!==e.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var u=a.get(["label","show"]);if(l.show=null==u||u,!o){var c=s.lineStyle=a.get("crossStyle");c&&mW(l,c.textStyle)}}return e.model.getModel("axisPointer",new _x(s,n,i))}(c,o,s,r,t,a):h).get("snap"),p=h.get("triggerEmphasis"),g=Ra(c.model),m=a||f||"category"===c.type,v=i.axesInfo[g]={key:g,axis:c,coordSys:e,axisPointerModel:h,triggerTooltip:a,triggerEmphasis:p,involveSeries:m,snap:f,useHandle:Ro(h),seriesModels:[],linkGroup:null};n[g]=v,i.seriesInvolved=i.seriesInvolved||m;var y=function(e,t){for(var n=t.model,i=t.dim,r=0;r<e.length;r++){var o=e[r]||{};if(Ri(o[i+"AxisId"],n.id)||Ri(o[i+"AxisIndex"],n.componentIndex)||Ri(o[i+"AxisName"],n.name))return r}}(l,c);if(null!=y){var x=u[y]||(u[y]={axesInfo:{}});x.axesInfo[g]=v,x.mapper=l[y].mapper,v.linkGroup=x}}}}),n.seriesInvolved&&(c=n,e.eachSeries(function(e){var t=e.coordinateSystem,n=e.get(["tooltip","trigger"],!0),i=e.get(["tooltip","show"],!0);t&&"none"!==n&&!1!==n&&"item"!==n&&!1!==i&&!1!==e.get(["axisPointer","show"],!0)&&mq(c.coordSysAxesInfo[Ra(t.model)],function(n){var i=n.axis;t.getAxis(i.dim)===i&&(n.seriesModels.push(e),null==n.seriesDataCount&&(n.seriesDataCount=0),n.seriesDataCount+=e.getData().count())})})),n)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},LC)}var LO=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:"box",ignoreSize:!0},n}return yz(t,e),t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(Cf),LP=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get("show")){var i=this.group,r=e.getModel("textStyle"),o=e.getModel("subtextStyle"),a=e.get("textAlign"),s=vt(e.get("textBaseline"),e.get("textVerticalAlign")),l=new Sr({style:_e(r,{text:e.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),h=new Sr({style:_e(o,{text:c,fill:o.getTextColor(),y:u.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),f=e.get("sublink"),p=e.get("triggerEvent",!0);l.silent=!d&&!p,h.silent=!f&&!p,d&&l.on("click",function(){Ci(d,"_"+e.get("target"))}),f&&h.on("click",function(){Ci(f,"_"+e.get("subtarget"))}),So(l).eventData=So(h).eventData=p?{componentType:"title",componentIndex:e.componentIndex}:null,i.add(l),c&&i.add(h);var g=i.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=Cs(m,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));a||("middle"===(a=e.get("left")||e.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),i.x=v.x,i.y=v.y,i.markRedraw();var y={align:a,verticalAlign:s};l.setStyle(y),h.setStyle(y),g=i.getBoundingRect();var x=v.margin,b=e.getItemStyle(["color","opacity"]);b.fill=e.get("backgroundColor");var w=new w0({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:e.get("borderRadius")},style:b,subPixelOptimize:!0,silent:!0});i.add(w)}},t.type="title",t}(Dp),LR=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.type="dataZoom.select",t}(Ey),LE=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.type="dataZoom.select",t}(Ew);function LL(e){e.registerComponentModel(LR),e.registerComponentView(LE),EH(e)}var LN=function(){},LB={},LF=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;mq(this.option.feature,function(e,n){var i=LB[n];i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(t)),mj(e,i.defaultOption))})},t.type="toolbox",t.layoutMode={type:"box",ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},t}(Cf),Lz=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.render=function(e,t,n,i){var r=this.group;if(r.removeAll(),e.get("show")){var o,a,s,l,u=+e.get("itemSize"),c="vertical"===e.get("orient"),h=e.get("feature")||{},d=this._features||(this._features={}),f=[];mq(h,function(e,t){f.push(t)}),new Mx(this._featureNames||[],f).add(p).update(p).remove(mJ(p,null)).execute(),this._featureNames=f,o=e.getBoxLayoutParams(),a=e.get("padding"),l=Cs(o,s={width:n.getWidth(),height:n.getHeight()},a),Ca(e.get("orient"),r,e.get("itemGap"),l.width,l.height),Cl(r,o,s,a),r.add(EJ(r.getBoundingRect(),e)),c||r.eachChild(function(e){var t=e.__title,i=e.ensureState("emphasis"),o=i.textConfig||(i.textConfig={}),a=e.getTextContent(),s=a&&a.ensureState("emphasis");if(s&&!m1(s)&&t){var l=s.style||(s.style={}),c=xm(t,Sr.makeFont(l)),h=e.x+r.x,d=e.y+r.y+u,f=!1;d+c.height>n.getHeight()&&(o.position="top",f=!0);var p=f?-5-c.height:u+10;h+c.width/2>n.getWidth()?(o.position=["100%",p],l.align="right"):h-c.width/2<0&&(o.position=[0,p],l.align="left")}})}function p(o,a){var s,l,p,g,m,v,y,x,b,w,S,_=f[o],C=f[a],M=h[_],A=new _x(M,e,e.ecModel);if(i&&null!=i.newTitle&&i.featureName===_&&(M.title=i.newTitle),_&&!C){if(0===_.indexOf("my"))S={onclick:A.option.onclick,featureName:_};else{var k=LB[_];if(!k)return;S=new k}d[_]=S}else if(!(S=d[C]))return;S.uid=_w("toolbox-feature"),S.model=A,S.ecModel=t,S.api=n;var T=S instanceof LN;if(!_&&C){T&&S.dispose&&S.dispose(t,n);return}if(!A.get("show")||T&&S.unusable){T&&S.remove&&S.remove(t,n);return}s=A,l=S,p=_,v=s.getModel("iconStyle"),y=s.getModel(["emphasis","iconStyle"]),x=l instanceof LN&&l.getIcons?l.getIcons():s.get("icon"),b=s.get("title")||{},m2(x)?(g={})[p]=x:g=x,m2(b)?(m={})[p]=b:m=b,w=s.iconPaths={},mq(g,function(i,o){var a=ki(i,{},{x:-u/2,y:-u/2,width:u,height:u});a.setStyle(v.getItemStyle()),a.ensureState("emphasis").style=y.getItemStyle();var h=new Sr({style:{text:m[o],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:_a({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},t)},ignore:!0});a.setTextContent(h),ka({el:a,componentModel:e,itemName:o,formatterParamsExtra:{title:m[o]}}),a.__title=m[o],a.on("mouseover",function(){var t=y.getItemStyle(),i=c?null==e.get("right")&&"right"!==e.get("left")?"right":"left":null==e.get("bottom")&&"bottom"!==e.get("top")?"bottom":"top";h.setStyle({fill:y.get("textFill")||t.fill||t.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),a.setTextConfig({position:y.get("textPosition")||i}),h.ignore=!e.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==s.get(["iconStatus",o])&&n.leaveEmphasis(this),h.hide()}),("emphasis"===s.get(["iconStatus",o])?SP:SR)(a),r.add(a),a.on("click",mQ(l.onclick,l,t,n,o)),w[o]=a}),A.setIconStatus=function(e,t){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,i[e]&&("emphasis"===t?SP:SR)(i[e])},S instanceof LN&&S.render&&S.render(A,t,n,i)}},t.prototype.updateView=function(e,t,n,i){mq(this._features,function(e){e instanceof LN&&e.updateView&&e.updateView(e.model,t,n,i)})},t.prototype.remove=function(e,t){mq(this._features,function(n){n instanceof LN&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){mq(this._features,function(n){n instanceof LN&&n.dispose&&n.dispose(e,t)})},t.type="toolbox",t}(Dp),LV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.onclick=function(e,t){var n=this.model,i=n.get("name")||e.get("title.0.text")||"echarts",r="svg"===t.getZr().painter.getType(),o=r?"svg":n.get("type",!0)||"png",a=t.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=vE.browser;if(m1(MouseEvent)&&(s.newEdge||!s.ie&&!s.edge)){var l=document.createElement("a");l.download=i+"."+o,l.target="_blank",l.href=a;var u=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||r){var c=a.split(","),h=c[0].indexOf("base64")>-1,d=r?decodeURIComponent(c[1]):c[1];h&&(d=window.atob(d));var f=i+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var p=d.length,g=new Uint8Array(p);p--;)g[p]=d.charCodeAt(p);var m=new Blob([g]);window.navigator.msSaveOrOpenBlob(m,f)}else{var v=document.createElement("iframe");document.body.appendChild(v);var y=v.contentWindow,x=y.document;x.open("image/svg+xml","replace"),x.write(d),x.close(),y.focus(),x.execCommand("SaveAs",!0,f),document.body.removeChild(v)}}else{var b=n.get("lang"),w='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(b&&b[0]||"")+'" /></body>',S=window.open();S.document.write(w),S.document.title=i}},t.getDefaultOption=function(e){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:e.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:e.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},t}(LN),Lj="__ec_magicType_stack__",LH=[["line","bar"],["stack"]],LW=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.getIcons=function(){var e=this.model,t=e.get("icon"),n={};return mq(e.get("type"),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:e.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var i,r=this.model,o=r.get(["seriesIndex",n]);if(LG[n]){var a={series:[]};mq(LH,function(e){mG(e,n)>=0&&mq(e,function(e){r.setIconStatus(e,"normal")})}),r.setIconStatus(n,"emphasis"),e.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var t=e.subType,i=e.id,o=LG[n](t,i,e,r);o&&(mW(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",c=e.getReferringComponents(u,vK).models[0].componentIndex;a[u]=a[u]||[];for(var h=0;h<=c;h++)a[u][c]=a[u][c]||{};a[u][c].boundaryGap="bar"===n}}});var s=n;"stack"===n&&(i=mj({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),"emphasis"!==r.get(["iconStatus",n])&&(s="tiled")),t.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:i,featureName:"magicType"})}},t}(LN),LG={line:function(e,t,n,i){if("bar"===e)return mj({id:t,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(e,t,n,i){if("line"===e)return mj({id:t,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(e,t,n,i){var r=n.get("stack")===Lj;if("line"===e||"bar"===e)return i.setIconStatus("stack",r?"normal":"emphasis"),mj({id:t,stack:r?"":Lj},i.get(["option","stack"])||{},!0)}};OH({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var L$=Array(60).join("-");function LU(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var Lq=RegExp("[ ]+","g"),LY=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.onclick=function(e,t){setTimeout(function(){t.dispatchAction({type:"hideTip"})});var n,i,r,o,a,s,l=t.getDom(),u=this.model;this._dom&&l.removeChild(this._dom);var c=document.createElement("div");c.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",c.style.backgroundColor=u.get("backgroundColor")||"#fff";var h=document.createElement("h4"),d=u.get("lang")||[];h.innerHTML=d[0]||u.get("title"),h.style.cssText="margin:10px 20px",h.style.color=u.get("textColor");var f=document.createElement("div"),p=document.createElement("textarea");f.style.cssText="overflow:auto";var g=u.get("optionToContent"),m=u.get("contentToOption"),v={value:mX([(o=(s=(n={},i=[],r=[],e.eachRawSeries(function(e){var t=e.coordinateSystem;if(t&&("cartesian2d"===t.type||"polar"===t.type)){var o=t.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;n[a]||(n[a]={categoryAxis:o,valueAxis:t.getOtherAxis(o),series:[]},r.push({axisDim:o.dim,axisIndex:o.index})),n[a].series.push(e)}else i.push(e)}else i.push(e)}),{seriesGroupByCategoryAxis:n,other:i,meta:r})).seriesGroupByCategoryAxis,a=[],mq(o,function(e,t){var n=e.categoryAxis,i=e.valueAxis.dim,r=[" "].concat(mY(e.series,function(e){return e.name})),o=[n.model.getCategories()];mq(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(i),function(e){return e}))});for(var s=[r.join(" ")],l=0;l<o[0].length;l++){for(var u=[],c=0;c<o.length;c++)u.push(o[c][l]);s.push(u.join(" "))}a.push(s.join("\n"))}),a.join("\n\n"+L$+"\n\n")),mY(s.other,function(e){var t=e.getRawData(),n=[e.name],i=[];return t.each(t.dimensions,function(){for(var e=arguments.length,r=arguments[e-1],o=t.getName(r),a=0;a<e-1;a++)i[a]=arguments[a];n.push((o?o+" ":"")+i.join(" "))}),n.join("\n")}).join("\n\n"+L$+"\n\n")],function(e){return!!e.replace(/[\n\t\s]/g,"")}).join("\n\n"+L$+"\n\n"),meta:s.meta};if(m1(g)){var y=g(t.getOption());m2(y)?f.innerHTML=y:m9(y)&&f.appendChild(y)}else{p.readOnly=u.get("readOnly");var x=p.style;x.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",x.color=u.get("textColor"),x.borderColor=u.get("textareaBorderColor"),x.backgroundColor=u.get("textareaColor"),p.value=v.value,f.appendChild(p)}var b=v.meta,w=document.createElement("div");w.style.cssText="position:absolute;bottom:5px;left:0;right:0";var S="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",_=document.createElement("div"),C=document.createElement("div");S+=";background-color:"+u.get("buttonColor")+";color:"+u.get("buttonTextColor");var M=this;function A(){l.removeChild(c),M._dom=null}In(_,"click",A),In(C,"click",function(){var e,n,i,r;if(null==m&&null!=g||null!=m&&null==g)return void A();try{m1(m)?e=m(f,t.getOption()):(n=p.value,i=n.split(RegExp("\n*"+L$+"\n*","g")),r={series:[]},mq(i,function(e,t){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(" ")>=0)return!0}(e)){var n=function(e){for(var t=e.split(/\n+/g),n=LU(t.shift()).split(Lq),i=[],r=mY(n,function(e){return{name:e,data:[]}}),o=0;o<t.length;o++){var a=LU(t[o]).split(Lq);i.push(a.shift());for(var s=0;s<a.length;s++)r[s]&&(r[s].data[o]=a[s])}return{series:r,categories:i}}(e),i=b[t],o=i.axisDim+"Axis";i&&(r[o]=r[o]||[],r[o][i.axisIndex]={data:n.categories},r.series=r.series.concat(n.series))}else{var n=function(e){for(var t=e.split(/\n+/g),n=LU(t.shift()),i=[],r=0;r<t.length;r++){var o=LU(t[r]);if(o){var a=o.split(Lq),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),i[r]={name:s,value:[]},l=i[r].value):l=i[r]=[];for(var c=0;c<a.length;c++)l.push(+a[c]);1===l.length&&(u?i[r].value=l[0]:i[r]=l[0])}}return{name:n,data:i}}(e);r.series.push(n)}}),e=r)}catch(e){throw A(),Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),A()}),_.innerHTML=d[1],C.innerHTML=d[2],C.style.cssText=_.style.cssText=S,u.get("readOnly")||w.appendChild(C),w.appendChild(_),c.appendChild(h),c.appendChild(f),c.appendChild(w),f.style.height=l.clientHeight-80+"px",l.appendChild(c),this._dom=c},t.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:e.getLocaleModel().get(["toolbox","dataView","title"]),lang:e.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},t}(LN);OH({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(e,t){var n=[];mq(e.newOption.series,function(e){var i=t.getSeriesByName(e.name)[0];if(i){var r,o=i.get("data");n.push({name:e.name,data:(r=e.data,mY(r,function(e,t){var n=o&&o[t];if(!m4(n)||m0(n))return e;m4(e)&&!m0(e)||(e={value:e});var i=null!=n.name&&null==e.name;return e=mW(e,n),i&&delete e.name,e}))})}else n.push(mH({type:"scatter"},e))}),t.mergeOption(mW({series:n},e.newOption))});var LZ=vq();function LX(e){var t=LZ(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var LK=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.onclick=function(e,t){LZ(e).snapshots=null,t.dispatchAction({type:"restore",from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:e.getLocaleModel().get(["toolbox","restore","title"])}},t}(LN);OH({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var LQ=Math.min,LJ=Math.max,L0=Math.pow,L1="globalPan",L2={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},L5={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},L3={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},L4=0,L6=function(e){function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new MF,n._uid="brushController_"+L4++,mq(N_,function(e,t){this._handlers[t]=mQ(e,this)},n),n}return yz(t,e),t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t,n=this._zr;this._enableGlobalPan||(t=this._uid,EA(n)[L1]=t),mq(this._handlers,function(e,t){n.on(t,e)}),this._brushType=e.brushType,this._brushOption=mj(mV(L3),e,!0)},t.prototype._doDisableBrush=function(){var e,t,n=this._zr;e=this._uid,(t=EA(n))[L1]===e&&(t[L1]=null),mq(this._handlers,function(e,t){n.off(t,e)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};mq(e,function(e){t[e.panelId]=mV(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=mY(e,function(e){return mj(mV(L3),e,!0)});var t=this._covers,n=this._covers=[],i=this,r=this._creatingCover;return new Mx(t,e,function(e,t){return o(e.__brushOption,t)},o).add(a).update(a).remove(function(e){t[e]!==r&&i.group.remove(t[e])}).execute(),this;function o(e,t){return(null!=e.id?e.id:"\0-brush-index-"+t)+"-"+e.brushType}function a(o,a){var s=e[o];if(null!=a&&t[a]===r)n[o]=t[a];else{var l=n[o]=null!=a?(t[a].__brushOption=s,t[a]):L9(i,L8(i,s));Nt(i,l)}}},t.prototype.unmount=function(){return this.enableBrush(!1),No(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(bz);function L8(e,t){var n=NM[t.brushType].createCover(e,t);return n.__brushOption=t,Ne(n,t),e.group.add(n),n}function L9(e,t){var n=Nn(t);return n.endCreating&&(n.endCreating(e,t),Ne(t,t.__brushOption)),t}function L7(e,t){var n=t.__brushOption;Nn(t).updateCoverShape(e,t,n.range,n)}function Ne(e,t){var n=t.z;null==n&&(n=1e4),e.traverse(function(e){e.z=n,e.z2=n})}function Nt(e,t){Nn(t).updateCommon(e,t),L7(e,t)}function Nn(e){return NM[e.__brushOption.brushType]}function Ni(e,t,n){var i,r=e._panels;if(!r)return!0;var o=e._transform;return mq(r,function(e){e.isTargetByCursor(t,n,o)&&(i=e)}),i}function Nr(e,t){var n=e._panels;if(!n)return!0;var i=t.__brushOption.panelId;return null==i||n[i]}function No(e){var t=e._covers,n=t.length;return mq(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function Na(e,t){var n=mY(e._covers,function(e){var t=e.__brushOption,n=mV(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger("brush",{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function Ns(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function Nl(e,t,n,i){var r=new MF;return r.add(new w0({name:"main",style:Nd(n),silent:!0,draggable:!0,cursor:"move",drift:mJ(Ng,e,t,r,["n","s","w","e"]),ondragend:mJ(Na,t,{isEnd:!0})})),mq(i,function(n){r.add(new w0({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:mJ(Ng,e,t,r,n),ondragend:mJ(Na,t,{isEnd:!0})}))}),r}function Nu(e,t,n,i){var r=i.brushStyle.lineWidth||0,o=LJ(r,6),a=n[0][0],s=n[1][0],l=a-r/2,u=s-r/2,c=n[0][1],h=n[1][1],d=c-o+r/2,f=h-o+r/2,p=c-a,g=h-s,m=p+r,v=g+r;Nh(e,t,"main",a,s,p,g),i.transformable&&(Nh(e,t,"w",l,u,o,v),Nh(e,t,"e",d,u,o,v),Nh(e,t,"n",l,u,m,o),Nh(e,t,"s",l,f,m,o),Nh(e,t,"nw",l,u,o,o),Nh(e,t,"ne",d,u,o,o),Nh(e,t,"sw",l,f,o,o),Nh(e,t,"se",d,f,o,o))}function Nc(e,t){var n=t.__brushOption,i=n.transformable,r=t.childAt(0);r.useStyle(Nd(n)),r.attr({silent:!i,cursor:i?"move":"default"}),mq([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var r,o,a,s=t.childOfName(n.join("")),l=1===n.length?Np(e,n[0]):(("e"===(a=[Np(r=e,(o=n)[0]),Np(r,o[1])])[0]||"w"===a[0])&&a.reverse(),a.join(""));s&&s.attr({silent:!i,invisible:!i,cursor:i?L5[l]+"-resize":null})})}function Nh(e,t,n,i,r,o,a){var s,l,u,c=t.childOfName(n);c&&c.setShape((l=LQ((s=Ny(e,t,[[i,r],[i+o,r+a]]))[0][0],s[1][0]),{x:l,y:u=LQ(s[0][1],s[1][1]),width:LJ(s[0][0],s[1][0])-l,height:LJ(s[0][1],s[1][1])-u}))}function Nd(e){return mW({strokeNoScale:!0},e.brushStyle)}function Nf(e,t,n,i){var r=[LQ(e,n),LQ(t,i)],o=[LJ(e,n),LJ(t,i)];return[[r[0],o[0]],[r[1],o[1]]]}function Np(e,t){return({left:"w",right:"e",top:"n",bottom:"s"})[A7({w:"left",e:"right",n:"top",s:"bottom"}[t],A8(e.group))]}function Ng(e,t,n,i,r,o){var a=n.__brushOption,s=e.toRectRange(a.range),l=Nv(t,r,o);mq(i,function(e){var t=L2[e];s[t[0]][t[1]]+=l[t[0]]}),a.range=e.fromRectRange(Nf(s[0][0],s[1][0],s[0][1],s[1][1])),Nt(t,n),Na(t,{isEnd:!1})}function Nm(e,t,n,i){var r=t.__brushOption.range,o=Nv(e,n,i);mq(r,function(e){e[0]+=o[0],e[1]+=o[1]}),Nt(e,t),Na(e,{isEnd:!1})}function Nv(e,t,n){var i=e.group,r=i.transformCoordToLocal(t,n),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function Ny(e,t,n){var i=Nr(e,t);return i&&!0!==i?i.clipPath(n,e._transform):mV(n)}function Nx(e){var t=e.event;t.preventDefault&&t.preventDefault()}function Nb(e,t,n){return e.childOfName("main").contain(t,n)}function Nw(e,t,n,i){var r,o=e._creatingCover,a=e._creatingPanel,s=e._brushOption;if(e._track.push(n.slice()),function(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],i=t[0],r=n[0]-i[0],o=n[1]-i[1];return L0(r*r+o*o,.5)>6}(e)||o){if(a&&!o){"single"===s.brushMode&&No(e);var l=mV(s);l.brushType=NS(l.brushType,a),l.panelId=!0===a?null:a.panelId,o=e._creatingCover=L8(e,l),e._covers.push(o)}if(o){var u=NM[NS(e._brushType,a)];o.__brushOption.range=u.getCreatingRange(Ny(e,o,e._track)),i&&(L9(e,o),u.updateCommon(e,o)),L7(e,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&Ni(e,t,n)&&No(e)&&(r={isEnd:i,removeOnClick:!0});return r}function NS(e,t){return"auto"===e?t.defaultBrushType:e}var N_={mousedown:function(e){if(this._dragging)NC(this,e);else if(!e.target||!e.target.draggable){Nx(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=Ni(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,i=this.group.transformCoordToLocal(t,n);if(!function(e,t,n){if(!(!e._brushType||(i=e,r=t.offsetX,o=t.offsetY,a=i._zr,r<0||r>a.getWidth()||o<0||o>a.getHeight()))){var i,r,o,a,s=e._zr,l=e._covers,u=Ni(e,t,n);if(!e._dragging)for(var c=0;c<l.length;c++){var h=l[c].__brushOption;if(u&&(!0===u||h.panelId===u.panelId)&&NM[h.brushType].contain(l[c],n[0],n[1]))return}u&&s.setCursorStyle("crosshair")}}(this,e,i),this._dragging){Nx(e);var r=Nw(this,e,i,!1);r&&Na(this,r)}},mouseup:function(e){NC(this,e)}};function NC(e,t){if(e._dragging){Nx(t);var n=t.offsetX,i=t.offsetY,r=e.group.transformCoordToLocal(n,i),o=Nw(e,t,r,!0);e._dragging=!1,e._track=[],e._creatingCover=null,o&&Na(e,o)}}var NM={lineX:NA(0),lineY:NA(1),rect:{createCover:function(e,t){function n(e){return e}return Nl({toRectRange:n,fromRectRange:n},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=Ns(e);return Nf(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,i){Nu(e,t,n,i)},updateCommon:Nc,contain:Nb},polygon:{createCover:function(e,t){var n=new MF;return n.add(new Aw({name:"main",style:Nd(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new Ay({name:"main",draggable:!0,drift:mJ(Nm,e,t),ondragend:mJ(Na,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,i){t.childAt(0).setShape({points:Ny(e,t,n)})},updateCommon:Nc,contain:Nb}};function NA(e){return{createCover:function(t,n){return Nl({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[["w"],["e"]],[["n"],["s"]]][e])},getCreatingRange:function(t){var n=Ns(t);return[LQ(n[0][e],n[1][e]),LJ(n[0][e],n[1][e])]},updateCoverShape:function(t,n,i,r){var o,a=Nr(t,n);if(!0!==a&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(e);else{var s=t._zr;o=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[i,o];e&&l.reverse(),Nu(t,n,l,r)},updateCommon:Nc,contain:Nb}}var Nk={axisPointer:1,tooltip:1,brush:1};function NT(e){return xd.create(e)}var NI=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],ND=function(){function e(e,t,n){var i=this;this._targetInfoList=[];var r=NP(t,e);mq(NR,function(e,t){(!n||!n.include||mG(n.include,t)>=0)&&e(r,i._targetInfoList)})}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(e,t,n){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var i=NN[e.brushType](0,n,t);e.__rangeOffset={offset:NF[e.brushType](i.values,e.range,[1,1]),xyMinMax:i.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){mq(e,function(e){var i=this.findTargetInfo(e,t);i&&!0!==i&&mq(i.coordSyses,function(i){var r=NN[e.brushType](1,i,e.range,!0);n(e,r.values,i,t)})},this)},e.prototype.setInputRanges=function(e,t){mq(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&!0!==n){e.panelId=n.panelId;var i,r,o,a,s,l=NN[e.brushType](0,n.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?NF[e.brushType](l.values,u.offset,(i=l.xyMinMax,r=u.xyMinMax,o=NV(i),a=NV(r),isNaN((s=[o[0]/a[0],o[1]/a[1]])[0])&&(s[0]=1),isNaN(s[1])&&(s[1]=1),s)):l.values}},this)},e.prototype.makePanelOpts=function(e,t){return mY(this._targetInfoList,function(n){var i,r,o,a,s=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:(i=NT(i=s),function(e){return kt(e,i)}),isTargetByCursor:(r=n.coordSysModel,o=NT(s),function(t,n){var i,a;return o.contain(n[0],n[1])&&(a=(i=e.getComponentByElement(t.topTarget))&&i.coordinateSystem,!i||i===r||!!Nk.hasOwnProperty(i.mainType)||!a||a.model===r)}),getLinearBrushOtherExtent:(a=NT(a=s),function(e){var t=e?a.width:a.height,n=e?a.x:a.y;return[n,n+(t||0)]})}})},e.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return!0===i||i&&mG(i.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=NP(t,e),r=0;r<n.length;r++){var o=n[r],a=e.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<NE.length;s++)if(NE[s](i,o))return o}return!0},e}();function NO(e){return e[0]>e[1]&&e.reverse(),e}function NP(e,t){return vZ(e,t,{includeMainTypes:NI})}var NR={grid:function(e,t){var n=e.xAxisModels,i=e.yAxisModels,r=e.gridModels,o=vh(),a={},s={};(n||i||r)&&(mq(n,function(e){var t=e.axis.grid.model;o.set(t.id,t),a[t.id]=!0}),mq(i,function(e){var t=e.axis.grid.model;o.set(t.id,t),s[t.id]=!0}),mq(r,function(e){o.set(e.id,e),a[e.id]=!0,s[e.id]=!0}),o.each(function(e){var r=e.coordinateSystem,o=[];mq(r.getCartesians(),function(e,t){(mG(n,e.getAxis("x").model)>=0||mG(i,e.getAxis("y").model)>=0)&&o.push(e)}),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:o[0],coordSyses:o,getPanelRect:NL.grid,xAxisDeclared:a[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){mq(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:NL.geo})})}},NE=[function(e,t){var n=e.xAxisModel,i=e.yAxisModel,r=e.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],NL={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(A8(e)),t}},NN={lineX:mJ(NB,0),lineY:mJ(NB,1),rect:function(e,t,n,i){var r=e?t.pointToData([n[0][0],n[1][0]],i):t.dataToPoint([n[0][0],n[1][0]],i),o=e?t.pointToData([n[0][1],n[1][1]],i):t.dataToPoint([n[0][1],n[1][1]],i),a=[NO([r[0],o[0]]),NO([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(e,t,n,i){var r=[[1/0,-1/0],[1/0,-1/0]];return{values:mY(n,function(n){var o=e?t.pointToData(n,i):t.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o}),xyMinMax:r}}};function NB(e,t,n,i){var r=n.getAxis(["x","y"][e]),o=NO(mY([0,1],function(e){return t?r.coordToData(r.toLocalCoord(i[e]),!0):r.toGlobalCoord(r.dataToCoord(i[e]))})),a=[];return a[e]=o,a[1-e]=[NaN,NaN],{values:o,xyMinMax:a}}var NF={lineX:mJ(Nz,0),lineY:mJ(Nz,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return mY(e,function(e,i){return[e[0]-n[0]*t[i][0],e[1]-n[1]*t[i][1]]})}};function Nz(e,t,n,i){return[t[0]-i[e]*n[0],t[1]-i[e]*n[1]]}function NV(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var Nj=vN+"toolbox-dataZoom_",NH=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yz(t,e),t.prototype.render=function(e,t,n,i){var r,o,a,s,l,u,c,h,d;this._brushController||(this._brushController=new L6(n.getZr()),this._brushController.on("brush",mQ(this._onBrush,this)).mount()),r=e,o=t,a=this,s=i,l=n,u=a._isZoomActive,s&&"takeGlobalCursor"===s.type&&(u="dataZoomSelect"===s.key&&s.dataZoomSelectActive),a._isZoomActive=u,r.setIconStatus("zoom",u?"emphasis":"normal"),c=new ND(NG(r),o,{include:["grid"]}).makePanelOpts(l,function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}),a._brushController.setPanels(c).enableBrush(!!u&&!!c.length&&{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}),h=e,d=t,h.setIconStatus("back",LX(d).length>1?"emphasis":"normal")},t.prototype.onclick=function(e,t,n){NW[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(e.isEnd&&t.length){var n,i,r,o={},a=this.ecModel;this._brushController.updateCovers([]),new ND(NG(this.model),a,{include:["grid"]}).matchOutputRanges(t,a,function(e,t,n){if("cartesian2d"===n.type){var i=e.brushType;"rect"===i?(s("x",n,t[0]),s("y",n,t[1])):s({lineX:"x",lineY:"y"}[i],n,t)}}),n=a,i=o,r=LX(n),mq(i,function(e,t){for(var i=r.length-1;i>=0&&!r[i][t];i--);if(i<0){var o=n.queryComponents({mainType:"dataZoom",subType:"select",id:t})[0];if(o){var a=o.getPercentRange();r[0][t]={dataZoomId:t,start:a[0],end:a[1]}}}}),r.push(i),this._dispatchZoomAction(o)}function s(e,t,n){var i,r,s,l=t.getAxis(e),u=l.model,c=(i=e,r=u,a.eachComponent({mainType:"dataZoom",subType:"select"},function(e){e.getAxisModel(i,r.componentIndex)&&(s=e)}),s),h=c.findRepresentativeAxisProxy(u).getMinMaxSpan();(null!=h.minValueSpan||null!=h.maxValueSpan)&&(n=ES(0,n.slice(),l.scale.getExtent(),0,h.minValueSpan,h.maxValueSpan)),c&&(o[c.id]={dataZoomId:c.id,startValue:n[0],endValue:n[1]})}},t.prototype._dispatchZoomAction=function(e){var t=[];mq(e,function(e,n){t.push(mV(e))}),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:e.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},t}(LN),NW={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){var e,t,n;this._dispatchZoomAction((t=(e=LX(this.ecModel))[e.length-1],e.length>1&&e.pop(),n={},mq(t,function(t,i){for(var r=e.length-1;r>=0;r--)if(t=e[r][i]){n[i]=t;break}}),n))}};function NG(e){var t={xAxisIndex:e.get("xAxisIndex",!0),yAxisIndex:e.get("yAxisIndex",!0),xAxisId:e.get("xAxisId",!0),yAxisId:e.get("yAxisId",!0)};return null==t.xAxisIndex&&null==t.xAxisId&&(t.xAxisIndex="all"),null==t.yAxisIndex&&null==t.yAxisId&&(t.yAxisIndex="all"),t}A=function(e){var t=e.getComponent("toolbox",0),n=["feature","dataZoom"];if(t&&null!=t.get(n)){var i=t.getModel(n),r=[],o=vZ(e,NG(i));return mq(o.xAxisModels,function(e){return a(e,"xAxis","xAxisIndex")}),mq(o.yAxisModels,function(e){return a(e,"yAxis","yAxisIndex")}),r}function a(e,t,n){var o=e.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:Nj+t+o};a[n]=o,r.push(a)}},vo(null==IX.get("dataZoom")&&A),IX.set("dataZoom",A);var N$=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.type="tooltip",t.dependencies=["axisPointer"],t.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},t}(Cf);function NU(e){var t=e.get("confine");return null!=t?!!t:"richText"===e.get("renderMode")}function Nq(e){if(vE.domSupported){for(var t=document.documentElement.style,n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n]}}var NY=Nq(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function NZ(e,t){if(!e)return t;t=_8(t,!0);var n=e.indexOf(t);return(e=-1===n?t:"-"+e.slice(0,n)+"-"+t).toLowerCase()}var NX=NZ(Nq(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),NK=NZ(NY,"transform"),NQ="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(vE.transform3dSupported?"will-change:transform;":"");function NJ(e,t,n){var i=e.toFixed(0)+"px",r=t.toFixed(0)+"px";if(!vE.transformSupported)return n?"top:"+r+";left:"+i+";":[["top",r],["left",i]];var o=vE.transform3dSupported,a="translate"+(o?"3d":"")+"("+i+","+r+(o?",0":"")+")";return n?"top:0;left:0;"+NK+":"+a+";":[["top",0],["left",0],[NY,a]]}function N0(e,t,n,i,r){var o=t&&t.painter;if(n){var a=o&&o.getViewportRoot();a&&_T(_k,a,i,r,!0)&&_T(e,n,_k[0],_k[1])}else{e[0]=i,e[1]=r;var s=o&&o.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var N1=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,vE.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),r=t.appendTo,o=r&&(m2(r)?document.querySelector(r):m9(r)?r:m1(r)&&r(e.getDom()));N0(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!a._enterable){var t=i.handler;It(i.painter.getViewportRoot(),e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t,n,i=this._api.getDom(),r=(t="position",(n=i.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(i))?t?n[t]:n:null),o=i.style;"absolute"!==o.position&&"absolute"!==r&&(o.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n,i,r,o,a,s,l,u,c,h,d,f,p,g,m,v,y,x,b,w,S,_=this.el,C=_.style,M=this._styleCoord;_.innerHTML?C.cssText=NQ+(n=!this._firstShow,i=this._longHide,r=[],o=e.get("transitionDuration"),a=e.get("backgroundColor"),s=e.get("shadowBlur"),l=e.get("shadowColor"),u=e.get("shadowOffsetX"),c=e.get("shadowOffsetY"),h=e.getModel("textStyle"),d=Mo(e,"html"),f=u+"px "+c+"px "+s+"px "+l,r.push("box-shadow:"+f),n&&o&&r.push((g="opacity"+(p=" "+o/2+"s cubic-bezier(0.23,1,0.32,1)")+",visibility"+p,i||(p=" "+o+"s cubic-bezier(0.23,1,0.32,1)",g+=vE.transformSupported?","+NK+p:",left"+p+",top"+p),NX+":"+g)),a&&r.push("background-color:"+a),mq(["width","color","radius"],function(t){var n="border-"+t,i=_8(n),o=e.get(i);null!=o&&r.push(n+":"+o+("color"===t?"":"px"))}),r.push((m=[],v=h.get("fontSize"),(y=h.getTextColor())&&m.push("color:"+y),m.push("font:"+h.getFont()),v&&m.push("line-height:"+Math.round(3*v/2)+"px"),x=h.get("textShadowColor"),b=h.get("textShadowBlur")||0,w=h.get("textShadowOffsetX")||0,S=h.get("textShadowOffsetY")||0,x&&b&&m.push("text-shadow:"+w+"px "+S+"px "+b+"px "+x),mq(["decoration","align"],function(e){var t=h.get(e);t&&m.push("text-"+e+":"+t)}),m.join(";"))),null!=d&&r.push("padding:"+vr(d).join("px ")+"px"),r.join(";")+";")+NJ(M[0],M[1],!0)+"border-color:"+Cn(t)+";"+(e.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):C.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,i,r){var o=this.el;if(null==e){o.innerHTML="";return}var a="";if(m2(r)&&"item"===n.get("trigger")&&!NU(n)&&(a=function(e,t,n){if(!m2(n)||"inside"===n)return"";var i,r,o=e.get("backgroundColor"),a=e.get("borderWidth");t=Cn(t);var s=i="left"===(i=n)?"right":"right"===i?"left":"top"===i?"bottom":"top",l=Math.max(1.5*Math.round(a),6),u="",c=NK+":";mG(["left","right"],s)>-1?(u+="top:50%",c+="translateY(-50%) rotate("+(r="left"===s?-225:-45)+"deg)"):(u+="left:50%",c+="translateX(-50%) rotate("+(r="top"===s?225:45)+"deg)");var h=r*Math.PI/180,d=l+a,f=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h));u+=";"+s+":-"+Math.round(((f-Math.SQRT2*a)/2+Math.SQRT2*a-(f-d)/2)*100)/100+"px";var p=t+" solid "+a+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",u+";"+c+";","border-bottom:"+p,"border-right:"+p,"background-color:"+o+";"].join("")+'"></div>'}(n,i,r)),m2(e))o.innerHTML=e+a;else if(e){o.innerHTML="",m0(e)||(e=[e]);for(var s=0;s<e.length;s++)m9(e[s])&&e[s].parentNode!==o&&o.appendChild(e[s]);if(a&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=a,o.appendChild(l)}}},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},e.prototype.moveTo=function(e,t){var n=this._styleCoord;if(N0(n,this._zr,this._container,e,t),null!=n[0]&&null!=n[1]){var i=this.el.style;mq(NJ(n[0],n[1]),function(e){i[e[0]]=e[1]})}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){var e=this,t=this.el.style;t.visibility="hidden",t.opacity="0",vE.transform3dSupported&&(t.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(mQ(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},e}(),N2=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),N4(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){var t=e.get("alwaysShowContent");t&&this._moveIfResized(),this._alwaysShowContent=t},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,i,r){var o=this;m4(e)&&CR(""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new Sr({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:Mo(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),mq(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(e){o.el.style[e]=n.get(e)}),mq(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(e){o.el.style[e]=a.get(e)||0}),this._zr.add(this.el);var s=this;this.el.on("mouseover",function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0}),this.el.on("mouseout",function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1})},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=N3(e.style);return[t.width+n.left+n.right,t.height+n.top+n.bottom]},e.prototype.moveTo=function(e,t){var n=this.el;if(n){var i=this._styleCoord;N4(i,this._zr,e,t),e=i[0],t=i[1];var r=n.style,o=N5(r.borderWidth||0),a=N3(r);n.x=e+o+a.left,n.y=t+o+a.top,n.markRedraw()}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},e.prototype.hideLater=function(e){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(mQ(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}();function N5(e){return Math.max(0,e)}function N3(e){var t=N5(e.shadowBlur||0),n=N5(e.shadowOffsetX||0),i=N5(e.shadowOffsetY||0);return{left:N5(t-n),right:N5(t+n),top:N5(t-i),bottom:N5(t+i)}}function N4(e,t,n,i){e[0]=n,e[1]=i,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var N6=new w0({shape:{x:-1,y:-1,width:2,height:2}}),N8=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.init=function(e,t){if(!vE.node&&t.getDom()){var n,i=e.getComponent("tooltip"),r=this._renderMode="auto"===(n=i.get("renderMode"))?vE.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===r?new N2(t):new N1(t,{appendTo:i.get("appendToBody",!0)?"body":i.get("appendTo",!0)})}},t.prototype.render=function(e,t,n){if(!vE.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var i=this._tooltipContent;i.update(e),i.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&e.get("transitionDuration")?kf(this,"_updatePosition",50,"fixRate"):kp(this,"_updatePosition")}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get("triggerOn");Lv("itemTooltip",this._api,mQ(function(t,n,i){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(n,i):"leave"===t&&this._hide(i))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,i=e.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.isDisposed()||r.manuallyShowTip(e,t,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,i){if(i.from!==this.uid&&!vE.node&&n.getDom()){var r=N7(i,n);this._ticket="";var o=i.dataByCoordSys,a=function(e,t,n){var i,r=vX(e).queryOptionMap,o=r.keys()[0];if(o&&"series"!==o){var a=vJ(t,o,r.get(o),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a&&(n.getViewOfComponentModel(a).group.traverse(function(t){var n=So(t).tooltipConfig;if(n&&n.name===e.name)return i=t,!0}),i))return{componentMainType:o,componentIndex:a.componentIndex,el:i}}}(i,t,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},r)}else if(i.tooltip&&null!=i.x&&null!=i.y)N6.x=i.x,N6.y=i.y,N6.update(),So(N6).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:N6},r);else if(o)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:o,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(e,t,n,i))return;var l=LS(i,t),u=l.point[0],c=l.point[1];null!=u&&null!=c&&this._tryShow({offsetX:u,offsetY:c,target:l.el,position:i.position,positionDefault:"bottom"},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},t.prototype.manuallyHideTip=function(e,t,n,i){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(N7(i,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,i){var r=i.seriesIndex,o=i.dataIndex,a=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=t.getSeriesByIndex(r);if(s&&"axis"===N9([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var i,r,o=e.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,e);else if(n){if("legend"===So(n).ssrType)return;this._lastDataByCoordSys=null,DU(n,function(e){return null!=So(e).dataIndex?(i=e,!0):null!=So(e).tooltipConfig?(r=e,!0):void 0},!0),i?this._showSeriesItemTooltip(e,i,t):r?this._showComponentItemTooltip(e,r,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get("showDelay");t=mQ(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,i=this._tooltipModel,r=[t.offsetX,t.offsetY],o=N9([t.tooltipOption],i),a=this._renderMode,s=[],l=C9("section",{blocks:[],noHeader:!0}),u=[],c=new Ma;mq(e,function(e){mq(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+"Axis",e.axisIndex),r=e.value;if(t&&null!=r){var o=Lu(r,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),h=C9("section",{header:o,noHeader:!va(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),mq(e.seriesDataIndices,function(l){var d=n.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,p=d.getDataParams(f);if(!(p.dataIndex<0)){p.axisDim=e.axisDim,p.axisIndex=e.axisIndex,p.axisType=e.axisType,p.axisId=e.axisId,p.axisValue=PE(t.axis,{value:r}),p.axisValueLabel=o,p.marker=c.makeTooltipMarker("item",Cn(p.color),a);var g=CI(d.formatTooltip(f,!0,null)),m=g.frag;if(m){var v=N9([d],i).get("valueFormatter");h.blocks.push(v?mH({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(p)}})}})}),l.blocks.reverse(),u.reverse();var h=t.position,d=Mn(l,c,a,o.get("order"),n.get("useUTC"),o.get("textStyle"));d&&u.unshift(d);var f="richText"===a?"\n\n":"<br/>",p=u.join(f);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(o,h,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,p,s,Math.random()+"",r[0],r[1],h,null,c)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var i=this._ecModel,r=So(t),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,u=r.dataType,c=s.getData(u),h=this._renderMode,d=e.positionDefault,f=N9([c.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),p=f.get("trigger");if(null==p||"item"===p){var g=s.getDataParams(l,u),m=new Ma;g.marker=m.makeTooltipMarker("item",Cn(g.color),h);var v=CI(s.formatTooltip(l,!1,u)),y=f.get("order"),x=f.get("valueFormatter"),b=v.frag,w=b?Mn(x?mH({valueFormatter:x},b):b,m,h,y,i.get("useUTC"),f.get("textStyle")):v.text,S="item_"+s.name+"_"+l;this._showOrMove(f,function(){this._showTooltipContent(f,w,g,S,e.offsetX,e.offsetY,e.position,e.target,m)}),n({type:"showTip",dataIndexInside:l,dataIndex:c.getRawIndex(l),seriesIndex:o,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var i=So(t),r=i.tooltipConfig.option||{};if(m2(r)){var o=r;r={content:o,formatter:o}}var a=[r],s=this._ecModel.getComponent(i.componentMainType,i.componentIndex);s&&a.push(s),a.push({formatter:r.content});var l=e.positionDefault,u=N9(a,this._tooltipModel,l?{position:l}:null),c=u.get("content"),h=Math.random()+"",d=new Ma;this._showOrMove(u,function(){var n=mV(u.get("formatterParams")||{});this._showTooltipContent(u,c,n,h,e.offsetX,e.offsetY,e.position,t,d)}),n({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,i,r,o,a,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent;u.setEnterable(e.get("enterable"));var c=e.get("formatter");a=a||e.get("position");var h=t,d=this._getNearestPoint([r,o],n,e.get("trigger"),e.get("borderColor")).color;if(c)if(m2(c)){var f=e.ecModel.get("useUTC"),p=m0(n)?n[0]:n,g=p&&p.axisType&&p.axisType.indexOf("time")>=0;h=c,g&&(h=_G(p.axisValue,h,f)),h=Ct(h,n,!0)}else if(m1(c)){var m=mQ(function(t,i){t===this._ticket&&(u.setContent(i,l,e,d,a),this._updatePosition(e,a,r,o,u,n,s))},this);this._ticket=i,h=c(n,i,m)}else h=c;u.setContent(h,l,e,d,a),u.show(e,d),this._updatePosition(e,a,r,o,u,n,s)}},t.prototype._getNearestPoint=function(e,t,n,i){return"axis"===n||m0(t)?{color:i||("html"===this._renderMode?"#fff":"none")}:m0(t)?void 0:{color:i||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=r.getSize(),c=e.get("align"),h=e.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),m1(t)&&(t=t([n,i],o,r.el,d,{viewSize:[s,l],contentSize:u.slice()})),m0(t))n=vy(t[0],s),i=vy(t[1],l);else if(m4(t)){var f=t;f.width=u[0],f.height=u[1];var p=Cs(f,{width:s,height:l});n=p.x,i=p.y,c=null,h=null}else if(m2(t)&&a){var g=function(e,t,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-r/2,l=t.y+c/2-o/2;break;case"top":s=t.x+u/2-r/2,l=t.y-o-a;break;case"bottom":s=t.x+u/2-r/2,l=t.y+c+a;break;case"left":s=t.x-r-a,l=t.y+c/2-o/2;break;case"right":s=t.x+u+a,l=t.y+c/2-o/2}return[s,l]}(t,d,u,e.get("borderWidth"));n=g[0],i=g[1]}else{var m,v,y,x,b,w,S,_,C,M,g=(m=n,v=i,y=r,x=s,b=l,w=c?null:20,S=h?null:20,C=(_=y.getSize())[0],M=_[1],null!=w&&(m+C+w+2>x?m-=C+w:m+=w),null!=S&&(v+M+S>b?v-=M+S:v+=S),[m,v]);n=g[0],i=g[1]}if(c&&(n-=Be(c)?u[0]/2:"right"===c?u[0]:0),h&&(i-=Be(h)?u[1]/2:"bottom"===h?u[1]:0),NU(e)){var A,k,T,I,D,O,P,R,g=(A=n,k=i,T=r,I=s,D=l,P=(O=T.getSize())[0],R=O[1],A=Math.min(A+P,I)-P,k=Math.min(k+R,D)-R,[A=Math.max(A,0),k=Math.max(k,0)]);n=g[0],i=g[1]}r.moveTo(n,i)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===e.length;return r&&mq(n,function(n,o){var a=n.dataByAxis||[],s=(e[o]||{}).dataByAxis||[];(r=r&&a.length===s.length)&&mq(a,function(e,n){var o=s[n]||{},a=e.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&e.value===o.value&&e.axisType===o.axisType&&e.axisId===o.axisId&&a.length===l.length)&&mq(a,function(e,t){var n=l[t];r=r&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),i&&mq(e.seriesDataIndices,function(e){var n=e.seriesIndex,o=t[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!r},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},t.prototype.dispose=function(e,t){!vE.node&&t.getDom()&&(kp(this,"_updatePosition"),this._tooltipContent.dispose(),Lb("itemTooltip",t))},t.type="tooltip",t}(Dp);function N9(e,t,n){var i,r=t.ecModel;n?(i=new _x(n,r,r),i=new _x(t.option,i,r)):i=t;for(var o=e.length-1;o>=0;o--){var a=e[o];a&&(a instanceof _x&&(a=a.get("tooltip",!0)),m2(a)&&(a={formatter:a}),a&&(i=new _x(a,i,r)))}return i}function N7(e,t){return e.dispatchAction||mQ(t.dispatchAction,t)}function Be(e){return"center"===e||"middle"===e}var Bt={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};let Bn=function(e,t,n){var i=mV((Bt[e]||{})[t]);return n&&m0(i)?i[i.length-1]:i};var Bi=function(){function e(t){var n,i,r=t.mappingMethod,o=t.type,a=this.option=mV(t);this.type=o,this.mappingMethod=r,this._normalizeData=Bf[r];var s=e.visualHandlers[o];this.applyVisual=s.applyVisual,this.getColorMapper=s.getColorMapper,this._normalizedToVisual=s._normalizedToVisual[r],"piecewise"===r?(Br(a),i=(n=a).pieceList,n.hasSpecialVisual=!1,mq(i,function(e,t){e.originIndex=t,null!=e.visual&&(n.hasSpecialVisual=!0)})):"category"===r?a.categories?function(e){var t=e.categories,n=e.categoryMap={},i=e.visual;if(mq(t,function(e,t){n[e]=t}),!m0(i)){var r=[];m4(i)?mq(i,function(e,t){var i=n[t];r[null!=i?i:-1]=e}):r[-1]=i,i=Bd(e,r)}for(var o=t.length-1;o>=0;o--)null==i[o]&&(delete n[t[o]],t.pop())}(a):Br(a,!0):(vo("linear"!==r||a.dataExtent),Br(a))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return mQ(this._normalizeData,this)},e.listVisualTypes=function(){return mK(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){m4(e)?mq(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,i){var r,o=m0(t)?[]:m4(t)?{}:(r=!0,null);return e.eachVisual(t,function(e,t){var a=n.call(i,e,t);r?o=a:o[t]=a}),o},e.retrieveVisuals=function(t){var n,i={};return t&&mq(e.visualHandlers,function(e,r){t.hasOwnProperty(r)&&(i[r]=t[r],n=!0)}),n?i:null},e.prepareVisualTypes=function(e){if(m0(e))e=e.slice();else{if(!m4(e))return[];var t=[];mq(e,function(e,n){t.push(n)}),e=t}return e.sort(function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1}),e},e.dependsOn=function(e,t){return"color"===t?!!(e&&0===e.indexOf(t)):e===t},e.findPieceIndex=function(e,t,n){for(var i,r=1/0,o=0,a=t.length;o<a;o++){var s=t[o].value;if(null!=s){if(s===e||m2(s)&&s===e+"")return o;n&&_(s,o)}}for(var o=0,a=t.length;o<a;o++){var l,u,c,h,d,f,p,g,m,v,y,x,b=t[o],w=b.interval,S=b.close;if(w){if(w[0]===-1/0){if(l=S[1],u=e,c=w[1],l?u<=c:u<c)return o}else if(w[1]===1/0){if(h=S[0],d=w[0],f=e,h?d<=f:d<f)return o}else{if(p=S[0],g=w[0],m=e,(p?g<=m:g<m)&&(v=S[1],y=e,x=w[1],v?y<=x:y<x))return o}n&&_(w[0],o),n&&_(w[1],o)}}if(n)return e===1/0?t.length-1:e===-1/0?0:i;function _(t,n){var o=Math.abs(t-e);o<r&&(r=o,i=n)}},e.visualHandlers={color:{applyVisual:Bs("color"),getColorMapper:function(){var e=this.option;return mQ("category"===e.mappingMethod?function(e,t){return t||(e=this._normalizeData(e)),Bl.call(this,e)}:function(t,n,i){var r=!!i;return n||(t=this._normalizeData(t)),i=bw(t,e.parsedVisual,i),r?i:bC(i,"rgba")},this)},_normalizedToVisual:{linear:function(e){return bC(bw(e,this.option.parsedVisual),"rgba")},category:Bl,piecewise:function(e,t){var n=Bh.call(this,t);return null==n&&(n=bC(bw(e,this.option.parsedVisual),"rgba")),n},fixed:Bu}},colorHue:Bo(function(e,t){return bS(e,t)}),colorSaturation:Bo(function(e,t){return bS(e,null,t)}),colorLightness:Bo(function(e,t){return bS(e,null,null,t)}),colorAlpha:Bo(function(e,t){return b_(e,t)}),decal:{applyVisual:Bs("decal"),_normalizedToVisual:{linear:null,category:Bl,piecewise:null,fixed:null}},opacity:{applyVisual:Bs("opacity"),_normalizedToVisual:Bc([0,1])},liftZ:{applyVisual:Bs("liftZ"),_normalizedToVisual:{linear:Bu,category:Bu,piecewise:Bu,fixed:Bu}},symbol:{applyVisual:function(e,t,n){n("symbol",this.mapValueToVisual(e))},_normalizedToVisual:{linear:Ba,category:Bl,piecewise:function(e,t){var n=Bh.call(this,t);return null==n&&(n=Ba.call(this,e)),n},fixed:Bu}},symbolSize:{applyVisual:Bs("symbolSize"),_normalizedToVisual:Bc([0,1])}},e}();function Br(e,t){var n=e.visual,i=[];m4(n)?mq(n,function(e){i.push(e)}):null!=n&&i.push(n),t||1!==i.length||({color:1,symbol:1}).hasOwnProperty(e.type)||(i[1]=i[0]),Bd(e,i)}function Bo(e){return{applyVisual:function(t,n,i){var r=this.mapValueToVisual(t);i("color",e(n("color"),r))},_normalizedToVisual:Bc([0,1])}}function Ba(e){var t=this.option.visual;return t[Math.round(vv(e,[0,1],[0,t.length-1],!0))]||{}}function Bs(e){return function(t,n,i){i(e,this.mapValueToVisual(t))}}function Bl(e){var t=this.option.visual;return t[this.option.loop&&-1!==e?e%t.length:e]}function Bu(){return this.option.visual[0]}function Bc(e){return{linear:function(t){return vv(t,e,this.option.visual,!0)},category:Bl,piecewise:function(t,n){var i=Bh.call(this,n);return null==i&&(i=vv(t,e,this.option.visual,!0)),i},fixed:Bu}}function Bh(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var i=Bi.findPieceIndex(e,n),r=n[i];if(r&&r.visual)return r.visual[this.type]}}function Bd(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=mY(t,function(e){return by(e)||[0,0,0,1]})),t}var Bf={linear:function(e){return vv(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=Bi.findPieceIndex(e,t,!0);if(null!=n)return vv(n,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?-1:t},fixed:vg};function Bp(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function Bg(e,t,n){var i={};return mq(t,function(t){var r,o=i[t]=((r=function(){}).prototype.__hidden=r.prototype,new r);mq(e[t],function(e,i){if(Bi.isValidType(i)){var r={type:i,visual:e};n&&n(r,t),o[i]=new Bi(r),"opacity"===i&&((r=mV(r)).type="colorAlpha",o.__hidden.__alphaForOpacity=new Bi(r))}})}),i}var Bm=Bi.mapVisual,Bv=Bi.eachVisual,By=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return yz(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n,i,r=this.option;t||(mq(n=this.replacableOptionKeys,function(t){e.hasOwnProperty(t)&&Bp(e[t])&&(i=!0)}),i&&mq(n,function(t){e.hasOwnProperty(t)&&Bp(e[t])?r[t]=mV(e[t]):delete r[t]})),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=mQ(e,this),this.controllerVisuals=Bg(this.option.controller,t,e),this.targetVisuals=Bg(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries(function(e,n){t.push(n)}):t=vB(e),t},t.prototype.eachTargetSeries=function(e,t){mq(this.getTargetSeriesIndices(),function(n){var i=this.ecModel.getSeriesByIndex(n);i&&e.call(t,i)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var i,r=this.option,o=r.precision,a=this.dataBound,s=r.formatter;n=n||["<",">"],m0(e)&&(e=e.slice(),i=!0);var l=t?e:i?[u(e[0]),u(e[1])]:u(e);if(m2(s))return s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l);if(m1(s))return i?s(e[0],e[1]):s(e);if(!i)return l;if(e[0]===a[0])return n[0]+" "+l[1];if(e[1]===a[1])return n[1]+" "+l[0];return l[0]+" - "+l[1];function u(e){return e===a[0]?"min":e===a[1]?"max":(+e).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var e=this.option,t=vb([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(null!=t)return e.getDimensionIndex(t);for(var n=e.dimensions,i=n.length-1;i>=0;i--){var r=n[i],o=e.getDimensionInfo(r);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},i=t.target||(t.target={}),r=t.controller||(t.controller={});mj(i,n),mj(r,n);var o=this.isCategory();function a(n){m0(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get("gradientColor")}}a.call(this,i),a.call(this,r),(function(e,t,n){var i=e[t],r=e[n];i&&!r&&(r=e[n]={},mq(i,function(e,t){if(Bi.isValidType(t)){var n=Bn(t,"inactive",o);null!=n&&(r[t]=n,"color"!==t||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}}))}).call(this,i,"inRange","outOfRange"),(function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),r=this.getItemSymbol()||"roundRect";mq(this.stateList,function(a){var s=this.itemSize,l=e[a];l||(l=e[a]={color:o?i:[i]}),null==l.symbol&&(l.symbol=t&&mV(t)||(o?r:[r])),null==l.symbolSize&&(l.symbolSize=n&&mV(n)||(o?s[0]:[s[0],s[0]])),l.symbol=Bm(l.symbol,function(e){return"none"===e?r:e});var u=l.symbolSize;if(null!=u){var c=-1/0;Bv(u,function(e){e>c&&(c=e)}),l.symbolSize=Bm(u,function(e){return vv(e,[0,c],[0,s[0]],!0)})}},this)}).call(this,r)},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type="visualMap",t.dependencies=["series"],t.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},t}(Cf),Bx=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(null==t[0]||isNaN(t[0]))&&(t[0]=20),(null==t[1]||isNaN(t[1]))&&(t[1]=140)},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):m0(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),mq(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=vb((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent();return(t[0]<=n[0]||t[0]<=e)&&(t[1]>=n[1]||e<=t[1])?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var i=[],r=n.getData();r.each(this.getDataDimensionIndex(r),function(t,n){e[0]<=t&&t<=e[1]&&i.push(n)},this),t.push({seriesId:n.id,dataIndex:i})},this),t},t.prototype.getVisualMeta=function(e){var t=Bb(this,"outOfRange",this.getExtent()),n=Bb(this,"inRange",this.option.range.slice()),i=[];function r(t,n){i.push({value:t,color:e(t,n)})}for(var o=0,a=0,s=n.length,l=t.length;a<l&&(!n.length||t[a]<=n[0]);a++)t[a]<n[o]&&r(t[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&i.length&&r(n[o],"outOfRange"),r(n[o],"inRange");for(var u=1;a<l;a++)(!n.length||n[n.length-1]<t[a])&&(u&&(i.length&&r(i[i.length-1].value,"outOfRange"),u=0),r(t[a],"outOfRange"));var c=i.length;return{stops:i,outerColors:[c?i[0].color:"transparent",c?i[c-1].color:"transparent"]}},t.type="visualMap.continuous",t.defaultOption=_S(By.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),t}(By);function Bb(e,t,n){if(n[0]===n[1])return n.slice();for(var i=(n[1]-n[0])/200,r=n[0],o=[],a=0;a<=200&&r<n[1];a++)o.push(r),r+=i;return o.push(n[1]),o}var Bw=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return yz(t,e),t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,i){(this.visualMapModel=e,!1===e.get("show"))?this.group.removeAll():this.doRender(e,t,n,i)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=vr(t.get("padding")||0),i=e.getBoundingRect();e.add(new w0({z2:-1,silent:!0,shape:{x:i.x-n[3],y:i.y-n[0],width:i.width+n[3]+n[1],height:i.height+n[0]+n[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},t.prototype.getControllerVisual=function(e,t,n){var i=(n=n||{}).forceState,r=this.visualMapModel,o={};function a(e){return o[e]}function s(e,t){o[e]=t}"color"===t&&(o.color=r.get("contentColor"));var l=r.controllerVisuals[i||r.getValueState(e)];return mq(Bi.prepareVisualTypes(l),function(i){var r=l[i];n.convertOpacityToAlpha&&"opacity"===i&&(i="colorAlpha",r=l.__alphaForOpacity),Bi.dependsOn(i,t)&&r&&r.applyVisual(e,a,s)}),o[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api;Cl(e,t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},t.prototype.doRender=function(e,t,n,i){},t.type="visualMap",t}(Dp),BS=[["left","right","width"],["top","bottom","height"]];function B_(e,t,n){var i=e.option,r=i.align;if(null!=r&&"auto"!==r)return r;for(var o={width:t.getWidth(),height:t.getHeight()},a=+("horizontal"===i.orient),s=BS[a],l=[0,null,10],u={},c=0;c<3;c++)u[BS[1-a][c]]=l[c],u[s[c]]=2===c?n[0]:i[s[c]];var h=[["x","width",3],["y","height",0]][a],d=Cs(u,o,i.padding);return s[(d.margin[h[2]]||0)+d[h[0]]+.5*d[h[1]]<.5*o[h[1]]?0:1]}function BC(e,t){return mq(e||[],function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")}),e}var BM=Math.min,BA=Math.max,Bk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return yz(t,e),t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=mQ(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=mQ(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,i){i&&"selectDataRange"===i.type&&i.from===this.uid||this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var n=e.get("text");this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var i=t[1-n];i=null!=i?i+"":"";var r=this.visualMapModel,o=r.get("textGap"),a=r.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),c=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new Sr({style:_e(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===c?"middle":u,align:"horizontal"===c?u:"center",text:i})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,i=t.itemSize,r=this._orient,o=this._useHandle,a=B_(t,this.api,i),s=n.mainGroup=this._createBarGroup(a),l=new MF;s.add(l),l.add(n.outOfRange=BT()),l.add(n.inRange=BT(null,o?BD(this._orient):null,mQ(this._dragHandle,this,"all",!1),mQ(this._dragHandle,this,"all",!0))),l.setClipPath(new w0({shape:{x:0,y:0,width:i[0],height:i[1],r:3}}));var u=t.textStyleModel.getTextRect("国"),c=BA(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,i,c,r),this._createHandle(t,s,1,i,c,r)),this._createIndicator(t,s,i,c,r),e.add(s)},t.prototype._createHandle=function(e,t,n,i,r,o){var a=mQ(this._dragHandle,this,n,!1),s=mQ(this._dragHandle,this,n,!0),l=xb(e.get("handleSize"),i[0]),u=k6(e.get("handleIcon"),-l/2,-l/2,l,l,null,!0),c=BD(this._orient);u.attr({cursor:c,draggable:!0,drift:a,ondragend:s,onmousemove:function(e){Ii(e.event)}}),u.x=i[0]/2,u.useStyle(e.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=e.getModel(["emphasis","handleStyle"]).getItemStyle(),S$(u,!0),t.add(u);var h=new Sr({cursor:c,draggable:!0,drift:a,onmousemove:function(e){Ii(e.event)},ondragend:s,style:_e(this.visualMapModel.textStyleModel,{x:0,y:0,text:""})});h.ensureState("blur").style={opacity:.1},h.stateTransition={duration:200},this.group.add(h);var d=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=d,f.handleLabels[n]=h},t.prototype._createIndicator=function(e,t,n,i,r){var o=xb(e.get("indicatorSize"),n[0]),a=k6(e.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel("indicatorStyle").getItemStyle();if(a instanceof wU){var l=a.style;a.useStyle(mH({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);t.add(a);var u=new Sr({silent:!0,invisible:!0,style:_e(this.visualMapModel.textStyleModel,{x:0,y:0,text:""})});this.group.add(u);var c=[("horizontal"===r?i/2:6)+n[0]/2,0],h=this._shapes;h.indicator=a,h.indicatorLabel=u,h.indicatorLabelPoint=c,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,i){if(this._useHandle){if(this._dragging=!t,!t){var r=this._applyTransform([n,i],this._shapes.mainGroup,!0);this._updateInterval(e,r[1]),this._hideIndicator(),this._updateView()}!this.visualMapModel.get("realtime")===t&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?this._hovering||this._clearHoverLinkToSeries():BI(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),i=[0,e.itemSize[1]];this._handleEnds=[vv(t[0],n,i,!0),vv(t[1],n,i,!0)]},t.prototype._updateInterval=function(e,t){t=t||0;var n=this.visualMapModel,i=this._handleEnds,r=[0,n.itemSize[1]];ES(t,i,r,e,0);var o=n.getExtent();this._dataInterval=[vv(i[0],r,o,!0),vv(i[1],r,o,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),i=this._shapes,r=[0,t.itemSize[1]],o=e?r:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,r,"outOfRange");i.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),i.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},t.prototype._createBarVisual=function(e,t,n,i){var r={forceState:i,convertOpacityToAlpha:!0},o=this._makeColorGradient(e,r),a=[this.getControllerVisual(e[0],"symbolSize",r),this.getControllerVisual(e[1],"symbolSize",r)],s=this._createBarPoints(n,a);return{barColor:new AN(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=[],i=(e[1]-e[0])/100;n.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var r=1;r<100;r++){var o=e[0]+i*r;if(o>e[1])break;n.push({color:this.getControllerVisual(o,"color",t),offset:r/100})}return n.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),n},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get("inverse");return new MF("horizontal"===t&&!n?{scaleX:"bottom"===e?1:-1,rotation:Math.PI/2}:"horizontal"===t&&n?{scaleX:"bottom"===e?-1:1,rotation:-Math.PI/2}:"vertical"===t&&!n?{scaleX:"left"===e?1:-1,scaleY:-1}:{scaleX:"left"===e?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,o=n.handleLabels,a=i.itemSize,s=i.getExtent();mq([0,1],function(l){var u=r[l];u.setStyle("fill",t.handlesColor[l]),u.y=e[l];var c=vv(e[l],[0,a[1]],s,!0),h=this.getControllerVisual(c,"symbolSize");u.scaleX=u.scaleY=h/a[0],u.x=a[0]-h/2;var d=A9(n.handleLabelPoints[l],A8(u,this.group));o[l].setStyle({x:d[0],y:d[1],text:i.formatValueText(this._dataInterval[l]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})},this)}},t.prototype._showIndicator=function(e,t,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(e,"symbolSize"),d=vv(e,o,s,!0),f=a[0]-h/2,p={x:u.x,y:u.y};u.y=d,u.x=f;var g=A9(l.indicatorLabelPoint,A8(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+r.formatValueText(t),verticalAlign:y?v:"middle",align:y?"center":v});var x={x:f,y:d,style:{fill:c}},b={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var w={duration:100,easing:"cubicInOut",additive:!0};u.x=p.x,u.y=p.y,u.animateTo(x,w),m.animateTo(b,w)}else u.attr(x),m.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var _=0;_<S.length;_++)this.api.enterBlur(S[_])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on("mousemove",function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,i=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);i[1]=BM(BA(0,i[1]),n[1]),e._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=n[0])}}).on("mouseout",function(){e._hovering=!1,e._dragging||e._clearHoverLinkToSeries()})},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,i=n.itemSize;if(n.option.hoverLink){var r,o,a,s,l,u=[0,i[1]],c=n.getExtent();e=BM(BA(u[0],e),u[1]);var h=(r=n,o=c,a=u,s=6,(l=r.get("hoverLinkDataSize"))&&(s=vv(l,o,a,!0)/2),s),d=[e-h,e+h],f=vv(e,u,c,!0),p=[vv(d[0],u,c,!0),vv(d[1],u,c,!0)];d[0]<u[0]&&(p[0]=-1/0),d[1]>u[1]&&(p[1]=1/0),t&&(p[0]===-1/0?this._showIndicator(f,p[1],"< ",h):p[1]===1/0?this._showIndicator(f,p[0],"> ",h):this._showIndicator(f,f,"≈ ",h));var g=this._hoverLinkDataIndices,m=[];(t||BI(n))&&(m=this._hoverLinkDataIndices=n.findTargetDataIndices(p));var v=function(e,t){var n={},i={};return r(e||[],n),r(t||[],i,n),[o(n),o(i)];function r(e,t,n){for(var i=0,r=e.length;i<r;i++){var o=vW(e[i].seriesId,null);if(null==o)return;for(var a=vB(e[i].dataIndex),s=n&&n[o],l=0,u=a.length;l<u;l++){var c=a[l];s&&s[c]?s[c]=null:(t[o]||(t[o]={}))[c]=1}}}function o(e,t){var n=[];for(var i in e)if(e.hasOwnProperty(i)&&null!=e[i])if(t)n.push(+i);else{var r=o(e[i],!0);r.length&&n.push({seriesId:i,dataIndex:r})}return n}}(g,m);this._dispatchHighDown("downplay",BC(v[0],n)),this._dispatchHighDown("highlight",BC(v[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){if(DU(e.target,function(e){var n=So(e);if(null!=n.dataIndex)return t=n,!0},!0),t){var t,n=this.ecModel.getSeriesByIndex(t.seriesIndex),i=this.visualMapModel;if(i.isTargetSeries(n)){var r=n.getData(t.dataType),o=r.getStore().get(i.getDataDimensionIndex(r),t.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",BC(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,i){var r=A8(t,i?null:this.group);return m0(e)?A9(e,r,n):A7(e,r,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type="visualMap.continuous",t}(Bw);function BT(e,t,n,i){return new Ay({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){Ii(e.event)},ondragend:i})}function BI(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function BD(e){return"vertical"===e?"ns-resize":"ew-resize"}var BO={type:"selectDataRange",event:"dataRangeSelected",update:"update"},BP=function(e,t){t.eachComponent({mainType:"visualMap",query:e},function(t){t.setSelected(e.selected)})},BR=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent("visualMap",function(t){var i,r,o,a,s,l=e.pipelineContext;!t.isTargetSeries(e)||l&&l.large||n.push((i=t.stateList,r=t.targetVisuals,o=mQ(t.getValueState,t),a=t.getDataDimensionIndex(e.getData()),s={},mq(i,function(e){var t=Bi.prepareVisualTypes(r[e]);s[e]=t}),{progress:function(e,t){function n(e){return DG(t,u,e)}function i(e,n){var i=u;switch(e){case"color":t.ensureUniqueItemVisual(i,"style")[t.getVisual("drawType")]=n,t.setItemVisual(i,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(i,"style").opacity=n;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(i,e,n)}}null!=a&&(l=t.getDimensionIndex(a));for(var l,u,c=t.getStore();null!=(u=e.next());){var h=t.getRawDataItem(u);if(!h||!1!==h.visualMap)for(var d=null!=a?c.get(l,u):u,f=o(d),p=r[f],g=s[f],m=0,v=g.length;m<v;m++){var y=g[m];p[y]&&p[y].applyVisual(d,n,i)}}}}))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),i=[];t.eachComponent("visualMap",function(t){if(t.isTargetSeries(e)){var r=t.getVisualMeta(mQ(BE,null,e,t))||{stops:[],outerColors:[]},o=t.getDataDimensionIndex(n);o>=0&&(r.dimension=o,i.push(r))}}),e.getData().setVisual("visualMeta",i)}}];function BE(e,t,n,i){for(var r=t.targetVisuals[i],o=Bi.prepareVisualTypes(r),a={color:D$(e.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],c=r["opacity"===u?"__alphaForOpacity":u];c&&c.applyVisual(n,h,d)}return a.color;function h(e){return a[e]}function d(e,t){a[e]=t}}function BL(e){var t=e&&e.visualMap;m0(t)||(t=t?[t]:[]),mq(t,function(e){if(e){BN(e,"splitList")&&!BN(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&m0(t)&&mq(t,function(e){m4(e)&&(BN(e,"start")&&!BN(e,"min")&&(e.min=e.start),BN(e,"end")&&!BN(e,"max")&&(e.max=e.end))})}})}function BN(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var BB=!1;function BF(e){BB||(BB=!0,e.registerSubTypeDefaulter("visualMap",function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}),e.registerAction(BO,BP),mq(BR,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(BL))}function Bz(e){e.registerComponentModel(Bx),e.registerComponentView(Bk),BF(e)}var BV=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return yz(t,e),t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],Bj[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var r=this.option.categories;this.resetVisual(function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=mV(r)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=mY(this._pieceList,function(e){return e=mV(e),"inRange"!==t&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},i=Bi.listVisualTypes(),r=this.isCategory();function o(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}mq(t.pieces,function(e){mq(i,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),mq(n,function(e,n){var i=!1;mq(this.stateList,function(e){i=i||o(t,e,n)||o(t.target,e,n)},this),i||mq(this.stateList,function(e){(t[e]||(t[e]={}))[n]=Bn(n,"inRange"===e?"active":"inactive",r)})},this),e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,i=this._pieceList,r=(t?n:e).selected||{};if(n.selected=r,mq(i,function(e,t){var n=this.getSelectedMapKey(e);r.hasOwnProperty(n)||(r[n]=!0)},this),"single"===n.selectedMode){var o=!1;mq(i,function(e,t){var n=this.getSelectedMapKey(e);r[n]&&(o?r[n]=!1:o=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get("itemSymbol")},t.prototype.getSelectedMapKey=function(e){return"categories"===this._mode?e.value+"":e.index+""},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},t.prototype.setSelected=function(e){this.option.selected=mV(e)},t.prototype.getValueState=function(e){var t=Bi.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(i){var r=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(t,i){Bi.findPieceIndex(t,n)===e&&r.push(i)},this),t.push({seriesId:i.id,dataIndex:r})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(!this.isCategory()){var t=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var o=r[0].interval[0];o!==-1/0&&r.unshift({interval:[-1/0,o]}),(o=r[r.length-1].interval[1])!==1/0&&r.push({interval:[o,1/0]})}else r.push({interval:[-1/0,1/0]});var a=-1/0;return mq(r,function(e){var t=e.interval;t&&(t[0]>a&&s([a,t[0]],"outOfRange"),s(t.slice()),a=t[1])},this),{stops:t,outerColors:n}}function s(r,o){var a=i.getRepresentValue({interval:r});o||(o=i.getValueState(a));var s=e(a,o);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:t.push({value:r[0],color:s},{value:r[1],color:s})}},t.type="visualMap.piecewise",t.defaultOption=_S(By.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),t}(By),Bj={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),i=this.getExtent(),r=t.splitNumber;t.splitNumber=r=Math.max(parseInt(r,10),1);for(var o=(i[1]-i[0])/r;+o.toFixed(n)!==o&&n<5;)n++;t.precision=n,o=+o.toFixed(n),t.minOpen&&e.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a<r;s+=o,a++){var l=a===r-1?i[1]:s+o;e.push({interval:[s,l],close:[1,1]})}t.maxOpen&&e.push({interval:[i[1],1/0],close:[0,0]}),vI(e),mq(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;mq(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),BH(t,e)},pieces:function(e){var t=this.option;mq(t.pieces,function(t,n){m4(t)||(t={value:t});var i={text:"",index:n};if(null!=t.label&&(i.text=t.label),t.hasOwnProperty("value")){var r=i.value=t.value;i.interval=[r,r],i.close=[1,1]}else{for(var o=i.interval=[],a=i.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],c=0;c<2;c++){for(var h=[["gte","gt","min"],["lte","lt","max"]][c],d=0;d<3&&null==o[c];d++)o[c]=t[h[d]],a[c]=s[d],u[c]=2===d;null==o[c]&&(o[c]=l[c])}u[0]&&o[1]===1/0&&(a[0]=0),u[1]&&o[0]===-1/0&&(a[1]=0),o[0]===o[1]&&a[0]&&a[1]&&(i.value=o[0])}i.visual=Bi.retrieveVisuals(t),e.push(i)},this),BH(t,e),vI(e),mq(e,function(e){var t=e.close,n=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,n)},this)}};function BH(e,t){var n=e.inverse;("vertical"===e.orient?!n:n)&&t.reverse()}var BW=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get("textGap"),i=t.textStyleModel,r=i.getFont(),o=i.getTextColor(),a=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,c=ve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,c,a),mq(l.viewPieceList,function(i){var l=i.piece,u=new MF;u.onclick=mQ(this._onItemClick,this,l),this._enableHoverLink(u,i.indexInModelPieceList);var h=t.getRepresentValue(l);if(this._createItemSymbol(u,h,[0,0,s[0],s[1]]),c){var d=this.visualMapModel.getValueState(h);u.add(new Sr({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:r,fill:o,opacity:"outOfRange"===d?.5:1}}))}e.add(u)},this),u&&this._renderEndsText(e,u[1],s,c,a),Ca(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on("mouseover",function(){return i("highlight")}).on("mouseout",function(){return i("downplay")});var i=function(e){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:e,batch:BC(i.findTargetDataIndices(t),i)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return B_(e,this.api,e.itemSize);var n=t.align;return n&&"auto"!==n||(n="left"),n},t.prototype._renderEndsText=function(e,t,n,i,r){if(t){var o=new MF,a=this.visualMapModel.textStyleModel;o.add(new Sr({style:_e(a,{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:t})})),e.add(o)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=mY(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get("text"),i=e.get("orient"),r=e.get("inverse");return("horizontal"===i?r:!r)?t.reverse():n&&(n=n.slice().reverse()),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n){e.add(k6(this.getControllerVisual(t,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(t,"color")))},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,i=n.selectedMode;if(i){var r=mV(n.selected),o=t.getSelectedMapKey(e);"single"===i||!0===i?(r[o]=!0,mq(r,function(e,t){r[t]=t===o})):r[o]=!r[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}},t.type="visualMap.piecewise",t}(Bw);function BG(e){e.registerComponentModel(BV),e.registerComponentView(BW),BF(e)}function B$(e,t){if(!e)return!1;for(var n=m0(e)?e:[e],i=0;i<n.length;i++)if(n[i]&&n[i][t])return!0;return!1}function BU(e){vF(e,"label",["show"])}var Bq=vq(),BY=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n}return yz(t,e),t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(vE.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,i){var r=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),o=Bq(e)[r];if(!n||!n.data){Bq(e)[r]=null;return}o?o._mergeOption(n,t,!0):(i&&BU(n),mq(n.data,function(e){e instanceof Array?(BU(e[0]),BU(e[1])):BU(e)}),mH(o=this.createMarkerModelFromSeries(n,this,t),{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),Bq(e)[r]=o},this)},t.prototype.formatTooltip=function(e,t,n){var i=this.getData(),r=this.getRawValue(e),o=i.getName(e);return C9("section",{header:this.name,blocks:[C9("nameValue",{name:o,value:r,noName:!o,noValue:null==r})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.getMarkerModelFromSeries=function(e,t){return Bq(e)[t]},t.type="marker",t.dependencies=["series","grid","polar","geo"],t}(Cf);m$(BY,CT.prototype);var BZ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markArea",t.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},t}(BY);function BX(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function BK(e,t,n,i,r,o){var a=[],s=yb(t,i)?t.getCalculationInfo("stackResultDimension"):i,l=B5(t,s,e),u=t.indicesOfNearest(s,l)[0];a[r]=t.get(n,u),a[o]=t.get(s,u);var c=t.get(i,u),h=vw(t.get(i,u));return(h=Math.min(h,20))>=0&&(a[o]=+a[o].toFixed(h)),[a,c]}var BQ={min:mJ(BK,"min"),max:mJ(BK,"max"),average:mJ(BK,"average"),median:mJ(BK,"median")};function BJ(e,t){if(t){var n,i=e.getData(),r=e.coordinateSystem,o=r&&r.dimensions;if(!(!isNaN(parseFloat((n=t).x))&&!isNaN(parseFloat(n.y)))&&!m0(t.coord)&&m0(o)){var a=B0(t,i,r,e);if((t=mV(t)).type&&BQ[t.type]&&a.baseAxis&&a.valueAxis){var s=mG(o,a.baseAxis.dim),l=mG(o,a.valueAxis.dim),u=BQ[t.type](i,a.baseDataDim,a.valueDataDim,s,l);t.coord=u[0],t.value=u[1]}else t.coord=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis]}if(null!=t.coord&&m0(o))for(var c=t.coord,h=0;h<2;h++)BQ[c[h]]&&(c[h]=B5(i,i.mapDimension(o[h]),c[h]));else t.coord=[];return t}}function B0(e,t,n,i){var r,o,a,s={};return null!=e.valueIndex||null!=e.valueDim?(s.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,s.valueAxis=n.getAxis((r=i,o=s.valueDataDim,(a=r.getData().getDimensionInfo(o))&&a.coordDim)),s.baseAxis=n.getOtherAxis(s.valueAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim)):(s.baseAxis=i.getBaseAxis(),s.valueAxis=n.getOtherAxis(s.baseAxis),s.baseDataDim=t.mapDimension(s.baseAxis.dim),s.valueDataDim=t.mapDimension(s.valueAxis.dim)),s}function B1(e,t){return!e||!e.containData||!t.coord||!!BX(t)||e.containData(t.coord)}function B2(e,t){return e?function(e,n,i,r){return CE(r<2?e.coord&&e.coord[r]:e.value,t[r])}:function(e,n,i,r){return CE(e.value,t[r])}}function B5(e,t,n){if("average"===n){var i=0,r=0;return e.each(t,function(e,t){!isNaN(e)&&(i+=e,r++)}),i/r}return"median"===n?e.getMedian(t):e.getDataExtent(t)[+("max"===n)]}var B3=vq(),B4=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.init=function(){this.markerGroupMap=vh()},t.prototype.render=function(e,t,n){var i=this,r=this.markerGroupMap;r.each(function(e){B3(e).keep=!1}),t.eachSeries(function(e){var r=BY.getMarkerModelFromSeries(e,i.type);r&&i.renderSeries(e,r,t,n)}),r.each(function(e){B3(e).keep||i.group.remove(e.group)})},t.prototype.markKeep=function(e){B3(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;mq(e,function(e){var i=BY.getMarkerModelFromSeries(e,n.type);i&&i.getData().eachItemGraphicEl(function(e){e&&(t?SA(e,SS):SA(e,S_))})})},t.type="marker",t}(Dp),B6=vq(),B8=function(e,t,n,i){var r=i[0],o=i[1];if(r&&o){var a=BJ(e,r),s=BJ(e,o),l=a.coord,u=s.coord;l[0]=ve(l[0],-1/0),l[1]=ve(l[1],-1/0),u[0]=ve(u[0],1/0),u[1]=ve(u[1],1/0);var c=function(e){for(var t=e[0],n=1,i=e.length;n<i;n++)t=mj(t,e[n],void 0);return t}([{},a,s]);return c.coord=[a.coord,s.coord],c.x0=a.x,c.y0=a.y,c.x1=s.x,c.y1=s.y,c}};function B9(e){return!isNaN(e)&&!isFinite(e)}function B7(e,t,n,i){var r=1-e;return B9(t[r])&&B9(n[r])}function Fe(e,t){var n=t.coord[0],i=t.coord[1],r={coord:n,x:t.x0,y:t.y0},o={coord:i,x:t.x1,y:t.y1};if(kT(e,"cartesian2d"))return!!(n&&i&&(B7(1,n,i,e)||B7(0,n,i,e)))||!e||!e.containZone||!r.coord||!o.coord||!!BX(r)||!!BX(o)||e.containZone(r.coord,o.coord);return B1(e,r)||B1(e,o)}function Ft(e,t,n,i,r){var o,a=i.coordinateSystem,s=e.getItemModel(t),l=vy(s.get(n[0]),r.getWidth()),u=vy(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition){var c=e.getValues(["x0","y0"],t),h=e.getValues(["x1","y1"],t),d=a.clampData(c),f=a.clampData(h),p=[];"x0"===n[0]?p[0]=d[0]>f[0]?h[0]:c[0]:p[0]=d[0]>f[0]?c[0]:h[0],"y0"===n[1]?p[1]=d[1]>f[1]?h[1]:c[1]:p[1]=d[1]>f[1]?c[1]:h[1],o=i.getMarkerPosition(p,n,!0)}else{var g=e.get(n[0],t),m=e.get(n[1],t),v=[g,m];a.clampData&&a.clampData(v,v),o=a.dataToPoint(v,!0)}if(kT(a,"cartesian2d")){var y=a.getAxis("x"),x=a.getAxis("y"),g=e.get(n[0],t),m=e.get(n[1],t);B9(g)?o[0]=y.toGlobalCoord(y.getExtent()[+("x0"!==n[0])]):B9(m)&&(o[1]=x.toGlobalCoord(x.getExtent()[+("y0"!==n[1])]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var Fn=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],Fi=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=BY.getMarkerModelFromSeries(e,"markArea");if(t){var i=t.getData();i.each(function(t){var r=mY(Fn,function(r){return Ft(i,t,r,e,n)});i.setItemLayout(t,r),i.getItemGraphicEl(t).setShape("points",r)})}},this)},t.prototype.renderSeries=function(e,t,n,i){var r=e.coordinateSystem,o=e.id,a=e.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new MF});this.group.add(l.group),this.markKeep(l);var u=function(e,t,n){if(e){var i,r,o=mY(e&&e.dimensions,function(e){var n=t.getData();return mH(mH({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})});i=new Mk(r=mY(["x0","y0","x1","y1"],function(e,t){return{name:e,type:o[t%2].type}}),n)}else i=new Mk(r=[{name:"value",type:"float"}],n);var a=mY(n.get("data"),mJ(B8,t,e,n));e&&(a=mX(a,mJ(Fe,e)));var s=e?function(e,t,n,i){return CE(e.coord[Math.floor(i/2)][i%2],r[i])}:function(e,t,n,i){return CE(e.value,r[i])};return i.initData(a,null,s),i.hasItemOption=!0,i}(r,e,t);t.setData(u),u.each(function(t){var n=mY(Fn,function(n){return Ft(u,t,n,e,i)}),o=r.getAxis("x").scale,s=r.getAxis("y").scale,l=o.getExtent(),c=s.getExtent(),h=[o.parse(u.get("x0",t)),o.parse(u.get("x1",t))],d=[s.parse(u.get("y0",t)),s.parse(u.get("y1",t))];vb(h),vb(d);var f=!(l[0]>h[1]||l[1]<h[0]||c[0]>d[1]||c[1]<d[0]);u.setItemLayout(t,{points:n,allClipped:!f});var p=u.getItemModel(t).getModel("itemStyle").getItemStyle(),g=D$(a,"color");!p.fill&&(p.fill=g,m2(p.fill)&&(p.fill=b_(p.fill,.4))),p.stroke||(p.stroke=g),u.setItemVisual(t,"style",p)}),u.diff(B6(l).data).add(function(e){var t=u.getItemLayout(e);if(!t.allClipped){var n=new Ay({shape:{points:t.points}});u.setItemGraphicEl(e,n),l.group.add(n)}}).update(function(e,n){var i=B6(l).data.getItemGraphicEl(n),r=u.getItemLayout(e);r.allClipped?i&&l.group.remove(i):(i?SQ(i,{shape:{points:r.points}},t,e):i=new Ay({shape:{points:r.points}}),u.setItemGraphicEl(e,i),l.group.add(i))}).remove(function(e){var t=B6(l).data.getItemGraphicEl(e);l.group.remove(t)}).execute(),u.eachItemGraphicEl(function(e,n){var i=u.getItemModel(n),r=u.getItemVisual(n,"style");e.useStyle(u.getItemVisual(n,"style")),S9(e,S7(i),{labelFetcher:t,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:m2(r.fill)?b_(r.fill,1):"#000"}),SG(e,i),Sj(e,null,null,i.get(["emphasis","disabled"])),So(e).dataModel=t}),B6(l).data=u,l.group.silent=t.get("silent")||e.get("silent")},t.type="markArea",t}(B4),Fr=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markLine",t.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},t}(BY),Fo=AM.prototype,Fa=AD.prototype,Fs=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function Fl(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}yz(function(){return null!==k&&k.apply(this,arguments)||this},k=Fs);var Fu=function(e){function t(t){var n=e.call(this,t)||this;return n.type="ec-line",n}return yz(t,e),t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new Fs},t.prototype.buildPath=function(e,t){Fl(t)?Fo.buildPath.call(this,e,t):Fa.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return Fl(this.shape)?Fo.pointAt.call(this,e):Fa.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=Fl(t)?[t.x2-t.x1,t.y2-t.y1]:Fa.tangentAt.call(this,e);return xL(n,n)},t}(wV),Fc=["fromSymbol","toSymbol"];function Fh(e){return"_"+e+"Type"}function Fd(e,t,n){var i=t.getItemVisual(n,e);if(!i||"none"===i)return i;var r=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=k8(r),u=k9(a||0,l);return i+l+u+(o||"")+(s||"")}function Ff(e,t,n){var i=t.getItemVisual(n,e);if(i&&"none"!==i){var r=t.getItemVisual(n,e+"Size"),o=t.getItemVisual(n,e+"Rotate"),a=t.getItemVisual(n,e+"Offset"),s=t.getItemVisual(n,e+"KeepAspect"),l=k8(r),u=k9(a||0,l),c=k6(i,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return c.__specifiedRotation=null==o||isNaN(o)?void 0:o*Math.PI/180||0,c.name=e,c}}function Fp(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var Fg=function(e){function t(t,n,i){var r=e.call(this)||this;return r._createLine(t,n,i),r}return yz(t,e),t.prototype._createLine=function(e,t,n){var i,r,o=e.hostModel,a=(i=e.getItemLayout(t),Fp((r=new Fu({name:"line",subPixelOptimize:!0})).shape,i),r);a.shape.percent=0,SJ(a,{shape:{percent:1}},o,t),this.add(a),mq(Fc,function(n){var i=Ff(n,e,t);this.add(i),this[Fh(n)]=Fd(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),o=e.getItemLayout(t),a={shape:{}};Fp(a.shape,o),SQ(r,a,i,t),mq(Fc,function(n){var i=Fd(n,e,t),r=Fh(n);if(this[r]!==i){this.remove(this.childOfName(n));var o=Ff(n,e,t);this.add(o)}this[r]=i},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var i=e.hostModel,r=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,c=n&&n.focus,h=n&&n.blurScope;if(!n||e.hasItemOption){var d=e.getItemModel(t),f=d.getModel("emphasis");o=f.getModel("lineStyle").getLineStyle(),a=d.getModel(["blur","lineStyle"]).getLineStyle(),s=d.getModel(["select","lineStyle"]).getLineStyle(),u=f.get("disabled"),c=f.get("focus"),h=f.get("blurScope"),l=S7(d)}var p=e.getItemVisual(t,"style"),g=p.stroke;r.useStyle(p),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,r.ensureState("blur").style=a,r.ensureState("select").style=s,mq(Fc,function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=p.opacity;for(var n=0;n<Sh.length;n++){var i=Sh[n],o=r.getState(i);if(o){var a=o.style||{},s=t.ensureState(i),l=s.style||(s.style={});null!=a.stroke&&(l[t.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}t.markRedraw()}},this);var m=i.getRawValue(t);S9(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return i.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||"#000",defaultOpacity:p.opacity,defaultText:(null==m?e.getName(t):isFinite(m)?vx(m):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var x=y.get("distance");m0(x)||(x=[x,x]),v.__labelDistance=x}this.setTextConfig({position:null,local:!0,inside:!1}),Sj(this,c,h,u)},t.prototype.highlight=function(){SP(this)},t.prototype.downplay=function(){SR(this)},t.prototype.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName("line");Fp(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this.childOfName("fromSymbol"),t=this.childOfName("toSymbol"),n=this.getTextContent();if(e||t||n&&!n.ignore){for(var i=1,r=this.parent;r;)r.scaleX&&(i/=r.scaleX),r=r.parent;var o=this.childOfName("line");if(this.__dirty||o.__dirty){var a=o.shape.percent,s=o.pointAt(0),l=o.pointAt(a),u=xR([],l,s);if(xL(u,u),e&&(e.setPosition(s),S(e,0),e.scaleX=e.scaleY=i*a,e.markRedraw()),t&&(t.setPosition(l),S(t,1),t.scaleX=t.scaleY=i*a,t.markRedraw()),n&&!n.ignore){n.x=n.y=0,n.originX=n.originY=0;var c=void 0,h=void 0,d=n.__labelDistance,f=d[0]*i,p=d[1]*i,g=a/2,m=o.tangentAt(g),v=[m[1],-m[0]],y=o.pointAt(g);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var x=m[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var b=-Math.atan2(m[1],m[0]);l[0]<s[0]&&(b=Math.PI+b),n.rotation=b}var w=void 0;switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-p,h="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=p,h="top";break;default:w=0,h="middle"}switch(n.__position){case"end":n.x=u[0]*f+l[0],n.y=u[1]*p+l[1],c=u[0]>.8?"left":u[0]<-.8?"right":"center",h=u[1]>.8?"top":u[1]<-.8?"bottom":"middle";break;case"start":n.x=-u[0]*f+s[0],n.y=-u[1]*p+s[1],c=u[0]>.8?"right":u[0]<-.8?"left":"center",h=u[1]>.8?"bottom":u[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":n.x=f*x+s[0],n.y=s[1]+w,c=m[0]<0?"right":"left",n.originX=-f*x,n.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":n.x=y[0],n.y=y[1]+w,c="center",n.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":n.x=-f*x+l[0],n.y=l[1]+w,c=m[0]>=0?"right":"left",n.originX=f*x,n.originY=-w}n.scaleX=n.scaleY=i,n.setStyle({verticalAlign:n.__verticalAlign||h,align:n.__align||c})}}}function S(e,t){var n=e.__specifiedRotation;if(null==n){var i=o.tangentAt(t);e.attr("rotation",(1===t?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else e.attr("rotation",n)}},t}(MF),Fm=function(){function e(e){this.group=new MF,this._LineCtor=e||Fg}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this.group,i=this._lineData;this._lineData=e,i||n.removeAll();var r=Fv(e);e.diff(i).add(function(n){t._doAdd(e,n,r)}).update(function(n,o){t._doUpdate(i,e,o,n,r)}).remove(function(e){n.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=Fv(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){function n(e){var t;e.isGroup||(t=e).animators&&t.animators.length>0||(e.incremental=!0,e.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=e.start;i<e.end;i++)if(Fx(t.getItemLayout(i))){var r=new this._LineCtor(t,i,this._seriesScope);r.traverse(n),this.group.add(r),t.setItemGraphicEl(i,r),this._progressiveEls.push(r)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){kl(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(Fx(e.getItemLayout(t))){var i=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,i),this.group.add(i)}},e.prototype._doUpdate=function(e,t,n,i,r){var o=e.getItemGraphicEl(n);Fx(t.getItemLayout(i))?(o?o.updateData(t,i,r):o=new this._LineCtor(t,i,r),t.setItemGraphicEl(i,o),this.group.add(o)):this.group.remove(o)},e}();function Fv(e){var t=e.hostModel,n=t.getModel("emphasis");return{lineStyle:t.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:t.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:t.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:S7(t)}}function Fy(e){return isNaN(e[0])||isNaN(e[1])}function Fx(e){return e&&!Fy(e[0])&&!Fy(e[1])}var Fb=vq(),Fw=function(e,t,n,i){var r,o=e.getData();if(m0(i))r=i;else{var a=i.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=t.getAxis(null!=i.yAxis?"y":"x"),l=ve(i.yAxis,i.xAxis);else{var u=B0(i,o,t,e);s=u.valueAxis;var c=yw(o,u.valueDataDim);l=B5(o,c,a)}var h=+("x"!==s.dim),d=1-h,f=mV(i),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var g=n.get("precision");g>=0&&m3(l)&&(l=+l.toFixed(Math.min(g,20))),f.coord[h]=p.coord[h]=l,r=[f,p,{type:a,valueIndex:i.valueIndex,value:l}]}else r=[]}var m=[BJ(e,r[0]),BJ(e,r[1]),mH({},r[2])];return m[2].type=m[2].type||null,mj(m[2],m[0]),mj(m[2],m[1]),m};function FS(e){return!isNaN(e)&&!isFinite(e)}function F_(e,t,n,i){var r=1-e,o=i.dimensions[e];return FS(t[r])&&FS(n[r])&&t[e]===n[e]&&i.getAxis(o).containData(t[e])}function FC(e,t){if("cartesian2d"===e.type){var n=t[0].coord,i=t[1].coord;if(n&&i&&(F_(1,n,i,e)||F_(0,n,i,e)))return!0}return B1(e,t[0])&&B1(e,t[1])}function FM(e,t,n,i,r){var o,a=i.coordinateSystem,s=e.getItemModel(t),l=vy(s.get("x"),r.getWidth()),u=vy(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(u)){if(i.getMarkerPosition)o=i.getMarkerPosition(e.getValues(e.dimensions,t));else{var c=a.dimensions,h=e.get(c[0],t),d=e.get(c[1],t);o=a.dataToPoint([h,d])}if(kT(a,"cartesian2d")){var f=a.getAxis("x"),p=a.getAxis("y"),c=a.dimensions;FS(e.get(c[0],t))?o[0]=f.toGlobalCoord(f.getExtent()[+!n]):FS(e.get(c[1],t))&&(o[1]=p.toGlobalCoord(p.getExtent()[+!n]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];e.setItemLayout(t,o)}var FA=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=BY.getMarkerModelFromSeries(e,"markLine");if(t){var i=t.getData(),r=Fb(t).from,o=Fb(t).to;r.each(function(t){FM(r,t,!0,e,n),FM(o,t,!1,e,n)}),i.each(function(e){i.setItemLayout(e,[r.getItemLayout(e),o.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,i){var r,o,a,s,l,u,c,h,d,f=e.coordinateSystem,p=e.id,g=e.getData(),m=this.markerGroupMap,v=m.get(p)||m.set(p,new Fm);this.group.add(v.group);var y=(r=f,o=e,a=t,l=new Mk(s=r?mY(r&&r.dimensions,function(e){return mH(mH({},o.getData().getDimensionInfo(o.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],a),u=new Mk(s,a),c=new Mk([],a),h=mY(a.get("data"),mJ(Fw,o,r,a)),r&&(h=mX(h,mJ(FC,r))),d=B2(!!r,s),l.initData(mY(h,function(e){return e[0]}),null,d),u.initData(mY(h,function(e){return e[1]}),null,d),c.initData(mY(h,function(e){return e[2]})),c.hasItemOption=!0,{from:l,to:u,line:c}),x=y.from,b=y.to,w=y.line;Fb(t).from=x,Fb(t).to=b,t.setData(w);var S=t.get("symbol"),_=t.get("symbolSize"),C=t.get("symbolRotate"),M=t.get("symbolOffset");function A(t,n,r){var o=t.getItemModel(n);FM(t,n,r,e,i);var a=o.getModel("itemStyle").getItemStyle();null==a.fill&&(a.fill=D$(g,"color")),t.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:vt(o.get("symbolOffset",!0),M[+!r]),symbolRotate:vt(o.get("symbolRotate",!0),C[+!r]),symbolSize:vt(o.get("symbolSize"),_[+!r]),symbol:vt(o.get("symbol",!0),S[+!r]),style:a})}m0(S)||(S=[S,S]),m0(_)||(_=[_,_]),m0(C)||(C=[C,C]),m0(M)||(M=[M,M]),y.from.each(function(e){A(x,e,!0),A(b,e,!1)}),w.each(function(e){var t=w.getItemModel(e).getModel("lineStyle").getLineStyle();w.setItemLayout(e,[x.getItemLayout(e),b.getItemLayout(e)]),null==t.stroke&&(t.stroke=x.getItemVisual(e,"style").fill),w.setItemVisual(e,{fromSymbolKeepAspect:x.getItemVisual(e,"symbolKeepAspect"),fromSymbolOffset:x.getItemVisual(e,"symbolOffset"),fromSymbolRotate:x.getItemVisual(e,"symbolRotate"),fromSymbolSize:x.getItemVisual(e,"symbolSize"),fromSymbol:x.getItemVisual(e,"symbol"),toSymbolKeepAspect:b.getItemVisual(e,"symbolKeepAspect"),toSymbolOffset:b.getItemVisual(e,"symbolOffset"),toSymbolRotate:b.getItemVisual(e,"symbolRotate"),toSymbolSize:b.getItemVisual(e,"symbolSize"),toSymbol:b.getItemVisual(e,"symbol"),style:t})}),v.updateData(w),y.line.eachItemGraphicEl(function(e){So(e).dataModel=t,e.traverse(function(e){So(e).dataModel=t})}),this.markKeep(v),v.group.silent=t.get("silent")||e.get("silent")},t.type="markLine",t}(B4),Fk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.createMarkerModelFromSeries=function(e,n,i){return new t(e,n,i)},t.type="markPoint",t.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}(BY);function FT(e,t,n){var i=t.coordinateSystem;e.each(function(r){var o,a=e.getItemModel(r),s=vy(a.get("x"),n.getWidth()),l=vy(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,r));else if(i){var u=e.get(i.dimensions[0],r),c=e.get(i.dimensions[1],r);o=i.dataToPoint([u,c])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),e.setItemLayout(r,o)})}var FI=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.type=t.type,n}return yz(t,e),t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=BY.getMarkerModelFromSeries(e,"markPoint");t&&(FT(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,i){var r,o,a,s,l,u,c,h=e.coordinateSystem,d=e.id,f=e.getData(),p=this.markerGroupMap,g=p.get(d)||p.set(d,new To),m=(r=h,o=e,a=t,l=new Mk(s=r?mY(r&&r.dimensions,function(e){return mH(mH({},o.getData().getDimensionInfo(o.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:"value",type:"float"}],a),u=mY(a.get("data"),mJ(BJ,o)),r&&(u=mX(u,mJ(B1,r))),c=B2(!!r,s),l.initData(u,null,c),l);t.setData(m),FT(t.getData(),e,i),m.each(function(e){var n=m.getItemModel(e),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),a=n.getShallow("symbolOffset"),s=n.getShallow("symbolKeepAspect");if(m1(i)||m1(r)||m1(o)||m1(a)){var l=t.getRawValue(e),u=t.getDataParams(e);m1(i)&&(i=i(l,u)),m1(r)&&(r=r(l,u)),m1(o)&&(o=o(l,u)),m1(a)&&(a=a(l,u))}var c=n.getModel("itemStyle").getItemStyle(),h=D$(f,"color");c.fill||(c.fill=h),m.setItemVisual(e,{symbol:i,symbolSize:r,symbolRotate:o,symbolOffset:a,symbolKeepAspect:s,style:c})}),g.updateData(m),this.group.add(g.group),m.eachItemGraphicEl(function(e){e.traverse(function(e){So(e).dataModel=t})}),this.markKeep(g),g.group.silent=t.get("silent")||e.get("silent")},t.type="markPoint",t}(B4);function FD(e,t,n){var i=mA.createCanvas(),r=t.getWidth(),o=t.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=r+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",e)),i.width=r*n,i.height=o*n,i}var FO=function(e){function t(t,n,i){var r,o=e.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,i=i||bj,"string"==typeof t?r=FD(t,n,i):m4(t)&&(t=(r=t).id),o.id=t,o.dom=r;var a=r.style;return a&&(vf(r),r.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=i,o}return yJ(t,e),t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=FD("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,o=[],a=this.maxRepaintRectCount,s=!1,l=new xd(0,0,0,0);function u(e){if(!(!e.isFinite()||e.isZero()))if(0===o.length){var t=new xd(0,0,0,0);t.copy(e),o.push(t)}else{for(var n=!1,i=1/0,r=0,u=0;u<o.length;++u){var c=o[u];if(c.intersect(e)){var h=new xd(0,0,0,0);h.copy(c),h.union(e),o[u]=h,n=!0;break}if(s){l.copy(e),l.union(c);var d=e.width*e.height,f=c.width*c.height,p=l.width*l.height-d-f;p<i&&(i=p,r=u)}}if(s&&(o[r].union(e),n=!0),!n){var t=new xd(0,0,0,0);t.copy(e),o.push(t)}s||(s=o.length>=a)}}for(var c=this.__startIndex;c<this.__endIndex;++c){var h=e[c];if(h){var d=h.shouldBePainted(n,i,!0,!0),f=h.__isRendered&&(1&h.__dirty||!d)?h.getPrevPaintRect():null;f&&u(f);var p=d&&(1&h.__dirty||!h.__isRendered)?h.getPaintRect():null;p&&u(p)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var h=t[c],d=h&&h.shouldBePainted(n,i,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var f=h.getPrevPaintRect();f&&u(f)}}do{r=!1;for(var c=0;c<o.length;){if(o[c].isZero()){o.splice(c,1);continue}for(var g=c+1;g<o.length;)o[c].intersect(o[g])?(r=!0,o[c].union(o[g]),o.splice(g,1)):g++;c++}}while(r);return this._paintRects=o,o},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,i=this.dom,r=i.style,o=this.domBack;r&&(r.width=e+"px",r.height=t+"px"),i.width=e*n,i.height=t*n,o&&(o.width=e*n,o.height=t*n,1!==n&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var i=this.dom,r=this.ctx,o=i.width,a=i.height;t=t||this.clearColor;var s=this.motionBlur&&!e,l=this.lastFrameAlpha,u=this.dpr,c=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,o/u,a/u));var h=this.domBack;function d(e,n,i,o){if(r.clearRect(e,n,i,o),t&&"transparent"!==t){var a=void 0;m7(t)?(a=(t.global||t.__width===i&&t.__height===o)&&t.__canvasGradient||DK(r,t,{x:0,y:0,width:i,height:o}),t.__canvasGradient=a,t.__width=i,t.__height=o):null!=t.image&&(t.scaleX=t.scaleX||u,t.scaleY=t.scaleY||u,a=D8(r,t,{dirty:function(){c.setUnpainted(),c.painter.refresh()}})),r.save(),r.fillStyle=a||t,r.fillRect(e,n,i,o),r.restore()}s&&(r.save(),r.globalAlpha=l,r.drawImage(h,e,n,i,o),r.restore())}!n||s?d(0,0,o,a):n.length&&mq(n,function(e){d(e.x*u,e.y*u,e.width*u,e.height*u)})},t}(bz),FP=function(){function e(e,t,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var r=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=n=mH({},n||{}),this.dpr=n.devicePixelRatio||bj,this._singleCanvas=r,this.root=e,e.style&&(vf(e),e.innerHTML=""),this.storage=t;var o=this._zlevelList;this._prevDisplayList=[];var a=this._layers;if(r){var s=e.width,l=e.height;null!=n.width&&(s=n.width),null!=n.height&&(l=n.height),this.dpr=n.devicePixelRatio||1,e.width=s*this.dpr,e.height=l*this.dpr,this._width=s,this._height=l;var u=new FO(e,this,this.dpr);u.__builtin__=!0,u.initContext(),a[314159]=u,u.zlevel=314159,o.push(314159),this._domRoot=e}else{this._width=DJ(e,0,n),this._height=DJ(e,1,n);var c,h,d,f=this._domRoot=(c=this._width,h=this._height,(d=document.createElement("div")).style.cssText=["position:relative","width:"+c+"px","height:"+h+"px","padding:0;margin:0;border-width:0"].join(";")+";",d);e.appendChild(f)}}return e.prototype.getType=function(){return"canvas"},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,n,e,this._redrawId);for(var r=0;r<i.length;r++){var o=i[r],a=this._layers[o];if(!a.__builtin__&&a.refresh){var s=0===r?this._backgroundColor:null;a.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=t.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(e){var t,n=e.length,i=this._hoverlayer;if(i&&i.clear(),n){for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<n;o++){var a=e[o];a.__inHover&&(i||(i=this._hoverlayer=this.getLayer(1e5)),t||(t=i.ctx).save(),Oa(t,a,r,o===n-1))}t&&t.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(1e5)},e.prototype.paintOne=function(e,t){Oo(e,t)},e.prototype._paintList=function(e,t,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var r=this._doPaintList(e,t,n),o=r.finished,a=r.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(e),o)this.eachLayer(function(e){e.afterBrush&&e.afterBrush()});else{var s=this;Y(function(){s._paintList(e,t,n,i)})}}},e.prototype._compositeManually=function(){var e=this.getLayer(314159).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,t,n)})},e.prototype._doPaintList=function(e,t,n){for(var i=this,r=[],o=this._opts.useDirtyRect,a=0;a<this._zlevelList.length;a++){var s=this._zlevelList[a],l=this._layers[s];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||n)&&r.push(l)}for(var u=!0,c=!1,h=this,d=0;d<r.length;d++)!function(a){var s,l=r[a],d=l.ctx,f=o&&l.createRepaintRects(e,t,h._width,h._height),p=n?l.__startIndex:l.__drawIndex,g=!n&&l.incremental&&Date.now,m=g&&Date.now(),v=l.zlevel===h._zlevelList[0]?h._backgroundColor:null;if(l.__startIndex===l.__endIndex)l.clear(!1,v,f);else if(p===l.__startIndex){var y=e[p];y.incremental&&y.notClear&&!n||l.clear(!1,v,f)}-1===p&&(console.error("For some unknown reason. drawIndex is -1"),p=l.__startIndex);var x=function(t){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(s=p;s<l.__endIndex;s++){var r=e[s];if(r.__inHover&&(c=!0),i._doPaintEl(r,l,o,t,n,s===l.__endIndex-1),g&&Date.now()-m>15)break}n.prevElClipPaths&&d.restore()};if(f)if(0===f.length)s=l.__endIndex;else for(var b=h.dpr,w=0;w<f.length;++w){var S=f[w];d.save(),d.beginPath(),d.rect(S.x*b,S.y*b,S.width*b,S.height*b),d.clip(),x(S),d.restore()}else d.save(),x(),d.restore();l.__drawIndex=s,l.__drawIndex<l.__endIndex&&(u=!1)}(d);return vE.wxa&&mq(this._layers,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),{finished:u,needsRefreshHover:c}},e.prototype._doPaintEl=function(e,t,n,i,r,o){var a=t.ctx;if(n){var s=e.getPaintRect();(!i||s&&s.intersect(i))&&(Oa(a,e,r,o),e.setPrevPaintRect(s))}else Oa(a,e,r,o)},e.prototype.getLayer=function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=314159);var n=this._layers[e];return n||((n=new FO("zr_"+e,this,this.dpr)).zlevel=e,n.__builtin__=!0,this._layerConfig[e]?mj(n,this._layerConfig[e],!0):this._layerConfig[e-.01]&&mj(n,this._layerConfig[e-.01],!0),t&&(n.virtual=t),this.insertLayer(e,n),n.initContext()),n},e.prototype.insertLayer=function(e,t){var n=this._layers,i=this._zlevelList,r=i.length,o=this._domRoot,a=null,s=-1;if(!n[e]){if(t&&(t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh&&1)){if(r>0&&e>i[0]){for(s=0;s<r-1&&(!(i[s]<e)||!(i[s+1]>e));s++);a=n[i[s]]}if(i.splice(s+1,0,e),n[e]=t,!t.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(t.dom,l.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i];e.call(t,this._layers[r],r)}},e.prototype.eachBuiltinLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],o=this._layers[r];o.__builtin__&&e.call(t,o,r)}},e.prototype.eachOtherLayer=function(e,t){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],o=this._layers[r];o.__builtin__||e.call(t,o,r)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(e){function t(e){a&&(a.__endIndex!==e&&(a.__dirty=!0),a.__endIndex=e)}if(this.eachBuiltinLayer(function(e,t){e.__dirty=e.__used=!1}),this._singleCanvas)for(var n,i,r=1;r<e.length;r++){var o=e[r];if(o.zlevel!==e[r-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var a=null,s=0;for(i=0;i<e.length;i++){var o=e[i],l=o.zlevel,u=void 0;n!==l&&(n=l,s=0),o.incremental?((u=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,s=1):u=this.getLayer(l+.01*(s>0),this._needsManuallyCompositing),u.__builtin__||mz("ZLevel "+l+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==i&&(u.__dirty=!0),u.__startIndex=i,u.incremental?u.__drawIndex=-1:u.__drawIndex=i,t(i),a=u),1&o.__dirty&&!o.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=i))}t(i),this.eachBuiltinLayer(function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,mq(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?mj(n[e],t,!0):n[e]=t;for(var i=0;i<this._zlevelList.length;i++){var r=this._zlevelList[i];(r===e||r===e+.01)&&mj(this._layers[r],n[e],!0)}}},e.prototype.delLayer=function(e){var t=this._layers,n=this._zlevelList,i=t[e];i&&(i.dom.parentNode.removeChild(i.dom),delete t[e],n.splice(mG(n,e),1))},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,r=this.root;if(null!=e&&(i.width=e),null!=t&&(i.height=t),e=DJ(r,0,i),t=DJ(r,1,i),n.style.display="",this._width!==e||t!==this._height){for(var o in n.style.width=e+"px",n.style.height=t+"px",this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,t);this.refresh(!0)}this._width=e,this._height=t}else{if(null==e||null==t)return;this._width=e,this._height=t,this.getLayer(314159).resize(e,t)}return this},e.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},e.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new FO("image",this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,r=t.dom.height;this.eachLayer(function(e){e.__builtin__?n.drawImage(e.dom,0,0,i,r):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},a=this.storage.getDisplayList(!0),s=0,l=a.length;s<l;s++)Oa(n,a[s],o,s===l-1);return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}();OY([function(e){e.registerComponentModel(Eh),e.registerComponentView(Ed)},function(e){OY(EW),OY(EK)},function(e){OY(E8),OY(Li)},function(e){e.registerChartView(kN),e.registerSeriesModel(MN),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,mJ(yP,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,{seriesType:"bar",plan:yS(),reset:function(e){if(yR(e)){var t,n=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),o=i.getOtherAxis(r),a=n.getDimensionIndex(n.mapDimension(o.dim)),s=n.getDimensionIndex(n.mapDimension(r.dim)),l=e.get("showBackground",!0),u=n.mapDimension(o.dim),c=n.getCalculationInfo("stackResultDimension"),h=yb(n,u)&&!!n.getCalculationInfo("stackedOnSeries"),d=o.isHorizontal(),f=(t=o).toGlobalCoord(t.dataToCoord(+("log"===t.type))),p=yE(e),g=e.get("barMinHeight")||0,m=c&&n.getDimensionIndex(c),v=n.getLayout("size"),y=n.getLayout("offset");return{progress:function(e,t){for(var n,r=e.count,o=p&&yM(3*r),u=p&&l&&yM(3*r),c=p&&yM(r),x=i.master.getRect(),b=d?x.width:x.height,w=t.getStore(),S=0;null!=(n=e.next());){var _=w.get(h?m:a,n),C=w.get(s,n),M=f,A=void 0;h&&(A=_-w.get(a,n));var k=void 0,T=void 0,I=void 0,D=void 0;if(d){var O=i.dataToPoint([_,C]);if(h){var P=i.dataToPoint([A,C]);M=P[0]}k=M,T=O[1]+y,I=O[0]-M,D=v,Math.abs(I)<g&&(I=(I<0?-1:1)*g)}else{var O=i.dataToPoint([C,_]);if(h){var P=i.dataToPoint([C,A]);M=P[1]}k=O[0]+y,T=M,I=v,Math.abs(D=O[1]-M)<g&&(D=(D<=0?-1:1)*g)}p?(o[S]=k,o[S+1]=T,o[S+2]=d?I:D,u&&(u[S]=d?x.x:k,u[S+1]=d?T:x.y,u[S+2]=b),c[n]=n):t.setItemLayout(n,{x:k,y:T,width:I,height:D}),S+=3}p&&t.setLayout({largePoints:o,largeDataIndices:c,largeBackgroundPoints:u,valueAxisHorizontal:d})}}}}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,yB("bar")),e.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})})},function(e){e.registerChartView(TC),e.registerSeriesModel(k7),e.registerLayout(TM("line",!0)),e.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,yB("line"))},function(e){e.registerChartView(TI),e.registerSeriesModel(TO)},function(e){var t;e.registerChartView(TJ),e.registerSeriesModel(T2),t=e.registerAction,mq([["pieToggleSelect","toggleSelect"],["pieSelect","select"],["pieUnSelect","unselect"]],function(e){t(e[0],function(t,n,i){var r,o;t=mH({},t),i.dispatchAction(mH(t,{type:e[1],seriesIndex:(r=t,o=[],n.eachComponent({mainType:"series",subType:"pie",query:r},function(e){o.push(e.seriesIndex)}),o)}))})}),e.registerLayout(mJ(TB,"pie")),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=t.findComponents({mainType:"legend"});if(n&&n.length){var i=e.getData();i.filterSelf(function(e){for(var t=i.getName(e),r=0;r<n.length;r++)if(!n[r].isSelected(t))return!1;return!0})}}}),e.registerProcessor({seriesType:"pie",reset:function(e,t){var n=e.getData();n.filterSelf(function(e){var t=n.mapDimension("value"),i=n.get(t,e);return!m3(i)||!!isNaN(i)||!(i<0)})}})},function(e){OY(Ry),e.registerSeriesModel(OZ),e.registerChartView(OJ),e.registerLayout(TM("scatter"))},function(e){e.registerChartView(R2),e.registerSeriesModel(RS)},function(e){e.registerChartView(Eu),e.registerSeriesModel(Ec)},function(e){OY(Ry),OY(LD)},function(e){e.registerComponentModel(LO),e.registerComponentView(LP)},function(e){e.registerComponentModel(LF),e.registerComponentView(Lz),LB.saveAsImage=LV,LB.magicType=LW,LB.dataView=LY,LB.dataZoom=NH,LB.restore=LK,OY(LL)},function(e){OY(LD),e.registerComponentModel(N$),e.registerComponentView(N8),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},vg),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},vg)},function(e){e.registerPainter("canvas",FP)},function(e){OY(Bz),OY(BG)},function(e){e.registerComponentModel(BZ),e.registerComponentView(Fi),e.registerPreprocessor(function(e){B$(e.series,"markArea")&&(e.markArea=e.markArea||{})})},function(e){e.registerComponentModel(Fr),e.registerComponentView(FA),e.registerPreprocessor(function(e){B$(e.series,"markLine")&&(e.markLine=e.markLine||{})})},function(e){e.registerComponentModel(Fk),e.registerComponentView(FI),e.registerPreprocessor(function(e){B$(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}]);let FR=["click","dblclick","mousedown","mousemove","mouseup","mouseover","mouseout","globalout","contextmenu"],FE=["datazoom","downplay","highlight"],FL=(0,eI.memo)(function({option:e,theme:t,renderer:n,sx:i,style:r,onEvents:o,_instance:a,syncGroup:s,onChartInitialized:l}){let u=(0,eI.useRef)(e),c=(0,eI.useRef)(e),h=(0,eI.useRef)(null),d=(0,eI.useRef)(null);return(0,eI.useLayoutEffect)(()=>{if(null!==h.current&&null===d.current&&(d.current=function(e,t,n){var i=!(n&&n.ssr);if(i){var r=function(e){return OE[e.getAttribute?e.getAttribute(OF):e[OF]]}(e);if(r)return r}var o=new OC(e,t,n);return o.id="ec_"+ON++,OE[o.id]=o,i&&v0(e,OF,o.id),ep(o),Od.trigger("afterinit",o),o}(h.current,t,{renderer:n??"canvas"}),void 0!==d.current))return d.current.setOption(u.current,!0),l?.(d.current),void 0!==a&&(a.current=d.current),()=>{null!==d.current&&(d.current.dispose(),d.current=null)}},[a,l,t,n]),(0,eI.useEffect)(()=>{d.current&&s&&(d.current.group=s,function(e){if(m0(e)){var t=e;e=null,mq(t,function(t){null!=t.group&&(e=t.group)}),e=e||"g_"+OB++,mq(t,function(t){t.group=e})}OL[e]=!0}([d.current]))},[s,d]),(0,eI.useEffect)(()=>{void 0===c.current||r3(c.current,e)||d.current&&(d.current.setOption(e,!0),c.current=e)},[e]),(0,eI.useLayoutEffect)(()=>{let e=pO(()=>{d.current&&d.current.resize()},200);return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),(0,eI.useEffect)(()=>{let e=d.current;if(e&&void 0!==o)return function(e,t){if(void 0!==t){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n]??null;i&&function(t,n){var i,r;"function"==typeof n&&((i=t,FR.includes(i))?e.on(t,t=>n(t,e)):(r=t,FE.includes(r))?e.on(t,e=>n(e)):e.on(t,()=>n(null,e)))}(n,i)}}}(e,o),()=>{if(void 0!==e&&!0!==e.isDisposed())for(let t in o)e.off(t)}},[o]),(0,eI.useEffect)(()=>{pO(()=>{d.current&&d.current.resize()},200,{leading:!0})()},[i,r]),(0,eb.jsx)(ua.A,{ref:h,sx:i,style:r})});var FN=n(17157);function FB(e,t){return function(n){let i=new Date(Number(n));return e>15768e7?(0,FN.formatWithTimeZone)(i,"yyyy",t):e>15552e6?(0,FN.formatWithTimeZone)(i,"MMM yyyy",t):e>864e6?(0,FN.formatWithTimeZone)(i,"dd.MM",t):e>1728e5?(0,FN.formatWithTimeZone)(i,"dd.MM HH:mm",t):(0,FN.formatWithTimeZone)(i,"HH:mm",t)}}var FF=n(34007);function Fz(e){let{error:t}=e;return(0,eb.jsx)(FF.A,{severity:"error",children:t.message})}var FV=n(77440);let Fj=[{id:"default",label:"Default",value:void 0},{id:"12",label:"12",value:12},{id:"14",label:"14",value:14},{id:"16",label:"16",value:16},{id:"20",label:"20",value:20},{id:"24",label:"24",value:24},{id:"28",label:"28",value:28},{id:"32",label:"32",value:32},{id:"36",label:"36",value:36},{id:"40",label:"40",value:40},{id:"48",label:"48",value:48},{id:"56",label:"56",value:56},{id:"64",label:"64",value:64},{id:"72",label:"72",value:72},{id:"96",label:"96",value:96},{id:"128",label:"128",value:128},{id:"160",label:"160",value:160},{id:"192",label:"192",value:192}];function FH({value:e,onChange:t}){return(0,eb.jsx)(gt,{label:"Font Size",control:(0,eb.jsx)(ga,{value:Fj.find(t=>t.value===e),options:Fj,getOptionLabel:e=>e.label,onChange:(e,{value:n})=>{t(n)},disableClearable:!0})})}function FW({action:e,submitText:t="Save",cancelText:n="Cancel",isReadonly:i,isValid:r,onActionChange:o,onSubmit:a,onDelete:s,onCancel:l,...u}){return(0,eb.jsx)(eC.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},...u,children:"read"===e?(0,eb.jsxs)(eb.Fragment,{children:[o&&(0,eb.jsx)(eS.A,{disabled:i,variant:"contained",onClick:()=>o("update"),children:"Edit"}),s&&(0,eb.jsx)(eS.A,{color:"error",disabled:i,variant:"outlined",onClick:s,children:"Delete"}),l&&(a||s)&&(0,eb.jsx)(pb.A,{orientation:"vertical",flexItem:!0,sx:{borderColor:e=>e.palette.grey["500"],"&.MuiDivider-root":{marginLeft:2,marginRight:1}}}),l&&(0,eb.jsx)(eS.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]}):(0,eb.jsxs)(eb.Fragment,{children:[a&&(0,eb.jsx)(eS.A,{variant:"contained",disabled:!r,onClick:a,children:t}),l&&(0,eb.jsx)(eS.A,{color:"secondary",variant:"outlined",onClick:l,children:n})]})})}let FG=0;class F${constructor(e,t){this.from=e,this.to=t}}class FU{constructor(e={}){this.id=FG++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=FZ.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}FU.closedBy=new FU({deserialize:e=>e.split(" ")}),FU.openedBy=new FU({deserialize:e=>e.split(" ")}),FU.group=new FU({deserialize:e=>e.split(" ")}),FU.isolate=new FU({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),FU.contextHash=new FU({perNode:!0}),FU.lookAhead=new FU({perNode:!0}),FU.mounted=new FU({perNode:!0});class Fq{constructor(e,t,n,i=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[FU.mounted.id]}}let FY=Object.create(null);class FZ{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):FY,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),i=new FZ(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(FU.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(FU.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}FZ.none=new FZ("",Object.create(null),0,8);class FX{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);if(e){i||(i=Object.assign({},n.props));let t=e[1],r=e[0];r.combine&&r.id in i&&(t=r.combine(i[r.id],t)),i[r.id]=t}}t.push(i?new FZ(n.name,i,n.id,n.flags):n)}return new FX(t)}}let FK=new WeakMap,FQ=new WeakMap;(T=ev||(ev={}))[T.ExcludeBuffers=1]="ExcludeBuffers",T[T.IncludeAnonymous=2]="IncludeAnonymous",T[T.IgnoreMounts=4]="IgnoreMounts",T[T.IgnoreOverlays=8]="IgnoreOverlays",T[T.EnterBracketed=16]="EnterBracketed";class FJ{constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length)for(let[e,t]of(this.props=Object.create(null),r))this.props["number"==typeof e?e:e.id]=t}toString(){let e=Fq.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new zn(this.topNode,e)}cursorAt(e,t=0,n=0){let i=new zn(FK.get(this)||this.topNode);return i.moveTo(e,t),FK.set(this,i._tree),i}get topNode(){return new F4(this,0,0,null)}resolve(e,t=0){let n=F5(FK.get(this)||this.topNode,e,t,!1);return FK.set(this,n),n}resolveInner(e,t=0){let n=F5(FQ.get(this)||this.topNode,e,t,!0);return FQ.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof F4?i:i.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(r||(r=[i])).push(o.resolve(t,n)),e=o}else{let o=Fq.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let a=new F4(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(F5(a,t,n,!1))}}return r?ze(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:r=this.length}=e,o=e.mode||0,a=(o&ev.IncludeAnonymous)>0;for(let e=this.cursor(o|ev.IncludeAnonymous);;){let o=!1;if(e.from<=r&&e.to>=i&&(!a&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(a||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:za(FZ.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new FJ(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new FJ(FZ.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:o=[],minRepeatType:a=i.types.length}=e,s=Array.isArray(n)?new F0(n,n.length):n,l=i.types,u=0,c=0;function h(e,t,n,r,o,a,s,l,u){let c=[],h=[];for(;e.length>r;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(d(i.types[s],c,h,a-o,l-a,u)),t.push(o-n)}function d(e,t,n,i,r,o,a){if(o){let e=[FU.contextHash,o];a=a?[e].concat(a):[e]}if(r>25){let e=[FU.lookAhead,r];a=a?[e].concat(a):[e]}return new FJ(e,t,n,i,a)}let f=[],p=[];for(;s.pos>0;)!function e(t,n,f,p,g,m){let{id:v,start:y,end:x,size:b}=s,w=c,S=u;if(b<0){if(s.next(),-1==b){let e=o[v];f.push(e),p.push(y-t);return}if(-3==b){u=v;return}if(-4==b){c=v;return}else throw RangeError(`Unrecognized record size: ${b}`)}let _=l[v],C,M,A=y-t;if(x-y<=r&&(M=function(e,t){let n=s.fork(),i=0,o=0,l=0,u=n.end-r,c={size:0,start:0,skip:0};i:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){c.size=i,c.start=o,c.skip=l,l+=4,i+=4,n.next();continue}let s=n.pos-e;if(e<0||s<r||n.start<u)break;let h=4*(n.id>=a),d=n.start;for(n.next();n.pos>s;){if(n.size<0)if(-3==n.size||-4==n.size)h+=4;else break i;else n.id>=a&&(h+=4);n.next()}o=d,i+=e,l+=h}return(t<0||i==e)&&(c.size=i,c.start=o,c.skip=l),c.size>4?c:void 0}(s.pos-n,g))){let e=new Uint16Array(M.size-M.skip),n=s.pos-M.size,r=e.length;for(;s.pos>n;)r=function e(t,n,i){let{id:r,start:o,end:l,size:h}=s;if(s.next(),h>=0&&r<a){let a=i;if(h>4){let r=s.pos-(h-4);for(;s.pos>r;)i=e(t,n,i)}n[--i]=a,n[--i]=l-t,n[--i]=o-t,n[--i]=r}else -3==h?u=r:-4==h&&(c=r);return i}(M.start,e,r);C=new F1(e,x-M.start,i),A=M.start-t}else{let t=s.pos-b;s.next();let n=[],o=[],l=v>=a?v:-1,u=0,c=x;for(;s.pos>t;)l>=0&&s.id==l&&s.size>=0?(s.end<=c-r&&(h(n,o,y,u,s.end,c,l,w,S),u=n.length,c=s.end),s.next()):m>2500?function(e,t,n,o){let a=[],l=0,u=-1;for(;s.pos>t;){let{id:e,start:t,end:n,size:i}=s;if(i>4)s.next();else if(u>-1&&t<u)break;else u<0&&(u=n-r),a.push(e,t,n),l++,s.next()}if(l){let t=new Uint16Array(4*l),r=a[a.length-2];for(let e=a.length-3,n=0;e>=0;e-=3)t[n++]=a[e],t[n++]=a[e+1]-r,t[n++]=a[e+2]-r,t[n++]=n;n.push(new F1(t,a[2]-r,i)),o.push(r-e)}}(y,t,n,o):e(y,t,n,o,l,m+1);if(l>=0&&u>0&&u<n.length&&h(n,o,y,u,y,c,l,w,S),n.reverse(),o.reverse(),l>-1&&u>0){let e=function(e,t){return(n,i,r)=>{let o=0,a=n.length-1,s,l;if(a>=0&&(s=n[a])instanceof FJ){if(!a&&s.type==e&&s.length==r)return s;(l=s.prop(FU.lookAhead))&&(o=i[a]+s.length+l)}return d(e,n,i,r,o,t)}}(_,S);C=za(_,n,o,0,n.length,0,x-y,e,e)}else C=d(_,n,o,x-y,w-x,S)}f.push(C),p.push(A)}(e.start||0,e.bufferStart||0,f,p,-1,0);let g=null!=(t=e.length)?t:f.length?p[0]+f[0].length:0;return new FJ(l[e.topID],f.reverse(),p.reverse(),g)}(e)}}FJ.empty=new FJ(FZ.none,[],[],0);class F0{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new F0(this.buffer,this.index)}}class F1{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return FZ.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,n,i,r){let{buffer:o}=this,a=-1;for(let s=e;s!=t&&(!F2(r,i,o[s+1],o[s+2])||(a=s,!(n>0)));s=o[s+3]);return a}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),o=0;for(let a=e,s=0;a<t;){r[s++]=i[a++],r[s++]=i[a++]-n;let t=r[s++]=i[a++]-n;r[s++]=i[a++]-e,o=Math.max(o,t)}return new F1(r,o,this.set)}}function F2(e,t,n,i){switch(e){case -2:return n<t;case -1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function F5(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof F4&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=i?0:ev.IgnoreOverlays;if(i)for(let i=e,a=i.parent;a;a=(i=a).parent)i instanceof F4&&i.index<0&&(null==(r=a.enter(t,n,o))?void 0:r.from)!=i.from&&(e=a);for(;;){let i=e.enter(t,n,o);if(!i)return e;e=i}}class F3{cursor(e=0){return new zn(this,e)}getChild(e,t=null,n=null){let i=F6(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return F6(this,e,t,n)}resolve(e,t=0){return F5(this,e,t,!1)}resolveInner(e,t=0){return F5(this,e,t,!0)}matchContext(e){return F8(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class F4 extends F3{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,r=0){for(let o=this;;){for(let{children:a,positions:s}=o._tree,l=t>0?a.length:-1;e!=l;e+=t){let l=a[e],u=s[e]+o.from,c;if(r&ev.EnterBracketed&&l instanceof FJ&&(c=Fq.get(l))&&!c.overlay&&c.bracketed&&n>=u&&n<=u+l.length||F2(i,n,u,u+l.length)){if(l instanceof F1){if(r&ev.ExcludeBuffers)continue;let a=l.findChild(0,l.buffer.length,t,n-u,i);if(a>-1)return new F7(new F9(o,l,e,u),null,a)}else if(r&ev.IncludeAnonymous||!l.type.isAnonymous||zi(l)){let a;if(!(r&ev.IgnoreMounts)&&(a=Fq.get(l))&&!a.overlay)return new F4(a.tree,u,e,o);let s=new F4(l,u,e,o);return r&ev.IncludeAnonymous||!s.type.isAnonymous?s:s.nextChild(t<0?l.children.length-1:0,t,n,i,r)}}}if(r&ev.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let i;if(!(n&ev.IgnoreOverlays)&&(i=Fq.get(this._tree))&&i.overlay){let r=e-this.from,o=n&ev.EnterBracketed&&i.bracketed;for(let{from:e,to:n}of i.overlay)if((t>0||o?e<=r:e<r)&&(t<0||o?n>=r:n>r))return new F4(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function F6(e,t,n,i){let r=e.cursor(),o=[];if(!r.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return o}for(;;){if(null!=i&&r.type.is(i))return o;if(r.type.is(t)&&o.push(r.node),!r.nextSibling())return null==i?o:[]}}function F8(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class F9{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class F7 extends F3{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new F7(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&ev.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new F7(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new F7(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new F7(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let o=n.buffer[this.index+1];e.push(n.slice(i,r,o)),t.push(0)}return new FJ(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ze(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof F4&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new zt(r,n)}class zt{constructor(e,t){this.heads=e,this.node=t}get next(){return ze(this.heads)}}class zn{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~ev.EnterBracketed,e instanceof F4)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof F4?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&ev.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ev.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ev.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let i=t+e,r=e<0?-1:n._tree.children.length;i!=r;i+=e){let e=n._tree.children[i];if(this.mode&ev.IncludeAnonymous||e instanceof F1||!e.type.isAnonymous||zi(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)i:for(let i=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,n=r+1;break i}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new F7(this.buffer,t,this.stack[e]);return this.bufferNode=new F7(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return F8(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return F8(this._tree,e,i);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function zi(e){return e.children.some(e=>e instanceof F1||!e.type.isAnonymous||zi(e))}let zr=new WeakMap;function zo(e,t){if(!e.isAnonymous||t instanceof F1||t.type!=e)return 1;let n=zr.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof FJ)){n=1;break}n+=zo(e,i)}zr.set(t,n)}return n}function za(e,t,n,i,r,o,a,s,l){let u=0;for(let n=i;n<r;n++)u+=zo(e,t[n]);let c=Math.ceil(1.5*u/8),h=[],d=[];return!function t(n,i,r,a,s){for(let u=r;u<a;){let r=u,f=i[u],p=zo(e,n[u]);for(u++;u<a;u++){let t=zo(e,n[u]);if(p+t>=c)break;p+=t}if(u==r+1){if(p>c){let e=n[r];t(e.children,e.positions,0,e.children.length,i[r]+s);continue}h.push(n[r])}else{let t=i[u-1]+n[u-1].length-f;h.push(za(e,n,i,r,u,f,t,null,l))}d.push(f+s-o)}}(t,n,i,r,0),(s||l)(h,d,a)}class zs{constructor(e,t,n,i,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=!!r|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new zs(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,o=e.length?e[0]:null;for(let a=0,s=0,l=0;;a++){let u=a<t.length?t[a]:null,c=u?u.fromA:1e9;if(c-s>=n)for(;o&&o.from<c;){let t=o;if(s>=t.from||c<=t.to||l){let e=Math.max(t.from,s)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new zs(e,n,t.tree,t.offset+l,a>0,!!u)}if(t&&i.push(t),o.to>c)break;o=r<e.length?e[r++]:null}if(!u)break;s=u.toA,l=u.toA-u.toB}return i}}class zl{startParse(e,t,n){return"string"==typeof e&&(e=new zu(e)),n=n?n.length?n.map(e=>new F$(e.from,e.to)):[new F$(0,0)]:[new F$(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class zu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new FU({perNode:!0});class zc{constructor(e,t,n,i,r,o,a,s,l,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=o,this.buffer=a,this.bufferBase=s,this.curContext=l,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new zc(e,[],t,n,n,0,[],0,i?new zh(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=65535&e,{parser:r}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(i);if(a&&(this.score+=a),0==n){i<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let s=this.stack.length-(n-1)*3-(262144&e?6:0),l=s?this.stack[s-2]:this.p.ranges[0].from;i<r.minRepeatTerm&&l==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-l;u>=2e3&&!(null==(t=this.p.parser.nodeSet.types[i])?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let c=s?this.stack[s-1]:0,h=this.bufferBase+this.buffer.length-c;if(i<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,e,h+4,!0)}if(262144&e)this.state=this.stack[s];else{let e=this.stack[s-3];this.state=r.getGoto(e,i,!0)}for(;this.stack.length>s;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&0==this.buffer[e-4]&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&(0!=this.buffer[r-4]||this.buffer[r-1]<0)){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:r}=this.p;this.pos=i;let o=r.stateFlag(e,1);!o&&(i>n||t<=r.maxNode)&&(this.reducePos=i),this.pushState(e,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=r.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&0==e.buffer[t-4]&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new zc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new zd(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i=0,r;i<t.length;i+=2)(r=t[i+1])!=this.state&&this.p.parser.hasAction(r,e)&&n.push(t[i],r);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some((e,t)=>1&t&&e==i)||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let r=this.split();r.pushState(i,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,n.push(r)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=65535&t,r=this.stack.length-3*n;if(r<0||0>e.getGoto(this.stack[r],i,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(i,r)=>{if(!t.includes(i))return t.push(i),e.allActions(i,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let i=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let e=n(t,r+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new zh(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead)&&(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class zh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class zd{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class zf{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new zf(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new zf(this.stack,this.pos,this.index)}}function zp(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i<e.length;){let o=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),o+=r,n)break;o*=46}n?n[r++]=o:n=new t(o)}return n}class zg{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let zm=new zg;class zv{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=zm,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!i)return null;let e=this.ranges[--i];r-=n.from-e.to,n=e}for(;t<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t<this.chunk.length)n=this.pos+e,i=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=zm,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class zy{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;zx(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}function zx(e,t,n,i,r,o){let a=0,s=1<<i,{dialect:l}=n.p.parser;i:for(;(s&e[a])!=0;){let n=e[a+1];for(let i=a+3;i<n;i+=2)if((e[i+1]&s)>0){let n=e[i];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,i){let r=zb(n,i,t);return r<0||zb(n,i,e)<r}(n,t.token.value,r,o))){t.acceptToken(n);break}}let i=t.next,u=0,c=e[a+2];if(t.next<0&&c>u&&65535==e[n+3*c-3]){a=e[n+3*c-1];continue}for(;u<c;){let r=u+c>>1,o=n+r+(r<<1),s=e[o],l=e[o+1]||65536;if(i<s)c=r;else if(i>=l)u=r+1;else{a=e[o+2],t.advance();continue i}}break}}function zb(e,t,n){for(let i=t,r;65535!=(r=e[i]);i++)if(r==n)return i-t;return -1}zy.prototype.contextual=zy.prototype.fallback=zy.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?zp(e):e}token(e,t){let n=e.pos,i=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(zx(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&i++,null==r)break;e.reset(r,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}).prototype.contextual=zy.prototype.fallback=zy.prototype.extend=!1;let zw="u">typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),zS=null;function z_(e,t,n){let i=e.cursor(ev.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.to<t:i.from>t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}class zC{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?z_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?z_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],i=this.index[t];if(i==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=n.children[i],o=this.start[t]+n.positions[i];if(o>e)return this.nextStart=o,null;if(r instanceof FJ){if(o==e){if(o<this.safeFrom)return null;let e=o+r.length;if(e<=this.safeTo){let t=r.prop(FU.lookAhead);if(!t||e+t<this.fragment.to)return r}}this.index[t]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class zM{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new zg)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0;for(let i=0;i<r.length;i++){if((1<<i&o)==0)continue;let l=r[i],u=this.tokens[i];if((!n||l.fallback)&&((l.contextual||u.start!=e.pos||u.mask!=o||u.context!=a)&&(this.updateCachedToken(u,l,e),u.mask=o,u.context=a),u.lookAhead>u.end+25&&(s=Math.max(u.lookAhead,s)),0!=u.value)){let i=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!l.extend&&(n=u,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new zg).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new zg,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let r=t.specializers[i](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){(1&r)==0?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:r}=e,{parser:o}=e.p,{data:a}=o;for(let e=0;e<2;e++)for(let s=o.stateSlot(r,e?2:1);;s+=3){if(65535==a[s])if(1==a[s+1])s=zD(a,s+2);else{0==i&&2==a[s+1]&&(i=this.putAction(zD(a,s+2),t,n,i));break}a[s]==t&&(i=this.putAction(zD(a,s+1),t,n,i))}return i}}class zA{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new zv(t,i),this.tokens=new zM(e,this.stream),this.topTerm=e.top[1];let{from:r}=i[0];this.stacks=[zc.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>4*e.bufferLength?new zC(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let a=n[o];for(;;){if(this.tokens.mainToken=null,a.pos>i)r.push(a);else{if(this.advanceStack(a,r,n))continue;e||(e=[],t=[]),e.push(a);let i=this.tokens.getMainToken(a);t.push(i.value,i.end)}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return zw&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw zw&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return zw&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort((e,t)=>t.score-e.score);r.length>e;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1){n:for(let e=0;e<r.length-1;e++){let t=r[e];for(let n=e+1;n<r.length;n++){let i=r[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)r.splice(n--,1);else{r.splice(e--,1);continue n}}}r.length>12&&(r.sort((e,t)=>t.score-e.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let i=e.pos,{parser:r}=this,o=zw?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(i);a;){let i=this.parser.nodeSet.types[a.type.id]==a.type?r.getGoto(e.state,a.type.id):-1;if(i>-1&&a.length&&(!t||(a.prop(FU.contextHash)||0)==n))return e.useNode(a,i),zw&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof FJ)||0==a.children.length||a.positions[0]>0)break;let s=a.children[0];if(s instanceof FJ&&0==a.positions[0])a=s;else break}}let a=r.stateSlot(e.state,4);if(a>0)return e.reduce(a),zw&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(65535&a)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let a=0;a<s.length;){let l=s[a++],u=s[a++],c=s[a++],h=a==s.length||!n,d=h?e:e.split(),f=this.tokens.mainToken;if(d.apply(l,u,f?f.start:d.pos,c),zw&&console.log(o+this.stackID(d)+` (via ${(65536&l)==0?"shift":`reduce of ${r.getName(65535&l)}`} for ${r.getName(u)} @ ${i}${d==e?"":", split"})`),h)return!0;d.pos>i?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return zk(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let o=0;o<e.length;o++){let a=e[o],s=t[o<<1],l=t[(o<<1)+1],u=zw?this.stackID(a)+" -> ":"";if(a.deadEnd&&(r||(r=!0,a.restart(),zw&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let c=a.split(),h=u;for(let e=0;e<10&&c.forceReduce()&&(zw&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)zw&&(h=this.stackID(c)+" -> ");for(let e of a.recoverByInsert(s))zw&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>a.pos?(l==a.pos&&(l++,s=0),a.recoverByDelete(s,l),zw&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(s)})`),zk(a,n)):(!i||i.score<c.score)&&(i=c)}return i}stackToTree(e){return e.close(),FJ.build({buffer:zf.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(zS||(zS=new WeakMap)).get(e);return t||zS.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function zk(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class zT{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class zI extends zl{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),i=[];for(let e=0;e<t.length;e++)i.push([]);function r(e,t,n){i[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=FU[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)r(i,e,t[n++]);else{let o=t[n+-i];for(let a=-i;a>0;a--)r(t[n++],e,o);n++}}}this.nodeSet=new FX(t.map((t,r)=>FZ.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:i[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=zp(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(zO),this.states=zp(e.states,Uint32Array),this.data=zp(e.stateData),this.goto=zp(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new zy(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new zA(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return -1;for(let r=i[t+1];;){let t=i[r++],o=1&t,a=i[r++];if(o&&n)return a;for(let n=r+(t>>1);r<n;r++)if(i[r]==e)return a;if(o)return -1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let r=this.stateSlot(e,i?2:1),o;;r+=3){if(65535==(o=n[r]))if(1==n[r+1])o=n[r=zD(n,r+2)];else if(2==n[r+1])return zD(n,r+2);else break;if(o==t||0==o)return zD(n,r+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=zD(this.data,n+2);else break;i=t(zD(this.data,n+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=zD(this.data,n+2);else break;if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(zI.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=zO(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],r;65535!=(r=this.data[n++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[r]=1;return new zT(e,n,i)}static deserialize(e){return new zI(e)}}function zD(e,t){return e[t]|e[t+1]<<16}function zO(e){if(e.external){let t=+!!e.extend;return(n,i)=>e.external(n,i)<<1|t}return e.get}let zP=0;class zR{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=zP++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){if(e instanceof zR&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new zR("string"==typeof e?e:"?",[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new zL(e);return e=>e.modified.indexOf(t)>-1?e:zL.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let zE=0;class zL{constructor(e){this.name=e,this.instances=[],this.id=zE++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var i,r;return n.base==e&&(i=t,r=n.modified,i.length==r.length&&i.every((e,t)=>e==r[t]))});if(n)return n;let i=[],r=new zR(e.name,i,e,t);for(let e of t)e.instances.push(r);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)i.push(zL.get(t,e));return r}}function zN(e){let t=Object.create(null);for(let n in e){let i=e[n];for(let e of(Array.isArray(i)||(i=[i]),n.split(" ")))if(e){let n=[],r=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),(t+=i[0].length)==e.length)break;let a=e[t++];if(t==e.length&&"!"==a){r=0;break}if("/"!=a)throw RangeError("Invalid path: "+e);o=e.slice(t)}let a=n.length-1,s=n[a];if(!s)throw RangeError("Invalid path: "+e);let l=new zF(i,r,a>0?n.slice(0,a):null);t[s]=l.sort(t[s])}}return zB.add(t)}let zB=new FU({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let o=new zF(r.tags,r.mode,r.context);n?n.next=o:i=o,n=o}return i}});class zF{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function zz(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}zF.empty=new zF([],2,null);class zV{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,r){let{type:o,from:a,to:s}=e;if(a>=n||s<=t)return;o.isTop&&(r=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=i,u=function(e){let t=e.type.prop(zB);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||zF.empty,c=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(r,u.tags);if(c&&(l&&(l+=" "),l+=c,1==u.mode&&(i+=(i?" ":"")+c)),this.startSpan(Math.max(t,a),l),u.opaque)return;let h=e.tree&&e.tree.prop(FU.mounted);if(h&&h.overlay){let o=e.node.enter(h.overlay[0].from+a,1),u=this.highlighters.filter(e=>!e.scope||e.scope(h.tree.type)),c=e.firstChild();for(let d=0,f=a;;d++){let p=d<h.overlay.length?h.overlay[d]:null,g=p?p.from+a:s,m=Math.max(t,f),v=Math.min(n,g);if(m<v&&c)for(;e.from<v&&(this.highlightRange(e,m,v,i,r),this.startSpan(Math.min(v,e.to),l),!(e.to>=g)&&e.nextSibling()););if(!p||g>n)break;(f=p.to+a)>t&&(this.highlightRange(o.cursor(),Math.max(t,p.from+a),Math.min(n,f),"",u),this.startSpan(Math.min(n,f),l))}c&&e.parent()}else if(e.firstChild()){h&&(i="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,i,r),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}}let zj=zR.define,zH=zj(),zW=zj(),zG=zj(zW),z$=zj(zW),zU=zj(),zq=zj(zU),zY=zj(zU),zZ=zj(),zX=zj(zZ),zK=zj(),zQ=zj(),zJ=zj(),z0=zj(zJ),z1=zj(),z2={comment:zH,lineComment:zj(zH),blockComment:zj(zH),docComment:zj(zH),name:zW,variableName:zj(zW),typeName:zG,tagName:zj(zG),propertyName:z$,attributeName:zj(z$),className:zj(zW),labelName:zj(zW),namespace:zj(zW),macroName:zj(zW),literal:zU,string:zq,docString:zj(zq),character:zj(zq),attributeValue:zj(zq),number:zY,integer:zj(zY),float:zj(zY),bool:zj(zU),regexp:zj(zU),escape:zj(zU),color:zj(zU),url:zj(zU),keyword:zK,self:zj(zK),null:zj(zK),atom:zj(zK),unit:zj(zK),modifier:zj(zK),operatorKeyword:zj(zK),controlKeyword:zj(zK),definitionKeyword:zj(zK),moduleKeyword:zj(zK),operator:zQ,derefOperator:zj(zQ),arithmeticOperator:zj(zQ),logicOperator:zj(zQ),bitwiseOperator:zj(zQ),compareOperator:zj(zQ),updateOperator:zj(zQ),definitionOperator:zj(zQ),typeOperator:zj(zQ),controlOperator:zj(zQ),punctuation:zJ,separator:zj(zJ),bracket:z0,angleBracket:zj(z0),squareBracket:zj(z0),paren:zj(z0),brace:zj(z0),content:zZ,heading:zX,heading1:zj(zX),heading2:zj(zX),heading3:zj(zX),heading4:zj(zX),heading5:zj(zX),heading6:zj(zX),contentSeparator:zj(zZ),list:zj(zZ),quote:zj(zZ),emphasis:zj(zZ),strong:zj(zZ),link:zj(zZ),monospace:zj(zZ),strikethrough:zj(zZ),inserted:zj(),deleted:zj(),changed:zj(),invalid:zj(),meta:z1,documentMeta:zj(z1),annotation:zj(z1),processingInstruction:zj(z1),definition:zR.defineModifier("definition"),constant:zR.defineModifier("constant"),function:zR.defineModifier("function"),standard:zR.defineModifier("standard"),local:zR.defineModifier("local"),special:zR.defineModifier("special")};for(let e in z2){let t=z2[e];t instanceof zR&&(t.name=e)}zz([{tag:z2.link,class:"tok-link"},{tag:z2.heading,class:"tok-heading"},{tag:z2.emphasis,class:"tok-emphasis"},{tag:z2.strong,class:"tok-strong"},{tag:z2.keyword,class:"tok-keyword"},{tag:z2.atom,class:"tok-atom"},{tag:z2.bool,class:"tok-bool"},{tag:z2.url,class:"tok-url"},{tag:z2.labelName,class:"tok-labelName"},{tag:z2.inserted,class:"tok-inserted"},{tag:z2.deleted,class:"tok-deleted"},{tag:z2.literal,class:"tok-literal"},{tag:z2.string,class:"tok-string"},{tag:z2.number,class:"tok-number"},{tag:[z2.regexp,z2.escape,z2.special(z2.string)],class:"tok-string2"},{tag:z2.variableName,class:"tok-variableName"},{tag:z2.local(z2.variableName),class:"tok-variableName tok-local"},{tag:z2.definition(z2.variableName),class:"tok-variableName tok-definition"},{tag:z2.special(z2.variableName),class:"tok-variableName2"},{tag:z2.definition(z2.propertyName),class:"tok-propertyName tok-definition"},{tag:z2.typeName,class:"tok-typeName"},{tag:z2.namespace,class:"tok-namespace"},{tag:z2.className,class:"tok-className"},{tag:z2.macroName,class:"tok-macroName"},{tag:z2.propertyName,class:"tok-propertyName"},{tag:z2.operator,class:"tok-operator"},{tag:z2.comment,class:"tok-comment"},{tag:z2.meta,class:"tok-meta"},{tag:z2.invalid,class:"tok-invalid"},{tag:z2.punctuation,class:"tok-punctuation"}]);let z5=zN({String:z2.string,Number:z2.number,"True False":z2.bool,PropertyName:z2.propertyName,Null:z2.null,", :":z2.separator,"[ ]":z2.squareBracket,"{ }":z2.brace}),z3=zI.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[z5],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),z4=[],z6=[],z8="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<z8.length;e++)(e%2?z6:z4).push(t+=z8[e]);function z9(e){return e>=127462&&e<=127487}function z7(e,t,n){if(t==e.length)return t;t&&Vt(e.charCodeAt(t))&&Vn(e.charCodeAt(t-1))&&t--;let i=Ve(e,t);for(t+=Vi(i);t<e.length;){let r=Ve(e,t);if(8205==i||8205==r||n&&function(e){if(e<768)return!1;for(let t=0,n=z4.length;;){let i=t+n>>1;if(e<z4[i])n=i;else{if(!(e>=z6[i]))return!0;t=i+1}if(t==n)return!1}}(r))t+=Vi(r),i=r;else if(z9(r)){let n=0,i=t-2;for(;i>=0&&z9(Ve(e,i));)n++,i-=2;if(n%2==0)break;t+=2}else break}return t}function Ve(e,t){let n=e.charCodeAt(t);if(!Vn(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return Vt(i)?(n-55296<<10)+(i-56320)+65536:n}function Vt(e){return e>=56320&&e<57344}function Vn(e){return e>=55296&&e<56320}function Vi(e){return e<65536?1:2}class Vr{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Vd(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),Va.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vd(this,e,t);let n=[];return this.decompose(e,t,n,0),Va.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new Vl(this),r=new Vl(e);for(let e=t,o=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(o+=i.value.length,i.done||o>=n)return!0}}iter(e=1){return new Vl(this,e)}iterRange(e,t=this.length){return new Vu(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Vc(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new Vo(e):Va.from(Vo.split(e,[])):Vr.empty}}class Vo extends Vr{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.text[r],a=i+o.length;if((t?n:a)>=e)return new Vh(i,a,n,o);i=a+1,n++}}decompose(e,t,n,i){var r;let o=e<=0&&t>=this.length?this:new Vo((r=this.text,Vs(r,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=Vs(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new Vo(t,e.length+o.length));else{let e=t.length>>1;n.push(new Vo(t.slice(0,e)),new Vo(t.slice(e)))}}else n.push(o)}replace(e,t,n){var i;if(!(n instanceof Vo))return super.replace(e,t,n);[e,t]=Vd(this,e,t);let r=Vs(this.text,Vs(n.text,(i=this.text,Vs(i,[""],0,e))),t),o=this.length+n.length-(t-e);return r.length<=32?new Vo(r,o):Va.from(Vo.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=Vd(this,e,t);let i="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let a=this.text[o],s=r+a.length;r>e&&o&&(i+=n),e<s&&t>r&&(i+=a.slice(Math.max(0,e-r),t-r)),r=s+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new Vo(n,i)),n=[],i=-1);return i>-1&&t.push(new Vo(n,i)),t}}class Va extends Vr{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let o=this.children[r],a=i+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,i);i=a+1,n=s+1}}decompose(e,t,n,i){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let a=this.children[r],s=o+a.length;if(e<=s&&t>=o){let r=i&(o<=e|2*(s>=t));o>=e&&s<=t&&!r?n.push(a):a.decompose(e-o,t-o,n,r)}o=s+1}}replace(e,t,n){if([e,t]=Vd(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let o=this.children[i],a=r+o.length;if(e>=r&&t<=a){let s=o.replace(e-r,t-r,n),l=this.lines-o.lines+s.lines;if(s.lines<l>>4&&s.lines>l>>6){let r=this.children.slice();return r[i]=s,new Va(r,this.length-(t-e)+n.length)}return super.replace(r,a,s)}r=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=Vd(this,e,t);let i="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let a=this.children[r],s=o+a.length;o>e&&r&&(i+=n),e<s&&t>o&&(i+=a.sliceString(e-o,t-o,n)),o=s+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Va))return 0;let n=0,[i,r,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==o||r==a)return n;let s=this.children[i],l=e.children[r];if(s!=l)return n+s.scanIdentical(l,t);n+=s.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new Vo(n,t)}let i=Math.max(32,n>>5),r=i<<1,o=i>>1,a=[],s=0,l=-1,u=[];function c(){0!=s&&(a.push(1==u.length?u[0]:Va.from(u,l)),l=-1,s=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>r&&t instanceof Va)for(let n of t.children)e(n);else t.lines>o&&(s>o||!s)?(c(),a.push(t)):t instanceof Vo&&s&&(n=u[u.length-1])instanceof Vo&&t.lines+n.lines<=32?(s+=t.lines,l+=t.length+1,u[u.length-1]=new Vo(n.text.concat(t.text),n.length+1+t.length)):(s+t.lines>i&&c(),s+=t.lines,l+=t.length+1,u.push(t))}(t);return c(),1==a.length?a[0]:new Va(a,t)}}function Vs(e,t,n=0,i=1e9){for(let r=0,o=0,a=!0;o<e.length&&r<=i;o++){let s=e[o],l=r+s.length;l>=n&&(l>i&&(s=s.slice(0,i-r)),r<n&&(s=s.slice(n-r)),a?(t[t.length-1]+=s,a=!1):t.push(s)),r=l+1}return t}Vr.empty=new Vo([""],0);class Vl{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Vo?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],o=r>>1,a=i instanceof Vo?i.text.length:i.children.length;if(o==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof Vo){let r=i.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[o+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof Vo?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Vu{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Vl(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Vc{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"u">typeof Symbol&&(Vr.prototype[Symbol.iterator]=function(){return this.iter()},Vl.prototype[Symbol.iterator]=Vu.prototype[Symbol.iterator]=Vc.prototype[Symbol.iterator]=function(){return this});class Vh{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function Vd(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function Vf(e,t,n=!0,i=!0){return function(e,t,n=!0,i=!0){return(n?z7:function(e,t,n){for(;t>1;){let i=z7(e,t-2,n);if(i<t)return i;t--}return 0})(e,t,i)}(e,t,n,i)}function Vp(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return i>=56320&&i<57344?(n-55296<<10)+(i-56320)+65536:n}function Vg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function Vm(e){return e<65536?1:2}let Vv=/\r\n?|\n/;var Vy=((I=Vy||(Vy={}))[I.Simple=0]="Simple",I[I.TrackDel=1]="TrackDel",I[I.TrackBefore=2]="TrackBefore",I[I.TrackAfter=3]="TrackAfter",I);class Vx{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(n,i,r),i+=r):i+=o,n+=r}}iterChangedRanges(e,t=!1){V_(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new Vx(e)}composeDesc(e){return this.empty?e:e.empty?this:VM(this,e)}mapDesc(e,t=!1){return e.empty?this:VC(this,e,t)}mapPos(e,t=-1,n=Vy.Simple){let i=0,r=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],s=this.sections[o++],l=i+a;if(s<0){if(l>e)return r+(e-i);r+=a}else{if(n!=Vy.Simple&&l>=e&&(n==Vy.TrackDel&&i<e&&l>e||n==Vy.TrackBefore&&i<e||n==Vy.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==i||t<0?r:r+s;r+=s}i=l}if(e>i)throw RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=this.sections[n++],o=this.sections[n++],a=i+r;if(o>=0&&i<=t&&a>=e)return!(i<e)||!(a>t)||"cover";i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new Vx(e)}static create(e){return new Vx(e)}}class Vb extends Vx{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return V_(this,(t,n,i,r,o)=>e=e.replace(i,i+(n-t),o),!1),e}mapDesc(e,t=!1){return VC(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let s=i>>1;for(;n.length<s;)n.push(Vr.empty);n.push(o?e.slice(r,r+o):Vr.empty)}r+=o}return new Vb(t,n)}compose(e){return this.empty?e:e.empty?this:VM(this,e,!0)}map(e,t=!1){return e.empty?this:VC(this,e,t,!0)}iterChanges(e,t=!1){V_(this,e,t)}get desc(){return Vx.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new VA(this);r:for(let o=0,a=0;;){let s=o==e.length?1e9:e[o++];for(;a<s||a==s&&0==r.len;){if(r.done)break r;let e=Math.min(r.len,s-a);Vw(i,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;Vw(t,e,o),o>0&&VS(n,t,r.text),r.forward(e),a+=e}let l=e[o++];for(;a<l;){if(r.done)break r;let e=Math.min(r.len,l-a);Vw(t,e,-1),Vw(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),a+=e}}return{changes:new Vb(t,n),filtered:Vx.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],o=0,a=null;function s(e=!1){if(!e&&!i.length)return;o<t&&Vw(i,t-o,-1);let n=new Vb(i,r);a=a?a.compose(n.map(a)):n,i=[],r=[],o=0}return!function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof Vb){if(l.length!=t)throw RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);s(),a=a?a.compose(l.map(a)):l}else{let{from:e,to:a=e,insert:u}=l;if(e>a||e<0||a>t)throw RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let c=u?"string"==typeof u?Vr.of(u.split(n||Vv)):u:Vr.empty,h=c.length;if(e==a&&0==h)return;e<o&&s(),e>o&&Vw(i,e-o,-1),Vw(i,a-e,h),VS(r,i,c),o=a}}(e),s(!a),a}static empty(e){return new Vb(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(Vr.empty);n[i]=Vr.of(r.slice(1)),t.push(r[0],n[i].length)}}return new Vb(t,n)}static createSet(e,t){return new Vb(e,t)}}function Vw(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function VS(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(Vr.empty);e.push(n)}}function V_(e,t,n){let i=e.inserted;for(let r=0,o=0,a=0;a<e.sections.length;){let s=e.sections[a++],l=e.sections[a++];if(l<0)r+=s,o+=s;else{let u=r,c=o,h=Vr.empty;for(;u+=s,c+=l,l&&i&&(h=h.append(i[a-2>>1])),!n&&a!=e.sections.length&&!(e.sections[a+1]<0);)s=e.sections[a++],l=e.sections[a++];t(r,u,o,c,h),r=u,o=c}}}function VC(e,t,n,i=!1){let r=[],o=i?[]:null,a=new VA(e),s=new VA(t);for(let e=-1;;)if(a.done&&s.len||s.done&&a.len)throw Error("Mismatched change set lengths");else if(-1==a.ins&&-1==s.ins){let e=Math.min(a.len,s.len);Vw(r,e,-1),a.forward(e),s.forward(e)}else if(s.ins>=0&&(a.ins<0||e==a.i||0==a.off&&(s.len<a.len||s.len==a.len&&!n))){let t=s.len;for(Vw(r,s.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(Vw(r,0,a.ins),o&&VS(o,r,a.text),e=a.i),a.forward(n),t-=n}s.next()}else if(a.ins>=0){let t=0,n=a.len;for(;n;)if(-1==s.ins){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(0==s.ins&&s.len<n)n-=s.len,s.next();else break;Vw(r,t,e<a.i?a.ins:0),o&&e<a.i&&VS(o,r,a.text),e=a.i,a.forward(a.len-n)}else if(a.done&&s.done)return o?Vb.createSet(r,o):Vx.create(r);else throw Error("Mismatched change set lengths")}function VM(e,t,n=!1){let i=[],r=n?[]:null,o=new VA(e),a=new VA(t);for(let e=!1;;)if(o.done&&a.done)return r?Vb.createSet(i,r):Vx.create(i);else if(0==o.ins)Vw(i,o.len,0,e),o.next();else if(0!=a.len||a.done)if(o.done||a.done)throw Error("Mismatched change set lengths");else{let t=Math.min(o.len2,a.len),n=i.length;if(-1==o.ins){let n=-1==a.ins?-1:a.off?0:a.ins;Vw(i,t,n,e),r&&n&&VS(r,i,a.text)}else -1==a.ins?(Vw(i,o.off?0:o.len,t,e),r&&VS(r,i,o.textBit(t))):(Vw(i,o.off?0:o.len,a.off?0:a.ins,e),r&&!a.off&&VS(r,i,a.text));e=(o.ins>t||a.ins>=0&&a.len>t)&&(e||i.length>n),o.forward2(t),a.forward(t)}else Vw(i,0,a.ins,e),r&&VS(r,i,a.text),a.next()}class VA{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Vr.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Vr.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Vk{constructor(e,t,n,i){this.from=e,this.to=t,this.flags=n,this.goalColumn=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get undirectional(){return(64&this.flags)>0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new Vk(n,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return VT.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return VT.range(this.anchor,i,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return VT.range(e.anchor,e.head)}static create(e,t,n,i){return new Vk(e,t,n,i)}}class VT{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:VT.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new VT([this.main],0)}addRange(e,t=!0){return VT.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,VT.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new VT(e.ranges.map(e=>Vk.fromJSON(e)),e.main)}static single(e,t=e){return new VT([VT.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return VT.normalized(e.slice(),t);n=r.to}return new VT(e,t)}static cursor(e,t=0,n,i){return Vk.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n)),i)}static range(e,t,n,i,r){let o=null==i?7:Math.min(6,i);return r||e==t||(r=t<e?1:-1),r&&(o|=r<0?8:16),t<e?Vk.create(t,e,32|o,n):Vk.create(e,t,o,n)}static undirectionalRange(e,t){return Vk.create(e,t,64,void 0)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let o=r.from,a=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?VT.range(a,o):VT.range(o,a))}}return new VT(e,t)}}function VI(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let VD=0;class VO{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=VD++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new VO(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?VP:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new VR([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new VR(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new VR(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function VP(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class VR{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=VD++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,o=e[r]>>1,a=2==this.type,s=!1,l=!1,u=[];for(let n of this.dependencies)"doc"==n?s=!0:"selection"==n?l=!0:((null!=(t=e[n.id])?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(s&&t.docChanged||l&&(t.docChanged||t.selection)||VL(e,u)){let t=n(e);if(a?!VE(t,e.values[o],i):!i(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let s,l=t.config.address[r];if(null!=l){let r=V$(t,l);if(this.dependencies.every(n=>n instanceof VO?t.facet(n)===e.facet(n):!(n instanceof VB)||t.field(n,!1)==e.field(n,!1))||(a?VE(s=n(e),r,i):i(s=n(e),r)))return e.values[o]=r,0}else s=n(e);return e.values[o]=s,1}}}}function VE(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function VL(e,t){let n=!1;for(let i of t)1&VG(e,i)&&(n=!0);return n}let VN=VO.define({static:!0});class VB{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new VB(VD++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(VN).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>{let i=e.facet(VN),r=n.facet(VN),o;return(o=i.find(e=>e.field==this))&&o!=r.find(e=>e.field==this)?(e.values[t]=o.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,VN.of({field:this,create:e})]}get extension(){return this}}function VF(e){return t=>new VV(t,e)}let Vz={highest:VF(0),high:VF(1),default:VF(2),low:VF(3),lowest:VF(4)};class VV{constructor(e,t){this.inner=e,this.prec=t}}class Vj{of(e){return new VH(this,e)}reconfigure(e){return Vj.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class VH{constructor(e,t){this.compartment=e,this.inner=t}}class VW{constructor(e,t,n,i,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){var i,r,o;let a,s,l=[],u=Object.create(null),c=new Map;for(let n of(i=e,r=t,o=c,a=[[],[],[],[],[]],s=new Map,!function e(t,n){let i=s.get(t);if(null!=i){if(i<=n)return;let e=a[i].indexOf(t);e>-1&&a[i].splice(e,1),t instanceof VH&&o.delete(t.compartment)}if(s.set(t,n),Array.isArray(t))for(let i of t)e(i,n);else if(t instanceof VH){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let i=r.get(t.compartment)||t.inner;o.set(t.compartment,i),e(i,n)}else if(t instanceof VV)e(t.inner,t.prec);else if(t instanceof VB)a[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof VR)a[n].push(t),t.facet.extensions&&e(t.facet.extensions,2);else{let i=t.extension;if(!i)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(i,n)}}(i,2),a.reduce((e,t)=>e.concat(t))))n instanceof VB?l.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let h=Object.create(null),d=[],f=[];for(let e of l)h[e.id]=f.length<<1,f.push(t=>e.slot(t));let p=null==n?void 0:n.config.facets;for(let e in u){let t=u[e],i=t[0].facet,r=p&&p[e]||[];if(t.every(e=>0==e.type))if(h[i.id]=d.length<<1|1,VP(r,t))d.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));d.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}else{for(let e of t)0==e.type?(h[e.id]=d.length<<1|1,d.push(e.value)):(h[e.id]=f.length<<1,f.push(t=>e.dynamicSlot(t)));h[i.id]=f.length<<1,f.push(e=>(function(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),o=i.filter(e=>!(1&e)),a=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<i.length;t++){let o=V$(e,i[t]);if(2==r[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of i)VG(e,t);return e.values[a]=s(e),1},update(e,n){if(!VL(e,o))return 0;let i=s(e);return t.compare(i,e.values[a])?0:(e.values[a]=i,1)},reconfigure(e,r){let o=VL(e,i),l=r.config.facets[t.id],u=r.facet(t);if(l&&!o&&VP(n,l))return e.values[a]=u,0;let c=s(e);return t.compare(c,u)?(e.values[a]=u,0):(e.values[a]=c,1)}}})(e,i,t))}}return new VW(e,c,f.map(e=>e(h)),h,d,u)}}function VG(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function V$(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let VU=VO.define(),Vq=VO.define({combine:e=>e.some(e=>e),static:!0}),VY=VO.define({combine:e=>e.length?e[0]:void 0,static:!0}),VZ=VO.define(),VX=VO.define(),VK=VO.define(),VQ=VO.define({combine:e=>!!e.length&&e[0]});class VJ{constructor(e,t){this.type=e,this.value=t}static define(){return new V0}}class V0{of(e){return new VJ(this,e)}}class V1{constructor(e){this.map=e}of(e){return new V2(this,e)}}class V2{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new V2(this.type,t)}is(e){return this.type==e}static define(e={}){return new V1(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}V2.reconfigure=V2.define(),V2.appendConfig=V2.define();class V5{constructor(e,t,n,i,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&VI(n,t.newLength),r.some(e=>e.type==V5.time)||(this.annotations=r.concat(V5.time.of(Date.now())))}static create(e,t,n,i,r,o){return new V5(e,t,n,i,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(V5.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function V3(e,t,n){var i;let r,o,a;return n?(r=t.changes,o=Vb.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(o):null==(i=e.selection)?void 0:i.map(r),effects:V2.mapEffects(e.effects,r).concat(V2.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function V4(e,t,n){let i=t.selection,r=V8(t.annotations);return t.userEvent&&(r=r.concat(V5.userEvent.of(t.userEvent))),{changes:t.changes instanceof Vb?t.changes:Vb.of(t.changes||[],n,e.facet(VY)),selection:i&&(i instanceof VT?i:VT.single(i.anchor,i.head)),effects:V8(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}V5.time=VJ.define(),V5.userEvent=VJ.define(),V5.addToHistory=VJ.define(),V5.remote=VJ.define();let V6=[];function V8(e){return null==e?V6:Array.isArray(e)?e:[e]}var V9=((D=V9||(V9={}))[D.Word=0]="Word",D[D.Space=1]="Space",D[D.Other=2]="Other",D);let V7=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class je{constructor(e,t,n,i,r,o){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)VG(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return VG(this,n),V$(this,n)}update(...e){return function e(t,n,i){let r=V4(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(i=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(i=!1);let o=!!n[e].sequential;r=V3(r,V4(t,n[e],o?r.changes.newLength:t.doc.length),o)}let o=V5.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(VK),i=e;for(let r=n.length-1;r>=0;r--){let o=n[r](e);o&&Object.keys(o).length&&(i=V3(i,V4(t,o,e.changes.newLength),!0))}return i==e?e:V5.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(i?function(t){let n=t.startState,i=!0;for(let e of n.facet(VZ)){let n=e(t);if(!1===n){i=!1;break}Array.isArray(n)&&(i=!0===i?n:function(e,t){let n=[];for(let i=0,r=0;;){let o,a;if(i<e.length&&(r==t.length||t[r]>=e[i]))o=e[i++],a=e[i++];else{if(!(r<t.length))return n;o=t[r++],a=t[r++]}!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}(i,n))}if(!0!==i){let e,r;if(!1===i)r=t.changes.invertedDesc,e=Vb.empty(n.doc.length);else{let n=t.changes.filter(i);e=n.changes,r=n.filtered.mapDesc(n.changes).invertedDesc}t=V5.create(n,e,t.selection&&t.selection.map(r),V2.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let r=n.facet(VX);for(let i=r.length-1;i>=0;i--){let o=r[i](t);t=o instanceof V5?o:Array.isArray(o)&&1==o.length&&o[0]instanceof V5?o[0]:e(n,V8(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(Vj.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(V2.reconfigure)?(n=null,i=t.value):t.is(V2.appendConfig)&&(n=null,i=V8(i).concat(t.value));t=n?e.startState.values.slice():new je(n=VW.resolve(i,r,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(Vq)?e.newSelection:e.newSelection.asSingle();new je(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:VT.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],o=V8(n.effects);for(let n=1;n<t.ranges.length;n++){let a=e(t.ranges[n]),s=this.changes(a.changes),l=s.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(l);let u=i.mapDesc(s,!0);r.push(a.range.map(u)),i=i.compose(l),o=V2.mapEffects(o,l).concat(V2.mapEffects(V8(a.effects),u))}return{changes:i,selection:VT.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Vb?e:Vb.of(e,this.doc.length,this.facet(je.lineSeparator))}toText(e){return Vr.of(e.split(this.facet(je.lineSeparator)||Vv))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(VG(this,t),V$(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof VB&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],o=e[t];i.push(r.init(e=>r.spec.fromJSON(o,e)))}}return je.create({doc:e.doc,selection:VT.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=VW.resolve(e.extensions||[],new Map),n=e.doc instanceof Vr?e.doc:Vr.of((e.doc||"").split(t.staticFacet(je.lineSeparator)||Vv)),i=e.selection?e.selection instanceof VT?e.selection:VT.single(e.selection.anchor,e.selection.head):VT.single(0);return VI(i,n.length),t.staticFacet(Vq)||(i=i.asSingle()),new je(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(je.tabSize)}get lineBreak(){return this.facet(je.lineSeparator)||"\n"}get readOnly(){return this.facet(VQ)}phrase(e,...t){for(let t of this.facet(je.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(VU))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){var t;let n=this.languageDataAt("wordChars",e);return t=n.length?n[0]:"",e=>{if(!/\S/.test(e))return V9.Space;if(function(e){if(i)return i.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||V7.test(n)))return!0}return!1}(e))return V9.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return V9.Word;return V9.Other}}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,a=e-n;for(;o>0;){let e=Vf(t,o,!1);if(r(t.slice(e,o))!=V9.Word)break;o=e}for(;a<i;){let e=Vf(t,a);if(r(t.slice(a,e))!=V9.Word)break;a=e}return o==a?null:VT.range(o+n,a+n)}}function jt(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],o=i[e];if(void 0===o)i[e]=r;else if(o===r||void 0===r);else if(Object.hasOwnProperty.call(n,e))i[e]=n[e](o,r);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}je.allowMultipleSelections=Vq,je.tabSize=VO.define({combine:e=>e.length?e[0]:4}),je.lineSeparator=VY,je.readOnly=VQ,je.phrases=VO.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),je.languageData=VU,je.changeFilter=VZ,je.transactionFilter=VX,je.transactionExtender=VK,Vj.reconfigure=V2.define();class jn{eq(e){return this==e}range(e,t=e){return jr.create(e,t,this)}}function ji(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}jn.prototype.startSide=jn.prototype.endSide=0,jn.prototype.point=!1,jn.prototype.mapMode=Vy.TrackDel;class jr{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new jr(e,t,n)}}function jo(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class ja{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let o=i,a=r.length;;){if(o==a)return o;let i=o+a>>1,s=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==o)return s>=0?o:a;s>=0?a=i:o=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let n=[],i=[],r=[],o=-1,a=-1;for(let s=0;s<this.value.length;s++){let l=this.value[s],u=this.from[s]+e,c=this.to[s]+e,h,d;if(u==c){let e=t.mapPos(u,l.startSide,l.mapMode);if(null==e||(h=d=e,l.startSide!=l.endSide&&(d=t.mapPos(u,l.endSide))<h))continue}else if((h=t.mapPos(u,l.startSide))>(d=t.mapPos(c,l.endSide))||h==d&&l.startSide>0&&l.endSide<=0)continue;0>(d-h||l.endSide-l.startSide)||(o<0&&(o=h),l.point&&(a=Math.max(a,d-h)),n.push(l),i.push(h-o),r.push(d-o))}return{mapped:n.length?new ja(i,r,n,a):null,pos:o}}}class js{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new js(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(jo)),this.isEmpty)return t.length?js.of(t):this;let a=new jc(this,null,-1).goto(0),s=0,l=[],u=new jl;for(;a.value||s<t.length;)if(s<t.length&&(a.from-t[s].from||a.startSide-t[s].value.startSide)>=0){let e=t[s++];u.addInner(e.from,e.to,e.value)||l.push(e)}else 1==a.rangeIndex&&a.chunkIndex<this.chunk.length&&(s==t.length||this.chunkEnd(a.chunkIndex)<t[s].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||r<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||r<a.from||o(a.from,a.to,a.value))&&!u.addInner(a.from,a.to,a.value)&&l.push(jr.create(a.from,a.to,a.value)),a.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?js.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],a=this.chunk[r],s=e.touchesRange(o,o+a.length);if(!1===s)i=Math.max(i,a.maxPoint),t.push(a),n.push(e.mapPos(o));else if(!0===s){let{mapped:r,pos:s}=a.map(o,e);r&&(i=Math.max(i,r.maxPoint),t.push(r),n.push(s))}}let r=this.nextLayer.map(e);return 0==t.length?r:new js(n,t,r||js.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],o=this.chunk[i];if(t>=r&&e<=r+o.length&&!1===o.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return jh.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return jh.from(e).goto(t)}static compare(e,t,n,i,r=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),a=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),s=ju(o,a,n),l=new jf(o,s,r),u=new jf(a,s,r);n.iterGaps((e,t,n)=>jp(l,e,u,t,n,i)),n.empty&&0==n.length&&jp(l,0,u,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=0x3b9ac9ff);let r=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(r.length!=o.length)return!1;if(!r.length)return!0;let a=ju(r,o),s=new jf(r,a,0).goto(n),l=new jf(o,a,0).goto(n);for(;;){if(s.to!=l.to||!jg(s.active,l.active)||s.point&&(!l.point||!ji(s.point,l.point)))return!1;if(s.to>i)return!0;s.next(),l.next()}}static spans(e,t,n,i,r=-1){let o=new jf(e,null,r).goto(t),a=t,s=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),r=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,s);i.point(a,e,o.point,n,r,o.pointRank),s=Math.min(o.openEnd(e),n.length)}else e>a&&(i.span(a,e,o.active,s),s=o.openEnd(e));if(o.to>n)return s+(o.point&&o.to>n?1:0);a=o.to,o.next()}}static of(e,t=!1){let n=new jl;for(let i of e instanceof jr?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(jo(t,i)>0)return e.slice().sort(jo);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return js.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=js.empty;i=i.nextLayer)t=new js(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}js.empty=new js([],[],null,-1),js.empty.nextLayer=js.empty;class jl{finishChunk(e){this.chunks.push(new ja(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new jl)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(js.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=js.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function ju(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=i.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||r.add(e.chunk[t])}return r}class jc{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class jh{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&i.push(new jc(o,t,n,r));return 1==i.length?i[0]:new jh(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)jd(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)jd(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),jd(this.heap,0)}}}function jd(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),0>n.compare(r))break;e[i]=n,e[t]=r,t=i}}class jf{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=jh.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){jm(this.active,e),jm(this.activeTo,e),jm(this.activeRank,e),this.minActive=jy(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;jv(this.active,t,n),jv(this.activeTo,t,i),jv(this.activeRank,t,r),e&&jv(e,t,this.cursor.from),this.minActive=jy(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&0>(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&jm(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(e.point)if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}else this.addActive(n),this.cursor.next()}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function jp(e,t,n,i,r,o){e.goto(t),n.goto(i);let a=i+r,s=i,l=i-t,u=!!o.boundChange;for(let t=!1;;){let i=e.to+l-n.to,r=i||e.endSide-n.endSide,c=r<0?e.to+l:n.to,h=Math.min(c,a);if(e.point||n.point?(e.point&&n.point&&ji(e.point,n.point)&&jg(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(s,h,e.point,n.point),t=!1):(t&&o.boundChange(s),h>s&&!jg(e.active,n.active)&&o.compareRange(s,h,e.active,n.active),u&&h<a&&(i||e.openEnd(c)!=n.openEnd(c))&&(t=!0)),c>a)break;s=c,r<=0&&e.next(),r>=0&&n.next()}}function jg(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!ji(e[n],t[n]))return!1;return!0}function jm(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function jv(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function jy(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)0>(t[r]-i||e[r].endSide-e[n].endSide)&&(n=r,i=t[r]);return n}function jx(e,t,n=e.length){let i=0;for(let r=0;r<n&&r<e.length;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=Vf(e,r));return i}function jb(e,t,n,i){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=Vf(e,i)}return!0===i?-1:e.length}let jw="u"<typeof Symbol?"__ͼ":Symbol.for("ͼ"),jS="u"<typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),j_="u">typeof globalThis?globalThis:"u">typeof window?window:{};class jC{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,r,o,a){let s=[],l=/^@(\w+)\b/.exec(t[0]),u=l&&"keyframes"==l[1];if(l&&null==r)return o.push(t[0]+";");for(let n in r){let a=r[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),a,o);else if(a&&"object"==typeof a){if(!l)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(i(n),a,s,u)}else null!=a&&s.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+a+";")}(s.length||u)&&o.push((n&&!l&&!a?t.map(n):t).join(", ")+" {"+s.join(" ")+"}")}(i(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=j_[jw]||1;return j_[jw]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[jS],r=n&&n.nonce;i?r&&i.setNonce(r):i=new jA(e,r),i.mount(Array.isArray(t)?t:[t],e)}}let jM=new Map;class jA{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=jM.get(n);if(t)return e[jS]=t;this.sheet=new i.CSSStyleSheet,jM.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[jS]=this}mount(e,t){let n=this.sheet,i=0,r=0;for(let t=0;t<e.length;t++){let o=e[t],a=this.modules.indexOf(o);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],i++)}else{for(;r<a;)i+=this.modules[r++].rules.length;i+=o.rules.length,r++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var jk={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},jT={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},jI="u">typeof navigator&&/Mac/.test(navigator.platform),jD="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),jO=0;jO<10;jO++)jk[48+jO]=jk[96+jO]=String(jO);for(var jO=1;jO<=24;jO++)jk[jO+111]="F"+jO;for(var jO=65;jO<=90;jO++)jk[jO]=String.fromCharCode(jO+32),jT[jO]=String.fromCharCode(jO);for(var jP in jk)jT.hasOwnProperty(jP)||(jT[jP]=jk[jP]);function jR(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var i=0;i<n.length;i++)e(t,n[i]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let jE="u">typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},jL="u">typeof document?document:{documentElement:{style:{}}},jN=/Edge\/(\d+)/.exec(jE.userAgent),jB=/MSIE \d/.test(jE.userAgent),jF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jE.userAgent),jz=!!(jB||jF||jN),jV=!jz&&/gecko\/(\d+)/i.test(jE.userAgent),jj=!jz&&/Chrome\/(\d+)/.exec(jE.userAgent),jH="webkitFontSmoothing"in jL.documentElement.style,jW=!jz&&/Apple Computer/.test(jE.vendor),jG=jW&&(/Mobile\/\w+/.test(jE.userAgent)||jE.maxTouchPoints>2);var j$={mac:jG||/Mac/.test(jE.platform),windows:/Win/.test(jE.platform),linux:/Linux|X11/.test(jE.platform),ie:jz,ie_version:jB?jL.documentMode||6:jF?+jF[1]:jN?+jN[1]:0,gecko:jV,gecko_version:jV?+(/Firefox\/(\d+)/.exec(jE.userAgent)||[0,0])[1]:0,chrome:!!jj,chrome_version:jj?+jj[1]:0,ios:jG,android:/Android\b/.test(jE.userAgent),webkit:jH,webkit_version:jH?+(/\bAppleWebKit\/(\d+)/.exec(jE.userAgent)||[0,0])[1]:0,safari:jW,safari_version:jW?+(/\bVersion\/(\d+(\.\d+)?)/.exec(jE.userAgent)||[0,0])[1]:0,tabSize:null!=jL.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function jU(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}let jq=Object.create(null);function jY(e,t,n){if(e==t)return!0;e||(e=jq),t||(t=jq);let i=Object.keys(e),r=Object.keys(t);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let o of i)if(o!=n&&(-1==r.indexOf(o)||e[o]!==t[o]))return!1;return!0}function jZ(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}class jX{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return -1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var jK=((O=jK||(jK={}))[O.Text=0]="Text",O[O.WidgetBefore=1]="WidgetBefore",O[O.WidgetAfter=2]="WidgetAfter",O[O.WidgetRange=3]="WidgetRange",O);class jQ extends jn{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new jJ(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new j1(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,i;if(e.isBlockGap)n=-5e8,i=4e8;else{let{start:r,end:o}=j2(e,t);n=(r?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new j1(e,n,i,t,e.widget||null,!0)}static line(e){return new j0(e)}static set(e,t=!1){return js.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}jQ.none=js.empty;class jJ extends jQ{constructor(e){let{start:t,end:n}=j2(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?jU(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||jq}eq(e){return this==e||e instanceof jJ&&this.tagName==e.tagName&&jY(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}jJ.prototype.point=!1;class j0 extends jQ{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof j0&&this.spec.class==e.spec.class&&jY(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}j0.prototype.mapMode=Vy.TrackBefore,j0.prototype.point=!0;class j1 extends jQ{constructor(e,t,n,i,r,o){super(t,n,r,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?Vy.TrackBefore:Vy.TrackAfter:Vy.TrackDel}get type(){return this.startSide!=this.endSide?jK.WidgetRange:this.startSide<=0?jK.WidgetBefore:jK.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof j1&&(t=this.widget,t==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function j2(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function j5(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}j1.prototype.point=!0;class j3 extends jn{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(e){return e==this||e instanceof j3&&this.tagName==e.tagName&&jY(this.attributes,e.attributes)}static create(e){return new j3(e.tagName,e.attributes||jq,null==e.rank?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return js.of(e,t)}}function j4(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function j6(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function j8(e,t){if(!t.anchorNode)return!1;try{return j6(e,t.anchorNode)}catch(e){return!1}}function j9(e){return 3==e.nodeType?Hc(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function j7(e,t,n,i){return!!n&&(Hn(e,t,n,i,-1)||Hn(e,t,n,i,1))}function He(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function Ht(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Hn(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:Hi(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=He(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?Hi(e):0}}}function Hi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Hr(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Ho(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(i>.995&&i<1.005||!isFinite(i)||1>Math.abs(t.height-e.offsetHeight))&&(i=1),{scaleX:n,scaleY:i}}function Ha(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let o=e.parentNode;o;)if(o==n.body||(!t||i)&&r)break;else if(1==o.nodeType)!r&&o.scrollHeight>o.clientHeight&&(r=o),t&&!i&&o.scrollWidth>o.clientWidth&&(i=o),o=o.assignedSlot||o.parentNode;else if(11==o.nodeType)o=o.host;else break;return{x:i,y:r}}j3.prototype.startSide=j3.prototype.endSide=-1;class Hs{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Hi(t):0),n,Math.min(e.focusOffset,n?Hi(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let Hl=null;function Hu(e){if(e.setActive)return e.setActive();if(Hl)return e.focus(Hl);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==Hl?{get preventScroll(){return Hl={preventScroll:!0},!0}}:void 0),!Hl){Hl=!1;for(let e=0;e<t.length;){let n=t[e++],i=t[e++],r=t[e++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}}}function Hc(e,t,n=t){let i=r||(r=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function Hh(e,t,n,i){let r={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,e.dispatchEvent(o);let a=new KeyboardEvent("keyup",r);return a.synthetic=!0,e.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function Hd(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Hf(e,t){for(let n=e,i=t;;)if(3==n.nodeType&&i>0)return{node:n,offset:i};else if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;i=Hi(n=n.childNodes[i-1])}else{if(!n.parentNode||Ht(n))return null;i=He(n),n=n.parentNode}}function Hp(e,t){for(let n=e,i=t;;)if(3==n.nodeType&&i<n.nodeValue.length)return{node:n,offset:i};else if(1==n.nodeType&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||Ht(n))return null;i=He(n)+1,n=n.parentNode}}j$.safari&&j$.safari_version>=26&&(Hl=!1);class Hg{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Hg(e.parentNode,He(e),t)}static after(e,t){return new Hg(e.parentNode,He(e)+1,t)}}var Hm=((P=Hm||(Hm={}))[P.LTR=0]="LTR",P[P.RTL=1]="RTL",P);let Hv=Hm.LTR,Hy=Hm.RTL;function Hx(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let Hb=Hx("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Hw=Hx("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),HS=Object.create(null),H_=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);HS[t]=n,HS[n]=-t}function HC(e){return e<=247?Hb[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Hw[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let HM=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class HA{get dir(){return this.level%2?Hy:Hv}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,i){let r=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==n)return o;(r<0||(0!=i?i<0?a.from<t:a.to>t:e[r].level>a.level))&&(r=o)}}if(r<0)throw RangeError("Index out of range");return r}}let Hk=[];function HT(e){return[new HA(0,e,0)]}let HI="",HD=VO.define(),HO=VO.define(),HP=VO.define(),HR=VO.define(),HE=VO.define(),HL=VO.define(),HN=VO.define(),HB=VO.define(),HF=VO.define(),Hz=VO.define({combine:e=>e.some(e=>e)}),HV=VO.define({combine:e=>e.some(e=>e)}),Hj=VO.define();class HH{constructor(e,t,n,i,r,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new HH(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new HH(VT.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let HW=V2.define({map:(e,t)=>e.map(t)}),HG=V2.define();function H$(e,t,n){let i=e.facet(HR);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}let HU=VO.define({combine:e=>!e.length||e[0]}),Hq=0,HY=VO.define({combine:e=>e.filter((t,n)=>{for(let i=0;i<n;i++)if(e[i].plugin==t.plugin)return!1;return!0})});class HZ{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(HY.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(HY.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:i,provide:r,decorations:o}=t||{};return new HZ(Hq++,e,n,i,e=>{let t=[];return o&&t.push(HJ.of(t=>{let n=t.plugin(e);return n?o(n):jQ.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return HZ.define((t,n)=>new e(t,n),t)}}class HX{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(H$(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){H$(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null==(t=this.value)?void 0:t.destroy)try{this.value.destroy()}catch(t){H$(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let HK=VO.define(),HQ=VO.define(),HJ=VO.define(),H0=VO.define(),H1=VO.define(),H2=VO.define(),H5=VO.define();function H3(e,t){let n=e.state.facet(H5);if(!n.length)return n;let i=n.map(t=>t instanceof Function?t(e):t),r=[];return js.spans(i,t.from,t.to,{point(){},span(e,n,i,o){let a=e-t.from,s=n-t.from,l=r;for(let e=i.length-1;e>=0;e--,o--){let n=i[e].spec.bidiIsolate,r;if(null==n&&(n=function(e,t,n){for(let i=t;i<n;i++){let t=HC(e.charCodeAt(i));if(1==t)break;if(2==t||4==t)return Hy}return Hv}(t.text,a,s)),o>0&&l.length&&(r=l[l.length-1]).to==a&&r.direction==n)r.to=s,l=r.inner;else{let e={from:a,to:s,direction:n,inner:[]};l.push(e),l=e.inner}}}}),r}let H4=VO.define();function H6(e){let t=0,n=0,i=0,r=0;for(let o of e.state.facet(H4)){let a=o(e);a&&(null!=a.left&&(t=Math.max(t,a.left)),null!=a.right&&(n=Math.max(n,a.right)),null!=a.top&&(i=Math.max(i,a.top)),null!=a.bottom&&(r=Math.max(r,a.bottom)))}return{left:t,right:n,top:i,bottom:r}}let H8=VO.define();class H9{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new H9(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let i=0,r=0,o=0;;){let a=Math.min(i<e.length?e[i].fromB:1e9,r<t.length?t[r]:1e9);if(1e9==a)break;let s=a+o,l=a,u=s;for(;;)if(r<t.length&&t[r]<=l){let n=t[r+1];r+=2,l=Math.max(l,n);for(let t=i;t<e.length&&e[t].fromB<=l;t++)o=e[t].toA-e[t].toB;u=Math.max(u,n+o)}else if(i<e.length&&e[i].fromB<=l){let t=e[i++];l=Math.max(l,t.toB),u=Math.max(u,t.toA),o=t.toA-t.toB}else break;n.push(new H9(s,u,a,l))}return n}}class H7{constructor(e,t,n){for(let i of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=Vb.empty(this.startState.doc.length),n))this.changes=this.changes.compose(i.changes);let i=[];this.changes.iterChangedRanges((e,t,n,r)=>i.push(new H9(e,t,n,r))),this.changedRanges=i}static create(e,t,n){return new H7(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}let We=[];class Wt{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return We}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;null==t[i]&&e.removeAttribute(i)}for(let n in t){let i=t[n];"style"==n?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=He(this.dom),i=this.length?e>0:t>0;return new Hg(this.parent.dom,n+ +!!i,0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Wr)return e;return null}static get(e){return e.cmTile}}class Wn extends Wt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t=this.dom,n=null,i,r=(null==e?void 0:e.node)==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,i=n?n.nextSibling:t.firstChild,r&&i!=a.dom&&(r.written=!0),a.dom.parentNode==t)for(;i&&i!=a.dom;)i=Wi(i);else t.insertBefore(a.dom,i);n=a.dom}for(i=n?n.nextSibling:t.firstChild,r&&i&&(r.written=!0);i;)i=Wi(i);this.length=o}}function Wi(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Wr extends Wn{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=Wt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,i=0,r=0;;)if(i==n.children.length){if(!t.length)return;(n=n.parent).breakAfter&&r++,i=t.pop()}else{let o=n.children[i++];if(o instanceof Wo)t.push(i),n=o,i=0;else{let t=r+o.length,n=e(o,r);if(void 0!==n)return n;r=t+o.breakAfter}}}resolveBlock(e,t){let n,i=-1,r,o=-1;if(this.blockTiles((a,s)=>{let l=s+a.length;if(e>=s&&e<=l){if(a.isWidget()&&t>=-1&&t<=1){if(32&a.flags)return!0;16&a.flags&&(n=void 0)}(s<e||e==l&&(t<-1?a.length:a.covers(1)))&&(!n||!a.isWidget()&&n.isWidget())&&(n=a,i=e-s),(l>e||e==s&&(t>1?a.length:a.covers(-1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,o=e-s)}}),!n&&!r)throw Error("No tile at position "+e);return n&&t<0||!r?{tile:n,offset:i}:{tile:r,offset:o}}}class Wo extends Wn{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new Wo(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class Wa extends Wn{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let i=new Wa(t||document.createElement("div"),e);return t&&n||(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let i=null,r=-1,o=null,a=-1;!function e(s,l){for(let u=0,c=0;u<s.children.length&&c<=l;u++){let h=s.children[u],d=c+h.length;d>=l&&(h.isComposite()?e(h,l-c):(!o||o.isHidden&&(t>0||n&&function(e,t){let n=e.coordsIn(0,1),i=t.coordsIn(0,1);return n&&i&&i.top<n.bottom}(o,h)))&&(d>l||32&h.flags)?(o=h,a=l-c):(c<l||16&h.flags&&!h.isHidden)&&(i=h,r=l-c)),c=d}}(this,e);let s=(t<0?i:o)||i||o;return s?{tile:s,offset:s==i?r:a}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=j9(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:i}=n;if(this.dom.contains(e.dom))return e.isText()?new Hg(e.dom,Math.min(e.dom.nodeValue.length,i)):e.domPosFor(i,16&e.flags?1:32&e.flags?-1:t);let r=n.tile.parent,o=!1;for(let e of r.children){if(o)return new Hg(e.dom,0);e==n.tile&&(o=!0)}}return new Hg(this.dom,0)}}class Ws extends Wn{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new Ws(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class Wl extends Wt{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let i=e,r=e,o=0;0==e&&t<0||e==n&&t>=0?!(j$.chrome||j$.gecko)&&(e?(i--,o=1):r<n&&(r++,o=-1)):t<0?i--:r<n&&r++;let a=Hc(this.dom,i,r).getClientRects();if(!a.length)return null;let s=a[(o?o<0:t>=0)?0:a.length-1];return j$.safari&&!o&&0==s.width&&(s=Array.prototype.find.call(a,e=>e.width)||s),o?Hr(s,o<0):s||null}static of(e,t){let n=new Wl(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class Wu extends Wt{constructor(e,t,n,i){super(e,t,i),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;if(n)return Hr(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let i=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let r=i?t.length-1:0;n=t[r],e>0?0!=r:r!=t.length-1&&!(n.top<n.bottom);r+=i?-1:1);return Hr(n,!i)}}get overrideDOMText(){if(!this.length)return Vr.empty;let{root:e}=this;if(!e)return Vr.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,i,r){return!r&&(r=e.toDOM(t),e.editable||(r.contentEditable="false")),new Wu(r,n,e,i)}}class Wc extends Wt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Vr.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Wh{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:i,index:r,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(i.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(r==i.children.length){if(!e&&!a.length)break;n&&n.leave(i),o=!!i.breakAfter,({tile:i,index:r}=a.pop()),r++}else{let s=i.children[r],l=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||!1!==n.skip(s,0,s.length)||!s.isComposite)?(o=!!l,r++,e-=s.length):(a.push({tile:i,index:r}),i=s,r=0,n&&s.isComposite()&&n.enter(s))}else if(r==i.length)o=!!i.breakAfter,({tile:i,index:r}=a.pop()),r++;else if(e){let t=Math.min(e,i.length-r);n&&n.skip(i,r,r+t),e-=t,r+=t}else break;return this.tile=i,this.index=r,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Wd{constructor(e,t,n,i){this.from=e,this.to=t,this.wrapper=n,this.rank=i}}class Wf{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,i){var r;this.flushBuffer();let o=this.ensureMarks(t,n),a=o.lastChild;a&&a.isText()&&!(8&a.flags)&&a.length+e.length<512?(this.cache.reused.set(a,2),(o.children[o.children.length-1]=new Wl(a.dom,a.text+e)).parent=o):o.append(i||Wl.of(e,null==(r=this.cache.find(Wl))?void 0:r.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Wb(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let i=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],r=i.lastChild;if(r instanceof Ws&&r.mark.eq(n.mark))r.dom!=n.dom&&r.setDOM(Wb(n.dom)),i=r;else{if(this.cache.reused.get(n)){let e=Wt.get(n.dom);e&&e.setDOM(Wb(n.dom))}let e=Ws.of(n.mark,n.dom);i.append(e),i=e}this.cache.reused.set(n,2)}let r=Wt.get(e.text);r&&this.cache.reused.set(r,2);let o=new Wl(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,i.append(o)}addInlineWidget(e,t,n){let i=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);i||this.flushBuffer();let r=this.ensureMarks(t,n);i||16&e.flags||r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=Wx);let i=Wa.start(e,t||(null==(n=this.cache.find(Wa))?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let i=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],a;if(t>0&&(a=i.lastChild)&&a instanceof Ws&&a.mark.eq(o))i=a,t--;else{let e=Ws.of(o,null==(n=this.cache.find(Ws,e=>e.mark.eq(o)))?void 0:n.dom);i.append(e),i=e,t=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Wy(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(j$.ios&&Wy(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(WS,0,32)||new Wu(WS.toDOM(),0,WS,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=102*e.rank+e.value.rank,n=new Wd(e.from,e.to,e.value,t),i=this.wrappers.length;for(;i>0&&0>(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to);)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let i=t.lastChild;if(n.from<this.pos&&i instanceof Wo&&i.wrapper.eq(n.wrapper))t=i;else{let i=Wo.of(n.wrapper,null==(e=this.cache.find(Wo,e=>e.wrapper.eq(n.wrapper)))?void 0:e.dom);t.append(i),t=i}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(Wc,void 0,1);return n&&(n.flags=t),n||new Wc(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Wp{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skipCount);if(this.skipCount=0,i)throw Error("Ran out of text content when drawing inline views");this.text=t;let r=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,r)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}let Wg=[Wu,Wa,Wl,Ws,Wc,Wo,Wr];for(let e=0;e<Wg.length;e++)Wg[e].bucket=e;class Wm{constructor(e){this.view=e,this.buckets=Wg.map(()=>[]),this.index=Wg.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let i=e.bucket,r=this.buckets[i],o=this.index[i];for(let e=r.length-1;e>=0;e--){let a=(e+o)%r.length,s=r[a];if((!t||t(s))&&!this.reused.has(s))return r.splice(a,1),a<o&&this.index[i]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let i=this.buckets[0];if(i.length)for(let r=0,o=0;;r++){if(r==i.length){if(o)return null;o=1,r=0}let a=i[r];if(!this.reused.has(a)&&(0==o?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view,a.widget))){if(i.splice(r,1),r<this.index[0]&&this.index[0]--,a.widget==e&&a.length==t&&(497&a.flags)==n)return this.reused.set(a,1),a;return this.reused.set(a,2),new Wu(a.dom,t,e,-498&a.flags|n)}}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Wv{constructor(e,t,n,i,r){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new Wm(e),this.text=new Wp(e.state.doc),this.builder=new Wf(this.cache,new Wr(e,e.contentDOM),js.iter(n)),this.cache.reused.set(t,2),this.old=new Wh(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let i=0,r=0,o=0;;){let a=o<e.length?e[o++]:null,s=a?a.fromA:this.old.root.length;if(s>i){let e=s-i;this.preserve(e,!o,!a),i=s,r+=e}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(r,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,a.toA),this.emit(t.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(r,a.toB)),r=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let i=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof Ws&&t.push(i.mark)}return t}(this.old),r=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let o=n>0||t<e.length?Wu.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&o.flags?(o.flags&=-2,this.builder.addBlockWidget(o)):(this.builder.ensureLine(null),this.builder.addInlineWidget(o,i,r),r=i.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length||this.cache.reused.has(e)?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),i,r)):this.builder.addText(e.text,i,r,this.cache.reuse(e)),r=i.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof Wc)this.cache.add(e);else{if(!(e instanceof Ws))return!1;this.builder.ensureLine(null),this.builder.addMark(e,i,r),this.cache.reused.set(e,1),r=i.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof Ws&&i.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?i.length&&(i.length=r=0):e instanceof Ws&&(i.shift(),r=Math.min(r,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,i=this.builder,r=0,o=js.spans(this.decorations,e,t,{point:(e,t,o,a,s,l)=>{var u,c,h;if(o instanceof j1){if(this.disallowBlockEffectsFor[l]){if(o.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=a.length,s>a.length)i.continueWidget(t-e);else{let r,l=o.widget||(o.block?Ww.block:Ww.inline),c=(r=(u=o).isReplace?64*(u.startSide<0)|128*(u.endSide>0):u.startSide>0?32:16,u.block&&(r|=256),r),h=this.cache.findWidget(l,t-e,c)||Wu.of(l,this.view,t-e,c);o.block?(o.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(h)):(i.ensureLine(n),i.addInlineWidget(h,a,s))}n=null}else{let e,t;c=n,e=(h=o).spec.attributes,t=h.spec.class,(e||t)&&(c||(c={class:"cm-line"}),e&&jU(e,c),t&&(c.class+=" "+t)),n=c}t>e&&this.text.skip(t-e)},span:(e,t,o,a)=>{for(let r=e;r<t;){let s=this.text.next(Math.min(512,t-r));null==s?(i.addLineStartIfNotCovered(n),i.addBreak(),r++):(i.ensureLine(n),i.addText(s,o,r==e?a:o.length),r+=s.length),n=null}r=o.length}});this.openWidget=o>r,this.openWidget||i.addLineStartIfNotCovered(n),this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let i=e.parentNode;;i=i.parentNode){let e=Wt.get(i);if(i==this.view.contentDOM)break;e instanceof Ws?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof Wo||("DIV"!=i.nodeName||n||i==this.view.contentDOM?n||t.push(Ws.of(new jJ({tagName:i.nodeName.toLowerCase(),attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}(i)}),i)):n=new Wa(i,Wx))}return{line:n,marks:t}}}function Wy(e,t){let n=e=>{for(let i of e.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}let Wx={class:"cm-line"};function Wb(e){let t=Wt.get(e);return t&&t.setDOM(e.cloneNode()),e}class Ww extends jX{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ww.inline=new Ww("span"),Ww.block=new Ww("div");let WS=new class extends jX{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class W_{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=jQ.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Wr(e,e.contentDOM),this.updateInner([new H9(0,0,0,e.state.doc.length)],null)}update(e){var t,n,i,r,o,a,s,l,u;let c,h,d,f=e.changedRanges;this.minWidth>0&&f.length&&(f.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let p=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null==(t=this.domChanged)?void 0:t.newSel)?p=this.domChanged.newSel.head:(n=e.changes,i=this.hasComposition,c=!1,i&&n.iterChangedRanges((e,t)=>{e<i.to&&t>i.from&&(c=!0)}),c||e.selectionSet||(p=e.state.selection.main.head)));let g=p>-1?function(e,t,n){let i=WM(e,n);if(!i)return null;let{node:r,from:o,to:a}=i,s=r.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(i.from,i.to)!=s)return null;let l=t.invertedDesc;return{range:new H9(l.mapPos(o),l.mapPos(a),o,a),text:r}}(this.view,e.changes,p):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;f=new H9(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(f.slice())}this.hasComposition=g?{from:g.range.fromB,to:g.range.toB}:null,(j$.ie||j$.chrome)&&!g&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let m=this.decorations,v=this.blockWrappers;this.updateDeco();let y=(r=m,o=this.decorations,a=e.changes,h=new WA,js.compare(r,o,a,h),h.changes);y.length&&(f=H9.extendWithRanges(f,y));let x=(s=v,l=this.blockWrappers,u=e.changes,d=new Wk,js.compare(s,l,u,d),d.changes);return x.length&&(f=H9.extendWithRanges(f,x)),g&&!f.some(e=>e.fromA<=g.range.fromA&&e.toA>=g.range.toA)&&(f=g.range.addToSet(f.slice())),(!(2&this.tile.flags)||0!=f.length)&&(this.updateInner(f,g),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,i=new Wv(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Wt.get(t.text)&&i.cache.reused.set(Wt.get(t.text),2),this.tile=i.run(e,t),WC(n,i.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=j$.chrome||j$.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||n.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof WT&&i.push(e.dom);n.updateGaps(i)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(HG)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,o=r==i,a=!o&&!(this.view.state.facet(HU)||i.tabIndex>-1)&&j8(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(o||t||a))return;let s=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),j$.gecko&&l.empty&&!this.hasComposition&&1==(n=u).node.nodeType&&n.node.firstChild&&(0==n.offset||"false"==n.node.childNodes[n.offset-1].contentEditable)&&(n.offset==n.node.childNodes.length||"false"==n.node.childNodes[n.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(e,u.node.childNodes[u.offset]||null)),u=c=new Hg(e,0),s=!0}let h=this.view.observer.selectionRange;!s&&h.focusNode&&(j7(u.node,u.offset,h.anchorNode,h.anchorOffset)&&j7(c.node,c.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,l))||(this.view.observer.ignore(()=>{j$.android&&j$.chrome&&i.contains(h.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(h.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let e=j4(this.view.root);if(e)if(l.empty){if(j$.gecko){var t,n;let e=(t=u.node,n=u.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|2*(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable));if(e&&3!=e){let t=(1==e?Hf:Hp)(u.node,u.offset);t&&(u=new Hg(t.node,t.offset))}}e.collapse(u.node,u.offset),null!=l.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=l.bidiLevel)}else if(e.extend){e.collapse(u.node,u.offset);try{e.extend(c.node,c.offset)}catch(e){}}else{let t=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),t.setEnd(c.node,c.offset),t.setStart(u.node,u.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new Hg(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Hg(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&j7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=j4(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let s=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!s||!l||s.bottom>l.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(i,r)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let i=n.posAtStart;if(n.isComposite()){let r;if(e==n.dom)r=n.dom.childNodes[t];else{let i=0==Hi(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}r=i<0?e:e.nextSibling}if(r==n.dom.firstChild)return i;for(;r&&!Wt.get(r);)r=r.nextSibling;if(!r)return i+n.length;for(let e=0,t=i;;e++){let i=n.children[e];if(i.dom==r)return t;t+=i.length+i.breakAfter}}else if(n.isText())return e==n.dom?i+t:i+(t?n.length:0);else return i}domAtPos(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(i,t)}inlineDOMNearPos(e,t){let n,i=-1,r=!1,o,a=-1,s=!1;return(this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&l>=e)return!0;16&t.flags&&(r=!0)}else{let u=l+t.length;if(l<=e&&(n=t,i=e-l,r=u<e),u>=e&&!o&&(o=t,a=e-l,s=l>e),l>e&&o)return!0}}),n||o)?(r&&o?n=null:s&&n&&(o=null),n&&t<0||!o?n.domIn(i,t):o.domIn(a,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof WT?null:n.coordsInWidget(i,t,!0):n.coordsIn(i,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let i of t.children){if(i.length>=n){let t=e(i,n);if(t)return t}if((n-=i.length)<0)break}else if(t.isText()&&n<t.length){let e=Vf(t.text,n);if(e==n)return null;let i=Hc(t.dom,n,e).getClientRects();for(let e=0;e<i.length;e++){let t=i[e];if(e==i.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=this.view.textDirection==Hm.LTR,l=0,u=(e,c,h)=>{for(let d=0;d<e.children.length&&!(c>i);d++){let i=e.children[d],f=c+i.length,p=i.dom.getBoundingClientRect(),{height:g}=p;if(h&&!d&&(l+=p.top-h.top),i instanceof Wo)f>n&&u(i,c,p);else if(c>=n&&(l>0&&t.push(-l),t.push(g+l),l=0,o)){let e=i.dom.lastChild,t=e?j9(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-p.left:p.right-e.left;n>a&&(a=n,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=f)}}h&&d==e.children.length-1&&(l+=h.bottom-p.bottom),c=f+i.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?Hm.RTL:Hm.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let i of e.children){if(!i.isText()||/[^ -~]/.test(i.text))return;let e=j9(i.dom);if(1!=e.length)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement("div"),n,i,r;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=j9(t.firstChild)[0];n=t.getBoundingClientRect().height,i=e&&e.width?e.width/27:7,r=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:i,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],o=r?r.from-1:this.view.state.doc.length;if(o>n){let i=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(jQ.replace({widget:new WT(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return jQ.set(e)}updateDeco(){let e=1,t=this.view.state.facet(HJ).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,i=this.view.state.facet(H1).map((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e});for(i.length&&(this.dynamicDecorationMap[e++]=n,t.push(js.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(H0).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){var t;if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(Hj))try{if(t(this.view,e.range,e))return!0}catch(e){H$(this.view.state,e,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,null!=(t=n.assoc)?t:n.empty?0:n.head>n.anchor?-1:1),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let o=H6(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;if(!function(e,t,n,i,r,o,a,s){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,h=!1;c&&!h;)if(1==c.nodeType){let e,d=c==l.body,f=1,p=1;if(d)e=function(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:f,scaleY:p}=Ho(c,t)),e={left:t.left,right:t.left+c.clientWidth*f,top:t.top,bottom:t.top+c.clientHeight*p}}let g=0,m=0;if("nearest"==r)t.top<e.top+a?(m=t.top-(e.top+a),n>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+a)):t.bottom>e.bottom-a&&(m=t.bottom-e.bottom+a,n<0&&t.top-m<e.top&&(m=t.top-(e.top+a)));else{let i=t.bottom-t.top,o=e.bottom-e.top;m=("center"==r&&i<=o?t.top+i/2-o/2:"start"==r||"center"==r&&n<0?t.top-a:t.bottom-o+a)-e.top}if("nearest"==i?t.left<e.left+o?(g=t.left-(e.left+o),n>0&&t.right>e.right+g&&(g=t.right-e.right+o)):t.right>e.right-o&&(g=t.right-e.right+o,n<0&&t.left<e.left+g&&(g=t.left-(e.left+o))):g=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==s?t.left-o:t.right-(e.right-e.left)+o)-e.left,g||m)if(d)u.scrollBy(g,m);else{let e=0,n=0;if(m){let e=c.scrollTop;c.scrollTop+=m/p,n=(c.scrollTop-e)*p}if(g){let t=c.scrollLeft;c.scrollLeft+=g/f,e=(c.scrollLeft-t)*f}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&1>Math.abs(e-g)&&(i="nearest"),n&&1>Math.abs(n-m)&&(r="nearest")}if(d)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Hm.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(n.head,1);e&&e.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){WC(this.tile)}}function WC(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let i of(null==n&&e.destroy(),e.children))WC(i,t)}function WM(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=Hf(n.focusNode,n.focusOffset),r=Hp(n.focusNode,n.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let t=Wt.get(r.node);if(!t||t.isText()&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=Wt.get(i.node);!e||e.isText()&&e.text!=i.node.nodeValue||(o=r)}}if(e.docView.lastCompositionAfterCursor=o!=i,!o)return null;let a=t-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}let WA=class{constructor(){this.changes=[]}compareRange(e,t){j5(e,t,this.changes)}comparePoint(e,t){j5(e,t,this.changes)}boundChange(e){j5(e,e,this.changes)}};class Wk{constructor(){this.changes=[]}compareRange(e,t){j5(e,t,this.changes)}comparePoint(){}boundChange(e){j5(e,e,this.changes)}}class WT extends jX{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function WI(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let e;for(let r of i.type){if(r.from>t)break;if(!(r.to<t)){if(r.from<t&&r.to>t)return r;(!e||r.type==jK.Text&&(e.type!=r.type||(n<0?r.from<t:r.to>t)))&&(e=r)}}return e||i}return i}function WD(e,t,n,i){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),a=e.textDirectionAt(r.from);for(let s=t,l=null;;){let t=function(e,t,n,i,r){var o;let a=i.head-e.from,s=HA.find(t,a,null!=(o=i.bidiLevel)?o:-1,i.assoc),l=t[s],u=l.side(r,n);if(a==u){let e=s+=r?1:-1;if(e<0||e>=t.length)return null;a=(l=t[s=e]).side(!r,n),u=l.side(r,n)}let c=Vf(e.text,a,l.forward(r,n));(c<l.from||c>l.to)&&(c=u),HI=e.text.slice(Math.min(a,c),Math.max(a,c));let h=s==(r?t.length-1:0)?null:t[s+(r?1:-1)];return h&&c==u&&h.level+ +!r<l.level?VT.cursor(h.side(!r,n)+e.from,h.forward(r,n)?1:-1,h.level):VT.cursor(c+e.from,l.forward(r,n)?-1:1,l.level)}(r,o,a,s,n),u=HI;if(!t){if(r.number==(n?e.state.doc.lines:1))return s;u="\n",r=e.state.doc.line(r.number+(n?1:-1)),o=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(l){if(!l(u))return s}else{if(!i)return t;l=i(u)}s=t}}function WO(e,t,n){for(;;){let i=0;for(let r of e)r.between(t-1,t+1,(e,r,o)=>{if(t>e&&t<r){let o=i||n||(t-e<r-t?-1:1);t=o<0?e:r,i=o}});if(!i)return t}}function WP(e,t){let n=null;for(let i=0;i<t.ranges.length;i++){let r=t.ranges[i],o=null;if(r.empty){let t=WO(e,r.from,0);t!=r.from&&(o=VT.cursor(t,-1))}else{let t=WO(e,r.from,-1),n=WO(e,r.to,1);(t!=r.from||n!=r.to)&&(o=r.undirectional?VT.undirectionalRange(r.from,r.to):VT.range(r.from==r.anchor?t:n,r.from==r.head?t:n))}o&&(n||(n=t.ranges.slice()),n[i]=o)}return n?VT.create(n,t.mainIndex):t}function WR(e,t,n){let i=WO(e.state.facet(H2).map(t=>t(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:VT.cursor(i,i<n.from?1:-1)}class WE{constructor(e,t){this.pos=e,this.assoc=t}}function WL(e,t,n,i){let r=e.contentDOM.getBoundingClientRect(),o=r.top+e.viewState.paddingTop,{x:a,y:s}=t,l=s-o,u;for(;;){if(l<0)return new WE(0,1);if(l>e.viewState.docHeight)return new WE(e.state.doc.length,-1);if(u=e.elementAtHeight(l),null==i)break;if(u.type==jK.Text){if(i<0?u.to<e.viewport.from:u.from>e.viewport.to)break;let t=e.docView.coordsAt(i<0?u.from:u.to,i>0?-1:1);if(t&&(i<0?t.top<=l+o:t.bottom>=l+o))break}let t=e.viewState.heightOracle.textHeight/2;l=i>0?u.bottom+t:u.top-t}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==jK.Text){let t=function(e,t,n,i,r){let o=Math.round((i-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((r-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+jb(a,o,e.state.tabSize)}(e,r,u,a,s);return new WE(t,t==u.from?1:-1)}}if(u.type!=jK.Text)return l<(u.top+u.bottom)/2?new WE(u.from,1):new WE(u.to,-1);let c=e.docView.lineAt(u.from,2);return c&&c.length==u.length||(c=e.docView.lineAt(u.from,-2)),new WN(e,a,s,e.textDirectionAt(u.from)).scanTile(c,u.from)}class WN{constructor(e,t,n,i){this.view=e,this.x=t,this.y=n,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[HA.find(i,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[HA.find(i,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:i}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+i.from<t)}scan(e,t,n=!1){let i,r,o=0,a=e.length-1,s=new Set,l=this.bidiIn(e[0],e[a]),u=-1,c=1e9,h;for(;o<a;){let n=a-o,d=o+a>>1;o:if(s.has(d)){let e=o+Math.floor(Math.random()*n);for(let t=0;t<n;t++){if(!s.has(e)){d=e;break o}++e==a&&(e=o)}break}s.add(d);let f=t(d);if(f)for(let t=0;t<f.length;t++){let n=f[t],s=0;if(0!=n.width||!(f.length>1)){if(n.bottom<this.y)(!i||i.bottom<n.bottom)&&(i=n),s=1;else if(n.top>this.y)(!r||r.top>n.top)&&(r=n),s=-1;else{let e=n.left>this.x?this.x-n.left:n.right<this.x?this.x-n.right:0,t=Math.abs(e);t<c&&(u=d,c=t,h=n),e&&(s=e<0==(this.baseDir==Hm.LTR)?-1:1)}-1==s&&(!l||this.baseDirAt(e[d],1))?a=d:1==s&&(!l||this.baseDirAt(e[d+1],-1))&&(o=d+1)}}}if(!h){if(!r&&!i)return{i:e[0],after:!1};let n=i&&(!r||this.y-i.bottom<r.top-this.y)?i:r;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(c&&!n){let{top:n,bottom:o}=h;if(i&&i.bottom>(n+n+o)/3)return this.y=i.bottom-1,this.scan(e,t,!0);if(r&&r.top<(n+o+o)/3)return this.y=r.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==Hm.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,t){let n=[];for(let i=0;i<e.length;i=Vf(e.text,i))n.push(t+i);n.push(t+e.length);let i=this.scan(n,i=>{let r=n[i]-t,o=n[i+1]-t;return Hc(e.dom,r,o).getClientRects()});return i.after?new WE(n[i.i+1],-1):new WE(n[i.i],1)}scanTile(e,t){if(!e.length)return new WE(t,1);if(1==e.children.length){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let i=0,r=t;i<e.children.length;i++)n.push(r+=e.children[i].length);let i=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(1==n.dom.nodeType?n.dom:Hc(n.dom,0,n.length)).getClientRects()}),r=e.children[i.i],o=n[i.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):i.after?new WE(n[i.i+1],-1):new WE(o,1)}}class WB{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(je.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=""}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let r=Wt.get(i),o=i.nextSibling;if(o==t){(null==r?void 0:r.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let a=Wt.get(o);(r&&a?r.breakAfter:(r?r.breakAfter:Ht(i))||Ht(o)&&("BR"!=i.nodeName||(null==r?void 0:r.isWidget()))&&this.text.length>e)&&!function(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=Wt.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}(o,t)&&this.lineBreak(),i=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,a;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(a=i.exec(t))&&(r=a.index,o=a[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=r+o}}readNode(e){let t=Wt.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(!function(e,t,n){for(;;){if(!t||n<Hi(t))return!1;if(t==e)return!0;n=He(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class WF{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Wz{constructor(e,t,n,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=function e(t,n,i,r){if(t.isComposite()){let o=-1,a=-1,s=-1,l=-1;for(let u=0,c=r,h=r;u<t.children.length;u++){let r=t.children[u],d=c+r.length;if(c<n&&d>i)return e(r,n,i,c);if(d>=n&&-1==o&&(o=u,a=c),c>i&&r.dom.parentNode==t.dom){s=u,l=h;break}h=d,c=d+r.breakAfter}return{from:a,to:l<0?r+t.length:l,startDOM:(o?t.children[o-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s<t.children.length&&s>=0?t.children[s].dom:null}}return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}(e.docView.tile,t,n,0))){let t=r||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new WF(n,i)),(r!=n||o!=i)&&t.push(new WF(r,o))),t}(e),n=new WB(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?VT.single(n+t,i+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!j6(e.contentDOM,t.focusNode)?a.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),i=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!j6(e.contentDOM,t.anchorNode)?a.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((j$.ios||j$.chrome)&&n!=i&&Math.min(n,i)<=a.main.from&&Math.max(n,i)>=a.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,i),r=Math.max(n,i),o=s.from-t,a=s.to-r;(0==o||1==o||0==t)&&(0==a||-1==a||r==e.state.doc.length)&&(n=0,i=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(VT.range(i,n));else if(e.lineWrapping&&i==n&&!(a.main.empty&&a.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),i=0;t&&(i=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=VT.create([VT.cursor(n,i)])}else this.newSel=VT.single(i,n)}}}function WV(e,t){let n,{newSel:i}=t,{state:r}=e,o=r.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:i}=t.bounds,s=o.from,l=null;(8===a||j$.android&&t.text.length<i-e)&&(s=o.to,l="end");let u=r.doc.sliceString(e,i,""),c,h;!o.empty&&o.from>=e&&o.to<=i&&(t.typeOver||u!=t.text)&&u.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&u.slice(o.to-e)==t.text.slice(c=t.text.length-(u.length-(o.to-e)))?n={from:o.from,to:o.to,insert:Vr.of(t.text.slice(o.from-e,c).split(""))}:(h=WH(u,t.text,s-e,l))&&(j$.chrome&&13==a&&h.toB==h.from+2&&""==t.text.slice(h.from,h.toB)&&h.toB--,n={from:e+h.from,to:e+h.toA,insert:Vr.of(t.text.slice(h.from,h.toB).split(""))})}else i&&(!e.hasFocus&&r.facet(HU)||WW(i,o))&&(i=null);if(!n&&!i)return!1;if((j$.mac||j$.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(i&&2==n.insert.length&&(i=VT.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:Vr.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:r.toText(e.inputState.insertingText)}:j$.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(i&&(i=VT.single(i.main.anchor-1,i.main.head-1)),n={from:o.from,to:o.to,insert:Vr.of([" "])}),n)return Wj(e,n,i,a);if(!i||WW(i,o))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),"select.pointer"==(n=e.inputState.lastSelectionOrigin)&&(i=WP(r.facet(H2).map(t=>t(e)),i))),e.dispatch({selection:i,scrollIntoView:t,userEvent:n}),!0}}function Wj(e,t,n,i=-1){let r;if(j$.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(j$.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&Hh(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==i&&t.insert.length<t.to-t.from&&t.to>o.head)&&Hh(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&Hh(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s=()=>r||(r=function(e,t,n){let i,r=e.state,o=r.selection.main,a=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,i=n<0?o.from:o.to,s=WO(r.facet(H2).map(t=>t(e)),i,n);t.from==s&&(a=s)}if(a>-1)i={changes:t,selection:VT.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?r.sliceDoc(o.from,t.from):"",a=o.to>t.to?r.sliceDoc(t.to,o.to):"";i=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+a))}else{let a=r.changes(t),s=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let l=e.state.sliceDoc(t.from,t.to),u,c=n&&WM(e,n.main.head);if(c){let e=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-e}}else u=e.state.doc.lineAt(o.head);let h=o.to-t.to;i=r.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:a,range:s||n.map(a)};let i=n.to-h,c=i-l.length;if(e.state.sliceDoc(c,i)!=l||i>=u.from&&c<=u.to)return{range:n};let d=r.changes({from:c,to:i,insert:t.insert}),f=n.to-o.to;return{changes:d,range:s?VT.range(Math.max(0,s.anchor+f),Math.max(0,s.head+f)):n.map(d)}})}else i={changes:a,selection:s&&r.selection.replaceRange(s)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:s,scrollIntoView:!0})}(e,t,n));return e.state.facet(HL).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function WH(e,t,n,i){let r=Math.min(e.length,t.length),o=0;for(;o<r&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==r&&e.length==t.length)return null;let a=e.length,s=t.length;for(;a>0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==i){let e=Math.max(0,o-Math.min(a,s));n-=a+e-o}if(a<o&&e.length<t.length){let e=n<=o&&n>=a?o-n:0;o-=e,s=o+(s-a),a=o}else if(s<o){let e=n<=o&&n>=s?o-n:0;o-=e,a=o+(a-s),s=o}return{from:o,toA:a,toB:s}}function WW(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class WG{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,j$.safari&&e.contentDOM.addEventListener("input",()=>null),j$.gecko&&function(e){Gi.has(e)||(Gi.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,i;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=Wt.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e)||"keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,i=e&&e.plugin.domEventHandlers,r=e&&e.plugin.domEventObservers;if(i)for(let e in i){let r=i[e];r&&n(e).handlers.push(W$(t.value,r))}if(r)for(let e in r){let i=r[e];i&&n(e).observers.push(W$(t.value,i))}}for(let e in WK)n(e).handlers.push(WK[e]);for(let e in WQ)n(e).observers.push(WQ[e]);return t}(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=r&&(i.removeEventListener(e,this.handleEvent),o=null),o||i.addEventListener(e,this.handleEvent,{passive:r})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&0>WY.indexOf(e.keyCode)&&(this.tabFocusMode=-1),j$.android&&j$.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(j$.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(WU.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||Wq.indexOf(e.key)>-1&&e.ctrlKey)){var t;let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&j$.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&(t=this.view.win).visualViewport&&t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return 229!=e.keyCode&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,Hh(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(j$.safari&&!j$.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function W$(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){H$(n.state,e)}}}let WU=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Wq="dthko",WY=[16,17,18,20,91,92,224,225];function WZ(e){return .7*Math.max(0,e)+8}class WX{constructor(e,t,n,i){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Ha(e.contentDOM),this.atoms=e.state.facet(H2).map(t=>t(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(je.allowMultipleSelections)&&function(e,t){let n=e.state.facet(HD);return n.length?n[0](t):j$.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=j4(e.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let n=r[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)&&1==W8(t)&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&10>(t=this.startEvent,Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))))return;this.select(this.lastEvent=e);let n=0,i=0,r=0,o=0,a=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=H6(this.view);e.clientX-l.left<=r+6?n=-WZ(r-e.clientX):e.clientX+l.right>=a-6&&(n=WZ(e.clientX-a)),e.clientY-l.top<=o+6?i=-WZ(o-e.clientY):e.clientY+l.bottom>=s-6&&(i=WZ(e.clientY-s)),this.setScrollSpeed(n,i)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=WP(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}let WK=Object.create(null),WQ=Object.create(null),WJ=j$.ie&&j$.ie_version<15||j$.ios&&j$.webkit_version<604;function W0(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function W1(e,t){t=W0(e.state,HB,t);let{state:n}=e,i,r=1,o=n.toText(t),a=o.lines==n.selection.ranges.length;if(null!=W7&&n.selection.ranges.every(e=>e.empty)&&W7==o.toString()){let e=-1;i=n.changeByRange(i=>{let s=n.doc.lineAt(i.from);if(s.from==e)return{range:i};e=s.from;let l=n.toText((a?o.line(r++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:l},range:VT.cursor(i.from+l.length)}})}else i=a?n.changeByRange(e=>{let t=o.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:VT.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function W2(e,t,n,i){if(1==i)return VT.cursor(t,n);{if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),o=t-r.from;if(0==r.length)return VT.cursor(t);0==o?n=1:o==r.length&&(n=-1);let a=o,s=o;n<0?a=Vf(r.text,o,!1):s=Vf(r.text,o);let l=i(r.text.slice(a,s));for(;a>0;){let e=Vf(r.text,a,!1);if(i(r.text.slice(e,a))!=l)break;a=e}for(;s<r.length;){let e=Vf(r.text,s);if(i(r.text.slice(s,e))!=l)break;s=e}return VT.undirectionalRange(a+r.from,s+r.from)}(e.state,t,n);let r=e.docView.lineAt(t,n),o=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:o.from,s=r?r.posAtEnd:o.to;return s<e.state.doc.length&&s==o.to&&s++,VT.undirectionalRange(a,s)}}WQ.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},WQ.wheel=WQ.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},WK.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),WQ.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")},WQ.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},WK.mousedown=(e,t)=>{var n,i;let r,o,a;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let s=null;for(let n of e.state.facet(HP))if(s=n(e,t))break;if(s||0!=t.button||(n=e,i=t,r=n.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),o=W8(i),a=n.state.selection,s={update(e){e.docChanged&&(r.pos=e.changes.mapPos(r.pos),a=a.map(e.changes))},get(e,t,i){let s=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),l,u=W2(n,s.pos,s.assoc,o);if(r.pos!=s.pos&&!t){let e=W2(n,r.pos,r.assoc,o),t=Math.min(e.from,u.from),i=Math.max(e.to,u.to);u=t<u.from?VT.range(t,i,u.assoc):VT.range(i,t,u.assoc)}return t?a.replaceRange(a.main.extend(u.from,u.to,u.assoc)):i&&1==o&&a.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:i,to:r}=e.ranges[n];if(i<=t&&r>=t)return VT.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n))}return null}(a,s.pos))?l:i?a.addRange(u):VT.create([u])}}),s){let n=!e.hasFocus;e.inputState.startMouseSelection(new WX(e,t,s,n)),n&&e.observer.ignore(()=>{Hu(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),!1===i.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let W5=j$.ie&&j$.ie_version<=11,W3=null,W4=0,W6=0;function W8(e){if(!W5)return e.detail;let t=W3,n=W6;return W3=e,W6=Date.now(),W4=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(W4+1)%3:1}function W9(e,t,n,i){let r;if(!(n=W0(e.state,HB,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,s=i&&a&&((r=e.state.facet(HO)).length?r[0](t):j$.mac?!t.altKey:!t.ctrlKey)?{from:a.from,to:a.to}:null,l={from:o,insert:n},u=e.state.changes(s?[s,l]:l);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}WK.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let e=i.posAtStart,t=e+i.length;(e>=n.to||t<=n.from)&&(n=VT.undirectionalRange(e,t))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",W0(e.state,HF,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},WK.dragend=e=>(e.inputState.draggedContent=null,!1),WK.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,o=()=>{++r==n.length&&W9(e,t,i.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(i[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return W9(e,t,n,!0),!0}return!1},WK.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=WJ?null:t.clipboardData;return n?(W1(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(!function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),W1(e,n.value)},50)}(e),!1)};let W7=null;WK.copy=WK.cut=(e,t)=>{if(!j8(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let o=e.doc.lineAt(i);o.number>r&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}i=!0}return{text:W0(e,HF,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;W7=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=WJ?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(!function(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}(e,n),!1)};let Ge=VJ.define();function Gt(e,t){let n=[];for(let i of e.facet(HN)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:Ge.of(!0)}):null}function Gn(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Gt(e.state,t);n?e.dispatch(n):e.update([])}},10)}WQ.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Gn(e)},WQ.blur=e=>{e.observer.clearSelectionRange(),Gn(e)},WQ.compositionstart=WQ.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},WQ.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,j$.chrome&&j$.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},WQ.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},WK.beforeinput=(e,t)=>{var n,i;let r;if(("insertText"==t.inputType||"insertCompositionText"==t.inputType)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let i=null==(n=t.dataTransfer)?void 0:n.getData("text/plain"),r=t.getTargetRanges();if(i&&r.length){let t=r[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return Wj(e,{from:n,to:o,insert:e.state.toText(i)},null),!0}}if(j$.chrome&&j$.android&&(r=WU.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null==(i=window.visualViewport)?void 0:i.height)||0;setTimeout(()=>{var n;((null==(n=window.visualViewport)?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return j$.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),j$.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>WQ.compositionend(e,t),20),!1};let Gi=new Set,Gr=["pre-wrap","normal","pre-line","break-spaces"],Go=!1;class Ga{constructor(e){this.lineWrapping=e,this.doc=Vr.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Gr.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,r,o){let a=Gr.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,s){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return s}}class Gs{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Gl{constructor(e,t,n,i,r){this.from=e,this.length=t,this.top=n,this.height=i,this._content=r}get type(){return"number"==typeof this._content?jK.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof j1?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Gl(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Gu=((R=Gu||(Gu={}))[R.ByPos=0]="ByPos",R[R.ByHeight=1]="ByHeight",R[R.ByPosNoHeight=2]="ByPosNoHeight",R);class Gc{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=2*!!e|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>.001&&(Go=!0),this.height=e)}replace(e,t,n){return Gc.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,o=n.doc;for(let a=i.length-1;a>=0;a--){let{fromA:s,toA:l,fromB:u,toB:c}=i[a],h=r.lineAt(s,Gu.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=l?h:r.lineAt(l,Gu.ByPosNoHeight,n,0,0);for(c+=d.to-l,l=d.to;a>0&&h.from<=i[a-1].toA;)s=i[a-1].fromA,u=i[a-1].fromB,a--,s<h.from&&(h=r.lineAt(s,Gu.ByPosNoHeight,n,0,0));u+=h.from-s,s=h.from;let f=Gy.build(n.setDoc(o),e,u,c);r=Gh(r,r.replace(s,l,f))}return r.updateHeight(n,0)}static empty(){return new Gp(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,r=0;for(;;)if(t==n)if(i>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,i-=r.size}else if(r>2*i){let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}else break;else if(i<r){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(r+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new Gm(Gc.of(e.slice(0,t)),o,Gc.of(e.slice(n)))}}function Gh(e,t){return e==t?e:(e.constructor!=t.constructor&&(Go=!0),t)}Gc.prototype.size=1;let Gd=jQ.replace({});class Gf extends Gc{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Gl(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,i){return this.spaceAbove&&e<n+this.spaceAbove?new Gl(i,0,n,this.spaceAbove,Gd):this.mainBlock(n,i)}lineAt(e,t,n,i,r){let o=this.mainBlock(i,r);return this.spaceAbove?this.blockAt(0,n,i,r).join(o):o}forEachLine(e,t,n,i,r,o){e<=r+this.length&&t>=r&&o(this.lineAt(0,Gu.ByPos,n,i,r))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Gp extends Gf{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Gl(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof Gp||i instanceof Gg&&4&i.flags)&&10>Math.abs(this.length-i.length)?(i instanceof Gg?i=new Gp(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Gc.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setMeasuredHeight(i):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Gg extends Gc{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,r=i-n+1,o,a=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*r);o=t/r,this.length>r+1&&(a=(this.height-t)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,n,i){let{firstLine:r,lastLine:o,perLine:a,perChar:s}=this.heightMetrics(t,i);if(t.lineWrapping){let r=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(r),l=a+o.length*s,u=Math.max(n,e-l/2);return new Gl(o.from,o.length,u,l,0)}{let i=Math.max(0,Math.min(o-r,Math.floor((e-n)/a))),{from:s,length:l}=t.doc.line(r+i);return new Gl(s,l,n+a*i,a,0)}}lineAt(e,t,n,i,r){if(t==Gu.ByHeight)return this.blockAt(e,n,i,r);if(t==Gu.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new Gl(t,i-t,0,0,0)}let{firstLine:o,perLine:a,perChar:s}=this.heightMetrics(n,r),l=n.doc.lineAt(e),u=a+l.length*s,c=l.number-o,h=i+a*c+s*(l.from-r-c);return new Gl(l.from,l.length,Math.max(i,Math.min(h,i+this.height-u)),u,0)}forEachLine(e,t,n,i,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:a,perLine:s,perChar:l}=this.heightMetrics(n,r);for(let u=e,c=i;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-a;c+=s*n+l*(e-r-n)}let i=s+l*t.length;o(new Gl(t.from,t.length,c,i,0)),c+=i,u=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof Gg?n[n.length-1]=new Gg(e.length+i):n.push(null,new Gg(i-1))}if(e>0){let t=n[0];t instanceof Gg?n[0]=new Gg(e+t.length):n.unshift(new Gg(e-1),null)}return Gc.of(n)}decomposeLeft(e,t){t.push(new Gg(e-1),null)}decomposeRight(e,t){t.push(null,new Gg(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],o=Math.max(t,i.from),a=-1;for(i.from>t&&n.push(new Gg(i.from-t-1).updateHeight(e,t));o<=r&&i.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let r=i.heights[i.index++],s=0;r<0&&(s=-r,r=i.heights[i.index++]),-1==a?a=r:Math.abs(r-a)>=.001&&(a=-2);let l=new Gp(t,r,s);l.outdated=!1,n.push(l),o+=t+1}o<=r&&n.push(null,new Gg(r-o).updateHeight(e,o));let s=Gc.of(n);return(a<0||Math.abs(s.height-this.height)>=.001||Math.abs(a-this.heightMetrics(e,t).perLine)>=.001)&&(Go=!0),Gh(this,s)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Gm extends Gc{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,i){let r=n+this.left.height;return e<r?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,n,i,r){let o=i+this.left.height,a=r+this.left.length+this.break,s=t==Gu.ByHeight?e<o:e<a,l=s?this.left.lineAt(e,t,n,i,r):this.right.lineAt(e,t,n,o,a);if(this.break||(s?l.to<a:l.from>a))return l;let u=t==Gu.ByPosNoHeight?Gu.ByPosNoHeight:Gu.ByPos;return s?l.join(this.right.lineAt(a,u,n,o,a)):this.left.lineAt(a,u,n,i,r).join(l)}forEachLine(e,t,n,i,r,o){let a=i+this.left.height,s=r+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,i,r,o),t>=s&&this.right.forEachLine(e,t,n,a,s,o);else{let l=this.lineAt(s,Gu.ByPos,n,i,r);e<l.from&&this.left.forEachLine(e,l.from-1,n,i,r,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,s,o)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let e of n)r.push(e);if(e>0&&Gv(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),Gv(r,e)}return Gc.of(r)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Gc.of(this.break?[e,null,t]:[e,t]):(this.left=Gh(this.left,e),this.right=Gh(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,i){let{left:r,right:o}=this,a=t+r.length+this.break,s=null;return(i&&i.from<=t+r.length&&i.more?s=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=a+o.length&&i.more?s=o=o.updateHeight(e,a,n,i):o.updateHeight(e,a,n),s)?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Gv(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof Gg&&(i=e[t+1])instanceof Gg&&e.splice(t-1,3,new Gg(n.length+1+i.length))}class Gy{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Gp?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Gp(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new Gf(o,i,n)):(o||r||i>=5)&&this.addLineDeco(i,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Gp(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Gg(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Gp)return e;let t=new Gp(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Gp||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Gp(0,-1,0));let n=e;for(let e of this.nodes)e instanceof Gp&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,i){let r=new Gy(n,e);return js.spans(t,n,i,r,0),r.finish(n)}}class Gx{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&j5(e,t,this.changes,5)}}class Gb{constructor(e,t,n,i){this.from=e,this.to=t,this.size=n,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return jQ.replace({widget:new Gw(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class Gw extends jX{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class GS{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=GA,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Hm.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(HQ).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new Ga(n),this.stateDeco=Gk(t),this.heightMap=Gc.empty().applyChanges(this.stateDeco,Vr.empty,this.heightOracle.setDoc(t.doc),[new H9(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=jQ.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>i>=e&&i<=t)){let{from:t,to:n}=this.lineBlockAt(i);e.push(new G_(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?GA:new GT(this.heightOracle,this.heightMap,this.viewports),2*!e.eq(this.scaler)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(GI(e,this.scaler))})}update(e,t=null){var n,i;let r;this.state=e.state;let o=this.stateDeco;this.stateDeco=Gk(this.state);let a=e.changedRanges,s=H9.extendWithRanges(a,(n=this.stateDeco,i=e?e.changes:Vb.empty(this.state.doc.length),r=new Gx,js.compare(o,n,i,r,0),r.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Go=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||Go)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(HV)&&(this.mustEnforceCursorAssoc=!0)}measure(){var e;let t,n,{view:i}=this,r=i.contentDOM,o=window.getComputedStyle(r),a=this.heightOracle,s=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?Hm.RTL:Hm.LTR;let l=this.heightOracle.mustRefreshForWrapping(s)||"refresh"===this.mustMeasureContent,u=r.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let h=0,d=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=Ho(r,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,h|=16,l=c=!0)}let f=(parseInt(o.paddingTop)||0)*this.scaleY,p=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=p)&&(this.paddingTop=f,this.paddingBottom=p,h|=18),this.editorWidth!=i.scrollDOM.clientWidth&&(a.lineWrapping&&(c=!0),this.editorWidth=i.scrollDOM.clientWidth,h|=16);let g=Ha(this.view.contentDOM,!1).y;g!=this.scrollParent&&(this.scrollParent=g,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=Hd(this.scrollParent||i.win);let v=(this.printing?function(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}:function(e,t){let n=e.getBoundingClientRect(),i=e.ownerDocument,r=i.defaultView||window,o=Math.max(0,n.left),a=Math.min(r.innerWidth,n.right),s=Math.max(0,n.top),l=Math.min(r.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(1==t.nodeType){let n=t,i=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();o=Math.max(o,i.left),a=Math.min(a,i.right),s=Math.max(s,i.top),l=Math.min(t==e.parentNode?r.innerHeight:l,i.bottom)}t="absolute"==i.position||"fixed"==i.position?n.offsetParent:n.parentNode}else if(11==t.nodeType)t=t.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+t),bottom:Math.max(s,l)-(n.top+t)}})(r,this.paddingTop),y=v.top-this.pixelViewport.top,x=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(c=!0)),!this.inView&&!this.scrollTarget&&(t=(e=i.dom).getBoundingClientRect(),n=e.ownerDocument.defaultView||window,!(t.left<n.innerWidth)||!(t.right>0)||!(t.top<n.innerHeight)||!(t.bottom>0)))return 0;let w=u.width;if((this.contentDOMWidth!=w||this.editorHeight!=i.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=i.scrollDOM.clientHeight,h|=16),c){let e=i.docView.measureVisibleLineHeights(this.viewport);if(a.mustRefreshForHeights(e)&&(l=!0),l||a.lineWrapping&&Math.abs(w-this.contentDOMWidth)>a.charWidth){let{lineHeight:t,charWidth:n,textHeight:r}=i.docView.measureTextSize();(l=t>0&&a.refresh(s,t,n,r,Math.max(5,w/n),e))&&(i.docView.minWidth=0,h|=16)}for(let t of(y>0&&x>0?d=Math.max(y,x):y<0&&x<0&&(d=Math.min(y,x)),Go=!1,this.viewports)){let n=t.from==this.viewport.from?e:i.docView.measureVisibleLineHeights(t);this.heightMap=(l?Gc.empty().applyChanges(this.stateDeco,Vr.empty,this.heightOracle,[new H9(0,0,0,i.state.doc.length)]):this.heightMap).updateHeight(a,0,l,new Gs(t.from,n))}Go&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(2&h&&(h|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),h|=this.updateForViewport()),(2&h||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,i)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,i.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,s=new G_(i.lineAt(o-1e3*n,Gu.ByHeight,r,0,0).from,i.lineAt(a+(1-n)*1e3,Gu.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=i.lineAt(e,Gu.ByPos,r,0,0),a;a="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<s.from?o.top:o.bottom-n,s=new G_(i.lineAt(a-500,Gu.ByHeight,r,0,0).from,i.lineAt(a+n+500,Gu.ByHeight,r,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new G_(this.heightMap.lineAt(n,Gu.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Gu.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Gu.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,Gu.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(0==e||i<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||r>=a+Math.max(10,Math.min(n,250)))&&i>o-2e3&&r<a+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new Gb(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,i=n?1e4:2e3,r=i>>1,o=i<<1;if(this.defaultTextDirection!=Hm.LTR&&!n)return[];let a=[],s=(i,o,l,u)=>{if(o-i<r)return;let c=this.state.selection.main,h=[c.from];for(let e of(c.empty||h.push(c.to),h))if(e>i&&e<o){s(i,e-10,l,u),s(e+10,o,l,u);return}let d=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-i)<r&&Math.abs(e.to-o)<r&&!h.some(t=>e.from<t&&e.to>t));if(!d){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(VT.cursor(o),!1,!0).head;e>i&&(o=e)}let e=this.gapSize(l,i,o,u),r=n||e<2e6?e:2e6;d=new Gb(i,o,e,r)}a.push(d)},l=t=>{var r,a,l;let u,c,h,d,f;if(t.length<o||t.type!=jK.Text)return;let p=(r=t.from,a=t.to,l=this.stateDeco,h=[],d=r,f=0,js.spans(l,r,a,{span(){},point(e,t){e>d&&(h.push({from:d,to:e}),f+=e-d),d=t}},20),d<a&&(h.push({from:d,to:a}),f+=a-d),{total:f,ranges:h});if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,r=i/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let i=GM(p,g),o=((this.visibleBottom-this.visibleTop)/2+r)/t.height;e=i-o,n=i+o}else e=(this.visibleTop-t.top-r)/t.height,n=(this.visibleBottom-t.top+r)/t.height;u=GC(p,e),c=GC(p,n)}else{let n,r,o=p.total*this.heightOracle.charWidth,a=i*this.heightOracle.charWidth,s=0;if(o>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let l=this.pixelViewport.left+s,h=this.pixelViewport.right+s;if(null!=g){let e=GM(p,g),t=((h-l)/2+a)/o;n=e-t,r=e+t}else n=(l-a)/o,r=(h+a)/o;u=GC(p,n),c=GC(p,r)}u>t.from&&s(t.from,u,t,p),c<t.to&&s(c,t.to,t,p)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return a}gapSize(e,t,n,i){let r=GM(i,n)-GM(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){Gb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=jQ.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];js.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let i=0;if(n.length!=this.visibleRanges.length)i=12;else for(let t=0;t<n.length&&!(8&i);t++){let r=this.visibleRanges[t],o=n[t];(r.from!=o.from||r.to!=o.to)&&(i|=4,e&&e.mapPos(r.from,-1)==o.from&&e.mapPos(r.to,1)==o.to||(i|=8))}return this.visibleRanges=n,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||GI(this.heightMap.lineAt(e,Gu.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||GI(this.heightMap.lineAt(this.scaler.fromDOM(e),Gu.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return GI(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class G_{constructor(e,t){this.from=e,this.to=t}}function GC({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:r}=t[e],o=r-n;if(i<=o)return n+i;i-=o}}function GM(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}let GA={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function Gk(e){let t=e.facet(HJ).filter(e=>"function"!=typeof e),n=e.facet(H1).filter(e=>"function"!=typeof e);return n.length&&t.push(js.join(n)),t}class GT{constructor(e,t,n){let i=0,r=0,o=0;for(let a of(this.viewports=n.map(({from:n,to:r})=>{let o=t.lineAt(n,Gu.ByPos,e,0,0).top,a=t.lineAt(r,Gu.ByPos,e,0,0).bottom;return i+=a-o,{from:n,to:r,top:o,bottom:a,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i),this.viewports))a.domTop=o+(a.top-r)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),r=a.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return n+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,i=r.domBottom}}eq(e){return e instanceof GT&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function GI(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Gl(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>GI(e,t)):e._content)}let GD=VO.define({combine:e=>e.join(" ")}),GO=VO.define({combine:e=>e.indexOf(!0)>-1}),GP=jC.newName(),GR=jC.newName(),GE=jC.newName(),GL={"&light":"."+GR,"&dark":"."+GE};function GN(e,t,n){return new jC(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}let GB=GN("."+GP,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},GL),GF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Gz=j$.ie&&j$.ie_version<=11;class GV{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Hs,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(j$.ie&&j$.ie_version<=11||j$.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&j$.android&&!1!==e.constructor.EDIT_CONTEXT&&!(j$.chrome&&j$.chrome_version<126)&&(this.editContext=new GW(e),e.state.facet(HU)&&(e.contentDOM.editContext=this.editContext.editContext)),Gz&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null==(e=this.view.docView)?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){for(let t of(this.gapIntersection.disconnect(),e))this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,i=this.selectionRange;if(n.state.facet(HU)?n.root.activeElement!=this.dom:!j8(this.dom,i))return;let r=i.anchorNode&&n.docView.tile.nearest(i.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(j$.ie&&j$.ie_version<=11||j$.android&&j$.chrome)&&!n.state.selection.main.empty&&i.focusNode&&j7(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=j4(e.root);if(!t)return!1;let n=j$.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return GH(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?GH(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=j8(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,Hi(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:i=Hi(n=e)}else{if(n==e)return!0;i=He(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(11==n.nodeType)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,GF),Gz&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Gz&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Hh(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null==(n=this.delayedAndroidKey)?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(i=!0),-1==t?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&j8(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Wz(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,i=WV(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!WW(this.view.state.selection,t.newSel.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=Gj(t,e.previousSibling||e.target.previousSibling,-1),i=Gj(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(HU)!=e.state.facet(HU)&&(e.view.contentDOM.editContext=e.state.facet(HU)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let i of(this.stop(),null==(e=this.intersection)||e.disconnect(),null==(t=this.gapIntersection)||t.disconnect(),null==(n=this.resizeScroll)||n.disconnect(),this.scrollTargets))i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Gj(e,t,n){for(;t;){let i=Wt.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function GH(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,o=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return j7(a.node,a.offset,r,o)&&([n,i,r,o]=[r,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:o}}class GW{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});for(let n in this.handlers.textupdate=n=>{let i=e.state.selection.main,{anchor:r,head:o}=i,a=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let l=s-a>n.text.length;a==this.from&&r<this.from?a=r:s==this.to&&r>this.to&&(s=r);let u=WH(e.state.sliceDoc(a,s),n.text,(l?i.from:i.to)-a,l?"end":null);if(!u){let t=VT.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));WW(t,i)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+a,to:u.toA+a,insert:Vr.of(n.text.slice(u.from,u.toB).split("\n"))};if((j$.mac||j$.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:a,to:s,insert:Vr.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);Wj(e,c,VT.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from<c.to&&!c.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let i=[],r=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);r=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(i)){let r=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(r<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(i)?1:2}px`;n.push(jQ.mark({attributes:{style:e}}).range(r,o))}}}e.dispatch({effects:HG.of(jQ.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}},this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:e=>{let t=j4(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,o,a,s,l)=>{if(n)return;let u=l.length-(o-r);if(i&&o>=i.to)if(i.from==r&&i.to==o&&i.insert.eq(l)){i=this.pendingContextChange=null,t+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(r+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),l.toString()),this.to+=u}t+=u}),i&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class GG{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;for(let t of(this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new GS(this,e.state||je.create(e)),e.scrollTo&&e.scrollTo.is(HW)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(HY).map(e=>new HX(e)),this.plugins))t.update(this);this.observer=new GV(this),this.inputState=new WG(this),this.inputState.ensureHandlers(this.plugins),this.docView=new W_(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null==(t=document.fonts)?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof V5?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,i,r=this.state;for(let t of e){if(t.startState!=r)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=t.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,a=0,s=null;e.some(e=>e.annotation(Ge))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(s=Gt(r,o))||(a=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(u=null)):this.observer.clear(),r.facet(je.phrases)!=this.state.facet(je.phrases))return this.setState(r);i=H7.create(this,r,e),i.flags|=a;let c=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection,{x:n,y:i}=this.state.facet(GG.cursorScrollMargin);c=new HH(e.empty?e:VT.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",i,n)}for(let e of t.effects)e.is(HW)&&(c=e.value.clip(this.state))}this.viewState.update(i,c),this.bidiCache=Gq.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(H8)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(GD)!=i.state.facet(GD)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(HE))try{e(i)}catch(e){H$(this.state,e,"update listener")}(s||u)&&Promise.resolve().then(()=>{s&&this.state==s.startState&&this.dispatch(s),u&&!WV(this,u)&&l.force&&Hh(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);for(let t of(this.viewState=new GS(this,e),this.plugins=e.facet(HY).map(e=>new HX(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new W_(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(HY),n=e.state.facet(HY);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new HX(r));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){H$(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(Hd(n||this.win))r=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(i);r=e.from,o=e.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let s=[];4&a||([this.measureRequests,s]=[s,this.measureRequests]);let l=s.map(e=>{try{return e.read(this)}catch(e){return H$(this.state,e),GU}}),u=H7.create(this,this.state,[]),c=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,!u.empty&&(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),(c=this.docView.update(u))&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(l[e]!=GU)try{let t=s[e];t.write&&t.write(l[e],this)}catch(e){H$(this.state,e)}if(c&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let e=((r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(HE))e(t)}get themeClasses(){return GP+" "+(this.state.facet(GO)?GE:GR)+" "+this.state.facet(GD)}updateAttrs(){let e=GY(this,HK,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(HU)?"true":"false",class:"cm-content",style:`${j$.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),GY(this,HQ,t);let n=this.observer.ignore(()=>{let n=jZ(this.contentDOM,this.contentAttrs,t),i=jZ(this.dom,this.editorAttrs,e);return n||i});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(GG.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(H8);let e=this.state.facet(GG.cspNonce);jC.mount(this.root,this.styleModules.concat(GB).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if((this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e)&&!(this.measureRequests.indexOf(e)>-1)){if(null!=e.key){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return WR(this,e,WD(this,e,t,n))}moveByGroup(e,t){return WR(this,e,WD(this,e,t,t=>{var n;let i,r;return n=e.head,r=(i=this.state.charCategorizer(n))(t),e=>{let t=i(e);return r==V9.Space&&(r=t),r==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),i=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return VT.cursor(r.side(t,i)+e.from,r.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,i){let r=WI(e,t.head,t.assoc||-1),o=i&&r.type==jK.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),i=e.textDirectionAt(r.from),a=e.posAtCoords({x:n==(i==Hm.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=a)return VT.cursor(a,n?-1:1)}return VT.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return WR(this,e,function(e,t,n,i){let r=t.head,o=n?1:-1;if(r==(n?e.state.doc.length:0))return VT.cursor(r,t.assoc);let a=t.goalColumn,s,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(r,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),c=e.documentTop;if(u)null==a&&(a=u.left-l.left),s=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(r-t.from))),s=(o<0?t.top:t.bottom)+c}let h=l.left+a,d=e.viewState.heightOracle.textHeight>>1,f=null!=i?i:d;for(let t=0;;t+=d){let i=s+(f+t)*o,r=WL(e,{x:h,y:i},!1,o);if(n?i>l.bottom:i<l.top)return VT.cursor(r.pos,r.assoc);let u=e.coordsAtPos(r.pos,r.assoc),c=u?(u.top+u.bottom)/2:0;if(!u||(n?c>s:c<s))return VT.cursor(r.pos,r.assoc,void 0,a)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=WL(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),WL(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let i=this.state.doc.lineAt(e),r=this.bidiSpans(i);return Hr(n,r[HA.find(r,e-i.from,-1,t)].dir==Hm.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Hz)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>G$)return HT(e.length);let t=this.textDirectionAt(e.from),n;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t&&(i.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++){let r=t[i],o=n[i];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!e(r.inner,o.inner))return!1}return!0}(i.isolates,n=H3(this,e))))return i.order;n||(n=H3(this,e));let i=function(e,t,n){if(!e)return[new HA(0,0,+(t==Hy))];if(t==Hv&&!n.length&&!HM.test(e))return HT(e.length);if(n.length)for(;e.length>Hk.length;)Hk[Hk.length]=256;let i=[],r=+(t!=Hv);return function e(t,n,i,r,o,a,s){let l=n%2?2:1;!function(e,t,n,i,r){for(let o=0;o<=i.length;o++){let a=o?i[o-1].to:t,s=o<i.length?i[o].from:n,l=o?256:r;for(let t=a,n=l,i=l;t<s;t++){let r=HC(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),Hk[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=a,t=l,i=l;e<s;e++){let r=Hk[e];if(128==r)e<s-1&&t==Hk[e+1]&&24&t?r=Hk[e]=t:Hk[e]=256;else if(64==r){let r=e+1;for(;r<s&&64==Hk[r];)r++;let o=e&&8==t||r<n&&8==Hk[r]?1==i?1:8:256;for(let t=e;t<r;t++)Hk[t]=o;e=r-1}else 8==r&&1==i&&(Hk[e]=1);t=r,7&r&&(i=r)}}}(t,o,a,r,l),function(e,t,n,i,r){let o=1==r?2:1;for(let a=0,s=0,l=0;a<=i.length;a++){let u=a?i[a-1].to:t,c=a<i.length?i[a].from:n;for(let t=u,n,i,a;t<c;t++)if(i=HS[n=e.charCodeAt(t)])if(i<0){for(let e=s-3;e>=0;e-=3)if(H_[e+1]==-i){let n=H_[e+2],i=2&n?r:4&n?1&n?o:r:0;i&&(Hk[t]=Hk[H_[e]]=i),s=e;break}}else if(189==H_.length)break;else H_[s++]=t,H_[s++]=n,H_[s++]=l;else if(2==(a=Hk[t])||1==a){let e=a==r;l=+!e;for(let t=s-3;t>=0;t-=3){let n=H_[t+2];if(2&n)break;if(e)H_[t+2]|=2;else{if(4&n)break;H_[t+2]|=4}}}}}(t,o,a,r,l),function(e,t,n,i){for(let r=0,o=i;r<=n.length;r++){let a=r?n[r-1].to:e,s=r<n.length?n[r].from:t;for(let l=a;l<s;){let a=Hk[l];if(256==a){let a=l+1;for(;;)if(a==s){if(r==n.length)break;a=n[r++].to,s=r<n.length?n[r].from:t}else if(256==Hk[a])a++;else break;let u=1==o,c=u==((a<t?Hk[a]:i)==1)?u?1:2:i;for(let t=a,i=r,o=i?n[i-1].to:e;t>l;)t==o&&(t=n[--i].from,o=i?n[i-1].to:e),Hk[--t]=c;l=a}else o=a,l++}}}(o,a,r,l),function t(n,i,r,o,a,s,l){let u=o%2?2:1;if(o%2==a%2)for(let c=i,h=0;c<r;){let i=!0,d=!1;if(h==s.length||c<s[h].from){let e=Hk[c];e!=u&&(i=!1,d=16==e)}let f=i||1!=u?null:[],p=i?o:o+1,g=c;a:for(;;)if(h<s.length&&g==s[h].from){if(d)break;let t=s[h];if(!i)for(let e=t.to,n=h+1;;){if(e==r)break a;if(n<s.length&&s[n].from==e)e=s[n++].to;else if(Hk[e]==u)break a;else break}h++,f?f.push(t):(t.from>c&&l.push(new HA(c,t.from,p)),e(n,t.direction==Hv!=!(p%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==r||(i?Hk[g]!=u:Hk[g]==u))break;else g++;f?t(n,c,g,o+1,a,f,l):c<g&&l.push(new HA(c,g,p)),c=g}else for(let c=r,h=s.length;c>i;){let r=!0,d=!1;if(!h||c>s[h-1].to){let e=Hk[c-1];e!=u&&(r=!1,d=16==e)}let f=r||1!=u?null:[],p=r?o:o+1,g=c;a:for(;;)if(h&&g==s[h-1].to){if(d)break;let t=s[--h];if(!r)for(let e=t.from,n=h;;){if(e==i)break a;if(n&&s[n-1].to==e)e=s[--n].from;else if(Hk[e-1]==u)break a;else break}f?f.push(t):(t.to<c&&l.push(new HA(t.to,c,p)),e(n,t.direction==Hv!=!(p%2)?o+1:o,a,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==i||(r?Hk[g-1]!=u:Hk[g-1]==u))break;else g--;f?t(n,g,c,o+1,a,f,l):g<c&&l.push(new HA(g,c,p)),c=g}}(t,o,a,n,i,r,s)}(e,r,r,n,0,e.length,i),i}(e.text,t,n);return this.bidiCache.push(new Gq(e.from,e.to,t,n,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||j$.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Hu(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of(this.root.activeElement==this.contentDOM&&this.contentDOM.blur(),this.plugins))e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var n,i,r,o;return HW.of(new HH("number"==typeof e?VT.cursor(e):e,null!=(n=t.y)?n:"nearest",null!=(i=t.x)?i:"nearest",null!=(r=t.yMargin)?r:5,null!=(o=t.xMargin)?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return HW.of(new HH(VT.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return HZ.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return HZ.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=jC.newName(),i=[GD.of(n),H8.of(GN(`.${n}`,e))];return t&&t.dark&&i.push(GO.of(!0)),i}static baseTheme(e){return Vz.lowest(H8.of(GN("."+GP,e,GL)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&&Wt.get(n)||Wt.get(e);return(null==(t=null==i?void 0:i.root)?void 0:t.view)||null}}GG.styleModule=H8,GG.inputHandler=HL,GG.clipboardInputFilter=HB,GG.clipboardOutputFilter=HF,GG.scrollHandler=Hj,GG.focusChangeEffect=HN,GG.perLineTextDirection=Hz,GG.exceptionSink=HR,GG.updateListener=HE,GG.editable=HU,GG.mouseSelectionStyle=HP,GG.dragMovesSelection=HO,GG.clickAddsSelectionRange=HD,GG.decorations=HJ,GG.blockWrappers=H0,GG.outerDecorations=H1,GG.atomicRanges=H2,GG.bidiIsolatedRanges=H5,GG.cursorScrollMargin=VO.define({combine:e=>{let t=5,n=5;for(let i of e)"number"==typeof i?t=n=i:{x:t,y:n}=i;return{x:t,y:n}}}),GG.scrollMargins=H4,GG.darkTheme=GO,GG.cspNonce=VO.define({combine:e=>e.length?e[0]:""}),GG.contentAttributes=HQ,GG.editorAttributes=HK,GG.lineWrapping=GG.contentAttributes.of({class:"cm-lineWrapping"}),GG.announce=V2.define();let G$=4096,GU={};class Gq{constructor(e,t,n,i,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:Hm.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir!=i||t.touchesRange(o.from,o.to)||n.push(new Gq(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function GY(e,t,n){for(let i=e.state.facet(t),r=i.length-1;r>=0;r--){let t=i[r],o="function"==typeof t?t(e):t;o&&jU(o,n)}return n}let GZ=j$.mac?"mac":j$.windows?"win":j$.linux?"linux":"key";function GX(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}let GK=Vz.default(GG.domEventHandlers({keydown:(e,t)=>G5(G0(t.state),e,t,"editor")})),GQ=VO.define({enables:GK}),GJ=new WeakMap;function G0(e){let t=e.facet(GQ),n=GJ.get(t);return n||GJ.set(t,n=function(e,t=GZ){let n=Object.create(null),i=Object.create(null),r=(e,t)=>{let n=i[e];if(null==n)i[e]=t;else if(n!=t)throw Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,i,o,a,s)=>{var l,u;let c=n[e]||(n[e]=Object.create(null)),h=i.split(/ (?!$)/).map(e=>(function(e,t){let n,i,r,o,a=e.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(let e=0;e<a.length-1;++e){let s=a[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))"mac"==t?o=!0:i=!0;else throw Error("Unrecognized modifier name: "+s)}return n&&(s="Alt-"+s),i&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s})(e,t));for(let t=1;t<h.length;t++){let n=h.slice(0,t).join(" ");r(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=G1={view:t,prefix:n,scope:e};return setTimeout(()=>{G1==i&&(G1=null)},4e3),!0}]})}let d=h.join(" ");r(d,!1);let f=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null==(u=null==(l=c._any)?void 0:l.run)?void 0:u.slice())||[]});o&&f.run.push(o),a&&(f.preventDefault=!0),s&&(f.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=i;for(let t in e)e[t].run.push(e=>r(e,G2))}let r=i[t]||i.key;if(r)for(let t of e)o(t,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&o(t,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let G1=null,G2=null;function G5(e,t,n,i){var r;G2=t;let o=("Esc"==(r=!(jI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||jD&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?jT:jk)[t.keyCode]||t.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),a=Vm(Vp(o,0))==o.length&&" "!=o,s="",l=!1,u=!1,c=!1;G1&&G1.view==n&&G1.scope==i&&(s=G1.prefix+" ",0>WY.indexOf(t.keyCode)&&(u=!0,G1=null));let h=new Set,d=e=>{if(e){for(let t of e.run)if(!h.has(t)&&(h.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},f=e[i],p,g;return f&&(d(f[s+GX(o,t,!a)])?l=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(j$.windows&&t.ctrlKey&&t.altKey)&&!(j$.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=jk[t.keyCode])&&p!=o?d(f[s+GX(p,t,!0)])?l=!0:t.shiftKey&&(g=jT[t.keyCode])!=o&&g!=p&&d(f[s+GX(g,t,!1)])&&(l=!0):a&&t.shiftKey&&d(f[s+GX(o,t,!0)])&&(l=!0),!l&&d(f._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),G2=null,l}class G3{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(!n.empty)return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),o=e.textDirection==Hm.LTR,a=e.contentDOM,s=a.getBoundingClientRect(),l=G4(e),u=a.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=s.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=s.right-(c?parseInt(c.paddingRight):0),f=WI(e,i,1),p=WI(e,r,-1),g=f.type==jK.Text?f:null,m=p.type==jK.Text?p:null;if(g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=G6(e,i,1,g)),m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=G6(e,r,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let t=g?x(n.from,null,g):b(f,!1),i=m?x(null,n.to,m):b(p,!0),r=[];return(g||f).to<(m||p).from-(g&&m?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<i.top?r.push(v(h,t.bottom,d,i.top)):t.bottom<i.top&&e.elementAtHeight((t.bottom+i.top)/2).type==jK.Text&&(t.bottom=i.top=(t.bottom+i.top)/2),y(t).concat(r).concat(y(i))}function v(e,n,i,r){return new G3(t,e-l.left,n-l.top,Math.max(0,i-e),r-n)}function y({top:e,bottom:t,horizontal:n}){let i=[];for(let r=0;r<n.length;r+=2)i.push(v(n[r],e,n[r+1],t));return i}function x(t,n,i){let r=1e9,a=-1e9,s=[];function l(t,n,l,u,c){let f=e.coordsAtPos(t,t==i.to?-2:2),p=e.coordsAtPos(l,l==i.from?2:-2);f&&p&&(r=Math.min(f.top,p.top,r),a=Math.max(f.bottom,p.bottom,a),c==Hm.LTR?s.push(o&&n?h:f.left,o&&u?d:p.right):s.push(!o&&u?h:p.left,!o&&n?d:f.right))}let u=null!=t?t:i.from,c=null!=n?n:i.to;for(let i of e.visibleRanges)if(i.to>u&&i.from<c)for(let r=Math.max(i.from,u),o=Math.min(i.to,c);;){let i=e.state.doc.lineAt(r);for(let a of e.bidiSpans(i)){let e=a.from+i.from,s=a.to+i.from;if(e>=o)break;s>r&&l(Math.max(e,r),null==t&&e<=u,Math.min(s,o),null==n&&s>=c,a.dir)}if((r=i.to+1)>=o)break}return 0==s.length&&l(u,null==t,c,null==n,e.textDirection),{top:r,bottom:a,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=G4(e);return[new G3(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}}}function G4(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Hm.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function G6(e,t,n,i){let r=e.coordsAtPos(t,2*n);if(!r)return i;let o=e.dom.getBoundingClientRect(),a=(r.top+r.bottom)/2,s=e.posAtCoords({x:o.left+1,y:a}),l=e.posAtCoords({x:o.right-1,y:a});return null==s||null==l?i:{from:Math.max(i.from,Math.min(s,l)),to:Math.min(i.to,Math.max(s,l))}}class G8{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(G9)!=e.state.facet(G9)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(G9);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{var n;return n=this.drawn[t],!(e.constructor==n.constructor&&e.eq(n))})){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,j$.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let G9=VO.define();function G7(e){return[HZ.define(t=>new G8(t,e)),G9.of(e)]}let $e=VO.define({combine:e=>jt(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function $t(e){return e.startState.facet($e)!=e.state.facet($e)}let $n=G7({above:!0,markers(e){let{state:t}=e,n=t.facet($e),i=[];for(let r of t.selection.ranges){let o=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(o&&j$.ios&&n.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:VT.cursor(r.head,r.assoc);for(let r of G3.forRange(e,t,n))i.push(r)}}return i},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=$t(e);return n&&$i(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){$i(t.state,e)},class:"cm-cursorLayer"});function $i(e,t){t.style.animationDuration=e.facet($e).cursorBlinkRate+"ms"}let $r=G7({above:!1,markers(e){let t=[],{main:n,ranges:i}=e.state.selection;for(let n of i)if(!n.empty)for(let i of G3.forRange(e,"cm-selectionBackground",n))t.push(i);if(j$.ios&&!n.empty&&e.state.facet($e).iosSelectionHandles){for(let i of G3.forRange(e,"cm-selectionHandle cm-selectionHandle-start",VT.cursor(n.from,1)))t.push(i);for(let i of G3.forRange(e,"cm-selectionHandle cm-selectionHandle-end",VT.cursor(n.to,1)))t.push(i)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||$t(e),class:"cm-selectionLayer"}),$o=Vz.highest(GG.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),$a=V2.define({map:(e,t)=>null==e?null:t.mapPos(e)}),$s=VB.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is($a)?t.value:e,e))}),$l=HZ.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field($s);null==n?null!=this.cursor&&(null==(t=this.cursor)||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field($s)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field($s),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field($s)!=e&&this.view.dispatch({effects:$a.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function $u(e,t,n,i,r){t.lastIndex=0;for(let o=e.iterRange(n,i),a=n,s;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=t.exec(o.value);)r(a+s.index,s)}class $c{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(e,t,n,r)=>i(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,i,r)=>{let o=n(e,t,i);o&&r(i,i+e[0].length,o)};else if(n)this.addMatch=(e,t,i,r)=>r(i,i+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new jl,n=t.add.bind(t);for(let{from:t,to:i}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:o}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=o:i.push({from:r,to:o});return i}(e,this.maxLength))$u(e.state.doc,this.regexp,t,i,(t,i)=>this.addMatch(i,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return(e.docChanged&&e.changes.iterChanges((t,r,o,a)=>{a>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),i=Math.max(a,i))}),e.viewportMoved||i-n>1e3)?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let o=Math.max(r.from,n),a=Math.min(r.to,i);if(a>=o){let n=e.state.doc.lineAt(o),i=n.to<a?e.state.doc.lineAt(a):n,s=Math.max(r.from,n.from),l=Math.min(r.to,i.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){s=o;break}for(;a<i.to;a++)if(this.boundary.test(i.text[a-i.from])){l=a;break}}let u=[],c,h=(e,t,n)=>u.push(n.range(e,t));if(n==i)for(this.regexp.lastIndex=s-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,h);else $u(e.state.doc,this.regexp,s,l,(t,n)=>this.addMatch(n,e,t,h));t=t.update({filterFrom:s,filterTo:l,filter:(e,t)=>e<s||t>l,add:u})}}return t}}let $h=null!=/x/.unicode?"gu":"g",$d=RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u2028\u2029\uFEFF-]",$h),$f={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},$p=null,$g=VO.define({combine(e){let t=jt(e,{render:null,specialChars:$d,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==$p&&"u">typeof document&&document.body){let t=document.body.style;$p=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return $p||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,$h)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,$h)),t}}),$m=null;class $v extends jX{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){var t;let n=(t=this.code)>=32?"•":10==t?"":String.fromCharCode(9216+t),i=e.state.phrase("Control character")+" "+($f[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,n);if(r)return r;let o=document.createElement("span");return o.textContent=n,o.title=i,o.setAttribute("aria-label",i),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class $y extends jX{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}let $x=jQ.line({class:"cm-activeLine"}),$b=HZ.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push($x.range(r.from)),t=r.from)}return jQ.set(n)}},{decorations:e=>e.decorations});class $w extends jX{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?j9(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=Hr(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}}function $S(e,t){var n;let i,r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(r),a=r-o.from,s=a>2e3?-1:a==o.length?(n=t.clientX,(i=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((i.left-n)/e.defaultCharacterWidth)):-1):jx(o.text,e.state.tabSize,r-o.from);return{line:o.number,col:s,off:a}}let $_={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},$C={style:"cursor: crosshair"},$M="-10000px";class $A{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let r=null;this.tooltipViews=this.tooltips.map(e=>r=n(e,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(e=>e);if(i===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],a=t?[]:null;for(let n=0;n<r.length;n++){let i=r[n],s=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(s=e)}if(s<0)o[n]=this.createTooltipView(i,n?o[n-1]:null),a&&(a[n]=!!i.above);else{let i=o[n]=this.tooltipViews[s];a&&(a[n]=t[s]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null==(n=e.destroy)||n.call(e));return t&&(a.forEach((e,n)=>t[n]=e),t.length=a.length),this.input=i,this.tooltips=r,this.tooltipViews=o,!0}}function $k(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let $T=VO.define({combine:e=>{var t,n,i;return{position:j$.ios?"absolute":(null==(t=e.find(e=>e.position))?void 0:t.position)||"fixed",parent:(null==(n=e.find(e=>e.parent))?void 0:n.parent)||null,tooltipSpace:(null==(i=e.find(e=>e.tooltipSpace))?void 0:i.tooltipSpace)||$k}}}),$I=new WeakMap,$D=HZ.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet($T);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new $A(e,$E,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let e of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(e.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet($T);if(i.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=i.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=$M,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;for(let t of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))t.dom.remove(),null==(e=t.destroy)||e.call(t);this.parent&&this.container.remove(),null==(t=this.resizeObserver)||t.disconnect(),null==(n=this.intersectionObserver)||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(j$.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=H6(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet($T).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute)for(let e of(this.madeAbsolute=!0,this.position="absolute",this.manager.tooltipViews))e.dom.style.position="absolute";let{visible:n,space:i,scaleX:r,scaleY:o}=e,a=[];for(let s=0;s<this.manager.tooltips.length;s++){let l=this.manager.tooltips[s],u=this.manager.tooltipViews[s],{dom:c}=u,h=e.pos[s],d=e.size[s];if(!h||!1!==l.clip&&(h.bottom<=Math.max(n.top,i.top)||h.top>=Math.min(n.bottom,i.bottom)||h.right<Math.max(n.left,i.left)-.1||h.left>Math.min(n.right,i.right)+.1)){c.style.top=$M;continue}let f=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=7*!!f,g=d.right-d.left,m=null!=(t=$I.get(u))?t:d.bottom-d.top,v=u.offset||$R,y=this.view.textDirection==Hm.LTR,x=d.width>i.right-i.left?y?i.left:i.right-d.width:y?Math.max(i.left,Math.min(h.left-14*!!f+v.x,i.right-g)):Math.min(Math.max(i.left,h.left-g+14*!!f-v.x),i.right-g),b=this.above[s];!l.strictSide&&(b?h.top-m-p-v.y<i.top:h.bottom+m+p+v.y>i.bottom)&&b==i.bottom-h.bottom>h.top-i.top&&(b=this.above[s]=!b);let w=(b?h.top-i.top:i.bottom-h.bottom)-p;if(w<m&&!1!==u.resize){if(w<this.view.defaultLineHeight){c.style.top=$M;continue}$I.set(u,m),c.style.height=(m=w)/o+"px"}else c.style.height&&(c.style.height="");let S=b?h.top-m-p-v.y:h.bottom+p+v.y,_=x+g;if(!0!==u.overlap)for(let e of a)e.left<_&&e.right>x&&e.top<S+m&&e.bottom>S&&(S=b?e.top-m-2-p:e.bottom+p+2);if("absolute"==this.position?(c.style.top=(S-e.parent.top)/o+"px",$O(c,(x-e.parent.left)/r)):(c.style.top=S/o+"px",$O(c,x/r)),f){let e=h.left+(y?v.x:-v.x)-(x+14-7);f.style.left=e/r+"px"}!0!==u.overlap&&a.push({left:x,top:S,right:_,bottom:S+m}),c.classList.toggle("cm-tooltip-above",b),c.classList.toggle("cm-tooltip-below",!b),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView)&&(this.inView=this.view.inView,!this.inView))for(let e of this.manager.tooltipViews)e.dom.style.top=$M}},{eventObservers:{scroll(){this.maybeMeasure()}}});function $O(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let $P=GG.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),$R={x:0,y:0},$E=VO.define({enables:[$D,$P]}),$L=VO.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class $N{static create(e){return new $N(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new $A(e,$L,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null==(e=t.destroy)||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i){if(void 0===t)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}let $B=$E.compute([$L],e=>{let t=e.facet($L);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!=(t=e.end)?t:e.pos})),create:$N.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),$F=VO.define();class $z{constructor(e,t,n,i,r,o){this.view=e,this.source=t,this.field=n,this.locked=i,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let i,r=1;if(n.isWidget())i=n.posAtStart;else{if(null==(i=e.posAtCoords(t)))return;let n=e.coordsAtPos(i);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(i)).find(e=>e.from<=i&&e.to>=i),a=o&&o.dir==Hm.RTL?-1:1;r=t.x<n.left?-a:a}this.activateHover(e,i,r)}activateHover(e,t,n,i){let r=this.source(e,t,n),o=t=>{if(t&&!(Array.isArray(t)&&!t.length)){let n=Array.isArray(t)?t:[t];i&&this.locked.set(n,i),e.dispatch({effects:this.setHover.of(n)})}};if(r&&"then"in r){let n=this.pending={pos:t};r.then(e=>{this.pending==n&&(this.pending=null,o(e))},t=>H$(e.state,t,"hover tooltip"))}else o(r)}get tooltip(){let e=this.view.plugin($D),t=e?e.manager.tooltips.findIndex(e=>e.create==$N.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:r}=this;if(i.length&&!this.locked.has(i)&&r&&!function(e,t){let{left:n,right:i,top:r,bottom:o}=e.getBoundingClientRect(),a;if(a=e.querySelector(".cm-tooltip-arrow")){let e=a.getBoundingClientRect();r=Math.min(e.top,r),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=i+4&&t.clientY>=r-4&&t.clientY<=o+4}(r.dom,e)||this.pending){let{pos:r}=i[0]||this.pending,o=null!=(n=null==(t=i[0])?void 0:t.end)?n:r;(r==o?this.view.posAtCoords(this.lastMove)!=r:!function(e,t,n,i,r){let o=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,a)<r)return!1;let s=e.posAtCoords({x:i,y:r},!1);return s>=t&&s<=n}(this.view,r,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t);let{active:i}=this;!i.length||this.locked.has(i)||this.view.dom.contains(n.relatedTarget)||this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function $V(e,t){let n=e.plugin($D);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}let $j=V2.define(),$H=VO.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function $W(e,t){let n=e.plugin($G),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}let $G=HZ.fromClass(class{constructor(e){this.input=e.state.facet($q),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet($H);for(let n of(this.top=new $$(e,!0,t.topContainer),this.bottom=new $$(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top)),this.panels))n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet($H);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new $$(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new $$(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet($q);if(n!=this.input){let t=n.filter(e=>e),i=[],r=[],o=[],a=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),a.push(s)):(s=this.panels[t]).update&&s.update(e),i.push(s),(s.top?r:o).push(s)}for(let e of(this.specs=t,this.panels=i,this.top.sync(r),this.bottom.sync(o),a))e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>GG.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class $${constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&0>e.indexOf(t)&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=$U(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=$U(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function $U(e){let t=e.nextSibling;return e.remove(),t}let $q=VO.define({enables:$G}),$Y=VB.define({create:()=>[],update(e,t){for(let n of t.effects)n.is($Z)?e=[n.value].concat(e):n.is($X)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>$q.computeN([e],t=>t.field(e))}),$Z=V2.define(),$X=V2.define();class $K extends jn{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}$K.prototype.elementClass="",$K.prototype.toDOM=void 0,$K.prototype.mapMode=Vy.TrackBefore,$K.prototype.startSide=$K.prototype.endSide=-1,$K.prototype.point=!0;let $Q=VO.define(),$J=VO.define(),$0={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>js.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},$1=VO.define();function $2(e){return[$3(),$1.of({...$0,...e})]}let $5=VO.define({combine:e=>e.some(e=>e)});function $3(e){let t=[$4];return e&&!1===e.fixed&&t.push($5.of(!0)),t}let $4=HZ.fromClass(class{constructor(e){for(let t of(this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet($1).map(t=>new $7(e,t)),this.fixed=!e.state.facet($5),this.gutters))"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet($5)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=js.iter(this.view.state.facet($Q),this.view.viewport.from),i=[],r=this.gutters.map(e=>new $9(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==jK.Text&&t){for(let e of($8(n,i,o.from),r))e.line(this.view,o,i);t=!1}else if(o.widget)for(let e of r)e.widget(this.view,o)}else if(e.type==jK.Text)for(let t of($8(n,i,e.from),r))t.line(this.view,e,i);else if(e.widget)for(let t of r)t.widget(this.view,e);for(let e of r)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet($1),n=e.state.facet($1),i=e.docChanged||e.heightChanged||e.viewportChanged||!js.eq(e.startState.facet($Q),e.state.facet($Q),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new $7(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>r.indexOf(e)&&e.destroy();for(let e of r)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>GG.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Hm.LTR?{left:i,right:r}:{right:i,left:r}})});function $6(e){return Array.isArray(e)?e:[e]}function $8(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class $9{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=js.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let t=new Ue(e,o,r,n);i.elements.push(t),i.dom.appendChild(t.dom)}else i.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];$8(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let o=this.gutter;(0!=i.length||o.config.renderEmptyElements)&&this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),i=n?[n]:null;for(let n of e.state.facet($J)){let r=n(e,t.widget,t);r&&(i||(i=[])).push(r)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class $7{constructor(e,t){for(let n in this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),t.domEventHandlers)this.dom.addEventListener(n,i=>{let r=i.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let e=r.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,i)&&i.preventDefault()});this.markers=$6(t.markers(e)),t.initialSpacer&&(this.spacer=new Ue(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=$6(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!js.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Ue{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,i)&&this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,o=0;;){let a=o,s=r<t.length?t[r++]:null,l=!1;if(s){let e=s.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(s)){a=e,l=!0;break}}else a=this.markers.length;for(;o<a;){let e=this.markers[o++];if(e.toDOM){e.destroy(i);let t=i.nextSibling;i.remove(),i=t}}if(!s)break;s.toDOM&&(l?i=i.nextSibling:this.dom.insertBefore(s.toDOM(e),i)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let Ut=VO.define(),Un=VO.define(),Ui=VO.define({combine:e=>jt(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let i=n[e],r=t[e];n[e]=i?(e,t,n)=>i(e,t,n)||r(e,t,n):r}return n}})});class Ur extends $K{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Uo(e,t){return e.state.facet(Ui).formatNumber(t,e.state)}let Ua=$1.compute([Ui],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Ut),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new Ur(Uo(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let i of e.state.facet(Un)){let r=i(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Ui)!=e.state.facet(Ui),initialSpacer:e=>new Ur(Uo(e,Us(e.state.doc.lines))),updateSpacer(e,t){let n=Uo(t.view,Us(t.view.state.doc.lines));return n==e.number?e:new Ur(n)},domEventHandlers:e.facet(Ui).domEventHandlers,side:"before"}));function Us(e){let t=9;for(;t<e;)t=10*t+9;return t}let Ul=new class extends $K{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Uu=$Q.compute(["selection"],e=>{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(Ul.range(r)))}return js.of(t)}),Uc=new FU,Uh=new FU;class Ud{constructor(e,t,n=[],i=""){this.data=e,this.name=i,je.prototype.hasOwnProperty("tree")||Object.defineProperty(je.prototype,"tree",{get(){return Ug(this)}}),this.parser=t,this.extension=[UC.of(this),je.languageData.of((e,t,n)=>{let i=Uf(e,t,n),r=i.type.prop(Uc);if(!r)return[];let o=e.facet(r),a=i.type.prop(Uh);if(a){let r=i.resolve(t-i.from,n);for(let t of a)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return Uf(e,t,n).type.prop(Uc)==this.data}findRegions(e){let t=e.facet(UC);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(Uc)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(FU.mounted);if(r){if(r.tree.prop(Uc)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(r.overlay){let e=n.length;if(i(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let r=e.children[n];r instanceof FJ&&i(r,e.positions[n]+t)}};return i(Ug(e),0),n}get allowsNesting(){return!0}}function Uf(e,t,n){let i=e.facet(UC),r=Ug(e).topNode;if(!i||i.allowsNesting)for(let e=r;e;e=e.enter(t,n,ev.ExcludeBuffers|ev.EnterBracketed))e.type.isTop&&(r=e);return r}Ud.setState=V2.define();class Up extends Ud{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,VO.define({combine:t?e=>e.concat(t):void 0}));return new Up(n,e.parser.configure({props:[Uc.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new Up(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ug(e){let t=e.field(Ud.state,!1);return t?t.tree:FJ.empty}class Um{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Uv=null;class Uy{constructor(e,t,n=[],i,r,o,a,s){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=o,this.skipped=a,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Uy(e,t,[],FJ.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Um(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=FJ.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(zs.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!=(n=this.parse.stoppedAt)?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(zs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Uv;Uv=this;try{return e()}finally{Uv=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Ux(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:r,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=zs.applyChanges(n,t),i=FJ.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(a=[],this.skipped)){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&a.push({from:n,to:i})}}return new Uy(this.parser,t,n,i,r,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=Ux(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends zl{createParse(t,n,i){let r=i[0].from,o=i[i.length-1].to;return{parsedPos:r,advance(){let t=Uv;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new FJ(FZ.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Uv}}function Ux(e,t,n){return zs.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class Ub{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Ub(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Uy.create(e.facet(UC).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Ub(n)}}Ud.state=VB.define({create:Ub.init,update(e,t){for(let e of t.effects)if(e.is(Ud.setState))return e.value;return t.startState.facet(UC)!=t.state.facet(UC)?Ub.init(t.state):e.apply(t)}});let Uw=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"u">typeof requestIdleCallback&&(Uw=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let US="u">typeof navigator&&(null==(ey=navigator.scheduling)?void 0:ey.isInputPending)?()=>navigator.scheduling.isInputPending():null,U_=HZ.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ud.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ud.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=Uw(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(Ud.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!US?Math.max(25,e.timeRemaining()-5):1e9),a=r.context.treeLen<i&&n.doc.length>i+1e3,s=r.context.work(()=>US&&US()||Date.now()>o,i+1e5*!a);this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Ud.setState.of(new Ub(r.context))})),this.chunkBudget>0&&!(s&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>H$(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),UC=VO.define({combine:e=>e.length?e[0]:null,enables:e=>[Ud.state,U_,GG.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class UM{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let UA=VO.define(),Uk=VO.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function UT(e){let t=e.facet(Uk);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function UI(e,t){let n="",i=e.tabSize,r=e.facet(Uk)[0];if(" "==r){for(;t>=i;)n+=" ",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function UD(e,t){for(let n of(e instanceof je&&(e=new UO(e)),e.state.facet(UA))){let i=n(e,t);if(void 0!==i)return i}let n=Ug(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t&&!(t.from<i.node.from||t.to>i.node.to||t.from==i.node.from&&t.type==i.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return UR(i,e,n)}(e,n,t):null}class UO{constructor(e,t={}){this.state=e,this.options=t,this.unit=UT(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;if(null!=i&&i>=n.from&&i<=n.to)if(r&&i==e)return{text:"",from:e};else if(t<0?i<e:i<=e)return{text:n.text.slice(i-n.from),from:i};else return{text:n.text.slice(0,i-n.from),from:n.from};return n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return jx(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let UP=new FU;function UR(e,t,n){for(let i=e;i;i=i.next){let e=function(e){let t=e.type.prop(UP);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(FU.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>(function(e,t,n,i){let r=e.textAfter,o=r.match(/^\s*/)[0].length,a=n&&r.slice(o,o+n.length)==n||i==e.pos+o,s=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.from>=a)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=r.to}}(e):null;return s?a?e.column(s.from):e.column(s.to):e.baseIndent+(a?0:+e.unit)})(e,!0,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?UE:null}(i.node);if(e)return e(UL.create(t,n,i))}return 0}function UE(){return 0}class UL extends UO{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new UL(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return UR(this.context.next,this.base,this.pos)}}function UN({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}let UB=VO.define(),UF=new FU;function Uz(e,t,n){for(let i of e.facet(UB)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=Ug(e);if(i.length<n)return null;let r=i.resolveStack(n,1),o=null;for(let a=r;a;a=a.next){let r=a.node;if(r.to<=n||r.from>n)continue;if(o&&r.from<t)break;let s=r.type.prop(UF);if(s&&(r.to<i.length-50||i.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(r))){let i=s(r,e);i&&i.from<=n&&i.from>=t&&i.to>n&&(o=i)}}return o}(e,t,n)}function UV(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}let Uj=V2.define({map:UV}),UH=V2.define({map:UV});function UW(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let UG=VB.define({create:()=>jQ.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=U$(e,t,n)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(Uj)&&!function(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}(e,i.value.from,i.value.to)?n.push(i.value):i.is(UH)&&(e=e.update({filter:(e,t)=>i.value.from!=e||i.value.to!=t,filterFrom:i.value.from,filterTo:i.value.to}));if(n.length){let{preparePlaceholder:i}=t.state.facet(UK),r=n.map(e=>(i?jQ.replace({widget:new U1(i(t.state,e))}):U0).range(e.from,e.to));e=e.update({add:r})}return t.selection&&(e=U$(e,t.selection.main.head)),e},provide:e=>GG.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let i=e[n++],r=e[n++];if("number"!=typeof i||"number"!=typeof r)throw RangeError("Invalid JSON for fold state");t.push(U0.range(i,r))}return jQ.set(t,!0)}});function U$(e,t,n=t){let i=!1;return e.between(t,n,(e,r)=>{e<n&&r>t&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(e,i)=>e>=n||i<=t}):e}function UU(e,t,n){var i;let r=null;return null==(i=e.field(UG,!1))||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function Uq(e,t){return e.field(UG,!1)?t:t.concat(V2.appendConfig.of(UQ()))}function UY(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return GG.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let UZ=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of UW(e)){let n=Uz(e.state,t.from,t.to);if(n)return e.dispatch({effects:Uq(e.state,[Uj.of(n),UY(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(UG,!1))return!1;let t=[];for(let n of UW(e)){let i=UU(e.state,n.from,n.to);i&&t.push(UH.of(i),UY(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let i=0;i<t.doc.length;){let r=e.lineBlockAt(i),o=Uz(t,r.from,r.to);o&&n.push(Uj.of(o)),i=(o?e.lineBlockAt(o.to):r).to+1}return n.length&&e.dispatch({effects:Uq(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(UG,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(UH.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],UX={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},UK=VO.define({combine:e=>jt(e,UX)});function UQ(e){let t=[UG,U3];return e&&t.push(UK.of(e)),t}function UJ(e,t){let{state:n}=e,i=n.facet(UK),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=UU(e.state,n.from,n.to);i&&e.dispatch({effects:UH.of(i)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}let U0=jQ.replace({widget:new class extends jX{toDOM(e){return UJ(e,null)}}});class U1 extends jX{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return UJ(e,this.value)}}let U2={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class U5 extends $K{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}let U3=GG.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class U4{constructor(e,t){let n;function i(e){let t=jC.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Ud?e=>e.prop(Uc)==o.data:o?e=>e==o:void 0,this.style=zz(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new jC(n):null,this.themeType=t.themeType}static define(e,t){return new U4(e,t||{})}}let U6=VO.define(),U8=VO.define({combine:e=>e.length?[e[0]]:null});function U9(e){let t=e.facet(U6);return t.length?t:e.facet(U8)}function U7(e,t){let n=[qe],i;return e instanceof U4&&(e.module&&n.push(GG.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(U8.of(e)):i?n.push(U6.computeN([GG.darkTheme],t=>t.facet(GG.darkTheme)==("dark"==i)?[e]:[])):n.push(U6.of(e)),n}let qe=Vz.high(HZ.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=Ug(e.state),this.decorations=this.buildDeco(e,U9(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Ug(e.state),n=U9(e.state),i=n!=U9(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return jQ.none;let n=new jl;for(let{from:i,to:r}of e.visibleRanges)!function(e,t,n,i=0,r=e.length){let o=new zV(i,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),i,r,"",o.highlighters),o.flush(r)}(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=jQ.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),qt=U4.define([{tag:z2.meta,color:"#404740"},{tag:z2.link,textDecoration:"underline"},{tag:z2.heading,textDecoration:"underline",fontWeight:"bold"},{tag:z2.emphasis,fontStyle:"italic"},{tag:z2.strong,fontWeight:"bold"},{tag:z2.strikethrough,textDecoration:"line-through"},{tag:z2.keyword,color:"#708"},{tag:[z2.atom,z2.bool,z2.url,z2.contentSeparator,z2.labelName],color:"#219"},{tag:[z2.literal,z2.inserted],color:"#164"},{tag:[z2.string,z2.deleted],color:"#a11"},{tag:[z2.regexp,z2.escape,z2.special(z2.string)],color:"#e40"},{tag:z2.definition(z2.variableName),color:"#00f"},{tag:z2.local(z2.variableName),color:"#30a"},{tag:[z2.typeName,z2.namespace],color:"#085"},{tag:z2.className,color:"#167"},{tag:[z2.special(z2.variableName),z2.macroName],color:"#256"},{tag:z2.definition(z2.propertyName),color:"#00c"},{tag:z2.comment,color:"#940"},{tag:z2.invalid,color:"#f00"}]),qn=GG.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),qi="()[]{}",qr=VO.define({combine:e=>jt(e,{afterCursor:!0,brackets:qi,maxScanDistance:1e4,renderMatch:qs})}),qo=jQ.mark({class:"cm-matchingBracket"}),qa=jQ.mark({class:"cm-nonmatchingBracket"});function qs(e){let t=[],n=e.matched?qo:qa;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function ql(e){let t=[],n=e.facet(qr);for(let i of e.selection.ranges){if(!i.empty)continue;let r=qf(e,i.head,-1,n)||i.head>0&&qf(e,i.head-1,1,n)||n.afterCursor&&(qf(e,i.head,1,n)||i.head<e.doc.length&&qf(e,i.head+1,-1,n));r&&(t=t.concat(n.renderMatch(r,e)))}return jQ.set(t,!0)}let qu=[HZ.fromClass(class{constructor(e){this.paused=!1,this.decorations=ql(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=ql(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),qn],qc=new FU;function qh(e,t,n){let i=e.prop(t<0?FU.openedBy:FU.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==+(t<0))return[n[i+t]]}return null}function qd(e){let t=e.type.prop(qc);return t?t(e.node):e}function qf(e,t,n,i={}){let r=i.maxScanDistance||1e4,o=i.brackets||qi,a=Ug(e),s=a.resolveInner(t,n);for(let e=s;e;e=e.parent){let i=qh(e.type,n,o);if(i&&e.from<e.to){let r=qd(e);if(r&&(n>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return function(e,t,n,i,r){let o=t.parent,a={from:n.from,to:n.to},s=0,l=null==o?void 0:o.cursor();if(l&&(e<0?l.childBefore(t.from):l.childAfter(t.to)))do if(e<0?l.to<=t.from:l.from>=t.to){if(0==s&&i.indexOf(l.type.name)>-1&&l.from<l.to){let e=qd(l);return{start:a,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(qh(l.type,e,r))s++;else if(qh(l.type,-e,r)){if(0==s){let e=qd(l);return{start:a,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}s--}}while(e<0?l.prevSibling():l.nextSibling());return{start:a,matched:!1}}(n,e,r,i,o)}}return function(e,t,n,i,r,o,a){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=a.indexOf(s);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),h=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let s=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=a.indexOf(o[e]);if(!(t<0)&&i.resolveInner(s+e,1).type==r)if(t%2==0==n>0)h++;else{if(1==h)return{start:u,end:{from:s+e,to:s+e+1},matched:t>>1==l>>1};h--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,a,s.type,r,o)}let qp=Object.create(null),qg=[FZ.none],qm=[],qv=Object.create(null),qy=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])qy[e]=function(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||z2[n];i?"function"==typeof i?t.length?t=t.map(i):qx(n,`Modifier ${n} used at start of tag`):t.length?qx(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:qx(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),r=i+" "+n.map(e=>e.id),o=qv[r];if(o)return o.id;let a=qv[r]=FZ.define({id:qg.length,name:i,props:[zN({[i]:n})]});return qg.push(a),a.id}(qp,t);function qx(e,t){qm.indexOf(e)>-1||(qm.push(e),console.warn(t))}Hm.RTL,Hm.LTR;let qb=Up.define({name:"json",parser:z3.configure({props:[UP.add({Object:UN({except:/^\s*\}/}),Array:UN({except:/^\s*\]/})}),UF.add({"Object Array":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});class qw{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class qS{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=n.facet(qL).markerFilter;i&&(e=i(e,n));let r=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new jl,a=[],s=0,l=n.doc.iter(),u=0,c=n.doc.length;for(let e=0;;){let t,n,i=e==r.length?null:r[e];if(!i&&!a.length)break;if(a.length)t=s,n=a.reduce((e,t)=>Math.min(e,t.to),i&&i.from>t?i.from:1e8);else{if((t=i.from)>c)break;n=i.to,a.push(i),e++}for(;e<r.length;){let i=r[e];if(i.from==t&&(i.to>i.from||i.to==t))a.push(i),e++,n=Math.min(i.to,n);else{n=Math.min(i.from,n);break}}n=Math.min(n,c);let h=!1;if(a.some(e=>e.from==t&&(e.to==n||n==c))&&!(h=t==n)&&n-t<10){let e=t-(u+l.value.length);e>0&&(l.next(e),u=t);for(let e=t;;){if(e>=n){h=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let d=q$(a);if(h)o.add(t,t,jQ.widget({widget:new qz(d),diagnostics:a.slice()}));else{let e=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,jQ.mark({class:"cm-lintRange cm-lintRange-"+d+e,diagnostics:a.slice(),inclusiveEnd:a.some(e=>e.to>n)}))}if((s=n)==c)break;for(let e=0;e<a.length;e++)a[e].to<=s&&a.splice(e--,1)}let h=o.finish();return new qS(h,t,q_(h))}}function q_(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!(t&&0>r.diagnostics.indexOf(t)))if(i){if(0>r.diagnostics.indexOf(i.diagnostic))return!1;i=new qw(i.from,n,i.diagnostic)}else i=new qw(e,n,t||r.diagnostics[0])}),i}function qC(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(qL).hideOn(e,n,i);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(qA))||e.changes.touchesRange(o.from,Math.max(o.to,i)))}function qM(e,t){return e.field(qI,!1)?t:t.concat(V2.appendConfig.of(qJ))}let qA=V2.define(),qk=V2.define(),qT=V2.define(),qI=VB.define({create:()=>new qS(jQ.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=q_(n,e.selected.diagnostic,r)||q_(n,null,r)}!n.size&&r&&t.state.facet(qL).autoPanel&&(r=null),e=new qS(n,r,i)}for(let n of t.effects)if(n.is(qA)){let i=t.state.facet(qL).autoPanel?n.value.length?qj.open:null:e.panel;e=qS.init(n.value,i,t.state)}else n.is(qk)?e=new qS(e.diagnostics,n.value?qj.open:null,e.selected):n.is(qT)&&(e=new qS(e.diagnostics,e.panel,n.value));return e},provide:e=>[$q.from(e,e=>e.panel),GG.decorations.from(e,e=>e.diagnostics)]}),qD=jQ.mark({class:"cm-lintRange cm-lintRange-active"});function qO(e,t){return jR("ul",{class:"cm-tooltip-lint"},t.map(t=>qF(e,t,!1)))}let qP=e=>{let t=e.state.field(qI,!1);return!!t&&!!t.panel&&(e.dispatch({effects:qk.of(!1)}),!0)},qR=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(qI,!1);t&&t.panel||e.dispatch({effects:qM(e.state,[qk.of(!0)])});let n=$W(e,qj.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(qI,!1);if(!t)return!1;let n=e.state.selection.main,i=q_(t.diagnostics,null,n.to+1);return(!!i||!!(i=q_(t.diagnostics,null,0))&&(i.from!=n.from||i.to!=n.to))&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!function(e,t,n={}){var i;let r=e.state.facet($F).map(t=>e.plugin(t)).filter(e=>!!e);if(n.tooltip&&n.tooltip.active){let e=r.find(e=>e.field==n.tooltip.active);e&&(r=[e])}for(let o of r)o.activateHover(e,t,1,null!=(i=n.until)?i:()=>!1)}(e,i.from,{tooltip:qQ,until:e=>e.docChanged||e.newSelection.main.head<i.from||e.newSelection.main.head>i.to}),!0)}}],qE=HZ.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(qL);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(qL);t.length&&function(e,t,n){let i=[],r=-1;for(let o of e)o.then(n=>{i.push(n),clearTimeout(r),i.length==e.length?t(i):r=setTimeout(()=>t(i),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{var n,i;this.view.state.doc==e.doc&&this.view.dispatch((n=this.view.state,i=t.reduce((e,t)=>e.concat(t)),{effects:qM(n,[qA.of(i)])}))},e=>{H$(this.view.state,e)})}}update(e){let t=e.state.facet(qL);(e.docChanged||t!=e.startState.facet(qL)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),qL=VO.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...jt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:qN,tooltipFilter:qN,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,i,r)=>e(n,i,r)||t(n,i,r):e:t,autoPanel:(e,t)=>e||t})})});function qN(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function qB(e){let t=[];if(e)s:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue s}}t.push("")}return t}function qF(e,t,n){var i;let r=n?qB(t.actions):[];return jR("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},jR("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(i=t.actions)?void 0:i.map((n,i)=>{let o=!1,a=i=>{if(i.preventDefault(),o)return;o=!0;let r=q_(e.state.field(qI).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:s}=n,l=r[i]?s.indexOf(r[i]):-1,u=l<0?s:[s.slice(0,l),jR("u",s.slice(l,l+1)),s.slice(l+1)];return jR("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:a,onmousedown:a,"aria-label":` Action: ${s}${l<0?"":` (access key "${r[i]})"`}.`},u)}),t.source&&jR("div",{class:"cm-diagnosticSource"},t.source))}class qz extends jX{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return jR("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class qV{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=qF(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class qj{constructor(e){this.view=e,this.items=[];let t=t=>{if(!t.ctrlKey&&!t.altKey&&!t.metaKey){if(27==t.keyCode)qP(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],i=qB(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=q_(this.view.state.field(qI).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=jR("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=jR("div",{class:"cm-panel-lint"},this.list,jR("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>qP(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(qI).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(qI),n=0,i=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:s})=>{for(let e of s.diagnostics){if(o.has(e))continue;o.add(e);let a=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){a=t;break}a<0?(s=new qV(this.view,e),this.items.splice(n,0,s),i=!0):(s=this.items[a],a>n&&(this.items.splice(n,a-n),i=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute("aria-selected")||(s.dom.setAttribute("aria-selected","true"),r=s):s.dom.hasAttribute("aria-selected")&&s.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new qV(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=q_(this.view.state.field(qI).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:qT.of(t)})}static open(e){return new qj(e)}}function qH(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function qW(e){return qH(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let qG=GG.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qW("#f11")},".cm-lintRange-warning":{backgroundImage:qW("orange")},".cm-lintRange-info":{backgroundImage:qW("#999")},".cm-lintRange-hint":{backgroundImage:qW("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function q$(e){let t="hint",n=1;for(let r of e){var i;let e="error"==(i=r.severity)?4:"warning"==i?3:"info"==i?2:1;e>n&&(n=e,t=r.severity)}return t}class qU extends $K{constructor(e){super(),this.diagnostics=e,this.severity=q$(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,i=e.state.facet(q0).tooltipFilter;return i&&(n=i(n,e.state)),n.length&&(t.onmouseover=()=>(function(e,t,n){function i(){let i,r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:qZ.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:qO(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,i=n=>{let r=t.getBoundingClientRect();if(!(n.clientX>r.left-10)||!(n.clientX<r.right+10)||!(n.clientY>r.top-10)||!(n.clientY<r.bottom+10)){for(let e=n.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",i),e.state.field(qX)&&e.dispatch({effects:qZ.of(null)})}},window.addEventListener("mousemove",i)}let{hoverTime:r}=e.state.facet(q0),o=setTimeout(i,r);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(i,r)}})(e,t,n)),t}}let qq=$2({class:"cm-gutter-lint",markers:e=>e.state.field(qY),widgetMarker:(e,t,n)=>{let i=[];return e.state.field(qY).between(n.from,n.to,(e,t,r)=>{e>n.from&&e<n.to&&i.push(...r.diagnostics)}),i.length?new qU(i):null}}),qY=VB.define({create:()=>js.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(q0).markerFilter;for(let i of t.effects)if(i.is(qA)){let r=i.value;n&&(r=n(r||[],t.state)),e=function(e,t){let n=Object.create(null);for(let i of t){let t=e.lineAt(i.from);(n[t.from]||(n[t.from]=[])).push(i)}let i=[];for(let e in n)i.push(new qU(n[e]).range(+e));return js.of(i,!0)}(t.state.doc,r.slice(0))}return e}}),qZ=V2.define(),qX=VB.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=qC(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(qZ)?t.value:e,e)),provide:e=>$E.from(e)}),qK=GG.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:qH('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:qH('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:qH('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),qQ=function(e,t={}){let n=V2.define(),i=new WeakMap,r=VB.define({create:()=>[],update(e,o){let a=i.get(e);if(e.length&&(t.hideOnChange&&(o.docChanged||o.selection)||a&&a(o)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(o,e)))),o.docChanged&&e.length){let t=[];for(let n of e){let e=o.changes.mapPos(n.pos,-1,Vy.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=o.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of o.effects)t.is(n)&&(e=t.value,a=void 0),(t.is($j)&&!t.value||t.value==r)&&(e=[]);return e.length&&a&&i.set(e,a),e},provide:e=>$L.from(e)}),o=HZ.define(o=>new $z(o,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,o,$F.of(o),$B]}}(function(e,t,n){let{diagnostics:i}=e.state.field(qI),r,o=-1,a=-1;i.between(t-(n<0),t+ +(n>0),(e,i,{spec:s})=>{if(t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t<i||n<0)))return r=s.diagnostics,o=e,a=i,!1});let s=e.state.facet(qL).tooltipFilter;return(r&&s&&(r=s(r,e.state)),r)?{pos:o,end:a,above:!0,create:()=>({dom:qO(e,r)})}:null},{hideOn:qC}),qJ=[qI,GG.decorations.compute([qI],e=>{let{selected:t,panel:n}=e.field(qI);return t&&n&&t.from!=t.to?jQ.set([qD.range(t.from,t.to)]):jQ.none}),qQ,qG],q0=VO.define({combine:e=>jt(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var q1=n(49257);function q2(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}let q5=q2(function(e,t,n=t.selection.ranges){let i=[],r=-1;l:for(let{from:e,to:o}of n){let n=i.length,a=1e9,s;for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(void 0==s&&!(s=q6(t,l.from).line))continue l;if(l.from>r&&(e==o||o>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+s.length)==s?e:-1;e<l.text.length&&e<a&&(a=e),i.push({line:l,comment:n,token:s,indent:e,empty:t,single:!1})}n=l.to+1}if(a<1e9)for(let e=n;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=a);i.length==n+1&&(i[n].single=!0)}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:o,single:a}of i)(a||!o)&&e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,o=i+r.length;" "==t.text[o-t.from]&&o++,e.push({from:i,to:o})}return{changes:e}}return null},0),q3=q2(q8,0),q4=q2((e,t)=>q8(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>i.from?t[o].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function q6(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function q8(e,t,n=t.selection.ranges){let i=n.map(e=>q6(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>(function(e,{open:t,close:n},i,r){let o,a,s=e.sliceDoc(i-50,i),l=e.sliceDoc(r,r+50),u=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(l)[0].length,h=s.length-u;if(s.slice(h-t.length,h)==t&&l.slice(c,c+n.length)==n)return{open:{pos:i-u,margin:u&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?o=a=e.sliceDoc(i,r):(o=e.sliceDoc(i,i+50),a=e.sliceDoc(r-50,r));let d=/^\s*/.exec(o)[0].length,f=/\s*$/.exec(a)[0].length,p=a.length-f-n.length;return o.slice(d,d+t.length)==t&&a.slice(p,p+n.length)==n?{open:{pos:i+d+t.length,margin:+!!/\s/.test(o.charAt(d+t.length))},close:{pos:r-f-n.length,margin:+!!/\s/.test(a.charAt(p-1))}}:null})(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t=0,n;t<r.length;t++)if(n=r[t]){let r=i[t],{open:o,close:a}=n;e.push({from:o.pos-r.open.length,to:o.pos+o.margin},{from:a.pos-a.margin,to:a.pos+r.close.length})}return{changes:e}}return null}let q9=VJ.define(),q7=VJ.define(),Ye=VO.define(),Yt=VO.define({combine:e=>jt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),Yn=VB.define({create:()=>Yg.empty,update(e,t){let n=t.state.facet(Yt),i=t.annotation(q9);if(i){let r=Yl.fromTransaction(t,i.selection),o=i.side,a=0==o?e.undone:e.done;return a=r?Yu(a,a.length,n.minDepth,r):Yd(a,t.startState.selection),new Yg(0==o?i.rest:a,0==o?a:i.rest)}let r=t.annotation(q7);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(V5.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=Yl.fromTransaction(t),a=t.annotation(V5.time),s=t.annotation(V5.userEvent);return o?e=e.addChanges(o,a,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,s,n.newGroupDelay)),("full"==r||"after"==r)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new Yg(e.done.map(Yl.fromJSON),e.undone.map(Yl.fromJSON))});function Yi(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(Yn,!1);if(!r)return!1;let o=r.pop(e,n,t);return!!o&&(i(o),!0)}}let Yr=Yi(0,!1),Yo=Yi(1,!1),Ya=Yi(0,!0),Ys=Yi(1,!0);class Yl{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new Yl(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new Yl(e.changes&&Vb.fromJSON(e.changes),[],e.mapped&&Vx.fromJSON(e.mapped),e.startSelection&&VT.fromJSON(e.startSelection),e.selectionsAfter.map(VT.fromJSON))}static fromTransaction(e,t){let n=Yh;for(let t of e.startState.facet(Ye)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new Yl(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Yh)}static selection(e){return new Yl(void 0,Yh,void 0,void 0,e)}}function Yu(e,t,n,i){let r=e.slice(t+1>n+20?t-n-1:0,t);return r.push(i),r}function Yc(e,t){return e.length?t.length?e.concat(t):e:t}let Yh=[];function Yd(e,t){if(!e.length)return[Yl.selection([t])];{let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),Yu(e,e.length-1,1e9,n.setSelAfter(i)))}}function Yf(e,t){if(!e.length)return e;let n=e.length,i=Yh;for(;n;){let r=function(e,t,n){let i=Yc(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Yh,n);if(!e.changes)return Yl.selection(i);let r=e.changes.map(t),o=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(o):o;return new Yl(r,V2.mapEffects(e.effects,t),a,e.startSelection.map(o),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[Yl.selection(i)]:Yh}let Yp=/^(input\.type|delete)($|\.)/;class Yg{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new Yg(this.done,this.undone):this}addChanges(e,t,n,i,r){var o,a;let s,l,u=this.done,c=u[u.length-1];return new Yg(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||Yp.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,(o=c.changes,a=e.changes,s=[],l=!1,o.iterChangedRanges((e,t)=>s.push(e,t)),a.iterChangedRanges((e,t,n,i)=>{for(let e=0;e<s.length;){let t=s[e++],r=s[e++];i>=t&&n<=r&&(l=!0)}}),l))||"input.type.compose"==n)?Yu(u,u.length-1,i.minDepth,new Yl(e.changes.compose(c.changes),Yc(V2.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,Yh)):Yu(u,u.length,i.minDepth,e),Yh,t,n)}addSelection(e,t,n,i){var r;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Yh;return o.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(r=o[o.length-1],r.ranges.length==e.ranges.length&&0===r.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new Yg(Yd(this.done,e),this.undone,t,n)}addMapping(e){return new Yg(Yf(this.done,e),Yf(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):t.selection);if(n&&r.selectionsAfter.length){let n,a;return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:q9.of({side:e,rest:(n=i[i.length-1],(a=i.slice())[i.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),a),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!r.changes)return null;let n=1==i.length?Yh:i.slice(0,i.length-1);return r.mapped&&(n=Yf(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:q9.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}Yg.empty=new Yg(Yh,Yh);let Ym=[{key:"Mod-z",run:Yr,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Yo,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Yo,preventDefault:!0},{key:"Mod-u",run:Ya,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Ys,preventDefault:!0}];function Yv(e,t){return VT.create(e.ranges.map(t),e.mainIndex)}function Yy(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Yx({state:e,dispatch:t},n){let i=Yv(e.selection,n);return!i.eq(e.selection,!0)&&(t(Yy(e,i)),!0)}function Yb(e,t){return VT.cursor(t?e.to:e.from)}function Yw(e,t){return Yx(e,n=>n.empty?e.moveByChar(n,t):Yb(n,t))}function YS(e){return e.textDirectionAt(e.state.selection.main.head)==Hm.LTR}let Y_=e=>Yw(e,!YS(e)),YC=e=>Yw(e,YS(e));function YM(e,t){return Yx(e,n=>n.empty?e.moveByGroup(n,t):Yb(n,t))}function YA(e,t,n){let i,r,o=Ug(e).resolveInner(t.head),a=n?FU.closedBy:FU.openedBy;for(let i=t.head;;){let t=n?o.childAfter(i):o.childBefore(i);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,a)?i=n?t.to:t.from:o=t}return r=o.type.prop(a)&&(i=n?qf(e,o.from,1):qf(e,o.to,-1))&&i.matched?n?i.end.to:i.end.from:n?o.to:o.from,VT.cursor(r,n?-1:1)}function Yk(e,t){return Yx(e,n=>{if(!n.empty)return Yb(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let YT=e=>Yk(e,!1),YI=e=>Yk(e,!0);function YD(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,i=0,r;if(t){for(let t of e.state.facet(GG.scrollMargins)){let r=t(e);(null==r?void 0:r.top)&&(n=Math.max(null==r?void 0:r.top,n)),(null==r?void 0:r.bottom)&&(i=Math.max(null==r?void 0:r.bottom,i))}r=e.scrollDOM.clientHeight-n-i}else r=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,r-5)}}function YO(e,t){let n,i=YD(e),{state:r}=e,o=Yv(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):Yb(n,t));if(o.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),s=a.top+i.marginTop,l=a.bottom-i.marginBottom;t&&t.top>s&&t.bottom<l&&(n=GG.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-s}))}return e.dispatch(Yy(r,o),{effects:n}),!0}let YP=e=>YO(e,!1),YR=e=>YO(e,!0);function YE(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=VT.cursor(i.from+n))}return r}function YL(e,t,n){let i=Yv(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=VT.range(e.head,e.anchor));let i=n(e);return VT.range(e.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return!i.eq(e.state.selection)&&(e.dispatch(Yy(e.state,i)),!0)}function YN(e,t){return YL(e,t,n=>e.moveByChar(n,t))}let YB=e=>YN(e,!YS(e)),YF=e=>YN(e,YS(e));function Yz(e,t){return YL(e,t,n=>e.moveByGroup(n,t))}function YV(e,t){return YL(e,t,n=>e.moveVertically(n,t))}let Yj=e=>YV(e,!1),YH=e=>YV(e,!0);function YW(e,t){return YL(e,t,n=>e.moveVertically(n,t,YD(e).height))}let YG=e=>YW(e,!1),Y$=e=>YW(e,!0),YU=({state:e,dispatch:t})=>(t(Yy(e,{anchor:0})),!0),Yq=({state:e,dispatch:t})=>(t(Yy(e,{anchor:e.doc.length})),!0),YY=({state:e,dispatch:t})=>(t(Yy(e,{anchor:e.selection.main.anchor,head:0})),!0),YZ=({state:e,dispatch:t})=>(t(Yy(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function YX(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let o=n.doc.lineAt(i.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=i;;){let i=e.moveVertically(n,t);if(i.head<o.from||i.head>o.to){r.some(e=>e.head==i.head)||r.push(i);break}if(i.head==n.head)break;n=i}}return r.length!=i.ranges.length&&(e.dispatch(Yy(n,VT.create(r,r.length-1))),!0)}function YK(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:o}=i;if(r==o){let a=t(i);a<r?(n="delete.backward",a=YQ(e,a,!1)):a>r&&(n="delete.forward",a=YQ(e,a,!0)),r=Math.min(r,a),o=Math.max(o,a)}else r=YQ(e,r,!1),o=YQ(e,o,!0);return r==o?{range:i}:{changes:{from:r,to:o},range:VT.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?GG.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function YQ(e,t,n){if(e instanceof GG)for(let i of e.state.facet(GG.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}let YJ=(e,t,n)=>YK(e,i=>{let r=i.from,{state:o}=e,a=o.doc.lineAt(r),s,l;if(n&&!t&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(s=a.text.slice(0,r-a.from))){if(" "==s[s.length-1])return r-1;let e=jx(s,o.tabSize)%UT(o)||UT(o);for(let t=0;t<e&&" "==s[s.length-1-t];t++)r--;l=r}else(l=Vf(a.text,r-a.from,t,t)+a.from)==r&&a.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(l-a.from,r-a.from))&&(l=Vf(a.text,l-a.from,!1,!1)+a.from);return l}),Y0=e=>YJ(e,!1,!0),Y1=e=>YJ(e,!0,!1),Y2=(e,t)=>YK(e,n=>{let i=n.head,{state:r}=e,o=r.doc.lineAt(i),a=r.charCategorizer(i);for(let e=null;;){if(i==(t?o.to:o.from)){i==n.head&&o.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let s=Vf(o.text,i-o.from,t)+o.from,l=o.text.slice(Math.min(i,s)-o.from,Math.max(i,s)-o.from),u=a(l);if(null!=e&&u!=e)break;(" "!=l||i!=n.head)&&(e=u),i=s}return i}),Y5=e=>Y2(e,!1);function Y3(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),o=e.doc.lineAt(i.to);if(i.empty||i.to!=o.from||(o=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(i)}else t.push({from:r.from,to:o.to,ranges:[i]});n=o.number+1}return t}function Y4(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of Y3(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),a=o.length+1;if(n)for(let n of(i.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))r.push(VT.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)));else for(let n of(i.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))r.push(VT.range(n.anchor-a,n.head-a))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:VT.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Y6(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of Y3(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let Y8=Y7(!1),Y9=Y7(!0);function Y7(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,o=t.doc.lineAt(i),a=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Ug(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),o;return i&&r&&i.to<=t&&r.from>=t&&(o=i.type.prop(FU.closedBy))&&o.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}(t,i);e&&(i=r=(r<=o.to?o:t.doc.lineAt(r)).to);let s=new UO(t,{simulateBreak:i,simulateDoubleBreak:!!a}),l=UD(s,i);for(null==l&&(l=jx(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<o.to&&/\s/.test(o.text[r-o.from]);)r++;a?{from:i,to:r}=a:i>o.from&&i<o.from+100&&!/\S/.test(o.text.slice(0,i))&&(i=o.from);let u=["",UI(t,l)];return a&&u.push(UI(t,s.lineIndent(o.from,-1))),{changes:{from:i,to:r,insert:Vr.of(u)},range:VT.cursor(i+1+u[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ze(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let a=e.doc.lineAt(o);a.number>n&&(i.empty||i.to>a.from)&&(t(a,r,i),n=a.number),o=a.to+1}let o=e.changes(r);return{changes:r,range:VT.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}let Zt=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ze(e,(t,n)=>{n.push({from:t.from,insert:e.facet(Uk)})}),{userEvent:"input.indent"})),!0),Zn=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ze(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=jx(i,e.tabSize),o=0,a=UI(e,Math.max(0,r-UT(e)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),Zi=[{key:"Ctrl-b",run:Y_,shift:YB,preventDefault:!0},{key:"Ctrl-f",run:YC,shift:YF},{key:"Ctrl-p",run:YT,shift:Yj},{key:"Ctrl-n",run:YI,shift:YH},{key:"Ctrl-a",run:e=>Yx(e,t=>VT.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>YL(e,!1,t=>VT.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>Yx(e,t=>VT.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>YL(e,!0,t=>VT.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:Y1},{key:"Ctrl-h",run:Y0},{key:"Ctrl-k",run:e=>YK(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:Y5},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Vr.of(["",""])},range:VT.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:Vf(i.text,n-i.from,!1)+i.from,o=n==i.to?n+1:Vf(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(r,n))},range:VT.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:YR}],Zr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>Yx(e,t=>YA(e.state,t,!YS(e))),shift:e=>{let t=!YS(e);return YL(e,t,n=>YA(e.state,n,t))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Yx(e,t=>YA(e.state,t,YS(e))),shift:e=>{let t=YS(e);return YL(e,t,n=>YA(e.state,n,t))}},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Y4(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Y6(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Y4(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Y6(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>YX(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>YX(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=VT.create([n.main]):n.main.empty||(i=VT.create([VT.cursor(n.main.head)])),!!i&&(t(Yy(e,i)),!0)}},{key:"Mod-Enter",run:Y9},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Y3(e).map(({from:t,to:n})=>VT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:VT.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=Yv(e.selection,t=>{let n=Ug(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return VT.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(Yy(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:Zn},{key:"Mod-]",run:Zt},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new UO(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Ze(e,(t,r,o)=>{let a=UD(i,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let s=/^\s*/.exec(t.text)[0],l=UI(e,a);(s!=l||o.from<t.from+s.length)&&(n[t.from]=a,r.push({from:t.from,to:t.from+s.length,insert:l}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Y3(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=Yv(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,i;return n=!1,i=Yv(e.selection,t=>{let i=qf(e,t.head,-1)||qf(e,t.head,1)||t.head>0&&qf(e,t.head-1,1)||t.head<e.doc.length&&qf(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let r=i.start.from==t.head?i.end.to:i.end.from;return VT.cursor(r)}),!!n&&(t(Yy(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=q6(e.state,n.from);return i.line?q5(e):!!i.block&&q4(e)}},{key:"Alt-A",run:q3},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:Y_,shift:YB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>YM(e,!YS(e)),shift:e=>Yz(e,!YS(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>Yx(e,t=>YE(e,t,!YS(e))),shift:e=>{let t=!YS(e);return YL(e,t,n=>YE(e,n,t))},preventDefault:!0},{key:"ArrowRight",run:YC,shift:YF,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>YM(e,YS(e)),shift:e=>Yz(e,YS(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>Yx(e,t=>YE(e,t,YS(e))),shift:e=>{let t=YS(e);return YL(e,t,n=>YE(e,n,t))},preventDefault:!0},{key:"ArrowUp",run:YT,shift:Yj,preventDefault:!0},{mac:"Cmd-ArrowUp",run:YU,shift:YY},{mac:"Ctrl-ArrowUp",run:YP,shift:YG},{key:"ArrowDown",run:YI,shift:YH,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Yq,shift:YZ},{mac:"Ctrl-ArrowDown",run:YR,shift:Y$},{key:"PageUp",run:YP,shift:YG},{key:"PageDown",run:YR,shift:Y$},{key:"Home",run:e=>Yx(e,t=>YE(e,t,!1)),shift:e=>YL(e,!1,t=>YE(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:YU,shift:YY},{key:"End",run:e=>Yx(e,t=>YE(e,t,!0)),shift:e=>YL(e,!0,t=>YE(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:Yq,shift:YZ},{key:"Enter",run:Y8,shift:Y8},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Y0,shift:Y0,preventDefault:!0},{key:"Delete",run:Y1,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Y5,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Y2(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>YK(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>YK(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(Zi.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),Zo={key:"Tab",run:Zt,shift:Zn},Za="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class Zs{constructor(e,t,n=0,i=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(Za(e)):Za,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return Vp(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Vg(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Vm(e);let i=this.normalize(t);if(i.length)for(let e=0,r=n,o=!0;;e++){let n=i.charCodeAt(e),a=this.match(n,r,o,this.bufferPos+this.bufferStart,e==i.length-1);if(a)return this.value=a,this;if(e==i.length-1)break;o&&e<t.length&&t.charCodeAt(e)==n?r++:o=!1}}}match(e,t,n,i,r){let o=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],a=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?o={from:n.from,to:i,precise:r&&n.precise}:(n.index++,a=!0)),a?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(1==this.query.length?o={from:t,to:i,precise:n&&r}:this.matches.push({from:t,index:1,precise:n})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}"u">typeof Symbol&&(Zs.prototype[Symbol.iterator]=function(){return this});let Zl={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Zu="gm"+(null==/x/.unicode?"":"u");class Zc{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Zl,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Zf(e,t,n,i,r);this.re=new RegExp(t,Zu+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Zp(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=Zp(this.text,i+ +(n==i)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let Zh=new WeakMap;class Zd{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=Zh.get(e);if(!i||i.from>=n||i.to<=t){let i=new Zd(t,e.sliceString(t,n));return Zh.set(e,i),i}if(i.from==t&&i.to==n)return i;let{text:r,from:o}=i;return o>t&&(r=e.sliceString(t,o)+r,o=t),i.to<n&&(r+=e.sliceString(i.to,n)),Zh.set(e,new Zd(o,r)),new Zd(t,r.slice(t-o,n-o))}}class Zf{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=Zl,this.matchPos=Zp(e,i),this.re=new RegExp(t,Zu+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Zd.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=Zp(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Zd.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Zp(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t<n.to&&(i=n.text.charCodeAt(t-n.from))>=56320&&i<57344;)t++;return t}"u">typeof Symbol&&(Zc.prototype[Symbol.iterator]=Zf.prototype[Symbol.iterator]=function(){return this});let Zg={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Zm=VO.define({combine:e=>jt(e,Zg,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Zv=jQ.mark({class:"cm-selectionMatch"}),Zy=jQ.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Zx(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=V9.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=V9.Word)}let Zb=HZ.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Zm),{state:n}=e,i=n.selection;if(i.ranges.length>1)return jQ.none;let r=i.main,o,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return jQ.none;let e=n.wordAt(r.head);if(!e)return jQ.none;a=n.charCategorizer(r.head),o=n.sliceDoc(e.from,e.to)}else{let e=r.to-r.from;if(e<t.minSelectionLength||e>200)return jQ.none;if(t.wholeWords){var s,l,u;if(o=n.sliceDoc(r.from,r.to),!(Zx(a=n.charCategorizer(r.head),n,r.from,r.to)&&(s=a,l=r.from,u=r.to,s(n.sliceDoc(l,l+1))==V9.Word&&s(n.sliceDoc(u-1,u))==V9.Word)))return jQ.none}else if(!(o=n.sliceDoc(r.from,r.to)))return jQ.none}let c=[];for(let i of e.visibleRanges){let e=new Zs(n.doc,o,i.from,i.to);for(;!e.next().done;){let{from:i,to:o}=e.value;if((!a||Zx(a,n,i,o))&&(r.empty&&i<=r.from&&o>=r.to?c.push(Zy.range(i,o)):(i>=r.to||o<=r.from)&&c.push(Zv.range(i,o)),c.length>t.maxMatches))return jQ.none}}return jQ.set(c)}},{decorations:e=>e.decorations}),Zw=GG.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ZS=VO.define({combine:e=>jt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ZK(e),scrollToMatch:e=>GG.scrollIntoView(e)})});class Z_{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Zu),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new ZD(this):new ZA(this)}getCursor(e,t=0,n){let i=e.doc?e:je.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?Zk(this,i,t,n):ZM(this,i,t,n)}}class ZC{constructor(e){this.spec=e}}function ZM(e,t,n,i){var r,o,a,s;let l;return e.wholeWord&&(a=t.doc,s=t.charCategorizer(t.selection.main.head),l=(e,t,n,i)=>((i>e||i+n.length<t)&&(i=Math.max(0,e-2),n=a.sliceString(i,Math.min(a.length,t+2))),(s(ZT(n,e-i))!=V9.Word||s(ZI(n,e-i))!=V9.Word)&&(s(ZI(n,t-i))!=V9.Word||s(ZT(n,t-i))!=V9.Word))),e.test&&(r=e.test,o=l,l=(e,n,i,a)=>(!o||!!o(e,n,i,a))&&r(e>=a&&n<=a+i.length?i.slice(e-a,n-a):t.doc.sliceString(e,n),t,e,n)),new Zs(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),l)}class ZA extends ZC{constructor(e){super(e)}nextMatch(e,t,n){let i=ZM(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);i=ZM(this.spec,e,0,n).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==n?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let n=Math.max(t,i-1e4-this.spec.unquoted.length),r=ZM(this.spec,e,n,i),o=null;for(;!r.nextOverlapping().done;)o=r.value;if(o)return o;if(n==t)return null;i-=1e4}}prevMatch(e,t,n){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=n)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=ZM(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=ZM(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}function Zk(e,t,n,i){var r,o,a;let s;return e.wholeWord&&(a=t.charCategorizer(t.selection.main.head),s=(e,t,n)=>!n[0].length||(a(ZT(n.input,n.index))!=V9.Word||a(ZI(n.input,n.index))!=V9.Word)&&(a(ZI(n.input,n.index+n[0].length))!=V9.Word||a(ZT(n.input,n.index+n[0].length))!=V9.Word)),e.test&&(r=e.test,o=s,s=(e,n,i)=>(!o||o(e,n,i))&&r(i[0],t,e,n)),new Zc(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,i)}function ZT(e,t){return e.slice(Vf(e,t,!1),t)}function ZI(e,t){return e.slice(t,Vf(e,t))}class ZD extends ZC{nextMatch(e,t,n){let i=Zk(this.spec,e,n,e.doc.length).next();return i.done&&(i=Zk(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),o=Zk(this.spec,e,r,n),a=null;for(;!o.next().done;)a=o.value;if(a&&(r==t||a.from>r+10))return a;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let i=+n.slice(0,t);if(i>0&&i<e.match.length)return e.match[i]+n.slice(t)}return t})}matchAll(e,t){let n=Zk(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=Zk(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}let ZO=V2.define(),ZP=V2.define(),ZR=VB.define({create:e=>new ZE(Z$(e).create(),null),update(e,t){for(let n of t.effects)n.is(ZO)?e=new ZE(n.value.create(),e.panel):n.is(ZP)&&(e=new ZE(e.query,n.value?ZG:null));return e},provide:e=>$q.from(e,e=>e.panel)});class ZE{constructor(e,t){this.query=e,this.panel=t}}let ZL=jQ.mark({class:"cm-searchMatch"}),ZN=jQ.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ZB=HZ.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ZR))}update(e){let t=e.state.field(ZR);(t!=e.startState.field(ZR)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return jQ.none;let{view:n}=this,i=new jl;for(let t=0,r=n.visibleRanges,o=r.length;t<o;t++){let{from:a,to:s}=r[t];for(;t<o-1&&s>r[t+1].from-500;)s=r[++t].to;e.highlight(n.state,a,s,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?ZN:ZL)})}return i.finish()}},{decorations:e=>e.decorations});function ZF(e){return t=>{let n=t.state.field(ZR,!1);return n&&n.query.spec.valid?e(t,n):ZY(t)}}let Zz=ZF((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=VT.single(i.from,i.to),o=e.state.facet(ZS);return e.dispatch({selection:r,effects:[Z0(e,i),o.scrollToMatch(r.main,e)],userEvent:"select.search"}),Zq(e),!0}),ZV=ZF((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let o=VT.single(r.from,r.to),a=e.state.facet(ZS);return e.dispatch({selection:o,effects:[Z0(e,r),a.scrollToMatch(o.main,e)],userEvent:"select.search"}),Zq(e),!0}),Zj=ZF((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:VT.create(n.map(e=>VT.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),ZH=ZF((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,i,i);if(!o)return!1;let a=o,s=[],l,u,c=[];a.precise?a.from==i&&a.to==r&&(u=n.toText(t.getReplacement(a)),s.push({from:a.from,to:a.to,insert:u}),a=t.nextMatch(n,a.from,a.to),c.push(GG.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):a=t.nextMatch(n,a.from,a.to);let h=e.state.changes(s);return a&&(l=VT.single(a.from,a.to).map(h),c.push(Z0(e,a)),c.push(n.facet(ZS).scrollToMatch(l.main,e))),e.dispatch({changes:h,selection:l,effects:c,userEvent:"input.replace"}),!0}),ZW=ZF((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:e,to:r,precise:o}=i;o&&n.push({from:e,to:r,insert:t.getReplacement(i)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:GG.announce.of(i),userEvent:"input.replace.all"}),!0});function ZG(e){return e.state.facet(ZS).createPanel(e)}function Z$(e,t){var n,i,r,o,a;let s=e.selection.main,l=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!l)return t;let u=e.facet(ZS);return new Z_({search:(null!=(n=null==t?void 0:t.literal)?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!=(i=null==t?void 0:t.caseSensitive)?i:u.caseSensitive,literal:null!=(r=null==t?void 0:t.literal)?r:u.literal,regexp:null!=(o=null==t?void 0:t.regexp)?o:u.regexp,wholeWord:null!=(a=null==t?void 0:t.wholeWord)?a:u.wholeWord})}function ZU(e){let t=$W(e,ZG);return t&&t.dom.querySelector("[main-field]")}function Zq(e){let t=ZU(e);t&&t==e.root.activeElement&&t.select()}let ZY=e=>{let t=e.state.field(ZR,!1);if(t&&t.panel){let n=ZU(e);if(n&&n!=e.root.activeElement){let i=Z$(e.state,t.query.spec);i.valid&&e.dispatch({effects:ZO.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[ZP.of(!0),t?ZO.of(Z$(e.state,t.query.spec)):V2.appendConfig.of(Z2)]});return!0},ZZ=e=>{let t=e.state.field(ZR,!1);if(!t||!t.panel)return!1;let n=$W(e,ZG);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:ZP.of(!1)}),!0},ZX=[{key:"Mod-f",run:ZY,scope:"editor search-panel"},{key:"F3",run:Zz,shift:ZV,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Zz,shift:ZV,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ZZ,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,o=[],a=0;for(let t=new Zs(e.doc,e.sliceDoc(i,r));!t.next().done;){if(o.length>1e3)return!1;t.value.from==i&&(a=o.length),o.push(VT.range(t.value.from,t.value.to))}return t(e.update({selection:VT.create(o,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{var t;let n,i,r,o,{state:a}=e,s=String(a.doc.lineAt(e.state.selection.main.head).number),{close:l,result:u}=(t={label:a.phrase("Go to line"),input:{type:"text",name:"line",value:s},focus:!0,submitLabel:a.phrase("go")},i=new Promise(e=>n=e),r=e=>(function(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=jR("form"),t.input){let e=jR("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),i.appendChild(jR("label",(t.label||"")+": ",e))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(jR("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r="FORM"==i.nodeName?[i]:i.querySelectorAll("form");for(let e=0;e<r.length;e++){let t=r[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),a(null)):13==e.keyCode&&(e.preventDefault(),a(t))}),t.addEventListener("submit",e=>{e.preventDefault(),a(t)})}let o=jR("div",i,jR("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["\xd7"]));function a(t){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(t)}return t.class&&(o.className=t.class),o.classList.add("cm-dialog"),{dom:o,top:t.top,mount:()=>{if(t.focus){let e;(e="string"==typeof t.focus?i.querySelector(t.focus):i.querySelector("input")||i.querySelector("button"))&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}})(e,t,n),e.state.field($Y,!1)?e.dispatch({effects:$Z.of(r)}):e.dispatch({effects:V2.appendConfig.of($Y.init(()=>[r]))}),{close:o=$X.of(r),result:i.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field($Y).indexOf(r)>-1&&e.dispatch({effects:o})}),t))});return u.then(t=>{let n=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!n)return void e.dispatch({effects:l});let i=a.doc.lineAt(a.selection.main.head),[,r,o,s,u]=n,c=s?+s.slice(1):0,h=o?+o:i.number;if(o&&u){let e=h/100;r&&(e=e*("-"==r?-1:1)+i.number/a.doc.lines),h=Math.round(a.doc.lines*e)}else o&&r&&(h=h*("-"==r?-1:1)+i.number);let d=a.doc.line(Math.max(1,Math.min(a.doc.lines,h))),f=VT.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[l,GG.scrollIntoView(f.from,{y:"center"})],selection:f})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,i=VT.create(n.ranges.map(t=>e.wordAt(t.head)||VT.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)})({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),o=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new Zs(e.doc,t,i[i.length-1].to);;)if(r.next(),r.done){if(n)return null;r=new Zs(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),n=!0}else{if(n&&i.some(e=>e.from==r.value.from))continue;if(o){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(VT.range(r.from,r.to),!1),effects:GG.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class ZK{constructor(e){this.view=e;let t=this.query=e.state.field(ZR).query.spec;function n(e,t,n){return jR("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=jR("input",{value:t.search,placeholder:ZQ(e,"Find"),"aria-label":ZQ(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=jR("input",{value:t.replace,placeholder:ZQ(e,"Replace"),"aria-label":ZQ(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=jR("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=jR("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=jR("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=jR("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Zz(e),[ZQ(e,"next")]),n("prev",()=>ZV(e),[ZQ(e,"previous")]),n("select",()=>Zj(e),[ZQ(e,"all")]),jR("label",null,[this.caseField,ZQ(e,"match case")]),jR("label",null,[this.reField,ZQ(e,"regexp")]),jR("label",null,[this.wordField,ZQ(e,"by word")]),...e.state.readOnly?[]:[jR("br"),this.replaceField,n("replace",()=>ZH(e),[ZQ(e,"replace")]),n("replaceAll",()=>ZW(e),[ZQ(e,"replace all")])],jR("button",{name:"close",onclick:()=>ZZ(e),"aria-label":ZQ(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new Z_({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ZO.of(e)}))}keydown(e){var t;(t=this.view,G5(G0(t.state),e,t,"search-panel"))?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ZV:Zz)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),ZH(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(ZO)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ZS).top}}function ZQ(e,t){return e.state.phrase(t)}let ZJ=/[\s\.,:;?!]/;function Z0(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,o=Math.max(i.from,t-30),a=Math.min(r,n+30),s=e.state.sliceDoc(o,a);if(o!=i.from){for(let e=0;e<30;e++)if(!ZJ.test(s[e+1])&&ZJ.test(s[e])){s=s.slice(e);break}}if(a!=r){for(let e=s.length-1;e>s.length-30;e--)if(!ZJ.test(s[e-1])&&ZJ.test(s[e])){s=s.slice(0,e);break}}return GG.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${i.number}.`)}let Z1=GG.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Z2=[ZR,Vz.low(ZB),Z1];class Z5{constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=Ug(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(Z8(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function Z3(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class Z4{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function Z6(e){return e.selection.main.from}function Z8(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],o="$"!=i[i.length-1];return r||o?RegExp(`${r?"^":""}(?:${i})${o?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let Z9=VJ.define(),Z7=new WeakMap;function Xe(e){if(!Array.isArray(e))return e;let t=Z7.get(e);return t||Z7.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=Z3(t)+Z3(n)+"*$";return[RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}(e)),t}let Xt=V2.define(),Xn=V2.define();class Xi{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Vp(e,t),i=Vm(n);this.chars.push(n);let r=e.slice(t,t+i),o=r.toUpperCase();this.folded.push(Vp(o==r?r.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:o}=this;if(1==t.length){let i=Vp(e,0),r=Vm(i),o=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;o+=-200}return this.ret(o,[0,r])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,l=0;if(a<0){for(let r=0,o=Math.min(e.length,200);r<o&&l<s;){let o=Vp(e,r);(o==t[l]||o==n[l])&&(i[l++]=r),r+=Vm(o)}if(l<s)return null}let u=0,c=0,h=!1,d=0,f=-1,p=-1,g=/[a-z]/.test(e),m=!0;for(let i=0,l=Math.min(e.length,200),v=0;i<l&&c<s;){let l=Vp(e,i);a<0&&(u<s&&l==t[u]&&(r[u++]=i),d<s&&(l==t[d]||l==n[d]?(0==d&&(f=i),p=i+1,d++):d=0));let y,x=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(y=Vg(l))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!i||1==x&&g||0==v&&0!=x)&&(t[c]==l||n[c]==l&&(h=!0)?o[c++]=i:o.length&&(m=!1)),v=x,i+=Vm(l)}return c==s&&0==o[0]&&m?this.result(-100+(h?-200:0),o,e):d==s&&0==f?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):d==s?this.ret(-900-e.length,[f,p]):c==s?this.result(-100+(h?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?Vm(Vp(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}}class Xr{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}let Xo=VO.define({combine:e=>jt(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Xs,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Xa(e(n),t(n)),optionClass:(e,t)=>n=>Xa(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function Xa(e,t){return e?t?e+" "+t:e:t}function Xs(e,t,n,i,r,o){let a=e.textDirection==Hm.RTL,s=a,l=!1,u="top",c,h,d=t.left-r.left,f=r.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(s&&d<Math.min(p,f)?s=!1:!s&&f<Math.min(p,d)&&(s=!0),p<=(s?d:f))c=Math.max(r.top,Math.min(n.top,r.bottom-g))-t.top,h=Math.min(400,s?d:f);else{l=!0,h=Math.min(400,(a?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=g||e>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${h/v}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":s?"left":"right")}}let Xl=V2.define();function Xu(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.ceil((e-t)/n);return{from:e-i*n,to:e-(i-1)*n}}class Xc{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:o}=i.open,a=e.state.facet(Xo);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let o=e.displayLabel||e.label,a=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>a&&r.appendChild(document.createTextNode(o.slice(a,t)));let s=r.appendChild(document.createElement("span"));s.appendChild(document.createTextNode(o.slice(t,n))),s.className="cm-completionMatchedText",a=n}return a<o.length&&r.appendChild(document.createTextNode(o.slice(a))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Xu(r.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t=n.target,r;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(r=/-(\d+)$/.exec(t.id))&&+r[1]<i.length){this.applyCompletion(e,i[+r[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:Xl.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(Xo).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Xn.of(null)})}),this.showOptions(r,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:o,disabled:a}=n.open;i.open&&i.open.options==r||(this.range=Xu(r.length,o,e.state.facet(Xo).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),a!=(null==(t=i.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Xu(t.options.length,t.selected,this.view.state.facet(Xo).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(i);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,i)}).catch(e=>H$(this.view.state,e,"completion info")):(this.addInfoPane(o,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let i,r,o,a=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),a=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return a&&(t=this.list,n=a,i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),o=i.height/t.offsetHeight,r.top<i.top?t.scrollTop-=(i.top-r.top)/o:r.bottom>i.bottom&&(t.scrollTop+=(r.bottom-i.bottom)/o)),a}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(Xo).positionInfo(this.view,t,i,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",e=>{e.target==i&&e.preventDefault()});let r=null;for(let o=n.from;o<n.to;o++){let{completion:a,match:s}=e[o],{section:l}=a;if(l){let e="string"==typeof l?l:l.name;e!=r&&(o>n.from||0==n.from)&&(r=e,"string"!=typeof l&&l.header?i.appendChild(l.header(l)):i.appendChild(document.createElement("completion-section")).textContent=e)}let u=i.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let c=this.optionClass(a);for(let e of(c&&(u.className=c),this.optionContent)){let t=e(a,this.view.state,this.view,s);t&&u.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Xh(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class Xd{constructor(e,t,n,i,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Xd(this.options,Xm(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r,o){if(i&&!o&&e.some(e=>e.isPending))return i.setDisabled();let a=function(e,t){let n=[],i=null,r=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},a=t.facet(Xo);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)o(new Z4(t,i.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(i.from,i.to),s,l=a.filterStrict?new Xr(n):new Xi(n);for(let t of i.result.options)if(s=l.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,a=s.score+(t.boost||0);if(o(new Z4(t,i.source,n,a)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;r||(r=Object.create(null)),r[e]=Math.max(a,r[e]||-1e9)}}}}if(i){let e=Object.create(null),t=0;for(let n of i.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?r[t.name]-r[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let s=[],l=null,u=a.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||u(e.completion,t.completion))){let t=e.completion;l&&l.label==t.label&&l.detail==t.detail&&(null==l.type||null==t.type||l.type==t.type)&&l.apply==t.apply&&l.boost==t.boost?Xh(e.completion)>Xh(l)&&(s[s.length-1]=e):s.push(e),l=e.completion}return s}(e,t);if(!a.length)return i&&e.some(e=>e.isPending)?i.setDisabled():null;let s=t.facet(Xo).selectOnOpen?0:-1;if(i&&i.selected!=s&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<a.length;t++)if(a[t].completion==e){s=t;break}}return new Xd(a,Xm(n,s),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:XC,above:r.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new Xd(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Xd(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Xf{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new Xf(Xv,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(Xo),i=(n.override||t.languageDataAt("autocomplete",Z6(t)).map(Xe)).map(t=>(this.active.find(e=>e.source==t)||new Xx(t,+!!this.active.some(e=>0!=e.state))).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open,o=e.effects.some(e=>e.is(Xw));for(let a of(r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let r=n==e.length,o=i==t.length;if(r||o)return r==o;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)||o?r=Xd.build(i,t,this.id,r,n,o):r&&r.disabled&&!i.some(e=>e.isPending)&&(r=null),!r&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new Xx(e.source,0):e)),e.effects))a.is(Xl)&&(r=r&&r.setSelected(a.value,this.id));return i==this.active&&r==this.open?this:new Xf(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Xp:Xg}}let Xp={"aria-autocomplete":"list"},Xg={};function Xm(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let Xv=[];function Xy(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(Z9);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}class Xx{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=Xy(e,t),i=this;for(let t of((8&n||16&n&&this.touches(e))&&(i=new Xx(i.source,0)),4&n&&0==i.state&&(i=new Xx(this.source,1)),i=i.updateFor(e,n),e.effects))if(t.is(Xt))i=new Xx(i.source,1,t.value);else if(t.is(Xn))i=new Xx(i.source,0);else if(t.is(Xw))for(let e of t.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Z6(e.state))}}class Xb extends Xx{constructor(e,t,n,i,r,o){super(e,3,t),this.limit=n,this.result=i,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Z6(e.state);if(a>o||!i||2&t&&(Z6(e.startState)==this.from||a<this.limit))return new Xx(this.source,4&t?1:0);let s=e.changes.mapPos(this.limit);return!function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):Z8(e,!0).test(r)}(i.validFor,e.state,r,o)?i.update&&(i=i.update(i,r,o,new Z5(e.state,a,!1)))?new Xb(this.source,this.explicit,s,i,i.from,null!=(n=i.to)?n:Z6(e.state)):new Xx(this.source,1,this.explicit):new Xb(this.source,this.explicit,s,i,r,o)}map(e){if(e.empty)return this;let t=this.result.map?this.result.map(this.result,e):this.result;return t?new Xb(this.source,this.explicit,e.mapPos(this.limit),t,e.mapPos(this.from),e.mapPos(this.to,1)):new Xx(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let Xw=V2.define({map:(e,t)=>e.map(e=>e.map(t))}),XS=VB.define({create:()=>Xf.start(),update:(e,t)=>e.update(t),provide:e=>[$E.from(e,e=>e.tooltip),GG.contentAttributes.from(e,e=>e.attrs)]});function X_(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(XS).active.find(e=>e.source==t.source);return i instanceof Xb&&("string"==typeof n?e.dispatch({...function(e,t,n,i){let{main:r}=e.selection,o=n-r.from,a=i-r.from;return{...e.changeByRange(s=>{if(s!=r&&n!=i&&e.sliceDoc(s.from+o,s.from+a)!=e.sliceDoc(n,i))return{range:s};let l=e.toText(t);return{changes:{from:s.from+o,to:i==r.from?s.to:s.from+a,insert:l},range:VT.cursor(s.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,i.from,i.to),annotations:Z9.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}let XC=e=>new Xc(e,XS,X_);function XM(e,t="option"){return n=>{let i=n.state.field(XS,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(Xo).interactionDelay)return!1;let r=1,o;"page"==t&&(o=$V(n,i.open.tooltip))&&(r=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=i.open.options,s=i.open.selected>-1?i.open.selected+r*(e?1:-1):e?0:a-1;return s<0?s="page"==t?0:a-1:s>=a&&(s="page"==t?a-1:0),n.dispatch({effects:Xl.of(s)}),!0}}let XA=e=>!!e.state.field(XS,!1)&&(e.dispatch({effects:Xt.of(!0)}),!0);class Xk{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let XT=HZ.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(XS).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(XS),n=e.state.facet(Xo);if(!e.selectionSet&&!e.docChanged&&e.startState.field(XS)==t)return;let i=e.transactions.some(e=>{let t=Xy(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){H$(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(Xt)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(XS);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Xo).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Z6(t),i=new Z5(t,n,e.explicit,this.view),r=new Xk(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:Xn.of(null)}),H$(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Xo).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Xo),i=this.view.state.field(XS);for(let r=0;r<this.running.length;r++){let o=this.running[r];if(void 0===o.done)continue;if(this.running.splice(r--,1),o.done){let i=Z6(o.updates.length?o.updates[0].startState:this.view.state),r=Math.min(i,o.done.from+ +!o.active.explicit),a=new Xb(o.active.source,o.active.explicit,r,o.done,o.done.from,null!=(e=o.done.to)?e:i);for(let e of o.updates)a=a.update(e,n);if(a.hasResult()){t.push(a);continue}}let a=i.active.find(e=>e.source==o.active.source);if(a&&a.isPending)if(null==o.done){let e=new Xx(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(a)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Xw.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(XS,!1);if(t&&t.tooltip&&this.view.state.facet(Xo).closeOnBlur){let n=t.open&&$V(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:Xn.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:Xt.of(!1)}),20),this.composing=0}}}),XI="object"==typeof navigator&&/Win/.test(navigator.platform),XD=Vz.highest(GG.domEventHandlers({keydown(e,t){let n=t.state.field(XS,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(XI&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),o=i.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&X_(t,i),!1}})),XO=GG.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),XP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},XR=V2.define({map(e,t){let n=t.mapPos(e,-1,Vy.TrackAfter);return null==n?void 0:n}}),XE=new class extends jn{};XE.startSide=1,XE.endSide=-1;let XL=VB.define({create:()=>js.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(XR)&&(e=e.update({add:[XE.range(n.value,n.value+1)]}));return e}}),XN="()[]{}<>\xab\xbb\xbb\xab[]{}";function XB(e){for(let t=0;t<XN.length;t+=2)if(XN.charCodeAt(t)==e)return XN.charAt(t+1);return Vg(e<128?e:e+1)}function XF(e,t){return e.languageDataAt("closeBrackets",t)[0]||XP}let Xz="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),XV=GG.inputHandler.of((e,t,n,i)=>{if((Xz?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==Vm(Vp(i,0))||t!=r.from||n!=r.to)return!1;let o=function(e,t){let n=XF(e,e.selection.main.head),i=n.brackets||XP.brackets;for(let r of i){let o=XB(Vp(r,0));if(t==r)return o==r?function(e,t,n,i){let r=i.stringPrefixes||XP.stringPrefixes,o=null,a=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:XR.of(i.to+t.length),range:VT.range(i.anchor+t.length,i.head+t.length)};let a=i.head,s=XW(e.doc,a),l;if(s==t){if(XG(e,a))return{changes:{insert:t+t,from:a},effects:XR.of(a+t.length),range:VT.cursor(a+t.length)};else if(XH(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:VT.cursor(a+i.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=X$(e,a-2*t.length,r))>-1&&XG(e,l))return{changes:{insert:t+t+t+t,from:a},effects:XR.of(a+t.length),range:VT.cursor(a+t.length)};else if(e.charCategorizer(a)(s)!=V9.Word&&X$(e,a,r)>-1&&!function(e,t,n,i){let r=Ug(e).resolveInner(t,-1),o=i.reduce((e,t)=>Math.max(e,t.length),0);for(let a=0;a<5;a++){let a=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),s=a.indexOf(n);if(!s||s>-1&&i.indexOf(a.slice(0,s))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=r.to==t&&r.parent;if(!l)break;r=l}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:XR.of(a+t.length),range:VT.cursor(a+t.length)};return{range:o=i}});return o?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,i.indexOf(r+r+r)>-1,n):function(e,t,n,i){let r=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:XR.of(o.to+t.length),range:VT.range(o.anchor+t.length,o.head+t.length)};let a=XW(e.doc,o.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:t+n,from:o.head},effects:XR.of(o.head+t.length),range:VT.cursor(o.head+t.length)}:{range:r=o}});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,r,o,n.before||XP.before);if(t==o&&XH(e,e.selection.main.from))return function(e,t){let n=null,i=e.changeByRange(i=>i.empty&&XW(e.doc,i.head)==t?{changes:{from:i.head,to:i.head+t.length,insert:t},range:VT.cursor(i.head+t.length)}:n={range:i});return n?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}(e,o)}return null}(e.state,i);return!!o&&(e.dispatch(o),!0)}),Xj=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=XF(e,e.selection.main.head).brackets||XP.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){var r,o;let i,a=(r=e.doc,o=t.head,Vm(Vp(i=r.sliceString(o-2,o),0))==i.length?i:i.slice(1));for(let i of n)if(i==a&&XW(e.doc,t.head)==XB(Vp(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:VT.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function XH(e,t){let n=!1;return e.field(XL).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function XW(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Vm(Vp(n,0)))}function XG(e,t){let n=Ug(e).resolveInner(t+1);return n.parent&&n.from==t}function X$(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=V9.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=V9.Word)return n}return -1}let XU=[{key:"Ctrl-Space",run:XA},{mac:"Alt-`",run:XA},{mac:"Alt-i",run:XA},{key:"Escape",run:e=>{let t=e.state.field(XS,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:Xn.of(null)}),!0)}},{key:"ArrowDown",run:XM(!0)},{key:"ArrowUp",run:XM(!1)},{key:"PageDown",run:XM(!0,"page")},{key:"PageUp",run:XM(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(XS,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Xo).interactionDelay)&&X_(e,t.open.options[t.open.selected])}}],Xq=Vz.highest(GQ.computeN([Xo],e=>e.facet(Xo).defaultKeymap?[XU]:[]));var XY=function(e){let t;void 0===e&&(e={});var n=e.crosshairCursor,i=[];!1!==e.closeBracketsKeymap&&(i=i.concat(Xj)),!1!==e.defaultKeymap&&(i=i.concat(Zr)),!1!==e.searchKeymap&&(i=i.concat(ZX)),!1!==e.historyKeymap&&(i=i.concat(Ym)),!1!==e.foldKeymap&&(i=i.concat(UZ)),!1!==e.completionKeymap&&(i=i.concat(XU)),!1!==e.lintKeymap&&(i=i.concat(qR));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[Ui.of(e),$3(),Ua]}()),!1!==e.highlightActiveLineGutter&&r.push(Uu),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[$g.of(e),$m||($m=HZ.fromClass(class{constructor(e){this.view=e,this.decorations=jQ.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet($g)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new $c({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,o=Vp(t[0],0);if(9==o){let e=r.lineAt(i),t=n.state.tabSize,o=jx(e.text,t,i-e.from);return jQ.replace({widget:new $y((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=jQ.replace({widget:new $v(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet($g);e.startState.facet($g)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&r.push(function(e={}){return[Yn,Yt.of(e),GG.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Yr:"historyRedo"==e.inputType?Yo:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t={...U2,...e},n=new U5(t,!0),i=new U5(t,!1),r=HZ.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(UC)!=e.state.facet(UC)||e.startState.field(UG,!1)!=e.state.field(UG,!1)||Ug(e.startState)!=Ug(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new jl;for(let r of e.viewportLineBlocks){let o=UU(e.state,r.from,r.to)?i:Uz(e.state,r.from,r.to)?n:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[r,$2({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(r))?void 0:t.markers)||js.empty},initialSpacer:()=>new U5(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let i=UU(e.state,t.from,t.to);if(i)return e.dispatch({effects:UH.of(i)}),!0;let r=Uz(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:Uj.of(r)}),!0)}}}),UQ()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[$e.of(e),$n,$r,$o,HV.of(!0)]}()),!1!==e.dropCursor&&r.push([$s,$l]),!1!==e.allowMultipleSelections&&r.push(je.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(je.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let o=n.sliceString(r.from,i);if(!t.some(e=>e.test(o)))return e;let{state:a}=e,s=-1,l=[];for(let{head:e}of a.selection.ranges){let t=a.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=UD(a,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=UI(a,n);i!=r&&l.push({from:t.from,to:t.from+i.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&r.push(U7(qt,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[qr.of(e),qu]}()),!1!==e.closeBrackets&&r.push([XV,XL]),!1!==e.autocompletion&&r.push(function(e={}){return[XD,XS,Xo.of(e),XT,Xq,XO]}()),!1!==e.rectangularSelection&&r.push((t=e=>e.altKey&&0==e.button,GG.mouseSelectionStyle.of((e,n)=>{let i,r;return t(n)?(i=$S(e,n),r=e.state.selection,i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),n=e.state.doc.lineAt(t);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},r=r.map(e.changes)}},get(t,n,o){let a=$S(e,t);if(!a)return r;let s=function(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0){let a=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=i;t<=r;t++){let n=e.doc.line(t);n.length<=s&&o.push(VT.range(n.from+a,n.to+s))}}else{let a=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=i;t<=r;t++){let n=e.doc.line(t),i=jb(n.text,a,e.tabSize,!0);if(i<0)o.push(VT.cursor(n.to));else{let t=jb(n.text,s,e.tabSize);o.push(VT.range(n.from+i,n.from+t))}}}return o}(e.state,i,a);return s.length?o?VT.create(s.concat(r.ranges)):VT.create(s):r}}:null):null}))),!1!==(void 0!==n&&n)&&r.push(function(e={}){let[t,n]=$_[e.key||"Alt"],i=HZ.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[i,GG.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(i))?void 0:t.isDown)?$C:null})]}()),!1!==e.highlightActiveLine&&r.push($b),!1!==e.highlightSelectionMatches&&r.push([Zw,Zb]),e.tabSize&&"number"==typeof e.tabSize&&r.push(Uk.of(" ".repeat(e.tabSize))),r.concat([GQ.of(i.flat())]).filter(Boolean)};let XZ="#e06c75",XX="#abb2bf",XK="#7d8799",XQ="#d19a66",XJ="#2c313a",X0="#282c34",X1="#353a42",X2="#528bff",X5=[GG.theme({"&":{color:XX,backgroundColor:X0},".cm-content":{caretColor:X2},".cm-cursor, .cm-dropCursor":{borderLeftColor:X2},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:XX},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:X0,color:XK,border:"none"},".cm-activeLineGutter":{backgroundColor:XJ},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:X1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:X1,borderBottomColor:X1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:XJ,color:XX}}},{dark:!0}),U7(U4.define([{tag:z2.keyword,color:"#c678dd"},{tag:[z2.name,z2.deleted,z2.character,z2.propertyName,z2.macroName],color:XZ},{tag:[z2.function(z2.variableName),z2.labelName],color:"#61afef"},{tag:[z2.color,z2.constant(z2.name),z2.standard(z2.name)],color:XQ},{tag:[z2.definition(z2.name),z2.separator],color:XX},{tag:[z2.typeName,z2.className,z2.number,z2.changed,z2.annotation,z2.modifier,z2.self,z2.namespace],color:"#e5c07b"},{tag:[z2.operator,z2.operatorKeyword,z2.url,z2.escape,z2.regexp,z2.link,z2.special(z2.string)],color:"#56b6c2"},{tag:[z2.meta,z2.comment],color:XK},{tag:z2.strong,fontWeight:"bold"},{tag:z2.emphasis,fontStyle:"italic"},{tag:z2.strikethrough,textDecoration:"line-through"},{tag:z2.link,color:XK,textDecoration:"underline"},{tag:z2.heading,fontWeight:"bold",color:XZ},{tag:[z2.atom,z2.bool,z2.special(z2.variableName)],color:XQ},{tag:[z2.processingInstruction,z2.string,z2.inserted],color:"#98c379"},{tag:z2.invalid,color:"#ffffff"}]))];var X3=GG.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),X4=function(e){let t;void 0===e&&(e={});var n=e,i=n.indentWithTab,r=n.editable,o=n.readOnly,a=n.theme,s=void 0===a?"light":a,l=n.placeholder,u=void 0===l?"":l,c=n.basicSetup,h=void 0===c||c,d=[];switch((void 0===i||i)&&d.unshift(GQ.of([Zo])),h&&("boolean"==typeof h?d.unshift(XY()):d.unshift(XY(h))),u&&d.unshift((t=HZ.fromClass(class{constructor(e){this.view=e,this.placeholder=u?jQ.set([jQ.widget({widget:new $w(u),side:1}).range(0)]):jQ.none}get decorations(){return this.view.state.doc.length?jQ.none:this.placeholder}},{decorations:e=>e.decorations}),"string"==typeof u?[t,GG.contentAttributes.of({"aria-placeholder":u})]:t)),s){case"light":d.push(X3);break;case"dark":d.push(X5);break;case"none":break;default:d.push(s)}return!1===(void 0===r||r)&&d.push(GG.editable.of(!1)),void 0!==o&&o&&d.push(je.readOnly.of(!0)),[...d]};class X6{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class X8{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var X9=null,X7=VJ.define(),Ke=[],Kt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Kn=(0,eI.forwardRef)((e,t)=>{var n,i,r,o,a,s,l,u,c,h,d,f,p,g,m,v,y,x,b,w,S,_,C,M,A,k,T,I,D,O,P,R,E,L,N,B,F,z,V,j,H,W,G,$,U,q,Y,Z,X,K=e.className,Q=e.value,J=void 0===Q?"":Q,ee=e.selection,et=e.extensions,en=e.onChange,ei=e.onStatistics,er=e.onCreateEditor,eo=e.onUpdate,ea=e.autoFocus,es=e.theme,el=void 0===es?"light":es,eu=e.height,ec=e.minHeight,eh=e.maxHeight,ed=e.width,ef=e.minWidth,ep=e.maxWidth,eg=e.basicSetup,em=e.placeholder,ev=e.indentWithTab,ey=e.editable,ex=e.readOnly,ew=e.root,eS=e.initialState,e_=(0,q1.A)(e,Kt),eC=(0,eI.useRef)(null),eM=(i=(n={root:ew,value:J,autoFocus:ea,theme:el,height:eu,minHeight:ec,maxHeight:eh,width:ed,minWidth:ef,maxWidth:ep,basicSetup:eg,placeholder:em,indentWithTab:ev,editable:ey,readOnly:ex,selection:ee,onChange:en,onStatistics:ei,onCreateEditor:er,onUpdate:eo,extensions:void 0===et?[]:et,initialState:eS}).value,r=n.selection,o=n.onChange,a=n.onStatistics,s=n.onCreateEditor,l=n.onUpdate,c=void 0===(u=n.extensions)?Ke:u,h=n.autoFocus,f=void 0===(d=n.theme)?"light":d,g=void 0===(p=n.height)?null:p,v=void 0===(m=n.minHeight)?null:m,x=void 0===(y=n.maxHeight)?null:y,w=void 0===(b=n.width)?null:b,_=void 0===(S=n.minWidth)?null:S,M=void 0===(C=n.maxWidth)?null:C,k=void 0===(A=n.placeholder)?"":A,I=void 0===(T=n.editable)||T,O=void 0!==(D=n.readOnly)&&D,R=void 0===(P=n.indentWithTab)||P,L=void 0===(E=n.basicSetup)||E,N=n.root,B=n.initialState,z=(F=(0,eI.useState)())[0],V=F[1],H=(j=(0,eI.useState)())[0],W=j[1],$=(G=(0,eI.useState)())[0],U=G[1],q=(0,eI.useState)(()=>({current:null}))[0],Y=(0,eI.useState)(()=>({current:null}))[0],Z=GG.theme({"&":{height:g,minHeight:v,maxHeight:x,width:w,minWidth:_,maxWidth:M},"& .cm-scroller":{height:"100% !important"}}),X=[GG.updateListener.of(e=>{e.docChanged&&"function"==typeof o&&!e.transactions.some(e=>e.annotation(X7))&&(q.current?q.current.reset():(q.current=new X6(()=>{if(Y.current){var e=Y.current;Y.current=null,e()}q.current=null},200),("u"<typeof window?new X8:(!X9&&(X9=new X8),X9)).add(q.current)),o(e.state.doc.toString(),e)),a&&a({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)})}),Z,...X4({theme:f,editable:I,readOnly:O,placeholder:k,indentWithTab:R,basicSetup:L})],l&&"function"==typeof l&&X.push(GG.updateListener.of(l)),X=X.concat(c),(0,eI.useLayoutEffect)(()=>{if(z&&!$){var e={doc:i,selection:r,extensions:X},t=B?je.fromJSON(B.json,e,B.fields):je.create(e);if(U(t),!H){var n=new GG({state:t,parent:z,root:N});W(n),s&&s(n,t)}}return()=>{H&&(U(void 0),W(void 0))}},[z,$]),(0,eI.useEffect)(()=>{n.container&&V(n.container)},[n.container]),(0,eI.useEffect)(()=>()=>{H&&(H.destroy(),W(void 0)),q.current&&(q.current.cancel(),q.current=null)},[H]),(0,eI.useEffect)(()=>{h&&H&&H.focus()},[h,H]),(0,eI.useEffect)(()=>{H&&H.dispatch({effects:V2.reconfigure.of(X)})},[f,c,g,v,x,w,_,M,k,I,O,R,L,o,l]),(0,eI.useEffect)(()=>{if(void 0!==i){var e=H?H.state.doc.toString():"";if(H&&i!==e){var t=q.current&&!q.current.isDone,n=()=>{H&&i!==H.state.doc.toString()&&H.dispatch({changes:{from:0,to:H.state.doc.toString().length,insert:i||""},annotations:[X7.of(!0)]})};t?Y.current=n:n()}}},[i,H]),{state:$,setState:U,view:H,setView:W,container:z,setContainer:V}),eA=eM.state,ek=eM.view,eT=eM.container,eD=eM.setContainer;(0,eI.useImperativeHandle)(t,()=>({editor:eC.current,state:eA,view:ek}),[eC,eT,eA,ek]);var eO=(0,eI.useCallback)(e=>{eC.current=e,eD(e)},[eD]);if("string"!=typeof J)throw Error("value must be typeof string but got "+typeof J);return(0,eb.jsx)("div",(0,oc.A)({ref:eO,className:("string"==typeof el?"cm-theme-"+el:"cm-theme")+(K?" "+K:"")},e_))});function Ki(e){let t=(0,uo.A)(),n="dark"===t.palette.mode,[i,r]=(0,eI.useState)(()=>JSON.stringify(e.value,null,2)),[o,a]=(0,eI.useState)(i);return(0,eb.jsx)(Kn,{...e,style:{border:`1px solid ${t.palette.divider}`},theme:n?"dark":"light",extensions:[new UM(qb),function(e,t={}){return[qL.of({source:e,config:t}),qE,qJ]}(e=>{try{JSON.parse(e.state.doc.toString())}catch(r){var t;let n;if(!(r instanceof SyntaxError))throw r;let i=(t=e.state.doc,(n=r.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=r.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0);return[{from:i,message:r.message,severity:"error",to:i}]}return[]}),function(e={}){return[q0.of(e),qY,qq,qK,qX]}()],value:i,onChange:t=>{r(t),e.onChange&&e.onChange(t)},onBlur:()=>{o!==i&&void 0!==e.onChange&&(e.onChange(i),a(i))},placeholder:e.placeholder})}Kn.displayName="CodeMirror";var Kr=n(10740);let Ko=e=>{let{mode:t,url:n,name:i,newTabOpen:r,renderVariables:o,tooltip:a}=e;return(0,eb.jsxs)(eC.A,{direction:"column",gap:2,flexGrow:1,children:[(0,eb.jsx)(pP,{label:n.label,error:n.error?.hasError,helperText:n.error?.helperText,onChange:n.onChange,placeholder:n.placeholder,multiline:!0,maxRows:5,required:!0,fullWidth:!0,value:n.value}),(i||a)&&(0,eb.jsxs)(eC.A,{gap:1,direction:"inline"===t?"row":"column",children:[i&&(0,eb.jsx)(pP,{sx:{flexGrow:"1"},label:i.label,onChange:i?.onChange,placeholder:i?.placeholder,value:i?.value}),a&&(0,eb.jsx)(pP,{sx:{flexGrow:"1"},label:a.label,onChange:a?.onChange,placeholder:a?.placeholder,value:a?.value})]}),(0,eb.jsxs)(eC.A,{direction:"row",gap:1,children:[o&&(0,eb.jsx)(Kr.A,{label:o.label,control:(0,eb.jsx)(fM.A,{checked:o.value,onChange:e=>{o?.onChange(e.target.checked)}})}),(0,eb.jsx)(Kr.A,{label:r.label,control:(0,eb.jsx)(fM.A,{checked:r.value,onChange:e=>{r?.onChange(e.target.checked)}})})]})]})},Ka=[{id:"value",label:"Value"},{id:"percentage",label:"Percentage"}];function Ks({disablePercentageMode:e,onChange:t,value:n="value"}){return(0,eb.jsx)(gt,{label:"Mode",control:(0,eb.jsx)(ga,{value:Ka.find(e=>e.id===n),options:Ka,getOptionLabel:e=>e.label,getOptionDisabled:t=>"percentage"===t.id&&e,onChange:(e,{id:n})=>{t(n)},disableClearable:!0})})}var Kl=n(33313);function Ku(e){let{message:t}=e;return(0,eb.jsx)(eC.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center"},children:(0,eb.jsx)(pd.A,{children:t})})}function Kc(e){let{resource:t}=e;return(0,eb.jsx)(Ku,{message:`No ${t}`})}function Kh(e){let{variant:t="rounded"}=e;return(0,eb.jsx)(eC.A,{sx:{height:"100%",alignItems:"center",justifyContent:"center",px:1},children:(0,eb.jsx)(Kl.A,{variant:t,width:"100%",height:"30%","aria-label":"Loading..."})})}let Kd=[{id:"asc",label:"Ascending"},{id:"desc",label:"Descending"}];function Kf({onChange:e,value:t="desc"}){return(0,eb.jsx)(gt,{label:"Sort",control:(0,eb.jsx)(ga,{value:Kd.find(e=>e.id===t),options:Kd,getOptionLabel:e=>e.label,onChange:(t,{id:n})=>{e(n)},disableClearable:!0})})}function Kp({onChange:e,value:t,...n}){let i=t=>{e(t)};return(0,eb.jsxs)(ew.A,{"aria-label":"Sort",...n,children:[(0,eb.jsx)(eS.A,{onClick:()=>i(void 0),variant:void 0===t?"contained":"outlined",children:"None"}),(0,eb.jsx)(eS.A,{onClick:()=>i("asc"),variant:"asc"===t?"contained":"outlined",children:"Asc"}),(0,eb.jsx)(eS.A,{onClick:()=>i("desc"),variant:"desc"===t?"contained":"outlined",children:"Desc"})]})}var Kg=n(61375),Km=n(31729);let Kv=(0,n(68335).A)();var Ky=n(86742),Kx=n(86067);function Kb({inputRef:e,label:t,color:n,value:i,mode:r,onChange:o,onColorChange:a,onBlur:s,onDelete:l}){let[u,c]=(0,eI.useState)(0);return(0,eb.jsxs)(eC.A,{flex:1,direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,eb.jsx)(ui,{label:t,color:n,onColorChange:a}),(0,eb.jsx)(p4.A,{htmlFor:t,children:t}),(0,eb.jsx)(eA.A,{id:t,inputRef:e,type:"number",value:0===i?"":i,placeholder:"0",onChange:o,onBlur:s,onKeyDown:e=>{"Enter"===e.key&&(s(),c(u+1))},InputProps:{endAdornment:"percent"===r?(0,eb.jsx)(ua.A,{paddingX:1,children:"%"}):void 0}},u),(0,eb.jsx)(eM.A,{"aria-label":`delete threshold ${t}`,size:"small",onClick:l,children:(0,eb.jsx)(Kx,{})})]})}function Kw({thresholds:e,onChange:t,hideDefault:n,disablePercentMode:i}){let{thresholds:{defaultColor:r,palette:o}}=ti(),a=e?.defaultColor??r,s=e?.steps,l=(0,eI.useRef)(null),u=(0,eI.useRef)(!1);(0,eI.useEffect)(()=>{l.current&&u.current&&(l.current?.focus(),u.current=!1)},[s?.length]);let c=()=>{if(void 0!==s){let n=[...s];n.sort((e,t)=>e.value-t.value),void 0!==e&&t((0,us.jM)(e,e=>{e.steps=n}))}};return(0,eb.jsxs)(gi,{title:"Thresholds",icon:(0,eb.jsx)(p9,{description:"Add threshold",children:(0,eb.jsx)(eM.A,{size:"small","aria-label":"add threshold",onClick:()=>{u.current=!0,void 0===e?t({steps:[{value:10}]}):e&&void 0===e.steps?t((0,us.jM)(e,e=>{e.steps=[{value:10}]})):t((0,us.jM)(e,e=>{let t=e.steps;if(t?.length){let e=t[t.length-1],n=o[t.length]??KS();t.push({color:n,value:(e?.value??0)+10})}else t&&t.push({value:10})}))},children:(0,eb.jsx)(Ky,{})})}),children:[(0,eb.jsx)(gt,{label:"Mode",description:"Percentage means thresholds relative to min & max",control:(0,eb.jsxs)(Kg.A,{exclusive:!0,disabled:i,value:e?.mode??"absolute",onChange:(n,i)=>{let r="percent"===i?"percent":void 0;void 0!==e?t((0,us.jM)(e,e=>{e.mode=r})):t({mode:r})},sx:{height:"36px",marginLeft:"auto"},children:[(0,eb.jsx)(Km.A,{"aria-label":"absolute",value:"absolute",sx:{fontWeight:500},children:"Absolute"}),(0,eb.jsx)(Km.A,{"aria-label":"percent",value:"percent",sx:{fontWeight:500},children:"Percent"})]})}),s&&s.map((n,i)=>(0,eb.jsx)(Kb,{inputRef:i===s.length-1?l:void 0,label:`T${i+1}`,color:n.color??o[i]??a,value:n.value,mode:e?.mode,onColorChange:n=>{void 0!==e&&t((0,us.jM)(e,e=>{if(void 0!==e.steps){let t=e.steps[i];t&&(t.color=n)}}))},onChange:n=>{void 0!==e&&t((0,us.jM)(e,e=>{let t=e.steps?.[i];t&&(t.value=Number(n.target.value))}))},onDelete:()=>{void 0!==e&&t((0,us.jM)(e,e=>{e.steps&&e.steps.splice(i,1)}))},onBlur:c},i)).reverse(),!n&&(0,eb.jsxs)(Kv,{flex:1,direction:"row",alignItems:"center",spacing:1,children:[(0,eb.jsx)(ui,{label:"default",color:a,onColorChange:n=>{void 0!==e?t((0,us.jM)(e,e=>{e.defaultColor=n})):t({defaultColor:n})}}),(0,eb.jsx)(pd.A,{children:"Default"})]})]})}let KS=()=>"#"+Math.floor(0x1000000*Math.random()).toString(16).padStart(6,"0");var K_=n(24300),KC=n(26684),KM=n(51327),KA=n(87169),Kk=n(93724);function KT({props:e,name:t}){return(0,KM.A)({props:e,name:t,defaultTheme:KA.A,themeId:Kk.A})}let KI=["localeText"],KD=eI.createContext(null),KO=function(e){let{localeText:t}=e,n=(0,q1.A)(e,KI),{utils:i,localeText:r}=eI.useContext(KD)??{utils:void 0,localeText:void 0},{children:o,dateAdapter:a,dateFormats:s,dateLibInstance:l,adapterLocale:u,localeText:c}=KT({props:n,name:"MuiLocalizationProvider"}),h=eI.useMemo(()=>(0,oc.A)({},c,r,t),[c,r,t]),d=eI.useMemo(()=>{if(!a)return i||null;let e=new a({locale:u,formats:s,instance:l});if(!e.isMUIAdapter)throw Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
|
|
6
|
+
`));return e},[a,u,s,l,i]),f=eI.useMemo(()=>d?{minDate:d.date("1900-01-01T00:00:00.000"),maxDate:d.date("2099-12-31T00:00:00.000")}:null,[d]),p=eI.useMemo(()=>({utils:d,defaultDates:f,localeText:h}),[f,d,h]);return(0,eb.jsx)(KD.Provider,{value:p,children:o})};var KP=n(62688),KR=n.n(KP);let KE={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>"year"===e?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,i)=>`Select ${e}. ${!i&&(null===t||!n.isValid(t))?"No time selected":`Selected time is ${i??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||null!==e&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>"letter"===e.contentType?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>"letter"===e.contentType?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"};(0,oc.A)({},KE);let KL=()=>{let e=eI.useContext(KD);if(null===e)throw Error("MUI X: Can not find the date and time pickers localization context.\nIt looks like you forgot to wrap your component in LocalizationProvider.\nThis can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package");if(null===e.utils)throw Error("MUI X: Can not find the date and time pickers adapter from its localization context.\nIt looks like you forgot to pass a `dateAdapter` to your LocalizationProvider.");let t=eI.useMemo(()=>(0,oc.A)({},KE,e.localeText),[e.localeText]);return eI.useMemo(()=>(0,oc.A)({},e,{localeText:t}),[e,t])},KN=e=>{let t=KL().utils,n=eI.useRef(void 0);return void 0===n.current&&(n.current=t.date(void 0,e)),n.current},KB=(e,t,n)=>{let i=t;return i=e.setHours(i,e.getHours(n)),i=e.setMinutes(i,e.getMinutes(n)),i=e.setSeconds(i,e.getSeconds(n)),i=e.setMilliseconds(i,e.getMilliseconds(n))},KF=({date:e,disableFuture:t,disablePast:n,maxDate:i,minDate:r,isDateDisabled:o,utils:a,timezone:s})=>{let l=KB(a,a.date(void 0,s),e);n&&a.isBefore(r,l)&&(r=l),t&&a.isAfter(i,l)&&(i=l);let u=e,c=e;for(a.isBefore(e,r)&&(u=r,c=null),a.isAfter(e,i)&&(c&&(c=i),u=null);u||c;){if(u&&a.isAfter(u,i)&&(u=null),c&&a.isBefore(c,r)&&(c=null),u){if(!o(u))return u;u=a.addDays(u,1)}if(c){if(!o(c))return c;c=a.addDays(c,-1)}}return null},Kz=(e,t,n)=>null!=t&&e.isValid(t)?t:n,KV=(e,t)=>{let n=[e.startOfYear(t)];for(;n.length<12;){let t=n[n.length-1];n.push(e.addMonths(t,1))}return n},Kj=(e,t,n)=>"date"===n?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),KH=(e,t)=>{let n=e.setHours(e.date(),"am"===t?2:14);return e.format(n,"meridiem")},KW=["year","month","day"],KG=e=>KW.includes(e);var K$=n(33868),KU=n(87034),Kq=n(22857);let KY=(0,fF.A)((0,eb.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),KZ=(0,fF.A)((0,eb.jsx)("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),KX=(0,fF.A)((0,eb.jsx)("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight");(0,fF.A)((0,eb.jsx)("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),(0,fF.A)((0,eb.jsxs)(eI.Fragment,{children:[(0,eb.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,eb.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");let KK=(0,fF.A)((0,eb.jsx)("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),KQ=(0,fF.A)((0,eb.jsxs)(eI.Fragment,{children:[(0,eb.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),(0,eb.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),KJ=(0,fF.A)((0,eb.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function K0(e){return(0,ub.Ay)("MuiDateTimePickerTabs",e)}(0,ux.A)("MuiDateTimePickerTabs",["root"]);let K1=(0,e7.A)(KU.A,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${Kq.A.indicator}`]:{bottom:"auto",top:0}}})),K2=function(e){let t=KT({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:n=(0,eb.jsx)(KK,{}),onViewChange:i,timeIcon:r=(0,eb.jsx)(KQ,{}),view:o,hidden:a="u"<typeof window||window.innerHeight<667,className:s,sx:l}=t,u=KL().localeText,c=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"]},K0,t)})(t);return a?null:(0,eb.jsxs)(K1,{ownerState:t,variant:"fullWidth",value:KG(o)?"date":"time",onChange:(e,t)=>{i("date"===t?"day":"hours")},className:(0,uu.A)(s,c.root),sx:l,children:[(0,eb.jsx)(K$.A,{value:"date","aria-label":u.dateTableLabel,icon:(0,eb.jsx)(eI.Fragment,{children:n})}),(0,eb.jsx)(K$.A,{value:"time","aria-label":u.timeTableLabel,icon:(0,eb.jsx)(eI.Fragment,{children:r})})]})};function K5(e){return(0,ub.Ay)("MuiPickersToolbarText",e)}let K3=(0,ux.A)("MuiPickersToolbarText",["root","selected"]),K4=["className","selected","value"],K6=(0,e7.A)(pd.A,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${K3.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${K3.selected}`]:{color:(e.vars||e).palette.text.primary}})),K8=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersToolbarText"}),{className:i,value:r}=n,o=(0,q1.A)(n,K4),a=(e=>{let{classes:t,selected:n}=e;return(0,uc.A)({root:["root",n&&"selected"]},K5,t)})(n);return(0,eb.jsx)(K6,(0,oc.A)({ref:t,className:(0,uu.A)(a.root,i),component:"span"},o,{children:r}))});function K9(e){return(0,ub.Ay)("MuiPickersToolbar",e)}let K7=(0,ux.A)("MuiPickersToolbar",["root","content"]),Qe=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Qt=(0,e7.A)("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),Qn=(0,e7.A)("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Qi=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersToolbar"}),{children:i,className:r,toolbarTitle:o,hidden:a,titleId:s}=n,l=(0,q1.A)(n,Qe),u=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],content:["content"]},K9,t)})(n);return a?null:(0,eb.jsxs)(Qt,(0,oc.A)({ref:t,className:(0,uu.A)(u.root,r),ownerState:n},l,{children:[(0,eb.jsx)(pd.A,{color:"text.secondary",variant:"overline",id:s,children:o}),(0,eb.jsx)(Qn,{className:u.content,ownerState:n,children:i})]}))}),Qr=["align","className","selected","typographyClassName","value","variant","width"],Qo=(0,e7.A)(eS.A,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),Qa=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:r,selected:o,typographyClassName:a,value:s,variant:l,width:u}=n,c=(0,q1.A)(n,Qr),h=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"]},K9,t)})(n);return(0,eb.jsx)(Qo,(0,oc.A)({variant:"text",ref:t,className:(0,uu.A)(h.root,r)},u?{sx:{width:u}}:{},c,{children:(0,eb.jsx)(K8,{align:i,className:a,variant:l,value:s,selected:o})}))});function Qs(e){return(0,ub.Ay)("MuiDateTimePickerToolbar",e)}let Ql=(0,ux.A)("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),Qu=["hours","minutes","seconds"],Qc=e=>Qu.includes(e),Qh=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?"am"===t?e-12:e+12:e,Qd=(e,t)=>3600*t.getHours(e)+60*t.getMinutes(e)+t.getSeconds(e),Qf=(e,t)=>(n,i)=>e?t.isAfter(n,i):Qd(n,t)>Qd(i,t);function Qp(e,t,n,i){let r=KL().utils;return{meridiemMode:e?r.getHours(e)>=12?"pm":"am":null,handleMeridiemChange:eI.useCallback(o=>{var a;let s;n(null==e?null:(a=!!t,s=Qh(r.getHours(e),o,a),r.setHours(e,s)),i??"partial")},[t,e,n,i,r])}}let Qg=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],Qm=(0,e7.A)(Qi,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${K7.content} .${K3.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),Qv=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),Qy=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&"desktop"!==t,style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&"desktop"!==t&&n,style:{flexDirection:"column-reverse"}}]}),Qx=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),Qb=(0,e7.A)(K8,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),Qw=(0,e7.A)("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${Ql.ampmLabel}`]:t.ampmLabel},{[`&.${Ql.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${Ql.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function QS(e){let t=KT({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:i,value:r,onChange:o,view:a,isLandscape:s,onViewChange:l,toolbarFormat:u,toolbarPlaceholder:c="––",views:h,disabled:d,readOnly:f,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=t,v=(0,q1.A)(t,Qg),y=(0,fL.I)(),x=(0,oc.A)({},t,{isRtl:y}),b=KL().utils,{meridiemMode:w,handleMeridiemChange:S}=Qp(r,n,o),_=!!(n&&!i),C="desktop"===p,M=KL().localeText,A=(e=>{let{classes:t,isLandscape:n,isRtl:i}=e;return(0,uc.A)({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",i&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",i&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},Qs,t)})(x),k=g??M.dateTimePickerToolbarTitle,T=eI.useMemo(()=>r?u?b.formatByString(r,u):b.format(r,"shortDate"):c,[r,u,c,b]);return(0,eb.jsxs)(Qm,(0,oc.A)({isLandscape:s,className:(0,uu.A)(A.root,m),toolbarTitle:k},v,{ownerState:x,children:[(0,eb.jsxs)(Qv,{className:A.dateContainer,ownerState:x,children:[h.includes("year")&&(0,eb.jsx)(Qa,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:"year"===a,value:r?b.format(r,"year"):"–"}),h.includes("day")&&(0,eb.jsx)(Qa,{tabIndex:-1,variant:C?"h5":"h4",onClick:()=>l("day"),selected:"day"===a,value:T})]}),(0,eb.jsxs)(Qy,{className:A.timeContainer,ownerState:x,children:[(0,eb.jsxs)(Qx,{className:A.timeDigitsContainer,ownerState:x,children:[h.includes("hours")&&(0,eb.jsxs)(eI.Fragment,{children:[(0,eb.jsx)(Qa,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("hours"),selected:"hours"===a,value:r?n?b.format(r,"hours12h"):b.format(r,"hours24h"):"--"}),(0,eb.jsx)(Qb,{variant:C?"h5":"h3",value:":",className:A.separator,ownerState:x}),(0,eb.jsx)(Qa,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("minutes"),selected:"minutes"===a||!h.includes("minutes")&&"hours"===a,value:r?b.format(r,"minutes"):"--",disabled:!h.includes("minutes")})]}),h.includes("seconds")&&(0,eb.jsxs)(eI.Fragment,{children:[(0,eb.jsx)(Qb,{variant:C?"h5":"h3",value:":",className:A.separator,ownerState:x}),(0,eb.jsx)(Qa,{variant:C?"h5":"h3",width:C&&!s?48:void 0,onClick:()=>l("seconds"),selected:"seconds"===a,value:r?b.format(r,"seconds"):"--"})]})]}),_&&!C&&(0,eb.jsxs)(Qw,{className:A.ampmSelection,ownerState:x,children:[(0,eb.jsx)(Qa,{variant:"subtitle2",selected:"am"===w,typographyClassName:A.ampmLabel,value:KH(b,"am"),onClick:f?void 0:()=>S("am"),disabled:d}),(0,eb.jsx)(Qa,{variant:"subtitle2",selected:"pm"===w,typographyClassName:A.ampmLabel,value:KH(b,"pm"),onClick:f?void 0:()=>S("pm"),disabled:d})]}),n&&C&&(0,eb.jsx)(Qa,{variant:"h5",onClick:()=>l("meridiem"),selected:"meridiem"===a,value:r&&w?KH(b,w):"--",width:48})]})]}))}var Q_=n(54553),QC=n(77893);function QM(e){return(0,ub.Ay)("MuiPickersArrowSwitcher",e)}(0,ux.A)("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);let QA=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],Qk=["ownerState"],QT=["ownerState"],QI=(0,e7.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),QD=(0,e7.A)("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),QO=(0,e7.A)(eM.A,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),QP=eI.forwardRef(function(e,t){let n=(0,fL.I)(),i=KT({props:e,name:"MuiPickersArrowSwitcher"}),{children:r,className:o,slots:a,slotProps:s,isNextDisabled:l,isNextHidden:u,onGoToNext:c,nextLabel:h,isPreviousDisabled:d,isPreviousHidden:f,onGoToPrevious:p,previousLabel:g,labelId:m}=i,v=(0,q1.A)(i,QA),y=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},QM,t)})(i),x=a?.previousIconButton??QO,b=(0,QC.A)({elementType:x,externalSlotProps:s?.previousIconButton,additionalProps:{size:"medium",title:g,"aria-label":g,disabled:d,edge:"end",onClick:p},ownerState:(0,oc.A)({},i,{hidden:f}),className:(0,uu.A)(y.button,y.previousIconButton)}),w=a?.nextIconButton??QO,S=(0,QC.A)({elementType:w,externalSlotProps:s?.nextIconButton,additionalProps:{size:"medium",title:h,"aria-label":h,disabled:l,edge:"start",onClick:c},ownerState:(0,oc.A)({},i,{hidden:u}),className:(0,uu.A)(y.button,y.nextIconButton)}),_=a?.leftArrowIcon??KZ,C=(0,QC.A)({elementType:_,externalSlotProps:s?.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:y.leftArrowIcon}),M=(0,q1.A)(C,Qk),A=a?.rightArrowIcon??KX,k=(0,QC.A)({elementType:A,externalSlotProps:s?.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:i,className:y.rightArrowIcon}),T=(0,q1.A)(k,QT);return(0,eb.jsxs)(QI,(0,oc.A)({ref:t,className:(0,uu.A)(y.root,o),ownerState:i},v,{children:[(0,eb.jsx)(x,(0,oc.A)({},b,{children:n?(0,eb.jsx)(A,(0,oc.A)({},T)):(0,eb.jsx)(_,(0,oc.A)({},M))})),r?(0,eb.jsx)(pd.A,{variant:"subtitle1",component:"span",id:m,children:r}):(0,eb.jsx)(QD,{className:y.spacer,ownerState:i}),(0,eb.jsx)(w,(0,oc.A)({},S,{children:n?(0,eb.jsx)(_,(0,oc.A)({},M)):(0,eb.jsx)(A,(0,oc.A)({},T))}))]}))});var QR=n(83183),QE=n(89369);function QL({onChange:e,onViewChange:t,openTo:n,view:i,views:r,autoFocus:o,focusedView:a,onFocusedViewChange:s}){let l=eI.useRef(n),u=eI.useRef(r),c=eI.useRef(r.includes(n)?n:r[0]),[h,d]=(0,QE.A)({name:"useViews",state:"view",controlled:i,default:c.current}),f=eI.useRef(o?h:null),[p,g]=(0,QE.A)({name:"useViews",state:"focusedView",controlled:a,default:f.current});eI.useEffect(()=>{(l.current&&l.current!==n||u.current&&u.current.some(e=>!r.includes(e)))&&(d(r.includes(n)?n:r[0]),u.current=r,l.current=n)},[n,d,h,r]);let m=r.indexOf(h),v=r[m-1]??null,y=r[m+1]??null,x=(0,QR.A)((e,t)=>{t?g(e):g(t=>e===t?null:t),s?.(e,t)}),b=(0,QR.A)(e=>{x(e,!0),e!==h&&(d(e),t&&t(e))}),w=(0,QR.A)(()=>{y&&b(y)}),S=(0,QR.A)((t,n,i)=>{let o="finish"===n,a=i?r.indexOf(i)<r.length-1:!!y;if(e(t,o&&a?"partial":n,i),i&&i!==h){let e=r[r.indexOf(i)+1];e&&b(e)}else o&&w()});return{view:h,setView:b,focusedView:p,setFocusedView:x,nextView:y,previousView:v,defaultView:r.includes(n)?n:r[0],goToNextView:w,setValueAndGoToNextView:S}}let QN=(0,e7.A)("div")({overflow:"hidden",width:320,maxHeight:336,display:"flex",flexDirection:"column",margin:"0 auto"});function QB(e){return(0,ub.Ay)("MuiTimeClock",e)}(0,ux.A)("MuiTimeClock",["root","arrowSwitcher"]);var QF=n(31789);function Qz(e){return(0,ub.Ay)("MuiClockPointer",e)}(0,ux.A)("MuiClockPointer",["root","thumb"]);let QV=["className","hasSelected","isInner","type","viewValue"],Qj=(0,e7.A)("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),QH=(0,e7.A)("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:"calc(50% - 18px)",border:`16px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function QW(e){let t,n=KT({props:e,name:"MuiClockPointer"}),{className:i,isInner:r,type:o,viewValue:a}=n,s=(0,q1.A)(n,QV),l=eI.useRef(o);eI.useEffect(()=>{l.current=o},[o]);let u=(0,oc.A)({},n,{shouldAnimate:l.current!==o}),c=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],thumb:["thumb"]},Qz,t)})(u);return(0,eb.jsx)(Qj,(0,oc.A)({style:(t=360/("hours"===o?12:60)*a,"hours"===o&&a>12&&(t-=360),{height:Math.round((r?.26:.4)*220),transform:`rotateZ(${t}deg)`}),className:(0,uu.A)(c.root,i),ownerState:u},s,{children:(0,eb.jsx)(QH,{ownerState:u,className:c.thumb})}))}let QG=110,Q$=110,QU=QG,Qq=0,QY=QU-QG,QZ=Qq-Q$,QX=(e,t,n)=>{let i=t-QG,r=n-Q$,o=180/Math.PI*(Math.atan2(QY,QZ)-Math.atan2(i,r));return{value:Math.floor((o=Math.round(o/e)*e%360)/e)||0,distance:Math.sqrt(i**2+r**2)}};function QK(e){return(0,ub.Ay)("MuiClock",e)}(0,ux.A)("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);let QQ=(0,e7.A)("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),QJ=(0,e7.A)("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),Q0=(0,e7.A)("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),Q1=(0,e7.A)("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),Q2=(0,e7.A)("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),Q5=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:36,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),Q3=(0,e7.A)(eM.A,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>(0,oc.A)({},Q5(e,"am"),{position:"absolute",left:8})),Q4=(0,e7.A)(eM.A,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>(0,oc.A)({},Q5(e,"pm"),{position:"absolute",right:8})),Q6=(0,e7.A)(pd.A,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function Q8(e){let t=KT({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:i,autoFocus:r,children:o,value:a,handleMeridiemChange:s,isTimeDisabled:l,meridiemMode:u,minutesStep:c=1,onChange:h,selectedId:d,type:f,viewValue:p,viewRange:[g,m],disabled:v=!1,readOnly:y,className:x}=t,b=KL().utils,w=KL().localeText,S=eI.useRef(!1),_=(e=>{let{classes:t,meridiemMode:n}=e;return(0,uc.A)({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton","am"===n&&"selected"],pmButton:["pmButton","pm"===n&&"selected"],meridiemText:["meridiemText"]},QK,t)})(t),C=l(p,f),M=!n&&"hours"===f&&(p<1||p>12),A=(e,t)=>{v||y||l(e,f)||h(e,t)},k=(e,t)=>{let{offsetX:i,offsetY:r}=e;if(void 0===i){let t=e.target.getBoundingClientRect();i=e.changedTouches[0].clientX-t.left,r=e.changedTouches[0].clientY-t.top}A("seconds"===f||"minutes"===f?((e,t,n=1)=>{let{value:i}=QX(6*n,e,t);return i*n%60})(i,r,c):((e,t,n)=>{let{value:i,distance:r}=QX(30,e,t),o=i||12;return n?o%=12:r<74&&(o+=12,o%=24),o})(i,r,!!n),t)},T=e=>{S.current=!0,k(e,"shallow")},I=eI.useMemo(()=>"hours"===f||p%5==0,[f,p]),D="minutes"===f?c:1,O=eI.useRef(null);(0,QF.A)(()=>{r&&O.current.focus()},[r]);let P=e=>Math.max(g,Math.min(m,e)),R=e=>(e+(m+1))%(m+1);return(0,eb.jsxs)(QQ,{className:(0,uu.A)(_.root,x),children:[(0,eb.jsxs)(QJ,{className:_.clock,children:[(0,eb.jsx)(Q1,{onTouchMove:T,onTouchStart:T,onTouchEnd:e=>{S.current&&(k(e,"finish"),S.current=!1),e.preventDefault()},onMouseUp:e=>{S.current&&(S.current=!1),k(e.nativeEvent,"finish")},onMouseMove:e=>{e.buttons>0&&k(e.nativeEvent,"shallow")},ownerState:{disabled:v},className:_.squareMask}),!C&&(0,eb.jsxs)(eI.Fragment,{children:[(0,eb.jsx)(Q2,{className:_.pin}),null!=a&&(0,eb.jsx)(QW,{type:f,viewValue:p,isInner:M,hasSelected:I})]}),(0,eb.jsx)(Q0,{"aria-activedescendant":d,"aria-label":w.clockLabelText(f,a,b,null==a?null:b.format(a,"fullTime")),ref:O,role:"listbox",onKeyDown:e=>{if(!S.current)switch(e.key){case"Home":A(g,"partial"),e.preventDefault();break;case"End":A(m,"partial"),e.preventDefault();break;case"ArrowUp":A(R(p+D),"partial"),e.preventDefault();break;case"ArrowDown":A(R(p-D),"partial"),e.preventDefault();break;case"PageUp":A(P(p+5),"partial"),e.preventDefault();break;case"PageDown":A(P(p-5),"partial"),e.preventDefault();break;case"Enter":case" ":A(p,"finish"),e.preventDefault()}},tabIndex:0,className:_.wrapper,children:o})]}),n&&i&&(0,eb.jsxs)(eI.Fragment,{children:[(0,eb.jsx)(Q3,{onClick:y?void 0:()=>s("am"),disabled:v||null===u,ownerState:t,className:_.amButton,title:KH(b,"am"),children:(0,eb.jsx)(Q6,{variant:"caption",className:_.meridiemText,children:KH(b,"am")})}),(0,eb.jsx)(Q4,{disabled:v||null===u,onClick:y?void 0:()=>s("pm"),ownerState:t,className:_.pmButton,title:KH(b,"pm"),children:(0,eb.jsx)(Q6,{variant:"caption",className:_.meridiemText,children:KH(b,"pm")})})]})]})}function Q9(e){return(0,ub.Ay)("MuiClockNumber",e)}let Q7=(0,ux.A)("MuiClockNumber",["root","selected","disabled"]),Je=["className","disabled","index","inner","label","selected"],Jt=(0,e7.A)("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Q7.disabled}`]:t.disabled},{[`&.${Q7.selected}`]:t.selected}]})(({theme:e})=>({height:36,width:36,position:"absolute",left:"calc((100% - 36px) / 2)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${Q7.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${Q7.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:(0,oc.A)({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function Jn(e){let t=KT({props:e,name:"MuiClockNumber"}),{className:n,disabled:i,index:r,inner:o,label:a,selected:s}=t,l=(0,q1.A)(t,Je),u=(e=>{let{classes:t,selected:n,disabled:i}=e;return(0,uc.A)({root:["root",n&&"selected",i&&"disabled"]},Q9,t)})(t),c=r%12/12*Math.PI*2-Math.PI/2,h=91*(o?.65:1),d=Math.round(Math.cos(c)*h),f=Math.round(Math.sin(c)*h);return(0,eb.jsx)(Jt,(0,oc.A)({className:(0,uu.A)(u.root,n),"aria-disabled":!!i||void 0,"aria-selected":!!s||void 0,role:"option",style:{transform:`translate(${d}px, ${f+92}px`},ownerState:t},l,{children:a}))}let Ji=({utils:e,value:t,isDisabled:n,getClockNumberText:i,selectedId:r})=>{let o=e.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([e,o],a)=>{let s=e===t;return(0,eb.jsx)(Jn,{label:o,id:s?r:void 0,index:a+1,inner:!1,disabled:n(e),selected:s,"aria-label":i(o)},e)})},Jr=({timezone:e,value:t,defaultValue:n,referenceDate:i,onChange:r,valueManager:o})=>{let a,s=KL().utils,l=eI.useRef(n),u=t??l.current??o.emptyValue,c=eI.useMemo(()=>o.getTimezone(s,u),[s,o,u]),h=(0,QR.A)(e=>null==c?e:o.setTimezone(s,c,e));return a=e||c||(i?s.getTimezone(i):"default"),{value:eI.useMemo(()=>o.setTimezone(s,a,u),[o,s,a,u]),handleValueChange:(0,QR.A)((e,...t)=>{let n=h(e);r?.(n,...t)}),timezone:a}},Jo=({name:e,timezone:t,value:n,defaultValue:i,referenceDate:r,onChange:o,valueManager:a})=>{let[s,l]=(0,QE.A)({name:e,state:"value",controlled:n,default:i??a.emptyValue});return Jr({timezone:t,value:s,defaultValue:void 0,referenceDate:r,onChange:(0,QR.A)((e,...t)=>{l(e),o?.(e,...t)}),valueManager:a})},Ja={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Js=(e,t,n)=>{if(t===Ja.year)return e.startOfYear(n);if(t===Ja.month)return e.startOfMonth(n);if(t===Ja.day)return e.startOfDay(n);let i=n;return t<Ja.minutes&&(i=e.setMinutes(i,0)),t<Ja.seconds&&(i=e.setSeconds(i,0)),t<Ja.milliseconds&&(i=e.setMilliseconds(i,0)),i},Jl=(e,t)=>{let n=e.formatTokenMap[t];if(null==n)throw Error(`MUI X: The token "${t}" is not supported by the Date and Time Pickers.
|
|
7
|
+
Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported.`);return"string"==typeof n?{type:n,contentType:"meridiem"===n?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},Ju=(e,t)=>{let n=[],i=e.date(void 0,"default"),r=e.startOfWeek(i),o=e.endOfWeek(i),a=r;for(;e.isBefore(a,o);)n.push(a),a=e.addDays(a,1);return n.map(n=>e.formatByString(n,t))},Jc=(e,t,n,i)=>{switch(n){case"month":return KV(e,e.date(void 0,t)).map(t=>e.formatByString(t,i));case"weekDay":return Ju(e,i);case"meridiem":{let n=e.date(void 0,t);return[e.startOfDay(n),e.endOfDay(n)].map(t=>e.formatByString(t,i))}default:return[]}},Jh=["0","1","2","3","4","5","6","7","8","9"],Jd=(e,t)=>{if("0"===t[0])return e;let n=[],i="";for(let r=0;r<e.length;r+=1){i+=e[r];let o=t.indexOf(i);o>-1&&(n.push(o.toString()),i="")}return n.join("")},Jf=(e,t)=>"0"===t[0]?e:e.split("").map(e=>t[Number(e)]).join(""),Jp=(e,t)=>{let n=Jd(e,t);return" "!==n&&!Number.isNaN(Number(n))},Jg=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},Jm=(e,t,n,i,r)=>{if("day"===r.type&&"digit-with-letter"===r.contentType){let i=e.setDate(n.longestMonth,t);return e.formatByString(i,r.format)}let o=t.toString();return r.hasLeadingZerosInInput&&(o=Jg(o,r.maxLength)),Jf(o,i)},Jv=(e,t,n)=>{let i=e.value||e.placeholder,r="non-input"===t?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return"non-input"===t&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(i=Number(Jd(i,n)).toString()),["input-rtl","input-ltr"].includes(t)&&"digit"===e.contentType&&!r&&1===i.length&&(i=`${i}\u200e`),"input-rtl"===t&&(i=`\u2068${i}\u2069`),i},Jy=(e,t,n,i)=>e.formatByString(e.parse(t,n),i),Jx=(e,t,n,i)=>{if("digit"!==t)return!1;let r=e.date(void 0,"default");switch(n){case"year":if("dayjs"===e.lib&&"YY"===i)return!0;return e.formatByString(e.setYear(r,1),i).startsWith("0");case"month":return e.formatByString(e.startOfYear(r),i).length>1;case"day":return e.formatByString(e.startOfMonth(r),i).length>1;case"weekDay":return e.formatByString(e.startOfWeek(r),i).length>1;case"hours":return e.formatByString(e.setHours(r,1),i).length>1;case"minutes":return e.formatByString(e.setMinutes(r,1),i).length>1;case"seconds":return e.formatByString(e.setSeconds(r,1),i).length>1;default:throw Error("Invalid section type")}},Jb=(e,t)=>{},Jw={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},JS=(e,t,n,i,r)=>[...n].sort((e,t)=>Jw[e.type]-Jw[t.type]).reduce((n,i)=>!r||i.modified?((e,t,n,i)=>{switch(t.type){case"year":return e.setYear(i,e.getYear(n));case"month":return e.setMonth(i,e.getMonth(n));case"weekDay":{let i=Ju(e,t.format),r=e.formatByString(n,t.format),o=i.indexOf(r),a=i.indexOf(t.value);return e.addDays(n,a-o)}case"day":return e.setDate(i,e.getDate(n));case"meridiem":{let t=12>e.getHours(n),r=e.getHours(i);if(t&&r>=12)return e.addHours(i,-12);if(!t&&r<12)return e.addHours(i,12);return i}case"hours":return e.setHours(i,e.getHours(n));case"minutes":return e.setMinutes(i,e.getMinutes(n));case"seconds":return e.setSeconds(i,e.getSeconds(n));default:return i}})(e,i,t,n):n,i),J_=(e,t)=>{if(null==e)return null;if("all"===e)return"all";if("string"==typeof e){let n=t.findIndex(t=>t.type===e);return -1===n?null:n}return e},JC=["value","referenceDate"],JM={emptyValue:null,getTodayValue:Kj,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,i=(0,q1.A)(e,JC);return null!=t&&i.utils.isValid(t)?t:null!=n?n:(({props:e,utils:t,granularity:n,timezone:i,getTodayDate:r})=>{let o=r?r():Js(t,n,Kj(t,i));null!=e.minDate&&t.isAfterDay(e.minDate,o)&&(o=Js(t,n,e.minDate)),null!=e.maxDate&&t.isBeforeDay(e.maxDate,o)&&(o=Js(t,n,e.maxDate));let a=Qf(e.disableIgnoringDatePartForTimeValidation??!1,t);return null!=e.minTime&&a(e.minTime,o)&&(o=Js(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:KB(t,o,e.minTime))),null!=e.maxTime&&a(o,e.maxTime)&&(o=Js(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:KB(t,o,e.maxTime))),o})(i)},cleanValue:(e,t)=>null!=t&&e.isValid(t)?t:null,areValuesEqual:(e,t,n)=>!(e.isValid(t)||null==t||e.isValid(n))&&null!=n||e.isEqual(t,n),isSameError:(e,t)=>e===t,hasError:e=>null!=e,defaultErrorState:null,getTimezone:(e,t)=>null!=t&&e.isValid(t)?e.getTimezone(t):null,setTimezone:(e,t,n)=>null==n?null:e.setTimezone(n,t)},JA={updateReferenceValue:(e,t,n)=>null!=t&&e.isValid(t)?t:n,getSectionsFromValue:(e,t,n,i)=>!e.isValid(t)&&n?n:i(t),getV7HiddenInputValueFromSections:e=>e.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),getV6InputValueFromSections:(e,t,n)=>{let i=e.map(e=>{let i=Jv(e,n?"input-rtl":"input-ltr",t);return`${e.startSeparator}${i}${e.endSeparator}`}).join("");return n?`\u2066${i}\u2069`:i},getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:e=>e,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:null!=n&&e.isValid(n)?n:t.referenceValue})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},Jk=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],JT=(0,e7.A)(QN,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),JI=(0,e7.A)(QP,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),JD=["hours","minutes"],JO=eI.forwardRef(function(e,t){let n=KL().utils,i=KT({props:e,name:"MuiTimeClock"}),{ampm:r=n.is12HourCycleInCurrentLocale(),ampmInClock:o=!1,autoFocus:a,slots:s,slotProps:l,value:u,defaultValue:c,referenceDate:h,disableIgnoringDatePartForTimeValidation:d=!1,maxTime:f,minTime:p,disableFuture:g,disablePast:m,minutesStep:v=1,shouldDisableTime:y,showViewSwitcher:x,onChange:b,view:w,views:S=JD,openTo:_,onViewChange:C,focusedView:M,onFocusedViewChange:A,className:k,disabled:T,readOnly:I,timezone:D}=i,O=(0,q1.A)(i,Jk),{value:P,handleValueChange:R,timezone:E}=Jo({name:"TimeClock",timezone:D,value:u,defaultValue:c,referenceDate:h,onChange:b,valueManager:JM}),L=(({value:e,referenceDate:t,utils:n,props:i,timezone:r})=>{let o=eI.useMemo(()=>JM.getInitialReferenceValue({value:e,utils:n,props:i,referenceDate:t,granularity:Ja.day,timezone:r,getTodayDate:()=>Kj(n,r,"date")}),[]);return e??o})({value:P,referenceDate:h,utils:n,props:i,timezone:E}),N=KL().localeText,B=KN(E),{view:F,setView:z,previousView:V,nextView:j,setValueAndGoToNextView:H}=QL({view:w,views:S,openTo:_,onViewChange:C,onChange:R,focusedView:M,onFocusedViewChange:A}),{meridiemMode:W,handleMeridiemChange:G}=Qp(L,r,H),$=eI.useCallback((e,t)=>{let i=Qf(d,n),o="hours"===t||"minutes"===t&&S.includes("seconds"),a=({start:e,end:t})=>!(p&&i(p,t)||f&&i(e,f)||g&&i(e,B)||m&&i(B,o?t:e)),s=(e,i=1)=>{if(e%i!=0)return!1;if(y)switch(t){case"hours":return!y(n.setHours(L,e),"hours");case"minutes":return!y(n.setMinutes(L,e),"minutes");case"seconds":return!y(n.setSeconds(L,e),"seconds");default:return!1}return!0};switch(t){case"hours":{let t=Qh(e,W,r),i=n.setHours(L,t);if(n.getHours(i)!==t)return!0;return!a({start:n.setSeconds(n.setMinutes(i,0),0),end:n.setSeconds(n.setMinutes(i,59),59)})||!s(t)}case"minutes":{let t=n.setMinutes(L,e);return!a({start:n.setSeconds(t,0),end:n.setSeconds(t,59)})||!s(e,v)}case"seconds":{let t=n.setSeconds(L,e);return!a({start:t,end:t})||!s(e)}default:throw Error("not supported")}},[r,L,d,f,W,p,v,y,n,g,m,B,S]),U=(0,Q_.A)(),q=eI.useMemo(()=>{switch(F){case"hours":{let e,t=(e,t)=>{let i=Qh(e,W,r);H(n.setHours(L,i),t,"hours")},i=n.getHours(L);return e=r?i>12?[12,23]:[0,11]:[0,23],{onChange:t,viewValue:i,children:(({ampm:e,value:t,getClockNumberText:n,isDisabled:i,selectedId:r,utils:o})=>{let a=t?o.getHours(t):null,s=[],l=+!!e,u=e?12:23,c=t=>null!==a&&(e?12===t?12===a||0===a:a===t||a-12===t:a===t);for(let t=l;t<=u;t+=1){let a=t.toString();0===t&&(a="00");let l=!e&&(0===t||t>12);a=o.formatNumber(a);let u=c(t);s.push((0,eb.jsx)(Jn,{id:u?r:void 0,index:t,inner:l,selected:u,disabled:i(t),label:a,"aria-label":n(a)},t))}return s})({value:P,utils:n,ampm:r,onChange:t,getClockNumberText:N.hoursClockNumberText,isDisabled:e=>T||$(e,"hours"),selectedId:U}),viewRange:e}}case"minutes":{let e=n.getMinutes(L),t=(e,t)=>{H(n.setMinutes(L,e),t,"minutes")};return{viewValue:e,onChange:t,children:Ji({utils:n,value:e,onChange:t,getClockNumberText:N.minutesClockNumberText,isDisabled:e=>T||$(e,"minutes"),selectedId:U}),viewRange:[0,59]}}case"seconds":{let e=n.getSeconds(L),t=(e,t)=>{H(n.setSeconds(L,e),t,"seconds")};return{viewValue:e,onChange:t,children:Ji({utils:n,value:e,onChange:t,getClockNumberText:N.secondsClockNumberText,isDisabled:e=>T||$(e,"seconds"),selectedId:U}),viewRange:[0,59]}}default:throw Error("You must provide the type for ClockView")}},[F,n,P,r,N.hoursClockNumberText,N.minutesClockNumberText,N.secondsClockNumberText,W,H,L,$,U,T]),Y=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],arrowSwitcher:["arrowSwitcher"]},QB,t)})(i);return(0,eb.jsxs)(JT,(0,oc.A)({ref:t,className:(0,uu.A)(Y.root,k),ownerState:i},O,{children:[(0,eb.jsx)(Q8,(0,oc.A)({autoFocus:a??!!M,ampmInClock:o&&S.includes("hours"),value:P,type:F,ampm:r,minutesStep:v,isTimeDisabled:$,meridiemMode:W,handleMeridiemChange:G,selectedId:U,disabled:T,readOnly:I},q)),x&&(0,eb.jsx)(JI,{className:Y.arrowSwitcher,slots:s,slotProps:l,onGoToPrevious:()=>z(V),isPreviousDisabled:!V,previousLabel:N.openPreviousView,onGoToNext:()=>z(j),isNextDisabled:!j,nextLabel:N.openNextView,ownerState:i})]}))}),JP=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:i,views:r,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:C,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:A,timezone:k})=>(0,eb.jsx)(JO,{view:e,onViewChange:t,focusedView:n&&Qc(n)?n:null,onFocusedViewChange:i,views:r.filter(Qc),value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minTime:f,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:S,sx:_,autoFocus:C,showViewSwitcher:M,disableIgnoringDatePartForTimeValidation:A,timezone:k}),JR=({props:e,value:t,timezone:n,adapter:i})=>{if(null===t)return null;let{shouldDisableDate:r,shouldDisableMonth:o,shouldDisableYear:a,disablePast:s,disableFuture:l}=e,u=i.utils.date(void 0,n),c=Kz(i.utils,e.minDate,i.defaultDates.minDate),h=Kz(i.utils,e.maxDate,i.defaultDates.maxDate);switch(!0){case!i.utils.isValid(t):return"invalidDate";case!!(r&&r(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(a&&a(t)):return"shouldDisableYear";case!!(l&&i.utils.isAfterDay(t,u)):return"disableFuture";case!!(s&&i.utils.isBeforeDay(t,u)):return"disablePast";case!!(c&&i.utils.isBeforeDay(t,c)):return"minDate";case!!(h&&i.utils.isAfterDay(t,h)):return"maxDate";default:return null}};JR.valueManager=JM;let JE=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:r,disableFuture:o,disablePast:a,timezone:s})=>{let l=KL();return eI.useCallback(u=>null!==JR({adapter:l,value:u,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:i,maxDate:r,disableFuture:o,disablePast:a}}),[l,e,t,n,i,r,o,a,s])};var JL=n(44394),JN=n(96313);let JB=e=>(0,ub.Ay)("MuiPickersFadeTransitionGroup",e);(0,ux.A)("MuiPickersFadeTransitionGroup",["root"]);let JF=(0,e7.A)(JL.A,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function Jz(e){let t=KT({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,a=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"]},JB,t)})(t),s=(0,uo.A)();return r?n:(0,eb.jsx)(JF,{className:(0,uu.A)(a.root,i),children:(0,eb.jsx)(JN.A,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},o)})}var JV=n(95591);function Jj(e){return(0,ub.Ay)("MuiPickersDay",e)}let JH=(0,ux.A)("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),JW=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],JG=({theme:e})=>(0,oc.A)({},e.typography.caption,{width:36,height:36,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uh.X4)(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,uh.X4)(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${JH.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${JH.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${JH.disabled}:not(.${JH.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${JH.disabled}&.${JH.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:"0 2px"}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${JH.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),J$=(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},JU=(0,e7.A)(ug.A,{name:"MuiPickersDay",slot:"Root",overridesResolver:J$})(JG),Jq=(0,e7.A)("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:J$})(({theme:e})=>(0,oc.A)({},JG({theme:e}),{opacity:0,pointerEvents:"none"})),JY=()=>{},JZ=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:r,day:o,disabled:a=!1,disableHighlightToday:s=!1,disableMargin:l=!1,isAnimating:u,onClick:c,onDaySelect:h,onFocus:d=JY,onBlur:f=JY,onKeyDown:p=JY,onMouseDown:g=JY,onMouseEnter:m=JY,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:w=!1}=n,S=(0,q1.A)(n,JW),_=(0,oc.A)({},n,{autoFocus:i,disabled:a,disableHighlightToday:s,disableMargin:l,selected:y,showDaysOutsideCurrentMonth:x,today:w}),C=(e=>{let{selected:t,disableMargin:n,disableHighlightToday:i,today:r,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e,u=a&&!s;return(0,uc.A)({root:["root",t&&!u&&"selected",o&&"disabled",!n&&"dayWithMargin",!i&&r&&"today",a&&s&&"dayOutsideMonth",u&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},Jj,l)})(_),M=KL().utils,A=eI.useRef(null),k=(0,JV.A)(A,t);return((0,QF.A)(()=>{!i||a||u||v||A.current.focus()},[i,a,u,v]),v&&!x)?(0,eb.jsx)(Jq,{className:(0,uu.A)(C.root,C.hiddenDaySpacingFiller,r),ownerState:_,role:S.role}):(0,eb.jsx)(JU,(0,oc.A)({className:(0,uu.A)(C.root,r),ref:k,centerRipple:!0,disabled:a,tabIndex:y?0:-1,onKeyDown:e=>p(e,o),onFocus:e=>d(e,o),onBlur:e=>f(e,o),onMouseEnter:e=>m(e,o),onClick:e=>{a||h(o),v&&e.currentTarget.focus(),c&&c(e)},onMouseDown:e=>{g(e),v&&e.preventDefault()}},S,{ownerState:_,children:b||M.format(o,"dayOfMonth")}))}),JX=eI.memo(JZ);var JK=n(7490);function JQ(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var JJ=n(64863),J0=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=JQ(e.className,t):e.setAttribute("class",JQ(e.className&&e.className.baseVal||"",t))})},J1=function(e){function t(){for(var t,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.removeClasses(r,"exit"),t.addClass(r,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1];t.addClass(r,o?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],o=i[1]?"appear":"enter";t.removeClasses(r,o),t.addClass(r,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i&&n?n+"-":"",o=i?""+r+e:n[e],a=i?o+"-active":n[e+"Active"],s=i?o+"-done":n[e+"Done"];return{baseClassName:o,activeClassName:a,doneClassName:s}},t}(0,JK.A)(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i,r=this.getClassNames(t)[n+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&o&&(r+=" "+o),"active"===n&&e&&(0,JJ.F)(e),r&&(this.appliedClasses[t][n]=r,i=r,e&&i&&i.split(" ").forEach(function(t){e.classList?e.classList.add(t):(e.classList?t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" "))||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,o=n.done;this.appliedClasses[t]={},i&&J0(e,i),r&&J0(e,r),o&&J0(e,o)},n.render=function(){var e=this.props,t=(e.classNames,(0,q1.A)(e,["classNames"]));return eD().createElement(ms.Ay,(0,oc.A)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(eD().Component);J1.defaultProps={classNames:""},J1.propTypes={};let J2=e=>(0,ub.Ay)("MuiPickersSlideTransition",e),J5=(0,ux.A)("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),J3=["children","className","reduceAnimations","slideDirection","transKey","classes"],J4=(0,e7.A)(JL.A,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${J5["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${J5["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${J5.slideEnterActive}`]:t.slideEnterActive},{[`.${J5.slideExit}`]:t.slideExit},{[`.${J5["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${J5["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{let t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${J5["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${J5["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${J5.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${J5.slideExit}`]:{transform:"translate(0%)"},[`& .${J5["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${J5["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}}),J6=e=>(0,ub.Ay)("MuiDayCalendar",e);(0,ux.A)("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);let J8=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],J9=["ownerState"],J7=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),eee=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),eet=(0,e7.A)(pd.A,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),een=(0,e7.A)(pd.A,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),eei=(0,e7.A)(pd.A,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>(0,oc.A)({},e.typography.caption,{width:36,height:36,padding:0,margin:"0 2px",color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),eer=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:240}),eeo=(0,e7.A)(function(e){let t=KT({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:i,reduceAnimations:r,transKey:o}=t,a=(0,q1.A)(t,J3),s=(e=>{let{classes:t,slideDirection:n}=e,i={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return(0,uc.A)(i,J2,t)})(t),l=(0,uo.A)();if(r)return(0,eb.jsx)("div",{className:(0,uu.A)(s.root,i),children:n});let u={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return(0,eb.jsx)(J4,{className:(0,uu.A)(s.root,i),childFactory:e=>eI.cloneElement(e,{classNames:u}),role:"presentation",children:(0,eb.jsx)(J1,(0,oc.A)({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:u},a,{children:n}),o)})},{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:240}),eea=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),ees=(0,e7.A)("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:"2px 0",display:"flex",justifyContent:"center"});function eel(e){let{parentProps:t,day:n,focusableDay:i,selectedDays:r,isDateDisabled:o,currentMonthNumber:a,isViewFocused:s}=e,l=(0,q1.A)(e,J8),{disabled:u,disableHighlightToday:c,isMonthSwitchingAnimating:h,showDaysOutsideCurrentMonth:d,slots:f,slotProps:p,timezone:g}=t,m=KL().utils,v=KN(g),y=null!==i&&m.isSameDay(n,i),x=r.some(e=>m.isSameDay(e,n)),b=m.isSameDay(n,v),w=f?.day??JX,S=(0,QC.A)({elementType:w,externalSlotProps:p?.day,additionalProps:(0,oc.A)({disableHighlightToday:c,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:h,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:(0,oc.A)({},t,{day:n,selected:x})}),_=(0,q1.A)(S,J9),C=eI.useMemo(()=>u||o(n),[u,o,n]),M=eI.useMemo(()=>m.getMonth(n)!==a,[m,n,a]),A=eI.useMemo(()=>{let e=m.startOfMonth(m.setMonth(n,a));return d?m.isSameDay(n,m.startOfWeek(e)):m.isSameDay(n,e)},[a,n,d,m]),k=eI.useMemo(()=>{let e=m.endOfMonth(m.setMonth(n,a));return d?m.isSameDay(n,m.endOfWeek(e)):m.isSameDay(n,e)},[a,n,d,m]);return(0,eb.jsx)(w,(0,oc.A)({},_,{day:n,disabled:C,autoFocus:s&&y,today:b,outsideCurrentMonth:M,isFirstVisibleCell:A,isLastVisibleCell:k,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function eeu(e){let t,n=KT({props:e,name:"MuiDayCalendar"}),i=KL().utils,{onFocusedDayChange:r,className:o,currentMonth:a,selectedDays:s,focusedDay:l,loading:u,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:h,readOnly:d,reduceAnimations:f,renderLoading:p=()=>(0,eb.jsx)("span",{children:"..."}),slideDirection:g,TransitionProps:m,disablePast:v,disableFuture:y,minDate:x,maxDate:b,shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,dayOfWeekFormatter:C=e=>i.format(e,"weekdayShort").charAt(0).toUpperCase(),hasFocus:M,onFocusedViewChange:A,gridLabelId:k,displayWeekNumber:T,fixedWeekNumber:I,autoFocus:D,timezone:O}=n,P=KN(O),R=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},J6,t)})(n),E=(0,fL.I)(),L=JE({shouldDisableDate:w,shouldDisableMonth:S,shouldDisableYear:_,minDate:x,maxDate:b,disablePast:v,disableFuture:y,timezone:O}),N=KL().localeText,[B,F]=(0,QE.A)({name:"DayCalendar",state:"hasFocus",controlled:M,default:D??!1}),[z,V]=eI.useState(()=>l||P),j=(0,QR.A)(e=>{d||c(e)}),H=e=>{L(e)||(r(e),V(e),A?.(!0),F(!0))},W=(0,QR.A)((e,t)=>{switch(e.key){case"ArrowUp":H(i.addDays(t,-7)),e.preventDefault();break;case"ArrowDown":H(i.addDays(t,7)),e.preventDefault();break;case"ArrowLeft":{let n=i.addDays(t,E?1:-1),r=i.addMonths(t,E?1:-1);H(KF({utils:i,date:n,minDate:E?n:i.startOfMonth(r),maxDate:E?i.endOfMonth(r):n,isDateDisabled:L,timezone:O})||n),e.preventDefault();break}case"ArrowRight":{let n=i.addDays(t,E?-1:1),r=i.addMonths(t,E?-1:1);H(KF({utils:i,date:n,minDate:E?i.startOfMonth(r):n,maxDate:E?n:i.endOfMonth(r),isDateDisabled:L,timezone:O})||n),e.preventDefault();break}case"Home":H(i.startOfWeek(t)),e.preventDefault();break;case"End":H(i.endOfWeek(t)),e.preventDefault();break;case"PageUp":H(i.addMonths(t,1)),e.preventDefault();break;case"PageDown":H(i.addMonths(t,-1)),e.preventDefault()}}),G=(0,QR.A)((e,t)=>H(t)),$=(0,QR.A)((e,t)=>{B&&i.isSameDay(z,t)&&A?.(!1)}),U=i.getMonth(a),q=i.getYear(a),Y=eI.useMemo(()=>s.filter(e=>!!e).map(e=>i.startOfDay(e)),[i,s]),Z=`${q}-${U}`,X=eI.useMemo(()=>eI.createRef(),[Z]),K=eI.useMemo(()=>{let e=i.startOfMonth(a),t=i.endOfMonth(a);return L(z)||i.isAfterDay(z,t)||i.isBeforeDay(z,e)?KF({utils:i,date:z,minDate:e,maxDate:t,disablePast:v,disableFuture:y,isDateDisabled:L,timezone:O}):z},[a,y,v,z,L,i,O]),Q=eI.useMemo(()=>{let e=i.getWeekArray(a),t=i.addMonths(a,1);for(;I&&e.length<I;){let n=i.getWeekArray(t),r=i.isSameDay(e[e.length-1][0],n[0][0]);n.slice(+!!r).forEach(t=>{e.length<I&&e.push(t)}),t=i.addMonths(t,1)}return e},[a,I,i]);return(0,eb.jsxs)(J7,{role:"grid","aria-labelledby":k,className:R.root,children:[(0,eb.jsxs)(eee,{role:"row",className:R.header,children:[T&&(0,eb.jsx)(een,{variant:"caption",role:"columnheader","aria-label":N.calendarWeekNumberHeaderLabel,className:R.weekNumberLabel,children:N.calendarWeekNumberHeaderText}),(t=i.startOfWeek(P),[0,1,2,3,4,5,6].map(e=>i.addDays(t,e))).map((e,t)=>(0,eb.jsx)(eet,{variant:"caption",role:"columnheader","aria-label":i.format(e,"weekday"),className:R.weekDayLabel,children:C(e)},t.toString()))]}),u?(0,eb.jsx)(eer,{className:R.loadingContainer,children:p()}):(0,eb.jsx)(eeo,(0,oc.A)({transKey:Z,onExited:h,reduceAnimations:f,slideDirection:g,className:(0,uu.A)(o,R.slideTransition)},m,{nodeRef:X,children:(0,eb.jsx)(eea,{ref:X,role:"rowgroup",className:R.monthContainer,children:Q.map((e,t)=>(0,eb.jsxs)(ees,{role:"row",className:R.weekContainer,"aria-rowindex":t+1,children:[T&&(0,eb.jsx)(eei,{className:R.weekNumber,role:"rowheader","aria-label":N.calendarWeekNumberAriaLabelText(i.getWeekNumber(e[0])),children:N.calendarWeekNumberText(i.getWeekNumber(e[0]))}),e.map((e,t)=>(0,eb.jsx)(eel,{parentProps:n,day:e,selectedDays:Y,focusableDay:K,onKeyDown:W,onFocus:G,onBlur:$,onDaySelect:j,isDateDisabled:L,currentMonthNumber:U,isViewFocused:B,"aria-colindex":t+1},e.toString()))]},`week-${e[0]}`))})}))]})}function eec(e){return(0,ub.Ay)("MuiPickersMonth",e)}let eeh=(0,ux.A)("MuiPickersMonth",["root","monthButton","disabled","selected"]),eed=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],eef=(0,e7.A)("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),eep=(0,e7.A)("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${eeh.disabled}`]:t.disabled},{[`&.${eeh.selected}`]:t.selected}]})(({theme:e})=>(0,oc.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uh.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uh.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${eeh.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${eeh.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),eeg=eI.memo(function(e){let t=KT({props:e,name:"MuiPickersMonth"}),{autoFocus:n,className:i,children:r,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":f,"aria-label":p,slots:g,slotProps:m}=t,v=(0,q1.A)(t,eed),y=eI.useRef(null),x=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,uc.A)({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},eec,i)})(t);(0,QF.A)(()=>{n&&y.current?.focus()},[n]);let b=g?.monthButton??eep,w=(0,QC.A)({elementType:b,externalSlotProps:m?.monthButton,additionalProps:{children:r,disabled:o,tabIndex:l,ref:y,type:"button",role:"radio","aria-current":f,"aria-checked":a,"aria-label":p,onClick:e=>u(e,s),onKeyDown:e=>c(e,s),onFocus:e=>h(e,s),onBlur:e=>d(e,s)},ownerState:t,className:x.monthButton});return(0,eb.jsx)(eef,(0,oc.A)({className:(0,uu.A)(x.root,i),ownerState:t},v,{children:(0,eb.jsx)(b,(0,oc.A)({},w))}))});function eem(e){return(0,ub.Ay)("MuiMonthCalendar",e)}(0,ux.A)("MuiMonthCalendar",["root"]);let eev=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],eey=(0,e7.A)("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:320,boxSizing:"border-box"}),eex=eI.forwardRef(function(e,t){let n,i,r,o=(n=KL().utils,i=KL().defaultDates,r=KT({props:e,name:"MuiMonthCalendar"}),(0,oc.A)({disableFuture:!1,disablePast:!1},r,{minDate:Kz(n,r.minDate,i.minDate),maxDate:Kz(n,r.maxDate,i.maxDate)})),{className:a,value:s,defaultValue:l,referenceDate:u,disabled:c,disableFuture:h,disablePast:d,maxDate:f,minDate:p,onChange:g,shouldDisableMonth:m,readOnly:v,autoFocus:y=!1,onMonthFocus:x,hasFocus:b,onFocusedViewChange:w,monthsPerRow:S=3,timezone:_,gridLabelId:C,slots:M,slotProps:A}=o,k=(0,q1.A)(o,eev),{value:T,handleValueChange:I,timezone:D}=Jo({name:"MonthCalendar",timezone:_,value:s,defaultValue:l,referenceDate:u,onChange:g,valueManager:JM}),O=KN(D),P=(0,fL.I)(),R=KL().utils,E=eI.useMemo(()=>JM.getInitialReferenceValue({value:T,utils:R,props:o,timezone:D,referenceDate:u,granularity:Ja.month}),[]),L=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"]},eem,t)})(o),N=eI.useMemo(()=>R.getMonth(O),[R,O]),B=eI.useMemo(()=>null!=T?R.getMonth(T):null,[T,R]),[F,z]=eI.useState(()=>B||R.getMonth(E)),[V,j]=(0,QE.A)({name:"MonthCalendar",state:"hasFocus",controlled:b,default:y??!1}),H=(0,QR.A)(e=>{j(e),w&&w(e)}),W=eI.useCallback(e=>{let t=R.startOfMonth(d&&R.isAfter(O,p)?O:p),n=R.startOfMonth(h&&R.isBefore(O,f)?O:f),i=R.startOfMonth(e);return!!(R.isBefore(i,t)||R.isAfter(i,n))||!!m&&m(i)},[h,d,f,p,O,m,R]),G=(0,QR.A)((e,t)=>{v||I(R.setMonth(T??E,t))}),$=(0,QR.A)(e=>{!W(R.setMonth(T??E,e))&&(z(e),H(!0),x&&x(e))});eI.useEffect(()=>{z(e=>null!==B&&e!==B?B:e)},[B]);let U=(0,QR.A)((e,t)=>{switch(e.key){case"ArrowUp":$((12+t-3)%12),e.preventDefault();break;case"ArrowDown":$((12+t+3)%12),e.preventDefault();break;case"ArrowLeft":$((12+t+(P?1:-1))%12),e.preventDefault();break;case"ArrowRight":$((12+t+(P?-1:1))%12),e.preventDefault()}}),q=(0,QR.A)((e,t)=>{$(t)}),Y=(0,QR.A)((e,t)=>{F===t&&H(!1)});return(0,eb.jsx)(eey,(0,oc.A)({ref:t,className:(0,uu.A)(L.root,a),ownerState:o,role:"radiogroup","aria-labelledby":C},k,{children:KV(R,T??E).map(e=>{let t=R.getMonth(e),n=R.format(e,"monthShort"),i=R.format(e,"month"),r=c||W(e);return(0,eb.jsx)(eeg,{selected:t===B,value:t,onClick:G,onKeyDown:U,autoFocus:V&&t===F,disabled:r,tabIndex:t!==F||r?-1:0,onFocus:q,onBlur:Y,"aria-current":N===t?"date":void 0,"aria-label":i,monthsPerRow:S,slots:M,slotProps:A,children:n},n)})}))});function eeb(e){return(0,ub.Ay)("MuiPickersYear",e)}let eew=(0,ux.A)("MuiPickersYear",["root","yearButton","selected","disabled"]),eeS=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],ee_=(0,e7.A)("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),eeC=(0,e7.A)("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${eew.disabled}`]:t.disabled},{[`&.${eew.selected}`]:t.selected}]})(({theme:e})=>(0,oc.A)({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:(0,uh.X4)(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,uh.X4)(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${eew.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${eew.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),eeM=eI.memo(function(e){let t=KT({props:e,name:"MuiPickersYear"}),{autoFocus:n,className:i,children:r,disabled:o,selected:a,value:s,tabIndex:l,onClick:u,onKeyDown:c,onFocus:h,onBlur:d,"aria-current":f,slots:p,slotProps:g}=t,m=(0,q1.A)(t,eeS),v=eI.useRef(null),y=(e=>{let{disabled:t,selected:n,classes:i}=e;return(0,uc.A)({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},eeb,i)})(t);(0,QF.A)(()=>{n&&v.current?.focus()},[n]);let x=p?.yearButton??eeC,b=(0,QC.A)({elementType:x,externalSlotProps:g?.yearButton,additionalProps:{children:r,disabled:o,tabIndex:l,ref:v,type:"button",role:"radio","aria-current":f,"aria-checked":a,onClick:e=>u(e,s),onKeyDown:e=>c(e,s),onFocus:e=>h(e,s),onBlur:e=>d(e,s)},ownerState:t,className:y.yearButton});return(0,eb.jsx)(ee_,(0,oc.A)({className:(0,uu.A)(y.root,i),ownerState:t},m,{children:(0,eb.jsx)(x,(0,oc.A)({},b))}))});function eeA(e){return(0,ub.Ay)("MuiYearCalendar",e)}(0,ux.A)("MuiYearCalendar",["root"]);let eek=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],eeT=(0,e7.A)("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:320,maxHeight:280,boxSizing:"border-box",position:"relative"}),eeI=eI.forwardRef(function(e,t){let n,i,r,o=(n=KL().utils,i=KL().defaultDates,r=KT({props:e,name:"MuiYearCalendar"}),(0,oc.A)({disablePast:!1,disableFuture:!1},r,{yearsPerRow:r.yearsPerRow??3,minDate:Kz(n,r.minDate,i.minDate),maxDate:Kz(n,r.maxDate,i.maxDate)})),{autoFocus:a,className:s,value:l,defaultValue:u,referenceDate:c,disabled:h,disableFuture:d,disablePast:f,maxDate:p,minDate:g,onChange:m,readOnly:v,shouldDisableYear:y,onYearFocus:x,hasFocus:b,onFocusedViewChange:w,yearsOrder:S="asc",yearsPerRow:_,timezone:C,gridLabelId:M,slots:A,slotProps:k}=o,T=(0,q1.A)(o,eek),{value:I,handleValueChange:D,timezone:O}=Jo({name:"YearCalendar",timezone:C,value:l,defaultValue:u,referenceDate:c,onChange:m,valueManager:JM}),P=KN(O),R=(0,fL.I)(),E=KL().utils,L=eI.useMemo(()=>JM.getInitialReferenceValue({value:I,utils:E,props:o,timezone:O,referenceDate:c,granularity:Ja.year}),[]),N=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"]},eeA,t)})(o),B=eI.useMemo(()=>E.getYear(P),[E,P]),F=eI.useMemo(()=>null!=I?E.getYear(I):null,[I,E]),[z,V]=eI.useState(()=>F||E.getYear(L)),[j,H]=(0,QE.A)({name:"YearCalendar",state:"hasFocus",controlled:b,default:a??!1}),W=(0,QR.A)(e=>{H(e),w&&w(e)}),G=eI.useCallback(e=>!!(f&&E.isBeforeYear(e,P)||d&&E.isAfterYear(e,P)||g&&E.isBeforeYear(e,g)||p&&E.isAfterYear(e,p))||!!y&&y(E.startOfYear(e)),[d,f,p,g,P,y,E]),$=(0,QR.A)((e,t)=>{v||D(E.setYear(I??L,t))}),U=(0,QR.A)(e=>{G(E.setYear(I??L,e))||(V(e),W(!0),x?.(e))});eI.useEffect(()=>{V(e=>null!==F&&e!==F?F:e)},[F]);let q="desc"!==S?+_:-1*_,Y=R&&"asc"===S||!R&&"desc"===S?-1:1,Z=(0,QR.A)((e,t)=>{switch(e.key){case"ArrowUp":U(t-q),e.preventDefault();break;case"ArrowDown":U(t+q),e.preventDefault();break;case"ArrowLeft":U(t-Y),e.preventDefault();break;case"ArrowRight":U(t+Y),e.preventDefault()}}),X=(0,QR.A)((e,t)=>{U(t)}),K=(0,QR.A)((e,t)=>{z===t&&W(!1)}),Q=eI.useRef(null),J=(0,JV.A)(t,Q);eI.useEffect(()=>{if(a||null===Q.current)return;let e=Q.current.querySelector('[tabindex="0"]');if(!e)return;let t=e.offsetHeight,n=e.offsetTop,i=Q.current.clientHeight,r=Q.current.scrollTop;t>i||n<r||(Q.current.scrollTop=n+t-i/2-t/2)},[a]);let ee=E.getYearRange([g,p]);return"desc"===S&&ee.reverse(),(0,eb.jsx)(eeT,(0,oc.A)({ref:J,className:(0,uu.A)(N.root,s),ownerState:o,role:"radiogroup","aria-labelledby":M},T,{children:ee.map(e=>{let t=E.getYear(e),n=h||G(e);return(0,eb.jsx)(eeM,{selected:t===F,value:t,onClick:$,onKeyDown:Z,autoFocus:j&&t===z,disabled:n,tabIndex:t!==z||n?-1:0,onFocus:X,onBlur:K,"aria-current":B===t?"date":void 0,yearsPerRow:_,slots:A,slotProps:k,children:E.format(e,"year")},E.format(e,"year"))})}))}),eeD=e=>(0,ub.Ay)("MuiPickersCalendarHeader",e),eeO=(0,ux.A)("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),eeP=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],eeR=["ownerState"],eeE=(0,e7.A)("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),eeL=(0,e7.A)("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>(0,oc.A)({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),eeN=(0,e7.A)("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),eeB=(0,e7.A)(eM.A,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${eeO.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),eeF=(0,e7.A)(KY,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),eez=eI.forwardRef(function(e,t){let n=KL().localeText,i=KL().utils,r=KT({props:e,name:"MuiPickersCalendarHeader"}),{slots:o,slotProps:a,currentMonth:s,disabled:l,disableFuture:u,disablePast:c,maxDate:h,minDate:d,onMonthChange:f,onViewChange:p,view:g,reduceAnimations:m,views:v,labelId:y,className:x,timezone:b,format:w=`${i.formats.month} ${i.formats.year}`}=r,S=(0,q1.A)(r,eeP),_=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},eeD,t)})(r),C=o?.switchViewButton??eeB,M=(0,QC.A)({elementType:C,externalSlotProps:a?.switchViewButton,additionalProps:{size:"small","aria-label":n.calendarViewSwitchingButtonAriaLabel(g)},ownerState:r,className:_.switchViewButton}),A=o?.switchViewIcon??eeF,k=(0,QC.A)({elementType:A,externalSlotProps:a?.switchViewIcon,ownerState:r,className:_.switchViewIcon}),T=(0,q1.A)(k,eeR),I=function(e,{disableFuture:t,maxDate:n,timezone:i}){let r=KL().utils;return eI.useMemo(()=>{let o=r.date(void 0,i),a=r.startOfMonth(t&&r.isBefore(o,n)?o:n);return!r.isAfter(a,e)},[t,n,e,r,i])}(s,{disableFuture:u,maxDate:h,timezone:b}),D=function(e,{disablePast:t,minDate:n,timezone:i}){let r=KL().utils;return eI.useMemo(()=>{let o=r.date(void 0,i),a=r.startOfMonth(t&&r.isAfter(o,n)?o:n);return!r.isBefore(a,e)},[t,n,e,r,i])}(s,{disablePast:c,minDate:d,timezone:b});if(1===v.length&&"year"===v[0])return null;let O=i.formatByString(s,w);return(0,eb.jsxs)(eeE,(0,oc.A)({},S,{ownerState:r,className:(0,uu.A)(_.root,x),ref:t,children:[(0,eb.jsxs)(eeL,{role:"presentation",onClick:()=>{if(1!==v.length&&p&&!l)if(2===v.length)p(v.find(e=>e!==g)||v[0]);else{let e=+(0===v.indexOf(g));p(v[e])}},ownerState:r,"aria-live":"polite",className:_.labelContainer,children:[(0,eb.jsx)(Jz,{reduceAnimations:m,transKey:O,children:(0,eb.jsx)(eeN,{id:y,ownerState:r,className:_.label,children:O})}),v.length>1&&!l&&(0,eb.jsx)(C,(0,oc.A)({},M,{children:(0,eb.jsx)(A,(0,oc.A)({},T))}))]}),(0,eb.jsx)(JN.A,{in:"day"===g,appear:!m,enter:!m,children:(0,eb.jsx)(QP,{slots:o,slotProps:a,onGoToPrevious:()=>f(i.addMonths(s,-1),"right"),isPreviousDisabled:D,previousLabel:n.previousMonth,onGoToNext:()=>f(i.addMonths(s,1),"left"),isNextDisabled:I,nextLabel:n.nextMonth})})]}))}),eeV="u">typeof navigator&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),eej=eeV&&eeV[1]?parseInt(eeV[1],10):null,eeH=eeV&&eeV[2]?parseInt(eeV[2],10):null,eeW=eej&&eej<10||eeH&&eeH<13||!1,eeG=e=>(0,ub.Ay)("MuiDateCalendar",e);(0,ux.A)("MuiDateCalendar",["root","viewTransitionContainer"]);let ee$=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],eeU=(0,e7.A)(QN,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:336}),eeq=(0,e7.A)(Jz,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),eeY=eI.forwardRef(function(e,t){let n,i,r,o,a=KL().utils,s=(0,Q_.A)(),l=(n=KL().utils,i=KL().defaultDates,r=(0,mo.A)("@media (prefers-reduced-motion: reduce)",{defaultMatches:!1})||eeW,o=KT({props:e,name:"MuiDateCalendar"}),(0,oc.A)({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??r,renderLoading:o.renderLoading??(()=>(0,eb.jsx)("span",{children:"..."})),minDate:Kz(n,o.minDate,i.minDate),maxDate:Kz(n,o.maxDate,i.maxDate)})),{autoFocus:u,onViewChange:c,value:h,defaultValue:d,referenceDate:f,disableFuture:p,disablePast:g,onChange:m,onYearChange:v,onMonthChange:y,reduceAnimations:x,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:S,view:_,views:C,openTo:M,className:A,disabled:k,readOnly:T,minDate:I,maxDate:D,disableHighlightToday:O,focusedView:P,onFocusedViewChange:R,showDaysOutsideCurrentMonth:E,fixedWeekNumber:L,dayOfWeekFormatter:N,slots:B,slotProps:F,loading:z,renderLoading:V,displayWeekNumber:j,yearsOrder:H,yearsPerRow:W,monthsPerRow:G,timezone:$}=l,U=(0,q1.A)(l,ee$),{value:q,handleValueChange:Y,timezone:Z}=Jo({name:"DateCalendar",timezone:$,value:h,defaultValue:d,referenceDate:f,onChange:m,valueManager:JM}),{view:X,setView:K,focusedView:Q,setFocusedView:J,goToNextView:ee,setValueAndGoToNextView:et}=QL({view:_,views:C,openTo:M,onChange:Y,onViewChange:c,autoFocus:u,focusedView:P,onFocusedViewChange:R}),{referenceDate:en,calendarState:ei,changeFocusedDay:er,changeMonth:eo,handleChangeMonth:ea,isDateDisabled:es,onMonthSwitchingAnimationEnd:el}=(e=>{let t,{value:n,referenceDate:i,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:a=!1,maxDate:s,minDate:l,onMonthChange:u,reduceAnimations:c,shouldDisableDate:h,timezone:d}=e,f=KL().utils,p=eI.useRef((t=!!c,(e,n)=>{switch(n.type){case"changeMonth":return(0,oc.A)({},e,{slideDirection:n.direction,currentMonth:n.newMonth,isMonthSwitchingAnimating:!t});case"changeMonthTimezone":{let t=n.newTimezone;if(f.getTimezone(e.currentMonth)===t)return e;let i=f.setTimezone(e.currentMonth,t);return f.getMonth(i)!==f.getMonth(e.currentMonth)&&(i=f.setMonth(i,f.getMonth(e.currentMonth))),(0,oc.A)({},e,{currentMonth:i})}case"finishMonthSwitchingAnimation":return(0,oc.A)({},e,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(null!=e.focusedDay&&null!=n.focusedDay&&f.isSameDay(n.focusedDay,e.focusedDay))return e;let i=null!=n.focusedDay&&!a&&!f.isSameMonth(e.currentMonth,n.focusedDay);return(0,oc.A)({},e,{focusedDay:n.focusedDay,isMonthSwitchingAnimating:i&&!t&&!n.withoutMonthSwitchingAnimation,currentMonth:i?f.startOfMonth(n.focusedDay):e.currentMonth,slideDirection:null!=n.focusedDay&&f.isAfterDay(n.focusedDay,e.currentMonth)?"left":"right"})}default:throw Error("missing support")}})).current,g=eI.useMemo(()=>JM.getInitialReferenceValue({value:n,utils:f,timezone:d,props:e,referenceDate:i,granularity:Ja.day}),[i,d]),[m,v]=eI.useReducer(p,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:f.startOfMonth(g),slideDirection:"left"});eI.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:f.getTimezone(g)})},[g,f]);let y=eI.useCallback(e=>{v((0,oc.A)({type:"changeMonth"},e)),u&&u(e.newMonth)},[u]),x=eI.useCallback(e=>{f.isSameMonth(e,m.currentMonth)||y({newMonth:f.startOfMonth(e),direction:f.isAfterDay(e,m.currentMonth)?"left":"right"})},[m.currentMonth,y,f]),b=JE({shouldDisableDate:h,minDate:l,maxDate:s,disableFuture:r,disablePast:o,timezone:d}),w=eI.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]);return{referenceDate:g,calendarState:m,changeMonth:x,changeFocusedDay:(0,QR.A)((e,t)=>{b(e)||v({type:"changeFocusedDay",focusedDay:e,withoutMonthSwitchingAnimation:t})}),isDateDisabled:b,onMonthSwitchingAnimationEnd:w,handleChangeMonth:y}})({value:q,referenceDate:f,reduceAnimations:x,onMonthChange:y,minDate:I,maxDate:D,shouldDisableDate:b,disablePast:g,disableFuture:p,timezone:Z}),eu=k&&q||I,ec=k&&q||D,eh=`${s}-grid-label`,ed=null!==Q,ef=B?.calendarHeader??eez,ep=(0,QC.A)({elementType:ef,externalSlotProps:F?.calendarHeader,additionalProps:{views:C,view:X,currentMonth:ei.currentMonth,onViewChange:K,onMonthChange:(e,t)=>ea({newMonth:e,direction:t}),minDate:eu,maxDate:ec,disabled:k,disablePast:g,disableFuture:p,reduceAnimations:x,timezone:Z,labelId:eh},ownerState:l}),eg=(0,QR.A)(e=>{let t=a.startOfMonth(e),n=a.endOfMonth(e),i=es(e)?KF({utils:a,date:e,minDate:a.isBefore(I,t)?t:I,maxDate:a.isAfter(D,n)?n:D,disablePast:g,disableFuture:p,isDateDisabled:es,timezone:Z}):e;i?(et(i,"finish"),y?.(t)):(ee(),eo(t)),er(i,!0)}),em=(0,QR.A)(e=>{let t=a.startOfYear(e),n=a.endOfYear(e),i=es(e)?KF({utils:a,date:e,minDate:a.isBefore(I,t)?t:I,maxDate:a.isAfter(D,n)?n:D,disablePast:g,disableFuture:p,isDateDisabled:es,timezone:Z}):e;i?(et(i,"finish"),v?.(i)):(ee(),eo(t)),er(i,!0)}),ev=(0,QR.A)(e=>e?Y(KB(a,e,q??en),"finish",X):Y(e,"finish",X));eI.useEffect(()=>{null!=q&&a.isValid(q)&&eo(q)},[q]);let ey=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},eeG,t)})(l),ex={disablePast:g,disableFuture:p,maxDate:D,minDate:I},ew={disableHighlightToday:O,readOnly:T,disabled:k,timezone:Z,gridLabelId:eh,slots:B,slotProps:F},eS=eI.useRef(X);eI.useEffect(()=>{eS.current!==X&&(Q===eS.current&&J(X,!0),eS.current=X)},[Q,J,X]);let e_=eI.useMemo(()=>[q],[q]);return(0,eb.jsxs)(eeU,(0,oc.A)({ref:t,className:(0,uu.A)(ey.root,A),ownerState:l},U,{children:[(0,eb.jsx)(ef,(0,oc.A)({},ep,{slots:B,slotProps:F})),(0,eb.jsx)(eeq,{reduceAnimations:x,className:ey.viewTransitionContainer,transKey:X,ownerState:l,children:(0,eb.jsxs)("div",{children:["year"===X&&(0,eb.jsx)(eeI,(0,oc.A)({},ex,ew,{value:q,onChange:em,shouldDisableYear:S,hasFocus:ed,onFocusedViewChange:e=>J("year",e),yearsOrder:H,yearsPerRow:W,referenceDate:en})),"month"===X&&(0,eb.jsx)(eex,(0,oc.A)({},ex,ew,{hasFocus:ed,className:A,value:q,onChange:eg,shouldDisableMonth:w,onFocusedViewChange:e=>J("month",e),monthsPerRow:G,referenceDate:en})),"day"===X&&(0,eb.jsx)(eeu,(0,oc.A)({},ei,ex,ew,{onMonthSwitchingAnimationEnd:el,onFocusedDayChange:er,reduceAnimations:x,selectedDays:e_,onSelectedDaysChange:ev,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:S,hasFocus:ed,onFocusedViewChange:e=>J("day",e),showDaysOutsideCurrentMonth:E,fixedWeekNumber:L,dayOfWeekFormatter:N,displayWeekNumber:j,loading:z,renderLoading:V}))]})})]}))}),eeZ=({view:e,onViewChange:t,views:n,focusedView:i,onFocusedViewChange:r,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minDate:f,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:S,yearsPerRow:_,slots:C,slotProps:M,loading:A,renderLoading:k,disableHighlightToday:T,readOnly:I,disabled:D,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:P,sx:R,autoFocus:E,fixedWeekNumber:L,displayWeekNumber:N,timezone:B})=>(0,eb.jsx)(eeY,{view:e,onViewChange:t,views:n.filter(KG),focusedView:i&&KG(i)?i:null,onFocusedViewChange:r,value:o,defaultValue:a,referenceDate:s,onChange:l,className:u,classes:c,disableFuture:h,disablePast:d,minDate:f,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:S,yearsPerRow:_,slots:C,slotProps:M,loading:A,renderLoading:k,disableHighlightToday:T,readOnly:I,disabled:D,showDaysOutsideCurrentMonth:O,dayOfWeekFormatter:P,sx:R,autoFocus:E,fixedWeekNumber:L,displayWeekNumber:N,timezone:B});function eeX(e){let{props:t,validator:n,value:i,timezone:r,onError:o}=e,a=KL(),s=eI.useRef(n.valueManager.defaultErrorState),l=n({adapter:a,value:i,timezone:r,props:t}),u=n.valueManager.hasError(l);return eI.useEffect(()=>{o&&!n.valueManager.isSameError(l,s.current)&&o(l,i),s.current=l},[n,o,l,i]),{validationError:l,hasValidationError:u,getValidationErrorForNewValue:(0,QR.A)(e=>n({adapter:a,value:e,timezone:r,props:t}))}}let eeK=["className","sx"],eeQ=(e=document)=>{let t=e.activeElement;return t?t.shadowRoot?eeQ(t.shadowRoot):t:null};function eeJ(){return"u"<typeof window?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?90===Math.abs(window.screen.orientation.angle)?"landscape":"portrait":window.orientation&&90===Math.abs(Number(window.orientation))?"landscape":"portrait"}function ee0(e){return(0,ub.Ay)("MuiPickersLayout",e)}let ee1=(0,ux.A)("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),ee2=["onAccept","onClear","onCancel","onSetToday","actions"];function ee5(e){let{onAccept:t,onClear:n,onCancel:i,onSetToday:r,actions:o}=e,a=(0,q1.A)(e,ee2),s=KL().localeText;if(null==o||0===o.length)return null;let l=o?.map(e=>{switch(e){case"clear":return(0,eb.jsx)(eS.A,{onClick:n,children:s.clearButtonLabel},e);case"cancel":return(0,eb.jsx)(eS.A,{onClick:i,children:s.cancelButtonLabel},e);case"accept":return(0,eb.jsx)(eS.A,{onClick:t,children:s.okButtonLabel},e);case"today":return(0,eb.jsx)(eS.A,{onClick:r,children:s.todayButtonLabel},e);default:return null}});return(0,eb.jsx)(pK.A,(0,oc.A)({},a,{children:l}))}var ee3=n(76477),ee4=n(79223),ee6=n(6835);function ee8(e){return(0,ub.Ay)("MuiListItem",e)}function ee9(e){return(0,ub.Ay)("MuiListItemSecondaryAction",e)}(0,ux.A)("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]),(0,ux.A)("MuiListItemSecondaryAction",["root","disableGutters"]);let ee7=(0,e7.A)("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),ete=eI.forwardRef(function(e,t){let n=(0,uf.b)({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...r}=n,o=eI.useContext(uy.A),a={...n,disableGutters:o.disableGutters},s=(e=>{let{disableGutters:t,classes:n}=e;return(0,uc.A)({root:["root",t&&"disableGutters"]},ee9,n)})(a);return(0,eb.jsx)(ee7,{className:(0,uu.A)(s.root,i),ownerState:a,ref:t,...r})});ete.muiName="ListItemSecondaryAction";let ett=(0,e7.A)("div",{name:"MuiListItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]}})((0,ud.A)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${uS.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),etn=(0,e7.A)("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),eti=eI.forwardRef(function(e,t){let n=(0,uf.b)({props:e,name:"MuiListItem"}),{alignItems:i="center",children:r,className:o,component:a,components:s={},componentsProps:l={},ContainerComponent:u="li",ContainerProps:{className:c,...h}={},dense:d=!1,disableGutters:f=!1,disablePadding:p=!1,divider:g=!1,secondaryAction:m,slotProps:v={},slots:y={},...x}=n,b=eI.useContext(uy.A),w=eI.useMemo(()=>({dense:d||b.dense||!1,alignItems:i,disableGutters:f}),[i,b.dense,d,f]),S=eI.useRef(null),_=eI.Children.toArray(r),C=_.length&&(0,ee6.A)(_[_.length-1],["ListItemSecondaryAction"]),M={...n,alignItems:i,dense:w.dense,disableGutters:f,disablePadding:p,divider:g,hasSecondaryAction:C},A=(e=>{let{alignItems:t,classes:n,dense:i,disableGutters:r,disablePadding:o,divider:a,hasSecondaryAction:s}=e;return(0,uc.A)({root:["root",i&&"dense",!r&&"gutters",!o&&"padding",a&&"divider","flex-start"===t&&"alignItemsFlexStart",s&&"secondaryAction"],container:["container"]},ee8,n)})(M),k=(0,uv.A)(S,t),T=y.root||s.Root||ett,I=v.root||l.root||{},D={className:(0,uu.A)(A.root,I.className,o),...x},O=a||"li";return C?(O=D.component||a?O:"div","li"===u&&("li"===O?O="div":"li"===D.component&&(D.component="div")),(0,eb.jsx)(uy.A.Provider,{value:w,children:(0,eb.jsxs)(etn,{as:u,className:(0,uu.A)(A.container,c),ref:k,ownerState:M,...h,children:[(0,eb.jsx)(T,{...I,...!(0,ee4.A)(T)&&{as:O,ownerState:{...M,...I.ownerState}},...D,children:_}),_.pop()]})})):(0,eb.jsx)(uy.A.Provider,{value:w,children:(0,eb.jsxs)(T,{...I,as:O,ref:k,...!(0,ee4.A)(T)&&{ownerState:{...M,...I.ownerState}},...D,children:[_,m&&(0,eb.jsx)(ete,{children:m})]})})});var etr=n(47601);let eto=["items","changeImportance","isLandscape","onChange","isValid"],eta=["getValue"];function ets(e){let{items:t,changeImportance:n="accept",onChange:i,isValid:r}=e,o=(0,q1.A)(e,eto);if(null==t||0===t.length)return null;let a=t.map(e=>{let{getValue:t}=e,o=(0,q1.A)(e,eta),a=t({isValid:r});return(0,oc.A)({},o,{label:o.label,onClick:()=>{i(a,n,o)},disabled:!r(a)})});return(0,eb.jsx)(ee3.A,(0,oc.A)({dense:!0,sx:[{maxHeight:336,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:a.map(e=>(0,eb.jsx)(eti,{children:(0,eb.jsx)(etr.A,(0,oc.A)({},e))},e.id??e.label))}))}let etl=(0,e7.A)("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${ee1.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${ee1.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${ee1.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${ee1.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${ee1.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${ee1.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${ee1.shortcuts}`]:{gridColumn:3}}}]}),etu=(0,e7.A)("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),etc=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:r,tabs:o,actionBar:a,shortcuts:s}=(e=>{let{wrapperVariant:t,onAccept:n,onClear:i,onCancel:r,onSetToday:o,view:a,views:s,onViewChange:l,value:u,onChange:c,onSelectShortcut:h,isValid:d,isLandscape:f,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=e,x=(e=>{let{classes:t,isLandscape:n}=e;return(0,uc.A)({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},ee0,t)})(e),b=v?.actionBar??ee5,w=(0,QC.A)({elementType:b,externalSlotProps:y?.actionBar,additionalProps:{onAccept:n,onClear:i,onCancel:r,onSetToday:o,actions:"desktop"===t?[]:["cancel","accept"]},className:x.actionBar,ownerState:(0,oc.A)({},e,{wrapperVariant:t})}),S=(0,eb.jsx)(b,(0,oc.A)({},w)),_=v?.toolbar,C=(0,QC.A)({elementType:_,externalSlotProps:y?.toolbar,additionalProps:{isLandscape:f,onChange:c,value:u,view:a,onViewChange:l,views:s,disabled:p,readOnly:g},className:x.toolbar,ownerState:(0,oc.A)({},e,{wrapperVariant:t})}),M=null!==C.view&&_?(0,eb.jsx)(_,(0,oc.A)({},C)):null,A=v?.tabs,k=a&&A?(0,eb.jsx)(A,(0,oc.A)({view:a,onViewChange:l,className:x.tabs},y?.tabs)):null,T=v?.shortcuts??ets,I=(0,QC.A)({elementType:T,externalSlotProps:y?.shortcuts,additionalProps:{isValid:d,isLandscape:f,onChange:h},className:x.shortcuts,ownerState:{isValid:d,isLandscape:f,onChange:h,wrapperVariant:t}});return{toolbar:M,content:m,tabs:k,actionBar:S,shortcuts:a&&T?(0,eb.jsx)(T,(0,oc.A)({},I)):null}})(n),{sx:l,className:u,isLandscape:c,wrapperVariant:h}=n,d=(e=>{let{isLandscape:t,classes:n}=e;return(0,uc.A)({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},ee0,n)})(n);return(0,eb.jsxs)(etl,{ref:t,sx:l,className:(0,uu.A)(d.root,u),ownerState:n,children:[c?s:i,c?i:s,(0,eb.jsx)(etu,{className:d.contentWrapper,children:"desktop"===h?(0,eb.jsxs)(eI.Fragment,{children:[r,o]}):(0,eb.jsxs)(eI.Fragment,{children:[o,r]})}),a]})}),eth=["props","ref"],etd=(0,e7.A)(etc)(({theme:e})=>({overflow:"hidden",minWidth:320,backgroundColor:(e.vars||e).palette.background.paper})),etf=({adapter:e,value:t,timezone:n,props:i})=>{if(null===t)return null;let{minTime:r,maxTime:o,minutesStep:a,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:u,disableFuture:c}=i,h=e.utils.date(void 0,n),d=Qf(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(r&&d(r,t)):return"minTime";case!!(o&&d(t,o)):return"maxTime";case!!(c&&e.utils.isAfter(t,h)):return"disableFuture";case!!(u&&e.utils.isBefore(t,h)):return"disablePast";case!!(s&&s(t,"hours")):return"shouldDisableTime-hours";case!!(s&&s(t,"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(t,"seconds")):return"shouldDisableTime-seconds";case!!(a&&e.utils.getMinutes(t)%a!=0):return"minutesStep";default:return null}};etf.valueManager=JM;let etp=({adapter:e,value:t,timezone:n,props:i})=>{let r=JR({adapter:e,value:t,timezone:n,props:i});return null!==r?r:etf({adapter:e,value:t,timezone:n,props:i})};etp.valueManager=JM;let etg=eI.forwardRef(function(e,t){let n,i,r,o,a,s=(n=KL().utils,i=KL().defaultDates,o=(r=KT({props:e,name:"MuiStaticDateTimePicker"})).ampm??n.is12HourCycleInCurrentLocale(),a=eI.useMemo(()=>r.localeText?.toolbarTitle==null?r.localeText:(0,oc.A)({},r.localeText,{dateTimePickerToolbarTitle:r.localeText.toolbarTitle}),[r.localeText]),(0,oc.A)({},r,(({openTo:e,defaultOpenTo:t,views:n,defaultViews:i})=>{let r,o=n??i;if(null!=e)r=e;else if(o.includes(t))r=t;else if(o.length>0)r=o[0];else throw Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:r}})({views:r.views,openTo:r.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:a,orientation:r.orientation??"portrait",disableIgnoringDatePartForTimeValidation:r.disableIgnoringDatePartForTimeValidation??!!(r.minDateTime||r.maxDateTime||r.disablePast||r.disableFuture),disableFuture:r.disableFuture??!1,disablePast:r.disablePast??!1,minDate:Kz(n,r.minDateTime??r.minDate,i.minDate),maxDate:Kz(n,r.maxDateTime??r.maxDate,i.maxDate),minTime:r.minDateTime??r.minTime,maxTime:r.maxDateTime??r.maxTime,slots:(0,oc.A)({toolbar:QS,tabs:K2},r.slots),slotProps:(0,oc.A)({},r.slotProps,{toolbar:(0,oc.A)({ampm:o},r.slotProps?.toolbar)})})),l=s.displayStaticWrapperAs??"mobile",u=s.ampmInClock??"desktop"===l,c=(0,oc.A)({day:eeZ,month:eeZ,year:eeZ,hours:JP,minutes:JP,seconds:JP},s.viewRenderers),{renderPicker:h}=(e=>{let{props:t,ref:n}=e,i=(0,q1.A)(e,eth),{localeText:r,slots:o,slotProps:a,className:s,sx:l,displayStaticWrapperAs:u,autoFocus:c}=t,{layoutProps:h,renderCurrentView:d}=(({props:e,valueManager:t,valueType:n,wrapperVariant:i,additionalViewProps:r,validator:o,autoFocusView:a,rendererInterceptor:s,fieldRef:l})=>{let u=(({props:e,valueManager:t,valueType:n,wrapperVariant:i,validator:r})=>{let{onAccept:o,onChange:a,value:s,defaultValue:l,closeOnSelect:u="desktop"===i,timezone:c,referenceDate:h}=e,{current:d}=eI.useRef(l),{current:f}=eI.useRef(void 0!==s),[p,g]=eI.useState(c),m=KL().utils,v=KL(),{isOpen:y,setIsOpen:x}=(({open:e,onOpen:t,onClose:n})=>{let i=eI.useRef("boolean"==typeof e).current,[r,o]=eI.useState(!1);return eI.useEffect(()=>{if(i){if("boolean"!=typeof e)throw Error("You must not mix controlling and uncontrolled mode for `open` prop");o(e)}},[i,e]),{isOpen:r,setIsOpen:eI.useCallback(e=>{i||o(e),e&&t&&t(),!e&&n&&n()},[i,t,n])}})(e),{timezone:b,value:w,handleValueChange:S}=Jr({timezone:c,value:s,defaultValue:d,referenceDate:h,onChange:a,valueManager:t}),[_,C]=eI.useState(()=>{let e;return{draft:e=void 0!==w?w:void 0!==d?d:t.emptyValue,lastPublishedValue:e,lastCommittedValue:e,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),M=t.getTimezone(m,_.draft);p!==c&&(g(c),c&&M&&c!==M&&C(e=>(0,oc.A)({},e,{draft:t.setTimezone(m,c,e.draft)})));let{getValidationErrorForNewValue:A}=eeX({props:e,validator:r,timezone:b,value:_.draft,onError:e.onError}),k=(0,QR.A)(e=>{let n={action:e,dateState:_,hasChanged:n=>!t.areValuesEqual(m,e.value,n),isControlled:f,closeOnSelect:u},i=(e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r}=e,o=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromField"===t.name||("setValueFromAction"===t.name?!!(o&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastPublishedValue):("setValueFromView"===t.name&&"shallow"!==t.selectionState||"setValueFromShortcut"===t.name)&&(!!o||n(i.lastPublishedValue)))})(n),r=(e=>{let{action:t,hasChanged:n,dateState:i,isControlled:r,closeOnSelect:o}=e,a=!r&&!i.hasBeenModifiedSinceMount;return"setValueFromAction"===t.name?!!(a&&["accept","today","clear"].includes(t.pickerAction))||n(i.lastCommittedValue):"setValueFromView"===t.name&&"finish"===t.selectionState&&o?!!a||n(i.lastCommittedValue):"setValueFromShortcut"===t.name&&"accept"===t.changeImportance&&n(i.lastCommittedValue)})(n),a=(e=>{let{action:t,closeOnSelect:n}=e;return"setValueFromAction"===t.name||("setValueFromView"===t.name?"finish"===t.selectionState&&n:"setValueFromShortcut"===t.name&&"accept"===t.changeImportance)})(n);C(t=>(0,oc.A)({},t,{draft:e.value,lastPublishedValue:i?e.value:t.lastPublishedValue,lastCommittedValue:r?e.value:t.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let s=null,l=()=>(s||(s={validationError:"setValueFromField"===e.name?e.context.validationError:A(e.value)},"setValueFromShortcut"===e.name&&(s.shortcut=e.shortcut)),s);i&&S(e.value,l()),r&&o&&o(e.value,l()),a&&x(!1)});if(_.lastControlledValue!==s){let e=t.areValuesEqual(m,_.draft,w);C(t=>(0,oc.A)({},t,{lastControlledValue:s},e?{}:{lastCommittedValue:w,lastPublishedValue:w,draft:w,hasBeenModifiedSinceMount:!0}))}let T=(0,QR.A)(()=>{k({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),I=(0,QR.A)(()=>{k({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),D=(0,QR.A)(()=>{k({value:_.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),O=(0,QR.A)(()=>{k({value:_.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),P=(0,QR.A)(()=>{k({value:t.getTodayValue(m,b,n),name:"setValueFromAction",pickerAction:"today"})}),R=(0,QR.A)(e=>{e.preventDefault(),x(!0)}),E=(0,QR.A)(e=>{e?.preventDefault(),x(!1)}),L=(0,QR.A)((e,t="partial")=>k({name:"setValueFromView",value:e,selectionState:t})),N=(0,QR.A)((e,t,n)=>k({name:"setValueFromShortcut",value:e,changeImportance:t,shortcut:n})),B=(0,QR.A)((e,t)=>k({name:"setValueFromField",value:e,context:t})),F={onClear:T,onAccept:I,onDismiss:D,onCancel:O,onSetToday:P,onOpen:R,onClose:E},z={value:_.draft,onChange:B},V=eI.useMemo(()=>t.cleanValue(m,_.draft),[m,t,_.draft]),j=(0,oc.A)({},F,{value:V,onChange:L,onSelectShortcut:N,isValid:n=>{let i=r({adapter:v,value:n,timezone:b,props:e});return!t.hasError(i)}}),H=eI.useMemo(()=>({onOpen:R,onClose:E,open:y}),[y,E,R]);return{open:y,fieldProps:z,viewProps:{value:V,onChange:L,onClose:E,open:y},layoutProps:j,actions:F,contextValue:H}})({props:e,valueManager:t,valueType:n,wrapperVariant:i,validator:o}),c=(({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:i,rendererInterceptor:r,fieldRef:o})=>{let{onChange:a,open:s,onClose:l}=t,{view:u,views:c,openTo:h,onViewChange:d,viewRenderers:f,timezone:p}=e,g=(0,q1.A)(e,eeK),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=QL({view:u,views:c,openTo:h,onChange:a,onViewChange:d,autoFocus:i}),{hasUIView:S,viewModeLookup:_}=eI.useMemo(()=>c.reduce((e,t)=>{let n;return n=null!=f[t]?"UI":"field",e.viewModeLookup[t]=n,"UI"===n&&(e.hasUIView=!0),e},{hasUIView:!1,viewModeLookup:{}}),[f,c]),C=eI.useMemo(()=>c.reduce((e,t)=>null!=f[t]&&Qc(t)?e+1:e,0),[f,c]),M=_[m],A=(0,QR.A)(()=>"UI"===M),[k,T]=eI.useState("UI"===M?m:null);return k!==m&&"UI"===_[m]&&T(m),(0,QF.A)(()=>{"field"===M&&s&&(l(),setTimeout(()=>{o?.current?.setSelectedSections(m),o?.current?.focusField(m)}))},[m]),(0,QF.A)(()=>{if(!s)return;let e=m;"field"===M&&null!=k&&(e=k),e!==y&&"UI"===_[e]&&"UI"===_[y]&&(e=y),e!==m&&v(e),b(e,!0)},[s]),{hasUIView:S,shouldRestoreFocus:A,layoutProps:{views:c,view:k,onViewChange:v},renderCurrentView:()=>{if(null==k)return null;let e=f[k];if(null==e)return null;let i=(0,oc.A)({},g,n,t,{views:c,timezone:p,onChange:w,view:k,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:C>1,timeViewsCount:C});return r?r(f,k,i):e(i)}}})({props:e,additionalViewProps:r,autoFocusView:a,fieldRef:l,propsFromPickerValue:u.viewProps,rendererInterceptor:s}),h=(({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:i})=>{let{orientation:r}=e,o=((e,t)=>{var n;let[i,r]=eI.useState(eeJ);return(0,QF.A)(()=>{let e=()=>{r(eeJ())};return window.addEventListener("orientationchange",e),()=>{window.removeEventListener("orientationchange",e)}},[]),(Array.isArray(n=["hours","minutes","seconds"])?!n.every(t=>-1!==e.indexOf(t)):-1===e.indexOf(n))&&"landscape"===(t||i)})(n.views,r),a=(0,fL.I)();return{layoutProps:(0,oc.A)({},n,t,{isLandscape:o,isRtl:a,wrapperVariant:i,disabled:e.disabled,readOnly:e.readOnly})}})({props:e,wrapperVariant:i,propsFromPickerValue:u.layoutProps,propsFromPickerViews:c.layoutProps}),d=function(e){let{props:t,pickerValueResponse:n}=e;return eI.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}({props:e,pickerValueResponse:u});return{open:u.open,actions:u.actions,fieldProps:u.fieldProps,renderCurrentView:c.renderCurrentView,hasUIView:c.hasUIView,shouldRestoreFocus:c.shouldRestoreFocus,layoutProps:h.layoutProps,contextValue:u.contextValue,ownerState:d}})((0,oc.A)({},i,{props:t,autoFocusView:c??!1,additionalViewProps:{},wrapperVariant:u})),f=o?.layout??etd;return{renderPicker:()=>(0,eb.jsx)(KO,{localeText:r,children:(0,eb.jsx)(f,(0,oc.A)({},h,a?.layout,{slots:o,slotProps:a,sx:[...Array.isArray(l)?l:[l],...Array.isArray(a?.layout?.sx)?a.layout.sx:[a?.layout?.sx]],className:(0,uu.A)(s,a?.layout?.className),ref:n,children:d()}))})}})({props:(0,oc.A)({},s,{viewRenderers:c,displayStaticWrapperAs:l,ampmInClock:u,yearsPerRow:s.yearsPerRow??("mobile"===l?3:4),slotProps:(0,oc.A)({},s.slotProps,{tabs:(0,oc.A)({hidden:"desktop"===l},s.slotProps?.tabs),toolbar:(0,oc.A)({hidden:"desktop"===l,ampmInClock:u},s.slotProps?.toolbar)})}),valueManager:JM,valueType:"date-time",validator:etp,ref:t});return h()});etg.propTypes={ampm:KR().bool,ampmInClock:KR().bool,autoFocus:KR().bool,className:KR().string,dayOfWeekFormatter:KR().func,defaultValue:KR().object,disabled:KR().bool,disableFuture:KR().bool,disableHighlightToday:KR().bool,disableIgnoringDatePartForTimeValidation:KR().bool,disablePast:KR().bool,displayStaticWrapperAs:KR().oneOf(["desktop","mobile"]),displayWeekNumber:KR().bool,fixedWeekNumber:KR().number,loading:KR().bool,localeText:KR().object,maxDate:KR().object,maxDateTime:KR().object,maxTime:KR().object,minDate:KR().object,minDateTime:KR().object,minTime:KR().object,minutesStep:KR().number,monthsPerRow:KR().oneOf([3,4]),onAccept:KR().func,onChange:KR().func,onClose:KR().func,onError:KR().func,onMonthChange:KR().func,onViewChange:KR().func,onYearChange:KR().func,openTo:KR().oneOf(["day","hours","minutes","month","seconds","year"]),orientation:KR().oneOf(["landscape","portrait"]),readOnly:KR().bool,reduceAnimations:KR().bool,referenceDate:KR().object,renderLoading:KR().func,shouldDisableDate:KR().func,shouldDisableMonth:KR().func,shouldDisableTime:KR().func,shouldDisableYear:KR().func,showDaysOutsideCurrentMonth:KR().bool,slotProps:KR().object,slots:KR().object,sx:KR().oneOfType([KR().arrayOf(KR().oneOfType([KR().func,KR().object,KR().bool])),KR().func,KR().object]),timezone:KR().string,value:KR().object,view:KR().oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:KR().shape({day:KR().func,hours:KR().func,minutes:KR().func,month:KR().func,seconds:KR().func,year:KR().func}),views:KR().arrayOf(KR().oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:KR().oneOf(["asc","desc"]),yearsPerRow:KR().oneOf([3,4])};let etm=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:i,localizedDigits:r,now:o,token:a,startSeparator:s})=>{if(""===a)throw Error("MUI X: Should not call `commitToken` with an empty token");let l=Jl(e,a),u=Jx(e,l.contentType,l.type,a),c=n?u:"digit"===l.contentType,h=null!=t&&e.isValid(t),d=h?e.formatByString(t,a):"",f=null;if(c)if(u)f=""===d?e.formatByString(o,a).length:d.length;else{if(null==l.maxLength)throw Error(`MUI X: The token ${a} should have a 'maxDigitNumber' property on it's adapter`);f=l.maxLength,h&&(d=Jf(Jg(Jd(d,r),f),r))}return(0,oc.A)({},l,{format:a,maxLength:f,value:d,placeholder:((e,t,n,i)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),i).length,format:i});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:i});case"day":return t.fieldDayPlaceholder({format:i});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:i});case"hours":return t.fieldHoursPlaceholder({format:i});case"minutes":return t.fieldMinutesPlaceholder({format:i});case"seconds":return t.fieldSecondsPlaceholder({format:i});case"meridiem":return t.fieldMeridiemPlaceholder({format:i});default:return i}})(e,i,l,a),hasLeadingZerosInFormat:u,hasLeadingZerosInInput:c,startSeparator:s,endSeparator:"",modified:!1})},etv=e=>{let t=(({utils:e,format:t})=>{let n=10,i=t,r=e.expandFormat(t);for(;r!==i;)if(i=r,r=e.expandFormat(i),(n-=1)<0)throw Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return r})(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));let n=(({utils:e,expandedFormat:t})=>{let n=[],{start:i,end:r}=e.escapedCharacters,o=RegExp(`(\\${i}[^\\${r}]*\\${r})+`,"g"),a=null;for(;a=o.exec(t);)n.push({start:a.index,end:o.lastIndex-1});return n})((0,oc.A)({},e,{expandedFormat:t})),i=(e=>{let{utils:t,expandedFormat:n,escapedParts:i}=e,r=t.date(void 0),o=[],a="",s=Object.keys(t.formatTokenMap).sort((e,t)=>t.length-e.length),l=/^([a-zA-Z]+)/,u=RegExp(`^(${s.join("|")})*$`),c=RegExp(`^(${s.join("|")})`),h=e=>i.find(t=>t.start<=e&&t.end>=e),d=0;for(;d<n.length;){let t=h(d),i=null!=t,s=l.exec(n.slice(d))?.[1];if(!i&&null!=s&&u.test(s)){let t=s;for(;t.length>0;){let n=c.exec(t)[1];t=t.slice(n.length),o.push(etm((0,oc.A)({},e,{now:r,token:n,startSeparator:a}))),a=""}d+=s.length}else{let e=n[d];i&&t?.start===d||t?.end===d||(0===o.length?a+=e:o[o.length-1].endSeparator+=e),d+=1}}return 0===o.length&&a.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),o})((0,oc.A)({},e,{expandedFormat:t,escapedParts:n}));return(({isRtl:e,formatDensity:t,sections:n})=>n.map(n=>{let i=n=>{let i=n;return e&&null!==i&&i.includes(" ")&&(i=`\u2069${i}\u2066`),"spacious"===t&&["/",".","-"].includes(i)&&(i=` ${i} `),i};return n.startSeparator=i(n.startSeparator),n.endSeparator=i(n.endSeparator),n}))((0,oc.A)({},e,{sections:i}))},ety=e=>{let{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:i,onBlur:r,onClick:o,onFocus:a,onInput:s,onPaste:l,focused:u,autoFocus:c=!1},fieldValueManager:h,applyCharacterEditing:d,resetCharacterQuery:f,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:w,areAllSectionsEmpty:S,sectionsValueBoundaries:_}=e,C=eI.useRef(null),M=(0,JV.A)(i,C),A=KL().localeText,k=KL().utils,T=(0,Q_.A)(),[I,D]=eI.useState(!1),O=eI.useMemo(()=>({syncSelectionToDOM:()=>{let e;if(!C.current)return;let t=document.getSelection();if(!t)return;if(null==g){t.rangeCount>0&&C.current.getRoot().contains(t.getRangeAt(0).startContainer)&&t.removeAllRanges(),I&&C.current.getRoot().blur();return}if(!C.current.getRoot().contains(eeQ(document)))return;let n=new window.Range;e="all"===g?C.current.getRoot():"empty"===m.sections[g].type?C.current.getSectionContainer(g):C.current.getSectionContent(g),n.selectNodeContents(e),e.focus(),t.removeAllRanges(),t.addRange(n)},getActiveSectionIndexFromDOM:()=>{let e=eeQ(document);return e&&C.current&&C.current.getRoot().contains(e)?C.current.getSectionIndexFromDOMElement(e):null},focusField:(e=0)=>{if(!C.current||null!=O.getActiveSectionIndexFromDOM())return;let t=J_(e,m.sections);D(!0),C.current.getSectionContent(t).focus()},setSelectedSections:e=>{if(!C.current)return;let t=J_(e,m.sections);D(null!==("all"===t?0:t)),p(e)},isFieldFocused:()=>{let e=eeQ(document);return!!C.current&&C.current.getRoot().contains(e)}}),[g,p,m.sections,I]),P=(0,QR.A)(e=>{if(!C.current)return;let t=m.sections[e];C.current.getSectionContent(e).innerHTML=t.value||t.placeholder,O.syncSelectionToDOM()}),R=(0,QR.A)((e,...t)=>{!e.isDefaultPrevented()&&C.current&&(D(!0),o?.(e,...t),"all"===g?setTimeout(()=>{let e=document.getSelection().getRangeAt(0).startOffset;if(0===e)return void p(w.startIndex);let t=0,n=0;for(;n<e&&t<m.sections.length;){let e=m.sections[t];t+=1,n+=`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`.length}p(t-1)}):I?C.current.getRoot().contains(e.target)||p(w.startIndex):(D(!0),p(w.startIndex)))}),E=(0,QR.A)(e=>{if(s?.(e),!C.current||"all"!==g)return;let t=e.target.textContent??"";C.current.getRoot().innerHTML=m.sections.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),O.syncSelectionToDOM(),0===t.length||10===t.charCodeAt(0)?(f(),y(),p("all")):t.length>1?b(t):("all"===g&&p(0),d({keyPressed:t,sectionIndex:0}))}),L=(0,QR.A)(e=>{if(l?.(e),n||"all"!==g)return void e.preventDefault();let t=e.clipboardData.getData("text");e.preventDefault(),f(),b(t)}),N=(0,QR.A)((...e)=>{a?.(...e),I||!C.current||(D(!0),null==C.current.getSectionIndexFromDOMElement(eeQ(document))&&p(w.startIndex))}),B=(0,QR.A)((...e)=>{r?.(...e),setTimeout(()=>{if(!C.current)return;let e=eeQ(document);C.current.getRoot().contains(e)||(D(!1),p(null))})}),F=(0,QR.A)(e=>t=>{t.isDefaultPrevented()||p(e)}),z=(0,QR.A)(e=>{e.preventDefault()}),V=(0,QR.A)(e=>()=>{p(e)}),j=(0,QR.A)(e=>{if(e.preventDefault(),n||t||"number"!=typeof g)return;let i=m.sections[g],r=e.clipboardData.getData("text"),o=/^[a-zA-Z]+$/.test(r),a=/^[0-9]+$/.test(r),s=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(r);"letter"===i.contentType&&o||"digit"===i.contentType&&a||"digit-with-letter"===i.contentType&&s?(f(),x({activeSection:i,newSectionValue:r,shouldGoToNextSection:!0})):o||a||(f(),b(r))}),H=(0,QR.A)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="none"}),W=(0,QR.A)(e=>{if(!C.current)return;let t=e.target,i=t.textContent??"",r=C.current.getSectionIndexFromDOMElement(t),o=m.sections[r];if(n||!C.current)return void P(r);if(0===i.length){if(""===o.value)return void P(r);let t=e.nativeEvent.inputType;return"insertParagraph"===t||"insertLineBreak"===t?void P(r):(f(),void v())}d({keyPressed:i,sectionIndex:r}),P(r)});(0,QF.A)(()=>{if(I&&C.current){if("all"===g)C.current.getRoot().focus();else if("number"==typeof g){let e=C.current.getSectionContent(g);e&&e.focus()}}},[g,I]);let G=eI.useMemo(()=>m.sections.reduce((e,t)=>(e[t.type]=_[t.type]({currentDate:null,contentType:t.contentType,format:t.format}),e),{}),[_,m.sections]),$="all"===g,U=eI.useMemo(()=>m.sections.map((e,i)=>{let r=!$&&!t&&!n;return{container:{"data-sectionindex":i,onClick:F(i)},content:{tabIndex:$||i>0?-1:0,contentEditable:!$&&!t&&!n,role:"spinbutton",id:`${T}-${e.type}`,"aria-labelledby":`${T}-${e.type}`,"aria-readonly":n,"aria-valuenow":((e,t)=>{if(e.value)switch(e.type){case"weekDay":if("letter"===e.contentType)return;return Number(e.value);case"meridiem":{let n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);if(n)return+(t.getHours(n)>=12);return}case"day":return"digit-with-letter"===e.contentType?parseInt(e.value,10):Number(e.value);case"month":{if("digit"===e.contentType)return Number(e.value);let n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return"letter"!==e.contentType?Number(e.value):void 0}})(e,k),"aria-valuemin":G[e.type].minimum,"aria-valuemax":G[e.type].maximum,"aria-valuetext":e.value?((e,t)=>{if(e.value)switch(e.type){case"month":{if("digit"===e.contentType)return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");let n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return"digit"===e.contentType?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;default:return}})(e,k):A.empty,"aria-label":A[e.type],"aria-disabled":t,spellCheck:!r&&void 0,autoCapitalize:r?"off":void 0,autoCorrect:r?"off":void 0,[parseInt(eI.version,10)>=17?"enterKeyHint":"enterkeyhint"]:r?"next":void 0,children:e.value||e.placeholder,onInput:W,onPaste:j,onFocus:V(i),onDragOver:H,onMouseUp:z,inputMode:"letter"===e.contentType?"text":"numeric"},before:{children:e.startSeparator},after:{children:e.endSeparator}}}),[m.sections,V,j,H,W,F,z,t,n,$,A,k,G,T]),q=(0,QR.A)(e=>{b(e.target.value)}),Y=eI.useMemo(()=>S?"":h.getV7HiddenInputValueFromSections(m.sections),[S,m.sections,h]);return eI.useEffect(()=>{if(null==C.current)throw Error("MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`\nYou probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.\n\nIf you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:\n\n<DatePicker slots={{ textField: MyCustomTextField }} />\n\nLearn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element");c&&C.current&&C.current.getSectionContent(w.startIndex).focus()},[]),{interactions:O,returnedValue:{autoFocus:c,readOnly:n,focused:u??I,sectionListRef:M,onBlur:B,onClick:R,onFocus:N,onInput:E,onPaste:L,enableAccessibleFieldDOMStructure:!0,elements:U,tabIndex:0===g?-1:0,contentEditable:$,value:Y,onChange:q,areAllSectionsEmpty:S}}},etx=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),etb=e=>{let t=(0,fL.I)(),n=eI.useRef(void 0),i=eI.useRef(void 0),{forwardedProps:{onFocus:r,onClick:o,onPaste:a,onBlur:s,inputRef:l,placeholder:u},internalProps:{readOnly:c=!1,disabled:h=!1},parsedSelectedSections:d,activeSectionIndex:f,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:w,clearValue:S,setTempAndroidValueStr:_,setSelectedSections:C,getSectionsFromValue:M,areAllSectionsEmpty:A,localizedDigits:k}=e,T=eI.useRef(null),I=(0,JV.A)(l,T),D=eI.useMemo(()=>((e,t,n)=>{let i=0,r=+!!n,o=[];for(let a=0;a<e.length;a+=1){let s=e[a],l=Jv(s,n?"input-rtl":"input-ltr",t),u=`${s.startSeparator}${l}${s.endSeparator}`,c=etx(u).length,h=u.length,d=etx(l),f=r+(""===d?0:l.indexOf(d[0]))+s.startSeparator.length,p=f+d.length;o.push((0,oc.A)({},s,{start:i,end:i+c,startInInput:f,endInInput:p})),i+=c,r+=h}return o})(p.sections,k,t),[p.sections,k,t]),O=eI.useMemo(()=>({syncSelectionToDOM:()=>{if(!T.current)return;if(null==d){T.current.scrollLeft&&(T.current.scrollLeft=0);return}if(T.current!==eeQ(document))return;let e=T.current.scrollTop;if("all"===d)T.current.select();else{let e=D[d],t="empty"===e.type?e.startInInput-e.startSeparator.length:e.startInInput,n="empty"===e.type?e.endInInput+e.endSeparator.length:e.endInInput;(t!==T.current.selectionStart||n!==T.current.selectionEnd)&&T.current===eeQ(document)&&T.current.setSelectionRange(t,n),clearTimeout(i.current),i.current=setTimeout(()=>{T.current&&T.current===eeQ(document)&&T.current.selectionStart===T.current.selectionEnd&&(T.current.selectionStart!==t||T.current.selectionEnd!==n)&&O.syncSelectionToDOM()})}T.current.scrollTop=e},getActiveSectionIndexFromDOM:()=>{let e=T.current.selectionStart??0,t=T.current.selectionEnd??0;if(0===e&&0===t)return null;let n=e<=D[0].startInInput?1:D.findIndex(t=>t.startInInput-t.startSeparator.length>e);return -1===n?D.length-1:n-1},focusField:(e=0)=>{eeQ(document)!==T.current&&(T.current?.focus(),C(e))},setSelectedSections:e=>C(e),isFieldFocused:()=>T.current===eeQ(document)}),[T,d,D,C]),P=()=>{let e,t=T.current.selectionStart??0;C(-1===(e=t<=D[0].startInInput||t>=D[D.length-1].endInInput?1:D.findIndex(e=>e.startInInput-e.startSeparator.length>t))?D.length-1:e-1)},R=(0,QR.A)((...e)=>{r?.(...e);let t=T.current;clearTimeout(n.current),n.current=setTimeout(()=>{t&&t===T.current&&null==f&&(t.value.length&&Number(t.selectionEnd)-Number(t.selectionStart)===t.value.length?C("all"):P())})}),E=(0,QR.A)((e,...t)=>{e.isDefaultPrevented()||(o?.(e,...t),P())}),L=(0,QR.A)(e=>{if(a?.(e),e.preventDefault(),c||h)return;let t=e.clipboardData.getData("text");if("number"==typeof d){let e=p.sections[d],n=/^[a-zA-Z]+$/.test(t),i=/^[0-9]+$/.test(t),r=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(t);if("letter"===e.contentType&&n||"digit"===e.contentType&&i||"digit-with-letter"===e.contentType&&r){y(),x({activeSection:e,newSectionValue:t,shouldGoToNextSection:!0});return}if(n||i)return}y(),b(t)}),N=(0,QR.A)((...e)=>{s?.(...e),C(null)}),B=(0,QR.A)(e=>{let n;if(c)return;let i=e.target.value;if(""===i){y(),S();return}let r=e.nativeEvent.data,o=r&&r.length>1,a=o?r:i,s=etx(a);if("all"===d&&C(f),null==f||o)return void b(o?r:s);if("all"===d&&1===s.length)n=s;else{let e=etx(g.getV6InputValueFromSections(D,k,t)),i=-1,r=-1;for(let t=0;t<e.length;t+=1)-1===i&&e[t]!==s[t]&&(i=t),-1===r&&e[e.length-t-1]!==s[s.length-t-1]&&(r=t);let o=D[f];if(i<o.start||e.length-r-1>o.end)return;let a=s.length-e.length+o.end-etx(o.endSeparator||"").length;n=s.slice(o.start+etx(o.startSeparator||"").length,a)}if(0===n.length){navigator.userAgent.toLowerCase().includes("android")&&_(a),y(),w();return}v({keyPressed:n,sectionIndex:f})}),F=eI.useMemo(()=>void 0!==u?u:g.getV6InputValueFromSections(M(m.emptyValue),k,t),[u,g,M,m.emptyValue,k,t]),z=eI.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,k,t),[p.sections,g,p.tempValueStrAndroid,k,t]);return eI.useEffect(()=>(T.current&&T.current===eeQ(document)&&C("all"),()=>{clearTimeout(n.current),clearTimeout(i.current)}),[]),{interactions:O,returnedValue:{readOnly:c,onBlur:N,onClick:E,onFocus:R,onPaste:L,inputRef:I,enableAccessibleFieldDOMStructure:!1,placeholder:F,inputMode:eI.useMemo(()=>null==f||"letter"===p.sections[f].contentType?"text":"numeric",[f,p.sections]),autoComplete:"off",value:!(T.current&&T.current===eeQ(document))&&A?"":z,onChange:B}}},etw=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],etS=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],et_=["minDateTime","maxDateTime"];[...etw,...etS,...et_];let etC=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],etM=["clearable","onClear","InputProps","sx","slots","slotProps"],etA=["ownerState"];var etk=n(54227),etT=n(75472);function etI(e){return(0,ub.Ay)("MuiPickersTextField",e)}(0,ux.A)("MuiPickersTextField",["root","focused","disabled","error","required"]);var etD=n(42872);function etO(e){return(0,ub.Ay)("MuiPickersInputBase",e)}let etP=(0,ux.A)("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function etR(e){return(0,ub.Ay)("MuiPickersOutlinedInput",e)}let etE=(0,oc.A)({},etP,(0,ux.A)("MuiPickersOutlinedInput",["root","notchedOutline","input"])),etL=["children","className","label","notched","shrink"],etN=(0,e7.A)("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),etB=(0,e7.A)("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),etF=(0,e7.A)("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function etz(e){let{className:t,label:n}=e,i=(0,q1.A)(e,etL),r=null!=n&&""!==n,o=(0,oc.A)({},e,{withLabel:r});return(0,eb.jsx)(etN,(0,oc.A)({"aria-hidden":!0,className:t},i,{ownerState:o,children:(0,eb.jsx)(etF,{ownerState:o,children:r?(0,eb.jsx)(etB,{children:n}):(0,eb.jsx)(etB,{className:"notranslate",children:""})})}))}var etV=n(85235);function etj(e){return(0,ub.Ay)("MuiPickersSectionList",e)}let etH=(0,ux.A)("MuiPickersSectionList",["root","section","sectionContent"]),etW=["slots","slotProps","elements","sectionListRef"],etG=(0,e7.A)("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),et$=(0,e7.A)("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),etU=(0,e7.A)("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),etq=(0,e7.A)("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"});function etY(e){let{slots:t,slotProps:n,element:i,classes:r}=e,o=t?.section??et$,a=(0,QC.A)({elementType:o,externalSlotProps:n?.section,externalForwardedProps:i.container,className:r.section,ownerState:{}}),s=t?.sectionContent??etq,l=(0,QC.A)({elementType:s,externalSlotProps:n?.sectionContent,externalForwardedProps:i.content,additionalProps:{suppressContentEditableWarning:!0},className:r.sectionContent,ownerState:{}}),u=t?.sectionSeparator??etU,c=(0,QC.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.before,ownerState:{position:"before"}}),h=(0,QC.A)({elementType:u,externalSlotProps:n?.sectionSeparator,externalForwardedProps:i.after,ownerState:{position:"after"}});return(0,eb.jsxs)(o,(0,oc.A)({},a,{children:[(0,eb.jsx)(u,(0,oc.A)({},c)),(0,eb.jsx)(s,(0,oc.A)({},l)),(0,eb.jsx)(u,(0,oc.A)({},h))]}))}let etZ=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:r,elements:o,sectionListRef:a}=n,s=(0,q1.A)(n,etW),l=(e=>{let{classes:t}=e;return(0,uc.A)({root:["root"],section:["section"],sectionContent:["sectionContent"]},etj,t)})(n),u=eI.useRef(null),c=(0,JV.A)(t,u),h=e=>{if(!u.current)throw Error(`MUI X: Cannot call sectionListRef.${e} before the mount of the component.`);return u.current};eI.useImperativeHandle(a,()=>({getRoot:()=>h("getRoot"),getSectionContainer:e=>h("getSectionContainer").querySelector(`.${etH.section}[data-sectionindex="${e}"]`),getSectionContent:e=>h("getSectionContent").querySelector(`.${etH.section}[data-sectionindex="${e}"] .${etH.sectionContent}`),getSectionIndexFromDOMElement(e){let t=h("getSectionIndexFromDOMElement");if(null==e||!t.contains(e))return null;let n=null;return(e.classList.contains(etH.section)?n=e:e.classList.contains(etH.sectionContent)&&(n=e.parentElement),null==n)?null:Number(n.dataset.sectionindex)}}));let d=i?.root??etG,f=(0,QC.A)({elementType:d,externalSlotProps:r?.root,externalForwardedProps:s,additionalProps:{ref:c,suppressContentEditableWarning:!0},className:l.root,ownerState:{}});return(0,eb.jsx)(d,(0,oc.A)({},f,{children:f.contentEditable?o.map(({content:e,before:t,after:n})=>`${t.children}${e.children}${n.children}`).join(""):(0,eb.jsx)(eI.Fragment,{children:o.map((e,t)=>(0,eb.jsx)(etY,{slots:i,slotProps:r,element:e,classes:l},t))})}))}),etX=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],etK=(0,e7.A)("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>(0,oc.A)({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Math.round(.15/16*1e5)/1e5}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),etQ=(0,e7.A)(etG,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:t,filled:n,label:i})=>!e&&!t&&!n&&null==i,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:"light"===e.palette.mode?.42:.5}}]})),etJ=(0,e7.A)(et$,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),et0=(0,e7.A)(etq,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),et1=(0,e7.A)(etU,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),et2=(0,e7.A)("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})((0,oc.A)({},{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"})),et5=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:r,value:o,onChange:a,id:s,endAdornment:l,startAdornment:u,renderSuffix:c,slots:h,slotProps:d,contentEditable:f,tabIndex:p,onInput:g,onPaste:m,onKeyDown:v,name:y,readOnly:x,inputProps:b,inputRef:w,sectionListRef:S}=n,_=(0,q1.A)(n,etX),C=eI.useRef(null),M=(0,JV.A)(t,C),A=(0,JV.A)(b?.ref,w),k=(0,fL.I)(),T=(0,etD.A)();if(!T)throw Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");eI.useEffect(()=>{T&&T.setAdornedStart(!!u)},[T,u]),eI.useEffect(()=>{T&&(r?T.onEmpty():T.onFilled())},[T,r]);let I=(0,oc.A)({},n,T,{isRtl:k}),D=(e=>{let{focused:t,disabled:n,error:i,classes:r,fullWidth:o,readOnly:a,color:s,size:l,endAdornment:u,startAdornment:c}=e,h={root:["root",t&&!n&&"focused",n&&"disabled",a&&"readOnly",i&&"error",o&&"fullWidth",`color${(0,etV.A)(s)}`,"small"===l&&"inputSizeSmall",!!c&&"adornedStart",!!u&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return(0,uc.A)(h,etO,r)})(I),O=h?.root||etK,P=(0,QC.A)({elementType:O,externalSlotProps:d?.root,externalForwardedProps:_,additionalProps:{"aria-invalid":T.error,ref:M},className:D.root,ownerState:I}),R=h?.input||etQ;return(0,eb.jsxs)(O,(0,oc.A)({},P,{children:[u,(0,eb.jsx)(etZ,{sectionListRef:S,elements:i,contentEditable:f,tabIndex:p,className:D.sectionsContainer,onFocus:e=>{T.disabled?e.stopPropagation():T.onFocus?.(e)},onBlur:T.onBlur,onInput:g,onPaste:m,onKeyDown:v,slots:{root:R,section:etJ,sectionContent:et0,sectionSeparator:et1},slotProps:{root:{ownerState:I},sectionContent:{className:etP.sectionContent},sectionSeparator:({position:e})=>({className:"before"===e?etP.sectionBefore:etP.sectionAfter})}}),l,c?c((0,oc.A)({},T)):null,(0,eb.jsx)(et2,(0,oc.A)({name:y,className:D.input,value:o,onChange:a,id:s,"aria-hidden":"true",tabIndex:-1,readOnly:x,required:T.required,disabled:T.disabled},b,{ref:A}))]}))}),et3=["label","autoFocus","ownerState","notched"],et4=(0,e7.A)(etK,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${etE.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${etE.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${etE.focused} .${etE.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${etE.disabled}`]:{[`& .${etE.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${etE.error} .${etE.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t]?.main??!1).map(t=>({props:{color:t},style:{[`&.${etE.focused}:not(.${etE.error}) .${etE.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}}))}}),et6=(0,e7.A)(etQ,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),et8=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:r,notched:o}=n,a=(0,q1.A)(n,et3),s=(0,etD.A)(),l=(0,oc.A)({},n,r,s,{color:s?.color||"primary"}),u=(e=>{let{classes:t}=e,n=(0,uc.A)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},etR,t);return(0,oc.A)({},t,n)})(l);return(0,eb.jsx)(et5,(0,oc.A)({slots:{root:et4,input:et6},renderSuffix:e=>(0,eb.jsx)(etz,{shrink:!!(o||e.adornedStart||e.focused||e.filled),notched:!!(o||e.adornedStart||e.focused||e.filled),className:u.notchedOutline,label:null!=i&&""!==i&&s?.required?(0,eb.jsxs)(eI.Fragment,{children:[i," ","*"]}):i,ownerState:l})},a,{label:i,classes:u,ref:t}))});et8.muiName="Input";var et9=n(57867);function et7(e){return(0,ub.Ay)("MuiPickersFilledInput",e)}let ene=(0,oc.A)({},etP,(0,ux.A)("MuiPickersFilledInput",["root","underline","input"])),ent=["label","autoFocus","disableUnderline","ownerState"],enn=(0,e7.A)(etK,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,et9.MC)(e)&&"disableUnderline"!==e})(({theme:e})=>{let t="light"===e.palette.mode,n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${ene.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${ene.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ene.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ene.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ene.disabled}, .${ene.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${ene.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:12}},{props:({endAdornment:e})=>!!e,style:{paddingRight:12}}]}}),eni=(0,e7.A)(etQ,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),enr=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,a=(0,q1.A)(n,ent),s=(0,etD.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,uc.A)({root:["root",!n&&"underline"],input:["input"]},et7,t);return(0,oc.A)({},t,i)})((0,oc.A)({},n,o,s,{color:s?.color||"primary"}));return(0,eb.jsx)(et5,(0,oc.A)({slots:{root:enn,input:eni},slotProps:{root:{disableUnderline:r}}},a,{label:i,classes:l,ref:t}))});function eno(e){return(0,ub.Ay)("MuiPickersFilledInput",e)}enr.muiName="Input";let ena=(0,oc.A)({},etP,(0,ux.A)("MuiPickersInput",["root","input"])),ens=["label","autoFocus","disableUnderline","ownerState"],enl=(0,e7.A)(etK,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(t=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(t=>(e.vars??e).palette[t].main).map(t=>({props:{color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ena.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ena.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ena.disabled}, .${ena.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${ena.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),enu=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:r=!1,ownerState:o}=n,a=(0,q1.A)(n,ens),s=(0,etD.A)(),l=(e=>{let{classes:t,disableUnderline:n}=e,i=(0,uc.A)({root:["root",!n&&"underline"],input:["input"]},eno,t);return(0,oc.A)({},t,i)})((0,oc.A)({},n,o,s,{disableUnderline:r,color:s?.color||"primary"}));return(0,eb.jsx)(et5,(0,oc.A)({slots:{root:enl}},a,{label:i,classes:l,ref:t}))});enu.muiName="Input";let enc=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],enh={standard:enu,filled:enr,outlined:et8},end=(0,e7.A)(p3.A,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({maxWidth:"100%"}),enf=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:r,className:o,color:a="primary",disabled:s=!1,error:l=!1,variant:u="outlined",required:c=!1,InputProps:h,inputProps:d,inputRef:f,sectionListRef:p,elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onPaste:b,onInput:w,endAdornment:S,startAdornment:_,tabIndex:C,contentEditable:M,focused:A,value:k,onChange:T,fullWidth:I,id:D,name:O,helperText:P,FormHelperTextProps:R,label:E,InputLabelProps:L}=n,N=(0,q1.A)(n,enc),B=eI.useRef(null),F=(0,JV.A)(t,B),z=(0,Q_.A)(D),V=P&&z?`${z}-helper-text`:void 0,j=E&&z?`${z}-label`:void 0,H=(0,oc.A)({},n,{color:a,disabled:s,error:l,focused:A,required:c,variant:u}),W=(e=>{let{focused:t,disabled:n,classes:i,required:r}=e;return(0,uc.A)({root:["root",t&&!n&&"focused",n&&"disabled",r&&"required"]},etI,i)})(H),G=enh[u];return(0,eb.jsxs)(end,(0,oc.A)({className:(0,uu.A)(W.root,o),ref:F,focused:A,onFocus:i,onBlur:r,disabled:s,variant:u,error:l,color:a,fullWidth:I,required:c,ownerState:H},N,{children:[(0,eb.jsx)(etk.A,(0,oc.A)({htmlFor:z,id:j},L,{children:E})),(0,eb.jsx)(G,(0,oc.A)({elements:g,areAllSectionsEmpty:m,onClick:v,onKeyDown:y,onKeyUp:x,onInput:w,onPaste:b,endAdornment:S,startAdornment:_,tabIndex:C,contentEditable:M,value:k,onChange:T,id:z,fullWidth:I,inputProps:d,inputRef:f,sectionListRef:p,label:E,name:O,role:"group","aria-labelledby":j,"aria-describedby":V,"aria-live":V?"polite":void 0},h)),P&&(0,eb.jsx)(etT.A,(0,oc.A)({id:V},R,{children:P}))]}))}),enp=["enableAccessibleFieldDOMStructure"],eng=["InputProps","readOnly"],enm=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],env=["slots","slotProps","InputProps","inputProps"],eny=eI.forwardRef(function(e,t){let n=KT({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:r,InputProps:o,inputProps:a}=n,s=(0,q1.A)(n,env),l=i?.textField??(e.enableAccessibleFieldDOMStructure?enf:eA.A),u=(0,QC.A)({elementType:l,externalSlotProps:r?.textField,externalForwardedProps:s,ownerState:n,additionalProps:{ref:t}});u.inputProps=(0,oc.A)({},a,u.inputProps),u.InputProps=(0,oc.A)({},o,u.InputProps);let c=(e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=(0,q1.A)(e,enp);if(t){let{InputProps:e,readOnly:t}=n,i=(0,q1.A)(n,eng);return(0,oc.A)({},i,{InputProps:(0,oc.A)({},e??{},{readOnly:t})})}let{onPaste:i,onKeyDown:r,inputMode:o,readOnly:a,InputProps:s,inputProps:l,inputRef:u}=n,c=(0,q1.A)(n,enm);return(0,oc.A)({},c,{InputProps:(0,oc.A)({},s??{},{readOnly:a}),inputProps:(0,oc.A)({},l??{},{inputMode:o,onPaste:i,onKeyDown:r,ref:u})})})((e=>{let t,n,i,r,o,{forwardedProps:a,internalProps:s}=(t=KL().utils,n=KL().defaultDates,i=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h,r=(0,oc.A)({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??i,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:Kz(t,e.minDateTime??e.minDate,n.minDate),maxDate:Kz(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime}),o="date-time",eI.useMemo(()=>{let e=(0,oc.A)({},r),t={},n=n=>{e.hasOwnProperty(n)&&(t[n]=e[n],delete e[n])};return etC.forEach(n),etw.forEach(n),etS.forEach(n),et_.forEach(n),{forwardedProps:e,internalProps:t}},[r,o]));return(e=>{let t=KL().utils,{internalProps:n,internalProps:{unstableFieldRef:i,minutesStep:r,enableAccessibleFieldDOMStructure:o=!1,disabled:a=!1,readOnly:s=!1},forwardedProps:{onKeyDown:l,error:u,clearable:c,onClear:h},fieldValueManager:d,valueManager:f,validator:p}=e,g=(0,fL.I)(),m=(e=>{let t=KL().utils,n=KL().localeText,i=KL(),r=(0,fL.I)(),{valueManager:o,fieldValueManager:a,valueType:s,validator:l,internalProps:u,internalProps:{value:c,defaultValue:h,referenceDate:d,onChange:f,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:x,enableAccessibleFieldDOMStructure:b=!1}}=e,{timezone:w,value:S,handleValueChange:_}=Jr({timezone:x,value:c,defaultValue:h,referenceDate:d,onChange:f,valueManager:o}),C=eI.useMemo(()=>{let e;return e=t.date(void 0),"0"===t.formatByString(t.setSeconds(e,0),"s")?Jh:Array.from({length:10}).map((n,i)=>t.formatByString(t.setSeconds(e,i),"s"))},[t]),M=eI.useMemo(()=>((e,t,n)=>{let i=e.date(void 0,n),r=e.endOfYear(i),o=e.endOfDay(i),{maxDaysInMonth:a,longestMonth:s}=KV(e,i).reduce((t,n)=>{let i=e.getDaysInMonth(n);return i>t.maxDaysInMonth?{maxDaysInMonth:i,longestMonth:n}:t},{maxDaysInMonth:0,longestMonth:null});return{year:({format:t})=>({minimum:0,maximum:4===e.formatByString(e.date(void 0,"system"),t).length?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(r)+1}),day:({currentDate:t})=>({minimum:1,maximum:null!=t&&e.isValid(t)?e.getDaysInMonth(t):a,longestMonth:s}),weekDay:({format:t,contentType:n})=>{if("digit"===n){let n=Ju(e,t).map(Number);return{minimum:Math.min(...n),maximum:Math.max(...n)}}return{minimum:1,maximum:7}},hours:({format:n})=>{let r=e.getHours(o);return Jd(e.formatByString(e.endOfDay(i),n),t)!==r.toString()?{minimum:1,maximum:Number(Jd(e.formatByString(e.startOfDay(i),n),t))}:{minimum:0,maximum:r}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}})(t,C,w),[t,C,w]),A=eI.useCallback((e,i=null)=>a.getSectionsFromValue(t,e,i,e=>etv({utils:t,localeText:n,localizedDigits:C,format:p,date:e,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:r})),[a,p,n,C,r,y,t,g,b]),[k,T]=eI.useState(()=>{let e=A(S);Jb(e,s);let n={sections:e,value:S,referenceValue:o.emptyValue,tempValueStrAndroid:null},i=Math.max(...e.map(e=>Ja[e.type]??1)),r=o.getInitialReferenceValue({referenceDate:d,value:S,utils:t,props:u,granularity:i,timezone:w});return(0,oc.A)({},n,{referenceValue:r})}),[I,D]=(0,QE.A)({controlled:m,default:null,name:"useField",state:"selectedSections"}),O=e=>{D(e),v?.(e)},P=eI.useMemo(()=>J_(I,k.sections),[I,k.sections]),R="all"===P?0:P,E=({value:e,referenceValue:n,sections:r})=>{if(T(t=>(0,oc.A)({},t,{sections:r,value:e,referenceValue:n,tempValueStrAndroid:null})),o.areValuesEqual(t,k.value,e))return;let a={validationError:l({adapter:i,value:e,timezone:w,props:u})};_(e,a)},L=(e,t)=>{let n=[...k.sections];return n[e]=(0,oc.A)({},n[e],{value:t,modified:!0}),n};return eI.useEffect(()=>{let e=A(k.value);Jb(e,s),T(t=>(0,oc.A)({},t,{sections:e}))},[p,t.locale,r]),eI.useEffect(()=>{o.areValuesEqual(t,k.value,S)&&o.getTimezone(t,k.value)===o.getTimezone(t,S)||T(e=>(0,oc.A)({},e,{value:S,referenceValue:a.updateReferenceValue(t,S,e.referenceValue),sections:A(S)}))},[S]),{state:k,activeSectionIndex:R,parsedSelectedSections:P,setSelectedSections:O,clearValue:()=>{E({value:o.emptyValue,referenceValue:k.referenceValue,sections:A(o.emptyValue)})},clearActiveSection:()=>{if(null==R)return;let e=k.sections[R],n=a.getActiveDateManager(t,k,e),i=n.getSections(k.sections).filter(e=>""!==e.value).length===+(""!==e.value),r=L(R,""),o=i?null:t.getInvalidDate(),s=n.getNewValuesFromNewActiveDate(o);E((0,oc.A)({},s,{sections:r}))},updateSectionValue:({activeSection:e,newSectionValue:n,shouldGoToNextSection:i})=>{let r,o;i&&R<k.sections.length-1&&O(R+1);let s=a.getActiveDateManager(t,k,e),l=L(R,n),u=s.getSections(l),c=((e,t,n)=>{let i=t.some(e=>"day"===e.type),r=[],o=[];for(let e=0;e<t.length;e+=1){let a=t[e];i&&"weekDay"===a.type||(r.push(a.format),o.push(Jv(a,"non-input",n)))}let a=r.join(" "),s=o.join(" ");return e.parse(s,a)})(t,u,C);if(null!=c&&t.isValid(c)){let e=JS(t,c,u,s.referenceDate,!0);r=s.getNewValuesFromNewActiveDate(e),o=!0}else r=s.getNewValuesFromNewActiveDate(c),o=(null!=c&&!t.isValid(c))!=(null!=s.date&&!t.isValid(s.date));return o?E((0,oc.A)({},r,{sections:l})):T(e=>(0,oc.A)({},e,r,{sections:l,tempValueStrAndroid:null}))},updateValueFromValueStr:e=>{let i=a.parseValueStr(e,k.referenceValue,(e,i)=>{let o=t.parse(e,p);if(null==o||!t.isValid(o))return null;let a=etv({utils:t,localeText:n,localizedDigits:C,format:p,date:o,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:r});return JS(t,o,a,i,!1)}),o=a.updateReferenceValue(t,i,k.referenceValue);E({value:i,referenceValue:o,sections:A(i,k.sections)})},setTempAndroidValueStr:e=>T(t=>(0,oc.A)({},t,{tempValueStrAndroid:e})),getSectionsFromValue:A,sectionsValueBoundaries:M,localizedDigits:C,timezone:w}})(e),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:S,updateSectionValue:_,setTempAndroidValueStr:C,sectionsValueBoundaries:M,localizedDigits:A,timezone:k}=m,T=(({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:i,setTempAndroidValueStr:r,timezone:o})=>{let a=KL().utils,[s,l]=eI.useState(null),u=(0,QR.A)(()=>l(null));eI.useEffect(()=>{null!=s&&e[s.sectionIndex]?.type!==s.sectionType&&u()},[e,s,u]),eI.useEffect(()=>{if(null!=s){let e=setTimeout(()=>u(),5e3);return()=>{clearTimeout(e)}}return()=>{}},[s,u]);let c=({keyPressed:t,sectionIndex:n},i,r)=>{let o=t.toLowerCase(),a=e[n];if(null!=s&&(!r||r(s.value))&&s.sectionIndex===n){let e=`${s.value}${o}`,t=i(e,a);if(null==t.saveQuery)return l({sectionIndex:n,value:e,sectionType:a.type}),t}let c=i(o,a);return null==c.saveQuery||c.saveQuery?(l({sectionIndex:n,value:o,sectionType:a.type}),null!=c.saveQuery?null:c):(u(),null)};return{applyCharacterEditing:(0,QR.A)(s=>{var l;let u,h,d,f=e[s.sectionIndex],p=Jp(s.keyPressed,i)?(l=(0,oc.A)({},s,{keyPressed:Jf(s.keyPressed,i)}),u=(e,t)=>{let r=Jd(e,i),o=Number(r),s=n[t.type]({currentDate:null,format:t.format,contentType:t.contentType});if(o>s.maximum)return{saveQuery:!1};if(o<s.minimum)return{saveQuery:!0};let l=10*o>s.maximum||r.length===s.maximum.toString().length;return{sectionValue:Jm(a,o,s,i,t),shouldGoToNextSection:l}},c(l,(e,t)=>{if("digit"===t.contentType||"digit-with-letter"===t.contentType)return u(e,t);if("month"===t.type){let n=Jx(a,"digit","month","MM"),i=u(e,{type:t.type,format:"MM",hasLeadingZerosInFormat:n,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(null!=i.saveQuery)return i;let r=Jy(a,i.sectionValue,"MM",t.format);return(0,oc.A)({},i,{sectionValue:r})}if("weekDay"===t.type){let n=u(e,t);if(null!=n.saveQuery)return n;let i=Ju(a,t.format)[Number(n.sectionValue)-1];return(0,oc.A)({},n,{sectionValue:i})}return{saveQuery:!1}},e=>Jp(e,i))):(h=(e,t,n)=>{let i=t.filter(e=>e.toLowerCase().startsWith(n));return 0===i.length?{saveQuery:!1}:{sectionValue:i[0],shouldGoToNextSection:1===i.length}},d=(e,t,n,i)=>{let r=e=>Jc(a,o,t.type,e);if("letter"===t.contentType)return h(t.format,r(t.format),e);if(n&&null!=i&&"letter"===Jl(a,n).contentType){let t=r(n),o=h(n,t,e);return null!=o.saveQuery?{saveQuery:!1}:(0,oc.A)({},o,{sectionValue:i(o.sectionValue,t)})}return{saveQuery:!1}},c(s,(e,t)=>{switch(t.type){case"month":return d(e,t,a.formats.month,e=>Jy(a,e,a.formats.month,t.format));case"weekDay":return d(e,t,a.formats.weekday,(e,t)=>t.indexOf(e).toString());case"meridiem":return d(e,t);default:return{saveQuery:!1}}}));null==p?r(null):t({activeSection:f,newSectionValue:p.sectionValue,shouldGoToNextSection:p.shouldGoToNextSection})}),resetCharacterQuery:u}})({sections:v.sections,updateSectionValue:_,sectionsValueBoundaries:M,localizedDigits:A,setTempAndroidValueStr:C,timezone:k}),{resetCharacterQuery:I}=T,D=f.areValuesEqual(t,v.value,f.emptyValue),O=o?ety:etb,P=eI.useMemo(()=>((e,t)=>{let n={};if(!t)return e.forEach((t,i)=>{let r=i===e.length-1?null:i+1;n[i]={leftIndex:0===i?null:i-1,rightIndex:r}}),{neighbors:n,startIndex:0,endIndex:e.length-1};let i={},r={},o=0,a=0,s=e.length-1;for(;s>=0;){-1===(a=e.findIndex((e,t)=>t>=o&&e.endSeparator?.includes(" ")&&" / "!==e.endSeparator))&&(a=e.length-1);for(let e=a;e>=o;e-=1)r[e]=s,i[s]=e,s-=1;o=a+1}return e.forEach((t,o)=>{let a=r[o],s=0===a?null:i[a-1],l=a===e.length-1?null:i[a+1];n[o]={leftIndex:s,rightIndex:l}}),{neighbors:n,startIndex:i[0],endIndex:i[e.length-1]}})(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:R,interactions:E}=O((0,oc.A)({},e,m,T,{areAllSectionsEmpty:D,sectionOrder:P})),L=(0,QR.A)(e=>{if(l?.(e),!a)switch(!0){case(e.ctrlKey||e.metaKey)&&"A"===String.fromCharCode(e.keyCode)&&!e.shiftKey&&!e.altKey:e.preventDefault(),b("all");break;case"ArrowRight"===e.key:if(e.preventDefault(),null==x)b(P.startIndex);else if("all"===x)b(P.endIndex);else{let e=P.neighbors[x].rightIndex;null!==e&&b(e)}break;case"ArrowLeft"===e.key:if(e.preventDefault(),null==x)b(P.endIndex);else if("all"===x)b(P.startIndex);else{let e=P.neighbors[x].leftIndex;null!==e&&b(e)}break;case"Delete"===e.key:if(e.preventDefault(),s)break;null==x||"all"===x?w():S(),I();break;case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(e.key):{if(e.preventDefault(),s||null==y)break;"all"===x&&b(y);let n=v.sections[y],i=d.getActiveDateManager(t,v,n),o=((e,t,n,i,r,o,a,s)=>{let l=(e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return -1;case"PageUp":return 5;case"PageDown":return -5;default:return 0}})(i),u="Home"===i,c="End"===i,h=""===n.value||u||c;if("digit"===n.contentType||"digit-with-letter"===n.contentType){let i,d=r[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),f="minutes"===n.type&&s?.minutesStep?s.minutesStep:1;if(h){if("year"===n.type&&!c&&!u)return e.formatByString(e.date(void 0,t),n.format);i=l>0||u?d.minimum:d.maximum}else i=parseInt(Jd(n.value,o),10)+l*f;return(i%f!=0&&((l<0||u)&&(i+=f-(f+i)%f),(l>0||c)&&(i-=i%f)),i>d.maximum)?Jm(e,d.minimum+(i-d.maximum-1)%(d.maximum-d.minimum+1),d,o,n):i<d.minimum?Jm(e,d.maximum-(d.minimum-i-1)%(d.maximum-d.minimum+1),d,o,n):Jm(e,i,d,o,n)}let d=Jc(e,t,n.type,n.format);if(0===d.length)return n.value;if(h)return l>0||u?d[0]:d[d.length-1];let f=((d.indexOf(n.value)+l)%d.length+d.length)%d.length;return d[f]})(t,k,n,e.key,M,A,i.date,{minutesStep:r});_({activeSection:n,newSectionValue:o,shouldGoToNextSection:!1})}}});(0,QF.A)(()=>{E.syncSelectionToDOM()});let{hasValidationError:N}=eeX({props:n,validator:p,timezone:k,value:v.value,onError:n.onError}),B=eI.useMemo(()=>void 0!==u?u:N,[N,u]);eI.useEffect(()=>{B||null!=y||I()},[v.referenceValue,y,B]),eI.useEffect(()=>{null!=v.tempValueStrAndroid&&null!=y&&(I(),S())},[v.sections]),eI.useImperativeHandle(i,()=>({getSections:()=>v.sections,getActiveSectionIndex:E.getActiveSectionIndexFromDOM,setSelectedSections:E.setSelectedSections,focusField:E.focusField,isFieldFocused:E.isFieldFocused}));let F={onKeyDown:L,onClear:(0,QR.A)((e,...t)=>{e.preventDefault(),h?.(e,...t),w(),E.isFieldFocused()?b(P.startIndex):E.focusField(0)}),error:B,clearable:!!(c&&!D&&!s&&!a)};return(0,oc.A)({},e.forwardedProps,F,{disabled:a,readOnly:s},R)})({forwardedProps:a,internalProps:s,valueManager:JM,fieldValueManager:JA,validator:etp,valueType:"date-time"})})(u)),h=(e=>{let t=KL().localeText,{clearable:n,onClear:i,InputProps:r,sx:o,slots:a,slotProps:s}=e,l=(0,q1.A)(e,etM),u=a?.clearButton??eM.A,c=(0,QC.A)({elementType:u,externalSlotProps:s?.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),h=(0,q1.A)(c,etA),d=a?.clearIcon??KJ,f=(0,QC.A)({elementType:d,externalSlotProps:s?.clearIcon,ownerState:{}});return(0,oc.A)({},l,{InputProps:(0,oc.A)({},r,{endAdornment:(0,eb.jsxs)(eI.Fragment,{children:[n&&(0,eb.jsx)(p_.A,{position:"end",sx:{marginRight:r?.endAdornment?-1:-1.5},children:(0,eb.jsx)(u,(0,oc.A)({},h,{onClick:i,children:(0,eb.jsx)(d,(0,oc.A)({fontSize:"small"},f))}))}),r?.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})})((0,oc.A)({},c,{slots:i,slotProps:r}));return(0,eb.jsx)(l,(0,oc.A)({},h))});var enx=n(65130),enb=n(43628),enw=n(47196),enS=n(54266),en_=n(54708),enC=n(38086),enM=n(16299),enA=n(85910),enk=n(44766),enT=n(65043),enI=n(72710),enD=n(96962),enO=n(47918),enP=n(54354),enR=n(8151),enE=n(91733),enL=n(99042),enN=n(89321),enB=n(51148),enF=n(55578),enz=n(18463),enV=n(54752),enj=n(36163),enH=n(28850),enW=n(45350),enG=n(67619),en$=n(39270),enU=n(56756),enq=n(268),enY=n(12282),enZ=n(41042),enX=n(38267),enK=n(47025),enQ=n(30118),enJ=n(84253),en0=n(98608),en1=n(8643),en2=n(18109),en5=n(19681),en3=n(73206),en4=n(53819),en6=n(96058),en8=n(682),en9=n(67671);let en7={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},eie={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class eit{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=en7,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=e=>void 0===e?new Date:null===e?null:new Date(e),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=e=>e,this.toJsDate=e=>e,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=e=>e.match(/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,this.longFormatters[t])(e,this.locale.formatLong):e}).join(""),this.formatNumber=e=>e,this.getDayOfWeek=e=>e.getDay()+1;const{locale:t,formats:n,longFormatters:i,lib:r}=e;this.locale=t,this.formats=(0,oc.A)({},eie,n),this.longFormatters=i,this.lib=r||"date-fns"}}class ein extends eit{constructor({locale:e,formats:t}={}){super({locale:e??en9.c,formats:t,longFormatters:enI.m}),this.parse=(e,t)=>""===e?null:(0,enY.qg)(e,t,new Date,{locale:this.locale}),this.isValid=e=>null!=e&&(0,enq.f)(e),this.format=(e,t)=>this.formatByString(e,this.formats[t]),this.formatByString=(e,t)=>(0,enD.GP)(e,t,{locale:this.locale}),this.isEqual=(e,t)=>null===e&&null===t||null!==e&&null!==t&&(0,enH.n)(e,t),this.isSameYear=(e,t)=>(0,enG.s)(e,t),this.isSameMonth=(e,t)=>(0,en$.t)(e,t),this.isSameDay=(e,t)=>(0,enW.r)(e,t),this.isSameHour=(e,t)=>(0,enU.l)(e,t),this.isAfter=(e,t)=>(0,enV.d)(e,t),this.isAfterYear=(e,t)=>(0,enV.d)(e,(0,enT.Q)(t)),this.isAfterDay=(e,t)=>(0,enV.d)(e,(0,enA.D)(t)),this.isBefore=(e,t)=>(0,enj.Y)(e,t),this.isBeforeYear=(e,t)=>(0,enj.Y)(e,this.startOfYear(t)),this.isBeforeDay=(e,t)=>(0,enj.Y)(e,this.startOfDay(t)),this.isWithinRange=(e,[t,n])=>(0,en8.v)(e,{start:t,end:n}),this.startOfYear=e=>(0,en6.D)(e),this.startOfMonth=e=>(0,en5.w)(e),this.startOfWeek=e=>(0,en4.k)(e,{locale:this.locale}),this.startOfDay=e=>(0,en2.o)(e),this.endOfYear=e=>(0,enT.Q)(e),this.endOfMonth=e=>(0,en3.p)(e),this.endOfWeek=e=>(0,enk.$)(e,{locale:this.locale}),this.endOfDay=e=>(0,enA.D)(e),this.addYears=(e,t)=>(0,enM.e)(e,t),this.addMonths=(e,t)=>(0,enC.P)(e,t),this.addWeeks=(e,t)=>(0,en_.J)(e,t),this.addDays=(e,t)=>(0,enx.f)(e,t),this.addHours=(e,t)=>(0,enS.L)(e,t),this.addMinutes=(e,t)=>(0,enw.z)(e,t),this.addSeconds=(e,t)=>(0,enb.p)(e,t),this.getYear=e=>(0,enz.C)(e),this.getMonth=e=>(0,enL.t)(e),this.getDate=e=>(0,enO.p)(e),this.getHours=e=>(0,enR.q)(e),this.getMinutes=e=>(0,enE.O)(e),this.getSeconds=e=>(0,enN.S)(e),this.getMilliseconds=e=>(0,enB.D)(e),this.setYear=(e,t)=>(0,en1.i)(e,t),this.setMonth=(e,t)=>(0,enQ.Z)(e,t),this.setDate=(e,t)=>(0,enZ.X)(e,t),this.setHours=(e,t)=>(0,enX.a)(e,t),this.setMinutes=(e,t)=>(0,enK.g)(e,t),this.setSeconds=(e,t)=>(0,enJ.g)(e,t),this.setMilliseconds=(e,t)=>(0,en0.$)(e,t),this.getDaysInMonth=e=>(0,enP.P)(e),this.getWeekArray=e=>{let t=this.startOfWeek(this.startOfMonth(e)),n=this.endOfWeek(this.endOfMonth(e)),i=0,r=t,o=[];for(;this.isBefore(r,n);){let e=Math.floor(i/7);o[e]=o[e]||[],o[e].push(r),r=this.addDays(r,1),i+=1}return o},this.getWeekNumber=e=>(0,enF.N)(e,{locale:this.locale}),this.getYearRange=([e,t])=>{let n=this.startOfYear(e),i=this.endOfYear(t),r=[],o=n;for(;this.isBefore(o,i);)r.push(o),o=this.addYears(o,1);return r}}}let eii="yyyy-MM-dd HH:mm:ss";function eir(e,t){let n,i;return e?(0,nT.isRelativeTimeRange)(e)?e.pastDuration:(n=r0(e.start,eii,t),i=r0(e.end,eii,t),`${n} - ${i}`):"Custom Time Range"}let eio=({initialTimeRange:e,onChange:t,onCancel:n,timeZone:i})=>{let r=["local","browser"].includes(i.toLowerCase())?Intl.DateTimeFormat().resolvedOptions().timeZone:i,[o,a]=(0,eI.useState)(e),[s,l]=(0,eI.useState)(!0),u=(e,t)=>{a(n=>({...n,[t]:e}))},c=e=>{u(e,"start")},h=e=>{u(e,"end")},d=()=>{var e,t;let n={start:o.start,end:o.end};if(e=n.start,t=n.end,(0,nI.isValid)(e)&&(0,nI.isValid)(t)?!!(0,nI.isBefore)(e,t)||(console.error("End Time is before Start Time"),!1):(console.error("Invalid Date"),!1))return n};return(0,eb.jsx)(KO,{dateAdapter:ein,children:(0,eb.jsxs)(eC.A,{spacing:2,sx:e=>({padding:e.spacing(1,0,2)}),children:[s&&(0,eb.jsxs)(ua.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,eb.jsx)(pd.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select Start Time"}),(0,eb.jsx)(etg,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new rQ(o.start,r),onChange:e=>{null!==e&&c(e)},onAccept:()=>{l(!1)}})]}),!s&&(0,eb.jsxs)(ua.A,{sx:e=>({".MuiPickersLayout-contentWrapper":{backgroundColor:e.palette.background.default}}),children:[(0,eb.jsx)(pd.A,{variant:"h3",padding:1,paddingLeft:2,children:"Select End Time"}),(0,eb.jsx)(etg,{timezone:r,displayStaticWrapperAs:"desktop",openTo:"day",disableHighlightToday:!0,value:new rQ(o.end,r),minDateTime:new rQ(o.start,r),onChange:e=>{null!==e&&h(e)},onAccept:e=>{null!==e&&(l(!0),h(e))}})]}),(0,eb.jsxs)(eC.A,{direction:"row",alignItems:"center",gap:1,pl:1,pr:1,children:[(0,eb.jsx)(FV.ErrorBoundary,{FallbackComponent:Fz,children:(0,eb.jsx)(eny,{"data-testid":"start_time_input",timezone:r,label:"Start Time",value:new rQ(o.start,r),onChange:e=>{e&&c(e)},onBlur:()=>d(),format:eii})}),(0,eb.jsx)(FV.ErrorBoundary,{FallbackComponent:Fz,children:(0,eb.jsx)(eny,{"data-testid":"end_time_input",timezone:r,label:"End Time",value:new rQ(o.end,r),onChange:e=>{e&&h(e)},onBlur:()=>d(),format:eii})})]}),(0,eb.jsxs)(eC.A,{direction:"row",sx:{padding:e=>e.spacing(0,1)},gap:1,children:[(0,eb.jsx)(eS.A,{variant:"contained",onClick:()=>{let e;(e=d())&&t(e)},fullWidth:!0,children:"Apply"}),(0,eb.jsx)(eS.A,{variant:"outlined",onClick:()=>n(),fullWidth:!0,children:"Cancel"})]})]})})};function eia({value:e,timeOptions:t,onChange:n,height:i,showCustomTimeRange:r=!0,timeZone:o,timeZoneOptions:a,onTimeZoneChange:s}){let l,{timeZone:u}=un(),c=o??u,h=(0,eI.useRef)(),[d,f]=(0,eI.useState)(!1),p=(0,eI.useMemo)(()=>(0,nT.isRelativeTimeRange)(e)?(0,nT.toAbsoluteTimeRange)(e):e,[e]),g=(0,eI.useMemo)(()=>{var t;return{value:t=(0,nT.isRelativeTimeRange)(e)?void 0:e,display:eir(t,c)}},[e,c]),[m,v]=(0,eI.useState)(!1),y=a??nO(),[x,b]=(0,eI.useState)(null),w=y.find(e=>e.value===c)?.display??c,S=r1(c),_=r1("local"),C=y.map(e=>({id:e.value,label:e.display}));{let e=y.find(e=>e.value===c);e&&(l={id:e.value,label:e.display})}return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(e9.Ay,{anchorEl:x,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},open:!!x,onClose:()=>b(null),sx:e=>({padding:e.spacing(1)}),children:(0,eb.jsx)(ua.A,{sx:{p:1,minWidth:260},onClick:e=>{e.stopPropagation()},children:(0,eb.jsx)(ga,{options:C,value:l,onChange:(e,t)=>{if(t){let e=y.find(e=>e.value===t.id);e&&s?.(e)}b(null)},disableClearable:!0,renderInput:e=>(0,eb.jsx)(eA.A,{...e,placeholder:"Search timezones",size:"small"})})})}),(0,eb.jsx)(e9.Ay,{anchorEl:h.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},open:d,onClose:()=>f(!1),sx:e=>({padding:e.spacing(2)}),children:(0,eb.jsx)(eio,{initialTimeRange:p,onChange:e=>{n(e),f(!1),v(!1)},onCancel:()=>f(!1),timeZone:c})}),(0,eb.jsx)(ua.A,{ref:h,children:(0,eb.jsxs)(fD.A,{open:m,value:eir(e,c),onClick:()=>v(!m),IconComponent:K_,renderValue:()=>(0,eb.jsxs)(eC.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,eb.jsx)("span",{children:t.find(t=>eir(t.value,c)===eir(e,c))?.display??eir(e,c)}),S!==_&&(0,eb.jsxs)(ua.A,{sx:{typography:"caption",color:"text.secondary"},children:["\xb7 ",S]})]}),inputProps:{"aria-label":`Select time range. Currently set to ${e}`},sx:{".MuiSelect-icon":{marginTop:"1px",transform:"none"},".MuiSelect-select.MuiSelect-outlined.MuiInputBase-input":{paddingRight:"36px"},".MuiSelect-select":i?{lineHeight:i,paddingY:0}:{}},children:[(0,eb.jsx)(fI.A,{disableRipple:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},sx:{cursor:"default","&:hover":{backgroundColor:"transparent"},py:.5,px:1},children:(0,eb.jsxs)(ua.A,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[(0,eb.jsxs)(ua.A,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,eb.jsx)(ua.A,{sx:{typography:"subtitle1"},children:"Time Range"}),(0,eb.jsxs)(ua.A,{sx:{color:"text.secondary",typography:"caption",mt:.25},children:["Timezone: ",w]})]}),(0,eb.jsx)(ua.A,{sx:{display:"flex",alignItems:"center",pr:1,ml:1.5},children:(0,eb.jsx)(eM.A,{size:"small","aria-label":"Select timezone",onClick:e=>{e.preventDefault(),e.stopPropagation(),b(e.currentTarget)},children:(0,eb.jsx)(KC,{fontSize:"small"})})})]})}),t.map((e,t)=>(0,eb.jsx)(fI.A,{value:eir(e.value,c),onClick:()=>{n(e.value)},children:e.display},t)),r&&(0,eb.jsx)(fI.A,{value:eir(g.value,c),onClick:()=>f(!0),children:g.display})]})})]})}function eis({value:e,onChange:t,timeZoneOptions:n,variant:i="standard",heightPx:r,...o}){let a,s=(0,eI.useMemo)(()=>n??nO(),[n]);r&&(a="number"==typeof r?`${r}px`:r);let l=(0,eI.useMemo)(()=>({minWidth:"compact"===i?"80px":"150px",...a&&{lineHeight:a,paddingY:0},...o.sx}),[i,a,o.sx]);return(0,eb.jsx)(fD.A,{...o,value:e,onChange:(e,n)=>{var i;let r;i=e.target.value,(r=s.find(e=>e.value===i))&&t&&t(r)},sx:l,size:"compact"===i?"small":"medium",children:s.map(e=>(0,eb.jsx)(fI.A,{value:e.value,children:e.display},e.value))})}function eil(e){let{markerColor:t,sx:n}=e;return(0,eb.jsx)(ua.A,{sx:ry({display:"inline-block",width:"11px",height:"11px",borderRadius:"2px",marginRight:1,verticalAlign:"top"},n),style:{backgroundColor:t}})}function eiu(e){let{formattedY:t,markerColor:n,metricName:i,metricLabels:r}=e;return(0,eb.jsxs)(eC.A,{spacing:.5,children:[(0,eb.jsxs)(ua.A,{sx:e=>({display:"flex",height:"16px",flexDirection:"row",alignItems:"center",justifyContent:"left",color:e.palette.common.white,fontSize:"11px"}),children:[(0,eb.jsx)(eil,{markerColor:n,sx:{marginTop:.25}}),(0,eb.jsxs)(ua.A,{component:"span",children:[i,(0,eb.jsx)(ua.A,{component:"span",sx:e=>({color:e.palette.common.white,fontWeight:700,paddingLeft:"2px"}),children:t})]})]}),(0,eb.jsx)(pb.A,{sx:e=>({borderColor:e.palette.grey["500"]})}),(0,eb.jsx)(ua.A,{sx:e=>({color:e.palette.common.white}),children:r.map(e=>{if(e){let[t,n]=e.split("="),i=void 0!==n?`${t}: `:t,r=void 0!==n?n.replace(/(^"|"$)/g,""):n;return(0,eb.jsxs)(ua.A,{sx:{display:"flex",gap:"4px"},children:[(0,eb.jsx)(pd.A,{sx:{fontSize:"11px"},children:i}),(0,eb.jsx)(pd.A,{sx:e=>({color:e.palette.common.white,fontWeight:700,fontSize:"11px"}),children:r})]},e)}})})]})}let eic=375,eih=650,eid=650,eif=500,eip=.75,eig=8,eim=750,eiv="nearby series showing in tooltip",eiy="emphasized series showing as bold in tooltip",eix="#2E313E",eib=new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}),eiw={coords:{plotCanvas:{x:0,y:0},zrender:{x:0,y:0},target:null},chartWidth:0},eiS=[],ei_=()=>{let[e,t]=(0,eI.useState)(null);return(0,eI.useEffect)(()=>{let e=e=>t({page:{x:e.pageX,y:e.pageY},client:{x:e.clientX,y:e.clientY},plotCanvas:{x:e.zrX??e.offsetX,y:e.zrY??e.offsetY},target:e.target});return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),e},eiC={wrapLabels:!0,enablePinning:!0},eiM="Click chart to pin",eiA="Click chart to unpin";function eik(e){let{seriesName:t,formattedY:n,markerColor:i,totalSeries:r,emphasizeText:o=!1,wrapLabels:a=!0}=e,s=t.split("{"),l=(s[1]??t).replace(/[{}]/g,"").split(",");if(1===r&&l.length>1){let e=s[0]?`${s[0]}:`:"value:";return(0,eb.jsx)(eiu,{formattedY:n,metricName:e,metricLabels:l,markerColor:i})}let u=t.replace(/[,]/g,", ");return(0,eb.jsxs)(ua.A,{sx:{display:"table-row",paddingTop:.5},children:[(0,eb.jsxs)(ua.A,{sx:{display:"table-cell",maxWidth:"520px"},children:[(0,eb.jsx)(eil,{markerColor:i,sx:{marginTop:.5}}),(0,eb.jsx)(ua.A,{component:"span",sx:e=>({display:"inline-block",width:"calc(100% - 20px)",minWidth:150,maxWidth:eif,overflow:"hidden",color:e.palette.common.white,fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular,textOverflow:"ellipsis",whiteSpace:a?"normal":"nowrap"}),"aria-label":o?eiy:eiv,children:u})]}),(0,eb.jsx)(ua.A,{sx:e=>({display:"table-cell",paddingLeft:1.5,textAlign:"right",verticalAlign:"top",fontWeight:o?e.typography.fontWeightBold:e.typography.fontWeightRegular}),children:n})]})}var eiT=n(36961),eiI=n(85180);function eiD(e,t,n,i,r){if(null===e||(null!==t&&(e=t),void 0===e.plotCanvas.x))return;let o=n>0?n:eid,a=i>0?i:eih,s=e.page.x+32,l=e.page.y+16;if(r){let e=r.getBoundingClientRect();s=s-e.left+r.scrollLeft,l=l-e.top+r.scrollTop;let t=e.top+r.scrollHeight;l+o>t&&(l=Math.max(t-o-16,eig/2))}else l+o>window.innerHeight+window.scrollY&&(l=Math.max(window.innerHeight+window.scrollY-o-16,eig/2));return s+a>window.innerWidth&&(s=e.page.x-a-32),s<32&&(s=32),l<eig/2&&(l=eig/2),`translate3d(${s}px, ${l}px, 0)`}function eiO(e,t,n){return{minWidth:eic,maxWidth:eih,maxHeight:(n?n-eig:void 0)??eid,padding:0,position:"absolute",top:0,left:0,backgroundColor:e.palette.designSystem?.grey[800]??eix,borderRadius:"6px",color:"#fff",fontSize:"11px",visibility:"visible",opacity:1,transition:"opacity 0.1s ease-out, visibility 0.1s ease-out",zIndex:null!==t?"auto":e.zIndex.tooltip,overflow:"hidden","&:hover":{overflowY:"auto"}}}function eiP(e,t){try{let n=t.convertToPixel("grid",[e,0]);return n?.[0]??null}catch{return null}}function eiR(e,t,n,i){let r=n[e];if(!r)return t;let o=r.stack;if(!o)return t;let a=o.toString(),s=(i.get(a)??0)+t;return i.set(a,s),s}function eiE(e,t,n){let i,r,o=t.indexOf(e);if(-1===o)return 20;let a=o>0?t[o-1]??null:null,s=o<t.length-1?t[o+1]??null:null,l=eiP(e,n);if(null===l)return 20;if(null!==a&&null!==s){let e=eiP(a,n)??l,t=eiP(s,n)??l;i=(l+e)/2,r=(l+t)/2}else if(null!==a){let e=eiP(a,n)??l;i=(l+e)/2,r=l+(l-i)}else{if(null===s)return 20;let e=eiP(s,n)??l;r=(l+e)/2,i=l-(r-l)}return Math.max(1,r-i)}function eiL(e,t,n,i){let r=t/Math.max(1,i),o=n-t/2+e*r;return{left:o,right:o+r}}function eiN(e,t,n){try{let i=n.convertToPixel("grid",[0,e]),r=n.convertToPixel("grid",[0,t]);if(!i||!r||void 0===i[1]||void 0===r[1])return null;return{top:Math.min(r[1],i[1]),bottom:Math.max(r[1],i[1])}}catch{return null}}let eiB=5.5,eiF=30,eiz=5;function eiV(e,t,n,i,r,o,a,s,l){let u=n[0]??null,c=n[1]??null;if(null===u||null===c||void 0===r.dispatchAction||!Array.isArray(e))return eiS;let h=rm(e[0]?.values,u);if(null===h)return eiS;let d=null;if(void 0!==s){let e=r.convertToPixel("grid",[0,c]),t=r.convertToPixel("grid",[0,c+i]);e&&t&&void 0!==e[1]&&void 0!==t[1]&&(d=Math.abs(t[1]-e[1]))}let f=l??eiP(h,r),p=function(e,t,n,i,r,o,a,s,l){let u=[],c=e.length,h=new Map,d=[],f=e[0]?.values;if(f&&f.length>0){let e=new Set;for(let[t]of f)e.has(t)||(e.add(t),d.push(t));d=d.sort((e,t)=>e-t)}let p=[];for(let e=0;e<c;e++)(t[e]?.type??"line")==="bar"&&p.push(e);let g=null,m=null;p.length>0&&null!==r&&(g=eiE(n,d,l),m=eiP(n,l));for(let d=0;d<c;d++){let c,f=t[d];if(!f)continue;let v=e[d];if(!v)continue;let y=v.values;if(!y||!Array.isArray(y))continue;let x=f.type??"line",b=f.name?f.name.toString():"",w=f.id?f.id.toString():"",S=(f.color??"#000").toString(),_=-1,C=0;for(let e=0;e<y.length;e++){let t=y[e];if(t&&t[0]===n){_=e,C=t[0],c=t[1];break}}if(-1===_||null==c)continue;let M=!1,A=c,k=1/0;if("line"===x)if(A=eiR(d,c,t,h),void 0!==o&&null!==s)try{let e=l.convertToPixel({seriesIndex:d},[_,A]);if(e&&void 0!==e[1]){let t=Math.abs(o-e[1]);M=t<=s,k=t}else{let e=Math.abs(A-i);M=e<=a,k=e}}catch{let e=Math.abs(A-i);M=e<=a,k=e}else{let e=Math.abs(A-i);M=e<=a,k=e}else if("bar"===x){if(null===r||null===g||null===m)continue;let e=p.indexOf(d);if(-1===e)continue;let n=eiL(e,g,m,p.length);if(!(r>=n.left&&r<=n.right))continue;let o=f.stack,a=!0;if(o){let e=o.toString(),n=eiN(h.get(e)??0,A=eiR(d,c,t,h),l);if(n){let e=l.convertToPixel("grid",[0,i]);e&&void 0!==e[1]&&(a=e[1]>=n.top&&e[1]<=n.bottom)}}else A=c;if(!a)continue;k=Math.abs(r-(n.left+n.right)/2),M=!0}M&&u.push({seriesIdx:d,datumIdx:_,seriesId:w,seriesName:b,date:n,markerColor:S,x:C,y:c,visualY:A,distance:k})}return u}(e,t,h,c,f,s,i,d,r),g=function(e){if(0===e.length)return null;let t=null;for(let n of e)(null===t||n.distance<t.distance)&&(t=n);return t}(p),m=new Set;for(let e of p)m.add(e.seriesIdx);let v=[];for(let t=0;t<e.length;t++)m.has(t)||v.push(t);return function(e,t,n,i,r,o){let a=[],s=[],l=[...o],u=[],c=[],h=new Map,d=[];for(let r of e){let e=i?.get(r.seriesId)??n,o=r.y,f=i1(o,e),p=null!==t&&r.seriesIdx===t.seriesIdx;if(p){s.push(r.seriesIdx);let e=h.get(o)??0;h.set(o,e+1),e>0&&c.push({seriesIndex:r.seriesIdx,dataIndex:r.datumIdx,seriesName:r.seriesName,yValue:o}),u.push({seriesIndex:r.seriesIdx,dataIndex:r.datumIdx,seriesName:r.seriesName,yValue:o})}else l.push(r.seriesIdx);d.push({seriesIdx:r.seriesIdx,datumIdx:r.datumIdx,seriesName:r.seriesName,date:r.date,x:r.x,y:o,formattedY:f,markerColor:r.markerColor,isClosestToCursor:p}),a.push(r.seriesIdx)}return rp(r,a,s,l,u,c),d}(p,g,o,a,r,v)}function eij(e,t,n,i,r){let o=[],a=t[0]??null,s=t[1]??null;if(null===a||null===s)return o;let l=[],u=[],c=[],h=e.timeSeries.length;if(Array.isArray(e.xAxis)&&Array.isArray(e.timeSeries))for(let t=0;t<h;t++){let d=e.timeSeries[t];if(void 0===d||o.length>=1e3)break;let f=d.name?d.name.toString():"",p=d.color??"#000";if(Array.isArray(d.data))for(let g=0;g<d.data.length;g++){let m=e.xAxis[g]??0,v=d.data[g];if(null!=v&&a===g&&"-"!==v&&s<=v+n&&s>=v-n){let e=eiW({valueToCheck:s,baseValue:v,percentage:Math.max(h>eiz?2:5,100/h)});e?u.push(t):(c.push(t),i?.dispatchAction!==void 0&&i.dispatchAction({type:"downplay",seriesIndex:t}));let n=m>0x174876e7ff?m:1e3*m,a=i1(v,r);o.push({seriesIdx:t,datumIdx:g,seriesName:f,date:n,x:m,y:v,formattedY:a,markerColor:p.toString(),isClosestToCursor:e}),l.push(t)}}}return i?.dispatchAction!==void 0&&(i.dispatchAction({type:"downplay",seriesIndex:c}),u.length>0?i.dispatchAction({type:"highlight",seriesIndex:u,notBlur:!1,escapeConnect:!0}):i.dispatchAction({type:"highlight",seriesIndex:l,notBlur:!0,escapeConnect:!0})),o}function eiH({mousePos:e,pinnedPos:t,data:n,seriesMapping:i,chart:r,format:o,seriesFormatMap:a,showAllSeries:s=!1}){if(void 0===r||null===e)return eiS;let l=!1;if(null!==e.target){let t=e.target.parentElement;if(null!==t){let e=t.parentElement;null!==e&&r.getDom()===e&&(l=!0)}}if(null!==t&&(e=t,l=!0),!1===l||null===n||void 0===r._model||void 0===e.plotCanvas.x||void 0===e.plotCanvas.y)return eiS;let u=e.plotCanvas.y,c=e.plotCanvas.x,h=rf(c,u,r);if(null!==h){let e=r._model.getComponent("yAxis").axis.scale,t="log"===e.type,l=e._interval;if(t&&e.base){let t=e.base,n=e._extent,i=t**n[0];l=(t**n[1]-i)/100}let d=eiG({yInterval:l,totalSeries:n.length,showAllSeries:s}),f=i.some(e=>void 0!==e.yAxisIndex&&e.yAxisIndex>0);return eiV(n,i,h,d,r,o,a,f?u:void 0,c)}return eiS}function eiW({valueToCheck:e,baseValue:t,percentage:n}){let i=n/100*t;return e>=t-i&&e<=t+i}function eiG({yInterval:e,totalSeries:t,showAllSeries:n=!1}){if(n)return 10*e;let i=.3*e;return t>eiz?Math.max(i,e*eiF/t):Math.max(i,e*eiB)}function ei$(e){let{series:t,wrapLabels:n}=e,i=(0,eI.useMemo)(()=>null===t?null:t.sort((e,t)=>e.y>t.y?-1:1),[t]);return null===t||null===i?null:(0,eb.jsx)(ua.A,{sx:e=>({display:"table",padding:e.spacing(.5,2)}),children:i.map(({datumIdx:e,seriesIdx:t,seriesName:r,y:o,formattedY:a,markerColor:s,isClosestToCursor:l})=>{if(null===e||null===t)return null;let u=t.toString()+e.toString();return(0,eb.jsx)(eik,{seriesName:r,y:o,formattedY:a,markerColor:s,totalSeries:i.length,wrapLabels:n,emphasizeText:l},u)})})}var eiU=n(68003),eiq=n(4491),eiY=n(29917);let eiZ=(0,eI.memo)(function({nearbySeries:e,totalSeries:t,isTooltipPinned:n,showAllSeries:i,enablePinning:r=!0,onShowAllClick:o,onUnpinClick:a}){let s,l,u,{formatWithUserTimeZone:c}=un(),h=e[0]?.date??null;if(null===h)return null;let d=r&&t>5;return(0,eb.jsxs)(ua.A,{sx:e=>({width:"100%",maxWidth:eih,padding:e.spacing(1.5,2,.5,2),backgroundColor:e.palette.designSystem?.grey[800]??eix,position:"sticky",top:0,left:0}),children:[(0,eb.jsxs)(ua.A,{sx:{width:"100%",display:"flex",justifyContent:"start",alignItems:"center",paddingBottom:.5},children:[(l=c(s=new Date(h),"MMM dd, yyyy - "),u=c(s,"HH:mm:ss"),(0,eb.jsxs)(ua.A,{children:[(0,eb.jsx)(pd.A,{variant:"caption",sx:e=>({color:e.palette.common.white}),children:l}),(0,eb.jsx)(pd.A,{variant:"caption",children:(0,eb.jsx)("strong",{children:u})})]})),(0,eb.jsxs)(eC.A,{direction:"row",gap:1,sx:{marginLeft:"auto"},children:[d&&(0,eb.jsxs)(eC.A,{direction:"row",gap:.5,alignItems:"center",sx:{textAlign:"right"},children:[(0,eb.jsx)(pd.A,{sx:{fontSize:11},children:"Show All"}),(0,eb.jsx)(eiU.A,{checked:i,size:"small",onChange:(e,t)=>{if(void 0!==o)return o(t)},sx:e=>({"& .MuiSwitch-switchBase":{color:e.palette.common.white},"& .MuiSwitch-track":{backgroundColor:e.palette.common.white}})})]}),r&&(0,eb.jsxs)(eC.A,{direction:"row",alignItems:"center",children:[(0,eb.jsx)(pd.A,{sx:{marginRight:.5,fontSize:11,verticalAlign:"middle"},children:n?eiA:eiM}),n?(0,eb.jsx)(eiq,{onClick:()=>{void 0!==a&&a()},sx:{fontSize:16,cursor:"pointer"}}):(0,eb.jsx)(eiY,{sx:{fontSize:16}})]})]})]}),(0,eb.jsx)(pb.A,{sx:e=>({width:"100%",borderColor:e.palette.grey["500"]})})]})}),eiX=(0,eI.memo)(function({containerId:e,chartRef:t,data:n,seriesMapping:i,enablePinning:r=!0,wrapLabels:o,format:a,seriesFormatMap:s,onUnpinClick:l,pinnedPos:u}){let[c,h]=(0,eI.useState)(!1),d=(0,eI.useRef)(),f=(0,eI.useRef)(null),p=ei_(),{height:g,width:m,ref:v}=(0,eiI.A)(),y=null!==u&&r,x=(0,eI.useCallback)(e=>{f.current=e,v(e)},[v]),b=e?document.querySelector(e):void 0;if((0,eI.useLayoutEffect)(()=>{if(null===p)return;let e=f.current;if(!e)return;let t=e.getBoundingClientRect();if(0===t.height||0===t.width)return;let n=eiD(p,u,t.height,t.width,b);n&&n!==d.current&&(d.current=n,e.style.transform=n)}),null===p||null===p.target||null===n||null===u&&"CANVAS"!==p.target.tagName)return null;let w=t.current,S=b?b.getBoundingClientRect().height:void 0;d.current=eiD(p,u,g??0,m??0,b);let _=eiH({mousePos:p,data:n,seriesMapping:i,pinnedPos:u,chart:w,format:a,seriesFormatMap:s,showAllSeries:c});if(0===_.length)return null;let C=n.length;return(0,eb.jsx)(eiT.A,{container:b,children:(0,eb.jsx)(ua.A,{ref:x,sx:e=>eiO(e,u,S),style:{transform:d.current},children:(0,eb.jsxs)(eC.A,{spacing:.5,children:[(0,eb.jsx)(eiZ,{nearbySeries:_,totalSeries:C,enablePinning:r,isTooltipPinned:y,showAllSeries:c,onShowAllClick:e=>h(e),onUnpinClick:l}),(0,eb.jsx)(ei$,{series:_,wrapLabels:o})]})})})}),eiK=(0,e7.A)(eS.A)(({theme:e})=>({padding:e.spacing(.5),minWidth:"auto"})),eiQ=(0,eI.forwardRef)(function(e,t){return(0,eb.jsx)(eiK,{ref:t,variant:"outlined",color:"secondary",...e})}),eiJ=Object.entries(i0).map(([e,t])=>({...t,id:e,group:t.group||"Decimal"})).filter(e=>!e.disableSelectorOption);function ei0({value:e,onChange:t,disabled:n=!1,...i}){let r=i0[e?.unit||"decimal"];return(0,eb.jsx)(ga,{value:{id:e?.unit||"decimal",...r},options:eiJ,groupBy:e=>e.group??"Decimal",onChange:(e,n)=>{null===n?t(void 0):t({unit:n.id})},disabled:n,disableClearable:!0,renderInput:({InputProps:e,...i})=>(0,eb.jsx)(eA.A,{...i,slotProps:{input:{...e,endAdornment:(0,eb.jsxs)(eb.Fragment,{children:[e.endAdornment,(0,eb.jsx)(p_.A,{position:"end",children:(0,eb.jsx)(eM.A,{size:"small","aria-label":"clear unit",onClick:()=>t(void 0),disabled:n,tabIndex:-1,children:(0,eb.jsx)(pA,{fontSize:"small"})})})]})}}}),...i})}let ei1=[{id:"default",label:"Default",decimalPlaces:void 0},{id:"0",label:"0",decimalPlaces:0},{id:"1",label:"1",decimalPlaces:1},{id:"2",label:"2",decimalPlaces:2},{id:"3",label:"3",decimalPlaces:3},{id:"4",label:"4",decimalPlaces:4}];function ei2({value:e,onChange:t,disabled:n=!1}){var i;let r=re(e),o=rt(e);return(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(gt,{label:"Short values",control:(0,eb.jsx)(eiU.A,{checked:!!o&&nq(e.shortValues),onChange:(n,i)=>{o&&t({...e,shortValues:i})},disabled:!o})}),(0,eb.jsx)(gt,{label:"Unit",control:(0,eb.jsx)(ei0,{value:e,onChange:e=>{t(e||{unit:"decimal"})},disabled:n})}),(0,eb.jsx)(gt,{label:"Decimals",control:(0,eb.jsx)(ga,{value:(i=e.decimalPlaces,ei1.find(e=>e.decimalPlaces===i)),options:ei1,getOptionLabel:e=>e.label,onChange:(n,i)=>(({decimalPlaces:n})=>{r&&t({...e,decimalPlaces:n})})(i),disabled:!r,disableClearable:!0})})]})}function ei5({name:e,height:t}){return(0,eb.jsx)(ua.A,{style:{maxWidth:t,top:`calc(${t}px / 2)`},sx:{display:"inline-block",position:"absolute",transform:"translateX(-50%) rotate(-90deg)",transformOrigin:"top",textAlign:"center",zIndex:1},children:(0,eb.jsx)(pd.A,{variant:"body1","aria-label":"y axis label",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})}var ei3=n(9408);let ei4=oi((0,ei3.A)({}),{echartsTheme:{textStyle:{fontFamily:"Lato"},categoryAxis:{splitLine:{show:!1}},timeAxis:{splitLine:{show:!1}},bar:{barCategoryGap:2}}}),ei6={chartsTheme:ei4,enablePinning:!1,enableSyncGrouping:!0,lastTooltipPinnedCoords:null,setLastTooltipPinnedCoords:()=>null};var ei8=n(52855);let ei9={defaultProps:{variant:"standard",severity:"success"},styleOverrides:{standardError:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.error.dark,color:e.palette.error.light,[`& .${ei8.A.icon}`]:{color:e.palette.error.main}}:{...e.typography.body1,backgroundColor:e.palette.error.light,color:e.palette.error.dark,[`& .${ei8.A.icon}`]:{color:e.palette.error.main}},standardInfo:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.info.dark,color:e.palette.info.light,[`& .${ei8.A.icon}`]:{color:e.palette.info.main}}:{...e.typography.body1,backgroundColor:e.palette.info.light,color:e.palette.info.dark,[`& .${ei8.A.icon}`]:{color:e.palette.info.main}},standardSuccess:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.success.dark,color:e.palette.success.light,[`& .${ei8.A.icon}`]:{color:e.palette.success.main}}:{...e.typography.body1,backgroundColor:e.palette.success.light,color:e.palette.success.dark,[`& .${ei8.A.icon}`]:{color:e.palette.success.main}},standardWarning:({theme:e})=>"dark"===e.palette.mode?{...e.typography.body1,backgroundColor:e.palette.warning.dark,color:e.palette.warning.light,[`& .${ei8.A.icon}`]:{color:e.palette.warning.main}}:{...e.typography.body1,backgroundColor:e.palette.warning.light,color:e.palette.warning.dark,[`& .${ei8.A.icon}`]:{color:e.palette.warning.main}},root:{["& ."+n(82561).A.root]:{textDecoration:"underline"}}}},ei7={styleOverrides:{root:({theme:e})=>({backgroundColor:e.palette.background.default})}},ere={50:"#E7F1FC",100:"#D0E3FA",150:"#B8D5F7",200:"#A1C7F5",300:"#72ABF0",400:"#438FEB",500:"#1473E6",600:"#105CB8",700:"#0C458A",800:"#082E5C",850:"#062345",900:"#04172E",950:"#020C17"},ert="#FFFFFF",ern={50:"#F0F1F6",100:"#E1E3ED",150:"#D2D5E4",200:"#C3C7DB",300:"#A4ACC8",400:"#8690B6",500:"#717CA4",600:"#535D83",700:"#3E4662",800:"#2A2E42",850:"#1F2331",900:"#151721",950:"#0A0C10"},eri={50:"#EAF9F1",100:"#D5F2E3",150:"#C1ECD4",200:"#ACE5C6",300:"#82D9AA",400:"#59CC8D",500:"#2FBF71",600:"#26995A",700:"#1C7344",800:"#134C2D",850:"#0E3922",900:"#092617",950:"#05130B"},err={50:"#FFF5E8",100:"#FFECD2",150:"#FFE2BB",200:"#FFD9A4",300:"#FFC577",400:"#FFB249",500:"#FF9F1C",600:"#CC7F16",700:"#995F11",800:"#66400B",850:"#4D3008",900:"#332006",950:"#1A1003"},ero={50:"#EFE9FD",100:"#E0D2FC",150:"#D0BCFA",200:"#C1A6F8",300:"#A179F5",400:"#824DF1",500:"#6320EE",600:"#4F1ABE",700:"#3B138F",800:"#280D5F",850:"#1E0A47",900:"#140630",950:"#0A0318"},era={50:"#FDEDED",100:"#FBDADA",150:"#F9C8C8",200:"#F7B5B5",300:"#F29191",400:"#EE6C6C",500:"#EA4747",600:"#BD3939",700:"#902B2B",800:"#621D1D",850:"#4C1616",900:"#350F0F",950:"#1F0808"},ers=e=>"light"===e?{main:ere["500"],dark:ere["600"],light:ere["50"]}:{main:ere["400"],dark:ere["800"],light:ere["200"]},erl={fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,h1:{fontSize:"1.5rem",fontWeight:600,lineHeight:"32px"},h2:{fontSize:"1.25rem",fontWeight:600,lineHeight:"28px"},h3:{fontSize:"1rem",fontWeight:600,lineHeight:"24px"},h4:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px"},h5:void 0,h6:void 0,body1:{fontSize:"0.875rem",fontWeight:400,lineHeight:"20px"},body2:{fontSize:"0.75rem",fontWeight:400,lineHeight:"18px"},subtitle1:{fontSize:"1rem",fontWeight:400,lineHeight:"24px",letterSpacing:"0.02rem"},subtitle2:{fontSize:"0.875rem",fontWeight:600,lineHeight:"22px",letterSpacing:"0.03rem",textTransform:"uppercase"},button:{fontSize:"0.875rem",fontWeight:600,lineHeight:"1.25rem",textTransform:"none",letterSpacing:"0.03rem"},caption:{fontSize:"0.6875rem",fontWeight:400,lineHeight:"16px"}},eru=({theme:e})=>({..."light"===e.palette.mode?{}:{backgroundImage:"unset",backgroundColor:e.palette.designSystem.grey[800]}});function erc(e,t={},n=!1){var i,r;let o;return(0,ei3.A)({palette:function(e){let t,n,i,r;return{mode:e,primary:ers(e),secondary:"light"===e?{main:ern["600"],dark:ern["900"],light:ern["100"]}:{main:ert,dark:ert,light:ert},grey:"light"===e?{50:ern["50"],100:ern["100"],200:ern["200"],300:ern["300"],400:ern["400"],500:ern["500"],600:ern["600"],700:ern["700"],800:ern["800"],900:ern["900"],950:ern["950"]}:{50:ern["950"],100:ern["900"],200:ern["800"],300:ern["700"],400:ern["600"],500:ern["500"],600:ern["400"],700:ern["300"],800:ern["200"],900:ern["100"],950:ern["50"]},background:(t=ere["150"],n="rgba(21, 23, 33, 0.75)","light"===e?{navigation:t,overlay:n,default:ert,paper:ern["50"],code:ern["50"],tooltip:ern["100"],lighter:ern["50"],border:ern["100"]}:{navigation:t,overlay:n,default:ern["900"],paper:ern["850"],code:ern["800"],tooltip:ern["600"],lighter:ern["700"],border:ern["600"]}),text:(i=ern["800"],r=ern["300"],"light"===e?{navigation:i,accent:r,primary:ern["800"],secondary:ern["700"],disabled:ern["300"],link:ere["500"],linkHover:ere["600"]}:{navigation:i,accent:r,primary:ert,secondary:ern["50"],disabled:ern["600"],link:ere["400"],linkHover:ere["500"]}),error:"light"===e?{main:era["500"],dark:era["600"],light:era["50"]}:{main:era["400"],dark:era["800"],light:era["300"]},warning:"light"===e?{main:err["500"],dark:err["700"],light:err["50"]}:{main:err["400"],dark:err["800"],light:err["300"]},info:ers(e),success:"light"===e?{main:eri["500"],dark:eri["700"],light:eri["50"]}:{main:eri["400"],dark:eri["800"],light:eri["300"]},common:{white:ert,black:"#000000"},designSystem:{blue:ere,green:eri,grey:ern,orange:err,purple:ero,red:era}}}(e),typography:erl,mixins:{},components:(i=e,r=n,o={MuiAlert:ei9,MuiFormControl:{defaultProps:{size:"small"}},MuiPaper:ei7,MuiTextField:{defaultProps:{size:"small"}},MuiDrawer:{styleOverrides:{paper:eru}},MuiDialog:{styleOverrides:{paper:eru}},MuiPopover:{styleOverrides:{paper:eru}}},r?o:{MuiCssBaseline:{styleOverrides:{body:{colorScheme:i}}},...o}),...t})}var erh=n(87275),erd=n(11061),erf=n(78536),erp=n(1355);function erg({value:e,onChange:t}){return(0,eb.jsxs)(eC.A,{direction:"row",children:[(0,eb.jsx)(gr.A,{freeSolo:!0,multiple:!0,id:"join-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,eb.jsx)(eA.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,eb.jsx)(Kr.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eiU.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function erm({value:e,onChange:t}){return(0,eb.jsxs)(eC.A,{direction:"row",gap:1,alignItems:"center",children:[(0,eb.jsx)(gr.A,{freeSolo:!0,multiple:!0,id:"merge-columns-columns",sx:{width:"100%"},options:[],value:e.spec.columns??[],renderInput:e=>(0,eb.jsx)(eA.A,{...e,variant:"outlined",label:"Columns",required:!0}),onChange:(n,i)=>{t({...e,spec:{...e.spec,columns:i}})}}),(0,eb.jsx)(pP,{id:"merge-columns-name",variant:"outlined",label:"Output Name",value:e.spec.name??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,name:n}})},required:!0}),(0,eb.jsx)(Kr.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eiU.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function erv({value:e,onChange:t}){return(0,eb.jsxs)(eC.A,{direction:"row",children:[(0,eb.jsx)(pP,{id:"merge-indexed-columns",variant:"outlined",label:"Column",placeholder:"Example: 'value' for merging 'value #1', 'value #2' and 'value #...'",value:e.spec.column??"",sx:{width:"100%"},onChange:n=>{t({...e,spec:{...e.spec,column:n}})},required:!0}),(0,eb.jsx)(Kr.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eiU.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})]})}function ery({value:e,onChange:t}){return(0,eb.jsx)(eC.A,{direction:"row",children:(0,eb.jsx)(Kr.A,{label:"Enabled",labelPlacement:"start",control:(0,eb.jsx)(eiU.A,{value:!e.spec.disabled,checked:!e.spec.disabled,onChange:n=>t({...e,spec:{...e.spec,disabled:!n.target.checked}})})})})}function erx({value:e,onChange:t,...n}){return(0,eb.jsxs)(eC.A,{gap:2,sx:{width:"100%"},mt:1,...n,children:[(0,eb.jsxs)(pP,{select:!0,label:"Kind",value:e.kind,onChange:n=>t({...e,kind:n}),children:[(0,eb.jsx)(fI.A,{value:"JoinByColumnValue",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Join by column value"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Regroup rows with equal cell value in a column"})]})}),(0,eb.jsx)(fI.A,{value:"MergeColumns",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Merge columns"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Multiple columns are merged to one column"})]})}),(0,eb.jsx)(fI.A,{value:"MergeIndexedColumns",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Merge indexed columns"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Indexed columns are merged to one column"})]})}),(0,eb.jsx)(fI.A,{value:"MergeSeries",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Merge series"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Series will be merged by their labels"})]})})]}),"JoinByColumnValue"===e.kind&&(0,eb.jsx)(erg,{value:e,onChange:t}),"MergeColumns"===e.kind&&(0,eb.jsx)(erm,{value:e,onChange:t}),"MergeIndexedColumns"===e.kind&&(0,eb.jsx)(erv,{value:e,onChange:t}),"MergeSeries"===e.kind&&(0,eb.jsx)(ery,{value:e,onChange:t})]})}function erb({index:e,value:t,isCollapsed:n,onChange:i,onCollapse:r,onDelete:o,...a}){return(0,eb.jsxs)(eC.A,{...a,children:[(0,eb.jsxs)(eC.A,{direction:"row",alignItems:"center",borderBottom:1,borderColor:e=>e.palette.divider,justifyContent:"space-between",gap:4,children:[(0,eb.jsxs)(eC.A,{direction:"row",gap:1,children:[(0,eb.jsx)(eM.A,{"data-testid":`transform-toggle#${e}`,size:"small",onClick:()=>r(!n),children:n?(0,eb.jsx)(erd,{}):(0,eb.jsx)(erh,{})}),(0,eb.jsx)(pd.A,{variant:"overline",component:"h4",sx:{textTransform:"none"},children:t.kind?(0,eb.jsx)("span",{children:(0,eb.jsx)("strong",{children:ra[t.kind]})}):(0,eb.jsx)("strong",{children:"Select a transformation kind"})})]}),(0,eb.jsxs)(eC.A,{direction:"row",gap:1,children:[n&&(0,eb.jsxs)(eb.Fragment,{children:[(0,eb.jsx)(pC.A,{title:t.spec?.disabled?"Enable transformation":"Disable transformation",placement:"top",children:(0,eb.jsx)(eM.A,{size:"small",sx:{marginLeft:"auto"},onClick:function(){i({...t,spec:{...t.spec,disabled:!t.spec?.disabled}})},children:t.spec?.disabled?(0,eb.jsx)(erf,{}):(0,eb.jsx)(erp,{})})}),(0,eb.jsx)(pb.A,{flexItem:!0,orientation:"vertical",variant:"middle"})]}),(0,eb.jsx)(pC.A,{title:"Remove transformation",placement:"top",children:(0,eb.jsx)(eM.A,{size:"small",sx:{marginLeft:"auto"},onClick:o,children:(0,eb.jsx)(Kx,{})})})]})]}),!n&&(0,eb.jsx)(erx,{value:t,onChange:i})]})}function erw({value:e,onChange:t,...n}){let[i,r]=(0,eI.useState)(e.map(()=>!0));return(0,eb.jsxs)(eC.A,{gap:1,...n,children:[e.map((n,o)=>(0,eb.jsx)(erb,{index:o,value:n,isCollapsed:i[o]??!0,onChange:n=>{let i;(i=[...e])[o]=n,t(i)},onDelete:()=>{let n;(n=[...e]).splice(o,1),t(n),r(e=>(e.splice(o,1),[...e]))},onCollapse:e=>{r(t=>(t[o]=e,[...t]))}},o)),(0,eb.jsx)(eS.A,{variant:"contained",startIcon:(0,eb.jsx)(Ky,{}),sx:{marginTop:1},onClick:function(){let n=[...e];n.push({kind:"",spec:{}}),t(n),r(e=>(e.push(!1),[...e]))},children:"Add Transformation"})]})}function erS(e){let{value:t,onChange:n,timeOptions:i,height:r}=e,o=(0,eI.useMemo)(()=>{if(t&&!i.some(e=>e.value.pastDuration===t))return(0,eb.jsx)(fI.A,{value:t,children:t})},[i,t]);return(0,eb.jsx)(p3.A,{children:(0,eb.jsx)(ua.A,{children:(0,eb.jsxs)(fD.A,{id:"refreshInterval",value:t,onChange:e=>{n(e.target.value)},inputProps:{"aria-label":`Select refresh interval. Currently set to ${t}`},sx:{".MuiSelect-select":r?{lineHeight:r,paddingY:0}:{}},children:[i.map((e,t)=>(0,eb.jsx)(fI.A,{value:e.value.pastDuration,children:e.display},t)),o]})})})}function er_({repeatItems:e,maxPer:t,gap:n,renderItem:i,containerSx:r,rowSx:o}){let{rows:a,perRow:s}=(0,eI.useMemo)(()=>{let n=Math.max(1,t),i=[];for(let t=0;t<e.length;t+=n)i.push(e.slice(t,t+n));return{rows:i,perRow:n}},[t,e]);return(0,eb.jsx)(ua.A,{sx:[{display:"flex",flexDirection:"column",width:"100%",height:"100%",gap:`${n}px`},...Array.isArray(r)?r:[r]],children:a.map((e,t)=>(0,eb.jsx)(ua.A,{sx:[{display:"flex",gap:`${n}px`},...Array.isArray(o)?o:[o]],children:e.map((e,r)=>(0,eb.jsx)(ua.A,{sx:{width:`calc((100% - ${n*(s-1)}px) / ${s})`,overflow:"hidden"},children:i(e,{rowIndex:t,colIndex:r})},`${t}-${r}`))},t))})}var erC=n(54381);let erM=({mapping:e,onChange:t,...n})=>{switch(e.kind){case"Value":return(0,eb.jsx)(eC.A,{gap:1,direction:"row",...n,children:(0,eb.jsx)(eA.A,{label:"Value",placeholder:"Exact value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{...e.spec,value:n.target.value}}),fullWidth:!0})});case"Range":return(0,eb.jsxs)(eC.A,{gap:1,direction:"row",...n,children:[(0,eb.jsx)(eA.A,{label:"From",placeholder:"Start of range",value:e.spec?.from??"",onChange:n=>t({...e,spec:{...e.spec,from:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0}),(0,eb.jsx)(eA.A,{label:"To",placeholder:"End of range (inclusive)",value:e.spec?.to??"",onChange:n=>t({...e,spec:{...e.spec,to:""===n.target.value?void 0:+n.target.value}}),fullWidth:!0})]});case"Regex":return(0,eb.jsx)(eC.A,{gap:1,direction:"row",...n,children:(0,eb.jsx)(eA.A,{label:"Regular Expression",placeholder:"JavaScript regular expression",value:e.spec?.pattern??"",onChange:n=>t({...e,spec:{...e.spec,pattern:n.target.value}}),fullWidth:!0})});case"Misc":return(0,eb.jsx)(eC.A,{gap:1,direction:"row",...n,children:(0,eb.jsxs)(eA.A,{select:!0,label:"Value",value:e.spec?.value??"",onChange:n=>t({...e,spec:{value:n.target.value}}),SelectProps:{renderValue:e=>{switch(e){case"empty":return"Empty";case"null":return"Null";case"NaN":return"NaN";case"true":return"True";case"false":return"False";default:return String(e)}}},fullWidth:!0,children:[(0,eb.jsx)(fI.A,{value:"empty",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Empty"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches empty string"})]})}),(0,eb.jsx)(fI.A,{value:"null",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Null"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches null or undefined"})]})}),(0,eb.jsx)(fI.A,{value:"NaN",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"NaN"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches Not a Number value"})]})}),(0,eb.jsx)(fI.A,{value:"true",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"True"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches true boolean"})]})}),(0,eb.jsx)(fI.A,{value:"false",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"False"}),(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches false boolean"})]})})]})});default:return null}},erA=({mapping:e,onChange:t,onDelete:n,...i})=>{let r=n=>{t({...e,spec:{...e.spec,result:{...e.spec.result,color:n}}})};return(0,eb.jsxs)(erC.A,{container:!0,spacing:2,...i,children:[(0,eb.jsx)(erC.A,{size:{xs:5},children:(0,eb.jsxs)(eC.A,{direction:"row",gap:1,width:"100%",children:[(0,eb.jsxs)(eA.A,{select:!0,label:"Type",value:e.kind,onChange:n=>t({...e,kind:n.target.value}),required:!0,sx:{width:"120px"},children:[(0,eb.jsx)(fI.A,{value:"Value",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Value"}),"Value"!==e.kind&&(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches an exact text value"})]})}),(0,eb.jsx)(fI.A,{value:"Range",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Range"}),"Range"!==e.kind&&(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches against a numerical range"})]})}),(0,eb.jsx)(fI.A,{value:"Regex",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Regex"}),"Regex"!==e.kind&&(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches against a regular expression"})]})}),(0,eb.jsx)(fI.A,{value:"Misc",children:(0,eb.jsxs)(eC.A,{children:[(0,eb.jsx)(pd.A,{children:"Misc"}),"Misc"!==e.kind&&(0,eb.jsx)(pd.A,{variant:"caption",children:"Matches against empty, null and NaN values"})]})})]}),(0,eb.jsx)(erM,{width:"100%",mapping:e,onChange:n=>t({...e,...n})})]})}),(0,eb.jsx)(erC.A,{size:{xs:4},children:(0,eb.jsx)(eA.A,{label:"Display text",value:e.spec?.result?.value??"",onChange:n=>t({...e,spec:{...e.spec,result:{...e.spec?.result,value:n.target.value}}}),fullWidth:!0})}),(0,eb.jsx)(erC.A,{size:{xs:1},children:(0,eb.jsx)(eC.A,{direction:"row",justifyContent:"center",gap:1,children:e.spec?.result?.color?(0,eb.jsx)(ui,{label:"Color",color:e.spec.result.color??"#000",onColorChange:r,onClear:()=>r(void 0)}):(0,eb.jsx)(eM.A,{onClick:()=>r("#000"),children:(0,eb.jsx)(Ky,{})})})}),(0,eb.jsx)(erC.A,{size:{xs:1},textAlign:"end",children:(0,eb.jsx)(pC.A,{title:"Remove mapping settings",placement:"top",children:(0,eb.jsx)(eM.A,{size:"small",sx:{marginLeft:"auto"},onClick:n,children:(0,eb.jsx)(Kx,{})})})})]})},erk=({mappings:e,onChange:t})=>{let[n,i]=(0,eI.useState)(e);return(0,eb.jsxs)(eC.A,{spacing:1,children:[(0,eb.jsxs)(erC.A,{container:!0,spacing:2,children:[(0,eb.jsx)(erC.A,{size:{xs:5},children:(0,eb.jsx)(pd.A,{variant:"subtitle1",children:"Condition"})}),(0,eb.jsx)(erC.A,{size:{xs:4},children:(0,eb.jsx)(pd.A,{variant:"subtitle1",children:"Display Text"})}),(0,eb.jsx)(erC.A,{size:{xs:1},textAlign:"center",children:(0,eb.jsx)(pd.A,{variant:"subtitle1",children:"Color"})}),(0,eb.jsx)(erC.A,{size:{xs:1}})]}),(0,eb.jsx)(eC.A,{gap:1.5,divider:(0,eb.jsx)(pb.A,{flexItem:!0,orientation:"horizontal"}),children:n.map((e,r)=>(0,eb.jsx)(erA,{mapping:e,onChange:e=>{let o;(o=[...n])[r]=e,i(o),t(o)},onDelete:()=>{let e;(e=[...n]).splice(r,1),i(e),t(e)}},r))}),(0,eb.jsx)(eS.A,{variant:"contained",startIcon:(0,eb.jsx)(Ky,{}),sx:{marginTop:1},onClick:function(){let e=[...n];e.push({kind:"Value",spec:{result:{value:""}}}),i(e),t(e)},children:"Add value mappings"})]})}}}]);
|