@bigbinary/neeto-github-frontend 1.0.7 → 1.0.8

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/dist/index.cjs.js CHANGED
@@ -3,114 +3,553 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var neetoCist = require('@bigbinary/neeto-cist');
7
- var neetoui = require('@bigbinary/neetoui');
8
- var reactI18next = require('react-i18next');
9
- var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
10
- var require$$0 = require('util');
11
6
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
12
7
  var neetoIcons = require('@bigbinary/neeto-icons');
8
+ var neetoui = require('@bigbinary/neetoui');
13
9
  var misc = require('@bigbinary/neeto-icons/misc');
14
10
  var classNames = require('classnames');
11
+ var neetoCist = require('@bigbinary/neeto-cist');
15
12
  var Search = require('@bigbinary/neeto-molecules/Search');
13
+ var reactI18next = require('react-i18next');
16
14
  var Scrollable = require('@bigbinary/neeto-molecules/Scrollable');
17
15
  var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
16
+ var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
17
+ var require$$0 = require('util');
18
18
 
19
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
20
 
21
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
- var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
23
22
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
24
23
  var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
25
24
  var Scrollable__default = /*#__PURE__*/_interopDefaultLegacy(Scrollable);
26
25
  var DateFormat__default = /*#__PURE__*/_interopDefaultLegacy(DateFormat);
26
+ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
27
27
 
28
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
29
-
30
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
31
- var shams = function hasSymbols() {
32
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
33
- if (typeof Symbol.iterator === 'symbol') { return true; }
34
-
35
- var obj = {};
36
- var sym = Symbol('test');
37
- var symObj = Object(sym);
38
- if (typeof sym === 'string') { return false; }
39
-
40
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
41
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
42
-
43
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
44
- // if (sym instanceof Symbol) { return false; }
45
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
46
- // if (!(symObj instanceof Symbol)) { return false; }
47
-
48
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
49
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
50
-
51
- var symVal = 42;
52
- obj[sym] = symVal;
53
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
54
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
55
-
56
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
57
-
58
- var syms = Object.getOwnPropertySymbols(obj);
59
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
60
-
61
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
62
-
63
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
64
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
65
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
66
- }
67
-
68
- return true;
69
- };
28
+ var Configure = reactUtils.withT(function (_ref) {
29
+ var t = _ref.t,
30
+ isConnected = _ref.isConnected,
31
+ installationUrl = _ref.installationUrl;
32
+ return /*#__PURE__*/React__default["default"].createElement("div", {
33
+ className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
34
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
35
+ className: "mt-1 text-indigo-600 xl:mt-3",
36
+ href: installationUrl,
37
+ icon: isConnected ? neetoIcons.Settings : neetoIcons.Plus,
38
+ iconPosition: "left",
39
+ iconSize: 20,
40
+ size: "small",
41
+ style: "text"
42
+ }, isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")));
43
+ });
70
44
 
71
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
72
- var hasSymbolSham = shams;
45
+ var Header = reactUtils.withT(function (_ref) {
46
+ var t = _ref.t;
47
+ return /*#__PURE__*/React__default["default"].createElement("div", {
48
+ className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased"
49
+ }, /*#__PURE__*/React__default["default"].createElement(misc.Github, {
50
+ size: 16
51
+ }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
52
+ style: "h4"
53
+ }, t("neetoGithub.github")));
54
+ });
73
55
 
74
- var hasSymbols$1 = function hasNativeSymbols() {
75
- if (typeof origSymbol !== 'function') { return false; }
76
- if (typeof Symbol !== 'function') { return false; }
77
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
78
- if (typeof Symbol('bar') !== 'symbol') { return false; }
56
+ var List$1 = reactUtils.withT(function (_ref) {
57
+ var t = _ref.t,
58
+ accounts = _ref.accounts;
59
+ return accounts.map(function (_ref2) {
60
+ var id = _ref2.id,
61
+ name = _ref2.name,
62
+ avatarUrl = _ref2.avatarUrl,
63
+ type = _ref2.type,
64
+ profileUrl = _ref2.profileUrl,
65
+ count = _ref2.count;
66
+ return /*#__PURE__*/React__default["default"].createElement("div", {
67
+ className: "neeto-ui-border-gray-300 flex w-full items-center space-x-2 border-b border-l-0 border-r-0 border-t-0 border-solid p-2",
68
+ key: id
69
+ }, type === "Organization" ? /*#__PURE__*/React__default["default"].createElement(neetoIcons.Building, {
70
+ className: "neeto-ui-text-gray-600",
71
+ size: 16
72
+ }) : /*#__PURE__*/React__default["default"].createElement(neetoIcons.User, {
73
+ className: "neeto-ui-text-gray-600",
74
+ size: 16
75
+ }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
76
+ className: "neeto-ui-text-gray-900",
77
+ style: "body2"
78
+ }, "@", name), /*#__PURE__*/React__default["default"].createElement("img", {
79
+ alt: name,
80
+ className: "neeto-ui-rounded-full h-4 w-4",
81
+ src: avatarUrl
82
+ }), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
83
+ className: "text-indigo-600",
84
+ icon: neetoIcons.CannedResponses,
85
+ iconPosition: "left",
86
+ iconSize: 16,
87
+ size: "small",
88
+ style: "text",
89
+ onClick: function onClick() {
90
+ return window.open(profileUrl, "_blank");
91
+ }
92
+ }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
93
+ className: "neeto-ui-text-gray-900 mx-2 text-sm",
94
+ component: "span",
95
+ style: "h3"
96
+ }, "\u2022"), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
97
+ style: "body2"
98
+ }, t("neetoGithub.countOf.repos", {
99
+ count: count
100
+ })));
101
+ });
102
+ });
79
103
 
80
- return hasSymbolSham();
104
+ var Accounts = function Accounts(_ref) {
105
+ var isPane = _ref.isPane,
106
+ accounts = _ref.accounts,
107
+ isConnected = _ref.isConnected,
108
+ onConnect = _ref.onConnect,
109
+ installationUrl = _ref.installationUrl;
110
+ return /*#__PURE__*/React__default["default"].createElement("div", {
111
+ className: classNames__default["default"]("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
112
+ "2xl:max-w-sm 2xl:px-8": isPane,
113
+ "xl:max-w-sm xl:px-8": !isPane
114
+ })
115
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
116
+ className: "mb-2"
117
+ }, /*#__PURE__*/React__default["default"].createElement(Header, null), /*#__PURE__*/React__default["default"].createElement(List$1, {
118
+ accounts: accounts,
119
+ isConnected: isConnected
120
+ }), /*#__PURE__*/React__default["default"].createElement(Configure, {
121
+ installationUrl: installationUrl,
122
+ isConnected: isConnected,
123
+ onConnect: onConnect
124
+ })));
81
125
  };
82
126
 
83
- var test = {
84
- foo: {}
85
- };
127
+ function _arrayWithHoles(arr) {
128
+ if (Array.isArray(arr)) return arr;
129
+ }
86
130
 
87
- var $Object = Object;
131
+ function _iterableToArrayLimit(arr, i) {
132
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
133
+ if (null != _i) {
134
+ var _s,
135
+ _e,
136
+ _x,
137
+ _r,
138
+ _arr = [],
139
+ _n = !0,
140
+ _d = !1;
141
+ try {
142
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
143
+ if (Object(_i) !== _i) return;
144
+ _n = !1;
145
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
146
+ } catch (err) {
147
+ _d = !0, _e = err;
148
+ } finally {
149
+ try {
150
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
151
+ } finally {
152
+ if (_d) throw _e;
153
+ }
154
+ }
155
+ return _arr;
156
+ }
157
+ }
88
158
 
89
- var hasProto$1 = function hasProto() {
90
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
91
- };
159
+ function _arrayLikeToArray(arr, len) {
160
+ if (len == null || len > arr.length) len = arr.length;
161
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
162
+ return arr2;
163
+ }
92
164
 
93
- /* eslint no-invalid-this: 1 */
165
+ function _unsupportedIterableToArray(o, minLen) {
166
+ if (!o) return;
167
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
168
+ var n = Object.prototype.toString.call(o).slice(8, -1);
169
+ if (n === "Object" && o.constructor) n = o.constructor.name;
170
+ if (n === "Map" || n === "Set") return Array.from(o);
171
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
172
+ }
94
173
 
95
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
96
- var toStr$1 = Object.prototype.toString;
97
- var max = Math.max;
98
- var funcType = '[object Function]';
174
+ function _nonIterableRest() {
175
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
176
+ }
99
177
 
100
- var concatty = function concatty(a, b) {
101
- var arr = [];
178
+ function _slicedToArray(arr, i) {
179
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
180
+ }
102
181
 
103
- for (var i = 0; i < a.length; i += 1) {
104
- arr[i] = a[i];
105
- }
106
- for (var j = 0; j < b.length; j += 1) {
107
- arr[j + a.length] = b[j];
182
+ var NoRepositories = reactUtils.withT(function (_ref) {
183
+ var t = _ref.t,
184
+ installationUrl = _ref.installationUrl,
185
+ troubleshootUrl = _ref.troubleshootUrl;
186
+ return /*#__PURE__*/React__default["default"].createElement("div", {
187
+ className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
188
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
189
+ style: "body2"
190
+ }, t("neetoGithub.noReposDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
191
+ href: installationUrl,
192
+ icon: misc.Github,
193
+ iconPosition: "left",
194
+ label: t("neetoGithub.connectRepository"),
195
+ size: "medium",
196
+ style: "primary"
197
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
198
+ className: "text-xs"
199
+ }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
200
+ i18nKey: "troubleshoot",
201
+ components: {
202
+ troubleshootLink: /*#__PURE__*/React__default["default"].createElement("a", {
203
+ className: "text-indigo-600 underline",
204
+ href: troubleshootUrl,
205
+ rel: "noopener noreferrer",
206
+ target: "_blank"
207
+ })
108
208
  }
209
+ })));
210
+ });
109
211
 
110
- return arr;
111
- };
112
-
113
- var slicy = function slicy(arrLike, offset) {
212
+ var RepositoryTile = function RepositoryTile(_ref) {
213
+ var onConnect = _ref.onConnect,
214
+ repository = _ref.repository;
215
+ var _useTranslation = reactI18next.useTranslation(),
216
+ t = _useTranslation.t;
217
+ var id = repository.id,
218
+ fullName = repository.fullName,
219
+ isPrivate = repository.isPrivate,
220
+ updatedAt = repository.updatedAt;
221
+ return /*#__PURE__*/React__default["default"].createElement("div", {
222
+ className: "neeto-ui-border-gray-300 flex items-center justify-between border-b border-l-0 border-r-0 border-t-0 border-solid py-3 pl-5 pr-3",
223
+ key: id
224
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
225
+ className: "width-calc flex items-center space-x-2"
226
+ }, /*#__PURE__*/React__default["default"].createElement(misc.Github, {
227
+ size: 16
228
+ }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
229
+ style: "body2"
230
+ }, fullName), isPrivate && /*#__PURE__*/React__default["default"].createElement(neetoIcons.Lock, {
231
+ size: 16
232
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
233
+ className: "hidden md:inline-block"
234
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
235
+ className: "neeto-ui-text-gray-900 mx-2 text-sm",
236
+ component: "span",
237
+ style: "h3"
238
+ }, "\u2022"), /*#__PURE__*/React__default["default"].createElement(DateFormat__default["default"].FromNow, {
239
+ date: updatedAt
240
+ }))), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
241
+ style: "primary",
242
+ type: "button",
243
+ onClick: function onClick() {
244
+ return onConnect({
245
+ repoType: "private",
246
+ repository: repository
247
+ });
248
+ }
249
+ }, t("neetoGithub.connect")));
250
+ };
251
+
252
+ var List = reactUtils.withT(function (_ref) {
253
+ var t = _ref.t,
254
+ isPublicRepoAllowed = _ref.isPublicRepoAllowed,
255
+ filteredRepositories = _ref.filteredRepositories,
256
+ repositories = _ref.repositories,
257
+ onConnect = _ref.onConnect,
258
+ installationUrl = _ref.installationUrl,
259
+ troubleshootUrl = _ref.troubleshootUrl;
260
+ return /*#__PURE__*/React__default["default"].createElement("div", {
261
+ className: classNames__default["default"]("neeto-ui-border-gray-300 neeto-ui-rounded-md m-0 flex flex-col items-center justify-center border border-solid p-0 2xl:h-96", {
262
+ "h-52": isPublicRepoAllowed,
263
+ "h-72": !isPublicRepoAllowed
264
+ })
265
+ }, neetoCist.isPresent(repositories) ? /*#__PURE__*/React__default["default"].createElement(Scrollable__default["default"], {
266
+ className: "m-0 h-full w-full overflow-y-scroll p-0 shadow-inner"
267
+ }, neetoCist.isPresent(filteredRepositories) ? filteredRepositories.map(function (repository) {
268
+ return /*#__PURE__*/React__default["default"].createElement(RepositoryTile, {
269
+ onConnect: onConnect,
270
+ repository: repository
271
+ });
272
+ }) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
273
+ className: "flex h-full w-full items-center justify-center",
274
+ style: "body2"
275
+ }, t("neetoGithub.noRepos"))) : /*#__PURE__*/React__default["default"].createElement(NoRepositories, {
276
+ installationUrl: installationUrl,
277
+ troubleshootUrl: troubleshootUrl
278
+ }));
279
+ });
280
+
281
+ var NotConnected = reactUtils.withT(function (_ref) {
282
+ var t = _ref.t,
283
+ installationUrl = _ref.installationUrl;
284
+ return /*#__PURE__*/React__default["default"].createElement("div", {
285
+ className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
286
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
287
+ style: "body2"
288
+ }, t("neetoGithub.notConnectedDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
289
+ href: installationUrl,
290
+ icon: misc.Github,
291
+ iconPosition: "left",
292
+ label: t("neetoGithub.connectGithub"),
293
+ size: "medium",
294
+ style: "primary"
295
+ }));
296
+ });
297
+
298
+ var Private = function Private(_ref) {
299
+ var isConnected = _ref.isConnected,
300
+ isPublicRepoAllowed = _ref.isPublicRepoAllowed,
301
+ repositories = _ref.repositories,
302
+ onConnect = _ref.onConnect,
303
+ installationUrl = _ref.installationUrl,
304
+ troubleshootUrl = _ref.troubleshootUrl;
305
+ var _useTranslation = reactI18next.useTranslation(),
306
+ t = _useTranslation.t;
307
+ var _useState = React.useState(repositories),
308
+ _useState2 = _slicedToArray(_useState, 2),
309
+ filteredRepositories = _useState2[0],
310
+ setFilteredRepositories = _useState2[1];
311
+ var onSearch = function onSearch(searchTerm) {
312
+ if (!neetoCist.isPresent(searchTerm)) {
313
+ setFilteredRepositories(repositories);
314
+ return;
315
+ }
316
+ var filteredRepositories = repositories.filter(function (_ref2) {
317
+ var fullName = _ref2.fullName;
318
+ return fullName.toLowerCase().includes(searchTerm.toLowerCase());
319
+ });
320
+ setFilteredRepositories(filteredRepositories);
321
+ };
322
+ return /*#__PURE__*/React__default["default"].createElement("div", {
323
+ className: "connect-repo neeto-ui-rounded-md neeto-ui-border-gray-300 border border-solid px-8 py-7"
324
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
325
+ className: "mb-2 pb-5 text-lg font-medium",
326
+ style: "h2"
327
+ }, t("neetoGithub.connectARepo")), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
328
+ className: "flex w-full flex-col space-y-6"
329
+ }, /*#__PURE__*/React__default["default"].createElement(Search__default["default"], {
330
+ onSearch: onSearch,
331
+ className: "w-full",
332
+ suffix: /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
333
+ style: "body2"
334
+ }, t("neetoGithub.countOf.repos", {
335
+ count: filteredRepositories.length
336
+ }))
337
+ }), /*#__PURE__*/React__default["default"].createElement(List, {
338
+ isPublicRepoAllowed: isPublicRepoAllowed,
339
+ filteredRepositories: filteredRepositories,
340
+ installationUrl: installationUrl,
341
+ onConnect: onConnect,
342
+ repositories: repositories,
343
+ troubleshootUrl: troubleshootUrl
344
+ })) : /*#__PURE__*/React__default["default"].createElement("div", {
345
+ className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
346
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
347
+ className: "neeto-ui-rounded-md neeto-ui-border-gray-300 m-0 flex h-[366px] flex-col items-center justify-center border border-solid p-4 shadow-inner"
348
+ }, /*#__PURE__*/React__default["default"].createElement(NotConnected, {
349
+ installationUrl: installationUrl
350
+ }))));
351
+ };
352
+
353
+ var Public = function Public(_ref) {
354
+ var onConnect = _ref.onConnect;
355
+ var _useTranslation = reactI18next.useTranslation(),
356
+ t = _useTranslation.t;
357
+ var _useState = React.useState(""),
358
+ _useState2 = _slicedToArray(_useState, 2),
359
+ publicRepoUrl = _useState2[0],
360
+ setPublicRepoUrl = _useState2[1];
361
+ return /*#__PURE__*/React__default["default"].createElement("div", {
362
+ className: "transition-drop-shadow neeto-ui-border-gray-300 neeto-ui-rounded-md border border-solid px-8 py-7 font-sans transition-colors"
363
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
364
+ className: "mb-2 pb-5"
365
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
366
+ className: "flex justify-between"
367
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
368
+ className: "pr-4"
369
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
370
+ className: "text-lg font-medium",
371
+ style: "h2"
372
+ }, t("neetoGithub.publicGitRepo")), /*#__PURE__*/React__default["default"].createElement("div", {
373
+ className: "neeto-ui-text-gray-900 mt-2 flex max-w-xl space-x-1 font-sans text-sm font-normal leading-6 antialiased"
374
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
375
+ style: "body2"
376
+ }, t("neetoGithub.publicGitRepoDescription")))))), /*#__PURE__*/React__default["default"].createElement("div", {
377
+ className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
378
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
379
+ className: "flex"
380
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
381
+ className: "z-0 flex-1"
382
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
383
+ className: "w-full"
384
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Input, {
385
+ nakedInput: true,
386
+ autocomplete: "false",
387
+ className: "relative rounded-b rounded-l rounded-r-none rounded-t border-b border-l border-r-0 border-t border-solid px-2",
388
+ placeholder: t("neetoGithub.publicGitRepoPlaceholder"),
389
+ size: "large",
390
+ spellcheck: "false",
391
+ type: "text",
392
+ value: publicRepoUrl,
393
+ onChange: function onChange(e) {
394
+ return setPublicRepoUrl(e.target.value);
395
+ }
396
+ }))), /*#__PURE__*/React__default["default"].createElement("div", {
397
+ className: "relative"
398
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
399
+ className: "rounded-b rounded-l-none rounded-r rounded-t",
400
+ disabled: !neetoCist.isPresent(publicRepoUrl),
401
+ size: "large",
402
+ style: "primary",
403
+ type: "button",
404
+ onClick: function onClick() {
405
+ return onConnect({
406
+ repoType: "public",
407
+ repository: {
408
+ fullName: publicRepoUrl
409
+ }
410
+ });
411
+ }
412
+ }, t("neetoGithub.continue"))))));
413
+ };
414
+
415
+ var Repositories = function Repositories(_ref) {
416
+ var isConnected = _ref.isConnected,
417
+ isPublicRepoAllowed = _ref.isPublicRepoAllowed,
418
+ repositories = _ref.repositories,
419
+ onConnect = _ref.onConnect,
420
+ installationUrl = _ref.installationUrl,
421
+ troubleshootUrl = _ref.troubleshootUrl;
422
+ return /*#__PURE__*/React__default["default"].createElement("div", {
423
+ className: "w-full space-y-6"
424
+ }, /*#__PURE__*/React__default["default"].createElement(Private, {
425
+ isPublicRepoAllowed: isPublicRepoAllowed,
426
+ installationUrl: installationUrl,
427
+ isConnected: isConnected,
428
+ onConnect: onConnect,
429
+ repositories: repositories,
430
+ troubleshootUrl: troubleshootUrl
431
+ }), isPublicRepoAllowed && /*#__PURE__*/React__default["default"].createElement(Public, {
432
+ onConnect: onConnect
433
+ }));
434
+ };
435
+
436
+ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
437
+ var _ref$accounts = _ref.accounts,
438
+ accounts = _ref$accounts === void 0 ? [] : _ref$accounts,
439
+ installationUrl = _ref.installationUrl,
440
+ isConnected = _ref.isConnected,
441
+ _ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
442
+ isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
443
+ onConnect = _ref.onConnect,
444
+ _ref$repositories = _ref.repositories,
445
+ repositories = _ref$repositories === void 0 ? [] : _ref$repositories,
446
+ troubleshootUrl = _ref.troubleshootUrl,
447
+ _ref$isPane = _ref.isPane,
448
+ isPane = _ref$isPane === void 0 ? false : _ref$isPane;
449
+ return /*#__PURE__*/React__default["default"].createElement("div", {
450
+ className: "flex w-full flex-col-reverse 2xl:flex-row"
451
+ }, /*#__PURE__*/React__default["default"].createElement(Repositories, {
452
+ installationUrl: installationUrl,
453
+ isConnected: isConnected,
454
+ isPublicRepoAllowed: isPublicRepoAllowed,
455
+ onConnect: onConnect,
456
+ repositories: repositories,
457
+ troubleshootUrl: troubleshootUrl
458
+ }), /*#__PURE__*/React__default["default"].createElement(Accounts, {
459
+ accounts: accounts,
460
+ installationUrl: installationUrl,
461
+ isConnected: isConnected,
462
+ onConnect: onConnect,
463
+ isPane: isPane
464
+ }));
465
+ };
466
+
467
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
468
+
469
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
470
+ var shams = function hasSymbols() {
471
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
472
+ if (typeof Symbol.iterator === 'symbol') { return true; }
473
+
474
+ var obj = {};
475
+ var sym = Symbol('test');
476
+ var symObj = Object(sym);
477
+ if (typeof sym === 'string') { return false; }
478
+
479
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
480
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
481
+
482
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
483
+ // if (sym instanceof Symbol) { return false; }
484
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
485
+ // if (!(symObj instanceof Symbol)) { return false; }
486
+
487
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
488
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
489
+
490
+ var symVal = 42;
491
+ obj[sym] = symVal;
492
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
493
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
494
+
495
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
496
+
497
+ var syms = Object.getOwnPropertySymbols(obj);
498
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
499
+
500
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
501
+
502
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
503
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
504
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
505
+ }
506
+
507
+ return true;
508
+ };
509
+
510
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
511
+ var hasSymbolSham = shams;
512
+
513
+ var hasSymbols$1 = function hasNativeSymbols() {
514
+ if (typeof origSymbol !== 'function') { return false; }
515
+ if (typeof Symbol !== 'function') { return false; }
516
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
517
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
518
+
519
+ return hasSymbolSham();
520
+ };
521
+
522
+ var test = {
523
+ foo: {}
524
+ };
525
+
526
+ var $Object = Object;
527
+
528
+ var hasProto$1 = function hasProto() {
529
+ return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
530
+ };
531
+
532
+ /* eslint no-invalid-this: 1 */
533
+
534
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
535
+ var toStr$1 = Object.prototype.toString;
536
+ var max = Math.max;
537
+ var funcType = '[object Function]';
538
+
539
+ var concatty = function concatty(a, b) {
540
+ var arr = [];
541
+
542
+ for (var i = 0; i < a.length; i += 1) {
543
+ arr[i] = a[i];
544
+ }
545
+ for (var j = 0; j < b.length; j += 1) {
546
+ arr[j + a.length] = b[j];
547
+ }
548
+
549
+ return arr;
550
+ };
551
+
552
+ var slicy = function slicy(arrLike, offset) {
114
553
  var arr = [];
115
554
  for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
116
555
  arr[j] = arrLike[i];
@@ -1941,787 +2380,348 @@ var stringify_1 = function (object, opts) {
1941
2380
  arrayFormat = opts.arrayFormat;
1942
2381
  } else if (opts && 'indices' in opts) {
1943
2382
  arrayFormat = opts.indices ? 'indices' : 'repeat';
1944
- } else {
1945
- arrayFormat = 'indices';
1946
- }
1947
-
1948
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
1949
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
1950
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
1951
- }
1952
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
1953
-
1954
- if (!objKeys) {
1955
- objKeys = Object.keys(obj);
1956
- }
1957
-
1958
- if (options.sort) {
1959
- objKeys.sort(options.sort);
1960
- }
1961
-
1962
- var sideChannel = getSideChannel();
1963
- for (var i = 0; i < objKeys.length; ++i) {
1964
- var key = objKeys[i];
1965
-
1966
- if (options.skipNulls && obj[key] === null) {
1967
- continue;
1968
- }
1969
- pushToArray(keys, stringify$1(
1970
- obj[key],
1971
- key,
1972
- generateArrayPrefix,
1973
- commaRoundTrip,
1974
- options.strictNullHandling,
1975
- options.skipNulls,
1976
- options.encode ? options.encoder : null,
1977
- options.filter,
1978
- options.sort,
1979
- options.allowDots,
1980
- options.serializeDate,
1981
- options.format,
1982
- options.formatter,
1983
- options.encodeValuesOnly,
1984
- options.charset,
1985
- sideChannel
1986
- ));
1987
- }
1988
-
1989
- var joined = keys.join(options.delimiter);
1990
- var prefix = options.addQueryPrefix === true ? '?' : '';
1991
-
1992
- if (options.charsetSentinel) {
1993
- if (options.charset === 'iso-8859-1') {
1994
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
1995
- prefix += 'utf8=%26%2310003%3B&';
1996
- } else {
1997
- // encodeURIComponent('✓')
1998
- prefix += 'utf8=%E2%9C%93&';
1999
- }
2000
- }
2001
-
2002
- return joined.length > 0 ? prefix + joined : '';
2003
- };
2004
-
2005
- var utils = utils$2;
2006
-
2007
- var has = Object.prototype.hasOwnProperty;
2008
- var isArray = Array.isArray;
2009
-
2010
- var defaults = {
2011
- allowDots: false,
2012
- allowPrototypes: false,
2013
- allowSparse: false,
2014
- arrayLimit: 20,
2015
- charset: 'utf-8',
2016
- charsetSentinel: false,
2017
- comma: false,
2018
- decoder: utils.decode,
2019
- delimiter: '&',
2020
- depth: 5,
2021
- ignoreQueryPrefix: false,
2022
- interpretNumericEntities: false,
2023
- parameterLimit: 1000,
2024
- parseArrays: true,
2025
- plainObjects: false,
2026
- strictNullHandling: false
2027
- };
2028
-
2029
- var interpretNumericEntities = function (str) {
2030
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
2031
- return String.fromCharCode(parseInt(numberStr, 10));
2032
- });
2033
- };
2034
-
2035
- var parseArrayValue = function (val, options) {
2036
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
2037
- return val.split(',');
2038
- }
2039
-
2040
- return val;
2041
- };
2042
-
2043
- // This is what browsers will submit when the ✓ character occurs in an
2044
- // application/x-www-form-urlencoded body and the encoding of the page containing
2045
- // the form is iso-8859-1, or when the submitted form has an accept-charset
2046
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
2047
- // the ✓ character, such as us-ascii.
2048
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
2049
-
2050
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
2051
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
2052
-
2053
- var parseValues = function parseQueryStringValues(str, options) {
2054
- var obj = {};
2055
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
2056
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
2057
- var parts = cleanStr.split(options.delimiter, limit);
2058
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
2059
- var i;
2060
-
2061
- var charset = options.charset;
2062
- if (options.charsetSentinel) {
2063
- for (i = 0; i < parts.length; ++i) {
2064
- if (parts[i].indexOf('utf8=') === 0) {
2065
- if (parts[i] === charsetSentinel) {
2066
- charset = 'utf-8';
2067
- } else if (parts[i] === isoSentinel) {
2068
- charset = 'iso-8859-1';
2069
- }
2070
- skipIndex = i;
2071
- i = parts.length; // The eslint settings do not allow break;
2072
- }
2073
- }
2074
- }
2075
-
2076
- for (i = 0; i < parts.length; ++i) {
2077
- if (i === skipIndex) {
2078
- continue;
2079
- }
2080
- var part = parts[i];
2081
-
2082
- var bracketEqualsPos = part.indexOf(']=');
2083
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
2084
-
2085
- var key, val;
2086
- if (pos === -1) {
2087
- key = options.decoder(part, defaults.decoder, charset, 'key');
2088
- val = options.strictNullHandling ? null : '';
2089
- } else {
2090
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
2091
- val = utils.maybeMap(
2092
- parseArrayValue(part.slice(pos + 1), options),
2093
- function (encodedVal) {
2094
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
2095
- }
2096
- );
2097
- }
2098
-
2099
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
2100
- val = interpretNumericEntities(val);
2101
- }
2102
-
2103
- if (part.indexOf('[]=') > -1) {
2104
- val = isArray(val) ? [val] : val;
2105
- }
2106
-
2107
- if (has.call(obj, key)) {
2108
- obj[key] = utils.combine(obj[key], val);
2109
- } else {
2110
- obj[key] = val;
2111
- }
2112
- }
2113
-
2114
- return obj;
2115
- };
2116
-
2117
- var parseObject = function (chain, val, options, valuesParsed) {
2118
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
2119
-
2120
- for (var i = chain.length - 1; i >= 0; --i) {
2121
- var obj;
2122
- var root = chain[i];
2123
-
2124
- if (root === '[]' && options.parseArrays) {
2125
- obj = [].concat(leaf);
2126
- } else {
2127
- obj = options.plainObjects ? Object.create(null) : {};
2128
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
2129
- var index = parseInt(cleanRoot, 10);
2130
- if (!options.parseArrays && cleanRoot === '') {
2131
- obj = { 0: leaf };
2132
- } else if (
2133
- !isNaN(index)
2134
- && root !== cleanRoot
2135
- && String(index) === cleanRoot
2136
- && index >= 0
2137
- && (options.parseArrays && index <= options.arrayLimit)
2138
- ) {
2139
- obj = [];
2140
- obj[index] = leaf;
2141
- } else if (cleanRoot !== '__proto__') {
2142
- obj[cleanRoot] = leaf;
2143
- }
2144
- }
2145
-
2146
- leaf = obj;
2147
- }
2148
-
2149
- return leaf;
2150
- };
2151
-
2152
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
2153
- if (!givenKey) {
2154
- return;
2155
- }
2156
-
2157
- // Transform dot notation to bracket notation
2158
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2159
-
2160
- // The regex chunks
2161
-
2162
- var brackets = /(\[[^[\]]*])/;
2163
- var child = /(\[[^[\]]*])/g;
2164
-
2165
- // Get the parent
2166
-
2167
- var segment = options.depth > 0 && brackets.exec(key);
2168
- var parent = segment ? key.slice(0, segment.index) : key;
2169
-
2170
- // Stash the parent if it exists
2171
-
2172
- var keys = [];
2173
- if (parent) {
2174
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2175
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
2176
- if (!options.allowPrototypes) {
2177
- return;
2178
- }
2179
- }
2180
-
2181
- keys.push(parent);
2182
- }
2183
-
2184
- // Loop through children appending to the array until we hit depth
2185
-
2186
- var i = 0;
2187
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2188
- i += 1;
2189
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2190
- if (!options.allowPrototypes) {
2191
- return;
2192
- }
2193
- }
2194
- keys.push(segment[1]);
2383
+ } else {
2384
+ arrayFormat = 'indices';
2195
2385
  }
2196
2386
 
2197
- // If there's a remainder, just add whatever is left
2198
-
2199
- if (segment) {
2200
- keys.push('[' + key.slice(segment.index) + ']');
2387
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2388
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2389
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2201
2390
  }
2391
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
2202
2392
 
2203
- return parseObject(keys, val, options, valuesParsed);
2204
- };
2393
+ if (!objKeys) {
2394
+ objKeys = Object.keys(obj);
2395
+ }
2205
2396
 
2206
- var normalizeParseOptions = function normalizeParseOptions(opts) {
2207
- if (!opts) {
2208
- return defaults;
2397
+ if (options.sort) {
2398
+ objKeys.sort(options.sort);
2209
2399
  }
2210
2400
 
2211
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2212
- throw new TypeError('Decoder has to be a function.');
2401
+ var sideChannel = getSideChannel();
2402
+ for (var i = 0; i < objKeys.length; ++i) {
2403
+ var key = objKeys[i];
2404
+
2405
+ if (options.skipNulls && obj[key] === null) {
2406
+ continue;
2407
+ }
2408
+ pushToArray(keys, stringify$1(
2409
+ obj[key],
2410
+ key,
2411
+ generateArrayPrefix,
2412
+ commaRoundTrip,
2413
+ options.strictNullHandling,
2414
+ options.skipNulls,
2415
+ options.encode ? options.encoder : null,
2416
+ options.filter,
2417
+ options.sort,
2418
+ options.allowDots,
2419
+ options.serializeDate,
2420
+ options.format,
2421
+ options.formatter,
2422
+ options.encodeValuesOnly,
2423
+ options.charset,
2424
+ sideChannel
2425
+ ));
2213
2426
  }
2214
2427
 
2215
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2216
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2428
+ var joined = keys.join(options.delimiter);
2429
+ var prefix = options.addQueryPrefix === true ? '?' : '';
2430
+
2431
+ if (options.charsetSentinel) {
2432
+ if (options.charset === 'iso-8859-1') {
2433
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
2434
+ prefix += 'utf8=%26%2310003%3B&';
2435
+ } else {
2436
+ // encodeURIComponent('✓')
2437
+ prefix += 'utf8=%E2%9C%93&';
2438
+ }
2217
2439
  }
2218
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2219
2440
 
2220
- return {
2221
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2222
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2223
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2224
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2225
- charset: charset,
2226
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2227
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2228
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2229
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2230
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2231
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2232
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2233
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2234
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2235
- parseArrays: opts.parseArrays !== false,
2236
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2237
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2238
- };
2441
+ return joined.length > 0 ? prefix + joined : '';
2239
2442
  };
2240
2443
 
2241
- var parse$1 = function (str, opts) {
2242
- var options = normalizeParseOptions(opts);
2243
-
2244
- if (str === '' || str === null || typeof str === 'undefined') {
2245
- return options.plainObjects ? Object.create(null) : {};
2246
- }
2444
+ var utils = utils$2;
2247
2445
 
2248
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2249
- var obj = options.plainObjects ? Object.create(null) : {};
2446
+ var has = Object.prototype.hasOwnProperty;
2447
+ var isArray = Array.isArray;
2250
2448
 
2251
- // Iterate over the keys and setup the new object
2449
+ var defaults = {
2450
+ allowDots: false,
2451
+ allowPrototypes: false,
2452
+ allowSparse: false,
2453
+ arrayLimit: 20,
2454
+ charset: 'utf-8',
2455
+ charsetSentinel: false,
2456
+ comma: false,
2457
+ decoder: utils.decode,
2458
+ delimiter: '&',
2459
+ depth: 5,
2460
+ ignoreQueryPrefix: false,
2461
+ interpretNumericEntities: false,
2462
+ parameterLimit: 1000,
2463
+ parseArrays: true,
2464
+ plainObjects: false,
2465
+ strictNullHandling: false
2466
+ };
2252
2467
 
2253
- var keys = Object.keys(tempObj);
2254
- for (var i = 0; i < keys.length; ++i) {
2255
- var key = keys[i];
2256
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2257
- obj = utils.merge(obj, newObj, options);
2258
- }
2468
+ var interpretNumericEntities = function (str) {
2469
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
2470
+ return String.fromCharCode(parseInt(numberStr, 10));
2471
+ });
2472
+ };
2259
2473
 
2260
- if (options.allowSparse === true) {
2261
- return obj;
2474
+ var parseArrayValue = function (val, options) {
2475
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
2476
+ return val.split(',');
2262
2477
  }
2263
2478
 
2264
- return utils.compact(obj);
2479
+ return val;
2265
2480
  };
2266
2481
 
2267
- var stringify = stringify_1;
2268
- var parse = parse$1;
2269
- var formats = formats$3;
2482
+ // This is what browsers will submit when the ✓ character occurs in an
2483
+ // application/x-www-form-urlencoded body and the encoding of the page containing
2484
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
2485
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
2486
+ // the ✓ character, such as us-ascii.
2487
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
2270
2488
 
2271
- var lib = {
2272
- formats: formats,
2273
- parse: parse,
2274
- stringify: stringify
2275
- };
2489
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
2490
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
2276
2491
 
2277
- var _globalProps$organiza;
2278
- var newInstallationParams = lib.stringify({
2279
- integrator_id: initializers.globalProps === null || initializers.globalProps === void 0 || (_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.id,
2280
- integrator_type: "Organization",
2281
- redirect_path: "/projects/new"
2282
- });
2283
- var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
2284
- var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
2492
+ var parseValues = function parseQueryStringValues(str, options) {
2493
+ var obj = {};
2494
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
2495
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
2496
+ var parts = cleanStr.split(options.delimiter, limit);
2497
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
2498
+ var i;
2285
2499
 
2286
- var Configure = reactUtils.withT(function (_ref) {
2287
- var t = _ref.t,
2288
- isConnected = _ref.isConnected,
2289
- installationUrl = _ref.installationUrl;
2290
- return /*#__PURE__*/React__default["default"].createElement("div", {
2291
- className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
2292
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2293
- className: "mt-1 text-indigo-600 xl:mt-3",
2294
- href: installationUrl,
2295
- icon: isConnected ? neetoIcons.Settings : neetoIcons.Plus,
2296
- iconPosition: "left",
2297
- iconSize: 20,
2298
- size: "small",
2299
- style: "text"
2300
- }, isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")));
2301
- });
2500
+ var charset = options.charset;
2501
+ if (options.charsetSentinel) {
2502
+ for (i = 0; i < parts.length; ++i) {
2503
+ if (parts[i].indexOf('utf8=') === 0) {
2504
+ if (parts[i] === charsetSentinel) {
2505
+ charset = 'utf-8';
2506
+ } else if (parts[i] === isoSentinel) {
2507
+ charset = 'iso-8859-1';
2508
+ }
2509
+ skipIndex = i;
2510
+ i = parts.length; // The eslint settings do not allow break;
2511
+ }
2512
+ }
2513
+ }
2302
2514
 
2303
- var Header = reactUtils.withT(function (_ref) {
2304
- var t = _ref.t;
2305
- return /*#__PURE__*/React__default["default"].createElement("div", {
2306
- className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased"
2307
- }, /*#__PURE__*/React__default["default"].createElement(misc.Github, {
2308
- size: 16
2309
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2310
- style: "h4"
2311
- }, t("neetoGithub.github")));
2312
- });
2515
+ for (i = 0; i < parts.length; ++i) {
2516
+ if (i === skipIndex) {
2517
+ continue;
2518
+ }
2519
+ var part = parts[i];
2313
2520
 
2314
- var List$1 = reactUtils.withT(function (_ref) {
2315
- var t = _ref.t,
2316
- accounts = _ref.accounts;
2317
- return accounts.map(function (_ref2) {
2318
- var id = _ref2.id,
2319
- name = _ref2.name,
2320
- avatarUrl = _ref2.avatarUrl,
2321
- type = _ref2.type,
2322
- profileUrl = _ref2.profileUrl,
2323
- count = _ref2.count;
2324
- return /*#__PURE__*/React__default["default"].createElement("div", {
2325
- className: "neeto-ui-border-gray-300 flex w-full items-center space-x-2 border-b border-l-0 border-r-0 border-t-0 border-solid p-2",
2326
- key: id
2327
- }, type === "Organization" ? /*#__PURE__*/React__default["default"].createElement(neetoIcons.Building, {
2328
- className: "neeto-ui-text-gray-600",
2329
- size: 16
2330
- }) : /*#__PURE__*/React__default["default"].createElement(neetoIcons.User, {
2331
- className: "neeto-ui-text-gray-600",
2332
- size: 16
2333
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2334
- className: "neeto-ui-text-gray-900",
2335
- style: "body2"
2336
- }, "@", name), /*#__PURE__*/React__default["default"].createElement("img", {
2337
- alt: name,
2338
- className: "neeto-ui-rounded-full h-4 w-4",
2339
- src: avatarUrl
2340
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2341
- className: "text-indigo-600",
2342
- icon: neetoIcons.CannedResponses,
2343
- iconPosition: "left",
2344
- iconSize: 16,
2345
- size: "small",
2346
- style: "text",
2347
- onClick: function onClick() {
2348
- return window.open(profileUrl, "_blank");
2349
- }
2350
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2351
- className: "neeto-ui-text-gray-900 mx-2 text-sm",
2352
- component: "span",
2353
- style: "h3"
2354
- }, "\u2022"), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2355
- style: "body2"
2356
- }, t("neetoGithub.countOf.repos", {
2357
- count: count
2358
- })));
2359
- });
2360
- });
2521
+ var bracketEqualsPos = part.indexOf(']=');
2522
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
2523
+
2524
+ var key, val;
2525
+ if (pos === -1) {
2526
+ key = options.decoder(part, defaults.decoder, charset, 'key');
2527
+ val = options.strictNullHandling ? null : '';
2528
+ } else {
2529
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
2530
+ val = utils.maybeMap(
2531
+ parseArrayValue(part.slice(pos + 1), options),
2532
+ function (encodedVal) {
2533
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
2534
+ }
2535
+ );
2536
+ }
2361
2537
 
2362
- var Accounts = function Accounts(_ref) {
2363
- var isPane = _ref.isPane,
2364
- accounts = _ref.accounts,
2365
- isConnected = _ref.isConnected,
2366
- onConnect = _ref.onConnect,
2367
- installationUrl = _ref.installationUrl;
2368
- return /*#__PURE__*/React__default["default"].createElement("div", {
2369
- className: classNames__default["default"]("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
2370
- "2xl:max-w-sm 2xl:px-8": isPane,
2371
- "xl:max-w-sm xl:px-8": !isPane
2372
- })
2373
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2374
- className: "mb-2"
2375
- }, /*#__PURE__*/React__default["default"].createElement(Header, null), /*#__PURE__*/React__default["default"].createElement(List$1, {
2376
- accounts: accounts,
2377
- isConnected: isConnected
2378
- }), /*#__PURE__*/React__default["default"].createElement(Configure, {
2379
- installationUrl: installationUrl,
2380
- isConnected: isConnected,
2381
- onConnect: onConnect
2382
- })));
2383
- };
2538
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
2539
+ val = interpretNumericEntities(val);
2540
+ }
2384
2541
 
2385
- function _arrayWithHoles(arr) {
2386
- if (Array.isArray(arr)) return arr;
2387
- }
2542
+ if (part.indexOf('[]=') > -1) {
2543
+ val = isArray(val) ? [val] : val;
2544
+ }
2388
2545
 
2389
- function _iterableToArrayLimit(arr, i) {
2390
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
2391
- if (null != _i) {
2392
- var _s,
2393
- _e,
2394
- _x,
2395
- _r,
2396
- _arr = [],
2397
- _n = !0,
2398
- _d = !1;
2399
- try {
2400
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
2401
- if (Object(_i) !== _i) return;
2402
- _n = !1;
2403
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
2404
- } catch (err) {
2405
- _d = !0, _e = err;
2406
- } finally {
2407
- try {
2408
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
2409
- } finally {
2410
- if (_d) throw _e;
2411
- }
2546
+ if (has.call(obj, key)) {
2547
+ obj[key] = utils.combine(obj[key], val);
2548
+ } else {
2549
+ obj[key] = val;
2550
+ }
2412
2551
  }
2413
- return _arr;
2414
- }
2415
- }
2416
2552
 
2417
- function _arrayLikeToArray(arr, len) {
2418
- if (len == null || len > arr.length) len = arr.length;
2419
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
2420
- return arr2;
2421
- }
2553
+ return obj;
2554
+ };
2422
2555
 
2423
- function _unsupportedIterableToArray(o, minLen) {
2424
- if (!o) return;
2425
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2426
- var n = Object.prototype.toString.call(o).slice(8, -1);
2427
- if (n === "Object" && o.constructor) n = o.constructor.name;
2428
- if (n === "Map" || n === "Set") return Array.from(o);
2429
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2430
- }
2556
+ var parseObject = function (chain, val, options, valuesParsed) {
2557
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
2431
2558
 
2432
- function _nonIterableRest() {
2433
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2434
- }
2559
+ for (var i = chain.length - 1; i >= 0; --i) {
2560
+ var obj;
2561
+ var root = chain[i];
2435
2562
 
2436
- function _slicedToArray(arr, i) {
2437
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
2438
- }
2563
+ if (root === '[]' && options.parseArrays) {
2564
+ obj = [].concat(leaf);
2565
+ } else {
2566
+ obj = options.plainObjects ? Object.create(null) : {};
2567
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
2568
+ var index = parseInt(cleanRoot, 10);
2569
+ if (!options.parseArrays && cleanRoot === '') {
2570
+ obj = { 0: leaf };
2571
+ } else if (
2572
+ !isNaN(index)
2573
+ && root !== cleanRoot
2574
+ && String(index) === cleanRoot
2575
+ && index >= 0
2576
+ && (options.parseArrays && index <= options.arrayLimit)
2577
+ ) {
2578
+ obj = [];
2579
+ obj[index] = leaf;
2580
+ } else if (cleanRoot !== '__proto__') {
2581
+ obj[cleanRoot] = leaf;
2582
+ }
2583
+ }
2439
2584
 
2440
- var NoRepositories = reactUtils.withT(function (_ref) {
2441
- var t = _ref.t,
2442
- installationUrl = _ref.installationUrl,
2443
- troubleshootUrl = _ref.troubleshootUrl;
2444
- return /*#__PURE__*/React__default["default"].createElement("div", {
2445
- className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
2446
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2447
- style: "body2"
2448
- }, t("neetoGithub.noReposDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2449
- href: installationUrl,
2450
- icon: misc.Github,
2451
- iconPosition: "left",
2452
- label: t("neetoGithub.connectRepository"),
2453
- size: "medium",
2454
- style: "primary"
2455
- }), /*#__PURE__*/React__default["default"].createElement("div", {
2456
- className: "text-xs"
2457
- }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
2458
- i18nKey: "troubleshoot",
2459
- components: {
2460
- troubleshootLink: /*#__PURE__*/React__default["default"].createElement("a", {
2461
- className: "text-indigo-600 underline",
2462
- href: troubleshootUrl,
2463
- rel: "noopener noreferrer",
2464
- target: "_blank"
2465
- })
2585
+ leaf = obj;
2466
2586
  }
2467
- })));
2468
- });
2469
2587
 
2470
- var RepositoryTile = function RepositoryTile(_ref) {
2471
- var onConnect = _ref.onConnect,
2472
- repository = _ref.repository;
2473
- var _useTranslation = reactI18next.useTranslation(),
2474
- t = _useTranslation.t;
2475
- var id = repository.id,
2476
- fullName = repository.fullName,
2477
- isPrivate = repository.isPrivate,
2478
- updatedAt = repository.updatedAt;
2479
- return /*#__PURE__*/React__default["default"].createElement("div", {
2480
- className: "neeto-ui-border-gray-300 flex items-center justify-between border-b border-l-0 border-r-0 border-t-0 border-solid py-3 pl-5 pr-3",
2481
- key: id
2482
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2483
- className: "width-calc flex items-center space-x-2"
2484
- }, /*#__PURE__*/React__default["default"].createElement(misc.Github, {
2485
- size: 16
2486
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2487
- style: "body2"
2488
- }, fullName), isPrivate && /*#__PURE__*/React__default["default"].createElement(neetoIcons.Lock, {
2489
- size: 16
2490
- }), /*#__PURE__*/React__default["default"].createElement("div", {
2491
- className: "hidden md:inline-block"
2492
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2493
- className: "neeto-ui-text-gray-900 mx-2 text-sm",
2494
- component: "span",
2495
- style: "h3"
2496
- }, "\u2022"), /*#__PURE__*/React__default["default"].createElement(DateFormat__default["default"].FromNow, {
2497
- date: updatedAt
2498
- }))), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2499
- style: "primary",
2500
- type: "button",
2501
- onClick: function onClick() {
2502
- return onConnect({
2503
- repoType: "private",
2504
- repository: repository
2505
- });
2506
- }
2507
- }, t("neetoGithub.connect")));
2588
+ return leaf;
2508
2589
  };
2509
2590
 
2510
- var List = reactUtils.withT(function (_ref) {
2511
- var t = _ref.t,
2512
- isPublicRepoAllowed = _ref.isPublicRepoAllowed,
2513
- filteredRepositories = _ref.filteredRepositories,
2514
- repositories = _ref.repositories,
2515
- onConnect = _ref.onConnect,
2516
- installationUrl = _ref.installationUrl,
2517
- troubleshootUrl = _ref.troubleshootUrl;
2518
- return /*#__PURE__*/React__default["default"].createElement("div", {
2519
- className: classNames__default["default"]("neeto-ui-border-gray-300 neeto-ui-rounded-md m-0 flex flex-col items-center justify-center border border-solid p-0 2xl:h-96", {
2520
- "h-52": isPublicRepoAllowed,
2521
- "h-72": !isPublicRepoAllowed
2522
- })
2523
- }, neetoCist.isPresent(repositories) ? /*#__PURE__*/React__default["default"].createElement(Scrollable__default["default"], {
2524
- className: "m-0 h-full w-full overflow-y-scroll p-0 shadow-inner"
2525
- }, neetoCist.isPresent(filteredRepositories) ? filteredRepositories.map(function (repository) {
2526
- return /*#__PURE__*/React__default["default"].createElement(RepositoryTile, {
2527
- onConnect: onConnect,
2528
- repository: repository
2529
- });
2530
- }) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2531
- className: "flex h-full w-full items-center justify-center",
2532
- style: "body2"
2533
- }, t("neetoGithub.noRepos"))) : /*#__PURE__*/React__default["default"].createElement(NoRepositories, {
2534
- installationUrl: installationUrl,
2535
- troubleshootUrl: troubleshootUrl
2536
- }));
2537
- });
2591
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
2592
+ if (!givenKey) {
2593
+ return;
2594
+ }
2595
+
2596
+ // Transform dot notation to bracket notation
2597
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2598
+
2599
+ // The regex chunks
2600
+
2601
+ var brackets = /(\[[^[\]]*])/;
2602
+ var child = /(\[[^[\]]*])/g;
2603
+
2604
+ // Get the parent
2605
+
2606
+ var segment = options.depth > 0 && brackets.exec(key);
2607
+ var parent = segment ? key.slice(0, segment.index) : key;
2608
+
2609
+ // Stash the parent if it exists
2610
+
2611
+ var keys = [];
2612
+ if (parent) {
2613
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2614
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
2615
+ if (!options.allowPrototypes) {
2616
+ return;
2617
+ }
2618
+ }
2619
+
2620
+ keys.push(parent);
2621
+ }
2622
+
2623
+ // Loop through children appending to the array until we hit depth
2624
+
2625
+ var i = 0;
2626
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2627
+ i += 1;
2628
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2629
+ if (!options.allowPrototypes) {
2630
+ return;
2631
+ }
2632
+ }
2633
+ keys.push(segment[1]);
2634
+ }
2538
2635
 
2539
- var NotConnected = reactUtils.withT(function (_ref) {
2540
- var t = _ref.t,
2541
- installationUrl = _ref.installationUrl;
2542
- return /*#__PURE__*/React__default["default"].createElement("div", {
2543
- className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
2544
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2545
- style: "body2"
2546
- }, t("neetoGithub.notConnectedDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2547
- href: installationUrl,
2548
- icon: misc.Github,
2549
- iconPosition: "left",
2550
- label: t("neetoGithub.connectGithub"),
2551
- size: "medium",
2552
- style: "primary"
2553
- }));
2554
- });
2636
+ // If there's a remainder, just add whatever is left
2555
2637
 
2556
- var Private = function Private(_ref) {
2557
- var isConnected = _ref.isConnected,
2558
- isPublicRepoAllowed = _ref.isPublicRepoAllowed,
2559
- repositories = _ref.repositories,
2560
- onConnect = _ref.onConnect,
2561
- installationUrl = _ref.installationUrl,
2562
- troubleshootUrl = _ref.troubleshootUrl;
2563
- var _useTranslation = reactI18next.useTranslation(),
2564
- t = _useTranslation.t;
2565
- var _useState = React.useState(repositories),
2566
- _useState2 = _slicedToArray(_useState, 2),
2567
- filteredRepositories = _useState2[0],
2568
- setFilteredRepositories = _useState2[1];
2569
- var onSearch = function onSearch(searchTerm) {
2570
- if (!neetoCist.isPresent(searchTerm)) {
2571
- setFilteredRepositories(repositories);
2572
- return;
2638
+ if (segment) {
2639
+ keys.push('[' + key.slice(segment.index) + ']');
2573
2640
  }
2574
- var filteredRepositories = repositories.filter(function (_ref2) {
2575
- var fullName = _ref2.fullName;
2576
- return fullName.toLowerCase().includes(searchTerm.toLowerCase());
2577
- });
2578
- setFilteredRepositories(filteredRepositories);
2579
- };
2580
- return /*#__PURE__*/React__default["default"].createElement("div", {
2581
- className: "connect-repo neeto-ui-rounded-md neeto-ui-border-gray-300 border border-solid px-8 py-7"
2582
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2583
- className: "mb-2 pb-5 text-lg font-medium",
2584
- style: "h2"
2585
- }, t("neetoGithub.connectARepo")), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
2586
- className: "flex w-full flex-col space-y-6"
2587
- }, /*#__PURE__*/React__default["default"].createElement(Search__default["default"], {
2588
- onSearch: onSearch,
2589
- className: "w-full",
2590
- suffix: /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2591
- style: "body2"
2592
- }, t("neetoGithub.countOf.repos", {
2593
- count: filteredRepositories.length
2594
- }))
2595
- }), /*#__PURE__*/React__default["default"].createElement(List, {
2596
- isPublicRepoAllowed: isPublicRepoAllowed,
2597
- filteredRepositories: filteredRepositories,
2598
- installationUrl: installationUrl,
2599
- onConnect: onConnect,
2600
- repositories: repositories,
2601
- troubleshootUrl: troubleshootUrl
2602
- })) : /*#__PURE__*/React__default["default"].createElement("div", {
2603
- className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
2604
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2605
- className: "neeto-ui-rounded-md neeto-ui-border-gray-300 m-0 flex h-[366px] flex-col items-center justify-center border border-solid p-4 shadow-inner"
2606
- }, /*#__PURE__*/React__default["default"].createElement(NotConnected, {
2607
- installationUrl: installationUrl
2608
- }))));
2641
+
2642
+ return parseObject(keys, val, options, valuesParsed);
2609
2643
  };
2610
2644
 
2611
- var Public = function Public(_ref) {
2612
- var onConnect = _ref.onConnect;
2613
- var _useTranslation = reactI18next.useTranslation(),
2614
- t = _useTranslation.t;
2615
- var _useState = React.useState(""),
2616
- _useState2 = _slicedToArray(_useState, 2),
2617
- publicRepoUrl = _useState2[0],
2618
- setPublicRepoUrl = _useState2[1];
2619
- return /*#__PURE__*/React__default["default"].createElement("div", {
2620
- className: "transition-drop-shadow neeto-ui-border-gray-300 neeto-ui-rounded-md border border-solid px-8 py-7 font-sans transition-colors"
2621
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2622
- className: "mb-2 pb-5"
2623
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2624
- className: "flex justify-between"
2625
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2626
- className: "pr-4"
2627
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2628
- className: "text-lg font-medium",
2629
- style: "h2"
2630
- }, t("neetoGithub.publicGitRepo")), /*#__PURE__*/React__default["default"].createElement("div", {
2631
- className: "neeto-ui-text-gray-900 mt-2 flex max-w-xl space-x-1 font-sans text-sm font-normal leading-6 antialiased"
2632
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2633
- style: "body2"
2634
- }, t("neetoGithub.publicGitRepoDescription")))))), /*#__PURE__*/React__default["default"].createElement("div", {
2635
- className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
2636
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2637
- className: "flex"
2638
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2639
- className: "z-0 flex-1"
2640
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2641
- className: "w-full"
2642
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Input, {
2643
- nakedInput: true,
2644
- autocomplete: "false",
2645
- className: "relative rounded-b rounded-l rounded-r-none rounded-t border-b border-l border-r-0 border-t border-solid px-2",
2646
- placeholder: t("neetoGithub.publicGitRepoPlaceholder"),
2647
- size: "large",
2648
- spellcheck: "false",
2649
- type: "text",
2650
- value: publicRepoUrl,
2651
- onChange: function onChange(e) {
2652
- return setPublicRepoUrl(e.target.value);
2645
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
2646
+ if (!opts) {
2647
+ return defaults;
2653
2648
  }
2654
- }))), /*#__PURE__*/React__default["default"].createElement("div", {
2655
- className: "relative"
2656
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2657
- className: "rounded-b rounded-l-none rounded-r rounded-t",
2658
- disabled: !neetoCist.isPresent(publicRepoUrl),
2659
- size: "large",
2660
- style: "primary",
2661
- type: "button",
2662
- onClick: function onClick() {
2663
- return onConnect({
2664
- repoType: "public",
2665
- repository: {
2666
- fullName: publicRepoUrl
2667
- }
2668
- });
2649
+
2650
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2651
+ throw new TypeError('Decoder has to be a function.');
2669
2652
  }
2670
- }, t("neetoGithub.continue"))))));
2653
+
2654
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2655
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2656
+ }
2657
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2658
+
2659
+ return {
2660
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2661
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2662
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2663
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2664
+ charset: charset,
2665
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2666
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2667
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2668
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2669
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2670
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2671
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2672
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2673
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2674
+ parseArrays: opts.parseArrays !== false,
2675
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2676
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2677
+ };
2671
2678
  };
2672
2679
 
2673
- var Repositories = function Repositories(_ref) {
2674
- var isConnected = _ref.isConnected,
2675
- isPublicRepoAllowed = _ref.isPublicRepoAllowed,
2676
- repositories = _ref.repositories,
2677
- onConnect = _ref.onConnect,
2678
- installationUrl = _ref.installationUrl,
2679
- troubleshootUrl = _ref.troubleshootUrl;
2680
- return /*#__PURE__*/React__default["default"].createElement("div", {
2681
- className: "w-full space-y-6"
2682
- }, /*#__PURE__*/React__default["default"].createElement(Private, {
2683
- isPublicRepoAllowed: isPublicRepoAllowed,
2684
- installationUrl: installationUrl,
2685
- isConnected: isConnected,
2686
- onConnect: onConnect,
2687
- repositories: repositories,
2688
- troubleshootUrl: troubleshootUrl
2689
- }), isPublicRepoAllowed && /*#__PURE__*/React__default["default"].createElement(Public, {
2690
- onConnect: onConnect
2691
- }));
2680
+ var parse$1 = function (str, opts) {
2681
+ var options = normalizeParseOptions(opts);
2682
+
2683
+ if (str === '' || str === null || typeof str === 'undefined') {
2684
+ return options.plainObjects ? Object.create(null) : {};
2685
+ }
2686
+
2687
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2688
+ var obj = options.plainObjects ? Object.create(null) : {};
2689
+
2690
+ // Iterate over the keys and setup the new object
2691
+
2692
+ var keys = Object.keys(tempObj);
2693
+ for (var i = 0; i < keys.length; ++i) {
2694
+ var key = keys[i];
2695
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2696
+ obj = utils.merge(obj, newObj, options);
2697
+ }
2698
+
2699
+ if (options.allowSparse === true) {
2700
+ return obj;
2701
+ }
2702
+
2703
+ return utils.compact(obj);
2692
2704
  };
2693
2705
 
2694
- var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
2695
- var _ref$accounts = _ref.accounts,
2696
- accounts = _ref$accounts === void 0 ? [] : _ref$accounts,
2697
- installationUrl = _ref.installationUrl,
2698
- isConnected = _ref.isConnected,
2699
- _ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
2700
- isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
2701
- onConnect = _ref.onConnect,
2702
- _ref$repositories = _ref.repositories,
2703
- repositories = _ref$repositories === void 0 ? [] : _ref$repositories,
2704
- troubleshootUrl = _ref.troubleshootUrl,
2705
- _ref$isPane = _ref.isPane,
2706
- isPane = _ref$isPane === void 0 ? false : _ref$isPane;
2707
- return /*#__PURE__*/React__default["default"].createElement("div", {
2708
- className: "flex w-full flex-col-reverse 2xl:flex-row"
2709
- }, /*#__PURE__*/React__default["default"].createElement(Repositories, {
2710
- installationUrl: installationUrl,
2711
- isConnected: isConnected,
2712
- isPublicRepoAllowed: isPublicRepoAllowed,
2713
- onConnect: onConnect,
2714
- repositories: repositories,
2715
- troubleshootUrl: troubleshootUrl
2716
- }), /*#__PURE__*/React__default["default"].createElement(Accounts, {
2717
- accounts: accounts,
2718
- installationUrl: installationUrl,
2719
- isConnected: isConnected,
2720
- onConnect: onConnect,
2721
- isPane: isPane
2722
- }));
2706
+ var stringify = stringify_1;
2707
+ var parse = parse$1;
2708
+ var formats = formats$3;
2709
+
2710
+ var lib = {
2711
+ formats: formats,
2712
+ parse: parse,
2713
+ stringify: stringify
2723
2714
  };
2724
2715
 
2716
+ var _globalProps$organiza;
2717
+ var newInstallationParams = lib.stringify({
2718
+ integrator_id: initializers.globalProps === null || initializers.globalProps === void 0 || (_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.id,
2719
+ integrator_type: "Organization",
2720
+ redirect_path: "/projects/new"
2721
+ });
2722
+ var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
2723
+ var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
2724
+
2725
2725
  var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
2726
2726
  var isOpen = _ref.isOpen,
2727
2727
  onClose = _ref.onClose,
@@ -2770,5 +2770,6 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
2770
2770
  var css = ".width-calc{width:calc(100% - 82px)}.neeto-github-modal-pane-wrapper{width:min(75%,1280px)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlcG9zaXRvcnktdGlsZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3BhbmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUNFLHVCQ0NGLENDRkEsaUNBQ0UscUJES0YiLCJzb3VyY2VzQ29udGVudCI6WyIud2lkdGgtY2FsYyB7XG4gIHdpZHRoOiBjYWxjKDEwMCUgLSA4MnB4KTtcbn1cbiIsIi53aWR0aC1jYWxjIHtcbiAgd2lkdGg6IGNhbGMoMTAwJSAtIDgycHgpO1xufVxuXG4ubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oNzUlLCAxMjgwcHgpO1xufSIsIi5uZWV0by1naXRodWItbW9kYWwtcGFuZS13cmFwcGVyIHtcbiAgd2lkdGg6IG1pbig3NSUsIDEyODBweCk7XG59XG4iXX0= */";
2771
2771
  n(css,{});
2772
2772
 
2773
+ exports.NeetoGithubNanoContainer = NeetoGithubNanoContainer;
2773
2774
  exports.NeetoGithubNanoModal = NeetoGithubNanoModal;
2774
2775
  //# sourceMappingURL=index.cjs.js.map