@stlite/desktop 0.96.0 → 0.97.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/CHANGELOG.md +6 -0
- package/bin/dump_artifacts.js +1 -1
- package/build/assets/{ErrorOutline.esm-_LuTQzkr-BFWi9Uuj.js → ErrorOutline.esm-lsdlHF0t-DG4LSxex.js} +1 -1
- package/build/assets/{FileDownload.esm-CUqXYNk4-DieQ2Qle.js → FileDownload.esm-B67hf_fm-CYQKuYJG.js} +1 -1
- package/build/assets/FileHelper-CfZ5yPb2-CNHTcjh9.js +5 -0
- package/build/assets/{FormClearHelper-C58X4iX0-CI3cpm91.js → FormClearHelper-XrLdNEJa-DVEjd1cV.js} +1 -1
- package/build/assets/{InputInstructions-BSpH125g-CSupbuK3.js → InputInstructions-UPXPLzmg-Q7bu80af.js} +2 -2
- package/build/assets/Particles-BG5hjQKX-C7A0Knla.js +1 -0
- package/build/assets/{ProgressBar-CQHaVJeY-Bo6RDYz5.js → ProgressBar-E3DTwBEC-BjaNqN1B.js} +2 -2
- package/build/assets/StreamlitSyntaxHighlighter-CzihVVQU-DKtwdTjA.js +9 -0
- package/build/assets/TableChart.esm-DTCdMC22-C2aHYx-P.js +1 -0
- package/build/assets/Toolbar-DencJ98c--L3IVNu_.js +1 -0
- package/build/assets/UploadFileInfo-DdcsXhjv-m2CBXl3F.js +1 -0
- package/build/assets/WidgetLabelHelpIconInline-DFAc7fKv-BB1k3kRL.js +1 -0
- package/build/assets/_baseAssignValue-D2hePX0_-CX8WO6Yp.js +1 -0
- package/build/assets/{base-input-CAXjxi6E-LJzeEbPm.js → base-input-BPl9JMAl-yC1GT4Gd.js} +3 -3
- package/build/assets/{checkbox-OEhCo8NJ-C1rXZb97.js → checkbox-BCtTdZut-CgBE95kP.js} +2 -2
- package/build/assets/createDownloadLinkElement-D-zJ1ZGH-MUElf4MM.js +1 -0
- package/build/assets/createSuper-Csct9QVD-vLz3pY3G.js +1 -0
- package/build/assets/data-grid-overlay-editor-58Vv1cYM-BTQbyoqC.js +1 -0
- package/build/assets/{downloader-DcCTL3Wz-Dj-02g6N.js → downloader-DcCTL3Wz-CCWe5qlA.js} +1 -1
- package/build/assets/{embed-DJe7ZhON-C4OnDOK-.js → embed-4M_Y1tyc-DYkZAF8O.js} +14 -14
- package/build/assets/{es6--XPcqeHG-2BbC2xK9.js → es6--XPcqeHG-7ATg0sOb.js} +2 -2
- package/build/assets/formatMoment-DEtsTHwA-BeQagUzn.js +1 -0
- package/build/assets/formatNumber-ep44bWil-jKcj-W8C.js +1 -0
- package/build/assets/iconPosition-D6yC8Xnj-BF1h45AJ.js +1 -0
- package/build/assets/iframeResizer.contentWindow-nTwp-zqr-CtsMNeCZ.js +1 -0
- package/build/assets/index--TzMnXzp-DAvnEXlj.js +1 -0
- package/build/assets/index--qHBza9B-Cw3TTMgu.js +1 -0
- package/build/assets/index-B-mlHTWW-DxFrd5NG.js +1 -0
- package/build/assets/{index-Cbq5ClnA-Ct1ftt5G.js → index-B-vlNoRi-Cx4hHKp7.js} +1 -1
- package/build/assets/{index-CF9SDiIL-0Yw8O39Y.js → index-B7jXK8tg-DQuHfWI9.js} +1 -1
- package/build/assets/index-BFmSYBo1-C1-2gL1R.js +2 -0
- package/build/assets/{index-Cp-N8m1m-CSwdpflI.js → index-BIskStic-GEaJjVf4.js} +3 -3
- package/build/assets/index-BmOxzNZt-CNMeXzFc.js +1 -0
- package/build/assets/{index-DfPnrVLL-B6NKOBTt.js → index-BmPxToPj-BM0EGyRT.js} +1 -1
- package/build/assets/index-BmXuG0WA-D_Ql4e0d.js +3 -0
- package/build/assets/index-BtV4cH-G-DZqE8EFk.js +1 -0
- package/build/assets/index-BwXCTp7d-CbCsXHhb.js +6 -0
- package/build/assets/index-BwaRZjpn-BcW7Mc-p.js +1 -0
- package/build/assets/index-BzkAb_Ru-BoJQq1Du.js +1 -0
- package/build/assets/{index-NPM6VaN3-C-0cbqN2.js → index-C5pyI-9n-BoqvCp9L.js} +1 -1
- package/build/assets/index-CHTMxzEE-CdrOqTD2.js +1 -0
- package/build/assets/index-CJJUSpBk-Cjx3_stH.js +2 -0
- package/build/assets/{index-Bck9VlwE-zB2PlFuX.js → index-CWwI7Day-CBbcYz7C.js} +3 -3
- package/build/assets/{index-DttfDE80-GomZzukD.js → index-CYKyPdc--DXQt2pbH.js} +1 -1
- package/build/assets/index-CYavJtAA-CEB9mFy5.js +11 -0
- package/build/assets/index-C_AtJDfm-C2sFKVUp.js +1 -0
- package/build/assets/index-Cc93rxqK-qmLHI1ce.js +1 -0
- package/build/assets/index-CgwImjw9-vhGwcoU0.js +1 -0
- package/build/assets/{index-CY18be0x-Bq4JW-41.js → index-CiGWj_Vp-n6pbS_He.js} +1 -1
- package/build/assets/index-Cp9lKUfY-DCgJbJZE.js +1 -0
- package/build/assets/index-CrLOtTTY-_bXB7Npw.js +2 -0
- package/build/assets/{index-BHN72E4J-BztQAHMJ.js → index-CuAftQdk-D76l7Kt4.js} +1 -1
- package/build/assets/{index-R0bDPfYF-CRQIdCoC.js → index-D0DUjycF-DZpBbVrj.js} +2 -2
- package/build/assets/index-D1pkaPju-DGUZOgpo.js +1 -0
- package/build/assets/index-D6IEgvdJ-B-rltr1-.js +1 -0
- package/build/assets/index-D9TZavtE.css +1 -0
- package/build/assets/{index-BwqdV017-BaIzlXlX.js → index-DQ7wfL_P-DAp2jN40.js} +2 -2
- package/build/assets/{index-BrYfiXJ9-D7No2wma.js → index-DR-j-FYy-DJdOMdE8.js} +1 -1
- package/build/assets/index-DUNdG0N4-BKyH_Fci.js +2 -0
- package/build/assets/index-Df-1Z3LJ-bsVAaBS1.js +1 -0
- package/build/assets/index-Dfye6cAn-CH-9suNF.js +1 -0
- package/build/assets/index-DhMU6AlU-DzPhysZa.js +3789 -0
- package/build/assets/index-DjAHjI25-oZ9XAxp1.js +27 -0
- package/build/assets/index-DlPzHASD-B0KSeIYY.js +1 -0
- package/build/assets/index-DrLK8ov3-Stod2ydK.js +2 -0
- package/build/assets/index-DtFJwl5H-Dn2VZIyI.js +1 -0
- package/build/assets/{index-CJA4Tdig-Rs7zFCTh.js → index-DuZXLtJ1-BxktJ87b.js} +1 -1
- package/build/assets/index-H5hDyygX-DMvEgj-E.js +1 -0
- package/build/assets/index-LD7yKakY-9tfSlqzu.js +1 -0
- package/build/assets/index-LeNVxf2A-B46Z4XAZ.js +1 -0
- package/build/assets/index-QsvFitQg-IS60zSNc.js +1 -0
- package/build/assets/index-YCKUmi7k-wKVbmOTE.js +1 -0
- package/build/assets/index-f_0uAugs-KaRkqnk8.js +1 -0
- package/build/assets/index-nhNM5UeG.js +185 -0
- package/build/assets/index-pi_S-NOw-DHRw2FEx.js +198 -0
- package/build/assets/index-saRTHQRt-Cep0ox_U.js +1 -0
- package/build/assets/{input-5gXdrXd2-J6HaBKjM.js → input-BZGQFBY5-B-EqzVpf.js} +2 -2
- package/build/assets/{main-DvFfgny--BkQIK2a9.js → main-DD_nsVBV-B-nG1zNN.js} +1 -1
- package/build/assets/{memory-B3L1Fctl-mli5o0A1.js → memory-B3L1Fctl-Dwxd_AN8.js} +1 -1
- package/build/assets/number-overlay-editor--_WCmOH8-DebLrQQ4.js +9 -0
- package/build/assets/numbro-CBbENDeu-C6X7Pww4.js +1 -0
- package/build/assets/{pandasStylerUtils-BvB3vP-L-D9viw-G9.js → pandasStylerUtils-DlCnQunN-DDd07kWa.js} +1 -1
- package/build/assets/possibleConstructorReturn-i7eTFBhJ-BnzuGOIJ.js +1 -0
- package/build/assets/record-CvRL89xC-Cpipd1Kv.js +1 -0
- package/build/assets/{sandbox-ChAzL-i--CSnZJIg8.js → sandbox-ChAzL-i--CrJOWfYj.js} +1 -1
- package/build/assets/{styled-components-DkuYntx5-DrGZZlKf.js → styled-components-Dq_iSDU9-i1eh3pWs.js} +1 -1
- package/build/assets/{timepicker-BMxsIjZb-Uq5-wJ6H.js → timepicker-CL-801So-Sc5MVKGZ.js} +3 -3
- package/build/assets/toConsumableArray-CCohTQYb-ClE5WF0y.js +3 -0
- package/build/assets/uniqueId-CWWNkcH4-CJJowNJ2.js +1 -0
- package/build/assets/{useBasicWidgetState-CzHHKP20-CGMCneWD.js → useBasicWidgetState-BYeS5Lnw-COvJBdtg.js} +1 -1
- package/build/assets/{useIntlLocale-5C0LAQxq-ow_F-T5t.js → useIntlLocale-D1zv6Q2y-BpOVDRdF.js} +9 -9
- package/build/assets/{useTextInputAutoExpand-BMCOrWKx-DmoV3o2_.js → useTextInputAutoExpand-DEesfW0v-Cv12Lx8Q.js} +2 -2
- package/build/assets/{useUpdateUiValue-BtVkPggP-4VTS40xs.js → useUpdateUiValue-DDoOKBFH-DrpUtoEl.js} +1 -1
- package/build/assets/{useWaveformController-DuJh2iwj-BQGl9KsR.js → useWaveformController-Betfr4kn-B9JLTJ93.js} +1 -1
- package/build/assets/wavesurfer.esm-idh1jvYE-D4Wwdy60.js +74 -0
- package/build/assets/withCalculatedWidth-ZZ9bYZZd-CtbnrMaD.js +1 -0
- package/build/assets/{withFullScreenWrapper-wajYPLRg-e8FnO2xN.js → withFullScreenWrapper-B-PKqZVg-DWJ8sEV7.js} +1 -1
- package/build/index.html +2 -2
- package/package.json +3 -3
- package/wheels/streamlit-1.53.1-cp313-none-any.whl +0 -0
- package/build/assets/FileHelper-DbeeBEs5-Co0d-OBP.js +0 -5
- package/build/assets/Particles-6ak5Hlgw-4VTgCETZ.js +0 -1
- package/build/assets/StreamlitSyntaxHighlighter-DSYWFRjz-B77VB7yz.js +0 -8
- package/build/assets/Toolbar-Cr9ArNQU-D5-awBnv.js +0 -1
- package/build/assets/UploadFileInfo-B5SttewO-BfvME59S.js +0 -1
- package/build/assets/_baseAssignValue-3fAevQ7t-BOcc6F75.js +0 -1
- package/build/assets/createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js +0 -1
- package/build/assets/createSuper-bIcQlS98-B8MWK81T.js +0 -1
- package/build/assets/data-grid-overlay-editor-DbHL3o_S-CiO7EIHu.js +0 -1
- package/build/assets/iframeResizer.contentWindow-9ByjY9IM-BBpPzlnE.js +0 -1
- package/build/assets/index-10RiWKwV-Cn-PcXb4.js +0 -3
- package/build/assets/index-47jAZmzN-8ZV_muwb.js +0 -1
- package/build/assets/index-99W3Zegr-DhiLonYo.js +0 -1
- package/build/assets/index-BGCCnxH2-jQwb1QhH.js +0 -1
- package/build/assets/index-BSOGSXpv-Bd9gyoUy.js +0 -27
- package/build/assets/index-BVhYQGzc-Do7aV0dQ.js +0 -1
- package/build/assets/index-BVuioNdm-CVDd_GaD.js +0 -1
- package/build/assets/index-BYGDMULw-4dwQq_lE.js +0 -1
- package/build/assets/index-B_94eI3S-ADuW4ppz.js +0 -6
- package/build/assets/index-Bdi0ug4X.js +0 -181
- package/build/assets/index-C6MBr137-B6bz_i6a.js +0 -1
- package/build/assets/index-CAtZcI5--D0BcKLsl.js +0 -2
- package/build/assets/index-CFA5JkEa-DUK-7VD7.js +0 -1
- package/build/assets/index-CaWaI2PT-DvorZu2G.js +0 -2
- package/build/assets/index-CceTm1nk-D-m7sDsR.js +0 -1
- package/build/assets/index-CucLKMvI-CdFsTlcF.js +0 -1
- package/build/assets/index-CxZCITs0-CLi85oo1.js +0 -1
- package/build/assets/index-D3vT_IC--BZlisRXs.js +0 -3789
- package/build/assets/index-D5L-gN8f-Bny7-WhK.js +0 -11
- package/build/assets/index-D7zRUNKG-2cwkh8qP.js +0 -1
- package/build/assets/index-D8RPh1xj-BLIXkU4c.js +0 -1
- package/build/assets/index-DNE2UpRK-CMtd92Tg.js +0 -1
- package/build/assets/index-D_5mY4iN-C3O2lE89.js +0 -1
- package/build/assets/index-DnTjZ9IR.css +0 -1
- package/build/assets/index-Do4wh7Iw-cPdQGRDQ.js +0 -1
- package/build/assets/index-DwedDN1c-C-Y3cCQP.js +0 -1
- package/build/assets/index-Fvxtopfe-CxLnCat0.js +0 -1
- package/build/assets/index-G4vqu33f-DO7BfNY6.js +0 -1
- package/build/assets/index-KWOwopwF-CN_5PcLU.js +0 -2
- package/build/assets/index-Q4xI4OhR-D81jje-l.js +0 -1
- package/build/assets/index-R1QyBsfg-tcyjJ4fb.js +0 -1
- package/build/assets/index-YOustUZZ-CX09XTf8.js +0 -2
- package/build/assets/index-b6W2ubHd-BapgUWLx.js +0 -1
- package/build/assets/index-h-ZgFEXT-DdL6EMUv.js +0 -2
- package/build/assets/index-lGTf3abu-B6CGTEed.js +0 -1
- package/build/assets/index-nXfHwIms-cOwCevci.js +0 -198
- package/build/assets/index-tU7dWFCN-DURbp79P.js +0 -1
- package/build/assets/inherits-Byw8NQvD-DdaLbWVP.js +0 -1
- package/build/assets/number-overlay-editor-BQ0qCmxT-5g_cUv4i.js +0 -9
- package/build/assets/record-DJsfODTt-CK8X1liM.js +0 -1
- package/build/assets/slicedToArray-CrkrjOeW-7_omneg6.js +0 -2
- package/build/assets/toConsumableArray-BpgQ3N5A-AHKfFeLf.js +0 -2
- package/build/assets/uniqueId-BrCTHDA7-CGglDaT_.js +0 -1
- package/build/assets/unsupportedIterableToArray-CFN3yOc2-C4SckrTc.js +0 -1
- package/build/assets/wavesurfer.esm-CzjpjtNs-CtBzisOM.js +0 -74
- package/build/assets/withCalculatedWidth-C0lBnc3E-BAFtxM9t.js +0 -1
- package/wheels/streamlit-1.52.2-cp313-none-any.whl +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as p,aA as h,L as f,k as i,aj as b,ap as m,y as s,ae as g,B as k}from"./index-nhNM5UeG.js";import{s as y}from"./iconPosition-D6yC8Xnj-BF1h45AJ.js";const C=s("div",{target:"e11k5jya2"})({name:"b6wrti",styles:"display:flex;flex-direction:column;width:100%"}),S=s("a",{target:"e11k5jya1"})(({disabled:o,isCurrentPage:r,theme:e})=>({textDecoration:"none",width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,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},...o?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}}),""),j=s("span",{target:"e11k5jya0"})(({disabled:o,theme:r})=>({color:r.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...o?{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}:{}}),"");function v(o){let r=o.page;if(o.queryString)if(o.external)try{const e=new URL(o.page);new URLSearchParams(o.queryString).forEach((t,n)=>e.searchParams.append(n,t)),r=e.toString()}catch{const[e,t]=r.split("#");r=e+(e.includes("?")?"&":"?")+o.queryString+(t?"#"+t:"")}else r+=(r.includes("?")?"&":"?")+o.queryString;return r}function w(o){const{onPageChange:r,currentPageScriptHash:e}=p.useContext(h),{colors:t}=f(),{disabled:n,element:a}=o,l=e===a.pageScriptHash,u=d=>{a.external?n&&d.preventDefault():(d.preventDefault(),n||r(a.pageScriptHash,a.queryString))},c=y(a.iconPosition),x=v(a);return i.jsx("div",{className:"stPageLink","data-testid":"stPageLink",children:i.jsx(b,{help:a.help,placement:m.TOP_RIGHT,containerWidth:!0,children:i.jsx(C,{children:i.jsxs(S,{"data-testid":"stPageLink-NavLink",disabled:n,isCurrentPage:l,href:x,target:a.external?"_blank":"",rel:"noreferrer",onClick:u,children:[a.icon&&c==="left"&&i.jsx(g,{size:"lg",color:n?t.fadedText40:t.bodyText,iconValue:a.icon}),i.jsx(j,{disabled:n,children:i.jsx(k,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:l,largerLabel:!0,disableLinks:!0})}),a.icon&&c==="right"&&i.jsx(g,{size:"lg",color:n?t.fadedText40:t.bodyText,iconValue:a.icon})]})})})})}const P=p.memo(w);export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,
|
|
1
|
+
import{r as i,k as a,y as c,aK as g,ae as m,B as p}from"./index-nhNM5UeG.js";const h=c("div",{target:"e1se5lgy3"})(({theme:e,cache:s})=>({...s?{paddingBottom:e.spacing.lg,background:`linear-gradient(to bottom, ${e.colors.bgColor} 0%, ${e.colors.bgColor} 80%, transparent 100%)`}:null}),""),f=c("div",{target:"e1se5lgy2"})(({theme:e})=>({display:"flex",alignItems:"center",width:"100%",gap:e.spacing.sm}),""),$=c("div",{target:"e1se5lgy1"})(({theme:e})=>({display:"flex",gap:e.spacing.sm,alignItems:"baseline"}),""),x=c("span",{target:"e1se5lgy0"})(({theme:e})=>({opacity:.6,fontSize:e.fontSizes.sm,lineHeight:e.lineHeights.none,whiteSpace:"nowrap"}),""),y=e=>{const s=Math.floor(e/3600),t=Math.floor(e%3600/60),n=e%60;if(s===0&&t===0)return`(${n.toFixed(1)} seconds)`;if(s===0){const u=`${t} minute${t===1?"":"s"}`,d=n===0?"":`, ${n.toFixed(1)} seconds`;return`(${u}${d})`}const l=`${s} hour${s===1?"":"s"}`,r=t===0?"":`, ${t} minute${t===1?"":"s"}`,o=n===0?"":`, ${n.toFixed(1)} seconds`;return`(${l}${r}${o})`};function S({element:e}){const{cache:s,showTime:t}=e,[n,l]=i.useState(0),r=i.useRef(null);return i.useEffect(()=>{if(!t)return;r.current=Date.now();const o=()=>{if(r.current!==null){const d=(Date.now()-r.current)/1e3;l(d)}};o();const u=setInterval(o,100);return()=>clearInterval(u)},[t]),a.jsx(h,{className:g({stSpinner:!0,stCacheSpinner:s}),"data-testid":"stSpinner",cache:s,children:a.jsxs(f,{children:[a.jsx(m,{size:"lg",iconValue:"spinner"}),a.jsxs($,{children:[a.jsx(p,{source:e.text,allowHTML:!1}),t&&a.jsx(x,{children:y(n)})]})]})})}const b=i.memo(S);export{b as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as u,k as y,ao as ge,L as ye,aP as ve,ap as we,B as re,ar as oe,cJ as ne,br as R,bM as Oe,bs as w}from"./index-nhNM5UeG.js";import{b as Re}from"./WidgetLabelHelpIconInline-DFAc7fKv-BB1k3kRL.js";import{S as ke}from"./useBasicWidgetState-BYeS5Lnw-COvJBdtg.js";import"./FormClearHelper-XrLdNEJa-DVEjd1cV.js";var ie={vertical:"vertical",horizontal:"horizontal"};function ae(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,r)}return o}function B(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ae(Object(o),!0).forEach(function(r){O(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ae(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var x=0,E=1,L=2;function A(e){return e.$isActive?L:e.$isHovered?E:x}function je(e){var t=e.$theme.colors,o=e.$disabled,r=e.$checked,n=e.$isFocusVisible,i=e.$error;if(o)return t.tickFillDisabled;if(r)if(i)switch(A(e)){case x:return t.tickFillErrorSelected;case E:return t.tickFillErrorSelectedHover;case L:return t.tickFillErrorSelectedHoverActive}else switch(A(e)){case x:return t.tickFillSelected;case E:return t.tickFillSelectedHover;case L:return t.tickFillSelectedHoverActive}else return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function Se(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(A(e)){case x:return t.tickFillError;case E:return t.tickFillErrorHover;case L:return t.tickFillErrorHoverActive}else switch(A(e)){case x:return t.tickFill;case E:return t.tickFillHover;case L:return t.tickFillActive}}function Me(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n=r.direction==="rtl"?"Left":"Right";break;default:case"right":n=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,a=i.scale300;return O({},"padding".concat(n),a)}function $e(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var W=R("div",function(e){var t=e.$disabled,o=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:o==="horizontal"?"row":"column",alignItems:o==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});W.displayName="RadioGroupRoot";W.displayName="RadioGroupRoot";var X=R("label",function(e){var t,o=e.$disabled,r=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,c=a==="horizontal",d=i.direction==="rtl"?"Left":"Right";return t={flexDirection:n==="top"||n==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:o?"not-allowed":"pointer",marginTop:s.scale200},O(t,"margin".concat(d),c?s.scale200:null),O(t,"marginBottom",r&&!c?null:s.scale200),t});X.displayName="Root";X.displayName="Root";var J=R("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{backgroundColor:Se(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});J.displayName="RadioMarkInner";J.displayName="RadioMarkInner";var K=R("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:je(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve}});K.displayName="RadioMarkOuter";K.displayName="RadioMarkOuter";var Q=R("div",function(e){var t=e.$theme.typography;return B(B({verticalAlign:"middle"},Me(e)),{},{color:$e(e)},t.LabelMedium)});Q.displayName="Label";Q.displayName="Label";var Y=R("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});Y.displayName="Input";Y.displayName="Input";var Z=R("div",function(e){var t,o=e.$theme,r=e.$align,n=r==="horizontal",i=o.direction==="rtl"?"Right":"Left",a=o.direction==="rtl"?"Left":"Right";return B(B({},o.typography.ParagraphSmall),{},(t={color:o.colors.contentSecondary,cursor:"auto"},O(t,"margin".concat(i),r==="horizontal"?null:o.sizing.scale900),O(t,"margin".concat(a),n?o.sizing.scale200:null),O(t,"maxWidth","240px"),t))});Z.displayName="Description";Z.displayName="Description";function N(e){"@babel/helpers - typeof";return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(e)}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},_.apply(this,arguments)}function Fe(e,t){return Le(e)||Ee(e,t)||xe(e,t)||Pe()}function Pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(e,t){if(e){if(typeof e=="string")return se(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return se(e,t)}}function se(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function Ee(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function Le(e){if(Array.isArray(e))return e}function Ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ce(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Te(e,t,o){return t&&Ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Be(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},U(e,t)}function Ae(e){var t=ze();return function(){var o=D(e),r;if(t){var n=D(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return De(this,r)}}function De(e,t){if(t&&(N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}function C(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ze(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},D(e)}function T(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var ue=(function(e){Be(o,e);var t=Ae(o);function o(){var r;Ie(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),T(C(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),T(C(r),"handleFocus",function(s,c){Oe(s)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:c}),r.props.onFocus&&r.props.onFocus(s)}),T(C(r),"handleBlur",function(s,c){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(s)}),r}return Te(o,[{key:"render",value:function(){var r=this,n=this.props.overrides,i=n===void 0?{}:n,a=w(i.RadioGroupRoot,W),s=Fe(a,2),c=s[0],d=s[1];return u.createElement(c,_({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},d),u.Children.map(this.props.children,function(p,b){if(!u.isValidElement(p))return null;var l=r.props.value===p.props.value;return u.cloneElement(p,{align:r.props.align,autoFocus:r.props.autoFocus,checked:l,disabled:r.props.disabled||p.props.disabled,error:r.props.error,isFocused:r.state.focusedRadioIndex===b,isFocusVisible:r.state.isFocusVisible,tabIndex:b===0&&!r.props.value||l?"0":"-1",labelPlacement:r.props.labelPlacement,name:r.props.name,onBlur:function(f){return r.handleBlur(f,b)},onFocus:function(f){return r.handleFocus(f,b)},onChange:r.props.onChange,onMouseEnter:r.props.onMouseEnter,onMouseLeave:r.props.onMouseLeave})}))}}]),o})(u.Component);T(ue,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});function q(e){"@babel/helpers - typeof";return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(e)}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},v.apply(this,arguments)}function S(e,t){return _e(e)||Ne(e,t)||He(e,t)||Ve()}function Ve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function He(e,t){if(e){if(typeof e=="string")return le(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return le(e,t)}}function le(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function Ne(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function _e(e){if(Array.isArray(e))return e}function Ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ge(e,t,o){return t&&qe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function We(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}function G(e,t){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},G(e,t)}function Xe(e){var t=Ke();return function(){var o=z(e),r;if(t){var n=z(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Je(this,r)}}function Je(e,t){if(t&&(q(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(e)}function M(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ke(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},z(e)}function $(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Qe(e){return e==="top"||e==="left"}function Ye(e){return e==="bottom"||e==="right"}var Ze=function(e){return e.stopPropagation()},ce=(function(e){We(o,e);var t=Xe(o);function o(){var r;Ue(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),$(M(r),"state",{isActive:!1,isHovered:!1}),$(M(r),"onMouseEnter",function(s){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(s)}),$(M(r),"onMouseLeave",function(s){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(s)}),$(M(r),"onMouseDown",function(s){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(s)}),$(M(r),"onMouseUp",function(s){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(s)}),r}return Ge(o,[{key:"componentDidMount",value:function(){var r;this.props.autoFocus&&(r=this.props.inputRef)!==null&&r!==void 0&&r.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var r=this.props.overrides,n=r===void 0?{}:r,i=w(n.Root,X),a=S(i,2),s=a[0],c=a[1],d=w(n.Label,Q),p=S(d,2),b=p[0],l=p[1],f=w(n.Input,Y),F=S(f,2),V=F[0],k=F[1],H=w(n.Description,Z),P=S(H,2),I=P[0],m=P[1],g=w(n.RadioMarkInner,J),h=S(g,2),pe=h[0],fe=h[1],de=w(n.RadioMarkOuter,K),ee=S(de,2),be=ee[0],he=ee[1],j={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},te=u.createElement(b,v({},j,l),this.props.containsInteractiveElement?u.createElement("div",{onClick:function(me){return me.preventDefault()}},this.props.children):this.props.children);return u.createElement(u.Fragment,null,u.createElement(s,v({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},j,c),Qe(this.props.labelPlacement)&&te,u.createElement(be,v({},j,he),u.createElement(pe,v({},j,fe))),u.createElement(V,v({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:Ze,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},j,k)),Ye(this.props.labelPlacement)&&te),!!this.props.description&&u.createElement(I,v({},j,m),this.props.description))}}]),o})(u.Component);$(ce,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:u.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function et(e){const t=parseFloat(e.sizes.checkbox),o=parseFloat(e.spacing.threeXS),r=oe(t.toString()),n=Math.round(r*.375);let i=Math.round(oe((t-o).toString()));return i>=r&&(i-=1),[ne(n,"px"),ne(i,"px")]}function tt({disabled:e,horizontal:t,value:o,onChange:r,options:n,captions:i,label:a,labelVisibility:s,help:c}){const[d,p]=u.useState(o??null);u.useEffect(()=>{o!==d&&p(o??null)},[o]);const b=u.useCallback(m=>{const g=parseInt(m.target.value,10);p(g),r(g)},[r]),l=ye(),f=i.length>0,F=n.length>0,V=F?n:["No options to select."],k=e||!F,H=m=>m==""&&t&&f?" ":m,[P,I]=et(l);return y.jsxs("div",{className:"stRadio","data-testid":"stRadio",children:[y.jsx(ve,{label:a,disabled:k,labelVisibility:s,children:c&&y.jsx(Re,{content:c,placement:we.TOP_RIGHT,label:a})}),y.jsx(ue,{onChange:b,value:d!==null?d.toString():void 0,disabled:k,align:t?ie.horizontal:ie.vertical,"aria-label":a,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:f?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:V.map((m,g)=>y.jsxs(ce,{value:g.toString(),overrides:{Root:{style:({$isFocusVisible:h})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:f?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:h?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:h})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:h&&!k?l.colors.primary:l.colors.borderColor})},RadioMarkInner:{style:({$checked:h})=>({height:h?P:I,width:h?P:I})},Label:{style:{color:k?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[y.jsx(re,{source:m,allowHTML:!1,isLabel:!0,largerLabel:!0}),f&&y.jsx(re,{source:H(i[g]),allowHTML:!1,isCaption:!0,isLabel:!0})]},g))})]})}const rt=u.memo(tt);function ot({disabled:e,element:t,widgetMgr:o,fragmentId:r}){const[n,i]=ke({getStateFromWidgetMgr:nt,getDefaultStateFromProto:it,getCurrStateFromProto:at,updateWidgetMgrState:st,element:t,widgetMgr:o,fragmentId:r}),a=u.useCallback(f=>{i({value:f,fromUi:!0})},[i]),{horizontal:s,options:c,captions:d,label:p,labelVisibility:b,help:l}=t;return y.jsx(rt,{label:p,onChange:a,options:c,captions:d,disabled:e,horizontal:s,labelVisibility:ge(b?.value),value:n??null,help:l})}function nt(e,t){return e.getIntValue(t)}function it(e){return e.default??null}function at(e){return e.value??null}function st(e,t,o,r){t.setIntValue(e,o.value??null,{fromUi:o.fromUi},r)}const ft=u.memo(ot);export{ft as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,H as pe,aJ as fe,j as L,E as me,O as ge,k as f,y as O,aP as ve,ao as be,aQ as ye,aq as H,aT as we,aS as Se,F as N,_ as W,M as xe,L as Ue,bC as Ce,a4 as Me,af as je,bD as te,bn as Ie,ap as ke,aU as Ee,ag as Oe,Q as Re}from"./index-nhNM5UeG.js";import{t as re}from"./UploadFileInfo-DdcsXhjv-m2CBXl3F.js";import{m as Pe}from"./FormClearHelper-XrLdNEJa-DVEjd1cV.js";import{J as Fe,U as Te}from"./ProgressBar-E3DTwBEC-BjaNqN1B.js";import{e as ze}from"./urls-CuMqgoDl-BWqF1s4U.js";var oe=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(N,W({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:a}),n.createElement("rect",{width:24,height:24,fill:"none"}),n.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"}))});oe.displayName="SwitchCamera";var ie=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(N,W({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.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"}))});ie.displayName="Video";var ne=n.forwardRef(function(e,a){var d={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return n.createElement(N,W({iconAttrs:d,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:a}),n.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"}))});ne.displayName="X";function Le(e,a){switch(e){case"xsmall":return{padding:`${a.spacing.twoXS} ${a.spacing.sm}`,fontSize:a.fontSizes.sm};case"small":return{padding:`${a.spacing.twoXS} ${a.spacing.md}`};case"large":return{padding:`${a.spacing.md} ${a.spacing.md}`};default:return{padding:`${a.spacing.xs} ${a.spacing.md}`}}}const ae=O("div",{target:"etz5kuj9"})({name:"b6gpc",styles:"position:relative;overflow:hidden;width:100%;object-fit:contain"}),X=O("div",{target:"etz5kuj8"})(({theme:e,width:a})=>({backgroundColor:e.colors.secondaryBg,borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,width:"100%",height:a*9/16,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),""),$e=O("p",{target:"etz5kuj7"})(({theme:e})=>({marginTop:e.spacing.sm,textAlign:"center"}),""),Be=O("img",{target:"etz5kuj6"})(({theme:e,opacity:a})=>({borderRadius:`${e.radii.default} ${e.radii.default} 0 0`,objectFit:"contain",opacity:a}),""),De=O("a",{target:"etz5kuj5"})(({theme:e})=>({color:e.colors.link,textDecoration:e.linkUnderline?"underline":"none",display:"block"}),""),Ve=O("span",{target:"etz5kuj4"})({name:"s5xdrg",styles:"display:flex;align-items:center"}),_e=O("div",{target:"etz5kuj3"})(({theme:e})=>({position:"absolute",top:e.spacing.lg,right:e.spacing.lg,zIndex:e.zIndices.priority,color:e.colors.fadedText40,mixBlendMode:"difference",opacity:.6}),""),Ae=O("div",{target:"etz5kuj1"})({name:"1yoks5w",styles:"height:fit-content;width:100%;position:absolute;bottom:0"}),He=O("button",{target:"etz5kuj0"})(({theme:e})=>({position:"relative",display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:e.colors.lightenedBg05,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,borderRadius:`0 0 ${e.radii.default} ${e.radii.default}`,"&:hover":{borderColor:e.colors.primary,color:e.colors.primary},"&:active":{color:e.colors.white,borderColor:e.colors.primary,backgroundColor:e.colors.primary},"&:focus:not(:active)":{borderColor:e.colors.primary,color:e.colors.primary},"&:disabled, &:disabled:hover, &:disabled:active":{color:e.colors.fadedText40,borderColor:e.colors.borderColor,backgroundColor:e.colors.lightenedBg05,cursor:"not-allowed"},fontWeight:e.fontWeights.normal,padding:`${e.spacing.xs} ${e.spacing.md}`,margin:e.spacing.none,lineHeight:e.lineHeights.base,color:"inherit",width:"100%",userSelect:"none","&:focus":{outline:"none"},"&:focus-visible":{boxShadow:je(e)},...Le("medium",e)}),"");function Ne({disabled:e,onClick:a,children:d,progress:g}){return f.jsxs(He,{disabled:e||!1,onClick:a||(()=>{}),progress:g||null,"data-testid":"stCameraInputButton",children:[d,g?f.jsx(Ae,{children:f.jsx(Fe,{value:g,size:Te.EXTRASMALL,overrides:{Bar:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarProgress:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}},BarContainer:{style:{borderTopLeftRadius:0,borderTopRightRadius:0}}}})}):null]})}const se=n.memo(Ne);var z=(e=>(e.USER="user",e.ENVIRONMENT="environment",e))(z||{});const We=({switchFacingMode:e})=>f.jsx(_e,{"data-testid":"stCameraInputSwitchButton",children:f.jsx(Ie,{content:"Switch camera",placement:ke.TOP_RIGHT,children:f.jsx(Ee,{kind:Oe.MINIMAL,onClick:e,children:f.jsx(H,{content:oe,size:"twoXL",color:te.white})})})}),Xe=n.memo(We);var A={exports:{}},qe=A.exports,ee;function Je(){return ee||(ee=1,(function(e,a){(function(d,g){e.exports=g(Re)})(qe,function(d){return(function(g){var y={};function p(i){if(y[i])return y[i].exports;var h=y[i]={i,l:!1,exports:{}};return g[i].call(h.exports,h,h.exports,p),h.l=!0,h.exports}return p.m=g,p.c=y,p.d=function(i,h,w){p.o(i,h)||Object.defineProperty(i,h,{enumerable:!0,get:w})},p.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},p.t=function(i,h){if(h&1&&(i=p(i)),h&8||h&4&&typeof i=="object"&&i&&i.__esModule)return i;var w=Object.create(null);if(p.r(w),Object.defineProperty(w,"default",{enumerable:!0,value:i}),h&2&&typeof i!="string")for(var k in i)p.d(w,k,(function(I){return i[I]}).bind(null,k));return w},p.n=function(i){var h=i&&i.__esModule?(function(){return i.default}):(function(){return i});return p.d(h,"a",h),h},p.o=function(i,h){return Object.prototype.hasOwnProperty.call(i,h)},p.p="",p(p.s="./src/react-webcam.tsx")})({"./src/react-webcam.tsx":(function(g,y,p){p.r(y);var i=p("react"),h=(function(){var v=function(o,r){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,l){t.__proto__=l}||function(t,l){for(var s in l)l.hasOwnProperty(s)&&(t[s]=l[s])},v(o,r)};return function(o,r){v(o,r);function t(){this.constructor=o}o.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}})(),w=function(){return w=Object.assign||function(v){for(var o,r=1,t=arguments.length;r<t;r++){o=arguments[r];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(v[l]=o[l])}return v},w.apply(this,arguments)},k=function(v,o){var r={};for(var t in v)Object.prototype.hasOwnProperty.call(v,t)&&o.indexOf(t)<0&&(r[t]=v[t]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,t=Object.getOwnPropertySymbols(v);l<t.length;l++)o.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(v,t[l])&&(r[t[l]]=v[t[l]]);return r};(function(){typeof window>"u"||(navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(v){var o=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return o?new Promise(function(r,t){o.call(navigator,v,r,t)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}))})();function I(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}var E=(function(v){h(o,v);function o(r){var t=v.call(this,r)||this;return t.canvas=null,t.ctx=null,t.requestUserMediaId=0,t.unmounted=!1,t.state={hasUserMedia:!1},t}return o.prototype.componentDidMount=function(){var r=this,t=r.state,l=r.props;if(this.unmounted=!1,!I()){l.onUserMediaError("getUserMedia not supported");return}t.hasUserMedia||this.requestUserMedia(),l.children&&typeof l.children!="function"&&console.warn("children must be a function")},o.prototype.componentDidUpdate=function(r){var t=this.props;if(!I()){t.onUserMediaError("getUserMedia not supported");return}var l=JSON.stringify(r.audioConstraints)!==JSON.stringify(t.audioConstraints),s=JSON.stringify(r.videoConstraints)!==JSON.stringify(t.videoConstraints),C=r.minScreenshotWidth!==t.minScreenshotWidth,S=r.minScreenshotHeight!==t.minScreenshotHeight;(s||C||S)&&(this.canvas=null,this.ctx=null),(l||s)&&(this.stopAndCleanup(),this.requestUserMedia())},o.prototype.componentWillUnmount=function(){this.unmounted=!0,this.stopAndCleanup()},o.stopMediaStream=function(r){r&&(r.getVideoTracks&&r.getAudioTracks?(r.getVideoTracks().map(function(t){r.removeTrack(t),t.stop()}),r.getAudioTracks().map(function(t){r.removeTrack(t),t.stop()})):r.stop())},o.prototype.stopAndCleanup=function(){var r=this.state;r.hasUserMedia&&(o.stopMediaStream(this.stream),r.src&&window.URL.revokeObjectURL(r.src))},o.prototype.getScreenshot=function(r){var t=this,l=t.state,s=t.props;if(!l.hasUserMedia)return null;var C=this.getCanvas(r);return C&&C.toDataURL(s.screenshotFormat,s.screenshotQuality)},o.prototype.getCanvas=function(r){var t=this,l=t.state,s=t.props;if(!this.video||!l.hasUserMedia||!this.video.videoHeight)return null;if(!this.ctx){var C=this.video.videoWidth,S=this.video.videoHeight;if(!this.props.forceScreenshotSourceSize){var x=C/S;C=s.minScreenshotWidth||this.video.clientWidth,S=C/x,s.minScreenshotHeight&&S<s.minScreenshotHeight&&(S=s.minScreenshotHeight,C=S*x)}this.canvas=document.createElement("canvas"),this.canvas.width=r?.width||C,this.canvas.height=r?.height||S,this.ctx=this.canvas.getContext("2d")}var j=this,U=j.ctx,b=j.canvas;return U&&b&&(b.width=r?.width||b.width,b.height=r?.height||b.height,s.mirrored&&(U.translate(b.width,0),U.scale(-1,1)),U.imageSmoothingEnabled=s.imageSmoothing,U.drawImage(this.video,0,0,r?.width||b.width,r?.height||b.height),s.mirrored&&(U.scale(-1,1),U.translate(-b.width,0))),b},o.prototype.requestUserMedia=function(){var r=this,t=this.props,l=function(S,x){var j={video:typeof x<"u"?x:!0};t.audio&&(j.audio=typeof S<"u"?S:!0),r.requestUserMediaId++;var U=r.requestUserMediaId;navigator.mediaDevices.getUserMedia(j).then(function(b){r.unmounted||U!==r.requestUserMediaId?o.stopMediaStream(b):r.handleUserMedia(null,b)}).catch(function(b){r.handleUserMedia(b)})};if("mediaDevices"in navigator)l(t.audioConstraints,t.videoConstraints);else{var s=function(S){return{optional:[{sourceId:S}]}},C=function(S){var x=S.deviceId;return typeof x=="string"?x:Array.isArray(x)&&x.length>0?x[0]:typeof x=="object"&&x.ideal?x.ideal:null};MediaStreamTrack.getSources(function(S){var x=null,j=null;S.forEach(function(R){R.kind==="audio"?x=R.id:R.kind==="video"&&(j=R.id)});var U=C(t.audioConstraints);U&&(x=U);var b=C(t.videoConstraints);b&&(j=b),l(s(x),s(j))})}},o.prototype.handleUserMedia=function(r,t){var l=this.props;if(r||!t){this.setState({hasUserMedia:!1}),l.onUserMediaError(r);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)})}l.onUserMedia(t)},o.prototype.render=function(){var r=this,t=this,l=t.state,s=t.props,C=s.audio;s.forceScreenshotSourceSize;var S=s.disablePictureInPicture;s.onUserMedia,s.onUserMediaError,s.screenshotFormat,s.screenshotQuality,s.minScreenshotWidth,s.minScreenshotHeight,s.audioConstraints,s.videoConstraints,s.imageSmoothing;var x=s.mirrored,j=s.style,U=j===void 0?{}:j,b=s.children,R=k(s,["audio","forceScreenshotSourceSize","disablePictureInPicture","onUserMedia","onUserMediaError","screenshotFormat","screenshotQuality","minScreenshotWidth","minScreenshotHeight","audioConstraints","videoConstraints","imageSmoothing","mirrored","style","children"]),D=x?w(w({},U),{transform:(U.transform||"")+" scaleX(-1)"}):U,$={getScreenshot:this.getScreenshot.bind(this)};return i.createElement(i.Fragment,null,i.createElement("video",w({autoPlay:!0,disablePictureInPicture:S,src:l.src,muted:!C,playsInline:!0,ref:function(B){r.video=B},style:D},R)),b&&b($))},o.defaultProps={audio:!1,disablePictureInPicture:!1,forceScreenshotSourceSize:!1,imageSmoothing:!0,mirrored:!1,onUserMedia:function(){},onUserMediaError:function(){},screenshotFormat:"image/webp",screenshotQuality:.92},o})(i.Component);y.default=E}),react:(function(g,y){g.exports=d})}).default})})(A)),A.exports}var Qe=Je();const Ye=Me(Qe),Ze=({width:e})=>f.jsxs(X,{width:e,children:[f.jsx(H,{size:"threeXL",color:te.gray60,content:ie}),f.jsxs($e,{children:["This app would like to use your camera.",f.jsx(De,{href:ze,rel:"noopener noreferrer",target:"_blank",children:"Learn how to allow access."})]})]}),Ke=({handleCapture:e,width:a,disabled:d,clearPhotoInProgress:g,setClearPhotoInProgress:y,facingMode:p,setFacingMode:i,testOverride:h})=>{const[w,k]=n.useState(h||"pending"),I=n.useRef(null),[E,v]=n.useState(a),o=n.useCallback(xe(1e3,v),[]);n.useEffect(()=>{o(a)},[a,o]);function r(){if(I.current!==null){const l=I.current.getScreenshot();e(l)}}const t=Ue();return f.jsxs(ae,{"data-testid":"stCameraInputWebcamComponent",children:[w!=="success"&&!d&&!g?f.jsx(Ze,{width:E}):Ce()&&f.jsx(Xe,{switchFacingMode:i}),f.jsx(X,{"data-testid":"stCameraInputWebcamStyledBox",hidden:w!=="success"&&!d&&!g,width:E,children:!d&&f.jsx(Ye,{audio:!1,ref:I,screenshotFormat:"image/jpeg",screenshotQuality:1,width:E,height:E*9/16,style:{borderRadius:`${t.radii.default} ${t.radii.default} 0 0`},onUserMediaError:()=>{k("error")},onUserMedia:()=>{k("success"),y(!1)},videoConstraints:{width:{ideal:E},facingMode:p}})}),f.jsx(se,{onClick:r,disabled:w!=="success"||d||g,children:"Take Photo"})]})},Ge=n.memo(Ke),le="RESTORED_FROM_WIDGET",et=150,tt=me.getLogger("CameraInput"),_=e=>{const a=e.filter(d=>d.status.type==="uploaded").map(d=>{const{name:g,size:y,status:p}=d,{fileId:i,fileUrls:h}=p;return new we({fileId:i,fileUrls:h,name:g,size:y})});return new Se({uploadedFileInfo:a})},rt=(e,a)=>{const d=a.getFileUploaderStateValue(e);if(L(d))return{files:[],nextLocalId:1,imgSrc:null};const{uploadedFileInfo:g}=d;if(L(g)||g.length===0)return{files:[],nextLocalId:1,imgSrc:null};let y=1;const p=g.map(i=>{const h=i.name,w=i.size,k=i.fileId,I=i.fileUrls,E=new re(h,w,y,{type:"uploaded",fileId:k,fileUrls:I});return y+=1,E});return{files:p,nextLocalId:y,imgSrc:p.length>0?le:null}};function ot(e,a){return fetch(e).then(d=>d.arrayBuffer()).then(d=>new File([d],a,{type:"image/jpeg"}))}const it=({element:e,widgetMgr:a,uploadClient:d,disabled:g,fragmentId:y,testOverride:p})=>{const{width:i,elementRef:h}=pe(),w=n.useRef(null);w.current===null&&(w.current=rt(e,a));const{files:k,nextLocalId:I,imgSrc:E}=w.current,v=n.useRef(I),[o,r]=n.useState(()=>k),t=n.useRef(o);n.useLayoutEffect(()=>{t.current=o},[o]);const[l,s]=n.useState(()=>E),[C,S]=n.useState(!1),[x,j]=n.useState(!0),[U,b]=n.useState(!1),[R,D]=n.useState(z.USER),$=n.useCallback(()=>{const c=v.current;return v.current+=1,c},[]),B=n.useMemo(()=>{const c=u=>u.status.type==="uploading";return o.some(c)?"updating":"ready"},[o]),V=n.useMemo(()=>{if(o.length>0&&o[o.length-1].status.type==="uploading")return o[o.length-1].status.progress},[o]),ce=n.useCallback(()=>{D(c=>c===z.USER?z.ENVIRONMENT:z.USER)},[]),P=n.useCallback(c=>t.current.find(u=>u.id===c),[]),q=n.useCallback(c=>{fe.flushSync(()=>{r(u=>[...u,c])})},[]),J=n.useCallback(c=>{r(u=>u.filter(m=>m.id!==c))},[]),F=n.useCallback((c,u)=>{r(m=>m.map(M=>M.id===c?u:M))},[]),Q=n.useCallback((c,u)=>{S(!1);const m=P(c);L(m)||m.status.type!=="uploading"||F(m.id,m.setStatus({type:"uploaded",fileId:u.fileId,fileUrls:u}))},[P,F]),Y=n.useCallback((c,u)=>{const m=P(u);if(L(m)||m.status.type!=="uploading")return;const M=Math.round(c.loaded*100/c.total);m.status.progress!==M&&F(u,m.setStatus({type:"uploading",abortController:m.status.abortController,progress:M}))},[P,F]),Z=n.useCallback((c,u)=>{const m=new AbortController,M=new re(u.name,u.size,$(),{type:"uploading",abortController:m,progress:1});q(M),d.uploadFile(e,c.uploadUrl,u,T=>Y(T,M.id),m.signal).then(()=>Q(M.id,c)).catch(T=>{T instanceof DOMException&&T.name==="AbortError"||F(M.id,M.setStatus({type:"error",errorMessage:T?T.toString():"Unknown error"}))})},[q,e,$,Q,Y,F,d]),K=n.useCallback(c=>{const u=P(c);L(u)||(u.status.type==="uploading"&&u.status.abortController.abort(),u.status.type==="uploaded"&&u.status.fileUrls.deleteUrl&&d.deleteFile(u.status.fileUrls.deleteUrl),J(c))},[P,J,d]),G=n.useCallback(c=>{if(c===null)return Promise.resolve();s(c),S(!0),j(!1);const u=m=>new Promise(M=>setTimeout(M,m));return ot(c,`camera-input-${new Date().toISOString().replace(/:/g,"_")}.jpg`).then(m=>d.fetchFileURLs([m]).then(M=>({file:m,fileUrls:M[0]}))).then(({file:m,fileUrls:M})=>Z(M,m)).then(()=>u(et)).then(()=>{j(!0)}).catch(m=>{tt.error(m)})},[d,Z]),de=n.useCallback(c=>{G(c)},[G]),ue=n.useCallback(()=>{o.length!==0&&(o.forEach(c=>K(c.id)),s(null),b(!0))},[o,K]);n.useEffect(()=>{a.getFileUploaderStateValue(e)===void 0&&a.setFileUploaderStateValue(e,_(o),{fromUi:!1},y)},[]),n.useEffect(()=>{if(B!=="ready")return;const c=_(o),u=a.getFileUploaderStateValue(e);ge(c,u)||a.setFileUploaderStateValue(e,c,{fromUi:!0},y)},[B,o,a,e,y]);const he=n.useCallback(()=>{r([]),s(null);const c=_([]);a.setFileUploaderStateValue(e,c,{fromUi:!0},y)},[e,y,a]);return Pe({element:e,widgetMgr:a,onFormCleared:he}),f.jsxs(ae,{className:"stCameraInput","data-testid":"stCameraInput",ref:h,children:[f.jsx(ve,{label:e.label,disabled:g,labelVisibility:be(e.labelVisibility?.value),children:e.help&&f.jsx(ye,{content:e.help,label:e.label})}),l?f.jsxs(f.Fragment,{children:[f.jsx(X,{width:i,children:l!==le&&f.jsx(Be,{src:l,alt:"Snapshot",opacity:C||!x?"50%":"100%",width:i,height:i*9/16})}),f.jsx(se,{onClick:ue,progress:V,disabled:!!V||g,children:V?"Uploading...":f.jsxs(Ve,{children:[f.jsx(H,{content:ne,margin:"0 xs 0 0",size:"sm"})," Clear photo"]})})]}):f.jsx(Ge,{handleCapture:de,width:i,disabled:g,clearPhotoInProgress:U,setClearPhotoInProgress:b,facingMode:R,setFacingMode:ce,testOverride:p})]})},dt=n.memo(it);export{dt as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
function Ve(e,t){return function(){return e.apply(t,arguments)}}const{toString:mt}=Object.prototype,{getPrototypeOf:ge}=Object,{iterator:te,toStringTag:$e}=Symbol,re=(e=>t=>{const r=mt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),N=e=>(e=e.toLowerCase(),t=>re(t)===e),ne=e=>t=>typeof t===e,{isArray:q}=Array,k=ne("undefined");function z(e){return e!==null&&!k(e)&&e.constructor!==null&&!k(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ke=N("ArrayBuffer");function bt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ke(e.buffer),t}const gt=ne("string"),T=ne("function"),Xe=ne("number"),H=e=>e!==null&&typeof e=="object",yt=e=>e===!0||e===!1,G=e=>{if(re(e)!=="object")return!1;const t=ge(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!($e in e)&&!(te in e)},wt=e=>{if(!H(e)||z(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Et=N("Date"),Rt=N("File"),Ot=e=>!!(e&&typeof e.uri<"u"),St=e=>e&&typeof e.getParts<"u",Tt=N("Blob"),At=N("FileList"),Ct=e=>H(e)&&T(e.pipe);function Nt(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const _e=Nt(),xe=typeof _e.FormData<"u"?_e.FormData:void 0,vt=e=>{let t;return e&&(xe&&e instanceof xe||T(e.append)&&((t=re(e))==="formdata"||t==="object"&&T(e.toString)&&e.toString()==="[object FormData]"))},_t=N("URLSearchParams"),[xt,Pt,jt,Ut]=["ReadableStream","Request","Response","Headers"].map(N),Ft=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function J(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),q(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(z(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let c;for(n=0;n<s;n++)c=i[n],t.call(null,e[c],c,e)}}function Qe(e,t){if(z(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const F=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ge=e=>!k(e)&&e!==F;function pe(){const{caseless:e,skipUndefined:t}=Ge(this)&&this||{},r={},n=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const s=e&&Qe(r,i)||i;G(r[s])&&G(o)?r[s]=pe(r[s],o):G(o)?r[s]=pe({},o):q(o)?r[s]=o.slice():(!t||!k(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&J(arguments[o],n);return r}const Lt=(e,t,r,{allOwnKeys:n}={})=>(J(t,(o,i)=>{r&&T(o)?Object.defineProperty(e,i,{value:Ve(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Dt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Bt=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},kt=(e,t,r,n)=>{let o,i,s;const c={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=r!==!1&&ge(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},qt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},It=e=>{if(!e)return null;if(q(e))return e;let t=e.length;if(!Xe(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Mt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ge(Uint8Array)),zt=(e,t)=>{const r=(e&&e[te]).call(e);let n;for(;(n=r.next())&&!n.done;){const o=n.value;t.call(e,o[0],o[1])}},Ht=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Jt=N("HTMLFormElement"),Wt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),Pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Vt=N("RegExp"),Ye=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};J(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},$t=e=>{Ye(e,(t,r)=>{if(T(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(T(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Kt=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return q(e)?n(e):n(String(e).split(t)),r},Xt=()=>{},Qt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Gt(e){return!!(e&&T(e.append)&&e[$e]==="FormData"&&e[te])}const Yt=e=>{const t=new Array(10),r=(n,o)=>{if(H(n)){if(t.indexOf(n)>=0)return;if(z(n))return n;if(!("toJSON"in n)){t[o]=n;const i=q(n)?[]:{};return J(n,(s,c)=>{const f=r(s,o+1);!k(f)&&(i[c]=f)}),t[o]=void 0,i}}return n};return r(e,0)},Zt=N("AsyncFunction"),er=e=>e&&(H(e)||T(e))&&T(e.then)&&T(e.catch),Ze=((e,t)=>e?setImmediate:t?((r,n)=>(F.addEventListener("message",({source:o,data:i})=>{o===F&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),F.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",T(F.postMessage)),tr=typeof queueMicrotask<"u"?queueMicrotask.bind(F):typeof process<"u"&&process.nextTick||Ze,rr=e=>e!=null&&T(e[te]),a={isArray:q,isArrayBuffer:Ke,isBuffer:z,isFormData:vt,isArrayBufferView:bt,isString:gt,isNumber:Xe,isBoolean:yt,isObject:H,isPlainObject:G,isEmptyObject:wt,isReadableStream:xt,isRequest:Pt,isResponse:jt,isHeaders:Ut,isUndefined:k,isDate:Et,isFile:Rt,isReactNativeBlob:Ot,isReactNative:St,isBlob:Tt,isRegExp:Vt,isFunction:T,isStream:Ct,isURLSearchParams:_t,isTypedArray:Mt,isFileList:At,forEach:J,merge:pe,extend:Lt,trim:Ft,stripBOM:Dt,inherits:Bt,toFlatObject:kt,kindOf:re,kindOfTest:N,endsWith:qt,toArray:It,forEachEntry:zt,matchAll:Ht,isHTMLForm:Jt,hasOwnProperty:Pe,hasOwnProp:Pe,reduceDescriptors:Ye,freezeMethods:$t,toObjectSet:Kt,toCamelCase:Wt,noop:Xt,toFiniteNumber:Qt,findKey:Qe,global:F,isContextDefined:Ge,isSpecCompliantForm:Gt,toJSONObject:Yt,isAsyncFn:Zt,isThenable:er,setImmediate:Ze,asap:tr,isIterable:rr};let m=class et extends Error{static from(t,r,n,o,i,s){const c=new et(t.message,r||t.code,n,o,i);return c.cause=t,c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),s&&Object.assign(c,s),c}constructor(t,r,n,o,i){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}};m.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";m.ERR_BAD_OPTION="ERR_BAD_OPTION";m.ECONNABORTED="ECONNABORTED";m.ETIMEDOUT="ETIMEDOUT";m.ERR_NETWORK="ERR_NETWORK";m.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";m.ERR_DEPRECATED="ERR_DEPRECATED";m.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";m.ERR_BAD_REQUEST="ERR_BAD_REQUEST";m.ERR_CANCELED="ERR_CANCELED";m.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";m.ERR_INVALID_URL="ERR_INVALID_URL";const nr=null;function he(e){return a.isPlainObject(e)||a.isArray(e)}function tt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function le(e,t,r){return e?e.concat(t).map(function(n,o){return n=tt(n),!r&&o?"["+n+"]":n}).join(r?".":""):t}function or(e){return a.isArray(e)&&!e.some(he)}const sr=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function oe(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,p){return!a.isUndefined(p[h])});const n=r.metaTokens,o=r.visitor||l,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function f(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(a.isBoolean(h))return h.toString();if(!c&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?c&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,p,d){let E=h;if(a.isReactNative(t)&&a.isReactNativeBlob(h))return t.append(le(d,p,i),f(h)),!1;if(h&&!d&&typeof h=="object"){if(a.endsWith(p,"{}"))p=n?p:p.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&or(h)||(a.isFileList(h)||a.endsWith(p,"[]"))&&(E=a.toArray(h)))return p=tt(p),E.forEach(function(R,w){!(a.isUndefined(R)||R===null)&&t.append(s===!0?le([p],w,i):s===null?p:p+"[]",f(R))}),!1}return he(h)?!0:(t.append(le(d,p,i),f(h)),!1)}const u=[],b=Object.assign(sr,{defaultVisitor:l,convertValue:f,isVisitable:he});function g(h,p){if(!a.isUndefined(h)){if(u.indexOf(h)!==-1)throw Error("Circular reference detected in "+p.join("."));u.push(h),a.forEach(h,function(d,E){(!(a.isUndefined(d)||d===null)&&o.call(t,d,a.isString(E)?E.trim():E,p,b))===!0&&g(d,p?p.concat(E):[E])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return g(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ye(e,t){this._pairs=[],e&&oe(e,this,t)}const rt=ye.prototype;rt.append=function(e,t){this._pairs.push([e,t])};rt.toString=function(e){const t=e?function(r){return e.call(this,r,je)}:je;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function ir(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nt(e,t,r){if(!t)return e;const n=r&&r.encode||ir,o=a.isFunction(r)?{serialize:r}:r,i=o&&o.serialize;let s;if(i?s=i(t,o):s=a.isURLSearchParams(t)?t.toString():new ye(t,o).toString(n),s){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Ue{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const we={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ar=typeof URLSearchParams<"u"?URLSearchParams:ye,cr=typeof FormData<"u"?FormData:null,lr=typeof Blob<"u"?Blob:null,ur={isBrowser:!0,classes:{URLSearchParams:ar,FormData:cr,Blob:lr},protocols:["http","https","file","blob","url","data"]},Ee=typeof window<"u"&&typeof document<"u",me=typeof navigator=="object"&&navigator||void 0,fr=Ee&&(!me||["ReactNative","NativeScript","NS"].indexOf(me.product)<0),dr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",pr=Ee&&window.location.href||"http://localhost",hr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ee,hasStandardBrowserEnv:fr,hasStandardBrowserWebWorkerEnv:dr,navigator:me,origin:pr},Symbol.toStringTag,{value:"Module"})),O={...hr,...ur};function mr(e,t){return oe(e,new O.classes.URLSearchParams,{visitor:function(r,n,o,i){return O.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function br(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function gr(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function ot(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const c=Number.isFinite(+s),f=i>=r.length;return s=!s&&a.isArray(o)?o.length:s,f?(a.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!c):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&a.isArray(o[s])&&(o[s]=gr(o[s])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const r={};return a.forEachEntry(e,(n,o)=>{t(br(n),o,r,0)}),r}return null}function yr(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const W={transitional:we,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return n?JSON.stringify(ot(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mr(e,this.formSerializer).toString();if((i=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){const s=this.env&&this.env.FormData;return oe(i?{"files[]":e}:e,s&&new s,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),yr(e)):e}],transformResponse:[function(e){const t=this.transitional||W.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||n)){const o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(i){if(o)throw i.name==="SyntaxError"?m.from(i,m.ERR_BAD_RESPONSE,this,null,this.response):i}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{W.headers[e]={}});const wr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Er=e=>{const t={};let r,n,o;return e&&e.split(`
|
|
2
|
+
`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&wr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Fe=Symbol("internals");function M(e){return e&&String(e).trim().toLowerCase()}function Y(e){return e===!1||e==null?e:a.isArray(e)?e.map(Y):String(e)}function Rr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Or=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ue(e,t,r,n,o){if(a.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!a.isString(t)){if(a.isString(n))return t.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(t)}}function Sr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Tr(e,t){const r=a.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let A=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(s,c,f){const l=M(c);if(!l)throw new Error("header name must be a non-empty string");const u=a.findKey(n,l);(!u||n[u]===void 0||f===!0||f===void 0&&n[u]!==!1)&&(n[u||c]=Y(s))}const i=(s,c)=>a.forEach(s,(f,l)=>o(f,l,c));if(a.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(a.isString(e)&&(e=e.trim())&&!Or(e))i(Er(e),t);else if(a.isObject(e)&&a.isIterable(e)){let s={},c,f;for(const l of e){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");s[f=l[0]]=(c=s[f])?a.isArray(c)?[...c,l[1]]:[c,l[1]]:l[1]}i(s,t)}else e!=null&&o(t,e,r);return this}get(e,t){if(e=M(e),e){const r=a.findKey(this,e);if(r){const n=this[r];if(!t)return n;if(t===!0)return Rr(n);if(a.isFunction(t))return t.call(this,n,r);if(a.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=M(e),e){const r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||ue(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let n=!1;function o(i){if(i=M(i),i){const s=a.findKey(r,i);s&&(!t||ue(r,r[s],s,t))&&(delete r[s],n=!0)}}return a.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];(!e||ue(this,this[o],o,e,!0))&&(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return a.forEach(this,(n,o)=>{const i=a.findKey(r,o);if(i){t[i]=Y(n),delete t[o];return}const s=e?Sr(o):String(o).trim();s!==o&&delete t[o],t[s]=Y(n),r[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return a.forEach(this,(r,n)=>{r!=null&&r!==!1&&(t[n]=e&&a.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(n=>r.set(n)),r}static accessor(e){const t=(this[Fe]=this[Fe]={accessors:{}}).accessors,r=this.prototype;function n(o){const i=M(o);t[i]||(Tr(r,o),t[i]=!0)}return a.isArray(e)?e.forEach(n):n(e),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(A.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});a.freezeMethods(A);function fe(e,t){const r=this||W,n=t||r,o=A.from(n.headers);let i=n.data;return a.forEach(e,function(s){i=s.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function st(e){return!!(e&&e.__CANCEL__)}let V=class extends m{constructor(e,t,r){super(e??"canceled",m.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function it(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ar(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Cr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),l=n[i];s||(s=f),r[o]=c,n[o]=f;let u=i,b=0;for(;u!==o;)b+=r[u++],u=u%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),f-s<t)return;const g=l&&f-l;return g?Math.round(b*1e3/g):void 0}}function Nr(e,t){let r=0,n=1e3/t,o,i;const s=(c,f=Date.now())=>{r=f,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const f=Date.now(),l=f-r;l>=n?s(c,f):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},n-l)))},()=>o&&s(o)]}const ee=(e,t,r=3)=>{let n=0;const o=Cr(50,250);return Nr(i=>{const s=i.loaded,c=i.lengthComputable?i.total:void 0,f=s-n,l=o(f),u=s<=c;n=s;const b={loaded:s,total:c,progress:c?s/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-s)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(b)},r)},Le=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},De=e=>(...t)=>a.asap(()=>e(...t)),vr=O.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,O.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,_r=O.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(o)&&c.push(`domain=${o}`),i===!0&&c.push("secure"),a.isString(s)&&c.push(`SameSite=${s}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function xr(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Pr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function at(e,t,r){let n=!xr(t);return e&&(n||r==!1)?Pr(e,t):t}const Be=e=>e instanceof A?{...e}:e;function D(e,t){t=t||{};const r={};function n(l,u,b,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function o(l,u,b,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l,b,g)}else return n(l,u,b,g)}function i(l,u){if(!a.isUndefined(u))return n(void 0,u)}function s(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function c(l,u,b){if(b in t)return n(l,u);if(b in e)return n(void 0,l)}const f={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(l,u,b)=>o(Be(l),Be(u),b,!0)};return a.forEach(Object.keys({...e,...t}),function(l){if(l==="__proto__"||l==="constructor"||l==="prototype")return;const u=a.hasOwnProp(f,l)?f[l]:o,b=u(e[l],t[l],l);a.isUndefined(b)&&u!==c||(r[l]=b)}),r}const ct=e=>{const t=D({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:c}=t;if(t.headers=s=A.from(s),t.url=nt(at(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(a.isFunction(r.getHeaders)){const f=r.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,b])=>{l.includes(u.toLowerCase())&&s.set(u,b)})}}if(O.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&vr(t.url))){const f=o&&i&&_r.read(i);f&&s.set(o,f)}return t},jr=typeof XMLHttpRequest<"u",Ur=jr&&function(e){return new Promise(function(t,r){const n=ct(e);let o=n.data;const i=A.from(n.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:f}=n,l,u,b,g,h;function p(){g&&g(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(l),n.signal&&n.signal.removeEventListener("abort",l)}let d=new XMLHttpRequest;d.open(n.method.toUpperCase(),n.url,!0),d.timeout=n.timeout;function E(){if(!d)return;const w=A.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),v={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:w,config:e,request:d};it(function(_){t(_),p()},function(_){r(_),p()},v),d=null}"onloadend"in d?d.onloadend=E:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(E)},d.onabort=function(){d&&(r(new m("Request aborted",m.ECONNABORTED,e,d)),d=null)},d.onerror=function(w){const v=w&&w.message?w.message:"Network Error",_=new m(v,m.ERR_NETWORK,e,d);_.event=w||null,r(_),d=null},d.ontimeout=function(){let w=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const v=n.transitional||we;n.timeoutErrorMessage&&(w=n.timeoutErrorMessage),r(new m(w,v.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,d)),d=null},o===void 0&&i.setContentType(null),"setRequestHeader"in d&&a.forEach(i.toJSON(),function(w,v){d.setRequestHeader(v,w)}),a.isUndefined(n.withCredentials)||(d.withCredentials=!!n.withCredentials),s&&s!=="json"&&(d.responseType=n.responseType),f&&([b,h]=ee(f,!0),d.addEventListener("progress",b)),c&&d.upload&&([u,g]=ee(c),d.upload.addEventListener("progress",u),d.upload.addEventListener("loadend",g)),(n.cancelToken||n.signal)&&(l=w=>{d&&(r(!w||w.type?new V(null,e,d):w),d.abort(),d=null)},n.cancelToken&&n.cancelToken.subscribe(l),n.signal&&(n.signal.aborted?l():n.signal.addEventListener("abort",l)));const R=Ar(n.url);if(R&&O.protocols.indexOf(R)===-1){r(new m("Unsupported protocol "+R+":",m.ERR_BAD_REQUEST,e));return}d.send(o||null)})},Fr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(l){if(!o){o=!0,c();const u=l instanceof Error?l:this.reason;n.abort(u instanceof m?u:new V(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new m(`timeout of ${t}ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},Lr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},Dr=async function*(e,t){for await(const r of Br(e))yield*Lr(r,t)},Br=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},ke=(e,t,r,n)=>{const o=Dr(e,t);let i=0,s,c=f=>{s||(s=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await o.next();if(l){c(),f.close();return}let b=u.byteLength;if(r){let g=i+=b;r(g)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),o.return()}},{highWaterMark:2})},qe=64*1024,{isFunction:Q}=a,kr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Ie,TextEncoder:Me}=a.global,ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qr=e=>{e=a.merge.call({skipUndefined:!0},kr,e);const{fetch:t,Request:r,Response:n}=e,o=t?Q(t):typeof fetch=="function",i=Q(r),s=Q(n);if(!o)return!1;const c=o&&Q(Ie),f=o&&(typeof Me=="function"?(p=>d=>p.encode(d))(new Me):async p=>new Uint8Array(await new r(p).arrayBuffer())),l=i&&c&&ze(()=>{let p=!1;const d=new r(O.origin,{body:new Ie,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!d}),u=s&&c&&ze(()=>a.isReadableStream(new n("").body)),b={stream:u&&(p=>p.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!b[p]&&(b[p]=(d,E)=>{let R=d&&d[p];if(R)return R.call(d);throw new m(`Response type '${p}' is not supported`,m.ERR_NOT_SUPPORT,E)})});const g=async p=>{if(p==null)return 0;if(a.isBlob(p))return p.size;if(a.isSpecCompliantForm(p))return(await new r(O.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(a.isArrayBufferView(p)||a.isArrayBuffer(p))return p.byteLength;if(a.isURLSearchParams(p)&&(p=p+""),a.isString(p))return(await f(p)).byteLength},h=async(p,d)=>a.toFiniteNumber(p.getContentLength())??g(d);return async p=>{let{url:d,method:E,data:R,signal:w,cancelToken:v,timeout:_,onDownloadProgress:ie,onUploadProgress:Oe,responseType:x,headers:ae,withCredentials:$="same-origin",fetchOptions:Se}=ct(p),Te=t||fetch;x=x?(x+"").toLowerCase():"text";let K=Fr([w,v&&v.toAbortSignal()],_),I=null;const U=K&&K.unsubscribe&&(()=>{K.unsubscribe()});let Ae;try{if(Oe&&l&&E!=="get"&&E!=="head"&&(Ae=await h(ae,R))!==0){let j=new r(d,{method:"POST",body:R,duplex:"half"}),B;if(a.isFormData(R)&&(B=j.headers.get("content-type"))&&ae.setContentType(B),j.body){const[ce,X]=Le(Ae,ee(De(Oe)));R=ke(j.body,qe,ce,X)}}a.isString($)||($=$?"include":"omit");const S=i&&"credentials"in r.prototype,Ce={...Se,signal:K,method:E.toUpperCase(),headers:ae.normalize().toJSON(),body:R,duplex:"half",credentials:S?$:void 0};I=i&&new r(d,Ce);let P=await(i?Te(I,Se):Te(d,Ce));const Ne=u&&(x==="stream"||x==="response");if(u&&(ie||Ne&&U)){const j={};["status","statusText","headers"].forEach(ve=>{j[ve]=P[ve]});const B=a.toFiniteNumber(P.headers.get("content-length")),[ce,X]=ie&&Le(B,ee(De(ie),!0))||[];P=new n(ke(P.body,qe,ce,()=>{X&&X(),U&&U()}),j)}x=x||"text";let ht=await b[a.findKey(b,x)||"text"](P,p);return!Ne&&U&&U(),await new Promise((j,B)=>{it(j,B,{data:ht,headers:A.from(P.headers),status:P.status,statusText:P.statusText,config:p,request:I})})}catch(S){throw U&&U(),S&&S.name==="TypeError"&&/Load failed|fetch/i.test(S.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,p,I,S&&S.response),{cause:S.cause||S}):m.from(S,S&&S.code,p,I,S&&S.response)}}},Ir=new Map,lt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,c=s,f,l,u=Ir;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:qr(t)),u=l;return l};lt();const Re={http:nr,xhr:Ur,fetch:{get:lt}};a.forEach(Re,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const He=e=>`- ${e}`,Mr=e=>a.isFunction(e)||e===null||e===!1;function zr(e,t){e=a.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let c;if(o=n,!Mr(n)&&(o=Re[(c=String(n)).toLowerCase()],o===void 0))throw new m(`Unknown adapter '${c}'`);if(o&&(a.isFunction(o)||(o=o.get(t))))break;i[c||"#"+s]=o}if(!o){const s=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=r?s.length>1?`since :
|
|
4
|
+
`+s.map(He).join(`
|
|
5
|
+
`):" "+He(s[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return o}const ut={getAdapter:zr,adapters:Re};function de(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new V(null,e)}function Je(e){return de(e),e.headers=A.from(e.headers),e.data=fe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ut.getAdapter(e.adapter||W.adapter,e)(e).then(function(t){return de(e),t.data=fe.call(e,e.transformResponse,t),t.headers=A.from(t.headers),t},function(t){return st(t)||(de(e),t&&t.response&&(t.response.data=fe.call(e,e.transformResponse,t.response),t.response.headers=A.from(t.response.headers))),Promise.reject(t)})}const ft="1.13.6",se={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{se[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};se.transitional=function(e,t,r){function n(o,i){return"[Axios v"+ft+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,s)=>{if(e===!1)throw new m(n(i," has been removed"+(t?" in "+t:"")),m.ERR_DEPRECATED);return t&&!We[i]&&(We[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,i,s):!0}};se.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Hr(e,t,r){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const c=e[i],f=c===void 0||s(c,i,e);if(f!==!0)throw new m("option "+i+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const Z={assertOptions:Hr,validators:se},C=Z.validators;let L=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ue,response:new Ue}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const o=n.stack?n.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
+
`+o):r.stack=o}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=D(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;r!==void 0&&Z.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean),legacyInterceptorReqResOrdering:C.transitional(C.boolean)},!1),n!=null&&(a.isFunction(n)?t.paramsSerializer={serialize:n}:Z.assertOptions(n,{encode:C.function,serialize:C.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Z.assertOptions(t,{baseUrl:C.spelling("baseURL"),withXsrfToken:C.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[t.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),t.headers=A.concat(i,o);const s=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(t)===!1)return;c=c&&h.synchronous;const p=t.transitional||we;p&&p.legacyInterceptorReqResOrdering?s.unshift(h.fulfilled,h.rejected):s.push(h.fulfilled,h.rejected)});const f=[];this.interceptors.response.forEach(function(h){f.push(h.fulfilled,h.rejected)});let l,u=0,b;if(!c){const h=[Je.bind(this),void 0];for(h.unshift(...s),h.push(...f),b=h.length,l=Promise.resolve(t);u<b;)l=l.then(h[u++],h[u++]);return l}b=s.length;let g=t;for(;u<b;){const h=s[u++],p=s[u++];try{g=h(g)}catch(d){p.call(this,d);break}}try{l=Je.call(this,g)}catch(h){return Promise.reject(h)}for(u=0,b=f.length;u<b;)l=l.then(f[u++],f[u++]);return l}getUri(e){e=D(this.defaults,e);const t=at(e.baseURL,e.url,e.allowAbsoluteUrls);return nt(t,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){L.prototype[e]=function(t,r){return this.request(D(r||{},{method:e,url:t,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(e){function t(r){return function(n,o,i){return this.request(D(i||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}L.prototype[e]=t(),L.prototype[e+"Form"]=t(!0)});let Jr=class dt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(c=>{n.subscribe(c),i=c}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(o,i,s){n.reason||(n.reason=new V(o,i,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new dt(function(r){t=r}),cancel:t}}};function Wr(e){return function(t){return e.apply(null,t)}}function Vr(e){return a.isObject(e)&&e.isAxiosError===!0}const be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(be).forEach(([e,t])=>{be[t]=e});function pt(e){const t=new L(e),r=Ve(L.prototype.request,t);return a.extend(r,L.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return pt(D(e,n))},r}const y=pt(W);y.Axios=L;y.CanceledError=V;y.CancelToken=Jr;y.isCancel=st;y.VERSION=ft;y.toFormData=oe;y.AxiosError=m;y.Cancel=y.CanceledError;y.all=function(e){return Promise.all(e)};y.spread=Wr;y.isAxiosError=Vr;y.mergeConfig=D;y.AxiosHeaders=A;y.formToJSON=e=>ot(a.isHTMLForm(e)?new FormData(e):e);y.getAdapter=ut.getAdapter;y.HttpStatusCode=be;y.default=y;const{Axios:$r,AxiosError:Kr,CanceledError:Xr,isCancel:Qr,CancelToken:Gr,VERSION:Yr,all:Zr,Cancel:en,isAxiosError:tn,spread:rn,toFormData:nn,AxiosHeaders:on,HttpStatusCode:sn,formToJSON:an,getAdapter:cn,mergeConfig:ln}=y;export{$r as Axios,Kr as AxiosError,on as AxiosHeaders,en as Cancel,Gr as CancelToken,Xr as CanceledError,sn as HttpStatusCode,Yr as VERSION,Zr as all,y as default,an as formToJSON,cn as getAdapter,tn as isAxiosError,Qr as isCancel,ln as mergeConfig,rn as spread,nn as toFormData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,H as P,L as $,cG as W,ar as k,k as l,y as B,aP as D,ao as H,aQ as M,cI as U,ch as G,ae as N,cN as _}from"./index-nhNM5UeG.js";import{e as A}from"./InputInstructions-UPXPLzmg-Q7bu80af.js";import{S as K}from"./useBasicWidgetState-BYeS5Lnw-COvJBdtg.js";import{v as O,a as Q,c as Z}from"./useUpdateUiValue-DDoOKBFH-DrpUtoEl.js";import{u as q}from"./uniqueId-CWWNkcH4-CJJowNJ2.js";import{a as J}from"./input-BZGQFBY5-B-EqzVpf.js";import"./FormClearHelper-XrLdNEJa-DVEjd1cV.js";import"./inputUtils-DCYiajnz-DsrlAoKH.js";import"./base-input-BPl9JMAl-yC1GT4Gd.js";const X=B("div",{target:"e11y4ecf0"})({name:"bjn8wh",styles:"position:relative"});function Y({disabled:o,element:e,widgetMgr:r,fragmentId:d}){const[s,c]=a.useState(()=>S(r,e)??null),{width:I,elementRef:y}=P(),[i,p]=a.useState(!1),C=a.useCallback(()=>{c(e.default??null),p(!0)},[e.default]),[T,g]=K({getStateFromWidgetMgr:S,getDefaultStateFromProto:ee,getCurrStateFromProto:te,updateWidgetMgrState:oe,element:e,widgetMgr:r,fragmentId:d,onFormCleared:C});O(T,s,c,i);const[v,h]=a.useState(!1),t=$(),[b]=a.useState(()=>q("text_input_")),{placeholder:R,formId:n,icon:u,maxChars:x}=e,f=a.useCallback(()=>{p(!1),g({value:s,fromUi:!0})},[s,g]),E=W({formId:n})?r.allowFormEnterToSubmit(n):i,F=v&&I>k(t.breakpoints.hideWidgetDetails),L=a.useCallback(()=>{i&&f(),h(!1)},[i,f]),V=a.useCallback(()=>{h(!0)},[]),j=Q({formId:n,maxChars:x,setDirty:p,setUiValue:c,setValueWithSource:g}),z=Z(n,f,i,r,d);return l.jsxs(X,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[l.jsx(D,{label:e.label,disabled:o,labelVisibility:H(e.labelVisibility?.value),htmlFor:b,children:e.help&&l.jsx(M,{content:e.help,label:e.label})}),l.jsx(J,{value:s??"",placeholder:R,onBlur:L,onFocus:V,onChange:j,onKeyPress:z,"aria-label":e.label,disabled:o,id:b,type:ae(e),autoComplete:e.autocomplete,startEnhancer:u&&l.jsx(N,{"data-testid":"stTextInputIcon",iconValue:u,size:"lg"}),overrides:{Input:{style:{fontWeight:t.fontWeights.normal,minWidth:0,lineHeight:t.lineHeights.inputWidget,paddingRight:t.spacing.sm,paddingLeft:t.spacing.md,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,"::placeholder":{color:t.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:({$isFocused:w})=>{const m=G(t.colors,w);return{height:t.sizes.minElementHeight,borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth,borderTopColor:m,borderRightColor:m,borderBottomColor:m,borderLeftColor:m,paddingLeft:u?t.spacing.sm:0}}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:t.iconSizes.lg,color:U(u)?t.colors.fadedText60:"inherit"}}}}),F&&l.jsx(A,{dirty:i,value:s??"",maxLength:x,inForm:W({formId:n}),allowEnterToSubmit:E})]})}function S(o,e){return o.getStringValue(e)??null}function ee(o){return o.default??null}function te(o){return o.value??null}function oe(o,e,r,d){e.setStringValue(o,r.value,{fromUi:r.fromUi},d)}function ae(o){return o.type===_.Type.PASSWORD?"password":"text"}const pe=a.memo(Y);export{pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,ag as s,k as i,ah as v,ai as x,aj as C,ak as d,al as y,y as c,am as l,af as B}from"./index-nhNM5UeG.js";import{s as S}from"./iconPosition-D6yC8Xnj-BF1h45AJ.js";function R(o,e){switch(o){case d.XSMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.sm}`,fontSize:e.fontSizes.sm};case d.SMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.md}`};case d.LARGE:return{padding:`${e.spacing.md} ${e.spacing.md}`};default:return{padding:`${e.spacing.xs} ${e.spacing.md}`}}}const p=c("a",{target:"e16zdaao3"})(({containerWidth:o,size:e,theme:r})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,borderRadius:r.radii.button,minHeight:r.sizes.minElementHeight,margin:0,lineHeight:r.lineHeights.base,color:r.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:r.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:B(r)},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...R(e,r)}),""),$=c(p,{target:"e16zdaao2"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover, &:focus-visible":{backgroundColor:l(o.colors.primary,.15),borderColor:l(o.colors.primary,.15)},"&:active":{backgroundColor:o.colors.primary,borderColor:l(o.colors.primary,.15)},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}),""),z=c(p,{target:"e16zdaao1"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}),""),w=c(p,{target:"e16zdaao0"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{color:o.colors.primary},"&:hover:not([disabled]), &:focus-visible:not([disabled])":{"span.stMarkdownColoredText":{color:"inherit !important"}},"&:active":{color:l(o.colors.primary,.25)},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}),""),m=t.forwardRef(function({kind:o,size:e,disabled:r,children:a,autoFocus:n,href:u,rel:b,target:g,onClick:f},k){let h=$;return o===s.SECONDARY?h=z:o===s.TERTIARY&&(h=w),i.jsx(h,{ref:k,kind:o,size:e||d.MEDIUM,containerWidth:!0,disabled:r||!1,autoFocus:n||!1,href:u,target:g,rel:b,onClick:f,tabIndex:r?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:a})});m.displayName="BaseLinkButton";const L=t.memo(m);function T(o){const{element:e}=o,r=e.shortcut?e.shortcut:void 0;let a=s.SECONDARY;e.type==="primary"?a=s.PRIMARY:e.type==="tertiary"&&(a=s.TERTIARY);const n=t.useRef(null),u=t.useCallback(()=>{e.disabled||n.current?.click()},[e.disabled]),b=t.useCallback(g=>{e.disabled&&g.preventDefault()},[e.disabled]);return v({shortcut:r,disabled:e.disabled,onActivate:u}),i.jsx(x,{className:"stLinkButton","data-testid":"stLinkButton",children:i.jsx(C,{help:e.help,containerWidth:!0,children:i.jsx(L,{ref:n,kind:a,size:d.SMALL,disabled:e.disabled,onClick:b,href:e.url,target:"_blank",rel:"noreferrer","aria-disabled":e.disabled,children:i.jsx(y,{icon:e.icon,iconPosition:S(e.iconPosition),label:e.label,shortcut:r})})})})}const E=t.memo(T);export{E as default};
|