@stlite/desktop 0.91.2 → 0.92.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/README.md +10 -0
  3. package/build/assets/{ErrorOutline.esm-CBPRrcCq-C9-TIHiy.js → ErrorOutline.esm-B7r5abii-8TGLClC0.js} +1 -1
  4. package/build/assets/{FileDownload.esm-zztsCQgv-C5piFaVt.js → FileDownload.esm-CYy3w3Vv-BwlEuFJu.js} +1 -1
  5. package/build/assets/{FileHelper-D9iak492-B1kwMP-N.js → FileHelper-8inOMdj8-8VXLhO12.js} +1 -1
  6. package/build/assets/{FormClearHelper-B-0AN2KG-drNJ-Zdq.js → FormClearHelper-DcUb9gFm-uvoV81fq.js} +1 -1
  7. package/build/assets/{Hooks-BLb3umpI-CC08A2wx.js → Hooks-BLb3umpI-BjA4i06_.js} +1 -1
  8. package/build/assets/{InputInstructions-w5hPdqFC-DnPj3I4S.js → InputInstructions-CWrzjlV--n3Hf1PP9.js} +1 -1
  9. package/build/assets/{Particles-DQoPZNo9-BWmBxXhd.js → Particles-DtETFR7S-2aUDxKFJ.js} +1 -1
  10. package/build/assets/{ProgressBar-DlHaaa-z-DdC3oXz0.js → ProgressBar-Q8F-JGwo-LczZQzat.js} +1 -1
  11. package/build/assets/{Toolbar-Cau3SOTY-cJ6wtM04.js → Toolbar-Dj6ALImb-BVamUnHI.js} +1 -1
  12. package/build/assets/{base-input-D-Fvddky-3QuAUeGB.js → base-input-GLmTpqXt-CImyaDRq.js} +1 -1
  13. package/build/assets/{checkbox-CjcIG3na-LB8a9-d7.js → checkbox-CEGFZTJa-C72AFGdh.js} +1 -1
  14. package/build/assets/{createSuper-B81LEHTk-DVB4ulOX.js → createSuper-DBoQFSgk-BYJ7jbld.js} +1 -1
  15. package/build/assets/{data-grid-overlay-editor-C7-8Z8CC-CmhK1L1G.js → data-grid-overlay-editor-KB2z8mJP-C62BT9jT.js} +1 -1
  16. package/build/assets/{downloader-DcCTL3Wz-DfHnsO-D.js → downloader-DcCTL3Wz-DCpITTU1.js} +1 -1
  17. package/build/assets/{es6--XPcqeHG-CU-P5RWV.js → es6--XPcqeHG-DhJ5N6cn.js} +2 -2
  18. package/build/assets/{iframeResizer.contentWindow-vAQsQkcx-DjDgPkx5.js → iframeResizer.contentWindow-B8PMRo_J-DvNzNbbR.js} +1 -1
  19. package/build/assets/{index-6t9Tq-Ab-Cc_ees8I.js → index-B4C0HP4d-BkRIYQ6B.js} +1 -1
  20. package/build/assets/{index-DEKI5kx7-B8lK1On8.js → index-B8DruXv7-BsVgHQy8.js} +1 -1
  21. package/build/assets/{index-D6OV4wQy-CQIpYALu.js → index-BEhJ1GQx-Bd2m54CP.js} +1 -1
  22. package/build/assets/{index-Da8BucgM-CDMzLZMq.js → index-BIgXGMHt-JW2hwTbx.js} +1 -1
  23. package/build/assets/{index-BxpEVUJq.js → index-BIyIgwS4.js} +10 -10
  24. package/build/assets/{index-DVo6TdD5-Cigl7ucs.js → index-BOT4J8P2-nhENc6Pb.js} +1 -1
  25. package/build/assets/{index-Bx1YyC6x-bUWv5Yyf.js → index-BUQFjfFe-DhpyxZBa.js} +1 -1
  26. package/build/assets/{index-oFRA4JRK-kx0e_3zA.js → index-BcOX_8Yb-BQhvH4hh.js} +1 -1
  27. package/build/assets/{index-BNeCf0z6-eizg-dFz.js → index-BeQFPWOx-B1_VBork.js} +1 -1
  28. package/build/assets/{index-DqAvSOqr-BCGTFud5.js → index-BlHNutXS-Bf1cUsIS.js} +1 -1
  29. package/build/assets/{index-B5h0Xgw3-CNFqm9ip.js → index-Bn_Q7wro-BclOBnF3.js} +1 -1
  30. package/build/assets/{index-vdN_5NIh-CyyygayY.js → index-Bqaw3D2g-DJFA3vu1.js} +1 -1
  31. package/build/assets/{index-Ds3R2kL1-CFh_Kz3Y.js → index-BvmneqQT-C6pM51YE.js} +1 -1
  32. package/build/assets/{index-C5FPtYYS-BTTgdUI2.js → index-C43v7-zt-XSOlpSRO.js} +1 -1
  33. package/build/assets/{index--hiX6Uwv-DtKO9Hld.js → index-C5n_E3xJ-C9GlH5Bh.js} +1 -1
  34. package/build/assets/{index-COXlYbHo-B2m8urCs.js → index-C9MF7a8p-1U1wjf1z.js} +1 -1
  35. package/build/assets/{index-D4OS_mB9-BwMU_oxN.js → index-C9t9keZs-Cj8jGlNq.js} +1 -1
  36. package/build/assets/{index-JJq6JoHy-CX1Omp_x.js → index-CCBxT-Px-B32Uy-Qk.js} +1 -1
  37. package/build/assets/{index-D9xjkRNt-CFe8X0f3.js → index-CKhpdqU4-B-ULAgQ3.js} +1 -1
  38. package/build/assets/{index-Bt2pmgaJ-ymksNLCl.js → index-CRwtTJoc-DxkxT91b.js} +5 -5
  39. package/build/assets/{index-CUH8SI0g-CgCG3Tq7.js → index-CVVkGp8U-OXoobo4A.js} +1 -1
  40. package/build/assets/{index-BXbsmcnm-D0BJVs7R.js → index-CmxogrTC-CmhUjGHI.js} +1 -1
  41. package/build/assets/{index-PfjJDWy5-DkldmeJ8.js → index-DGEZt8XB-BPwUD6x9.js} +1 -1
  42. package/build/assets/{index-CeUKVR_x-6fYziq6X.js → index-DIlmdxHH-DZzaykGG.js} +1 -1
  43. package/build/assets/{index-CR_1rzEZ-DaqWZNME.js → index-DQkZMKcP-qmoywAyX.js} +1 -1
  44. package/build/assets/{index-D5GvvN8r-CL05rAIV.js → index-DXzYmrGv-DMgQyWr1.js} +1 -1
  45. package/build/assets/{index-FbSORAjW-Lthz52ML.js → index-DpJLAqiz-BkX4MLEb.js} +1 -1
  46. package/build/assets/{index-D8AcUh2z-BvmWAicd.js → index-Dws1I0Ds-DN2TZwAq.js} +1 -1
  47. package/build/assets/{index-BDD6ManL-XC9-hEWd.js → index-E8OLJqjb-DnzI_NxU.js} +1 -1
  48. package/build/assets/{index-kgY8PEpO-BUILDAe7.js → index-EY_iYK3N-Bp22waFF.js} +1 -1
  49. package/build/assets/{index-BDtR3I-m-C6v_enzF.js → index-MLOYywLc-D7-SprmM.js} +1 -1
  50. package/build/assets/{index-DbIPIRRU-UJS7GIgX.js → index-gFid1htU-BDjIBtvA.js} +1 -1
  51. package/build/assets/{index-D9Ww6wIM-CODTYNKi.js → index-h6RjFy4Y-C5de9ASo.js} +1 -1
  52. package/build/assets/{index-CL9VPrGG-DvzaBWYj.js → index-hQQyMr9F-eQNYPxka.js} +1 -1
  53. package/build/assets/{index-DYssp6us-ss1M0SKX.js → index-kEUlOODQ-D3h_Flo2.js} +1 -1
  54. package/build/assets/{index-OAJkEMe--vGYqEFkN.js → index-nCXiKSAh-DSiervQu.js} +1 -1
  55. package/build/assets/{index-DBM8Q3zu-1UaS0Le1.js → index-oX5euHW0-C-SIRbDl.js} +1 -1
  56. package/build/assets/{inherits-DIXnBNlu-DQhXiByk.js → inherits-BwU0tCO4-DkeIG_qH.js} +1 -1
  57. package/build/assets/{input-D3V-zfyu-Ca751_uU.js → input-DMrd22sk-UYShFfZu.js} +1 -1
  58. package/build/assets/{memory-B3L1Fctl-DNb7NEQl.js → memory-B3L1Fctl-WytsaLFU.js} +1 -1
  59. package/build/assets/{number-overlay-editor-ChRMsdOl-C6ThLwiC.js → number-overlay-editor-CdbzA3D_-BCwwbhhn.js} +1 -1
  60. package/build/assets/{sandbox-ChAzL-i--FikCfyDW.js → sandbox-ChAzL-i--CpDb1da2.js} +1 -1
  61. package/build/assets/{slicedToArray-BPQXLGHq-C21Y2TxO.js → slicedToArray-CQ1aOJ-Q-fFO-C-TS.js} +1 -1
  62. package/build/assets/{timepicker-B0aGGgzd-sxFvpbfo.js → timepicker-DZap2iV8-CkcqVZT5.js} +1 -1
  63. package/build/assets/{uniqueId-MHj2wT7u-DPxsodx6.js → uniqueId-Dmqdy5md-DdrLw8YB.js} +1 -1
  64. package/build/assets/{useBasicWidgetState-zjZCXhqV-BNiFnFun.js → useBasicWidgetState-DH5OpqC3-H5wMmJFo.js} +1 -1
  65. package/build/assets/{useTextInputAutoExpand-ox95UJrD-CZJQOtsK.js → useTextInputAutoExpand-B5nEdsJC-DTKFLxU2.js} +1 -1
  66. package/build/assets/{useUpdateUiValue-Yj1mvLxf-DIZzUp3u.js → useUpdateUiValue-CzJ3I42c-D42S2lbA.js} +1 -1
  67. package/build/assets/{withFullScreenWrapper-Ca0mIjWH-ClODS1xe.js → withFullScreenWrapper-CsmVH3u1-BwamaUTy.js} +1 -1
  68. package/build/index.html +1 -1
  69. package/package.json +3 -3
  70. package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
@@ -1,4 +1,4 @@
1
- import{r as reactExports,j as jsxRuntimeExports}from"./index-BxpEVUJq.js";const main=(function(T,V,t,k){t===void 0&&(t={}),k===void 0&&(k={});const E={},v=function(f){if(typeof f=="number")return f;if(f==="bokehjs")return V;if(!k[f]){const o="@bokehjs/";f.slice(0,o.length)===o&&(f=f.slice(o.length))}const d=t[f];if(d!=null)return d;const u=f.length>0&&f[f.lenght-1]==="/";return t[f+(u?"":"/")+"index"]??f},b=function(f){let d=E[f];if(!d){const u=v(f);if(d=E[u],d)E[f]=d;else{let i=function(){Object.defineProperty(d.exports,"__esModule",{value:!0})},o=function(r,e){Object.defineProperty(d.exports,r,{enumerable:!0,get:function(){return e}})};if(!T[u]){if(k[u]===!1||k[u]==!0&&parent_require)try{return d={exports:k[u]?parent_require(u):{}},E[u]=E[f]=d,d.exports}catch{}const r=new Error("Cannot find module '"+f+"'");throw r.code="MODULE_NOT_FOUND",r}d={exports:{}},E[u]=E[f]=d,T[u].call(d.exports,b,d,d.exports,i,o)}}return d.exports};b.resolve=function(f){return""};const w=b(V);return w.require=b,typeof Proxy<"u"&&(w.loader=new Proxy({},{get:function(f,d){return b(d)}})),w.register_plugin=function(f,d,u,i){u===void 0&&(u={}),i===void 0&&(i={});for(let r in f)T[r]=f[r];for(let r in u)t[r]=u[r];for(let r in i)k[r]=i[r];const o=b(d);for(let r in o)w[r]=o[r];return o},w})([function(T,V,t,k,E){k(),(0,T(1).__exportStar)(T(2),t)},function(T,V,t,k,E){k();var v=function(u,i){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(o[e]=r[e])},v(u,i)};t.__extends=function(u,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=u}v(u,i),u.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)};function b(u){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&u[i],r=0;if(o)return o.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&r>=u.length&&(u=void 0),{value:u&&u[r++],done:!u}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(u,i){var o=typeof Symbol=="function"&&u[Symbol.iterator];if(!o)return u;var r,e,s=o.call(u),a=[];try{for(;(i===void 0||i-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(c){e={error:c}}finally{try{r&&!r.done&&(o=s.return)&&o.call(s)}finally{if(e)throw e.error}}return a}function f(u){return this instanceof f?(this.v=u,this):new f(u)}t.__assign=function(){return t.__assign=Object.assign||function(u){for(var i,o=1,r=arguments.length;o<r;o++)for(var e in i=arguments[o])Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return u},t.__assign.apply(this,arguments)},t.__rest=function(u,i){var o={};for(var r in u)Object.prototype.hasOwnProperty.call(u,r)&&i.indexOf(r)<0&&(o[r]=u[r]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function"){var e=0;for(r=Object.getOwnPropertySymbols(u);e<r.length;e++)i.indexOf(r[e])<0&&Object.prototype.propertyIsEnumerable.call(u,r[e])&&(o[r[e]]=u[r[e]])}return o},t.__decorate=function(u,i,o,r){var e,s=arguments.length,a=s<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,o):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(u,i,o,r);else for(var c=u.length-1;c>=0;c--)(e=u[c])&&(a=(s<3?e(a):s>3?e(i,o,a):e(i,o))||a);return s>3&&a&&Object.defineProperty(i,o,a),a},t.__param=function(u,i){return function(o,r){i(o,r,u)}},t.__metadata=function(u,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(u,i)},t.__awaiter=function(u,i,o,r){return new(o||(o=Promise))(function(e,s){function a(Q){try{l(r.next(Q))}catch(m){s(m)}}function c(Q){try{l(r.throw(Q))}catch(m){s(m)}}function l(Q){var m;Q.done?e(Q.value):(m=Q.value,m instanceof o?m:new o(function(p){p(m)})).then(a,c)}l((r=r.apply(u,i||[])).next())})},t.__generator=function(u,i){var o,r,e,s,a={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(l){return function(Q){return(function(m){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(e=2&m[0]?r.return:m[0]?r.throw||((e=r.return)&&e.call(r),0):r.next)&&!(e=e.call(r,m[1])).done)return e;switch(r=0,e&&(m=[2&m[0],e.value]),m[0]){case 0:case 1:e=m;break;case 4:return a.label++,{value:m[1],done:!1};case 5:a.label++,r=m[1],m=[0];continue;case 7:m=a.ops.pop(),a.trys.pop();continue;default:if(e=a.trys,!((e=e.length>0&&e[e.length-1])||m[0]!==6&&m[0]!==2)){a=0;continue}if(m[0]===3&&(!e||m[1]>e[0]&&m[1]<e[3])){a.label=m[1];break}if(m[0]===6&&a.label<e[1]){a.label=e[1],e=m;break}if(e&&a.label<e[2]){a.label=e[2],a.ops.push(m);break}e[2]&&a.ops.pop(),a.trys.pop();continue}m=i.call(u,a)}catch(p){m=[6,p],r=0}finally{o=e=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([l,Q])}}},t.__createBinding=Object.create?function(u,i,o,r){r===void 0&&(r=o),Object.defineProperty(u,r,{enumerable:!0,get:function(){return i[o]}})}:function(u,i,o,r){r===void 0&&(r=o),u[r]=i[o]},t.__exportStar=function(u,i){for(var o in u)o==="default"||Object.prototype.hasOwnProperty.call(i,o)||(0,t.__createBinding)(i,u,o)},t.__values=b,t.__read=w,t.__spread=function(){for(var u=[],i=0;i<arguments.length;i++)u=u.concat(w(arguments[i]));return u},t.__spreadArrays=function(){for(var u=0,i=0,o=arguments.length;i<o;i++)u+=arguments[i].length;var r=Array(u),e=0;for(i=0;i<o;i++)for(var s=arguments[i],a=0,c=s.length;a<c;a++,e++)r[e]=s[a];return r},t.__spreadArray=function(u,i,o){if(o||arguments.length===2)for(var r,e=0,s=i.length;e<s;e++)!r&&e in i||(r||(r=Array.prototype.slice.call(i,0,e)),r[e]=i[e]);return u.concat(r||Array.prototype.slice.call(i))},t.__await=f,t.__asyncGenerator=function(u,i,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,e=o.apply(u,i||[]),s=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(p){e[p]&&(r[p]=function(y){return new Promise(function(g,L){s.push([p,y,g,L])>1||c(p,y)})})}function c(p,y){try{(g=e[p](y)).value instanceof f?Promise.resolve(g.value.v).then(l,Q):m(s[0][2],g)}catch(L){m(s[0][3],L)}var g}function l(p){c("next",p)}function Q(p){c("throw",p)}function m(p,y){p(y),s.shift(),s.length&&c(s[0][0],s[0][1])}},t.__asyncDelegator=function(u){var i,o;return i={},r("next"),r("throw",function(e){throw e}),r("return"),i[Symbol.iterator]=function(){return this},i;function r(e,s){i[e]=u[e]?function(a){return(o=!o)?{value:f(u[e](a)),done:e==="return"}:s?s(a):a}:s}},t.__asyncValues=function(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,o=u[Symbol.asyncIterator];return o?o.call(u):(u=b(u),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(e){i[e]=u[e]&&function(s){return new Promise(function(a,c){(function(l,Q,m,p){Promise.resolve(p).then(function(y){l({value:y,done:m})},Q)})(a,c,(s=u[e](s)).done,s.value)})}}},t.__makeTemplateObject=function(u,i){return Object.defineProperty?Object.defineProperty(u,"raw",{value:i}):u.raw=i,u};var d=Object.create?function(u,i){Object.defineProperty(u,"default",{enumerable:!0,value:i})}:function(u,i){u.default=i};t.__importStar=function(u){if(u&&u.__esModule)return u;var i={};if(u!=null)for(var o in u)o!=="default"&&Object.prototype.hasOwnProperty.call(u,o)&&(0,t.__createBinding)(i,u,o);return d(i,u),i},t.__importDefault=function(u){return u&&u.__esModule?u:{default:u}},t.__classPrivateFieldGet=function(u,i,o,r){if(o==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?u!==i||!r:!i.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?r:o==="a"?r.call(u):r?r.value:i.get(u)},t.__classPrivateFieldSet=function(u,i,o,r,e){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!e)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?u!==i||!e:!i.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?e.call(u,o):e?e.value=o:i.set(u,o),o}},function(T,V,t,k,E){k();const v=T(1);E("version",T(3).version),E("index",T(4).index),t.embed=(0,v.__importStar)(T(4)),t.protocol=(0,v.__importStar)(T(406)),t._testing=(0,v.__importStar)(T(407));var b=T(19);E("logger",b.logger),E("set_log_level",b.set_log_level),E("settings",T(28).settings),E("Models",T(7).Models),E("documents",T(5).documents),E("safely",T(408).safely)},function(T,V,t,k,E){k(),t.version="2.4.3"},function(T,V,t,k,E){k();const v=T(5),b=T(19),w=T(34),f=T(13),d=T(8),u=T(16),i=T(397),o=T(399),r=T(398);var e=T(397);E("add_document_standalone",e.add_document_standalone),E("index",e.index),E("add_document_from_session",T(399).add_document_from_session);var s=T(404);async function a(c,l,Q,m){(0,d.isString)(c)&&(c=JSON.parse((0,w.unescape)(c)));const p={};for(const[g,L]of(0,f.entries)(c))p[g]=v.Document.from_json(L);const y=[];for(const g of l){const L=(0,r._resolve_element)(g),A=(0,r._resolve_root_elements)(g);if(g.docid!=null)y.push(await(0,i.add_document_standalone)(p[g.docid],L,A,g.use_for_title));else{if(g.token==null)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const x=(0,o._get_ws_url)(Q,m);b.logger.debug(`embed: computed ws url: ${x}`);try{y.push(await(0,o.add_document_from_session)(x,g.token,L,A,g.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(H){console.log("Error rendering Bokeh items:",H)}}}}return y}E("embed_items_notebook",s.embed_items_notebook),E("kernels",s.kernels),E("BOKEH_ROOT",T(398).BOKEH_ROOT),t.embed_item=async function(c,l){const Q={},m=(0,w.uuid4)();Q[m]=c.doc,l==null&&(l=c.target_id),document.getElementById(l)?.classList.add(r.BOKEH_ROOT);const y={roots:{[c.root_id]:l},root_ids:[c.root_id],docid:m};await(0,u.defer)();const[g]=await a(Q,[y]);return g},t.embed_items=async function(c,l,Q,m){return await(0,u.defer)(),a(c,l,Q,m)}},function(T,V,t,k,E){k();const v=T(1);(0,v.__exportStar)(T(6),t),(0,v.__exportStar)(T(35),t)},function(T,V,t,k,E){k();const v=T(1),b=T(7),w=T(3),f=T(19),d=T(251),u=T(14),i=T(30),o=T(15),r=T(17),e=T(31),s=T(29),a=T(9),c=T(13),l=(0,v.__importStar)(T(77)),Q=T(26),m=T(8),p=T(309),y=T(75),g=T(53),L=T(396),A=T(35);class x{constructor(M){this.document=M,this.session=null,this.subscribed_models=new Set}send_event(M){const C=new A.MessageSentEvent(this.document,"bokeh_event",M.to_json());this.document._trigger_on_change(C)}trigger(M){for(const C of this.subscribed_models)M.origin!=null&&M.origin!=C||C._process_event(M)}}t.EventManager=x,x.__name__="EventManager",t.documents=[],t.DEFAULT_TITLE="Bokeh Application";class H{constructor(M){var C;t.documents.push(this),this._init_timestamp=Date.now(),this._resolver=(C=M?.resolver)!==null&&C!==void 0?C:new b.ModelResolver,this._title=t.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._all_models_freeze_count=0,this._callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new x(this),this.idle=new o.Signal0(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}get layoutables(){return this._roots.filter(M=>M instanceof p.LayoutDOM)}get is_idle(){for(const M of this.layoutables)if(!this._idle_roots.has(M))return!1;return!0}notify_idle(M){this._idle_roots.set(M,!0),this.is_idle&&(f.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new d.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(M,C=null){this._interactive_plot==null&&(this._interactive_plot=M,this._interactive_plot.trigger_event(new d.LODStart)),this._interactive_finalize=C,this._interactive_timestamp=Date.now()}interactive_stop(){this._interactive_plot!=null&&(this._interactive_plot.trigger_event(new d.LODEnd),this._interactive_finalize!=null&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return this._interactive_timestamp==null?-1:Date.now()-this._interactive_timestamp}destructively_move(M){if(M===this)throw new Error("Attempted to overwrite a document with itself");M.clear();const C=(0,a.copy)(this._roots);this.clear();for(const R of C)if(R.document!=null)throw new Error(`Somehow we didn't detach ${R}`);if(this._all_models.size!=0)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const R of C)M.add_root(R);M.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,this._all_models_freeze_count===0&&this._recompute_all_models()}_invalidate_all_models(){f.logger.debug("invalidating document models"),this._all_models_freeze_count===0&&this._recompute_all_models()}_recompute_all_models(){let M=new Set;for(const z of this._roots)M=l.union(M,z.references());const C=new Set(this._all_models.values()),R=l.difference(C,M),D=l.difference(M,C),B=new Map;for(const z of M)B.set(z.id,z);for(const z of R)z.detach_document();for(const z of D)z.attach_document(this);this._all_models=B}roots(){return this._roots}add_root(M,C){if(f.logger.debug(`Adding root: ${M}`),!(0,a.includes)(this._roots,M)){this._push_all_models_freeze();try{this._roots.push(M)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new A.RootAddedEvent(this,M,C))}}remove_root(M,C){const R=this._roots.indexOf(M);if(!(R<0)){this._push_all_models_freeze();try{this._roots.splice(R,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new A.RootRemovedEvent(this,M,C))}}title(){return this._title}set_title(M,C){M!==this._title&&(this._title=M,this._trigger_on_change(new A.TitleChangedEvent(this,M,C)))}get_model_by_id(M){var C;return(C=this._all_models.get(M))!==null&&C!==void 0?C:null}get_model_by_name(M){const C=[];for(const R of this._all_models.values())R instanceof g.Model&&R.name==M&&C.push(R);switch(C.length){case 0:return null;case 1:return C[0];default:throw new Error(`Multiple models are named '${M}'`)}}on_message(M,C){const R=this._message_callbacks.get(M);R==null?this._message_callbacks.set(M,new Set([C])):R.add(C)}remove_on_message(M,C){var R;(R=this._message_callbacks.get(M))===null||R===void 0||R.delete(C)}_trigger_on_message(M,C){const R=this._message_callbacks.get(M);if(R!=null)for(const D of R)D(C)}on_change(M,C=!1){this._callbacks.has(M)||this._callbacks.set(M,C)}remove_on_change(M){this._callbacks.delete(M)}_trigger_on_change(M){for(const[C,R]of this._callbacks)if(!R&&M instanceof A.DocumentEventBatch)for(const D of M.events)C(D);else C(M)}_notify_change(M,C,R,D,B){this._trigger_on_change(new A.ModelChangedEvent(this,M,C,R,D,B?.setter_id,B?.hint))}static _instantiate_object(M,C,R,D){const B=Object.assign(Object.assign({},R),{id:M,__deferred__:!0});return new(D.get(C))(B)}static _instantiate_references_json(M,C,R){var D;const B=new Map;for(const z of M){const N=z.id,I=z.type,O=(D=z.attributes)!==null&&D!==void 0?D:{};let G=C.get(N);G==null&&(G=H._instantiate_object(N,I,O,R),z.subtype!=null&&G.set_subtype(z.subtype)),B.set(G.id,G)}return B}static _resolve_refs(M,C,R,D){function B(z){var N;if((0,r.is_ref)(z)){const I=(N=C.get(z.id))!==null&&N!==void 0?N:R.get(z.id);if(I!=null)return I;throw new Error(`reference ${JSON.stringify(z)} isn't known (not in Document?)`)}if((0,e.is_NDArray_ref)(z)){const{buffer:I,dtype:O,shape:G}=(0,e.decode_NDArray)(z,D);return(0,s.ndarray)(I,{dtype:O,shape:G})}return(0,m.isArray)(z)?(function(I){const O=[];for(const G of I)O.push(B(G));return O})(z):(0,m.isPlainObject)(z)?(function(I){const O={};for(const[G,q]of(0,c.entries)(I))O[G]=B(q);return O})(z):z}return B(M)}static _initialize_references_json(M,C,R,D){const B=new Map;for(const{id:O,attributes:G}of M){const q=!C.has(O),Z=q?R.get(O):C.get(O),U=H._resolve_refs(G,C,R,D);Z.setv(U,{silent:!0}),B.set(O,{instance:Z,is_new:q})}const z=[],N=new Set;function I(O){if(O instanceof u.HasProps){if(B.has(O.id)&&!N.has(O.id)){N.add(O.id);const{instance:G,is_new:q}=B.get(O.id),{attributes:Z}=G;for(const U of(0,c.values)(Z))I(U);q&&(G.finalize(),z.push(G))}}else if((0,m.isArray)(O))for(const G of O)I(G);else if((0,m.isPlainObject)(O))for(const G of(0,c.values)(O))I(G)}for(const O of B.values())I(O.instance);for(const O of z)O.connect_signals()}static _event_for_attribute_change(M,C,R,D,B){if(D.get_model_by_id(M.id).property(C).syncable){const z={kind:"ModelChanged",model:{id:M.id},attr:C,new:R};return u.HasProps._json_record_references(D,R,B,{recursive:!0}),z}return null}static _events_to_sync_objects(M,C,R,D){const B=Object.keys(M.attributes),z=Object.keys(C.attributes),N=(0,a.difference)(B,z),I=(0,a.difference)(z,B),O=(0,a.intersection)(B,z),G=[];for(const q of N)f.logger.warn(`Server sent key ${q} but we don't seem to have it in our JSON`);for(const q of I){const Z=C.attributes[q];G.push(H._event_for_attribute_change(M,q,Z,R,D))}for(const q of O){const Z=M.attributes[q],U=C.attributes[q];Z==null&&U==null||(Z==null||U==null?G.push(H._event_for_attribute_change(M,q,U,R,D)):q=="data"||(0,Q.is_equal)(Z,U)||G.push(H._event_for_attribute_change(M,q,U,R,D)))}return G.filter(q=>q!=null)}static _compute_patch_since_json(M,C){const R=C.to_json(!1);function D(ot){const ft=new Map;for(const Ct of ot.roots.references)ft.set(Ct.id,Ct);return ft}const B=D(M),z=new Map,N=[];for(const ot of M.roots.root_ids)z.set(ot,B.get(ot)),N.push(ot);const I=D(R),O=new Map,G=[];for(const ot of R.roots.root_ids)O.set(ot,I.get(ot)),G.push(ot);if(N.sort(),G.sort(),(0,a.difference)(N,G).length>0||(0,a.difference)(G,N).length>0)throw new Error("Not implemented: computing add/remove of document roots");const q=new Set;let Z=[];for(const ot of C._all_models.keys())if(B.has(ot)){const ft=H._events_to_sync_objects(B.get(ot),I.get(ot),C,q);Z=Z.concat(ft)}const U=new i.Serializer({include_defaults:!1});return U.to_serializable([...q]),{references:[...U.definitions],events:Z}}to_json_string(M=!0){return JSON.stringify(this.to_json(M))}to_json(M=!0){const C=new i.Serializer({include_defaults:M}),R=C.to_serializable(this._roots);return{version:w.version,title:this._title,roots:{root_ids:R.map(D=>D.id),references:[...C.definitions]}}}static from_json_string(M){const C=JSON.parse(M);return H.from_json(C)}static from_json(M){f.logger.debug("Creating Document from JSON");const C=M.version,R=C.indexOf("+")!==-1||C.indexOf("-")!==-1,D=`Library versions: JS (${w.version}) / Python (${C})`;R||w.version.replace(/-(dev|rc)\./,"$1")==C?f.logger.debug(D):(f.logger.warn("JS/Python version mismatch"),f.logger.warn(D));const B=new b.ModelResolver;M.defs!=null&&(0,L.resolve_defs)(M.defs,B);const z=M.roots,N=z.root_ids,I=z.references,O=H._instantiate_references_json(I,new Map,B);H._initialize_references_json(I,new Map,O,new Map);const G=new H({resolver:B});G._push_all_models_freeze();for(const q of N){const Z=O.get(q);Z!=null&&G.add_root(Z)}return G._pop_all_models_freeze(),G.set_title(M.title),G}replace_with_json(M){H.from_json(M).destructively_move(this)}create_json_patch_string(M){return JSON.stringify(this.create_json_patch(M))}create_json_patch(M){for(const D of M)if(D.document!=this)throw new Error("Cannot create a patch using events from a different document");const C=new i.Serializer,R=C.to_serializable(M);for(const D of this._all_models.values())C.remove_def(D);return{events:R,references:[...C.definitions]}}apply_json_patch(M,C=new Map,R){const D=M.references,B=M.events,z=H._instantiate_references_json(D,this._all_models,this._resolver);C instanceof Map||(C=new Map(C));for(const O of B)switch(O.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":{const G=O.model.id,q=this._all_models.get(G);if(q!=null)z.set(G,q);else if(!z.has(G))throw f.logger.warn(`Got an event for unknown model ${O.model}"`),new Error("event model wasn't known");break}}const N=new Map(this._all_models),I=new Map;for(const[O,G]of z)N.has(O)||I.set(O,G);H._initialize_references_json(D,N,I,C);for(const O of B)switch(O.kind){case"MessageSent":{const{msg_type:G,msg_data:q}=O;let Z;if(q===void 0){if(C.size!=1)throw new Error("expected exactly one buffer");{const[[,U]]=C;Z=U}}else Z=H._resolve_refs(q,N,I,C);this._trigger_on_message(G,Z);break}case"ModelChanged":{const G=O.model.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot apply patch to ${G} which is not in the document`);const Z=O.attr,U=H._resolve_refs(O.new,N,I,C);q.setv({[Z]:U},{setter_id:R});break}case"ColumnDataChanged":{const G=O.column_source.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot stream to ${G} which is not in the document`);const Z=H._resolve_refs(O.new,new Map,new Map,C);if(O.cols!=null)for(const U in q.data)U in Z||(Z[U]=q.data[U]);q.setv({data:Z},{setter_id:R,check_eq:!1});break}case"ColumnsStreamed":{const G=O.column_source.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot stream to ${G} which is not in the document`);if(!(q instanceof y.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");const Z=O.data,U=O.rollover;q.stream(Z,U,R);break}case"ColumnsPatched":{const G=O.column_source.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot patch ${G} which is not in the document`);if(!(q instanceof y.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");const Z=O.patches;q.patch(Z,R);break}case"RootAdded":{const G=O.model.id,q=z.get(G);this.add_root(q,R);break}case"RootRemoved":{const G=O.model.id,q=z.get(G);this.remove_root(q,R);break}case"TitleChanged":this.set_title(O.title,R);break;default:throw new Error(`Unknown patch event ${JSON.stringify(O)}`)}}}t.Document=H,H.__name__="Document"},function(T,V,t,k,E){k();const v=T(1),b=T(8),w=T(13),f=T(14);t.overrides={};const d=new Map;t.Models=r=>{const e=t.Models.get(r);if(e!=null)return e;throw new Error(`Model '${r}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)},t.Models.get=r=>{var e;return(e=t.overrides[r])!==null&&e!==void 0?e:d.get(r)},t.Models.register=(r,e)=>{t.overrides[r]=e},t.Models.unregister=r=>{delete t.overrides[r]},t.Models.register_models=(r,e=!1,s)=>{var a;if(r!=null){for(const c of(0,b.isArray)(r)?r:(0,w.values)(r))if(a=c,(0,b.isObject)(a)&&a.prototype instanceof f.HasProps){const l=c.__qualified__;e||!d.has(l)?d.set(l,c):s!=null?s(l):console.warn(`Model '${l}' was already registered`)}}},t.register_models=t.Models.register_models,t.Models.registered_names=()=>[...d.keys()];class u{constructor(){this._known_models=new Map}get(e,s){var a;const c=(a=t.Models.get(e))!==null&&a!==void 0?a:this._known_models.get(e);if(c!=null)return c;if(s!==void 0)return s;throw new Error(`Model '${e}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)}register(e){const s=e.__qualified__;this.get(s,null)==null?this._known_models.set(s,e):console.warn(`Model '${s}' was already registered with this resolver`)}}t.ModelResolver=u,u.__name__="ModelResolver";const i=(0,v.__importStar)(T(38));(0,t.register_models)(i);const o=(0,v.__importStar)(T(392));(0,t.register_models)(o)},function(T,V,t,k,E){k();const v=T(9),b=Object.prototype.toString;function w(r){return r===!0||r===!1||b.call(r)==="[object Boolean]"}function f(r){return b.call(r)==="[object Number]"}function d(r){return b.call(r)==="[object String]"}function u(r){return typeof r=="symbol"}function i(r){const e=typeof r;return e==="function"||e==="object"&&!!r}function o(r){return i(r)&&r[Symbol.iterator]!==void 0}t.isBoolean=w,t.isNumber=f,t.isInteger=function(r){return f(r)&&Number.isInteger(r)},t.isString=d,t.isSymbol=u,t.isPrimitive=function(r){return r===null||w(r)||f(r)||d(r)||u(r)},t.isFunction=function(r){return b.call(r)==="[object Function]"},t.isArray=function(r){return Array.isArray(r)},t.isArrayOf=function(r,e){return(0,v.every)(r,e)},t.isArrayableOf=function(r,e){for(let s=0,a=r.length;s<a;s++)if(!e(r[s]))return!1;return!0},t.isTypedArray=function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},t.isObject=i,t.isPlainObject=function(r){return i(r)&&(r.constructor==null||r.constructor===Object)},t.isIterable=o,t.isArrayable=function(r){return o(r)&&"length"in r}},function(T,V,t,k,E){k();const v=T(10),b=T(11),w=T(12);E("map",w.map),E("reduce",w.reduce),E("min",w.min),E("min_by",w.min_by),E("max",w.max),E("max_by",w.max_by),E("sum",w.sum),E("cumsum",w.cumsum),E("every",w.every),E("some",w.some),E("find",w.find),E("find_last",w.find_last),E("find_index",w.find_index),E("find_last_index",w.find_last_index),E("sorted_index",w.sorted_index),E("is_empty",w.is_empty);const f=Array.prototype.slice;function d(r){return f.call(r)}function u(r){return[].concat(...r)}function i(r,e){return r.indexOf(e)!==-1}function o(r,e,s=1){(0,b.assert)(s>0,"'step' must be a positive number"),e==null&&(e=r,r=0);const{max:a,ceil:c,abs:l}=Math,Q=r<=e?s:-s,m=a(c(l(e-r)/s),0),p=new Array(m);for(let y=0;y<m;y++,r+=Q)p[y]=r;return p}t.head=function(r){return r[0]},t.tail=function(r){return r[r.length-1]},t.last=function(r){return r[r.length-1]},t.copy=d,t.concat=u,t.includes=i,t.contains=i,t.nth=function(r,e){return r[e>=0?e:r.length+e]},t.zip=function(...r){if(r.length==0)return[];const e=(0,w.min)(r.map(c=>c.length)),s=r.length,a=new Array(e);for(let c=0;c<e;c++){a[c]=new Array(s);for(let l=0;l<s;l++)a[c][l]=r[l][c]}return a},t.unzip=function(r){const e=r.length,s=(0,w.min)(r.map(c=>c.length)),a=Array(s);for(let c=0;c<s;c++)a[c]=new Array(e);for(let c=0;c<e;c++)for(let l=0;l<s;l++)a[l][c]=r[c][l];return a},t.range=o,t.linspace=function(r,e,s=100){const a=(e-r)/(s-1),c=new Array(s);for(let l=0;l<s;l++)c[l]=r+a*l;return c},t.transpose=function(r){const e=r.length,s=r[0].length,a=[];for(let c=0;c<s;c++){a[c]=[];for(let l=0;l<e;l++)a[c][l]=r[l][c]}return a},t.argmin=function(r){return(0,w.min_by)(o(r.length),e=>r[e])},t.argmax=function(r){return(0,w.max_by)(o(r.length),e=>r[e])},t.sort_by=function(r,e){const s=r.map((a,c)=>({value:a,index:c,key:e(a)}));return s.sort((a,c)=>{const l=a.key,Q=c.key;if(l!==Q){if(l>Q||l===void 0)return 1;if(l<Q||Q===void 0)return-1}return a.index-c.index}),s.map(a=>a.value)},t.uniq=function(r){const e=new Set;for(const s of r)e.add(s);return[...e]},t.uniq_by=function(r,e){const s=[],a=[];for(const c of r){const l=e(c);i(a,l)||(a.push(l),s.push(c))}return s},t.union=function(...r){const e=new Set;for(const s of r)for(const a of s)e.add(a);return[...e]},t.intersection=function(r,...e){const s=[];t:for(const a of r)if(!i(s,a)){for(const c of e)if(!i(c,a))continue t;s.push(a)}return s},t.difference=function(r,...e){const s=u(e);return r.filter(a=>!i(s,a))},t.remove_at=function(r,e){const s=d(r);return s.splice(e,1),s},t.remove_by=function(r,e){for(let s=0;s<r.length;)e(r[s])?r.splice(s,1):s++},t.shuffle=function(r){const e=r.length,s=new Array(e);for(let a=0;a<e;a++){const c=(0,v.randomIn)(0,a);c!==a&&(s[a]=s[c]),s[c]=r[a]}return s},t.pairwise=function(r,e){const s=r.length,a=new Array(s-1);for(let c=0;c<s-1;c++)a[c]=e(r[c],r[c+1]);return a},t.reversed=function(r){const e=r.length,s=new Array(e);for(let a=0;a<e;a++)s[e-a-1]=r[a];return s},t.repeat=function(r,e){const s=new Array(e);for(let a=0;a<e;a++)s[a]=r;return s}},function(T,V,t,k,E){k();const{PI:v}=Math;function b(u){if(u==0)return 0;for(;u<=0;)u+=2*v;for(;u>2*v;)u-=2*v;return u}function w(u,i){return b(u-i)}function f(){return Math.random()}function d(u){switch(u){case"deg":return v/180;case"rad":return 1;case"grad":return v/200;case"turn":return 2*v}}t.angle_norm=b,t.angle_dist=w,t.angle_between=function(u,i,o,r=!1){const e=w(i,o);if(e==0)return!1;if(e==2*v)return!0;const s=b(u),a=w(i,s)<=e&&w(s,o)<=e;return r?!a:a},t.random=f,t.randomIn=function(u,i){return i==null&&(i=u,u=0),u+Math.floor(Math.random()*(i-u+1))},t.atan2=function(u,i){return Math.atan2(i[1]-u[1],i[0]-u[0])},t.radians=function(u){return u*(v/180)},t.degrees=function(u){return u/(v/180)},t.resolve_angle=function(u,i){return-d(i)*u},t.to_radians_coeff=d,t.rnorm=function(u,i){let o,r;for(;o=f(),r=f(),r=(2*r-1)*Math.sqrt(1/Math.E*2),!(-4*o*o*Math.log(o)>=r*r););let e=r/o;return e=u+i*e,e},t.clamp=function(u,i,o){return u<i?i:u>o?o:u},t.log=function(u,i=Math.E){return Math.log(u)/Math.log(i)},t.float32_epsilon=11920928955078125e-23},function(T,V,t,k,E){k();class v extends Error{}t.AssertionError=v,v.__name__="AssertionError",t.assert=function(b,w){if(!(b===!0||b!==!1&&b()))throw new v(w??"Assertion failed")},t.unreachable=function(){throw new Error("unreachable code")}},function(T,V,t,k,E){k();const v=T(10);function b(e,s,a,...c){const l=e.length;s<0&&(s+=l),s<0?s=0:s>l&&(s=l),a==null||a>l-s?a=l-s:a<0&&(a=0);const Q=l-a+c.length,m=new e.constructor(Q);let p=0;for(;p<s;p++)m[p]=e[p];for(const y of c)m[p++]=y;for(let y=s+a;y<l;y++)m[p++]=e[y];return m}function w(e,s){return b(e,s,e.length-s)}function f(e,s){const a=e.length,c=new e.constructor(a);for(let l=0;l<a;l++)c[l]=s(e[l],l,e);return c}function d(e,s,a){const c=e.length;if(a===void 0&&c==0)throw new Error("can't reduce an empty array without an initial value");let l,Q;for(a===void 0?(l=e[0],Q=1):(l=a,Q=0);Q<c;Q++)l=s(l,e[Q],Q,e);return l}function u(e){return function(s,a){const c=s.length;let l=e>0?0:c-1;for(;l>=0&&l<c;l+=e)if(a(s[l]))return l;return-1}}function i(e,s){let a=0,c=e.length;for(;a<c;){const l=Math.floor((a+c)/2);e[l]<s?a=l+1:c=l}return a}function o(e,s,a,c,l){const Q=(l-a)/(c-s);let m=Q*(e-s)+a;return isFinite(m)||(m=Q*(e-c)+l,isFinite(m)||a!=l||(m=a)),m}function r(e,s){if(e<s[0])return-1;if(e>s[s.length-1])return s.length;let a=0,c=s.length-1;for(;c-a!=1;){const l=a+Math.floor((c-a)/2);e>=s[l]?a=l:c=l}return a}t.is_empty=function(e){return e.length==0},t.copy=function(e){return Array.isArray(e)?e.slice():new e.constructor(e)},t.splice=b,t.head=w,t.insert=function(e,s,a){return b(e,a,0,s)},t.append=function(e,s){return b(e,e.length,0,s)},t.prepend=function(e,s){return b(e,0,0,s)},t.indexOf=function(e,s){for(let a=0,c=e.length;a<c;a++)if(e[a]===s)return a;return-1},t.subselect=function(e,s){const a=s.length,c=new e.constructor(a);for(let l=0;l<a;l++)c[l]=e[s[l]];return c},t.mul=function(e,s,a){const c=e.length,l=a??new e.constructor(c);for(let Q=0;Q<c;Q++)l[Q]=e[Q]*s;return l},t.map=f,t.inplace_map=function(e,s,a){const c=e.length,l=a??e;for(let Q=0;Q<c;Q++)l[Q]=s(e[Q],Q)},t.filter=function(e,s){const a=e.length,c=new e.constructor(a);let l=0;for(let Q=0;Q<a;Q++){const m=e[Q];s(m,Q,e)&&(c[l++]=m)}return w(c,l)},t.reduce=d,t.min=function(e){let s,a=1/0;for(let c=0,l=e.length;c<l;c++)s=e[c],!isNaN(s)&&s<a&&(a=s);return a},t.max=function(e){let s,a=-1/0;for(let c=0,l=e.length;c<l;c++)s=e[c],!isNaN(s)&&s>a&&(a=s);return a},t.minmax=function(e){let s,a=1/0,c=-1/0;for(let l=0,Q=e.length;l<Q;l++)s=e[l],isNaN(s)||(s<a&&(a=s),s>c&&(c=s));return[a,c]},t.minmax2=function(e,s){let a,c,l=1/0,Q=-1/0,m=1/0,p=-1/0;const y=Math.min(e.length,s.length);for(let g=0;g<y;g++)a=e[g],c=s[g],isNaN(a)||isNaN(c)||(a<l&&(l=a),a>Q&&(Q=a),c<m&&(m=c),c>p&&(p=c));return[l,Q,m,p]},t.min_by=function(e,s){if(e.length==0)throw new Error("min_by() called with an empty array");let a=e[0],c=s(a);for(let l=1,Q=e.length;l<Q;l++){const m=e[l],p=s(m);p<c&&(a=m,c=p)}return a},t.max_by=function(e,s){if(e.length==0)throw new Error("max_by() called with an empty array");let a=e[0],c=s(a);for(let l=1,Q=e.length;l<Q;l++){const m=e[l],p=s(m);p>c&&(a=m,c=p)}return a},t.sum=function(e){let s=0;for(let a=0,c=e.length;a<c;a++)s+=e[a];return s},t.cumsum=function(e){const s=new e.constructor(e.length);return d(e,(a,c,l)=>s[l]=a+c,0),s},t.every=function(e,s){for(let a=0,c=e.length;a<c;a++)if(!s(e[a]))return!1;return!0},t.some=function(e,s){for(let a=0,c=e.length;a<c;a++)if(s(e[a]))return!0;return!1},t.index_of=function(e,s){for(let a=0,c=e.length;a<c;a++)if(e[a]===s)return a;return-1},t.find_index=u(1),t.find_last_index=u(-1),t.find=function(e,s){const a=(0,t.find_index)(e,s);return a==-1?void 0:e[a]},t.find_last=function(e,s){const a=(0,t.find_last_index)(e,s);return a==-1?void 0:e[a]},t.sorted_index=i,t.bin_counts=function(e,s){const a=s.length-1,c=Array(a).fill(0);for(let l=0;l<e.length;l++){const Q=i(s,e[l]);c[(0,v.clamp)(Q-1,0,a-1)]+=1}return c},t.interpolate=function(e,s,a){const c=e.length,l=new Array(c);for(let Q=0;Q<c;Q++){const m=e[Q];if(isNaN(m)){l[Q]=m;continue}const p=r(m,s);if(p==-1)l[Q]=a[0];else if(p==s.length)l[Q]=a[a.length-1];else if(p==s.length-1||s[p]==m)l[Q]=a[p];else{const y=s[p],g=a[p],L=s[p+1],A=a[p+1];l[Q]=o(m,y,g,L,A)}}return l},t.left_edge_index=r,t.norm=function(e,s,a){const c=a-s;return f(e,l=>(l-s)/c)}},function(T,V,t,k,E){k();const v=T(9),{hasOwnProperty:b}=Object.prototype;function w(d){return Object.keys(d).length}function f(d){return w(d)==0}t.keys=Object.keys,t.values=Object.values,t.entries=Object.entries,t.extend=Object.assign,t.clone=function(d){return Object.assign({},d)},t.merge=function(d,u){const i=Object.create(Object.prototype),o=(0,v.concat)([Object.keys(d),Object.keys(u)]);for(const r of o){const e=b.call(d,r)?d[r]:[],s=b.call(u,r)?u[r]:[];i[r]=(0,v.union)(e,s)}return i},t.size=w,t.is_empty=f,t.isEmpty=f,t.to_object=function(d){const u={};for(const[i,o]of d)u[i]=o;return u}},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(15),f=T(17),d=(0,v.__importStar)(T(18)),u=(0,v.__importStar)(T(21)),i=T(34),o=T(13),r=T(8),e=T(26),s=T(30),a=T(35),c=T(26),l=T(36),Q=T(37),m=(0,v.__importStar)(T(21));class p extends(0,w.Signalable)(){constructor(g={}){var L,A;super(),this._subtype=void 0,this.document=null,this.destroyed=new w.Signal0(this,"destroyed"),this.change=new w.Signal0(this,"change"),this.transformchange=new w.Signal0(this,"transformchange"),this.exprchange=new w.Signal0(this,"exprchange"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const x=g instanceof Map?g.get.bind(g):H=>g[H];this.id=(L=x("id"))!==null&&L!==void 0?L:(0,i.uniqueId)();for(const[H,{type:S,default_value:M,options:C}]of(0,o.entries)(this._props)){let R;S instanceof d.PropertyAlias?Object.defineProperty(this.properties,H,{get:()=>this.properties[S.attr],configurable:!1,enumerable:!1}):(R=S instanceof u.Kind?new d.PrimitiveProperty(this,H,S,M,x(H),C):new S(this,H,u.Any,M,x(H),C),this.properties[H]=R)}(A=x("__deferred__"))!==null&&A!==void 0&&A||(this.finalize(),this.connect_signals())}get is_syncable(){return!0}set type(g){console.warn("prototype.type = 'ModelName' is deprecated, use static __name__ instead"),this.constructor.__name__=g}get type(){return this.constructor.__qualified__}static get __qualified__(){const{__module__:g,__name__:L}=this;return g!=null?`${g}.${L}`:L}static get[Symbol.toStringTag](){return this.__name__}static _fix_default(g,L){if(g===void 0||(0,r.isFunction)(g))return g;if((0,r.isPrimitive)(g))return()=>g;{const A=new Q.Cloner;return()=>A.clone(g)}}static define(g){for(const[L,A]of(0,o.entries)((0,r.isFunction)(g)?g(m):g)){if(this.prototype._props[L]!=null)throw new Error(`attempted to redefine property '${this.prototype.type}.${L}'`);if(this.prototype[L]!=null)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${L}'`);Object.defineProperty(this.prototype,L,{get(){return this.properties[L].get_value()},set(R){return this.setv({[L]:R}),this},configurable:!1,enumerable:!0});const[x,H,S={}]=A,M={type:x,default_value:this._fix_default(H,L),options:S},C=Object.assign({},this.prototype._props);C[L]=M,this.prototype._props=C}}static internal(g){const L={};for(const[A,x]of(0,o.entries)((0,r.isFunction)(g)?g(m):g)){const[H,S,M={}]=x;L[A]=[H,S,Object.assign(Object.assign({},M),{internal:!0})]}this.define(L)}static mixins(g){function L(H,S){const M={};for(const[C,R]of(0,o.entries)(S))M[H+C]=R;return M}const A={},x=[];for(const H of(0,r.isArray)(g)?g:[g])if((0,r.isArray)(H)){const[S,M]=H;(0,o.extend)(A,L(S,M)),x.push([S,M])}else{const S=H;(0,o.extend)(A,S),x.push(["",S])}this.define(A),this.prototype._mixins=[...this.prototype._mixins,...x]}static override(g){for(const[L,A]of(0,o.entries)(g)){const x=this._fix_default(A,L),H=this.prototype._props[L];if(H==null)throw new Error(`attempted to override nonexistent '${this.prototype.type}.${L}'`);const S=Object.assign({},this.prototype._props);S[L]=Object.assign(Object.assign({},H),{default_value:x}),this.prototype._props=S}}toString(){return`${this.type}(${this.id})`}property(g){const L=this.properties[g];if(L!=null)return L;throw new Error(`unknown property ${this.type}.${g}`)}get attributes(){const g={};for(const L of this)g[L.attr]=L.get_value();return g}[Q.clone](g){const L=new Map;for(const A of this)A.dirty&&L.set(A.attr,g.clone(A.get_value()));return new this.constructor(L)}[c.equals](g,L){for(const A of this){const x=g.property(A.attr);if(!L.eq(A.get_value(),x.get_value()))return!1}return!0}[l.pretty](g){const L=g.token,A=[];for(const x of this)if(x.dirty){const H=x.get_value();A.push(`${x.attr}${L(":")} ${g.to_string(H)}`)}return`${this.constructor.__qualified__}${L("(")}${L("{")}${A.join(`${L(",")} `)}${L("}")}${L(")")}`}[s.serialize](g){const L=this.ref();g.add_ref(this,L);const A=this.struct();for(const x of this)x.syncable&&(g.include_defaults||x.dirty)&&(A.attributes[x.attr]=g.to_serializable(x.get_value()));return g.add_def(this,A),L}finalize(){for(const g of this){if(!(g instanceof d.VectorSpec||g instanceof d.ScalarSpec))continue;const L=g.get_value();if(L!=null){const{transform:A,expr:x}=L;A!=null&&this.connect(A.change,()=>this.transformchange.emit()),x!=null&&this.connect(x.change,()=>this.exprchange.emit())}}this.initialize()}initialize(){}connect_signals(){}disconnect_signals(){w.Signal.disconnectReceiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return new Q.Cloner().clone(this)}changed_for(g){const L=this._watchers.get(g);return this._watchers.set(g,!1),L==null||L}_setv(g,L){const A=L.check_eq,x=[],H=this._changing;this._changing=!0;for(const[S,M]of g)A!==!1&&(0,e.is_equal)(S.get_value(),M)||(S.set_value(M),x.push(S));x.length>0&&(this._watchers=new WeakMap,this._pending=!0);for(const S of x)S.change.emit();if(!H){if(!L.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}}setv(g,L={}){const A=(0,o.entries)(g);if(A.length==0)return;if(L.silent===!0){this._watchers=new WeakMap;for(const[M,C]of A)this.properties[M].set_value(C);return}const x=new Map,H=new Map;for(const[M,C]of A){const R=this.properties[M];x.set(R,C),H.set(R,R.get_value())}this._setv(x,L);const{document:S}=this;if(S!=null){const M=[];for(const[C,R]of H)M.push([C,R,C.get_value()]);for(const[,C,R]of M)if(this._needs_invalidate(C,R)){S._invalidate_all_models();break}this._push_changes(M,L)}}getv(g){return this.property(g).get_value()}ref(){return{id:this.id}}struct(){const g={type:this.type,id:this.id,attributes:{}};return this._subtype!=null&&(g.subtype=this._subtype),g}set_subtype(g){this._subtype=g}*[Symbol.iterator](){yield*(0,o.values)(this.properties)}*syncable_properties(){for(const g of this)g.syncable&&(yield g)}serializable_attributes(){const g={};for(const L of this.syncable_properties())g[L.attr]=L.get_value();return g}static _json_record_references(g,L,A,x){const{recursive:H}=x;if((0,f.is_ref)(L)){const S=g.get_model_by_id(L.id);S==null||A.has(S)||p._value_record_references(S,A,{recursive:H})}else if((0,r.isArray)(L))for(const S of L)p._json_record_references(g,S,A,{recursive:H});else if((0,r.isPlainObject)(L))for(const S of(0,o.values)(L))p._json_record_references(g,S,A,{recursive:H})}static _value_record_references(g,L,A){const{recursive:x}=A;if(g instanceof p){if(!L.has(g)&&(L.add(g),x))for(const H of g.syncable_properties()){const S=H.get_value();p._value_record_references(S,L,{recursive:x})}}else if((0,r.isArray)(g))for(const H of g)p._value_record_references(H,L,{recursive:x});else if((0,r.isPlainObject)(g))for(const H of(0,o.values)(g))p._value_record_references(H,L,{recursive:x})}references(){const g=new Set;return p._value_record_references(this,g,{recursive:!0}),g}_doc_attached(){}_doc_detached(){}attach_document(g){if(this.document!=null&&this.document!=g)throw new Error("models must be owned by only a single document");this.document=g,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(g,L){const A=new Set;p._value_record_references(L,A,{recursive:!1});const x=new Set;p._value_record_references(g,x,{recursive:!1});for(const H of A)if(!x.has(H))return!0;for(const H of x)if(!A.has(H))return!0;return!1}_push_changes(g,L={}){if(!this.is_syncable)return;const{document:A}=this;if(A==null)return;const{setter_id:x}=L,H=[];for(const[S,M,C]of g)S.syncable&&H.push(new a.ModelChangedEvent(A,this,S.attr,M,C,x));if(H.length!=0){let S;H.length==1?[S]=H:S=new a.DocumentEventBatch(A,H,x),A._trigger_on_change(S)}}on_change(g,L){for(const A of(0,r.isArray)(g)?g:[g])this.connect(A.change,L)}}t.HasProps=p,(b=p).prototype._props={},b.prototype._mixins=[]},function(T,V,t,k,E){k();const v=T(16),b=T(9);class w{constructor(s,a){this.sender=s,this.name=a}connect(s,a=null){d.has(this.sender)||d.set(this.sender,[]);const c=d.get(this.sender);if(i(c,this,s,a)!=null)return!1;const l=a??s;u.has(l)||u.set(l,[]);const Q=u.get(l),m={signal:this,slot:s,context:a};return c.push(m),Q.push(m),!0}disconnect(s,a=null){const c=d.get(this.sender);if(c==null||c.length===0)return!1;const l=i(c,this,s,a);if(l==null)return!1;const Q=a??s,m=u.get(Q);return l.signal=null,r(c),r(m),!0}emit(s){var a;const c=(a=d.get(this.sender))!==null&&a!==void 0?a:[];for(const{signal:l,slot:Q,context:m}of c)l===this&&Q.call(m,s,this.sender)}}t.Signal=w,w.__name__="Signal";class f extends w{emit(){super.emit(void 0)}}t.Signal0=f,f.__name__="Signal0",(function(e){function s(Q,m){const p=d.get(Q);if(p==null||p.length===0)return;const y=u.get(m);if(y!=null&&y.length!==0){for(const g of y){if(g.signal==null)return;g.signal.sender===Q&&(g.signal=null)}r(p),r(y)}}function a(Q){var m;const p=d.get(Q);if(p!=null&&p.length!==0){for(const y of p){if(y.signal==null)return;const g=(m=y.context)!==null&&m!==void 0?m:y.slot;y.signal=null,r(u.get(g))}r(p)}}function c(Q,m,p){const y=u.get(Q);if(y!=null&&y.length!==0){for(const g of y){if(g.signal==null)return;if(m!=null&&g.slot!=m)continue;const L=g.signal.sender;p!=null&&p.has(L)||(g.signal=null,r(d.get(L)))}r(y)}}function l(Q){const m=d.get(Q);if(m!=null&&m.length!==0){for(const y of m)y.signal=null;r(m)}const p=u.get(Q);if(p!=null&&p.length!==0){for(const y of p)y.signal=null;r(p)}}e.disconnect_between=s,e.disconnect_sender=a,e.disconnect_receiver=c,e.disconnect_all=l,e.disconnectBetween=s,e.disconnectSender=a,e.disconnectReceiver=c,e.disconnectAll=l})(w||(t.Signal=w={})),t.Signalable=function(){return class{connect(e,s){return e.connect(s,this)}disconnect(e,s){return e.disconnect(s,this)}}};const d=new WeakMap,u=new WeakMap;function i(e,s,a,c){return(0,b.find)(e,l=>l.signal===s&&l.slot===a&&l.context===c)}const o=new Set;function r(e){o.size===0&&(async()=>(await(0,v.defer)(),(function(){for(const s of o)(0,b.remove_by)(s,a=>a.signal==null);o.clear()})()))(),o.add(e)}},function(T,V,t,k,E){k();const v=new MessageChannel,b=new Map;v.port1.onmessage=f=>{const d=f.data,u=b.get(d);if(u!=null)try{u()}finally{b.delete(d)}};let w=1;t.defer=function(){return new Promise(f=>{const d=w++;b.set(d,f),v.port2.postMessage(d)})},t.wait=function(f){return new Promise(d=>setTimeout(d,f))}},function(T,V,t,k,E){k();const v=T(8),b=T(13);t.is_ref=function(w){if((0,v.isPlainObject)(w)){const f=(0,b.keys)(w);return f.length==1&&f[0]=="id"}return!1}},function(T,V,t,k,E){k(),t.YCoordinateSeqSeqSeqSpec=t.XCoordinateSeqSeqSeqSpec=t.YCoordinateSeqSpec=t.XCoordinateSeqSpec=t.YCoordinateSpec=t.XCoordinateSpec=t.CoordinateSeqSeqSeqSpec=t.CoordinateSeqSpec=t.CoordinateSpec=t.BaseCoordinateSpec=t.NumberUnitsSpec=t.UnitsSpec=t.DataSpec=t.VectorSpec=t.TextBaselineScalar=t.TextAlignScalar=t.FontStyleScalar=t.FontSizeScalar=t.FontScalar=t.LineDashScalar=t.LineCapScalar=t.LineJoinScalar=t.ArrayScalar=t.NullStringScalar=t.StringScalar=t.NumberScalar=t.ColorScalar=t.AnyScalar=t.ScalarSpec=t.VerticalAlign=t.UpdateMode=t.TooltipAttachment=t.TickLabelOrientation=t.TextureRepetition=t.TextBaseline=t.TextAlign=t.TapBehavior=t.StepMode=t.StartEnd=t.SpatialUnits=t.Sort=t.SizingMode=t.Side=t.RoundingFunction=t.ResetPolicy=t.RenderMode=t.RenderLevel=t.RadiusDimension=t.PointPolicy=t.Place=void 0,t.TextBaselineSpec=t.TextAlignSpec=t.FontStyleSpec=t.FontSizeSpec=t.FontSpec=t.LineDashSpec=t.LineCapSpec=t.LineJoinSpec=t.MarkerSpec=t.ArraySpec=t.NullStringSpec=t.StringSpec=t.AnySpec=t.NDArraySpec=t.ColorSpec=t.ScreenSizeSpec=t.NumberSpec=t.IntSpec=t.BooleanSpec=t.NullDistanceSpec=t.DistanceSpec=t.AngleSpec=void 0;const v=T(1),b=T(15),w=T(19),f=(0,v.__importStar)(T(20)),d=T(24),u=T(9),i=T(12),o=T(10),r=T(22),e=T(27),s=T(8),a=T(28),c=T(29),l=T(33);function Q(K){try{return JSON.stringify(K)}catch{return K.toString()}}function m(K){return(0,s.isPlainObject)(K)&&(K.value===void 0?0:1)+(K.field===void 0?0:1)+(K.expr===void 0?0:1)==1}E("Uniform",l.Uniform),E("UniformScalar",l.UniformScalar),E("UniformVector",l.UniformVector),t.isSpec=m;class p{constructor(Y,pt,J,st,ht,At={}){var Nt;let X;if(this.obj=Y,this.attr=pt,this.kind=J,this.default_value=st,this._dirty=!1,this.change=new b.Signal0(this.obj,"change"),this.internal=(Nt=At.internal)!==null&&Nt!==void 0&&Nt,this.convert=At.convert,this.on_update=At.on_update,ht!==void 0)X=ht,this._dirty=!0;else{const ct=this._default_override();if(ct!==void 0)X=ct;else{if(st===void 0)return void(this.spec={value:null});X=st(Y)}}this._update(X)}get is_value(){return this.spec.value!==void 0}get syncable(){return!this.internal}get_value(){return this.spec.value}set_value(Y){this._update(Y),this._dirty=!0}_default_override(){}get dirty(){return this._dirty}_update(Y){var pt;if(this.validate(Y),this.convert!=null){const J=this.convert(Y);J!==void 0&&(Y=J)}this.spec={value:Y},(pt=this.on_update)===null||pt===void 0||pt.call(this,Y,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, spec: ${Q(this.spec)})`}normalize(Y){return Y}validate(Y){if(!this.valid(Y))throw new Error(`${this.obj}.${this.attr} given invalid value: ${Q(Y)}`)}valid(Y){return this.kind.valid(Y)}_value(Y=!0){if(!this.is_value)throw new Error("attempted to retrieve property value for property without value specification");let pt=this.normalize([this.spec.value])[0];return this.spec.transform!=null&&Y&&(pt=this.spec.transform.compute(pt)),pt}}t.Property=p,p.__name__="Property";class y{constructor(Y){this.attr=Y}}t.PropertyAlias=y,y.__name__="PropertyAlias",t.Alias=function(K){return new y(K)};class g extends p{}t.PrimitiveProperty=g,g.__name__="PrimitiveProperty";class L extends p{}t.Any=L,L.__name__="Any";class A extends p{valid(Y){return(0,s.isArray)(Y)||(0,s.isTypedArray)(Y)}}t.Array=A,A.__name__="Array";class x extends p{valid(Y){return(0,s.isBoolean)(Y)}}t.Boolean=x,x.__name__="Boolean";class H extends p{valid(Y){return(0,r.is_Color)(Y)}}t.Color=H,H.__name__="Color";class S extends p{}t.Instance=S,S.__name__="Instance";class M extends p{valid(Y){return(0,s.isNumber)(Y)}}t.Number=M,M.__name__="Number";class C extends M{valid(Y){return(0,s.isNumber)(Y)&&(0|Y)==Y}}t.Int=C,C.__name__="Int";class R extends M{}t.Angle=R,R.__name__="Angle";class D extends M{valid(Y){return(0,s.isNumber)(Y)&&0<=Y&&Y<=1}}t.Percent=D,D.__name__="Percent";class B extends p{valid(Y){return(0,s.isString)(Y)}}t.String=B,B.__name__="String";class z extends p{valid(Y){return Y===null||(0,s.isString)(Y)}}t.NullString=z,z.__name__="NullString";class N extends B{}t.FontSize=N,N.__name__="FontSize";class I extends B{_default_override(){return a.settings.dev?"Bokeh":void 0}}t.Font=I,I.__name__="Font";class O extends p{valid(Y){return(0,s.isString)(Y)&&(0,u.includes)(this.enum_values,Y)}}function G(K){return class extends O{get enum_values(){return[...K]}}}t.EnumProperty=O,O.__name__="EnumProperty",t.Enum=G;class q extends O{get enum_values(){return[...f.Direction]}normalize(Y){const pt=new Uint8Array(Y.length);for(let J=0;J<Y.length;J++)switch(Y[J]){case"clock":pt[J]=0;break;case"anticlock":pt[J]=1}return pt}}t.Direction=q,q.__name__="Direction",t.Anchor=G(f.Anchor),t.AngleUnits=G(f.AngleUnits),t.BoxOrigin=G(f.BoxOrigin),t.ButtonType=G(f.ButtonType),t.CalendarPosition=G(f.CalendarPosition),t.Dimension=G(f.Dimension),t.Dimensions=G(f.Dimensions),t.Distribution=G(f.Distribution),t.FontStyle=G(f.FontStyle),t.HatchPatternType=G(f.HatchPatternType),t.HTTPMethod=G(f.HTTPMethod),t.HexTileOrientation=G(f.HexTileOrientation),t.HoverMode=G(f.HoverMode),t.LatLon=G(f.LatLon),t.LegendClickPolicy=G(f.LegendClickPolicy),t.LegendLocation=G(f.LegendLocation),t.LineCap=G(f.LineCap),t.LineJoin=G(f.LineJoin),t.LinePolicy=G(f.LinePolicy),t.Location=G(f.Location),t.Logo=G(f.Logo),t.MarkerType=G(f.MarkerType),t.MutedPolicy=G(f.MutedPolicy),t.Orientation=G(f.Orientation),t.OutputBackend=G(f.OutputBackend),t.PaddingUnits=G(f.PaddingUnits),t.Place=G(f.Place),t.PointPolicy=G(f.PointPolicy),t.RadiusDimension=G(f.RadiusDimension),t.RenderLevel=G(f.RenderLevel),t.RenderMode=G(f.RenderMode),t.ResetPolicy=G(f.ResetPolicy),t.RoundingFunction=G(f.RoundingFunction),t.Side=G(f.Side),t.SizingMode=G(f.SizingMode),t.Sort=G(f.Sort),t.SpatialUnits=G(f.SpatialUnits),t.StartEnd=G(f.StartEnd),t.StepMode=G(f.StepMode),t.TapBehavior=G(f.TapBehavior),t.TextAlign=G(f.TextAlign),t.TextBaseline=G(f.TextBaseline),t.TextureRepetition=G(f.TextureRepetition),t.TickLabelOrientation=G(f.TickLabelOrientation),t.TooltipAttachment=G(f.TooltipAttachment),t.UpdateMode=G(f.UpdateMode),t.VerticalAlign=G(f.VerticalAlign);class Z extends p{get_value(){const{value:Y,expr:pt,transform:J}=this.spec;return pt!=null||J!=null?this.spec:Y}_update(Y){m(Y)?this.spec=Y:this.spec={value:Y},this.spec.value!=null&&this.validate(this.spec.value)}materialize(Y){return Y}scalar(Y,pt){return new l.UniformScalar(Y,pt)}uniform(Y){var pt;const{expr:J,value:st,transform:ht}=this.spec,At=(pt=Y.get_length())!==null&&pt!==void 0?pt:1;if(J!=null){let Nt=J.compute(Y);return ht!=null&&(Nt=ht.compute(Nt)),Nt=this.materialize(Nt),this.scalar(Nt,At)}{let Nt=st;return ht!=null&&(Nt=ht.compute(Nt)),Nt=this.materialize(Nt),this.scalar(Nt,At)}}}t.ScalarSpec=Z,Z.__name__="ScalarSpec";class U extends Z{}t.AnyScalar=U,U.__name__="AnyScalar";class ot extends Z{}t.ColorScalar=ot,ot.__name__="ColorScalar";class ft extends Z{}t.NumberScalar=ft,ft.__name__="NumberScalar";class Ct extends Z{}t.StringScalar=Ct,Ct.__name__="StringScalar";class ne extends Z{}t.NullStringScalar=ne,ne.__name__="NullStringScalar";class jt extends Z{}t.ArrayScalar=jt,jt.__name__="ArrayScalar";class ye extends Z{}t.LineJoinScalar=ye,ye.__name__="LineJoinScalar";class me extends Z{}t.LineCapScalar=me,me.__name__="LineCapScalar";class Je extends Z{}t.LineDashScalar=Je,Je.__name__="LineDashScalar";class Ye extends Z{_default_override(){return a.settings.dev?"Bokeh":void 0}}t.FontScalar=Ye,Ye.__name__="FontScalar";class Oe extends Z{}t.FontSizeScalar=Oe,Oe.__name__="FontSizeScalar";class Ke extends Z{}t.FontStyleScalar=Ke,Ke.__name__="FontStyleScalar";class we extends Z{}t.TextAlignScalar=we,we.__name__="TextAlignScalar";class Se extends Z{}t.TextBaselineScalar=Se,Se.__name__="TextBaselineScalar";class Le extends p{get_value(){return this.spec.value===null?null:this.spec}_update(Y){m(Y)?this.spec=Y:this.spec={value:Y},this.spec.value!=null&&this.validate(this.spec.value)}materialize(Y){return Y}v_materialize(Y){return Y}scalar(Y,pt){return new l.UniformScalar(Y,pt)}vector(Y){return new l.UniformVector(Y)}uniform(Y){var pt;const{field:J,expr:st,value:ht,transform:At}=this.spec,Nt=(pt=Y.get_length())!==null&&pt!==void 0?pt:1;if(J!=null){let X=Y.get_column(J);return X!=null?(At!=null&&(X=At.v_compute(X)),X=this.v_materialize(X),this.vector(X)):(w.logger.warn(`attempted to retrieve property array for nonexistent field '${J}'`),this.scalar(null,Nt))}if(st!=null){let X=st.v_compute(Y);return At!=null&&(X=At.v_compute(X)),X=this.v_materialize(X),this.vector(X)}{let X=ht;return At!=null&&(X=At.compute(X)),X=this.materialize(X),this.scalar(X,Nt)}}array(Y){var pt;let J;const st=(pt=Y.get_length())!==null&&pt!==void 0?pt:1;if(this.spec.field!=null){const ht=Y.get_column(this.spec.field);if(ht!=null)J=this.normalize(ht);else{w.logger.warn(`attempted to retrieve property array for nonexistent field '${this.spec.field}'`);const At=new Float64Array(st);At.fill(NaN),J=At}}else if(this.spec.expr!=null)J=this.normalize(this.spec.expr.v_compute(Y));else{const ht=this._value(!1);if((0,s.isNumber)(ht)){const At=new Float64Array(st);At.fill(ht),J=At}else J=(0,u.repeat)(ht,st)}return this.spec.transform!=null&&(J=this.spec.transform.v_compute(J)),J}}t.VectorSpec=Le,Le.__name__="VectorSpec";class de extends Le{}t.DataSpec=de,de.__name__="DataSpec";class Be extends Le{_update(Y){super._update(Y);const{units:pt}=this.spec;if(pt!=null&&!(0,u.includes)(this.valid_units,pt))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${pt}`)}get units(){var Y;return(Y=this.spec.units)!==null&&Y!==void 0?Y:this.default_units}set units(Y){Y!=this.default_units?this.spec.units=Y:delete this.spec.units}}t.UnitsSpec=Be,Be.__name__="UnitsSpec";class ze extends Be{array(Y){return new Float64Array(super.array(Y))}}t.NumberUnitsSpec=ze,ze.__name__="NumberUnitsSpec";class t1 extends de{}t.BaseCoordinateSpec=t1,t1.__name__="BaseCoordinateSpec";class Pe extends t1{}t.CoordinateSpec=Pe,Pe.__name__="CoordinateSpec";class Lt extends t1{}t.CoordinateSeqSpec=Lt,Lt.__name__="CoordinateSeqSpec";class it extends t1{}t.CoordinateSeqSeqSeqSpec=it,it.__name__="CoordinateSeqSeqSeqSpec";class le extends Pe{constructor(){super(...arguments),this.dimension="x"}}t.XCoordinateSpec=le,le.__name__="XCoordinateSpec";class Me extends Pe{constructor(){super(...arguments),this.dimension="y"}}t.YCoordinateSpec=Me,Me.__name__="YCoordinateSpec";class _e extends Lt{constructor(){super(...arguments),this.dimension="x"}}t.XCoordinateSeqSpec=_e,_e.__name__="XCoordinateSeqSpec";class Ae extends Lt{constructor(){super(...arguments),this.dimension="y"}}t.YCoordinateSeqSpec=Ae,Ae.__name__="YCoordinateSeqSpec";class d1 extends it{constructor(){super(...arguments),this.dimension="x"}}t.XCoordinateSeqSeqSeqSpec=d1,d1.__name__="XCoordinateSeqSeqSeqSpec";class c1 extends it{constructor(){super(...arguments),this.dimension="y"}}t.YCoordinateSeqSeqSeqSpec=c1,c1.__name__="YCoordinateSeqSeqSeqSpec";class v1 extends ze{get default_units(){return"rad"}get valid_units(){return[...f.AngleUnits]}materialize(Y){return Y*-(0,o.to_radians_coeff)(this.units)}v_materialize(Y){const pt=-(0,o.to_radians_coeff)(this.units),J=new Float32Array(Y.length);return(0,i.mul)(Y,pt,J),J}array(Y){throw new Error("not supported")}}t.AngleSpec=v1,v1.__name__="AngleSpec";class m1 extends ze{get default_units(){return"data"}get valid_units(){return[...f.SpatialUnits]}}t.DistanceSpec=m1,m1.__name__="DistanceSpec";class Ft extends m1{materialize(Y){return Y??NaN}}t.NullDistanceSpec=Ft,Ft.__name__="NullDistanceSpec";class qt extends de{v_materialize(Y){return new Uint8Array(Y)}array(Y){return new Uint8Array(super.array(Y))}}t.BooleanSpec=qt,qt.__name__="BooleanSpec";class Kt extends de{v_materialize(Y){return(0,s.isTypedArray)(Y)?Y:new Int32Array(Y)}array(Y){return new Int32Array(super.array(Y))}}t.IntSpec=Kt,Kt.__name__="IntSpec";class re extends de{v_materialize(Y){return(0,s.isTypedArray)(Y)?Y:new Float64Array(Y)}array(Y){return new Float64Array(super.array(Y))}}t.NumberSpec=re,re.__name__="NumberSpec";class $e extends re{valid(Y){return(0,s.isNumber)(Y)&&Y>=0}}t.ScreenSizeSpec=$e,$e.__name__="ScreenSizeSpec";class Ie extends de{materialize(Y){return(0,r.encode_rgba)((0,r.color2rgba)(Y))}v_materialize(Y){if(!(0,c.is_NDArray)(Y)){const pt=Y.length,J=new d.RGBAArray(4*pt);let st=0;for(const ht of Y){const[At,Nt,X,ct]=(0,r.color2rgba)(ht);J[st++]=At,J[st++]=Nt,J[st++]=X,J[st++]=ct}return new d.ColorArray(J.buffer)}if(Y.dtype=="uint32"&&Y.dimension==1)return(0,e.to_big_endian)(Y);if(Y.dtype=="uint8"&&Y.dimension==1){const[pt]=Y.shape,J=new d.RGBAArray(4*pt);let st=0;for(const ht of Y)J[st++]=ht,J[st++]=ht,J[st++]=ht,J[st++]=255;return new d.ColorArray(J.buffer)}if(Y.dtype=="uint8"&&Y.dimension==2){const[pt,J]=Y.shape;if(J==4)return new d.ColorArray(Y.buffer);if(J==3){const st=new d.RGBAArray(4*pt);for(let ht=0,At=0;ht<J*pt;)st[At++]=Y[ht++],st[At++]=Y[ht++],st[At++]=Y[ht++],st[At++]=255;return new d.ColorArray(st.buffer)}}else if((Y.dtype=="float32"||Y.dtype=="float64")&&Y.dimension==2){const[pt,J]=Y.shape;if(J==3||J==4){const st=new d.RGBAArray(4*pt);for(let ht=0,At=0;ht<J*pt;)st[At++]=255*Y[ht++],st[At++]=255*Y[ht++],st[At++]=255*Y[ht++],st[At++]=255*(J==3?1:Y[ht++]);return new d.ColorArray(st.buffer)}}throw new Error("invalid color array")}vector(Y){return new l.ColorUniformVector(Y)}}t.ColorSpec=Ie,Ie.__name__="ColorSpec";class o1 extends de{}t.NDArraySpec=o1,o1.__name__="NDArraySpec";class b1 extends de{}t.AnySpec=b1,b1.__name__="AnySpec";class L1 extends de{}t.StringSpec=L1,L1.__name__="StringSpec";class V1 extends de{}t.NullStringSpec=V1,V1.__name__="NullStringSpec";class R1 extends de{}t.ArraySpec=R1,R1.__name__="ArraySpec";class H1 extends de{}t.MarkerSpec=H1,H1.__name__="MarkerSpec";class l2 extends de{}t.LineJoinSpec=l2,l2.__name__="LineJoinSpec";class $1 extends de{}t.LineCapSpec=$1,$1.__name__="LineCapSpec";class s2 extends de{}t.LineDashSpec=s2,s2.__name__="LineDashSpec";class E2 extends de{_default_override(){return a.settings.dev?"Bokeh":void 0}}t.FontSpec=E2,E2.__name__="FontSpec";class b2 extends de{}t.FontSizeSpec=b2,b2.__name__="FontSizeSpec";class C2 extends de{}t.FontStyleSpec=C2,C2.__name__="FontStyleSpec";class rt extends de{}t.TextAlignSpec=rt,rt.__name__="TextAlignSpec";class tt extends de{}t.TextBaselineSpec=tt,tt.__name__="TextBaselineSpec"},function(T,V,t,k,E){k();const v=T(8),b=T(13),w={};class f{constructor(r,e){this.name=r,this.level=e}}t.LogLevel=f,f.__name__="LogLevel";class d{constructor(r,e=d.INFO){this._name=r,this.set_level(e)}static get levels(){return Object.keys(d.log_levels)}static get(r,e=d.INFO){if(r.length>0){let s=w[r];return s==null&&(w[r]=s=new d(r,e)),s}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}get level(){return this.get_level()}get_level(){return this._log_level}set_level(r){if(r instanceof f)this._log_level=r;else{if(!(0,v.isString)(r)||d.log_levels[r]==null)throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=d.log_levels[r]}const e=`[${this._name}]`;for(const[s,a]of(0,b.entries)(d.log_levels))a.level<this._log_level.level||this._log_level.level===d.OFF.level?this[s]=function(){}:this[s]=u(s,e)}trace(...r){}debug(...r){}info(...r){}warn(...r){}error(...r){}}function u(o,r){return console[o]!=null?console[o].bind(console,r):console.log!=null?console.log.bind(console,r):function(){}}function i(o){const r=t.logger.level;return(0,v.isString)(o)&&d.log_levels[o]==null?(console.log(`[bokeh] unrecognized logging level '${o}' passed to Bokeh.set_log_level(), ignoring`),console.log(`[bokeh] valid log levels are: ${d.levels.join(", ")}`)):(console.log(`[bokeh] setting log level to: '${(0,v.isString)(o)?o:o.level}'`),t.logger.set_level(o)),r}t.Logger=d,d.__name__="Logger",d.TRACE=new f("trace",0),d.DEBUG=new f("debug",1),d.INFO=new f("info",2),d.WARN=new f("warn",6),d.ERROR=new f("error",7),d.FATAL=new f("fatal",8),d.OFF=new f("off",9),d.log_levels={trace:d.TRACE,debug:d.DEBUG,info:d.INFO,warn:d.WARN,error:d.ERROR,fatal:d.FATAL,off:d.OFF},t.logger=d.get("bokeh"),t.set_log_level=i,t.with_log_level=function(o,r){const e=i(o);try{r()}finally{i(e)}}},function(T,V,t,k,E){k(),t.VerticalAlign=void 0;const v=T(21);t.Align=(0,v.Enum)("start","center","end"),t.Anchor=(0,v.Enum)("top_left","top_center","top_right","center_left","center_center","center_right","bottom_left","bottom_center","bottom_right","top","left","center","right","bottom"),t.AngleUnits=(0,v.Enum)("deg","rad","grad","turn"),t.BoxOrigin=(0,v.Enum)("corner","center"),t.ButtonType=(0,v.Enum)("default","primary","success","warning","danger","light"),t.CalendarPosition=(0,v.Enum)("auto","above","below"),t.Dimension=(0,v.Enum)("width","height"),t.Dimensions=(0,v.Enum)("width","height","both"),t.Direction=(0,v.Enum)("clock","anticlock"),t.Distribution=(0,v.Enum)("uniform","normal"),t.FontStyle=(0,v.Enum)("normal","italic","bold","bold italic"),t.HatchPatternType=(0,v.Enum)("blank","dot","ring","horizontal_line","vertical_line","cross","horizontal_dash","vertical_dash","spiral","right_diagonal_line","left_diagonal_line","diagonal_cross","right_diagonal_dash","left_diagonal_dash","horizontal_wave","vertical_wave","criss_cross"," ",".","o","-","|","+",'"',":","@","/","\\","x",",","`","v",">","*"),t.HTTPMethod=(0,v.Enum)("POST","GET"),t.HexTileOrientation=(0,v.Enum)("pointytop","flattop"),t.HoverMode=(0,v.Enum)("mouse","hline","vline"),t.LatLon=(0,v.Enum)("lat","lon"),t.LegendClickPolicy=(0,v.Enum)("none","hide","mute"),t.LegendLocation=t.Anchor,t.LineCap=(0,v.Enum)("butt","round","square"),t.LineJoin=(0,v.Enum)("miter","round","bevel"),t.LineDash=(0,v.Enum)("solid","dashed","dotted","dotdash","dashdot"),t.LinePolicy=(0,v.Enum)("prev","next","nearest","interp","none"),t.Location=(0,v.Enum)("above","below","left","right"),t.Logo=(0,v.Enum)("normal","grey"),t.MarkerType=(0,v.Enum)("asterisk","circle","circle_cross","circle_dot","circle_x","circle_y","cross","dash","diamond","diamond_cross","diamond_dot","dot","hex","hex_dot","inverted_triangle","plus","square","square_cross","square_dot","square_pin","square_x","star","star_dot","triangle","triangle_dot","triangle_pin","x","y"),t.MutedPolicy=(0,v.Enum)("show","ignore"),t.Orientation=(0,v.Enum)("vertical","horizontal"),t.OutputBackend=(0,v.Enum)("canvas","svg","webgl"),t.PaddingUnits=(0,v.Enum)("percent","absolute"),t.Place=(0,v.Enum)("above","below","left","right","center"),t.PointPolicy=(0,v.Enum)("snap_to_data","follow_mouse","none"),t.RadiusDimension=(0,v.Enum)("x","y","max","min"),t.RenderLevel=(0,v.Enum)("image","underlay","glyph","guide","annotation","overlay"),t.RenderMode=(0,v.Enum)("canvas","css"),t.ResetPolicy=(0,v.Enum)("standard","event_only"),t.RoundingFunction=(0,v.Enum)("round","nearest","floor","rounddown","ceil","roundup"),t.SelectionMode=(0,v.Enum)("replace","append","intersect","subtract"),t.Side=(0,v.Enum)("above","below","left","right"),t.SizingMode=(0,v.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed"),t.Sort=(0,v.Enum)("ascending","descending"),t.SpatialUnits=(0,v.Enum)("screen","data"),t.StartEnd=(0,v.Enum)("start","end"),t.StepMode=(0,v.Enum)("after","before","center"),t.TapBehavior=(0,v.Enum)("select","inspect"),t.TextAlign=(0,v.Enum)("left","right","center"),t.TextBaseline=(0,v.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),t.TextureRepetition=(0,v.Enum)("repeat","repeat_x","repeat_y","no_repeat"),t.TickLabelOrientation=(0,v.Enum)("vertical","horizontal","parallel","normal"),t.TooltipAttachment=(0,v.Enum)("horizontal","vertical","left","right","above","below"),t.UpdateMode=(0,v.Enum)("replace","append"),t.VerticalAlign=(0,v.Enum)("top","middle","bottom")},function(T,V,t,k,E){k();const v=(0,T(1).__importStar)(T(8)),b=T(22),w=T(13),f=window.Map,{hasOwnProperty:d}=Object.prototype;class u{}t.Kind=u,u.__name__="Kind",(function(i){class o extends u{valid(N){return!0}}o.__name__="Any",i.Any=o;class r extends u{valid(N){return!0}}r.__name__="Unknown",i.Unknown=r;class e extends u{valid(N){return v.isBoolean(N)}}e.__name__="Boolean",i.Boolean=e;class s extends u{constructor(N){super(),this.obj_type=N}valid(N){return!0}}s.__name__="Ref",i.Ref=s;class a extends u{valid(N){return!0}}a.__name__="AnyRef",i.AnyRef=a;class c extends u{valid(N){return v.isNumber(N)}}c.__name__="Number",i.Number=c;class l extends c{valid(N){return super.valid(N)&&v.isInteger(N)}}l.__name__="Int",i.Int=l;class Q extends c{valid(N){return super.valid(N)&&0<=N&&N<=1}}Q.__name__="Percent",i.Percent=Q;class m extends u{constructor(N){super(),this.types=N,this.types=N}valid(N){return this.types.some(I=>I.valid(N))}}m.__name__="Or",i.Or=m;class p extends u{constructor(N){super(),this.types=N,this.types=N}valid(N){if(!v.isArray(N))return!1;for(let I=0;I<this.types.length;I++){const O=this.types[I],G=N[I];if(!O.valid(G))return!1}return!0}}p.__name__="Tuple",i.Tuple=p;class y extends u{constructor(N){super(),this.struct_type=N}valid(N){if(!v.isPlainObject(N))return!1;const{struct_type:I}=this;if((0,w.size)(I)!=(0,w.size)(N))return!1;for(const O in I)if(d.call(I,O)){if(!d.call(N,O))return!1;const G=I[O],q=N[O];if(!G.valid(q))return!1}return!0}}y.__name__="Struct",i.Struct=y;class g extends u{valid(N){return v.isArray(N)||v.isTypedArray(N)}}g.__name__="Arrayable",i.Arrayable=g;class L extends u{constructor(N){super(),this.item_type=N}valid(N){return v.isArray(N)&&N.every(I=>this.item_type.valid(I))}}L.__name__="Array",i.Array=L;class A extends u{valid(N){return N===null}}A.__name__="Null",i.Null=A;class x extends u{constructor(N){super(),this.base_type=N}valid(N){return N===null||this.base_type.valid(N)}}x.__name__="Nullable",i.Nullable=x;class H extends u{constructor(N){super(),this.base_type=N}valid(N){return N===void 0||this.base_type.valid(N)}}H.__name__="Opt",i.Opt=H;class S extends u{valid(N){return v.isString(N)}}S.__name__="String",i.String=S;class M extends u{constructor(N){super(),this.values=new Set(N)}valid(N){return this.values.has(N)}*[Symbol.iterator](){yield*this.values}}M.__name__="Enum",i.Enum=M;class C extends u{constructor(N){super(),this.item_type=N}valid(N){if(!v.isPlainObject(N))return!1;for(const I in N)if(d.call(N,I)){const O=N[I];if(!this.item_type.valid(O))return!1}return!0}}C.__name__="Dict",i.Dict=C;class R extends u{constructor(N,I){super(),this.key_type=N,this.item_type=I}valid(N){if(!(N instanceof f))return!1;for(const[I,O]of N.entries())if(!this.key_type.valid(I)||!this.item_type.valid(O))return!1;return!0}}R.__name__="Map",i.Map=R;class D extends u{valid(N){return(0,b.is_Color)(N)}}D.__name__="Color",i.Color=D;class B extends u{valid(N){return v.isFunction(N)}}B.__name__="Function",i.Function=B})(t.Kinds||(t.Kinds={})),t.Any=new t.Kinds.Any,t.Unknown=new t.Kinds.Unknown,t.Boolean=new t.Kinds.Boolean,t.Number=new t.Kinds.Number,t.Int=new t.Kinds.Int,t.String=new t.Kinds.String,t.Null=new t.Kinds.Null,t.Nullable=i=>new t.Kinds.Nullable(i),t.Opt=i=>new t.Kinds.Opt(i),t.Or=(...i)=>new t.Kinds.Or(i),t.Tuple=(...i)=>new t.Kinds.Tuple(i),t.Struct=i=>new t.Kinds.Struct(i),t.Arrayable=new t.Kinds.Arrayable,t.Array=i=>new t.Kinds.Array(i),t.Dict=i=>new t.Kinds.Dict(i),t.Map=(i,o)=>new t.Kinds.Map(i,o),t.Enum=(...i)=>new t.Kinds.Enum(i),t.Ref=i=>new t.Kinds.Ref(i),t.AnyRef=()=>new t.Kinds.AnyRef,t.Function=()=>new t.Kinds.Function,t.Percent=new t.Kinds.Percent,t.Alpha=t.Percent,t.Color=new t.Kinds.Color,t.Auto=(0,t.Enum)("auto"),t.FontSize=t.String,t.Font=t.String,t.Angle=t.Number},function(T,V,t,k,E){k();const v=T(23),b=T(10),w=T(8),{round:f}=Math;function d(Q){return(0,b.clamp)(f(Q),0,255)}function u(){return[0,0,0,0]}function i(Q){return[Q>>24&255,Q>>16&255,Q>>8&255,255&Q]}function o(Q,m){var p;let y,g,L,A;return Q==null?[y,g,L,A]=[0,0,0,0]:(0,w.isInteger)(Q)?[y,g,L,A]=i(Q):(0,w.isString)(Q)?[y,g,L,A]=(p=l(Q))!==null&&p!==void 0?p:[0,0,0,0]:([y,g,L,A=1]=Q,A=d(255*A)),A==255&&m!=null&&(A=d(255*m)),[y,g,L,A]}t.transparent=u,t.encode_rgba=function([Q,m,p,y]){return Q<<24|m<<16|p<<8|y},t.decode_rgba=i,t.compose_alpha=function(Q,m){return(255&Q)==255?4294967040&Q|d(255*m):Q},t.color2rgba=o;const r={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"a",11:"b",12:"c",13:"d",14:"e",15:"f"};function e(Q){return r[Q>>4]+r[15&Q]}t.color2css=function(Q,m){const[p,y,g,L]=o(Q,m);return`rgba(${p}, ${y}, ${g}, ${L/255})`},t.color2hex=function(Q,m){const[p,y,g,L]=o(Q,m),A=`#${e(p)}${e(y)}${e(g)}`;return L==255?A:`${A}${e(L)}`},t.color2hexrgb=function(Q){const[m,p,y]=o(Q);return`#${e(m)}${e(p)}${e(y)}`};const s=/^rgba?\(\s*([^\s,]+?)\s+([^\s,]+?)\s+([^\s,]+?)(?:\s*\/\s*([^\s,]+?))?\s*\)$/,a=/^rgba?\(\s*([^\s,]+?)\s*,\s*([^\s,]+?)\s*,\s*([^\s,]+?)(?:\s*,\s*([^\s,]+?))?\s*\)$/,c=(()=>{const Q=document.createElement("canvas");Q.width=1,Q.height=1;const m=Q.getContext("2d"),p=m.createLinearGradient(0,0,1,1);return y=>{m.fillStyle=p,m.fillStyle=y;const g=m.fillStyle;return g!=p?g:null}})();function l(Q){var m;if(!(Q=Q.trim().toLowerCase()))return null;if(Q=="transparent")return[0,0,0,0];if((0,v.is_named_color)(Q))return i(v.named_colors[Q]);if(Q[0]=="#"){const p=+`0x${Q.substr(1)}`;if(isNaN(p))return null;switch(Q.length-1){case 3:{const y=p>>8&15,g=p>>4&15,L=p>>0&15;return[y<<4|y,g<<4|g,L<<4|L,255]}case 4:{const y=p>>12&15,g=p>>8&15,L=p>>4&15,A=p>>0&15;return[y<<4|y,g<<4|g,L<<4|L,A<<4|A]}case 6:return[p>>16&255,p>>8&255,p>>0&255,255];case 8:return[p>>24&255,p>>16&255,p>>8&255,p>>0&255]}}else if(Q.startsWith("rgb")){const p=(m=Q.match(s))!==null&&m!==void 0?m:Q.match(a);if(p!=null){let[,y,g,L,A="1"]=p;const x=y.endsWith("%"),H=g.endsWith("%"),S=L.endsWith("%"),M=A.endsWith("%");if(!(x&&H&&S)&&(x||H||S))return null;x&&(y=y.slice(0,-1)),H&&(g=g.slice(0,-1)),S&&(L=L.slice(0,-1)),M&&(A=A.slice(0,-1));let C=Number(y),R=Number(g),D=Number(L),B=Number(A);return isNaN(C+R+D+B)?null:(x&&(C=C/100*255),H&&(R=R/100*255),S&&(D=D/100*255),B=255*(M?B/100:B),C=d(C),R=d(R),D=d(D),B=d(B),[C,R,D,B])}}else{const p=c(Q);if(p!=null)return l(p)}return null}t.css4_parse=l,t.is_Color=function(Q){return!!(0,w.isInteger)(Q)||!(!(0,w.isString)(Q)||l(Q)==null)||!(!(0,w.isArray)(Q)||Q.length!=3&&Q.length!=4)},t.is_dark=function([Q,m,p]){return 1-(.299*Q+.587*m+.114*p)/255>=.6}},function(T,V,t,k,E){k(),t.named_colors={aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},t.is_named_color=function(v){return v in t.named_colors}},function(T,V,t,k,E){k(),t.GeneratorFunction=Object.getPrototypeOf(function*(){}).constructor,t.ColorArray=Uint32Array,t.RGBAArray=Uint8ClampedArray,t.infer_type=function(v,b){return v instanceof Float64Array||v instanceof Array||b instanceof Float64Array||b instanceof Array?Float64Array:Float32Array},t.ScreenArray=Float32Array,t.to_screen=function(v){return v instanceof Float32Array?v:Float32Array.from(v)},E("Indices",T(25).BitSet)},function(T,V,t,k,E){var v;k();const b=T(26),w=T(11);class f{constructor(u,i=0){this.size=u,this[v]="BitSet",this._count=null,this._nwords=Math.ceil(u/32),i==0||i==1?(this._array=new Uint32Array(this._nwords),i==1&&this._array.fill(4294967295)):((0,w.assert)(i.length==this._nwords,"Initializer size mismatch"),this._array=i)}clone(){return new f(this.size,new Uint32Array(this._array))}[(v=Symbol.toStringTag,b.equals)](u,i){if(!i.eq(this.size,u.size))return!1;const{_nwords:o}=this,r=this.size%o,e=r==0?o:o-1;for(let s=0;s<e;s++)if(this._array[s]!=u._array[s])return!1;if(r==0)return!0;{const s=1<<r-1,a=s-1^s;return(this._array[e]&a)==(u._array[e]&a)}}static all_set(u){return new f(u,1)}static all_unset(u){return new f(u,0)}static from_indices(u,i){const o=new f(u);for(const r of i)o.set(r);return o}static from_booleans(u,i){const o=new f(u),r=Math.min(u,i.length);for(let e=0;e<r;e++)i[e]&&o.set(e);return o}_check_bounds(u){(0,w.assert)(0<=u&&u<this.size,`Out of bounds: 0 <= ${u} < ${this.size}`)}get(u){this._check_bounds(u);const i=u>>>5,o=31&u;return!!(this._array[i]>>o&1)}set(u,i=!0){this._check_bounds(u),this._count=null;const o=u>>>5,r=31&u;i?this._array[o]|=1<<r:this._array[o]&=~(1<<r)}unset(u){this.set(u,!1)}*[Symbol.iterator](){yield*this.ones()}get count(){let u=this._count;return u==null&&(this._count=u=this._get_count()),u}_get_count(){const{_array:u,_nwords:i,size:o}=this;let r=0;for(let e=0,s=0;s<i;s++){const a=u[s];if(a==0)e+=32;else for(let c=0;c<32&&e<o;c++,e++)a>>>c&1&&(r+=1)}return r}*ones(){const{_array:u,_nwords:i,size:o}=this;for(let r=0,e=0;e<i;e++){const s=u[e];if(s!=0)for(let a=0;a<32&&r<o;a++,r++)s>>>a&1&&(yield r);else r+=32}}*zeros(){const{_array:u,_nwords:i,size:o}=this;for(let r=0,e=0;e<i;e++){const s=u[e];if(s!=4294967295)for(let a=0;a<32&&r<o;a++,r++)s>>>a&1||(yield r);else r+=32}}_check_size(u){(0,w.assert)(this.size==u.size,"Size mismatch")}add(u){this._check_size(u);for(let i=0;i<this._nwords;i++)this._array[i]|=u._array[i]}intersect(u){this._check_size(u);for(let i=0;i<this._nwords;i++)this._array[i]&=u._array[i]}subtract(u){this._check_size(u);for(let i=0;i<this._nwords;i++){const o=this._array[i],r=u._array[i];this._array[i]=(o^r)&o}}union(u){this._check_size(u);const i=this.clone();for(let o=0;o<this._nwords;o++)i._array[o]|=u._array[o];return i}intersection(u){this._check_size(u);const i=this.clone();for(let o=0;o<this._nwords;o++)i._array[o]&=u._array[o];return i}difference(u){this._check_size(u);const i=this.clone();for(let o=0;o<this._nwords;o++){const r=this._array[o],e=u._array[o];i._array[o]=(r^e)&r}return i}select(u){(0,w.assert)(this.size<=u.length,"Size mismatch");const i=this.count,o=new u.constructor(i);let r=0;for(const e of this)o[r++]=u[e];return o}}t.BitSet=f,f.__name__="BitSet"},function(T,V,t,k,E){k();const v=T(8),{hasOwnProperty:b}=Object.prototype;function w(r){return(0,v.isObject)(r)&&r[t.equals]!==void 0}t.equals=Symbol("equals"),t.wildcard=Symbol("wildcard");const f=Object.prototype.toString;class d{constructor(){this.a_stack=[],this.b_stack=[]}eq(e,s){if(Object.is(e,s)||e===t.wildcard||s===t.wildcard)return!0;if(e==null||s==null)return e===s;const a=f.call(e);if(a!=f.call(s))return!1;switch(a){case"[object Number]":return this.numbers(e,s);case"[object RegExp]":case"[object String]":return`${e}`==`${s}`;case"[object Date]":case"[object Boolean]":return+e==+s}const{a_stack:c,b_stack:l}=this;let Q=c.length;for(;Q--;)if(c[Q]===e)return l[Q]===s;c.push(e),l.push(s);const m=(()=>{if(w(e)&&w(s))return e[t.equals](s,this);switch(a){case"[object Array]":case"[object Uint8Array]":case"[object Int8Array]":case"[object Uint16Array]":case"[object Int16Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":return this.arrays(e,s);case"[object Map]":return this.maps(e,s);case"[object Set]":return this.sets(e,s);case"[object Object]":if(e.constructor==s.constructor&&(e.constructor==null||e.constructor===Object))return this.objects(e,s);case"[object Function]":if(e.constructor==s.constructor&&e.constructor===Function)return this.eq(`${e}`,`${s}`)}if(e instanceof Node)return this.nodes(e,s);throw Error(`can't compare objects of type ${a}`)})();return c.pop(),l.pop(),m}numbers(e,s){return Object.is(e,s)}arrays(e,s){const{length:a}=e;if(a!=s.length)return!1;for(let c=0;c<a;c++)if(!this.eq(e[c],s[c]))return!1;return!0}iterables(e,s){const a=e[Symbol.iterator](),c=s[Symbol.iterator]();for(;;){const l=a.next(),Q=c.next();if(l.done&&Q.done)return!0;if(l.done||Q.done||!this.eq(l.value,Q.value))return!1}}maps(e,s){if(e.size!=s.size)return!1;for(const[a,c]of e)if(!s.has(a)||!this.eq(c,s.get(a)))return!1;return!0}sets(e,s){if(e.size!=s.size)return!1;for(const a of e)if(!s.has(a))return!1;return!0}objects(e,s){const a=Object.keys(e);if(a.length!=Object.keys(s).length)return!1;for(const c of a)if(!b.call(s,c)||!this.eq(e[c],s[c]))return!1;return!0}nodes(e,s){return e.nodeType==s.nodeType&&e.textContent==s.textContent&&!!this.iterables(e.childNodes,s.childNodes)}}t.Comparator=d,d.__name__="Comparator";const{abs:u}=Math;class i extends d{constructor(e=1e-4){super(),this.tolerance=e}numbers(e,s){return super.numbers(e,s)||u(e-s)<this.tolerance}}function o(r,e){return new d().eq(r,e)}t.SimilarComparator=i,i.__name__="SimilarComparator",t.is_equal=o,t.is_similar=function(r,e,s){return new i(s).eq(r,e)},t.isEqual=o},function(T,V,t,k,E){k(),t.is_windows=navigator.appVersion.includes("Windows"),t.is_ie=(()=>{const v=navigator.userAgent;return v.includes("MSIE")||v.includes("Trident")||v.includes("Edge")})(),t.is_mobile=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),t.is_little_endian=(()=>{const v=new ArrayBuffer(4),b=new Uint8Array(v);new Uint32Array(v)[1]=168496141;let w=!0;return b[4]==10&&b[5]==11&&b[6]==12&&b[7]==13&&(w=!1),w})(),t.BYTE_ORDER=t.is_little_endian?"little":"big",t.to_big_endian=function(v){if(t.is_little_endian){const b=new Uint32Array(v.length),w=new DataView(b.buffer);let f=0;for(const d of v)w.setUint32(f,d),f+=4;return b}return v}},function(T,V,t,k,E){k();class v{constructor(){this._dev=!1,this._wireframe=!1,this._force_webgl=!1}set dev(w){this._dev=w}get dev(){return this._dev}set wireframe(w){this._wireframe=w}get wireframe(){return this._wireframe}set force_webgl(w){this._force_webgl=w}get force_webgl(){return this._force_webgl}}t.Settings=v,v.__name__="Settings",t.settings=new v},function(T,V,t,k,E){var v,b,w,f,d,u,i,o;k();const r=T(8),e=T(11),s=T(26),a=T(30),c=T(31),l=Symbol("__ndarray__");class Q extends Uint8Array{constructor(M,C){super(M),this[v]=!0,this.dtype="uint8",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>Q.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>Q.prototype[a.serialize].call(this,R))}[(v=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Uint8NDArray=Q,Q.__name__="Uint8NDArray";class m extends Int8Array{constructor(M,C){super(M),this[b]=!0,this.dtype="int8",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>m.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>m.prototype[a.serialize].call(this,R))}[(b=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Int8NDArray=m,m.__name__="Int8NDArray";class p extends Uint16Array{constructor(M,C){super(M),this[w]=!0,this.dtype="uint16",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>p.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>p.prototype[a.serialize].call(this,R))}[(w=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Uint16NDArray=p,p.__name__="Uint16NDArray";class y extends Int16Array{constructor(M,C){super(M),this[f]=!0,this.dtype="int16",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>y.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>y.prototype[a.serialize].call(this,R))}[(f=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Int16NDArray=y,y.__name__="Int16NDArray";class g extends Uint32Array{constructor(M,C){super(M),this[d]=!0,this.dtype="uint32",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>g.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>g.prototype[a.serialize].call(this,R))}[(d=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Uint32NDArray=g,g.__name__="Uint32NDArray";class L extends Int32Array{constructor(M,C){super(M),this[u]=!0,this.dtype="int32",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>L.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>L.prototype[a.serialize].call(this,R))}[(u=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Int32NDArray=L,L.__name__="Int32NDArray";class A extends Float32Array{constructor(M,C){super(M),this[i]=!0,this.dtype="float32",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>A.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>A.prototype[a.serialize].call(this,R))}[(i=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Float32NDArray=A,A.__name__="Float32NDArray";class x extends Float64Array{constructor(M,C){super(M),this[o]=!0,this.dtype="float64",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>x.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>x.prototype[a.serialize].call(this,R))}[(o=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}function H(S){return(0,r.isObject)(S)&&S[l]!==void 0}t.Float64NDArray=x,x.__name__="Float64NDArray",t.is_NDArray=H,t.ndarray=function(S,M={}){let{dtype:C}=M;C==null&&(C=S instanceof ArrayBuffer||(0,r.isArray)(S)?"float64":(()=>{switch(!0){case S instanceof Uint8Array:return"uint8";case S instanceof Int8Array:return"int8";case S instanceof Uint16Array:return"uint16";case S instanceof Int16Array:return"int16";case S instanceof Uint32Array:return"uint32";case S instanceof Int32Array:return"int32";case S instanceof Float32Array:return"float32";case S instanceof Float64Array:return"float64";default:(0,e.unreachable)()}})());const{shape:R}=M;switch(C){case"uint8":return new Q(S,R);case"int8":return new m(S,R);case"uint16":return new p(S,R);case"int16":return new y(S,R);case"uint32":return new g(S,R);case"int32":return new L(S,R);case"float32":return new A(S,R);case"float64":return new x(S,R)}}},function(T,V,t,k,E){k();const v=T(11),b=T(13),w=T(8);t.serialize=Symbol("serialize");class f extends Error{}t.SerializationError=f,f.__name__="SerializationError";class d{constructor(i){var o;this._references=new Map,this._definitions=new Map,this._refmap=new Map,this.include_defaults=(o=i?.include_defaults)===null||o===void 0||o}get_ref(i){return this._references.get(i)}add_ref(i,o){(0,v.assert)(!this._references.has(i)),this._references.set(i,o)}add_def(i,o){const r=this.get_ref(i);(0,v.assert)(r!=null),this._definitions.set(i,o),this._refmap.set(r,o)}get objects(){return new Set(this._references.keys())}get references(){return new Set(this._references.values())}get definitions(){return new Set(this._definitions.values())}resolve_ref(i){return this._refmap.get(i)}remove_ref(i){return this._references.delete(i)}remove_def(i){return this._definitions.delete(i)}to_serializable(i){const o=this.get_ref(i);if(o!=null)return o;if((function(r){return(0,w.isObject)(r)&&r[t.serialize]!==void 0})(i))return i[t.serialize](this);if((0,w.isArray)(i)||(0,w.isTypedArray)(i)){const r=i.length,e=new Array(r);for(let s=0;s<r;s++){const a=i[s];e[s]=this.to_serializable(a)}return e}if((0,w.isPlainObject)(i)){const r={};for(const[e,s]of(0,b.entries)(i))r[e]=this.to_serializable(s);return r}if(i===null||(0,w.isBoolean)(i)||(0,w.isNumber)(i)||(0,w.isString)(i))return i;throw new f(`${Object.prototype.toString.call(i)} is not serializable`)}}t.Serializer=d,d.__name__="Serializer"},function(T,V,t,k,E){k();const v=T(8),b=T(27),w=T(32);t.is_NDArray_ref=function(f){return(0,v.isPlainObject)(f)&&("__buffer__"in f||"__ndarray__"in f)},t.decode_NDArray=function(f,d){const{shape:u,dtype:i,order:o}=f;let r;if("__buffer__"in f){const e=d.get(f.__buffer__);if(e==null)throw new Error(`buffer for ${f.__buffer__} not found`);r=e}else r=(0,w.base64_to_buffer)(f.__ndarray__);return o!==b.BYTE_ORDER&&(0,w.swap)(r,i),{buffer:r,dtype:i,shape:u}},t.encode_NDArray=function(f,d){const u={order:b.BYTE_ORDER,dtype:f.dtype,shape:f.shape};if(d!=null){const i=`${d.size}`;return d.set(i,f.buffer),Object.assign({__buffer__:i},u)}return Object.assign({__ndarray__:{toJSON:()=>(0,w.buffer_to_base64)(f.buffer)}},u)}},function(T,V,t,k,E){k(),t.buffer_to_base64=function(v){const b=new Uint8Array(v),w=Array.from(b).map(f=>String.fromCharCode(f));return btoa(w.join(""))},t.base64_to_buffer=function(v){const b=atob(v),w=b.length,f=new Uint8Array(w);for(let d=0,u=w;d<u;d++)f[d]=b.charCodeAt(d);return f.buffer},t.swap=function(v,b){switch(b){case"uint16":case"int16":(function(w){const f=new Uint8Array(w);for(let d=0,u=f.length;d<u;d+=2){const i=f[d];f[d]=f[d+1],f[d+1]=i}})(v);break;case"uint32":case"int32":case"float32":(function(w){const f=new Uint8Array(w);for(let d=0,u=f.length;d<u;d+=4){let i=f[d];f[d]=f[d+3],f[d+3]=i,i=f[d+1],f[d+1]=f[d+2],f[d+2]=i}})(v);break;case"float64":(function(w){const f=new Uint8Array(w);for(let d=0,u=f.length;d<u;d+=8){let i=f[d];f[d]=f[d+7],f[d+7]=i,i=f[d+1],f[d+1]=f[d+6],f[d+6]=i,i=f[d+2],f[d+2]=f[d+5],f[d+5]=i,i=f[d+3],f[d+3]=f[d+4],f[d+4]=i}})(v)}}},function(T,V,t,k,E){k();const v=T(26);class b{is_Scalar(){return this.is_scalar}is_Vector(){return!this.is_scalar}}t.Uniform=b,b.__name__="Uniform";class w extends b{constructor(i,o){super(),this.value=i,this.length=o,this.is_scalar=!0}get(i){return this.value}*[Symbol.iterator](){const{length:i,value:o}=this;for(let r=0;r<i;r++)yield o}select(i){return new w(this.value,i.count)}[v.equals](i,o){return o.eq(this.length,i.length)&&o.eq(this.value,i.value)}}t.UniformScalar=w,w.__name__="UniformScalar";class f extends b{constructor(i){super(),this.array=i,this.is_scalar=!1,this.length=this.array.length}get(i){return this.array[i]}*[Symbol.iterator](){yield*this.array}select(i){const o=i.select(this.array);return new this.constructor(o)}[v.equals](i,o){return o.eq(this.length,i.length)&&o.eq(this.array,i.array)}}t.UniformVector=f,f.__name__="UniformVector";class d extends f{constructor(i){super(i),this.array=i,this._view=new DataView(i.buffer)}get(i){return this._view.getUint32(4*i)}*[Symbol.iterator](){const i=this.length;for(let o=0;o<i;o++)yield this.get(o)}}t.ColorUniformVector=d,d.__name__="ColorUniformVector"},function(T,V,t,k,E){k();const v=T(28);function b(){const f=new Array(32),d="0123456789ABCDEF";for(let u=0;u<32;u++)f[u]=d.substr(Math.floor(16*Math.random()),1);return f[12]="4",f[16]=d.substr(3&f[16].charCodeAt(0)|8,1),f.join("")}t.startsWith=function(f,d,u=0){return f.substr(u,d.length)==d},t.uuid4=b;let w=1e3;t.uniqueId=function(f){const d=v.settings.dev?"j"+w++:b();return f!=null?`${f}-${d}`:d},t.escape=function(f){return f.replace(/(?:[&<>"'`])/g,d=>{switch(d){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#x27;";case"`":return"&#x60;";default:return d}})},t.unescape=function(f){return f.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,(d,u)=>{switch(u){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return u}})},t.use_strict=function(f){return`'use strict';
1
+ import{r as reactExports,j as jsxRuntimeExports}from"./index-BIyIgwS4.js";const main=(function(T,V,t,k){t===void 0&&(t={}),k===void 0&&(k={});const E={},v=function(f){if(typeof f=="number")return f;if(f==="bokehjs")return V;if(!k[f]){const o="@bokehjs/";f.slice(0,o.length)===o&&(f=f.slice(o.length))}const d=t[f];if(d!=null)return d;const u=f.length>0&&f[f.lenght-1]==="/";return t[f+(u?"":"/")+"index"]??f},b=function(f){let d=E[f];if(!d){const u=v(f);if(d=E[u],d)E[f]=d;else{let i=function(){Object.defineProperty(d.exports,"__esModule",{value:!0})},o=function(r,e){Object.defineProperty(d.exports,r,{enumerable:!0,get:function(){return e}})};if(!T[u]){if(k[u]===!1||k[u]==!0&&parent_require)try{return d={exports:k[u]?parent_require(u):{}},E[u]=E[f]=d,d.exports}catch{}const r=new Error("Cannot find module '"+f+"'");throw r.code="MODULE_NOT_FOUND",r}d={exports:{}},E[u]=E[f]=d,T[u].call(d.exports,b,d,d.exports,i,o)}}return d.exports};b.resolve=function(f){return""};const w=b(V);return w.require=b,typeof Proxy<"u"&&(w.loader=new Proxy({},{get:function(f,d){return b(d)}})),w.register_plugin=function(f,d,u,i){u===void 0&&(u={}),i===void 0&&(i={});for(let r in f)T[r]=f[r];for(let r in u)t[r]=u[r];for(let r in i)k[r]=i[r];const o=b(d);for(let r in o)w[r]=o[r];return o},w})([function(T,V,t,k,E){k(),(0,T(1).__exportStar)(T(2),t)},function(T,V,t,k,E){k();var v=function(u,i){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(o[e]=r[e])},v(u,i)};t.__extends=function(u,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function o(){this.constructor=u}v(u,i),u.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)};function b(u){var i=typeof Symbol=="function"&&Symbol.iterator,o=i&&u[i],r=0;if(o)return o.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&r>=u.length&&(u=void 0),{value:u&&u[r++],done:!u}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(u,i){var o=typeof Symbol=="function"&&u[Symbol.iterator];if(!o)return u;var r,e,s=o.call(u),a=[];try{for(;(i===void 0||i-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(c){e={error:c}}finally{try{r&&!r.done&&(o=s.return)&&o.call(s)}finally{if(e)throw e.error}}return a}function f(u){return this instanceof f?(this.v=u,this):new f(u)}t.__assign=function(){return t.__assign=Object.assign||function(u){for(var i,o=1,r=arguments.length;o<r;o++)for(var e in i=arguments[o])Object.prototype.hasOwnProperty.call(i,e)&&(u[e]=i[e]);return u},t.__assign.apply(this,arguments)},t.__rest=function(u,i){var o={};for(var r in u)Object.prototype.hasOwnProperty.call(u,r)&&i.indexOf(r)<0&&(o[r]=u[r]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function"){var e=0;for(r=Object.getOwnPropertySymbols(u);e<r.length;e++)i.indexOf(r[e])<0&&Object.prototype.propertyIsEnumerable.call(u,r[e])&&(o[r[e]]=u[r[e]])}return o},t.__decorate=function(u,i,o,r){var e,s=arguments.length,a=s<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,o):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(u,i,o,r);else for(var c=u.length-1;c>=0;c--)(e=u[c])&&(a=(s<3?e(a):s>3?e(i,o,a):e(i,o))||a);return s>3&&a&&Object.defineProperty(i,o,a),a},t.__param=function(u,i){return function(o,r){i(o,r,u)}},t.__metadata=function(u,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(u,i)},t.__awaiter=function(u,i,o,r){return new(o||(o=Promise))(function(e,s){function a(Q){try{l(r.next(Q))}catch(m){s(m)}}function c(Q){try{l(r.throw(Q))}catch(m){s(m)}}function l(Q){var m;Q.done?e(Q.value):(m=Q.value,m instanceof o?m:new o(function(p){p(m)})).then(a,c)}l((r=r.apply(u,i||[])).next())})},t.__generator=function(u,i){var o,r,e,s,a={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(l){return function(Q){return(function(m){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(e=2&m[0]?r.return:m[0]?r.throw||((e=r.return)&&e.call(r),0):r.next)&&!(e=e.call(r,m[1])).done)return e;switch(r=0,e&&(m=[2&m[0],e.value]),m[0]){case 0:case 1:e=m;break;case 4:return a.label++,{value:m[1],done:!1};case 5:a.label++,r=m[1],m=[0];continue;case 7:m=a.ops.pop(),a.trys.pop();continue;default:if(e=a.trys,!((e=e.length>0&&e[e.length-1])||m[0]!==6&&m[0]!==2)){a=0;continue}if(m[0]===3&&(!e||m[1]>e[0]&&m[1]<e[3])){a.label=m[1];break}if(m[0]===6&&a.label<e[1]){a.label=e[1],e=m;break}if(e&&a.label<e[2]){a.label=e[2],a.ops.push(m);break}e[2]&&a.ops.pop(),a.trys.pop();continue}m=i.call(u,a)}catch(p){m=[6,p],r=0}finally{o=e=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([l,Q])}}},t.__createBinding=Object.create?function(u,i,o,r){r===void 0&&(r=o),Object.defineProperty(u,r,{enumerable:!0,get:function(){return i[o]}})}:function(u,i,o,r){r===void 0&&(r=o),u[r]=i[o]},t.__exportStar=function(u,i){for(var o in u)o==="default"||Object.prototype.hasOwnProperty.call(i,o)||(0,t.__createBinding)(i,u,o)},t.__values=b,t.__read=w,t.__spread=function(){for(var u=[],i=0;i<arguments.length;i++)u=u.concat(w(arguments[i]));return u},t.__spreadArrays=function(){for(var u=0,i=0,o=arguments.length;i<o;i++)u+=arguments[i].length;var r=Array(u),e=0;for(i=0;i<o;i++)for(var s=arguments[i],a=0,c=s.length;a<c;a++,e++)r[e]=s[a];return r},t.__spreadArray=function(u,i,o){if(o||arguments.length===2)for(var r,e=0,s=i.length;e<s;e++)!r&&e in i||(r||(r=Array.prototype.slice.call(i,0,e)),r[e]=i[e]);return u.concat(r||Array.prototype.slice.call(i))},t.__await=f,t.__asyncGenerator=function(u,i,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,e=o.apply(u,i||[]),s=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(p){e[p]&&(r[p]=function(y){return new Promise(function(g,L){s.push([p,y,g,L])>1||c(p,y)})})}function c(p,y){try{(g=e[p](y)).value instanceof f?Promise.resolve(g.value.v).then(l,Q):m(s[0][2],g)}catch(L){m(s[0][3],L)}var g}function l(p){c("next",p)}function Q(p){c("throw",p)}function m(p,y){p(y),s.shift(),s.length&&c(s[0][0],s[0][1])}},t.__asyncDelegator=function(u){var i,o;return i={},r("next"),r("throw",function(e){throw e}),r("return"),i[Symbol.iterator]=function(){return this},i;function r(e,s){i[e]=u[e]?function(a){return(o=!o)?{value:f(u[e](a)),done:e==="return"}:s?s(a):a}:s}},t.__asyncValues=function(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,o=u[Symbol.asyncIterator];return o?o.call(u):(u=b(u),i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i);function r(e){i[e]=u[e]&&function(s){return new Promise(function(a,c){(function(l,Q,m,p){Promise.resolve(p).then(function(y){l({value:y,done:m})},Q)})(a,c,(s=u[e](s)).done,s.value)})}}},t.__makeTemplateObject=function(u,i){return Object.defineProperty?Object.defineProperty(u,"raw",{value:i}):u.raw=i,u};var d=Object.create?function(u,i){Object.defineProperty(u,"default",{enumerable:!0,value:i})}:function(u,i){u.default=i};t.__importStar=function(u){if(u&&u.__esModule)return u;var i={};if(u!=null)for(var o in u)o!=="default"&&Object.prototype.hasOwnProperty.call(u,o)&&(0,t.__createBinding)(i,u,o);return d(i,u),i},t.__importDefault=function(u){return u&&u.__esModule?u:{default:u}},t.__classPrivateFieldGet=function(u,i,o,r){if(o==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof i=="function"?u!==i||!r:!i.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?r:o==="a"?r.call(u):r?r.value:i.get(u)},t.__classPrivateFieldSet=function(u,i,o,r,e){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!e)throw new TypeError("Private accessor was defined without a setter");if(typeof i=="function"?u!==i||!e:!i.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?e.call(u,o):e?e.value=o:i.set(u,o),o}},function(T,V,t,k,E){k();const v=T(1);E("version",T(3).version),E("index",T(4).index),t.embed=(0,v.__importStar)(T(4)),t.protocol=(0,v.__importStar)(T(406)),t._testing=(0,v.__importStar)(T(407));var b=T(19);E("logger",b.logger),E("set_log_level",b.set_log_level),E("settings",T(28).settings),E("Models",T(7).Models),E("documents",T(5).documents),E("safely",T(408).safely)},function(T,V,t,k,E){k(),t.version="2.4.3"},function(T,V,t,k,E){k();const v=T(5),b=T(19),w=T(34),f=T(13),d=T(8),u=T(16),i=T(397),o=T(399),r=T(398);var e=T(397);E("add_document_standalone",e.add_document_standalone),E("index",e.index),E("add_document_from_session",T(399).add_document_from_session);var s=T(404);async function a(c,l,Q,m){(0,d.isString)(c)&&(c=JSON.parse((0,w.unescape)(c)));const p={};for(const[g,L]of(0,f.entries)(c))p[g]=v.Document.from_json(L);const y=[];for(const g of l){const L=(0,r._resolve_element)(g),A=(0,r._resolve_root_elements)(g);if(g.docid!=null)y.push(await(0,i.add_document_standalone)(p[g.docid],L,A,g.use_for_title));else{if(g.token==null)throw new Error("Error rendering Bokeh items: either 'docid' or 'token' was expected.");{const x=(0,o._get_ws_url)(Q,m);b.logger.debug(`embed: computed ws url: ${x}`);try{y.push(await(0,o.add_document_from_session)(x,g.token,L,A,g.use_for_title)),console.log("Bokeh items were rendered successfully")}catch(H){console.log("Error rendering Bokeh items:",H)}}}}return y}E("embed_items_notebook",s.embed_items_notebook),E("kernels",s.kernels),E("BOKEH_ROOT",T(398).BOKEH_ROOT),t.embed_item=async function(c,l){const Q={},m=(0,w.uuid4)();Q[m]=c.doc,l==null&&(l=c.target_id),document.getElementById(l)?.classList.add(r.BOKEH_ROOT);const y={roots:{[c.root_id]:l},root_ids:[c.root_id],docid:m};await(0,u.defer)();const[g]=await a(Q,[y]);return g},t.embed_items=async function(c,l,Q,m){return await(0,u.defer)(),a(c,l,Q,m)}},function(T,V,t,k,E){k();const v=T(1);(0,v.__exportStar)(T(6),t),(0,v.__exportStar)(T(35),t)},function(T,V,t,k,E){k();const v=T(1),b=T(7),w=T(3),f=T(19),d=T(251),u=T(14),i=T(30),o=T(15),r=T(17),e=T(31),s=T(29),a=T(9),c=T(13),l=(0,v.__importStar)(T(77)),Q=T(26),m=T(8),p=T(309),y=T(75),g=T(53),L=T(396),A=T(35);class x{constructor(M){this.document=M,this.session=null,this.subscribed_models=new Set}send_event(M){const C=new A.MessageSentEvent(this.document,"bokeh_event",M.to_json());this.document._trigger_on_change(C)}trigger(M){for(const C of this.subscribed_models)M.origin!=null&&M.origin!=C||C._process_event(M)}}t.EventManager=x,x.__name__="EventManager",t.documents=[],t.DEFAULT_TITLE="Bokeh Application";class H{constructor(M){var C;t.documents.push(this),this._init_timestamp=Date.now(),this._resolver=(C=M?.resolver)!==null&&C!==void 0?C:new b.ModelResolver,this._title=t.DEFAULT_TITLE,this._roots=[],this._all_models=new Map,this._all_models_freeze_count=0,this._callbacks=new Map,this._message_callbacks=new Map,this.event_manager=new x(this),this.idle=new o.Signal0(this,"idle"),this._idle_roots=new WeakMap,this._interactive_timestamp=null,this._interactive_plot=null}get layoutables(){return this._roots.filter(M=>M instanceof p.LayoutDOM)}get is_idle(){for(const M of this.layoutables)if(!this._idle_roots.has(M))return!1;return!0}notify_idle(M){this._idle_roots.set(M,!0),this.is_idle&&(f.logger.info(`document idle at ${Date.now()-this._init_timestamp} ms`),this.event_manager.send_event(new d.DocumentReady),this.idle.emit())}clear(){this._push_all_models_freeze();try{for(;this._roots.length>0;)this.remove_root(this._roots[0])}finally{this._pop_all_models_freeze()}}interactive_start(M,C=null){this._interactive_plot==null&&(this._interactive_plot=M,this._interactive_plot.trigger_event(new d.LODStart)),this._interactive_finalize=C,this._interactive_timestamp=Date.now()}interactive_stop(){this._interactive_plot!=null&&(this._interactive_plot.trigger_event(new d.LODEnd),this._interactive_finalize!=null&&this._interactive_finalize()),this._interactive_plot=null,this._interactive_timestamp=null,this._interactive_finalize=null}interactive_duration(){return this._interactive_timestamp==null?-1:Date.now()-this._interactive_timestamp}destructively_move(M){if(M===this)throw new Error("Attempted to overwrite a document with itself");M.clear();const C=(0,a.copy)(this._roots);this.clear();for(const R of C)if(R.document!=null)throw new Error(`Somehow we didn't detach ${R}`);if(this._all_models.size!=0)throw new Error(`this._all_models still had stuff in it: ${this._all_models}`);for(const R of C)M.add_root(R);M.set_title(this._title)}_push_all_models_freeze(){this._all_models_freeze_count+=1}_pop_all_models_freeze(){this._all_models_freeze_count-=1,this._all_models_freeze_count===0&&this._recompute_all_models()}_invalidate_all_models(){f.logger.debug("invalidating document models"),this._all_models_freeze_count===0&&this._recompute_all_models()}_recompute_all_models(){let M=new Set;for(const z of this._roots)M=l.union(M,z.references());const C=new Set(this._all_models.values()),R=l.difference(C,M),D=l.difference(M,C),B=new Map;for(const z of M)B.set(z.id,z);for(const z of R)z.detach_document();for(const z of D)z.attach_document(this);this._all_models=B}roots(){return this._roots}add_root(M,C){if(f.logger.debug(`Adding root: ${M}`),!(0,a.includes)(this._roots,M)){this._push_all_models_freeze();try{this._roots.push(M)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new A.RootAddedEvent(this,M,C))}}remove_root(M,C){const R=this._roots.indexOf(M);if(!(R<0)){this._push_all_models_freeze();try{this._roots.splice(R,1)}finally{this._pop_all_models_freeze()}this._trigger_on_change(new A.RootRemovedEvent(this,M,C))}}title(){return this._title}set_title(M,C){M!==this._title&&(this._title=M,this._trigger_on_change(new A.TitleChangedEvent(this,M,C)))}get_model_by_id(M){var C;return(C=this._all_models.get(M))!==null&&C!==void 0?C:null}get_model_by_name(M){const C=[];for(const R of this._all_models.values())R instanceof g.Model&&R.name==M&&C.push(R);switch(C.length){case 0:return null;case 1:return C[0];default:throw new Error(`Multiple models are named '${M}'`)}}on_message(M,C){const R=this._message_callbacks.get(M);R==null?this._message_callbacks.set(M,new Set([C])):R.add(C)}remove_on_message(M,C){var R;(R=this._message_callbacks.get(M))===null||R===void 0||R.delete(C)}_trigger_on_message(M,C){const R=this._message_callbacks.get(M);if(R!=null)for(const D of R)D(C)}on_change(M,C=!1){this._callbacks.has(M)||this._callbacks.set(M,C)}remove_on_change(M){this._callbacks.delete(M)}_trigger_on_change(M){for(const[C,R]of this._callbacks)if(!R&&M instanceof A.DocumentEventBatch)for(const D of M.events)C(D);else C(M)}_notify_change(M,C,R,D,B){this._trigger_on_change(new A.ModelChangedEvent(this,M,C,R,D,B?.setter_id,B?.hint))}static _instantiate_object(M,C,R,D){const B=Object.assign(Object.assign({},R),{id:M,__deferred__:!0});return new(D.get(C))(B)}static _instantiate_references_json(M,C,R){var D;const B=new Map;for(const z of M){const N=z.id,I=z.type,O=(D=z.attributes)!==null&&D!==void 0?D:{};let G=C.get(N);G==null&&(G=H._instantiate_object(N,I,O,R),z.subtype!=null&&G.set_subtype(z.subtype)),B.set(G.id,G)}return B}static _resolve_refs(M,C,R,D){function B(z){var N;if((0,r.is_ref)(z)){const I=(N=C.get(z.id))!==null&&N!==void 0?N:R.get(z.id);if(I!=null)return I;throw new Error(`reference ${JSON.stringify(z)} isn't known (not in Document?)`)}if((0,e.is_NDArray_ref)(z)){const{buffer:I,dtype:O,shape:G}=(0,e.decode_NDArray)(z,D);return(0,s.ndarray)(I,{dtype:O,shape:G})}return(0,m.isArray)(z)?(function(I){const O=[];for(const G of I)O.push(B(G));return O})(z):(0,m.isPlainObject)(z)?(function(I){const O={};for(const[G,q]of(0,c.entries)(I))O[G]=B(q);return O})(z):z}return B(M)}static _initialize_references_json(M,C,R,D){const B=new Map;for(const{id:O,attributes:G}of M){const q=!C.has(O),Z=q?R.get(O):C.get(O),U=H._resolve_refs(G,C,R,D);Z.setv(U,{silent:!0}),B.set(O,{instance:Z,is_new:q})}const z=[],N=new Set;function I(O){if(O instanceof u.HasProps){if(B.has(O.id)&&!N.has(O.id)){N.add(O.id);const{instance:G,is_new:q}=B.get(O.id),{attributes:Z}=G;for(const U of(0,c.values)(Z))I(U);q&&(G.finalize(),z.push(G))}}else if((0,m.isArray)(O))for(const G of O)I(G);else if((0,m.isPlainObject)(O))for(const G of(0,c.values)(O))I(G)}for(const O of B.values())I(O.instance);for(const O of z)O.connect_signals()}static _event_for_attribute_change(M,C,R,D,B){if(D.get_model_by_id(M.id).property(C).syncable){const z={kind:"ModelChanged",model:{id:M.id},attr:C,new:R};return u.HasProps._json_record_references(D,R,B,{recursive:!0}),z}return null}static _events_to_sync_objects(M,C,R,D){const B=Object.keys(M.attributes),z=Object.keys(C.attributes),N=(0,a.difference)(B,z),I=(0,a.difference)(z,B),O=(0,a.intersection)(B,z),G=[];for(const q of N)f.logger.warn(`Server sent key ${q} but we don't seem to have it in our JSON`);for(const q of I){const Z=C.attributes[q];G.push(H._event_for_attribute_change(M,q,Z,R,D))}for(const q of O){const Z=M.attributes[q],U=C.attributes[q];Z==null&&U==null||(Z==null||U==null?G.push(H._event_for_attribute_change(M,q,U,R,D)):q=="data"||(0,Q.is_equal)(Z,U)||G.push(H._event_for_attribute_change(M,q,U,R,D)))}return G.filter(q=>q!=null)}static _compute_patch_since_json(M,C){const R=C.to_json(!1);function D(ot){const ft=new Map;for(const Ct of ot.roots.references)ft.set(Ct.id,Ct);return ft}const B=D(M),z=new Map,N=[];for(const ot of M.roots.root_ids)z.set(ot,B.get(ot)),N.push(ot);const I=D(R),O=new Map,G=[];for(const ot of R.roots.root_ids)O.set(ot,I.get(ot)),G.push(ot);if(N.sort(),G.sort(),(0,a.difference)(N,G).length>0||(0,a.difference)(G,N).length>0)throw new Error("Not implemented: computing add/remove of document roots");const q=new Set;let Z=[];for(const ot of C._all_models.keys())if(B.has(ot)){const ft=H._events_to_sync_objects(B.get(ot),I.get(ot),C,q);Z=Z.concat(ft)}const U=new i.Serializer({include_defaults:!1});return U.to_serializable([...q]),{references:[...U.definitions],events:Z}}to_json_string(M=!0){return JSON.stringify(this.to_json(M))}to_json(M=!0){const C=new i.Serializer({include_defaults:M}),R=C.to_serializable(this._roots);return{version:w.version,title:this._title,roots:{root_ids:R.map(D=>D.id),references:[...C.definitions]}}}static from_json_string(M){const C=JSON.parse(M);return H.from_json(C)}static from_json(M){f.logger.debug("Creating Document from JSON");const C=M.version,R=C.indexOf("+")!==-1||C.indexOf("-")!==-1,D=`Library versions: JS (${w.version}) / Python (${C})`;R||w.version.replace(/-(dev|rc)\./,"$1")==C?f.logger.debug(D):(f.logger.warn("JS/Python version mismatch"),f.logger.warn(D));const B=new b.ModelResolver;M.defs!=null&&(0,L.resolve_defs)(M.defs,B);const z=M.roots,N=z.root_ids,I=z.references,O=H._instantiate_references_json(I,new Map,B);H._initialize_references_json(I,new Map,O,new Map);const G=new H({resolver:B});G._push_all_models_freeze();for(const q of N){const Z=O.get(q);Z!=null&&G.add_root(Z)}return G._pop_all_models_freeze(),G.set_title(M.title),G}replace_with_json(M){H.from_json(M).destructively_move(this)}create_json_patch_string(M){return JSON.stringify(this.create_json_patch(M))}create_json_patch(M){for(const D of M)if(D.document!=this)throw new Error("Cannot create a patch using events from a different document");const C=new i.Serializer,R=C.to_serializable(M);for(const D of this._all_models.values())C.remove_def(D);return{events:R,references:[...C.definitions]}}apply_json_patch(M,C=new Map,R){const D=M.references,B=M.events,z=H._instantiate_references_json(D,this._all_models,this._resolver);C instanceof Map||(C=new Map(C));for(const O of B)switch(O.kind){case"RootAdded":case"RootRemoved":case"ModelChanged":{const G=O.model.id,q=this._all_models.get(G);if(q!=null)z.set(G,q);else if(!z.has(G))throw f.logger.warn(`Got an event for unknown model ${O.model}"`),new Error("event model wasn't known");break}}const N=new Map(this._all_models),I=new Map;for(const[O,G]of z)N.has(O)||I.set(O,G);H._initialize_references_json(D,N,I,C);for(const O of B)switch(O.kind){case"MessageSent":{const{msg_type:G,msg_data:q}=O;let Z;if(q===void 0){if(C.size!=1)throw new Error("expected exactly one buffer");{const[[,U]]=C;Z=U}}else Z=H._resolve_refs(q,N,I,C);this._trigger_on_message(G,Z);break}case"ModelChanged":{const G=O.model.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot apply patch to ${G} which is not in the document`);const Z=O.attr,U=H._resolve_refs(O.new,N,I,C);q.setv({[Z]:U},{setter_id:R});break}case"ColumnDataChanged":{const G=O.column_source.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot stream to ${G} which is not in the document`);const Z=H._resolve_refs(O.new,new Map,new Map,C);if(O.cols!=null)for(const U in q.data)U in Z||(Z[U]=q.data[U]);q.setv({data:Z},{setter_id:R,check_eq:!1});break}case"ColumnsStreamed":{const G=O.column_source.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot stream to ${G} which is not in the document`);if(!(q instanceof y.ColumnDataSource))throw new Error("Cannot stream to non-ColumnDataSource");const Z=O.data,U=O.rollover;q.stream(Z,U,R);break}case"ColumnsPatched":{const G=O.column_source.id,q=this._all_models.get(G);if(q==null)throw new Error(`Cannot patch ${G} which is not in the document`);if(!(q instanceof y.ColumnDataSource))throw new Error("Cannot patch non-ColumnDataSource");const Z=O.patches;q.patch(Z,R);break}case"RootAdded":{const G=O.model.id,q=z.get(G);this.add_root(q,R);break}case"RootRemoved":{const G=O.model.id,q=z.get(G);this.remove_root(q,R);break}case"TitleChanged":this.set_title(O.title,R);break;default:throw new Error(`Unknown patch event ${JSON.stringify(O)}`)}}}t.Document=H,H.__name__="Document"},function(T,V,t,k,E){k();const v=T(1),b=T(8),w=T(13),f=T(14);t.overrides={};const d=new Map;t.Models=r=>{const e=t.Models.get(r);if(e!=null)return e;throw new Error(`Model '${r}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)},t.Models.get=r=>{var e;return(e=t.overrides[r])!==null&&e!==void 0?e:d.get(r)},t.Models.register=(r,e)=>{t.overrides[r]=e},t.Models.unregister=r=>{delete t.overrides[r]},t.Models.register_models=(r,e=!1,s)=>{var a;if(r!=null){for(const c of(0,b.isArray)(r)?r:(0,w.values)(r))if(a=c,(0,b.isObject)(a)&&a.prototype instanceof f.HasProps){const l=c.__qualified__;e||!d.has(l)?d.set(l,c):s!=null?s(l):console.warn(`Model '${l}' was already registered`)}}},t.register_models=t.Models.register_models,t.Models.registered_names=()=>[...d.keys()];class u{constructor(){this._known_models=new Map}get(e,s){var a;const c=(a=t.Models.get(e))!==null&&a!==void 0?a:this._known_models.get(e);if(c!=null)return c;if(s!==void 0)return s;throw new Error(`Model '${e}' does not exist. This could be due to a widget or a custom model not being registered before first usage.`)}register(e){const s=e.__qualified__;this.get(s,null)==null?this._known_models.set(s,e):console.warn(`Model '${s}' was already registered with this resolver`)}}t.ModelResolver=u,u.__name__="ModelResolver";const i=(0,v.__importStar)(T(38));(0,t.register_models)(i);const o=(0,v.__importStar)(T(392));(0,t.register_models)(o)},function(T,V,t,k,E){k();const v=T(9),b=Object.prototype.toString;function w(r){return r===!0||r===!1||b.call(r)==="[object Boolean]"}function f(r){return b.call(r)==="[object Number]"}function d(r){return b.call(r)==="[object String]"}function u(r){return typeof r=="symbol"}function i(r){const e=typeof r;return e==="function"||e==="object"&&!!r}function o(r){return i(r)&&r[Symbol.iterator]!==void 0}t.isBoolean=w,t.isNumber=f,t.isInteger=function(r){return f(r)&&Number.isInteger(r)},t.isString=d,t.isSymbol=u,t.isPrimitive=function(r){return r===null||w(r)||f(r)||d(r)||u(r)},t.isFunction=function(r){return b.call(r)==="[object Function]"},t.isArray=function(r){return Array.isArray(r)},t.isArrayOf=function(r,e){return(0,v.every)(r,e)},t.isArrayableOf=function(r,e){for(let s=0,a=r.length;s<a;s++)if(!e(r[s]))return!1;return!0},t.isTypedArray=function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},t.isObject=i,t.isPlainObject=function(r){return i(r)&&(r.constructor==null||r.constructor===Object)},t.isIterable=o,t.isArrayable=function(r){return o(r)&&"length"in r}},function(T,V,t,k,E){k();const v=T(10),b=T(11),w=T(12);E("map",w.map),E("reduce",w.reduce),E("min",w.min),E("min_by",w.min_by),E("max",w.max),E("max_by",w.max_by),E("sum",w.sum),E("cumsum",w.cumsum),E("every",w.every),E("some",w.some),E("find",w.find),E("find_last",w.find_last),E("find_index",w.find_index),E("find_last_index",w.find_last_index),E("sorted_index",w.sorted_index),E("is_empty",w.is_empty);const f=Array.prototype.slice;function d(r){return f.call(r)}function u(r){return[].concat(...r)}function i(r,e){return r.indexOf(e)!==-1}function o(r,e,s=1){(0,b.assert)(s>0,"'step' must be a positive number"),e==null&&(e=r,r=0);const{max:a,ceil:c,abs:l}=Math,Q=r<=e?s:-s,m=a(c(l(e-r)/s),0),p=new Array(m);for(let y=0;y<m;y++,r+=Q)p[y]=r;return p}t.head=function(r){return r[0]},t.tail=function(r){return r[r.length-1]},t.last=function(r){return r[r.length-1]},t.copy=d,t.concat=u,t.includes=i,t.contains=i,t.nth=function(r,e){return r[e>=0?e:r.length+e]},t.zip=function(...r){if(r.length==0)return[];const e=(0,w.min)(r.map(c=>c.length)),s=r.length,a=new Array(e);for(let c=0;c<e;c++){a[c]=new Array(s);for(let l=0;l<s;l++)a[c][l]=r[l][c]}return a},t.unzip=function(r){const e=r.length,s=(0,w.min)(r.map(c=>c.length)),a=Array(s);for(let c=0;c<s;c++)a[c]=new Array(e);for(let c=0;c<e;c++)for(let l=0;l<s;l++)a[l][c]=r[c][l];return a},t.range=o,t.linspace=function(r,e,s=100){const a=(e-r)/(s-1),c=new Array(s);for(let l=0;l<s;l++)c[l]=r+a*l;return c},t.transpose=function(r){const e=r.length,s=r[0].length,a=[];for(let c=0;c<s;c++){a[c]=[];for(let l=0;l<e;l++)a[c][l]=r[l][c]}return a},t.argmin=function(r){return(0,w.min_by)(o(r.length),e=>r[e])},t.argmax=function(r){return(0,w.max_by)(o(r.length),e=>r[e])},t.sort_by=function(r,e){const s=r.map((a,c)=>({value:a,index:c,key:e(a)}));return s.sort((a,c)=>{const l=a.key,Q=c.key;if(l!==Q){if(l>Q||l===void 0)return 1;if(l<Q||Q===void 0)return-1}return a.index-c.index}),s.map(a=>a.value)},t.uniq=function(r){const e=new Set;for(const s of r)e.add(s);return[...e]},t.uniq_by=function(r,e){const s=[],a=[];for(const c of r){const l=e(c);i(a,l)||(a.push(l),s.push(c))}return s},t.union=function(...r){const e=new Set;for(const s of r)for(const a of s)e.add(a);return[...e]},t.intersection=function(r,...e){const s=[];t:for(const a of r)if(!i(s,a)){for(const c of e)if(!i(c,a))continue t;s.push(a)}return s},t.difference=function(r,...e){const s=u(e);return r.filter(a=>!i(s,a))},t.remove_at=function(r,e){const s=d(r);return s.splice(e,1),s},t.remove_by=function(r,e){for(let s=0;s<r.length;)e(r[s])?r.splice(s,1):s++},t.shuffle=function(r){const e=r.length,s=new Array(e);for(let a=0;a<e;a++){const c=(0,v.randomIn)(0,a);c!==a&&(s[a]=s[c]),s[c]=r[a]}return s},t.pairwise=function(r,e){const s=r.length,a=new Array(s-1);for(let c=0;c<s-1;c++)a[c]=e(r[c],r[c+1]);return a},t.reversed=function(r){const e=r.length,s=new Array(e);for(let a=0;a<e;a++)s[e-a-1]=r[a];return s},t.repeat=function(r,e){const s=new Array(e);for(let a=0;a<e;a++)s[a]=r;return s}},function(T,V,t,k,E){k();const{PI:v}=Math;function b(u){if(u==0)return 0;for(;u<=0;)u+=2*v;for(;u>2*v;)u-=2*v;return u}function w(u,i){return b(u-i)}function f(){return Math.random()}function d(u){switch(u){case"deg":return v/180;case"rad":return 1;case"grad":return v/200;case"turn":return 2*v}}t.angle_norm=b,t.angle_dist=w,t.angle_between=function(u,i,o,r=!1){const e=w(i,o);if(e==0)return!1;if(e==2*v)return!0;const s=b(u),a=w(i,s)<=e&&w(s,o)<=e;return r?!a:a},t.random=f,t.randomIn=function(u,i){return i==null&&(i=u,u=0),u+Math.floor(Math.random()*(i-u+1))},t.atan2=function(u,i){return Math.atan2(i[1]-u[1],i[0]-u[0])},t.radians=function(u){return u*(v/180)},t.degrees=function(u){return u/(v/180)},t.resolve_angle=function(u,i){return-d(i)*u},t.to_radians_coeff=d,t.rnorm=function(u,i){let o,r;for(;o=f(),r=f(),r=(2*r-1)*Math.sqrt(1/Math.E*2),!(-4*o*o*Math.log(o)>=r*r););let e=r/o;return e=u+i*e,e},t.clamp=function(u,i,o){return u<i?i:u>o?o:u},t.log=function(u,i=Math.E){return Math.log(u)/Math.log(i)},t.float32_epsilon=11920928955078125e-23},function(T,V,t,k,E){k();class v extends Error{}t.AssertionError=v,v.__name__="AssertionError",t.assert=function(b,w){if(!(b===!0||b!==!1&&b()))throw new v(w??"Assertion failed")},t.unreachable=function(){throw new Error("unreachable code")}},function(T,V,t,k,E){k();const v=T(10);function b(e,s,a,...c){const l=e.length;s<0&&(s+=l),s<0?s=0:s>l&&(s=l),a==null||a>l-s?a=l-s:a<0&&(a=0);const Q=l-a+c.length,m=new e.constructor(Q);let p=0;for(;p<s;p++)m[p]=e[p];for(const y of c)m[p++]=y;for(let y=s+a;y<l;y++)m[p++]=e[y];return m}function w(e,s){return b(e,s,e.length-s)}function f(e,s){const a=e.length,c=new e.constructor(a);for(let l=0;l<a;l++)c[l]=s(e[l],l,e);return c}function d(e,s,a){const c=e.length;if(a===void 0&&c==0)throw new Error("can't reduce an empty array without an initial value");let l,Q;for(a===void 0?(l=e[0],Q=1):(l=a,Q=0);Q<c;Q++)l=s(l,e[Q],Q,e);return l}function u(e){return function(s,a){const c=s.length;let l=e>0?0:c-1;for(;l>=0&&l<c;l+=e)if(a(s[l]))return l;return-1}}function i(e,s){let a=0,c=e.length;for(;a<c;){const l=Math.floor((a+c)/2);e[l]<s?a=l+1:c=l}return a}function o(e,s,a,c,l){const Q=(l-a)/(c-s);let m=Q*(e-s)+a;return isFinite(m)||(m=Q*(e-c)+l,isFinite(m)||a!=l||(m=a)),m}function r(e,s){if(e<s[0])return-1;if(e>s[s.length-1])return s.length;let a=0,c=s.length-1;for(;c-a!=1;){const l=a+Math.floor((c-a)/2);e>=s[l]?a=l:c=l}return a}t.is_empty=function(e){return e.length==0},t.copy=function(e){return Array.isArray(e)?e.slice():new e.constructor(e)},t.splice=b,t.head=w,t.insert=function(e,s,a){return b(e,a,0,s)},t.append=function(e,s){return b(e,e.length,0,s)},t.prepend=function(e,s){return b(e,0,0,s)},t.indexOf=function(e,s){for(let a=0,c=e.length;a<c;a++)if(e[a]===s)return a;return-1},t.subselect=function(e,s){const a=s.length,c=new e.constructor(a);for(let l=0;l<a;l++)c[l]=e[s[l]];return c},t.mul=function(e,s,a){const c=e.length,l=a??new e.constructor(c);for(let Q=0;Q<c;Q++)l[Q]=e[Q]*s;return l},t.map=f,t.inplace_map=function(e,s,a){const c=e.length,l=a??e;for(let Q=0;Q<c;Q++)l[Q]=s(e[Q],Q)},t.filter=function(e,s){const a=e.length,c=new e.constructor(a);let l=0;for(let Q=0;Q<a;Q++){const m=e[Q];s(m,Q,e)&&(c[l++]=m)}return w(c,l)},t.reduce=d,t.min=function(e){let s,a=1/0;for(let c=0,l=e.length;c<l;c++)s=e[c],!isNaN(s)&&s<a&&(a=s);return a},t.max=function(e){let s,a=-1/0;for(let c=0,l=e.length;c<l;c++)s=e[c],!isNaN(s)&&s>a&&(a=s);return a},t.minmax=function(e){let s,a=1/0,c=-1/0;for(let l=0,Q=e.length;l<Q;l++)s=e[l],isNaN(s)||(s<a&&(a=s),s>c&&(c=s));return[a,c]},t.minmax2=function(e,s){let a,c,l=1/0,Q=-1/0,m=1/0,p=-1/0;const y=Math.min(e.length,s.length);for(let g=0;g<y;g++)a=e[g],c=s[g],isNaN(a)||isNaN(c)||(a<l&&(l=a),a>Q&&(Q=a),c<m&&(m=c),c>p&&(p=c));return[l,Q,m,p]},t.min_by=function(e,s){if(e.length==0)throw new Error("min_by() called with an empty array");let a=e[0],c=s(a);for(let l=1,Q=e.length;l<Q;l++){const m=e[l],p=s(m);p<c&&(a=m,c=p)}return a},t.max_by=function(e,s){if(e.length==0)throw new Error("max_by() called with an empty array");let a=e[0],c=s(a);for(let l=1,Q=e.length;l<Q;l++){const m=e[l],p=s(m);p>c&&(a=m,c=p)}return a},t.sum=function(e){let s=0;for(let a=0,c=e.length;a<c;a++)s+=e[a];return s},t.cumsum=function(e){const s=new e.constructor(e.length);return d(e,(a,c,l)=>s[l]=a+c,0),s},t.every=function(e,s){for(let a=0,c=e.length;a<c;a++)if(!s(e[a]))return!1;return!0},t.some=function(e,s){for(let a=0,c=e.length;a<c;a++)if(s(e[a]))return!0;return!1},t.index_of=function(e,s){for(let a=0,c=e.length;a<c;a++)if(e[a]===s)return a;return-1},t.find_index=u(1),t.find_last_index=u(-1),t.find=function(e,s){const a=(0,t.find_index)(e,s);return a==-1?void 0:e[a]},t.find_last=function(e,s){const a=(0,t.find_last_index)(e,s);return a==-1?void 0:e[a]},t.sorted_index=i,t.bin_counts=function(e,s){const a=s.length-1,c=Array(a).fill(0);for(let l=0;l<e.length;l++){const Q=i(s,e[l]);c[(0,v.clamp)(Q-1,0,a-1)]+=1}return c},t.interpolate=function(e,s,a){const c=e.length,l=new Array(c);for(let Q=0;Q<c;Q++){const m=e[Q];if(isNaN(m)){l[Q]=m;continue}const p=r(m,s);if(p==-1)l[Q]=a[0];else if(p==s.length)l[Q]=a[a.length-1];else if(p==s.length-1||s[p]==m)l[Q]=a[p];else{const y=s[p],g=a[p],L=s[p+1],A=a[p+1];l[Q]=o(m,y,g,L,A)}}return l},t.left_edge_index=r,t.norm=function(e,s,a){const c=a-s;return f(e,l=>(l-s)/c)}},function(T,V,t,k,E){k();const v=T(9),{hasOwnProperty:b}=Object.prototype;function w(d){return Object.keys(d).length}function f(d){return w(d)==0}t.keys=Object.keys,t.values=Object.values,t.entries=Object.entries,t.extend=Object.assign,t.clone=function(d){return Object.assign({},d)},t.merge=function(d,u){const i=Object.create(Object.prototype),o=(0,v.concat)([Object.keys(d),Object.keys(u)]);for(const r of o){const e=b.call(d,r)?d[r]:[],s=b.call(u,r)?u[r]:[];i[r]=(0,v.union)(e,s)}return i},t.size=w,t.is_empty=f,t.isEmpty=f,t.to_object=function(d){const u={};for(const[i,o]of d)u[i]=o;return u}},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(15),f=T(17),d=(0,v.__importStar)(T(18)),u=(0,v.__importStar)(T(21)),i=T(34),o=T(13),r=T(8),e=T(26),s=T(30),a=T(35),c=T(26),l=T(36),Q=T(37),m=(0,v.__importStar)(T(21));class p extends(0,w.Signalable)(){constructor(g={}){var L,A;super(),this._subtype=void 0,this.document=null,this.destroyed=new w.Signal0(this,"destroyed"),this.change=new w.Signal0(this,"change"),this.transformchange=new w.Signal0(this,"transformchange"),this.exprchange=new w.Signal0(this,"exprchange"),this.properties={},this._watchers=new WeakMap,this._pending=!1,this._changing=!1;const x=g instanceof Map?g.get.bind(g):H=>g[H];this.id=(L=x("id"))!==null&&L!==void 0?L:(0,i.uniqueId)();for(const[H,{type:S,default_value:M,options:C}]of(0,o.entries)(this._props)){let R;S instanceof d.PropertyAlias?Object.defineProperty(this.properties,H,{get:()=>this.properties[S.attr],configurable:!1,enumerable:!1}):(R=S instanceof u.Kind?new d.PrimitiveProperty(this,H,S,M,x(H),C):new S(this,H,u.Any,M,x(H),C),this.properties[H]=R)}(A=x("__deferred__"))!==null&&A!==void 0&&A||(this.finalize(),this.connect_signals())}get is_syncable(){return!0}set type(g){console.warn("prototype.type = 'ModelName' is deprecated, use static __name__ instead"),this.constructor.__name__=g}get type(){return this.constructor.__qualified__}static get __qualified__(){const{__module__:g,__name__:L}=this;return g!=null?`${g}.${L}`:L}static get[Symbol.toStringTag](){return this.__name__}static _fix_default(g,L){if(g===void 0||(0,r.isFunction)(g))return g;if((0,r.isPrimitive)(g))return()=>g;{const A=new Q.Cloner;return()=>A.clone(g)}}static define(g){for(const[L,A]of(0,o.entries)((0,r.isFunction)(g)?g(m):g)){if(this.prototype._props[L]!=null)throw new Error(`attempted to redefine property '${this.prototype.type}.${L}'`);if(this.prototype[L]!=null)throw new Error(`attempted to redefine attribute '${this.prototype.type}.${L}'`);Object.defineProperty(this.prototype,L,{get(){return this.properties[L].get_value()},set(R){return this.setv({[L]:R}),this},configurable:!1,enumerable:!0});const[x,H,S={}]=A,M={type:x,default_value:this._fix_default(H,L),options:S},C=Object.assign({},this.prototype._props);C[L]=M,this.prototype._props=C}}static internal(g){const L={};for(const[A,x]of(0,o.entries)((0,r.isFunction)(g)?g(m):g)){const[H,S,M={}]=x;L[A]=[H,S,Object.assign(Object.assign({},M),{internal:!0})]}this.define(L)}static mixins(g){function L(H,S){const M={};for(const[C,R]of(0,o.entries)(S))M[H+C]=R;return M}const A={},x=[];for(const H of(0,r.isArray)(g)?g:[g])if((0,r.isArray)(H)){const[S,M]=H;(0,o.extend)(A,L(S,M)),x.push([S,M])}else{const S=H;(0,o.extend)(A,S),x.push(["",S])}this.define(A),this.prototype._mixins=[...this.prototype._mixins,...x]}static override(g){for(const[L,A]of(0,o.entries)(g)){const x=this._fix_default(A,L),H=this.prototype._props[L];if(H==null)throw new Error(`attempted to override nonexistent '${this.prototype.type}.${L}'`);const S=Object.assign({},this.prototype._props);S[L]=Object.assign(Object.assign({},H),{default_value:x}),this.prototype._props=S}}toString(){return`${this.type}(${this.id})`}property(g){const L=this.properties[g];if(L!=null)return L;throw new Error(`unknown property ${this.type}.${g}`)}get attributes(){const g={};for(const L of this)g[L.attr]=L.get_value();return g}[Q.clone](g){const L=new Map;for(const A of this)A.dirty&&L.set(A.attr,g.clone(A.get_value()));return new this.constructor(L)}[c.equals](g,L){for(const A of this){const x=g.property(A.attr);if(!L.eq(A.get_value(),x.get_value()))return!1}return!0}[l.pretty](g){const L=g.token,A=[];for(const x of this)if(x.dirty){const H=x.get_value();A.push(`${x.attr}${L(":")} ${g.to_string(H)}`)}return`${this.constructor.__qualified__}${L("(")}${L("{")}${A.join(`${L(",")} `)}${L("}")}${L(")")}`}[s.serialize](g){const L=this.ref();g.add_ref(this,L);const A=this.struct();for(const x of this)x.syncable&&(g.include_defaults||x.dirty)&&(A.attributes[x.attr]=g.to_serializable(x.get_value()));return g.add_def(this,A),L}finalize(){for(const g of this){if(!(g instanceof d.VectorSpec||g instanceof d.ScalarSpec))continue;const L=g.get_value();if(L!=null){const{transform:A,expr:x}=L;A!=null&&this.connect(A.change,()=>this.transformchange.emit()),x!=null&&this.connect(x.change,()=>this.exprchange.emit())}}this.initialize()}initialize(){}connect_signals(){}disconnect_signals(){w.Signal.disconnectReceiver(this)}destroy(){this.disconnect_signals(),this.destroyed.emit()}clone(){return new Q.Cloner().clone(this)}changed_for(g){const L=this._watchers.get(g);return this._watchers.set(g,!1),L==null||L}_setv(g,L){const A=L.check_eq,x=[],H=this._changing;this._changing=!0;for(const[S,M]of g)A!==!1&&(0,e.is_equal)(S.get_value(),M)||(S.set_value(M),x.push(S));x.length>0&&(this._watchers=new WeakMap,this._pending=!0);for(const S of x)S.change.emit();if(!H){if(!L.no_change)for(;this._pending;)this._pending=!1,this.change.emit();this._pending=!1,this._changing=!1}}setv(g,L={}){const A=(0,o.entries)(g);if(A.length==0)return;if(L.silent===!0){this._watchers=new WeakMap;for(const[M,C]of A)this.properties[M].set_value(C);return}const x=new Map,H=new Map;for(const[M,C]of A){const R=this.properties[M];x.set(R,C),H.set(R,R.get_value())}this._setv(x,L);const{document:S}=this;if(S!=null){const M=[];for(const[C,R]of H)M.push([C,R,C.get_value()]);for(const[,C,R]of M)if(this._needs_invalidate(C,R)){S._invalidate_all_models();break}this._push_changes(M,L)}}getv(g){return this.property(g).get_value()}ref(){return{id:this.id}}struct(){const g={type:this.type,id:this.id,attributes:{}};return this._subtype!=null&&(g.subtype=this._subtype),g}set_subtype(g){this._subtype=g}*[Symbol.iterator](){yield*(0,o.values)(this.properties)}*syncable_properties(){for(const g of this)g.syncable&&(yield g)}serializable_attributes(){const g={};for(const L of this.syncable_properties())g[L.attr]=L.get_value();return g}static _json_record_references(g,L,A,x){const{recursive:H}=x;if((0,f.is_ref)(L)){const S=g.get_model_by_id(L.id);S==null||A.has(S)||p._value_record_references(S,A,{recursive:H})}else if((0,r.isArray)(L))for(const S of L)p._json_record_references(g,S,A,{recursive:H});else if((0,r.isPlainObject)(L))for(const S of(0,o.values)(L))p._json_record_references(g,S,A,{recursive:H})}static _value_record_references(g,L,A){const{recursive:x}=A;if(g instanceof p){if(!L.has(g)&&(L.add(g),x))for(const H of g.syncable_properties()){const S=H.get_value();p._value_record_references(S,L,{recursive:x})}}else if((0,r.isArray)(g))for(const H of g)p._value_record_references(H,L,{recursive:x});else if((0,r.isPlainObject)(g))for(const H of(0,o.values)(g))p._value_record_references(H,L,{recursive:x})}references(){const g=new Set;return p._value_record_references(this,g,{recursive:!0}),g}_doc_attached(){}_doc_detached(){}attach_document(g){if(this.document!=null&&this.document!=g)throw new Error("models must be owned by only a single document");this.document=g,this._doc_attached()}detach_document(){this._doc_detached(),this.document=null}_needs_invalidate(g,L){const A=new Set;p._value_record_references(L,A,{recursive:!1});const x=new Set;p._value_record_references(g,x,{recursive:!1});for(const H of A)if(!x.has(H))return!0;for(const H of x)if(!A.has(H))return!0;return!1}_push_changes(g,L={}){if(!this.is_syncable)return;const{document:A}=this;if(A==null)return;const{setter_id:x}=L,H=[];for(const[S,M,C]of g)S.syncable&&H.push(new a.ModelChangedEvent(A,this,S.attr,M,C,x));if(H.length!=0){let S;H.length==1?[S]=H:S=new a.DocumentEventBatch(A,H,x),A._trigger_on_change(S)}}on_change(g,L){for(const A of(0,r.isArray)(g)?g:[g])this.connect(A.change,L)}}t.HasProps=p,(b=p).prototype._props={},b.prototype._mixins=[]},function(T,V,t,k,E){k();const v=T(16),b=T(9);class w{constructor(s,a){this.sender=s,this.name=a}connect(s,a=null){d.has(this.sender)||d.set(this.sender,[]);const c=d.get(this.sender);if(i(c,this,s,a)!=null)return!1;const l=a??s;u.has(l)||u.set(l,[]);const Q=u.get(l),m={signal:this,slot:s,context:a};return c.push(m),Q.push(m),!0}disconnect(s,a=null){const c=d.get(this.sender);if(c==null||c.length===0)return!1;const l=i(c,this,s,a);if(l==null)return!1;const Q=a??s,m=u.get(Q);return l.signal=null,r(c),r(m),!0}emit(s){var a;const c=(a=d.get(this.sender))!==null&&a!==void 0?a:[];for(const{signal:l,slot:Q,context:m}of c)l===this&&Q.call(m,s,this.sender)}}t.Signal=w,w.__name__="Signal";class f extends w{emit(){super.emit(void 0)}}t.Signal0=f,f.__name__="Signal0",(function(e){function s(Q,m){const p=d.get(Q);if(p==null||p.length===0)return;const y=u.get(m);if(y!=null&&y.length!==0){for(const g of y){if(g.signal==null)return;g.signal.sender===Q&&(g.signal=null)}r(p),r(y)}}function a(Q){var m;const p=d.get(Q);if(p!=null&&p.length!==0){for(const y of p){if(y.signal==null)return;const g=(m=y.context)!==null&&m!==void 0?m:y.slot;y.signal=null,r(u.get(g))}r(p)}}function c(Q,m,p){const y=u.get(Q);if(y!=null&&y.length!==0){for(const g of y){if(g.signal==null)return;if(m!=null&&g.slot!=m)continue;const L=g.signal.sender;p!=null&&p.has(L)||(g.signal=null,r(d.get(L)))}r(y)}}function l(Q){const m=d.get(Q);if(m!=null&&m.length!==0){for(const y of m)y.signal=null;r(m)}const p=u.get(Q);if(p!=null&&p.length!==0){for(const y of p)y.signal=null;r(p)}}e.disconnect_between=s,e.disconnect_sender=a,e.disconnect_receiver=c,e.disconnect_all=l,e.disconnectBetween=s,e.disconnectSender=a,e.disconnectReceiver=c,e.disconnectAll=l})(w||(t.Signal=w={})),t.Signalable=function(){return class{connect(e,s){return e.connect(s,this)}disconnect(e,s){return e.disconnect(s,this)}}};const d=new WeakMap,u=new WeakMap;function i(e,s,a,c){return(0,b.find)(e,l=>l.signal===s&&l.slot===a&&l.context===c)}const o=new Set;function r(e){o.size===0&&(async()=>(await(0,v.defer)(),(function(){for(const s of o)(0,b.remove_by)(s,a=>a.signal==null);o.clear()})()))(),o.add(e)}},function(T,V,t,k,E){k();const v=new MessageChannel,b=new Map;v.port1.onmessage=f=>{const d=f.data,u=b.get(d);if(u!=null)try{u()}finally{b.delete(d)}};let w=1;t.defer=function(){return new Promise(f=>{const d=w++;b.set(d,f),v.port2.postMessage(d)})},t.wait=function(f){return new Promise(d=>setTimeout(d,f))}},function(T,V,t,k,E){k();const v=T(8),b=T(13);t.is_ref=function(w){if((0,v.isPlainObject)(w)){const f=(0,b.keys)(w);return f.length==1&&f[0]=="id"}return!1}},function(T,V,t,k,E){k(),t.YCoordinateSeqSeqSeqSpec=t.XCoordinateSeqSeqSeqSpec=t.YCoordinateSeqSpec=t.XCoordinateSeqSpec=t.YCoordinateSpec=t.XCoordinateSpec=t.CoordinateSeqSeqSeqSpec=t.CoordinateSeqSpec=t.CoordinateSpec=t.BaseCoordinateSpec=t.NumberUnitsSpec=t.UnitsSpec=t.DataSpec=t.VectorSpec=t.TextBaselineScalar=t.TextAlignScalar=t.FontStyleScalar=t.FontSizeScalar=t.FontScalar=t.LineDashScalar=t.LineCapScalar=t.LineJoinScalar=t.ArrayScalar=t.NullStringScalar=t.StringScalar=t.NumberScalar=t.ColorScalar=t.AnyScalar=t.ScalarSpec=t.VerticalAlign=t.UpdateMode=t.TooltipAttachment=t.TickLabelOrientation=t.TextureRepetition=t.TextBaseline=t.TextAlign=t.TapBehavior=t.StepMode=t.StartEnd=t.SpatialUnits=t.Sort=t.SizingMode=t.Side=t.RoundingFunction=t.ResetPolicy=t.RenderMode=t.RenderLevel=t.RadiusDimension=t.PointPolicy=t.Place=void 0,t.TextBaselineSpec=t.TextAlignSpec=t.FontStyleSpec=t.FontSizeSpec=t.FontSpec=t.LineDashSpec=t.LineCapSpec=t.LineJoinSpec=t.MarkerSpec=t.ArraySpec=t.NullStringSpec=t.StringSpec=t.AnySpec=t.NDArraySpec=t.ColorSpec=t.ScreenSizeSpec=t.NumberSpec=t.IntSpec=t.BooleanSpec=t.NullDistanceSpec=t.DistanceSpec=t.AngleSpec=void 0;const v=T(1),b=T(15),w=T(19),f=(0,v.__importStar)(T(20)),d=T(24),u=T(9),i=T(12),o=T(10),r=T(22),e=T(27),s=T(8),a=T(28),c=T(29),l=T(33);function Q(K){try{return JSON.stringify(K)}catch{return K.toString()}}function m(K){return(0,s.isPlainObject)(K)&&(K.value===void 0?0:1)+(K.field===void 0?0:1)+(K.expr===void 0?0:1)==1}E("Uniform",l.Uniform),E("UniformScalar",l.UniformScalar),E("UniformVector",l.UniformVector),t.isSpec=m;class p{constructor(Y,pt,J,st,ht,At={}){var Nt;let X;if(this.obj=Y,this.attr=pt,this.kind=J,this.default_value=st,this._dirty=!1,this.change=new b.Signal0(this.obj,"change"),this.internal=(Nt=At.internal)!==null&&Nt!==void 0&&Nt,this.convert=At.convert,this.on_update=At.on_update,ht!==void 0)X=ht,this._dirty=!0;else{const ct=this._default_override();if(ct!==void 0)X=ct;else{if(st===void 0)return void(this.spec={value:null});X=st(Y)}}this._update(X)}get is_value(){return this.spec.value!==void 0}get syncable(){return!this.internal}get_value(){return this.spec.value}set_value(Y){this._update(Y),this._dirty=!0}_default_override(){}get dirty(){return this._dirty}_update(Y){var pt;if(this.validate(Y),this.convert!=null){const J=this.convert(Y);J!==void 0&&(Y=J)}this.spec={value:Y},(pt=this.on_update)===null||pt===void 0||pt.call(this,Y,this.obj)}toString(){return`Prop(${this.obj}.${this.attr}, spec: ${Q(this.spec)})`}normalize(Y){return Y}validate(Y){if(!this.valid(Y))throw new Error(`${this.obj}.${this.attr} given invalid value: ${Q(Y)}`)}valid(Y){return this.kind.valid(Y)}_value(Y=!0){if(!this.is_value)throw new Error("attempted to retrieve property value for property without value specification");let pt=this.normalize([this.spec.value])[0];return this.spec.transform!=null&&Y&&(pt=this.spec.transform.compute(pt)),pt}}t.Property=p,p.__name__="Property";class y{constructor(Y){this.attr=Y}}t.PropertyAlias=y,y.__name__="PropertyAlias",t.Alias=function(K){return new y(K)};class g extends p{}t.PrimitiveProperty=g,g.__name__="PrimitiveProperty";class L extends p{}t.Any=L,L.__name__="Any";class A extends p{valid(Y){return(0,s.isArray)(Y)||(0,s.isTypedArray)(Y)}}t.Array=A,A.__name__="Array";class x extends p{valid(Y){return(0,s.isBoolean)(Y)}}t.Boolean=x,x.__name__="Boolean";class H extends p{valid(Y){return(0,r.is_Color)(Y)}}t.Color=H,H.__name__="Color";class S extends p{}t.Instance=S,S.__name__="Instance";class M extends p{valid(Y){return(0,s.isNumber)(Y)}}t.Number=M,M.__name__="Number";class C extends M{valid(Y){return(0,s.isNumber)(Y)&&(0|Y)==Y}}t.Int=C,C.__name__="Int";class R extends M{}t.Angle=R,R.__name__="Angle";class D extends M{valid(Y){return(0,s.isNumber)(Y)&&0<=Y&&Y<=1}}t.Percent=D,D.__name__="Percent";class B extends p{valid(Y){return(0,s.isString)(Y)}}t.String=B,B.__name__="String";class z extends p{valid(Y){return Y===null||(0,s.isString)(Y)}}t.NullString=z,z.__name__="NullString";class N extends B{}t.FontSize=N,N.__name__="FontSize";class I extends B{_default_override(){return a.settings.dev?"Bokeh":void 0}}t.Font=I,I.__name__="Font";class O extends p{valid(Y){return(0,s.isString)(Y)&&(0,u.includes)(this.enum_values,Y)}}function G(K){return class extends O{get enum_values(){return[...K]}}}t.EnumProperty=O,O.__name__="EnumProperty",t.Enum=G;class q extends O{get enum_values(){return[...f.Direction]}normalize(Y){const pt=new Uint8Array(Y.length);for(let J=0;J<Y.length;J++)switch(Y[J]){case"clock":pt[J]=0;break;case"anticlock":pt[J]=1}return pt}}t.Direction=q,q.__name__="Direction",t.Anchor=G(f.Anchor),t.AngleUnits=G(f.AngleUnits),t.BoxOrigin=G(f.BoxOrigin),t.ButtonType=G(f.ButtonType),t.CalendarPosition=G(f.CalendarPosition),t.Dimension=G(f.Dimension),t.Dimensions=G(f.Dimensions),t.Distribution=G(f.Distribution),t.FontStyle=G(f.FontStyle),t.HatchPatternType=G(f.HatchPatternType),t.HTTPMethod=G(f.HTTPMethod),t.HexTileOrientation=G(f.HexTileOrientation),t.HoverMode=G(f.HoverMode),t.LatLon=G(f.LatLon),t.LegendClickPolicy=G(f.LegendClickPolicy),t.LegendLocation=G(f.LegendLocation),t.LineCap=G(f.LineCap),t.LineJoin=G(f.LineJoin),t.LinePolicy=G(f.LinePolicy),t.Location=G(f.Location),t.Logo=G(f.Logo),t.MarkerType=G(f.MarkerType),t.MutedPolicy=G(f.MutedPolicy),t.Orientation=G(f.Orientation),t.OutputBackend=G(f.OutputBackend),t.PaddingUnits=G(f.PaddingUnits),t.Place=G(f.Place),t.PointPolicy=G(f.PointPolicy),t.RadiusDimension=G(f.RadiusDimension),t.RenderLevel=G(f.RenderLevel),t.RenderMode=G(f.RenderMode),t.ResetPolicy=G(f.ResetPolicy),t.RoundingFunction=G(f.RoundingFunction),t.Side=G(f.Side),t.SizingMode=G(f.SizingMode),t.Sort=G(f.Sort),t.SpatialUnits=G(f.SpatialUnits),t.StartEnd=G(f.StartEnd),t.StepMode=G(f.StepMode),t.TapBehavior=G(f.TapBehavior),t.TextAlign=G(f.TextAlign),t.TextBaseline=G(f.TextBaseline),t.TextureRepetition=G(f.TextureRepetition),t.TickLabelOrientation=G(f.TickLabelOrientation),t.TooltipAttachment=G(f.TooltipAttachment),t.UpdateMode=G(f.UpdateMode),t.VerticalAlign=G(f.VerticalAlign);class Z extends p{get_value(){const{value:Y,expr:pt,transform:J}=this.spec;return pt!=null||J!=null?this.spec:Y}_update(Y){m(Y)?this.spec=Y:this.spec={value:Y},this.spec.value!=null&&this.validate(this.spec.value)}materialize(Y){return Y}scalar(Y,pt){return new l.UniformScalar(Y,pt)}uniform(Y){var pt;const{expr:J,value:st,transform:ht}=this.spec,At=(pt=Y.get_length())!==null&&pt!==void 0?pt:1;if(J!=null){let Nt=J.compute(Y);return ht!=null&&(Nt=ht.compute(Nt)),Nt=this.materialize(Nt),this.scalar(Nt,At)}{let Nt=st;return ht!=null&&(Nt=ht.compute(Nt)),Nt=this.materialize(Nt),this.scalar(Nt,At)}}}t.ScalarSpec=Z,Z.__name__="ScalarSpec";class U extends Z{}t.AnyScalar=U,U.__name__="AnyScalar";class ot extends Z{}t.ColorScalar=ot,ot.__name__="ColorScalar";class ft extends Z{}t.NumberScalar=ft,ft.__name__="NumberScalar";class Ct extends Z{}t.StringScalar=Ct,Ct.__name__="StringScalar";class ne extends Z{}t.NullStringScalar=ne,ne.__name__="NullStringScalar";class jt extends Z{}t.ArrayScalar=jt,jt.__name__="ArrayScalar";class ye extends Z{}t.LineJoinScalar=ye,ye.__name__="LineJoinScalar";class me extends Z{}t.LineCapScalar=me,me.__name__="LineCapScalar";class Je extends Z{}t.LineDashScalar=Je,Je.__name__="LineDashScalar";class Ye extends Z{_default_override(){return a.settings.dev?"Bokeh":void 0}}t.FontScalar=Ye,Ye.__name__="FontScalar";class Oe extends Z{}t.FontSizeScalar=Oe,Oe.__name__="FontSizeScalar";class Ke extends Z{}t.FontStyleScalar=Ke,Ke.__name__="FontStyleScalar";class we extends Z{}t.TextAlignScalar=we,we.__name__="TextAlignScalar";class Se extends Z{}t.TextBaselineScalar=Se,Se.__name__="TextBaselineScalar";class Le extends p{get_value(){return this.spec.value===null?null:this.spec}_update(Y){m(Y)?this.spec=Y:this.spec={value:Y},this.spec.value!=null&&this.validate(this.spec.value)}materialize(Y){return Y}v_materialize(Y){return Y}scalar(Y,pt){return new l.UniformScalar(Y,pt)}vector(Y){return new l.UniformVector(Y)}uniform(Y){var pt;const{field:J,expr:st,value:ht,transform:At}=this.spec,Nt=(pt=Y.get_length())!==null&&pt!==void 0?pt:1;if(J!=null){let X=Y.get_column(J);return X!=null?(At!=null&&(X=At.v_compute(X)),X=this.v_materialize(X),this.vector(X)):(w.logger.warn(`attempted to retrieve property array for nonexistent field '${J}'`),this.scalar(null,Nt))}if(st!=null){let X=st.v_compute(Y);return At!=null&&(X=At.v_compute(X)),X=this.v_materialize(X),this.vector(X)}{let X=ht;return At!=null&&(X=At.compute(X)),X=this.materialize(X),this.scalar(X,Nt)}}array(Y){var pt;let J;const st=(pt=Y.get_length())!==null&&pt!==void 0?pt:1;if(this.spec.field!=null){const ht=Y.get_column(this.spec.field);if(ht!=null)J=this.normalize(ht);else{w.logger.warn(`attempted to retrieve property array for nonexistent field '${this.spec.field}'`);const At=new Float64Array(st);At.fill(NaN),J=At}}else if(this.spec.expr!=null)J=this.normalize(this.spec.expr.v_compute(Y));else{const ht=this._value(!1);if((0,s.isNumber)(ht)){const At=new Float64Array(st);At.fill(ht),J=At}else J=(0,u.repeat)(ht,st)}return this.spec.transform!=null&&(J=this.spec.transform.v_compute(J)),J}}t.VectorSpec=Le,Le.__name__="VectorSpec";class de extends Le{}t.DataSpec=de,de.__name__="DataSpec";class Be extends Le{_update(Y){super._update(Y);const{units:pt}=this.spec;if(pt!=null&&!(0,u.includes)(this.valid_units,pt))throw new Error(`units must be one of ${this.valid_units.join(", ")}; got: ${pt}`)}get units(){var Y;return(Y=this.spec.units)!==null&&Y!==void 0?Y:this.default_units}set units(Y){Y!=this.default_units?this.spec.units=Y:delete this.spec.units}}t.UnitsSpec=Be,Be.__name__="UnitsSpec";class ze extends Be{array(Y){return new Float64Array(super.array(Y))}}t.NumberUnitsSpec=ze,ze.__name__="NumberUnitsSpec";class t1 extends de{}t.BaseCoordinateSpec=t1,t1.__name__="BaseCoordinateSpec";class Pe extends t1{}t.CoordinateSpec=Pe,Pe.__name__="CoordinateSpec";class Lt extends t1{}t.CoordinateSeqSpec=Lt,Lt.__name__="CoordinateSeqSpec";class it extends t1{}t.CoordinateSeqSeqSeqSpec=it,it.__name__="CoordinateSeqSeqSeqSpec";class le extends Pe{constructor(){super(...arguments),this.dimension="x"}}t.XCoordinateSpec=le,le.__name__="XCoordinateSpec";class Me extends Pe{constructor(){super(...arguments),this.dimension="y"}}t.YCoordinateSpec=Me,Me.__name__="YCoordinateSpec";class _e extends Lt{constructor(){super(...arguments),this.dimension="x"}}t.XCoordinateSeqSpec=_e,_e.__name__="XCoordinateSeqSpec";class Ae extends Lt{constructor(){super(...arguments),this.dimension="y"}}t.YCoordinateSeqSpec=Ae,Ae.__name__="YCoordinateSeqSpec";class d1 extends it{constructor(){super(...arguments),this.dimension="x"}}t.XCoordinateSeqSeqSeqSpec=d1,d1.__name__="XCoordinateSeqSeqSeqSpec";class c1 extends it{constructor(){super(...arguments),this.dimension="y"}}t.YCoordinateSeqSeqSeqSpec=c1,c1.__name__="YCoordinateSeqSeqSeqSpec";class v1 extends ze{get default_units(){return"rad"}get valid_units(){return[...f.AngleUnits]}materialize(Y){return Y*-(0,o.to_radians_coeff)(this.units)}v_materialize(Y){const pt=-(0,o.to_radians_coeff)(this.units),J=new Float32Array(Y.length);return(0,i.mul)(Y,pt,J),J}array(Y){throw new Error("not supported")}}t.AngleSpec=v1,v1.__name__="AngleSpec";class m1 extends ze{get default_units(){return"data"}get valid_units(){return[...f.SpatialUnits]}}t.DistanceSpec=m1,m1.__name__="DistanceSpec";class Ft extends m1{materialize(Y){return Y??NaN}}t.NullDistanceSpec=Ft,Ft.__name__="NullDistanceSpec";class qt extends de{v_materialize(Y){return new Uint8Array(Y)}array(Y){return new Uint8Array(super.array(Y))}}t.BooleanSpec=qt,qt.__name__="BooleanSpec";class Kt extends de{v_materialize(Y){return(0,s.isTypedArray)(Y)?Y:new Int32Array(Y)}array(Y){return new Int32Array(super.array(Y))}}t.IntSpec=Kt,Kt.__name__="IntSpec";class re extends de{v_materialize(Y){return(0,s.isTypedArray)(Y)?Y:new Float64Array(Y)}array(Y){return new Float64Array(super.array(Y))}}t.NumberSpec=re,re.__name__="NumberSpec";class $e extends re{valid(Y){return(0,s.isNumber)(Y)&&Y>=0}}t.ScreenSizeSpec=$e,$e.__name__="ScreenSizeSpec";class Ie extends de{materialize(Y){return(0,r.encode_rgba)((0,r.color2rgba)(Y))}v_materialize(Y){if(!(0,c.is_NDArray)(Y)){const pt=Y.length,J=new d.RGBAArray(4*pt);let st=0;for(const ht of Y){const[At,Nt,X,ct]=(0,r.color2rgba)(ht);J[st++]=At,J[st++]=Nt,J[st++]=X,J[st++]=ct}return new d.ColorArray(J.buffer)}if(Y.dtype=="uint32"&&Y.dimension==1)return(0,e.to_big_endian)(Y);if(Y.dtype=="uint8"&&Y.dimension==1){const[pt]=Y.shape,J=new d.RGBAArray(4*pt);let st=0;for(const ht of Y)J[st++]=ht,J[st++]=ht,J[st++]=ht,J[st++]=255;return new d.ColorArray(J.buffer)}if(Y.dtype=="uint8"&&Y.dimension==2){const[pt,J]=Y.shape;if(J==4)return new d.ColorArray(Y.buffer);if(J==3){const st=new d.RGBAArray(4*pt);for(let ht=0,At=0;ht<J*pt;)st[At++]=Y[ht++],st[At++]=Y[ht++],st[At++]=Y[ht++],st[At++]=255;return new d.ColorArray(st.buffer)}}else if((Y.dtype=="float32"||Y.dtype=="float64")&&Y.dimension==2){const[pt,J]=Y.shape;if(J==3||J==4){const st=new d.RGBAArray(4*pt);for(let ht=0,At=0;ht<J*pt;)st[At++]=255*Y[ht++],st[At++]=255*Y[ht++],st[At++]=255*Y[ht++],st[At++]=255*(J==3?1:Y[ht++]);return new d.ColorArray(st.buffer)}}throw new Error("invalid color array")}vector(Y){return new l.ColorUniformVector(Y)}}t.ColorSpec=Ie,Ie.__name__="ColorSpec";class o1 extends de{}t.NDArraySpec=o1,o1.__name__="NDArraySpec";class b1 extends de{}t.AnySpec=b1,b1.__name__="AnySpec";class L1 extends de{}t.StringSpec=L1,L1.__name__="StringSpec";class V1 extends de{}t.NullStringSpec=V1,V1.__name__="NullStringSpec";class R1 extends de{}t.ArraySpec=R1,R1.__name__="ArraySpec";class H1 extends de{}t.MarkerSpec=H1,H1.__name__="MarkerSpec";class l2 extends de{}t.LineJoinSpec=l2,l2.__name__="LineJoinSpec";class $1 extends de{}t.LineCapSpec=$1,$1.__name__="LineCapSpec";class s2 extends de{}t.LineDashSpec=s2,s2.__name__="LineDashSpec";class E2 extends de{_default_override(){return a.settings.dev?"Bokeh":void 0}}t.FontSpec=E2,E2.__name__="FontSpec";class b2 extends de{}t.FontSizeSpec=b2,b2.__name__="FontSizeSpec";class C2 extends de{}t.FontStyleSpec=C2,C2.__name__="FontStyleSpec";class rt extends de{}t.TextAlignSpec=rt,rt.__name__="TextAlignSpec";class tt extends de{}t.TextBaselineSpec=tt,tt.__name__="TextBaselineSpec"},function(T,V,t,k,E){k();const v=T(8),b=T(13),w={};class f{constructor(r,e){this.name=r,this.level=e}}t.LogLevel=f,f.__name__="LogLevel";class d{constructor(r,e=d.INFO){this._name=r,this.set_level(e)}static get levels(){return Object.keys(d.log_levels)}static get(r,e=d.INFO){if(r.length>0){let s=w[r];return s==null&&(w[r]=s=new d(r,e)),s}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")}get level(){return this.get_level()}get_level(){return this._log_level}set_level(r){if(r instanceof f)this._log_level=r;else{if(!(0,v.isString)(r)||d.log_levels[r]==null)throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=d.log_levels[r]}const e=`[${this._name}]`;for(const[s,a]of(0,b.entries)(d.log_levels))a.level<this._log_level.level||this._log_level.level===d.OFF.level?this[s]=function(){}:this[s]=u(s,e)}trace(...r){}debug(...r){}info(...r){}warn(...r){}error(...r){}}function u(o,r){return console[o]!=null?console[o].bind(console,r):console.log!=null?console.log.bind(console,r):function(){}}function i(o){const r=t.logger.level;return(0,v.isString)(o)&&d.log_levels[o]==null?(console.log(`[bokeh] unrecognized logging level '${o}' passed to Bokeh.set_log_level(), ignoring`),console.log(`[bokeh] valid log levels are: ${d.levels.join(", ")}`)):(console.log(`[bokeh] setting log level to: '${(0,v.isString)(o)?o:o.level}'`),t.logger.set_level(o)),r}t.Logger=d,d.__name__="Logger",d.TRACE=new f("trace",0),d.DEBUG=new f("debug",1),d.INFO=new f("info",2),d.WARN=new f("warn",6),d.ERROR=new f("error",7),d.FATAL=new f("fatal",8),d.OFF=new f("off",9),d.log_levels={trace:d.TRACE,debug:d.DEBUG,info:d.INFO,warn:d.WARN,error:d.ERROR,fatal:d.FATAL,off:d.OFF},t.logger=d.get("bokeh"),t.set_log_level=i,t.with_log_level=function(o,r){const e=i(o);try{r()}finally{i(e)}}},function(T,V,t,k,E){k(),t.VerticalAlign=void 0;const v=T(21);t.Align=(0,v.Enum)("start","center","end"),t.Anchor=(0,v.Enum)("top_left","top_center","top_right","center_left","center_center","center_right","bottom_left","bottom_center","bottom_right","top","left","center","right","bottom"),t.AngleUnits=(0,v.Enum)("deg","rad","grad","turn"),t.BoxOrigin=(0,v.Enum)("corner","center"),t.ButtonType=(0,v.Enum)("default","primary","success","warning","danger","light"),t.CalendarPosition=(0,v.Enum)("auto","above","below"),t.Dimension=(0,v.Enum)("width","height"),t.Dimensions=(0,v.Enum)("width","height","both"),t.Direction=(0,v.Enum)("clock","anticlock"),t.Distribution=(0,v.Enum)("uniform","normal"),t.FontStyle=(0,v.Enum)("normal","italic","bold","bold italic"),t.HatchPatternType=(0,v.Enum)("blank","dot","ring","horizontal_line","vertical_line","cross","horizontal_dash","vertical_dash","spiral","right_diagonal_line","left_diagonal_line","diagonal_cross","right_diagonal_dash","left_diagonal_dash","horizontal_wave","vertical_wave","criss_cross"," ",".","o","-","|","+",'"',":","@","/","\\","x",",","`","v",">","*"),t.HTTPMethod=(0,v.Enum)("POST","GET"),t.HexTileOrientation=(0,v.Enum)("pointytop","flattop"),t.HoverMode=(0,v.Enum)("mouse","hline","vline"),t.LatLon=(0,v.Enum)("lat","lon"),t.LegendClickPolicy=(0,v.Enum)("none","hide","mute"),t.LegendLocation=t.Anchor,t.LineCap=(0,v.Enum)("butt","round","square"),t.LineJoin=(0,v.Enum)("miter","round","bevel"),t.LineDash=(0,v.Enum)("solid","dashed","dotted","dotdash","dashdot"),t.LinePolicy=(0,v.Enum)("prev","next","nearest","interp","none"),t.Location=(0,v.Enum)("above","below","left","right"),t.Logo=(0,v.Enum)("normal","grey"),t.MarkerType=(0,v.Enum)("asterisk","circle","circle_cross","circle_dot","circle_x","circle_y","cross","dash","diamond","diamond_cross","diamond_dot","dot","hex","hex_dot","inverted_triangle","plus","square","square_cross","square_dot","square_pin","square_x","star","star_dot","triangle","triangle_dot","triangle_pin","x","y"),t.MutedPolicy=(0,v.Enum)("show","ignore"),t.Orientation=(0,v.Enum)("vertical","horizontal"),t.OutputBackend=(0,v.Enum)("canvas","svg","webgl"),t.PaddingUnits=(0,v.Enum)("percent","absolute"),t.Place=(0,v.Enum)("above","below","left","right","center"),t.PointPolicy=(0,v.Enum)("snap_to_data","follow_mouse","none"),t.RadiusDimension=(0,v.Enum)("x","y","max","min"),t.RenderLevel=(0,v.Enum)("image","underlay","glyph","guide","annotation","overlay"),t.RenderMode=(0,v.Enum)("canvas","css"),t.ResetPolicy=(0,v.Enum)("standard","event_only"),t.RoundingFunction=(0,v.Enum)("round","nearest","floor","rounddown","ceil","roundup"),t.SelectionMode=(0,v.Enum)("replace","append","intersect","subtract"),t.Side=(0,v.Enum)("above","below","left","right"),t.SizingMode=(0,v.Enum)("stretch_width","stretch_height","stretch_both","scale_width","scale_height","scale_both","fixed"),t.Sort=(0,v.Enum)("ascending","descending"),t.SpatialUnits=(0,v.Enum)("screen","data"),t.StartEnd=(0,v.Enum)("start","end"),t.StepMode=(0,v.Enum)("after","before","center"),t.TapBehavior=(0,v.Enum)("select","inspect"),t.TextAlign=(0,v.Enum)("left","right","center"),t.TextBaseline=(0,v.Enum)("top","middle","bottom","alphabetic","hanging","ideographic"),t.TextureRepetition=(0,v.Enum)("repeat","repeat_x","repeat_y","no_repeat"),t.TickLabelOrientation=(0,v.Enum)("vertical","horizontal","parallel","normal"),t.TooltipAttachment=(0,v.Enum)("horizontal","vertical","left","right","above","below"),t.UpdateMode=(0,v.Enum)("replace","append"),t.VerticalAlign=(0,v.Enum)("top","middle","bottom")},function(T,V,t,k,E){k();const v=(0,T(1).__importStar)(T(8)),b=T(22),w=T(13),f=window.Map,{hasOwnProperty:d}=Object.prototype;class u{}t.Kind=u,u.__name__="Kind",(function(i){class o extends u{valid(N){return!0}}o.__name__="Any",i.Any=o;class r extends u{valid(N){return!0}}r.__name__="Unknown",i.Unknown=r;class e extends u{valid(N){return v.isBoolean(N)}}e.__name__="Boolean",i.Boolean=e;class s extends u{constructor(N){super(),this.obj_type=N}valid(N){return!0}}s.__name__="Ref",i.Ref=s;class a extends u{valid(N){return!0}}a.__name__="AnyRef",i.AnyRef=a;class c extends u{valid(N){return v.isNumber(N)}}c.__name__="Number",i.Number=c;class l extends c{valid(N){return super.valid(N)&&v.isInteger(N)}}l.__name__="Int",i.Int=l;class Q extends c{valid(N){return super.valid(N)&&0<=N&&N<=1}}Q.__name__="Percent",i.Percent=Q;class m extends u{constructor(N){super(),this.types=N,this.types=N}valid(N){return this.types.some(I=>I.valid(N))}}m.__name__="Or",i.Or=m;class p extends u{constructor(N){super(),this.types=N,this.types=N}valid(N){if(!v.isArray(N))return!1;for(let I=0;I<this.types.length;I++){const O=this.types[I],G=N[I];if(!O.valid(G))return!1}return!0}}p.__name__="Tuple",i.Tuple=p;class y extends u{constructor(N){super(),this.struct_type=N}valid(N){if(!v.isPlainObject(N))return!1;const{struct_type:I}=this;if((0,w.size)(I)!=(0,w.size)(N))return!1;for(const O in I)if(d.call(I,O)){if(!d.call(N,O))return!1;const G=I[O],q=N[O];if(!G.valid(q))return!1}return!0}}y.__name__="Struct",i.Struct=y;class g extends u{valid(N){return v.isArray(N)||v.isTypedArray(N)}}g.__name__="Arrayable",i.Arrayable=g;class L extends u{constructor(N){super(),this.item_type=N}valid(N){return v.isArray(N)&&N.every(I=>this.item_type.valid(I))}}L.__name__="Array",i.Array=L;class A extends u{valid(N){return N===null}}A.__name__="Null",i.Null=A;class x extends u{constructor(N){super(),this.base_type=N}valid(N){return N===null||this.base_type.valid(N)}}x.__name__="Nullable",i.Nullable=x;class H extends u{constructor(N){super(),this.base_type=N}valid(N){return N===void 0||this.base_type.valid(N)}}H.__name__="Opt",i.Opt=H;class S extends u{valid(N){return v.isString(N)}}S.__name__="String",i.String=S;class M extends u{constructor(N){super(),this.values=new Set(N)}valid(N){return this.values.has(N)}*[Symbol.iterator](){yield*this.values}}M.__name__="Enum",i.Enum=M;class C extends u{constructor(N){super(),this.item_type=N}valid(N){if(!v.isPlainObject(N))return!1;for(const I in N)if(d.call(N,I)){const O=N[I];if(!this.item_type.valid(O))return!1}return!0}}C.__name__="Dict",i.Dict=C;class R extends u{constructor(N,I){super(),this.key_type=N,this.item_type=I}valid(N){if(!(N instanceof f))return!1;for(const[I,O]of N.entries())if(!this.key_type.valid(I)||!this.item_type.valid(O))return!1;return!0}}R.__name__="Map",i.Map=R;class D extends u{valid(N){return(0,b.is_Color)(N)}}D.__name__="Color",i.Color=D;class B extends u{valid(N){return v.isFunction(N)}}B.__name__="Function",i.Function=B})(t.Kinds||(t.Kinds={})),t.Any=new t.Kinds.Any,t.Unknown=new t.Kinds.Unknown,t.Boolean=new t.Kinds.Boolean,t.Number=new t.Kinds.Number,t.Int=new t.Kinds.Int,t.String=new t.Kinds.String,t.Null=new t.Kinds.Null,t.Nullable=i=>new t.Kinds.Nullable(i),t.Opt=i=>new t.Kinds.Opt(i),t.Or=(...i)=>new t.Kinds.Or(i),t.Tuple=(...i)=>new t.Kinds.Tuple(i),t.Struct=i=>new t.Kinds.Struct(i),t.Arrayable=new t.Kinds.Arrayable,t.Array=i=>new t.Kinds.Array(i),t.Dict=i=>new t.Kinds.Dict(i),t.Map=(i,o)=>new t.Kinds.Map(i,o),t.Enum=(...i)=>new t.Kinds.Enum(i),t.Ref=i=>new t.Kinds.Ref(i),t.AnyRef=()=>new t.Kinds.AnyRef,t.Function=()=>new t.Kinds.Function,t.Percent=new t.Kinds.Percent,t.Alpha=t.Percent,t.Color=new t.Kinds.Color,t.Auto=(0,t.Enum)("auto"),t.FontSize=t.String,t.Font=t.String,t.Angle=t.Number},function(T,V,t,k,E){k();const v=T(23),b=T(10),w=T(8),{round:f}=Math;function d(Q){return(0,b.clamp)(f(Q),0,255)}function u(){return[0,0,0,0]}function i(Q){return[Q>>24&255,Q>>16&255,Q>>8&255,255&Q]}function o(Q,m){var p;let y,g,L,A;return Q==null?[y,g,L,A]=[0,0,0,0]:(0,w.isInteger)(Q)?[y,g,L,A]=i(Q):(0,w.isString)(Q)?[y,g,L,A]=(p=l(Q))!==null&&p!==void 0?p:[0,0,0,0]:([y,g,L,A=1]=Q,A=d(255*A)),A==255&&m!=null&&(A=d(255*m)),[y,g,L,A]}t.transparent=u,t.encode_rgba=function([Q,m,p,y]){return Q<<24|m<<16|p<<8|y},t.decode_rgba=i,t.compose_alpha=function(Q,m){return(255&Q)==255?4294967040&Q|d(255*m):Q},t.color2rgba=o;const r={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"a",11:"b",12:"c",13:"d",14:"e",15:"f"};function e(Q){return r[Q>>4]+r[15&Q]}t.color2css=function(Q,m){const[p,y,g,L]=o(Q,m);return`rgba(${p}, ${y}, ${g}, ${L/255})`},t.color2hex=function(Q,m){const[p,y,g,L]=o(Q,m),A=`#${e(p)}${e(y)}${e(g)}`;return L==255?A:`${A}${e(L)}`},t.color2hexrgb=function(Q){const[m,p,y]=o(Q);return`#${e(m)}${e(p)}${e(y)}`};const s=/^rgba?\(\s*([^\s,]+?)\s+([^\s,]+?)\s+([^\s,]+?)(?:\s*\/\s*([^\s,]+?))?\s*\)$/,a=/^rgba?\(\s*([^\s,]+?)\s*,\s*([^\s,]+?)\s*,\s*([^\s,]+?)(?:\s*,\s*([^\s,]+?))?\s*\)$/,c=(()=>{const Q=document.createElement("canvas");Q.width=1,Q.height=1;const m=Q.getContext("2d"),p=m.createLinearGradient(0,0,1,1);return y=>{m.fillStyle=p,m.fillStyle=y;const g=m.fillStyle;return g!=p?g:null}})();function l(Q){var m;if(!(Q=Q.trim().toLowerCase()))return null;if(Q=="transparent")return[0,0,0,0];if((0,v.is_named_color)(Q))return i(v.named_colors[Q]);if(Q[0]=="#"){const p=+`0x${Q.substr(1)}`;if(isNaN(p))return null;switch(Q.length-1){case 3:{const y=p>>8&15,g=p>>4&15,L=p>>0&15;return[y<<4|y,g<<4|g,L<<4|L,255]}case 4:{const y=p>>12&15,g=p>>8&15,L=p>>4&15,A=p>>0&15;return[y<<4|y,g<<4|g,L<<4|L,A<<4|A]}case 6:return[p>>16&255,p>>8&255,p>>0&255,255];case 8:return[p>>24&255,p>>16&255,p>>8&255,p>>0&255]}}else if(Q.startsWith("rgb")){const p=(m=Q.match(s))!==null&&m!==void 0?m:Q.match(a);if(p!=null){let[,y,g,L,A="1"]=p;const x=y.endsWith("%"),H=g.endsWith("%"),S=L.endsWith("%"),M=A.endsWith("%");if(!(x&&H&&S)&&(x||H||S))return null;x&&(y=y.slice(0,-1)),H&&(g=g.slice(0,-1)),S&&(L=L.slice(0,-1)),M&&(A=A.slice(0,-1));let C=Number(y),R=Number(g),D=Number(L),B=Number(A);return isNaN(C+R+D+B)?null:(x&&(C=C/100*255),H&&(R=R/100*255),S&&(D=D/100*255),B=255*(M?B/100:B),C=d(C),R=d(R),D=d(D),B=d(B),[C,R,D,B])}}else{const p=c(Q);if(p!=null)return l(p)}return null}t.css4_parse=l,t.is_Color=function(Q){return!!(0,w.isInteger)(Q)||!(!(0,w.isString)(Q)||l(Q)==null)||!(!(0,w.isArray)(Q)||Q.length!=3&&Q.length!=4)},t.is_dark=function([Q,m,p]){return 1-(.299*Q+.587*m+.114*p)/255>=.6}},function(T,V,t,k,E){k(),t.named_colors={aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},t.is_named_color=function(v){return v in t.named_colors}},function(T,V,t,k,E){k(),t.GeneratorFunction=Object.getPrototypeOf(function*(){}).constructor,t.ColorArray=Uint32Array,t.RGBAArray=Uint8ClampedArray,t.infer_type=function(v,b){return v instanceof Float64Array||v instanceof Array||b instanceof Float64Array||b instanceof Array?Float64Array:Float32Array},t.ScreenArray=Float32Array,t.to_screen=function(v){return v instanceof Float32Array?v:Float32Array.from(v)},E("Indices",T(25).BitSet)},function(T,V,t,k,E){var v;k();const b=T(26),w=T(11);class f{constructor(u,i=0){this.size=u,this[v]="BitSet",this._count=null,this._nwords=Math.ceil(u/32),i==0||i==1?(this._array=new Uint32Array(this._nwords),i==1&&this._array.fill(4294967295)):((0,w.assert)(i.length==this._nwords,"Initializer size mismatch"),this._array=i)}clone(){return new f(this.size,new Uint32Array(this._array))}[(v=Symbol.toStringTag,b.equals)](u,i){if(!i.eq(this.size,u.size))return!1;const{_nwords:o}=this,r=this.size%o,e=r==0?o:o-1;for(let s=0;s<e;s++)if(this._array[s]!=u._array[s])return!1;if(r==0)return!0;{const s=1<<r-1,a=s-1^s;return(this._array[e]&a)==(u._array[e]&a)}}static all_set(u){return new f(u,1)}static all_unset(u){return new f(u,0)}static from_indices(u,i){const o=new f(u);for(const r of i)o.set(r);return o}static from_booleans(u,i){const o=new f(u),r=Math.min(u,i.length);for(let e=0;e<r;e++)i[e]&&o.set(e);return o}_check_bounds(u){(0,w.assert)(0<=u&&u<this.size,`Out of bounds: 0 <= ${u} < ${this.size}`)}get(u){this._check_bounds(u);const i=u>>>5,o=31&u;return!!(this._array[i]>>o&1)}set(u,i=!0){this._check_bounds(u),this._count=null;const o=u>>>5,r=31&u;i?this._array[o]|=1<<r:this._array[o]&=~(1<<r)}unset(u){this.set(u,!1)}*[Symbol.iterator](){yield*this.ones()}get count(){let u=this._count;return u==null&&(this._count=u=this._get_count()),u}_get_count(){const{_array:u,_nwords:i,size:o}=this;let r=0;for(let e=0,s=0;s<i;s++){const a=u[s];if(a==0)e+=32;else for(let c=0;c<32&&e<o;c++,e++)a>>>c&1&&(r+=1)}return r}*ones(){const{_array:u,_nwords:i,size:o}=this;for(let r=0,e=0;e<i;e++){const s=u[e];if(s!=0)for(let a=0;a<32&&r<o;a++,r++)s>>>a&1&&(yield r);else r+=32}}*zeros(){const{_array:u,_nwords:i,size:o}=this;for(let r=0,e=0;e<i;e++){const s=u[e];if(s!=4294967295)for(let a=0;a<32&&r<o;a++,r++)s>>>a&1||(yield r);else r+=32}}_check_size(u){(0,w.assert)(this.size==u.size,"Size mismatch")}add(u){this._check_size(u);for(let i=0;i<this._nwords;i++)this._array[i]|=u._array[i]}intersect(u){this._check_size(u);for(let i=0;i<this._nwords;i++)this._array[i]&=u._array[i]}subtract(u){this._check_size(u);for(let i=0;i<this._nwords;i++){const o=this._array[i],r=u._array[i];this._array[i]=(o^r)&o}}union(u){this._check_size(u);const i=this.clone();for(let o=0;o<this._nwords;o++)i._array[o]|=u._array[o];return i}intersection(u){this._check_size(u);const i=this.clone();for(let o=0;o<this._nwords;o++)i._array[o]&=u._array[o];return i}difference(u){this._check_size(u);const i=this.clone();for(let o=0;o<this._nwords;o++){const r=this._array[o],e=u._array[o];i._array[o]=(r^e)&r}return i}select(u){(0,w.assert)(this.size<=u.length,"Size mismatch");const i=this.count,o=new u.constructor(i);let r=0;for(const e of this)o[r++]=u[e];return o}}t.BitSet=f,f.__name__="BitSet"},function(T,V,t,k,E){k();const v=T(8),{hasOwnProperty:b}=Object.prototype;function w(r){return(0,v.isObject)(r)&&r[t.equals]!==void 0}t.equals=Symbol("equals"),t.wildcard=Symbol("wildcard");const f=Object.prototype.toString;class d{constructor(){this.a_stack=[],this.b_stack=[]}eq(e,s){if(Object.is(e,s)||e===t.wildcard||s===t.wildcard)return!0;if(e==null||s==null)return e===s;const a=f.call(e);if(a!=f.call(s))return!1;switch(a){case"[object Number]":return this.numbers(e,s);case"[object RegExp]":case"[object String]":return`${e}`==`${s}`;case"[object Date]":case"[object Boolean]":return+e==+s}const{a_stack:c,b_stack:l}=this;let Q=c.length;for(;Q--;)if(c[Q]===e)return l[Q]===s;c.push(e),l.push(s);const m=(()=>{if(w(e)&&w(s))return e[t.equals](s,this);switch(a){case"[object Array]":case"[object Uint8Array]":case"[object Int8Array]":case"[object Uint16Array]":case"[object Int16Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Float32Array]":case"[object Float64Array]":return this.arrays(e,s);case"[object Map]":return this.maps(e,s);case"[object Set]":return this.sets(e,s);case"[object Object]":if(e.constructor==s.constructor&&(e.constructor==null||e.constructor===Object))return this.objects(e,s);case"[object Function]":if(e.constructor==s.constructor&&e.constructor===Function)return this.eq(`${e}`,`${s}`)}if(e instanceof Node)return this.nodes(e,s);throw Error(`can't compare objects of type ${a}`)})();return c.pop(),l.pop(),m}numbers(e,s){return Object.is(e,s)}arrays(e,s){const{length:a}=e;if(a!=s.length)return!1;for(let c=0;c<a;c++)if(!this.eq(e[c],s[c]))return!1;return!0}iterables(e,s){const a=e[Symbol.iterator](),c=s[Symbol.iterator]();for(;;){const l=a.next(),Q=c.next();if(l.done&&Q.done)return!0;if(l.done||Q.done||!this.eq(l.value,Q.value))return!1}}maps(e,s){if(e.size!=s.size)return!1;for(const[a,c]of e)if(!s.has(a)||!this.eq(c,s.get(a)))return!1;return!0}sets(e,s){if(e.size!=s.size)return!1;for(const a of e)if(!s.has(a))return!1;return!0}objects(e,s){const a=Object.keys(e);if(a.length!=Object.keys(s).length)return!1;for(const c of a)if(!b.call(s,c)||!this.eq(e[c],s[c]))return!1;return!0}nodes(e,s){return e.nodeType==s.nodeType&&e.textContent==s.textContent&&!!this.iterables(e.childNodes,s.childNodes)}}t.Comparator=d,d.__name__="Comparator";const{abs:u}=Math;class i extends d{constructor(e=1e-4){super(),this.tolerance=e}numbers(e,s){return super.numbers(e,s)||u(e-s)<this.tolerance}}function o(r,e){return new d().eq(r,e)}t.SimilarComparator=i,i.__name__="SimilarComparator",t.is_equal=o,t.is_similar=function(r,e,s){return new i(s).eq(r,e)},t.isEqual=o},function(T,V,t,k,E){k(),t.is_windows=navigator.appVersion.includes("Windows"),t.is_ie=(()=>{const v=navigator.userAgent;return v.includes("MSIE")||v.includes("Trident")||v.includes("Edge")})(),t.is_mobile=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),t.is_little_endian=(()=>{const v=new ArrayBuffer(4),b=new Uint8Array(v);new Uint32Array(v)[1]=168496141;let w=!0;return b[4]==10&&b[5]==11&&b[6]==12&&b[7]==13&&(w=!1),w})(),t.BYTE_ORDER=t.is_little_endian?"little":"big",t.to_big_endian=function(v){if(t.is_little_endian){const b=new Uint32Array(v.length),w=new DataView(b.buffer);let f=0;for(const d of v)w.setUint32(f,d),f+=4;return b}return v}},function(T,V,t,k,E){k();class v{constructor(){this._dev=!1,this._wireframe=!1,this._force_webgl=!1}set dev(w){this._dev=w}get dev(){return this._dev}set wireframe(w){this._wireframe=w}get wireframe(){return this._wireframe}set force_webgl(w){this._force_webgl=w}get force_webgl(){return this._force_webgl}}t.Settings=v,v.__name__="Settings",t.settings=new v},function(T,V,t,k,E){var v,b,w,f,d,u,i,o;k();const r=T(8),e=T(11),s=T(26),a=T(30),c=T(31),l=Symbol("__ndarray__");class Q extends Uint8Array{constructor(M,C){super(M),this[v]=!0,this.dtype="uint8",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>Q.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>Q.prototype[a.serialize].call(this,R))}[(v=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Uint8NDArray=Q,Q.__name__="Uint8NDArray";class m extends Int8Array{constructor(M,C){super(M),this[b]=!0,this.dtype="int8",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>m.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>m.prototype[a.serialize].call(this,R))}[(b=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Int8NDArray=m,m.__name__="Int8NDArray";class p extends Uint16Array{constructor(M,C){super(M),this[w]=!0,this.dtype="uint16",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>p.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>p.prototype[a.serialize].call(this,R))}[(w=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Uint16NDArray=p,p.__name__="Uint16NDArray";class y extends Int16Array{constructor(M,C){super(M),this[f]=!0,this.dtype="int16",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>y.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>y.prototype[a.serialize].call(this,R))}[(f=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Int16NDArray=y,y.__name__="Int16NDArray";class g extends Uint32Array{constructor(M,C){super(M),this[d]=!0,this.dtype="uint32",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>g.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>g.prototype[a.serialize].call(this,R))}[(d=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Uint32NDArray=g,g.__name__="Uint32NDArray";class L extends Int32Array{constructor(M,C){super(M),this[u]=!0,this.dtype="int32",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>L.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>L.prototype[a.serialize].call(this,R))}[(u=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Int32NDArray=L,L.__name__="Int32NDArray";class A extends Float32Array{constructor(M,C){super(M),this[i]=!0,this.dtype="float32",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>A.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>A.prototype[a.serialize].call(this,R))}[(i=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}t.Float32NDArray=A,A.__name__="Float32NDArray";class x extends Float64Array{constructor(M,C){super(M),this[o]=!0,this.dtype="float64",this.shape=C??(H(M)?M.shape:[this.length]),this.dimension=this.shape.length,this[s.equals]==null&&(this[s.equals]=(R,D)=>x.prototype[s.equals].call(this,R,D)),this[a.serialize]==null&&(this[a.serialize]=R=>x.prototype[a.serialize].call(this,R))}[(o=l,s.equals)](M,C){return C.eq(this.shape,M.shape)&&C.arrays(this,M)}[a.serialize](M){return(0,c.encode_NDArray)(this)}}function H(S){return(0,r.isObject)(S)&&S[l]!==void 0}t.Float64NDArray=x,x.__name__="Float64NDArray",t.is_NDArray=H,t.ndarray=function(S,M={}){let{dtype:C}=M;C==null&&(C=S instanceof ArrayBuffer||(0,r.isArray)(S)?"float64":(()=>{switch(!0){case S instanceof Uint8Array:return"uint8";case S instanceof Int8Array:return"int8";case S instanceof Uint16Array:return"uint16";case S instanceof Int16Array:return"int16";case S instanceof Uint32Array:return"uint32";case S instanceof Int32Array:return"int32";case S instanceof Float32Array:return"float32";case S instanceof Float64Array:return"float64";default:(0,e.unreachable)()}})());const{shape:R}=M;switch(C){case"uint8":return new Q(S,R);case"int8":return new m(S,R);case"uint16":return new p(S,R);case"int16":return new y(S,R);case"uint32":return new g(S,R);case"int32":return new L(S,R);case"float32":return new A(S,R);case"float64":return new x(S,R)}}},function(T,V,t,k,E){k();const v=T(11),b=T(13),w=T(8);t.serialize=Symbol("serialize");class f extends Error{}t.SerializationError=f,f.__name__="SerializationError";class d{constructor(i){var o;this._references=new Map,this._definitions=new Map,this._refmap=new Map,this.include_defaults=(o=i?.include_defaults)===null||o===void 0||o}get_ref(i){return this._references.get(i)}add_ref(i,o){(0,v.assert)(!this._references.has(i)),this._references.set(i,o)}add_def(i,o){const r=this.get_ref(i);(0,v.assert)(r!=null),this._definitions.set(i,o),this._refmap.set(r,o)}get objects(){return new Set(this._references.keys())}get references(){return new Set(this._references.values())}get definitions(){return new Set(this._definitions.values())}resolve_ref(i){return this._refmap.get(i)}remove_ref(i){return this._references.delete(i)}remove_def(i){return this._definitions.delete(i)}to_serializable(i){const o=this.get_ref(i);if(o!=null)return o;if((function(r){return(0,w.isObject)(r)&&r[t.serialize]!==void 0})(i))return i[t.serialize](this);if((0,w.isArray)(i)||(0,w.isTypedArray)(i)){const r=i.length,e=new Array(r);for(let s=0;s<r;s++){const a=i[s];e[s]=this.to_serializable(a)}return e}if((0,w.isPlainObject)(i)){const r={};for(const[e,s]of(0,b.entries)(i))r[e]=this.to_serializable(s);return r}if(i===null||(0,w.isBoolean)(i)||(0,w.isNumber)(i)||(0,w.isString)(i))return i;throw new f(`${Object.prototype.toString.call(i)} is not serializable`)}}t.Serializer=d,d.__name__="Serializer"},function(T,V,t,k,E){k();const v=T(8),b=T(27),w=T(32);t.is_NDArray_ref=function(f){return(0,v.isPlainObject)(f)&&("__buffer__"in f||"__ndarray__"in f)},t.decode_NDArray=function(f,d){const{shape:u,dtype:i,order:o}=f;let r;if("__buffer__"in f){const e=d.get(f.__buffer__);if(e==null)throw new Error(`buffer for ${f.__buffer__} not found`);r=e}else r=(0,w.base64_to_buffer)(f.__ndarray__);return o!==b.BYTE_ORDER&&(0,w.swap)(r,i),{buffer:r,dtype:i,shape:u}},t.encode_NDArray=function(f,d){const u={order:b.BYTE_ORDER,dtype:f.dtype,shape:f.shape};if(d!=null){const i=`${d.size}`;return d.set(i,f.buffer),Object.assign({__buffer__:i},u)}return Object.assign({__ndarray__:{toJSON:()=>(0,w.buffer_to_base64)(f.buffer)}},u)}},function(T,V,t,k,E){k(),t.buffer_to_base64=function(v){const b=new Uint8Array(v),w=Array.from(b).map(f=>String.fromCharCode(f));return btoa(w.join(""))},t.base64_to_buffer=function(v){const b=atob(v),w=b.length,f=new Uint8Array(w);for(let d=0,u=w;d<u;d++)f[d]=b.charCodeAt(d);return f.buffer},t.swap=function(v,b){switch(b){case"uint16":case"int16":(function(w){const f=new Uint8Array(w);for(let d=0,u=f.length;d<u;d+=2){const i=f[d];f[d]=f[d+1],f[d+1]=i}})(v);break;case"uint32":case"int32":case"float32":(function(w){const f=new Uint8Array(w);for(let d=0,u=f.length;d<u;d+=4){let i=f[d];f[d]=f[d+3],f[d+3]=i,i=f[d+1],f[d+1]=f[d+2],f[d+2]=i}})(v);break;case"float64":(function(w){const f=new Uint8Array(w);for(let d=0,u=f.length;d<u;d+=8){let i=f[d];f[d]=f[d+7],f[d+7]=i,i=f[d+1],f[d+1]=f[d+6],f[d+6]=i,i=f[d+2],f[d+2]=f[d+5],f[d+5]=i,i=f[d+3],f[d+3]=f[d+4],f[d+4]=i}})(v)}}},function(T,V,t,k,E){k();const v=T(26);class b{is_Scalar(){return this.is_scalar}is_Vector(){return!this.is_scalar}}t.Uniform=b,b.__name__="Uniform";class w extends b{constructor(i,o){super(),this.value=i,this.length=o,this.is_scalar=!0}get(i){return this.value}*[Symbol.iterator](){const{length:i,value:o}=this;for(let r=0;r<i;r++)yield o}select(i){return new w(this.value,i.count)}[v.equals](i,o){return o.eq(this.length,i.length)&&o.eq(this.value,i.value)}}t.UniformScalar=w,w.__name__="UniformScalar";class f extends b{constructor(i){super(),this.array=i,this.is_scalar=!1,this.length=this.array.length}get(i){return this.array[i]}*[Symbol.iterator](){yield*this.array}select(i){const o=i.select(this.array);return new this.constructor(o)}[v.equals](i,o){return o.eq(this.length,i.length)&&o.eq(this.array,i.array)}}t.UniformVector=f,f.__name__="UniformVector";class d extends f{constructor(i){super(i),this.array=i,this._view=new DataView(i.buffer)}get(i){return this._view.getUint32(4*i)}*[Symbol.iterator](){const i=this.length;for(let o=0;o<i;o++)yield this.get(o)}}t.ColorUniformVector=d,d.__name__="ColorUniformVector"},function(T,V,t,k,E){k();const v=T(28);function b(){const f=new Array(32),d="0123456789ABCDEF";for(let u=0;u<32;u++)f[u]=d.substr(Math.floor(16*Math.random()),1);return f[12]="4",f[16]=d.substr(3&f[16].charCodeAt(0)|8,1),f.join("")}t.startsWith=function(f,d,u=0){return f.substr(u,d.length)==d},t.uuid4=b;let w=1e3;t.uniqueId=function(f){const d=v.settings.dev?"j"+w++:b();return f!=null?`${f}-${d}`:d},t.escape=function(f){return f.replace(/(?:[&<>"'`])/g,d=>{switch(d){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#x27;";case"`":return"&#x60;";default:return d}})},t.unescape=function(f){return f.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,(d,u)=>{switch(u){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return u}})},t.use_strict=function(f){return`'use strict';
2
2
  ${f}`},t.to_fixed=function(f,d){return f.toFixed(d).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"")}},function(T,V,t,k,E){k();const v=T(30);class b{constructor(c){this.document=c}}t.DocumentEvent=b,b.__name__="DocumentEvent";class w extends b{constructor(c,l,Q){super(c),this.events=l,this.setter_id=Q}}t.DocumentEventBatch=w,w.__name__="DocumentEventBatch";class f extends b{}t.DocumentChangedEvent=f,f.__name__="DocumentChangedEvent";class d extends f{constructor(c,l,Q){super(c),this.msg_type=l,this.msg_data=Q}[v.serialize](c){const l=this.msg_data,Q=c.to_serializable(l);return{kind:"MessageSent",msg_type:this.msg_type,msg_data:Q}}}t.MessageSentEvent=d,d.__name__="MessageSentEvent";class u extends f{constructor(c,l,Q,m,p,y,g){super(c),this.model=l,this.attr=Q,this.old=m,this.new_=p,this.setter_id=y,this.hint=g}[v.serialize](c){if(this.hint!=null)return c.to_serializable(this.hint);const l=this.new_,Q=c.to_serializable(l);return this.model!=l&&c.remove_def(this.model),{kind:"ModelChanged",model:this.model.ref(),attr:this.attr,new:Q}}}t.ModelChangedEvent=u,u.__name__="ModelChangedEvent";class i extends f{constructor(c,l,Q){super(c),this.column_source=l,this.patches=Q}[v.serialize](c){return{kind:"ColumnsPatched",column_source:this.column_source,patches:this.patches}}}t.ColumnsPatchedEvent=i,i.__name__="ColumnsPatchedEvent";class o extends f{constructor(c,l,Q,m){super(c),this.column_source=l,this.data=Q,this.rollover=m}[v.serialize](c){return{kind:"ColumnsStreamed",column_source:this.column_source,data:this.data,rollover:this.rollover}}}t.ColumnsStreamedEvent=o,o.__name__="ColumnsStreamedEvent";class r extends f{constructor(c,l,Q){super(c),this.title=l,this.setter_id=Q}[v.serialize](c){return{kind:"TitleChanged",title:this.title}}}t.TitleChangedEvent=r,r.__name__="TitleChangedEvent";class e extends f{constructor(c,l,Q){super(c),this.model=l,this.setter_id=Q}[v.serialize](c){return{kind:"RootAdded",model:c.to_serializable(this.model)}}}t.RootAddedEvent=e,e.__name__="RootAddedEvent";class s extends f{constructor(c,l,Q){super(c),this.model=l,this.setter_id=Q}[v.serialize](c){return{kind:"RootRemoved",model:this.model.ref()}}}t.RootRemovedEvent=s,s.__name__="RootRemovedEvent"},function(T,V,t,k,E){k();const v=T(8),b=T(13);t.pretty=Symbol("pretty");class w{constructor(d){this.visited=new Set,this.precision=d?.precision}to_string(d){if((0,v.isObject)(d)){if(this.visited.has(d))return"<circular>";this.visited.add(d)}return(function(u){return(0,v.isObject)(u)&&u[t.pretty]!==void 0})(d)?d[t.pretty](this):(0,v.isBoolean)(d)?this.boolean(d):(0,v.isNumber)(d)?this.number(d):(0,v.isString)(d)?this.string(d):(0,v.isArray)(d)?this.array(d):(0,v.isIterable)(d)?this.iterable(d):(0,v.isPlainObject)(d)?this.object(d):(0,v.isSymbol)(d)?this.symbol(d):`${d}`}token(d){return d}boolean(d){return`${d}`}number(d){return this.precision!=null?d.toFixed(this.precision):`${d}`}string(d){return`"${d.replace(/'/g,"\\'")}"`}symbol(d){return d.toString()}array(d){const u=this.token,i=[];for(const o of d)i.push(this.to_string(o));return`${u("[")}${i.join(`${u(",")} `)}${u("]")}`}iterable(d){var u;const i=this.token,o=(u=Object(d)[Symbol.toStringTag])!==null&&u!==void 0?u:"Object",r=this.array(d);return`${o}${i("(")}${r}${i(")")}`}object(d){const u=this.token,i=[];for(const[o,r]of(0,b.entries)(d))i.push(`${o}${u(":")} ${this.to_string(r)}`);return`${u("{")}${i.join(`${u(",")} `)}${u("}")}`}}t.Printer=w,w.__name__="Printer",t.to_string=function(f,d){return new w(d).to_string(f)}},function(T,V,t,k,E){k();const v=T(13),b=T(8);function w(u){return(0,b.isObject)(u)&&u[t.clone]!==void 0}t.clone=Symbol("clone"),t.is_Cloneable=w;class f extends Error{}t.CloningError=f,f.__name__="CloningError";class d{constructor(){}clone(i){if(w(i))return i[t.clone](this);if((0,b.isArray)(i)){const o=i.length,r=new Array(o);for(let e=0;e<o;e++){const s=i[e];r[e]=this.clone(s)}return r}if((0,b.isPlainObject)(i)){const o={};for(const[r,e]of(0,v.entries)(i))o[r]=this.clone(e);return o}if(i===null||(0,b.isBoolean)(i)||(0,b.isNumber)(i)||(0,b.isString)(i))return i;throw new f(`${Object.prototype.toString.call(i)} is not cloneable`)}}t.Cloner=d,d.__name__="Cloner"},function(T,V,t,k,E){k();const v=T(1);(0,v.__exportStar)(T(39),t),(0,v.__exportStar)(T(127),t),(0,v.__exportStar)(T(244),t),(0,v.__exportStar)(T(248),t),(0,v.__exportStar)(T(253),t),(0,v.__exportStar)(T(262),t),(0,v.__exportStar)(T(192),t),(0,v.__exportStar)(T(267),t),(0,v.__exportStar)(T(301),t),(0,v.__exportStar)(T(305),t),(0,v.__exportStar)(T(307),t),(0,v.__exportStar)(T(196),t),(0,v.__exportStar)(T(320),t),(0,v.__exportStar)(T(321),t),(0,v.__exportStar)(T(329),t),(0,v.__exportStar)(T(337),t),(0,v.__exportStar)(T(206),t),(0,v.__exportStar)(T(338),t),(0,v.__exportStar)(T(204),t),(0,v.__exportStar)(T(340),t),(0,v.__exportStar)(T(341),t),(0,v.__exportStar)(T(168),t),(0,v.__exportStar)(T(346),t),(0,v.__exportStar)(T(356),t),(0,v.__exportStar)(T(360),t)},function(T,V,t,k,E){k(),E("Annotation",T(40).Annotation),E("Arrow",T(68).Arrow),E("ArrowHead",T(112).ArrowHead),E("OpenHead",T(112).OpenHead),E("NormalHead",T(112).NormalHead),E("TeeHead",T(112).TeeHead),E("VeeHead",T(112).VeeHead),E("Band",T(114).Band),E("BoxAnnotation",T(116).BoxAnnotation),E("ColorBar",T(117).ColorBar),E("Label",T(212).Label),E("LabelSet",T(213).LabelSet),E("Legend",T(214).Legend),E("LegendItem",T(215).LegendItem),E("PolyAnnotation",T(217).PolyAnnotation),E("Slope",T(218).Slope),E("Span",T(219).Span),E("TextAnnotation",T(119).TextAnnotation),E("Title",T(118).Title),E("ToolbarPanel",T(220).ToolbarPanel),E("Tooltip",T(241).Tooltip),E("Whisker",T(243).Whisker)},function(T,V,t,k,E){var v;k();const b=T(41);class w extends b.RendererView{get_size(){if(this.model.visible){const{width:u,height:i}=this._get_size();return{width:Math.round(u),height:Math.round(i)}}return{width:0,height:0}}_get_size(){throw new Error("not implemented")}connect_signals(){super.connect_signals();const u=this.model.properties;this.on_change(u.visible,()=>{this.layout!=null&&(this.layout.visible=this.model.visible,this.plot_view.request_layout())})}get needs_clip(){return this.layout==null}serializable_state(){const u=super.serializable_state();return this.layout==null?u:Object.assign(Object.assign({},u),{bbox:this.layout.bbox.box})}}t.AnnotationView=w,w.__name__="AnnotationView";class f extends b.Renderer{constructor(u){super(u)}}t.Annotation=f,v=f,f.__name__="Annotation",v.override({level:"annotation"})},function(T,V,t,k,E){k();const v=T(1);var b,w;const f=T(42),d=(0,v.__importStar)(T(45)),u=T(20),i=T(53),o=T(54);class r extends i.Model{constructor(c){super(c)}}t.RendererGroup=r,b=r,r.__name__="RendererGroup",b.define(({Boolean:a})=>({visible:[a,!0]}));class e extends f.View{get coordinates(){const{_coordinates:c}=this;return c??(this._coordinates=this._initialize_coordinates())}initialize(){super.initialize(),this.visuals=new d.Visuals(this),this.needs_webgl_blit=!1}connect_signals(){super.connect_signals();const{x_range_name:c,y_range_name:l}=this.model.properties;this.on_change([c,l],()=>this._initialize_coordinates());const{group:Q}=this.model;Q!=null&&this.on_change(Q.properties.visible,()=>{this.model.visible=Q.visible})}_initialize_coordinates(){const{coordinates:c}=this.model,{frame:l}=this.plot_view;if(c!=null)return c.get_transform(l);{const{x_range_name:Q,y_range_name:m}=this.model,p=l.x_scales.get(Q),y=l.y_scales.get(m);return new o.CoordinateTransform(p,y)}}get plot_view(){return this.parent}get plot_model(){return this.parent.model}get layer(){const{overlays:c,primary:l}=this.canvas;return this.model.level=="overlay"?c:l}get canvas(){return this.plot_view.canvas_view}request_render(){this.request_paint()}request_paint(){this.plot_view.request_paint(this)}request_layout(){this.plot_view.request_layout()}notify_finished(){this.plot_view.notify_finished()}notify_finished_after_paint(){this.plot_view.notify_finished_after_paint()}get needs_clip(){return!1}get has_webgl(){return!1}render(){this.model.visible&&this._render(),this._has_finished=!0}renderer_view(c){}}t.RendererView=e,e.__name__="RendererView";class s extends i.Model{constructor(c){super(c)}}t.Renderer=s,w=s,s.__name__="Renderer",w.define(({Boolean:a,String:c,Ref:l,Nullable:Q})=>({group:[Q(l(r)),null],level:[u.RenderLevel,"image"],visible:[a,!0],x_range_name:[c,"default"],y_range_name:[c,"default"],coordinates:[Q(l(o.CoordinateMapping)),null]}))},function(T,V,t,k,E){k();const v=T(1),b=T(15),w=T(43),f=T(8),d=(0,v.__importDefault)(T(44));class u{constructor(o){this.removed=new b.Signal0(this,"removed"),this._ready=Promise.resolve(void 0),this._slots=new WeakMap,this._idle_notified=!1;const{model:r,parent:e}=o;this.model=r,this.parent=e,this.root=e==null?this:e.root,this.removed.emit()}get ready(){return this._ready}connect(o,r){let e=this._slots.get(r);return e==null&&(e=(s,a)=>{const c=Promise.resolve(r.call(this,s,a));this._ready=this._ready.then(()=>c)},this._slots.set(r,e)),o.connect(e,this)}disconnect(o,r){return o.disconnect(r,this)}initialize(){this._has_finished=!1,this.is_root&&(this._stylesheet=w.stylesheet);for(const o of this.styles())this.stylesheet.append(o)}async lazy_initialize(){}remove(){this.disconnect_signals(),this.removed.emit()}toString(){return`${this.model.type}View(${this.model.id})`}serializable_state(){return{type:this.model.type}}get is_root(){return this.parent==null}has_finished(){return this._has_finished}get is_idle(){return this.has_finished()}connect_signals(){}disconnect_signals(){b.Signal.disconnect_receiver(this)}on_change(o,r){for(const e of(0,f.isArray)(o)?o:[o])this.connect(e.change,r)}cursor(o,r){return null}get stylesheet(){return this.is_root?this._stylesheet:this.root.stylesheet}styles(){return[d.default]}notify_finished(){this.is_root?!this._idle_notified&&this.has_finished()&&this.model.document!=null&&(this._idle_notified=!0,this.model.document.notify_idle(this.model)):this.root.notify_finished()}}t.View=u,u.__name__="View"},function(T,V,t,k,E){k();const v=T(8),b=T(13),w=l=>(Q={},...m)=>{const p=document.createElement(l);p.classList.add("bk"),(0,v.isPlainObject)(Q)||(m=[Q,...m],Q={});for(let[g,L]of(0,b.entries)(Q))if(L!=null&&(!(0,v.isBoolean)(L)||L))if(g==="class"&&((0,v.isString)(L)&&(L=L.split(/\s+/)),(0,v.isArray)(L)))for(const A of L)A!=null&&p.classList.add(A);else if(g==="style"&&(0,v.isPlainObject)(L))for(const[A,x]of(0,b.entries)(L))p.style[A]=x;else if(g==="data"&&(0,v.isPlainObject)(L))for(const[A,x]of(0,b.entries)(L))p.dataset[A]=x;else p.setAttribute(g,L);function y(g){if((0,v.isString)(g))p.appendChild(document.createTextNode(g));else if(g instanceof Node)p.appendChild(g);else if(g instanceof NodeList||g instanceof HTMLCollection)for(const L of g)p.appendChild(L);else if(g!=null&&g!==!1)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(g)}`)}for(const g of m)if((0,v.isArray)(g))for(const L of g)y(L);else y(g);return p};function f(l){l.parentNode?.removeChild(l)}function d(l,...Q){const m=l.firstChild;for(const p of Q)l.insertBefore(p,m)}function u(l,Q){var m,p,y;const g=Element.prototype;return((y=(p=(m=g.matches)!==null&&m!==void 0?m:g.webkitMatchesSelector)!==null&&p!==void 0?p:g.mozMatchesSelector)!==null&&y!==void 0?y:g.msMatchesSelector).call(l,Q)}function i(l){return parseFloat(l)||0}function o(l){const Q=getComputedStyle(l);return{border:{top:i(Q.borderTopWidth),bottom:i(Q.borderBottomWidth),left:i(Q.borderLeftWidth),right:i(Q.borderRightWidth)},margin:{top:i(Q.marginTop),bottom:i(Q.marginBottom),left:i(Q.marginLeft),right:i(Q.marginRight)},padding:{top:i(Q.paddingTop),bottom:i(Q.paddingBottom),left:i(Q.paddingLeft),right:i(Q.paddingRight)}}}function r(l){const Q=l.getBoundingClientRect();return{width:Math.ceil(Q.width),height:Math.ceil(Q.height)}}t.createElement=function(l,Q,...m){return w(l)(Q,...m)},t.div=w("div"),t.span=w("span"),t.canvas=w("canvas"),t.link=w("link"),t.style=w("style"),t.a=w("a"),t.p=w("p"),t.i=w("i"),t.pre=w("pre"),t.button=w("button"),t.label=w("label"),t.input=w("input"),t.select=w("select"),t.option=w("option"),t.optgroup=w("optgroup"),t.textarea=w("textarea"),t.createSVGElement=function(l,Q,...m){const p=document.createElementNS("http://www.w3.org/2000/svg",l);for(const[g,L]of(0,b.entries)(Q??{}))L==null||(0,v.isBoolean)(L)&&!L||p.setAttribute(g,L);function y(g){if((0,v.isString)(g))p.appendChild(document.createTextNode(g));else if(g instanceof Node)p.appendChild(g);else if(g instanceof NodeList||g instanceof HTMLCollection)for(const L of g)p.appendChild(L);else if(g!=null&&g!==!1)throw new Error(`expected a DOM element, string, false or null, got ${JSON.stringify(g)}`)}for(const g of m)if((0,v.isArray)(g))for(const L of g)y(L);else y(g);return p},t.nbsp=function(){return document.createTextNode(" ")},t.append=function(l,...Q){for(const m of Q)l.appendChild(m)},t.remove=f,t.removeElement=f,t.replaceWith=function(l,Q){l.parentNode?.replaceChild(Q,l)},t.prepend=d,t.empty=function(l,Q=!1){let m;for(;m=l.firstChild;)l.removeChild(m);if(Q&&l instanceof Element)for(const p of l.attributes)l.removeAttributeNode(p)},t.display=function(l){l.style.display=""},t.undisplay=function(l){l.style.display="none"},t.show=function(l){l.style.visibility=""},t.hide=function(l){l.style.visibility="hidden"},t.offset=function(l){const Q=l.getBoundingClientRect();return{top:Q.top+window.pageYOffset-document.documentElement.clientTop,left:Q.left+window.pageXOffset-document.documentElement.clientLeft}},t.matches=u,t.parent=function(l,Q){let m=l;for(;m=m.parentElement;)if(u(m,Q))return m;return null},t.extents=o,t.size=r,t.scroll_size=function(l){return{width:Math.ceil(l.scrollWidth),height:Math.ceil(l.scrollHeight)}},t.outer_size=function(l){const{margin:{left:Q,right:m,top:p,bottom:y}}=o(l),{width:g,height:L}=r(l);return{width:Math.ceil(g+Q+m),height:Math.ceil(L+p+y)}},t.content_size=function(l){const{left:Q,top:m}=l.getBoundingClientRect(),{padding:p}=o(l);let y=0,g=0;for(const L of l.children){const A=L.getBoundingClientRect();y=Math.max(y,Math.ceil(A.left-Q-p.left+A.width)),g=Math.max(g,Math.ceil(A.top-m-p.top+A.height))}return{width:y,height:g}},t.position=function(l,Q,m){const{style:p}=l;if(p.left=`${Q.x}px`,p.top=`${Q.y}px`,p.width=`${Q.width}px`,p.height=`${Q.height}px`,m==null)p.margin="";else{const{top:y,right:g,bottom:L,left:A}=m;p.margin=`${y}px ${g}px ${L}px ${A}px`}},t.children=function(l){return Array.from(l.children)};class e{constructor(Q){this.el=Q,this.classList=Q.classList}get values(){const Q=[];for(let m=0;m<this.classList.length;m++){const p=this.classList.item(m);p!=null&&Q.push(p)}return Q}has(Q){return this.classList.contains(Q)}add(...Q){for(const m of Q)this.classList.add(m);return this}remove(...Q){for(const m of Q)this.classList.remove(m);return this}clear(){for(const Q of this.values)Q!="bk"&&this.classList.remove(Q);return this}toggle(Q,m){return m??!this.has(Q)?this.add(Q):this.remove(Q),this}}var s;function a(l,Q,m){const{width:p,height:y,position:g,display:L}=l.style;l.style.position="absolute",l.style.display="",l.style.width=Q.width!=null&&Q.width!=1/0?`${Q.width}px`:"auto",l.style.height=Q.height!=null&&Q.height!=1/0?`${Q.height}px`:"auto";try{return m()}finally{l.style.position=g,l.style.display=L,l.style.width=p,l.style.height=y}}t.ClassList=e,e.__name__="ClassList",t.classes=function(l){return new e(l)},t.toggle_attribute=function(l,Q,m){m==null&&(m=!l.hasAttribute(Q)),m?l.setAttribute(Q,"true"):l.removeAttribute(Q)},(s=t.Keys||(t.Keys={}))[s.Backspace=8]="Backspace",s[s.Tab=9]="Tab",s[s.Enter=13]="Enter",s[s.Esc=27]="Esc",s[s.PageUp=33]="PageUp",s[s.PageDown=34]="PageDown",s[s.Left=37]="Left",s[s.Up=38]="Up",s[s.Right=39]="Right",s[s.Down=40]="Down",s[s.Delete=46]="Delete",t.undisplayed=function(l,Q){const{display:m}=l.style;l.style.display="none";try{return Q()}finally{l.style.display=m}},t.unsized=function(l,Q){return a(l,{},Q)},t.sized=a;class c{constructor(Q){this.root=Q,this.known=new Set,this.style=(0,t.style)({type:"text/css"}),d(Q,this.style)}append(Q){this.known.has(Q)||(this.style.appendChild(document.createTextNode(Q)),this.known.add(Q))}}t.StyleSheet=c,c.__name__="StyleSheet",t.stylesheet=new c(document.head),t.dom_ready=async function(){if(document.readyState=="loading")return new Promise((l,Q)=>{document.addEventListener("DOMContentLoaded",()=>l(),{once:!0})})}},function(T,V,t,k,E){k(),t.root="bk-root",t.default=".bk-root{position:relative;width:auto;height:auto;box-sizing:border-box;font-family:Helvetica, Arial, sans-serif;font-size:13px;}.bk-root .bk,.bk-root .bk:before,.bk-root .bk:after{box-sizing:inherit;margin:0;border:0;padding:0;background-image:none;font-family:inherit;font-size:100%;line-height:1.42857143;}.bk-root pre.bk{font-family:Courier, monospace;}"},function(T,V,t,k,E){k();const v=T(1),b=T(46);E("Line",b.Line),E("LineScalar",b.LineScalar),E("LineVector",b.LineVector);const w=T(49);E("Fill",w.Fill),E("FillScalar",w.FillScalar),E("FillVector",w.FillVector);const f=T(50);E("Text",f.Text),E("TextScalar",f.TextScalar),E("TextVector",f.TextVector);const d=T(51);E("Hatch",d.Hatch),E("HatchScalar",d.HatchScalar),E("HatchVector",d.HatchVector);const u=(0,v.__importStar)(T(48)),i=T(47);E("VisualProperties",i.VisualProperties),E("VisualUniforms",i.VisualUniforms);class o{constructor(e){this._visuals=[];for(const[s,a]of e.model._mixins){const c=(()=>{switch(a){case u.Line:return new b.Line(e,s);case u.LineScalar:return new b.LineScalar(e,s);case u.LineVector:return new b.LineVector(e,s);case u.Fill:return new w.Fill(e,s);case u.FillScalar:return new w.FillScalar(e,s);case u.FillVector:return new w.FillVector(e,s);case u.Text:return new f.Text(e,s);case u.TextScalar:return new f.TextScalar(e,s);case u.TextVector:return new f.TextVector(e,s);case u.Hatch:return new d.Hatch(e,s);case u.HatchScalar:return new d.HatchScalar(e,s);case u.HatchVector:return new d.HatchVector(e,s);default:throw new Error("unknown visual")}})();c instanceof i.VisualProperties&&c.update(),this._visuals.push(c),Object.defineProperty(this,s+c.type,{get:()=>c,configurable:!1,enumerable:!0})}}*[Symbol.iterator](){yield*this._visuals}}t.Visuals=o,o.__name__="Visuals"},function(T,V,t,k,E){k();const v=T(1),b=T(47),w=(0,v.__importStar)(T(48)),f=T(22),d=T(8);function u(e){if((0,d.isArray)(e))return e;switch(e){case"solid":return[];case"dashed":return[6];case"dotted":return[2,4];case"dotdash":return[2,4,6,4];case"dashdot":return[6,4,2,4];default:return e.split(" ").map(Number).filter(d.isInteger)}}t.resolve_line_dash=u;class i extends b.VisualProperties{get doit(){const s=this.line_color.get_value(),a=this.line_alpha.get_value(),c=this.line_width.get_value();return!(s==null||a==0||c==0)}apply(s){const{doit:a}=this;return a&&(this.set_value(s),s.stroke()),a}values(){return{color:this.line_color.get_value(),alpha:this.line_alpha.get_value(),width:this.line_width.get_value(),join:this.line_join.get_value(),cap:this.line_cap.get_value(),dash:this.line_dash.get_value(),offset:this.line_dash_offset.get_value()}}set_value(s){const a=this.line_color.get_value(),c=this.line_alpha.get_value();s.strokeStyle=(0,f.color2css)(a,c),s.lineWidth=this.line_width.get_value(),s.lineJoin=this.line_join.get_value(),s.lineCap=this.line_cap.get_value(),s.lineDash=u(this.line_dash.get_value()),s.lineDashOffset=this.line_dash_offset.get_value()}}t.Line=i,i.__name__="Line";class o extends b.VisualUniforms{get doit(){const s=this.line_color.value,a=this.line_alpha.value,c=this.line_width.value;return!(s==0||a==0||c==0)}apply(s){const{doit:a}=this;return a&&(this.set_value(s),s.stroke()),a}values(){return{color:this.line_color.value,alpha:this.line_alpha.value,width:this.line_width.value,join:this.line_join.value,cap:this.line_cap.value,dash:this.line_dash.value,offset:this.line_dash_offset.value}}set_value(s){const a=this.line_color.value,c=this.line_alpha.value;s.strokeStyle=(0,f.color2css)(a,c),s.lineWidth=this.line_width.value,s.lineJoin=this.line_join.value,s.lineCap=this.line_cap.value,s.lineDash=u(this.line_dash.value),s.lineDashOffset=this.line_dash_offset.value}}t.LineScalar=o,o.__name__="LineScalar";class r extends b.VisualUniforms{get doit(){const{line_color:s}=this;if(s.is_Scalar()&&s.value==0)return!1;const{line_alpha:a}=this;if(a.is_Scalar()&&a.value==0)return!1;const{line_width:c}=this;return!c.is_Scalar()||c.value!=0}apply(s,a){const{doit:c}=this;return c&&(this.set_vectorize(s,a),s.stroke()),c}values(s){return{color:this.line_color.get(s),alpha:this.line_alpha.get(s),width:this.line_width.get(s),join:this.line_join.get(s),cap:this.line_cap.get(s),dash:this.line_dash.get(s),offset:this.line_dash_offset.get(s)}}set_vectorize(s,a){const c=this.line_color.get(a),l=this.line_alpha.get(a),Q=this.line_width.get(a),m=this.line_join.get(a),p=this.line_cap.get(a),y=this.line_dash.get(a),g=this.line_dash_offset.get(a);s.strokeStyle=(0,f.color2css)(c,l),s.lineWidth=Q,s.lineJoin=m,s.lineCap=p,s.lineDash=u(y),s.lineDashOffset=g}}t.LineVector=r,r.__name__="LineVector",i.prototype.type="line",i.prototype.attrs=Object.keys(w.Line),o.prototype.type="line",o.prototype.attrs=Object.keys(w.LineScalar),r.prototype.type="line",r.prototype.attrs=Object.keys(w.LineVector)},function(T,V,t,k,E){k();class v{constructor(f,d=""){this.obj=f,this.prefix=d;const u=this;this._props=[];for(const i of this.attrs){const o=f.model.properties[d+i];o.change.connect(()=>this.update()),u[i]=o,this._props.push(o)}}*[Symbol.iterator](){yield*this._props}update(){}}t.VisualProperties=v,v.__name__="VisualProperties";class b{constructor(f,d=""){this.obj=f,this.prefix=d;for(const u of this.attrs)Object.defineProperty(this,u,{get:()=>f[d+u]})}*[Symbol.iterator](){for(const f of this.attrs)yield this.obj.model.properties[this.prefix+f]}update(){}}t.VisualUniforms=b,b.__name__="VisualUniforms"},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importStar)(T(18)),w=T(20),f=(0,v.__importStar)(T(21)),d=T(13);t.Line={line_color:[f.Nullable(f.Color),"black"],line_alpha:[f.Alpha,1],line_width:[f.Number,1],line_join:[w.LineJoin,"bevel"],line_cap:[w.LineCap,"butt"],line_dash:[f.Or(w.LineDash,f.Array(f.Number)),[]],line_dash_offset:[f.Number,0]},t.Fill={fill_color:[f.Nullable(f.Color),"gray"],fill_alpha:[f.Alpha,1]},t.Hatch={hatch_color:[f.Nullable(f.Color),"black"],hatch_alpha:[f.Alpha,1],hatch_scale:[f.Number,12],hatch_pattern:[f.Nullable(f.Or(w.HatchPatternType,f.String)),null],hatch_weight:[f.Number,1],hatch_extra:[f.Dict(f.AnyRef()),{}]},t.Text={text_color:[f.Nullable(f.Color),"#444444"],text_alpha:[f.Alpha,1],text_font:[b.Font,"helvetica"],text_font_size:[f.FontSize,"16px"],text_font_style:[w.FontStyle,"normal"],text_align:[w.TextAlign,"left"],text_baseline:[w.TextBaseline,"bottom"],text_line_height:[f.Number,1.2]},t.LineScalar={line_color:[b.ColorScalar,"black"],line_alpha:[b.NumberScalar,1],line_width:[b.NumberScalar,1],line_join:[b.LineJoinScalar,"bevel"],line_cap:[b.LineCapScalar,"butt"],line_dash:[b.LineDashScalar,[]],line_dash_offset:[b.NumberScalar,0]},t.FillScalar={fill_color:[b.ColorScalar,"gray"],fill_alpha:[b.NumberScalar,1]},t.HatchScalar={hatch_color:[b.ColorScalar,"black"],hatch_alpha:[b.NumberScalar,1],hatch_scale:[b.NumberScalar,12],hatch_pattern:[b.NullStringScalar,null],hatch_weight:[b.NumberScalar,1],hatch_extra:[b.AnyScalar,{}]},t.TextScalar={text_color:[b.ColorScalar,"#444444"],text_alpha:[b.NumberScalar,1],text_font:[b.FontScalar,"helvetica"],text_font_size:[b.FontSizeScalar,"16px"],text_font_style:[b.FontStyleScalar,"normal"],text_align:[b.TextAlignScalar,"left"],text_baseline:[b.TextBaselineScalar,"bottom"],text_line_height:[b.NumberScalar,1.2]},t.LineVector={line_color:[b.ColorSpec,"black"],line_alpha:[b.NumberSpec,1],line_width:[b.NumberSpec,1],line_join:[b.LineJoinSpec,"bevel"],line_cap:[b.LineCapSpec,"butt"],line_dash:[b.LineDashSpec,[]],line_dash_offset:[b.NumberSpec,0]},t.FillVector={fill_color:[b.ColorSpec,"gray"],fill_alpha:[b.NumberSpec,1]},t.HatchVector={hatch_color:[b.ColorSpec,"black"],hatch_alpha:[b.NumberSpec,1],hatch_scale:[b.NumberSpec,12],hatch_pattern:[b.NullStringSpec,null],hatch_weight:[b.NumberSpec,1],hatch_extra:[b.AnyScalar,{}]},t.TextVector={text_color:[b.ColorSpec,"#444444"],text_alpha:[b.NumberSpec,1],text_font:[b.FontSpec,"helvetica"],text_font_size:[b.FontSizeSpec,"16px"],text_font_style:[b.FontStyleSpec,"normal"],text_align:[b.TextAlignSpec,"left"],text_baseline:[b.TextBaselineSpec,"bottom"],text_line_height:[b.NumberSpec,1.2]},t.attrs_of=function(u,i,o,r=!1){const e={};for(const s of(0,d.keys)(o)){const a=`${i}${s}`,c=u[a];e[r?a:s]=c}return e}},function(T,V,t,k,E){k();const v=T(1),b=T(47),w=(0,v.__importStar)(T(48)),f=T(22);class d extends b.VisualProperties{get doit(){const r=this.fill_color.get_value(),e=this.fill_alpha.get_value();return!(r==null||e==0)}apply(r,e){const{doit:s}=this;return s&&(this.set_value(r),r.fill(e)),s}values(){return{color:this.fill_color.get_value(),alpha:this.fill_alpha.get_value()}}set_value(r){const e=this.fill_color.get_value(),s=this.fill_alpha.get_value();r.fillStyle=(0,f.color2css)(e,s)}}t.Fill=d,d.__name__="Fill";class u extends b.VisualUniforms{get doit(){const r=this.fill_color.value,e=this.fill_alpha.value;return!(r==0||e==0)}apply(r,e){const{doit:s}=this;return s&&(this.set_value(r),r.fill(e)),s}values(){return{color:this.fill_color.value,alpha:this.fill_alpha.value}}set_value(r){const e=this.fill_color.value,s=this.fill_alpha.value;r.fillStyle=(0,f.color2css)(e,s)}}t.FillScalar=u,u.__name__="FillScalar";class i extends b.VisualUniforms{get doit(){const{fill_color:r}=this;if(r.is_Scalar()&&r.value==0)return!1;const{fill_alpha:e}=this;return!e.is_Scalar()||e.value!=0}apply(r,e,s){const{doit:a}=this;return a&&(this.set_vectorize(r,e),r.fill(s)),a}values(r){return{color:this.fill_color.get(r),alpha:this.fill_alpha.get(r)}}set_vectorize(r,e){const s=this.fill_color.get(e),a=this.fill_alpha.get(e);r.fillStyle=(0,f.color2css)(s,a)}}t.FillVector=i,i.__name__="FillVector",d.prototype.type="fill",d.prototype.attrs=Object.keys(w.Fill),u.prototype.type="fill",u.prototype.attrs=Object.keys(w.FillScalar),i.prototype.type="fill",i.prototype.attrs=Object.keys(w.FillVector)},function(T,V,t,k,E){k();const v=T(1),b=T(47),w=(0,v.__importStar)(T(48)),f=T(22);class d extends b.VisualProperties{get doit(){const r=this.text_color.get_value(),e=this.text_alpha.get_value();return!(r==null||e==0)}values(){return{color:this.text_color.get_value(),alpha:this.text_alpha.get_value(),font:this.text_font.get_value(),font_size:this.text_font_size.get_value(),font_style:this.text_font_style.get_value(),align:this.text_align.get_value(),baseline:this.text_baseline.get_value(),line_height:this.text_line_height.get_value()}}set_value(r){const e=this.text_color.get_value(),s=this.text_alpha.get_value();r.fillStyle=(0,f.color2css)(e,s),r.font=this.font_value(),r.textAlign=this.text_align.get_value(),r.textBaseline=this.text_baseline.get_value()}font_value(){return`${this.text_font_style.get_value()} ${this.text_font_size.get_value()} ${this.text_font.get_value()}`}}t.Text=d,d.__name__="Text";class u extends b.VisualUniforms{get doit(){const r=this.text_color.value,e=this.text_alpha.value;return!(r==0||e==0)}values(){return{color:this.text_color.value,alpha:this.text_alpha.value,font:this.text_font.value,font_size:this.text_font_size.value,font_style:this.text_font_style.value,align:this.text_align.value,baseline:this.text_baseline.value,line_height:this.text_line_height.value}}set_value(r){const e=this.text_color.value,s=this.text_alpha.value,a=this.font_value(),c=this.text_align.value,l=this.text_baseline.value;r.fillStyle=(0,f.color2css)(e,s),r.font=a,r.textAlign=c,r.textBaseline=l}font_value(){return`${this.text_font_style.value} ${this.text_font_size.value} ${this.text_font.value}`}}t.TextScalar=u,u.__name__="TextScalar";class i extends b.VisualUniforms{values(r){return{color:this.text_color.get(r),alpha:this.text_alpha.get(r),font:this.text_font.get(r),font_size:this.text_font_size.get(r),font_style:this.text_font_style.get(r),align:this.text_align.get(r),baseline:this.text_baseline.get(r),line_height:this.text_line_height.get(r)}}get doit(){const{text_color:r}=this;if(r.is_Scalar()&&r.value==0)return!1;const{text_alpha:e}=this;return!e.is_Scalar()||e.value!=0}set_vectorize(r,e){const s=this.text_color.get(e),a=this.text_alpha.get(e),c=this.font_value(e),l=this.text_align.get(e),Q=this.text_baseline.get(e);r.fillStyle=(0,f.color2css)(s,a),r.font=c,r.textAlign=l,r.textBaseline=Q}font_value(r){return`${this.text_font_style.get(r)} ${this.text_font_size.get(r)} ${this.text_font.get(r)}`}}t.TextVector=i,i.__name__="TextVector",d.prototype.type="text",d.prototype.attrs=Object.keys(w.Text),u.prototype.type="text",u.prototype.attrs=Object.keys(w.TextScalar),i.prototype.type="text",i.prototype.attrs=Object.keys(w.TextVector)},function(T,V,t,k,E){k();const v=T(1),b=T(47),w=T(52),f=(0,v.__importStar)(T(18)),d=(0,v.__importStar)(T(48));class u extends b.VisualProperties{constructor(){super(...arguments),this._update_iteration=0}update(){if(this._update_iteration++,this._hatch_image=null,!this.doit)return;const e=this.hatch_color.get_value(),s=this.hatch_alpha.get_value(),a=this.hatch_scale.get_value(),c=this.hatch_pattern.get_value(),l=this.hatch_weight.get_value(),Q=p=>{this._hatch_image=p},m=this.hatch_extra.get_value()[c];if(m!=null){const p=m.get_pattern(e,s,a,l);if(p instanceof Promise){const{_update_iteration:y}=this;p.then(g=>{this._update_iteration==y&&(Q(g),this.obj.request_render())})}else Q(p)}else{const p=this.obj.canvas.create_layer(),y=(0,w.get_pattern)(p,c,e,s,a,l);Q(y)}}get doit(){const e=this.hatch_color.get_value(),s=this.hatch_alpha.get_value(),a=this.hatch_pattern.get_value();return!(e==null||s==0||a==" "||a=="blank"||a==null)}apply(e,s){const{doit:a}=this;return a&&(this.set_value(e),e.layer.undo_transform(()=>e.fill(s))),a}set_value(e){const s=this.pattern(e);e.fillStyle=s??"transparent"}pattern(e){const s=this._hatch_image;return s==null?null:e.createPattern(s,this.repetition())}repetition(){const e=this.hatch_pattern.get_value(),s=this.hatch_extra.get_value()[e];if(s==null)return"repeat";switch(s.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}t.Hatch=u,u.__name__="Hatch";class i extends b.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const e=this.hatch_color.value,s=this.hatch_alpha.value,a=this.hatch_pattern.value;return!(e==null||s==0||a==" "||a=="blank"||a==null)}update(){this._update_iteration++;const e=this.hatch_color.length;if(this._hatch_image=new f.UniformScalar(null,e),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const s=this.hatch_color.value,a=this.hatch_alpha.value,c=this.hatch_scale.value,l=this.hatch_pattern.value,Q=this.hatch_weight.value,m=y=>{this._hatch_image=new f.UniformScalar(y,e)},p=this.hatch_extra.value[l];if(p!=null){const y=p.get_pattern(s,a,c,Q);if(y instanceof Promise){const{_update_iteration:g}=this;y.then(L=>{this._update_iteration==g&&(m(L),this.obj.request_render())})}else m(y)}else{const y=this.obj.canvas.create_layer(),g=(0,w.get_pattern)(y,l,s,a,c,Q);m(g)}}get doit(){return this._static_doit}apply(e,s){const{doit:a}=this;return a&&(this.set_value(e),e.layer.undo_transform(()=>e.fill(s))),a}set_value(e){var s;e.fillStyle=(s=this.pattern(e))!==null&&s!==void 0?s:"transparent"}pattern(e){const s=this._hatch_image.value;return s==null?null:e.createPattern(s,this.repetition())}repetition(){const e=this.hatch_pattern.value,s=this.hatch_extra.value[e];if(s==null)return"repeat";switch(s.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}t.HatchScalar=i,i.__name__="HatchScalar";class o extends b.VisualUniforms{constructor(){super(...arguments),this._static_doit=!1,this._update_iteration=0}_compute_static_doit(){const{hatch_color:e}=this;if(e.is_Scalar()&&e.value==0)return!1;const{hatch_alpha:s}=this;if(s.is_Scalar()&&s.value==0)return!1;const{hatch_pattern:a}=this;if(a.is_Scalar()){const c=a.value;if(c==" "||c=="blank"||c==null)return!1}return!0}update(){this._update_iteration++;const e=this.hatch_color.length;if(this._hatch_image=new f.UniformScalar(null,e),this._static_doit=this._compute_static_doit(),!this._static_doit)return;const s=(a,c,l,Q,m,p)=>{const y=this.hatch_extra.value[a];if(y!=null){const g=y.get_pattern(c,l,Q,m);if(g instanceof Promise){const{_update_iteration:L}=this;g.then(A=>{this._update_iteration==L&&(p(A),this.obj.request_render())})}else p(g)}else{const g=this.obj.canvas.create_layer(),L=(0,w.get_pattern)(g,a,c,l,Q,m);p(L)}};if(this.hatch_color.is_Scalar()&&this.hatch_alpha.is_Scalar()&&this.hatch_scale.is_Scalar()&&this.hatch_pattern.is_Scalar()&&this.hatch_weight.is_Scalar()){const a=this.hatch_color.value,c=this.hatch_alpha.value,l=this.hatch_scale.value;s(this.hatch_pattern.value,a,c,l,this.hatch_weight.value,Q=>{this._hatch_image=new f.UniformScalar(Q,e)})}else{const a=new Array(e);a.fill(null),this._hatch_image=new f.UniformVector(a);for(let c=0;c<e;c++){const l=this.hatch_color.get(c),Q=this.hatch_alpha.get(c),m=this.hatch_scale.get(c);s(this.hatch_pattern.get(c),l,Q,m,this.hatch_weight.get(c),p=>{a[c]=p})}}}get doit(){return this._static_doit}apply(e,s,a){const{doit:c}=this;return c&&(this.set_vectorize(e,s),e.layer.undo_transform(()=>e.fill(a))),c}set_vectorize(e,s){var a;e.fillStyle=(a=this.pattern(e,s))!==null&&a!==void 0?a:"transparent"}pattern(e,s){const a=this._hatch_image.get(s);return a==null?null:e.createPattern(a,this.repetition(s))}repetition(e){const s=this.hatch_pattern.get(e),a=this.hatch_extra.value[s];if(a==null)return"repeat";switch(a.repetition){case"repeat":return"repeat";case"repeat_x":return"repeat-x";case"repeat_y":return"repeat-y";case"no_repeat":return"no-repeat"}}}t.HatchVector=o,o.__name__="HatchVector",u.prototype.type="hatch",u.prototype.attrs=Object.keys(d.Hatch),i.prototype.type="hatch",i.prototype.attrs=Object.keys(d.HatchScalar),o.prototype.type="hatch",o.prototype.attrs=Object.keys(d.HatchVector)},function(T,V,t,k,E){k();const v=T(22);function b(d,u,i){d.moveTo(0,i+.5),d.lineTo(u,i+.5),d.stroke()}function w(d,u,i){d.moveTo(i+.5,0),d.lineTo(i+.5,u),d.stroke()}function f(d,u){d.moveTo(0,u),d.lineTo(u,0),d.stroke(),d.moveTo(0,0),d.lineTo(u,u),d.stroke()}t.hatch_aliases={" ":"blank",".":"dot",o:"ring","-":"horizontal_line","|":"vertical_line","+":"cross",'"':"horizontal_dash",":":"vertical_dash","@":"spiral","/":"right_diagonal_line","\\":"left_diagonal_line",x:"diagonal_cross",",":"right_diagonal_dash","`":"left_diagonal_dash",v:"horizontal_wave",">":"vertical_wave","*":"criss_cross"},t.get_pattern=function(d,u,i,o,r,e){return d.resize(r,r),d.prepare(),(function(s,a,c,l,Q,m){var p;const y=Q,g=y/2,L=g/2,A=(0,v.color2css)(c,l);switch(s.strokeStyle=A,s.fillStyle=A,s.lineCap="square",s.lineWidth=m,(p=t.hatch_aliases[a])!==null&&p!==void 0?p:a){case"blank":break;case"dot":s.arc(g,g,g/2,0,2*Math.PI,!0),s.fill();break;case"ring":s.arc(g,g,g/2,0,2*Math.PI,!0),s.stroke();break;case"horizontal_line":b(s,y,g);break;case"vertical_line":w(s,y,g);break;case"cross":b(s,y,g),w(s,y,g);break;case"horizontal_dash":b(s,g,g);break;case"vertical_dash":w(s,g,g);break;case"spiral":{const x=y/30;s.moveTo(g,g);for(let H=0;H<360;H++){const S=.1*H,M=g+x*S*Math.cos(S),C=g+x*S*Math.sin(S);s.lineTo(M,C)}s.stroke();break}case"right_diagonal_line":s.moveTo(.5-L,y),s.lineTo(L+.5,0),s.stroke(),s.moveTo(L+.5,y),s.lineTo(3*L+.5,0),s.stroke(),s.moveTo(3*L+.5,y),s.lineTo(5*L+.5,0),s.stroke(),s.stroke();break;case"left_diagonal_line":s.moveTo(L+.5,y),s.lineTo(.5-L,0),s.stroke(),s.moveTo(3*L+.5,y),s.lineTo(L+.5,0),s.stroke(),s.moveTo(5*L+.5,y),s.lineTo(3*L+.5,0),s.stroke(),s.stroke();break;case"diagonal_cross":f(s,y);break;case"right_diagonal_dash":s.moveTo(L+.5,3*L+.5),s.lineTo(3*L+.5,L+.5),s.stroke();break;case"left_diagonal_dash":s.moveTo(L+.5,L+.5),s.lineTo(3*L+.5,3*L+.5),s.stroke();break;case"horizontal_wave":s.moveTo(0,L),s.lineTo(g,3*L),s.lineTo(y,L),s.stroke();break;case"vertical_wave":s.moveTo(L,0),s.lineTo(3*L,g),s.lineTo(L,y),s.stroke();break;case"criss_cross":f(s,y),b(s,y,g),w(s,y,g)}})(d.ctx,u,i,o,r,e),d.canvas}},function(T,V,t,k,E){var v;k();const b=T(14),w=T(8),f=T(13),d=T(26),u=T(19);class i extends b.HasProps{constructor(r){super(r)}get is_syncable(){return this.syncable}[d.equals](r,e){return e.eq(this.id,r.id)&&super[d.equals](r,e)}initialize(){super.initialize(),this._js_callbacks=new Map}connect_signals(){super.connect_signals(),this._update_property_callbacks(),this.connect(this.properties.js_property_callbacks.change,()=>this._update_property_callbacks()),this.connect(this.properties.js_event_callbacks.change,()=>this._update_event_callbacks()),this.connect(this.properties.subscribed_events.change,()=>this._update_event_callbacks())}_process_event(r){var e;for(const s of(e=this.js_event_callbacks[r.event_name])!==null&&e!==void 0?e:[])s.execute(r);this.document!=null&&this.subscribed_events.some(s=>s==r.event_name)&&this.document.event_manager.send_event(r)}trigger_event(r){this.document!=null&&(r.origin=this,this.document.event_manager.trigger(r))}_update_event_callbacks(){this.document!=null?this.document.event_manager.subscribed_models.add(this):u.logger.warn("WARNING: Document not defined for updating event callbacks")}_update_property_callbacks(){const r=e=>{const[s,a=null]=e.split(":");return a!=null?this.properties[a][s]:this[s]};for(const[e,s]of this._js_callbacks){const a=r(e);for(const c of s)this.disconnect(a,c)}this._js_callbacks.clear();for(const[e,s]of(0,f.entries)(this.js_property_callbacks)){const a=s.map(l=>()=>l.execute(this));this._js_callbacks.set(e,a);const c=r(e);for(const l of a)this.connect(c,l)}}_doc_attached(){(0,f.isEmpty)(this.js_event_callbacks)&&this.subscribed_events.length==0||this._update_event_callbacks()}_doc_detached(){this.document.event_manager.subscribed_models.delete(this)}select(r){if((0,w.isString)(r))return[...this.references()].filter(e=>e instanceof i&&e.name===r);if(r.prototype instanceof b.HasProps)return[...this.references()].filter(e=>e instanceof r);throw new Error("invalid selector")}select_one(r){const e=this.select(r);switch(e.length){case 0:return null;case 1:return e[0];default:throw new Error("found more than one object matching given selector")}}}t.Model=i,v=i,i.__name__="Model",v.define(({Any:o,Unknown:r,Boolean:e,String:s,Array:a,Dict:c,Nullable:l})=>({tags:[a(r),[]],name:[l(s),null],js_property_callbacks:[c(a(o)),{}],js_event_callbacks:[c(a(o)),{}],subscribed_events:[a(s),[]],syncable:[e,!0]}))},function(T,V,t,k,E){var v,b;k();const w=T(12),f=T(53),d=T(55),u=T(59),i=T(61),o=T(62),r=T(57),e=T(63),s=T(67);class a{constructor(m,p){this.x_scale=m,this.y_scale=p,this.x_source=this.x_scale.source_range,this.y_source=this.y_scale.source_range,this.ranges=[this.x_source,this.y_source],this.scales=[this.x_scale,this.y_scale]}map_to_screen(m,p){return[this.x_scale.v_compute(m),this.y_scale.v_compute(p)]}map_from_screen(m,p){return[this.x_scale.v_invert(m),this.y_scale.v_invert(p)]}}t.CoordinateTransform=a,a.__name__="CoordinateTransform";class c extends f.Model{constructor(m){super(m)}get x_ranges(){return new Map([["default",this.x_source]])}get y_ranges(){return new Map([["default",this.y_source]])}_get_scale(m,p,y){if(m instanceof s.FactorRange!=p instanceof o.CategoricalScale)throw new Error(`Range ${m.type} is incompatible is Scale ${p.type}`);p instanceof i.LogScale&&m instanceof e.DataRange1d&&(m.scale_hint="log");const g=p.clone();return g.setv({source_range:m,target_range:y}),g}get_transform(m){const{x_source:p,x_scale:y,x_target:g}=this,L=this._get_scale(p,y,g),{y_source:A,y_scale:x,y_target:H}=this,S=this._get_scale(A,x,H),M=new l({source_scale:L,source_range:L.source_range,target_scale:m.x_scale,target_range:m.x_target}),C=new l({source_scale:S,source_range:S.source_range,target_scale:m.y_scale,target_range:m.y_target});return new a(M,C)}}t.CoordinateMapping=c,v=c,c.__name__="CoordinateMapping",v.define(({Ref:Q})=>({x_source:[Q(r.Range),()=>new e.DataRange1d],y_source:[Q(r.Range),()=>new e.DataRange1d],x_scale:[Q(d.Scale),()=>new u.LinearScale],y_scale:[Q(d.Scale),()=>new u.LinearScale],x_target:[Q(r.Range)],y_target:[Q(r.Range)]}));class l extends d.Scale{constructor(m){super(m)}get s_compute(){const m=this.source_scale.s_compute,p=this.target_scale.s_compute;return y=>p(m(y))}get s_invert(){const m=this.source_scale.s_invert,p=this.target_scale.s_invert;return y=>m(p(y))}compute(m){return this.s_compute(m)}v_compute(m){const{s_compute:p}=this;return(0,w.map)(m,p)}invert(m){return this.s_invert(m)}v_invert(m){const{s_invert:p}=this;return(0,w.map)(m,p)}}t.CompositeScale=l,b=l,l.__name__="CompositeScale",b.internal(({Ref:Q})=>({source_scale:[Q(d.Scale)],target_scale:[Q(d.Scale)]}))},function(T,V,t,k,E){var v;k();const b=T(56),w=T(57),f=T(58),d=T(24);class u extends b.Transform{constructor(o){super(o)}compute(o){return this.s_compute(o)}v_compute(o){const r=new d.ScreenArray(o.length),{s_compute:e}=this;for(let s=0;s<o.length;s++)r[s]=e(o[s]);return r}invert(o){return this.s_invert(o)}v_invert(o){const r=new Float64Array(o.length),{s_invert:e}=this;for(let s=0;s<o.length;s++)r[s]=e(o[s]);return r}r_compute(o,r){const{s_compute:e}=this;return this.target_range.is_reversed?[e(r),e(o)]:[e(o),e(r)]}r_invert(o,r){const{s_invert:e}=this;return this.target_range.is_reversed?[e(r),e(o)]:[e(o),e(r)]}}t.Scale=u,v=u,u.__name__="Scale",v.internal(({Ref:i})=>({source_range:[i(w.Range)],target_range:[i(f.Range1d)]}))},function(T,V,t,k,E){k();const v=T(53);class b extends v.Model{constructor(f){super(f)}}t.Transform=b,b.__name__="Transform"},function(T,V,t,k,E){var v;k();const b=T(53);class w extends b.Model{constructor(d){super(d),this.have_updated_interactively=!1}get is_reversed(){return this.start>this.end}get is_valid(){return isFinite(this.min)&&isFinite(this.max)}get span(){return Math.abs(this.end-this.start)}}t.Range=w,v=w,w.__name__="Range",v.define(({Number:f,Tuple:d,Or:u,Auto:i,Nullable:o})=>({bounds:[o(u(d(o(f),o(f)),i)),null],min_interval:[o(f),null],max_interval:[o(f),null]})),v.internal(({Array:f,AnyRef:d})=>({plots:[f(d()),[]]}))},function(T,V,t,k,E){var v;k();const b=T(57);class w extends b.Range{constructor(d){super(d)}_set_auto_bounds(){if(this.bounds=="auto"){const d=Math.min(this._reset_start,this._reset_end),u=Math.max(this._reset_start,this._reset_end);this.setv({bounds:[d,u]},{silent:!0})}}initialize(){super.initialize(),this._set_auto_bounds()}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}reset(){this._set_auto_bounds();const{_reset_start:d,_reset_end:u}=this;this.start!=d||this.end!=u?this.setv({start:d,end:u}):this.change.emit()}map(d){return new w({start:d(this.start),end:d(this.end)})}widen(d){let{start:u,end:i}=this;return this.is_reversed?(u+=d,i-=d):(u-=d,i+=d),new w({start:u,end:i})}}t.Range1d=w,v=w,w.__name__="Range1d",v.define(({Number:f,Nullable:d})=>({start:[f,0],end:[f,1],reset_start:[d(f),null,{on_update(u,i){i._reset_start=u??i.start}}],reset_end:[d(f),null,{on_update(u,i){i._reset_end=u??i.end}}]}))},function(T,V,t,k,E){k();const v=T(60);class b extends v.ContinuousScale{constructor(f){super(f)}get s_compute(){const[f,d]=this._linear_compute_state();return u=>f*u+d}get s_invert(){const[f,d]=this._linear_compute_state();return u=>(u-d)/f}_linear_compute_state(){const f=this.source_range.start,d=this.source_range.end,u=this.target_range.start,i=(this.target_range.end-u)/(d-f);return[i,-i*f+u]}}t.LinearScale=b,b.__name__="LinearScale"},function(T,V,t,k,E){k();const v=T(55);class b extends v.Scale{constructor(f){super(f)}}t.ContinuousScale=b,b.__name__="ContinuousScale"},function(T,V,t,k,E){k();const v=T(60);class b extends v.ContinuousScale{constructor(f){super(f)}get s_compute(){const[f,d,u,i]=this._compute_state();return o=>{if(u==0)return 0;{const r=(Math.log(o)-i)/u;return isFinite(r)?r*f+d:NaN}}}get s_invert(){const[f,d,u,i]=this._compute_state();return o=>{const r=(o-d)/f;return Math.exp(u*r+i)}}_get_safe_factor(f,d){let u=f<0?0:f,i=d<0?0:d;if(u==i)if(u==0)[u,i]=[1,10];else{const o=Math.log(u)/Math.log(10);u=10**Math.floor(o),i=Math.ceil(o)!=Math.floor(o)?10**Math.ceil(o):10**(Math.ceil(o)+1)}return[u,i]}_compute_state(){const f=this.source_range.start,d=this.source_range.end,u=this.target_range.start,i=this.target_range.end-u,[o,r]=this._get_safe_factor(f,d);let e,s;return o==0?(e=Math.log(r),s=0):(e=Math.log(r)-Math.log(o),s=Math.log(o)),[i,u,e,s]}}t.LogScale=b,b.__name__="LogScale"},function(T,V,t,k,E){k();const v=T(55),b=T(59),{_linear_compute_state:w}=b.LinearScale.prototype;class f extends v.Scale{constructor(u){super(u)}get s_compute(){const[u,i]=w.call(this),o=this.source_range;return r=>u*o.synthetic(r)+i}get s_invert(){const[u,i]=w.call(this);return o=>(o-i)/u}}t.CategoricalScale=f,f.__name__="CategoricalScale"},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(64),f=T(20),d=T(9),u=T(19),i=(0,v.__importStar)(T(65)),o=T(66);class r extends w.DataRange{constructor(s){super(s),this.have_updated_interactively=!1}initialize(){super.initialize(),this._initial_start=this.start,this._initial_end=this.end,this._initial_range_padding=this.range_padding,this._initial_range_padding_units=this.range_padding_units,this._initial_follow=this.follow,this._initial_follow_interval=this.follow_interval,this._initial_default_span=this.default_span,this._plot_bounds=new Map}get min(){return Math.min(this.start,this.end)}get max(){return Math.max(this.start,this.end)}computed_renderers(){const{renderers:s,names:a}=this,c=(0,d.concat)(this.plots.map(l=>l.data_renderers));return(0,o.compute_renderers)(s.length==0?"auto":s,c,a)}_compute_plot_bounds(s,a){let c=i.empty();for(const l of s){const Q=a.get(l);Q==null||!l.visible&&this.only_visible||(c=i.union(c,Q))}return c}adjust_bounds_for_aspect(s,a){const c=i.empty();let l=s.x1-s.x0;l<=0&&(l=1);let Q=s.y1-s.y0;Q<=0&&(Q=1);const m=.5*(s.x1+s.x0),p=.5*(s.y1+s.y0);return l<a*Q?l=a*Q:Q=l/a,c.x1=m+.5*l,c.x0=m-.5*l,c.y1=p+.5*Q,c.y0=p-.5*Q,c}_compute_min_max(s,a){let c,l,Q=i.empty();for(const[m,p]of s)m.visible&&(Q=i.union(Q,p));return[c,l]=a==0?[Q.x0,Q.x1]:[Q.y0,Q.y1],[c,l]}_compute_range(s,a){const c=this.range_padding;let l,Q;if(this._initial_start!=null&&(s=this._initial_start),this._initial_end!=null&&(a=this._initial_end),this.scale_hint=="log"){let y,g;if((isNaN(s)||!isFinite(s)||s<=0)&&(s=isNaN(a)||!isFinite(a)||a<=0?.1:a/100,u.logger.warn(`could not determine minimum data value for log axis, DataRange1d using value ${s}`)),(isNaN(a)||!isFinite(a)||a<=0)&&(a=isNaN(s)||!isFinite(s)||s<=0?10:100*s,u.logger.warn(`could not determine maximum data value for log axis, DataRange1d using value ${a}`)),a==s)g=this.default_span+.001,y=Math.log(s)/Math.log(10);else{let L,A;this.range_padding_units=="percent"?(L=Math.log(s)/Math.log(10),A=Math.log(a)/Math.log(10),g=(A-L)*(1+c)):(L=Math.log(s-c)/Math.log(10),A=Math.log(a+c)/Math.log(10),g=A-L),y=(L+A)/2}l=10**(y-g/2),Q=10**(y+g/2)}else{let y;y=a==s?this.default_span:this.range_padding_units=="percent"?(a-s)*(1+c):a-s+2*c;const g=(a+s)/2;l=g-y/2,Q=g+y/2}let m=1;this.flipped&&([l,Q]=[Q,l],m=-1);const p=this.follow_interval;return p!=null&&Math.abs(l-Q)>p&&(this.follow=="start"?Q=l+m*p:this.follow=="end"&&(l=Q-m*p)),[l,Q]}update(s,a,c,l){if(this.have_updated_interactively)return;const Q=this.computed_renderers();let m=this._compute_plot_bounds(Q,s);l!=null&&(m=this.adjust_bounds_for_aspect(m,l)),this._plot_bounds.set(c,m);const[p,y]=this._compute_min_max(this._plot_bounds.entries(),a);let[g,L]=this._compute_range(p,y);this._initial_start!=null&&(this.scale_hint=="log"?this._initial_start>0&&(g=this._initial_start):g=this._initial_start),this._initial_end!=null&&(this.scale_hint=="log"?this._initial_end>0&&(L=this._initial_end):L=this._initial_end);let A=!1;this.bounds=="auto"&&(this.setv({bounds:[g,L]},{silent:!0}),A=!0);const[x,H]=[this.start,this.end];if(g!=x||L!=H){const S={};g!=x&&(S.start=g),L!=H&&(S.end=L),this.setv(S),A=!1}A&&this.change.emit()}reset(){this.have_updated_interactively=!1,this.setv({range_padding:this._initial_range_padding,range_padding_units:this._initial_range_padding_units,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span},{silent:!0}),this.change.emit()}}t.DataRange1d=r,b=r,r.__name__="DataRange1d",b.define(({Boolean:e,Number:s,Nullable:a})=>({start:[s],end:[s],range_padding:[s,.1],range_padding_units:[f.PaddingUnits,"percent"],flipped:[e,!1],follow:[a(f.StartEnd),null],follow_interval:[a(s),null],default_span:[s,2],only_visible:[e,!1]})),b.internal(({Enum:e})=>({scale_hint:[e("log","auto"),"auto"]}))},function(T,V,t,k,E){var v;k();const b=T(57);class w extends b.Range{constructor(d){super(d)}}t.DataRange=w,v=w,w.__name__="DataRange",v.define(({String:f,Array:d,AnyRef:u})=>({names:[d(f),[]],renderers:[d(u()),[]]}))},function(T,V,t,k,E){k();const v=T(24),b=T(26),{min:w,max:f}=Math;t.empty=function(){return{x0:1/0,y0:1/0,x1:-1/0,y1:-1/0}},t.positive_x=function(){return{x0:Number.MIN_VALUE,y0:-1/0,x1:1/0,y1:1/0}},t.positive_y=function(){return{x0:-1/0,y0:Number.MIN_VALUE,x1:1/0,y1:1/0}},t.union=function(u,i){return{x0:w(u.x0,i.x0),x1:f(u.x1,i.x1),y0:w(u.y0,i.y0),y1:f(u.y1,i.y1)}};class d{constructor(i){if(i==null)this.x0=0,this.y0=0,this.x1=0,this.y1=0;else if("x0"in i){const{x0:o,y0:r,x1:e,y1:s}=i;if(!(o<=e&&r<=s))throw new Error(`invalid bbox {x0: ${o}, y0: ${r}, x1: ${e}, y1: ${s}}`);this.x0=o,this.y0=r,this.x1=e,this.y1=s}else if("x"in i){const{x:o,y:r,width:e,height:s}=i;if(!(e>=0&&s>=0))throw new Error(`invalid bbox {x: ${o}, y: ${r}, width: ${e}, height: ${s}}`);this.x0=o,this.y0=r,this.x1=o+e,this.y1=r+s}else{let o,r,e,s;if("width"in i)if("left"in i)o=i.left,r=o+i.width;else if("right"in i)r=i.right,o=r-i.width;else{const a=i.width/2;o=i.hcenter-a,r=i.hcenter+a}else o=i.left,r=i.right;if("height"in i)if("top"in i)e=i.top,s=e+i.height;else if("bottom"in i)s=i.bottom,e=s-i.height;else{const a=i.height/2;e=i.vcenter-a,s=i.vcenter+a}else e=i.top,s=i.bottom;if(!(o<=r&&e<=s))throw new Error(`invalid bbox {left: ${o}, top: ${e}, right: ${r}, bottom: ${s}}`);this.x0=o,this.y0=e,this.x1=r,this.y1=s}}static from_rect({left:i,right:o,top:r,bottom:e}){return new d({x0:Math.min(i,o),y0:Math.min(r,e),x1:Math.max(i,o),y1:Math.max(r,e)})}equals(i){return this.x0==i.x0&&this.y0==i.y0&&this.x1==i.x1&&this.y1==i.y1}[b.equals](i,o){return o.eq(this.x0,i.x0)&&o.eq(this.y0,i.y0)&&o.eq(this.x1,i.x1)&&o.eq(this.y1,i.y1)}toString(){return`BBox({left: ${this.left}, top: ${this.top}, width: ${this.width}, height: ${this.height}})`}get left(){return this.x0}get top(){return this.y0}get right(){return this.x1}get bottom(){return this.y1}get p0(){return[this.x0,this.y0]}get p1(){return[this.x1,this.y1]}get x(){return this.x0}get y(){return this.y0}get width(){return this.x1-this.x0}get height(){return this.y1-this.y0}get size(){return{width:this.width,height:this.height}}get rect(){const{x0:i,y0:o,x1:r,y1:e}=this;return{p0:{x:i,y:o},p1:{x:r,y:o},p2:{x:r,y:e},p3:{x:i,y:e}}}get box(){const{x:i,y:o,width:r,height:e}=this;return{x:i,y:o,width:r,height:e}}get h_range(){return{start:this.x0,end:this.x1}}get v_range(){return{start:this.y0,end:this.y1}}get ranges(){return[this.h_range,this.v_range]}get aspect(){return this.width/this.height}get hcenter(){return(this.left+this.right)/2}get vcenter(){return(this.top+this.bottom)/2}get area(){return this.width*this.height}relative(){const{width:i,height:o}=this;return new d({x:0,y:0,width:i,height:o})}translate(i,o){const{x:r,y:e,width:s,height:a}=this;return new d({x:i+r,y:o+e,width:s,height:a})}relativize(i,o){return[i-this.x,o-this.y]}contains(i,o){return this.x0<=i&&i<=this.x1&&this.y0<=o&&o<=this.y1}clip(i,o){return i<this.x0?i=this.x0:i>this.x1&&(i=this.x1),o<this.y0?o=this.y0:o>this.y1&&(o=this.y1),[i,o]}grow_by(i){return new d({left:this.left-i,right:this.right+i,top:this.top-i,bottom:this.bottom+i})}shrink_by(i){return new d({left:this.left+i,right:this.right-i,top:this.top+i,bottom:this.bottom-i})}union(i){return new d({x0:w(this.x0,i.x0),y0:w(this.y0,i.y0),x1:f(this.x1,i.x1),y1:f(this.y1,i.y1)})}intersection(i){return this.intersects(i)?new d({x0:f(this.x0,i.x0),y0:f(this.y0,i.y0),x1:w(this.x1,i.x1),y1:w(this.y1,i.y1)}):null}intersects(i){return!(i.x1<this.x0||i.x0>this.x1||i.y1<this.y0||i.y0>this.y1)}get xview(){return{compute:i=>this.left+i,v_compute:i=>{const o=new v.ScreenArray(i.length),r=this.left;for(let e=0;e<i.length;e++)o[e]=r+i[e];return o}}}get yview(){return{compute:i=>this.bottom-i,v_compute:i=>{const o=new v.ScreenArray(i.length),r=this.bottom;for(let e=0;e<i.length;e++)o[e]=r-i[e];return o}}}}t.BBox=d,d.__name__="BBox"},function(T,V,t,k,E){k();const v=T(9);t.compute_renderers=function(b,w,f){if(b==null)return[];let d=b=="auto"?w:b;return f.length>0&&(d=d.filter(u=>(0,v.includes)(f,u.name))),d}},function(T,V,t,k,E){var v;k();const b=T(57),w=T(20),f=T(21),d=T(24),u=T(9),i=T(8),o=T(11);function r(c,l,Q=0){const m=new Map;for(let p=0;p<c.length;p++){const y=c[p];if(m.has(y))throw new Error(`duplicate factor or subfactor: ${y}`);m.set(y,{value:.5+p*(1+l)+Q})}return[m,(c.length-1)*l]}function e(c,l,Q,m=0){var p;const y=new Map,g=new Map;for(const[x,H]of c){const S=(p=g.get(x))!==null&&p!==void 0?p:[];g.set(x,[...S,H])}let L=m,A=0;for(const[x,H]of g){const S=H.length,[M,C]=r(H,Q,L);A+=C;const R=(0,u.sum)(H.map(D=>M.get(D).value));y.set(x,{value:R/S,mapping:M}),L+=S+l+C}return[y,(g.size-1)*l+A]}function s(c,l,Q,m,p=0){var y;const g=new Map,L=new Map;for(const[H,S,M]of c){const C=(y=L.get(H))!==null&&y!==void 0?y:[];L.set(H,[...C,[S,M]])}let A=p,x=0;for(const[H,S]of L){const M=S.length,[C,R]=e(S,Q,m,A);x+=R;const D=(0,u.sum)(S.map(([B])=>C.get(B).value));g.set(H,{value:D/M,mapping:C}),A+=M+l+R}return[g,(L.size-1)*l+x]}t.Factor=(0,f.Or)(f.String,(0,f.Tuple)(f.String,f.String),(0,f.Tuple)(f.String,f.String,f.String)),t.FactorSeq=(0,f.Or)((0,f.Array)(f.String),(0,f.Array)((0,f.Tuple)(f.String,f.String)),(0,f.Array)((0,f.Tuple)(f.String,f.String,f.String))),t.map_one_level=r,t.map_two_levels=e,t.map_three_levels=s;class a extends b.Range{constructor(l){super(l)}get min(){return this.start}get max(){return this.end}initialize(){super.initialize(),this._init(!0)}connect_signals(){super.connect_signals(),this.connect(this.properties.factors.change,()=>this.reset()),this.connect(this.properties.factor_padding.change,()=>this.reset()),this.connect(this.properties.group_padding.change,()=>this.reset()),this.connect(this.properties.subgroup_padding.change,()=>this.reset()),this.connect(this.properties.range_padding.change,()=>this.reset()),this.connect(this.properties.range_padding_units.change,()=>this.reset())}reset(){this._init(!1),this.change.emit()}_lookup(l){switch(l.length){case 1:{const[Q]=l,m=this._mapping.get(Q);return m!=null?m.value:NaN}case 2:{const[Q,m]=l,p=this._mapping.get(Q);if(p!=null){const y=p.mapping.get(m);if(y!=null)return y.value}return NaN}case 3:{const[Q,m,p]=l,y=this._mapping.get(Q);if(y!=null){const g=y.mapping.get(m);if(g!=null){const L=g.mapping.get(p);if(L!=null)return L.value}}return NaN}default:(0,o.unreachable)()}}synthetic(l){if((0,i.isNumber)(l))return l;if((0,i.isString)(l))return this._lookup([l]);let Q=0;const m=l[l.length-1];return(0,i.isNumber)(m)&&(Q=m,l=l.slice(0,-1)),this._lookup(l)+Q}v_synthetic(l){const Q=l.length,m=new d.ScreenArray(Q);for(let p=0;p<Q;p++)m[p]=this.synthetic(l[p]);return m}_init(l){const{levels:Q,mapping:m,tops:p,mids:y,inside_padding:g}=(()=>{if((0,u.every)(this.factors,i.isString)){const x=this.factors,[H,S]=r(x,this.factor_padding);return{levels:1,mapping:H,tops:null,mids:null,inside_padding:S}}if((0,u.every)(this.factors,x=>(0,i.isArray)(x)&&x.length==2&&(0,i.isString)(x[0])&&(0,i.isString)(x[1]))){const x=this.factors,[H,S]=e(x,this.group_padding,this.factor_padding),M=[...H.keys()];return{levels:2,mapping:H,tops:M,mids:null,inside_padding:S}}if((0,u.every)(this.factors,x=>(0,i.isArray)(x)&&x.length==3&&(0,i.isString)(x[0])&&(0,i.isString)(x[1])&&(0,i.isString)(x[2]))){const x=this.factors,[H,S]=s(x,this.group_padding,this.subgroup_padding,this.factor_padding),M=[...H.keys()],C=[];for(const[R,D]of H)for(const B of D.mapping.keys())C.push([R,B]);return{levels:3,mapping:H,tops:M,mids:C,inside_padding:S}}(0,o.unreachable)()})();this._mapping=m,this.tops=p,this.mids=y;let L=0,A=this.factors.length+g;if(this.range_padding_units=="percent"){const x=(A-L)*this.range_padding/2;L-=x,A+=x}else L-=this.range_padding,A+=this.range_padding;this.setv({start:L,end:A,levels:Q},{silent:l}),this.bounds=="auto"&&this.setv({bounds:[L,A]},{silent:!0})}}t.FactorRange=a,v=a,a.__name__="FactorRange",v.define(({Number:c})=>({factors:[t.FactorSeq,[]],factor_padding:[c,0],subgroup_padding:[c,.8],group_padding:[c,1.4],range_padding:[c,0],range_padding_units:[w.PaddingUnits,"percent"],start:[c],end:[c]})),v.internal(({Number:c,String:l,Array:Q,Tuple:m,Nullable:p})=>({levels:[c],mids:[p(Q(m(l,l))),null],tops:[p(Q(l)),null]}))},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(69),f=T(112),d=T(48),u=T(20),i=T(24),o=T(113),r=(0,v.__importStar)(T(18)),e=T(10);class s extends w.DataAnnotationView{async lazy_initialize(){await super.lazy_initialize();const{start:l,end:Q}=this.model;l!=null&&(this.start=await(0,o.build_view)(l,{parent:this})),Q!=null&&(this.end=await(0,o.build_view)(Q,{parent:this}))}set_data(l){var Q,m;super.set_data(l),(Q=this.start)===null||Q===void 0||Q.set_data(l),(m=this.end)===null||m===void 0||m.set_data(l)}remove(){var l,Q;(l=this.start)===null||l===void 0||l.remove(),(Q=this.end)===null||Q===void 0||Q.remove(),super.remove()}map_data(){const{frame:l}=this.plot_view;this.model.start_units=="data"?(this._sx_start=this.coordinates.x_scale.v_compute(this._x_start),this._sy_start=this.coordinates.y_scale.v_compute(this._y_start)):(this._sx_start=l.bbox.xview.v_compute(this._x_start),this._sy_start=l.bbox.yview.v_compute(this._y_start)),this.model.end_units=="data"?(this._sx_end=this.coordinates.x_scale.v_compute(this._x_end),this._sy_end=this.coordinates.y_scale.v_compute(this._y_end)):(this._sx_end=l.bbox.xview.v_compute(this._x_end),this._sy_end=l.bbox.yview.v_compute(this._y_end));const{_sx_start:Q,_sy_start:m,_sx_end:p,_sy_end:y}=this,g=Q.length,L=this._angles=new i.ScreenArray(g);for(let A=0;A<g;A++)L[A]=Math.PI/2+(0,e.atan2)([Q[A],m[A]],[p[A],y[A]])}paint(l){const{start:Q,end:m}=this,{_sx_start:p,_sy_start:y,_sx_end:g,_sy_end:L,_angles:A}=this,{x,y:H,width:S,height:M}=this.plot_view.frame.bbox;for(let C=0,R=p.length;C<R;C++)m!=null&&(l.save(),l.translate(g[C],L[C]),l.rotate(A[C]),m.render(l,C),l.restore()),Q!=null&&(l.save(),l.translate(p[C],y[C]),l.rotate(A[C]+Math.PI),Q.render(l,C),l.restore()),this.visuals.line.doit&&(l.save(),Q==null&&m==null||(l.beginPath(),l.rect(x,H,S,M),m!=null&&(l.save(),l.translate(g[C],L[C]),l.rotate(A[C]),m.clip(l,C),l.restore()),Q!=null&&(l.save(),l.translate(p[C],y[C]),l.rotate(A[C]+Math.PI),Q.clip(l,C),l.restore()),l.closePath(),l.clip()),this.visuals.line.set_vectorize(l,C),l.beginPath(),l.moveTo(p[C],y[C]),l.lineTo(g[C],L[C]),l.stroke(),l.restore())}}t.ArrowView=s,s.__name__="ArrowView";class a extends w.DataAnnotation{constructor(l){super(l)}}t.Arrow=a,b=a,a.__name__="Arrow",b.prototype.default_view=s,b.mixins(d.LineVector),b.define(({Ref:c,Nullable:l})=>({x_start:[r.XCoordinateSpec,{field:"x_start"}],y_start:[r.YCoordinateSpec,{field:"y_start"}],start_units:[u.SpatialUnits,"data"],start:[l(c(f.ArrowHead)),null],x_end:[r.XCoordinateSpec,{field:"x_end"}],y_end:[r.YCoordinateSpec,{field:"y_end"}],end_units:[u.SpatialUnits,"data"],end:[l(c(f.ArrowHead)),()=>new f.OpenHead]}))},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(40),f=T(70),d=T(75),u=T(78),i=(0,v.__importStar)(T(18));class o extends w.AnnotationView{constructor(){super(...arguments),this._initial_set_data=!1}connect_signals(){super.connect_signals();const s=()=>{this.set_data(this.model.source),this._rerender()};this.connect(this.model.change,s),this.connect(this.model.source.streaming,s),this.connect(this.model.source.patching,s),this.connect(this.model.source.change,s)}_rerender(){this.request_render()}set_data(s){const a=this;for(const c of this.model)if(c instanceof i.VectorSpec||c instanceof i.ScalarSpec)if(c instanceof i.BaseCoordinateSpec){const l=c.array(s);a[`_${c.attr}`]=l}else{const l=c.uniform(s);a[`${c.attr}`]=l}this.plot_model.use_map&&(a._x!=null&&u.inplace.project_xy(a._x,a._y),a._xs!=null&&u.inplace.project_xsys(a._xs,a._ys));for(const c of this.visuals)c.update()}_render(){this._initial_set_data||(this.set_data(this.model.source),this._initial_set_data=!0),this.map_data(),this.paint(this.layer.ctx)}}t.DataAnnotationView=o,o.__name__="DataAnnotationView";class r extends w.Annotation{constructor(s){super(s)}}t.DataAnnotation=r,b=r,r.__name__="DataAnnotation",b.define(({Ref:e})=>({source:[e(f.ColumnarDataSource),()=>new d.ColumnDataSource]}))},function(T,V,t,k,E){var v;k();const b=T(71),w=T(15),f=T(19),d=T(73),u=T(8),i=T(9),o=T(13),r=T(72),e=T(74),s=T(29);class a extends b.DataSource{constructor(l){super(l),this.selection_manager=new d.SelectionManager(this)}get_array(l){let Q=this.data[l];return Q==null?this.data[l]=Q=[]:(0,u.isArray)(Q)||(this.data[l]=Q=Array.from(Q)),Q}initialize(){super.initialize(),this._select=new w.Signal0(this,"select"),this.inspect=new w.Signal(this,"inspect"),this.streaming=new w.Signal0(this,"streaming"),this.patching=new w.Signal(this,"patching")}get_column(l){return this.data[l]??null}columns(){return(0,o.keys)(this.data)}get_length(l=!0){const Q=(0,i.uniq)((0,o.values)(this.data).map(m=>(0,s.is_NDArray)(m)?m.shape[0]:m.length));switch(Q.length){case 0:return null;case 1:return Q[0];default:{const m="data source has columns of inconsistent lengths";if(l)return f.logger.warn(m),Q.sort()[0];throw new Error(m)}}}get length(){var l;return(l=this.get_length())!==null&&l!==void 0?l:0}clear(){const l={};for(const Q of this.columns())l[Q]=new this.data[Q].constructor(0);this.data=l}}t.ColumnarDataSource=a,v=a,a.__name__="ColumnarDataSource",v.define(({Ref:c})=>({selection_policy:[c(e.SelectionPolicy),()=>new e.UnionRenderers]})),v.internal(({AnyRef:c})=>({inspected:[c(),()=>new r.Selection]}))},function(T,V,t,k,E){var v;k();const b=T(53),w=T(72);class f extends b.Model{constructor(u){super(u)}}t.DataSource=f,v=f,f.__name__="DataSource",v.define(({Ref:d})=>({selected:[d(w.Selection),()=>new w.Selection]}))},function(T,V,t,k,E){var v;k();const b=T(53),w=T(9),f=T(13);class d extends b.Model{constructor(i){super(i)}get_view(){return this.view}get selected_glyph(){return this.selected_glyphs.length>0?this.selected_glyphs[0]:null}add_to_selected_glyphs(i){this.selected_glyphs.push(i)}update(i,o=!0,r="replace"){switch(r){case"replace":this.indices=i.indices,this.line_indices=i.line_indices,this.multiline_indices=i.multiline_indices,this.image_indices=i.image_indices,this.view=i.view,this.selected_glyphs=i.selected_glyphs;break;case"append":this.update_through_union(i);break;case"intersect":this.update_through_intersection(i);break;case"subtract":this.update_through_subtraction(i)}}clear(){this.indices=[],this.line_indices=[],this.multiline_indices={},this.image_indices=[],this.view=null,this.selected_glyphs=[]}map(i){return new d(Object.assign(Object.assign({},this.attributes),{indices:this.indices.map(i),multiline_indices:(0,f.to_object)((0,f.entries)(this.multiline_indices).map(([o,r])=>[i(Number(o)),r])),image_indices:this.image_indices.map(o=>Object.assign(Object.assign({},o),{index:i(o.index)}))}))}is_empty(){return this.indices.length==0&&this.line_indices.length==0&&this.image_indices.length==0}update_through_union(i){this.indices=(0,w.union)(this.indices,i.indices),this.selected_glyphs=(0,w.union)(i.selected_glyphs,this.selected_glyphs),this.line_indices=(0,w.union)(i.line_indices,this.line_indices),this.view=i.view,this.multiline_indices=(0,f.merge)(i.multiline_indices,this.multiline_indices)}update_through_intersection(i){this.indices=(0,w.intersection)(this.indices,i.indices),this.selected_glyphs=(0,w.union)(i.selected_glyphs,this.selected_glyphs),this.line_indices=(0,w.union)(i.line_indices,this.line_indices),this.view=i.view,this.multiline_indices=(0,f.merge)(i.multiline_indices,this.multiline_indices)}update_through_subtraction(i){this.indices=(0,w.difference)(this.indices,i.indices),this.selected_glyphs=(0,w.union)(i.selected_glyphs,this.selected_glyphs),this.line_indices=(0,w.union)(i.line_indices,this.line_indices),this.view=i.view,this.multiline_indices=(0,f.merge)(i.multiline_indices,this.multiline_indices)}}t.Selection=d,v=d,d.__name__="Selection",v.define(({Int:u,Array:i,Dict:o})=>({indices:[i(u),[]],line_indices:[i(u),[]],multiline_indices:[o(i(u)),{}]})),v.internal(({Int:u,Array:i,AnyRef:o,Struct:r,Nullable:e})=>({selected_glyphs:[i(o()),[]],view:[e(o()),null],image_indices:[i(r({index:u,dim1:u,dim2:u,flat_index:u})),[]]}))},function(T,V,t,k,E){k();const v=T(72);function b(d){return d.model.type=="GlyphRenderer"}function w(d){return d.model.type=="GraphRenderer"}class f{constructor(u){this.source=u,this.inspectors=new Map}select(u,i,o,r="replace"){const e=[],s=[];for(const c of u)b(c)?e.push(c):w(c)&&s.push(c);let a=!1;for(const c of s){const l=c.model.selection_policy.hit_test(i,c);a=a||c.model.selection_policy.do_selection(l,c.model,o,r)}if(e.length>0){const c=this.source.selection_policy.hit_test(i,e);a=a||this.source.selection_policy.do_selection(c,this.source,o,r)}return a}inspect(u,i){let o=!1;if(b(u)){const r=u.hit_test(i);if(r!=null){o=!r.is_empty();const e=this.get_or_create_inspector(u.model);e.update(r,!0,"replace"),this.source.setv({inspected:e},{silent:!0}),this.source.inspect.emit([u.model,{geometry:i}])}}else if(w(u)){const r=u.model.inspection_policy.hit_test(i,u);o=o||u.model.inspection_policy.do_inspection(r,i,u,!1,"replace")}return o}clear(u){this.source.selected.clear(),u!=null&&this.get_or_create_inspector(u.model).clear()}get_or_create_inspector(u){let i=this.inspectors.get(u);return i==null&&(i=new v.Selection,this.inspectors.set(u,i)),i}}t.SelectionManager=f,f.__name__="SelectionManager"},function(T,V,t,k,E){k();const v=T(53);class b extends v.Model{do_selection(u,i,o,r){return u!=null&&(i.selected.update(u,o,r),i._select.emit(),!i.selected.is_empty())}}t.SelectionPolicy=b,b.__name__="SelectionPolicy";class w extends b{hit_test(u,i){const o=[];for(const r of i){const e=r.hit_test(u);e!=null&&o.push(e)}if(o.length>0){const r=o[0];for(const e of o)r.update_through_intersection(e);return r}return null}}t.IntersectRenderers=w,w.__name__="IntersectRenderers";class f extends b{hit_test(u,i){const o=[];for(const r of i){const e=r.hit_test(u);e!=null&&o.push(e)}if(o.length>0){const r=o[0];for(const e of o)r.update_through_union(e);return r}return null}}t.UnionRenderers=f,f.__name__="UnionRenderers"},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(70),f=T(8),d=T(13),u=(0,v.__importStar)(T(76)),i=T(77),o=T(35);function r(c,l,Q){if((0,f.isArray)(c)){const m=c.concat(l);return Q!=null&&m.length>Q?m.slice(-Q):m}if((0,f.isTypedArray)(c)){const m=c.length+l.length;if(Q!=null&&m>Q){const p=m-Q,y=c.length;let g;c.length<Q?(g=new c.constructor(Q),g.set(c,0)):g=c;for(let L=p,A=y;L<A;L++)g[L-p]=g[L];for(let L=0,A=l.length;L<A;L++)g[L+(y-p)]=l[L];return g}{const p=new c.constructor(l);return u.concat(c,p)}}throw new Error("unsupported array types")}function e(c,l){let Q,m,p;return(0,f.isNumber)(c)?(Q=c,p=c+1,m=1):(Q=c.start!=null?c.start:0,p=c.stop!=null?c.stop:l,m=c.step!=null?c.step:1),[Q,p,m]}function s(c,l){const Q=new Set;let m=!1;for(const[p,y]of l){let g,L,A,x;if((0,f.isArray)(p)){const[z]=p;Q.add(z),g=c[z].shape,L=c[z],x=y,p.length===2?(g=[1,g[0]],A=[p[0],0,p[1]]):A=p}else(0,f.isNumber)(p)?(x=[y],Q.add(p)):(x=y,m=!0),A=[0,0,p],g=[1,c.length],L=c;let H=0;const[S,M,C]=e(A[1],g[0]),[R,D,B]=e(A[2],g[1]);for(let z=S;z<M;z+=C)for(let N=R;N<D;N+=B)m&&Q.add(N),L[z*g[1]+N]=x[H],H++}return Q}t.stream_to_column=r,t.slice=e,t.patch_to_column=s;class a extends w.ColumnarDataSource{constructor(l){super(l)}stream(l,Q,m){const{data:p}=this;for(const[y,g]of(0,d.entries)(l))p[y]=r(p[y],g,Q);if(this.setv({data:p},{silent:!0}),this.streaming.emit(),this.document!=null){const y=new o.ColumnsStreamedEvent(this.document,this.ref(),l,Q);this.document._notify_change(this,"data",null,null,{setter_id:m,hint:y})}}patch(l,Q){const{data:m}=this;let p=new Set;for(const[y,g]of(0,d.entries)(l))p=(0,i.union)(p,s(m[y],g));if(this.setv({data:m},{silent:!0}),this.patching.emit([...p]),this.document!=null){const y=new o.ColumnsPatchedEvent(this.document,this.ref(),l);this.document._notify_change(this,"data",null,null,{setter_id:Q,hint:y})}}}t.ColumnDataSource=a,b=a,a.__name__="ColumnDataSource",b.define(({Dict:c,Any:l})=>({data:[c(l),{}]}))},function(T,V,t,k,E){k(),t.concat=function(v,...b){let w=v.length;for(const u of b)w+=u.length;const f=new v.constructor(w);f.set(v,0);let d=v.length;for(const u of b)f.set(u,d),d+=u.length;return f}},function(T,V,t,k,E){function v(...b){const w=new Set;for(const f of b)for(const d of f)w.add(d);return w}k(),t.union=v,t.intersection=function(b,...w){const f=new Set;t:for(const d of b){for(const u of w)if(!u.has(d))continue t;f.add(d)}return f},t.difference=function(b,...w){const f=new Set(b);for(const d of v(...w))f.delete(d);return f}},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importDefault)(T(79)),w=(0,v.__importDefault)(T(80)),f=T(24),d=new w.default("GOOGLE"),u=new w.default("WGS84"),i=(0,b.default)(u,d);t.wgs84_mercator={compute:(c,l)=>isFinite(c)&&isFinite(l)?i.forward([c,l]):[NaN,NaN],invert:(c,l)=>isFinite(c)&&isFinite(l)?i.inverse([c,l]):[NaN,NaN]};const o={lon:[-2002637639e-2,2002637639e-2],lat:[-200489661e-1,200489661e-1]},r={lon:[-180,180],lat:[-85.06,85.06]},{min:e,max:s}=Math;function a(c,l){const Q=e(c.length,l.length),m=(0,f.infer_type)(c,l),p=new m(Q),y=new m(Q);return t.inplace.project_xy(c,l,p,y),[p,y]}t.clip_mercator=function(c,l,Q){const[m,p]=o[Q];return[s(c,m),e(l,p)]},t.in_bounds=function(c,l){const[Q,m]=r[l];return Q<c&&c<m},(function(c){function l(Q,m,p,y){const g=e(Q.length,m.length);p=p??Q,y=y??m;for(let L=0;L<g;L++){const A=Q[L],x=m[L],[H,S]=t.wgs84_mercator.compute(A,x);p[L]=H,y[L]=S}}c.project_xy=l,c.project_xsys=function(Q,m,p,y){const g=e(Q.length,m.length);p=p??Q,y=y??m;for(let L=0;L<g;L++)l(Q[L],m[L],p[L],y[L])}})(t.inplace||(t.inplace={})),t.project_xy=a,t.project_xsys=function(c,l){const Q=e(c.length,l.length),m=new Array(Q),p=new Array(Q);for(let y=0;y<Q;y++){const[g,L]=a(c[y],l[y]);m[y]=g,p[y]=L}return[m,p]}},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importDefault)(T(80)),w=(0,v.__importDefault)(T(106));var f=(0,b.default)("WGS84");function d(i,o,r,e){var s,a,c;return Array.isArray(r)?(s=(0,w.default)(i,o,r,e)||{x:NaN,y:NaN},r.length>2?i.name!==void 0&&i.name==="geocent"||o.name!==void 0&&o.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(r.splice(3)):[s.x,s.y,r[2]].concat(r.splice(3)):[s.x,s.y].concat(r.splice(2)):[s.x,s.y]):(a=(0,w.default)(i,o,r,e),(c=Object.keys(r)).length===2||c.forEach(function(l){if(i.name!==void 0&&i.name==="geocent"||o.name!==void 0&&o.name==="geocent"){if(l==="x"||l==="y"||l==="z")return}else if(l==="x"||l==="y")return;a[l]=r[l]}),a)}function u(i){return i instanceof b.default?i:i.oProj?i.oProj:(0,b.default)(i)}t.default=function(i,o,r){i=u(i);var e,s=!1;return o===void 0?(o=i,i=f,s=!0):(o.x!==void 0||Array.isArray(o))&&(r=o,o=i,i=f,s=!0),o=u(o),r?d(i,o,r):(e={forward:function(a,c){return d(i,o,a,c)},inverse:function(a,c){return d(o,i,a,c)}},s&&(e.oProj=o),e)}},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importDefault)(T(81)),w=(0,v.__importDefault)(T(92)),f=(0,v.__importDefault)(T(93)),d=T(101),u=(0,v.__importDefault)(T(103)),i=(0,v.__importDefault)(T(104)),o=(0,v.__importDefault)(T(88)),r=T(105);function e(s,a){if(!(this instanceof e))return new e(s);a=a||function(L){if(L)throw L};var c=(0,b.default)(s);if(typeof c=="object"){var l=e.projections.get(c.projName);if(l){if(c.datumCode&&c.datumCode!=="none"){var Q=(0,o.default)(u.default,c.datumCode);Q&&(c.datum_params=c.datum_params||(Q.towgs84?Q.towgs84.split(","):null),c.ellps=Q.ellipse,c.datumName=Q.datumName?Q.datumName:c.datumCode)}c.k0=c.k0||1,c.axis=c.axis||"enu",c.ellps=c.ellps||"wgs84",c.lat1=c.lat1||c.lat0;var m=(0,d.sphere)(c.a,c.b,c.rf,c.ellps,c.sphere),p=(0,d.eccentricity)(m.a,m.b,m.rf,c.R_A),y=(0,r.getNadgrids)(c.nadgrids),g=c.datum||(0,i.default)(c.datumCode,c.datum_params,m.a,m.b,p.es,p.ep2,y);(0,w.default)(this,c),(0,w.default)(this,l),this.a=m.a,this.b=m.b,this.rf=m.rf,this.sphere=m.sphere,this.es=p.es,this.e=p.e,this.ep2=p.ep2,this.datum=g,this.init(),a(null,this)}else a(s)}else a(s)}e.projections=f.default,e.projections.start(),t.default=e},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importDefault)(T(82)),w=(0,v.__importDefault)(T(89)),f=(0,v.__importDefault)(T(84)),d=(0,v.__importDefault)(T(88));var u=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],i=["3857","900913","3785","102113"];t.default=function(o){if(!(function(s){return typeof s=="string"})(o))return o;if((function(s){return s in b.default})(o))return b.default[o];if((function(s){return u.some(function(a){return s.indexOf(a)>-1})})(o)){var r=(0,w.default)(o);if((function(s){var a=(0,d.default)(s,"authority");if(a){var c=(0,d.default)(a,"epsg");return c&&i.indexOf(c)>-1}})(r))return b.default["EPSG:3857"];var e=(function(s){var a=(0,d.default)(s,"extension");if(a)return(0,d.default)(a,"proj4")})(r);return e?(0,f.default)(e):r}return(function(s){return s[0]==="+"})(o)?(0,f.default)(o):void 0}},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importDefault)(T(83)),w=(0,v.__importDefault)(T(84)),f=(0,v.__importDefault)(T(89));function d(u){var i=this;if(arguments.length===2){var o=arguments[1];typeof o=="string"?o.charAt(0)==="+"?d[u]=(0,w.default)(arguments[1]):d[u]=(0,f.default)(arguments[1]):d[u]=o}else if(arguments.length===1){if(Array.isArray(u))return u.map(function(r){Array.isArray(r)?d.apply(i,r):d(r)});if(typeof u=="string"){if(u in d)return d[u]}else"EPSG"in u?d["EPSG:"+u.EPSG]=u:"ESRI"in u?d["ESRI:"+u.ESRI]=u:"IAU2000"in u?d["IAU2000:"+u.IAU2000]=u:console.log(u);return}}(0,b.default)(d),t.default=d},function(T,V,t,k,E){k(),t.default=function(v){v("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),v("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),v("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),v.WGS84=v["EPSG:4326"],v["EPSG:3785"]=v["EPSG:3857"],v.GOOGLE=v["EPSG:3857"],v["EPSG:900913"]=v["EPSG:3857"],v["EPSG:102113"]=v["EPSG:3857"]}},function(T,V,t,k,E){k();const v=T(1),b=T(85),w=(0,v.__importDefault)(T(86)),f=(0,v.__importDefault)(T(87)),d=(0,v.__importDefault)(T(88));t.default=function(u){var i,o,r,e={},s=u.split("+").map(function(c){return c.trim()}).filter(function(c){return c}).reduce(function(c,l){var Q=l.split("=");return Q.push(!0),c[Q[0].toLowerCase()]=Q[1],c},{}),a={proj:"projName",datum:"datumCode",rf:function(c){e.rf=parseFloat(c)},lat_0:function(c){e.lat0=c*b.D2R},lat_1:function(c){e.lat1=c*b.D2R},lat_2:function(c){e.lat2=c*b.D2R},lat_ts:function(c){e.lat_ts=c*b.D2R},lon_0:function(c){e.long0=c*b.D2R},lon_1:function(c){e.long1=c*b.D2R},lon_2:function(c){e.long2=c*b.D2R},alpha:function(c){e.alpha=parseFloat(c)*b.D2R},gamma:function(c){e.rectified_grid_angle=parseFloat(c)},lonc:function(c){e.longc=c*b.D2R},x_0:function(c){e.x0=parseFloat(c)},y_0:function(c){e.y0=parseFloat(c)},k_0:function(c){e.k0=parseFloat(c)},k:function(c){e.k0=parseFloat(c)},a:function(c){e.a=parseFloat(c)},b:function(c){e.b=parseFloat(c)},r_a:function(){e.R_A=!0},zone:function(c){e.zone=parseInt(c,10)},south:function(){e.utmSouth=!0},towgs84:function(c){e.datum_params=c.split(",").map(function(l){return parseFloat(l)})},to_meter:function(c){e.to_meter=parseFloat(c)},units:function(c){e.units=c;var l=(0,d.default)(f.default,c);l&&(e.to_meter=l.to_meter)},from_greenwich:function(c){e.from_greenwich=c*b.D2R},pm:function(c){var l=(0,d.default)(w.default,c);e.from_greenwich=(l||parseFloat(c))*b.D2R},nadgrids:function(c){c==="@null"?e.datumCode="none":e.nadgrids=c},axis:function(c){var l="ewnsud";c.length===3&&l.indexOf(c.substr(0,1))!==-1&&l.indexOf(c.substr(1,1))!==-1&&l.indexOf(c.substr(2,1))!==-1&&(e.axis=c)},approx:function(){e.approx=!0}};for(i in s)o=s[i],i in a?typeof(r=a[i])=="function"?r(o):e[r]=o:e[i]=o;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e}},function(T,V,t,k,E){k(),t.PJD_3PARAM=1,t.PJD_7PARAM=2,t.PJD_GRIDSHIFT=3,t.PJD_WGS84=4,t.PJD_NODATUM=5,t.SRS_WGS84_SEMIMAJOR=6378137,t.SRS_WGS84_SEMIMINOR=6356752314e-3,t.SRS_WGS84_ESQUARED=.0066943799901413165,t.SEC_TO_RAD=484813681109536e-20,t.HALF_PI=Math.PI/2,t.SIXTH=.16666666666666666,t.RA4=.04722222222222222,t.RA6=.022156084656084655,t.EPSLN=1e-10,t.D2R=.017453292519943295,t.R2D=57.29577951308232,t.FORTPI=Math.PI/4,t.TWO_PI=2*Math.PI,t.SPI=3.14159265359},function(T,V,t,k,E){k();var v={};t.default=v,v.greenwich=0,v.lisbon=-9.131906111111,v.paris=2.337229166667,v.bogota=-74.080916666667,v.madrid=-3.687938888889,v.rome=12.452333333333,v.bern=7.439583333333,v.jakarta=106.807719444444,v.ferro=-17.666666666667,v.brussels=4.367975,v.stockholm=18.058277777778,v.athens=23.7163375,v.oslo=10.722916666667},function(T,V,t,k,E){k(),t.default={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}}},function(T,V,t,k,E){k();var v=/[\s_\-\/\(\)]/g;t.default=function(b,w){if(b[w])return b[w];for(var f,d=Object.keys(b),u=w.toLowerCase().replace(v,""),i=-1;++i<d.length;)if((f=d[i]).toLowerCase().replace(v,"")===u)return b[f]}},function(T,V,t,k,E){k();const v=(0,T(1).__importDefault)(T(90)),b=T(91);function w(f){return .017453292519943295*f}t.default=function(f){var d=(0,v.default)(f),u=d.shift(),i=d.shift();d.unshift(["name",i]),d.unshift(["type",u]);var o={};return(0,b.sExpr)(d,o),(function(r){if(r.type==="GEOGCS"?r.projName="longlat":r.type==="LOCAL_CS"?(r.projName="identity",r.local=!0):typeof r.PROJECTION=="object"?r.projName=Object.keys(r.PROJECTION)[0]:r.projName=r.PROJECTION,r.AXIS){for(var e="",s=0,a=r.AXIS.length;s<a;++s){var c=[r.AXIS[s][0].toLowerCase(),r.AXIS[s][1].toLowerCase()];c[0].indexOf("north")!==-1||(c[0]==="y"||c[0]==="lat")&&c[1]==="north"?e+="n":c[0].indexOf("south")!==-1||(c[0]==="y"||c[0]==="lat")&&c[1]==="south"?e+="s":c[0].indexOf("east")!==-1||(c[0]==="x"||c[0]==="lon")&&c[1]==="east"?e+="e":c[0].indexOf("west")===-1&&(c[0]!=="x"&&c[0]!=="lon"||c[1]!=="west")||(e+="w")}e.length===2&&(e+="u"),e.length===3&&(r.axis=e)}r.UNIT&&(r.units=r.UNIT.name.toLowerCase(),r.units==="metre"&&(r.units="meter"),r.UNIT.convert&&(r.type==="GEOGCS"?r.DATUM&&r.DATUM.SPHEROID&&(r.to_meter=r.UNIT.convert*r.DATUM.SPHEROID.a):r.to_meter=r.UNIT.convert));var l=r.GEOGCS;function Q(m){return m*(r.to_meter||1)}r.type==="GEOGCS"&&(l=r),l&&(l.DATUM?r.datumCode=l.DATUM.name.toLowerCase():r.datumCode=l.name.toLowerCase(),r.datumCode.slice(0,2)==="d_"&&(r.datumCode=r.datumCode.slice(2)),r.datumCode!=="new_zealand_geodetic_datum_1949"&&r.datumCode!=="new_zealand_1949"||(r.datumCode="nzgd49"),r.datumCode!=="wgs_1984"&&r.datumCode!=="world_geodetic_system_1984"||(r.PROJECTION==="Mercator_Auxiliary_Sphere"&&(r.sphere=!0),r.datumCode="wgs84"),r.datumCode.slice(-6)==="_ferro"&&(r.datumCode=r.datumCode.slice(0,-6)),r.datumCode.slice(-8)==="_jakarta"&&(r.datumCode=r.datumCode.slice(0,-8)),~r.datumCode.indexOf("belge")&&(r.datumCode="rnb72"),l.DATUM&&l.DATUM.SPHEROID&&(r.ellps=l.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),r.ellps.toLowerCase().slice(0,13)==="international"&&(r.ellps="intl"),r.a=l.DATUM.SPHEROID.a,r.rf=parseFloat(l.DATUM.SPHEROID.rf,10)),l.DATUM&&l.DATUM.TOWGS84&&(r.datum_params=l.DATUM.TOWGS84),~r.datumCode.indexOf("osgb_1936")&&(r.datumCode="osgb36"),~r.datumCode.indexOf("osni_1952")&&(r.datumCode="osni52"),(~r.datumCode.indexOf("tm65")||~r.datumCode.indexOf("geodetic_datum_of_1965"))&&(r.datumCode="ire65"),r.datumCode==="ch1903+"&&(r.datumCode="ch1903"),~r.datumCode.indexOf("israel")&&(r.datumCode="isr93")),r.b&&!isFinite(r.b)&&(r.b=r.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",w],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",w],["x0","false_easting",Q],["y0","false_northing",Q],["long0","central_meridian",w],["lat0","latitude_of_origin",w],["lat0","standard_parallel_1",w],["lat1","standard_parallel_1",w],["lat2","standard_parallel_2",w],["azimuth","Azimuth"],["alpha","azimuth",w],["srsCode","name"]].forEach(function(m){return p=r,g=(y=m)[0],L=y[1],void(!(g in p)&&L in p&&(p[g]=p[L],y.length===3&&(p[g]=y[2](p[g]))));var p,y,g,L}),r.long0||!r.longc||r.projName!=="Albers_Conic_Equal_Area"&&r.projName!=="Lambert_Azimuthal_Equal_Area"||(r.long0=r.longc),r.lat_ts||!r.lat1||r.projName!=="Stereographic_South_Pole"&&r.projName!=="Polar Stereographic (variant B)"||(r.lat0=w(r.lat1>0?90:-90),r.lat_ts=r.lat1)})(o),o}},function(T,V,t,k,E){k(),t.default=function(i){return new u(i).output()};var v=/\s/,b=/[A-Za-z]/,w=/[A-Za-z84]/,f=/[,\]]/,d=/[\d\.E\-\+]/;function u(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}u.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==4)for(;v.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case 1:return this.neutral(i);case 2:return this.keyword(i);case 4:return this.quoted(i);case 5:return this.afterquote(i);case 3:return this.number(i);case-1:return}},u.prototype.afterquote=function(i){if(i==='"')return this.word+='"',void(this.state=4);if(f.test(i))return this.word=this.word.trim(),void this.afterItem(i);throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},u.prototype.afterItem=function(i){return i===","?(this.word!==null&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):i==="]"?(this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},u.prototype.number=function(i){if(!d.test(i)){if(f.test(i))return this.word=parseFloat(this.word),void this.afterItem(i);throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)}this.word+=i},u.prototype.quoted=function(i){i!=='"'?this.word+=i:this.state=5},u.prototype.keyword=function(i){if(w.test(i))this.word+=i;else{if(i==="["){var o=[];return o.push(this.word),this.level++,this.root===null?this.root=o:this.currentObject.push(o),this.stack.push(this.currentObject),this.currentObject=o,void(this.state=1)}if(!f.test(i))throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place);this.afterItem(i)}},u.prototype.neutral=function(i){if(b.test(i))return this.word=i,void(this.state=2);if(i==='"')return this.word="",void(this.state=4);if(d.test(i))return this.word=i,void(this.state=3);if(!f.test(i))throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place);this.afterItem(i)},u.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===-1)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)}},function(T,V,t,k,E){function v(w,f,d){Array.isArray(f)&&(d.unshift(f),f=null);var u=f?{}:w,i=d.reduce(function(o,r){return b(r,o),o},u);f&&(w[f]=i)}function b(w,f){if(Array.isArray(w)){var d=w.shift();if(d==="PARAMETER"&&(d=w.shift()),w.length===1)return Array.isArray(w[0])?(f[d]={},void b(w[0],f[d])):void(f[d]=w[0]);if(w.length)if(d!=="TOWGS84"){if(d==="AXIS")return d in f||(f[d]=[]),void f[d].push(w);var u;switch(Array.isArray(d)||(f[d]={}),d){case"UNIT":case"PRIMEM":case"VERT_DATUM":return f[d]={name:w[0].toLowerCase(),convert:w[1]},void(w.length===3&&b(w[2],f[d]));case"SPHEROID":case"ELLIPSOID":return f[d]={name:w[0],a:w[1],rf:w[2]},void(w.length===4&&b(w[3],f[d]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return w[0]=["name",w[0]],void v(f,d,w);default:for(u=-1;++u<w.length;)if(!Array.isArray(w[u]))return b(w,f[d]);return v(f,d,w)}}else f[d]=w;else f[d]=!0}else f[w]=!0}k(),t.sExpr=b},function(T,V,t,k,E){k(),t.default=function(v,b){var w,f;if(v=v||{},!b)return v;for(f in b)(w=b[f])!==void 0&&(v[f]=w);return v}},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importDefault)(T(94)),w=(0,v.__importDefault)(T(100));var f=[b.default,w.default],d={},u=[];function i(e,s){var a=u.length;return e.names?(u[a]=e,e.names.forEach(function(c){d[c.toLowerCase()]=a}),this):(console.log(s),!0)}function o(e){if(!e)return!1;var s=e.toLowerCase();return d[s]!==void 0&&u[d[s]]?u[d[s]]:void 0}function r(){f.forEach(i)}t.add=i,t.get=o,t.start=r,t.default={start:r,add:i,get:o}},function(T,V,t,k,E){k();const v=T(1),b=(0,v.__importDefault)(T(95)),w=(0,v.__importDefault)(T(96)),f=(0,v.__importDefault)(T(98)),d=(0,v.__importDefault)(T(99)),u=T(85);function i(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=(0,b.default)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function o(e){var s,a,c=e.x,l=e.y;if(l*u.R2D>90&&l*u.R2D<-90&&c*u.R2D>180&&c*u.R2D<-180||Math.abs(Math.abs(l)-u.HALF_PI)<=u.EPSLN)return null;if(this.sphere)s=this.x0+this.a*this.k0*(0,w.default)(c-this.long0),a=this.y0+this.a*this.k0*Math.log(Math.tan(u.FORTPI+.5*l));else{var Q=Math.sin(l),m=(0,f.default)(this.e,l,Q);s=this.x0+this.a*this.k0*(0,w.default)(c-this.long0),a=this.y0-this.a*this.k0*Math.log(m)}return e.x=s,e.y=a,e}function r(e){var s,a,c=e.x-this.x0,l=e.y-this.y0;if(this.sphere)a=u.HALF_PI-2*Math.atan(Math.exp(-l/(this.a*this.k0)));else{var Q=Math.exp(-l/(this.a*this.k0));if((a=(0,d.default)(this.e,Q))===-9999)return null}return s=(0,w.default)(this.long0+c/(this.a*this.k0)),e.x=s,e.y=a,e}t.init=i,t.forward=o,t.inverse=r,t.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],t.default={init:i,forward:o,inverse:r,names:t.names}},function(T,V,t,k,E){k(),t.default=function(v,b,w){var f=v*b;return w/Math.sqrt(1-f*f)}},function(T,V,t,k,E){k();const v=T(1),b=T(85),w=(0,v.__importDefault)(T(97));t.default=function(f){return Math.abs(f)<=b.SPI?f:f-(0,w.default)(f)*b.TWO_PI}},function(T,V,t,k,E){k(),t.default=function(v){return v<0?-1:1}},function(T,V,t,k,E){k();const v=T(85);t.default=function(b,w,f){var d=b*f,u=.5*b;return d=Math.pow((1-d)/(1+d),u),Math.tan(.5*(v.HALF_PI-w))/d}},function(T,V,t,k,E){k();const v=T(85);t.default=function(b,w){for(var f,d,u=.5*b,i=v.HALF_PI-2*Math.atan(w),o=0;o<=15;o++)if(f=b*Math.sin(i),i+=d=v.HALF_PI-2*Math.atan(w*Math.pow((1-f)/(1+f),u))-i,Math.abs(d)<=1e-10)return i;return-9999}},function(T,V,t,k,E){function v(){}function b(w){return w}k(),t.init=v,t.forward=b,t.inverse=b,t.names=["longlat","identity"],t.default={init:v,forward:b,inverse:b,names:t.names}},function(T,V,t,k,E){k();const v=T(1),b=T(85),w=(0,v.__importStar)(T(102)),f=(0,v.__importDefault)(T(88));t.eccentricity=function(d,u,i,o){var r=d*d,e=u*u,s=(r-e)/r,a=0;return o?(r=(d*=1-s*(b.SIXTH+s*(b.RA4+s*b.RA6)))*d,s=0):a=Math.sqrt(s),{es:s,e:a,ep2:(r-e)/e}},t.sphere=function(d,u,i,o,r){if(!d){var e=(0,f.default)(w.default,o);e||(e=w.WGS84),d=e.a,u=e.b,i=e.rf}return i&&!u&&(u=(1-1/i)*d),(i===0||Math.abs(d-u)<b.EPSLN)&&(r=!0,u=d),{a:d,b:u,rf:i,sphere:r}}},function(T,V,t,k,E){k();var v={};t.default=v,v.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},v.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},v.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},v.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},v.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},v.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},v.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},v.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},v.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},v.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},v.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},v.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},v.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},v.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},v.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},v.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},v.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},v.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},v.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},v.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},v.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},v.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},v.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},v.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},v.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},v.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},v.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},v.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},v.hough={a:6378270,rf:297,ellipseName:"Hough"},v.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},v.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},v.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},v.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},v.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},v.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},v.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},v.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},v.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},v.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},v.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},v.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},t.WGS84=v.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},v.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(T,V,t,k,E){k();var v={};t.default=v,v.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},v.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},v.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},v.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},v.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},v.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},v.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},v.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},v.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},v.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},v.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},v.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},v.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},v.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},v.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},v.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},v.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(T,V,t,k,E){k();const v=T(85);t.default=function(b,w,f,d,u,i,o){var r={};return r.datum_type=b===void 0||b==="none"?v.PJD_NODATUM:v.PJD_WGS84,w&&(r.datum_params=w.map(parseFloat),r.datum_params[0]===0&&r.datum_params[1]===0&&r.datum_params[2]===0||(r.datum_type=v.PJD_3PARAM),r.datum_params.length>3&&(r.datum_params[3]===0&&r.datum_params[4]===0&&r.datum_params[5]===0&&r.datum_params[6]===0||(r.datum_type=v.PJD_7PARAM,r.datum_params[3]*=v.SEC_TO_RAD,r.datum_params[4]*=v.SEC_TO_RAD,r.datum_params[5]*=v.SEC_TO_RAD,r.datum_params[6]=r.datum_params[6]/1e6+1))),o&&(r.datum_type=v.PJD_GRIDSHIFT,r.grids=o),r.a=f,r.b=d,r.es=u,r.ep2=i,r}},function(T,V,t,k,E){k();var v={};function b(o){if(o.length===0)return null;var r=o[0]==="@";return r&&(o=o.slice(1)),o==="null"?{name:"null",mandatory:!r,grid:null,isNull:!0}:{name:o,mandatory:!r,grid:v[o]||null,isNull:!1}}function w(o){return o/3600*Math.PI/180}function f(o,r,e){return String.fromCharCode.apply(null,new Uint8Array(o.buffer.slice(r,e)))}function d(o){return o.map(function(r){return[w(r.longitudeShift),w(r.latitudeShift)]})}function u(o,r,e){return{name:f(o,r+8,r+16).trim(),parent:f(o,r+24,r+24+8).trim(),lowerLatitude:o.getFloat64(r+72,e),upperLatitude:o.getFloat64(r+88,e),lowerLongitude:o.getFloat64(r+104,e),upperLongitude:o.getFloat64(r+120,e),latitudeInterval:o.getFloat64(r+136,e),longitudeInterval:o.getFloat64(r+152,e),gridNodeCount:o.getInt32(r+168,e)}}function i(o,r,e,s){for(var a=r+176,c=[],l=0;l<e.gridNodeCount;l++){var Q={latitudeShift:o.getFloat32(a+16*l,s),longitudeShift:o.getFloat32(a+16*l+4,s),latitudeAccuracy:o.getFloat32(a+16*l+8,s),longitudeAccuracy:o.getFloat32(a+16*l+12,s)};c.push(Q)}return c}t.default=function(o,r){var e=new DataView(r),s=(function(Q){var m=Q.getInt32(8,!1);return m===11?!1:((m=Q.getInt32(8,!0))!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)})(e),a=(function(Q,m){return{nFields:Q.getInt32(8,m),nSubgridFields:Q.getInt32(24,m),nSubgrids:Q.getInt32(40,m),shiftType:f(Q,56,64).trim(),fromSemiMajorAxis:Q.getFloat64(120,m),fromSemiMinorAxis:Q.getFloat64(136,m),toSemiMajorAxis:Q.getFloat64(152,m),toSemiMinorAxis:Q.getFloat64(168,m)}})(e,s);a.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var c=(function(Q,m,p){for(var y=176,g=[],L=0;L<m.nSubgrids;L++){var A=u(Q,y,p),x=i(Q,y,A,p),H=Math.round(1+(A.upperLongitude-A.lowerLongitude)/A.longitudeInterval),S=Math.round(1+(A.upperLatitude-A.lowerLatitude)/A.latitudeInterval);g.push({ll:[w(A.lowerLongitude),w(A.lowerLatitude)],del:[w(A.longitudeInterval),w(A.latitudeInterval)],lim:[H,S],count:A.gridNodeCount,cvs:d(x)})}return g})(e,a,s),l={header:a,subgrids:c};return v[o]=l,l},t.getNadgrids=function(o){return o===void 0?null:o.split(",").map(b)}},function(T,V,t,k,E){k();const v=T(1),b=T(85),w=(0,v.__importDefault)(T(107)),f=(0,v.__importDefault)(T(109)),d=(0,v.__importDefault)(T(80)),u=(0,v.__importDefault)(T(110)),i=(0,v.__importDefault)(T(111));t.default=function o(r,e,s,a){var c;if(Array.isArray(s)&&(s=(0,u.default)(s)),(0,i.default)(s),r.datum&&e.datum&&(function(l,Q){return(l.datum.datum_type===b.PJD_3PARAM||l.datum.datum_type===b.PJD_7PARAM)&&Q.datumCode!=="WGS84"||(Q.datum.datum_type===b.PJD_3PARAM||Q.datum.datum_type===b.PJD_7PARAM)&&l.datumCode!=="WGS84"})(r,e)&&(s=o(r,c=new d.default("WGS84"),s,a),r=c),a&&r.axis!=="enu"&&(s=(0,f.default)(r,!1,s)),r.projName==="longlat")s={x:s.x*b.D2R,y:s.y*b.D2R,z:s.z||0};else if(r.to_meter&&(s={x:s.x*r.to_meter,y:s.y*r.to_meter,z:s.z||0}),!(s=r.inverse(s)))return;if(r.from_greenwich&&(s.x+=r.from_greenwich),s=(0,w.default)(r.datum,e.datum,s))return e.from_greenwich&&(s={x:s.x-e.from_greenwich,y:s.y,z:s.z||0}),e.projName==="longlat"?s={x:s.x*b.R2D,y:s.y*b.R2D,z:s.z||0}:(s=e.forward(s),e.to_meter&&(s={x:s.x/e.to_meter,y:s.y/e.to_meter,z:s.z||0})),a&&e.axis!=="enu"?(0,f.default)(e,!0,s):s}},function(T,V,t,k,E){k();const v=T(1),b=T(85),w=T(108),f=(0,v.__importDefault)(T(96));function d(r){return r===b.PJD_3PARAM||r===b.PJD_7PARAM}function u(r,e,s){if(r.grids===null||r.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var a={x:-s.x,y:s.y},c={x:Number.NaN,y:Number.NaN},l=[],Q=0;Q<r.grids.length;Q++){var m=r.grids[Q];if(l.push(m.name),m.isNull){c=a;break}if(m.mandatory,m.grid!==null){var p=m.grid.subgrids[0],y=(Math.abs(p.del[1])+Math.abs(p.del[0]))/1e4,g=p.ll[0]-y,L=p.ll[1]-y,A=p.ll[0]+(p.lim[0]-1)*p.del[0]+y,x=p.ll[1]+(p.lim[1]-1)*p.del[1]+y;if(!(L>a.y||g>a.x||x<a.y||A<a.x||(c=i(a,e,p),isNaN(c.x))))break}else if(m.mandatory)return console.log("Unable to find mandatory grid '"+m.name+"'"),-1}return isNaN(c.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*b.R2D+" "+a.y*b.R2D+" tried: '"+l+"'"),-1):(s.x=-c.x,s.y=c.y,0)}function i(r,e,s){var a={x:Number.NaN,y:Number.NaN};if(isNaN(r.x))return a;var c={x:r.x,y:r.y};c.x-=s.ll[0],c.y-=s.ll[1],c.x=(0,f.default)(c.x-Math.PI)+Math.PI;var l=o(c,s);if(e){if(isNaN(l.x))return a;l.x=c.x-l.x,l.y=c.y-l.y;var Q,m,p=9;do{if(m=o(l,s),isNaN(m.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}Q={x:c.x-(m.x+l.x),y:c.y-(m.y+l.y)},l.x+=Q.x,l.y+=Q.y}while(p--&&Math.abs(Q.x)>1e-12&&Math.abs(Q.y)>1e-12);if(p<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=(0,f.default)(l.x+s.ll[0]),a.y=l.y+s.ll[1]}else isNaN(l.x)||(a.x=r.x+l.x,a.y=r.y+l.y);return a}function o(r,e){var s,a={x:r.x/e.del[0],y:r.y/e.del[1]},c=Math.floor(a.x),l=Math.floor(a.y),Q=a.x-1*c,m=a.y-1*l,p={x:Number.NaN,y:Number.NaN};if(c<0||c>=e.lim[0]||l<0||l>=e.lim[1])return p;s=l*e.lim[0]+c;var y=e.cvs[s][0],g=e.cvs[s][1];s++;var L=e.cvs[s][0],A=e.cvs[s][1];s+=e.lim[0];var x=e.cvs[s][0],H=e.cvs[s][1];s--;var S=e.cvs[s][0],M=e.cvs[s][1],C=Q*m,R=Q*(1-m),D=(1-Q)*(1-m),B=(1-Q)*m;return p.x=D*y+R*L+B*S+C*x,p.y=D*g+R*A+B*M+C*H,p}t.default=function(r,e,s){if((0,w.compareDatums)(r,e)||r.datum_type===b.PJD_NODATUM||e.datum_type===b.PJD_NODATUM)return s;var a=r.a,c=r.es;if(r.datum_type===b.PJD_GRIDSHIFT){if(u(r,!1,s)!==0)return;a=b.SRS_WGS84_SEMIMAJOR,c=b.SRS_WGS84_ESQUARED}var l=e.a,Q=e.b,m=e.es;if(e.datum_type===b.PJD_GRIDSHIFT&&(l=b.SRS_WGS84_SEMIMAJOR,Q=b.SRS_WGS84_SEMIMINOR,m=b.SRS_WGS84_ESQUARED),c===m&&a===l&&!d(r.datum_type)&&!d(e.datum_type)||(s=(0,w.geodeticToGeocentric)(s,c,a),d(r.datum_type)&&(s=(0,w.geocentricToWgs84)(s,r.datum_type,r.datum_params)),d(e.datum_type)&&(s=(0,w.geocentricFromWgs84)(s,e.datum_type,e.datum_params)),s=(0,w.geocentricToGeodetic)(s,m,l,Q),!(e.datum_type===b.PJD_GRIDSHIFT&&u(e,!0,s)!==0)))return s},t.applyGridShift=u},function(T,V,t,k,E){k();const v=T(85);t.compareDatums=function(b,w){return b.datum_type===w.datum_type&&!(b.a!==w.a||Math.abs(b.es-w.es)>5e-11)&&(b.datum_type===v.PJD_3PARAM?b.datum_params[0]===w.datum_params[0]&&b.datum_params[1]===w.datum_params[1]&&b.datum_params[2]===w.datum_params[2]:b.datum_type!==v.PJD_7PARAM||b.datum_params[0]===w.datum_params[0]&&b.datum_params[1]===w.datum_params[1]&&b.datum_params[2]===w.datum_params[2]&&b.datum_params[3]===w.datum_params[3]&&b.datum_params[4]===w.datum_params[4]&&b.datum_params[5]===w.datum_params[5]&&b.datum_params[6]===w.datum_params[6])},t.geodeticToGeocentric=function(b,w,f){var d,u,i,o,r=b.x,e=b.y,s=b.z?b.z:0;if(e<-v.HALF_PI&&e>-1.001*v.HALF_PI)e=-v.HALF_PI;else if(e>v.HALF_PI&&e<1.001*v.HALF_PI)e=v.HALF_PI;else{if(e<-v.HALF_PI)return{x:-1/0,y:-1/0,z:b.z};if(e>v.HALF_PI)return{x:1/0,y:1/0,z:b.z}}return r>Math.PI&&(r-=2*Math.PI),u=Math.sin(e),o=Math.cos(e),i=u*u,{x:((d=f/Math.sqrt(1-w*i))+s)*o*Math.cos(r),y:(d+s)*o*Math.sin(r),z:(d*(1-w)+s)*u}},t.geocentricToGeodetic=function(b,w,f,d){var u,i,o,r,e,s,a,c,l,Q,m,p,y,g,L,A=1e-12,x=b.x,H=b.y,S=b.z?b.z:0;if(u=Math.sqrt(x*x+H*H),i=Math.sqrt(x*x+H*H+S*S),u/f<A){if(g=0,i/f<A)return v.HALF_PI,L=-d,{x:b.x,y:b.y,z:b.z}}else g=Math.atan2(H,x);o=S/i,c=(r=u/i)*(1-w)*(e=1/Math.sqrt(1-w*(2-w)*r*r)),l=o*e,y=0;do y++,s=w*(a=f/Math.sqrt(1-w*l*l))/(a+(L=u*c+S*l-a*(1-w*l*l))),p=(m=o*(e=1/Math.sqrt(1-s*(2-s)*r*r)))*c-(Q=r*(1-s)*e)*l,c=Q,l=m;while(p*p>1e-24&&y<30);return{x:g,y:Math.atan(m/Math.abs(Q)),z:L}},t.geocentricToWgs84=function(b,w,f){if(w===v.PJD_3PARAM)return{x:b.x+f[0],y:b.y+f[1],z:b.z+f[2]};if(w===v.PJD_7PARAM){var d=f[0],u=f[1],i=f[2],o=f[3],r=f[4],e=f[5],s=f[6];return{x:s*(b.x-e*b.y+r*b.z)+d,y:s*(e*b.x+b.y-o*b.z)+u,z:s*(-r*b.x+o*b.y+b.z)+i}}},t.geocentricFromWgs84=function(b,w,f){if(w===v.PJD_3PARAM)return{x:b.x-f[0],y:b.y-f[1],z:b.z-f[2]};if(w===v.PJD_7PARAM){var d=f[0],u=f[1],i=f[2],o=f[3],r=f[4],e=f[5],s=f[6],a=(b.x-d)/s,c=(b.y-u)/s,l=(b.z-i)/s;return{x:a+e*c-r*l,y:-e*a+c+o*l,z:r*a-o*c+l}}}},function(T,V,t,k,E){k(),t.default=function(v,b,w){var f,d,u,i=w.x,o=w.y,r=w.z||0,e={};for(u=0;u<3;u++)if(!b||u!==2||w.z!==void 0)switch(u===0?(f=i,d="ew".indexOf(v.axis[u])!==-1?"x":"y"):u===1?(f=o,d="ns".indexOf(v.axis[u])!==-1?"y":"x"):(f=r,d="z"),v.axis[u]){case"e":e[d]=f;break;case"w":e[d]=-f;break;case"n":e[d]=f;break;case"s":e[d]=-f;break;case"u":w[d]!==void 0&&(e.z=f);break;case"d":w[d]!==void 0&&(e.z=-f);break;default:return null}return e}},function(T,V,t,k,E){k(),t.default=function(v){var b={x:v[0],y:v[1]};return v.length>2&&(b.z=v[2]),v.length>3&&(b.m=v[3]),b}},function(T,V,t,k,E){function v(b){if(typeof Number.isFinite=="function"){if(Number.isFinite(b))return;throw new TypeError("coordinates must be finite numbers")}if(typeof b!="number"||b!=b||!isFinite(b))throw new TypeError("coordinates must be finite numbers")}k(),t.default=function(b){v(b.x),v(b.y)}},function(T,V,t,k,E){k();const v=T(1);var b,w,f,d,u;const i=T(53),o=T(42),r=(0,v.__importStar)(T(45)),e=T(48),s=(0,v.__importStar)(T(18));class a extends o.View{initialize(){super.initialize(),this.visuals=new r.Visuals(this)}request_render(){this.parent.request_render()}get canvas(){return this.parent.canvas}set_data(H){const S=this;for(const M of this.model){if(!(M instanceof s.VectorSpec||M instanceof s.ScalarSpec))continue;const C=M.uniform(H);S[`${M.attr}`]=C}}}t.ArrowHeadView=a,a.__name__="ArrowHeadView";class c extends i.Model{constructor(H){super(H)}}t.ArrowHead=c,b=c,c.__name__="ArrowHead",b.define(()=>({size:[s.NumberSpec,25]}));class l extends a{clip(H,S){this.visuals.line.set_vectorize(H,S);const M=this.size.get(S);H.moveTo(.5*M,M),H.lineTo(.5*M,-2),H.lineTo(-.5*M,-2),H.lineTo(-.5*M,M),H.lineTo(0,0),H.lineTo(.5*M,M)}render(H,S){if(this.visuals.line.doit){this.visuals.line.set_vectorize(H,S);const M=this.size.get(S);H.beginPath(),H.moveTo(.5*M,M),H.lineTo(0,0),H.lineTo(-.5*M,M),H.stroke()}}}t.OpenHeadView=l,l.__name__="OpenHeadView";class Q extends c{constructor(H){super(H)}}t.OpenHead=Q,w=Q,Q.__name__="OpenHead",w.prototype.default_view=l,w.mixins(e.LineVector);class m extends a{clip(H,S){this.visuals.line.set_vectorize(H,S);const M=this.size.get(S);H.moveTo(.5*M,M),H.lineTo(.5*M,-2),H.lineTo(-.5*M,-2),H.lineTo(-.5*M,M),H.lineTo(.5*M,M)}render(H,S){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(H,S),this._normal(H,S),H.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(H,S),this._normal(H,S),H.stroke())}_normal(H,S){const M=this.size.get(S);H.beginPath(),H.moveTo(.5*M,M),H.lineTo(0,0),H.lineTo(-.5*M,M),H.closePath()}}t.NormalHeadView=m,m.__name__="NormalHeadView";class p extends c{constructor(H){super(H)}}t.NormalHead=p,f=p,p.__name__="NormalHead",f.prototype.default_view=m,f.mixins([e.LineVector,e.FillVector]),f.override({fill_color:"black"});class y extends a{clip(H,S){this.visuals.line.set_vectorize(H,S);const M=this.size.get(S);H.moveTo(.5*M,M),H.lineTo(.5*M,-2),H.lineTo(-.5*M,-2),H.lineTo(-.5*M,M),H.lineTo(0,.5*M),H.lineTo(.5*M,M)}render(H,S){this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(H,S),this._vee(H,S),H.fill()),this.visuals.line.doit&&(this.visuals.line.set_vectorize(H,S),this._vee(H,S),H.stroke())}_vee(H,S){const M=this.size.get(S);H.beginPath(),H.moveTo(.5*M,M),H.lineTo(0,0),H.lineTo(-.5*M,M),H.lineTo(0,.5*M),H.closePath()}}t.VeeHeadView=y,y.__name__="VeeHeadView";class g extends c{constructor(H){super(H)}}t.VeeHead=g,d=g,g.__name__="VeeHead",d.prototype.default_view=y,d.mixins([e.LineVector,e.FillVector]),d.override({fill_color:"black"});class L extends a{render(H,S){if(this.visuals.line.doit){this.visuals.line.set_vectorize(H,S);const M=this.size.get(S);H.beginPath(),H.moveTo(.5*M,0),H.lineTo(-.5*M,0),H.stroke()}}clip(H,S){}}t.TeeHeadView=L,L.__name__="TeeHeadView";class A extends c{constructor(H){super(H)}}t.TeeHead=A,u=A,A.__name__="TeeHead",u.prototype.default_view=L,u.mixins(e.LineVector)},function(T,V,t,k,E){k();const v=T(9);async function b(w,f,d){const u=new w(Object.assign(Object.assign({},d),{model:f}));return u.initialize(),await u.lazy_initialize(),u}t.build_view=async function(w,f={parent:null},d=u=>u.default_view){const u=await b(d(w),w,f);return u.connect_signals(),u},t.build_views=async function(w,f,d={parent:null},u=i=>i.default_view){const i=(0,v.difference)([...w.keys()],f);for(const e of i)w.get(e).remove(),w.delete(e);const o=[],r=f.filter(e=>!w.has(e));for(const e of r){const s=await b(u(e),e,d);w.set(e,s),o.push(s)}for(const e of o)e.connect_signals();return o},t.remove_views=function(w){for(const[f,d]of w)d.remove(),w.delete(f)}},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(115),f=(0,v.__importStar)(T(48));class d extends w.UpperLowerView{paint(o){o.beginPath(),o.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let r=0,e=this._lower_sx.length;r<e;r++)o.lineTo(this._lower_sx[r],this._lower_sy[r]);for(let r=this._upper_sx.length-1;r>=0;r--)o.lineTo(this._upper_sx[r],this._upper_sy[r]);o.closePath(),this.visuals.fill.apply(o),o.beginPath(),o.moveTo(this._lower_sx[0],this._lower_sy[0]);for(let r=0,e=this._lower_sx.length;r<e;r++)o.lineTo(this._lower_sx[r],this._lower_sy[r]);this.visuals.line.apply(o),o.beginPath(),o.moveTo(this._upper_sx[0],this._upper_sy[0]);for(let r=0,e=this._upper_sx.length;r<e;r++)o.lineTo(this._upper_sx[r],this._upper_sy[r]);this.visuals.line.apply(o)}}t.BandView=d,d.__name__="BandView";class u extends w.UpperLower{constructor(o){super(o)}}t.Band=u,b=u,u.__name__="Band",b.prototype.default_view=d,b.mixins([f.Line,f.Fill]),b.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(69),f=T(20),d=(0,v.__importStar)(T(18));class u extends w.DataAnnotationView{map_data(){const{frame:e}=this.plot_view,s=this.model.dimension,a=this.coordinates.x_scale,c=this.coordinates.y_scale,l=s=="height"?c:a,Q=s=="height"?a:c,m=s=="height"?e.bbox.yview:e.bbox.xview,p=s=="height"?e.bbox.xview:e.bbox.yview;let y,g,L;y=this.model.properties.lower.units=="data"?l.v_compute(this._lower):m.v_compute(this._lower),g=this.model.properties.upper.units=="data"?l.v_compute(this._upper):m.v_compute(this._upper),L=this.model.properties.base.units=="data"?Q.v_compute(this._base):p.v_compute(this._base);const[A,x]=s=="height"?[1,0]:[0,1],H=[y,L],S=[g,L];this._lower_sx=H[A],this._lower_sy=H[x],this._upper_sx=S[A],this._upper_sy=S[x]}}t.UpperLowerView=u,u.__name__="UpperLowerView";class i extends d.CoordinateSpec{get dimension(){return this.obj.dimension=="width"?"x":"y"}get units(){var e;return(e=this.spec.units)!==null&&e!==void 0?e:"data"}}t.XOrYCoordinateSpec=i,i.__name__="XOrYCoordinateSpec";class o extends w.DataAnnotation{constructor(e){super(e)}}t.UpperLower=o,b=o,o.__name__="UpperLower",b.define(()=>({dimension:[f.Dimension,"height"],lower:[i,{field:"lower"}],upper:[i,{field:"upper"}],base:[i,{field:"base"}]}))},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(40),f=(0,v.__importStar)(T(48)),d=T(20),u=T(65);t.EDGE_TOLERANCE=2.5;class i extends w.AnnotationView{constructor(){super(...arguments),this.bbox=new u.BBox}connect_signals(){super.connect_signals(),this.connect(this.model.change,()=>this.request_render())}_render(){const{left:e,right:s,top:a,bottom:c}=this.model;if(e==null&&s==null&&a==null&&c==null)return;const{frame:l}=this.plot_view,Q=this.coordinates.x_scale,m=this.coordinates.y_scale,p=(y,g,L,A,x)=>{let H;return H=y!=null?this.model.screen?y:g=="data"?L.compute(y):A.compute(y):x,H};this.bbox=u.BBox.from_rect({left:p(e,this.model.left_units,Q,l.bbox.xview,l.bbox.left),right:p(s,this.model.right_units,Q,l.bbox.xview,l.bbox.right),top:p(a,this.model.top_units,m,l.bbox.yview,l.bbox.top),bottom:p(c,this.model.bottom_units,m,l.bbox.yview,l.bbox.bottom)}),this._paint_box()}_paint_box(){const{ctx:e}=this.layer;e.save();const{left:s,top:a,width:c,height:l}=this.bbox;e.beginPath(),e.rect(s,a,c,l),this.visuals.fill.apply(e),this.visuals.hatch.apply(e),this.visuals.line.apply(e),e.restore()}interactive_bbox(){const e=this.model.line_width+t.EDGE_TOLERANCE;return this.bbox.grow_by(e)}interactive_hit(e,s){return this.model.in_cursor==null?!1:this.interactive_bbox().contains(e,s)}cursor(e,s){const{left:a,right:c,bottom:l,top:Q}=this.bbox;return Math.abs(e-a)<3||Math.abs(e-c)<3?this.model.ew_cursor:Math.abs(s-l)<3||Math.abs(s-Q)<3?this.model.ns_cursor:this.bbox.contains(e,s)?this.model.in_cursor:null}}t.BoxAnnotationView=i,i.__name__="BoxAnnotationView";class o extends w.Annotation{constructor(e){super(e)}update({left:e,right:s,top:a,bottom:c}){this.setv({left:e,right:s,top:a,bottom:c,screen:!0})}}t.BoxAnnotation=o,b=o,o.__name__="BoxAnnotation",b.prototype.default_view=i,b.mixins([f.Line,f.Fill,f.Hatch]),b.define(({Number:r,Nullable:e})=>({top:[e(r),null],top_units:[d.SpatialUnits,"data"],bottom:[e(r),null],bottom_units:[d.SpatialUnits,"data"],left:[e(r),null],left_units:[d.SpatialUnits,"data"],right:[e(r),null],right_units:[d.SpatialUnits,"data"],render_mode:[d.RenderMode,"canvas"]})),b.internal(({Boolean:r,String:e,Nullable:s})=>({screen:[r,!1],ew_cursor:[s(e),null],ns_cursor:[s(e),null],in_cursor:[s(e),null]})),b.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(40),f=T(118),d=T(126),u=T(127),i=T(130),o=T(168),r=T(131),e=T(192),s=T(132),a=T(173),c=T(172),l=T(196),Q=T(204),m=T(206),p=T(133),y=T(20),g=(0,v.__importStar)(T(48)),L=T(9),A=T(207),x=T(208),H=T(211),S=T(123),M=T(11),C=T(113),R=T(65),D=T(8);class B extends w.AnnotationView{get orientation(){return this._orientation}initialize(){super.initialize();const{ticker:I,formatter:O,color_mapper:G}=this.model;this._ticker=I!="auto"?I:(()=>{switch(!0){case G instanceof l.LogColorMapper:return new o.LogTicker;case G instanceof l.ScanningColorMapper:return new o.BinnedTicker({mapper:G});case G instanceof l.CategoricalColorMapper:return new o.CategoricalTicker;default:return new o.BasicTicker}})(),this._formatter=O!="auto"?O:(()=>{switch(!0){case this._ticker instanceof o.LogTicker:return new e.LogTickFormatter;case G instanceof l.CategoricalColorMapper:return new e.CategoricalTickFormatter;default:return new e.BasicTickFormatter}})(),this._major_range=(()=>{if(G instanceof l.CategoricalColorMapper){const{factors:ne}=G;return new m.FactorRange({factors:ne})}if(G instanceof c.ContinuousColorMapper){const{min:ne,max:jt}=G.metrics;return new m.Range1d({start:ne,end:jt})}(0,M.unreachable)()})(),this._major_scale=(()=>{if(G instanceof l.LinearColorMapper)return new Q.LinearScale;if(G instanceof l.LogColorMapper)return new Q.LogScale;if(G instanceof l.ScanningColorMapper){const{binning:ne}=G.metrics;return new Q.LinearInterpolationScale({binning:ne})}if(G instanceof l.CategoricalColorMapper)return new Q.CategoricalScale;(0,M.unreachable)()})(),this._minor_range=new m.Range1d({start:0,end:1}),this._minor_scale=new Q.LinearScale;const q=g.attrs_of(this.model,"major_label_",g.Text,!0),Z=g.attrs_of(this.model,"major_tick_",g.Line,!0),U=g.attrs_of(this.model,"minor_tick_",g.Line,!0),ot=g.attrs_of(this.model,"title_",g.Text),ft=G instanceof l.CategoricalColorMapper?u.CategoricalAxis:G instanceof l.LogColorMapper?u.LogAxis:u.LinearAxis;this._axis=new ft(Object.assign(Object.assign(Object.assign({ticker:this._ticker,formatter:this._formatter,major_tick_in:this.model.major_tick_in,major_tick_out:this.model.major_tick_out,minor_tick_in:this.model.minor_tick_in,minor_tick_out:this.model.minor_tick_out,major_label_standoff:this.model.label_standoff,major_label_overrides:this.model.major_label_overrides,major_label_policy:this.model.major_label_policy,axis_line_color:null},q),Z),U));const{title:Ct}=this.model;Ct&&(this._title=new f.Title(Object.assign({text:Ct,standoff:this.model.title_standoff},ot)))}async lazy_initialize(){await super.lazy_initialize();const I=this,O={get parent(){return I.parent},get root(){return I.root},get frame(){return I._frame},get canvas_view(){return I.parent.canvas_view},request_layout(){I.parent.request_layout()}};this._axis_view=await(0,C.build_view)(this._axis,{parent:O}),this._title!=null&&(this._title_view=await(0,C.build_view)(this._title,{parent:O}))}remove(){var I;(I=this._title_view)===null||I===void 0||I.remove(),this._axis_view.remove(),super.remove()}connect_signals(){super.connect_signals(),this.connect(this._ticker.change,()=>this.request_render()),this.connect(this._formatter.change,()=>this.request_render()),this.connect(this.model.color_mapper.metrics_change,()=>{const I=this._major_range,O=this._major_scale,{color_mapper:G}=this.model;if(G instanceof c.ContinuousColorMapper&&I instanceof m.Range1d){const{min:q,max:Z}=G.metrics;I.setv({start:q,end:Z})}if(G instanceof l.ScanningColorMapper&&O instanceof Q.LinearInterpolationScale){const{binning:q}=G.metrics;O.binning=q}this._set_canvas_image(),this.plot_view.request_layout()})}_set_canvas_image(){const{orientation:I}=this,O=(()=>{const{palette:Ct}=this.model.color_mapper;return I=="vertical"?(0,L.reversed)(Ct):Ct})(),[G,q]=I=="vertical"?[1,O.length]:[O.length,1],Z=this._image=document.createElement("canvas");Z.width=G,Z.height=q;const U=Z.getContext("2d"),ot=U.getImageData(0,0,G,q),ft=new l.LinearColorMapper({palette:O}).rgba_mapper.v_compute((0,L.range)(0,O.length));ot.data.set(ft),U.putImageData(ot,0,0)}update_layout(){const{location:I,width:O,height:G,padding:q,margin:Z}=this.model,[U,ot]=(()=>{if(!(0,D.isString)(I))return["end","start"];switch(I){case"top_left":return["start","start"];case"top":case"top_center":return["start","center"];case"top_right":return["start","end"];case"bottom_left":return["end","start"];case"bottom":case"bottom_center":return["end","center"];case"bottom_right":return["end","end"];case"left":case"center_left":return["center","start"];case"center":case"center_center":return["center","center"];case"right":case"center_right":return["center","end"]}})(),ft=this._orientation=(()=>{const{orientation:Ae}=this.model;return Ae=="auto"?this.panel!=null?this.panel.is_horizontal?"horizontal":"vertical":ot=="start"||ot=="end"||ot=="center"&&U=="center"?"vertical":"horizontal":Ae})(),Ct=new x.NodeLayout,ne=new x.VStack,jt=new x.VStack,ye=new x.HStack,me=new x.HStack;Ct.absolute=!0,ne.absolute=!0,jt.absolute=!0,ye.absolute=!0,me.absolute=!0;const[Je,Ye,Oe,Ke]=ft=="horizontal"?[this._major_scale,this._minor_scale,this._major_range,this._minor_range]:[this._minor_scale,this._major_scale,this._minor_range,this._major_range];this._frame=new d.CartesianFrame(Je,Ye,Oe,Ke),Ct.on_resize(Ae=>this._frame.set_geometry(Ae));const we=new H.BorderLayout;this._inner_layout=we,we.absolute=!0,we.center_panel=Ct,we.top_panel=ne,we.bottom_panel=jt,we.left_panel=ye,we.right_panel=me;const Se={left:q,right:q,top:q,bottom:q},Le=(()=>{if(this.panel==null){if((0,D.isString)(I))return{left:Z,right:Z,top:Z,bottom:Z};{const[Ae,d1]=I;return{left:Ae,right:Z,top:Z,bottom:d1}}}if(!(0,D.isString)(I)){const[Ae,d1]=I;return we.fixup_geometry=(c1,v1)=>{const m1=c1,Ft=this.layout.bbox,{width:qt,height:Kt}=c1;if(c1=new R.BBox({left:Ft.left+Ae,bottom:Ft.bottom-d1,width:qt,height:Kt}),v1!=null){const re=c1.left-m1.left,$e=c1.top-m1.top,{left:Ie,top:o1,width:b1,height:L1}=v1;v1=new R.BBox({left:Ie+re,top:o1+$e,width:b1,height:L1})}return[c1,v1]},{left:Ae,right:0,top:0,bottom:d1}}we.fixup_geometry=(Ae,d1)=>{const c1=Ae;if(ft=="horizontal"){const{top:v1,width:m1,height:Ft}=Ae;if(ot=="end"){const{right:qt}=this.layout.bbox;Ae=new R.BBox({right:qt,top:v1,width:m1,height:Ft})}else if(ot=="center"){const{hcenter:qt}=this.layout.bbox;Ae=new R.BBox({hcenter:Math.round(qt),top:v1,width:m1,height:Ft})}}else{const{left:v1,width:m1,height:Ft}=Ae;if(U=="end"){const{bottom:qt}=this.layout.bbox;Ae=new R.BBox({left:v1,bottom:qt,width:m1,height:Ft})}else if(U=="center"){const{vcenter:qt}=this.layout.bbox;Ae=new R.BBox({left:v1,vcenter:Math.round(qt),width:m1,height:Ft})}}if(d1!=null){const v1=Ae.left-c1.left,m1=Ae.top-c1.top,{left:Ft,top:qt,width:Kt,height:re}=d1;d1=new R.BBox({left:Ft+v1,top:qt+m1,width:Kt,height:re})}return[Ae,d1]}})();let de,Be,ze,t1;if(we.padding=Se,this.panel!=null?(de="max",Be=void 0,ze=void 0,t1=void 0):(ft=="horizontal"?O:G)=="auto"?(de="fixed",Be=25*this.model.color_mapper.palette.length,ze={percent:.3},t1={percent:.8}):(de="fit",Be=void 0),ft=="horizontal"){const Ae=O=="auto"?void 0:O,d1=G=="auto"?25:G;we.set_sizing({width_policy:de,height_policy:"min",width:Be,min_width:ze,max_width:t1,halign:ot,valign:U,margin:Le}),we.center_panel.set_sizing({width_policy:O=="auto"?"fit":"fixed",height_policy:"fixed",width:Ae,height:d1})}else{const Ae=O=="auto"?25:O,d1=G=="auto"?void 0:G;we.set_sizing({width_policy:"min",height_policy:de,height:Be,min_height:ze,max_height:t1,halign:ot,valign:U,margin:Le}),we.center_panel.set_sizing({width_policy:"fixed",height_policy:G=="auto"?"fit":"fixed",width:Ae,height:d1})}ne.set_sizing({width_policy:"fit",height_policy:"min"}),jt.set_sizing({width_policy:"fit",height_policy:"min"}),ye.set_sizing({width_policy:"min",height_policy:"fit"}),me.set_sizing({width_policy:"min",height_policy:"fit"});const{_title_view:Pe}=this;Pe!=null&&(ft=="horizontal"?(Pe.panel=new S.Panel("above"),Pe.update_layout(),ne.children.push(Pe.layout)):(Pe.panel=new S.Panel("left"),Pe.update_layout(),ye.children.push(Pe.layout)));const{panel:Lt}=this,it=Lt!=null&&ft==Lt.orientation?Lt.side:ft=="horizontal"?"below":"right",le=(()=>{switch(it){case"above":return ne;case"below":return jt;case"left":return ye;case"right":return me}})(),{_axis_view:Me}=this;if(Me.panel=new S.Panel(it),Me.update_layout(),le.children.push(Me.layout),this.panel!=null){const Ae=new A.Grid([{layout:we,row:0,col:0}]);Ae.absolute=!0,ft=="horizontal"?Ae.set_sizing({width_policy:"max",height_policy:"min"}):Ae.set_sizing({width_policy:"min",height_policy:"max"}),this.layout=Ae}else this.layout=this._inner_layout;const{visible:_e}=this.model;this.layout.sizing.visible=_e,this._set_canvas_image()}_render(){var I;const{ctx:O}=this.layer;O.save(),this._paint_bbox(O,this._inner_layout.bbox),this._paint_image(O,this._inner_layout.center_panel.bbox),(I=this._title_view)===null||I===void 0||I.render(),this._axis_view.render(),O.restore()}_paint_bbox(I,O){const{x:G,y:q}=O;let{width:Z,height:U}=O;G+Z>=this.parent.canvas_view.bbox.width&&(Z-=1),q+U>=this.parent.canvas_view.bbox.height&&(U-=1),I.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(I),I.fillRect(G,q,Z,U)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(I),I.strokeRect(G,q,Z,U)),I.restore()}_paint_image(I,O){const{x:G,y:q,width:Z,height:U}=O;I.save(),I.setImageSmoothingEnabled(!1),I.globalAlpha=this.model.scale_alpha,I.drawImage(this._image,G,q,Z,U),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(I),I.strokeRect(G,q,Z,U)),I.restore()}serializable_state(){const I=super.serializable_state(),{children:O=[]}=I,G=(0,v.__rest)(I,["children"]);return this._title_view!=null&&O.push(this._title_view.serializable_state()),O.push(this._axis_view.serializable_state()),Object.assign(Object.assign({},G),{children:O})}}t.ColorBarView=B,B.__name__="ColorBarView";class z extends w.Annotation{constructor(I){super(I)}}t.ColorBar=z,b=z,z.__name__="ColorBar",b.prototype.default_view=B,b.mixins([["major_label_",g.Text],["title_",g.Text],["major_tick_",g.Line],["minor_tick_",g.Line],["border_",g.Line],["bar_",g.Line],["background_",g.Fill]]),b.define(({Alpha:N,Number:I,String:O,Tuple:G,Dict:q,Or:Z,Ref:U,Auto:ot,Nullable:ft})=>({location:[Z(y.Anchor,G(I,I)),"top_right"],orientation:[Z(y.Orientation,ot),"auto"],title:[ft(O),null],title_standoff:[I,2],width:[Z(I,ot),"auto"],height:[Z(I,ot),"auto"],scale_alpha:[N,1],ticker:[Z(U(i.Ticker),ot),"auto"],formatter:[Z(U(r.TickFormatter),ot),"auto"],major_label_overrides:[q(Z(O,U(p.BaseText))),{}],major_label_policy:[U(s.LabelingPolicy),()=>new s.NoOverlap],color_mapper:[U(a.ColorMapper)],label_standoff:[I,5],margin:[I,30],padding:[I,10],major_tick_in:[I,5],major_tick_out:[I,0],minor_tick_in:[I,0],minor_tick_out:[I,0]})),b.override({background_fill_color:"#ffffff",background_fill_alpha:.95,bar_line_color:null,border_line_color:null,major_label_text_font_size:"11px",major_tick_line_color:"#ffffff",minor_tick_line_color:null,title_text_font_size:"13px",title_text_font_style:"italic"})},function(T,V,t,k,E){k();const v=T(1);var b;const w=T(119),f=T(20),d=T(120),u=(0,v.__importStar)(T(48));class i extends w.TextAnnotationView{_get_location(){const e=this.model.offset,s=this.model.standoff/2;let a,c;const{bbox:l}=this.layout;switch(this.panel.side){case"above":case"below":switch(this.model.vertical_align){case"top":c=l.top+s;break;case"middle":c=l.vcenter;break;case"bottom":c=l.bottom-s}switch(this.model.align){case"left":a=l.left+e;break;case"center":a=l.hcenter;break;case"right":a=l.right-e}break;case"left":switch(this.model.vertical_align){case"top":a=l.left+s;break;case"middle":a=l.hcenter;break;case"bottom":a=l.right-s}switch(this.model.align){case"left":c=l.bottom-e;break;case"center":c=l.vcenter;break;case"right":c=l.top+e}break;case"right":switch(this.model.vertical_align){case"top":a=l.right-s;break;case"middle":a=l.hcenter;break;case"bottom":a=l.left+s}switch(this.model.align){case"left":c=l.top+e;break;case"center":c=l.vcenter;break;case"right":c=l.bottom-e}}return[a,c]}_render(){const{text:e}=this.model;if(e==null||e.length==0)return;this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align;const[s,a]=this._get_location(),c=this.panel.get_label_angle_heuristic("parallel");(this.model.render_mode=="canvas"?this._canvas_text.bind(this):this._css_text.bind(this))(this.layer.ctx,e,s,a,c)}_get_size(){const{text:e}=this.model,s=new d.TextBox({text:e});s.visuals=this.visuals.text.values();const{width:a,height:c}=s.size();return{width:a,height:c==0?0:2+c+this.model.standoff}}}t.TitleView=i,i.__name__="TitleView";class o extends w.TextAnnotation{constructor(e){super(e)}}t.Title=o,b=o,o.__name__="Title",b.prototype.default_view=i,b.mixins([u.Text,["border_",u.Line],["background_",u.Fill]]),b.define(({Number:r,String:e})=>({text:[e,""],vertical_align:[f.VerticalAlign,"bottom"],align:[f.TextAlign,"left"],offset:[r,0],standoff:[r,10]})),b.prototype._props.text_align.options.internal=!0,b.prototype._props.text_baseline.options.internal=!0,b.override({text_font_size:"13px",text_font_style:"bold",text_line_height:1,background_fill_color:null,border_line_color:null})},function(T,V,t,k,E){var v;k();const b=T(40),w=T(43),f=T(20),d=T(120),u=T(123),i=T(11);class o extends b.AnnotationView{update_layout(){const{panel:s}=this;this.layout=s!=null?new u.SideLayout(s,()=>this.get_size(),!0):void 0}initialize(){super.initialize(),this.model.render_mode=="css"&&(this.el=(0,w.div)(),this.plot_view.canvas_view.add_overlay(this.el))}remove(){this.el!=null&&(0,w.remove)(this.el),super.remove()}connect_signals(){super.connect_signals(),this.model.render_mode=="css"?this.connect(this.model.change,()=>this.render()):this.connect(this.model.change,()=>this.request_render())}render(){this.model.visible||this.model.render_mode!="css"||(0,w.undisplay)(this.el),super.render()}_canvas_text(s,a,c,l,Q){const m=new d.TextBox({text:a});m.angle=Q,m.position={sx:c,sy:l},m.visuals=this.visuals.text.values();const{background_fill:p,border_line:y}=this.visuals;if(p.doit||y.doit){const{p0:g,p1:L,p2:A,p3:x}=m.rect();s.beginPath(),s.moveTo(g.x,g.y),s.lineTo(L.x,L.y),s.lineTo(A.x,A.y),s.lineTo(x.x,x.y),s.closePath(),this.visuals.background_fill.apply(s),this.visuals.border_line.apply(s)}this.visuals.text.doit&&m.paint(s)}_css_text(s,a,c,l,Q){const{el:m}=this;(0,i.assert)(m!=null),(0,w.undisplay)(m),m.textContent=a,this.visuals.text.set_value(s),m.style.position="absolute",m.style.left=`${c}px`,m.style.top=`${l}px`,m.style.color=s.fillStyle,m.style.font=s.font,m.style.lineHeight="normal",m.style.whiteSpace="pre";const[p,y]=(()=>{switch(this.visuals.text.text_align.get_value()){case"left":return["left","0%"];case"center":return["center","-50%"];case"right":return["right","-100%"]}})(),[g,L]=(()=>{switch(this.visuals.text.text_baseline.get_value()){case"top":return["top","0%"];case"middle":return["center","-50%"];case"bottom":return["bottom","-100%"];default:return["center","-50%"]}})();let A=`translate(${y}, ${L})`;Q&&(A+=`rotate(${Q}rad)`),m.style.transformOrigin=`${p} ${g}`,m.style.transform=A,this.layout,this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(s),m.style.backgroundColor=s.fillStyle),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(s),m.style.borderStyle=s.lineDash.length<2?"solid":"dashed",m.style.borderWidth=`${s.lineWidth}px`,m.style.borderColor=s.strokeStyle),(0,w.display)(m)}}t.TextAnnotationView=o,o.__name__="TextAnnotationView";class r extends b.Annotation{constructor(s){super(s)}}t.TextAnnotation=r,v=r,r.__name__="TextAnnotation",v.define(()=>({render_mode:[f.RenderMode,"canvas"]}))},function(T,V,t,k,E){k();const v=T(65),b=T(121),w=T(9),f=T(8),d=T(122),u=T(22);t.text_width=(()=>{const s=document.createElement("canvas").getContext("2d");let a="";return(c,l)=>(l!=a&&(a=l,s.font=l),s.measureText(c).width)})();class i{constructor(){this._position={sx:0,sy:0},this.font_size_scale=1,this.align="left",this._base_font_size=13,this._x_anchor="left",this._y_anchor="center"}set base_font_size(a){a!=null&&(this._base_font_size=a)}get base_font_size(){return this._base_font_size}set position(a){this._position=a}get position(){return this._position}infer_text_height(){return"ascent_descent"}bbox(){const{p0:a,p1:c,p2:l,p3:Q}=this.rect(),m=Math.min(a.x,c.x,l.x,Q.x),p=Math.min(a.y,c.y,l.y,Q.y),y=Math.max(a.x,c.x,l.x,Q.x),g=Math.max(a.y,c.y,l.y,Q.y);return new v.BBox({left:m,right:y,top:p,bottom:g})}size(){const{width:a,height:c}=this._size(),{angle:l}=this;if(l){const Q=Math.cos(Math.abs(l)),m=Math.sin(Math.abs(l));return{width:Math.abs(a*Q+c*m),height:Math.abs(a*m+c*Q)}}return{width:a,height:c}}rect(){const a=this._rect(),{angle:c}=this;if(c){const{sx:l,sy:Q}=this.position,m=new d.AffineTransform;return m.translate(l,Q),m.rotate(c),m.translate(-l,-Q),m.apply_rect(a)}return a}paint_rect(a){const{p0:c,p1:l,p2:Q,p3:m}=this.rect();a.save(),a.strokeStyle="red",a.lineWidth=1,a.beginPath();const{round:p}=Math;a.moveTo(p(c.x),p(c.y)),a.lineTo(p(l.x),p(l.y)),a.lineTo(p(Q.x),p(Q.y)),a.lineTo(p(m.x),p(m.y)),a.closePath(),a.stroke(),a.restore()}paint_bbox(a){const{x:c,y:l,width:Q,height:m}=this.bbox();a.save(),a.strokeStyle="blue",a.lineWidth=1,a.beginPath();const{round:p}=Math;a.moveTo(p(c),p(l)),a.lineTo(p(c),p(l+m)),a.lineTo(p(c+Q),p(l+m)),a.lineTo(p(c+Q),p(l)),a.closePath(),a.stroke(),a.restore()}}t.GraphicsBox=i,i.__name__="GraphicsBox";class o extends i{constructor({text:a}){super(),this.text=a}set visuals(a){const c=a.color,l=a.alpha,Q=a.font_style;let m=a.font_size;const p=a.font,{font_size_scale:y,base_font_size:g}=this,L=(0,b.parse_css_font_size)(m);if(L!=null){let{value:S,unit:M}=L;S*=y,M=="em"&&g&&(S*=g,M="px"),m=`${S}${M}`}const A=`${Q} ${m} ${p}`;this.font=A,this.color=(0,u.color2css)(c,l),this.line_height=a.line_height;const x=a.align;this._x_anchor=x;const H=a.baseline;this._y_anchor=(()=>{switch(H){case"top":return"top";case"middle":return"center";case"bottom":return"bottom";default:return"baseline"}})()}infer_text_height(){return this.text.includes(`
3
3
  `)?"ascent_descent":(function(a){for(const c of new Set(a))if(!("0"<=c&&c<="9"))switch(c){case",":case".":case"+":case"-":case"−":case"e":continue;default:return!1}return!0})(this.text)?"cap":"ascent_descent"}_text_line(a){var c;const l=(c=this.text_height_metric)!==null&&c!==void 0?c:this.infer_text_height(),Q=(()=>{switch(l){case"x":case"x_descent":return a.x_height;case"cap":case"cap_descent":return a.cap_height;case"ascent":case"ascent_descent":return a.ascent}})(),m=(()=>{switch(l){case"x":case"cap":case"ascent":return 0;case"x_descent":case"cap_descent":case"ascent_descent":return a.descent}})();return{height:Q+m,ascent:Q,descent:m}}get nlines(){return this.text.split(`
4
4
  `).length}_size(){var a,c;const{font:l}=this,Q=(0,b.font_metrics)(l),m=(this.line_height-1)*Q.height,p=this.text=="",y=this.text.split(`