UNPKG

6.16 kBJavaScriptView Raw
1import{z as e,i as t,_ as o,s as i,x as l,t as n,y as s}from"./styles-ChWDJ3ue.js";const a=s`
2 <svg
3 version="1.1"
4 id="Capa_1"
5 xmlns="http://www.w3.org/2000/svg"
6 xmlns:xlink="http://www.w3.org/1999/xlink"
7 x="0px"
8 y="0px"
9 viewBox="0 0 510.322 510.322"
10 xml:space="preserve"
11 style="width: 28px; vertical-align: middle;"
12 >
13 <g>
14 <path
15 style="fill:currentColor;"
16 d="M429.064,159.505c0-0.151,0.086-1.057,0.086-1.057c0-75.282-61.261-136.521-136.543-136.521 c-52.244,0-97.867,30.587-120.753,76.339c-11.67-9.081-25.108-15.682-40.273-15.682c-37.166,0-67.387,30.199-67.387,67.387 c0,0,0.453,3.279,0.798,5.824C27.05,168.716,0,203.423,0,244.516c0,25.389,9.901,49.268,27.848,67.171 c17.968,17.99,41.804,27.869,67.193,27.869h130.244v46.83h-54.66l97.694,102.008l95.602-102.008h-54.66v-46.83H419.25 c50.174,0,91.072-40.855,91.072-90.986C510.3,201.827,474.428,164.639,429.064,159.505z M419.207,312.744H309.26v-55.545h-83.975 v55.545H95.019c-18.184,0-35.333-7.075-48.211-19.996c-12.878-12.878-19.953-30.005-19.953-48.189 c0-32.68,23.21-60.808,55.264-66.956l12.511-2.394l-2.092-14.431l-1.488-10.785c0-22.347,18.184-40.51,40.531-40.51 c13.266,0,25.691,6.514,33.305,17.408l15.229,21.873l8.52-25.303c15.013-44.652,56.796-74.656,103.906-74.656 c60.506,0,109.709,49.203,109.709,109.644l-1.337,25.712l15.121,0.302l3.149-0.086c35.419,0,64.216,28.797,64.216,64.216 C483.401,283.969,454.604,312.744,419.207,312.744z"
17 />
18 </g>
19 </svg>
20`;let r=class extends i{render(){const e=(()=>{var e,t;const o=window.navigator.userAgent,i=(null===(t=null===(e=window.navigator)||void 0===e?void 0:e.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform;return-1!==["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(i)?"Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(i)?"iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(i)?"Windows":/Android/.test(o)?"Android":/Linux/.test(i)?"Linux":null})();return l`
21 <ew-dialog open @closed=${this._handleClose}>
22 <div slot="headline">No port selected</div>
23 <div slot="content">
24 <div>
25 If you didn't select a port because you didn't see your device
26 listed, try the following steps:
27 </div>
28 <ol>
29 <li>
30 Make sure that the device is connected to this computer (the one
31 that runs the browser that shows this website)
32 </li>
33 <li>
34 Most devices have a tiny light when it is powered on. If yours has
35 one, make sure it is on.
36 </li>
37 <li>
38 Make sure that the USB cable you use can be used for data and is
39 not a power-only cable.
40 </li>
41 ${"Linux"===e?l`
42 <li>
43 If you are using a Linux flavor, make sure that your user is
44 part of the <code>dialout</code> group so it has permission
45 to access the device.
46 <code class="block"
47 >sudo usermod -a -G dialout YourUserName</code
48 >
49 You may need to log out & back in or reboot to activate the
50 new group access.
51 </li>
52 `:""}
53 <li>
54 Make sure you have the right drivers installed. Below are the
55 drivers for common chips used in ESP devices:
56 <ul>
57 <li>
58 CP2102 drivers:
59 <a
60 href="https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers"
61 target="_blank"
62 rel="noopener"
63 >Windows & Mac</a
64 >
65 </li>
66 <li>
67 CH342, CH343, CH9102 drivers:
68 <a
69 href="https://www.wch.cn/downloads/CH343SER_ZIP.html"
70 target="_blank"
71 rel="noopener"
72 >Windows</a
73 >,
74 <a
75 href="https://www.wch.cn/downloads/CH34XSER_MAC_ZIP.html"
76 target="_blank"
77 rel="noopener"
78 >Mac</a
79 >
80 <br />
81 (download via blue button with ${a} icon)
82 </li>
83 <li>
84 CH340, CH341 drivers:
85 <a
86 href="https://www.wch.cn/downloads/CH341SER_ZIP.html"
87 target="_blank"
88 rel="noopener"
89 >Windows</a
90 >,
91 <a
92 href="https://www.wch.cn/downloads/CH341SER_MAC_ZIP.html"
93 target="_blank"
94 rel="noopener"
95 >Mac</a
96 >
97 <br />
98 (download via blue button with ${a} icon)
99 </li>
100 </ul>
101 </li>
102 </ol>
103 </div>
104 <div slot="actions">
105 ${this.doTryAgain?l`
106 <ew-text-button @click=${this.close}>Cancel</ew-text-button>
107 <ew-text-button @click=${this.tryAgain}>
108 Try Again
109 </ew-text-button>
110 `:l`
111 <ew-text-button @click=${this.close}>Close</ew-text-button>
112 `}
113 </div>
114 </ew-dialog>
115 `}tryAgain(){var e;this.close(),null===(e=this.doTryAgain)||void 0===e||e.call(this)}close(){this.shadowRoot.querySelector("ew-dialog").close()}async _handleClose(){this.parentNode.removeChild(this)}};r.styles=[e,t`
116 li + li,
117 li > ul {
118 margin-top: 8px;
119 }
120 ul,
121 ol {
122 margin-bottom: 0;
123 padding-left: 1.5em;
124 }
125 li code.block {
126 display: block;
127 margin: 0.5em 0;
128 }
129 `],r=o([n("ewt-no-port-picked-dialog")],r);const d=async e=>{const t=document.createElement("ewt-no-port-picked-dialog");return t.doTryAgain=e,document.body.append(t),!0};export{d as openNoPortPickedDialog};