PageSourceSearch

https://static.protopie.io/web/static/js/b846d74ae0be7fbc7e7a.chunk.js

js protopie.io collected 2026-10-01 09:20:20 UTC 26,801 bytes, 578 lines download raw bytes

1try{let e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="3b28ef9b-b20c-43d6-933b-0ffa8490108b",e._sentryDebugIdIdentifier="sentry-dbid-3b28ef9b-b20c-43d6-933b-0ffa8490108b")}catch(e){}("u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{}).SENTRY_RELEASE={id:"16.4.1"};"use strict";(self.webpackChunkcloud_web=self.webpackChunkcloud_web||[]).push([["fonts-page"],{11647:(e,r,i)=>{i.r(r),i.d(r,{FontsPage:()=>rA});var t=i(86070),o=i(6659),a=i(30758),n=i(9142),l=i(89677);let s=n.Ay.span`
2  ${e=>{if((0,l.ks)(e,["postscriptName","weight","italic"]))return(0,n.AH)`
3        font-family: ${e.postscriptName}, ${e.family};
4        font-weight: ${e.weight};
5        font-style: ${e.italic?"italic":"normal"};
6      `}}
7  font-display: swap;
8`;var d=i(16326),p=i(82093),c=i(41036),x=i(22556),h=i(96818);let u=e=>{switch(e){case 100:return`Thin (${e})`;case 200:return`Extra Light (${e})`;case 300:return`Light (${e})`;case 400:return`Regular (${e})`;case 500:return`Medium (${e})`;case 600:return`Semi Bold (${e})`;case 700:return`Bold (${e})`;case 800:return`Extra Bold (${e})`;case 900:return`Black (${e})`;case 950:return`Extra Black (${e})`;default:return e}};var g=i(19904),f=i(4729),y=i(37871),m=i(59016),b=i(39227),v=i(506),j=i(95203),w=i(78780),A=i(58594),k=i(54372);let E={async getFonts(e){let r={order:"postscriptName",...null!=e?e:{}};return(0,k.E)({method:A.vr.GET,url:"fonts",searchParams:r})},updateFonts:async e=>(0,k.E)({method:A.vr.POST,url:"fonts",body:e}),deleteFonts:async e=>(0,k.E)({method:A.vr.DELETE,url:`fonts/${e}`})};var S=i(57097);let F={INVALID_FILE_EXTENSION:"Unsupported format. Please use TTF or OTF files.",UNSUPPORTED_MEDIA_TYPE:"Unsupported format. Please use TTF or OTF files.",INVALID_ATTR:"Unsupported attributes in font file."};var N=i(3039),$=i(97491),z=i(17767),I=i(12897),C=i(92489),_=i(75935),D=i(27280);let T=(0,n.Ay)(_.pp)`
9  margin: 64px 0;
10`,P=(0,n.Ay)(I.Sx)`
11  width: 304px;
12  height: 232px;
13`,M=n.Ay.div`
14  display: inline-block;
15  margin-top: 16px;
16  color: var(--text-primary);
17  font-family: Gilroy, sans-serif;
18  text-align: center;
19`,B=n.Ay.h2`
20  font-weight: ${D.zN.BOLD};
21  font-size: 24px;
22  line-height: 28px;
23`,L=n.Ay.div`
24  margin-top: 16px;
25  font-weight: ${D.zN.MEDIUM};
26  font-size: 16px;
27  line-height: 24px;
28`,O=(0,n.Ay)(I.$n)`
29  width: 160px;
30  margin: 32px auto 0;
31`,U=e=>(0,t.jsxs)(T,{children:[(0,t.jsx)(P,{width:304,src:(0,C.EB)("/images/empty/[email protected]"),alt:"Upload your prototypes"}),(0,t.jsxs)(M,{children:[(0,t.jsx)(B,{children:"Upload custom fonts"}),(0,t.jsx)(L,{children:"Add your organization's unique style with custom fonts"})]}),(0,t.jsx)(O,{color:I.in.PRIMARY,size:I.Mp.BIG,onClick:e.handleUploadClick,children:"Upload fonts"})]}),R=n.Ay.div`
32  display: flex;
33  flex-direction: column;
34  align-items: center;
35  justify-content: center;
36  width: 100%;
37  margin-top: 8px;
38  padding: 100px 0;
39
40  &.isNarrowEmptyHeight {
41    padding: 40px 0;
42  }
43`;function H(e){return(0,t.jsxs)(R,{children:[(0,t.jsx)(I.Sx,{width:304,alt:"no result",src:(0,C.EB)("/images/empty/[email protected]")}),(0,t.jsxs)(_.uz.NoResultText,{children:['No results for "',e.currentSearchKeyword,'"']})]})}var G=i(11546),K=i(72079),q=i(63690),V=i(57496),Y=i(19532);let W=n.Ay.div`
44  width: 658px;
45  margin: 24px auto 80px;
46  padding: 24px;
47  border: 1px solid var(--gray-200);
48  border-radius: 8px;
49
50  @media (min-width: 1440px) {
51    width: 994px;
52  }
53
54  @media (min-width: 1728px) {
55    width: 1330px;
56  }
57`,Q=n.Ay.h2`
58  color: var(--text-primary);
59  font-weight: ${D.zN.SEMIBOLD};
60  font-size: 16px;
61  line-height: 20px;
62`,X=n.Ay.div`
63  margin-top: 8px;
64  color: var(--text-quinary);
65  font-size: 14px;
66  line-height: 16px;
67  white-space: pre-line;
68`,J=(0,n.Ay)(V.i)`
69  display: inline-block;
70  color: var(--text-primary);
71`,Z=n.Ay.div`
72  position: relative;
73  margin-top: 24px;
74  padding: 16px 16px 16px 40px;
75  background-color: ${(0,Y.B)("var(--yellow-100)",.3)};
76  border-radius: 4px;
77`,ee=n.Ay.div`
78  color: var(--text-quaternary);
79  font-size: 14px;
80  line-height: 16px;
81  white-space: pre-line;
82`,er=n.Ay.div`
83  display: inline-block;
84  color: var(--text-primary);
85  font-weight: ${D.zN.SEMIBOLD};
86  white-space: break-spaces;
87`,ei=(0,n.Ay)(G.Icon)`
88  position: absolute;
89  top: 16px;
90  left: 16px;
91`,et=n.Ay.div`
92  display: flex;
93  align-items: center;
94  justify-content: space-between;
95  margin: 24px auto 0;
96`;n.Ay.div`
97  margin-top: 24px;
98  color: var(--text-quinary);
99  font-size: 12px;
100  line-height: 16px;
101`;let eo=n.Ay.div`
102  width: 320px;
103`,ea=n.Ay.section`
104  margin-top: 24px;
105`,en=(0,n.AH)`
106  display: flex;
107`,el=n.Ay.div`
108  ${en}
109  padding-bottom: 16px;
110  border-bottom: 1px solid var(--border-neutral-seperator-default, #e9e9e9);
111`,es=n.Ay.div`
112  flex: 180px 0 0;
113  margin-right: 16px;
114  color: var(--text-tertiary);
115  font-weight: ${D.zN.SEMIBOLD};
116  font-size: 14px;
117  line-height: 16px;
118`,ed=(0,n.Ay)(es)`
119  position: relative;
120`,ep=(0,n.Ay)(p.J)`
121  display: inline-block;
122  margin-left: 4px;
123`,ec=(0,n.Ay)(es)``,ex=(0,n.Ay)(es)`
124  margin-right: 12px;
125
126  @media (min-width: 1440px) {
127    margin-right: 16px;
128  }
129`,eh=(0,n.Ay)(es)`
130  display: none;
131
132  @media (min-width: 1440px) {
133    display: block;
134  }
135`,eu=(0,n.Ay)(es)`
136  flex: 24px 0 0;
137  margin-left: auto;
138`,eg=n.Ay.div`
139  padding: 16px 0;
140  ${en}
141  border-bottom: 1px solid var(--border-neutral-seperator-subtle);
142  cursor: pointer;
143  transition: background-color 0.25s ease;
144
145  &:hover {
146    background-color: var(--background-surface-secondary-selected, #99999914);
147  }
148
149  &:last-child {
150    border: none;
151  }
152`,ef=n.Ay.div`
153  display: -webkit-box;
154  flex: 180px 0 0;
155  margin: auto 16px auto 0;
156  color: var(--text-primary);
157  font-size: 14px;
158  line-height: 16px;
159  text-overflow: ellipsis;
160  -webkit-line-clamp: 2;
161  -webkit-box-orient: vertical;
162  word-break: break-all;
163`,ey=(0,n.Ay)(ef)`
164  overflow: hidden;
165`,em=(0,n.Ay)(ef)``,eb=(0,n.Ay)(ef)`
166  margin-right: 12px;
167
168  @media (min-width: 1440px) {
169    margin-right: 16px;
170  }
171`,ev=(0,n.Ay)(ef)`
172  display: none;
173
174  @media (min-width: 1440px) {
175    display: block;
176  }
177`,ej=(0,n.Ay)(ef)`
178  position: relative;
179  flex: 24px 0 0;
180  margin-left: auto;
181  overflow: visible;
182`,ew=(0,n.Ay)(K.K)`
183  position: relative;
184  width: 24px;
185  height: 24px;
186  padding: 4px;
187  overflow: hidden;
188  border-radius: 2px;
189
190  &:hover {
191    background-color: var(--background-surface-secondary-selected, #99999914);
192  }
193`,eA=(0,n.Ay)(q.i)`
194  position: absolute;
195  top: 100%;
196  right: 0;
197  z-index: ${D.Zf};
198  padding: 0 116px 0 16px;
199  color: var(--red-500);
200  font-size: 14px;
201  line-height: 52px;
202  white-space: nowrap;
203  background-color: var(--background-surface-primary);
204  border: 1px solid var(--gray-100);
205  border-radius: 4px;
206  box-shadow:
207    0px 7px 15px rgba(0, 0, 0, 0.1),
208    0px 5px 7px rgba(0, 0, 0, 0.05);
209`,ek=n.Ay.div``,eE=n.Ay.div`
210  display: flex;
211  align-items: center;
212  justify-content: center;
213  padding: 40px 0;
214  border-bottom: 1px solid var(--border-neutral-seperator-subtle);
215`;var eS=i(78160),eF=i(51509),eN=i(35188);let e$=(0,n.Ay)(K.K)`
216  padding: 4px;
217  background-color: transparent;
218  &:hover {
219    background-color: var(--background-surface-secondary-selected, #99999914);
220  }
221`;n.Ay.h2`
222  color: var(--text-primary);
223  font-weight: ${D.zN.SEMIBOLD};
224  font-size: 16px;
225  line-height: 32px;
226  text-align: center;
227`,n.Ay.div`
228  position: absolute;
229  top: 0;
230  left: 0;
231  width: 32px;
232  height: 32px;
233  color: var(--gray-450);
234  font-size: 16px;
235  line-height: 32px;
236  text-align: center;
237  border: 1px solid var(--border-interactive-strong-hover);
238  border-radius: 50%;
239`,n.Ay.div`
240  padding: 8px 8px 8px 44px;
241  color: var(--gray-450);
242  font-size: 14px;
243`;let ez=n.Ay.label`
244  position: relative;
245  display: block;
246  height: 300px;
247  margin-top: 24px;
248  background-color: var(--gray-100);
249  border: 2px dashed var(--gray-200);
250  border-radius: 4px;
251`,eI=n.Ay.div`
252  position: absolute;
253  top: 0;
254  right: 0;
255  bottom: 0;
256  left: 0;
257  height: fit-content;
258  margin: auto;
259`,eC=n.Ay.div`
260  margin-bottom: 11px;
261  color: var(--gray-450);
262  font-size: 14px;
263  line-height: 16px;
264  text-align: center;
265`,e_=n.Ay.div`
266  display: inline-block;
267  color: var(--purple-500);
268`,eD=n.Ay.input`
269  display: none;
270`,eT=n.Ay.div`
271  position: absolute;
272  inset: 0;
273  width: 100%;
274  height: 100%;
275`,eP=n.Ay.div`
276  min-height: 300px;
277  max-height: 560px;
278  margin-top: 24px;
279`,eM=n.Ay.section`
280  margin: 0 auto;
281`,eB=(0,n.AH)`
282  display: flex;
283`,eL=n.Ay.div`
284  ${eB}
285  padding-bottom: 16px;
286  border-bottom: 1px solid var(--border-neutral-seperator-default, #e9e9e9);
287`,eO=n.Ay.div`
288  flex: 180px 0 0;
289  margin-right: 12px;
290  color: var(--text-tertiary);
291  font-weight: ${D.zN.SEMIBOLD};
292  font-size: 14px;
293  line-height: 16px;
294`,eU=(0,n.Ay)(eO)`
295  margin-right: 0;
296`,eR=(0,n.Ay)(eO)`
297  flex: 66px 0 0;
298  margin: 0;
299`,eH=n.Ay.div`
300  max-height: 512px;
301  overflow: hidden scroll;
302  scrollbar-width: none;
303  &::-webkit-scrollbar {
304    display: none;
305  }
306`,eG=n.Ay.div`
307  padding: 16px 0;
308  border-bottom: 1px solid var(--border-neutral-seperator-subtle);
309  transition: background-color 0.25s ease;
310
311  &:last-child {
312    border: none;
313  }
314`,eK=n.Ay.div`
315  display: flex;
316  flex-direction: row;
317`,eq=n.Ay.div`
318  display: -webkit-box;
319  flex: 180px 0 0;
320  margin: auto 12px auto 0;
321  overflow: hidden;
322  color: var(--text-primary);
323  font-size: 14px;
324  line-height: 16px;
325  text-overflow: ellipsis;
326  -webkit-line-clamp: 2;
327  -webkit-box-orient: vertical;
328  word-break: break-all;
329`,eV=(0,n.Ay)(eq)`
330  margin-right: 0;
331`,eY=(0,n.Ay)(eq)`
332  flex: 66px 0 0;
333  margin: 0;
334`,eW=n.Ay.div`
335  margin-top: 8px;
336  color: var(--red-500);
337  font-size: 12px;
338  line-height: 16px;
339`,eQ=n.Ay.div`
340  margin: 16px 0 76px;
341  color: var(--gray-450);
342  font-size: 14px;
343  line-height: 176px;
344  text-align: center;
345`,eX=(0,n.Ay)(K.K)`
346  margin-left: 34px;
347  padding: 4px;
348  border-radius: 4px;
349
350  &:hover {
351    background-color: var(--background-surface-secondary-selected, #99999914);
352  }
353`,eJ=n.Ay.div`
354  margin-top: 24px;
355`,eZ=n.Ay.div`
356  font-size: 16px;
357  line-height: 20px;
358`,e0=n.Ay.span`
359  font-weight: ${D.zN.SEMIBOLD};
360  vertical-align: top;
361`,e1=n.Ay.div`
362  position: relative;
363  margin-top: 16px;
364  padding: 8px 8px 8px 36px;
365  font-size: 14px;
366  line-height: 21px;
367  white-space: pre-line;
368  background-color: ${(0,Y.B)("var(--yellow-100)",.5)};
369  border-radius: 4px;
370`,e4=(0,n.Ay)(G.Icon)`
371  position: absolute;
372  top: 8px;
373  left: 8px;
374`,e2=n.Ay.div`
375  display: flex;
376  align-items: center;
377  margin-top: 92px;
378`,e6=(0,n.Ay)(I.Sc)`
379  flex: none;
380`,e9=n.Ay.label`
381  margin-left: 16px;
382  color: var(--text-quaternary);
383  font-size: 14px;
384  line-height: 16px;
385`,e3=(0,n.Ay)(V.i)`
386  color: var(--text-primary);
387  text-decoration: underline;
388`;n.Ay.span`
389  color: var(--text-primary);
390`;let e5=n.Ay.div`
391  display: flex;
392  align-items: center;
393  justify-content: space-between;
394  padding: 24px;
395`,e8=n.Ay.div`
396  display: flex;
397  gap: 16px;
398  margin-left: auto;
399`,e7=n.Ay.label`
400  position: relative;
401  box-sizing: border-box;
402  padding: 0 16px 0 36px;
403  font-weight: ${D.zN.SEMIBOLD};
404  font-size: 14px;
405  line-height: 38px;
406  white-space: nowrap;
407  border: 1px solid var(--border-neutral-seperator-default, #e9e9e9);
408  border-radius: 4px;
409
410  &:hover {
411    background-color: var(--background-surface-secondary-selected, #99999914);
412  }
413`,re=(0,n.Ay)(G.Icon)`
414  position: absolute;
415  top: 7px;
416  left: 7px;
417  padding: 4px;
418`,rr=(0,n.Ay)(I.$n)`
419  /*
420  * 추후 수정 필요
421  - ButtonSize.BIG의 height가 box-size: border-box 기준으로 되어있음
422  - box-size: border-box를 모두 적용해주거나, height를 38px로 적용해야 함
423   */
424  box-sizing: border-box;
425  width: 134px;
426`,ri=n.Ay.div`
427  color: var(--red-500);
428  font-size: 12px;
429  line-height: 16px;
430`;var rt=i(67311);let ro=e=>(0,t.jsxs)(e5,{children:[1===e.uploadFontsStep&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(e7,{htmlFor:"file",children:[(0,t.jsx)(re,{name:"ic_add_alt_24"}),"Add more fonts"]}),(0,t.jsx)(eD,{id:"file",type:"file",accept:".ttf, .otf",onChange:e.handleChange,multiple:!0})]}),2===e.uploadFontsStep&&e.isHaveErrorFonts&&(0,t.jsx)(ri,{children:"Error occurred. Please go to previous step."}),(0,t.jsxs)(e8,{children:[e.uploadFontsStep>0&&(0,t.jsx)(rr,{size:rt.Mp.BIG,color:rt.in.SECONDARY,onClick:e.onBackClick,children:"Previous"}),e.uploadFontsStep<2?(0,t.jsx)(rr,{size:rt.Mp.BIG,color:rt.in.PRIMARY,disabled:e.isNextButtonDisabled,onClick:e.onNextClick,children:"Next"}):(0,t.jsx)(rr,{size:rt.Mp.BIG,color:rt.in.PRIMARY,disabled:e.isNextButtonDisabled,onClick:e.onAction,children:"Agree & Upload"})]})]});var ra=i(13526);let rn=n.Ay.div`
431  padding: 8px 0;
432  text-align: center;
433`,rl=n.Ay.div`
434  position: absolute;
435  top: 0;
436  right: 0;
437  left: 0;
438  width: 32px;
439  height: 32px;
440  color: var(--gray-450);
441  font-size: 16px;
442  line-height: 30px;
443  text-align: center;
444  border: 1px solid var(--border-interactive-strong-hover);
445  border-radius: 50%;
446`,rs=n.Ay.span`
447  position: absolute;
448  top: 5px;
449  left: 5px;
450  display: none;
451
452  &.isVisible {
453    display: block;
454  }
455`,rd=n.Ay.span`
456  position: absolute;
457  top: 5px;
458  left: 5px;
459  display: none;
460
461  &.isVisible {
462    display: block;
463  }
464`,rp=n.Ay.div`
465  padding: 8px 8px 8px 44px;
466  color: var(--gray-450);
467  font-size: 14px;
468  line-height: 16px;
469`,rc=n.Ay.div`
470  position: relative;
471  display: inline-block;
472  margin-left: 42px;
473
474  &:not(:first-child)::before {
475    position: absolute;
476    top: 0;
477    right: 100%;
478    bottom: 0;
479    display: block;
480    width: 42px;
481    height: 1px;
482    margin: auto 0 auto 100%;
483    background-color: var(--gray-350);
484    content: '';
485  }
486
487  &:hover {
488    ${rl} {
489      color: var(--gray-650);
490      border-color: var(--gray-650);
491    }
492
493    ${rp} {
494      color: var(--gray-650);
495    }
496  }
497
498  &.isPrevious {
499    ${rl} {
500      color: transparent;
501      background-color: var(--purple-300);
502      border-color: var(--purple-300);
503    }
504
505    ${rp} {
506      color: var(--purple-300);
507    }
508  }
509
510  &.isPrevious:before {
511    background-color: var(--purple-300);
512  }
513
514  &.isCurrent {
515    ${rl} {
516      color: var(--text-brand);
517      border-color: var(--border-feedback-info);
518    }
519
520    ${rp} {
521      color: var(--text-brand);
522    }
523  }
524
525  &.isCurrent:before {
526    background-color: var(--background-surface-brand);
527  }
528
529  &.isChecked {
530    ${rl} {
531      background-color: var(--background-surface-brand);
532    }
533  }
534
535  &.isHaveError.isCurrent {
536    ${rl} {
537      background-color: var(--red-600);
538      border-color: var(--red-600);
539    }
540
541    ${rp} {
542      color: var(--red-600);
543    }
544  }
545
546  &.isHaveError.isPrevious {
547    ${rl} {
548      background-color: var(--red-300);
549      border-color: var(--red-300);
550    }
551
552    ${rp} {
553      color: var(--red-500);
554    }
555  }
556
557  &.error_current {
558    ${rl} {
559      color: var(--red-600);
560      border-color: var(--red-600);
561    }
562
563    ${rp} {
564      color: var(--red-600);
565    }
566  }
567
568  &.error_previous {
569    ${rl} {
570      color: var(--red-500);
571      border-color: var(--red-500);
572    }
573
574    ${rp} {
575      color: var(--red-500);
576    }
577  }
578`,rx=({isVisible:e})=>(0,t.jsx)(rd,{className:(0,ra.A)({isVisible:e}),children:(0,t.jsx)(G.Icon,{name:"ic_check_24",color:"var(--fill-interactive-inverse)",size:20})}),rh=e=>(0,t.jsxs)(rn,{children:[(0,t.jsxs)(rc,{className:(0,ra.A)({isCurrent:0===e.uploadFontsStep,isPrevious:e.uploadFontsStep>0}),children:[(0,t.jsxs)(rl,{children:["1",(0,t.jsx)(rx,{isVisible:e.uploadFontsStep>=1})]}),(0,t.jsx)(rp,{children:"Upload files"})]}),(0,t.jsxs)(rc,{className:(0,ra.A)({isCurrent:1===e.uploadFontsStep,isPrevious:e.uploadFontsStep>1,isChecked:1===e.uploadFontsStep&&e.isFontUploaded,isHaveError:e.isHaveErrorFonts}),children:[(0,t.jsxs)(rl,{children:["2",(0,t.jsx)(rx,{isVisible:e.uploadFontsStep>=1&&e.isFontUploaded&&!e.isHaveErrorFonts}),(0,t.jsx)(rs,{className:(0,ra.A)({isVisible:e.isHaveErrorFonts}),children:(0,t.jsx)(G.Icon,{name:"ic_warning_triangle_24",color:"var(--fill-interactive-inverse)",size:20})})]}),(0,t.jsx)(rp,{children:"Define details"})]}),(0,t.jsxs)(rc,{className:(0,ra.A)({isCurrent:2===e.uploadFontsStep,isPrevious:e.isChecked&&e.uploadFontsStep<2,isChecked:2===e.uploadFontsStep&&e.isChecked}),children:[(0,t.jsxs)(rl,{children:["3",(0,t.jsx)(rx,{isVisible:e.isChecked})]}),(0,t.jsx)(rp,{children:"Disclaimer"})]})]});var ru=i(29993),rg=i(41541),rf=i.n(rg);let ry=e=>{var r,i;return null!=(r=null!=(i=null==e?void 0:e.en)?i:e?Object.values(e)[0]:"")?r:""},rm=/\.(otf|ttf)$/i;class rb{constructor(e,r=""){this.convertToFontMetadata=(e,r="")=>{let i=ry(e.postScriptName)||r,t=ry(e.fontFamily)||r,o=ry(e.preferredSubfamily)||ry(e.fontSubfam
578ily),a=null!==/italic/i.exec(o),n=null!==/mono/i.exec(t),l=null!==/compressed/i.exec(t),s=null!==/condensed|narrow/i.exec(t),d=5;l?d=3:s&&(d=4);let p=rb.FONT_WEIGHT_NAMING.findLastIndex(e=>null!==e&&(null!==e.exec(t)||null!==e.exec(o)));return{postscriptName:i,family:t,style:o,weight:(-1===p?4:p)*100,width:d,italic:a,monospace:n}};const i=rf().parse(e).names,t=this.convertToFontMetadata(i,r);this.postscriptName=t.postscriptName,this.family=t.family,this.style=t.style,this.weight=t.weight,this.width=t.width,this.italic=t.italic,this.monospace=t.monospace}}rb.FONT_WEIGHT_NAMING=[null,/thin|hairline/i,/extralight|ultralight|extra light|ultra light/i,/(?<!extra ?|ultra ?)light/i,/normal|regular/i,/medium/i,/semibold|demibold|semi bold|demi bold/i,/(?<!semi ?|demi ?|extra ?|ultra ?)bold/i,/extrabold|ultrabold|extra bold|ultra bold/i,/black|heavy/i];let rv=async e=>new rb(await e.arrayBuffer(),e instanceof File?e.name.replace(rm,""):""),rj=async e=>{if(""===e.type){var r,i;let t=null!=(r=null==(i=rm.exec(e.name))?void 0:i[0])?r:null;if(!t)throw Error(`${e.name} is not a font file. (otf, ttf)`);return t=t.split(".")[1],new File([await e.arrayBuffer()],e.name,{type:`font/${t}`})}return e},rw=({initialFonts:e=[],onCancel:r,onSubmit:i})=>{let o=(0,ru.K)(e=>e.org),{showErrorAlert:n}=(0,g.MW)(),[l,d]=(0,a.useState)(e),[p,c]=(0,a.useState)(!1),[f,y]=(0,a.useState)(2*(e.length>0)),[m,b]=(0,a.useState)(e.length>0),[v,j]=(0,a.useState)(!1),w=l.some(e=>e.errorMessage),A=(0,a.useMemo)(()=>0===f||(1!==f||!(l.length>0))&&(2!==f||!m||!!w),[f,l,m,w]),k=async e=>{let r=[];for(let i=0;i<e.length;i++){let t=await rv(e[i]),o=await rj(e[i]);r.push({file:o,...t})}if(l.length>0){let e,{duplicatedFonts:i,fonts:t}=((e,r)=>{let i=[],t=[];for(let o=0;o<r.length;o++)e.find(e=>e.postscriptName===r[o].postscriptName)?i.push(r[o]):t.push(r[o]);return{duplicatedFonts:i,fonts:[...e,...t]}})(l,r);r=t,i.length>0&&(e=i.map(e=>e.family).join(", "),n({title:`${e} already exists. It excluded from adding font list.`}))}d(r),y(1)},E=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?c(!0):"dragleave"===e.type&&c(!1)},S=e=>{e.preventDefault(),k(e.target.files)},F=()=>{i(l)};return(0,a.useEffect)(()=>{l.forEach(e=>{let r=URL.createObjectURL(e.file);(0,h.Q)(e.postscriptName,r,e.italic,e.weight),(0,h.Q)(e.family,r,e.italic,e.weight)})},[l]),(0,t.jsxs)(eS.A,{open:!0,onClose:r,size:"large",width:886,children:[(0,t.jsxs)(eF.c,{children:[(0,t.jsx)(eF.L,{children:"Upload fonts"}),(0,t.jsx)(e$,{name:"ic_cancel_24",color:"var(--fill-interactive-primary)",onClick:r})]}),(0,t.jsxs)(eN.R,{children:[(0,t.jsx)(rh,{uploadFontsStep:f,isChecked:m,isFontUploaded:l.length>0,isHaveErrorFonts:w}),(0,t.jsx)("form",{onSubmit:F,children:(0,t.jsx)("div",{onDragEnter:E,onKeyDown:e=>{"Enter"===e.key&&E(e)},role:"button",tabIndex:0,children:0===f?(0,t.jsxs)(ez,{htmlFor:"file",children:[(0,t.jsxs)(eI,{children:[(0,t.jsxs)(eC,{children:["Drag & drop font files here or ",(0,t.jsx)(e_,{children:"upload files"})]}),(0,t.jsx)(eC,{children:"Best format: TTF & OTF"})]}),(0,t.jsx)(eD,{id:"file",type:"file",accept:".ttf, .otf",onChange:S,multiple:!0}),p&&(0,t.jsx)(eT,{onDragEnter:E,onDragLeave:E,onDragOver:E,onDrop:e=>{var r;e.preventDefault(),e.stopPropagation(),c(!1),(null==(r=e.dataTransfer.files)?void 0:r[0])&&k(e.dataTransfer.files)}})]}):1===f?(0,t.jsx)(eP,{children:(0,t.jsxs)(eM,{children:[(0,t.jsxs)(eL,{children:[(0,t.jsx)(eO,{children:"File"}),(0,t.jsx)(eO,{children:"Font name"}),(0,t.jsx)(eO,{children:"Weight"}),(0,t.jsx)(eU,{children:"Style"}),(0,t.jsx)(eR,{})]}),l.length>0?(0,t.jsx)(eH,{children:l.map((e,r)=>(0,t.jsxs)(eG,{children:[(0,t.jsxs)(eK,{children:[(0,t.jsx)(eq,{children:e.file.name}),(0,t.jsx)(eq,{children:(0,t.jsx)(s,{family:e.family,postscriptName:e.postscriptName,weight:e.weight,italic:e.italic,children:e.family})}),(0,t.jsx)(eq,{children:u(e.weight)}),(0,t.jsx)(eV,{children:e.italic?"Italic":"Normal"}),(0,t.jsx)(eY,{children:(0,t.jsx)(eX,{color:"var(--fill-interactive-primary)",name:"ic_delete_24",onClick:()=>{d(l.filter(r=>r!==e))}})})]}),e.errorMessage&&(0,t.jsx)(eW,{children:e.errorMessage})]},r))}):(0,t.jsx)(eQ,{children:"No font files"})]})}):(0,t.jsxs)(eJ,{children:[(0,t.jsxs)(eZ,{children:["Before uploading custom fonts to ",(0,t.jsx)(e0,{children:o.name}),", please read the following"]}),(0,t.jsxs)(e1,{children:[(0,t.jsx)(e4,{name:"ic_warning_triangle_24",size:20,color:"var(--icon-feedback-warning)"}),(0,t.jsx)(e0,{children:"Important note"}),(0,t.jsx)("br",{}),"Sharing a Pie with custom fonts may lead to license violations if the receiver extracts the files without necessary rights. Please make sure your organization can legally use and share the uploaded custom fonts.",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"Also, keep in mind that any fonts uploaded will be accessible to all members of the organization, regardless of their team."]}),(0,t.jsxs)(e2,{children:[(0,t.jsx)(e6,{id:"important_note_check",checked:m,onClick:()=>{v||b(!m)}}),(0,t.jsxs)(e9,{htmlFor:"important_note_check",children:["By checking this box, you agree to"," ",(0,t.jsx)(e3,{newTab:!0,to:x.L$,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:"ProtoPie's Terms of Service"})," ","and"," ",(0,t.jsx)(e3,{newTab:!0,to:x.H2,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:"Privacy Policy"}),", acknowledging the rights and risks of using custom fonts"]})]})]})})})]}),(0,t.jsx)(ro,{isHaveErrorFonts:w,isNextButtonDisabled:A,uploadFontsStep:f,onBackClick:()=>{1===f&&d([]),2===f&&b(!1),y(f-1)},onNextClick:()=>{y(f+1)},handleChange:S,onAction:F})]})},rA=()=>{var e;let r,i,{showAlert:n,showErrorAlert:l}=(0,g.MW)(),[A,k]=(0,a.useState)(!1),[I,C]=(0,a.useState)([]),[_,D]=(0,a.useState)(""),[T,P]=(0,a.useState)(null),[M,B]=(0,a.useState)(!0),L=(0,f.d)(_,300),O=(({search:e="",order:r="postscriptName"}={})=>(0,$.v)(j.IA.fontsList(e,r),()=>E.getFonts({search:e,order:r}),{placeholderData:N.rX}))({search:L,order:M?"postscriptName":"-postscriptName"}),R=(r=(0,b.jE)(),(0,w.C)([j.IA.key,"uploadFonts"],async e=>{let r=await Promise.allSettled(e.map(e=>{let r;return E.updateFonts(((r=new FormData).append("file",e.file),r.append("weight",`${e.weight}`),r.append("family",e.family),r.append("style",e.style),r.append("italic",`${e.italic}`),r.append("monospace",`${e.monospace}`),r.append("width",`${e.width}`),r.append("postscriptName",e.postscriptName),r))})),i=r.some(e=>"fulfilled"===e.status),t=[],o=[];for(let[i,a]of r.entries()){if("rejected"!==a.status)continue;let r=e[i];if(!(a.reason instanceof S.Hl)){t.push(r);continue}let n=a.reason;if(n.errorCode===v.O.PERMISSION_DENIED)throw n;
578if("DUPLICATED_FONT"===n.errorCode){o.push(r);continue}t.push({...r,errorMessage:F[n.errorCode]})}return{failedFonts:t,duplicatedFonts:o,hasSuccess:i}},{retry:0,onSettled:()=>{r.invalidateQueries({queryKey:j.IA.fonts()})}})),G=(i=(0,b.jE)(),(0,w.C)([j.IA.key,"deleteFont"],e=>E.deleteFonts(e),{retry:0,onSuccess:()=>{i.invalidateQueries({queryKey:j.IA.fonts()})}})),K=(0,a.useMemo)(()=>{var e,r;return null!=(e=null==(r=O.data)?void 0:r.fonts)?e:[]},[O.data]),q=(null==(e=O.data)?void 0:e.noAnyFonts)===!0,V=0===K.length&&!q&&!O.isLoading,Y=R.isPending,en=O.isLoading,es=()=>{P(null)},ef=()=>{k(!0)};return(0,a.useEffect)(()=>{K.forEach(e=>{(0,h.Q)(e.postscriptName,e.url,e.italic,e.weight),(0,h.Q)(e.family,e.url,e.italic,e.weight)})},[K]),(0,t.jsxs)(W,{children:[(0,t.jsx)(Q,{children:"Custom fonts"}),(0,t.jsxs)(X,{children:["Upload custom fonts for prototypes to always display your team's custom fonts properly across ProtoPie Studio, Cloud & Player.",(0,t.jsx)("br",{}),"All editors will be able to use these custom fonts.",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"ProtoPie supports, TTF & OTF.",(0,t.jsx)("br",{}),(0,t.jsx)(J,{to:x.mx,newTab:!0,children:"Learn more about uploading Custom fonts"})]}),(0,t.jsxs)(Z,{children:[(0,t.jsx)(ei,{name:"ic_warning_triangle_24",size:16,color:"var(--icon-feedback-warning)"}),(0,t.jsxs)(ee,{children:[(0,t.jsx)(er,{children:"Important: "}),"Before adding fonts, make sure you understand and have appropriate permission to use them. ProtoPie is not liable for font licenses and usage."]})]}),q&&!Y?(0,t.jsx)(U,{handleUploadClick:ef}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(et,{children:[(0,t.jsx)(eo,{children:(0,t.jsx)(c.q,{placeholder:"Search fonts",onChange:D})}),(0,t.jsx)(o.$,{variant:"outlined",color:"secondary",size:"large",startIcon:"ic_add_24",onClick:ef,children:"Upload fonts"})]}),(0,t.jsxs)(ea,{children:[(0,t.jsxs)(el,{children:[(0,t.jsxs)(ed,{onClick:()=>{B(e=>!e)},children:["Font name",(0,t.jsx)(ep,{direction:M?p.Y.DOWN:p.Y.UP})]}),(0,t.jsx)(ec,{children:"Weight"}),(0,t.jsx)(ex,{children:"Style"}),(0,t.jsx)(eh,{children:"Size"}),(0,t.jsx)(eu,{})]}),(Y||en)&&(0,t.jsx)(eE,{children:(0,t.jsx)(d.m,{size:24})}),en?null:V?(0,t.jsx)(H,{currentSearchKeyword:L}):(0,t.jsx)(ek,{children:K.map(e=>(0,t.jsxs)(eg,{children:[(0,t.jsx)(ey,{children:(0,t.jsx)(s,{family:e.family,postscriptName:e.postscriptName,weight:e.weight,italic:e.italic,children:e.family})}),(0,t.jsx)(em,{children:u(e.weight)}),(0,t.jsx)(eb,{children:e.italic?"Italic":"Normal"}),(0,t.jsxs)(ev,{children:[(0,z.qC)(Math.round(e.size/1e3)),"KB"]}),(0,t.jsxs)(ej,{children:[(0,t.jsx)(ew,{name:"ic_more_horizontal_24",size:20,color:"var(--fill-interactive-tertiary)",onClick:r=>{(r.stopPropagation(),T===e)?es():P(e)}}),T===e&&(0,t.jsx)(eA,{onClickOutside:es,onClick:()=>{es(),G.mutate(e.id,{onSuccess:()=>n({title:"Font removed"}),onError:()=>l({title:(0,y.$l)(m.M.ErrorUnexpected)})})},children:"Remove"})]})]},e.id))})]})]}),A&&(0,t.jsx)(rw,{initialFonts:I,onCancel:()=>{k(!1),C([])},onSubmit:e=>{k(!1),C([]),R.mutate(e,{onSuccess:({failedFonts:e,duplicatedFonts:r,hasSuccess:i})=>{if(i&&n({title:"Updated successfully"}),r.length>0){let e=r.map(e=>e.family).join(", ");l({title:`${e} already exists. It excluded from adding font list.`})}e.length>0&&(C(e),k(!0))},onError:()=>{l({title:(0,y.$l)(m.M.ErrorUnexpected)})}})}})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.