@stlite/desktop 0.87.0 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dump_artifacts.js +2 -2
- package/build/assets/{ErrorOutline.esm-C8z2dN3x.js → ErrorOutline.esm-D2SwfuYU.js} +1 -1
- package/build/assets/{FileDownload.esm-kSzyJagP.js → FileDownload.esm-C2Gywq_5.js} +1 -1
- package/build/assets/{FileHelper-BbrZYz8x.js → FileHelper-TEIN3a2s.js} +1 -1
- package/build/assets/{FormClearHelper-fvwQICEk.js → FormClearHelper-DBsQ33IR.js} +1 -1
- package/build/assets/{Hooks-CCS44jMc.js → Hooks-BdfQKLev.js} +1 -1
- package/build/assets/{InputInstructions-BgxdtQsQ.js → InputInstructions-CtPX8G6i.js} +1 -1
- package/build/assets/{Particles-C6lCS8Mc.js → Particles-CftaQRnu.js} +1 -1
- package/build/assets/{ProgressBar-CXipOcU9.js → ProgressBar-M7ATKOrt.js} +1 -1
- package/build/assets/{Toolbar-DiWCQxr5.js → Toolbar-AvCHJeN3.js} +1 -1
- package/build/assets/{base-input-D2OIsCyG.js → base-input-C1jq7mBd.js} +1 -1
- package/build/assets/{checkbox-BNaalk8J.js → checkbox-mkpBvvtC.js} +1 -1
- package/build/assets/{createSuper-CQM18OGw.js → createSuper-BqkNEFMI.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-CK8RiHSC.js → data-grid-overlay-editor-Kkg8Jnuo.js} +1 -1
- package/build/assets/{downloader-CE817MUq.js → downloader-D5bOXv0f.js} +1 -1
- package/build/assets/{es6-D9GNxEuI.js → es6-dD9evgqV.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-CNYkPhE6.js → iframeResizer.contentWindow-CcIGM7Tj.js} +1 -1
- package/build/assets/{index-X9E9p-kg.js → index-65i-IYyx.js} +1 -1
- package/build/assets/{index-BGbl-ncy.js → index-6GmirbOq.js} +1 -1
- package/build/assets/{index-CjHv4qYi.js → index-B6MoDIcs.js} +1 -1
- package/build/assets/{index-BDOZpIxN.js → index-B6dp8D8K.js} +1 -1
- package/build/assets/{index-CKEBU2Tu.js → index-B_ESKJn8.js} +1 -1
- package/build/assets/{index-DFlTnZFo.js → index-Bn07Nrcj.js} +1 -1
- package/build/assets/{index-C1VFEx3W.js → index-BvsGq1E8.js} +1 -1
- package/build/assets/{index-CDtHDDVr.js → index-BwDs6Dqm.js} +1 -1
- package/build/assets/{index-Dc2c4xJB.js → index-BzxHONei.js} +1 -1
- package/build/assets/{index-DhxOxSgZ.js → index-C3s_fpYA.js} +1 -1
- package/build/assets/{index-DhqQeff3.js → index-COglCO5Z.js} +5 -5
- package/build/assets/{index-XLeMBlQJ.js → index-CRXKMFnY.js} +1 -1
- package/build/assets/{index-DyVqVg90.js → index-CZ-g3tsi.js} +1 -1
- package/build/assets/{index-B-7mLFMQ.js → index-CaQBKEJy.js} +1 -1
- package/build/assets/{index-Wzix0Ssr.js → index-Cbwanp8_.js} +1 -1
- package/build/assets/{index---v6J_Xe.js → index-CmCzhGLu.js} +1 -1
- package/build/assets/{index-DFWekVRf.js → index-Cmk6T6xH.js} +1 -1
- package/build/assets/{index-B5zkrGKq.js → index-CuAJIEXV.js} +1 -1
- package/build/assets/{index-CxsEqDQL.js → index-CyGIJHIN.js} +1 -1
- package/build/assets/{index-DXGgezsh.js → index-D9I-_Axj.js} +1 -1
- package/build/assets/{index-B3wu97uA.js → index-DRnW2Id8.js} +1 -1
- package/build/assets/{index-Bnvb95fQ.js → index-Dpl6MGkr.js} +1 -1
- package/build/assets/{index-Vs85zs5K.js → index-Du10bw-R.js} +1 -1
- package/build/assets/{index-C6fUDD3N.js → index-GIlSUqbu.js} +1 -1
- package/build/assets/{index-CI7_FxNG.js → index-GZIk974x.js} +1 -1
- package/build/assets/{index--SdlqSfi.js → index-GZgkD7uG.js} +1 -1
- package/build/assets/{index-mlKr_pQQ.js → index-N4aGA-cE.js} +1 -1
- package/build/assets/{index-CnRs0MgX.js → index-P6F5Xebr.js} +1 -1
- package/build/assets/{index-CGMUJ4kd.js → index-XJiwj79b.js} +1 -1
- package/build/assets/{index-BI9UgvCi.js → index-_maoKajI.js} +1 -1
- package/build/assets/{index-DDiZtaVk.js → index-cMy3wqhE.js} +1 -1
- package/build/assets/{index-DCNLpqIv.js → index-clm6On2Y.js} +4 -4
- package/build/assets/{index-D0YDqQsn.js → index-i6_APaSl.js} +1 -1
- package/build/assets/{index-DqnX_TF4.js → index-npEbF0j6.js} +1 -1
- package/build/assets/{index-cAlcGRT2.js → index-o_WbG_Oh.js} +1 -1
- package/build/assets/{index-CT5_r023.js → index-w_HPESMz.js} +1 -1
- package/build/assets/{index-7qt3HHfl.js → index-yIAfElop.js} +1 -1
- package/build/assets/{inherits-BWX75f6B.js → inherits-D8N0057t.js} +1 -1
- package/build/assets/{input-DTfsWA-x.js → input-D2HjwqoP.js} +1 -1
- package/build/assets/{memory-DS2CpVMo.js → memory-DWwc6pLO.js} +1 -1
- package/build/assets/{mergeWith-fWFIuGgc.js → mergeWith-BGcS1SpY.js} +1 -1
- package/build/assets/{number-overlay-editor-DDQgeQYn.js → number-overlay-editor-B6CLC0X9.js} +1 -1
- package/build/assets/{sandbox-VD4WfD0W.js → sandbox-C6oygvjW.js} +1 -1
- package/build/assets/{slicedToArray-CgI3PJi3.js → slicedToArray-DOoFLiRi.js} +1 -1
- package/build/assets/{timepicker-qd0SiRjC.js → timepicker-C7DrJdVV.js} +1 -1
- package/build/assets/{uniqueId-Dgo2nsPZ.js → uniqueId-C1Mkja_B.js} +1 -1
- package/build/assets/{useBasicWidgetState-9vtYd9vP.js → useBasicWidgetState-CCltHZT9.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-BFx1z0yW.js → useTextInputAutoExpand-LP-kJAB7.js} +1 -1
- package/build/assets/{useUpdateUiValue-BF7Ryinr.js → useUpdateUiValue-JsRPimPm.js} +1 -1
- package/build/assets/{withFullScreenWrapper-C3PKUCi4.js → withFullScreenWrapper-CKQjmc-1.js} +1 -1
- package/build/assets/worker-CiNU4sgs.js +105 -0
- package/build/electron/worker.js +9 -9
- package/build/index.html +1 -1
- package/build/pyodide/pyodide-lock.json +1 -1
- package/build/pyodide/pyodide.asm.js +2 -4
- package/build/pyodide/pyodide.asm.wasm +0 -0
- package/build/pyodide/pyodide.mjs +3 -3
- package/build/pyodide/python_stdlib.zip +0 -0
- package/package.json +6 -6
- package/wheels/streamlit-1.48.0-cp313-none-any.whl +0 -0
- package/build/assets/worker-B7Gzidb7.js +0 -105
- package/wheels/streamlit-1.48.0-cp312-none-any.whl +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b1 as pN,c as mN,aq as se,bh as gN,bi as yN,bj as Xs,bk as hd,G as vN,ap as bN,r as Ne,F as vg,ao as xN,ak as _N,ag as WA,ah as HA,O as wN,bl as AN,H as GA,b4 as XA,l as VA,bd as kN,bm as EN,j as pd,bn as DN}from"./index-DCNLpqIv.js";import{w as CN,E as FN}from"./withFullScreenWrapper-C3PKUCi4.js";import{S as YA,T as SN}from"./Toolbar-DiWCQxr5.js";import{m as $N}from"./mergeWith-fWFIuGgc.js";import{a as Sl,n as MN,b as ON,c as md,t as Aa,p as TN,d as NN,e as BN,i as Fo,f as gd,g as JA,l as Vs,h as bg,j as yd,k as QA,m as So,o as Ys,q as zN,r as $o,s as RN,u as PN,v as LN,w as jN}from"./threshold-CqET7LYC.js";import{f as IN,a as xg,b as ZA,c as UN,R as vd,r as KA,d as _g,e as wg,C as Ag,g as tk,h as ek,i as bd,j as kg,n as Ve,k as $l,l as qN,m as WN,o as HN,p as GN,q as XN,s as VN,t as YN,u as JN,v as QN,w as ZN,x as KN,y as xd}from"./value-CgPGBV_l.js";import{P as tB,i as eB,a as nB,b as rB,p as Eg,T as iB,n as oB,t as aB,d as sB}from"./timer-C0yLShpu.js";import{u as uB}from"./FormClearHelper-fvwQICEk.js";const lB=t=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:t.genericFonts.bodyFont,color:t.colors.bodyText,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,backgroundColor:pN(t.colors.bgColor,.05),fontSize:t.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:t.sizes.maxChartTooltipWidth,padding:`${t.spacing.xs} ${t.spacing.md}`,borderRadius:t.radii.default,zIndex:t.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:t.spacing.none,marginBottom:t.spacing.sm,fontSize:t.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:t.spacing.threeXS,paddingBottom:t.spacing.threeXS},"td.key":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.4)`,textAlign:"right",color:t.colors.fadedText60,whiteSpace:"nowrap",paddingRight:t.spacing.twoXS},"td.value":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),cB=mN("div",{target:"egd2k5h0"})(({theme:t,useContainerWidth:e,isFullScreen:n})=>({width:e||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,zIndex:t.zIndices.popup,top:`calc(${t.iconSizes.md} + 2 * ${t.spacing.xs} + ${t.spacing.xs})`,right:0,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:t.radii.default,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:t.colors.darkenedBgMix15,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:t.spacing.xs,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix15},svg:{width:t.iconSizes.md,height:t.iconSizes.md}}}}),"");function nk(t,e){const n={font:e.genericFonts.bodyFont,background:e.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:e.colors.headingColor,titleFontStyle:"normal",fontWeight:e.fontWeights.bold,fontSize:se(e.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.md),titleColor:Xs(e),titleFontStyle:"normal",labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal"},axis:{labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal",titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.sm),titleColor:Xs(e),titleFontStyle:"normal",ticks:!1,gridColor:hd(e),domain:!1,domainWidth:1,domainColor:hd(e),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:se(e.spacing.lg),labelPadding:se(e.spacing.lg),labelSeparation:se(e.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:se(e.fontSizes.sm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),titleFontSize:se(e.fontSizes.sm),titleFontWeight:e.fontWeights.normal,titleFontStyle:"normal",titleColor:Xs(e),titlePadding:5,labelPadding:se(e.spacing.lg),columnPadding:se(e.spacing.sm),rowPadding:se(e.spacing.twoXS),padding:7,symbolStrokeWidth:se(e.spacing.twoXS)},range:{category:e.colors.chartCategoricalColors,diverging:yN(e),ramp:e.colors.chartSequentialColors,heatmap:e.colors.chartSequentialColors},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:gN(e)},bar:{binSpacing:se(e.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return t?$N({},n,t,(r,i)=>Array.isArray(i)?i:void 0):n}function fB(t,e){const{colors:n,fontSizes:r,genericFonts:i}=e,o={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:se(r.twoSm),titleFontSize:se(r.twoSm)},a={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:hd(e),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:hd(e),continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},mark:{tooltip:!0}};return t?vN({},a,t):a}const dB=20;function hB(t){"params"in t&&"encoding"in t&&t.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&vg(e.select.encodings)&&(e.select.encodings=Object.keys(t.encoding)))})}const pB=(t,e,n,r,i,o,a,s)=>{const u=JSON.parse(t);if(n==="streamlit"?u.config=nk(u.config,i):u.usermeta?.embedOptions?.theme==="streamlit"?(u.config=nk(u.config,i),u.usermeta.embedOptions.theme=void 0):u.config=fB(u.config,i),u.title&&(typeof u.title=="string"&&(u.title={text:u.title}),u.title.limit=u.title.limit??Math.max(a-40,0)),o?(u.width=a,u.height=s,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})):e&&(u.width=a,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})),u.padding||(u.padding={}),vg(u.padding.bottom)&&(u.padding.bottom=dB),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return r.length>0&&hB(u),u},mB=(t,e,n,r)=>{const i=bN(),{id:o,formId:a,spec:s,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=t,h=Ne.useMemo(()=>d,[JSON.stringify(d)]),p=Ne.useMemo(()=>pB(s,c,f,h,i,e,n||0,r),[s,c,f,h,i,e,n,r]);return{id:o,formId:a,vegaLiteTheme:f,spec:p,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function Pi(t,e,n){return t.fields=e||[],t.fname=n,t}function gB(t){return t==null?null:t.fname}function rk(t){return t==null?null:t.fields}function ik(t){return t.length===1?yB(t[0]):vB(t)}const yB=t=>function(e){return e[t]},vB=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function _d(t){throw Error(t)}function Dg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||_d("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&_d("Access path missing closing bracket: "+t),r&&_d("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function Cg(t,e,n){const r=Dg(t);return t=r.length===1?r[0]:t,Pi((n&&n.get||ik)(r),[t],e||t)}const bB=Cg("id"),Fg=Pi(t=>t,[],"identity"),xB=Pi(()=>0,[],"zero"),_B=Pi(()=>1,[],"one"),ok=Pi(()=>!0,[],"true"),wB=Pi(()=>!1,[],"false");function AB(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const ak=0,sk=1,uk=2,lk=3,ck=4;function kB(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AB,r=t||ak;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=sk&&n(e||"error","ERROR",arguments),this},warn(){return r>=uk&&n(e||"warn","WARN",arguments),this},info(){return r>=lk&&n(e||"log","INFO",arguments),this},debug(){return r>=ck&&n(e||"log","DEBUG",arguments),this}}}var wd=Array.isArray;function ka(t){return t===Object(t)}const fk=t=>t!=="__proto__";function Sg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=EB(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;Ad(r,o,i[o],a)}return r},{})}function Ad(t,e,n,r){if(!fk(e))return;let i,o;if(ka(n)&&!wd(n)){o=ka(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?Ad(o,i,n[i]):fk(i)&&(o[i]=n[i])}else t[e]=n}function EB(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Js(t){return t[t.length-1]}function $g(t){return t==null||t===""?null:+t}const dk=t=>e=>t*Math.exp(e),hk=t=>e=>Math.log(t*e),pk=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),mk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,kd=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Ed(t,e,n,r){const i=n(t[0]),o=n(Js(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function DB(t,e){return Ed(t,e,$g,Fg)}function CB(t,e){var n=Math.sign(t[0]);return Ed(t,e,hk(n),dk(n))}function FB(t,e,n){return Ed(t,e,kd(n),kd(1/n))}function SB(t,e,n){return Ed(t,e,pk(n),mk(n))}function Dd(t,e,n,r,i){const o=r(t[0]),a=r(Js(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function $B(t,e,n){return Dd(t,e,n,$g,Fg)}function MB(t,e,n){const r=Math.sign(t[0]);return Dd(t,e,n,hk(r),dk(r))}function OB(t,e,n,r){return Dd(t,e,n,kd(r),kd(1/r))}function TB(t,e,n,r){return Dd(t,e,n,pk(r),mk(r))}function NB(t){return 1+~~(new Date(t).getMonth()/3)}function BB(t){return 1+~~(new Date(t).getUTCMonth()/3)}function Ml(t){return t!=null?wd(t)?t:[t]:[]}function zB(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function Cd(t){return typeof t=="function"}const RB="descending";function PB(t,e,n){n=n||{},e=Ml(e)||[];const r=[],i=[],o={},a=n.comparator||LB;return Ml(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===RB?-1:1),i.push(s=Cd(s)?s:Cg(s,null,n)),(rk(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Pi(a(i,r),Object.keys(o))}const Mg=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),LB=(t,e)=>t.length===1?jB(t[0],e[0]):IB(t,e,t.length),jB=(t,e)=>function(n,r){return Mg(t(n),t(r))*e},IB=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Mg(o(r),o(i));return a*e[s]});function UB(t){return Cd(t)?t:()=>t}function qB(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function Og(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function WB(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function HB(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}const GB=Object.prototype.hasOwnProperty;function Li(t,e){return GB.call(t,e)}const Fd={};function XB(t){let e={},n;function r(o){return Li(e,o)&&e[o]!==Fd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Fd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Fd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Fd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function VB(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Js(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function YB(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),Og(r,n)}function JB(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function gk(t){return typeof t=="boolean"}function yk(t){return Object.prototype.toString.call(t)==="[object Date]"}function QB(t){return t&&Cd(t[Symbol.iterator])}function vk(t){return typeof t=="number"}function ZB(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ji(t){return typeof t=="string"}function KB(t,e,n){t&&(t=e?Ml(t).map(s=>s.replace(/\\(.)/g,"$1")):Ml(t));const r=t&&t.length,i=n&&n.get||ik,o=s=>i(e?[s]:Dg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Pi(a,t,"key")}function tz(t,e){const n=t[0],r=Js(t),i=+e;return i?i===1?r:n+i*(r-n):n}const ez=1e4;function nz(t){t=+t||ez;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>Li(e,a)||Li(n,a),get:a=>Li(e,a)?e[a]:Li(n,a)?o(a,n[a]):void 0,set:(a,s)=>Li(e,a)?e[a]=s:o(a,s)}}function rz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Ol(t,e){let n="";for(;--e>=0;)n+=t;return n}function iz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Ol(i,a)+o:r==="center"?Ol(i,~~(a/2))+o+Ol(i,Math.ceil(a/2)):o+Ol(i,a)}function oz(t){return t&&Js(t)-t[0]||0}function Qs(t){return wd(t)?"["+t.map(Qs)+"]":ka(t)||ji(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function az(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const sz=t=>vk(t)||yk(t)?t:Date.parse(t);function uz(t,e){return e=e||sz,t==null||t===""?null:e(t)}function lz(t){return t==null||t===""?null:t+""}function cz(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function fz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function dz(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}function Wn(t,e,n){return t.fields=e||[],t.fname=n,t}function ue(t){return t==null?null:t.fname}function un(t){return t==null?null:t.fields}function bk(t){return t.length===1?hz(t[0]):pz(t)}const hz=t=>function(e){return e[t]},pz=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function R(t){throw Error(t)}function Tg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||R("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&R("Access path missing closing bracket: "+t),r&&R("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function wr(t,e,n){const r=Tg(t);return t=r.length===1?r[0]:t,Wn((n&&n.get||bk)(r),[t],e||t)}const Sd=wr("id"),Fn=Wn(t=>t,[],"identity"),Ea=Wn(()=>0,[],"zero"),Tl=Wn(()=>1,[],"one"),Ar=Wn(()=>!0,[],"true"),Da=Wn(()=>!1,[],"false");function mz(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const gz=0,xk=1,yz=2,vz=3,bz=4;function xz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mz,r=t||gz;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=xk&&n("error","ERROR",arguments),this},warn(){return r>=yz&&n("warn","WARN",arguments),this},info(){return r>=vz&&n("log","INFO",arguments),this},debug(){return r>=bz&&n("log","DEBUG",arguments),this}}}var K=Array.isArray;function mt(t){return t===Object(t)}const _k=t=>t!=="__proto__";function _z(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=wz(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;wk(r,o,i[o],a)}return r},{})}function wk(t,e,n,r){if(!_k(e))return;let i,o;if(mt(n)&&!K(n)){o=mt(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?wk(o,i,n[i]):_k(i)&&(o[i]=n[i])}else t[e]=n}function wz(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Et(t){return t[t.length-1]}function ln(t){return t==null||t===""?null:+t}const Ak=t=>e=>t*Math.exp(e),kk=t=>e=>Math.log(t*e),Ek=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),Dk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,$d=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Md(t,e,n,r){const i=n(t[0]),o=n(Et(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function Az(t,e){return Md(t,e,ln,Fn)}function kz(t,e){var n=Math.sign(t[0]);return Md(t,e,kk(n),Ak(n))}function Ez(t,e,n){return Md(t,e,$d(n),$d(1/n))}function Dz(t,e,n){return Md(t,e,Ek(n),Dk(n))}function Od(t,e,n,r,i){const o=r(t[0]),a=r(Et(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Ck(t,e,n){return Od(t,e,n,ln,Fn)}function Fk(t,e,n){const r=Math.sign(t[0]);return Od(t,e,n,kk(r),Ak(r))}function Ng(t,e,n,r){return Od(t,e,n,$d(r),$d(1/r))}function Sk(t,e,n,r){return Od(t,e,n,Ek(r),Dk(r))}function Cz(t){return 1+~~(new Date(t).getMonth()/3)}function Fz(t){return 1+~~(new Date(t).getUTCMonth()/3)}function rt(t){return t!=null?K(t)?t:[t]:[]}function Sz(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function gt(t){return typeof t=="function"}const $z="descending";function $k(t,e,n){n=n||{},e=rt(e)||[];const r=[],i=[],o={},a=n.comparator||Mz;return rt(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===$z?-1:1),i.push(s=gt(s)?s:wr(s,null,n)),(un(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Wn(a(i,r),Object.keys(o))}const Td=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),Mz=(t,e)=>t.length===1?Oz(t[0],e[0]):Tz(t,e,t.length),Oz=(t,e)=>function(n,r){return Td(t(n),t(r))*e},Tz=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Td(o(r),o(i));return a*e[s]});function cn(t){return gt(t)?t:()=>t}function Mk(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function yt(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function Ii(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function Nz(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}function lt(t,e){return Object.hasOwn(t,e)}const Nd={};function Nl(t){let e={},n;function r(o){return lt(e,o)&&e[o]!==Nd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Nd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Nd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Nd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function Bz(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Et(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function H(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),yt(r,n)}function Bl(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function zz(t){return typeof t=="boolean"}function Ca(t){return Object.prototype.toString.call(t)==="[object Date]"}function Rz(t){return t&>(t[Symbol.iterator])}function Fa(t){return typeof t=="number"}function Ok(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Xt(t){return typeof t=="string"}function Tk(t,e,n){t&&(t=e?rt(t).map(s=>s.replace(/\\(.)/g,"$1")):rt(t));const r=t&&t.length,i=n&&n.get||bk,o=s=>i(e?[s]:Tg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Wn(a,t,"key")}function Pz(t,e){const n=t[0],r=Et(t),i=+e;return i?i===1?r:n+i*(r-n):n}const Lz=1e4;function jz(t){t=+t||Lz;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>lt(e,a)||lt(n,a),get:a=>lt(e,a)?e[a]:lt(n,a)?o(a,n[a]):void 0,set:(a,s)=>lt(e,a)?e[a]=s:o(a,s)}}function Iz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Bd(t,e){let n="";for(;--e>=0;)n+=t;return n}function Uz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Bd(i,a)+o:r==="center"?Bd(i,~~(a/2))+o+Bd(i,Math.ceil(a/2)):o+Bd(i,a)}function zd(t){return t&&Et(t)-t[0]||0}function it(t){return K(t)?"["+t.map(it)+"]":mt(t)||Xt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Nk(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const qz=t=>Fa(t)||Ca(t)?t:Date.parse(t);function Bk(t,e){return e=e||qz,t==null||t===""?null:e(t)}function zk(t){return t==null||t===""?null:t+""}function ti(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Wz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Sa(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}var Rk={},Bg={},zg=34,zl=10,Rg=13;function Pk(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function Hz(t,e){var n=Pk(t);return function(r,i){return e(n(r),i,t)}}function Lk(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function Sn(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Gz(t){return t<0?"-"+Sn(-t,6):t>9999?"+"+Sn(t,6):Sn(t,4)}function Xz(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":Gz(t.getUTCFullYear())+"-"+Sn(t.getUTCMonth()+1,2)+"-"+Sn(t.getUTCDate(),2)+(i?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"."+Sn(i,3)+"Z":r?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"Z":n||e?"T"+Sn(e,2)+":"+Sn(n,2)+"Z":"")}function Vz(t){var e=new RegExp('["'+t+`
|
|
1
|
+
import{b1 as pN,c as mN,aq as se,bh as gN,bi as yN,bj as Xs,bk as hd,G as vN,ap as bN,r as Ne,F as vg,ao as xN,ak as _N,ag as WA,ah as HA,O as wN,bl as AN,H as GA,b4 as XA,l as VA,bd as kN,bm as EN,j as pd,bn as DN}from"./index-clm6On2Y.js";import{w as CN,E as FN}from"./withFullScreenWrapper-CKQjmc-1.js";import{S as YA,T as SN}from"./Toolbar-AvCHJeN3.js";import{m as $N}from"./mergeWith-BGcS1SpY.js";import{a as Sl,n as MN,b as ON,c as md,t as Aa,p as TN,d as NN,e as BN,i as Fo,f as gd,g as JA,l as Vs,h as bg,j as yd,k as QA,m as So,o as Ys,q as zN,r as $o,s as RN,u as PN,v as LN,w as jN}from"./threshold-CqET7LYC.js";import{f as IN,a as xg,b as ZA,c as UN,R as vd,r as KA,d as _g,e as wg,C as Ag,g as tk,h as ek,i as bd,j as kg,n as Ve,k as $l,l as qN,m as WN,o as HN,p as GN,q as XN,s as VN,t as YN,u as JN,v as QN,w as ZN,x as KN,y as xd}from"./value-CgPGBV_l.js";import{P as tB,i as eB,a as nB,b as rB,p as Eg,T as iB,n as oB,t as aB,d as sB}from"./timer-C0yLShpu.js";import{u as uB}from"./FormClearHelper-DBsQ33IR.js";const lB=t=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:t.genericFonts.bodyFont,color:t.colors.bodyText,border:`${t.sizes.borderWidth} solid ${t.colors.borderColor}`,backgroundColor:pN(t.colors.bgColor,.05),fontSize:t.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:t.sizes.maxChartTooltipWidth,padding:`${t.spacing.xs} ${t.spacing.md}`,borderRadius:t.radii.default,zIndex:t.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:t.spacing.none,marginBottom:t.spacing.sm,fontSize:t.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:t.spacing.threeXS,paddingBottom:t.spacing.threeXS},"td.key":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.4)`,textAlign:"right",color:t.colors.fadedText60,whiteSpace:"nowrap",paddingRight:t.spacing.twoXS},"td.value":{maxWidth:`calc((${t.sizes.maxChartTooltipWidth} - 2 * ${t.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),cB=mN("div",{target:"egd2k5h0"})(({theme:t,useContainerWidth:e,isFullScreen:n})=>({width:e||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,zIndex:t.zIndices.popup,top:`calc(${t.iconSizes.md} + 2 * ${t.spacing.xs} + ${t.spacing.xs})`,right:0,backgroundColor:t.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${t.sizes.borderWidth} solid ${t.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:t.radii.default,a:{fontFamily:t.genericFonts.bodyFont,fontWeight:t.fontWeights.normal,fontSize:t.fontSizes.md,margin:0,padding:`${t.spacing.twoXS} ${t.spacing.twoXL}`,color:t.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:t.colors.darkenedBgMix15,color:t.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:t.spacing.xs,height:"auto",zIndex:t.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:t.radii.default,color:t.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:t.colors.bodyText,opacity:"1 !important",background:t.colors.darkenedBgMix15},svg:{width:t.iconSizes.md,height:t.iconSizes.md}}}}),"");function nk(t,e){const n={font:e.genericFonts.bodyFont,background:e.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:e.colors.headingColor,titleFontStyle:"normal",fontWeight:e.fontWeights.bold,fontSize:se(e.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.md),titleColor:Xs(e),titleFontStyle:"normal",labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal"},axis:{labelFontSize:se(e.fontSizes.twoSm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),labelFontStyle:"normal",titleFontWeight:e.fontWeights.normal,titleFontSize:se(e.fontSizes.sm),titleColor:Xs(e),titleFontStyle:"normal",ticks:!1,gridColor:hd(e),domain:!1,domainWidth:1,domainColor:hd(e),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:se(e.spacing.lg),labelPadding:se(e.spacing.lg),labelSeparation:se(e.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:se(e.fontSizes.sm),labelFontWeight:e.fontWeights.normal,labelColor:Xs(e),titleFontSize:se(e.fontSizes.sm),titleFontWeight:e.fontWeights.normal,titleFontStyle:"normal",titleColor:Xs(e),titlePadding:5,labelPadding:se(e.spacing.lg),columnPadding:se(e.spacing.sm),rowPadding:se(e.spacing.twoXS),padding:7,symbolStrokeWidth:se(e.spacing.twoXS)},range:{category:e.colors.chartCategoricalColors,diverging:yN(e),ramp:e.colors.chartSequentialColors,heatmap:e.colors.chartSequentialColors},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:gN(e)},bar:{binSpacing:se(e.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return t?$N({},n,t,(r,i)=>Array.isArray(i)?i:void 0):n}function fB(t,e){const{colors:n,fontSizes:r,genericFonts:i}=e,o={labelFont:i.bodyFont,titleFont:i.bodyFont,labelFontSize:se(r.twoSm),titleFontSize:se(r.twoSm)},a={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:hd(e),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:hd(e),continuousHeight:se(e.sizes.defaultChartHeight),continuousWidth:se(e.sizes.defaultChartWidth)},mark:{tooltip:!0}};return t?vN({},a,t):a}const dB=20;function hB(t){"params"in t&&"encoding"in t&&t.params.forEach(e=>{"select"in e&&(["interval","point"].includes(e.select)&&(e.select={type:e.select}),"type"in e.select&&e.select.type==="point"&&!("encodings"in e.select)&&vg(e.select.encodings)&&(e.select.encodings=Object.keys(t.encoding)))})}const pB=(t,e,n,r,i,o,a,s)=>{const u=JSON.parse(t);if(n==="streamlit"?u.config=nk(u.config,i):u.usermeta?.embedOptions?.theme==="streamlit"?(u.config=nk(u.config,i),u.usermeta.embedOptions.theme=void 0):u.config=fB(u.config,i),u.title&&(typeof u.title=="string"&&(u.title={text:u.title}),u.title.limit=u.title.limit??Math.max(a-40,0)),o?(u.width=a,u.height=s,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})):e&&(u.width=a,"vconcat"in u&&u.vconcat.forEach(l=>{l.width=a})),u.padding||(u.padding={}),vg(u.padding.bottom)&&(u.padding.bottom=dB),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return r.length>0&&hB(u),u},mB=(t,e,n,r)=>{const i=bN(),{id:o,formId:a,spec:s,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=t,h=Ne.useMemo(()=>d,[JSON.stringify(d)]),p=Ne.useMemo(()=>pB(s,c,f,h,i,e,n||0,r),[s,c,f,h,i,e,n,r]);return{id:o,formId:a,vegaLiteTheme:f,spec:p,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function Pi(t,e,n){return t.fields=e||[],t.fname=n,t}function gB(t){return t==null?null:t.fname}function rk(t){return t==null?null:t.fields}function ik(t){return t.length===1?yB(t[0]):vB(t)}const yB=t=>function(e){return e[t]},vB=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function _d(t){throw Error(t)}function Dg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||_d("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&_d("Access path missing closing bracket: "+t),r&&_d("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function Cg(t,e,n){const r=Dg(t);return t=r.length===1?r[0]:t,Pi((n&&n.get||ik)(r),[t],e||t)}const bB=Cg("id"),Fg=Pi(t=>t,[],"identity"),xB=Pi(()=>0,[],"zero"),_B=Pi(()=>1,[],"one"),ok=Pi(()=>!0,[],"true"),wB=Pi(()=>!1,[],"false");function AB(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const ak=0,sk=1,uk=2,lk=3,ck=4;function kB(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AB,r=t||ak;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=sk&&n(e||"error","ERROR",arguments),this},warn(){return r>=uk&&n(e||"warn","WARN",arguments),this},info(){return r>=lk&&n(e||"log","INFO",arguments),this},debug(){return r>=ck&&n(e||"log","DEBUG",arguments),this}}}var wd=Array.isArray;function ka(t){return t===Object(t)}const fk=t=>t!=="__proto__";function Sg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=EB(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;Ad(r,o,i[o],a)}return r},{})}function Ad(t,e,n,r){if(!fk(e))return;let i,o;if(ka(n)&&!wd(n)){o=ka(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?Ad(o,i,n[i]):fk(i)&&(o[i]=n[i])}else t[e]=n}function EB(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Js(t){return t[t.length-1]}function $g(t){return t==null||t===""?null:+t}const dk=t=>e=>t*Math.exp(e),hk=t=>e=>Math.log(t*e),pk=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),mk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,kd=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Ed(t,e,n,r){const i=n(t[0]),o=n(Js(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function DB(t,e){return Ed(t,e,$g,Fg)}function CB(t,e){var n=Math.sign(t[0]);return Ed(t,e,hk(n),dk(n))}function FB(t,e,n){return Ed(t,e,kd(n),kd(1/n))}function SB(t,e,n){return Ed(t,e,pk(n),mk(n))}function Dd(t,e,n,r,i){const o=r(t[0]),a=r(Js(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function $B(t,e,n){return Dd(t,e,n,$g,Fg)}function MB(t,e,n){const r=Math.sign(t[0]);return Dd(t,e,n,hk(r),dk(r))}function OB(t,e,n,r){return Dd(t,e,n,kd(r),kd(1/r))}function TB(t,e,n,r){return Dd(t,e,n,pk(r),mk(r))}function NB(t){return 1+~~(new Date(t).getMonth()/3)}function BB(t){return 1+~~(new Date(t).getUTCMonth()/3)}function Ml(t){return t!=null?wd(t)?t:[t]:[]}function zB(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function Cd(t){return typeof t=="function"}const RB="descending";function PB(t,e,n){n=n||{},e=Ml(e)||[];const r=[],i=[],o={},a=n.comparator||LB;return Ml(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===RB?-1:1),i.push(s=Cd(s)?s:Cg(s,null,n)),(rk(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Pi(a(i,r),Object.keys(o))}const Mg=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),LB=(t,e)=>t.length===1?jB(t[0],e[0]):IB(t,e,t.length),jB=(t,e)=>function(n,r){return Mg(t(n),t(r))*e},IB=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Mg(o(r),o(i));return a*e[s]});function UB(t){return Cd(t)?t:()=>t}function qB(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function Og(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function WB(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function HB(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}const GB=Object.prototype.hasOwnProperty;function Li(t,e){return GB.call(t,e)}const Fd={};function XB(t){let e={},n;function r(o){return Li(e,o)&&e[o]!==Fd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Fd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Fd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Fd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function VB(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Js(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function YB(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),Og(r,n)}function JB(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function gk(t){return typeof t=="boolean"}function yk(t){return Object.prototype.toString.call(t)==="[object Date]"}function QB(t){return t&&Cd(t[Symbol.iterator])}function vk(t){return typeof t=="number"}function ZB(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ji(t){return typeof t=="string"}function KB(t,e,n){t&&(t=e?Ml(t).map(s=>s.replace(/\\(.)/g,"$1")):Ml(t));const r=t&&t.length,i=n&&n.get||ik,o=s=>i(e?[s]:Dg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Pi(a,t,"key")}function tz(t,e){const n=t[0],r=Js(t),i=+e;return i?i===1?r:n+i*(r-n):n}const ez=1e4;function nz(t){t=+t||ez;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>Li(e,a)||Li(n,a),get:a=>Li(e,a)?e[a]:Li(n,a)?o(a,n[a]):void 0,set:(a,s)=>Li(e,a)?e[a]=s:o(a,s)}}function rz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Ol(t,e){let n="";for(;--e>=0;)n+=t;return n}function iz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Ol(i,a)+o:r==="center"?Ol(i,~~(a/2))+o+Ol(i,Math.ceil(a/2)):o+Ol(i,a)}function oz(t){return t&&Js(t)-t[0]||0}function Qs(t){return wd(t)?"["+t.map(Qs)+"]":ka(t)||ji(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function az(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const sz=t=>vk(t)||yk(t)?t:Date.parse(t);function uz(t,e){return e=e||sz,t==null||t===""?null:e(t)}function lz(t){return t==null||t===""?null:t+""}function cz(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function fz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function dz(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}function Wn(t,e,n){return t.fields=e||[],t.fname=n,t}function ue(t){return t==null?null:t.fname}function un(t){return t==null?null:t.fields}function bk(t){return t.length===1?hz(t[0]):pz(t)}const hz=t=>function(e){return e[t]},pz=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function R(t){throw Error(t)}function Tg(t){const e=[],n=t.length;let r=null,i=0,o="",a,s,u;t=t+"";function l(){e.push(o+t.substring(a,s)),o="",a=s+1}for(a=s=0;s<n;++s)if(u=t[s],u==="\\")o+=t.substring(a,s++),a=s;else if(u===r)l(),r=null,i=-1;else{if(r)continue;a===i&&u==='"'||a===i&&u==="'"?(a=s+1,r=u):u==="."&&!i?s>a?l():a=s+1:u==="["?(s>a&&l(),i=a=s+1):u==="]"&&(i||R("Access path missing open bracket: "+t),i>0&&l(),i=0,a=s+1)}return i&&R("Access path missing closing bracket: "+t),r&&R("Access path missing closing quote: "+t),s>a&&(s++,l()),e}function wr(t,e,n){const r=Tg(t);return t=r.length===1?r[0]:t,Wn((n&&n.get||bk)(r),[t],e||t)}const Sd=wr("id"),Fn=Wn(t=>t,[],"identity"),Ea=Wn(()=>0,[],"zero"),Tl=Wn(()=>1,[],"one"),Ar=Wn(()=>!0,[],"true"),Da=Wn(()=>!1,[],"false");function mz(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const gz=0,xk=1,yz=2,vz=3,bz=4;function xz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mz,r=t||gz;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=xk&&n("error","ERROR",arguments),this},warn(){return r>=yz&&n("warn","WARN",arguments),this},info(){return r>=vz&&n("log","INFO",arguments),this},debug(){return r>=bz&&n("log","DEBUG",arguments),this}}}var K=Array.isArray;function mt(t){return t===Object(t)}const _k=t=>t!=="__proto__";function _z(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=wz(r.signals,i.signals);else{const a=o==="legend"?{layout:1}:o==="style"?!0:null;wk(r,o,i[o],a)}return r},{})}function wk(t,e,n,r){if(!_k(e))return;let i,o;if(mt(n)&&!K(n)){o=mt(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?wk(o,i,n[i]):_k(i)&&(o[i]=n[i])}else t[e]=n}function wz(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function Et(t){return t[t.length-1]}function ln(t){return t==null||t===""?null:+t}const Ak=t=>e=>t*Math.exp(e),kk=t=>e=>Math.log(t*e),Ek=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),Dk=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,$d=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Md(t,e,n,r){const i=n(t[0]),o=n(Et(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function Az(t,e){return Md(t,e,ln,Fn)}function kz(t,e){var n=Math.sign(t[0]);return Md(t,e,kk(n),Ak(n))}function Ez(t,e,n){return Md(t,e,$d(n),$d(1/n))}function Dz(t,e,n){return Md(t,e,Ek(n),Dk(n))}function Od(t,e,n,r,i){const o=r(t[0]),a=r(Et(t)),s=e!=null?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function Ck(t,e,n){return Od(t,e,n,ln,Fn)}function Fk(t,e,n){const r=Math.sign(t[0]);return Od(t,e,n,kk(r),Ak(r))}function Ng(t,e,n,r){return Od(t,e,n,$d(r),$d(1/r))}function Sk(t,e,n,r){return Od(t,e,n,Ek(r),Dk(r))}function Cz(t){return 1+~~(new Date(t).getMonth()/3)}function Fz(t){return 1+~~(new Date(t).getUTCMonth()/3)}function rt(t){return t!=null?K(t)?t:[t]:[]}function Sz(t,e,n){let r=t[0],i=t[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function gt(t){return typeof t=="function"}const $z="descending";function $k(t,e,n){n=n||{},e=rt(e)||[];const r=[],i=[],o={},a=n.comparator||Mz;return rt(t).forEach((s,u)=>{s!=null&&(r.push(e[u]===$z?-1:1),i.push(s=gt(s)?s:wr(s,null,n)),(un(s)||[]).forEach(l=>o[l]=1))}),i.length===0?null:Wn(a(i,r),Object.keys(o))}const Td=(t,e)=>(t<e||t==null)&&e!=null?-1:(t>e||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),Mz=(t,e)=>t.length===1?Oz(t[0],e[0]):Tz(t,e,t.length),Oz=(t,e)=>function(n,r){return Td(t(n),t(r))*e},Tz=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;a===0&&++s<n;)o=t[s],a=Td(o(r),o(i));return a*e[s]});function cn(t){return gt(t)?t:()=>t}function Mk(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function yt(t){for(let e,n,r=1,i=arguments.length;r<i;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t}function Ii(t,e){let n=0,r,i,o,a;if(t&&(r=t.length))if(e==null){for(i=t[n];n<r&&(i==null||i!==i);i=t[++n]);for(o=a=i;n<r;++n)i=t[n],i!=null&&(i<o&&(o=i),i>a&&(a=i))}else{for(i=e(t[n]);n<r&&(i==null||i!==i);i=e(t[++n]));for(o=a=i;n<r;++n)i=e(t[n]),i!=null&&(i<o&&(o=i),i>a&&(a=i))}return[o,a]}function Nz(t,e){const n=t.length;let r=-1,i,o,a,s,u;if(e==null){for(;++r<n;)if(o=t[r],o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=t[r],o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}else{for(;++r<n;)if(o=e(t[r],r,t),o!=null&&o>=o){i=a=o;break}if(r===n)return[-1,-1];for(s=u=r;++r<n;)o=e(t[r],r,t),o!=null&&(i>o&&(i=o,s=r),a<o&&(a=o,u=r))}return[s,u]}function lt(t,e){return Object.hasOwn(t,e)}const Nd={};function Nl(t){let e={},n;function r(o){return lt(e,o)&&e[o]!==Nd}const i={size:0,empty:0,object:e,has:r,get(o){return r(o)?e[o]:void 0},set(o,a){return r(o)||(++i.size,e[o]===Nd&&--i.empty),e[o]=a,this},delete(o){return r(o)&&(--i.size,++i.empty,e[o]=Nd),this},clear(){i.size=i.empty=0,i.object=e={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let a=0;for(const s in e){const u=e[s];u!==Nd&&(!n||!n(u))&&(o[s]=u,++a)}i.size=a,i.empty=0,i.object=e=o}};return t&&Object.keys(t).forEach(o=>{i.set(o,t[o])}),i}function Bz(t,e,n,r,i,o){if(!n&&n!==0)return o;const a=+n;let s=t[0],u=Et(t),l;u<s&&(l=s,s=u,u=l),l=Math.abs(e-s);const c=Math.abs(u-e);return l<c&&l<=a?r:c<=a?i:o}function H(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),yt(r,n)}function Bl(t,e,n,r){let i=e[0],o=e[e.length-1],a;return i>o&&(a=i,i=o,o=a),n=n===void 0||n,r=r===void 0||r,(n?i<=t:i<t)&&(r?t<=o:t<o)}function zz(t){return typeof t=="boolean"}function Ca(t){return Object.prototype.toString.call(t)==="[object Date]"}function Rz(t){return t&>(t[Symbol.iterator])}function Fa(t){return typeof t=="number"}function Ok(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Xt(t){return typeof t=="string"}function Tk(t,e,n){t&&(t=e?rt(t).map(s=>s.replace(/\\(.)/g,"$1")):rt(t));const r=t&&t.length,i=n&&n.get||bk,o=s=>i(e?[s]:Tg(s));let a;if(!r)a=function(){return""};else if(r===1){const s=o(t[0]);a=function(u){return""+s(u)}}else{const s=t.map(o);a=function(u){let l=""+s[0](u),c=0;for(;++c<r;)l+="|"+s[c](u);return l}}return Wn(a,t,"key")}function Pz(t,e){const n=t[0],r=Et(t),i=+e;return i?i===1?r:n+i*(r-n):n}const Lz=1e4;function jz(t){t=+t||Lz;let e,n,r;const i=()=>{e={},n={},r=0},o=(a,s)=>(++r>t&&(n=e,e={},r=1),e[a]=s);return i(),{clear:i,has:a=>lt(e,a)||lt(n,a),get:a=>lt(e,a)?e[a]:lt(n,a)?o(a,n[a]):void 0,set:(a,s)=>lt(e,a)?e[a]=s:o(a,s)}}function Iz(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function Bd(t,e){let n="";for(;--e>=0;)n+=t;return n}function Uz(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:r==="left"?Bd(i,a)+o:r==="center"?Bd(i,~~(a/2))+o+Bd(i,Math.ceil(a/2)):o+Bd(i,a)}function zd(t){return t&&Et(t)-t[0]||0}function it(t){return K(t)?"["+t.map(it)+"]":mt(t)||Xt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Nk(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const qz=t=>Fa(t)||Ca(t)?t:Date.parse(t);function Bk(t,e){return e=e||qz,t==null||t===""?null:e(t)}function zk(t){return t==null||t===""?null:t+""}function ti(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Wz(t,e,n,r){const i=r??"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:n==="left"?i+o.slice(a-s):n==="center"?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Sa(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const o=e(t[i]);o&&n(o,i,t)}}else t.forEach(n)}var Rk={},Bg={},zg=34,zl=10,Rg=13;function Pk(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function Hz(t,e){var n=Pk(t);return function(r,i){return e(n(r),i,t)}}function Lk(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function Sn(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Gz(t){return t<0?"-"+Sn(-t,6):t>9999?"+"+Sn(t,6):Sn(t,4)}function Xz(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":Gz(t.getUTCFullYear())+"-"+Sn(t.getUTCMonth()+1,2)+"-"+Sn(t.getUTCDate(),2)+(i?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"."+Sn(i,3)+"Z":r?"T"+Sn(e,2)+":"+Sn(n,2)+":"+Sn(r,2)+"Z":n||e?"T"+Sn(e,2)+":"+Sn(n,2)+"Z":"")}function Vz(t){var e=new RegExp('["'+t+`
|
|
2
2
|
\r]`),n=t.charCodeAt(0);function r(f,d){var h,p,m=i(f,function(g,y){if(h)return h(g,y-1);p=g,h=d?Hz(g,d):Pk(g)});return m.columns=p||[],m}function i(f,d){var h=[],p=f.length,m=0,g=0,y,v=p<=0,b=!1;f.charCodeAt(p-1)===zl&&--p,f.charCodeAt(p-1)===Rg&&--p;function x(){if(v)return Bg;if(b)return b=!1,Rk;var A,_=m,k;if(f.charCodeAt(_)===zg){for(;m++<p&&f.charCodeAt(m)!==zg||f.charCodeAt(++m)===zg;);return(A=m)>=p?v=!0:(k=f.charCodeAt(m++))===zl?b=!0:k===Rg&&(b=!0,f.charCodeAt(m)===zl&&++m),f.slice(_+1,A-1).replace(/""/g,'"')}for(;m<p;){if((k=f.charCodeAt(A=m++))===zl)b=!0;else if(k===Rg)b=!0,f.charCodeAt(m)===zl&&++m;else if(k!==n)continue;return f.slice(_,A)}return v=!0,f.slice(_,p)}for(;(y=x())!==Bg;){for(var w=[];y!==Rk&&y!==Bg;)w.push(y),y=x();d&&(w=d(w,g++))==null||h.push(w)}return h}function o(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(t)})}function a(f,d){return d==null&&(d=Lk(f)),[d.map(c).join(t)].concat(o(f,d)).join(`
|
|
3
3
|
`)}function s(f,d){return d==null&&(d=Lk(f)),o(f,d).join(`
|
|
4
4
|
`)}function u(f){return f.map(l).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r as n,u as y,a as A,j as f,l as L}from"./index-
|
|
1
|
+
import{c as m,r as n,u as y,a as A,j as f,l as L}from"./index-clm6On2Y.js";const h=m("div",{target:"exyuj7n1"})(()=>({lineHeight:0}),""),j=m("audio",{target:"exyuj7n0"})(({theme:r})=>({width:"100%",height:r.sizes.minElementHeight,margin:0,padding:0}),""),x=L.getLogger("Audio");function C({element:r,endpoints:d,elementMgr:a}){const o=n.useRef(null),{startTime:i,endTime:s,loop:u,autoplay:g}=r,E=n.useMemo(()=>{if(!r.id)return!0;const e=a.getElementState(r.id,"preventAutoplay");return e||a.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,a]);n.useEffect(()=>{o.current&&(o.current.currentTime=i)},[i]),n.useEffect(()=>{const e=o.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),n.useEffect(()=>{const e=o.current;if(!e)return;let t=!1;const l=()=>{s>0&&e.currentTime>=s&&(u?(e.currentTime=i||0,e.play()):t||(t=!0,e.pause()))};return s>0&&e.addEventListener("timeupdate",l),()=>{e&&s>0&&e.removeEventListener("timeupdate",l)}},[s,u,i]),n.useEffect(()=>{const e=o.current;if(!e)return;const t=()=>{u&&(e.currentTime=i||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[u,i]);const c=y(r.url),p=A(c),v=d.buildMediaURL(c),T=e=>{const t=e.currentTarget.src;x.error(`Client Error: Audio source error - ${t}`),d.sendClientErrorToHost("Audio","Audio source failed to load","onerror triggered",t)};return f.jsx(h,{children:f.jsx(j,{className:"stAudio","data-testid":"stAudio",ref:o,controls:!0,autoPlay:g&&!E,src:v,onError:T,crossOrigin:p})})}const H=n.memo(C);export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,E as P,_,c as R,dd as v,F as g,H as X,l as pe,ap as me,bm as be,d3 as ge,aq as G,j as i,b$ as fe,c0 as he,ch as ye,c1 as ve,bJ as we,b9 as Ie,bY as K}from"./index-
|
|
1
|
+
import{r as a,E as P,_,c as R,dd as v,F as g,H as X,l as pe,ap as me,bm as be,d3 as ge,aq as G,j as i,b$ as fe,c0 as he,ch as ye,c1 as ve,bJ as we,b9 as Ie,bY as K}from"./index-clm6On2Y.js";import{u as xe}from"./uniqueId-C1Mkja_B.js";import{I as Te}from"./InputInstructions-CtPX8G6i.js";import{u as ke}from"./FormClearHelper-DBsQ33IR.js";import{s as Ce}from"./sprintf-D7DtBTRn.js";import{I as Re}from"./input-D2HjwqoP.js";import"./base-input-C1jq7mBd.js";var q=a.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(P,_({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),a.createElement("path",{d:"M0 3v2h8V3H0z"}))});q.displayName="Minus";var J=a.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(P,_({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),a.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});J.displayName="Plus";const Se=R("div",{target:"e116k4er3"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor??e.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}),""),ze=R("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),Y=R("button",{target:"e116k4er1"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}),""),Ee=R("div",{target:"e116k4er0"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`}),""),Ve=pe.getLogger("NumberInput");function Ne(e){return g(e)||e===""?void 0:e}const j=({value:e,format:t,step:n,dataType:b})=>{if(g(e))return null;let r=Ne(t);if(g(r)&&X(n)){const p=n.toString();b===v.DataType.FLOAT&&n!==0&&p.includes(".")&&(r=`%0.${p.split(".")[1].length}f`)}if(g(r))return e.toString();try{return Ce.sprintf(r,e)}catch(p){return Ve.warn(`Error in sprintf(${r}, ${e}): ${p}`),String(e)}},je=(e,t,n)=>g(e)?!1:e-t>=n,De=(e,t,n)=>g(e)?!1:e+t<=n,We=e=>(e.element.dataType===v.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,Q=({step:e,dataType:t})=>e||(t===v.DataType.INT?1:.01),Fe=({disabled:e,element:t,widgetMgr:n,fragmentId:b})=>{const r=me(),{dataType:p,id:S,formId:m,default:D,format:W,icon:z,min:f,max:h}=t,[F,Z]=be(),[l,ee]=a.useState(()=>Q(t)),B=We({element:t,widgetMgr:n}),[y,w]=a.useState(!1),[d,I]=a.useState(B),[L,x]=a.useState(()=>j({value:B,...t,step:l})),[A,M]=a.useState(!1),T=a.useRef(null),H=a.useRef(xe("number_input_")),k=je(d,l,f),C=De(d,l,h),U=ge({formId:m}),te=U?n.allowFormEnterToSubmit(m):y,re=A&&F>r.breakpoints.hideWidgetDetails;a.useEffect(()=>{ee(Q({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]);const c=a.useCallback(({value:o,source:s})=>{if(X(o)&&(f>o||o>h))T.current?.reportValidity();else{const u=o??D??null;switch(p){case v.DataType.INT:n.setIntValue({id:S,formId:m},u,s,b);break;case v.DataType.FLOAT:n.setDoubleValue({id:S,formId:m},u,s,b);break;default:throw new Error("Invalid data type")}w(!1),I(u),x(j({value:u,dataType:p,format:W,step:l}))}},[f,h,T,n,b,l,p,S,m,D,W]),ae=a.useCallback(()=>{y&&c({value:d,source:{fromUi:!0}}),M(!1)},[y,d,c]),oe=a.useCallback(()=>{M(!0)},[]),$=a.useCallback(()=>{const{value:o}=t;t.setValue=!1,I(o??null),x(j({value:o??null,...t,step:l})),c({value:o??null,source:{fromUi:!1}})},[t,l,c]);a.useEffect(()=>{t.setValue?$():c({value:d,source:{fromUi:!1}});const o=T.current;if(o){const s=u=>{u.preventDefault()};return o.addEventListener("wheel",s),()=>{o.removeEventListener("wheel",s)}}},[]),t.setValue&&$();const E=g(t.default)&&!e,ne=a.useCallback(()=>{const o=t.default??null;I(o),c({value:o,source:{fromUi:!0}})},[t]);ke({element:t,widgetMgr:n,onFormCleared:ne});const ie=o=>{const{value:s}=o.target;if(s==="")w(!0),I(null),x(null);else{let u;t.dataType===v.DataType.INT?u=parseInt(s,10):u=parseFloat(s),w(!0),I(u),x(s)}},V=a.useCallback(()=>{C&&(w(!0),c({value:(d??f)+l,source:{fromUi:!0}}))},[d,f,l,C]),N=a.useCallback(()=>{k&&(w(!0),c({value:(d??h)-l,source:{fromUi:!0}}))},[d,h,l,k]),le=a.useCallback(o=>{const{key:s}=o;switch(s){case"ArrowUp":o.preventDefault(),V();break;case"ArrowDown":o.preventDefault(),N();break}},[V,N]),se=a.useCallback(o=>{o.key==="Enter"&&(y&&c({value:d,source:{fromUi:!0}}),n.allowFormEnterToSubmit(m)&&n.submitForm(m,b))},[y,d,c,n,m,b]),O=z?.startsWith(":material"),de=O?"lg":"base",ce=G(r.iconSizes.lg)+2*G(r.spacing.twoXS),ue=z?r.breakpoints.hideNumberInputControls+ce:r.breakpoints.hideNumberInputControls;return i.jsxs("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[i.jsx(fe,{label:t.label,disabled:e,labelVisibility:he(t.labelVisibility?.value),htmlFor:H.current,children:t.help&&i.jsx(ye,{children:i.jsx(ve,{content:t.help,placement:we.TOP_RIGHT})})}),i.jsxs(Se,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[i.jsx(Re,{type:"number",inputRef:T,value:L??"",placeholder:t.placeholder,onBlur:ae,onFocus:oe,onChange:ie,onKeyPress:se,onKeyDown:le,clearable:E,clearOnEscape:E,disabled:e,"aria-label":t.label,startEnhancer:t.icon&&i.jsx(Ie,{"data-testid":"stNumberInputIcon",iconValue:t.icon,size:de}),id:H.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:r.colors.darkGray,padding:r.spacing.threeXS,height:r.sizes.clearIconSize,width:r.sizes.clearIconSize,":hover":{fill:r.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:l,min:f,max:h,type:"number",inputMode:""},style:{fontWeight:r.fontWeights.normal,lineHeight:r.lineHeights.inputWidget,paddingRight:r.spacing.sm,paddingLeft:r.spacing.md,paddingBottom:r.spacing.sm,paddingTop:r.spacing.sm,"::placeholder":{color:r.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:z?r.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:r.iconSizes.lg,color:O?r.colors.fadedText60:"inherit"}}}}),F>ue&&i.jsxs(ze,{children:[i.jsx(Y,{"data-testid":"stNumberInputStepDown",onClick:N,disabled:!k||e,tabIndex:-1,children:i.jsx(K,{content:q,size:"xs",color:k?"inherit":r.colors.disabled})}),i.jsx(Y,{"data-testid":"stNumberInputStepUp",onClick:V,disabled:!C||e,tabIndex:-1,children:i.jsx(K,{content:J,size:"xs",color:C?"inherit":r.colors.disabled})})]})]}),re&&i.jsx(Ee,{clearable:E,children:i.jsx(Te,{dirty:y,value:L??"",inForm:U,allowEnterToSubmit:te})})]})},Be=a.memo(Fe);export{Be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,E,_ as R,c as x,b1 as q,j as u,c2 as J,bJ as z,bX as Q,bF as Y,bY as O,cc as V,h as K,g as Z,bl as ee,ap as te,cd as re,ce as ie,cf as se,l as oe,b4 as ne,F as P,cg as _,bV as ae,bU as le,b$ as ce,c0 as de,ch as he,c1 as ue}from"./index-DCNLpqIv.js";import{U as L}from"./UploadFileInfo-C-jY39rj.js";import{F as pe}from"./FormClearHelper-fvwQICEk.js";import{P as ge,S as fe}from"./ProgressBar-CXipOcU9.js";var D=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});D.displayName="SwitchCamera";var W=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});W.displayName="Video";var $=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});$.displayName="X";function me(r,l){switch(r){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const A=x("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),k=x("div",{target:"etz5kuj8"})(({theme:r,width:l})=>({backgroundColor:r.colors.secondaryBg,borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),ve=x("p",{target:"etz5kuj7"})(({theme:r})=>({marginTop:r.spacing.sm,textAlign:"center"}),""),ye=x("img",{target:"etz5kuj6"})(({theme:r,opacity:l})=>({borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),Se=x("a",{target:"etz5kuj5"})(({theme:r})=>({color:r.colors.link,textDecoration:r.linkUnderline?"underline":"none",display:"block"}),""),be=x("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),we=x("div",{target:"etz5kuj3"})(({theme:r})=>({position:"absolute",top:r.spacing.lg,right:r.spacing.lg,zIndex:r.zIndices.priority,color:r.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Me=x("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ue=x("button",{target:"etz5kuj0"})(({theme:r})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:r.colors.lightenedBg05,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,borderRadius:`0 0 ${r.radii.default} ${r.radii.default}`,"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:r.colors.fadedText40,borderColor:r.colors.borderColor,backgroundColor:r.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,margin:r.spacing.none,lineHeight:r.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${q(r.colors.primary,.5)}`},...me("medium",r)}),"");function Ce({disabled:r,onClick:l,children:e,progress:s}){return u.jsxs(Ue,{disabled:r||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[e,s?u.jsx(Me,{children:u.jsx(ge,{value:s,size:fe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const H=y.memo(Ce);var F=(r=>(r.USER="user",r.ENVIRONMENT="environment",r))(F||{});const xe=({switchFacingMode:r})=>u.jsx(we,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(J,{content:"Switch camera",placement:z.TOP_RIGHT,children:u.jsx(Q,{kind:Y.MINIMAL,onClick:r,children:u.jsx(O,{content:D,size:"twoXL",color:V.white})})})}),Ie=y.memo(xe);var T={exports:{}},je=T.exports,N;function Pe(){return N||(N=1,function(r,l){(function(e,s){r.exports=s(K())})(je,function(e){return function(s){var o={};function n(a){if(o[a])return o[a].exports;var p=o[a]={i:a,l:!1,exports:{}};return s[a].call(p.exports,p,p.exports,n),p.l=!0,p.exports}return n.m=s,n.c=o,n.d=function(a,p,S){n.o(a,p)||Object.defineProperty(a,p,{enumerable:!0,get:S})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,p){if(p&1&&(a=n(a)),p&8||p&4&&typeof a=="object"&&a&&a.__esModule)return a;var S=Object.create(null);if(n.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:a}),p&2&&typeof a!="string")for(var C in a)n.d(S,C,(function(U){return a[U]}).bind(null,C));return S},n.n=function(a){var p=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(p,"a",p),p},n.o=function(a,p){return Object.prototype.hasOwnProperty.call(a,p)},n.p="",n(n.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,o,n){n.r(o);var a=n("react"),p=function(){var g=function(h,i){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var c in d)d.hasOwnProperty(c)&&(t[c]=d[c])},g(h,i)};return function(h,i){g(h,i);function t(){this.constructor=h}h.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),S=function(){return S=Object.assign||function(g){for(var h,i=1,t=arguments.length;i<t;i++){h=arguments[i];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},C=function(g,h){var i={};for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&h.indexOf(t)<0&&(i[t]=g[t]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,t=Object.getOwnPropertySymbols(g);d<t.length;d++)h.indexOf(t[d])<0&&Object.prototype.propertyIsEnumerable.call(g,t[d])&&(i[t[d]]=g[t[d]]);return i};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var h=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return h?new Promise(function(i,t){h.call(navigator,g,i,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(g){p(h,g);function h(i){var t=g.call(this,i)||this;return t.canvas=null,t.ctx=null,t.requestUserMediaId=0,t.unmounted=!1,t.state={hasUserMedia:!1},t}return h.prototype.componentDidMount=function(){var i=this,t=i.state,d=i.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}t.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(i){var t=this.props;if(!U()){t.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(i.audioConstraints)!==JSON.stringify(t.audioConstraints),c=JSON.stringify(i.videoConstraints)!==JSON.stringify(t.videoConstraints),w=i.minScreenshotWidth!==t.minScreenshotWidth,v=i.minScreenshotHeight!==t.minScreenshotHeight;(c||w||v)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},h.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},h.stopMediaStream=function(i){i&&(i.getVideoTracks&&i.getAudioTracks?(i.getVideoTracks().map(function(t){i.removeTrack(t),t.stop()}),i.getAudioTracks().map(function(t){i.removeTrack(t),t.stop()})):i.stop())},h.prototype.stopAndCleanup=function(){var i=this.state;i.hasUserMedia&&(h.stopMediaStream(this.stream),i.src&&window.URL.revokeObjectURL(i.src))},h.prototype.getScreenshot=function(i){var t=this,d=t.state,c=t.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(i);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(i){var t=this,d=t.state,c=t.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var w=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var m=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/m,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=i?.width||w,this.canvas.height=i?.height||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,f=M.canvas;return b&&f&&(f.width=i?.width||f.width,f.height=i?.height||f.height,c.mirrored&&(b.translate(f.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,i?.width||f.width,i?.height||f.height),c.mirrored&&(b.scale(-1,1),b.translate(-f.width,0))),f},h.prototype.requestUserMedia=function(){var i=this,t=this.props,d=function(v,m){var M={video:typeof m<"u"?m:!0};t.audio&&(M.audio=typeof v<"u"?v:!0),i.requestUserMediaId++;var b=i.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(f){i.unmounted||b!==i.requestUserMediaId?h.stopMediaStream(f):i.handleUserMedia(null,f)}).catch(function(f){i.handleUserMedia(f)})};if("mediaDevices"in navigator)d(t.audioConstraints,t.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var m=v.deviceId;return typeof m=="string"?m:Array.isArray(m)&&m.length>0?m[0]:typeof m=="object"&&m.ideal?m.ideal:null};MediaStreamTrack.getSources(function(v){var m=null,M=null;v.forEach(function(j){j.kind==="audio"?m=j.id:j.kind==="video"&&(M=j.id)});var b=w(t.audioConstraints);b&&(m=b);var f=w(t.videoConstraints);f&&(M=f),d(c(m),c(M))})}},h.prototype.handleUserMedia=function(i,t){var d=this.props;if(i||!t){this.setState({hasUserMedia:!1}),d.onUserMediaError(i);return}this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}d.onUserMedia(t)},h.prototype.render=function(){var i=this,t=this,d=t.state,c=t.props,w=c.audio;c.forceScreenshotSourceSize;var v=c.disablePictureInPicture;c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var m=c.mirrored,M=c.style,b=M===void 0?{}:M,f=c.children,j=C(c,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),B=m?S(S({},b),{transform:(b.transform||"")+" scaleX(-1)"}):b,G={getScreenshot:this.getScreenshot.bind(this)};return a.createElement(a.Fragment,null,a.createElement("video",S({autoPlay:!0,disablePictureInPicture:v,src:d.src,muted:!w,playsInline:!0,ref:function(X){i.video=X},style:B},j)),f&&f(G))},h.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(a.Component);o.default=I},react:function(s,o){s.exports=e}}).default})}(T)),T.exports}var Fe=Pe();const Ee=Z(Fe),Re=({width:r})=>u.jsxs(k,{width:r,children:[u.jsx(O,{size:"threeXL",color:V.gray60,content:W}),u.jsxs(ve,{children:["This app would like to use your camera.",u.jsx(Se,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Oe=({handleCapture:r,width:l,disabled:e,clearPhotoInProgress:s,setClearPhotoInProgress:o,facingMode:n,setFacingMode:a,testOverride:p})=>{const[S,C]=y.useState(p||"pending"),U=y.useRef(null),[I,g]=y.useState(l),h=y.useCallback(ee(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function i(){if(U.current!==null){const d=U.current.getScreenshot();r(d)}}const t=te();return u.jsxs(A,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!e&&!s?u.jsx(Re,{width:I}):re()&&u.jsx(Ie,{switchFacingMode:a}),u.jsx(k,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!e&&!s,width:I,children:!e&&u.jsx(Ee,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:n}})}),u.jsx(H,{onClick:i,disabled:S!=="success"||e||s,children:"Take Photo"})]})},ke=y.memo(Oe),Te=150,ze=oe.getLogger("CameraInput");class Ve extends y.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new pe,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState(e=>({facingMode:e.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=e=>{if(e===null)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});const s=o=>new Promise(n=>setTimeout(n,o));return _e(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(n=>({file:o,fileUrls:n[0]}))).then(({file:o,fileUrls:n})=>this.uploadFile(n,o)).then(()=>s(Te)).then(()=>{this.setState((o,n)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ze.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(e=>this.deleteFile(e.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:s,widgetMgr:o,fragmentId:n}=this.props,a=o.getFileUploaderStateValue(s);ne(e,a)||o.setFileUploaderStateValue(s,e,{fromUi:!0},n)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:s,element:o,fragmentId:n}=this.props;s.setFileUploaderStateValue(o,e,{fromUi:!0},n)})},this.deleteFile=e=>{const s=this.getFile(e);P(s)||(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(s=>({files:[...s.files,e]}))},this.removeFile=e=>{this.setState(s=>({files:s.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(s=>s.id===e),this.updateFile=(e,s)=>{this.setState(o=>({files:o.files.map(n=>n.id===e?s:n)}))},this.onUploadComplete=(e,s)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(e,s)=>{const o=this.getFile(s);if(P(o)||o.status.type!=="uploading")return;const n=Math.round(e.loaded*100/e.total);o.status.progress!==n&&this.updateFile(s,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:n}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,s)=>{const o=_.CancelToken.source(),n=new L(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,s,a=>this.onUploadProgress(a,n.id),o.token).then(()=>this.onUploadComplete(n.id,e)).catch(a=>{_.isCancel(a)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:a?a.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:e,element:s}=this.props,o=e.getFileUploaderStateValue(s);if(P(o))return l;const{uploadedFileInfo:n}=o;return P(n)||n.length===0?l:{files:n.map(a=>{const p=a.name,S=a.size,C=a.fileId,U=a.fileUrls;return new L(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:n.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=e=>e.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:e,widgetMgr:s,fragmentId:o}=this.props;s.getFileUploaderStateValue(e)===void 0&&s.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:s,size:o,status:n}=e;return new ae({fileId:n.fileId,fileUrls:n.fileUrls,name:s,size:o})});return new le({uploadedFileInfo:l})}render(){const{element:l,widgetMgr:e,disabled:s,width:o}=this.props;return this.formClearHelper.manageFormClearListener(e,l.formId,this.onFormCleared),u.jsxs(A,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(ce,{label:l.label,disabled:s,labelVisibility:de(l.labelVisibility?.value),children:l.help&&u.jsx(he,{children:u.jsx(ue,{content:l.help,placement:z.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(k,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(ye,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(be,{children:[u.jsx(O,{content:$,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(ke,{handleCapture:this.handleCapture,width:o,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function _e(r,l){return fetch(r).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const Le=se(Ve);export{Le as default};
|
|
1
|
+
import{r as y,E,_ as R,c as x,b1 as q,j as u,c2 as J,bJ as z,bX as Q,bF as Y,bY as O,cc as V,h as K,g as Z,bl as ee,ap as te,cd as re,ce as ie,cf as se,l as oe,b4 as ne,F as P,cg as _,bV as ae,bU as le,b$ as ce,c0 as de,ch as he,c1 as ue}from"./index-clm6On2Y.js";import{U as L}from"./UploadFileInfo-C-jY39rj.js";import{F as pe}from"./FormClearHelper-DBsQ33IR.js";import{P as ge,S as fe}from"./ProgressBar-M7ATKOrt.js";var D=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:l}),y.createElement("rect",{width:24,height:24,fill:"none"}),y.createElement("path",{d:"M20 5h-3.17l-1.24-1.35A1.99 1.99 0 0014.12 3H9.88c-.56 0-1.1.24-1.48.65L7.17 5H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-1.35 8.35l-2.79 2.79c-.32.32-.86.1-.86-.35v-1.75H9v1.75c0 .45-.54.67-.85.35l-2.79-2.79c-.2-.2-.2-.51 0-.71l2.79-2.79a.5.5 0 01.85.36v1.83h6v-1.83c0-.45.54-.67.85-.35l2.79 2.79c.2.19.2.51.01.7z"}))});D.displayName="SwitchCamera";var W=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),y.createElement("path",{d:"M.5 1c-.28 0-.5.23-.5.5v4c0 .28.23.5.5.5h5c.28 0 .5-.22.5-.5V4l1 1h1V2H7L6 3V1.5c0-.28-.22-.5-.5-.5h-5z"}))});W.displayName="Video";var $=y.forwardRef(function(r,l){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return y.createElement(E,R({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},r,{ref:l}),y.createElement("path",{d:"M1.41 0L0 1.41l.72.72L2.5 3.94.72 5.72 0 6.41l1.41 1.44.72-.72 1.81-1.81 1.78 1.81.69.72 1.44-1.44-.72-.69-1.81-1.78 1.81-1.81.72-.72L6.41 0l-.69.72L3.94 2.5 2.13.72 1.41 0z"}))});$.displayName="X";function me(r,l){switch(r){case"xsmall":return{padding:`${l.spacing.twoXS} ${l.spacing.sm}`,fontSize:l.fontSizes.sm};case"small":return{padding:`${l.spacing.twoXS} ${l.spacing.md}`};case"large":return{padding:`${l.spacing.md} ${l.spacing.md}`};default:return{padding:`${l.spacing.xs} ${l.spacing.md}`}}}const A=x("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),k=x("div",{target:"etz5kuj8"})(({theme:r,width:l})=>({backgroundColor:r.colors.secondaryBg,borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,width:"100%",height:l*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),ve=x("p",{target:"etz5kuj7"})(({theme:r})=>({marginTop:r.spacing.sm,textAlign:"center"}),""),ye=x("img",{target:"etz5kuj6"})(({theme:r,opacity:l})=>({borderRadius:`${r.radii.default} ${r.radii.default} 0 0`,objectFit:"contain",opacity:l}),""),Se=x("a",{target:"etz5kuj5"})(({theme:r})=>({color:r.colors.link,textDecoration:r.linkUnderline?"underline":"none",display:"block"}),""),be=x("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),we=x("div",{target:"etz5kuj3"})(({theme:r})=>({position:"absolute",top:r.spacing.lg,right:r.spacing.lg,zIndex:r.zIndices.priority,color:r.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Me=x("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),Ue=x("button",{target:"etz5kuj0"})(({theme:r})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:r.colors.lightenedBg05,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,borderRadius:`0 0 ${r.radii.default} ${r.radii.default}`,"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:r.colors.fadedText40,borderColor:r.colors.borderColor,backgroundColor:r.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,margin:r.spacing.none,lineHeight:r.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${q(r.colors.primary,.5)}`},...me("medium",r)}),"");function Ce({disabled:r,onClick:l,children:e,progress:s}){return u.jsxs(Ue,{disabled:r||!1,onClick:l||(()=>{}),progress:s||null,"data-testid":"stCameraInputButton",children:[e,s?u.jsx(Me,{children:u.jsx(ge,{value:s,size:fe.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const H=y.memo(Ce);var F=(r=>(r.USER="user",r.ENVIRONMENT="environment",r))(F||{});const xe=({switchFacingMode:r})=>u.jsx(we,{"data-testid":"stCameraInputSwitchButton",children:u.jsx(J,{content:"Switch camera",placement:z.TOP_RIGHT,children:u.jsx(Q,{kind:Y.MINIMAL,onClick:r,children:u.jsx(O,{content:D,size:"twoXL",color:V.white})})})}),Ie=y.memo(xe);var T={exports:{}},je=T.exports,N;function Pe(){return N||(N=1,function(r,l){(function(e,s){r.exports=s(K())})(je,function(e){return function(s){var o={};function n(a){if(o[a])return o[a].exports;var p=o[a]={i:a,l:!1,exports:{}};return s[a].call(p.exports,p,p.exports,n),p.l=!0,p.exports}return n.m=s,n.c=o,n.d=function(a,p,S){n.o(a,p)||Object.defineProperty(a,p,{enumerable:!0,get:S})},n.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},n.t=function(a,p){if(p&1&&(a=n(a)),p&8||p&4&&typeof a=="object"&&a&&a.__esModule)return a;var S=Object.create(null);if(n.r(S),Object.defineProperty(S,"default",{enumerable:!0,value:a}),p&2&&typeof a!="string")for(var C in a)n.d(S,C,(function(U){return a[U]}).bind(null,C));return S},n.n=function(a){var p=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(p,"a",p),p},n.o=function(a,p){return Object.prototype.hasOwnProperty.call(a,p)},n.p="",n(n.s="./src/react-webcam.tsx")}({"./src/react-webcam.tsx":function(s,o,n){n.r(o);var a=n("react"),p=function(){var g=function(h,i){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,d){t.__proto__=d}||function(t,d){for(var c in d)d.hasOwnProperty(c)&&(t[c]=d[c])},g(h,i)};return function(h,i){g(h,i);function t(){this.constructor=h}h.prototype=i===null?Object.create(i):(t.prototype=i.prototype,new t)}}(),S=function(){return S=Object.assign||function(g){for(var h,i=1,t=arguments.length;i<t;i++){h=arguments[i];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(g[d]=h[d])}return g},S.apply(this,arguments)},C=function(g,h){var i={};for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&h.indexOf(t)<0&&(i[t]=g[t]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,t=Object.getOwnPropertySymbols(g);d<t.length;d++)h.indexOf(t[d])<0&&Object.prototype.propertyIsEnumerable.call(g,t[d])&&(i[t[d]]=g[t[d]]);return i};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(g){var h=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return h?new Promise(function(i,t){h.call(navigator,g,i,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function U(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var I=function(g){p(h,g);function h(i){var t=g.call(this,i)||this;return t.canvas=null,t.ctx=null,t.requestUserMediaId=0,t.unmounted=!1,t.state={hasUserMedia:!1},t}return h.prototype.componentDidMount=function(){var i=this,t=i.state,d=i.props;if(this.unmounted=!1,!U()){d.onUserMediaError("getUserMedia not supported");return}t.hasUserMedia||this.requestUserMedia(),d.children&&typeof d.children!="function"&&console.warn("children must be a function")},h.prototype.componentDidUpdate=function(i){var t=this.props;if(!U()){t.onUserMediaError("getUserMedia not supported");return}var d=JSON.stringify(i.audioConstraints)!==JSON.stringify(t.audioConstraints),c=JSON.stringify(i.videoConstraints)!==JSON.stringify(t.videoConstraints),w=i.minScreenshotWidth!==t.minScreenshotWidth,v=i.minScreenshotHeight!==t.minScreenshotHeight;(c||w||v)&&(this.canvas=null,this.ctx=null),(d||c)&&(this.stopAndCleanup(),this.requestUserMedia())},h.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},h.stopMediaStream=function(i){i&&(i.getVideoTracks&&i.getAudioTracks?(i.getVideoTracks().map(function(t){i.removeTrack(t),t.stop()}),i.getAudioTracks().map(function(t){i.removeTrack(t),t.stop()})):i.stop())},h.prototype.stopAndCleanup=function(){var i=this.state;i.hasUserMedia&&(h.stopMediaStream(this.stream),i.src&&window.URL.revokeObjectURL(i.src))},h.prototype.getScreenshot=function(i){var t=this,d=t.state,c=t.props;if(!d.hasUserMedia)return null;var w=this.getCanvas(i);return w&&w.toDataURL(c.screenshotFormat,c.screenshotQuality)},h.prototype.getCanvas=function(i){var t=this,d=t.state,c=t.props;if(!this.video||!d.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var w=this.video.videoWidth,v=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var m=w/v;w=c.minScreenshotWidth||this.video.clientWidth,v=w/m,c.minScreenshotHeight&&v<c.minScreenshotHeight&&(v=c.minScreenshotHeight,w=v*m)}this.canvas=document.createElement("canvas"),this.canvas.width=i?.width||w,this.canvas.height=i?.height||v,this.ctx=this.canvas.getContext("2d")}var M=this,b=M.ctx,f=M.canvas;return b&&f&&(f.width=i?.width||f.width,f.height=i?.height||f.height,c.mirrored&&(b.translate(f.width,0),b.scale(-1,1)),b.imageSmoothingEnabled=c.imageSmoothing,b.drawImage(this.video,0,0,i?.width||f.width,i?.height||f.height),c.mirrored&&(b.scale(-1,1),b.translate(-f.width,0))),f},h.prototype.requestUserMedia=function(){var i=this,t=this.props,d=function(v,m){var M={video:typeof m<"u"?m:!0};t.audio&&(M.audio=typeof v<"u"?v:!0),i.requestUserMediaId++;var b=i.requestUserMediaId;navigator.mediaDevices.getUserMedia(M).then(function(f){i.unmounted||b!==i.requestUserMediaId?h.stopMediaStream(f):i.handleUserMedia(null,f)}).catch(function(f){i.handleUserMedia(f)})};if("mediaDevices"in navigator)d(t.audioConstraints,t.videoConstraints);else{var c=function(v){return{optional:[{sourceId:v}]}},w=function(v){var m=v.deviceId;return typeof m=="string"?m:Array.isArray(m)&&m.length>0?m[0]:typeof m=="object"&&m.ideal?m.ideal:null};MediaStreamTrack.getSources(function(v){var m=null,M=null;v.forEach(function(j){j.kind==="audio"?m=j.id:j.kind==="video"&&(M=j.id)});var b=w(t.audioConstraints);b&&(m=b);var f=w(t.videoConstraints);f&&(M=f),d(c(m),c(M))})}},h.prototype.handleUserMedia=function(i,t){var d=this.props;if(i||!t){this.setState({hasUserMedia:!1}),d.onUserMediaError(i);return}this.stream=t;try{this.video&&(this.video.srcObject=t),this.setState({hasUserMedia:!0})}catch{this.setState({hasUserMedia:!0,src:window.URL.createObjectURL(t)})}d.onUserMedia(t)},h.prototype.render=function(){var i=this,t=this,d=t.state,c=t.props,w=c.audio;c.forceScreenshotSourceSize;var v=c.disablePictureInPicture;c.onUserMedia,c.onUserMediaError,c.screenshotFormat,c.screenshotQuality,c.minScreenshotWidth,c.minScreenshotHeight,c.audioConstraints,c.videoConstraints,c.imageSmoothing;var m=c.mirrored,M=c.style,b=M===void 0?{}:M,f=c.children,j=C(c,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),B=m?S(S({},b),{transform:(b.transform||"")+" scaleX(-1)"}):b,G={getScreenshot:this.getScreenshot.bind(this)};return a.createElement(a.Fragment,null,a.createElement("video",S({autoPlay:!0,disablePictureInPicture:v,src:d.src,muted:!w,playsInline:!0,ref:function(X){i.video=X},style:B},j)),f&&f(G))},h.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},h}(a.Component);o.default=I},react:function(s,o){s.exports=e}}).default})}(T)),T.exports}var Fe=Pe();const Ee=Z(Fe),Re=({width:r})=>u.jsxs(k,{width:r,children:[u.jsx(O,{size:"threeXL",color:V.gray60,content:W}),u.jsxs(ve,{children:["This app would like to use your camera.",u.jsx(Se,{href:ie,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Oe=({handleCapture:r,width:l,disabled:e,clearPhotoInProgress:s,setClearPhotoInProgress:o,facingMode:n,setFacingMode:a,testOverride:p})=>{const[S,C]=y.useState(p||"pending"),U=y.useRef(null),[I,g]=y.useState(l),h=y.useCallback(ee(1e3,g),[]);y.useEffect(()=>{h(l)},[l,h]);function i(){if(U.current!==null){const d=U.current.getScreenshot();r(d)}}const t=te();return u.jsxs(A,{"data-testid":"stCameraInputWebcamComponent",children:[S!=="success"&&!e&&!s?u.jsx(Re,{width:I}):re()&&u.jsx(Ie,{switchFacingMode:a}),u.jsx(k,{"data-testid":"stCameraInputWebcamStyledBox",hidden:S!=="success"&&!e&&!s,width:I,children:!e&&u.jsx(Ee,{audio:!1,ref:U,screenshotFormat:"image/jpeg",screenshotQuality:1,width:I,height:I*9/16,style:{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`},onUserMediaError:()=>{C("error")},onUserMedia:()=>{C("success"),o(!1)},videoConstraints:{width:{ideal:I},facingMode:n}})}),u.jsx(H,{onClick:i,disabled:S!=="success"||e||s,children:"Take Photo"})]})},ke=y.memo(Oe),Te=150,ze=oe.getLogger("CameraInput");class Ve extends y.PureComponent{constructor(l){super(l),this.localFileIdCounter=1,this.RESTORED_FROM_WIDGET_STRING="RESTORED_FROM_WIDGET",this.formClearHelper=new pe,this.getProgress=()=>{if(this.state.files.length>0&&this.state.files[this.state.files.length-1].status.type==="uploading")return this.state.files[this.state.files.length-1].status.progress},this.setClearPhotoInProgress=e=>{this.setState({clearPhotoInProgress:e})},this.setFacingMode=()=>{this.setState(e=>({facingMode:e.facingMode===F.USER?F.ENVIRONMENT:F.USER}))},this.handleCapture=e=>{if(e===null)return Promise.resolve();this.setState({imgSrc:e,shutter:!0,minShutterEffectPassed:!1});const s=o=>new Promise(n=>setTimeout(n,o));return _e(e,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(o=>this.props.uploadClient.fetchFileURLs([o]).then(n=>({file:o,fileUrls:n[0]}))).then(({file:o,fileUrls:n})=>this.uploadFile(n,o)).then(()=>s(Te)).then(()=>{this.setState((o,n)=>({imgSrc:e,shutter:o.shutter,minShutterEffectPassed:!0}))}).catch(o=>{ze.error(o)})},this.removeCapture=()=>{this.state.files.length!==0&&(this.state.files.forEach(e=>this.deleteFile(e.id)),this.setState({imgSrc:null,clearPhotoInProgress:!0}))},this.componentDidUpdate=()=>{if(this.status!=="ready")return;const e=this.createWidgetValue(),{element:s,widgetMgr:o,fragmentId:n}=this.props,a=o.getFileUploaderStateValue(s);ne(e,a)||o.setFileUploaderStateValue(s,e,{fromUi:!0},n)},this.onFormCleared=()=>{this.setState({files:[]},()=>{const e=this.createWidgetValue();if(P(e))return;this.setState({imgSrc:null});const{widgetMgr:s,element:o,fragmentId:n}=this.props;s.setFileUploaderStateValue(o,e,{fromUi:!0},n)})},this.deleteFile=e=>{const s=this.getFile(e);P(s)||(s.status.type==="uploading"&&s.status.cancelToken.cancel(),s.status.type==="uploaded"&&s.status.fileUrls.deleteUrl&&this.props.uploadClient.deleteFile(s.status.fileUrls.deleteUrl),this.removeFile(e))},this.addFile=e=>{this.setState(s=>({files:[...s.files,e]}))},this.removeFile=e=>{this.setState(s=>({files:s.files.filter(o=>o.id!==e)}))},this.getFile=e=>this.state.files.find(s=>s.id===e),this.updateFile=(e,s)=>{this.setState(o=>({files:o.files.map(n=>n.id===e?s:n)}))},this.onUploadComplete=(e,s)=>{this.setState(()=>({shutter:!1}));const o=this.getFile(e);P(o)||o.status.type!=="uploading"||this.updateFile(o.id,o.setStatus({type:"uploaded",fileId:s.fileId,fileUrls:s}))},this.onUploadProgress=(e,s)=>{const o=this.getFile(s);if(P(o)||o.status.type!=="uploading")return;const n=Math.round(e.loaded*100/e.total);o.status.progress!==n&&this.updateFile(s,o.setStatus({type:"uploading",cancelToken:o.status.cancelToken,progress:n}))},this.reset=()=>{this.setState({files:[],imgSrc:null})},this.uploadFile=(e,s)=>{const o=_.CancelToken.source(),n=new L(s.name,s.size,this.nextLocalFileId(),{type:"uploading",cancelToken:o,progress:1});this.addFile(n),this.props.uploadClient.uploadFile(this.props.element,e.uploadUrl,s,a=>this.onUploadProgress(a,n.id),o.token).then(()=>this.onUploadComplete(n.id,e)).catch(a=>{_.isCancel(a)||this.updateFile(n.id,n.setStatus({type:"error",errorMessage:a?a.toString():"Unknown error"}))})},this.state=this.initialValue}get initialValue(){const l={files:[],imgSrc:null,shutter:!1,minShutterEffectPassed:!0,clearPhotoInProgress:!1,facingMode:F.USER},{widgetMgr:e,element:s}=this.props,o=e.getFileUploaderStateValue(s);if(P(o))return l;const{uploadedFileInfo:n}=o;return P(n)||n.length===0?l:{files:n.map(a=>{const p=a.name,S=a.size,C=a.fileId,U=a.fileUrls;return new L(p,S,this.nextLocalFileId(),{type:"uploaded",fileId:C,fileUrls:U})}),imgSrc:n.length===0?"":this.RESTORED_FROM_WIDGET_STRING,shutter:!1,minShutterEffectPassed:!1,clearPhotoInProgress:!1,facingMode:F.USER}}componentWillUnmount(){this.formClearHelper.disconnect()}get status(){const l=e=>e.status.type==="uploading";return this.state.files.some(l)?"updating":"ready"}componentDidMount(){const l=this.createWidgetValue(),{element:e,widgetMgr:s,fragmentId:o}=this.props;s.getFileUploaderStateValue(e)===void 0&&s.setFileUploaderStateValue(e,l,{fromUi:!1},o)}createWidgetValue(){const l=this.state.files.filter(e=>e.status.type==="uploaded").map(e=>{const{name:s,size:o,status:n}=e;return new ae({fileId:n.fileId,fileUrls:n.fileUrls,name:s,size:o})});return new le({uploadedFileInfo:l})}render(){const{element:l,widgetMgr:e,disabled:s,width:o}=this.props;return this.formClearHelper.manageFormClearListener(e,l.formId,this.onFormCleared),u.jsxs(A,{className:"stCameraInput","data-testid":"stCameraInput",children:[u.jsx(ce,{label:l.label,disabled:s,labelVisibility:de(l.labelVisibility?.value),children:l.help&&u.jsx(he,{children:u.jsx(ue,{content:l.help,placement:z.TOP_RIGHT})})}),this.state.imgSrc?u.jsxs(u.Fragment,{children:[u.jsx(k,{width:o,children:this.state.imgSrc!==this.RESTORED_FROM_WIDGET_STRING&&u.jsx(ye,{src:this.state.imgSrc,alt:"Snapshot",opacity:this.state.shutter||!this.state.minShutterEffectPassed?"50%":"100%",width:o,height:o*9/16})}),u.jsx(H,{onClick:this.removeCapture,progress:this.getProgress(),disabled:!!this.getProgress()||s,children:this.getProgress()?"Uploading...":u.jsxs(be,{children:[u.jsx(O,{content:$,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):u.jsx(ke,{handleCapture:this.handleCapture,width:o,disabled:s,clearPhotoInProgress:this.state.clearPhotoInProgress,setClearPhotoInProgress:this.setClearPhotoInProgress,facingMode:this.state.facingMode,setFacingMode:this.setFacingMode,testOverride:this.props.testOverride})]})}nextLocalFileId(){return this.localFileIdCounter++}}function _e(r,l){return fetch(r).then(e=>e.arrayBuffer()).then(e=>new File([e],l,{type:"image/jpeg"}))}const Le=se(Ve);export{Le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,r as i,ap as x,j as s,b9 as y,bc as w,bq as t,b8 as S,br as T,bs as v}from"./index-
|
|
1
|
+
import{c as p,r as i,ap as x,j as s,b9 as y,bc as w,bq as t,b8 as S,br as T,bs as v}from"./index-clm6On2Y.js";const z=p("button",{target:"elibz2u2"})(({theme:e})=>({fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,color:e.colors.fadedText60,backgroundColor:e.colors.transparent,fontFamily:"inherit",margin:e.spacing.none,border:"none",boxShadow:"none",padding:e.spacing.none,"&:hover, &:active, &:focus":{border:"none",outline:"none",boxShadow:"none"},"&:hover":{color:e.colors.primary}}),""),R=p("div",{target:"elibz2u1"})(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing.lg,"> span":{marginTop:e.spacing.twoXS}}),""),j=p("div",{target:"elibz2u0"})(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing.sm,alignItems:"start",justifyContent:"center",overflow:"hidden",minHeight:"100%",fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.base,div:{display:"inline-flex"}}),"");function C(e){const o=S(e);return{Body:{props:{"data-testid":"stToast",className:"stToast"},style:{display:"flex",flexDirection:"row",gap:e.spacing.md,width:e.sizes.toastWidth,marginTop:e.spacing.sm,borderTopLeftRadius:e.radii.default,borderTopRightRadius:e.radii.default,borderBottomLeftRadius:e.radii.default,borderBottomRightRadius:e.radii.default,paddingTop:e.spacing.lg,paddingBottom:e.spacing.lg,paddingLeft:e.spacing.twoXL,paddingRight:e.spacing.twoXL,backgroundColor:o?e.colors.gray10:e.colors.gray90,color:e.colors.bodyText,boxShadow:o?"0px 4px 16px rgba(0, 0, 0, 0.16)":"0px 4px 16px rgba(0, 0, 0, 0.7)"}},CloseIcon:{style:{color:e.colors.fadedText40,width:e.fontSizes.lg,height:e.fontSizes.lg,marginRight:`calc(-1 * ${e.spacing.lg} / 2)`,":hover":{color:e.colors.bodyText}}}}}function L(e){if(e.length>104){let o=e.replace(/^(.{104}[^\s]*).*/,"$1");return o.length>104&&(o=o.substring(0,104).split(" ").slice(0,-1).join(" ")),o.trim()}return e}function k({body:e,icon:o}){const n=x(),r=L(e),d=e!==r,[a,b]=i.useState(!d),[u,h]=i.useState(0),f=i.useCallback(()=>{b(!a)},[a]),l=i.useMemo(()=>C(n),[n]),c=i.useMemo(()=>s.jsxs(R,{expanded:a,children:[o&&s.jsx(y,{iconValue:o,size:"xl",testid:"stToastDynamicIcon"}),s.jsxs(j,{children:[s.jsx(w,{source:a?e:r,allowHTML:!1,isToast:!0}),d&&s.jsx(z,{"data-testid":"stToastViewButton",onClick:f,children:a?"view less":"view more"})]})]}),[d,a,e,o,r,f]);i.useEffect(()=>{if(n.inSidebar)return;const g=t.info(c,{overrides:{...l}});return h(g),()=>{t.update(g,{overrides:{Body:{style:{display:"none"}}}}),t.clear(g)}},[]),i.useEffect(()=>{t.update(u,{children:c,overrides:{...l}})},[u,c,l]);const m=s.jsx(T,{kind:v.ERROR,body:"Streamlit API Error: `st.toast` cannot be called directly on the sidebar with `st.sidebar.toast`.\n See our `st.toast` API [docs](https://docs.streamlit.io/develop/api-reference/status/st.toast) for more information."});return s.jsx(s.Fragment,{children:n.inSidebar&&m})}const B=i.memo(k);export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as V,r as n,u as N,bC as R,a as P,bS as U,j as m,l as M}from"./index-
|
|
1
|
+
import{c as V,r as n,u as N,bC as R,a as P,bS as U,j as m,l as M}from"./index-clm6On2Y.js";const w=V("iframe",{target:"evvcert0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"}),""),j=M.getLogger("Video"),x={width:"100%"};function O({element:r,endpoints:i,elementMgr:p}){const o=n.useRef(null),{type:h,url:v,startTime:a,subtitles:y,endTime:s,loop:d,autoplay:f,muted:g}=r,u=N(v),c=R(y);let S=P(u);const T=n.useMemo(()=>{if(!r.id)return!0;const e=p.getElementState(r.id,"preventAutoplay");return e||p.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,p]),E=n.useMemo(()=>JSON.stringify(c?c.map(e=>i.buildMediaURL(`${e.url}`)):[]),[c,i]);n.useEffect(()=>{const e=JSON.parse(E);e.length!==0&&e.forEach(t=>{i.checkSourceUrlResponse(t,"Video Subtitle")})},[E,i]),n.useEffect(()=>{o.current&&(o.current.currentTime=a)},[a]),n.useEffect(()=>{const e=o.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),n.useEffect(()=>{const e=o.current;if(!e)return;let t=!1;const l=()=>{s>0&&e.currentTime>=s&&(d?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return s>0&&e.addEventListener("timeupdate",l),()=>{e&&s>0&&e.removeEventListener("timeupdate",l)}},[s,d,a]),n.useEffect(()=>{const e=o.current;if(!e)return;const t=()=>{d&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[d,a]);const b=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),s&&!isNaN(s)&&t.searchParams.append("end",s.toString()),d){t.searchParams.append("loop","1");const l=t.pathname.split("/").pop();l&&t.searchParams.append("playlist",l)}return f&&t.searchParams.append("autoplay","1"),g&&t.searchParams.append("mute","1"),t.toString()};if(h===U.Type.YOUTUBE_IFRAME)return m.jsx(w,{className:"stVideo","data-testid":"stVideo",title:u,src:b(u),allow:"autoplay; encrypted-media",allowFullScreen:!0});const L=e=>{const t=e.currentTarget.src;j.error(`Client Error: Video source error - ${t}`),i.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return m.jsx("video",{className:"stVideo","data-testid":"stVideo",ref:o,controls:!0,muted:g,autoPlay:f&&!T,src:i.buildMediaURL(u),style:x,crossOrigin:S,onError:L,children:c&&c.map((e,t)=>m.jsx("track",{kind:"captions",src:i.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const $=n.memo(O);export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,r as c,L as p,ap as b,j as o,bH as x,bJ as u,b9 as h,bc as f}from"./index-
|
|
1
|
+
import{c as l,r as c,L as p,ap as b,j as o,bH as x,bJ as u,b9 as h,bc as f}from"./index-clm6On2Y.js";const k=l("div",{target:"e11k5jya2"})({name:"b6wrti",styles:"display:flex;flex-direction:column;width:100%"}),m=l("a",{target:"e11k5jya1"})(({disabled:t,isCurrentPage:r,theme:e})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.button,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:r?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:r?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...t?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),C=l("span",{target:"e11k5jya0"})(({disabled:t,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...t?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function v(t){const{onPageChange:r,currentPageScriptHash:e}=c.useContext(p),{colors:s}=b(),{disabled:n,element:a}=t,i=e===a.pageScriptHash,g=d=>{a.external?n&&d.preventDefault():(d.preventDefault(),n||r(a.pageScriptHash))};return o.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:o.jsx(x,{help:a.help,placement:u.TOP_RIGHT,containerWidth:!0,children:o.jsx(k,{children:o.jsxs(m,{"data-testid":"stPageLink-NavLink",disabled:n,isCurrentPage:i,href:a.page,target:a.external?"_blank":"",rel:"noreferrer",onClick:g,children:[a.icon&&o.jsx(h,{size:"lg",color:n?s.fadedText40:s.bodyText,iconValue:a.icon}),o.jsx(C,{disabled:n,children:o.jsx(f,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:i,largerLabel:!0,disableLinks:!0})})]})})})})}const L=c.memo(v);export{L as default};
|