@adoptaunabuelo/react-components 0.1.15 → 0.1.17
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/cjs/components/Avatar/Avatar.d.ts +10 -0
- package/dist/cjs/components/Menu/Menu.d.ts +2 -2
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/index.js +49 -29
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +10 -0
- package/dist/esm/components/Menu/Menu.d.ts +2 -2
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/index.js +45 -25
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +29 -19
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
declare const Avatar: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Avatar;
|
|
4
|
+
export interface Props extends ComponentPropsWithoutRef<"div"> {
|
|
5
|
+
icon?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
editable?: boolean;
|
|
8
|
+
clickable?: boolean;
|
|
9
|
+
onChange?: (file: any) => void;
|
|
10
|
+
}
|
|
@@ -9,8 +9,8 @@ export interface MenuProps {
|
|
|
9
9
|
icon?: JSX.Element;
|
|
10
10
|
Icon?: JSX.Element;
|
|
11
11
|
position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
12
|
-
children
|
|
13
|
-
options
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
options?: Array<OptionsProps>;
|
|
14
14
|
onChange?: (visible: boolean) => void;
|
|
15
15
|
onClick?: (option: OptionsProps) => void;
|
|
16
16
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -71,7 +71,7 @@ import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as React from"react";imp
|
|
|
71
71
|
font-family: 'Poppins';
|
|
72
72
|
margin: 0px;
|
|
73
73
|
color: ${Color.text.full};
|
|
74
|
-
`,P=e=>{const{style:t,type:n,children:r,weight:a}=e,o=__rest(e,["style","type","children","weight"]);return jsx(PStyled,Object.assign({style:Object.assign({fontSize:"p"===n?15:"p2"===n?14:"c1"===n?12:10,fontWeight:"semibold"===a?600:"medium"===a?500:400},t)},o,{children:r}))},Text=e=>"h1"===e.type||"h2"===e.type||"h3"===e.type||"h4"===e.type||"h5"===e.type||"h6"===e.type?jsx(Header,Object.assign({role:"header"},e,{children:e.children})):jsx(P,Object.assign({role:"paragraph"},e,{children:e.children})),Container$8=qe.div`
|
|
74
|
+
`,P=e=>{const{style:t,type:n,children:r,weight:a}=e,o=__rest(e,["style","type","children","weight"]);return jsx(PStyled,Object.assign({style:Object.assign({fontSize:"p"===n?15:"p2"===n?14:"c1"===n?12:10,fontWeight:"semibold"===a?600:"medium"===a?500:400},t)},o,{children:r}))},Text$1=e=>"h1"===e.type||"h2"===e.type||"h3"===e.type||"h4"===e.type||"h5"===e.type||"h6"===e.type?jsx(Header,Object.assign({role:"header"},e,{children:e.children})):jsx(P,Object.assign({role:"paragraph"},e,{children:e.children})),Container$8=qe.div`
|
|
75
75
|
display: flex;
|
|
76
76
|
flex: 1;
|
|
77
77
|
height: 6px;
|
|
@@ -103,7 +103,7 @@ import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as React from"react";imp
|
|
|
103
103
|
flex-direction: row;
|
|
104
104
|
align-items: center;
|
|
105
105
|
margin: 16px;
|
|
106
|
-
`,FeedBack=e=>{var{type:t="success",isVisible:n=!1}=e,r=__rest(e,["type","isVisible"]);const[a,o]=useState(!1);return useEffect((()=>{o(n),setTimeout((()=>{r.onClose&&r.onClose(),o(!1)}),3e3)}),[n]),a?jsx(Container$7,Object.assign({type:t},r,{role:"feedback"},{children:jsxs(View,{children:[jsx("success"===t?Check:X,{style:{marginRight:12},color:"white",height:24,width:24}),jsx(Text,Object.assign({type:"p",style:{display:"flex",flex:1,color:"white"}},{children:r.text}))]})})):null};
|
|
106
|
+
`,FeedBack=e=>{var{type:t="success",isVisible:n=!1}=e,r=__rest(e,["type","isVisible"]);const[a,o]=useState(!1);return useEffect((()=>{o(n),setTimeout((()=>{r.onClose&&r.onClose(),o(!1)}),3e3)}),[n]),a?jsx(Container$7,Object.assign({type:t},r,{role:"feedback"},{children:jsxs(View,{children:[jsx("success"===t?Check:X,{style:{marginRight:12},color:"white",height:24,width:24}),jsx(Text$1,Object.assign({type:"p",style:{display:"flex",flex:1,color:"white"}},{children:r.text}))]})})):null};
|
|
107
107
|
/*! *****************************************************************************
|
|
108
108
|
Copyright (c) Microsoft Corporation.
|
|
109
109
|
|
|
@@ -139,7 +139,7 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
139
139
|
:active {
|
|
140
140
|
transform: ${e=>e.disabled||e.loading?"none":"scale(0.95)"};
|
|
141
141
|
}
|
|
142
|
-
`,Label$2=qe(Text)`
|
|
142
|
+
`,Label$2=qe(Text$1)`
|
|
143
143
|
font-size: ${e=>"small"===e.size?"14px":"15px"};
|
|
144
144
|
width: 100%;
|
|
145
145
|
margin-left: ${e=>e.icon?6:0};
|
|
@@ -165,7 +165,7 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
165
165
|
:active {
|
|
166
166
|
transform: ${e=>e.disabled||e.loading?"none":"scale(0.95)"};
|
|
167
167
|
}
|
|
168
|
-
`,Label$1=qe(Text)`
|
|
168
|
+
`,Label$1=qe(Text$1)`
|
|
169
169
|
font-size: ${e=>"small"===e.size?"14px":"15px"};
|
|
170
170
|
width: 100%;
|
|
171
171
|
color: white;
|
|
@@ -214,10 +214,10 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
214
214
|
}
|
|
215
215
|
`,ChildrenView$1=qe.div`
|
|
216
216
|
margin-top: 4px;
|
|
217
|
-
`,Icon$
|
|
217
|
+
`,Icon$2=qe.img`
|
|
218
218
|
height: 24px;
|
|
219
219
|
width: 24px;
|
|
220
|
-
`,ButtonImage=e=>jsxs(Container$6,Object.assign({role:"button"},e,{disabled:e.disabled||e.loading,onClick:t=>e.onClick&&!e.loading&&!e.disabled&&e.onClick(t)},{children:[e.icon?e.icon:jsx(Icon$
|
|
220
|
+
`,ButtonImage=e=>jsxs(Container$6,Object.assign({role:"button"},e,{disabled:e.disabled||e.loading,onClick:t=>e.onClick&&!e.loading&&!e.disabled&&e.onClick(t)},{children:[e.icon?e.icon:jsx(Icon$2,{src:e.src}),jsx(ChildrenView$1,{children:e.children})]})),CallToActionStyled=qe.button`
|
|
221
221
|
display: flex;
|
|
222
222
|
gap: 8px;
|
|
223
223
|
align-items: center;
|
|
@@ -288,20 +288,20 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
288
288
|
:hover{
|
|
289
289
|
background-color: ${Color.background.soft};
|
|
290
290
|
}
|
|
291
|
-
`,Icon=qe.div`
|
|
291
|
+
`,Icon$1=qe.div`
|
|
292
292
|
display: flex;
|
|
293
293
|
align-items: center;
|
|
294
294
|
justify-content: center;
|
|
295
295
|
height: 24px;
|
|
296
296
|
width: 24px;
|
|
297
297
|
margin-right: 8px;
|
|
298
|
-
`,Title$1=qe(Text)`
|
|
298
|
+
`,Title$1=qe(Text$1)`
|
|
299
299
|
flex: 1;
|
|
300
300
|
color: ${e=>e.color?e.color:Color.text.full};
|
|
301
301
|
margin-left: 6px;
|
|
302
302
|
margin-top: ${e=>e.focus?"15px":"0px"};
|
|
303
303
|
transition: margin-top 0.1s ease-out;
|
|
304
|
-
`,Select$1=e=>{var t;const n=Flags,[r,a]=useState(!1),[o,i]=useState(void 0),[l,s]=useState(e.options),[c,d]=useState(void 0);useEffect((()=>{if(e.options){const t=e.options.sort(((e,t)=>e.esCountry.localeCompare(t.esCountry)));d(new Fuse(t,{keys:["esCountry","enCountry","prefix"]})),i(Object.assign(Object.assign({},e.options[0]),{flag:n[e.options[0].countryCode]})),s(t)}}),[e.options]),useEffect((()=>(window.addEventListener("mousedown",(e=>u(e))),window.removeEventListener("mousedown",(()=>{})))),[]),useEffect((()=>{e.selectedItem&&i(Object.assign(Object.assign({},e.selectedItem),{flag:n[e.selectedItem.countryCode]}))}),[e.selectedItem]);const u=t=>{const n=document.getElementById(e.id);n&&(n.contains(t.target)||a(!1))};return jsxs(Container$5,{children:[jsx(SelectStyled$1,Object.assign({role:"select",style:e.style,showMenu:r,onClick:e=>{if(!e)e=window.event;e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),a(!r)}},{children:o&&jsxs(Fragment,{children:[jsx(Icon,{children:jsx(o.flag,{height:24,width:24})}),jsx(r?ChevronUp:ChevronDown,{height:20,width:20,color:Color.text.high}),jsx(Title$1,Object.assign({type:"p",focus:e.focus,color:null===(t=e.style)||void 0===t?void 0:t.color},{children:o.prefix}))]})})),r&&jsxs(OptionsView$1,Object.assign({role:"menu",id:e.id,style:e.optionStyle},{children:[jsx(SearchBar,{id:"phone-search-bar",placeholder:"Buscar",type:"small",style:{padding:"8px 16px",position:"sticky",backgroundColor:"white",top:0,borderBottom:"1px solid "+Color.line.soft,height:30},design:"secondary",onChange:t=>{const n=t.target.value;if(n){const e=c.search(n).map((e=>e.item));s(e)}else s(e.options)}}),l&&l.map(((t,r)=>{const o=n[t.countryCode];return jsxs(Option$1,Object.assign({role:"country"+r,onClick:r=>((t,r)=>{r||(r=window.event);r.cancelBubble=!0,r.stopPropagation&&r.stopPropagation(),i(Object.assign(Object.assign({},t),{flag:n[t.countryCode]})),a(!1),s(e.options),e.onChange&&e.onChange(t)})(t,r)},{children:[jsx(Icon,{children:jsx(o,{height:24,width:24})}),jsxs(Text,Object.assign({type:"p",style:{fontSize:14,display:"flex",alignItems:"center"}},{children:[t.esCountry,jsxs("span",Object.assign({style:{marginLeft:4}},{children:["(",t.prefix,")"]}))]}))]}),"country"+r)}))]}))]})},Input$1=qe.input`
|
|
304
|
+
`,Select$1=e=>{var t;const n=Flags,[r,a]=useState(!1),[o,i]=useState(void 0),[l,s]=useState(e.options),[c,d]=useState(void 0);useEffect((()=>{if(e.options){const t=e.options.sort(((e,t)=>e.esCountry.localeCompare(t.esCountry)));d(new Fuse(t,{keys:["esCountry","enCountry","prefix"]})),i(Object.assign(Object.assign({},e.options[0]),{flag:n[e.options[0].countryCode]})),s(t)}}),[e.options]),useEffect((()=>(window.addEventListener("mousedown",(e=>u(e))),window.removeEventListener("mousedown",(()=>{})))),[]),useEffect((()=>{e.selectedItem&&i(Object.assign(Object.assign({},e.selectedItem),{flag:n[e.selectedItem.countryCode]}))}),[e.selectedItem]);const u=t=>{const n=document.getElementById(e.id);n&&(n.contains(t.target)||a(!1))};return jsxs(Container$5,{children:[jsx(SelectStyled$1,Object.assign({role:"select",style:e.style,showMenu:r,onClick:e=>{if(!e)e=window.event;e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),a(!r)}},{children:o&&jsxs(Fragment,{children:[jsx(Icon$1,{children:jsx(o.flag,{height:24,width:24})}),jsx(r?ChevronUp:ChevronDown,{height:20,width:20,color:Color.text.high}),jsx(Title$1,Object.assign({type:"p",focus:e.focus,color:null===(t=e.style)||void 0===t?void 0:t.color},{children:o.prefix}))]})})),r&&jsxs(OptionsView$1,Object.assign({role:"menu",id:e.id,style:e.optionStyle},{children:[jsx(SearchBar,{id:"phone-search-bar",placeholder:"Buscar",type:"small",style:{padding:"8px 16px",position:"sticky",backgroundColor:"white",top:0,borderBottom:"1px solid "+Color.line.soft,height:30},design:"secondary",onChange:t=>{const n=t.target.value;if(n){const e=c.search(n).map((e=>e.item));s(e)}else s(e.options)}}),l&&l.map(((t,r)=>{const o=n[t.countryCode];return jsxs(Option$1,Object.assign({role:"country"+r,onClick:r=>((t,r)=>{r||(r=window.event);r.cancelBubble=!0,r.stopPropagation&&r.stopPropagation(),i(Object.assign(Object.assign({},t),{flag:n[t.countryCode]})),a(!1),s(e.options),e.onChange&&e.onChange(t)})(t,r)},{children:[jsx(Icon$1,{children:jsx(o,{height:24,width:24})}),jsxs(Text$1,Object.assign({type:"p",style:{fontSize:14,display:"flex",alignItems:"center"}},{children:[t.esCountry,jsxs("span",Object.assign({style:{marginLeft:4}},{children:["(",t.prefix,")"]}))]}))]}),"country"+r)}))]}))]})},Input$1=qe.input`
|
|
305
305
|
font-family: 'Poppins';
|
|
306
306
|
font-size: 15px;
|
|
307
307
|
border: none;
|
|
@@ -349,7 +349,7 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
349
349
|
flex-direction: column;
|
|
350
350
|
`,IconView$2=qe.div`
|
|
351
351
|
margin-right: 8px;
|
|
352
|
-
`,InputPrimary=e=>{const t=GLPN.PhoneNumberUtil.getInstance(),[n,r]=useState(void 0),[a,o]=useState(Country[0]),[i,l]=useState(!1);useEffect((()=>{r(e.value)}),[e.value]),useEffect((()=>{if(e.country){const t=Country.filter((t=>t.countryCode===e.country));o(t[0])}}),[e.country]);return jsxs(Container$4,Object.assign({style:e.containerStyle},{children:[jsxs(InputContainer$1,Object.assign({error:!!e.error,style:e.style,focus:i},{children:[e.icon?jsx(IconView$2,{children:e.icon}):"tel"===e.type?jsx(IconView$2,{children:jsx(Select$1,{optionStyle:{top:45},selectedItem:a,onChange:r=>(r=>{o(r);const a=r.prefix+(n||"");e.onPhoneChange&&e.onPhoneChange({country:r.prefix,value:n,isValid:a.length>=6&&a.length<18&&t.isValidNumberForRegion(t.parse(a,r.countryCode),r.countryCode)})})(r),id:"country",options:Country,focus:!1})}):null,jsx(Column$1,{children:jsx(InputStyled$1,Object.assign({},e,{value:n,onChange:n=>{if(r(n.target.value),e.onChange&&e.onChange(n),"tel"===e.type){const r=a.prefix+n.target.value;e.onPhoneChange&&e.onPhoneChange({country:a.prefix,value:n.target.value,isValid:r.length>8&&r.length<18&&t.isValidNumberForRegion(t.parse(r,a.countryCode),a.countryCode)})}},onFocus:t=>{l(!0),e.onFocus&&e.onFocus(t)},onBlur:t=>{l(!1),e.onBlur&&e.onBlur(t)}}))})]})),e.error&&jsx(ErrorDiv$1,Object.assign({role:"error"},{children:jsx(Text,Object.assign({type:"p",style:{color:Color.status.color.error,marginTop:8,fontSize:14,lineHeight:"18px"}},{children:e.error}))}))]}))},Container$3=qe.div`
|
|
352
|
+
`,InputPrimary=e=>{const t=GLPN.PhoneNumberUtil.getInstance(),[n,r]=useState(void 0),[a,o]=useState(Country[0]),[i,l]=useState(!1);useEffect((()=>{r(e.value)}),[e.value]),useEffect((()=>{if(e.country){const t=Country.filter((t=>t.countryCode===e.country));o(t[0])}}),[e.country]);return jsxs(Container$4,Object.assign({style:e.containerStyle},{children:[jsxs(InputContainer$1,Object.assign({error:!!e.error,style:e.style,focus:i},{children:[e.icon?jsx(IconView$2,{children:e.icon}):"tel"===e.type?jsx(IconView$2,{children:jsx(Select$1,{optionStyle:{top:45},selectedItem:a,onChange:r=>(r=>{o(r);const a=r.prefix+(n||"");e.onPhoneChange&&e.onPhoneChange({country:r.prefix,value:n,isValid:a.length>=6&&a.length<18&&t.isValidNumberForRegion(t.parse(a,r.countryCode),r.countryCode)})})(r),id:"country",options:Country,focus:!1})}):null,jsx(Column$1,{children:jsx(InputStyled$1,Object.assign({},e,{value:n,onChange:n=>{if(r(n.target.value),e.onChange&&e.onChange(n),"tel"===e.type){const r=a.prefix+n.target.value;e.onPhoneChange&&e.onPhoneChange({country:a.prefix,value:n.target.value,isValid:r.length>8&&r.length<18&&t.isValidNumberForRegion(t.parse(r,a.countryCode),a.countryCode)})}},onFocus:t=>{l(!0),e.onFocus&&e.onFocus(t)},onBlur:t=>{l(!1),e.onBlur&&e.onBlur(t)}}))})]})),e.error&&jsx(ErrorDiv$1,Object.assign({role:"error"},{children:jsx(Text$1,Object.assign({type:"p",style:{color:Color.status.color.error,marginTop:8,fontSize:14,lineHeight:"18px"}},{children:e.error}))}))]}))},Container$3=qe.div`
|
|
353
353
|
`,InputContainer=qe.div`
|
|
354
354
|
position: relative;
|
|
355
355
|
display: flex;
|
|
@@ -378,14 +378,14 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
378
378
|
flex-direction: column;
|
|
379
379
|
`,IconView$1=qe.div`
|
|
380
380
|
margin-right: 8px;
|
|
381
|
-
`,Placeholder=qe(Text)`
|
|
381
|
+
`,Placeholder=qe(Text$1)`
|
|
382
382
|
position: absolute;
|
|
383
383
|
top: ${e=>e.focus?"8px":"16px"};
|
|
384
384
|
left: ${e=>e.phone?e.focus?"74px":"112px":"unset"};
|
|
385
385
|
color: ${e=>e.error?Color.status.color.error:Color.text.high};
|
|
386
386
|
font-size: ${e=>e.focus?"12px":"15px"} !important;
|
|
387
387
|
transition: top 0.1s ease-out, font-size 0.1s ease-out;
|
|
388
|
-
`,InputSecondary=e=>{const t=GLPN.PhoneNumberUtil.getInstance(),n=useRef(null),[r,a]=useState(void 0),[o,i]=useState(Country[0]),[l,s]=useState(!1);useEffect((()=>{a(e.value)}),[e.value]),useEffect((()=>{if(e.country){const t=Country.filter((t=>t.countryCode===e.country));i(t[0])}}),[e.country]);return jsxs(Container$3,Object.assign({style:e.containerStyle},{children:[jsxs(InputContainer,Object.assign({error:!!e.error,style:e.style,focus:l,onClick:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}},{children:[e.icon?jsx(IconView$1,{children:e.icon}):"tel"===e.type?jsx(IconView$1,{children:jsx(Select$1,{selectedItem:o,onChange:n=>(n=>{i(n);const a=n.prefix+(r||"");e.onPhoneChange&&e.onPhoneChange({country:n.prefix,value:r,isValid:a.length>=6&&a.length<18&&t.isValidNumberForRegion(t.parse(a,n.countryCode),n.countryCode)})})(n),id:"country",options:Country,focus:!(!l&&!r)})}):null,jsxs(Column,{children:[jsx(Placeholder,Object.assign({role:"placeholder",type:"p",phone:"tel"===e.type,focus:!!(l||r||e.defaultValue),error:!!e.error},{children:e.placeholder})),jsx(InputStyled$1,Object.assign({ref:n},e,{value:e.value?e.value:r,placeholder:"",style:Object.assign({marginTop:14,opacity:"date"===e.type||"time"===e.type?l||r||e.defaultValue?1:0:1},e.style),onChange:n=>{if(a(n.target.value),e.onChange&&e.onChange(n),"tel"===e.type){const r=o.prefix+n.target.value;e.onPhoneChange&&e.onPhoneChange({country:o.prefix,value:n.target.value,isValid:r.length>8&&r.length<18&&t.isValidNumberForRegion(t.parse(r,o.countryCode),o.countryCode)})}},onFocus:t=>{s(!0),e.onFocus&&e.onFocus(t)},onBlur:t=>{s(!1),e.onBlur&&e.onBlur(t)}}))]})]})),e.error&&jsx(ErrorDiv,Object.assign({role:"error"},{children:jsx(Text,Object.assign({type:"p",style:{color:Color.status.color.error,marginTop:8,fontSize:14,lineHeight:"18px"}},{children:e.error}))}))]}))},Container$2=qe.div`
|
|
388
|
+
`,InputSecondary=e=>{const t=GLPN.PhoneNumberUtil.getInstance(),n=useRef(null),[r,a]=useState(void 0),[o,i]=useState(Country[0]),[l,s]=useState(!1);useEffect((()=>{a(e.value)}),[e.value]),useEffect((()=>{if(e.country){const t=Country.filter((t=>t.countryCode===e.country));i(t[0])}}),[e.country]);return jsxs(Container$3,Object.assign({style:e.containerStyle},{children:[jsxs(InputContainer,Object.assign({error:!!e.error,style:e.style,focus:l,onClick:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}},{children:[e.icon?jsx(IconView$1,{children:e.icon}):"tel"===e.type?jsx(IconView$1,{children:jsx(Select$1,{selectedItem:o,onChange:n=>(n=>{i(n);const a=n.prefix+(r||"");e.onPhoneChange&&e.onPhoneChange({country:n.prefix,value:r,isValid:a.length>=6&&a.length<18&&t.isValidNumberForRegion(t.parse(a,n.countryCode),n.countryCode)})})(n),id:"country",options:Country,focus:!(!l&&!r)})}):null,jsxs(Column,{children:[jsx(Placeholder,Object.assign({role:"placeholder",type:"p",phone:"tel"===e.type,focus:!!(l||r||e.defaultValue),error:!!e.error},{children:e.placeholder})),jsx(InputStyled$1,Object.assign({ref:n},e,{value:e.value?e.value:r,placeholder:"",style:Object.assign({marginTop:14,opacity:"date"===e.type||"time"===e.type?l||r||e.defaultValue?1:0:1},e.style),onChange:n=>{if(a(n.target.value),e.onChange&&e.onChange(n),"tel"===e.type){const r=o.prefix+n.target.value;e.onPhoneChange&&e.onPhoneChange({country:o.prefix,value:n.target.value,isValid:r.length>8&&r.length<18&&t.isValidNumberForRegion(t.parse(r,o.countryCode),o.countryCode)})}},onFocus:t=>{s(!0),e.onFocus&&e.onFocus(t)},onBlur:t=>{s(!1),e.onBlur&&e.onBlur(t)}}))]})]})),e.error&&jsx(ErrorDiv,Object.assign({role:"error"},{children:jsx(Text$1,Object.assign({type:"p",style:{color:Color.status.color.error,marginTop:8,fontSize:14,lineHeight:"18px"}},{children:e.error}))}))]}))},Container$2=qe.div`
|
|
389
389
|
display: flex;
|
|
390
390
|
flex-direction: column;
|
|
391
391
|
position: relative;
|
|
@@ -475,7 +475,7 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
475
475
|
flex-direction: row;
|
|
476
476
|
justify-content: space-between;
|
|
477
477
|
margin-top: 8px;
|
|
478
|
-
`,InputRange=e=>{const t=createRef(),[n,r]=useState(e.value&&"number"==typeof e.value?e.value:e.defaultValue&&"number"==typeof e.defaultValue?e.defaultValue:0),[a,o]=useState(0),{style:i}=e,l=__rest(e,["style"]);useEffect((()=>{e.value&&"number"==typeof e.value&&r(e.value)}),[e.value]),useEffect((()=>{t.current&&o(t.current.offsetWidth)}),[t.current]);return jsxs(Container$2,Object.assign({ref:t,style:i},{children:[!e.hideRange&&jsx(RangeValue,Object.assign({role:"range",id:"bubbleHeight",value:e.min&&e.max?(n-e.min)/(e.max-e.min)*a:n/100*a},{children:jsx(RangeValueSpan,{children:n})})),jsx(InputStyled,Object.assign({role:"input"},l,{id:"rangeHeight",type:"range",backValue:e.min&&e.max?(n-e.min)/(e.max-e.min)*a:n/100*a,onChange:t=>{r(parseInt(t.target.value)),e.onChange&&e.onChange(t)}})),e.min&&e.max?jsxs(BottomRow,{children:[jsxs(Text,Object.assign({type:"p2",style:{color:Color.text.high}},{children:[e.min," ",e.unit]})),jsxs(Text,Object.assign({type:"p2",style:{color:Color.text.high}},{children:[e.max," ",e.unit]}))]}):null]}))};var dist={},PlacesAutocomplete$1={},propTypes={exports:{}},objectAssign,hasRequiredObjectAssign,ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret,has,hasRequiredHas,checkPropTypes_1,hasRequiredCheckPropTypes,factoryWithTypeCheckers,hasRequiredFactoryWithTypeCheckers,factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireObjectAssign(){if(hasRequiredObjectAssign)return objectAssign;hasRequiredObjectAssign=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return objectAssign=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,a){for(var o,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),s=1;s<arguments.length;s++){for(var c in o=Object(arguments[s]))t.call(o,c)&&(l[c]=o[c]);if(e){i=e(o);for(var d=0;d<i.length;d++)n.call(o,i[d])&&(l[i[d]]=o[i[d]])}}return l},objectAssign}function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;return ReactPropTypesSecret_1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function requireHas(){return hasRequiredHas?has:(hasRequiredHas=1,has=Function.call.bind(Object.prototype.hasOwnProperty))}function requireCheckPropTypes(){if(hasRequiredCheckPropTypes)return checkPropTypes_1;hasRequiredCheckPropTypes=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=requireReactPropTypesSecret(),n={},r=requireHas();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function a(a,o,i,l,s){if("production"!==process.env.NODE_ENV)for(var c in a)if(r(a,c)){var d;try{if("function"!=typeof a[c]){var u=Error((l||"React class")+": "+i+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=a[c](o,c,l,i,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((l||"React class")+": type specification of "+i+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=s?s():"";e("Failed "+i+" type: "+d.message+(null!=h?h:""))}}}return a.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},checkPropTypes_1=a}function requireFactoryWithTypeCheckers(){if(hasRequiredFactoryWithTypeCheckers)return factoryWithTypeCheckers;hasRequiredFactoryWithTypeCheckers=1;var e=reactIs$1.exports,t=requireObjectAssign(),n=requireReactPropTypesSecret(),r=requireHas(),a=requireCheckPropTypes(),o=function(){};function i(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),factoryWithTypeCheckers=function(l,s){var c="function"==typeof Symbol&&Symbol.iterator,d="@@iterator";var u="<<anonymous>>",h={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:m(i),arrayOf:function(e){return m((function(t,r,a,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+a+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new f("Invalid "+o+" `"+i+"` of type `"+_(l)+"` supplied to `"+a+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,a,o,i+"["+s+"]",n);if(c instanceof Error)return c}return null}))},element:m((function(e,t,n,r,a){var o=e[t];return l(o)?null:new f("Invalid "+r+" `"+a+"` of type `"+_(o)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:m((function(t,n,r,a,o){var i=t[n];return e.isValidElementType(i)?null:new f("Invalid "+a+" `"+o+"` of type `"+_(i)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return m((function(t,n,r,a,o){if(!(t[n]instanceof e)){var i=e.name||u;return new f("Invalid "+a+" `"+o+"` of type `"+(((l=t[n]).constructor&&l.constructor.name?l.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+i+"`.")}var l;return null}))},node:m((function(e,t,n,r,a){return v(e[t])?null:new f("Invalid "+r+" `"+a+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return m((function(t,a,o,i,l){if("function"!=typeof e)return new f("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[a],c=_(s);if("object"!==c)return new f("Invalid "+i+" `"+l+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var d in s)if(r(s,d)){var u=e(s,d,o,i,l+"."+d,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),i;return m((function(t,n,r,a,o){for(var i=t[n],l=0;l<e.length;l++)if(p(i,e[l]))return null;var s=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new f("Invalid "+a+" `"+o+"` of value `"+String(i)+"` supplied to `"+r+"`, expected one of "+s+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var t=0;t<e.length;t++){var a=e[t];if("function"!=typeof a)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(a)+" at index "+t+"."),i}return m((function(t,a,o,i,l){for(var s=[],c=0;c<e.length;c++){var d=(0,e[c])(t,a,o,i,l,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&s.push(d.data.expectedType)}return new f("Invalid "+i+" `"+l+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(t,r,a,o,i){var l=t[r],s=_(l);if("object"!==s)return new f("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return y(a,o,i,c,b(d));var u=d(l,c,a,o,i+"."+c,n);if(u)return u}return null}))},exact:function(e){return m((function(a,o,i,l,s){var c=a[o],d=_(c);if("object"!==d)return new f("Invalid "+l+" `"+s+"` of type `"+d+"` supplied to `"+i+"`, expected `object`.");var u=t({},a[o],e);for(var h in u){var p=e[h];if(r(e,h)&&"function"!=typeof p)return y(i,l,s,h,b(p));if(!p)return new f("Invalid "+l+" `"+s+"` key `"+h+"` supplied to `"+i+"`.\nBad object: "+JSON.stringify(a[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=p(c,h,i,l,s+"."+h,n);if(m)return m}return null}))}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function f(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function a(a,i,l,c,d,h,p){if(c=c||u,h=h||l,p!==n){if(s){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+l;!t[g]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[g]=!0,r++)}}return null==i[l]?a?null===i[l]?new f("The "+d+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new f("The "+d+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(i,l,c,d,h)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function g(e){return m((function(t,n,r,a,o,i){var l=t[n];return _(l)!==e?new f("Invalid "+a+" `"+o+"` of type `"+b(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,a){return new f((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+a+"`.")}function v(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(v);if(null===e||l(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e[d]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!v(n.value))return!1}else for(;!(n=r.next()).done;){var a=n.value;if(a&&!v(a[1]))return!1}return!0;default:return!1}}function _(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=_(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function k(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return f.prototype=Error.prototype,h.checkPropTypes=a,h.resetWarningCache=a.resetWarningCache,h.PropTypes=h,h},factoryWithTypeCheckers}function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var e=requireReactPropTypesSecret();function t(){}function n(){}return n.resetWarningCache=t,factoryWithThrowingShims=function(){function r(t,n,r,a,o,i){if(i!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function a(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}}if("production"!==process.env.NODE_ENV){var ReactIs=reactIs$1.exports,throwOnDirectAccess=!0;propTypes.exports=requireFactoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess)}else propTypes.exports=requireFactoryWithThrowingShims()();var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(e,t,n){var r,a,o,i,l,s,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);function p(t){var n=r,o=a;return r=a=void 0,c=t,i=e.apply(o,n)}function f(e){var n=e-s;return void 0===s||n>=t||n<0||u&&e-c>=o}function m(){var e=now();if(f(e))return g(e);l=setTimeout(m,function(e){var n=t-(e-s);return u?nativeMin(n,o-(e-c)):n}(e))}function g(e){return l=void 0,h&&r?p(e):(r=a=void 0,i)}function y(){var e=now(),n=f(e);if(r=arguments,a=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(m,t),d?p(e):i}(s);if(u)return l=setTimeout(m,t),p(s)}return void 0===l&&(l=setTimeout(m,t)),i}return t=toNumber(t)||0,isObject(n)&&(d=!!n.leading,o=(u="maxWait"in n)?nativeMax(toNumber(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=a=l=void 0},y.flush=function(){return void 0===l?i:g(now())},y}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return NAN;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(reTrim,"");var n=reIsBinary.test(e);return n||reIsOctal.test(e)?freeParseInt(e.slice(2),n?2:8):reIsBadHex.test(e)?NAN:+e}var lodash_debounce=debounce,helpers={};Object.defineProperty(helpers,"__esModule",{value:!0}),helpers.compose=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e&&e.apply(void 0,n)}))}},helpers.pick=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((function(t,n){return e&&e.hasOwnProperty(n)&&(t[n]=e[n]),t}),{})},Object.defineProperty(PlacesAutocomplete$1,"__esModule",{value:!0});var _extends$1=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_createClass$1=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),_react$1=React__default,_react2$1=_interopRequireDefault$6(_react$1),_propTypes$1=propTypes.exports,_propTypes2$1=_interopRequireDefault$6(_propTypes$1),_lodash=lodash_debounce,_lodash2=_interopRequireDefault$6(_lodash),_helpers=helpers;function _interopRequireDefault$6(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$1(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var formattedSuggestion=function(e){return{mainText:e.main_text,secondaryText:e.secondary_text}},PlacesAutocomplete=function(e){function t(e){_classCallCheck$2(this,t);var n=_possibleConstructorReturn$1(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.init=function(){if(!window.google)throw new Error("[react-places-autocomplete]: Google Maps JavaScript API library must be loaded. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library");if(!window.google.maps.places)throw new Error("[react-places-autocomplete]: Google Maps Places library must be loaded. Please add `libraries=places` to the src URL. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library");n.autocompleteService=new window.google.maps.places.AutocompleteService,n.autocompleteOK=window.google.maps.places.PlacesServiceStatus.OK,n.setState((function(e){return e.ready?null:{ready:!0}}))},n.autocompleteCallback=function(e,t){if(n.setState({loading:!1}),t===n.autocompleteOK){var r=n.props.highlightFirstSuggestion;n.setState({suggestions:e.map((function(e,t){return{id:e.id,description:e.description,placeId:e.place_id,active:!(!r||0!==t),index:t,formattedSuggestion:formattedSuggestion(e.structured_formatting),matchedSubstrings:e.matched_substrings,terms:e.terms,types:e.types}}))})}else n.props.onError(t,n.clearSuggestions)},n.fetchPredictions=function(){var e=n.props.value;e.length&&(n.setState({loading:!0}),n.autocompleteService.getPlacePredictions(_extends$1({},n.props.searchOptions,{input:e}),n.autocompleteCallback))},n.clearSuggestions=function(){n.setState({suggestions:[]})},n.clearActive=function(){n.setState({suggestions:n.state.suggestions.map((function(e){return _extends$1({},e,{active:!1})}))})},n.handleSelect=function(e,t,r){n.clearSuggestions(),n.props.onSelect?n.props.onSelect(e,t,r):n.props.onChange(e)},n.getActiveSuggestion=function(){return n.state.suggestions.find((function(e){return e.active}))},n.selectActiveAtIndex=function(e){var t=n.state.suggestions.find((function(t){return t.index===e})).description;n.setActiveAtIndex(e),n.props.onChange(t)},n.selectUserInputValue=function(){n.clearActive(),n.props.onChange(n.state.userInputValue)},n.handleEnterKey=function(){var e=n.getActiveSuggestion();void 0===e?n.handleSelect(n.props.value,null,null):n.handleSelect(e.description,e.placeId,e)},n.handleDownKey=function(){if(0!==n.state.suggestions.length){var e=n.getActiveSuggestion();void 0===e?n.selectActiveAtIndex(0):e.index===n.state.suggestions.length-1?n.selectUserInputValue():n.selectActiveAtIndex(e.index+1)}},n.handleUpKey=function(){if(0!==n.state.suggestions.length){var e=n.getActiveSuggestion();void 0===e?n.selectActiveAtIndex(n.state.suggestions.length-1):0===e.index?n.selectUserInputValue():n.selectActiveAtIndex(e.index-1)}},n.handleInputKeyDown=function(e){switch(e.key){case"Enter":e.preventDefault(),n.handleEnterKey();break;case"ArrowDown":e.preventDefault(),n.handleDownKey();break;case"ArrowUp":e.preventDefault(),n.handleUpKey();break;case"Escape":n.clearSuggestions()}},n.setActiveAtIndex=function(e){n.setState({suggestions:n.state.suggestions.map((function(t,n){return _extends$1({},t,n===e?{active:!0}:{active:!1})}))})},n.handleInputChange=function(e){var t=e.target.value;n.props.onChange(t),n.setState({userInputValue:t}),t?n.props.shouldFetchSuggestions&&n.debouncedFetchPredictions():n.clearSuggestions()},n.handleInputOnBlur=function(){n.mousedownOnSuggestion||n.clearSuggestions()},n.getActiveSuggestionId=function(){var e=n.getActiveSuggestion();return e?"PlacesAutocomplete__suggestion-"+e.placeId:void 0},n.getIsExpanded=function(){return n.state.suggestions.length>0},n.getInputProps=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.hasOwnProperty("value"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `value`. Use `value` prop instead");if(e.hasOwnProperty("onChange"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `onChange`. Use `onChange` prop instead");var t={type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-expanded":n.getIsExpanded(),"aria-activedescendant":n.getActiveSuggestionId(),disabled:!n.state.ready};return _extends$1({},t,e,{onKeyDown:(0,_helpers.compose)(n.handleInputKeyDown,e.onKeyDown),onBlur:(0,_helpers.compose)(n.handleInputOnBlur,e.onBlur),value:n.props.value,onChange:function(e){n.handleInputChange(e)}})},n.getSuggestionItemProps=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.handleSuggestionMouseEnter.bind(n,e.index),a=n.handleSuggestionClick.bind(n,e);return _extends$1({},t,{key:e.id,id:n.getActiveSuggestionId(),role:"option",onMouseEnter:(0,_helpers.compose)(r,t.onMouseEnter),onMouseLeave:(0,_helpers.compose)(n.handleSuggestionMouseLeave,t.onMouseLeave),onMouseDown:(0,_helpers.compose)(n.handleSuggestionMouseDown,t.onMouseDown),onMouseUp:(0,_helpers.compose)(n.handleSuggestionMouseUp,t.onMouseUp),onTouchStart:(0,_helpers.compose)(n.handleSuggestionTouchStart,t.onTouchStart),onTouchEnd:(0,_helpers.compose)(n.handleSuggestionMouseUp,t.onTouchEnd),onClick:(0,_helpers.compose)(a,t.onClick)})},n.handleSuggestionMouseEnter=function(e){n.setActiveAtIndex(e)},n.handleSuggestionMouseLeave=function(){n.mousedownOnSuggestion=!1,n.clearActive()},n.handleSuggestionMouseDown=function(e){e.preventDefault(),n.mousedownOnSuggestion=!0},n.handleSuggestionTouchStart=function(){n.mousedownOnSuggestion=!0},n.handleSuggestionMouseUp=function(){n.mousedownOnSuggestion=!1},n.handleSuggestionClick=function(e,t){t&&t.preventDefault&&t.preventDefault();var r=e.description,a=e.placeId;n.handleSelect(r,a,e),setTimeout((function(){n.mousedownOnSuggestion=!1}))},n.state={loading:!1,suggestions:[],userInputValue:e.value,ready:!e.googleCallbackName},n.debouncedFetchPredictions=(0,_lodash2.default)(n.fetchPredictions,e.debounce),n}return _inherits$1(t,_react2$1.default.Component),_createClass$1(t,[{key:"componentDidMount",value:function(){var e=this.props.googleCallbackName;e?window.google&&window.google.maps&&window.google.maps.places?this.init():window[e]=this.init:this.init()}},{key:"componentWillUnmount",value:function(){var e=this.props.googleCallbackName;e&&window[e]&&delete window[e]}},{key:"render",value:function(){return this.props.children({getInputProps:this.getInputProps,getSuggestionItemProps:this.getSuggestionItemProps,loading:this.state.loading,suggestions:this.state.suggestions})}}]),t}();PlacesAutocomplete.propTypes={onChange:_propTypes2$1.default.func.isRequired,value:_propTypes2$1.default.string.isRequired,children:_propTypes2$1.default.func.isRequired,onError:_propTypes2$1.default.func,onSelect:_propTypes2$1.default.func,searchOptions:_propTypes2$1.default.shape({bounds:_propTypes2$1.default.object,componentRestrictions:_propTypes2$1.default.object,location:_propTypes2$1.default.object,offset:_propTypes2$1.default.oneOfType([_propTypes2$1.default.number,_propTypes2$1.default.string]),radius:_propTypes2$1.default.oneOfType([_propTypes2$1.default.number,_propTypes2$1.default.string]),types:_propTypes2$1.default.array}),debounce:_propTypes2$1.default.number,highlightFirstSuggestion:_propTypes2$1.default.bool,shouldFetchSuggestions:_propTypes2$1.default.bool,googleCallbackName:_propTypes2$1.default.string},PlacesAutocomplete.defaultProps={onError:function(e,t){return console.error("[react-places-autocomplete]: error happened when fetching data from Google Maps API.\nPlease check the docs here (https://developers.google.com/maps/documentation/javascript/places#place_details_responses)\nStatus: ",e)},searchOptions:{},debounce:200,highlightFirstSuggestion:!1,shouldFetchSuggestions:!0},PlacesAutocomplete$1.default=PlacesAutocomplete;var utils={};Object.defineProperty(utils,"__esModule",{value:!0}),utils.geocodeByAddress=function(e){var t=new window.google.maps.Geocoder,n=window.google.maps.GeocoderStatus.OK;return new Promise((function(r,a){t.geocode({address:e},(function(e,t){t!==n&&a(t),r(e)}))}))},utils.getLatLng=function(e){return new Promise((function(t,n){try{t({lat:e.geometry.location.lat(),lng:e.geometry.location.lng()})}catch(e){n(e)}}))},utils.geocodeByPlaceId=function(e){var t=new window.google.maps.Geocoder,n=window.google.maps.GeocoderStatus.OK;return new Promise((function(r,a){t.geocode({placeId:e},(function(e,t){t!==n&&a(t),r(e)}))}))},Object.defineProperty(dist,"__esModule",{value:!0});var getLatLng=dist.getLatLng=dist.geocodeByPlaceId=geocodeByAddress=dist.geocodeByAddress=void 0,_PlacesAutocomplete=PlacesAutocomplete$1,_PlacesAutocomplete2=_interopRequireDefault$5(_PlacesAutocomplete),_utils=utils;function _interopRequireDefault$5(e){return e&&e.__esModule?e:{default:e}}var geocodeByAddress=dist.geocodeByAddress=_utils.geocodeByAddress;dist.geocodeByPlaceId=_utils.geocodeByPlaceId,getLatLng=dist.getLatLng=_utils.getLatLng;var _default=dist.default=_PlacesAutocomplete2.default;const SearchView=qe.div`
|
|
478
|
+
`,InputRange=e=>{const t=createRef(),[n,r]=useState(e.value&&"number"==typeof e.value?e.value:e.defaultValue&&"number"==typeof e.defaultValue?e.defaultValue:0),[a,o]=useState(0),{style:i}=e,l=__rest(e,["style"]);useEffect((()=>{e.value&&"number"==typeof e.value&&r(e.value)}),[e.value]),useEffect((()=>{t.current&&o(t.current.offsetWidth)}),[t.current]);return jsxs(Container$2,Object.assign({ref:t,style:i},{children:[!e.hideRange&&jsx(RangeValue,Object.assign({role:"range",id:"bubbleHeight",value:e.min&&e.max?(n-e.min)/(e.max-e.min)*a:n/100*a},{children:jsx(RangeValueSpan,{children:n})})),jsx(InputStyled,Object.assign({role:"input"},l,{id:"rangeHeight",type:"range",backValue:e.min&&e.max?(n-e.min)/(e.max-e.min)*a:n/100*a,onChange:t=>{r(parseInt(t.target.value)),e.onChange&&e.onChange(t)}})),e.min&&e.max?jsxs(BottomRow,{children:[jsxs(Text$1,Object.assign({type:"p2",style:{color:Color.text.high}},{children:[e.min," ",e.unit]})),jsxs(Text$1,Object.assign({type:"p2",style:{color:Color.text.high}},{children:[e.max," ",e.unit]}))]}):null]}))};var dist={},PlacesAutocomplete$1={},propTypes={exports:{}},objectAssign,hasRequiredObjectAssign,ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret,has,hasRequiredHas,checkPropTypes_1,hasRequiredCheckPropTypes,factoryWithTypeCheckers,hasRequiredFactoryWithTypeCheckers,factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireObjectAssign(){if(hasRequiredObjectAssign)return objectAssign;hasRequiredObjectAssign=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return objectAssign=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,a){for(var o,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),s=1;s<arguments.length;s++){for(var c in o=Object(arguments[s]))t.call(o,c)&&(l[c]=o[c]);if(e){i=e(o);for(var d=0;d<i.length;d++)n.call(o,i[d])&&(l[i[d]]=o[i[d]])}}return l},objectAssign}function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;return ReactPropTypesSecret_1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function requireHas(){return hasRequiredHas?has:(hasRequiredHas=1,has=Function.call.bind(Object.prototype.hasOwnProperty))}function requireCheckPropTypes(){if(hasRequiredCheckPropTypes)return checkPropTypes_1;hasRequiredCheckPropTypes=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=requireReactPropTypesSecret(),n={},r=requireHas();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function a(a,o,i,l,s){if("production"!==process.env.NODE_ENV)for(var c in a)if(r(a,c)){var d;try{if("function"!=typeof a[c]){var u=Error((l||"React class")+": "+i+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=a[c](o,c,l,i,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((l||"React class")+": type specification of "+i+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=s?s():"";e("Failed "+i+" type: "+d.message+(null!=h?h:""))}}}return a.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},checkPropTypes_1=a}function requireFactoryWithTypeCheckers(){if(hasRequiredFactoryWithTypeCheckers)return factoryWithTypeCheckers;hasRequiredFactoryWithTypeCheckers=1;var e=reactIs$1.exports,t=requireObjectAssign(),n=requireReactPropTypesSecret(),r=requireHas(),a=requireCheckPropTypes(),o=function(){};function i(){return null}return"production"!==process.env.NODE_ENV&&(o=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),factoryWithTypeCheckers=function(l,s){var c="function"==typeof Symbol&&Symbol.iterator,d="@@iterator";var u="<<anonymous>>",h={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:m(i),arrayOf:function(e){return m((function(t,r,a,o,i){if("function"!=typeof e)return new f("Property `"+i+"` of component `"+a+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new f("Invalid "+o+" `"+i+"` of type `"+_(l)+"` supplied to `"+a+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,a,o,i+"["+s+"]",n);if(c instanceof Error)return c}return null}))},element:m((function(e,t,n,r,a){var o=e[t];return l(o)?null:new f("Invalid "+r+" `"+a+"` of type `"+_(o)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:m((function(t,n,r,a,o){var i=t[n];return e.isValidElementType(i)?null:new f("Invalid "+a+" `"+o+"` of type `"+_(i)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return m((function(t,n,r,a,o){if(!(t[n]instanceof e)){var i=e.name||u;return new f("Invalid "+a+" `"+o+"` of type `"+(((l=t[n]).constructor&&l.constructor.name?l.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+i+"`.")}var l;return null}))},node:m((function(e,t,n,r,a){return v(e[t])?null:new f("Invalid "+r+" `"+a+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return m((function(t,a,o,i,l){if("function"!=typeof e)return new f("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[a],c=_(s);if("object"!==c)return new f("Invalid "+i+" `"+l+"` of type `"+c+"` supplied to `"+o+"`, expected an object.");for(var d in s)if(r(s,d)){var u=e(s,d,o,i,l+"."+d,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),i;return m((function(t,n,r,a,o){for(var i=t[n],l=0;l<e.length;l++)if(p(i,e[l]))return null;var s=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new f("Invalid "+a+" `"+o+"` of value `"+String(i)+"` supplied to `"+r+"`, expected one of "+s+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&o("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var t=0;t<e.length;t++){var a=e[t];if("function"!=typeof a)return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(a)+" at index "+t+"."),i}return m((function(t,a,o,i,l){for(var s=[],c=0;c<e.length;c++){var d=(0,e[c])(t,a,o,i,l,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&s.push(d.data.expectedType)}return new f("Invalid "+i+" `"+l+"` supplied to `"+o+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return m((function(t,r,a,o,i){var l=t[r],s=_(l);if("object"!==s)return new f("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return y(a,o,i,c,b(d));var u=d(l,c,a,o,i+"."+c,n);if(u)return u}return null}))},exact:function(e){return m((function(a,o,i,l,s){var c=a[o],d=_(c);if("object"!==d)return new f("Invalid "+l+" `"+s+"` of type `"+d+"` supplied to `"+i+"`, expected `object`.");var u=t({},a[o],e);for(var h in u){var p=e[h];if(r(e,h)&&"function"!=typeof p)return y(i,l,s,h,b(p));if(!p)return new f("Invalid "+l+" `"+s+"` key `"+h+"` supplied to `"+i+"`.\nBad object: "+JSON.stringify(a[o],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=p(c,h,i,l,s+"."+h,n);if(m)return m}return null}))}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function f(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function m(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function a(a,i,l,c,d,h,p){if(c=c||u,h=h||l,p!==n){if(s){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+l;!t[g]&&r<3&&(o("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[g]=!0,r++)}}return null==i[l]?a?null===i[l]?new f("The "+d+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new f("The "+d+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(i,l,c,d,h)}var i=a.bind(null,!1);return i.isRequired=a.bind(null,!0),i}function g(e){return m((function(t,n,r,a,o,i){var l=t[n];return _(l)!==e?new f("Invalid "+a+" `"+o+"` of type `"+b(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,a){return new f((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+a+"`.")}function v(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(v);if(null===e||l(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e[d]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!v(n.value))return!1}else for(;!(n=r.next()).done;){var a=n.value;if(a&&!v(a[1]))return!1}return!0;default:return!1}}function _(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=_(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function k(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return f.prototype=Error.prototype,h.checkPropTypes=a,h.resetWarningCache=a.resetWarningCache,h.PropTypes=h,h},factoryWithTypeCheckers}function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var e=requireReactPropTypesSecret();function t(){}function n(){}return n.resetWarningCache=t,factoryWithThrowingShims=function(){function r(t,n,r,a,o,i){if(i!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function a(){return r}r.isRequired=r;var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o}}if("production"!==process.env.NODE_ENV){var ReactIs=reactIs$1.exports,throwOnDirectAccess=!0;propTypes.exports=requireFactoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess)}else propTypes.exports=requireFactoryWithThrowingShims()();var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root.Date.now()};function debounce(e,t,n){var r,a,o,i,l,s,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError(FUNC_ERROR_TEXT);function p(t){var n=r,o=a;return r=a=void 0,c=t,i=e.apply(o,n)}function f(e){var n=e-s;return void 0===s||n>=t||n<0||u&&e-c>=o}function m(){var e=now();if(f(e))return g(e);l=setTimeout(m,function(e){var n=t-(e-s);return u?nativeMin(n,o-(e-c)):n}(e))}function g(e){return l=void 0,h&&r?p(e):(r=a=void 0,i)}function y(){var e=now(),n=f(e);if(r=arguments,a=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(m,t),d?p(e):i}(s);if(u)return l=setTimeout(m,t),p(s)}return void 0===l&&(l=setTimeout(m,t)),i}return t=toNumber(t)||0,isObject(n)&&(d=!!n.leading,o=(u="maxWait"in n)?nativeMax(toNumber(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=a=l=void 0},y.flush=function(){return void 0===l?i:g(now())},y}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function isObjectLike(e){return!!e&&"object"==typeof e}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&objectToString.call(e)==symbolTag}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return NAN;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(reTrim,"");var n=reIsBinary.test(e);return n||reIsOctal.test(e)?freeParseInt(e.slice(2),n?2:8):reIsBadHex.test(e)?NAN:+e}var lodash_debounce=debounce,helpers={};Object.defineProperty(helpers,"__esModule",{value:!0}),helpers.compose=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e&&e.apply(void 0,n)}))}},helpers.pick=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((function(t,n){return e&&e.hasOwnProperty(n)&&(t[n]=e[n]),t}),{})},Object.defineProperty(PlacesAutocomplete$1,"__esModule",{value:!0});var _extends$1=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_createClass$1=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),_react$1=React__default,_react2$1=_interopRequireDefault$6(_react$1),_propTypes$1=propTypes.exports,_propTypes2$1=_interopRequireDefault$6(_propTypes$1),_lodash=lodash_debounce,_lodash2=_interopRequireDefault$6(_lodash),_helpers=helpers;function _interopRequireDefault$6(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn$1(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits$1(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var formattedSuggestion=function(e){return{mainText:e.main_text,secondaryText:e.secondary_text}},PlacesAutocomplete=function(e){function t(e){_classCallCheck$2(this,t);var n=_possibleConstructorReturn$1(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.init=function(){if(!window.google)throw new Error("[react-places-autocomplete]: Google Maps JavaScript API library must be loaded. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library");if(!window.google.maps.places)throw new Error("[react-places-autocomplete]: Google Maps Places library must be loaded. Please add `libraries=places` to the src URL. See: https://github.com/kenny-hibino/react-places-autocomplete#load-google-library");n.autocompleteService=new window.google.maps.places.AutocompleteService,n.autocompleteOK=window.google.maps.places.PlacesServiceStatus.OK,n.setState((function(e){return e.ready?null:{ready:!0}}))},n.autocompleteCallback=function(e,t){if(n.setState({loading:!1}),t===n.autocompleteOK){var r=n.props.highlightFirstSuggestion;n.setState({suggestions:e.map((function(e,t){return{id:e.id,description:e.description,placeId:e.place_id,active:!(!r||0!==t),index:t,formattedSuggestion:formattedSuggestion(e.structured_formatting),matchedSubstrings:e.matched_substrings,terms:e.terms,types:e.types}}))})}else n.props.onError(t,n.clearSuggestions)},n.fetchPredictions=function(){var e=n.props.value;e.length&&(n.setState({loading:!0}),n.autocompleteService.getPlacePredictions(_extends$1({},n.props.searchOptions,{input:e}),n.autocompleteCallback))},n.clearSuggestions=function(){n.setState({suggestions:[]})},n.clearActive=function(){n.setState({suggestions:n.state.suggestions.map((function(e){return _extends$1({},e,{active:!1})}))})},n.handleSelect=function(e,t,r){n.clearSuggestions(),n.props.onSelect?n.props.onSelect(e,t,r):n.props.onChange(e)},n.getActiveSuggestion=function(){return n.state.suggestions.find((function(e){return e.active}))},n.selectActiveAtIndex=function(e){var t=n.state.suggestions.find((function(t){return t.index===e})).description;n.setActiveAtIndex(e),n.props.onChange(t)},n.selectUserInputValue=function(){n.clearActive(),n.props.onChange(n.state.userInputValue)},n.handleEnterKey=function(){var e=n.getActiveSuggestion();void 0===e?n.handleSelect(n.props.value,null,null):n.handleSelect(e.description,e.placeId,e)},n.handleDownKey=function(){if(0!==n.state.suggestions.length){var e=n.getActiveSuggestion();void 0===e?n.selectActiveAtIndex(0):e.index===n.state.suggestions.length-1?n.selectUserInputValue():n.selectActiveAtIndex(e.index+1)}},n.handleUpKey=function(){if(0!==n.state.suggestions.length){var e=n.getActiveSuggestion();void 0===e?n.selectActiveAtIndex(n.state.suggestions.length-1):0===e.index?n.selectUserInputValue():n.selectActiveAtIndex(e.index-1)}},n.handleInputKeyDown=function(e){switch(e.key){case"Enter":e.preventDefault(),n.handleEnterKey();break;case"ArrowDown":e.preventDefault(),n.handleDownKey();break;case"ArrowUp":e.preventDefault(),n.handleUpKey();break;case"Escape":n.clearSuggestions()}},n.setActiveAtIndex=function(e){n.setState({suggestions:n.state.suggestions.map((function(t,n){return _extends$1({},t,n===e?{active:!0}:{active:!1})}))})},n.handleInputChange=function(e){var t=e.target.value;n.props.onChange(t),n.setState({userInputValue:t}),t?n.props.shouldFetchSuggestions&&n.debouncedFetchPredictions():n.clearSuggestions()},n.handleInputOnBlur=function(){n.mousedownOnSuggestion||n.clearSuggestions()},n.getActiveSuggestionId=function(){var e=n.getActiveSuggestion();return e?"PlacesAutocomplete__suggestion-"+e.placeId:void 0},n.getIsExpanded=function(){return n.state.suggestions.length>0},n.getInputProps=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.hasOwnProperty("value"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `value`. Use `value` prop instead");if(e.hasOwnProperty("onChange"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `onChange`. Use `onChange` prop instead");var t={type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-expanded":n.getIsExpanded(),"aria-activedescendant":n.getActiveSuggestionId(),disabled:!n.state.ready};return _extends$1({},t,e,{onKeyDown:(0,_helpers.compose)(n.handleInputKeyDown,e.onKeyDown),onBlur:(0,_helpers.compose)(n.handleInputOnBlur,e.onBlur),value:n.props.value,onChange:function(e){n.handleInputChange(e)}})},n.getSuggestionItemProps=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.handleSuggestionMouseEnter.bind(n,e.index),a=n.handleSuggestionClick.bind(n,e);return _extends$1({},t,{key:e.id,id:n.getActiveSuggestionId(),role:"option",onMouseEnter:(0,_helpers.compose)(r,t.onMouseEnter),onMouseLeave:(0,_helpers.compose)(n.handleSuggestionMouseLeave,t.onMouseLeave),onMouseDown:(0,_helpers.compose)(n.handleSuggestionMouseDown,t.onMouseDown),onMouseUp:(0,_helpers.compose)(n.handleSuggestionMouseUp,t.onMouseUp),onTouchStart:(0,_helpers.compose)(n.handleSuggestionTouchStart,t.onTouchStart),onTouchEnd:(0,_helpers.compose)(n.handleSuggestionMouseUp,t.onTouchEnd),onClick:(0,_helpers.compose)(a,t.onClick)})},n.handleSuggestionMouseEnter=function(e){n.setActiveAtIndex(e)},n.handleSuggestionMouseLeave=function(){n.mousedownOnSuggestion=!1,n.clearActive()},n.handleSuggestionMouseDown=function(e){e.preventDefault(),n.mousedownOnSuggestion=!0},n.handleSuggestionTouchStart=function(){n.mousedownOnSuggestion=!0},n.handleSuggestionMouseUp=function(){n.mousedownOnSuggestion=!1},n.handleSuggestionClick=function(e,t){t&&t.preventDefault&&t.preventDefault();var r=e.description,a=e.placeId;n.handleSelect(r,a,e),setTimeout((function(){n.mousedownOnSuggestion=!1}))},n.state={loading:!1,suggestions:[],userInputValue:e.value,ready:!e.googleCallbackName},n.debouncedFetchPredictions=(0,_lodash2.default)(n.fetchPredictions,e.debounce),n}return _inherits$1(t,_react2$1.default.Component),_createClass$1(t,[{key:"componentDidMount",value:function(){var e=this.props.googleCallbackName;e?window.google&&window.google.maps&&window.google.maps.places?this.init():window[e]=this.init:this.init()}},{key:"componentWillUnmount",value:function(){var e=this.props.googleCallbackName;e&&window[e]&&delete window[e]}},{key:"render",value:function(){return this.props.children({getInputProps:this.getInputProps,getSuggestionItemProps:this.getSuggestionItemProps,loading:this.state.loading,suggestions:this.state.suggestions})}}]),t}();PlacesAutocomplete.propTypes={onChange:_propTypes2$1.default.func.isRequired,value:_propTypes2$1.default.string.isRequired,children:_propTypes2$1.default.func.isRequired,onError:_propTypes2$1.default.func,onSelect:_propTypes2$1.default.func,searchOptions:_propTypes2$1.default.shape({bounds:_propTypes2$1.default.object,componentRestrictions:_propTypes2$1.default.object,location:_propTypes2$1.default.object,offset:_propTypes2$1.default.oneOfType([_propTypes2$1.default.number,_propTypes2$1.default.string]),radius:_propTypes2$1.default.oneOfType([_propTypes2$1.default.number,_propTypes2$1.default.string]),types:_propTypes2$1.default.array}),debounce:_propTypes2$1.default.number,highlightFirstSuggestion:_propTypes2$1.default.bool,shouldFetchSuggestions:_propTypes2$1.default.bool,googleCallbackName:_propTypes2$1.default.string},PlacesAutocomplete.defaultProps={onError:function(e,t){return console.error("[react-places-autocomplete]: error happened when fetching data from Google Maps API.\nPlease check the docs here (https://developers.google.com/maps/documentation/javascript/places#place_details_responses)\nStatus: ",e)},searchOptions:{},debounce:200,highlightFirstSuggestion:!1,shouldFetchSuggestions:!0},PlacesAutocomplete$1.default=PlacesAutocomplete;var utils={};Object.defineProperty(utils,"__esModule",{value:!0}),utils.geocodeByAddress=function(e){var t=new window.google.maps.Geocoder,n=window.google.maps.GeocoderStatus.OK;return new Promise((function(r,a){t.geocode({address:e},(function(e,t){t!==n&&a(t),r(e)}))}))},utils.getLatLng=function(e){return new Promise((function(t,n){try{t({lat:e.geometry.location.lat(),lng:e.geometry.location.lng()})}catch(e){n(e)}}))},utils.geocodeByPlaceId=function(e){var t=new window.google.maps.Geocoder,n=window.google.maps.GeocoderStatus.OK;return new Promise((function(r,a){t.geocode({placeId:e},(function(e,t){t!==n&&a(t),r(e)}))}))},Object.defineProperty(dist,"__esModule",{value:!0});var getLatLng=dist.getLatLng=dist.geocodeByPlaceId=geocodeByAddress=dist.geocodeByAddress=void 0,_PlacesAutocomplete=PlacesAutocomplete$1,_PlacesAutocomplete2=_interopRequireDefault$5(_PlacesAutocomplete),_utils=utils;function _interopRequireDefault$5(e){return e&&e.__esModule?e:{default:e}}var geocodeByAddress=dist.geocodeByAddress=_utils.geocodeByAddress;dist.geocodeByPlaceId=_utils.geocodeByPlaceId,getLatLng=dist.getLatLng=_utils.getLatLng;var _default=dist.default=_PlacesAutocomplete2.default;const SearchView=qe.div`
|
|
479
479
|
position: relative;
|
|
480
480
|
display: flex;
|
|
481
481
|
flex: 1;
|
|
@@ -499,7 +499,7 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
499
499
|
:hover{
|
|
500
500
|
background-color: ${Color.background.soft};
|
|
501
501
|
}
|
|
502
|
-
`,InputLocation=e=>{const[t,n]=useState(void 0);return jsx(_default,Object.assign({value:t,onChange:e=>{n(e)},onSelect:t=>__awaiter$1(void 0,void 0,void 0,(function*(){n(t);const r=yield geocodeByAddress(t),a=yield getLatLng(r[0]);e.onLocationChange&&e.onLocationChange({address:t,geocoder:r[0],location:a})})),searchOptions:{types:["geocode"]}},{children:({getInputProps:n,suggestions:r,getSuggestionItemProps:a})=>jsxs(SearchView,{children:[jsx(InputSecondary,Object.assign({},n({className:"location-search-input",placeholder:e.placeholder}),{containerStyle:{flex:1},value:t})),r.length>0&&jsx(DropdownMenu,Object.assign({role:"menu"},{children:r.map(((e,t)=>jsx(SuggestionView,Object.assign({},a(e),{role:"cell"+t},{children:jsx(Text,Object.assign({type:"p2",style:{textOverflow:"ellipsis"}},{children:e.description}))}))))}))]})}))},Input=e=>"range"===e.type?jsx(InputRange,Object.assign({},e)):"location"===e.type?jsx(InputLocation,Object.assign({},e)):"secondary"===e.design?jsx(InputSecondary,Object.assign({},e)):jsx(InputPrimary,Object.assign({},e)),Container$1=qe.div`
|
|
502
|
+
`,InputLocation=e=>{const[t,n]=useState(void 0);return jsx(_default,Object.assign({value:t,onChange:e=>{n(e)},onSelect:t=>__awaiter$1(void 0,void 0,void 0,(function*(){n(t);const r=yield geocodeByAddress(t),a=yield getLatLng(r[0]);e.onLocationChange&&e.onLocationChange({address:t,geocoder:r[0],location:a})})),searchOptions:{types:["geocode"]}},{children:({getInputProps:n,suggestions:r,getSuggestionItemProps:a})=>jsxs(SearchView,{children:[jsx(InputSecondary,Object.assign({},n({className:"location-search-input",placeholder:e.placeholder}),{containerStyle:{flex:1},value:t})),r.length>0&&jsx(DropdownMenu,Object.assign({role:"menu"},{children:r.map(((e,t)=>jsx(SuggestionView,Object.assign({},a(e),{role:"cell"+t},{children:jsx(Text$1,Object.assign({type:"p2",style:{textOverflow:"ellipsis"}},{children:e.description}))}))))}))]})}))},Input=e=>"range"===e.type?jsx(InputRange,Object.assign({},e)):"location"===e.type?jsx(InputLocation,Object.assign({},e)):"secondary"===e.design?jsx(InputSecondary,Object.assign({},e)):jsx(InputPrimary,Object.assign({},e)),Container$1=qe.div`
|
|
503
503
|
position: relative;
|
|
504
504
|
`,SelectStyled=qe.div`
|
|
505
505
|
display: flex;
|
|
@@ -534,14 +534,7 @@ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__p
|
|
|
534
534
|
:hover{
|
|
535
535
|
background-color: ${Color.background.soft};
|
|
536
536
|
}
|
|
537
|
-
|
|
538
|
-
display: flex;
|
|
539
|
-
align-items: center;
|
|
540
|
-
justify-content: center;
|
|
541
|
-
height: 24px;
|
|
542
|
-
width: 24px;
|
|
543
|
-
margin-right: 8px;
|
|
544
|
-
`;const Select=e=>{const[t,n]=useState(!1),[r,a]=useState(e.options&&e.options[0]);useEffect((()=>(window.addEventListener("click",(e=>o(e))),window.removeEventListener("click",(()=>{})))),[]),useEffect((()=>{e.selectedItem&&a(e.selectedItem)}),[e.selectedItem]);const o=t=>{const r=document.getElementById(e.id);null!==r&&(r.contains(t.target)||n(!1))};return jsxs(Container$1,Object.assign({style:e.style},{children:[jsxs(SelectStyled,Object.assign({role:"select",id:e.id,showMenu:t,onClick:e=>{if(!e)e=window.event;e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),n(!t)}},{children:[null==r?void 0:r.icon,!e.hideTitle&&jsx(Text,Object.assign({type:"p",style:{flex:1,fontSize:14,color:e.style?e.style.color:Color.text.full}},{children:null==r?void 0:r.label})),jsx(t?ChevronUp:ChevronDown,{height:20,width:20})]})),t&&jsx(OptionsView,Object.assign({role:"menu",style:e.optionStyle},{children:e.options.map(((t,r)=>jsxs(Option,Object.assign({role:"cell-"+r,onClick:r=>((t,r)=>{r||(r=window.event);r.cancelBubble=!0,r.stopPropagation&&r.stopPropagation(),a(t),n(!1),e.onChange&&e.onChange(t)})(t,r)},{children:[t.icon,jsx(Text,Object.assign({type:"p"},{children:t.label}))]}),e.id+"-cell-"+r)))}))]}))};var lib={exports:{}},Modal$2={},reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={},hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<a(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>a(s,n))c<o&&0>a(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<o&&0>a(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var s=[],c=[],d=1,u=null,h=3,p=!1,f=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var a=n(c);null!==a;){if(null===a.callback)r(c);else{if(!(a.startTime<=e))break;r(c),a.sortIndex=a.expirationTime,t(s,a)}a=n(c)}}function b(e){if(m=!1,_(e),!f)if(null!==n(s))f=!0,L(k);else{var t=n(c);null!==t&&A(b,t.startTime-e)}}function k(t,a){f=!1,m&&(m=!1,y(S),S=-1),p=!0;var o=h;try{for(_(a),u=n(s);null!==u&&(!(u.expirationTime>a)||t&&!C());){var i=u.callback;if("function"==typeof i){u.callback=null,h=u.priorityLevel;var l=i(u.expirationTime<=a);a=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),_(a)}else r(s);u=n(s)}if(null!==u)var d=!0;else{var g=n(c);null!==g&&A(b,g.startTime-a),d=!1}return d}finally{u=null,h=o,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,E=!1,M=null,S=-1,w=5,$=-1;function C(){return!(e.unstable_now()-$<w)}function R(){if(null!==M){var t=e.unstable_now();$=t;var n=!0;try{n=M(!0,t)}finally{n?x():(E=!1,M=null)}}else E=!1}if("function"==typeof v)x=function(){v(R)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,T=P.port2;P.port1.onmessage=R,x=function(){T.postMessage(null)}}else x=function(){g(R,0)};function L(e){M=e,E||(E=!0,x())}function A(t,n){S=g((function(){t(e.unstable_now())}),n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){f||p||(f=!0,L(k))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},e.unstable_scheduleCallback=function(r,a,o){var i=e.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?i+o:i:o=i,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:a,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>i?(r.sortIndex=o,t(c,r),null===n(s)&&r===n(c)&&(m?(y(S),S=-1):m=!0,A(b,o-i))):(r.sortIndex=l,t(s,r),f||p||(f=!0,L(k))),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(scheduler_production_min)),scheduler_production_min}var scheduler_development={},hasRequiredScheduler_development,hasRequiredScheduler,hasRequiredReactDom_production_min;
|
|
537
|
+
`,Select=e=>{const[t,n]=useState(!1),[r,a]=useState(e.options&&e.options[0]);useEffect((()=>(window.addEventListener("click",(e=>o(e))),window.removeEventListener("click",(()=>{})))),[]),useEffect((()=>{e.selectedItem&&a(e.selectedItem)}),[e.selectedItem]);const o=t=>{const r=document.getElementById(e.id);null!==r&&(r.contains(t.target)||n(!1))};return jsxs(Container$1,{children:[jsxs(SelectStyled,Object.assign({role:"select",id:e.id,showMenu:t,style:e.style,onClick:e=>{if(!e)e=window.event;e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),n(!t)}},{children:[null==r?void 0:r.icon,!e.hideTitle&&jsx(Text$1,Object.assign({type:"p",style:{flex:1,fontSize:14,color:e.style?e.style.color:Color.text.full}},{children:null==r?void 0:r.label})),jsx(t?ChevronUp:ChevronDown,{height:20,width:20})]})),t&&jsx(OptionsView,Object.assign({role:"menu",style:e.optionStyle},{children:e.options.map(((t,r)=>jsxs(Option,Object.assign({role:"cell-"+r,onClick:r=>((t,r)=>{r||(r=window.event);r.cancelBubble=!0,r.stopPropagation&&r.stopPropagation(),a(t),n(!1),e.onChange&&e.onChange(t)})(t,r)},{children:[t.icon,jsx(Text$1,Object.assign({type:"p"},{children:t.label}))]}),e.id+"-cell-"+r)))}))]})};var lib={exports:{}},Modal$2={},reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={},hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<a(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var l=2*(r+1)-1,s=e[l],c=l+1,d=e[c];if(0>a(s,n))c<o&&0>a(d,s)?(e[r]=d,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else{if(!(c<o&&0>a(d,n)))break e;e[r]=d,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var s=[],c=[],d=1,u=null,h=3,p=!1,f=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function _(e){for(var a=n(c);null!==a;){if(null===a.callback)r(c);else{if(!(a.startTime<=e))break;r(c),a.sortIndex=a.expirationTime,t(s,a)}a=n(c)}}function b(e){if(m=!1,_(e),!f)if(null!==n(s))f=!0,L(k);else{var t=n(c);null!==t&&A(b,t.startTime-e)}}function k(t,a){f=!1,m&&(m=!1,y(S),S=-1),p=!0;var o=h;try{for(_(a),u=n(s);null!==u&&(!(u.expirationTime>a)||t&&!C());){var i=u.callback;if("function"==typeof i){u.callback=null,h=u.priorityLevel;var l=i(u.expirationTime<=a);a=e.unstable_now(),"function"==typeof l?u.callback=l:u===n(s)&&r(s),_(a)}else r(s);u=n(s)}if(null!==u)var d=!0;else{var g=n(c);null!==g&&A(b,g.startTime-a),d=!1}return d}finally{u=null,h=o,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,E=!1,M=null,S=-1,w=5,$=-1;function C(){return!(e.unstable_now()-$<w)}function R(){if(null!==M){var t=e.unstable_now();$=t;var n=!0;try{n=M(!0,t)}finally{n?x():(E=!1,M=null)}}else E=!1}if("function"==typeof v)x=function(){v(R)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,T=P.port2;P.port1.onmessage=R,x=function(){T.postMessage(null)}}else x=function(){g(R,0)};function L(e){M=e,E||(E=!0,x())}function A(t,n){S=g((function(){t(e.unstable_now())}),n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){f||p||(f=!0,L(k))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},e.unstable_scheduleCallback=function(r,a,o){var i=e.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?i+o:i:o=i,r){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return r={id:d++,callback:a,priorityLevel:r,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>i?(r.sortIndex=o,t(c,r),null===n(s)&&r===n(c)&&(m?(y(S),S=-1):m=!0,A(b,o-i))):(r.sortIndex=l,t(s,r),f||p||(f=!0,L(k))),r},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(scheduler_production_min)),scheduler_production_min}var scheduler_development={},hasRequiredScheduler_development,hasRequiredScheduler,hasRequiredReactDom_production_min;
|
|
545
538
|
/**
|
|
546
539
|
* @license React
|
|
547
540
|
* scheduler.development.js
|
|
@@ -648,7 +641,7 @@ var n="none",r="contents",a=/input|select|textarea|button|object|iframe/;functio
|
|
|
648
641
|
background-color: ${Color.background.redLow};
|
|
649
642
|
padding: 12px 24px;
|
|
650
643
|
margin-top: 24px;
|
|
651
|
-
`,ModalComponent=forwardRef(((e,t)=>{const[n,r]=useState(e.isVisible),[a,o]=useState(!1);useImperativeHandle(t,(()=>({close(){l()}}))),useEffect((()=>{e.isVisible?(r(!0),i(100).then((()=>{o(!0)}))):(o(!1),i(500).then((()=>{r(!1)})))}),[e.isVisible]);const i=e=>new Promise((t=>setTimeout(t,e))),l=()=>{o(!1),i(300).then((()=>{r(!1),e.onClose&&e.onClose()}))};return jsxs(Modal,Object.assign({role:"modal",isOpen:n,ariaHideApp:!1,style:{content:Object.assign({position:"absolute",width:"full-screen"===e.design?"100%":500,maxWidth:"full-screen"===e.design?"100%":"calc(100% - 24px)",maxHeight:"calc(100% - 24px)",background:"#FFFFFF",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",borderRadius:"full-screen"===e.design?"12px 12px 0px 0px":12,top:"full-screen"!==e.design?a?"50%":"150%":"unset",bottom:"full-screen"===e.design?a?"0px":"-100vh":"unset",transition:"top 0.3s ease-out, bottom 0.3s ease-out, transform 0.3s ease-in-out",left:"50%",transform:"full-screen"===e.design?"translate(-50%, 0%)":"translate(-50%, -50%) scale("+(a?1:.2)+")",overflow:"hidden",overflowY:"auto",border:"none",padding:0},e.style),overlay:{backgroundColor:"rgba(0, 0, 0, "+(a?.6:0)+")",transition:" background-color 0.3s ease-out",zIndex:1e3}}},{children:[!e.hideHeader&&jsxs(TitleView,{children:[!e.hideClose&&jsx(Button,{style:{position:"absolute",alignSelf:"flex-end",cursor:"pointer"},icon:jsx(X,{height:20,width:20,color:Color.text.full}),design:"image",onClick:l}),e.title&&jsx(Title,{children:e.title}),e.subtitle&&jsx(Subtitle,{children:e.subtitle}),e.Header]}),jsx(ChildrenView,Object.assign({style:e.contentStyle},{children:e.children})),e.error&&jsx(ErrorView,{children:jsx(Text,Object.assign({type:"p",style:{color:Color.status.color.error,fontSize:12}},{children:e.error}))}),e.buttonProps&&jsxs(Buttons,{children:[e.Bottom,e.buttonProps&&jsx(Button,Object.assign({},e.buttonProps,{children:e.buttonProps.children?e.buttonProps.children:"Guardar"}))]})]}))})),Container=qe.div`
|
|
644
|
+
`,ModalComponent=forwardRef(((e,t)=>{const[n,r]=useState(e.isVisible),[a,o]=useState(!1);useImperativeHandle(t,(()=>({close(){l()}}))),useEffect((()=>{e.isVisible?(r(!0),i(100).then((()=>{o(!0)}))):(o(!1),i(500).then((()=>{r(!1)})))}),[e.isVisible]);const i=e=>new Promise((t=>setTimeout(t,e))),l=()=>{o(!1),i(300).then((()=>{r(!1),e.onClose&&e.onClose()}))};return jsxs(Modal,Object.assign({role:"modal",isOpen:n,ariaHideApp:!1,style:{content:Object.assign({position:"absolute",width:"full-screen"===e.design?"100%":500,maxWidth:"full-screen"===e.design?"100%":"calc(100% - 24px)",maxHeight:"calc(100% - 24px)",background:"#FFFFFF",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",borderRadius:"full-screen"===e.design?"12px 12px 0px 0px":12,top:"full-screen"!==e.design?a?"50%":"150%":"unset",bottom:"full-screen"===e.design?a?"0px":"-100vh":"unset",transition:"top 0.3s ease-out, bottom 0.3s ease-out, transform 0.3s ease-in-out",left:"50%",transform:"full-screen"===e.design?"translate(-50%, 0%)":"translate(-50%, -50%) scale("+(a?1:.2)+")",overflow:"hidden",overflowY:"auto",border:"none",padding:0},e.style),overlay:{backgroundColor:"rgba(0, 0, 0, "+(a?.6:0)+")",transition:" background-color 0.3s ease-out",zIndex:1e3}}},{children:[!e.hideHeader&&jsxs(TitleView,{children:[!e.hideClose&&jsx(Button,{style:{position:"absolute",alignSelf:"flex-end",cursor:"pointer"},icon:jsx(X,{height:20,width:20,color:Color.text.full}),design:"image",onClick:l}),e.title&&jsx(Title,{children:e.title}),e.subtitle&&jsx(Subtitle,{children:e.subtitle}),e.Header]}),jsx(ChildrenView,Object.assign({style:e.contentStyle},{children:e.children})),e.error&&jsx(ErrorView,{children:jsx(Text$1,Object.assign({type:"p",style:{color:Color.status.color.error,fontSize:12}},{children:e.error}))}),e.buttonProps&&jsxs(Buttons,{children:[e.Bottom,e.buttonProps&&jsx(Button,Object.assign({},e.buttonProps,{children:e.buttonProps.children?e.buttonProps.children:"Guardar"}))]})]}))})),Container=qe.div`
|
|
652
645
|
position: relative;
|
|
653
646
|
`,FilterView=qe.div`
|
|
654
647
|
position: absolute;
|
|
@@ -683,7 +676,7 @@ var n="none",r="contents",a=/input|select|textarea|button|object|iframe/;functio
|
|
|
683
676
|
:hover{
|
|
684
677
|
background-color: ${Color.status.neutral.hover};
|
|
685
678
|
}
|
|
686
|
-
`,MenuList=forwardRef(((e,t)=>{const[n,r]=useState(!1);useImperativeHandle(t,(()=>({close(){r(!1)}}))),useEffect((()=>(document.addEventListener("mousedown",(t=>{const r=document.getElementById(e.id);null!==r&&(r.contains(t.target)||n&&a(t))})),document.removeEventListener("mousedown",a))));const a=t=>{t.stopPropagation(),n?(r(!1),e.onChange&&e.onChange(!1)):(r(!0),e.onChange&&e.onChange(!0))};return jsxs(Container,Object.assign({id:e.id,role:"menu",style:e.style},{children:[e.Icon?jsx(IconView,Object.assign({onClick:a},{children:e.Icon})):jsx(Button,{style:{backgroundColor:n?Color.status.neutral.active:void 0},design:"image",icon:e.icon?e.icon:jsx(MoreVertical,{}),onClick:a}),jsxs(FilterView,Object.assign({padding:!e.options,position:e.position,style:e.menuStyle,show:n},{children:[e.children,e.options&&e.options.map(((t,n)=>jsxs(MenuCell,Object.assign({style:{borderBottom:n+1===e.options.length?"none":"1px solid "+Color.line.soft},onClick:n=>((t,n)=>{t.stopPropagation(),r(!1),e.onClick&&e.onClick(n)})(n,t)},{children:[t.icon,jsx(Text,Object.assign({type:"p"},{children:t.label}))]}),"action"+n)))]}))]}))})),LabelStyled=qe.div`
|
|
679
|
+
`,MenuList=forwardRef(((e,t)=>{const[n,r]=useState(!1);useImperativeHandle(t,(()=>({close(){r(!1)}}))),useEffect((()=>(document.addEventListener("mousedown",(t=>{const r=document.getElementById(e.id);null!==r&&(r.contains(t.target)||n&&a(t))})),document.removeEventListener("mousedown",a))));const a=t=>{t.stopPropagation(),n?(r(!1),e.onChange&&e.onChange(!1)):(r(!0),e.onChange&&e.onChange(!0))};return jsxs(Container,Object.assign({id:e.id,role:"menu",style:e.style},{children:[e.Icon?jsx(IconView,Object.assign({onClick:a},{children:e.Icon})):jsx(Button,{style:{backgroundColor:n?Color.status.neutral.active:void 0},design:"image",icon:e.icon?e.icon:jsx(MoreVertical,{}),onClick:a}),jsxs(FilterView,Object.assign({padding:!e.options,position:e.position,style:e.menuStyle,show:n},{children:[e.children,e.options&&e.options.map(((t,n)=>{var a;return jsxs(MenuCell,Object.assign({style:{borderBottom:n+1===(null===(a=e.options)||void 0===a?void 0:a.length)?"none":"1px solid "+Color.line.soft},onClick:n=>((t,n)=>{t.stopPropagation(),r(!1),e.onClick&&e.onClick(n)})(n,t)},{children:[t.icon,jsx(Text$1,Object.assign({type:"p"},{children:t.label}))]}),"action"+n)}))]}))]}))})),LabelStyled=qe.div`
|
|
687
680
|
display: flex;
|
|
688
681
|
flex-direction: row;
|
|
689
682
|
justify-content: center;
|
|
@@ -692,5 +685,32 @@ var n="none",r="contents",a=/input|select|textarea|button|object|iframe/;functio
|
|
|
692
685
|
width: fit-content;
|
|
693
686
|
height: 28px;
|
|
694
687
|
border-radius: 3px;
|
|
695
|
-
`,Label=e=>{var t,n;const[r,a]=useState(void 0);useEffect((()=>{a(o())}),[e.text]);const o=()=>{switch(e.text){case"inRegister":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"En registro"};case"registered":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"Registrado"};case"waiting":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"Pendiente de match"};case"training":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"Formación en proceso"};case"match":return{color:"#59C183",backgroundColor:"#E7F6ED",text:"Match"};case"shutdown":return{color:"#FF5A5A",backgroundColor:"#FCEDF1",text:"Baja"};case"banned":return{color:"#FF5A5A",backgroundColor:"#FCEDF1",text:"Bloqueado"};case"exVolunteer":return{color:"#FF5A5A",backgroundColor:"#FCEDF1",text:"Ex-voluntario"};case"paused":return{color:"#828282",backgroundColor:"#F2F2F2",text:"Pausa"};case"inProgress":case"En proceso":return{color:"#FF8854",backgroundColor:"#FFF6E5",text:"En proceso"};case"pending":case"Pendiente":return{color:"#0000008F",backgroundColor:"#F2F2F2",text:"Pendiente"};case"canceled":return{color:Color.text.red,backgroundColor:Color.background.redLow,text:"Cancelado"};case"No resuelto":return{color:Color.text.red,backgroundColor:Color.background.redLow,text:"No resuelto"};case"done":case"Resuelto":return{color:"#448B6D",backgroundColor:"#E4F8EE",text:"Resuelto"}}};return jsx(LabelStyled,r?Object.assign({role:"label",id:"Label"},e,{style:Object.assign({background:r.backgroundColor},e.style)},{children:jsx(Text,Object.assign({type:"p",style:{fontSize:(null===(t=e.style)||void 0===t?void 0:t.fontSize)?e.style.fontSize:14,fontWeight:500,color:r.color}},{children:r.text}))}):Object.assign({role:"label",id:"Label"},e,{style:Object.assign({background:e.backgroundColor?e.backgroundColor:Color.background.soft},e.style)},{children:jsx(Text,Object.assign({type:"p",style:{fontSize:(null===(n=e.style)||void 0===n?void 0:n.fontSize)?e.style.fontSize:14,fontWeight:500,color:e.color}},{children:e.text}))}))}
|
|
688
|
+
`,Label=e=>{var t,n;const[r,a]=useState(void 0);useEffect((()=>{a(o())}),[e.text]);const o=()=>{switch(e.text){case"inRegister":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"En registro"};case"registered":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"Registrado"};case"waiting":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"Pendiente de match"};case"training":return{color:"#2D7FD9",backgroundColor:"#E5F1FC",text:"Formación en proceso"};case"match":return{color:"#59C183",backgroundColor:"#E7F6ED",text:"Match"};case"shutdown":return{color:"#FF5A5A",backgroundColor:"#FCEDF1",text:"Baja"};case"banned":return{color:"#FF5A5A",backgroundColor:"#FCEDF1",text:"Bloqueado"};case"exVolunteer":return{color:"#FF5A5A",backgroundColor:"#FCEDF1",text:"Ex-voluntario"};case"paused":return{color:"#828282",backgroundColor:"#F2F2F2",text:"Pausa"};case"inProgress":case"En proceso":return{color:"#FF8854",backgroundColor:"#FFF6E5",text:"En proceso"};case"pending":case"Pendiente":return{color:"#0000008F",backgroundColor:"#F2F2F2",text:"Pendiente"};case"canceled":return{color:Color.text.red,backgroundColor:Color.background.redLow,text:"Cancelado"};case"No resuelto":return{color:Color.text.red,backgroundColor:Color.background.redLow,text:"No resuelto"};case"done":case"Resuelto":return{color:"#448B6D",backgroundColor:"#E4F8EE",text:"Resuelto"}}};return jsx(LabelStyled,r?Object.assign({role:"label",id:"Label"},e,{style:Object.assign({background:r.backgroundColor},e.style)},{children:jsx(Text$1,Object.assign({type:"p",style:{fontSize:(null===(t=e.style)||void 0===t?void 0:t.fontSize)?e.style.fontSize:14,fontWeight:500,color:r.color}},{children:r.text}))}):Object.assign({role:"label",id:"Label"},e,{style:Object.assign({background:e.backgroundColor?e.backgroundColor:Color.background.soft},e.style)},{children:jsx(Text$1,Object.assign({type:"p",style:{fontSize:(null===(n=e.style)||void 0===n?void 0:n.fontSize)?e.style.fontSize:14,fontWeight:500,color:e.color}},{children:e.text}))}))},AvatarContainer=qe.div`
|
|
689
|
+
width: 50px;
|
|
690
|
+
height: 50px;
|
|
691
|
+
display: flex;
|
|
692
|
+
justify-content: center;
|
|
693
|
+
align-items: center;
|
|
694
|
+
text-align: center;
|
|
695
|
+
border-radius: 50%;
|
|
696
|
+
background-color: ${Color.background.primaryLow};
|
|
697
|
+
cursor: ${e=>e.editable||e.clickable?"pointer":"default"};
|
|
698
|
+
`,Text=qe.p`
|
|
699
|
+
font-family: Poppins;
|
|
700
|
+
font-style: normal;
|
|
701
|
+
font-weight: 500;
|
|
702
|
+
font-size: 25.4545px;
|
|
703
|
+
line-height: 40px;
|
|
704
|
+
color: ${Color.text.primary};
|
|
705
|
+
text-align: center;
|
|
706
|
+
`,Icon=qe.img`
|
|
707
|
+
height: 100%;
|
|
708
|
+
width: 100%;
|
|
709
|
+
object-fit: cover;
|
|
710
|
+
border-radius: 50%;
|
|
711
|
+
`,BigIcon=qe.img`
|
|
712
|
+
width: 100%;
|
|
713
|
+
height: 100%;
|
|
714
|
+
object-fit: cover;
|
|
715
|
+
`,Avatar=e=>{var t;const n=useRef(null),[r,a]=useState(!1),o=e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)}));return jsxs(Fragment,{children:[jsx(ModalComponent,Object.assign({isVisible:r,onClose:()=>a(!1),contentStyle:{padding:0,backgroundColor:"black"},hideHeader:!0,buttonProps:{children:"Cerrar",onClick:()=>a(!1)}},{children:jsx(BigIcon,{src:e.icon})})),jsxs(AvatarContainer,Object.assign({role:"avatar",style:e.style,editable:e.editable,clickable:e.clickable,onClick:()=>{var t;e.editable?null===(t=n.current)||void 0===t||t.click():e.clickable&&a(!0)}},{children:[jsx("input",{ref:n,id:"file",type:"file",accept:"image/x-png,image/gif,image/jpeg",style:{display:"none"},onChange:t=>__awaiter$1(void 0,void 0,void 0,(function*(){if(t.target&&t.target.files&&t.target.files[0])if(t.target.files[0].name.match(/\.(jpg|jpeg|png|gif)$/)){const n=yield o(t.target.files[0]);e.onChange&&e.onChange(n)}else alert("Debes seleccionar una imagen")}))}),e.icon?jsx(Icon,{src:e.icon}):e.name?jsx(Text,Object.assign({style:{fontSize:(null===(t=e.style)||void 0===t?void 0:t.fontSize)?e.style.fontSize:24,fontWeight:600}},{children:e.name.substring(0,1).toLocaleUpperCase()})):null]}))]})};export{Avatar,BreadCrumb,Button,Color,FeedBack as Feedback,Input,Label,MenuList as Menu,ModalComponent as Modal,ProgressBar,SearchBar,Select,Text$1 as Text};
|
|
696
716
|
//# sourceMappingURL=index.js.map
|