@stlite/desktop 0.45.5 → 0.46.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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var F=Object.create;var P=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var E=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of x(t))!C.call(e,a)&&a!==i&&P(e,a,{get:()=>t[a],enumerable:!(r=I(t,a))||r.enumerable});return e};var d=(e,t,i)=>(i=e!=null?F(M(e)):{},E(t||!e||!e.__esModule?P(i,"default",{value:e,enumerable:!0}):i,e));var v=y(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.parseRequirementsTxt=void 0;var R=/\s#.*$/;function J(e){return e.split(`
3
- `).filter(t=>!t.startsWith("#")).map(t=>t.replace(R,"")).map(t=>t.trim()).filter(t=>t!=="")}f.parseRequirementsTxt=J});var D=y(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.PromiseDelegate=void 0;var w=class{constructor(){this.promise=new Promise((t,i)=>{this.resolveInternal=t,this.rejectInternal=i})}resolve(t){this.resolveInternal(t)}reject(t){this.rejectInternal(t)}};g.PromiseDelegate=w});var b=y(l=>{"use strict";var W=l&&l.__createBinding||(Object.create?function(e,t,i,r){r===void 0&&(r=i);var a=Object.getOwnPropertyDescriptor(t,i);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,a)}:function(e,t,i,r){r===void 0&&(r=i),e[r]=t[i]}),_=l&&l.__exportStar||function(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&W(t,e,i)};Object.defineProperty(l,"__esModule",{value:!0});_(v(),l);_(D(),l)});var O=d(require("yargs")),T=require("yargs/helpers"),o=d(require("path")),s=d(require("fs/promises")),k=d(require("fs-extra")),h=d(require("node-fetch")),m=require("pyodide"),$=d(b());global.fetch=h.default;function S(e){return`https://cdn.jsdelivr.net/pyodide/v${m.version}/full/${e}`}async function A(e){console.info("Copy the build directory (the bare built app files) to this directory...");let t=o.default.resolve(__dirname,"../build");if(!(await s.default.stat(t)).isDirectory())throw new Error(`The source ${t} does not exist.`);if(t===e.copyTo){console.warn(`sourceDir == destDir (${t}). Are you in the development environment? Skip copying the directory.`);return}if(e.keepOld)try{await s.default.access(e.copyTo),console.info(`${e.copyTo} already exists. Use it and skip copying.`);return}catch{throw new Error(`${e.copyTo} does not exist even though the \`keepOld\` option is specified`)}console.log(`Copy ${t} to ${e.copyTo}`),await s.default.rm(e.copyTo,{recursive:!0,force:!0}),await k.default.copy(t,e.copyTo)}async function H(e){if(e.requirements.length===0)return[];let t=await(0,m.loadPyodide)();return await j(t,{requirements:e.requirements}),Object.entries(t.loadedPackages).filter(([,i])=>i==="default channel").map(([i])=>i)}async function B(){let e=S("pyodide-lock.json");return console.log(`Load the Pyodide pyodide-lock.json from ${e}`),(await(await(0,h.default)(e)).json()).packages}async function q(e,t){console.log(`Preparing the local wheel ${t}`);let i=await s.default.readFile(t),r="/tmp/"+o.default.basename(t);e.FS.writeFile(r,i);let a=`emfs:${r}`;return console.log(`The local wheel ${t} is prepared as ${a}`),a}async function j(e,t){await e.loadPackage(["micropip"]);let i=e.pyimport("micropip"),r=[...t.requirements],a=o.default.join(__dirname,"../wheels"),n=await q(e,o.default.join(a,"stlite_server-0.1.0-py3-none-any.whl"));r.push(n);let c=await q(e,o.default.join(a,"streamlit-1.30.0-cp311-none-any.whl"));r.push(c),console.log("Install the packages:",r),await i.install.callKwargs(r,{keep_going:!0})}async function z(e){console.info("Create the site-packages snapshot file...");let t=await(0,m.loadPyodide)();await t.loadPackage(["micropip"]);let i=t.pyimport("micropip"),r=await B(),a=[];e.usedBuiltinPackages.length>0&&(console.log("Mocking builtin packages so that they will not be included in the site-packages snapshot because these will be installed from the vendored wheel files at runtime..."),e.usedBuiltinPackages.forEach(p=>{let u=r[p];if(u==null)throw new Error(`Package ${p} is not found in the lock file.`);console.log(`Mock ${u.name} ${u.version}`),i.add_mock_package(u.name,u.version),a.push(u.name)})),console.log(`Install the requirements ${JSON.stringify(e.requirements)}`),await j(t,{requirements:e.requirements}),console.log("Remove the mocked packages",a),a.forEach(p=>i.remove_mock_package(p)),console.log("Archive the site-packages director(y|ies)");let n="/tmp/site-packages-snapshot.tar.gz";await t.runPythonAsync(`
3
+ `).filter(t=>!t.startsWith("#")).map(t=>t.replace(R,"")).map(t=>t.trim()).filter(t=>t!=="")}f.parseRequirementsTxt=J});var D=y(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.PromiseDelegate=void 0;var w=class{constructor(){this.promise=new Promise((t,i)=>{this.resolveInternal=t,this.rejectInternal=i})}resolve(t){this.resolveInternal(t)}reject(t){this.rejectInternal(t)}};g.PromiseDelegate=w});var b=y(l=>{"use strict";var W=l&&l.__createBinding||(Object.create?function(e,t,i,r){r===void 0&&(r=i);var a=Object.getOwnPropertyDescriptor(t,i);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,a)}:function(e,t,i,r){r===void 0&&(r=i),e[r]=t[i]}),_=l&&l.__exportStar||function(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&W(t,e,i)};Object.defineProperty(l,"__esModule",{value:!0});_(v(),l);_(D(),l)});var O=d(require("yargs")),T=require("yargs/helpers"),o=d(require("path")),s=d(require("fs/promises")),k=d(require("fs-extra")),h=d(require("node-fetch")),m=require("pyodide"),$=d(b());global.fetch=h.default;function S(e){return`https://cdn.jsdelivr.net/pyodide/v${m.version}/full/${e}`}async function A(e){console.info("Copy the build directory (the bare built app files) to this directory...");let t=o.default.resolve(__dirname,"../build");if(!(await s.default.stat(t)).isDirectory())throw new Error(`The source ${t} does not exist.`);if(t===e.copyTo){console.warn(`sourceDir == destDir (${t}). Are you in the development environment? Skip copying the directory.`);return}if(e.keepOld)try{await s.default.access(e.copyTo),console.info(`${e.copyTo} already exists. Use it and skip copying.`);return}catch{throw new Error(`${e.copyTo} does not exist even though the \`keepOld\` option is specified`)}console.log(`Copy ${t} to ${e.copyTo}`),await s.default.rm(e.copyTo,{recursive:!0,force:!0}),await k.default.copy(t,e.copyTo)}async function H(e){if(e.requirements.length===0)return[];let t=await(0,m.loadPyodide)();return await j(t,{requirements:e.requirements}),Object.entries(t.loadedPackages).filter(([,i])=>i==="default channel").map(([i])=>i)}async function B(){let e=S("pyodide-lock.json");return console.log(`Load the Pyodide pyodide-lock.json from ${e}`),(await(await(0,h.default)(e)).json()).packages}async function q(e,t){console.log(`Preparing the local wheel ${t}`);let i=await s.default.readFile(t),r="/tmp/"+o.default.basename(t);e.FS.writeFile(r,i);let a=`emfs:${r}`;return console.log(`The local wheel ${t} is prepared as ${a}`),a}async function j(e,t){await e.loadPackage(["micropip"]);let i=e.pyimport("micropip"),r=[...t.requirements],a=o.default.join(__dirname,"../wheels"),n=await q(e,o.default.join(a,"stlite_server-0.1.0-py3-none-any.whl"));r.push(n);let c=await q(e,o.default.join(a,"streamlit-1.31.0-cp311-none-any.whl"));r.push(c),console.log("Install the packages:",r),await i.install.callKwargs(r,{keep_going:!0})}async function z(e){console.info("Create the site-packages snapshot file...");let t=await(0,m.loadPyodide)();await t.loadPackage(["micropip"]);let i=t.pyimport("micropip"),r=await B(),a=[];e.usedBuiltinPackages.length>0&&(console.log("Mocking builtin packages so that they will not be included in the site-packages snapshot because these will be installed from the vendored wheel files at runtime..."),e.usedBuiltinPackages.forEach(p=>{let u=r[p];if(u==null)throw new Error(`Package ${p} is not found in the lock file.`);console.log(`Mock ${u.name} ${u.version}`),i.add_mock_package(u.name,u.version),a.push(u.name)})),console.log(`Install the requirements ${JSON.stringify(e.requirements)}`),await j(t,{requirements:e.requirements}),console.log("Remove the mocked packages",a),a.forEach(p=>i.remove_mock_package(p)),console.log("Archive the site-packages director(y|ies)");let n="/tmp/site-packages-snapshot.tar.gz";await t.runPythonAsync(`
4
4
  import os
5
5
  import tarfile
6
6
  import site
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "/static/css/main.fb5f4d99.css",
4
- "main.js": "/static/js/main.c9bce18f.js",
4
+ "main.js": "/static/js/main.26b04e67.js",
5
5
  "static/js/7332.c686e157.chunk.js": "/static/js/7332.c686e157.chunk.js",
6
6
  "static/js/4994.551c87ac.chunk.js": "/static/js/4994.551c87ac.chunk.js",
7
7
  "static/js/3685.c65c1e48.chunk.js": "/static/js/3685.c65c1e48.chunk.js",
8
- "static/js/4785.76a05d79.chunk.js": "/static/js/4785.76a05d79.chunk.js",
8
+ "static/js/4785.f0fa2d5d.chunk.js": "/static/js/4785.f0fa2d5d.chunk.js",
9
9
  "static/js/5299.beb80829.chunk.js": "/static/js/5299.beb80829.chunk.js",
10
10
  "static/js/4482.a9238ad0.chunk.js": "/static/js/4482.a9238ad0.chunk.js",
11
11
  "static/css/9699.7ce51b75.chunk.css": "/static/css/9699.7ce51b75.chunk.css",
12
- "static/js/9699.df050cd6.chunk.js": "/static/js/9699.df050cd6.chunk.js",
12
+ "static/js/9699.fd4930f2.chunk.js": "/static/js/9699.fd4930f2.chunk.js",
13
13
  "static/css/8050.c24b25fa.chunk.css": "/static/css/8050.c24b25fa.chunk.css",
14
14
  "static/js/8050.029f3dc8.chunk.js": "/static/js/8050.029f3dc8.chunk.js",
15
15
  "static/js/4021.ec2e87b0.chunk.js": "/static/js/4021.ec2e87b0.chunk.js",
@@ -17,14 +17,15 @@
17
17
  "static/js/1122.422f58fc.chunk.js": "/static/js/1122.422f58fc.chunk.js",
18
18
  "static/js/6802.df955c77.chunk.js": "/static/js/6802.df955c77.chunk.js",
19
19
  "static/js/9311.7c7348b0.chunk.js": "/static/js/9311.7c7348b0.chunk.js",
20
- "static/js/144.046792d9.chunk.js": "/static/js/144.046792d9.chunk.js",
20
+ "static/js/144.7b870b6f.chunk.js": "/static/js/144.7b870b6f.chunk.js",
21
21
  "static/js/2940.dd2240b9.chunk.js": "/static/js/2940.dd2240b9.chunk.js",
22
+ "static/js/9001.9c0cf7af.chunk.js": "/static/js/9001.9c0cf7af.chunk.js",
22
23
  "static/js/2873.f5c04f3b.chunk.js": "/static/js/2873.f5c04f3b.chunk.js",
23
- "static/js/6134.b9e5b2db.chunk.js": "/static/js/6134.b9e5b2db.chunk.js",
24
+ "static/js/6134.20400e9e.chunk.js": "/static/js/6134.20400e9e.chunk.js",
24
25
  "static/js/1189.71b89117.chunk.js": "/static/js/1189.71b89117.chunk.js",
25
- "static/js/1740.2c71a97a.chunk.js": "/static/js/1740.2c71a97a.chunk.js",
26
+ "static/js/1740.893c6c48.chunk.js": "/static/js/1740.893c6c48.chunk.js",
26
27
  "static/js/698.116a166b.chunk.js": "/static/js/698.116a166b.chunk.js",
27
- "static/js/4724.374578aa.chunk.js": "/static/js/4724.374578aa.chunk.js",
28
+ "static/js/4724.5f094a09.chunk.js": "/static/js/4724.5f094a09.chunk.js",
28
29
  "static/js/1729.d59ed152.chunk.js": "/static/js/1729.d59ed152.chunk.js",
29
30
  "static/js/1261.242b7386.chunk.js": "/static/js/1261.242b7386.chunk.js",
30
31
  "static/js/4494.6bb6fb20.chunk.js": "/static/js/4494.6bb6fb20.chunk.js",
@@ -33,7 +34,7 @@
33
34
  "static/js/7579.ea965a43.chunk.js": "/static/js/7579.ea965a43.chunk.js",
34
35
  "static/js/2448.e6f85eda.chunk.js": "/static/js/2448.e6f85eda.chunk.js",
35
36
  "static/js/8801.77babe65.chunk.js": "/static/js/8801.77babe65.chunk.js",
36
- "static/js/7696.c9589682.chunk.js": "/static/js/7696.c9589682.chunk.js",
37
+ "static/js/7696.4125474b.chunk.js": "/static/js/7696.4125474b.chunk.js",
37
38
  "static/js/7125.afecc159.chunk.js": "/static/js/7125.afecc159.chunk.js",
38
39
  "static/js/2385.2cbc4e3c.chunk.js": "/static/js/2385.2cbc4e3c.chunk.js",
39
40
  "static/js/9005.87bae37e.chunk.js": "/static/js/9005.87bae37e.chunk.js",
@@ -62,7 +63,7 @@
62
63
  "static/js/9166.f234f6b4.chunk.js": "/static/js/9166.f234f6b4.chunk.js",
63
64
  "static/js/6679.f4ee1d77.chunk.js": "/static/js/6679.f4ee1d77.chunk.js",
64
65
  "module.wasm": "/c43e2f2e6b6fd378c8e1.module.wasm",
65
- "pypi/streamlit-1.30.0-cp311-none-any.whl": "/pypi/streamlit-1.30.0-cp311-none-any.whl",
66
+ "pypi/streamlit-1.31.0-cp311-none-any.whl": "/pypi/streamlit-1.31.0-cp311-none-any.whl",
66
67
  "static/media/index.cjs": "/static/media/index.c05687ef19f5bac24939.cjs",
67
68
  "static/media/fireworks.gif": "/static/media/fireworks.0906f02ea43f1018a6d2.gif",
68
69
  "static/media/flake-2.png": "/static/media/flake-2.e3f07d06933dd0e84c24.png",
@@ -161,6 +162,6 @@
161
162
  },
162
163
  "entrypoints": [
163
164
  "static/css/main.fb5f4d99.css",
164
- "static/js/main.c9bce18f.js"
165
+ "static/js/main.26b04e67.js"
165
166
  ]
166
167
  }
package/build/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><script defer="defer" src="/static/js/main.c9bce18f.js"></script><link href="/static/css/main.fb5f4d99.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>stlite</title><script defer="defer" src="/static/js/main.26b04e67.js"></script><link href="/static/css/main.fb5f4d99.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[144],{10144:(t,i,e)=>{e.r(i),e.d(i,{default:()=>h});e(5057);var n=e(50651),o=e(4153),l=e(82160);const r=(0,l.Z)("div",{target:"e115fcil2"})((t=>{let{theme:i}=t;return{display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:i.spacing.lg}}),""),a=(0,l.Z)("div",{target:"e115fcil1"})((()=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0})),""),d=(0,l.Z)("div",{target:"e115fcil0"})((t=>{let{theme:i}=t;return{fontFamily:i.genericFonts.bodyFont,fontSize:i.fontSizes.sm,color:i.colors.fadedText60,textAlign:"center",marginTop:i.spacing.xs,wordWrap:"break-word",padding:"0.125rem"}}),"");var s=e(96266),c=function(t){return t[t.OriginalWidth=-1]="OriginalWidth",t[t.ColumnWidth=-2]="ColumnWidth",t[t.AutoWidth=-3]="AutoWidth",t}(c||{});const h=(0,n.Z)((function(t){let{width:i,isFullScreen:e,element:n,height:l,endpoints:h}=t;const g=(0,o.$R)(n.imgs);let u;const f=n.width;if(f===c.OriginalWidth||f===c.AutoWidth)u=void 0;else if(f===c.ColumnWidth)u=i;else{if(!(f>0))throw Error("Invalid image width: ".concat(f));u=f}const m={};return l&&e?(m.maxHeight=l,m["object-fit"]="contain"):(m.width=u,f===c.AutoWidth&&(m.maxWidth="100%")),(0,s.jsx)(r,{style:{width:i},children:g.map(((t,i)=>{const e=t;return(0,s.jsxs)(a,{"data-testid":"stImage",children:[(0,s.jsx)("img",{style:m,src:h.buildMediaURL(e.url),alt:i.toString()}),e.caption&&(0,s.jsx)(d,{"data-testid":"stImageCaption",style:m,children:" ".concat(e.caption," ")})]},i)}))})}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[1740],{31740:(t,e,i)=>{i.r(e),i.d(e,{default:()=>o});i(5057);var l=i(44088),s=i(92649),d=i(38830),r=i(46403),a=i(4153),n=i(96266);const o=function(t){const{disabled:e,element:i,widgetMgr:o,width:u,endpoints:c}=t,h={width:u},b="primary"===i.type?l.nW.PRIMARY:l.nW.SECONDARY,p=(0,a.v_)(),w=!i.help||u;return(0,n.jsx)("div",{className:"row-widget stDownloadButton","data-testid":"stDownloadButton",style:h,children:(0,n.jsx)(s.t,{help:i.help,children:(0,n.jsx)(d.ZP,{kind:b,size:l.V5.SMALL,disabled:e,onClick:()=>{if(o.setTriggerValue(i,{fromUi:!0}),i.url.startsWith("/media"))return void(0,a.uP)(p,i.url);const t=document.createElement("a"),e=c.buildMediaURL(i.url);t.setAttribute("href",e),t.setAttribute("target","_self"),t.setAttribute("download",""),t.click()},fluidWidth:!!i.useContainerWidth&&w,children:(0,n.jsx)(r.ZP,{source:i.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[4724],{94778:(e,t,r)=>{r.d(t,{Z:()=>p});r(5057);var n,o=r(50120),i=r(93905),a=r(82160);const s=(0,r(21371).F4)(n||(l=["\n 50% {\n color: rgba(0, 0, 0, 0);\n }\n"],c||(c=l.slice(0)),n=Object.freeze(Object.defineProperties(l,{raw:{value:Object.freeze(c)}}))));var l,c;const u=(0,a.Z)("span",{target:"edlqvik0"})((e=>{let{includeDot:t,shouldBlink:r,theme:n}=e;return{...t?{"&::before":{opacity:1,content:'"\u2022"',animation:"none",color:n.colors.gray,margin:"0 5px"}}:{},...r?{color:n.colors.red,animationName:"".concat(s),animationDuration:"0.5s",animationIterationCount:5}:{}}}),"");var d=r(96266);const p=e=>{let{dirty:t,value:r,maxLength:n,className:a,type:s="single",inForm:l}=e;const c=[],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.push((0,d.jsx)(u,{includeDot:c.length>0,shouldBlink:t,children:e},c.length))};if(t){const e=l?"submit form":"apply";if("multiline"===s){const t=(0,o.Ge)()?"\u2318":"Ctrl";p("Press ".concat(t,"+Enter to ").concat(e))}else"single"===s&&p("Press Enter to ".concat(e))}return n&&("chat"!==s||t)&&p("".concat(r.length,"/").concat(n),t&&r.length>=n),(0,d.jsx)(i.X7,{"data-testid":"InputInstructions",className:a,children:c})}},44724:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var n=r(5057),o=r(47206),i=r(7896),a=r(63947),s=n.forwardRef((function(e,t){return n.createElement(a.D,(0,i.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.createElement("path",{d:"M3 5.51v3.71c0 .46.31.86.76.97L11 12l-7.24 1.81c-.45.11-.76.51-.76.97v3.71c0 .72.73 1.2 1.39.92l15.42-6.49c.82-.34.82-1.5 0-1.84L4.39 4.58C3.73 4.31 3 4.79 3 5.51z"}))}));s.displayName="Send";var l=r(76866),c=r(73401),u=r(94778),d=r(96601),p=r(96216),f=r(82160);const h=(0,f.Z)("div",{target:"e1d2x3se4"})((e=>{var t;let{theme:r,width:n}=e;return{borderRadius:r.radii.lg,display:"flex",backgroundColor:null!==(t=r.colors.widgetBackgroundColor)&&void 0!==t?t:r.colors.secondaryBg,width:"".concat(n,"px")}}),""),y=(0,f.Z)("div",{target:"e1d2x3se3"})((e=>{let{theme:t}=e;return{backgroundColor:t.colors.transparent,position:"relative",flexGrow:1,borderRadius:t.radii.lg,display:"flex",alignItems:"center"}}),""),g=(0,f.Z)("button",{target:"e1d2x3se2"})((e=>{let{theme:t,disabled:r,extended:n}=e;const o=(0,d.Iy)(t),[i,a]=o?[t.colors.gray60,t.colors.gray80]:[t.colors.gray80,t.colors.gray40];return{border:"none",backgroundColor:t.colors.transparent,borderTopRightRadius:n?t.radii.none:t.radii.lg,borderTopLeftRadius:n?t.radii.lg:t.radii.none,borderBottomRightRadius:t.radii.lg,display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,margin:0,padding:t.spacing.sm,color:r?i:a,pointerEvents:"auto","&:focus":{outline:"none"},":focus":{outline:"none"},"&:focus-visible":{backgroundColor:o?t.colors.gray10:t.colors.gray90},"&:hover":{backgroundColor:t.colors.primary,color:t.colors.white},"&:disabled, &:disabled:hover, &:disabled:active":{backgroundColor:t.colors.transparent,borderColor:t.colors.transparent,color:t.colors.gray}}}),""),b=(0,f.Z)("div",{target:"e1d2x3se1"})((()=>({display:"flex",alignItems:"flex-end",height:"100%",position:"absolute",right:"0px",pointerEvents:"none"})),""),m=(0,f.Z)("div",{target:"e1d2x3se0"})({name:"1lm6gnd",styles:"position:absolute;bottom:0px;right:3rem"});var v=r(96266);const x=function(e){let{width:t,element:r,widgetMgr:i}=e;const a=(0,o.u)(),[f,x]=(0,n.useState)(!1),[w,O]=(0,n.useState)(r.default),[j,C]=(0,n.useState)(0),S=(0,n.useRef)(null),k=(0,n.useRef)({minHeight:0,maxHeight:0}),P=()=>{w&&(i.setStringTriggerValue(r,w,{fromUi:!0}),x(!1),O(""),C(0))};(0,n.useEffect)((()=>{if(r.setValue){r.setValue=!1;const e=r.value||"";O(e),x(""!==e)}}),[r]),(0,n.useEffect)((()=>{if(S.current){const{offsetHeight:e}=S.current;k.current.minHeight=e,k.current.maxHeight=6.5*e}}),[S]);const{disabled:R,placeholder:E,maxChars:I}=r,T=(0,d.Iy)(a),{minHeight:B,maxHeight:z}=k.current,F=T?a.colors.gray70:a.colors.gray80,A=!!(j>0&&S.current)&&Math.abs(j-B)>1;return(0,v.jsx)(h,{className:"stChatInput","data-testid":"stChatInput",width:t,children:(0,v.jsxs)(y,{children:[(0,v.jsx)(l.Z,{inputRef:S,value:w,placeholder:E,onChange:e=>{const{value:t}=e.target,{maxChars:n}=r;0!==n&&t.length>n||(x(""!==t),O(t),C((()=>{let e=0;const{current:t}=S;if(t){const r=t.placeholder;t.placeholder="",t.style.height="auto",e=t.scrollHeight,t.placeholder=r,t.style.height=""}return e})()))},onKeyDown:e=>{const{metaKey:t,ctrlKey:r,shiftKey:n}=e;(e=>{var t;const{keyCode:r,key:n}=e;return("Enter"===n||13===r||10===r)&&!(!0===(null===(t=e.nativeEvent)||void 0===t?void 0:t.isComposing))})(e)&&!n&&!r&&!t&&(e.preventDefault(),P())},"aria-label":E,disabled:R,rows:1,overrides:{Root:{style:{outline:"none",backgroundColor:a.colors.transparent,borderLeftWidth:"1px",borderRightWidth:"1px",borderTopWidth:"1px",borderBottomWidth:"1px",width:"".concat(t,"px")}},InputContainer:{style:{backgroundColor:a.colors.transparent}},Input:{props:{"data-testid":"stChatInputTextArea"},style:{lineHeight:"1.4",backgroundColor:a.colors.transparent,"::placeholder":{color:F},height:A?"".concat(j+1,"px"):"auto",maxHeight:z?"".concat(z,"px"):"none",paddingRight:"3rem",paddingLeft:a.spacing.sm,paddingBottom:a.spacing.sm,paddingTop:a.spacing.sm}}}}),t>p.A.hideWidgetDetails&&(0,v.jsx)(m,{children:(0,v.jsx)(u.Z,{dirty:f,value:w,maxLength:I,type:"chat",inForm:!1})}),(0,v.jsx)(b,{children:(0,v.jsx)(g,{onClick:P,disabled:!f||R,extended:A,"data-testid":"stChatInputSubmitButton",children:(0,v.jsx)(c.Z,{content:s,size:"xl",color:"inherit"})})})]})})}},76866:(e,t,r)=>{r.d(t,{Z:()=>k});var n=r(5057),o=r(80099),i=r(97135),a=r(18150),s=r(53381),l=r(4547);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=(0,s.zo)("div",(function(e){return u(u({},(0,l.d5)(u(u({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})}));p.displayName="StyledTextAreaRoot",p.displayName="StyledTextAreaRoot";var f=(0,s.zo)("div",(function(e){return(0,l.hB)(u({$positive:!1},e))}));f.displayName="StyledTextareaContainer",f.displayName="StyledTextareaContainer";var h=(0,s.zo)("textarea",(function(e){return u(u({},(0,l.Hx)(e)),{},{resize:e.$resize||"none"})}));function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(this,arguments)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(l){s=!0,o=l}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function w(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=j(e);if(t){var o=j(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return O(e)}(this,r)}}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}h.displayName="StyledTextarea",h.displayName="StyledTextarea";var S=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(c,e);var t,r,s,l=w(c);function c(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return C(O(e=l.call.apply(l,[this].concat(r))),"state",{isFocused:e.props.autoFocus||!1}),C(O(e),"onFocus",(function(t){e.setState({isFocused:!0}),e.props.onFocus(t)})),C(O(e),"onBlur",(function(t){e.setState({isFocused:!1}),e.props.onBlur(t)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props.overrides,t=void 0===e?{}:e,r=b((0,o.jb)(t.Root,p),2),s=r[0],l=r[1],c=(0,o.aO)({Input:{component:h},InputContainer:{component:f}},t);return n.createElement(s,g({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},l),n.createElement(i.Z,g({},this.props,{type:a.iB.textarea,overrides:c,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}])&&v(t.prototype,r),s&&v(t,s),Object.defineProperty(t,"prototype",{writable:!1}),c}(n.Component);C(S,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:a.NO.default});const k=S}}]);
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[4785],{94785:(t,e,s)=>{s.r(e),s.d(e,{default:()=>d});var i=s(5057),u=s(4153),r=s(96266);function d(t){let{element:e,width:s,endpoints:d}=t;const l=(0,i.useRef)(null);(0,i.useEffect)((()=>{l.current&&(l.current.currentTime=e.startTime)}),[e.startTime]);const a=(0,u.O0)(e.url),n=d.buildMediaURL(a);return(0,r.jsx)("audio",{"data-testid":"stAudio",id:"audio",ref:l,controls:!0,src:n,className:"stAudio",style:{width:s}})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[6134],{26134:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var s=r(5057),a=r(60913),i=r(4153),n=r(96266);const d=528;function o(e){let{element:t,width:r,endpoints:o}=e;const c=(0,s.useRef)(null),{type:l,url:u,startTime:h}=t,m=(0,i.O0)(u);(0,s.useEffect)((()=>{c.current&&(c.current.currentTime=h)}),[h]),(0,s.useEffect)((()=>{const e=c.current,r=()=>{e&&(e.currentTime=t.startTime)};return e&&e.addEventListener("loadedmetadata",r),()=>{e&&e.removeEventListener("loadedmetadata",r)}}),[t]);const f=e=>{const{startTime:r}=t;return r?"".concat(e,"?start=").concat(r):e};if(l===a.nk.Type.YOUTUBE_IFRAME){const e=0!==r?.75*r:d;return(0,n.jsx)("iframe",{"data-testid":"stVideo",title:m,src:f(m),width:r,height:e,style:{colorScheme:"light dark"},frameBorder:"0",allow:"autoplay; encrypted-media",allowFullScreen:!0})}return(0,n.jsx)("video",{"data-testid":"stVideo",ref:c,controls:!0,src:o.buildMediaURL(m),className:"stVideo",style:{width:r,height:0===r?d:void 0}})}}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7696],{52955:(e,t,i)=>{i.d(t,{K:()=>o});var s=i(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},87696:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(5057),o=i(8708),n=i.n(o),r=i(55790),a=i(47206),l=i(59500),d=i(52955),h=i(60913),m=i(50120),u=i(88084),c=i.n(u),g=i(38944),p=i(93905),f=i(21034),b=i(98790),v=i(82160),T=i(59990);const y=(0,v.Z)("div",{target:"ew7r33m3"})((e=>{let{disabled:t,theme:i}=e;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",height:i.radii.xl,justifyContent:"center",width:i.radii.xl,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,T.DZ)(i.colors.primary,.5))}}}),""),R=(0,v.Z)("div",{target:"ew7r33m2"})((e=>{let{disabled:t,theme:i}=e;return{fontFamily:i.genericFonts.codeFont,fontSize:i.fontSizes.sm,paddingBottom:i.spacing.twoThirdsSmFont,color:t?i.colors.gray:i.colors.primary,top:"-22px",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:"normal"}}),""),V=(0,v.Z)("div",{target:"ew7r33m1"})((e=>{let{theme:t}=e;return{paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:t.spacing.twoThirdsSmFont,justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),x=(0,v.Z)("div",{target:"ew7r33m0"})((e=>{let{disabled:t,theme:i}=e;return{lineHeight:i.lineHeights.base,fontWeight:"normal",fontSize:i.fontSizes.sm,fontFamily:i.genericFonts.codeFont,color:t?i.colors.fadedText40:"inherit"}}),"");var C=i(96266);class w extends s.PureComponent{constructor(e){super(e),this.formClearHelper=new d.K,this.state=void 0,this.sliderRef=s.createRef(),this.thumbRef=[],this.thumbValueRef=[],this.commitWidgetValueDebounced=void 0,this.commitWidgetValue=e=>{this.props.widgetMgr.setDoubleArrayValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{value:t}=e;this.setState({value:t},(()=>this.commitWidgetValueDebounced({fromUi:!0})))},this.renderThumb=s.forwardRef(((e,t)=>{var i;const{$value:o,$thumbIndex:r}=e,a=r||0;this.thumbRef[a]=t,(i=this.thumbValueRef)[a]||(i[a]=s.createRef());const l=o?this.formatValue(o[r]):"",d=n()(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),h={};return(this.props.element.options.length>0||this.isDateTimeType())&&(h["aria-valuetext"]=l),(0,C.jsx)(y,{...d,disabled:!0===e.$disabled,ref:this.thumbRef[a],"aria-valuetext":l,"aria-label":this.props.element.label,children:(0,C.jsx)(R,{className:"StyledThumbValue","data-testid":"stThumbValue",disabled:!0===e.$disabled,ref:this.thumbValueRef[a],children:l})})})),this.renderTickBar=()=>{const{disabled:e,element:t}=this.props,{max:i,min:s}=t;return(0,C.jsxs)(V,{"data-testid":"stTickBar",children:[(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMin",children:this.formatValue(s)}),(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMax",children:this.formatValue(i)})]})},this.commitWidgetValueDebounced=(0,m.Ds)(200,this.commitWidgetValue.bind(this)),this.state={value:this.initialValue}}get initialValue(){const e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){setTimeout((()=>{this.thumbValueAlignment()}),0),this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}get value(){const{min:e,max:t}=this.props.element,{value:i}=this.state;let s=i[0],o=i.length>1?i[1]:i[0];return s>o&&(s=o),s<e&&(s=e),s>t&&(s=t),o<e&&(o=e),o>t&&(o=t),i.length>1?[s,o]:[s]}isDateTimeType(){const{dataType:e}=this.props.element;return e===h.iR.DataType.DATETIME||e===h.iR.DataType.DATE||e===h.iR.DataType.TIME}formatValue(e){const{format:t,options:i}=this.props.element;return this.isDateTimeType()?c().utc(e/1e3).format(t):i.length>0?(0,l.sprintf)(t,i[e]):(0,l.sprintf)(t,e)}alignValueOnThumb(e,t,i){if(e&&t&&i){const s=e.getBoundingClientRect(),o=t.getBoundingClientRect(),n=i.getBoundingClientRect(),r=o.left+o.width/2,a=r-n.width/2<s.left,l=r+n.width/2>s.right;i.style.left=a?"0":"",i.style.right=l?"0":""}}thumbValueAlignment(){var e,t,i,s;const o=this.sliderRef.current,n=null===(e=this.thumbRef[0])||void 0===e?void 0:e.current,r=null===(t=this.thumbRef[1])||void 0===t?void 0:t.current,a=null===(i=this.thumbValueRef[0])||void 0===i?void 0:i.current,l=null===(s=this.thumbValueRef[1])||void 0===s?void 0:s.current;if(this.alignValueOnThumb(o,n,a),this.alignValueOnThumb(o,r,l),o&&n&&r&&a&&l){const e=o.getBoundingClientRect(),t=n.getBoundingClientRect(),i=r.getBoundingClientRect(),s=a.getBoundingClientRect(),d=l.getBoundingClientRect();if(s.right+16>d.left){d.left-16-s.width>e.left?a.style.right="".concat(d.width+16-(i.right-t.right),"px"):l.style.left="".concat(s.width+16-(i.left-t.left),"px")}}}render(){var e;const{disabled:t,element:i,theme:s,width:o,widgetMgr:n}=this.props,{colors:a,fonts:l,fontSizes:d,spacing:h}=s,u={width:o};return this.formClearHelper.manageFormClearListener(n,i.formId,this.onFormCleared),this.thumbValueAlignment(),(0,C.jsxs)("div",{ref:this.sliderRef,className:"stSlider",style:u,children:[(0,C.jsx)(g.O,{label:i.label,disabled:t,labelVisibility:(0,m.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,C.jsx)(p.dT,{children:(0,C.jsx)(f.Z,{content:i.help,placement:b.u.TOP_RIGHT})})}),(0,C.jsx)(r.Z,{min:i.min,max:i.max,step:i.step,value:this.value,onChange:this.handleChange,disabled:t,overrides:{Root:{style:{paddingTop:h.twoThirdsSmFont}},Thumb:this.renderThumb,Tick:{style:{fontFamily:l.monospace,fontSize:d.sm}},Track:{style:{backgroundColor:"none !important",paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:h.twoThirdsSmFont}},InnerTrack:{style:e=>{let{$disabled:t}=e;return{height:"4px",...t?{background:a.darkenedBgMix25}:{}}}},TickBar:this.renderTickBar}})]})}}const F=(0,a.b)(w)}}]);
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[7696],{52955:(e,t,i)=>{i.d(t,{K:()=>o});var s=i(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,i){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,s.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,i),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}},87696:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var s=i(5057),o=i(8708),n=i.n(o),a=i(55790),r=i(47206),l=i(59500),d=i(52955),h=i(60913),m=i(50120),u=i(88084),c=i.n(u),g=i(38944),p=i(93905),f=i(21034),b=i(98790),v=i(82160),T=i(59990);const y=(0,v.Z)("div",{target:"ew7r33m3"})((e=>{let{disabled:t,theme:i}=e;return{alignItems:"center",backgroundColor:t?i.colors.gray:i.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",height:i.radii.xl,justifyContent:"center",width:i.radii.xl,":focus":{outline:"none"},":focus-visible":{boxShadow:"0 0 0 0.2rem ".concat((0,T.DZ)(i.colors.primary,.5))}}}),""),R=(0,v.Z)("div",{target:"ew7r33m2"})((e=>{let{disabled:t,theme:i}=e;return{fontFamily:i.genericFonts.codeFont,fontSize:i.fontSizes.sm,paddingBottom:i.spacing.twoThirdsSmFont,color:t?i.colors.gray:i.colors.primary,top:"-22px",position:"absolute",whiteSpace:"nowrap",backgroundColor:i.colors.transparent,lineHeight:i.lineHeights.base,fontWeight:"normal"}}),""),V=(0,v.Z)("div",{target:"ew7r33m1"})((e=>{let{theme:t}=e;return{paddingBottom:t.spacing.none,paddingLeft:t.spacing.none,paddingRight:t.spacing.none,paddingTop:t.spacing.twoThirdsSmFont,justifyContent:"space-between",alignItems:"center",display:"flex"}}),""),x=(0,v.Z)("div",{target:"ew7r33m0"})((e=>{let{disabled:t,theme:i}=e;return{lineHeight:i.lineHeights.base,fontWeight:"normal",fontSize:i.fontSizes.sm,fontFamily:i.genericFonts.codeFont,color:t?i.colors.fadedText40:"inherit"}}),"");var C=i(96266);class w extends s.PureComponent{constructor(e){super(e),this.formClearHelper=new d.K,this.state=void 0,this.sliderRef=s.createRef(),this.thumbRef=[],this.thumbValueRef=[],this.commitWidgetValueDebounced=void 0,this.commitWidgetValue=e=>{this.props.widgetMgr.setDoubleArrayValue(this.props.element,this.state.value,e)},this.onFormCleared=()=>{this.setState(((e,t)=>({value:t.element.default})),(()=>this.commitWidgetValue({fromUi:!0})))},this.handleChange=e=>{let{value:t}=e;this.setState({value:t},(()=>this.commitWidgetValueDebounced({fromUi:!0})))},this.renderThumb=s.forwardRef(((e,t)=>{var i;const{$value:o,$thumbIndex:a}=e,r=a||0;this.thumbRef[r]=t,(i=this.thumbValueRef)[r]||(i[r]=s.createRef());const l=o?this.formatValue(o[a]):"",d=n()(e,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),h={};return(this.props.element.options.length>0||this.isDateTimeType())&&(h["aria-valuetext"]=l),(0,C.jsx)(y,{...d,disabled:!0===e.$disabled,ref:this.thumbRef[r],"aria-valuetext":l,"aria-label":this.props.element.label,children:(0,C.jsx)(R,{className:"StyledThumbValue","data-testid":"stThumbValue",disabled:!0===e.$disabled,ref:this.thumbValueRef[r],children:l})})})),this.renderTickBar=()=>{const{disabled:e,element:t}=this.props,{max:i,min:s}=t;return(0,C.jsxs)(V,{"data-testid":"stTickBar",children:[(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMin",children:this.formatValue(s)}),(0,C.jsx)(x,{disabled:e,"data-testid":"stTickBarMax",children:this.formatValue(i)})]})},this.commitWidgetValueDebounced=(0,m.Ds)(200,this.commitWidgetValue.bind(this)),this.state={value:this.initialValue}}get initialValue(){const e=this.props.widgetMgr.getDoubleArrayValue(this.props.element);return void 0!==e?e:this.props.element.default}componentDidMount(){setTimeout((()=>{this.thumbValueAlignment()}),0),this.props.element.setValue?this.updateFromProtobuf():this.commitWidgetValue({fromUi:!1})}componentDidUpdate(){this.maybeUpdateFromProtobuf()}componentWillUnmount(){this.formClearHelper.disconnect()}maybeUpdateFromProtobuf(){const{setValue:e}=this.props.element;e&&this.updateFromProtobuf()}updateFromProtobuf(){const{value:e}=this.props.element;this.props.element.setValue=!1,this.setState({value:e},(()=>{this.commitWidgetValue({fromUi:!1})}))}get value(){const{min:e,max:t}=this.props.element,{value:i}=this.state;let s=i[0],o=i.length>1?i[1]:i[0];return s>o&&(s=o),s<e&&(s=e),s>t&&(s=t),o<e&&(o=e),o>t&&(o=t),i.length>1?[s,o]:[s]}isDateTimeType(){const{dataType:e}=this.props.element;return e===h.iR.DataType.DATETIME||e===h.iR.DataType.DATE||e===h.iR.DataType.TIME}formatValue(e){const{format:t,options:i}=this.props.element;return this.isDateTimeType()?c().utc(e/1e3).format(t):i.length>0?(0,l.sprintf)(t,i[e]):(0,l.sprintf)(t,e)}alignValueOnThumb(e,t,i){if(e&&t&&i){const s=e.getBoundingClientRect(),o=t.getBoundingClientRect(),n=i.getBoundingClientRect(),a=o.left+o.width/2,r=a-n.width/2<s.left,l=a+n.width/2>s.right;i.style.left=r?"0":"",i.style.right=l?"0":""}}thumbValueAlignment(){var e,t,i,s;const o=this.sliderRef.current,n=null===(e=this.thumbRef[0])||void 0===e?void 0:e.current,a=null===(t=this.thumbRef[1])||void 0===t?void 0:t.current,r=null===(i=this.thumbValueRef[0])||void 0===i?void 0:i.current,l=null===(s=this.thumbValueRef[1])||void 0===s?void 0:s.current;if(this.alignValueOnThumb(o,n,r),this.alignValueOnThumb(o,a,l),o&&n&&a&&r&&l){const e=o.getBoundingClientRect(),t=n.getBoundingClientRect(),i=a.getBoundingClientRect(),s=r.getBoundingClientRect(),d=l.getBoundingClientRect();if(s.right+16>d.left){d.left-16-s.width>e.left?r.style.right="".concat(d.width+16-(i.right-t.right),"px"):l.style.left="".concat(s.width+16-(i.left-t.left),"px")}}}render(){var e;const{disabled:t,element:i,theme:s,width:o,widgetMgr:n}=this.props,{colors:r,fonts:l,fontSizes:d,spacing:h}=s,u={width:o};return this.formClearHelper.manageFormClearListener(n,i.formId,this.onFormCleared),this.thumbValueAlignment(),(0,C.jsxs)("div",{ref:this.sliderRef,className:"stSlider","data-testid":"stSlider",style:u,children:[(0,C.jsx)(g.O,{label:i.label,disabled:t,labelVisibility:(0,m.iF)(null===(e=i.labelVisibility)||void 0===e?void 0:e.value),children:i.help&&(0,C.jsx)(p.dT,{children:(0,C.jsx)(f.Z,{content:i.help,placement:b.u.TOP_RIGHT})})}),(0,C.jsx)(a.Z,{min:i.min,max:i.max,step:i.step,value:this.value,onChange:this.handleChange,disabled:t,overrides:{Root:{style:{paddingTop:h.twoThirdsSmFont}},Thumb:this.renderThumb,Tick:{style:{fontFamily:l.monospace,fontSize:d.sm}},Track:{style:{backgroundColor:"none !important",paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:h.twoThirdsSmFont}},InnerTrack:{style:e=>{let{$disabled:t}=e;return{height:"4px",...t?{background:r.darkenedBgMix25}:{}}}},TickBar:this.renderTickBar}})]})}}const F=(0,r.b)(w)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9001],{49001:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var o=r(5057),a=r(73401),n=r(98790),l=r(92649),i=r(46403),s=r(31808),d=r(41322),c=r(82160);const g=(0,c.Z)("div",{target:"e11k5jya2"})((e=>{let{}=e;return{display:"flex",flexDirection:"column"}}),""),p=(0,c.Z)("a",{target:"e11k5jya1"})((e=>{let{disabled:t,isCurrentPage:r,fluidWidth:o,theme:a}=e;return{textDecoration:"none",width:"number"==typeof o?"".concat(o,"px"):"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:a.spacing.sm,borderRadius:a.spacing.twoXS,paddingLeft:a.spacing.sm,paddingRight:a.spacing.sm,marginTop:a.spacing.threeXS,marginBottom:a.spacing.threeXS,lineHeight:a.lineHeights.menuItem,backgroundColor:r?a.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:r?a.colors.darkenedBgMix25:a.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:a.colors.darkenedBgMix15},"@media print":{paddingLeft:a.spacing.none},...t?{borderColor:a.colors.fadedText10,backgroundColor:a.colors.transparent,color:a.colors.fadedText40,cursor:"not-allowed","&:hover":{color:a.colors.fadedText40,backgroundColor:a.colors.transparent}}:{}}}),""),u=(0,c.Z)("span",{target:"e11k5jya0"})((e=>{let{disabled:t,theme:r}=e;return{color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...t?{borderColor:r.colors.fadedText10,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}}),"");var h=r(96266);const x=function(e){const{onPageChange:t,currentPageScriptHash:r}=o.useContext(s.E),c=o.useContext(d.Z),{disabled:x,element:b,width:f}=e,k={width:f},C=function(e,t){return!(null!==e||!t)||!(null===e&&!t)&&!0===e}(b.useContainerWidth,c),m=r===b.pageScriptHash;return(0,h.jsx)("div",{className:"row-widget stPageLink","data-testid":"stPageLink",style:k,children:(0,h.jsx)(l.t,{help:b.help,placement:n.u.TOP_RIGHT,children:(0,h.jsx)(g,{children:(0,h.jsxs)(p,{"data-testid":"stPageLink-NavLink",disabled:x,isCurrentPage:m,fluidWidth:!!C&&f,href:b.page,target:b.external?"_blank":"",rel:"noreferrer",onClick:e=>{b.external?x&&e.preventDefault():(e.preventDefault(),x||t(b.pageScriptHash))},children:[b.icon&&(0,h.jsx)(a.S,{size:"lg",children:b.icon}),(0,h.jsx)(u,{disabled:x,children:(0,h.jsx)(i.ZP,{source:b.label,allowHTML:!1,isLabel:!0,boldLabel:m,largerLabel:!0,disableLinks:!0})})]})})})})}}}]);
@@ -1 +1 @@
1
- "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9699],{96260:(e,t,n)=>{n.r(t),n.d(t,{default:()=>kt});var i=n(5057),o=n(66751),a=n(27179),l=n(23046),r=n(30383),s=n(61078),d=n(83221),c=n(52955),u=n(50651),m=n(60913),h=n(50120),g=n(47206),p=n(18932),f=n(93576),b=n(46403),v=n(98790),y=n(38830),w=n(44088),x=n(73401),C=n(31808),T=n(82160),k=n(96601);const E=(0,T.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:"0.5rem 0 0.5rem 0.5rem",position:"absolute",top:n?"-2.4rem":"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"},...i&&{["".concat(i,":hover &, ").concat(i,":active &, ").concat(i,":focus-visible &")]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"}}}}}),""),M=(0,T.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,k.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.lg,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var N=n(96266);function R(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const a=(0,g.u)(),l=n?t:"";return(0,N.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,N.jsx)(v.Z,{content:(0,N.jsx)(b.ZP,{source:t,allowHTML:!1,style:{fontSize:a.fontSizes.sm}}),placement:v.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,N.jsxs)(y.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:w.nW.ELEMENT_TOOLBAR,children:[i&&(0,N.jsx)(x.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),l&&(0,N.jsx)("span",{children:l})]})})})}const S=e=>{let{onExpand:t,onCollapse:n,isFullScreen:o,locked:a,children:l,target:r}=e;const{libConfig:s}=i.useContext(C.E);return(0,N.jsx)(E,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||o,target:r,children:(0,N.jsxs)(M,{children:[l,t&&!s.disableFullscreenMode&&!o&&(0,N.jsx)(R,{label:"Fullscreen",icon:p.i,onClick:()=>t()}),n&&!s.disableFullscreenMode&&o&&(0,N.jsx)(R,{label:"Close fullscreen",icon:f.m,onClick:()=>n()})]})})};var _=n(26849),O=n.n(_),I=n(40807),D=n.n(I),H=n(61918),A=n.n(H),z=n(59500),V=n(88084),F=n.n(V);n(56719),n(21763);const j=["true","t","yes","y","on","1"],L=["false","f","no","n","off","0"];function W(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function B(e){return e.hasOwnProperty("isError")&&e.isError}function P(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function Y(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function Z(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function q(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function J(e,t){return(0,h.le)(e)?t||{}:(0,h.le)(t)?e||{}:D()(e,t)}function K(e){if((0,h.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),"string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:X(e))):[X(t)]}catch(t){return[X(e)]}}function X(e){try{try{return O()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return"[".concat(typeof e,"]")}}function G(e){if((0,h.le)(e))return null;if("boolean"===typeof e)return e;const t=X(e).toLowerCase().trim();return""===t?null:!!j.includes(t)||!L.includes(t)&&void 0}function U(e){if((0,h.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=A().unformat(e.trim());if((0,h.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Q(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,h.le)(t)||""===t?(0===n&&(e=Math.round(e)),A()(e).format((0,h.bb)(n)?"0,0.".concat("0".repeat(n)):"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):"duration[ns]"===t?F().duration(e/1e6,"milliseconds").humanize():(0,z.sprintf)(t,e)}function $(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function ee(e){if((0,h.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=F().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=F().utc(e);if(t.isValid())return t.toDate();const n=F().utc(e,[F().HTML5_FMT.TIME_MS,F().HTML5_FMT.TIME_SECONDS,F().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function te(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const ne=new RegExp(/(\r\n|\n|\r)/gm);function ie(e){return-1!==e.indexOf("\n")?e.replace(ne," "):e}var oe=n(70714),ae=n(87241);function le(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,h.bb)(e)?X(e):null,i=(0,h.bb)(n)?ie(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,h.le)(e)}}catch(n){return W(X(e),"The value cannot be interpreted as a string. Error: ".concat(n))}},getCellValue:e=>void 0===e.data?null:e.data}}le.isEditableType=!1;const re=le;function se(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(l)}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},a=i=>{if((0,h.le)(i))return!e.isRequired;let o=X(i),a=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),a=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!a||o)};return{...e,kind:"text",sortMode:"default",validateInput:a,getCell(e,t){if("string"===typeof n)return W(X(e),n);if(t){const t=a(e);if(!1===t)return W(X(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,h.bb)(e)?X(e):null,n=(0,h.bb)(t)?ie(t):"";return{...i,isMissingValue:(0,h.le)(t),data:t,displayData:n}}catch(l){return W("Incompatible value","The value cannot be interpreted as string. Error: ".concat(l))}},getCellValue:e=>void 0===e.data?null:e.data}}se.isEditableType=!0;const de=se;function ce(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function ue(e,t,n,i,a,l,r){var s;const d=J({format:n,step:i,timezone:r},t.columnTypeOptions);let c,u,m;if((0,h.bb)(d.timezone))try{var g;c=(null===(g=ce(F()(),d.timezone))||void 0===g?void 0:g.utcOffset())||void 0}catch(b){}(0,h.bb)(d.min_value)&&(u=ee(d.min_value)||void 0),(0,h.bb)(d.max_value)&&(m=ee(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:a,min:u,max:m}},f=e=>{const n=ee(e);return null===n?!t.isRequired:void 0!==n&&(!((0,h.bb)(u)&&l(n)<l(u))&&!((0,h.bb)(m)&&l(n)>l(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return W(X(e),"Invalid input.");t instanceof Date&&(e=t)}const i=ee(e);let o="",a="",l=c;if(void 0===i)return W(X(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=F().utc(i);if(!e.isValid())return W(X(i),"This should never happen. Please report this bug. \nError: ".concat(e.toString()));if(d.timezone){try{e=ce(e,d.timezone)}catch(b){return W(e.toISOString(),"Failed to adjust to the provided timezone: ".concat(d.timezone,". \nError: ").concat(b))}l=e.utcOffset()}try{a=$(e,d.format||n)}catch(b){return W(e.toISOString(),"Failed to format the date for rendering with: ".concat(d.format,". \nError: ").concat(b))}o=$(e,n)}return{...p,copyData:o,isMissingValue:(0,h.le)(i),data:{...p.data,date:i,displayDate:a,timezoneOffset:l}}},getCellValue(e){var t;return(0,h.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:l(e.data.date)}}}function me(e){var t,n,i,o;let a="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?a="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(a="YYYY-MM-DD HH:mm:ss.SSS");const l=null===(i=e.arrowType)||void 0===i||null===(i=i.meta)||void 0===i?void 0:i.timezone,r=(0,h.bb)(l)||(0,h.bb)(null===e||void 0===e||null===(o=e.columnTypeOptions)||void 0===o?void 0:o.timezone);return ue("datetime",e,r?a+"Z":a,1,"datetime-local",(e=>r?e.toISOString():e.toISOString().replace("Z","")),l)}function he(e){var t,n;let i="HH:mm:ss";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(i="HH:mm:ss.SSS"),ue("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function ge(e){return ue("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function pe(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=G(e),void 0===n?W(X(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,h.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}me.isEditableType=!0,he.isEditableType=!0,ge.isEditableType=!0,pe.isEditableType=!0;const fe=pe;function be(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function ve(e){const t=ae.fu.getTypeName(e.arrowType),n=J({step:be(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:"timedelta64[ns]"===t?"duration[ns]":void 0},e.columnTypeOptions),i=(0,h.le)(n.min_value)||n.min_value<0,a=(0,h.bb)(n.step)&&!Number.isNaN(n.step)?te(n.step):void 0,l={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:i,fixedDecimals:a},r=t=>{let i=U(t);if((0,h.le)(i))return!e.isRequired;if(Number.isNaN(i))return!1;let o=!1;return(0,h.bb)(n.max_value)&&i>n.max_value&&(i=n.max_value,o=!0),!((0,h.bb)(n.min_value)&&i<n.min_value)&&(!o||i)};return{...e,kind:"number",sortMode:"smart",validateInput:r,getCell(e,t){if(!0===t){const t=r(e);if(!1===t)return W(X(e),"Invalid input.");"number"===typeof t&&(e=t)}let i=U(e),o="";if((0,h.bb)(i)){if(Number.isNaN(i))return W(X(e),"The value cannot be interpreted as a number.");if((0,h.bb)(a)&&(s=i,i=0===(d=a)?Math.trunc(s):Math.trunc(s*10**d)/10**d),Number.isInteger(i)&&!Number.isSafeInteger(i))return W(X(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=Q(i,n.format,a)}catch(c){return W(X(i),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(c):"Failed to format the number. Error: ".concat(c))}}var s,d;return{...l,data:i,displayData:o,isMissingValue:(0,h.le)(i)}},getCellValue:e=>void 0===e.data?null:e.data}}ve.isEditableType=!0;const ye=ve;function we(e){let t="string";const n=J({options:"bool"===ae.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const a={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>X(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,h.bb)(e)&&""!==e&&(n=X(e)),t&&!a.data.allowedValues.includes(n)?W(X(n),"The value is not part of the allowed options."):{...a,isMissingValue:null===n,copyData:n||"",data:{...a.data,value:n}}},getCellValue(e){var n,i,o,a,l,r,s;return(0,h.le)(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(a=U(null===(l=e.data)||void 0===l?void 0:l.value))&&void 0!==a?a:null:"boolean"===t?null!==(r=G(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==r?r:null:null===(o=e.data)||void 0===o?void 0:o.value}}}we.isEditableType=!0;const xe=we;function Ce(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.le)(e)?[]:K(e);return{...t,data:n,isMissingValue:(0,h.le)(e),copyData:(0,h.le)(e)?"":X(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,h.le)(e.data)||P(e)?null:e.data}}Ce.isEditableType=!1;const Te=Ce;function ke(e,t,n){const i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Ee(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===ae.fu.getTypeName(n)&&(o=!1),{id:"index-".concat(t),name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Me(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,h.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===ae.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,h.bb)(n)&&(i={options:n})}return{id:"column-".concat(n,"-").concat(t),name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function Ne(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?ae.fu.getTypeName(e.arrowType):null;let a;if("object"===e.kind)a=e.getCell((0,h.bb)(t.content)?ie(ae.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,h.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var l;let n;var r,s;if("time"===i&&(0,h.bb)(null===(l=t.field)||void 0===l||null===(l=l.type)||void 0===l?void 0:l.unit))n=F().unix(ae.fu.convertToSeconds(t.content,null!==(r=null===(s=t.field)||void 0===s||null===(s=s.type)||void 0===s?void 0:s.unit)&&void 0!==r?r:0)).utc().toDate();else n=F().utc(Number(t.content)).toDate();a=e.getCell(n)}else if("decimal"===i){const n=(0,h.le)(t.content)?null:ae.fu.format(t.content,t.contentType,t.field);a=e.getCell(n)}else a=e.getCell(t.content);if(B(a))return a;if(!e.isEditable){if((0,h.bb)(t.displayContent)){var d,c;const e=ie(t.displayContent);a.kind===o.p6.Text||a.kind===o.p6.Number?a={...a,displayData:e}:a.kind===o.p6.Custom&&"date-picker-cell"===(null===(d=a.data)||void 0===d?void 0:d.kind)?a={...a,data:{...a.data,displayDate:e}}:a.kind===o.p6.Custom&&"link-cell"===(null===(c=a.data)||void 0===c?void 0:c.kind)&&(a={...a,data:{...a.data,displayText:e}})}n&&t.cssId&&(a=function(e,t,n){const i={},o=ke(t,"color",n);o&&(i.textDark=o);const a=ke(t,"background-color",n);return a&&(i.bgCell=a),"yellow"===a&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(a,t.cssId,n))}return a}function Re(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(r)}if(!(0,h.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(r){i=void 0}const a={kind:o.p6.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"link-cell",href:"",displayText:""},copyData:""},l=i=>{if((0,h.le)(i))return!e.isRequired;const o=X(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:l,getCell(e,o){if((0,h.le)(e))return{...a,data:{...a.data,href:null},isMissingValue:!0};const s=e;if("string"===typeof n)return W(X(s),n);if(o){if(!1===l(s))return W(X(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,h.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?n[1]:t}catch(r){return t}}(i,s):t.display_text||s),{...a,data:{kind:"link-cell",href:s,displayText:d},copyData:s,cursor:"pointer",isMissingValue:(0,h.le)(s)}},getCellValue(e){var t;return(0,h.le)(null===(t=e.data)||void 0===t?void 0:t.href)?null:e.data.href}}}Re.isEditableType=!0;const Se=Re;function _e(e){const t={kind:o.p6.Image,data:[],displayData:[],allowAdd:!1,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.bb)(e)?[X(e)]:[];return{...t,data:n,isMissingValue:!(0,h.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}_e.isEditableType=!1;const Oe=_e;function Ie(e){const t=be(ae.fu.getTypeName(e.arrowType)),n=J({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=Q(n.max_value,n.format)}catch(r){i=X(n.max_value)}const a=(0,h.le)(n.step)||Number.isNaN(n.step)?void 0:te(n.step),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,h.le)(e))return Y();if((0,h.le)(n.min_value)||(0,h.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return W("Invalid min/max parameters","The min_value (".concat(n.min_value,") and max_value (").concat(n.max_value,") parameters must be valid numbers."));if((0,h.le)(n.step)||Number.isNaN(n.step))return W("Invalid step parameter","The step parameter (".concat(n.step,") must be a valid number."));const t=U(e);if(Number.isNaN(t)||(0,h.le)(t))return W(X(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return W(X(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=Q(t,n.format,a)}catch(r){return W(X(t),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(r):"Failed to format the number. Error: ".concat(r))}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...l,isMissingValue:(0,h.le)(e),copyData:String(t),data:{...l.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}}}Ie.isEditableType=!1;const De=Ie;function He(e,t,n){const i=J({y_min:0,y_max:1},t.columnTypeOptions),a={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,h.le)(i.y_min)||(0,h.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return W("Invalid min/max y-axis configuration","The y_min (".concat(i.y_min,") and y_max (").concat(i.y_max,") configuration options must be valid numbers."));if((0,h.le)(e))return Y();const t=K(e),o=[];let l=[];if(0===t.length)return Y();let r=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;for(let n=0;n<t.length;n++){const e=U(t[n]);if(Number.isNaN(e)||(0,h.le)(e))return W(X(t),"The value cannot be interpreted as a numeric array. ".concat(X(e)," is not a number."));e>r&&(r=e),e<s&&(s=e),o.push(e)}return"line"===n&&o.length<=2?Y():(l=o.length>0&&(r>i.y_max||s<i.y_min)?o.map((e=>r-s===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-s)/(r-s))+(i.y_min||0))):o,{...a,copyData:o.join(","),data:{...a.data,values:l,displayValues:o.map((e=>Q(e)))},isMissingValue:(0,h.le)(e)})},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}}}function Ae(e){return He("line_chart",e,"line")}function ze(e){return He("bar_chart",e,"bar")}Ae.isEditableType=!1,ze.isEditableType=!1;const Ve=(0,T.Z)("div",{target:"ex7xuzc0"})({name:"iatp2c",styles:"display:flex;flex-grow:1;align-items:center;min-height:21px;.gdg-link-area{flex-grow:1;flex-shrink:1;cursor:pointer;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gdg-link-color);text-decoration:underline!important;padding-bottom:3px;}"}),Fe=e=>{const{uri:t,onChange:n,readonly:i,validatedSelection:a,preview:l}=e;return i?(0,N.jsx)(Ve,{children:(0,N.jsx)("a",{"data-testid":"stLinkCell",className:"gdg-link-area",href:null!==t&&void 0!==t?t:"",target:"_blank",rel:"noopener noreferrer",children:l})}):(0,N.jsx)(o.t5,{validatedSelection:a,highlight:!0,autoFocus:!0,value:null!==t&&void 0!==t?t:"",onChange:n})};const je={draw:(e,t)=>{const{ctx:n,rect:i,theme:a,hoverX:l=-100}=e,{href:r,displayText:s}=t.data;if((0,h.le)(r))return;const d=s||r,c=a.cellHorizontalPadding,u=i.x+c,m=i.x+l,g="".concat(a.baseFontStyle," ").concat(a.fontFamily);n.font=g;const p=(0,o.aX)(n,g),f=i.y+i.height/2+p;if(m>i.x&&m<i.x+i.width){const e=(0,o.P7)(d,n,g);n.moveTo(u,Math.floor(f+5)+.5),n.lineTo(u+e.width,Math.floor(f+5)+.5),n.strokeStyle=a.linkColor,n.stroke()}return n.fillStyle=a.linkColor,n.fillText(d,u,f),n.closePath(),!0},isMatch:e=>"link-cell"===e.data.kind,kind:o.p6.Custom,measure:(e,t,n)=>{const{href:i,displayText:o}=t.data;return(0,h.le)(i)?0:e.measureText(o||i).width+2*n.cellHorizontalPadding},needsHover:!0,needsHoverPosition:!0,onSelect:e=>{const t=function(e){var t;const n=document.createElement("canvas").getContext("2d",{alpha:!1});if(null===n)return;const{posX:i,bounds:o,cell:a,theme:l}=e,r="".concat(l.baseFontStyle," ").concat(l.fontFamily);n.font=r;const{href:s,displayText:d}=a.data,c=o.x+i,u=n.measureText(null!==(t=d||s)&&void 0!==t?t:"").width,m=o.x+l.cellHorizontalPadding;return c>m&&c<m+u?s:void 0}(e);(0,h.le)(t)||window.open(t,"_blank","noopener,noreferrer")},onDelete:e=>({...e,data:{...e.data,displayText:"",href:""}}),provideEditor:()=>e=>{var t;const{onChange:n,value:i,validatedSelection:o}=e,{href:a,displayText:l}=i.data;return(0,N.jsx)(Fe,{uri:i.data.href,preview:null!==(t=l||a)&&void 0!==t?t:"",validatedSelection:o,readonly:!0===i.readonly,onChange:e=>n({...i,copyData:e.target.value,data:{...i.data,href:e.target.value}})})},onPaste:(e,t)=>e===t.href?void 0:{...t,href:e}},Le=new Map(Object.entries({object:re,text:de,checkbox:fe,selectbox:xe,list:Te,number:ye,link:Se,datetime:me,date:ge,time:he,line_chart:Ae,bar_chart:ze,image:Oe,progress:De})),We=[je],Be="_index",Pe="_pos:",Ye={small:75,medium:200,large:400};function Ze(e){if(!(0,h.le)(e))return"number"===typeof e?e:e in Ye?Ye[e]:void 0}function qe(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Be?n=t.get(e.name):t.has("".concat(Pe).concat(e.indexNumber))?n=t.get("".concat(Pe).concat(e.indexNumber)):e.isIndex&&t.has(Be)&&(n=t.get(Be)),n?D()({...e},{title:n.label,width:Ze(n.width),isEditable:(0,h.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function Je(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,h.bb)(n)&&(Le.has(n)?i=Le.get(n):(0,oe.KE)("Unknown column type configured in column configuration: ".concat(n))),(0,h.le)(i)&&(i=function(e){let t=e?ae.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?de:["datetime","datetimetz"].includes(t)?me:"time"===t?he:"date"===t?ge:["object","bytes"].includes(t)?re:["bool"].includes(t)?fe:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?ye:"categorical"===t?xe:t.startsWith("list")?Te:re):re}(e.arrowType)),i}const Ke=function(e,t,n){const o=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,oe.H)(t),new Map}}(e.columns)),[e.columns]),a=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){var t,n,i,o;const a=[],l=null!==(t=null===(n=e.types)||void 0===n||null===(n=n.index)||void 0===n?void 0:n.length)&&void 0!==t?t:0,r=null!==(i=null===(o=e.columns)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.length)&&void 0!==i?i:0;if(0===l&&0===r)return a.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),a;for(let s=0;s<l;s++){const t={...Ee(e,s),indexNumber:s};a.push(t)}for(let s=0;s<r;s++){const t={...Me(e,s),indexNumber:s+l};a.push(t)}return a}(t).map((t=>{let i={...t,...qe(t,o),isStretched:a};const l=Je(i);return(e.editingMode===m.Eh.EditingMode.READ_ONLY||n||!1===l.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==m.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&(i={...i,isHidden:!1})),l(i)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[re({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,o,a,n,e.editingMode,e.columnOrder])}};function Xe(e){return e.isIndex?Be:(0,h.le)(e.name)?"":e.name}const Ge=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const a={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(a[Xe(o)]=o.getCellValue(e))})),n.edited_rows[i]=a})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,a)=>{const l=t.get(n);if(l){const t=l.getCellValue(e);l.isRequired&&l.isEditable&&P(e)&&(o=!0),(0,h.bb)(t)&&(i[Xe(l)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Xe(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],a=o.get(e);if(a){const e=a.getCell(n);var l;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(l=this.editedCells.get(t))||void 0===l||l.set(a.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const t=new Map;Object.keys(e).forEach((n=>{const i=e[n],a=o.get(n);if(a){const e=a.getCell(i);e&&t.set(a.indexNumber,e)}})),this.addedRows.push(t)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map);this.editedCells.get(t).set(e,n)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,h.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var Ue=n(59990);const Qe=function(){const e=(0,g.u)(),t=i.useMemo((()=>({editable:e=>'<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="'.concat(e.bgColor,'"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>')})),[]);return{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,Ue.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Ue.DZ)(e.colors.primary,.9),bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:"".concat(e.fontSizes.sm),baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,Ue.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25,tableBorderRadius:e.radii.lg,headerIcons:t}};const $e=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[a,l]=i;if(a>t.length-1)return W("Column index out of bounds.","This should never happen. Please report this bug.");if(l>n-1)return W("Row index out of bounds.","This should never happen. Please report this bug.");const r=t[a],s=r.indexNumber,d=o.current.getOriginalRowIndex(l);if(r.isEditable||o.current.isAddedRow(d)){const e=o.current.getCell(s,d);if(void 0!==e)return e}try{return Ne(r,e.getCell(d+1,s),e.cssStyles)}catch(c){return(0,oe.H)(c),W("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(c))}}),[t,n,e,o])}};var et=n(33256);const tt=function(e,t,n){const[o,a]=i.useState(),{getCellContent:l,getOriginalIndex:r}=(0,et.fF)({columns:t.map((e=>q(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void a(void 0);t="desc"}a({column:q(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:r,getCellContent:l}};var nt=n(95599);const it=",",ot='"',at='"',lt="\n";function rt(e){return e.map((e=>function(e){if((0,h.le)(e))return"";const t=X(e);if(new RegExp("[".concat([it,ot,lt].join(""),"]")).test(t))return"".concat(ot).concat(t.replace(new RegExp(ot,"g"),at+ot)).concat(ot);return t}(e))).join(it)+lt}const st=function(e,t,n){return{exportToCsv:i.useCallback((async()=>{const i=(new Date).toISOString().slice(0,16).replace(":","-"),o="".concat(i,"_export.csv"),a=await(0,nt.Kr)({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),l=new TextEncoder,r=await a.createWritable();await r.write(l.encode("\ufeff"));const s=t.map((e=>e.name));await r.write(l.encode(rt(s)));for(let d=0;d<n;d++){const n=[];t.forEach(((t,i,o)=>{n.push(t.getCellValue(e([i,d])))})),await r.write(l.encode(rt(n)))}await r.close()}),[t,n,e])}};const dt=function(e,t,n,o,a,l,r){const s=i.useCallback(((t,i)=>{let[l,s]=t;const d=e[l];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(a(s)),m=o([l,s]),h=d.getCellValue(m),g=d.getCellValue(i);if(!B(m)&&g===h)return;const p=d.getCell(g,!0);B(p)?(0,oe.KE)("Not applying the cell edit since it causes this error:\n ".concat(p.data)):(n.current.setCell(c,u,{...p,lastUpdated:performance.now()}),r())}),[e,n,a,o,r]),d=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i)}),[e,n,t]),c=i.useCallback((()=>{t||(d(),r())}),[d,r,t]),u=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(a(e))));return n.current.deleteRows(e),r(!0),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),s([o,i],n.getCell(null)))}return t.length>0&&(r(),l(t)),!1}return!0}),[e,n,t,l,a,r,s]),m=i.useCallback(((i,s)=>{const[c,u]=i,m=[];for(let g=0;g<s.length;g++){const i=s[g];if(g+u>=n.current.getNumRows()){if(t)break;d()}for(let t=0;t<i.length;t++){const l=i[t],r=g+u,s=t+c;if(s>=e.length)break;const d=e[s];if(d.isEditable){const e=d.getCell(l,!0);if((0,h.bb)(e)&&!B(e)){const t=d.indexNumber,i=n.current.getOriginalRowIndex(a(r)),l=d.getCellValue(o([s,r]));d.getCellValue(e)!==l&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,r]}))}}}m.length>0&&(r(),l(m))}return!1}),[e,n,t,a,o,d,r,l]),g=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:s,onPaste:m,onRowAppended:c,onDelete:u,validateCell:g}};const ct=function(e,t){const[n,o]=i.useState(),a=i.useRef(null),l=i.useCallback((n=>{if(clearTimeout(a.current),a.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],l=n.location[1];let r;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,h.bb)(s))r=s.help;else if("cell"===n.kind){const e=t([i,l]);s.isRequired&&s.isEditable&&P(e)?r="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(r=e.tooltip)}r&&(a.current=setTimeout((()=>{r&&o({content:r,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,a]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:l}};var ut=n(8751);const mt=function(e,t){return{drawCell:i.useCallback((n=>{const{cell:i,theme:a,ctx:l,rect:r}=n,s=t?n.col-1:n.col;if(P(i)&&s<e.length){let t=!1;const i=e[s];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)||((e=>{const{cell:t,theme:n}=e;(0,o.uN)({...e,theme:{...n,textDark:n.textLight,textMedium:n.textLight},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign)})(n),t=!0),i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(l,r,a),t}return!1}),[e,t]),customRenderers:[...(0,ut.Bn)().customRenderers,...We]}};const ht=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,a)=>{e.id&&n(new Map(t).set(e.id,a))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},gt=35,pt=2*gt+3;const ft=function(e,t,n,o,a){let l,r=function(e){return Math.max(e*gt+1+2,pt)}(t+1+(e.editingMode===m.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(r,400);e.height&&(s=Math.max(e.height,pt),r=Math.max(e.height,r)),o&&(s=Math.min(s,o),r=Math.min(r,o),e.height||(s=r));let d=n;e.useContainerWidth?l=n:e.width&&(l=Math.min(Math.max(e.width,52),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:l||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:l||"100%",height:c.height})}),[l]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(a){const t=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:r})}else u({width:l||"100%",height:s})}),[a]),{minHeight:pt,maxHeight:r,minWidth:52,maxWidth:d,resizableSize:c,setResizableSize:u}},bt=(0,T.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),vt=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,N.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,N.jsx)(bt,{src:n})}):(0,N.jsx)(bt,{src:n})};var yt=n(98399),wt=n(73830),xt=n(37661);const Ct=function(e){let{top:t,left:n,content:o,clearTooltip:a}=e;const[l,r]=i.useState(!0),s=(0,g.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{r(!1),a()}),[a,r]);return(0,N.jsx)(yt.Z,{content:(0,N.jsx)(xt.Uo,{className:"stTooltipContent",children:(0,N.jsx)(b.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:wt.r4.top,accessibilityType:wt.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,k.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:l,children:(0,N.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Tt=(0,T.Z)("div",{target:"e1w7nams0"})((e=>{let{theme:t}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.lg},"& .dvn-scroller":{scrollbarWidth:"thin",overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(27235),n(33091);const kt=(0,u.Z)((function(e){let{element:t,data:n,width:u,height:g,disabled:p,widgetMgr:f,isFullScreen:b,expand:v,collapse:y}=e;const w=i.useRef(null),x=i.useRef(null),C=i.useRef(null),T=Qe(),[k,E]=i.useState(!0),[M,_]=i.useState(!1),[O,I]=i.useState(!1),[D,H]=i.useState(!1),A=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),z=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]),[V,F]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),j=i.useCallback((()=>{F({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0})}),[]),L=i.useCallback((()=>{F({columns:V.columns,rows:V.rows,current:void 0})}),[V]),W=i.useCallback((e=>{var t;null===(t=x.current)||void 0===t||t.updateCells(e)}),[]);(0,h.le)(t.editingMode)&&(t.editingMode=m.Eh.EditingMode.READ_ONLY);const{READ_ONLY:B,DYNAMIC:P}=m.Eh.EditingMode,Y=n.dimensions,J=Math.max(0,Y.rows-1),K=0===J&&!(t.editingMode===P&&Y.dataColumns>0),X=J>15e4,G=i.useRef(new Ge(J)),[U,Q]=i.useState(G.current.getNumRows());i.useEffect((()=>{G.current=new Ge(J),Q(G.current.getNumRows())}),[J]);const $=i.useCallback((()=>{G.current=new Ge(J),Q(G.current.getNumRows())}),[J]),{columns:ee}=Ke(t,n,p);i.useEffect((()=>{if(t.editingMode!==B){const e=f.getStringValue(t);e&&(G.current.fromJson(e,ee),Q(G.current.getNumRows()))}}),[]);const{getCellContent:te}=$e(n,ee,U,G),{columns:ne,sortColumn:ie,getOriginalIndex:oe,getCellContent:ae}=tt(J,ee,te),le=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];U!==G.current.getNumRows()&&Q(G.current.getNumRows()),e&&j(),(0,h.Ds)(100,(()=>{const e=G.current.toJson(ne);let i=f.getStringValue(t);void 0===i&&(i=new Ge(0).toJson([])),e!==i&&f.setStringValue(t,e,{fromUi:n})}))()}),[f,t,U,j,ne]),{exportToCsv:re}=st(ae,ne,U),{onCellEdited:se,onPaste:de,onRowAppended:ce,onDelete:ue,validateCell:me}=dt(ne,t.editingMode!==P,G,ae,oe,W,le),{tooltip:he,clearTooltip:ge,onItemHovered:pe}=ct(ne,ae),{drawCell:fe,customRenderers:be}=mt(ne,t.editingMode===P),{columns:ve,onColumnResize:ye}=ht(ne.map((e=>q(e)))),{minHeight:we,maxHeight:xe,minWidth:Ce,maxWidth:Te,resizableSize:ke,setResizableSize:Ee}=ft(t,U,u,g,b),Me=i.useCallback((e=>{let[t,n]=e;return{...Z(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(ne.length-1,0)]}}),[ne,T.textLight]);i.useEffect((()=>{const e=new c.K;return e.manageFormClearListener(f,t.formId,$),()=>{e.disconnect()}}),[t.formId,$,f]);const Ne=!K&&t.editingMode===P&&!p,Re=V.rows.length>0,Se=void 0!==V.current,_e=K?0:ne.filter((e=>e.isIndex)).length;return i.useEffect((()=>{if(C.current){var e;const t=null===(e=C.current)||void 0===e||null===(e=e.querySelector(".dvn-stack"))||void 0===e?void 0:e.getBoundingClientRect();t&&(I(t.height>C.current.clientHeight),H(t.width>C.current.clientWidth))}}),[ke,U,ve]),(0,N.jsxs)(Tt,{"data-testid":"stDataFrame",className:"stDataFrame",ref:C,onMouseDown:e=>{if(C.current&&z){const t=C.current.getBoundingClientRect();D&&t.height-7<e.clientY-t.top&&e.stopPropagation(),O&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{k||A||e.currentTarget.contains(e.relatedTarget)||L()},children:[(0,N.jsxs)(S,{isFullScreen:b,locked:Re||Se||A&&k,onExpand:v,onCollapse:y,target:Tt,children:[Ne&&Re&&(0,N.jsx)(R,{label:"Delete row(s)",icon:l.H,onClick:()=>{ue&&(ue(V),ge())}}),Ne&&!Re&&(0,N.jsx)(R,{label:"Add row",icon:r.m,onClick:()=>{ce&&(E(!0),ce(),ge())}}),!X&&!K&&(0,N.jsx)(R,{label:"Download as CSV",icon:s.k,onClick:()=>re()}),!K&&(0,N.jsx)(R,{label:"Search",icon:d.o,onClick:()=>{M?_(!1):(E(!0),_(!0)),ge()}})]}),(0,N.jsx)(a.e,{"data-testid":"stDataFrameResizable",ref:w,defaultSize:ke,style:{border:"1px solid ".concat(T.borderColor),borderRadius:"".concat(T.tableBorderRadius)},minHeight:we,maxHeight:xe,minWidth:Ce,maxWidth:Te,size:ke,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,gt],snapGap:gt/3,onResizeStop:(e,t,n,i)=>{w.current&&Ee({width:w.current.size.width,height:xe-w.current.size.height===3?w.current.size.height+3:w.current.size.height})},children:(0,N.jsx)(o.Nd,{className:"glideDataEditor",ref:x,columns:ve,rows:K?1:U,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:gt,headerHeight:gt,getCellContent:K?Me:ae,onColumnResize:ye,freezeColumns:_e,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:e=>!(e>=ne.length&&(t.useContainerWidth||"100%"===ke.width)),getCellsForSelection:!0,rowMarkers:"none",rangeSelect:A?"none":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:pe,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(_((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:M,onSearchClose:()=>{_(!1),ge()},onHeaderClicked:K||X?void 0:ie,gridSelection:V,onGridSelectionChange:e=>{(k||A)&&(F(e),void 0!==he&&ge())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&k?E(!1):"out-of-bounds"===e.kind||k||E(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:1,...z&&{paddingBottom:D?-6:void 0,paddingRight:O?-6:void 0}},drawCell:fe,customRenderers:be,imageEditorOverride:vt,headerIcons:T.headerIcons,validateCell:me,onPaste:!1,...!K&&t.editingMode!==B&&!p&&{fillHandle:!A,onCellEdited:se,onPaste:de,onDelete:ue},...!K&&t.editingMode===P&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkerTheme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader},rowMarkers:"checkbox",rowSelectionMode:"multi",rowSelect:p?"none":"multi",onRowAppended:p?void 0:ce,onHeaderClicked:void 0}})}),he&&he.content&&(0,N.jsx)(Ct,{top:he.top,left:he.left,content:he.content,clearTooltip:ge})]})}),!0)},52955:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);
1
+ "use strict";(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[9699],{96260:(e,t,n)=>{n.r(t),n.d(t,{default:()=>kt});var i=n(5057),o=n(66751),a=n(27179),l=n(23046),r=n(30383),s=n(61078),d=n(83221),c=n(52955),u=n(50651),m=n(60913),h=n(50120),g=n(47206),p=n(18932),f=n(93576),b=n(46403),v=n(98790),y=n(38830),w=n(44088),x=n(73401),C=n(31808),T=n(82160),k=n(96601);const E=(0,T.Z)("div",{target:"e2wxzia1"})((e=>{let{theme:t,locked:n,target:i}=e;return{padding:"0.5rem 0 0.5rem 0.5rem",position:"absolute",top:n?"-2.4rem":"-1rem",right:t.spacing.none,transition:"none",...!n&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"},...i&&{["".concat(i,":hover &, ").concat(i,":active &, ").concat(i,":focus-visible &")]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:"-2.4rem"}}}}}),""),M=(0,T.Z)("div",{target:"e2wxzia0"})((e=>{let{theme:t}=e;return{color:(0,k.Iy)(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.lg,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1}}),"");var N=n(96266);function R(e){let{label:t,show_label:n,icon:i,onClick:o}=e;const a=(0,g.u)(),l=n?t:"";return(0,N.jsx)("div",{"data-testid":"stElementToolbarButton",children:(0,N.jsx)(v.Z,{content:(0,N.jsx)(b.ZP,{source:t,allowHTML:!1,style:{fontSize:a.fontSizes.sm}}),placement:v.u.TOP,onMouseEnterDelay:1e3,inline:!0,children:(0,N.jsxs)(y.ZP,{onClick:e=>{o&&o(),e.stopPropagation()},kind:w.nW.ELEMENT_TOOLBAR,children:[i&&(0,N.jsx)(x.Z,{content:i,size:"md",testid:"stElementToolbarButtonIcon"}),l&&(0,N.jsx)("span",{children:l})]})})})}const S=e=>{let{onExpand:t,onCollapse:n,isFullScreen:o,locked:a,children:l,target:r}=e;const{libConfig:s}=i.useContext(C.E);return(0,N.jsx)(E,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||o,target:r,children:(0,N.jsxs)(M,{children:[l,t&&!s.disableFullscreenMode&&!o&&(0,N.jsx)(R,{label:"Fullscreen",icon:p.i,onClick:()=>t()}),n&&!s.disableFullscreenMode&&o&&(0,N.jsx)(R,{label:"Close fullscreen",icon:f.m,onClick:()=>n()})]})})};var _=n(26849),O=n.n(_),I=n(40807),D=n.n(I),H=n(61918),A=n.n(H),z=n(59500),V=n(88084),F=n.n(V);n(56719),n(21763);const j=["true","t","yes","y","on","1"],L=["false","f","no","n","off","0"];function W(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e="\u26a0\ufe0f ".concat(e),{kind:o.p6.Text,readonly:!0,allowOverlay:!0,data:e+(t?"\n\n".concat(t,"\n"):""),displayData:e,isError:!0}}function B(e){return e.hasOwnProperty("isError")&&e.isError}function P(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function Y(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?{kind:o.p6.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:o.p6.Loading,allowOverlay:!1}}function Z(e,t){const n=t?"faded":"normal";return{kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function q(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function J(e,t){return(0,h.le)(e)?t||{}:(0,h.le)(t)?e||{}:D()(e,t)}function K(e){if((0,h.le)(e))return[];if("number"===typeof e||"boolean"===typeof e)return[e];if(e instanceof Uint8Array&&(e=new TextDecoder("utf-8").decode(e)),"string"===typeof e){if(""===e)return[];if(!e.trim().startsWith("[")||!e.trim().endsWith("]"))return e.split(",");try{return JSON.parse(e)}catch(t){return[e]}}try{const t=JSON.parse(JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t)));return Array.isArray(t)?t.map((e=>["string","number","boolean","null"].includes(typeof e)?e:X(e))):[X(t)]}catch(t){return[X(e)]}}function X(e){try{try{return O()(e)}catch(t){return JSON.stringify(e,((e,t)=>"bigint"===typeof t?Number(t):t))}}catch(t){return"[".concat(typeof e,"]")}}function G(e){if((0,h.le)(e))return null;if("boolean"===typeof e)return e;const t=X(e).toLowerCase().trim();return""===t?null:!!j.includes(t)||!L.includes(t)&&void 0}function U(e){if((0,h.le)(e))return null;if(Array.isArray(e))return NaN;if("string"===typeof e){if(0===e.trim().length)return null;try{const t=A().unformat(e.trim());if((0,h.bb)(t))return t}catch(t){}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function Q(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":(0,h.le)(t)||""===t?(0===n&&(e=Math.round(e)),A()(e).format((0,h.bb)(n)?"0,0.".concat("0".repeat(n)):"0,0.[0000]")):"percent"===t?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):"duration[ns]"===t?F().duration(e/1e6,"milliseconds").humanize():(0,z.sprintf)(t,e)}function $(e,t){return"locale"===t?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):"distance"===t?e.fromNow():"relative"===t?e.calendar():e.format(t)}function ee(e){if((0,h.le)(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if("string"===typeof e&&0===e.trim().length)return null;try{const t=Number(e);if(!isNaN(t)){let e=t;t>=10**18?e=t/1e3**3:t>=10**15?e=t/1e6:t>=10**12&&(e=t/1e3);const n=F().unix(e).utc();if(n.isValid())return n.toDate()}if("string"===typeof e){const t=F().utc(e);if(t.isValid())return t.toDate();const n=F().utc(e,[F().HTML5_FMT.TIME_MS,F().HTML5_FMT.TIME_SECONDS,F().HTML5_FMT.TIME]);if(n.isValid())return n.toDate()}}catch(t){return}}function te(e){if(e%1===0)return 0;let t=e.toString();return-1!==t.indexOf("e")&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),-1===t.indexOf(".")?0:t.split(".")[1].length}const ne=new RegExp(/(\r\n|\n|\r)/gm);function ie(e){return-1!==e.indexOf("\n")?e.replace(ne," "):e}var oe=n(70714),ae=n(87241);function le(e){const t={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isIndex?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(e){try{const n=(0,h.bb)(e)?X(e):null,i=(0,h.bb)(n)?ie(n):"";return{...t,data:n,displayData:i,isMissingValue:(0,h.le)(e)}}catch(n){return W(X(e),"The value cannot be interpreted as a string. Error: ".concat(n))}},getCellValue:e=>void 0===e.data?null:e.data}}le.isEditableType=!1;const re=le;function se(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(l){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(l)}const i={kind:o.p6.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"},a=i=>{if((0,h.le)(i))return!e.isRequired;let o=X(i),a=!1;return t.max_chars&&o.length>t.max_chars&&(o=o.slice(0,t.max_chars),a=!0),!(n instanceof RegExp&&!1===n.test(o))&&(!a||o)};return{...e,kind:"text",sortMode:"default",validateInput:a,getCell(e,t){if("string"===typeof n)return W(X(e),n);if(t){const t=a(e);if(!1===t)return W(X(e),"Invalid input.");"string"===typeof t&&(e=t)}try{const t=(0,h.bb)(e)?X(e):null,n=(0,h.bb)(t)?ie(t):"";return{...i,isMissingValue:(0,h.le)(t),data:t,displayData:n}}catch(l){return W("Incompatible value","The value cannot be interpreted as string. Error: ".concat(l))}},getCellValue:e=>void 0===e.data?null:e.data}}se.isEditableType=!0;const de=se;function ce(e,t){return e=t.startsWith("+")||t.startsWith("-")?e.utcOffset(t,!1):e.tz(t)}function ue(e,t,n,i,a,l,r){var s;const d=J({format:n,step:i,timezone:r},t.columnTypeOptions);let c,u,m;if((0,h.bb)(d.timezone))try{var g;c=(null===(g=ce(F()(),d.timezone))||void 0===g?void 0:g.utcOffset())||void 0}catch(b){}(0,h.bb)(d.min_value)&&(u=ee(d.min_value)||void 0),(0,h.bb)(d.max_value)&&(m=ee(d.max_value)||void 0);const p={kind:o.p6.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isIndex?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:(null===(s=d.step)||void 0===s?void 0:s.toString())||"1",format:a,min:u,max:m}},f=e=>{const n=ee(e);return null===n?!t.isRequired:void 0!==n&&(!((0,h.bb)(u)&&l(n)<l(u))&&!((0,h.bb)(m)&&l(n)>l(m)))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(e,t){if(!0===t){const t=f(e);if(!1===t)return W(X(e),"Invalid input.");t instanceof Date&&(e=t)}const i=ee(e);let o="",a="",l=c;if(void 0===i)return W(X(e),"The value cannot be interpreted as a datetime object.");if(null!==i){let e=F().utc(i);if(!e.isValid())return W(X(i),"This should never happen. Please report this bug. \nError: ".concat(e.toString()));if(d.timezone){try{e=ce(e,d.timezone)}catch(b){return W(e.toISOString(),"Failed to adjust to the provided timezone: ".concat(d.timezone,". \nError: ").concat(b))}l=e.utcOffset()}try{a=$(e,d.format||n)}catch(b){return W(e.toISOString(),"Failed to format the date for rendering with: ".concat(d.format,". \nError: ").concat(b))}o=$(e,n)}return{...p,copyData:o,isMissingValue:(0,h.le)(i),data:{...p.data,date:i,displayDate:a,timezoneOffset:l}}},getCellValue(e){var t;return(0,h.le)(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.date)?null:l(e.data.date)}}}function me(e){var t,n,i,o;let a="YYYY-MM-DD HH:mm:ss";(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?a="YYYY-MM-DD HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(a="YYYY-MM-DD HH:mm:ss.SSS");const l=null===(i=e.arrowType)||void 0===i||null===(i=i.meta)||void 0===i?void 0:i.timezone,r=(0,h.bb)(l)||(0,h.bb)(null===e||void 0===e||null===(o=e.columnTypeOptions)||void 0===o?void 0:o.timezone);return ue("datetime",e,r?a+"Z":a,1,"datetime-local",(e=>r?e.toISOString():e.toISOString().replace("Z","")),l)}function he(e){var t,n;let i="HH:mm:ss";return(null===(t=e.columnTypeOptions)||void 0===t?void 0:t.step)>=60?i="HH:mm":(null===(n=e.columnTypeOptions)||void 0===n?void 0:n.step)<1&&(i="HH:mm:ss.SSS"),ue("time",e,i,1,"time",(e=>e.toISOString().split("T")[1].replace("Z","")))}function ge(e){return ue("date",e,"YYYY-MM-DD",1,"date",(e=>e.toISOString().split("T")[0]))}function pe(e){const t={kind:o.p6.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isIndex?"faded":"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(e){let n=null;return n=G(e),void 0===n?W(X(e),"The value cannot be interpreted as boolean."):{...t,data:n,isMissingValue:(0,h.le)(n)}},getCellValue:e=>void 0===e.data?null:e.data}}me.isEditableType=!0,he.isEditableType=!0,ge.isEditableType=!0,pe.isEditableType=!0;const fe=pe;function be(e){return e.startsWith("int")&&!e.startsWith("interval")||"range"===e||e.startsWith("uint")}function ve(e){const t=ae.fu.getTypeName(e.arrowType),n=J({step:be(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:"timedelta64[ns]"===t?"duration[ns]":void 0},e.columnTypeOptions),i=(0,h.le)(n.min_value)||n.min_value<0,a=(0,h.bb)(n.step)&&!Number.isNaN(n.step)?te(n.step):void 0,l={kind:o.p6.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isIndex?"faded":"normal",allowNegative:i,fixedDecimals:a},r=t=>{let i=U(t);if((0,h.le)(i))return!e.isRequired;if(Number.isNaN(i))return!1;let o=!1;return(0,h.bb)(n.max_value)&&i>n.max_value&&(i=n.max_value,o=!0),!((0,h.bb)(n.min_value)&&i<n.min_value)&&(!o||i)};return{...e,kind:"number",sortMode:"smart",validateInput:r,getCell(e,t){if(!0===t){const t=r(e);if(!1===t)return W(X(e),"Invalid input.");"number"===typeof t&&(e=t)}let i=U(e),o="";if((0,h.bb)(i)){if(Number.isNaN(i))return W(X(e),"The value cannot be interpreted as a number.");if((0,h.bb)(a)&&(s=i,i=0===(d=a)?Math.trunc(s):Math.trunc(s*10**d)/10**d),Number.isInteger(i)&&!Number.isSafeInteger(i))return W(X(e),"The value is larger than the maximum supported integer values in number columns (2^53).");try{o=Q(i,n.format,a)}catch(c){return W(X(i),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(c):"Failed to format the number. Error: ".concat(c))}}var s,d;return{...l,data:i,displayData:o,isMissingValue:(0,h.le)(i)}},getCellValue:e=>void 0===e.data?null:e.data}}ve.isEditableType=!0;const ye=ve;function we(e){let t="string";const n=J({options:"bool"===ae.fu.getTypeName(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map((e=>typeof e)));1===i.size&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const a={kind:o.p6.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,data:{kind:"dropdown-cell",allowedValues:[...!0!==e.isRequired?[null]:[],...n.options.filter((e=>null!==e&&""!==e)).map((e=>X(e)))],value:"",readonly:!e.isEditable}};return{...e,kind:"selectbox",sortMode:"default",getCell(e,t){let n=null;return(0,h.bb)(e)&&""!==e&&(n=X(e)),t&&!a.data.allowedValues.includes(n)?W(X(n),"The value is not part of the allowed options."):{...a,isMissingValue:null===n,copyData:n||"",data:{...a.data,value:n}}},getCellValue(e){var n,i,o,a,l,r,s;return(0,h.le)(null===(n=e.data)||void 0===n?void 0:n.value)||""===(null===(i=e.data)||void 0===i?void 0:i.value)?null:"number"===t?null!==(a=U(null===(l=e.data)||void 0===l?void 0:l.value))&&void 0!==a?a:null:"boolean"===t?null!==(r=G(null===(s=e.data)||void 0===s?void 0:s.value))&&void 0!==r?r:null:null===(o=e.data)||void 0===o?void 0:o.value}}}we.isEditableType=!0;const xe=we;function Ce(e){const t={kind:o.p6.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.le)(e)?[]:K(e);return{...t,data:n,isMissingValue:(0,h.le)(e),copyData:(0,h.le)(e)?"":X(n.map((e=>"string"===typeof e&&e.includes(",")?e.replace(/,/g," "):e)))}},getCellValue:e=>(0,h.le)(e.data)||P(e)?null:e.data}}Ce.isEditableType=!1;const Te=Ce;function ke(e,t,n){const i=new RegExp("".concat(e,"[,\\s].*{(?:[^}]*[\\s;]{1})?").concat(t,":\\s*([^;}]+)[;]?.*}"),"gm");n=n.replace(/{/g," {");const o=i.exec(n);if(o)return o[1].trim()}function Ee(e,t){const n=e.types.index[t],i=e.indexNames[t];let o=!0;return"range"===ae.fu.getTypeName(n)&&(o=!1),{id:"index-".concat(t),name:i,title:i,isEditable:o,arrowType:n,isIndex:!0,isHidden:!1}}function Me(e,t){const n=e.columns[0][t];let i,o=e.types.data[t];if((0,h.le)(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"}),"categorical"===ae.fu.getTypeName(o)){const n=e.getCategoricalOptions(t);(0,h.bb)(n)&&(i={options:n})}return{id:"column-".concat(n,"-").concat(t),name:n,title:n,isEditable:!0,arrowType:o,columnTypeOptions:i,isIndex:!1,isHidden:!1}}function Ne(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const i=e.arrowType?ae.fu.getTypeName(e.arrowType):null;let a;if("object"===e.kind)a=e.getCell((0,h.bb)(t.content)?ie(ae.fu.format(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&(0,h.bb)(t.content)&&("number"===typeof t.content||"bigint"===typeof t.content)){var l;let n;var r,s;if("time"===i&&(0,h.bb)(null===(l=t.field)||void 0===l||null===(l=l.type)||void 0===l?void 0:l.unit))n=F().unix(ae.fu.convertToSeconds(t.content,null!==(r=null===(s=t.field)||void 0===s||null===(s=s.type)||void 0===s?void 0:s.unit)&&void 0!==r?r:0)).utc().toDate();else n=F().utc(Number(t.content)).toDate();a=e.getCell(n)}else if("decimal"===i){const n=(0,h.le)(t.content)?null:ae.fu.format(t.content,t.contentType,t.field);a=e.getCell(n)}else a=e.getCell(t.content);if(B(a))return a;if(!e.isEditable){if((0,h.bb)(t.displayContent)){var d,c;const e=ie(t.displayContent);a.kind===o.p6.Text||a.kind===o.p6.Number?a={...a,displayData:e}:a.kind===o.p6.Custom&&"date-picker-cell"===(null===(d=a.data)||void 0===d?void 0:d.kind)?a={...a,data:{...a.data,displayDate:e}}:a.kind===o.p6.Custom&&"link-cell"===(null===(c=a.data)||void 0===c?void 0:c.kind)&&(a={...a,data:{...a.data,displayText:e}})}n&&t.cssId&&(a=function(e,t,n){const i={},o=ke(t,"color",n);o&&(i.textDark=o);const a=ke(t,"background-color",n);return a&&(i.bgCell=a),"yellow"===a&&void 0===o&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}(a,t.cssId,n))}return a}function Re(e){const t=e.columnTypeOptions||{};let n,i;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(r){n="Invalid validate regex: ".concat(t.validate,".\nError: ").concat(r)}if(!(0,h.le)(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch(r){i=void 0}const a={kind:o.p6.Custom,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:e.isIndex?"faded":"normal",data:{kind:"link-cell",href:"",displayText:""},copyData:""},l=i=>{if((0,h.le)(i))return!e.isRequired;const o=X(i);return!(t.max_chars&&o.length>t.max_chars)&&!(n instanceof RegExp&&!1===n.test(o))};return{...e,kind:"link",sortMode:"default",validateInput:l,getCell(e,o){if((0,h.le)(e))return{...a,data:{...a.data,href:null},isMissingValue:!0};const s=e;if("string"===typeof n)return W(X(s),n);if(o){if(!1===l(s))return W(X(s),"Invalid input.")}let d="";return s&&(d=void 0!==i?function(e,t){if((0,h.le)(t))return"";try{const n=t.match(e);return n&&void 0!==n[1]?n[1]:t}catch(r){return t}}(i,s):t.display_text||s),{...a,data:{kind:"link-cell",href:s,displayText:d},copyData:s,cursor:"pointer",isMissingValue:(0,h.le)(s)}},getCellValue(e){var t;return(0,h.le)(null===(t=e.data)||void 0===t?void 0:t.href)?null:e.data.href}}}Re.isEditableType=!0;const Se=Re;function _e(e){const t={kind:o.p6.Image,data:[],displayData:[],allowAdd:!1,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:e.isIndex?"faded":"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(e){const n=(0,h.bb)(e)?[X(e)]:[];return{...t,data:n,isMissingValue:!(0,h.bb)(e),displayData:n}},getCellValue:e=>void 0===e.data||0===e.data.length?null:e.data[0]}}_e.isEditableType=!1;const Oe=_e;function Ie(e){const t=be(ae.fu.getTypeName(e.arrowType)),n=J({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=Q(n.max_value,n.format)}catch(r){i=X(n.max_value)}const a=(0,h.le)(n.step)||Number.isNaN(n.step)?void 0:te(n.step),l={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(e){if((0,h.le)(e))return Y();if((0,h.le)(n.min_value)||(0,h.le)(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return W("Invalid min/max parameters","The min_value (".concat(n.min_value,") and max_value (").concat(n.max_value,") parameters must be valid numbers."));if((0,h.le)(n.step)||Number.isNaN(n.step))return W("Invalid step parameter","The step parameter (".concat(n.step,") must be a valid number."));const t=U(e);if(Number.isNaN(t)||(0,h.le)(t))return W(X(e),"The value cannot be interpreted as a number.");if(Number.isInteger(t)&&!Number.isSafeInteger(t))return W(X(e),"The value is larger than the maximum supported integer values in number columns (2^53).");let i="";try{i=Q(t,n.format,a)}catch(r){return W(X(t),(0,h.bb)(n.format)?"Failed to format the number based on the provided format configuration: (".concat(n.format,"). Error: ").concat(r):"Failed to format the number. Error: ".concat(r))}const o=Math.min(n.max_value,Math.max(n.min_value,t));return{...l,isMissingValue:(0,h.le)(e),copyData:String(t),data:{...l.data,value:o,label:i}}},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.value)?null:null===(n=e.data)||void 0===n?void 0:n.value}}}Ie.isEditableType=!1;const De=Ie;function He(e,t,n){const i=J({y_min:0,y_max:1},t.columnTypeOptions),a={kind:o.p6.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(e){if((0,h.le)(i.y_min)||(0,h.le)(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return W("Invalid min/max y-axis configuration","The y_min (".concat(i.y_min,") and y_max (").concat(i.y_max,") configuration options must be valid numbers."));if((0,h.le)(e))return Y();const t=K(e),o=[];let l=[];if(0===t.length)return Y();let r=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;for(let n=0;n<t.length;n++){const e=U(t[n]);if(Number.isNaN(e)||(0,h.le)(e))return W(X(t),"The value cannot be interpreted as a numeric array. ".concat(X(e)," is not a number."));e>r&&(r=e),e<s&&(s=e),o.push(e)}return"line"===n&&o.length<=2?Y():(l=o.length>0&&(r>i.y_max||s<i.y_min)?o.map((e=>r-s===0?r>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((e-s)/(r-s))+(i.y_min||0))):o,{...a,copyData:o.join(","),data:{...a.data,values:l,displayValues:o.map((e=>Q(e)))},isMissingValue:(0,h.le)(e)})},getCellValue(e){var t,n;return e.kind===o.p6.Loading||void 0===(null===(t=e.data)||void 0===t?void 0:t.values)?null:null===(n=e.data)||void 0===n?void 0:n.values}}}function Ae(e){return He("line_chart",e,"line")}function ze(e){return He("bar_chart",e,"bar")}Ae.isEditableType=!1,ze.isEditableType=!1;const Ve=(0,T.Z)("div",{target:"ex7xuzc0"})({name:"iatp2c",styles:"display:flex;flex-grow:1;align-items:center;min-height:21px;.gdg-link-area{flex-grow:1;flex-shrink:1;cursor:pointer;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gdg-link-color);text-decoration:underline!important;padding-bottom:3px;}"}),Fe=e=>{const{uri:t,onChange:n,readonly:i,validatedSelection:a,preview:l}=e;return i?(0,N.jsx)(Ve,{children:(0,N.jsx)("a",{"data-testid":"stLinkCell",className:"gdg-link-area",href:null!==t&&void 0!==t?t:"",target:"_blank",rel:"noopener noreferrer",children:l})}):(0,N.jsx)(o.t5,{validatedSelection:a,highlight:!0,autoFocus:!0,value:null!==t&&void 0!==t?t:"",onChange:n})};const je={draw:(e,t)=>{const{ctx:n,rect:i,theme:a,hoverX:l=-100}=e,{href:r,displayText:s}=t.data;if((0,h.le)(r))return;const d=s||r,c=a.cellHorizontalPadding,u=i.x+c,m=i.x+l,g="".concat(a.baseFontStyle," ").concat(a.fontFamily);n.font=g;const p=(0,o.aX)(n,g),f=i.y+i.height/2+p;if(m>i.x&&m<i.x+i.width){const e=(0,o.P7)(d,n,g);n.moveTo(u,Math.floor(f+5)+.5),n.lineTo(u+e.width,Math.floor(f+5)+.5),n.strokeStyle=a.linkColor,n.stroke()}return n.fillStyle=a.linkColor,n.fillText(d,u,f),n.closePath(),!0},isMatch:e=>"link-cell"===e.data.kind,kind:o.p6.Custom,measure:(e,t,n)=>{const{href:i,displayText:o}=t.data;return(0,h.le)(i)?0:e.measureText(o||i).width+2*n.cellHorizontalPadding},needsHover:!0,needsHoverPosition:!0,onSelect:e=>{const t=function(e){var t;const n=document.createElement("canvas").getContext("2d",{alpha:!1});if(null===n)return;const{posX:i,bounds:o,cell:a,theme:l}=e,r="".concat(l.baseFontStyle," ").concat(l.fontFamily);n.font=r;const{href:s,displayText:d}=a.data,c=o.x+i,u=n.measureText(null!==(t=d||s)&&void 0!==t?t:"").width,m=o.x+l.cellHorizontalPadding;return c>m&&c<m+u?s:void 0}(e);(0,h.le)(t)||window.open(t,"_blank","noopener,noreferrer")},onDelete:e=>({...e,data:{...e.data,displayText:"",href:""}}),provideEditor:()=>e=>{var t;const{onChange:n,value:i,validatedSelection:o}=e,{href:a,displayText:l}=i.data;return(0,N.jsx)(Fe,{uri:i.data.href,preview:null!==(t=l||a)&&void 0!==t?t:"",validatedSelection:o,readonly:!0===i.readonly,onChange:e=>n({...i,copyData:e.target.value,data:{...i.data,href:e.target.value}})})},onPaste:(e,t)=>e===t.href?void 0:{...t,href:e}},Le=new Map(Object.entries({object:re,text:de,checkbox:fe,selectbox:xe,list:Te,number:ye,link:Se,datetime:me,date:ge,time:he,line_chart:Ae,bar_chart:ze,image:Oe,progress:De})),We=[je],Be="_index",Pe="_pos:",Ye={small:75,medium:200,large:400};function Ze(e){if(!(0,h.le)(e))return"number"===typeof e?e:e in Ye?Ye[e]:void 0}function qe(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==Be?n=t.get(e.name):t.has("".concat(Pe).concat(e.indexNumber))?n=t.get("".concat(Pe).concat(e.indexNumber)):e.isIndex&&t.has(Be)&&(n=t.get(Be)),n?D()({...e},{title:n.label,width:Ze(n.width),isEditable:(0,h.bb)(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function Je(e){var t;const n=null===(t=e.columnTypeOptions)||void 0===t?void 0:t.type;let i;return(0,h.bb)(n)&&(Le.has(n)?i=Le.get(n):(0,oe.KE)("Unknown column type configured in column configuration: ".concat(n))),(0,h.le)(i)&&(i=function(e){let t=e?ae.fu.getTypeName(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty"].includes(t)?de:["datetime","datetimetz"].includes(t)?me:"time"===t?he:"date"===t?ge:["object","bytes"].includes(t)?re:["bool"].includes(t)?fe:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?ye:"categorical"===t?xe:t.startsWith("list")?Te:re):re}(e.arrowType)),i}const Ke=function(e,t,n){const o=i.useMemo((()=>function(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return(0,oe.H)(t),new Map}}(e.columns)),[e.columns]),a=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;return{columns:i.useMemo((()=>{let i=function(e){const t=[],{dimensions:n}=e,i=n.headerColumns,o=n.dataColumns;if(0===i&&0===o)return t.push({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0}),t;for(let a=0;a<i;a++){const n={...Ee(e,a),indexNumber:a};t.push(n)}for(let a=0;a<o;a++){const n={...Me(e,a),indexNumber:a+i};t.push(n)}return t}(t).map((t=>{let i={...t,...qe(t,o),isStretched:a};const l=Je(i);return(e.editingMode===m.Eh.EditingMode.READ_ONLY||n||!1===l.isEditableType)&&(i={...i,isEditable:!1}),e.editingMode!==m.Eh.EditingMode.READ_ONLY&&1==i.isEditable&&(i={...i,icon:"editable"},i.isRequired&&e.editingMode===m.Eh.EditingMode.DYNAMIC&&(i={...i,isHidden:!1})),l(i)})).filter((e=>!e.isHidden));if(e.columnOrder&&e.columnOrder.length>0){const t=[];i.forEach((e=>{e.isIndex&&t.push(e)})),e.columnOrder.forEach((e=>{const n=i.find((t=>t.name===e));n&&!n.isIndex&&t.push(n)})),i=t}return i.length>0?i:[re({id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0})]}),[t,o,a,n,e.editingMode,e.columnOrder])}};function Xe(e){return e.isIndex?Be:(0,h.le)(e.name)?"":e.name}const Ge=class{constructor(e){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=e}toJson(e){const t=new Map;e.forEach((e=>{t.set(e.indexNumber,e)}));const n={edited_rows:{},added_rows:[],deleted_rows:[]};this.editedCells.forEach(((e,i,o)=>{const a={};e.forEach(((e,n,i)=>{const o=t.get(n);o&&(a[Xe(o)]=o.getCellValue(e))})),n.edited_rows[i]=a})),this.addedRows.forEach((e=>{const i={};let o=!1;e.forEach(((e,n,a)=>{const l=t.get(n);if(l){const t=l.getCellValue(e);l.isRequired&&l.isEditable&&P(e)&&(o=!0),(0,h.bb)(t)&&(i[Xe(l)]=t)}})),o||n.added_rows.push(i)})),n.deleted_rows=this.deletedRows;return JSON.stringify(n,((e,t)=>void 0===t?null:t))}fromJson(e,t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const n=JSON.parse(e),i=new Map;t.forEach((e=>{i.set(e.indexNumber,e)}));const o=new Map;t.forEach((e=>{o.set(Xe(e),e)})),Object.keys(n.edited_rows).forEach((e=>{const t=Number(e),i=n.edited_rows[e];Object.keys(i).forEach((e=>{const n=i[e],a=o.get(e);if(a){const e=a.getCell(n);var l;if(e)this.editedCells.has(t)||this.editedCells.set(t,new Map),null===(l=this.editedCells.get(t))||void 0===l||l.set(a.indexNumber,e)}}))})),n.added_rows.forEach((e=>{const t=new Map;Object.keys(e).forEach((n=>{const i=e[n],a=o.get(n);if(a){const e=a.getCell(i);e&&t.set(a.indexNumber,e)}})),this.addedRows.push(t)})),this.deletedRows=n.deleted_rows}isAddedRow(e){return e>=this.numRows}getCell(e,t){if(this.isAddedRow(t))return this.addedRows[t-this.numRows].get(e);const n=this.editedCells.get(t);return void 0!==n?n.get(e):void 0}setCell(e,t,n){if(this.isAddedRow(t)){if(t-this.numRows>=this.addedRows.length)return;this.addedRows[t-this.numRows].set(e,n)}else{void 0===this.editedCells.get(t)&&this.editedCells.set(t,new Map);this.editedCells.get(t).set(e,n)}}addRow(e){this.addedRows.push(e)}deleteRows(e){e.sort(((e,t)=>t-e)).forEach((e=>{this.deleteRow(e)}))}deleteRow(e){(0,h.le)(e)||e<0||(this.isAddedRow(e)?this.addedRows.splice(e-this.numRows,1):(this.deletedRows.includes(e)||(this.deletedRows.push(e),this.deletedRows=this.deletedRows.sort(((e,t)=>e-t))),this.editedCells.delete(e)))}getOriginalRowIndex(e){let t=e;for(let n=0;n<this.deletedRows.length&&!(this.deletedRows[n]>t);n++)t+=1;return t}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}};var Ue=n(59990);const Qe=function(){const e=(0,g.u)(),t=i.useMemo((()=>({editable:e=>'<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="'.concat(e.bgColor,'"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>')})),[]);return{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:(0,Ue.DZ)(e.colors.primary,.9),borderColor:e.colors.fadedText05,horizontalBorderColor:e.colors.fadedText05,fontFamily:e.genericFonts.bodyFont,bgSearchResult:(0,Ue.DZ)(e.colors.primary,.9),bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:"".concat(e.fontSizes.sm),baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:(0,Ue.DZ)(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:8,cellVerticalPadding:3,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25,tableBorderRadius:e.radii.lg,headerIcons:t}};const $e=function(e,t,n,o){return{getCellContent:i.useCallback((i=>{let[a,l]=i;if(a>t.length-1)return W("Column index out of bounds.","This should never happen. Please report this bug.");if(l>n-1)return W("Row index out of bounds.","This should never happen. Please report this bug.");const r=t[a],s=r.indexNumber,d=o.current.getOriginalRowIndex(l);if(r.isEditable||o.current.isAddedRow(d)){const e=o.current.getCell(s,d);if(void 0!==e)return e}try{return Ne(r,e.getCell(d+1,s),e.cssStyles)}catch(c){return(0,oe.H)(c),W("Error during cell creation.","This should never happen. Please report this bug. \nError: ".concat(c))}}),[t,n,e,o])}};var et=n(33256);const tt=function(e,t,n){const[o,a]=i.useState(),{getCellContent:l,getOriginalIndex:r}=(0,et.fF)({columns:t.map((e=>q(e))),getCellContent:n,rows:e,sort:o}),s=i.useMemo((()=>function(e,t){return void 0===t?e:e.map((e=>e.id===t.column.id?{...e,title:"asc"===t.direction?"\u2191 ".concat(e.title):"\u2193 ".concat(e.title)}:e))}(t,o)),[t,o]),d=i.useCallback((e=>{let t="asc";const n=s[e];if(o&&o.column.id===n.id){if("asc"!==o.direction)return void a(void 0);t="desc"}a({column:q(n),direction:t,mode:n.sortMode})}),[o,s]);return{columns:s,sortColumn:d,getOriginalIndex:r,getCellContent:l}};var nt=n(95599);const it=",",ot='"',at='"',lt="\n";function rt(e){return e.map((e=>function(e){if((0,h.le)(e))return"";const t=X(e);if(new RegExp("[".concat([it,ot,lt].join(""),"]")).test(t))return"".concat(ot).concat(t.replace(new RegExp(ot,"g"),at+ot)).concat(ot);return t}(e))).join(it)+lt}const st=function(e,t,n){return{exportToCsv:i.useCallback((async()=>{const i=(new Date).toISOString().slice(0,16).replace(":","-"),o="".concat(i,"_export.csv"),a=await(0,nt.Kr)({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1}),l=new TextEncoder,r=await a.createWritable();await r.write(l.encode("\ufeff"));const s=t.map((e=>e.name));await r.write(l.encode(rt(s)));for(let d=0;d<n;d++){const n=[];t.forEach(((t,i,o)=>{n.push(t.getCellValue(e([i,d])))})),await r.write(l.encode(rt(n)))}await r.close()}),[t,n,e])}};const dt=function(e,t,n,o,a,l,r){const s=i.useCallback(((t,i)=>{let[l,s]=t;const d=e[l];if(!d.isEditable)return;const c=d.indexNumber,u=n.current.getOriginalRowIndex(a(s)),m=o([l,s]),h=d.getCellValue(m),g=d.getCellValue(i);if(!B(m)&&g===h)return;const p=d.getCell(g,!0);B(p)?(0,oe.KE)("Not applying the cell edit since it causes this error:\n ".concat(p.data)):(n.current.setCell(c,u,{...p,lastUpdated:performance.now()}),r())}),[e,n,a,o,r]),d=i.useCallback((()=>{if(t)return;const i=new Map;e.forEach((e=>{i.set(e.indexNumber,e.getCell(e.defaultValue))})),n.current.addRow(i)}),[e,n,t]),c=i.useCallback((()=>{t||(d(),r())}),[d,r,t]),u=i.useCallback((i=>{var o;if(i.rows.length>0){if(t)return!0;const e=i.rows.toArray().map((e=>n.current.getOriginalRowIndex(a(e))));return n.current.deleteRows(e),r(!0),!1}if(null!==(o=i.current)&&void 0!==o&&o.range){const t=[],n=i.current.range;for(let i=n.y;i<n.y+n.height;i++)for(let o=n.x;o<n.x+n.width;o++){const n=e[o];n.isEditable&&!n.isRequired&&(t.push({cell:[o,i]}),s([o,i],n.getCell(null)))}return t.length>0&&(r(),l(t)),!1}return!0}),[e,n,t,l,a,r,s]),m=i.useCallback(((i,s)=>{const[c,u]=i,m=[];for(let g=0;g<s.length;g++){const i=s[g];if(g+u>=n.current.getNumRows()){if(t)break;d()}for(let t=0;t<i.length;t++){const l=i[t],r=g+u,s=t+c;if(s>=e.length)break;const d=e[s];if(d.isEditable){const e=d.getCell(l,!0);if((0,h.bb)(e)&&!B(e)){const t=d.indexNumber,i=n.current.getOriginalRowIndex(a(r)),l=d.getCellValue(o([s,r]));d.getCellValue(e)!==l&&(n.current.setCell(t,i,{...e,lastUpdated:performance.now()}),m.push({cell:[s,r]}))}}}m.length>0&&(r(),l(m))}return!1}),[e,n,t,a,o,d,r,l]),g=i.useCallback(((t,n)=>{const i=t[0];if(i>=e.length)return!0;const o=e[i];if(o.validateInput){const e=o.validateInput(o.getCellValue(n));return!0===e||!1===e?e:o.getCell(e)}return!0}),[e]);return{onCellEdited:s,onPaste:m,onRowAppended:c,onDelete:u,validateCell:g}};const ct=function(e,t){const[n,o]=i.useState(),a=i.useRef(null),l=i.useCallback((n=>{if(clearTimeout(a.current),a.current=0,o(void 0),("header"===n.kind||"cell"===n.kind)&&n.location){const i=n.location[0],l=n.location[1];let r;if(i<0||i>=e.length)return;const s=e[i];if("header"===n.kind&&(0,h.bb)(s))r=s.help;else if("cell"===n.kind){const e=t([i,l]);s.isRequired&&s.isEditable&&P(e)?r="\u26a0\ufe0f Please fill out this cell.":function(e){return e.hasOwnProperty("tooltip")&&""!==e.tooltip}(e)&&(r=e.tooltip)}r&&(a.current=setTimeout((()=>{r&&o({content:r,left:n.bounds.x+n.bounds.width/2,top:n.bounds.y})}),600))}}),[e,t,o,a]);return{tooltip:n,clearTooltip:i.useCallback((()=>{o(void 0)}),[o]),onItemHovered:l}};var ut=n(8751);const mt=function(e,t){return{drawCell:i.useCallback((n=>{const{cell:i,theme:a,ctx:l,rect:r}=n,s=t?n.col-1:n.col;if(P(i)&&s<e.length){let t=!1;const i=e[s];return["checkbox","line_chart","bar_chart","progress"].includes(i.kind)||((e=>{const{cell:t,theme:n}=e;(0,o.uN)({...e,theme:{...n,textDark:n.textLight,textMedium:n.textLight},spriteManager:{},hyperWrapping:!1},"None",t.contentAlign)})(n),t=!0),i.isRequired&&i.isEditable&&function(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}(l,r,a),t}return!1}),[e,t]),customRenderers:[...(0,ut.Bn)().customRenderers,...We]}};const ht=function(e){const[t,n]=(0,i.useState)((()=>new Map)),o=i.useCallback(((e,i,o,a)=>{e.id&&n(new Map(t).set(e.id,a))}),[t]);return{columns:i.useMemo((()=>e.map((e=>e.id&&t.has(e.id)&&void 0!==t.get(e.id)?{...e,width:t.get(e.id),grow:0}:e))),[e,t]),onColumnResize:o}},gt=35,pt=2*gt+3;const ft=function(e,t,n,o,a){let l,r=function(e){return Math.max(e*gt+1+2,pt)}(t+1+(e.editingMode===m.Eh.EditingMode.DYNAMIC?1:0)),s=Math.min(r,400);e.height&&(s=Math.max(e.height,pt),r=Math.max(e.height,r)),o&&(s=Math.min(s,o),r=Math.min(r,o),e.height||(s=r));let d=n;e.useContainerWidth?l=n:e.width&&(l=Math.min(Math.max(e.width,52),n),d=Math.min(Math.max(e.width,d),n));const[c,u]=i.useState({width:l||"100%",height:s});return i.useLayoutEffect((()=>{e.useContainerWidth&&"100%"===c.width&&u({width:n,height:c.height})}),[n]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[t]),i.useLayoutEffect((()=>{u({width:l||"100%",height:c.height})}),[l]),i.useLayoutEffect((()=>{u({width:c.width,height:s})}),[s]),i.useLayoutEffect((()=>{if(a){const t=e.useContainerWidth||(0,h.bb)(e.width)&&e.width>0;u({width:t?d:"100%",height:r})}else u({width:l||"100%",height:s})}),[a]),{minHeight:pt,maxHeight:r,minWidth:52,maxWidth:d,resizableSize:c,setResizableSize:u}},bt=(0,T.Z)("img",{target:"e24uaba0"})((()=>({maxWidth:"100%",maxHeight:"600px",objectFit:"scale-down"})),""),vt=e=>{let{urls:t}=e;const n=t&&t.length>0?t[0]:"";return n.startsWith("http")?(0,N.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",children:(0,N.jsx)(bt,{src:n})}):(0,N.jsx)(bt,{src:n})};var yt=n(98399),wt=n(73830),xt=n(37661);const Ct=function(e){let{top:t,left:n,content:o,clearTooltip:a}=e;const[l,r]=i.useState(!0),s=(0,g.u)(),{colors:d,fontSizes:c,radii:u}=s,m=i.useCallback((()=>{r(!1),a()}),[a,r]);return(0,N.jsx)(yt.Z,{content:(0,N.jsx)(xt.Uo,{className:"stTooltipContent",children:(0,N.jsx)(b.ZP,{style:{fontSize:c.sm},source:o,allowHTML:!1})}),placement:wt.r4.top,accessibilityType:wt.SI.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:m,onEsc:m,overrides:{Body:{style:{borderTopLeftRadius:u.md,borderTopRightRadius:u.md,borderBottomLeftRadius:u.md,borderBottomRightRadius:u.md,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:(0,k.Iy)(s)?d.bgColor:d.secondaryBg,color:d.bodyText,fontSize:c.sm,fontWeight:"normal",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:l,children:(0,N.jsx)("div",{className:"stTooltipTarget","data-testid":"stTooltipTarget",style:{position:"fixed",top:t,left:n}})})},Tt=(0,T.Z)("div",{target:"e1w7nams0"})((e=>{let{hasCustomizedScrollbars:t,theme:n}=e;return{position:"relative",display:"inline-block","& .glideDataEditor":{height:"100%",minWidth:"100%",borderRadius:n.radii.lg},"& .dvn-scroller":{...!t&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}}}),"");n(27235),n(33091);const kt=(0,u.Z)((function(e){let{element:t,data:n,width:u,height:g,disabled:p,widgetMgr:f,isFullScreen:b,expand:v,collapse:y}=e;const w=i.useRef(null),x=i.useRef(null),C=i.useRef(null),T=Qe(),[k,E]=i.useState(!0),[M,_]=i.useState(!1),[O,I]=i.useState(!1),[D,H]=i.useState(!1),A=i.useMemo((()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches),[]),z=i.useMemo((()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome")),[]),[V,F]=i.useState({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0}),j=i.useCallback((()=>{F({columns:o.EV.empty(),rows:o.EV.empty(),current:void 0})}),[]),L=i.useCallback((()=>{F({columns:V.columns,rows:V.rows,current:void 0})}),[V]),W=i.useCallback((e=>{var t;null===(t=x.current)||void 0===t||t.updateCells(e)}),[]);(0,h.le)(t.editingMode)&&(t.editingMode=m.Eh.EditingMode.READ_ONLY);const{READ_ONLY:B,DYNAMIC:P}=m.Eh.EditingMode,Y=n.dimensions,J=Math.max(0,Y.rows-1),K=0===J&&!(t.editingMode===P&&Y.dataColumns>0),X=J>15e4,G=i.useRef(new Ge(J)),[U,Q]=i.useState(G.current.getNumRows());i.useEffect((()=>{G.current=new Ge(J),Q(G.current.getNumRows())}),[J]);const $=i.useCallback((()=>{G.current=new Ge(J),Q(G.current.getNumRows())}),[J]),{columns:ee}=Ke(t,n,p);i.useEffect((()=>{if(t.editingMode!==B){const e=f.getStringValue(t);e&&(G.current.fromJson(e,ee),Q(G.current.getNumRows()))}}),[]);const{getCellContent:te}=$e(n,ee,U,G),{columns:ne,sortColumn:ie,getOriginalIndex:oe,getCellContent:ae}=tt(J,ee,te),le=i.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];U!==G.current.getNumRows()&&Q(G.current.getNumRows()),e&&j(),(0,h.Ds)(100,(()=>{const e=G.current.toJson(ne);let i=f.getStringValue(t);void 0===i&&(i=new Ge(0).toJson([])),e!==i&&f.setStringValue(t,e,{fromUi:n})}))()}),[f,t,U,j,ne]),{exportToCsv:re}=st(ae,ne,U),{onCellEdited:se,onPaste:de,onRowAppended:ce,onDelete:ue,validateCell:me}=dt(ne,t.editingMode!==P,G,ae,oe,W,le),{tooltip:he,clearTooltip:ge,onItemHovered:pe}=ct(ne,ae),{drawCell:fe,customRenderers:be}=mt(ne,t.editingMode===P),{columns:ve,onColumnResize:ye}=ht(ne.map((e=>q(e)))),{minHeight:we,maxHeight:xe,minWidth:Ce,maxWidth:Te,resizableSize:ke,setResizableSize:Ee}=ft(t,U,u,g,b),Me=i.useCallback((e=>{let[t,n]=e;return{...Z(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:T.textLight},span:[0,Math.max(ne.length-1,0)]}}),[ne,T.textLight]);i.useEffect((()=>{const e=new c.K;return e.manageFormClearListener(f,t.formId,$),()=>{e.disconnect()}}),[t.formId,$,f]);const Ne=!K&&t.editingMode===P&&!p,Re=V.rows.length>0,Se=void 0!==V.current,_e=K?0:ne.filter((e=>e.isIndex)).length;return i.useEffect((()=>{if(C.current){var e;const t=null===(e=C.current)||void 0===e||null===(e=e.querySelector(".dvn-stack"))||void 0===e?void 0:e.getBoundingClientRect();t&&(I(t.height>C.current.clientHeight),H(t.width>C.current.clientWidth))}}),[ke,U,ve]),(0,N.jsxs)(Tt,{"data-testid":"stDataFrame",className:"stDataFrame",hasCustomizedScrollbars:z,ref:C,onMouseDown:e=>{if(C.current&&z){const t=C.current.getBoundingClientRect();D&&t.height-7<e.clientY-t.top&&e.stopPropagation(),O&&t.width-7<e.clientX-t.left&&e.stopPropagation()}},onBlur:e=>{k||A||e.currentTarget.contains(e.relatedTarget)||L()},children:[(0,N.jsxs)(S,{isFullScreen:b,locked:Re||Se||A&&k,onExpand:v,onCollapse:y,target:Tt,children:[Ne&&Re&&(0,N.jsx)(R,{label:"Delete row(s)",icon:l.H,onClick:()=>{ue&&(ue(V),ge())}}),Ne&&!Re&&(0,N.jsx)(R,{label:"Add row",icon:r.m,onClick:()=>{ce&&(E(!0),ce(),ge())}}),!X&&!K&&(0,N.jsx)(R,{label:"Download as CSV",icon:s.k,onClick:()=>re()}),!K&&(0,N.jsx)(R,{label:"Search",icon:d.o,onClick:()=>{M?_(!1):(E(!0),_(!0)),ge()}})]}),(0,N.jsx)(a.e,{"data-testid":"stDataFrameResizable",ref:w,defaultSize:ke,style:{border:"1px solid ".concat(T.borderColor),borderRadius:"".concat(T.tableBorderRadius)},minHeight:we,maxHeight:xe,minWidth:Ce,maxWidth:Te,size:ke,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,gt],snapGap:gt/3,onResizeStop:(e,t,n,i)=>{w.current&&Ee({width:w.current.size.width,height:xe-w.current.size.height===3?w.current.size.height+3:w.current.size.height})},children:(0,N.jsx)(o.Nd,{className:"glideDataEditor",ref:x,columns:ve,rows:K?1:U,minColumnWidth:50,maxColumnWidth:1e3,maxColumnAutoWidth:500,rowHeight:gt,headerHeight:gt,getCellContent:K?Me:ae,onColumnResize:ye,freezeColumns:_e,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:e=>!(e>=ne.length&&(t.useContainerWidth||"100%"===ke.width)),getCellsForSelection:!0,rowMarkers:"none",rangeSelect:A?"none":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:pe,keybindings:{downFill:!0},onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(_((e=>!e)),e.stopPropagation(),e.preventDefault())},showSearch:M,onSearchClose:()=>{_(!1),ge()},onHeaderClicked:K||X?void 0:ie,gridSelection:V,onGridSelectionChange:e=>{(k||A)&&(F(e),void 0!==he&&ge())},theme:T,onMouseMove:e=>{"out-of-bounds"===e.kind&&k?E(!1):"out-of-bounds"===e.kind||k||E(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:1,...z&&{paddingBottom:D?-6:void 0,paddingRight:O?-6:void 0}},drawCell:fe,customRenderers:be,imageEditorOverride:vt,headerIcons:T.headerIcons,validateCell:me,onPaste:!1,...!K&&t.editingMode!==B&&!p&&{fillHandle:!A,onCellEdited:se,onPaste:de,onDelete:ue},...!K&&t.editingMode===P&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkerTheme:{bgCell:T.bgHeader,bgCellMedium:T.bgHeader},rowMarkers:"checkbox",rowSelectionMode:"multi",rowSelect:p?"none":"multi",onRowAppended:p?void 0:ce,onHeaderClicked:void 0}})}),he&&he.content&&(0,N.jsx)(Ct,{top:he.top,left:he.left,content:he.content,clearTooltip:ge})]})}),!0)},52955:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(50120);class o{constructor(){this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}manageFormClearListener(e,t,n){null!=this.formClearListener&&this.lastWidgetMgr===e&&this.lastFormId===t||(this.disconnect(),(0,i.bM)(t)&&(this.formClearListener=e.addFormClearedListener(t,n),this.lastWidgetMgr=e,this.lastFormId=t))}disconnect(){var e;null===(e=this.formClearListener)||void 0===e||e.disconnect(),this.formClearListener=void 0,this.lastWidgetMgr=void 0,this.lastFormId=void 0}}}}]);