PageSourceSearch

https://partners.helloself.com/static/js/ProfilePageRoute.DtaaUttO.js

js helloself.com collected 2026-09-26 07:27:57 UTC 201,242 bytes, 33 lines download raw bytes

1import{j as s,ag as gt,al as Ge,cm as zi,ap as Yi,f as W,s as jt,l as Ae,T as He,n as kt,q as Vt,m as dt,bp as Ui,by as Ar,b5 as Tr,p as ut,dP as Ir,r as Se,O as We,b3 as Xi,u as ni,o as Ni,M as Vi,S as ai,$ as At,e as Qi,U as Er,v as Tt,bD as si,L as Te,a3 as qi,dQ as Ki,B as Ne,cG as Dr,cX as Lr,H as Xe,bE as Rr,bV as Or,dR as Mr,b as Gr,dS as Fr,aa as oi,cJ as Br,cI as Ji,dT as Ur,d as Jt,a5 as $i,a1 as Nr,dU as Hr,aD as Wr,x as zr,J as Yr,dV as Xr,I as Vr,dW as Qr,dA as Ye,P as qr,F as Kr,af as Jr,dX as $r,dY as Zr,d2 as en,dZ as tn,d_ as rn,b9 as nn}from"./index.kaq7r257.js";import{I as an}from"./IconEdit.DWLdaMon.js";import{C as Zi}from"./ChevronIcon.BuyNXnwp.js";import{u as sn,a as er}from"./connection.Bu14mxY7.js";import{s as tr}from"./selectors.DgMFKQrt.js";import{S as ce}from"./index.DMhOL5NM.js";import{H as _e}from"./H5.mUIuTpDj.js";import{I as on}from"./IconTick.DGSutuEh.js";import{S as ir}from"./Spinner.BPKbP2Nb.js";import{l as ln}from"./languages.DmQg6N_0.js";import{c as hn,a as Hi,d as cn}from"./array.BzGIDaHM.js";import{c as Ke,a as dn,S as li}from"./Select.DausLBrM.js";import{A as un}from"./Alert.CItMsYiD.js";import{F as hi,T as gn}from"./FormError.CuSzMVls.js";import{B as pn,C as rr}from"./CloseIcon.BcVwETsY.js";import{s as fn}from"./search.BdDtL2JD.js";import{L as nr}from"./Label.CYibAKYb.js";import"./objectWithoutProperties.CcorTJ6H.js";import"./createSuper.D7T-bmLy.js";import"./TickIcon.DMTtbmaD.js";import"./shapeVariant.CAfiQ12t.js";const $t=({color:c,...w})=>s.jsx(gt,{viewBox:"0 0 24 24",fill:"none",...w,children:s.jsx("path",{d:"M4.09188 11.1344L12 20L19.9081 11.1344C21.364 9.50234 21.364 6.85618 19.9081 5.22408C18.4523 3.59197 16.0919 3.59197 14.636 5.22408L12 8.17926L9.36396 5.22408C7.90812 3.59197 5.54773 3.59197 4.09188 5.22408C2.63604 6.85618 2.63604 9.50234 4.09188 11.1344Z",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});$t.defaultProps={color:Ge,height:"24px",width:"24px"};const Zt=({color:c,...w})=>s.jsx(gt,{viewBox:"0 0 25 24",fill:"none",...w,children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9269 3C12.9269 2.44772 12.4792 2 11.9269 2C11.3746 2 10.9269 2.44772 10.9269 3V4.12602C9.20167 4.57006 7.9269 6.13616 7.9269 8C7.9269 9.0396 8.32349 9.98656 8.97364 10.6979C8.97208 10.7028 8.97056 10.7077 8.96907 10.7127L5.96907 20.7127C5.81037 21.2416 6.11056 21.7991 6.63955 21.9578C7.16854 22.1165 7.72603 21.8163 7.88473 21.2873L9.57682 15.647C10.5467 15.9451 11.5674 16.0568 12.5842 15.9729C13.1608 15.9254 13.7282 15.8157 14.277 15.647L15.9691 21.2873C16.1278 21.8163 16.6853 22.1165 17.2142 21.9578C17.7432 21.7991 18.0434 21.2416 17.8847 20.7127L16.1157 14.8157C16.1778 14.7776 16.2395 14.7385 16.3006 14.6985C17.4142 13.9714 18.329 12.9781 18.9622 11.8086C19.5953 10.639 19.9269 9.32997 19.9269 8C19.9269 7.73478 19.8215 7.48043 19.634 7.29289C19.4465 7.10536 19.1921 7 18.9269 7H18.9176C18.3653 7 17.9176 7.44772 17.9176 8C17.9176 8.99593 17.6693 9.97615 17.1951 10.852C16.7809 11.6171 16.2058 12.2815 15.511 12.8003L14.8847 10.7127L14.8802 10.6979C15.5303 9.98656 15.9269 9.0396 15.9269 8C15.9269 6.13616 14.6521 4.57006 12.9269 4.12602V3ZM10.1542 13.7224C10.8844 13.9486 11.6532 14.0336 12.4191 13.9704C12.8554 13.9345 13.2846 13.8509 13.6996 13.7224L13.1278 11.8166C12.7488 11.9358 12.3453 12 11.9269 12C11.5085 12 11.105 11.9358 10.726 11.8166L10.1542 13.7224ZM11.9269 6C10.8223 6 9.9269 6.89543 9.9269 8C9.9269 9.10457 10.8223 10 11.9269 10C13.0315 10 13.9269 9.10457 13.9269 8C13.9269 6.89543 13.0315 6 11.9269 6Z",fill:c})});Zt.defaultProps={color:Ge,height:"24px",width:"24px"};const ar=({color:c,strokeWidth:w,...A})=>s.jsx(gt,{viewBox:"0 0 23 23",fill:"none",...A,children:s.jsx("g",{fill:"none",fillRule:"evenodd",strokeLinecap:"round",children:s.jsx("g",{stroke:c?zi[c]:"currentColor",strokeWidth:w,children:s.jsx("path",{d:"M19 9.5L0 9.5M9.5 19L9.5 0",transform:"translate(-937 -599) translate(912 579) translate(27 22)"})})})});ar.defaultProps={alt:"Plus icon",width:"23px",height:"23px",strokeWidth:3};const ei=({color:c="black",...w})=>s.jsx(gt,{viewBox:"0 0 34 28",fill:"none",...w,children:s.jsx("path",{d:"M0.48 18.76C0.48 11.44 4.68 4.6 10.2 0.759995L14.64 4.36C10.8 6.87999 7.44 11.68 6.96 15.52C7.08 15.52 7.92 15.28 8.52 15.28C11.88 15.28 14.4 17.92 14.4 21.4C14.4 25 11.52 27.88 7.92 27.88C3.96 27.88 0.48 24.64 0.48 18.76ZM19.68 18.76C19.68 11.44 23.88 4.6 29.4 0.759995L33.84 4.36C30 6.87999 26.64 11.68 26.16 15.52C26.4 15.52 27.24 15.28 27.72 15.28C31.08 15.28 33.6 17.92 33.6 21.4C33.6 25 30.72 27.88 27.12 27.88C23.16 27.88 19.68 24.64 19.68 18.76Z",fill:zi[c]})});ei.defaultProps={color:"black",height:"34px",width:"28px"};const ti=({color:c,...w})=>s.jsxs(gt,{viewBox:"0 0 25 24",fill:"none",...w,children:[s.jsx("circle",{cx:"12",cy:"12.1719",r:"9",stroke:c,strokeWidth:"2"}),s.jsx("path",{d:"M15 12.1719C15 14.8386 14.5658 17.2069 13.9 18.8716C13.5659 19.7066 13.1932 20.3153 12.8304 20.6989C12.4697 21.0804 12.1887 21.1719 12 21.1719C11.8113 21.1719 11.5303 21.0804 11.1696 20.6989C10.8068 20.3153 10.4341 19.7066 10.1 18.8716C9.43419 17.2069 9 14.8386 9 12.1719C9 9.5051 9.43419 7.13684 10.1 5.4722C10.4341 4.6371 10.8068 4.0284 11.1696 3.64483C11.5303 3.26337 11.8113 3.17188 12 3.17188C12.1887 3.17188 12.4697 3.26337 12.8304 3.64483C13.1932 4.0284 13.5659 4.6371 13.9 5.4722C14.5658 7.13684 15 9.5051 15 12.1719Z",stroke:c,strokeWidth:"2"}),s.jsx("path",{d:"M3 9.17188H20",stroke:c,strokeWidth:"2"}),s.jsx("path",{d:"M3 15.1719H20",stroke:c,strokeWidth:"2"})]});ti.defaultProps={color:Ge,height:"24px",width:"24px"};const sr=c=>s.jsx(pn,{src:fn,...c});sr.defaultProps={alt:"refer to self",width:"41px",height:"36px"};const mn=c=>{const{height:w}=c.getStyles("control",c);return s.jsx(Ke.ClearIndicator,{...c,children:s.jsx(rr,{width:`calc(${w} * .5)`,height:`calc(${w} * .5)`,color:Yi,cursor:"pointer"})})},xn=c=>s.jsx(Ke.DropdownIndicator,{...c,children:s.jsx(Zi,{direction:c.selectProps.menuIsOpen?"up":"down",color:Yi,margin:"0 8px 0 0",cursor:"pointer"})}),vn=c=>{const{height:w}=c.getStyles("control",c);return s.jsx(Ke.DropdownIndicator,{...c,children:s.jsx(sr,{margin:"0 8px 0 0",cursor:"pointer",width:`calc(${w} * .5)`,height:`calc(${w} * .4)`})})},yn=({children:c,...w})=>s.jsx(Ke.Option,{...w,children:w.isMulti?s.jsx(W,{flexDirection:"column",justifyContent:"center",padding:"8px 12px",minWidth:"60px",marginLeft:"5px",cursor:"pointer",border:`solid 1px ${jt}`,backgroundColor:jt,borderRadius:"4px",children:s.jsx(Ae,{fontSize:"14px",fontWeight:"600",children:c})}):c}),bn=c=>s.jsx(Ke.MultiValueRemove,{...c,children:s.jsx(rr,{width:"20px",height:"20px",color:Ge,cursor:"pointer"})}),Cn=({children:c,...w})=>s.jsx(Ke.NoOptionsMessage,{...w,children:c}),wn=c=>s.jsx(Ke.NoOptionsMessage,{...c,children:s.jsx(He,{textSize:"large",textColor:kt,margin:"8px 12px",children:"No options"})}),Sn=(c,w,A,J,q,Q,ae)=>({container:R=>({...R,width:"100%","&:focus":{boxShadow:"0px 0px 4px 0px #8EDCFF"}}),control:(R,B)=>({...R,height:c??"48px",minHeight:ae??"48px",border:Q?`1px solid ${ut}`:B.selectProps.menuIsOpen?`1px solid ${Vt}`:`1px solid ${kt}`,borderBottom:Q?"":B.selectProps.menuIsOpen?0:`1px solid ${kt}`,borderBottomRightRadius:B.selectProps.menuIsOpen?0:"4px",borderBottomLeftRadius:B.selectProps.menuIsOpen?0:"4px",boxShadow:B.selectProps.menuIsOpen&&!Q?"0px 0px 4px 0px #8EDCFF":"none","&:hover":{border:Q?`1px solid ${ut}`:""},"&:focus-within":{boxShadow:Q?`0 0 0 0.1rem ${Tr(Ir,.25)}`:""}}),valueContainer:R=>({...R,height:"100%"}),singleValue:R=>({...R,color:dt,fontSize:w??"18px"}),multiValue:R=>({...R,backgroundColor:jt,border:`solid 1px ${jt}`,borderRadius:"4px",padding:"0px 4px",color:Ge,fontSize:w??"18px"}),multiValueRemove:R=>({...R,border:"solid 1px transparent",color:Ge,paddingLeft:"0px",paddingRight:"0px","&:hover":{backgroundColor:"transparent"}}
1),input:R=>({...R,color:dt,fontSize:w??"18px"}),option:(R,B)=>({...R,display:"flex",padding:"5px",color:dt,fontSize:w??"18px",height:A??"58px",background:B.isFocused?B.selectProps.isMulti?Ui:Ar:B.isSelected?Ui:"transparent"}),placeholder:R=>({...R,color:dt,fontSize:w??"18px"}),menu:(R,B)=>({...R,top:"auto",margin:0,borderTopLeftRadius:0,borderTopRightRadius:0,border:B.selectProps.menuIsOpen?`1px solid ${Vt}`:`1px solid ${kt}`,boxShadow:B.selectProps.menuIsOpen?"1px 1px 1px #8edcff, -1px 1px 1px #8edcff":"none",borderTop:0}),menuList:R=>({...R,padding:0}),indicatorSeparator:()=>({display:"none"}),indicatorsContainer:R=>({...R,height:"auto"}),noOptionsMessage:()=>({padding:0}),dropdownIndicator:R=>({...R,width:J||"auto",height:"100%",alignItems:"center",padding:"8px 4px"}),clearIndicator:R=>({...R,width:q||"auto",height:"100%",alignItems:"center",padding:"8px 4px"}),group:R=>({...R,paddingBottom:0,paddingTop:"12px",borderBottom:`2px dotted ${Vt}`}),groupHeading:R=>({...R,fontSize:w??"18px"})}),_n=c=>{switch(c){case"search":return vn;case"arrow":default:return xn}},ci=({components:c,icon:w,height:A,fontSize:J,optionHeight:q,dropDownIndicatorWidth:Q,closeIndicatorWidth:ae,minHeight:R,isInvalid:B,...$})=>{const N=Se.useMemo(()=>Sn(A,J,q,Q,ae,B,R),[A,J,q,Q,ae,B,R]);return s.jsx(dn,{...$,styles:N,components:{ClearIndicator:mn,MultiValueRemove:bn,DropdownIndicator:_n(w),NoOptionsMessage:wn,Option:yn,...c}})};ci.defaultProps={isSearchable:!0,isClearable:!0,icon:"arrow",height:"auto",optionHeight:"48px",fontSize:"18px",minHeight:"48px"};ci.NoOptionsMessage=Cn;const pt=({children:c,backgroundColor:w,color:A,fontSize:J,padding:q,...Q})=>s.jsx(W,{"data-testid":"Tag-Container",display:"inline-flex",alignItems:"center",backgroundColor:w,color:A,padding:q,borderRadius:"6px",...Q,children:s.jsx(Ae,{fontSize:J,fontWeight:"600",children:c})});pt.defaultProps={backgroundColor:Xi,color:We,fontSize:"12px",padding:"4px 8px"};const Pn=()=>s.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("g",{clipPath:"url(#clip0_4038_15354)",children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.6393 5.98166L13.7825 18.7859L11.6948 14.6792C11.657 14.6048 11.6169 14.5318 11.5748 14.4603L14.756 11.279C15.1466 10.8885 15.1466 10.2553 14.756 9.86479C14.3655 9.47427 13.7324 9.47427 13.3418 9.86479L10.1605 13.0461C10.089 13.004 10.0161 12.964 9.94182 12.9262L5.83511 10.8384L18.6393 5.98166ZM17.93 4.11167C19.5422 3.50016 21.1208 5.07882 20.5093 6.69097L15.6525 19.4952C15.0367 21.1187 12.7866 21.2401 11.9997 19.6922L9.91194 15.5855C9.71997 15.2079 9.41307 14.901 9.03546 14.709L4.92875 12.6213C3.3809 11.8344 3.50228 9.58425 5.1258 8.96843L17.93 4.11167Z",fill:"currentColor"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_4038_15354",children:s.jsx("rect",{width:"24",height:"24",fill:"currentColor",transform:"translate(0 0.175781)"})})})]});function It({isOwnProfile:c,setIsEditOpen:w,onBackClick:A,onEditClick:J}){const q=ni(),Q=c?We:Vi,ae=()=>{A==null||A(),q.goBack()},R=()=>{J==null||J(),w==null||w(!0)};return s.jsxs(W,{height:"18px",width:"100%",justifyContent:"space-between",children:[s.jsx(Ni,{size:"auto",display:"transparent",onClick:ae,className:"hover:opacity-50 transition-opacity duration-150 ease-in-out",children:s.jsxs(W,{height:"18px",alignItems:"center",gap:"4px",children:[s.jsx(Zi,{color:Q,height:"16px",width:"16px"}),s.jsx(Ae,{lineHeight:"18px",fontSize:"14px",fontWeight:"600",textColor:Q,children:"Back"})]})}),c&&w&&s.jsx(W,{alignItems:"center",children:s.jsxs(Ni,{size:"auto",display:"transparent",onClick:R,className:"hover:opacity-50 transition-opacity duration-150 ease-in-out",children:[s.jsx(Ae,{lineHeight:"18px",margin:"0 4px 0 0",fontSize:"14px",fontWeight:"600",textColor:Q,children:"Edit"}),s.jsx(an,{color:"white",height:"16px",width:"16px"})]})})]})}function kn({background:c}){return s.jsx(W,{...c,backgroundRepeat:"no-repeat",backgroundSize:"100%",width:"100%",height:"100%",padding:"62px 0px",justifyContent:"center",children:s.jsxs(W,{flexDirection:"column",width:"920px",gap:"8px",children:[s.jsx(It,{isOwnProfile:!1,setIsEditOpen:()=>{}}),s.jsx(W,{gap:"24px",children:s.jsx(W,{margin:"24px 0",padding:"12px",width:"100%",height:"100%",borderRadius:"6px",backgroundColor:We,justifyContent:"center",children:s.jsxs(W,{width:"50%",flexDirection:"column",alignItems:"center",padding:"40px 0 0 0",children:[s.jsx(ai,{width:"48px",height:"48px"}),s.jsx(He,{textColor:At,fontWeight:"600",textSize:"xxxlarge",margin:"24px 0 0 0",children:"Error fetching profile"}),s.jsxs(He,{textColor:At,fontWeight:"600",textAlign:"center",margin:"8px 0 0 0",children:["There was a problem fetching the profile.",s.jsx("br",{}),"Please try again later or contact tech support."]}
1)]})})})]})})}function jn(c){const w=new RegExp(/(\/profile\/)([A-Z0-9-]+)(.*$)/i);return c.replace(w,"$1*****-*****$3")}const Ze=()=>{const c=Qi();function w(A,J){const q=jn(c.pathname);Er(A,q,{...J})}return{recordProfileEvent:w}},ii=({children:c})=>s.jsx(W,{flexDirection:"column",gap:"16px",children:c}),An=Tt(W)`
2    &:not(:first-child) {
3        padding-top: 16px;
4        border-top: 1px solid #e8e8e8;
5    }
6`,Tn=({children:c})=>s.jsx(An,{children:c});ii.Item=Tn;const ve=({children:c,background:w={backgroundColor:We}})=>s.jsx(W,{width:"100%",height:"auto",padding:"24px",borderRadius:"8px",flexDirection:"column",boxShadow:"0px 4px 4px 0px rgba(38, 38, 38, 0.02)",backgroundRepeat:"no-repeat",...w,children:c}),In=["and","the","of","london","&"],En=c=>{const w=c.trim().split(" ").filter(A=>In.indexOf(A.toLowerCase())<0);return[w.shift()||"",w.pop()||""]},Dn=({iconUrl:c,name:w,organisation:A,startDate:J,endDate:q})=>{const Q=A+(J?` | ${J} - ${q||"Present"}`:""),[ae,R]=En(A);return s.jsxs(W,{gap:"12px",children:[s.jsx(si,{size:"48px",profile:{firstName:ae,lastName:R,profilePicture:c}}),s.jsxs(W,{flexDirection:"column",gap:"6px",children:[s.jsx(Ae,{lineHeight:"22px",fontSize:"16px",fontWeight:"600",children:w}),s.jsx(Ae,{lineHeight:"18px",fontSize:"14px",children:Q})]})]})},Qt=({header:c,entries:w,isLoadingEntries:A})=>{if(A)return s.jsxs(ve,{children:[s.jsx(_e,{margin:"0 0 24px",children:c}),s.jsxs(W,{alignItems:"center",children:[s.jsx(ce,{width:"48px",height:"48px",borderRadius:"24px",style:{marginRight:"12px"}}),s.jsx(ce,{width:"280px",height:"24px"})]})]});if(!w||w.length===0)return null;const J=w.map(q=>s.jsx(ii.Item,{children:s.jsx(Dn,{...q})},`${q.name}-${q.organisation}`));return s.jsxs(ve,{children:[s.jsx(_e,{margin:"0 0 24px",children:c}),s.jsx(ii,{children:J})]})},Ln=Tt(W)`
7    overflow: hidden;
8    position: relative;
9
10    text-align: center;
11    &::before {
12        content: '';
13        position: absolute;
14        border: 5px dashed #c0c0c0;
15        top: -4px;
16        bottom: -4px;
17        left: -4px;
18        right: -4px;
19    }
20`;function Et({isOwnProfile:c}){let w="Partner/Expert hasn't updated this area yet";return c&&(w="Update this area"),s.jsx(Ln,{alignItems:"center",justifyContent:"center",padding:"28px",children:s.jsx(He,{textColor:dt,textSize:"small",margin:"0",children:w})})}function or({aboutMe:c,isLoading:w,isOwnProfile:A}){return w?s.jsx(ve,{children:s.jsxs(Te,{"data-testid":"AboutMeTile",children:[s.jsx(_e,{margin:"0 0 24px",children:"About me"}),s.jsxs(W,{flexDirection:"column",gap:"8px",children:[s.jsx(ce,{width:"480px",height:"24px"}),s.jsx(ce,{width:"460px",height:"24px"}),s.jsx(ce,{width:"420px",height:"24px"})]})]})}):!c||c.trim().length===0?s.jsx(ve,{children:s.jsxs(Te,{"data-testid":"AboutMeTile",children:[s.jsx(_e,{margin:"0 0 24px",children:"About me"}),s.jsx(Et,{isOwnProfile:A})]})}):s.jsx(ve,{children:s.jsxs(Te,{"data-testid":"AboutMeTile",children:[s.jsx(_e,{margin:"0 0 24px",children:"About me"}),s.jsx(Ae,{fontSize:"16px",whiteSpace:"pre-line",children:c})]})})}const ri=[{value:"aberdeen",label:"Aberdeen"},{value:"armagh",label:"Armagh"},{value:"bangor-wl",label:"Bangor (Wales)"},{value:"bangor-ie",label:"Bangor (NI)"},{value:"bath",label:"Bath"},{value:"belfast",label:"Belfast"},{value:"birmingham",label:"Birmingham"},{value:"bradford",label:"Bradford"},{value:"brighton and hove",label:"Brighton and Hove"},{value:"bristol",label:"Bristol"},{value:"cambridge",label:"Cambridge"},{value:"canterbury",label:"Canterbury"},{value:"cardiff",label:"Cardiff"},{value:"carlisle",label:"Carlisle"},{value:"chelmsford",label:"Chelmsford"},{value:"chester",label:"Chester"},{value:"chichester",label:"Chichester"},{value:"colchester",label:"Colchester"},{value:"coventry",label:"Coventry"},{value:"derby",label:"Derby"},{value:"doncaster",label:"Doncaster"},{value:"dundee",label:"Dundee"},{value:"dunfermline",label:"Dunfermline"},{value:"durham",label:"Durham"},{value:"ely",label:"Ely"},{value:"edinburgh",label:"Edinburgh"},{value:"exeter",label:"Exeter"},{value:"glasgow",label:"Glasgow"},{value:"gloucester",label:"Gloucester"},{value:"hereford",label:"Hereford"},{value:"inverness",label:"Inverness"},{value:"kingston upon hull",label:"Kingston upon Hull"},{value:"lancaster",label:"Lancaster"},{value:"leeds",label:"Leeds"},{value:"leicester",label:"Leicester"},{value:"lichfield",label:"Lichfield"},{value:"lincoln",label:"Lincoln"},{value:"lisburn",label:"Lisburn"},{value:"liverpool",label:"Liverpool"},{value:"london",label:"London"},{value:"londonderry",label:"Londonderry"},{value:"manchester",label:"Manchester"},{value:"milton keynes",label:"Milton Keynes"},{value:"newcastle upon tyne",label:"Newcastle upon Tyne"},{value:"newport",label:"Newport"},{value:"newry",label:"Newry"},{value:"norwich",label:"Norwich"},{value:"nottingham",label:"Nottingham"},{value:"oxford",label:"Oxford"},{value:"perth",label:"Perth"},{value:"peterborough",label:"Peterborough"},{value:"plymouth",label:"Plymouth"},{value:"portsmouth",label:"Portsmouth"},{value:"preston",label:"Preston"},{value:"ripon",label:"Ripon"},{value:"rochester",label:"Rochester"},{value:"salford",label:"Salford"},{value:"salisbury",label:"Salisbury"},{value:"sheffield",label:"Sheffield"},{value:"southampton",label:"Southampton"},{value:"st albans",label:"St Albans"},{value:"st asaph",label:"St Asaph"},{value:"st david's",label:"St David's"},{value:"southend-on-sea",label:"Southend-on-Sea"},{value:"stirling",label:"Stirling"},{value:"stoke-on-trent",label:"Stoke-on-Trent"},{value:"sunderland",label:"Sunderland"},{value:"swansea",label:"Swansea"},{value:"truro",label:"Truro"},{value:"wakefield",label:"Wakefield"},{value:"wells",label:"Wells"},{value:"westminster",label:"Westminster"},{value:"winchester",label:"Winchester"},{value:"wolverhampton",label:"Wolverhampton"},{value:"worcester",label:"Worcester"},{value:"wrexham",label:"Wrexham"},{value:"york",label:"York"}];function lr({expertId:c,externalId:w,profile:A,profilePictureUrl:J,profilePicturePreview:q,isLoading:Q,isConnected:ae,isProfileNotCompleted:R=!1}){var j;const[B,$]=Se.useState(!!ae),N=ni(),{recordProfileEvent:E}=Ze(),[ee]=sn();Se.useEffect(()=>{$(!!ae)},[ae]);const he=q||J,G=()=>{E("Clicked Message",{Connected:B,"Clicked from Location":"Profile Page","Profile Type":(A==null?void 0:A.userType)||"Unknown","External ID":w||"Unknown"}),A&&N.push(`/messages/${A.userType}/${c}`)},V=async()=>{E("Clicked Connect",{Category:"Network","Clicked from Location":"Profile Page","Profile Type":(A==null?void 0:A.userType)||"Unknown","External ID":w||"Unknown"});try{await ee({followingId:c,isFavourite:!1}).unwrap()}catch(y){console.error(y)}finally{$(!0)}};return Q||!A?s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"16px","data-testid":"BasicInfoTile",children:[s.jsx(ce,{width:"120px",height:"120px",borderRadius:"60px"}),s.jsxs(W,{flexDirection:"column",gap:"8px",children:[s.jsxs(W,{alignItems:"center",flexWrap:"wrap",gap:"8px",children:[s.jsx(ce,{width:"180px",height:"24px"}),s.jsx(ce,{width:"76px",height:"18px"})]}),s.jsx(ce,{width:"160px",height:"22px"}),s.jsx(ce,{width:"140px",height:"22px"}),s.jsx(ce,{width:"100px",height:"18px"})]}),s.jsxs(W,{flexDirection:"column",gap:"8px",children:[s.jsx(ei,{width:"30px",height:"100%",color:"peach50"}),s.jsx(ce,{width:"280px",height:"24px"}),s.jsx(ce,{width:"260px",height:"24px"}),s.jsx(ce,{width:"220px",height:"24px"})]})]})}):s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"16px","data-testid":"BasicInfoTile",children:[s.jsx(si,{size:"120px",profile:{firstName:A.firstName,lastName:A.lastName,profilePicture:he},backgroundColor:Ki,fontSize:"32px",textColor:qi}),s.jsxs(W,{flexDirection:"column",gap:"8px",children:[s.jsxs(W,{alignItems:"center",flexWrap:"wrap",gap:"8px",children:[s.jsxs(_e,{fontSize:"24px",margin:"0",children:[A.title?`${A.title} `:"",A.firstName," ",A.lastName]}),A.pronouns&&s.jsxs(Ae,{margin:"0",padding:"0",fontSize:"14px",lineHeight:"18px",children:["(",A.pronouns,")"]})]}),R?s.jsxs("div",{className:"space-y-1",children:[s.jsx(ce,{width:"90%",height:"16px"}),s.jsx(ce,{width:"45%",height:"16px"})]}):s.jsxs(s.Fragment,{children:[A.jobTitle&&s.jsx(Ae,{margin:"0",fontSize:"16px",fontWeight:"600",lineHeight:"22px",children:A.jobTitle}),A.professionalQualifications&&s.jsx(Ae,{fontSize:"16px",lineHeight:"22px",children:A.professionalQualifications.join(", ")}),A.location&&s.jsx(Ae,{fontSize:"14px",lineHeight:"18px",children:((j=ri.find(y=>{var z;return y.value===((z=A.location)==null?void 0:z.toLowerCase())}))==null?void 0:j.label)||null})]})]}),A.headline&&s.jsxs(W,{flexDirection:"column",gap:"8px",children:[s.jsx(ei,{width:"30px",height:"100%",color:"peach50"}),s.jsx(Ae,{padding:"0",fontSize:"16px",children:A.headline})]}
20),c&&s.jsxs(W,{justifyContent:"flex-start",gap:"8px",children:[s.jsx(Ne,{variant:B?"primary":"secondary",size:"small",onClick:G,children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-4 fw-svg",children:s.jsx(Dr,{})}),s.jsx("span",{children:"Message"})]})}),s.jsx(Ne,{variant:B?"secondary":"primary",size:"small",onClick:V,disabled:B,children:B?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-3 fw-svg",children:s.jsx(on,{})}),s.jsx("span",{children:"Connected"})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ar,{height:"14px",width:"14px"}),"Connect"]})})]})]})})}const hr="/static/media/default-avatar.Bsp_kxOU.png",Rn=c=>{c.currentTarget.onerror=null,c.currentTarget.src=hr},On=c=>c.indexOf("https://s3")>-1;function Mn(c){const[w,A]=Se.useState(hr);return Se.useEffect(()=>{c.expert.profilePhoto&&On(c.expert.profilePhoto)&&A(c.expert.profilePhoto)},[c.expert.profilePhoto]),s.jsx(Gn,{src:w,alt:c.alt?c.alt:`${c.expert.firstName} ${c.expert.lastName?c.expert.lastName:""}`,onError:Rn,className:c.className?c.className:void 0,...c})}const Gn=Tt.img`
21    width: ${c=>c.width?c.width:"48px"};
22    height: ${c=>c.height?c.height:"48px"};
23    border-radius: 50%;
24    object-fit: cover;
25`;function cr({following:c,isLoading:w,isOwnProfile:A}){const[J,q]=Se.useState([]),[Q,ae]=Se.useState(!1),[R]=Lr(),{recordProfileEvent:B}=Ze();return Se.useEffect(()=>{const $=async()=>{ae(!0);const N=c.slice(0,4),E=[];for(let ee=0;ee<N.length;ee++){let he="";try{he=await R(N[ee].userId).unwrap()}catch{}E.push(s.jsx(Fn,{expert:{firstName:"",profilePhoto:he},alt:"connection-avatar"},N[ee].userId))}q(E),ae(!1)};c.length>0&&$()},[c,R]),w?s.jsxs(ve,{children:[s.jsx(_e,{margin:"0 0 24px",children:"Connections"}),s.jsxs(W,{gap:"8px","data-testid":"ConnectionsTile",children:[s.jsxs(W,{children:[s.jsx(ce,{width:"48px",height:"48px",borderRadius:"24px",style:{marginRight:"-12px"}}),s.jsx(ce,{width:"48px",height:"48px",borderRadius:"24px",style:{marginRight:"-12px"}}),s.jsx(ce,{width:"48px",height:"48px",borderRadius:"24px",style:{marginRight:"-12px"}}),s.jsx(ce,{width:"48px",height:"48px",borderRadius:"24px"})]}),s.jsxs(W,{flexDirection:"column",children:[s.jsx(ce,{width:"50px",height:"32px"}),s.jsx(ce,{width:"110px",height:"21px"})]})]})]}):s.jsx(ve,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsx(Xe,{level:5,children:"Connections"}),s.jsxs(W,{gap:"8px","data-testid":"ConnectionsTile",children:[Q?s.jsx(ir,{height:"48px",width:"48px"}):s.jsx(W,{children:J}),s.jsxs(W,{flexDirection:"column",children:[s.jsx("strong",{className:"text-lg","data-testid":"ConnectionsFollowing",children:c.length}),A?s.jsx(Rr,{to:"/network?tab=myconnections",onClick:()=>B("Clicked Connections Link"),children:"Connections"}):"connections"]})]})]})})}const Fn=Tt(Mn)`
26    &:not(:last-child) {
27        margin-right: -12px;
28    }
29`;function Bn({isLoading:c,errorMessage:w,icons:A}){return c?s.jsx(ce,{width:"270px",height:"40px",borderRadius:"6px"}):w?s.jsx(W,{gap:"24px",children:s.jsx(He,{textColor:ut,children:w})}):s.jsx(W,{gap:"24px",flexWrap:"wrap",children:A})}function Un({insurers:c,isLoading:w,error:A}){if((!c||c.length===0)&&!w)return null;const J=c?c.map(({imageBase64:Q,imageMimeType:ae,organisationId:R,organisationName:B})=>s.jsx(Or,{size:40,src:`data:${ae};base64,${Q}`,alt:`${B} insurer image`},R)):[],q=Mr(A);return s.jsxs(ve,{children:[s.jsx(_e,{margin:"0 0 24px","data-testid":"InsurerTile",children:"Insurers I work with"}),s.jsx(Bn,{isLoading:w,errorMessage:q,icons:J})]})}const Dt=({children:c})=>s.jsx(Ae,{padding:"1px 0 0 0",lineHeight:"20px",fontSize:"14px",fontWeight:"600",children:c}),Nn=c=>{const w=ln.find(A=>A.value===c);return(w==null?void 0:w.label)||c};function Hn({languages:c,isLoading:w}){return w?s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"LanguagesTile",children:[s.jsx(_e,{margin:"0",children:"Languages I speak"}),s.jsxs(W,{flexDirection:"row",gap:"8px",children:[s.jsx(Te,{height:"24px",width:"24px",children:s.jsx(ti,{width:"24px",height:"24px"})}),s.jsxs(W,{gap:"8px",flexWrap:"wrap",children:[s.jsx(ce,{width:"64px",height:"38px",borderRadius:8,style:{padding:"3px 0"}}),s.jsx(ce,{width:"64px",height:"38px",borderRadius:8,style:{padding:"3px 0"}}),s.jsx(ce,{width:"64px",height:"38px",borderRadius:8,style:{padding:"3px 0"}})]})]})]})}):!c||c.length===0?null:s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"LanguagesTile",children:[s.jsx(_e,{margin:"0",children:"Languages I speak"}),s.jsxs(W,{flexDirection:"row",gap:"8px",children:[s.jsx(Te,{height:"24px",width:"24px",children:s.jsx(ti,{width:"24px",height:"24px"})}),s.jsx(W,{gap:"8px",flexWrap:"wrap",children:c.map((A,J)=>s.jsx(Te,{padding:"3px 0",borderRadius:8,border:"1px solid #e8e8e8",children:s.jsx(pt,{color:Ge,backgroundColor:We,children:s.jsx(Dt,{children:Nn(A)})})},J))})]})]})})}function Wn({children:c,otherTopics:w,isLoading:A,isOwnProfile:J}){return A?s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"OtherAreasTile",children:[s.jsx(_e,{margin:"0",children:c}),s.jsxs(W,{flexDirection:"row",gap:"8px",children:[s.jsx(Te,{height:"24px",width:"24px",children:s.jsx($t,{width:"24px",height:"24px"})}),s.jsxs(W,{gap:"8px",flexWrap:"wrap",children:[s.jsx(ce,{width:"140px",height:"38px",borderRadius:"8px"}),s.jsx(ce,{width:"120px",height:"38px",borderRadius:"8px"}),s.jsx(ce,{width:"100px",height:"38px",borderRadius:"8px"})]})]})]})}):!w||w.length===0?s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"12px","data-testid":"OtherAreasTile",children:[s.jsx(_e,{margin:"0",children:c}),s.jsx(Et,{isOwnProfile:J})]})}):s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"OtherAreasTile",children:[s.jsx(_e,{margin:"0",children:c}),s.jsxs(W,{flexDirection:"row",gap:"8px",children:[s.jsx(Te,{height:"24px",width:"24px",children:s.jsx($t,{width:"24px",height:"24px"})}),s.jsx(W,{gap:"8px",flexWrap:"wrap",children:w.map((q,Q)=>s.jsx(Te,{padding:"3px 0",borderRadius:8,border:"1px solid #e8e8e8",children:s.jsx(pt,{color:Ge,backgroundColor:We,children:s.jsx(Dt,{children:q})})},Q))})]})]})})}function zn({profile:c,externalId:w}){const A=ni(),{recordProfileEvent:J}=Ze(),q=()=>{J("Clicked Refer",{"Clicked from Location":"Profile Page","Profile Type":(c==null?void 0:c.userType)||"Unknown","External ID":w||"Unknown"});let Q="/new-referral";c&&(Q="/new-referral?expert="+encodeURIComponent(`${c.firstName} ${c.lastName}`)),A.push(Q)};return s.jsx(Gr,{children:s.jsxs("div",{className:"p-4 py-6 md:p-6 md:py-6 flex flex-col gap-6",children:[s.jsx(Xe,{level:4,children:"Make a referral"}),s.jsx("div",{children:"We'll send your referral to this therapist directly"}),s.jsx("div",{className:"flex justify-end",children:s.jsx(Ne,{size:"small",onClick:q,children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pn,{}),"Refer"]})})})]})})}function dr({topSpecialisms:c,isLoading:w,isOwnProfile:A}){if(w)return s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"TopSpecialitiesTile",children:[s.jsx(_e,{margin:"0",children:"Primary specialisms"}),s.jsxs(W,{gap:"8px",flexWrap:"wrap",children:[s.jsx(ce,{width:"140px",height:"38px",borderRadius:"8px"}),s.jsx(ce,{width:"120px",height:"38px",borderRadius:"8px"}),s.jsx(ce,{width:"100px",height:"38px",borderRadius:"8px"})]})]})});if(!c||c.length===0)return s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"12px","data-testid":"TopSpecialitiesTile",children:[s.jsx(_e,{margin:"0",children:"Primary specialisms"}),s.jsx(Et,{isOwnProfile:A})]})});const J=Fr;return s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"TopSpecialitiesTile",children:[s.jsx(_e,{margin:"0",children:"Primary specialisms"}),s.jsx(W,{gap:"8px",flexWrap:"wrap",children:c.map((q,Q)=>s.jsx(Te,{padding:"3px 0",borderRadius:8,backgroundColor:J,border:"1px solid #e8e8e8",children:s.jsx(pt,{color:Ge,backgroundColor:J,children:s.jsx(Dt,{children:q})})},Q))})]})})}function Yn({treatmentApproaches:c,isLoading:w,isOwnProfile:A}){return w?s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"TypesOfTherapyTile",children:[s.jsx(_e,{margin:"0",children:"Treatment approaches I can offer"}),s.jsxs(W,{flexDirection:"row",gap:"8px",children:[s.jsx(Te,{height:"24px",width:"24px",children:s.jsx(Zt,{width:"24px",height:"24px"})}),s.jsxs(W,{gap:"8px",flexWrap:"wrap",children:[s.jsx(ce,{width:"140px",height:"38px"}),s.jsx(ce,{width:"120px",height:"38px"}),s.jsx(ce,{width:"100px",height:"38px"})]})]})]})}):!c||c.length===0?s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"12px","data-testid":"TypesOfTherapyTile",children:[s.jsx(_e,{margin:"0",children:"Treatment approaches I can offer"}),s.jsx(Et,{isOwnProfile:A})]})}):s.jsx(ve,{children:s.jsxs(W,{flexDirection:"column",gap:"24px","data-testid":"TypesOfTherapyTile",children:[s.jsx(_e,{margin:"0",children:"Treatment approaches I can offer"}),s.jsxs(W,{flexDirection:"row",gap:"8px",children:[s.jsx(Te,{height:"24px",width:"24px",children:s.jsx(Zt,{width:"24px",height:"24px"})}),s.jsx(W,{gap:"8px",flexWrap:"wrap",children:c==null?void 0:c.map((J,q)=>s.jsx(Te,{padding:"3px 0",borderRadius:8,border:"1px solid #e8e8e8",children:s.jsx(pt,{color:Ge,backgroundColor:We,children:s.jsx(Dt,{children:J})})},q))})]})]})})}function Xn({profile:c,isLoadingProfiles:w,background:A}){const{cognitoId:J}=oi(),{recordProfileEvent:q}=Ze(),Q=Br(j=>tr(j,J));let{data:ae,error:R}=Ji(J,{skip:!J});const{data:B,isLoading:$,error:N}=Ur(J),{data:E,isLoading:ee}=er(J),he=Jt($i),G=((E==null?void 0:E.followedBy)||[]).findIndex(j=>j.userId===he.cognitoId)>-1;R&&(ae=void 0);const V=()=>{q("Clicked Back",{"Clicked from Location":"Profile Page","Profile Type":"expert"})};return s.jsx(W,{...A,backgroundRepeat:"no-repeat",backgroundSize:"contain",width:"100%",minHeight:"100%",height:"max-content",justifyContent:"center","data-testid":"profile",position:"relative",children:s.jsxs(W,{margin:"62px 0px",flexDirection:"column",width:"920px",gap:"8px",children:[s.jsx(It,{isOwnProfile:!1,onBackClick:V}),s.jsxs(W,{gap:"24px",children:[s.jsxs(W,{flexDirection:"column",gap:"16px",width:"330px",children:[s.jsx(lr,{expertId:J,externalId:Q==null?void 0:Q.externalId,profile:c,profilePictureUrl:ae,isLoading:w,isConnected:G}),s.jsx(zn,{profile:c,externalId:Q==null?void 0:Q.externalId}),s.jsx(cr,{following:(E==null?void 0:E.following)||[],isLoading:ee}),s.jsx(Un,{insurers:B,isLoading:$,error:N}),s.jsx(Hn,{languages:(c==null?void 0:c.languages)||[],isLoading:w})]}),s.jsxs(W,{flexDirection:"column",gap:"16px",width:"566px",children:[s.jsx(or,{aboutMe:c==null?void 0:c.aboutMe,isLoading:w}),s.jsx(dr,{topSpecialisms:c==null?void 0:c.topSpecialisms,isLoading:w}),s.jsx(Wn,{otherTopics:c==null?void 0:c.otherTopics,isLoading:w,children:"Other areas I have experience in"}),s.jsx(Yn,{treatmentApproaches:c==null?void 0:c.treatmentApproaches,isLoading:w}),!!(c!=null&&c.qualifications)&&c.qualifications.length>0&&s.jsx(Qt,{header:"Qualifications",entries:c==null?void 0:c.qualifications,isLoadingEntries:w}),!!(c!=null&&c.experience)&&c.experience.length>0&&s.jsx(Qt,{header:"Work Experience",entries:c==null?void 0:c.experience,isLoadingEntries:w}),!!(c!=null&&c.education)&&c.education.length>0&&s.jsx(Qt,{header:"Education",entries:c==null?void 0:c.education,isLoadingEntries:w})]})]})]})})}
29function Vn({previewBackground:c}){return s.jsx(W,{...c,backgroundRepeat:"no-repeat",backgroundSize:"contain",width:"100%",height:"100%",padding:"62px 0px",justifyContent:"center",children:s.jsxs(W,{flexDirection:"column",width:"920px",gap:"8px",children:[s.jsx(It,{isOwnProfile:!1}),s.jsx(W,{gap:"24px",children:s.jsx(W,{margin:"24px 0",padding:"12px",width:"100%",height:"100%",borderRadius:"6px",backgroundColor:We,justifyContent:"center",children:s.jsxs(W,{width:"50%",flexDirection:"column",alignItems:"center",padding:"40px 0 0 0",children:[s.jsx(ai,{width:"48px",height:"48px"}),s.jsx(He,{textColor:At,fontWeight:"600",textSize:"xxxlarge",margin:"24px 0 0 0",children:"Oops"}),s.jsx(He,{textColor:At,fontWeight:"600",textAlign:"center",margin:"8px 0 0 0",children:"We couldn't find this profile."})]})})})]})})}function qt(c){return typeof c=="object"&&c!=null&&"status"in c}function Qn(c){return typeof c=="object"&&c!=null&&"message"in c&&typeof c.message=="string"}async function qn(c,w,A,J){try{w.setStatus(void 0),w.setSubmitting(!0);const q=await A(c);if(q.ok){const Q=J||c;w.resetForm({values:Q}),w.setStatus({success:!0})}else w.setStatus({success:!1,errorMessage:q.errorMessage});w.setSubmitting(!1)}catch(q){w.setSubmitting(!1),console.error(q),w.setStatus({success:!1,errorMessage:q.message})}}function Kn({errorMessage:c}){return s.jsxs(W,{alignSelf:"stretch",alignItems:"center",padding:"12px",gap:"12px",children:[s.jsx(ai,{}),s.jsxs(He,{fontWeight:"600",textColor:ut,textSize:"small",margin:"6px 0",children:["Error: ",c]})]})}function Jn(){return s.jsx(W,{alignSelf:"stretch",children:s.jsx(He,{textColor:"green",fontWeight:"600",textSize:"small",children:"Successfully updated"})})}function $n({isSubmitting:c,status:w}){return c?s.jsx(Nr,{color:We}):w!=null&&w.success?s.jsx(Jn,{}):(w==null?void 0:w.success)===!1?s.jsx(Kn,{errorMessage:(w==null?void 0:w.errorMessage)||""}):null}const Zn=["General Adult Psychiatrist","Child and Adolescent Psychiatrist","Old Age Psychiatrist","Addiction Psychiatrist","Perinatal Pyschiatrist","Forensic Psychiatrist","General Practitioner (GP)","Neurologist","Oncologist","Surgeon","Cardiologist","Medical Doctor (Other) / Other medical specialist"];function ea({values:c,setFieldValue:w}){const A=Zn.map(q=>({label:q,value:q})),J=c.jobTitle?{label:c.jobTitle,value:c.jobTitle}:null;return s.jsx(li,{label:"Professional Title*",name:"jobTitle",id:"jobTitle",value:J,placeholder:"Please select",options:A,onChange:q=>{w("jobTitle",q==null?void 0:q.value)}})}const ta=({field:c,form:w})=>s.jsx(li,{label:"Location",name:c.name,id:"locationField",value:ri.find(A=>A.value===c.value),placeholder:"Start typing your city",options:ri,isSearchable:!0,search:!0,onChange:A=>{A&&w.setFieldValue(c.name,A.value)}});function ia(){return s.jsx(Hr,{name:"location",component:ta})}const ra=["","He/Him","She/Her","They/Them"];function na({values:c,setFieldValue:w}){const A=ra.reduce((q,Q)=>(Q!==""&&q.push({label:Q,value:Q}),q),[]),J=c.pronouns?{label:c.pronouns,value:c.pronouns}:null;return s.jsx(li,{label:"Pronouns",name:"pronouns",id:"pronouns",value:J,placeholder:"Select your pronouns",isClearable:!0,options:A,onChange:q=>{w("pronouns",(q==null?void 0:q.value)||null)}})}var ur={exports:{}};(function(c,w){(function(A,J){c.exports=J(Se)})(self,function(A){return(()=>{var J={303:(R,B,$)=>{R.exports=$(302),$(200),$(630),$(16),$(677),$(635),$(166),$(140),$(922)},635:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302),$(677)],(ee=typeof(N=function(G){var V=G.ExifMap.prototype;V.tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",34665:{36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",3738
290:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber"},34853:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},40965:{1:"InteroperabilityIndex"}},V.tags.ifd1=V.tags,V.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"Original",2:"Horizontal flip",3:"Rotate 180° CCW",4:"Vertical flip",5:"Vertical flip + Rotate 90° CW",6:"Rotate 90° CW",7:"Horizontal flip + Rotate 90° CW",8:"Rotate 90° CCW"}},V.getText=function(j){var y=this.get(j);switch(j){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[j][y];case"ExifVersion":case"FlashpixVersion":return y?String.fromCharCode(y[0],y[1],y[2],y[3]):void 0;case"ComponentsConfiguration":return y?this.stringValues[j][y[0]]+this.stringValues[j][y[1]]+this.stringValues[j][y[2]]+this.stringValues[j][y[3]]:void 0;case"GPSVersionID":return y?y[0]+"."+y[1]+"."+y[2]+"."+y[3]:void 0}return String(y)},V.getAll=function(){var j,y,z,U={};for(j in this)Object.prototype.hasOwnProperty.call(this,j)&&((y=this[j])&&y.getAll?U[this.ifds[j].name]=y.getAll():(z=this.tags[j])&&(U[z]=this.getText(z)));return U},V.getName=function(j){var y=this.tags[j];return typeof y=="object"?this.ifds[j].name:y},function(){var j,y,z,U=V.tags;for(j in U)if(Object.prototype.hasOwnProperty.call(U,j))if(y=V.ifds[j])for(j in z=U[j])Object.prototype.hasOwnProperty.call(z,j)&&(y.map[z[j]]=Number(j));else V.map[U[j]]=Number(j)}()})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},677:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302),$(630)],(ee=typeof(N=function(G){function V(D){D&&(Object.defineProperty(this,"map",{value:this.ifds[D].map}),Object.defineProperty(this,"tags",{value:this.tags&&this.tags[D]||{}}))}V.prototype.map={Orientation:274,Thumbnail:"ifd1",Blob:513,Exif:34665,GPSInfo:34853,Interoperability:40965}
29,V.prototype.ifds={ifd1:{name:"Thumbnail",map:V.prototype.map},34665:{name:"Exif",map:{}},34853:{name:"GPSInfo",map:{}},40965:{name:"Interoperability",map:{}}},V.prototype.get=function(D){return this[D]||this[this.map[D]]};var j={1:{getValue:function(D,g){return D.getUint8(g)},size:1},2:{getValue:function(D,g){return String.fromCharCode(D.getUint8(g))},size:1,ascii:!0},3:{getValue:function(D,g,T){return D.getUint16(g,T)},size:2},4:{getValue:function(D,g,T){return D.getUint32(g,T)},size:4},5:{getValue:function(D,g,T){return D.getUint32(g,T)/D.getUint32(g+4,T)},size:8},9:{getValue:function(D,g,T){return D.getInt32(g,T)},size:4},10:{getValue:function(D,g,T){return D.getInt32(g,T)/D.getInt32(g+4,T)},size:8}};function y(D,g,T,m,S,O){var k,v,x,p,P,_,I=j[m];if(I){if(!((v=(k=I.size*S)>4?g+D.getUint32(T+8,O):T+8)+k>D.byteLength)){if(S===1)return I.getValue(D,v,O);for(x=[],p=0;p<S;p+=1)x[p]=I.getValue(D,v+p*I.size,O);if(I.ascii){for(P="",p=0;p<x.length&&(_=x[p])!=="\0";p+=1)P+=_;return P}return x}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")}function z(D,g,T){return(!D||D[T])&&(!g||g[T]!==!0)}function U(D,g,T,m,S,O,k,v){var x,p,P,_,I,M;if(T+6>D.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((p=T+2+12*(x=D.getUint16(T,m)))+4>D.byteLength)){for(P=0;P<x;P+=1)_=T+2+12*P,z(k,v,I=D.getUint16(_,m))&&(M=y(D,g,_,D.getUint16(_+2,m),D.getUint32(_+4,m),m),S[I]=M,O&&(O[I]=_));return D.getUint32(p,m)}console.log("Invalid Exif data: Invalid directory size.")}}j[7]=j[1],G.parseExifData=function(D,g,T,m,S){if(!S.disableExif){var O,k,v,x=S.includeExifTags,p=S.excludeExifTags||{34665:{37500:!0}},P=g+10;if(D.getUint32(g+4)===1165519206)if(P+8>D.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(D.getUint16(g+8)===0){switch(D.getUint16(P)){case 18761:O=!0;break;case 19789:O=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}D.getUint16(P+2,O)===42?(k=D.getUint32(P+4,O),m.exif=new V,S.disableExifOffsets||(m.exifOffsets=new V,m.exifTiffOffset=P,m.exifLittleEndian=O),(k=U(D,P,P+k,O,m.exif,m.exifOffsets,x,p))&&z(x,p,"ifd1")&&(m.exif.ifd1=k,m.exifOffsets&&(m.exifOffsets.ifd1=P+k)),Object.keys(m.exif.ifds).forEach(function(_){(function(I,M,F,Y,ie,ne,se){var Z=I.exif[M];Z&&(I.exif[M]=new V(M),I.exifOffsets&&(I.exifOffsets[M]=new V(M)),U(F,Y,Y+Z,ie,I.exif[M],I.exifOffsets&&I.exifOffsets[M],ne&&ne[M],se&&se[M]))})(m,_,D,P,O,x,p)}),(v=m.exif.ifd1)&&v[513]&&(v[513]=function(_,I,M){if(M){if(!(I+M>_.byteLength))return new Blob([G.bufferSlice.call(_.buffer,I,I+M)],{type:"image/jpeg"});console.log("Invalid Exif data: Invalid thumbnail data.")}}(D,P+v[513],v[514]))):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},G.metaDataParsers.jpeg[65505].push(G.parseExifData),G.exifWriters={274:function(D,g,T){var m=g.exifOffsets[274];return m&&new DataView(D,m+8,2).setUint16(0,T,g.exifLittleEndian),D}},G.writeExifData=function(D,g,T,m){return G.exifWriters[g.exif.map[T]](D,g,m)},G.ExifMap=V})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},16:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302)],(ee=typeof(N=function(G){var V=G.global;V.fetch&&V.Request&&V.Response&&V.Response.prototype.blob?G.fetchBlob=function(j,y,z){function U(D){return D.blob()}if(V.Promise&&typeof y!="function")return fetch(new Request(j,y)).then(U);fetch(new Request(j,z)).then(U).then(y).catch(function(D){y(null,D)})}:V.XMLHttpRequest&&new XMLHttpRequest().responseType===""&&(G.fetchBlob=function(j,y,z){function U(D,g){z=z||{};var T=new XMLHttpRequest;T.open(z.method||"GET",j),z.headers&&Object.keys(z.headers).forEach(function(m){T.setRequestHeader(m,z.headers[m])}),T.withCredentials=z.credentials==="include",T.responseType="blob",T.onload=function(){D(T.response)},T.onerror=T.onabort=T.ontimeout=function(m){D===g?g(null,m):g(m)},T.send(z.body)}return V.Promise&&typeof y!="function"?(z=y,new Promise(U)):U(y,y)})})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},140:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302),$(166)],(ee=typeof(N=function(G){var V=G.IptcMap.prototype;V
vendor: 1,397 bytes, line 29
29.tags={0:"ApplicationRecordVersion",3:"ObjectTypeReference",4:"ObjectAttributeReference",5:"ObjectName",7:"EditStatus",8:"EditorialUpdate",10:"Urgency",12:"SubjectReference",15:"Category",20:"SupplementalCategories",22:"FixtureIdentifier",25:"Keywords",26:"ContentLocationCode",27:"ContentLocationName",30:"ReleaseDate",35:"ReleaseTime",37:"ExpirationDate",38:"ExpirationTime",40:"SpecialInstructions",42:"ActionAdvised",45:"ReferenceService",47:"ReferenceDate",50:"ReferenceNumber",55:"DateCreated",60:"TimeCreated",62:"DigitalCreationDate",63:"DigitalCreationTime",65:"OriginatingProgram",70:"ProgramVersion",75:"ObjectCycle",80:"Byline",85:"BylineTitle",90:"City",92:"Sublocation",95:"State",100:"CountryCode",101:"Country",103:"OriginalTransmissionReference",105:"Headline",110:"Credit",115:"Source",116:"CopyrightNotice",118:"Contact",120:"Caption",121:"LocalCaption",122:"Writer",125:"RasterizedCaption",130:"ImageType",131:"ImageOrientation",135:"LanguageIdentifier",150:"AudioType",151:"AudioSamplingRate",152:"AudioSamplingResolution",153:"AudioDuration",154:"AudioOutcue",184:"JobID",185:"MasterDocumentID",186:"ShortDocumentID",187:"UniqueDocumentID",188:"OwnerID",200:"ObjectPreviewFileFormat",201:"ObjectPreviewFileVersion",202:"ObjectPreviewData",221:"Prefs",225:"ClassifyState",228:"SimilarityIndex",230:"DocumentNotes",231:"DocumentHistory",232:"ExifCameraInfo",255:"CatalogSets"},
29V.stringValues={10:{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"},75:{a:"Morning",b:"Both Morning and Evening",p:"Evening"},131:{L:"Landscape",P:"Portrait",S:"Square"}},V.getText=function(j){var y=this.get(j),z=this.map[j],U=this.stringValues[z];return U?U[y]:String(y)},V.getAll=function(){var j,y,z={};for(j in this)Object.prototype.hasOwnProperty.call(this,j)&&(y=this.tags[j])&&(z[y]=this.getText(y));return z},V.getName=function(j){return this.tags[j]},function(){var j,y=V.tags,z=V.map||{};for(j in y)Object.prototype.hasOwnProperty.call(y,j)&&(z[y[j]]=Number(j))}()})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},166:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302),$(630)],(ee=typeof(N=function(G){function V(){}function j(g,T,m,S,O){return T.types[g]==="binary"?new Blob([m.buffer.slice(S,S+O)]):T.types[g]==="Uint16"?m.getUint16(S):function(k,v,x){for(var p="",P=v+x,_=v;_<P;_+=1)p+=String.fromCharCode(k.getUint8(_));return p}(m,S,O)}function y(g,T){return g===void 0?T:g instanceof Array?(g.push(T),g):[g,T]}function z(g,T,m,S,O,k){for(var v,x,p,P=T+m,_=T;_<P;)g.getUint8(_)===28&&g.getUint8(_+1)===2&&(p=g.getUint8(_+2),O&&!O[p]||k&&k[p]||(x=g.getInt16(_+3),v=j(p,S.iptc,g,_+5,x),S.iptc[p]=y(S.iptc[p],v),S.iptcOffsets&&(S.iptcOffsets[p]=_))),_+=1}function U(g,T){return g.getUint32(T)===943868237&&g.getUint16(T+4)===1028}function D(g,T){var m=g.getUint8(T+7);return m%2!=0&&(m+=1),m===0&&(m=4),m}V.prototype.map={ObjectName:5},V.prototype.types={0:"Uint16",200:"Uint16",201:"Uint16",202:"binary"},V.prototype.get=function(g){return this[g]||this[this.map[g]]},G.parseIptcData=function(g,T,m,S,O){if(!O.disableIptc)for(var k=T+m;T+8<k;){if(U(g,T)){var v=D(g,T),x=T+8+v;if(x>k){console.log("Invalid IPTC data: Invalid segment offset.");break}var p=g.getUint16(T+6+v);if(T+p>k){console.log("Invalid IPTC data: Invalid segment size.");break}return S.iptc=new V,O.disableIptcOffsets||(S.iptcOffsets=new V),void z(g,x,p,S,O.includeIptcTags,O.excludeIptcTags||{202:!0})}T+=1}},G.metaDataParsers.jpeg[65517].push(G.parseIptcData),G.IptcMap=V})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},630:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302)],(ee=typeof(N=function(G){var V=G.global,j=G.transform,y=V.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),z=V.ArrayBuffer&&ArrayBuffer.prototype.slice||function(T,m){m=m||this.byteLength-T;var S=new Uint8Array(this,T,m),O=new Uint8Array(m);return O.set(S),O.buffer},U={jpeg:{65505:[],65517:[]}};function D(T,m,S,O){var k=this;function v(x,p){if(!(V.DataView&&y&&T&&T.size>=12&&T.type==="image/jpeg"))return x(O);var P=S.maxMetaDataSize||262144;G.readFile(y.call(T,0,P),function(_){var I=new DataView(_);if(I.getUint16(0)!==65496)return p(new Error("Invalid JPEG file: Missing JPEG marker."));for(var M,F,Y,ie,ne=2,se=I.byteLength-4,Z=ne;ne<se&&((M=I.getUint16(ne))>=65504&&M<=65519||M===65534);){if(ne+(F=I.getUint16(ne+2)+2)>I.byteLength){console.log("Invalid JPEG metadata: Invalid segment size.");break}if((Y=U.jpeg[M])&&!S.disableMetaDataParsers)for(ie=0;ie<Y.length;ie+=1)Y[ie].call(k,I,ne,F,O,S);Z=ne+=F}!S.disableImageHead&&Z>6&&(O.imageHead=z.call(_,0,Z)),x(O)},p,"readAsArrayBuffer")||x(O)}return S=S||{},V.Promise&&typeof m!="function"?(O=S=m||{},new Promise(v)):(O=O||{},v(m,m))}function g(T,m,S){return T&&m&&S?new Blob([S,y.call(T,m.byteLength)],{type:"image/jpeg"}):null}G.transform=function(T,m,S,O,k){G.requiresMetaData(m)?D(O,function(v){v!==k&&(V.console&&console.log(v),v=k),j.call(G,T,m,S,O,v)},m,k=k||{}):j.apply(G,arguments)},G.blobSlice=y,G.bufferSlice=z,G.replaceHead=function(T,m,S){var O={maxMetaDataSize:256,disableMetaDataParsers:!0};if(!S&&V.Promise)return D(T,O).then(function(k){return g(T,k.imageHead,m)});D(T,function(k){S(g(T,k.imageHead,m))},O)},G.parseMetaData=D,G.metaDataParsers=U})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},922:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302),$(200),$(630)],(ee=typeof(N=function(G){var V=G.transform,j=G.requiresCanvas,y=G.requiresMetaData,z=G.transformCoordinates,U=G.getTransformedOptions;function D(m,S){var O=m&&m.orientation;return O===!0&&!G.orientation||O===1&&G.orientation||(!S||G.orientation)&&O>1&&O<9}function g(m,S){return m!==S&&(m===1&&S>1&&S<9||m>1&&m<9)}function T(m,S){if(S>1&&S<9)switch(m){case 2:case 4:return S>4;case 5:case 7:return S%2==0;case 6:case 8:return S===2||S===4||S===5||S===7}return!1}(function(m){if(m.global.document){var S=document.createElement("img");S.onload=function(){if(m.orientation=S.width===2&&S.height===3,m.orientation){var O=m.createCanvas(1,1,!0).getContext("2d");O.drawImage(S,1,1,1,1,0,0,1,1),m.orientationCropBug=O.getImageData(0,0,1,1).data.toString()!=="255,255,255,255"}},S.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH
29/9k="}})(G),G.requiresCanvas=function(m){return D(m)||j.call(G,m)},G.requiresMetaData=function(m){return D(m,!0)||y.call(G,m)},G.transform=function(m,S,O,k,v){V.call(G,m,S,function(x,p){if(p){var P=G.orientation&&p.exif&&p.exif.get("Orientation");if(P>4&&P<9){var _=p.originalWidth,I=p.originalHeight;p.originalWidth=I,p.originalHeight=_}}O(x,p)},k,v)},G.getTransformedOptions=function(m,S,O){var k=U.call(G,m,S),v=O.exif&&O.exif.get("Orientation"),x=k.orientation,p=G.orientation&&v;if(x===!0&&(x=v),!g(x,p))return k;var P=k.top,_=k.right,I=k.bottom,M=k.left,F={};for(var Y in k)Object.prototype.hasOwnProperty.call(k,Y)&&(F[Y]=k[Y]);if(F.orientation=x,(x>4&&!(p>4)||x<5&&p>4)&&(F.maxWidth=k.maxHeight,F.maxHeight=k.maxWidth,F.minWidth=k.minHeight,F.minHeight=k.minWidth,F.sourceWidth=k.sourceHeight,F.sourceHeight=k.sourceWidth),p>1){switch(p){case 2:_=k.left,M=k.right;break;case 3:P=k.bottom,_=k.left,I=k.top,M=k.right;break;case 4:P=k.bottom,I=k.top;break;case 5:P=k.left,_=k.bottom,I=k.right,M=k.top;break;case 6:P=k.left,_=k.top,I=k.right,M=k.bottom;break;case 7:P=k.right,_=k.top,I=k.left,M=k.bottom;break;case 8:P=k.right,_=k.bottom,I=k.left,M=k.top}if(T(x,p)){var ie=P,ne=_;P=I,_=M,I=ie,M=ne}}switch(F.top=P,F.right=_,F.bottom=I,F.left=M,x){case 2:F.right=M,F.left=_;break;case 3:F.top=I,F.right=M,F.bottom=P,F.left=_;break;case 4:F.top=I,F.bottom=P;break;case 5:F.top=M,F.right=I,F.bottom=_,F.left=P;break;case 6:F.top=_,F.right=I,F.bottom=M,F.left=P;break;case 7:F.top=_,F.right=P,F.bottom=M,F.left=I;break;case 8:F.top=M,F.right=P,F.bottom=_,F.left=I}return F},G.transformCoordinates=function(m,S,O){z.call(G,m,S,O);var k=S.orientation,v=G.orientation&&O.exif&&O.exif.get("Orientation");if(g(k,v)){var x=m.getContext("2d"),p=m.width,P=m.height,_=p,I=P;switch((k>4&&!(v>4)||k<5&&v>4)&&(m.width=P,m.height=p),k>4&&(_=P,I=p),v){case 2:x.translate(_,0),x.scale(-1,1);break;case 3:x.translate(_,I),x.rotate(Math.PI);break;case 4:x.translate(0,I),x.scale(1,-1);break;case 5:x.rotate(-.5*Math.PI),x.scale(-1,1);break;case 6:x.rotate(-.5*Math.PI),x.translate(-_,0);break;case 7:x.rotate(-.5*Math.PI),x.translate(-_,I),x.scale(1,-1);break;case 8:x.rotate(.5*Math.PI),x.translate(0,-I)}switch(T(k,v)&&(x.translate(_,I),x.rotate(Math.PI)),k){case 2:x.translate(p,0),x.scale(-1,1);break;case 3:x.translate(p,P),x.rotate(Math.PI);break;case 4:x.translate(0,P),x.scale(1,-1);break;case 5:x.rotate(.5*Math.PI),x.scale(1,-1);break;case 6:x.rotate(.5*Math.PI),x.translate(0,-P);break;case 7:x.rotate(.5*Math.PI),x.translate(p,-P),x.scale(-1,1);break;case 8:x.rotate(-.5*Math.PI),x.translate(-p,0)}}}})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},200:(R,B,$)=>{var N,E,ee;(function(he){E=[$(302)],(ee=typeof(N=function(G){var V=G.transform;G.createCanvas=function(j,y,z){if(z&&G.global.OffscreenCanvas)return new OffscreenCanvas(j,y);var U=document.createElement("canvas");return U.width=j,U.height=y,U},G.transform=function(j,y,z,U,D){V.call(G,G.scale(j,y,D),y,z,U,D)},G.transformCoordinates=function(){},G.getTransformedOptions=function(j,y){var z,U,D,g,T=y.aspectRatio;if(!T)return y;for(U in z={},y)Object.prototype.hasOwnProperty.call(y,U)&&(z[U]=y[U]);return z.crop=!0,(D=j.naturalWidth||j.width)/(g=j.naturalHeight||j.height)>T?(z.maxWidth=g*T,z.maxHeight=g):(z.maxWidth=D,z.maxHeight=D/T),z},G.drawImage=function(j,y,z,U,D,g,T,m,S){var O=y.getContext("2d");return S.imageSmoothingEnabled===!1?(O.msImageSmoothingEnabled=!1,O.imageSmoothingEnabled=!1):S.imageSmoothingQuality&&(O.imageSmoothingQuality=S.imageSmoothingQuality),O.drawImage(j,z,U,D,g,0,0,T,m),O},G.requiresCanvas=function(j){return j.canvas||j.crop||!!j.aspectRatio},G.scale=function(j,y,z){y=y||{},z=z||{};var U,D,g,T,m,S,O,k,v,x,p,P,_=j.getContext||G.requiresCanvas(y)&&!!G.global.HTMLCanvasElement,I=j.naturalWidth||j.width,M=j.naturalHeight||j.height,F=I,Y=M;function ie(){var se=Math.max((g||F)/F,(T||Y)/Y);se>1&&(F*=se,Y*=se)}function ne(){var se=Math.min((U||F)/F,(D||Y)/Y);se<1&&(F*=se,Y*=se)}if(_&&(O=(y=G.getTransformedOptions(j,y,z)).left||0,k=y.top||0,y.sourceWidth?(m=y.sourceWidth,y.right!==void 0&&y.left===void 0&&(O=I-m-y.right)):m=I-O-(y.right||0),y.sourceHeight?(S=y.sourceHeight,y.bottom!==void 0&&y.top===void 0&&(k=M-S-y.bottom)):S=M-k-(y.bottom||0),F=m,Y=S),U=y.maxWidth,D=y.maxHeight,g
29=y.minWidth,T=y.minHeight,_&&U&&D&&y.crop?(F=U,Y=D,(p=m/S-U/D)<0?(S=D*m/U,y.top===void 0&&y.bottom===void 0&&(k=(M-S)/2)):p>0&&(m=U*S/D,y.left===void 0&&y.right===void 0&&(O=(I-m)/2))):((y.contain||y.cover)&&(g=U=U||g,T=D=D||T),y.cover?(ne(),ie()):(ie(),ne())),_){if((v=y.pixelRatio)>1&&(!j.style.width||Math.floor(parseFloat(j.style.width,10))!==Math.floor(I/v))&&(F*=v,Y*=v),G.orientationCropBug&&!j.getContext&&(O||k||m!==I||S!==M)&&(p=j,j=G.createCanvas(I,M,!0),G.drawImage(p,j,0,0,I,M,I,M,y)),(x=y.downsamplingRatio)>0&&x<1&&F<m&&Y<S)for(;m*x>F;)P=G.createCanvas(m*x,S*x,!0),G.drawImage(j,P,O,k,m,S,P.width,P.height,y),O=0,k=0,m=P.width,S=P.height,j=P;return P=G.createCanvas(F,Y),G.transformCoordinates(P,y,z),v>1&&(P.style.width=P.width/v+"px"),G.drawImage(j,P,O,k,m,S,F,Y,y).setTransform(1,0,0,1,0,0),P}return j.width=F,j.height=Y,j}})=="function"?N.apply(B,E):N)===void 0||(R.exports=ee)})()},302:function(R,B,$){var N;(function(E){var ee=E.URL||E.webkitURL;function he(U){return!!ee&&ee.createObjectURL(U)}function G(U){return!!ee&&ee.revokeObjectURL(U)}function V(U,D){!U||U.slice(0,5)!=="blob:"||D&&D.noRevoke||G(U)}function j(U,D,g,T){if(!E.FileReader)return!1;var m=new FileReader;m.onload=function(){D.call(m,this.result)},g&&(m.onabort=m.onerror=function(){g.call(m,this.error)});var S=m[T||"readAsDataURL"];return S?(S.call(m,U),m):void 0}function y(U,D){return Object.prototype.toString.call(D)==="[object "+U+"]"}function z(U,D,g){function T(m,S){var O,k=document.createElement("img");function v(p,P){m!==S?p instanceof Error?S(p):((P=P||{}).image=p,m(P)):m&&m(p,P)}function x(p,P){P&&E.console&&console.log(P),p&&y("Blob",p)?O=he(U=p):(O=U,g&&g.crossOrigin&&(k.crossOrigin=g.crossOrigin)),k.src=O}return k.onerror=function(p){V(O,g),S&&S.call(k,p)},k.onload=function(){V(O,g);var p={originalWidth:k.naturalWidth||k.width,originalHeight:k.naturalHeight||k.height};try{z.transform(k,g,v,U,p)}catch(P){S&&S(P)}},typeof U=="string"?(z.requiresMetaData(g)?z.fetchBlob(U,x,g):x(),k):y("Blob",U)||y("File",U)?(O=he(U))?(k.src=O,k):j(U,function(p){k.src=p},S):void 0}return E.Promise&&typeof D!="function"?(g=D,new Promise(T)):T(D,D)}z.requiresMetaData=function(U){return U&&U.meta},z.fetchBlob=function(U,D){D()},z.transform=function(U,D,g,T,m){g(U,m)},z.global=E,z.readFile=j,z.isInstanceOf=y,z.createObjectURL=he,z.revokeObjectURL=G,(N=(function(){return z}).call(B,$,B,R))===void 0||(R.exports=N)})(typeof window<"u"&&window||this)},918:function(R,B){var $;(function(){var N=function(v){return v instanceof N?v:this instanceof N?void(this.EXIFwrapped=v):new N(v)};R.exports&&(B=R.exports=N),B.EXIF=N;var E=N.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"E
29xposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},ee=N.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},he=N.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},G=N.IFD1Tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",296:"ResolutionUnit",513:"JpegIFOffset",514:"JpegIFByteCount",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite"},V=N.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}};function j(v){return!!v.exifdata}function y(v,x){function p(I){var M=z(I);v.exifdata=M||{};var F=function(ie){var ne=new DataView(ie);if(ne.getUint8(0)!=255||ne.getUint8(1)!=216)return!1;for(var se=2,Z=ie.byteLength,ge=function(ye,be){return ye.getUint8(be)===56&&ye.getUint8(be+1)===66&&ye.getUint8(be+2)===73&&ye.getUint8(be+3)===
2977&&ye.getUint8(be+4)===4&&ye.getUint8(be+5)===4};se<Z;){if(ge(ne,se)){var pe=ne.getUint8(se+7);return pe%2!=0&&(pe+=1),pe===0&&(pe=4),D(ie,se+8+pe,ne.getUint16(se+6+pe))}se++}}(I);if(v.iptcdata=F||{},N.isXmpEnabled){var Y=function(ie){if("DOMParser"in self){var ne=new DataView(ie);if(ne.getUint8(0)!=255||ne.getUint8(1)!=216)return!1;for(var se=2,Z=ie.byteLength,ge=new DOMParser;se<Z-4;){if(m(ne,se,4)=="http"){var pe=se-1,ye=ne.getUint16(se-2)-1,be=m(ne,pe,ye),Re=be.indexOf("xmpmeta>")+8,Fe=(be=be.substring(be.indexOf("<x:xmpmeta"),Re)).indexOf("x:xmpmeta")+10;return be=be.slice(0,Fe)+'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" '+be.slice(Fe),k(ge.parseFromString(be,"text/xml"))}se++}}}(I);v.xmpdata=Y||{}}x&&x.call(v)}if(v.src)if(/^data\:/i.test(v.src))p(function(I,M){M=M||I.match(/^data\:([^\;]+)\;base64,/im)[1]||"",I=I.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var F=atob(I),Y=F.length,ie=new ArrayBuffer(Y),ne=new Uint8Array(ie),se=0;se<Y;se++)ne[se]=F.charCodeAt(se);return ie}(v.src));else if(/^blob\:/i.test(v.src))(_=new FileReader).onload=function(I){p(I.target.result)},function(I,M){var F=new XMLHttpRequest;F.open("GET",I,!0),F.responseType="blob",F.onload=function(Y){var ie;this.status!=200&&this.status!==0||(ie=this.response,_.readAsArrayBuffer(ie))},F.send()}(v.src);else{var P=new XMLHttpRequest;P.onload=function(){if(this.status!=200&&this.status!==0)throw"Could not load image";p(P.response),P=null},P.open("GET",v.src,!0),P.responseType="arraybuffer",P.send(null)}else if(self.FileReader&&(v instanceof self.Blob||v instanceof self.File)){var _;(_=new FileReader).onload=function(I){p(I.target.result)},_.readAsArrayBuffer(v)}}function z(v){var x=new DataView(v);if(x.getUint8(0)!=255||x.getUint8(1)!=216)return!1;for(var p=2,P=v.byteLength;p<P;){if(x.getUint8(p)!=255)return!1;if(x.getUint8(p+1)==225)return S(x,p+4,x.getUint16(p+2));p+=2+x.getUint16(p+2)}}var U={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};function D(v,x,p){for(var P,_,I,M,F=new DataView(v),Y={},ie=x;ie<x+p;)F.getUint8(ie)===28&&F.getUint8(ie+1)===2&&(M=F.getUint8(ie+2))in U&&(I=F.getInt16(ie+3),_=U[M],P=m(F,ie+5,I),Y.hasOwnProperty(_)?Y[_]instanceof Array?Y[_].push(P):Y[_]=[Y[_],P]:Y[_]=P),ie++;return Y}function g(v,x,p,P,_){var I,M,F=v.getUint16(p,!_),Y={};for(M=0;M<F;M++)I=p+12*M+2,Y[P[v.getUint16(I,!_)]]=T(v,I,x,0,_);return Y}function T(v,x,p,P,_){var I,M,F,Y,ie,ne,se=v.getUint16(x+2,!_),Z=v.getUint32(x+4,!_),ge=v.getUint32(x+8,!_)+p;switch(se){case 1:case 7:if(Z==1)return v.getUint8(x+8,!_);for(I=Z>4?ge:x+8,M=[],Y=0;Y<Z;Y++)M[Y]=v.getUint8(I+Y);return M;case 2:return m(v,I=Z>4?ge:x+8,Z-1);case 3:if(Z==1)return v.getUint16(x+8,!_);for(I=Z>2?ge:x+8,M=[],Y=0;Y<Z;Y++)M[Y]=v.getUint16(I+2*Y,!_);return M;case 4:if(Z==1)return v.getUint32(x+8,!_);for(M=[],Y=0;Y<Z;Y++)M[Y]=v.getUint32(ge+4*Y,!_);return M;case 5:if(Z==1)return ie=v.getUint32(ge,!_),ne=v.getUint32(ge+4,!_),(F=new Number(ie/ne)).numerator=ie,F.denominator=ne,F;for(M=[],Y=0;Y<Z;Y++)ie=v.getUint32(ge+8*Y,!_),ne=v.getUint32(ge+4+8*Y,!_),M[Y]=new Number(ie/ne),M[Y].numerator=ie,M[Y].denominator=ne;return M;case 9:if(Z==1)return v.getInt32(x+8,!_);for(M=[],Y=0;Y<Z;Y++)M[Y]=v.getInt32(ge+4*Y,!_);return M;case 10:if(Z==1)return v.getInt32(ge,!_)/v.getInt32(ge+4,!_);for(M=[],Y=0;Y<Z;Y++)M[Y]=v.getInt32(ge+8*Y,!_)/v.getInt32(ge+4+8*Y,!_);return M}}function m(v,x,p){var P="";for(n=x;n<x+p;n++)P+=String.fromCharCode(v.getUint8(n));return P}function S(v,x){if(m(v,x,4)!="Exif")return!1;var p,P,_,I,M,F=x+6;if(v.getUint16(F)==18761)p=!1;else{if(v.getUint16(F)!=19789)return!1;p=!0}
29if(v.getUint16(F+2,!p)!=42)return!1;var Y=v.getUint32(F+4,!p);if(Y<8)return!1;if((P=g(v,F,F+Y,ee,p)).ExifIFDPointer)for(_ in I=g(v,F,F+P.ExifIFDPointer,E,p)){switch(_){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":I[_]=V[_][I[_]];break;case"ExifVersion":case"FlashpixVersion":I[_]=String.fromCharCode(I[_][0],I[_][1],I[_][2],I[_][3]);break;case"ComponentsConfiguration":I[_]=V.Components[I[_][0]]+V.Components[I[_][1]]+V.Components[I[_][2]]+V.Components[I[_][3]]}P[_]=I[_]}if(P.GPSInfoIFDPointer)for(_ in M=g(v,F,F+P.GPSInfoIFDPointer,he,p)){switch(_){case"GPSVersionID":M[_]=M[_][0]+"."+M[_][1]+"."+M[_][2]+"."+M[_][3]}P[_]=M[_]}return P.thumbnail=function(ie,ne,se,Z){var ge=function(Re,Fe,et){var ft=Re.getUint16(Fe,!et);return Re.getUint32(Fe+2+12*ft,!et)}(ie,ne+se,Z);if(!ge)return{};if(ge>ie.byteLength)return{};var pe=g(ie,ne,ne+ge,G,Z);if(pe.Compression)switch(pe.Compression){case 6:if(pe.JpegIFOffset&&pe.JpegIFByteCount){var ye=ne+pe.JpegIFOffset,be=pe.JpegIFByteCount;pe.blob=new Blob([new Uint8Array(ie.buffer,ye,be)],{type:"image/jpeg"})}break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",pe.Compression)}else pe.PhotometricInterpretation==2&&console.log("Thumbnail image format is RGB, which is not implemented.");return pe}(v,F,Y,p),P}function O(v){var x={};if(v.nodeType==1){if(v.attributes.length>0){x["@attributes"]={};for(var p=0;p<v.attributes.length;p++){var P=v.attributes.item(p);x["@attributes"][P.nodeName]=P.nodeValue}}}else if(v.nodeType==3)return v.nodeValue;if(v.hasChildNodes())for(var _=0;_<v.childNodes.length;_++){var I=v.childNodes.item(_),M=I.nodeName;if(x[M]==null)x[M]=O(I);else{if(x[M].push==null){var F=x[M];x[M]=[],x[M].push(F)}x[M].push(O(I))}}return x}function k(v){try{var x={};if(v.children.length>0)for(var p=0;p<v.children.length;p++){var P=v.children.item(p),_=P.attributes;for(var I in _){var M=_[I],F=M.nodeName,Y=M.nodeValue;F!==void 0&&(x[F]=Y)}var ie=P.nodeName;if(x[ie]===void 0)x[ie]=O(P);else{if(x[ie].push===void 0){var ne=x[ie];x[ie]=[],x[ie].push(ne)}x[ie].push(O(P))}}else x=v.textContent;return x}catch(se){console.log(se.message)}}N.enableXmp=function(){N.isXmpEnabled=!0},N.disableXmp=function(){N.isXmpEnabled=!1},N.getData=function(v,x){return!((self.Image&&v instanceof self.Image||self.HTMLImageElement&&v instanceof self.HTMLImageElement)&&!v.complete||(j(v)?x&&x.call(v):y(v,x),0))},N.getTag=function(v,x){if(j(v))return v.exifdata[x]},N.getIptcTag=function(v,x){if(j(v))return v.iptcdata[x]},N.getAllTags=function(v){if(!j(v))return{};var x,p=v.exifdata,P={};for(x in p)p.hasOwnProperty(x)&&(P[x]=p[x]);return P},N.getAllIptcTags=function(v){if(!j(v))return{};var x,p=v.iptcdata,P={};for(x in p)p.hasOwnProperty(x)&&(P[x]=p[x]);return P},N.pretty=function(v){if(!j(v))return"";var x,p=v.exifdata,P="";for(x in p)p.hasOwnProperty(x)&&(typeof p[x]=="object"?p[x]instanceof Number?P+=x+" : "+p[x]+" ["+p[x].numerator+"/"+p[x].denominator+`]\r
30`:P+=x+" : ["+p[x].length+` values]\r
31`:P+=x+" : "+p[x]+`\r
32`);return P},N.readFromBinaryFile=function(v){return z(v)},($=(function(){return N}).apply(B,[]))===void 0||(R.exports=$)}).call(this)},297:R=>{R.exports=A}},q={};function Q(R){if(q[R])return q[R].exports;var B=q[R]={exports:{}};return J[R].call(B.exports,B,B.exports,Q),B.exports}Q.n=R=>{var B=R&&R.__esModule?()=>R.default:()=>R;return Q.d(B,{a:B}),B},Q.d=(R,B)=>{for(var $ in B)Q.o(B,$)&&!Q.o(R,$)&&Object.defineProperty(R,$,{enumerable:!0,get:B[$]})},Q.o=(R,B)=>Object.prototype.hasOwnProperty.call(R,B),Q.r=R=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})};var ae={};return(()=>{Q.r(ae),Q.d(ae,{default:()=>kr});var R=Q(297),B=Q.n(R),$=Math.PI/180;const N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},E={_global:N,version:"8.3.5",isBrowser:typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]"),isUnminified:/param/.test((function(a){}).toString()),dblClickWindow:400,getAngle:a=>E.angleDeg?a*$:a,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>E.DD.isDragging,isDragReady:()=>!!E.DD.node,document:N.document,_injectGlobal(a){N.Konva=a}},ee=a=>{E[a.prototype.getClassName()]=a};E._injectGlobal(E);class he{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new he(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),i=Math.sin(e),r=this.m[0]*t+this.m[2]*i,l=this.m[1]*t+this.m[3]*i,o=this.m[0]*-i+this.m[2]*t,h=this.m[1]*-i+this.m[3]*t;return this.m[0]=r,this.m[1]=l,this.m[2]=o,this.m[3]=h,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var i=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,l=this.m[2]+this.m[0]*e,o=this.m[3]+this.m[1]*e;return this.m[0]=i,this.m[1]=r,this.m[2]=l,this.m[3]=o,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],i=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],l=this.m[1]*e.m[2]+this.m[3]*e.m[3],o=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],h=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=i,this.m[2]=r,this.m[3]=l,this.m[4]=o,this.m[5]=h,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,i=-this.m[1]*e,r=-this.m[2]*e,l=this.m[0]*e,o=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),h=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=i,this.m[2]=r,this.m[3]=l,this.m[4]=o,this.m[5]=h,this}getMatrix(){return this.m}setAbsolutePosition(e,t){var i=this.m[0],r=this.m[1],l=this.m[2],o=this.m[3],h=this.m[4],d=(i*(t-this.m[5])-r*(e-h))/(i*o-r*l),u=(e-h-l*d)/i;return this.translate(u,d)}decompose(){var e=this.m[0],t=this.m[1],i=this.m[2],r=this.m[3],l=e*r-t*i;let o={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||t!=0){var h=Math.sqrt(e*e+t*t);o.rotation=t>0?Math.acos(e/h):-Math.acos(e/h),o.scaleX=h,o.scaleY=l/h,o.skewX=(e*i+t*r)/l,o.skewY=0}else if(i!=0||r!=0){var d=Math.sqrt(i*i+r*r);o.rotation=Math.PI/2-(r>0?Math.acos(-i/d):-Math.acos(i/d)),o.scaleX=l/d,o.scaleY=d,o.skewX=0,o.skewY=(e*i+t*r)/l}return o.rotation=g._getRotation(o.rotation),o}}var G=Math.PI/180,V=180/Math.PI,j="Konva error: ",y={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],ol
32ive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},z=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,U=[];const D=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(a){setTimeout(a,60)},g={_isElement:a=>!(!a||a.nodeType!=1),_isFunction:a=>!!(a&&a.constructor&&a.call&&a.apply),_isPlainObject:a=>!!a&&a.constructor===Object,_isArray:a=>Object.prototype.toString.call(a)==="[object Array]",_isNumber:a=>Object.prototype.toString.call(a)==="[object Number]"&&!isNaN(a)&&isFinite(a),_isString:a=>Object.prototype.toString.call(a)==="[object String]",_isBoolean:a=>Object.prototype.toString.call(a)==="[object Boolean]",isObject:a=>a instanceof Object,isValidSelector(a){if(typeof a!="string")return!1;var e=a[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign:a=>a===0||a>0?1:-1,requestAnimFrame(a){U.push(a),U.length===1&&D(function(){const e=U;U=[],e.forEach(function(t){t()})})},createCanvasElement(){var a=document.createElement("canvas");try{a.style=a.style||{}}catch{}return a},createImageElement:()=>document.createElement("img"),_isInDocument(a){for(;a=a.parentNode;)if(a==document)return!0;return!1},_urlToImage(a,e){var t=g.createImageElement();t.onload=function(){e(t)},t.src=a},_rgbToHex:(a,e,t)=>((1<<24)+(a<<16)+(e<<8)+t).toString(16).slice(1),_hexToRgb(a){a=a.replace("#","");var e=parseInt(a,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},getRandomColor(){for(var a=(16777215*Math.random()<<0).toString(16);a.length<6;)a="0"+a;return"#"+a},getRGB(a){var e;return a in y?{r:(e=y[a])[0],g:e[1],b:e[2]}:a[0]==="#"?this._hexToRgb(a.substring(1)):a.substr(0,4)==="rgb("?(e=z.exec(a.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA:a=>(a=a||"black",g._namedColorToRBA(a)||g._hex3ColorToRGBA(a)||g._hex6ColorToRGBA(a)||g._rgbColorToRGBA(a)||g._rgbaColorToRGBA(a)||g._hslColorToRGBA(a)),_namedColorToRBA(a){var e=y[a.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(a){if(a.indexOf("rgb(")===0){var e=(a=a.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(a){if(a.indexOf("rgba(")===0){var e=(a=a.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map((t,i)=>t.slice(-1)==="%"?i===3?parseInt(t)/100:parseInt(t)/100*255:Number(t));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex6ColorToRGBA(a){if(a[0]==="#"&&a.length===7)return{r:parseInt(a.slice(1,3),16),g:parseInt(a.slice(3,5),16),b:parseInt(a.slice(5,7),16),a:1}},_hex3ColorToRGBA(a){if(a[0]==="#"&&a.length===4)return{r:parseInt(a[1]+a[1],16),g:parseInt(a[2]+a[2],16),b:parseInt(a[3]+a[3],16),a:1}},_hslColorToRGBA(a){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(a)){const[e,...t]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a),i=Number(t[0])/360,r=Number(t[1])/100,l=Number(t[2])/100;let o,h,d;if(r===0)return d=255*l,{r:Math.round(d),g:Math.round(d),b:Math.round(d),a:1};o=l<.5?l*(1+r):l+r-l*r;const u=2*l-o,f=[0,0,0];for(let b=0;b<3;b++)h=i+1/3*-(b-1),h<0&&h++,h>1&&h--,d=6*h<1?u+6*(o-u)*h:2*h<1?o:3*h<2?u+(o-u)*(2/3-h)*6:u,f[b]=255*d;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[2]),a:1}}},haveIntersection:(a,e)=>!(e.x>a.x+a.width||e.x+e.width<a.x||e.y>a.y+a.height||e.y+e.height<a.y),cloneObject(a){var e={};for(var t in a)this._isPlainObject(a[t])?e[t]=this.cloneObject(a[t]):this._isArray(a[t])?e[t]=this.cloneArray(a[t]):e[t]=a[t];return e},cloneArray:a=>a.slice(0),degToRad:a=>a*G,radToDeg:a=>a*V,_degToRad:a=>(g.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),g.degToRad(a)),_radToDeg:a=>(g.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),g.radToDeg(a)),_getRotation:a=>E.angleDeg?g.radToDeg(a):a,_capitalize:a=>a.charAt(0).toUpperCase()+a.slice(1),throw(a){throw new Error(j+a)},error(a){console.error(j+a)},warn(a){E.showWarnings&&console.warn("Konva warning: "+a)},each(a,e){for(var t in a)e(t,a[t])},_inRange:(a,e,t)=>e<=a&&a<t,_getProjectionToSegment(a,e,t,i,r,l){var o,h,d,u=(a-t)*(a-t)+(e-i)
32*(e-i);if(u==0)o=a,h=e,d=(r-t)*(r-t)+(l-i)*(l-i);else{var f=((r-a)*(t-a)+(l-e)*(i-e))/u;f<0?(o=a,h=e,d=(a-r)*(a-r)+(e-l)*(e-l)):f>1?(o=t,h=i,d=(t-r)*(t-r)+(i-l)*(i-l)):d=((o=a+f*(t-a))-r)*(o-r)+((h=e+f*(i-e))-l)*(h-l)}return[o,h,d]},_getProjectionToLine(a,e,t){var i=g.cloneObject(a),r=Number.MAX_VALUE;return e.forEach(function(l,o){if(t||o!==e.length-1){var h=e[(o+1)%e.length],d=g._getProjectionToSegment(l.x,l.y,h.x,h.y,a.x,a.y),u=d[0],f=d[1],b=d[2];b<r&&(i.x=u,i.y=f,r=b)}}),i},_prepareArrayForTween(a,e,t){var i,r=[],l=[];if(a.length>e.length){var o=e;e=a,a=o}for(i=0;i<a.length;i+=2)r.push({x:a[i],y:a[i+1]});for(i=0;i<e.length;i+=2)l.push({x:e[i],y:e[i+1]});var h=[];return l.forEach(function(d){var u=g._getProjectionToLine(d,r,t);h.push(u.x),h.push(u.y)}),h},_prepareToStringify(a){var e;for(var t in a.visitedByCircularReferenceRemoval=!0,a)if(a.hasOwnProperty(t)&&a[t]&&typeof a[t]=="object"){if(e=Object.getOwnPropertyDescriptor(a,t),a[t].visitedByCircularReferenceRemoval||g._isElement(a[t])){if(!e.configurable)return null;delete a[t]}else if(g._prepareToStringify(a[t])===null){if(!e.configurable)return null;delete a[t]}}return delete a.visitedByCircularReferenceRemoval,a},_assign(a,e){for(var t in e)a[t]=e[t];return a},_getFirstPointerId:a=>a.touches?a.changedTouches[0].identifier:a.pointerId||999};function T(a){return g._isString(a)?'"'+a+'"':Object.prototype.toString.call(a)==="[object Number]"||g._isBoolean(a)?a:Object.prototype.toString.call(a)}function m(){if(E.isUnminified)return function(a,e){return g._isNumber(a)||g.warn(T(a)+' is a not val
32id value for "'+e+'" attribute. The value should be a number.'),a}}function S(){if(E.isUnminified)return function(a,e){return g._isString(a)||g.warn(T(a)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),a}}function O(){if(E.isUnminified)return function(a,e){const t=g._isString(a),i=Object.prototype.toString.call(a)==="[object CanvasGradient]"||a&&a.addColorStop;return t||i||g.warn(T(a)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),a}}function k(){if(E.isUnminified)return function(a,e){return a===!0||a===!1||g.warn(T(a)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),a}}var v="get",x="set";const p={addGetterSetter(a,e,t,i,r){p.addGetter(a,e,t),p.addSetter(a,e,i,r),p.addOverloadedGetterSetter(a,e)},addGetter(a,e,t){var i=v+g._capitalize(e);a.prototype[i]=a.prototype[i]||function(){var r=this.attrs[e];return r===void 0?t:r}},addSetter(a,e,t,i){var r=x+g._capitalize(e);a.prototype[r]||p.overWriteSetter(a,e,t,i)},overWriteSetter(a,e,t,i){var r=x+g._capitalize(e);a.prototype[r]=function(l){return t&&l!=null&&(l=t.call(this,l,e)),this._setAttr(e,l),i&&i.call(this),this}},addComponentsGetterSetter(a,e,t,i,r){var l,o,h=t.length,d=g._capitalize,u=v+d(e),f=x+d(e);a.prototype[u]=function(){var L={};for(l=0;l<h;l++)L[o=t[l]]=this.getAttr(e+d(o));return L};var b=function(L){if(E.isUnminified)return function(H,C){return g.isObject(H)||g.warn(T(H)+' is a not val
32id value for "'+C+'" attribute. The value should be an object with properties '+L),H}}(t);a.prototype[f]=function(L){var H,C=this.attrs[e];for(H in i&&(L=i.call(this,L)),b&&b.call(this,L,e),L)L.hasOwnProperty(H)&&this._setAttr(e+d(H),L[H]);return this._fireChangeEvent(e,C,L),r&&r.call(this),this},p.addOverloadedGetterSetter(a,e)},addOverloadedGetterSetter(a,e){var t=g._capitalize(e),i=x+t,r=v+t;a.prototype[e]=function(){return arguments.length?(this[i](arguments[0]),this):this[r]()}},addDeprecatedGetterSetter(a,e,t,i){g.error("Adding deprecated "+e);var r=v+g._capitalize(e),l=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[r]=function(){g.error(l);var o=this.attrs[e];return o===void 0?t:o},p.addSetter(a,e,i,function(){g.error(l)}),p.addOverloadedGetterSetter(a,e)},backCompat(a,e){g.each(e,function(t,i){var r=a.prototype[i],l=v+g._capitalize(t),o=x+g._capitalize(t);function h(){r.apply(this,arguments),g.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+i+'" instead.')}a.prototype[t]=h,a.prototype[l]=h,a.prototype[o]=h})},afterSetFilter(){this._filterUpToDate=!1}};function P(a){var e,t,i=[],r=a.length,l=g;for(e=0;e<r;e++)t=a[e],l._isNumber(t)?t=Math.round(1e3*t)/1e3:l._isString(t)||(t+=""),i.push(t);return i}var _,I=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"];class M{constructor(e){this.canvas=e,this._context=e._canvas.getContext("2d"),E.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,t){var i,r,l,o,h=this.traceArr,d=h.length,u="";for(i=0;i<d;i++)(l=(r=h[i]).method)?(o=r.args,u+=l,e?u+="()":g._isArray(o[0])?u+="(["+o.join(",")+"])":(t&&(o=o.map(f=>typeof f=="number"?Math.floor(f):f)),u+="("+o.join(",")+")")):(u+=r.property,e||(u+="="+r.val)),u+=";";return u}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),t.length>=100&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();t!==1&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,i,r,l,o){this._context.arc(e,t,i,r,l,o)}arcTo(e,t,i,r,l){this._context.arcTo(e,t,i,r,l)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,i,r,l,o){this._context.bezierCurveTo(e,t,i,r,l,o)}clearRect(e,t,i,r){this._context.clearRect(e,t,i,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var i=arguments;return i.length===2?this._context.createImageData(e,t):i.length===1?this._context.createImageData(e):void 0}createLinearGradient(e,t,i,r){return this._context.createLinearGradient(e,t,i,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,i,r,l,o){return this._context.createRadialGradient(e,t,i,r,l,o)}drawImage(e,t,i,r,l,o,h,d,u){var f=arguments,b=this._context;f.length===3?b.drawImage(e,t,i):f.length===5?b.drawImage(e,t,i,r,l):f.length===9&&b.drawImage(e,t,i,r,l,o,h,d,u)}ellipse(e,t,i,r,l,o,h,d){this._context.ellipse(e,t,i,r,l,o,h,d)}isPointInPath(e,t){return this._context.isPointInPath(e,t)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,i,r){this._context.fillRect(e,t,i,r)}strokeRect(e,t,i,r){this._context.strokeRect(e,t,i,r)}fillText(e,t,i,r){r?this._context.fillText(e,t,i,r):this._context.fillText(e,t,i)}measureText(e){return this._context.measureText(e)}getImageData(e,t,i,r){return this._context.getImageData(e,t,i,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,i,r){this._context.rect(e,t,i,r)}putImageData(e,t,i){this._context.putImageData(e,t,i)}quadraticCurveTo(e,t,i,r){this._context.quadraticCurveTo(e,t,i,r)}
32restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,i,r,l,o){this._context.setTransform(e,t,i,r,l,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,i,r){this._context.strokeText(e,t,i,r)}transform(e,t,i,r,l,o){this._context.transform(e,t,i,r,l,o)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e,t,i=this,r=I.length,l=this.setAttr,o=function(h){var d,u=i[h];i[h]=function(){return t=P(Array.prototype.slice.call(arguments,0)),d=u.apply(i,arguments),i._trace({method:h,args:t}),d}};for(e=0;e<r;e++)o(I[e]);i.setAttr=function(){l.apply(i,arguments);var h=arguments[0],d=arguments[1];h!=="shadowOffsetX"&&h!=="shadowOffsetY"&&h!=="shadowBlur"||(d/=this.canvas.getPixelRatio()),i._trace({property:h,val:d})}}_applyGlobalCompositeOperation(e){const t=e.attrs.globalCompositeOperation;!t||t==="source-over"||this.setAttr("globalCompositeOperation",t)}}["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"].forEach(function(a){Object.defineProperty(M.prototype,a,{get(){return this._context[a]},set(e){this._context[a]=e}})});class F extends M{_fillColor(e){var t=e.fill();this.setAttr("fillStyle",t),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){var t=e._getLinearGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}_fillRadialGradient(e){var t=e._getRadialGradient();t&&(this.setAttr("fillStyle",t),e._fillFunc(this))}_fill(e){var t=e.fill(),i=e.getFillPriority();if(t&&i==="color")this._fillColor(e);else{var r=e.getFillPatternImage();if(r&&i==="pattern")this._fillPattern(e);else{var l=e.getFillLinearGradientColorStops();if(l&&i==="linear-gradient")this._fillLinearGradient(e);else{var o=e.getFillRadialGradientColorStops();o&&i==="radial-gradient"?this._fillRadialGradient(e):t?this._fillColor(e):r?this._fillPattern(e):l?this._fillLinearGradient(e):o&&this._fillRadialGradient(e)}}}}_strokeLinearGradient(e){var t=e.getStrokeLinearGradientStartPoint(),i=e.getStrokeLinearGradientEndPoint(),r=e.getStrokeLinearGradientColorStops(),l=this.createLinearGradient(t.x,t.y,i.x,i.y);if(r){for(var o=0;o<r.length;o+=2)l.addColorStop(r[o],r[o+1]);this.setAttr("strokeStyle",l)}}_stroke(e){var t=e.dash(),i=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!i){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(e),t&&e.dashEnabled()&&(this.setLineDash(t),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),i||this.restore()}}_applyShadow(e){var t,i,r,l=(t=e.getShadowRGBA())!==null&&t!==void 0?t:"black",o=(i=e.getShadowBlur())!==null&&i!==void 0?i:5,h=(r=e.getShadowOffset())!==null&&r!==void 0?r:{x:0,y:0},d=e.getAbsoluteScale(),u=this.canvas.getPixelRatio(),f=d.x*u,b=d.y*u;this.setAttr("shadowColor",l),this.setAttr("shadowBlur",o*Math.min(Math.abs(f),Math.abs(b))),this.setAttr("shadowOffsetX",h.x*f),this.setAttr("shadowOffsetY",h.y*b)}}class Y extends M{_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){var t=e.getStrokeScaleEnabled();if(!t){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(e);var r=e.hitStrokeWidth(),l=r==="auto"?e.strokeWidth():r;this.setAttr("lineWidth",l),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),t||this.restore(
32)}}}class ie{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var t=(e||{}).pixelRatio||E.pixelRatio||function(){if(_)return _;var i=g.createCanvasElement().getContext("2d");return _=(E._global.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)}();this.pixelRatio=t,this._canvas=g.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){var t=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/t,this.getHeight()/t)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";var t=this.pixelRatio;this.getContext()._context.scale(t,t)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";var t=this.pixelRatio;this.getContext()._context.scale(t,t)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,t){this.setWidth(e||0),this.setHeight(t||0)}toDataURL(e,t){try{return this._canvas.toDataURL(e,t)}catch{try{return this._canvas.toDataURL()}catch(r){return g.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}p.addGetterSetter(ie,"pixelRatio",void 0,m());class ne extends ie{constructor(e={width:0,height:0}){super(e),this.context=new F(this),this.setSize(e.width,e.height)}}class se extends ie{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new Y(this),this.setSize(e.width,e.height)}}const Z={get isDragging(){var a=!1;return Z._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(a=!0)}),a},justDragged:!1,get node(){var a;return Z._dragElements.forEach(e=>{a=e.node}),a},_dragElements:new Map,_drag(a){const e=[];Z._dragElements.forEach((t,i)=>{const{node:r}=t,l=r.getStage();l.setPointersPositions(a),t.pointerId===void 0&&(t.pointerId=g._getFirstPointerId(a));const o=l._changedPointerPositions.find(d=>d.id===t.pointerId);if(o){if(t.dragStatus!=="dragging"){var h=r.dragDistance();if(Math.max(Math.abs(o.x-t.startPointerPos.x),Math.abs(o.y-t.startPointerPos.y))<h||(r.startDrag({evt:a}),!r.isDragging()))return}r._setDragPosition(a,t),e.push(r)}}),e.forEach(t=>{t.fire("dragmove",{type:"dragmove",target:t,evt:a},!0)})},_endDragBefore(a){Z._dragElements.forEach(e=>{const{node:t}=e,i=t.getStage();if(a&&i.setPointersPositions(a),!i._changedPointerPositions.find(l=>l.id===e.pointerId))return;e.dragStatus!=="dragging"&&e.dragStatus!=="stopped"||(Z.justDragged=!0,E._mouseListenClick=!1,E._touchListenClick=!1,E._pointerListenClick=!1,e.dragStatus="stopped");const r=e.node.getLayer()||e.node instanceof E.Stage&&e.node;r&&r.batchDraw()})},_endDragAfter(a){Z._dragElements.forEach((e,t)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:a},!0),e.dragStatus!=="dragging"&&Z._dragElements.delete(t)})}};E.isBrowser&&(window.addEventListener("mouseup",Z._endDragBefore,!0),window.addEventListener("touchend",Z._endDragBefore,!0),window.addEventListener("mousemove",Z._drag),window.addEventListener("touchmove",Z._drag),window.addEventListener("mouseup",Z._endDragAfter,!1),window.addEventListener("touchend",Z._endDragAfter,!1));var ge="absoluteOpacity",pe="allEventListeners",ye="absoluteTransform",be="absoluteScale",Re="canvas",Fe="listening",et="mouseenter",ft="mouseleave",di="Shape",mt=" ",ui="stage",ze="transform",Lt="visible",pr=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(mt);let fr=1;class te{constructor(e){this._id=fr++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==ze&&e!==ye||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var i=this._cache.get(e);return(i===void 0||(e===ze||e===ye)&&i.dirty===!0)&&(i=t.call(this),this._cache.set(e,i)),i}_calculate(e,t,i){if(!this._attachedDepsListeners.get(e)){const r=t.map(l=>l+"Change.konva").join(mt);this.on(r,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,i)}_getCanvasCache(){return this._cache.get(Re)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ye&&this.fire("absoluteTransformChange")}clearCache(){return this._cache.delete(Re),this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t=e||{},i={};t.x!==void 0&&t.y!==void 0&&t.width!==void 0&&t.height!==void 0||(i=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(t.width||i.width),l=Math.ceil(t.height||i.height),o=t.pixelRatio,h=t.x===void 0?Math.floor(i.x):t.x,d=t.y===void 0?Math.floor(i.y):t.y,u=t.offset||0,f=t.drawBorder||!1,b=t.hitCanvasPixelRatio||1;if(r&&l){h-=u,d-=u;var L=new ne({pixelRatio:o,width:r+=2*u+1,height:l+=2*u+1}),H=new ne({pixelRatio:o,width:0,height:0}),C=new se({pixelRatio:b,width:r,height:l}),K=L.getContext(),de=C.getContext();return C.isCache=!0,L.isCache=!0,this._cache.delete(Re),this._filterUpToDate=!1,t.imageSmoothingEnabled===!1&&(L.getContext()._context.
32imageSmoothingEnabled=!1,H.getContext()._context.imageSmoothingEnabled=!1),K.save(),de.save(),K.translate(-h,-d),de.translate(-h,-d),this._isUnderCache=!0,this._clearSelfAndDescendantCache(ge),this._clearSelfAndDescendantCache(be),this.drawScene(L,this),this.drawHit(C,this),this._isUnderCache=!1,K.restore(),de.restore(),f&&(K.save(),K.beginPath(),K.rect(0,0,r,l),K.closePath(),K.setAttr("strokeStyle","red"),K.setAttr("lineWidth",5),K.stroke(),K.restore()),this._cache.set(Re,{scene:L,filter:H,hit:C,x:h,y:d}),this._requestDraw(),this}g.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(Re)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){var i,r,l,o,h=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],d=this.getAbsoluteTransform(t);return h.forEach(function(u){var f=d.point(u);i===void 0&&(i=l=f.x,r=o=f.y),i=Math.min(i,f.x),r=Math.min(r,f.y),l=Math.max(l,f.x),o=Math.max(o,f.y)}),{x:i,y:r,width:l-i,height:o-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const t=this._getCanvasCache();e.translate(t.x,t.y);var i=this._getCachedSceneCanvas(),r=i.pixelRatio;e.drawImage(i._canvas,0,0,i.width/r,i.height/r),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),i=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(i._canvas,0,0,i.width/i.pixelRatio,i.height/i.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,i,r,l=this.filters(),o=this._getCanvasCache(),h=o.scene,d=o.filter,u=d.getContext();if(l){if(!this._filterUpToDate){var f=h.pixelRatio;d.setSize(h.width/h.pixelRatio,h.height/h.pixelRatio);try{for(e=l.length,u.clear(),u.drawImage(h._canvas,0,0,h.getWidth()/f,h.getHeight()/f),t=u.getImageData(0,0,d.getWidth(),d.getHeight()),i=0;i<e;i++)typeof(r=l[i])=="function"?(r.call(this,t),u.putImageData(t,0,0)):g.error("Filter should be type of function, but got "+typeof r+" instead. Please check correct filters")}catch(b){g.error("Unable to apply filter. "+b.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return d}return h}on(e,t){if(this._cache&&this._cache.delete(pe),arguments.length===3)return this._delegate.apply(this,arguments);var i,r,l,o,h=e.split(mt),d=h.length;for(i=0;i<d;i++)l=(r=h[i].split("."))[0],o=r[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:o,handler:t});return this}off(e,t){var i,r,l,o,h,d=(e||"").split(mt),u=d.length;if(this._cache&&this._cache.delete(pe),!e)for(r in this.eventListeners)this._off(r);for(i=0;i<u;i++)if(o=(l=d[i].split("."))[0],h=l[1],o)this.eventListeners[o]&&this._off(o,h,t);else for(r in this.eventListeners)this._off(r,h,t);return this}dispatchEvent(e){var t={target:this,type:e.type,evt:e};return this.fire(e.type,t),this}addEventListener(e,t){return this.on(e,function(i){t.call(this,i.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,t,i){var r=this;this.on(e,function(l){for(var o=l.target.findAncestors(t,!0,r),h=0;h<o.length;h++)(l=g.cloneObject(l)).currentTarget=o[h],i.call(o[h],l)})}
32remove(){return this.isDragging()&&this.stopDrag(),Z._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ye),this._clearSelfAndDescendantCache(ge),this._clearSelfAndDescendantCache(be),this._clearSelfAndDescendantCache(ui),this._clearSelfAndDescendantCache(Lt),this._clearSelfAndDescendantCache(Fe)}_remove(){this._clearCaches();var e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this}getAttr(e){var t="get"+g._capitalize(e);return g._isFunction(this[t])?this[t]():this.attrs[e]}getAncestors(){for(var e=this.getParent(),t=[];e;)t.push(e),e=e.getParent();return t}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{var t,i;if(!e)return this;for(t in e)t!=="children"&&(i="set"+g._capitalize(t),g._isFunction(this[i])?this[i](e[t]):this._setAttr(t,e[t]))}),this}isListening(){return this._getCache(Fe,this._isListening)}_isListening(e){if(!this.listening())return!1;const t=this.getParent();return!t||t===e||this===e||t._isListening(e)}isVisible(){return this._getCache(Lt,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const t=this.getParent();return!t||t===e||this===e||t._isVisible(e)}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);var i=this.getLayer(),r=!1;Z._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===i)&&(r=!0)});var l=!t&&!E.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!l}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e,t,i,r,l=this.getDepth(),o=this,h=0;return o.nodeType!=="Stage"&&function d(u){for(e=[],t=u.length,i=0;i<t;i++)r=u[i],h++,r.nodeType!==di&&(e=e.concat(r.getChildren().slice())),r._id===o._id&&(i=t);e.length>0&&e[0].getDepth()<=l&&d(e)}(o.getStage().getChildren()),h}getDepth(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(ze),this._clearSelfAndDescendantCache(ye)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}getAbsolutePosition(e){let t=!1,i=this.parent;for(;i;){if(i.isCached()){t=!0;break}i=i.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),l=new he,o=this.offset();return l.m=r.slice(),l.translate(o.x,o.y),l.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(ze);var i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(ze),this._clearSelfAndDescendantCache(ye),this}_setTransform(e){var t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var t=e.x,i=e.y,r=this.x(),l=this.y();return t!==void 0&&(r+=t),i!==void 0&&(l+=i),this.setPosition({x:r,y:l}),this}_eachAncestorReverse(e,t){var i,r,l=[],o=this.getParent();if(!t||t._id!==this._id){for(l.unshift(this);o&&(!t||o._id!==t._id);)l.unshift(o),o=o.parent;for(i=l.length,r=0;r<i;r++)e(l[r])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return g.warn("Node has no parent. moveToTop function is ignored."),!1;var e=this.index;return e<this.parent.getChildren().length-1&&(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0)}
32moveUp(){if(!this.parent)return g.warn("Node has no parent. moveUp function is ignored."),!1;var e=this.index;return e<this.parent.getChildren().length-1&&(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0)}moveDown(){if(!this.parent)return g.warn("Node has no parent. moveDown function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return g.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return g.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&g.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(ge,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,i,r,l={},o=this.getAttrs();for(e in l.attrs={},o)t=o[e],g.isObject(t)&&!g._isPlainObject(t)&&!g._isArray(t)||(i=typeof this[e]=="function"&&this[e],delete o[e],r=i?i.call(this):null,o[e]=t,r!==t&&(l.attrs[e]=t));return l.className=this.getClassName(),g._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,i){var r=[];t&&this._isMatch(e)&&r.push(this);for(var l=this.parent;l;){if(l===i)return r;l._isMatch(e)&&r.push(l),l=l.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,i){return this.findAncestors(e,t,i)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);var t,i,r=e.replace(/ /g,"").split(","),l=r.length;for(t=0;t<l;t++)if(i=r[t],g.isValidSelector(i)||(g.warn('Selector "'+i+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),g.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),g.warn("Konva is awesome, right?")),i.charAt(0)==="#"){if(this.id()===i.slice(1))return!0}else if(i.charAt(0)==="."){if(this.hasName(i.slice(1)))return!0}else if(this.className===i||this.nodeType===i)return!0;return!1}getLayer(){var e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(ui,this._getStage)}_getStage(){var e=this.getParent();return e?e.getStage():void 0}fire(e,t={},i){return t.target=t.target||this,i?this._fireAndBubble(e,t):this._fire(e,t),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(ye,this._getAbsoluteTransform)}_getAbsoluteTransform(e){var t;if(e)return t=new he,this._eachAncestorReverse(function(r){var l=r.transformsEnabled();l==="all"?t.multiply(r.getTransform()):l==="position"&&t.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},e),t;t=this._cache.get(ye)||new he,this.parent?this.parent.getAbsoluteTransform().copyInto(t):t.reset();var i=this.transformsEnabled();if(i==="all")t.multiply(this.getTransform());else if(i==="position"){const r=this.attrs.x||0,l=this.attrs.y||0,o=this.attrs.offsetX||0,h=this.attrs.offsetY||0;t.translate(r-o,l-h)}return t.dirty=!1,t}getAbsoluteScale(e){for(var t=this;t;)t._isUnderCache&&(e=t),t=t.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(ze,this._getTransform)}_getTransform(){var e,t,i=this._cache.get(ze)||new he;i.reset();var r=this.x(),l=this.y(),o=E.getAngle(this.rotation()),h=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,d=(t=this.attrs.scaleY)!==null&&t!==void 0?t:1,u=this.attrs.skewX||0,f=this.attrs.skewY||0,b=this.attrs.offsetX||0,L=this.attrs.offsetY||0;return r===0&&l===0||i.translate(r,l),o!==0&&i.rotate(o),u===0&&f===0||i.skew(u,f),h===1&&d===1||i.scale(h,d),b===0&&L===0||i.translate(-1*b,-1*L),i.dirty=!1,i}clone(e){var t,i,r,l,o,h=g.cloneObject(this.attrs);for(t in e)h[t]=e[t];var d=new this.constructor(h);for(t in this.eventListeners)for(r=(i=this.eventListeners[t]).length,l=0;l<r;l++)(o=i[l]).name.indexOf("konva")<0&&(d.eventListeners[t]||(d.eventListeners[t]=[]),d.eventListeners[t].push(o));return d}_toKonvaCanvas(e){e=e||{};var t=this.getClientRect(),i=this.getStage(),r=e.x!==void 0?e.x:Math.floor(t.x),l=e.y!==void 0?e.y:Math.floor(t.y),o=e.pixelRatio||1,h=new ne({width:e.width||Math.ceil(t.width)||(i?i.width():0),height:e.height||Math.ceil(t.height)||(i?i.height():0),pixelRatio:o}),d=h.getContext();return d.save(),(r||l)&&d.translate(-1*r,-1*l),this.drawScene(h),d.restore(
32),h}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){var t=(e=e||{}).mimeType||null,i=e.quality||null,r=this._toKonvaCanvas(e).toDataURL(t,i);return e.callback&&e.callback(r),r}toImage(e){if(!e||!e.callback)throw"callback required for toImage method config argument";var t=e.callback;delete e.callback,g._urlToImage(this.toDataURL(e),function(i){t(i)})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():E.dragDistance}_off(e,t,i){var r,l,o,h=this.eventListeners[e];for(r=0;r<h.length;r++)if(l=h[r].name,o=h[r].handler,!(l==="konva"&&t!=="konva"||t&&l!==t||i&&i!==o)){if(h.splice(r,1),h.length===0){delete this.eventListeners[e];break}r--}}_fireChangeEvent(e,t,i){this._fire(e+"Change",{oldVal:t,newVal:i})}addName(e){if(!this.hasName(e)){var t=this.name(),i=t?t+" "+e:e;this.name(i)}return this}hasName(e){if(!e)return!1;const t=this.name();return!!t&&(t||"").split(/\s/g).indexOf(e)!==-1}removeName(e){var t=(this.name()||"").split(/\s/g),i=t.indexOf(e);return i!==-1&&(t.splice(i,1),this.name(t.join(" "))),this}setAttr(e,t){var i=this["set"+g._capitalize(e)];return g._isFunction(i)?i.call(this,t):this._setAttr(e,t),this}_requestDraw(){if(E.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,t){var i=this.attrs[e];(i!==t||g.isObject(t))&&(t==null?delete this.attrs[e]:this.attrs[e]=t,this._shouldFireChangeEvents&&this._fireChangeEvent(e,i,t),this._requestDraw())}_setComponentAttr(e,t,i){var r;i!==void 0&&((r=this.attrs[e])||(this.attrs[e]=this.getAttr(e)),this.attrs[e][t]=i,this._fireChangeEvent(e,r,i))}_fireAndBubble(e,t,i){if(t&&this.nodeType===di&&(t.target=this),e!==et&&e!==ft||!(i&&(this===i||this.isAncestorOf&&this.isAncestorOf(i))||this.nodeType==="Stage"&&!i)){this._fire(e,t);var r=(e===et||e===ft)&&i&&i.isAncestorOf&&i.isAncestorOf(this)&&!i.isAncestorOf(this.parent);(t&&!t.cancelBubble||!t)&&this.parent&&this.parent.isListening()&&!r&&(i&&i.parent?this._fireAndBubble.call(this.parent,e,t,i):this._fireAndBubble.call(this.parent,e,t))}}_getProtoListeners(e){let t=this._cache.get(pe);if(!t){t={};let r=Object.getPrototypeOf(this);for(;r;)if(r.eventListeners){for(var i in r.eventListeners){const l=r.eventListeners[i],o=t[i]||[];t[i]=l.concat(o)}r=Object.getPrototypeOf(r)}else r=Object.getPrototypeOf(r);this._cache.set(pe,t)}return t[e]}_fire(e,t){(t=t||{}).currentTarget=this,t.type=e;const i=this._getProtoListeners(e);if(i)for(var r=0;r<i.length;r++)i[r].handler.call(this,t);const l=this.eventListeners[e];if(l)for(r=0;r<l.length;r++)l[r].handler.call(this,t)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){var t=e?e.pointerId:void 0,i=this.getStage(),r=this.getAbsolutePosition(),l=i._getPointerById(t)||i._changedPointerPositions[0]||r;Z._dragElements.set(this._id,{node:this,startPointerPos:l,offset:{x:l.x-r.x,y:l.y-r.y},dragStatus:"ready",pointerId:t})}startDrag(e,t=!0){Z._dragElements.has(this._id)||this._createDragElement(e),Z._dragElements.get(this._id).dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},t)}_setDragPosition(e,t){const i=this.getStage()._getPointerById(t.pointerId);if(i){var r={x:i.x-t.offset.x,y:i.y-t.offset.y},l=this.dragBoundFunc();if(l!==void 0){const o=l.call(this,r,e);o?r=o:g.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===r.x&&this._lastPos.y===r.y||(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}stopDrag(e){const t=Z._dragElements.get(this._id);t&&(t.dragStatus="stopped"),Z._endDragBefore(e),Z._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Z._dragElements.get(this._id);return!!e&&e.dragStatus==="dragging"}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if((e.evt.button===void 0||E.dragButtons.indexOf(e.evt.button)>=0)&&!this.isDragging()){var t=!1;
32Z._dragElements.forEach(i=>{this.isAncestorOf(i.node)&&(t=!0)}),t||this._createDragElement(e)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=Z._dragElements.get(this._id),t=e&&e.dragStatus==="dragging",i=e&&e.dragStatus==="ready";t?this.stopDrag():i&&Z._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const t=this.getStage();if(!t)return!1;const i={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return g.haveIntersection(i,this.getClientRect())}static create(e,t){return g._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var i,r,l,o=te.prototype.getClassName.call(e),h=e.children;if(t&&(e.attrs.container=t),E[o]||(g.warn('Can not find a node with class name "'+o+'". Fallback to "Shape".'),o="Shape"),i=new E[o](e.attrs),h)for(r=h.length,l=0;l<r;l++)i.add(te._createNode(h[l]));return i}}te.prototype.nodeType="Node",te.prototype._attrsAffectingSize=[],te.prototype.eventListeners={},te.prototype.on.call(te.prototype,pr,function(){this._batchingTransformChange?this._needClearTransformCache=!0:(this._clearCache(ze),this._clearSelfAndDescendantCache(ye))}),te.prototype.on.call(te.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Lt)}),te.prototype.on.call(te.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(Fe)}),te.prototype.on.call(te.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(ge)});const ue=p.addGetterSetter;ue(te,"zIndex"),ue(te,"absolutePosition"),ue(te,"position"),ue(te,"x",0,m()),ue(te,"y",0,m()),ue(te,"globalCompositeOperation","source-over",S()),ue(te,"opacity",1,m()),ue(te,"name","",S()),ue(te,"id","",S()),ue(te,"rotation",0,m()),p.addComponentsGetterSetter(te,"scale",["x","y"]),ue(te,"scaleX",1,m()),ue(te,"scaleY",1,m()),p.addComponentsGetterSetter(te,"skew",["x","y"]),ue(te,"skewX",0,m()),ue(te,"skewY",0,m()),p.addComponentsGetterSetter(te,"offset",["x","y"]),ue(te,"offsetX",0,m()),ue(te,"offsetY",0,m()),ue(te,"dragDistance",null,m()),ue(te,"width",0,m()),ue(te,"height",0,m()),ue(te,"listening",!0,k()),ue(te,"preventDefault",!0,k()),ue(te,"filters",null,function(a){return this._filterUpToDate=!1,a}),ue(te,"visible",!0,k()),ue(te,"transformsEnabled","all",S()),ue(te,"size"),ue(te,"dragBoundFunc"),ue(te,"draggable",!1,k()),p.backCompat(te,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Ie extends te{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const t=this.children||[];var i=[];return t.forEach(function(r){e(r)&&i.push(r)}),i}hasChildren(){return this.getChildren().length>0}
32removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}var i=e[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){var t=this._generalFind(e,!0);return t.length>0?t[0]:void 0}_generalFind(e,t){var i=[];return this._descendants(r=>{const l=r._isMatch(e);return l&&i.push(r),!(!l||!t)}),i}_descendants(e){let t=!1;const i=this.getChildren();for(const r of i)if(t=e(r),t||r.hasChildren()&&(t=r._descendants(e),t))return!0;return!1}toObject(){var e=te.prototype.toObject.call(this);
32return e.children=[],this.getChildren().forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=te.prototype.clone.call(this,e);return this.getChildren().forEach(function(i){t.add(i.clone())}),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach(function(i){i.isVisible()&&i.intersects(e)&&t.push(i)}),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||(t=this.children)===null||t===void 0||t.forEach(function(i){i._clearSelfAndDescendantCache(e)})}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(t,i){t.index=i}),this._requestDraw()}drawScene(e,t){var i=this.getLayer(),r=e||i&&i.getCanvas(),l=r&&r.getContext(),o=this._getCanvasCache(),h=o&&o.scene,d=r&&r.isCache;if(!this.isVisible()&&!d)return this;if(h){l.save();var u=this.getAbsoluteTransform(t).getMatrix();l.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(l),l.restore()}else this._drawChildren("drawScene",r,t);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var i=this.getLayer(),r=e||i&&i.hitCanvas,l=r&&r.getContext(),o=this._getCanvasCache();if(o&&o.hit){l.save();var h=this.getAbsoluteTransform(t).getMatrix();l.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(l),l.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,i){var r,l=t&&t.getContext(),o=this.clipWidth(),h=this.clipHeight(),d=this.clipFunc(),u=o&&h||d;const f=i===this;if(u){l.save();var b=this.getAbsoluteTransform(i),L=b.getMatrix();if(l.transform(L[0],L[1],L[2],L[3],L[4],L[5]),l.beginPath(),d)d.call(this,l,this);else{var H=this.clipX(),C=this.clipY();l.rect(H,C,o,h)}l.clip(),L=b.copy().invert().getMatrix(),l.transform(L[0],L[1],L[2],L[3],L[4],L[5])}var K=!f&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";K&&(l.save(),l._applyGlobalCompositeOperation(this)),(r=this.children)===null||r===void 0||r.forEach(function(de){de[e](t,i)}),K&&l.restore(),u&&l.restore()}getClientRect(e){var t,i,r,l,o,h,d=(e=e||{}).skipTransform,u=e.relativeTo,f=this;(t=this.children)===null||t===void 0||t.forEach(function(C){if(C.visible()){var K=C.getClientRect({relativeTo:f,skipShadow:e.skipShadow,skipStroke:e.skipStroke});K.width===0&&K.height===0||(i===void 0?(i=K.x,r=K.y,l=K.x+K.width,o=K.y+K.height):(i=Math.min(i,K.x),r=Math.min(r,K.y),l=Math.max(l,K.x+K.width),o=Math.max(o,K.y+K.height)))}});for(var b=this.find("Shape"),L=!1,H=0;H<b.length;H++)if(b[H]._isVisible(this)){L=!0;break}return h=L&&i!==void 0?{x:i,y:r,width:l-i,height:o-r}:{x:0,y:0,width:0,height:0},d?h:this._transformedRect(h,u)}}p.addComponentsGetterSetter(Ie,"clip",["x","y","width","height"]),p.addGetterSetter(Ie,"clipX",void 0,m()),p.addGetterSetter(Ie,"clipY",void 0,m()),p.addGetterSetter(Ie,"clipWidth",void 0,m()),p.addGetterSetter(Ie,"clipHeight",void 0,m()),p.addGetterSetter(Ie,"clipFunc");const tt=new Map,gi=E._global.PointerEvent!==void 0;function Rt(a){return tt.get(a)}function Ot(a){return{evt:a,pointerId:a.pointerId}}function pi(a,e){return tt.get(a)===e}function fi(a,e){it(a),e.getStage()&&(tt.set(a,e),gi&&e._fire("gotpointercapture",Ot(new PointerEvent("gotpointercapture"))))}function it(a,e){const t=tt.get(a);if(!t)return;const i=t.getStage();i&&i.content,tt.delete(a),gi&&t._fire("lostpointercapture",Ot(new PointerEvent("lostpointercapture")))}var mi="mouseleave",xi="mouseover",vi="mouseenter",yi="mousemove",bi="mousedown",Ci="mouseup",rt="pointermove",nt="pointerdown",Je="pointerup",at="pointercancel",xt="pointerout",vt="pointerleave",yt="pointerover",bt="pointerenter",Mt="contextmenu",wi="touchstart",Si="touchend",_i="touchmove",Pi="touchcancel",Gt="wheel",mr=[[vi,"_pointerenter"],[bi,"_pointerdown"],[yi,"_pointermove"],[Ci,"_pointerup"],[mi,"_pointerleave"],[wi,"_pointerdown"],[_i,"_pointermove"],[Si,"_pointerup"],[Pi,"_pointercancel"],[xi,"_pointerover"],[Gt,"_wheel"],[Mt,"_contextmenu"],[nt,"_pointerdown"],[rt,"_pointermove"],[Je,"_pointerup"],[at,"_pointercancel"],["lostpointercapture","_lostpointercapture"]];const Ft={mouse:{[xt]:"mouseout",[vt]:mi,[yt]:xi,[bt]:vi,[rt]:yi,[nt]:bi,[Je]:Ci,[at]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[xt]:"touchout",[vt]:"touchleave",[yt]:"touchover",[bt]:"touchenter",[rt]:_i,[nt]:wi,[Je]:Si,[at]:Pi,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[xt]:xt,[vt]:vt,[yt]:yt,[bt]:bt,[rt]:rt,[nt]:nt,[Je]:Je,[at]:at,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},st=a=>a.indexOf("pointer")>=0?"pointer":a.indexOf("touch")>=0?"touch":"mouse",$e=a=>{const e=st(a);return e==="pointer"?E.pointerEventsEnabled&&Ft.pointer:e==="touch"?Ft.touch:e==="mouse"?Ft.mouse:void 0};function ki(a={}){return(a.clipFunc||a.clipWidth||a.clipHeight)&&g.warn("Stage does not support clipping. Please use clip for Layers or Groups."),a}const Ct=[];class wt extends Ie{constructor(e){super(ki(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Ct.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{ki(this.attrs)}),this._checkVisibility()}_validateAdd(e){const t=e.getType()==="Layer",i=e.getType()==="FastLayer";t||i||g.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e=="string"){if(e.charAt(0)==="."){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var i;i=e.charAt(0)!=="#"?e:e.slice(1),e=document.getElementById(i)}if(!e)throw"Can not find container in document with id "+i}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e,t=this.children,i=t.length;for(e=0;e<i;e++)t[e].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),Ie.prototype.clone.call(this,e)}destroy(){super.destroy();var e=this.content;e&&g._isInDocument(e)&&this.container().removeChild(e);var t=Ct.indexOf(this);return t>-1&&Ct.splice(t,1),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(g.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}_getPointerById(e){return this._pointerPositions.find(t=>
32t.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new ne({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),i=t.getContext()._context,r=this.children;return(e.x||e.y)&&i.translate(-1*e.x,-1*e.y),r.forEach(function(l){if(l.isVisible()){var o=l._toKonvaCanvas(e);i.drawImage(o._canvas,e.x,e.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}}),t}getIntersection(e){if(!e)return null;var t,i=this.children;for(t=i.length-1;t>=0;t--){const r=i[t].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach(i=>{i.setSize({width:e,height:t}),i.draw()})}add(e,...t){if(arguments.length>1){for(var i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);var r=this.children.length;return r>5&&g.warn("The stage has "+r+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),E.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return pi(e,this)}setPointerCapture(e){fi(e,this)}releaseCapture(e){it(e)}getLayers(){return this.children}_bindContentEvents(){E.isBrowser&&mr.forEach(([e,t])=>{this.content.addEventListener(e,i=>{this[t](i)})})}_pointerenter(e){this.setPointersPositions(e);const t=$e(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const t=$e(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){const t=$e(e.type),i=st(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(i),l=!Z.isDragging||E.hitOnDragEnabled;r&&l?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[i+"targetShape"]=null):l&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const t=$e(e.type),i=st(e.type);if(t){this.setPointersPositions(e);var r=!1;this._changedPointerPositions.forEach(l=>{var o=this.getIntersection(l);if(Z.justDragged=!1,E["_"+i+"ListenClick"]=!0,!o||!o.isListening())return;E.capturePointerEventsEnabled&&o.setPointerCapture(l.id),this[i+"ClickStartShape"]=o,o._fireAndBubble(t.pointerdown,{evt:e,pointerId:l.id}),r=!0;const h=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&h&&e.preventDefault()}),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const t=$e(e.type),i=st(e.type);if(!t||(Z.isDragging&&Z.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),Z.isDragging&&!E.hitOnDragEnabled))return;var r={};let l=!1;var o=this._getTargetShape(i);this._changedPointerPositions.forEach(h=>{const d=Rt(h.id)||this.getIntersection(h),u=h.id,f={evt:e,pointerId:u};var b=o!==d;if(b&&o&&(o._fireAndBubble(t.pointerout,Object.assign({},f),d),o._fireAndBubble(t.pointerleave,Object.assign({},f),d)),d){if(r[d._id])return;r[d._id]=!0}d&&d.isListening()?(l=!0,b&&(d._fireAndBubble(t.pointerover,Object.assign({},f),o),d._fireAndBubble(t.pointerenter,Object.assign({},f),o),this[i+"targetShape"]=d),d._fireAndBubble(t.pointermove,Object.assign({},f))):o&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:u}),this[i+"targetShape"]=null)}),l||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const t=$e(e.type),i=st(e.type);if(!t)return;this.setPointersPositions(e);const r=this[i+"ClickStartShape"],l=this[i+"ClickEndShape"];var o={};let h=!1;this._changedPointerPositions.forEach(d=>{const u=Rt(d.id)||this.getIntersection(d);if(u){if(u.releaseCapture(d.id),o[u._id])return;o[u._id]=!0}const f=d.id,b={evt:e,pointerId:f};let L=!1;E["_"+i+"InDblClickWindow"]?(L=!0,clearTimeout(this[i+"DblTimeout"])):Z.justDragged||(E["_"+i+"InDblClickWindow"]=!0,clearTimeout(this[i+"DblTimeout"])),this[i+"DblTimeout"]=setTimeout(function(){E["_"+i+"InDblClickWindow"]=!1}
32,E.dblClickWindow),u&&u.isListening()?(h=!0,this[i+"ClickEndShape"]=u,u._fireAndBubble(t.pointerup,Object.assign({},b)),E["_"+i+"ListenClick"]&&r&&r===u&&(u._fireAndBubble(t.pointerclick,Object.assign({},b)),L&&l&&l===u&&u._fireAndBubble(t.pointerdblclick,Object.assign({},b)))):(this[i+"ClickEndShape"]=null,E["_"+i+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:f}),L&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:f}))}),h||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),E["_"+i+"ListenClick"]=!1,e.cancelable&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Mt,{evt:e}):this._fire(Mt,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Gt,{evt:e}):this._fire(Gt,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const t=Rt(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(Je,Ot(e)),it(e.pointerId)}_lostpointercapture(e){it(e.pointerId)}setPointersPositions(e){var t=this._getContentPosition(),i=null,r=null;(e=e||window.event).touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,l=>{this._pointerPositions.push({id:l.identifier,x:(l.clientX-t.left)/t.scaleX,y:(l.clientY-t.top)/t.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,l=>{this._changedPointerPositions.push({id:l.identifier,x:(l.clientX-t.left)/t.scaleX,y:(l.clientY-t.top)/t.scaleY})})):(i=(e.clientX-t.left)/t.scaleX,r=(e.clientY-t.top)/t.scaleY,this.pointerPos={x:i,y:r},this._pointerPositions=[{x:i,y:r,id:g._getFirstPointerId(e)}],this._changedPointerPositions=[{x:i,y:r,id:g._getFirstPointerId(e)}])}_setPointerPosition(e){g.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new ne({width:this.width(),height:this.height()}),this.bufferHitCanvas=new se({pixelRatio:1,width:this.width(),height:this.height()}),E.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}
32cache(){return g.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}}wt.prototype.nodeType="Stage",ee(wt),p.addGetterSetter(wt,"container");var ji="hasShadow",Ai="shadowRGBA",Ti="patternImage",Ii="linearGradient",Ei="radialGradient";let Bt;function Ut(){return Bt||(Bt=g.createCanvasElement().getContext("2d"),Bt)}const ot={};class X extends te{constructor(e){let t;for(super(e);t=g.getRandomColor(),!t||t in ot;);this.colorKey=t,ot[t]=this}getContext(){return g.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return g.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(ji,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Ti,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const e=Ut().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){const t=new he;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(E.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=t.getMatrix(),r=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);e.setTransform(r)}return e}}_getLinearGradient(){return this._getCache(Ii,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=Ut(),i=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),l=t.createLinearGradient(i.x,i.y,r.x,r.y),o=0;o<e.length;o+=2)l.addColorStop(e[o],e[o+1]);return l}}_getRadialGradient(){return this._getCache(Ei,this.__getRadialGradient)}__getRadialGradient(){var e=this.fillRadialGradientColorStops();if(e){for(var t=Ut(),i=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),l=t.createRadialGradient(i.x,i.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius()),o=0;o<e.length;o+=2)l.addColorStop(e[o],e[o+1]);return l}}getShadowRGBA(){return this._getCache(Ai,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var e=g.colorToRGBA(this.shadowColor());return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),t.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return te.prototype.destroy.call(this),delete ot[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var t;if(!this.getStage()||(t=this.attrs.perfectDrawEnabled)!==null&&t!==void 0&&!t)return!1;const i=e||this.hasFill(),r=this.hasStroke(),l=this.getAbsoluteOpacity()!==1;if(i&&r&&l)return!0;const o=this.hasShadow(),h=this.shadowForStrokeEnabled();return!!(i&&r&&o&&h)}setStrokeHitEnabled(e){g.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const t=e.skipTransform,i=e.relativeTo,r=this.getSelfRect(),l=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,o=r.width+l,h=r.height+l,d=!e.skipShadow&&this.hasShadow(),u=d?this.shadowOffsetX():0,f=d?this.shadowOffsetY():0,b=o+Math.abs(u),L=h+Math.abs(f),H=d&&this.shadowBlur()||0,C={width:b+2*H,height:L+2*H,x:-(l/2+H)+Math.min(u,0)+r.x,y:-(l/2+H)+Math.min(f,0)+r.y};return t?C:this._transformedRect(C,i)}drawScene(e,t){var i,r,l=this.getLayer(),o=e||l.getCanvas(),h=o.getContext(),d=this._getCanvasCache(),u=this.getSceneFunc(),f=this.hasShadow(),b=o.isCache,L=t===this;if(!this.isVisible()&&!L)return this;if(d){h.save();var H=this.getAbsoluteTransform(t).getMatrix();return h.transform(H[0],H[1],H[2],H[3],H[4],H[5]),this._drawCachedSceneCanvas(h),h.restore(
32),this}if(!u)return this;if(h.save(),this._useBufferCanvas()&&!b){(r=(i=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var C=this.getAbsoluteTransform(t).getMatrix();r.transform(C[0],C[1],C[2],C[3],C[4],C[5]),u.call(this,r,this),r.restore();var K=i.pixelRatio;f&&h._applyShadow(this),h._applyOpacity(this),h._applyGlobalCompositeOperation(this),h.drawImage(i._canvas,0,0,i.width/K,i.height/K)}else h._applyLineJoin(this),L||(C=this.getAbsoluteTransform(t).getMatrix(),h.transform(C[0],C[1],C[2],C[3],C[4],C[5]),h._applyOpacity(this),h._applyGlobalCompositeOperation(this)),f&&h._applyShadow(this),u.call(this,h,this);return h.restore(),this}drawHit(e,t,i=!1){if(!this.shouldDrawHit(t,i))return this;var r=this.getLayer(),l=e||r.hitCanvas,o=l&&l.getContext(),h=this.hitFunc()||this.sceneFunc(),d=this._getCanvasCache(),u=d&&d.hit;if(this.colorKey||g.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){o.save();var f=this.getAbsoluteTransform(t).getMatrix();return o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!h)return this;if(o.save(),o._applyLineJoin(this),this!==t){var b=this.getAbsoluteTransform(t).getMatrix();o.transform(b[0],b[1],b[2],b[3],b[4],b[5])}return h.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){var t,i,r,l,o,h=this._getCanvasCache(),d=this._getCachedSceneCanvas(),u=h.hit,f=u.getContext(),b=u.getWidth(),L=u.getHeight();f.clear(),f.drawImage(d._canvas,0,0,b,L);try{for(r=(i=(t=f.getImageData(0,0,b,L)).data).length,l=g._hexToRgb(this.colorKey),o=0;o<r;o+=4)i[o+3]>e?(i[o]=l.r,i[o+1]=l.g,i[o+2]=l.b,i[o+3]=255):i[o+3]=0;f.putImageData(t,0,0)}catch(H){g.error("Unable to draw hit graph from cached scene canvas. "+H.message)}return this}hasPointerCapture(e){return pi(e,this)}setPointerCapture(e){fi(e,this)}releaseCapture(e){it(e)}}X.prototype._fillFunc=function(a){a.fill()},X.prototype._strokeFunc=function(a){a.stroke()},X.prototype._fillFuncHit=function(a){a.fill()},X.prototype._strokeFuncHit=function(a){a.stroke()},X.prototype._centroid=!1,X.prototype.nodeType="Shape",ee(X),X.prototype.eventListeners={},X.prototype.on.call(X.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",function(){this._clearCache(ji)}),X.prototype.on.call(X.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",function(){this._clearCache(Ai)}),X.prototype.on.call(X.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",function(){this._clearCache(Ti)}),X.prototype.on.call(X.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",function(){this._clearCache(Ii)}),X.prototype.on.call(X.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",function(){this._clearCache(Ei)}),p.addGetterSetter(X,"stroke",void 0,O()),p.addGetterSetter(X,"strokeWidth",2,m()),p.addGetterSetter(X,"fillAfterStrokeEnabled",!1),p.addGetterSetter(X,"hitStrokeWidth","auto",function(){if(E.isUnminified)return function(a,e){return g._isNumber(a)||a==="auto"||g.warn(T(a)+' is a not val
32id value for "'+e+'" attribute. The value should be a number or "auto".'),a}}()),p.addGetterSetter(X,"strokeHitEnabled",!0,k()),p.addGetterSetter(X,"perfectDrawEnabled",!0,k()),p.addGetterSetter(X,"shadowForStrokeEnabled",!0,k()),p.addGetterSetter(X,"lineJoin"),p.addGetterSetter(X,"lineCap"),p.addGetterSetter(X,"sceneFunc"),p.addGetterSetter(X,"hitFunc"),p.addGetterSetter(X,"dash"),p.addGetterSetter(X,"dashOffset",0,m()),p.addGetterSetter(X,"shadowColor",void 0,S()),p.addGetterSetter(X,"shadowBlur",0,m()),p.addGetterSetter(X,"shadowOpacity",1,m()),p.addComponentsGetterSetter(X,"shadowOffset",["x","y"]),p.addGetterSetter(X,"shadowOffsetX",0,m()),p.addGetterSetter(X,"shadowOffsetY",0,m()),p.addGetterSetter(X,"fillPatternImage"),p.addGetterSetter(X,"fill",void 0,O()),p.addGetterSetter(X,"fillPatternX",0,m()),p.addGetterSetter(X,"fillPatternY",0,m()),p.addGetterSetter(X,"fillLinearGradientColorStops"),p.addGetterSetter(X,"strokeLinearGradientColorStops"),p.addGetterSetter(X,"fillRadialGradientStartRadius",0),p.addGetterSetter(X,"fillRadialGradientEndRadius",0),p.addGetterSetter(X,"fillRadialGradientColorStops"),p.addGetterSetter(X,"fillPatternRepeat","repeat"),p.addGetterSetter(X,"fillEnabled",!0),p.addGetterSetter(X,"strokeEnabled",!0),p.addGetterSetter(X,"shadowEnabled",!0),p.addGetterSetter(X,"dashEnabled",!0),p.addGetterSetter(X,"strokeScaleEnabled",!0),p.addGetterSetter(X,"fillPriority","color"),p.addComponentsGetterSetter(X,"fillPatternOffset",["x","y"]),p.addGetterSetter(X,"fillPatternOffsetX",0,m()),p.addGetterSetter(X,"fillPatternOffsetY",0,m()),p.addComponentsGetterSetter(X,"fillPatternScale",["x","y"]),p.addGetterSetter(X,"fillPatternScaleX",1,m()),p.addGetterSetter(X,"fillPatternScaleY",1,m()),p.addComponentsGetterSetter(X,"fillLinearGradientStartPoint",["x","y"]),p.addComponentsGetterSetter(X,"strokeLinearGradientStartPoint",["x","y"]),p.addGetterSetter(X,"fillLinearGradientStartPointX",0),p.addGetterSetter(X,"strokeLinearGradientStartPointX",0),p.addGetterSetter(X,"fillLinearGradientStartPointY",0),p.addGetterSetter(X,"strokeLinearGradientStartPointY",0),p.addComponentsGetterSetter(X,"fillLinearGradientEndPoint",["x","y"]),p.addComponentsGetterSetter(X,"strokeLinearGradientEndPoint",["x","y"]),p.addGetterSetter(X,"fillLinearGradientEndPointX",0),p.addGetterSetter(X,"strokeLinearGradientEndPointX",0),p.addGetterSetter(X,"fillLinearGradientEndPointY",0),p.addGetterSetter(X,"strokeLinearGradientEndPointY",0),p.addComponentsGetterSetter(X,"fillRadialGradientStartPoint",["x","y"]),p.addGetterSetter(X,"fillRadialGradientStartPointX",0),p.addGetterSetter(X,"fillRadialGradientStartPointY",0),p.addComponentsGetterSetter(X,"fillRadialGradientEndPoint",["x","y"]),p.addGetterSetter(X,"fillRadialGradientEndPointX",0),p.addGetterSetter(X,"fillRadialGradientEndPointY",0),p.addGetterSetter(X,"fillPatternRotation",0),p.backCompat(X,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var Di=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],xr=Di.length;class Ve extends Ie{constructor(e){super(e),this.canvas=new ne,this.hitCanvas=new se({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e<t.children.length-1?t.content.insertBefore(this.getNativeCanvasElement(),t.children[e+1].getCanvas()._canvas):t.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){te.prototype.moveToTop.call(this);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!te.prototype.moveUp.call(this))return!1;var e=this.getStage();return!(!e||!e.content||(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),0))}moveDown(){if(te.prototype.moveDown.call(this)){var e=this.getStage();if(e){var t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(te.prototype.moveToBottom.call(this)){var e=this.getStage();if(e){var t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[1].getCanvas()._canvas))}return!0}return!1}
32getLayer(){return this}remove(){var e=this.getNativeCanvasElement();return te.prototype.remove.call(this),e&&e.parentNode&&g._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:t}){return this.canvas.setSize(e,t),this.hitCanvas.setSize(e,t),this._setSmoothEnabled(),this}_validateAdd(e){var t=e.getType();t!=="Group"&&t!=="Shape"&&g.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return(e=e||{}).width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),te.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){const e=this.visible();this.canvas._canvas.style.display=e?"block":"none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){g.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){g.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,g.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,i=!1;;){for(let r=0;r<xr;r++){const l=Di[r],o=this._getIntersection({x:e.x+l.x*t,y:e.y+l.y*t}),h=o.shape;if(h)return h;if(i=!!o.antialiased,!o.antialiased)break}if(!i)return null;t+=1}}_getIntersection(e){const t=this.hitCanvas.pixelRatio,i=this.hitCanvas.context.getImageData(Math.round(e.x*t),Math.round(e.y*t),1,1).data,r=i[3];if(r===255){const l=g._rgbToHex(i[0],i[1],i[2]),o=ot["#"+l];return o?{shape:o}:{antialiased:!0}}return r>0?{antialiased:!0}:{}}drawScene(e,t){var i=this.getLayer(),r=e||i&&i.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),Ie.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}drawHit(e,t){var i=this.getLayer(),r=e||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),Ie.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){g.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return g.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var e=this.parent;this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}}Ve.prototype.nodeType="Layer",ee(Ve),p.addGetterSetter(Ve,"imageSmoothingEnabled",!0),p.addGetterSetter(Ve,"clearBeforeDraw",!0),p.addGetterSetter(Ve,"hitGraphEnabled",!0,k());class Nt extends Ve{constructor(e){super(e),this.listening(!1),g.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Nt.prototype.nodeType="FastLayer",ee(Nt);class Ht extends Ie{_validateAdd(e){var t=e.getType();t!=="Group"&&t!=="Shape"&&g.throw("You may only add groups and shapes to groups.")}}Ht.prototype.nodeType="Group",ee(Ht);var Wt=N.performance&&N.performance.now?function(){return N.performance.now()}:function(){return new Date().getTime()};class Ee{constructor(e,t){this.id=Ee.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Wt(),frameRate:0},this.func=e,this.setLayers(t)}setLayers(e){var t;return t=e?e.length>0?e:[e]:[],this.layers=t,this}getLayers(){return this.layers}addLayer(e){var t,i=this.layers,r=i.length;for(t=0;t<r;t++)if(i[t]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){var e,t=Ee.animations,i=t.length;for(e=0;e<i;e++)if(t[e].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Wt(),Ee._addAnimation(this),this}stop(){return Ee._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){var t,i=e.id,r=this.animations,l=r.length;for(t=0;t<l;t++)if(r[t].id===i){this.animations.splice(t,1);break}}static _runFrames(){var e,t,i,r,l,o,h,d,u={},f=this.animations;for(r=0;r<f.length;r++)if(t=(e=f[r]).layers,i=e.func,e._updateFrameObject(Wt()),o=t.length,!i||i.call(e,e.frame)!==!1)for(l=0;l<o;l++)(h=t[l])._id!==void 0&&(u[h._id]=h);for(d in u)u.hasOwnProperty(d)&&u[d].batchDraw()}static _animationLoop(){var e=Ee;
32e.animations.length?(e._runFrames(),g.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,g.requestAnimFrame(this._animationLoop))}}Ee.animations=[],Ee.animIdCounter=0,Ee.animRunning=!1;var vr={node:1,duration:1,easing:1,onFinish:1,yoyo:1},yr=0,Li=["fill","stroke","shadowColor"];class br{constructor(e,t,i,r,l,o,h){this.prop=e,this.propFunc=t,this.begin=r,this._pos=r,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=h,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=i,this._change=l-this.begin,this.pause()}fire(e){var t=this[e];t&&t()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var e=this.getTimer()-this._startTime;this.state===2?this.setTime(e):this.state===3&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return new Date().getTime()}}class fe{constructor(e){var t,i,r=this,l=e.node,o=l._id,h=e.easing||lt.Linear,d=!!e.yoyo;t=e.duration===void 0?.3:e.duration===0?.001:e.duration,this.node=l,this._id=yr++;var u=l.getLayer()||(l instanceof E.Stage?l.getLayers():null);for(i in u||g.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Ee(function(){r.tween.onEnterFrame()},u),this.tween=new br(i,function(f){r._tweenFunc(f)},h,0,1,1e3*t,d),this._addListeners(),fe.attrs[o]||(fe.attrs[o]={}),fe.attrs[o][this._id]||(fe.attrs[o][this._id]={}),fe.tweens[o]||(fe.tweens[o]={}),e)vr[i]===void 0&&this._addAttr(i,e[i]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var i,r,l,o,h,d,u,f,b=this.node,L=b._id;if((l=fe.tweens[L][e])&&delete fe.attrs[L][l][e],i=b.getAttr(e),g._isArray(t))if(r=[],h=Math.max(t.length,i.length),e==="points"&&t.length!==i.length&&(t.length>i.length?(u=i,i=g._prepareArrayForTween(i,t,b.closed())):(d=t,t=g._prepareArrayForTween(t,i,b.closed()))),e.indexOf("fill")===0)for(o=0;o<h;o++)if(o%2==0)r.push(t[o]-i[o]);else{var H=g.colorToRGBA(i[o]);f=g.colorToRGBA(t[o]),i[o]=H,r.push({r:f.r-H.r,g:f.g-H.g,b:f.b-H.b,a:f.a-H.a})}else for(o=0;o<h;o++)r.push(t[o]-i[o]);else Li.indexOf(e)!==-1?(i=g.colorToRGBA(i),r={r:(f=g.colorToRGBA(t)).r-i.r,g:f.g-i.g,b:f.b-i.b,a:f.a-i.a}):r=t-i;fe.attrs[L][this._id][e]={start:i,diff:r,end:t,trueEnd:d,trueStart:u},fe.tweens[L][e]=this._id}_tweenFunc(e){var t,i,r,l,o,h,d,u,f=this.node,b=fe.attrs[f._id][this._id];for(t in b){if(r=(i=b[t]).start,l=i.diff,u=i.end,g._isArray(r))if(o=[],d=Math.max(r.length,u.length),t.indexOf("fill")===0)for(h=0;h<d;h++)h%2==0?o.push((r[h]||0)+l[h]*e):o.push("rgba("+Math.round(r[h].r+l[h].r*e)+","+Math.round(r[h].g+l[h].g*e)+","+Math.round(r[h].b+l[h].b*e)+","+(r[h].a+l[h].a*e)+")");else for(h=0;h<d;h++)o.push((r[h]||0)+l[h]*e);else o=Li.indexOf(t)!==-1?"rgba("+Math.round(r.r+l.r*e)+","+Math.round(r.g+l.g*e)+","+Math.round(r.b+l.b*e)+","+(r.a+l.a*e)+")":r+l*e;f.setAttr(t,o)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=fe.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=fe.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.points.trueStart),this.onReset&&this.onReset()}
32,this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,i=this._id,r=fe.tweens[t];for(e in this.pause(),r)delete fe.tweens[t][e];delete fe.attrs[t][i]}}fe.attrs={},fe.tweens={},te.prototype.to=function(a){var e=a.onFinish;a.node=this,a.onFinish=function(){this.destroy(),e&&e()},new fe(a).play()};const lt={BackEaseIn(a,e,t,i){var r=1.70158;return t*(a/=i)*a*((r+1)*a-r)+e},BackEaseOut(a,e,t,i){var r=1.70158;return t*((a=a/i-1)*a*((r+1)*a+r)+1)+e},BackEaseInOut(a,e,t,i){var r=1.70158;return(a/=i/2)<1?t/2*(a*a*((1+(r*=1.525))*a-r))+e:t/2*((a-=2)*a*((1+(r*=1.525))*a+r)+2)+e},ElasticEaseIn(a,e,t,i,r,l){var o=0;return a===0?e:(a/=i)==1?e+t:(l||(l=.3*i),!r||r<Math.abs(t)?(r=t,o=l/4):o=l/(2*Math.PI)*Math.asin(t/r),-r*Math.pow(2,10*(a-=1))*Math.sin((a*i-o)*(2*Math.PI)/l)+e)},ElasticEaseOut(a,e,t,i,r,l){var o=0;return a===0?e:(a/=i)==1?e+t:(l||(l=.3*i),!r||r<Math.abs(t)?(r=t,o=l/4):o=l/(2*Math.PI)*Math.asin(t/r),r*Math.pow(2,-10*a)*Math.sin((a*i-o)*(2*Math.PI)/l)+t+e)},ElasticEaseInOut(a,e,t,i,r,l){var o=0;return a===0?e:(a/=i/2)==2?e+t:(l||(l=i*(.3*1.5)),!r||r<Math.abs(t)?(r=t,o=l/4):o=l/(2*Math.PI)*Math.asin(t/r),a<1?r*Math.pow(2,10*(a-=1))*Math.sin((a*i-o)*(2*Math.PI)/l)*-.5+e:r*Math.pow(2,-10*(a-=1))*Math.sin((a*i-o)*(2*Math.PI)/l)*.5+t+e)},BounceEaseOut:(a,e,t,i)=>(a/=i)<1/2.75?t*(7.5625*a*a)+e:a<2/2.75?t*(7.5625*(a-=1.5/2.75)*a+.75)+e:a<2.5/2.75?t*(7.5625*(a-=2.25/2.75)*a+.9375)+e:t*(7.5625*(a-=2.625/2.75)*a+.984375)+e,BounceEaseIn:(a,e,t,i)=>t-lt.BounceEaseOut(i-a,0,t,i)+e,BounceEaseInOut:(a,e,t,i)=>a<i/2?.5*lt.BounceEaseIn(2*a,0,t,i)+e:.5*lt.BounceEaseOut(2*a-i,0,t,i)+.5*t+e,E
32aseIn:(a,e,t,i)=>t*(a/=i)*a+e,EaseOut:(a,e,t,i)=>-t*(a/=i)*(a-2)+e,EaseInOut:(a,e,t,i)=>(a/=i/2)<1?t/2*a*a+e:-t/2*(--a*(a-2)-1)+e,StrongEaseIn:(a,e,t,i)=>t*(a/=i)*a*a*a*a+e,StrongEaseOut:(a,e,t,i)=>t*((a=a/i-1)*a*a*a*a+1)+e,StrongEaseInOut:(a,e,t,i)=>(a/=i/2)<1?t/2*a*a*a*a*a+e:t/2*((a-=2)*a*a*a*a+2)+e,Linear:(a,e,t,i)=>t*a/i+e},Be=g._assign(E,{Util:g,Transform:he,Node:te,Container:Ie,Stage:wt,stages:Ct,Layer:Ve,FastLayer:Nt,Group:Ht,DD:Z,Shape:X,shapes:ot,Animation:Ee,Tween:fe,Easings:lt,Context:M,Canvas:ie});var Cr=Q(918),Ri=Q.n(Cr),wr=Q(303),Sr=Q.n(wr);class Oe extends X{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const t=this.getWidth(),i=this.getHeight(),r=this.attrs.image;let l;if(r){const o=this.attrs.cropWidth,h=this.attrs.cropHeight;l=o&&h?[r,this.cropX(),this.cropY(),o,h,0,0,t,i]:[r,0,0,t,i]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,t,i),e.closePath(),e.fillStrokeShape(this)),r&&e.drawImage.apply(e,l)}_hitFunc(e){var t=this.width(),i=this.height();e.beginPath(),e.rect(0,0,t,i),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,t;return(e=this.attrs.width)!==null&&e!==void 0?e:(t=this.image())===null||t===void 0?void 0:t.width}getHeight(){var e,t;return(e=this.attrs.height)!==null&&e!==void 0?e:(t=this.image())===null||t===void 0?void 0:t.height}static fromURL(e,t,i=null){var r=g.createImageElement();r.onload=function(){var l=new Oe({image:r});t(l)},r.onerror=i,r.crossOrigin="Anonymous",r.src=e}}Oe.prototype.className="Image",ee(Oe),p.addGetterSetter(Oe,"image"),p.addComponentsGetterSetter(Oe,"crop",["x","y","width","height"]),p.addGetterSetter(Oe,"cropX",0,m()),p.addGetterSetter(Oe,"cropY",0,m()),p.addGetterSetter(Oe,"cropWidth",0,m()),p.addGetterSetter(Oe,"cropHeight",0,m());class ht extends X{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}ht.prototype._centroid=!0,ht.prototype.className="Circle",ht.prototype._attrsAffectingSize=["radius"],ee(ht),p.addGetterSetter(ht,"radius",0,m());class zt extends X{_sceneFunc(e){var t=this.cornerRadius(),i=this.width(),r=this.height();if(e.beginPath(),t){let l=0,o=0,h=0,d=0;typeof t=="number"?l=o=h=d=Math.min(t,i/2,r/2):(l=Math.min(t[0]||0,i/2,r/2),o=Math.min(t[1]||0,i/2,r/2),d=Math.min(t[2]||0,i/2,r/2),h=Math.min(t[3]||0,i/2,r/2)),e.moveTo(l,0),e.lineTo(i-o,0),e.arc(i-o,o,o,3*Math.PI/2,0,!1),e.lineTo(i,r-d),e.arc(i-d,r-d,d,0,Math.PI/2,!1),e.lineTo(h,r),e.arc(h,r-h,h,Math.PI/2,Math.PI,!1),e.lineTo(0,l),e.arc(l,l,l,Math.PI,3*Math.PI/2,!1)}else e.rect(0,0,i,r);e.closePath(),e.fillStrokeShape(this)}}zt.prototype.className="Rect",ee(zt),p.addGetterSetter(zt,"cornerRadius",0,function(a){if(E.isUnminified)return function(e,t){let i=g._isNumber(e),r=g._isArray(e)&&e.length==4;
32return i||r||g.warn(T(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or Array<number>(4)'),e}}());class je extends X{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this.dataArray=je.parsePathData(this.data()),this.pathLength=0;for(var t=0;t<this.dataArray.length;++t)this.pathLength+=this.dataArray[t].pathLength;this.on("dataChange.konva",function(){this.dataArray=je.parsePathData(this.data()),this.pathLength=0;for(var i=0;i<this.dataArray.length;++i)this.pathLength+=this.dataArray[i].pathLength})}_sceneFunc(e){var t=this.dataArray;e.beginPath();for(var i=!1,r=0;r<t.length;r++){var l=t[r].command,o=t[r].points;switch(l){case"L":e.lineTo(o[0],o[1]);break;case"M":e.moveTo(o[0],o[1]);break;case"C":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":e.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var h=o[0],d=o[1],u=o[2],f=o[3],b=o[4],L=o[5],H=o[6],C=o[7],K=u>f?u:f,de=u>f?1:u/f,Pe=u>f?f/u:1;e.translate(h,d),e.rotate(H),e.scale(de,Pe),e.arc(0,0,K,b,b+L,1-C),e.scale(1/de,1/Pe),e.rotate(-H),e.translate(-h,-d);break;case"z":i=!0,e.closePath()}}i||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach(function(u){if(u.command==="A"){var f=u.points[4],b=u.points[5],L=u.points[4]+b,H=Math.PI/180;if(Math.abs(f-L)<H&&(H=Math.abs(f-L)),b<0)for(let C=f-H;C>L;C-=H){const K=je.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],C,0);e.push(K.x,K.y)}else for(let C=f+H;C<L;C+=H){const K=je.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],C,0);e.push(K.x,K.y)}}else if(u.command==="C")for(let C=0;C<=1;C+=.01){const K=je.getPointOnCubicBezier(C,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);e.push(K.x,K.y)}else e=e.concat(u.points)});for(var t,i,r=e[0],l=e[0],o=e[1],h=e[1],d=0;d<e.length/2;d++)t=e[2*d],i=e[2*d+1],isNaN(t)||(r=Math.min(r,t),l=Math.max(l,t)),isNaN(i)||(o=Math.min(o,i),h=Math.max(h,i));return{x:r,y:o,width:l-r,height:h-o}}getLength(){return this.pathLength}getPointAtLength(e){var t,i=0,r=this.dataArray.length;if(!r)return null;for(;i<r&&e>this.dataArray[i].pathLength;)e-=this.dataArray[i].pathLength,++i;if(i===r)return{x:(t=this.dataArray[i-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[i].points.slice(0,2))[0],y:t[1]};var l=this.dataArray[i],o=l.points;switch(l.command){case"L":return je.getPointOnLine(e,l.start.x,l.start.y,o[0],o[1]);case"C":return je.getPointOnCubicBezier(e/l.pathLength,l.start.x,l.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return je.getPointOnQuadraticBezier(e/l.pathLength,l.start.x,l.start.y,o[0],o[1],o[2],o[3]);case"A":var h=o[0],d=o[1],u=o[2],f=o[3],b=o[4],L=o[5],H=o[6];return b+=L*e/l.pathLength,je.getPointOnEllipticalArc(h,d,u,f,b,H)}return null}static getLineLength(e,t,i,r){return Math.sqrt((i-e)*(i-e)+(r-t)*(r-t))}static getPointOnLine(e,t,i,r,l,o,h){o===void 0&&(o=t),h===void 0&&(h=i);var d=(l-i)/(r-t+1e-8),u=Math.sqrt(e*e/(1+d*d));r<t&&(u*=-1);var f,b=d*u;if(r===t)f={x:o,y:h+b};else if((h-i)/(o-t+1e-8)===d)f={x:o+u,y:h+b};else{var L,H,C=this.getLineLength(t,i,r,l),K=(o-t)*(r-t)+(h-i)*(l-i);L=t+(K/=C*C)*(r-t),H=i+K*(l-i);var de=this.getLineLength(o,h,L,H),Pe=Math.sqrt(e*e-de*de);u=Math.sqrt(Pe*Pe/(1+d*d)),r<t&&(u*=-1),f={x:L+u,y:H+(b=d*u)}}return f}static getPointOnCubicBezier(e,t,i,r,l,o,h,d,u){function f(C){return C*C*C}function b(C){return 3*C*C*(1-C)}function L(C){return 3*C*(1-C)*(1-C)}function H(C){return(1-C)*(1-C)*(1-C)}return{x:d*f(e)+o*b(e)+r*L(e)+t*H(e),y:u*f(e)+h*b(e)+l*L(e)+i*H(e)}}static getPointOnQuadraticBezier(e,t,i,r,l,o,h){function d(b){return b*b}function u(b){return 2*b*(1-b)}function f(b){return(1-b)*(1-b)}return{x:o*d(e)+r*u(e)+t*f(e),y:h*d(e)+l*u(e)+i*f(e)}}static getPointOnEllipticalArc(e,t,i,r,l,o){var h=Math.cos(o),d=Math.sin(o),u=i*Math.cos(l),f=r*Math.sin(l);return{x:e+(u*h-f*d),y:t+(u*d+f*h)}}static parsePathData(e){if(!e)return[];var t=e,i=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];t=t.replace(new RegExp(" ","g"),",");for(var r=0;r<i.length;r++)t=t.replace(new RegExp(i[r],"g"),"|"+i[r]);var l,o=t.split("|"),h=[],d=[],u=0,f=0,b=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;for(r=1;r<o.length;r++){var L=o[r],H=L.charAt(0);for(L=L.slice(1),d.length=0;l=b.exec(L);)d.push(l[0]);for(var C=[],K=0,de=d.length;K<de;K++)if(d[K]!=="00"){var Pe=parseFloat(d[K]);isNaN(Pe)?C.push(0):C.push(Pe)}else C.push(0,0);for(;C.length>0&&!isNaN(C[0]);){var me,Ce,xe,Me,Ue,De,Le,ke,we,re,oe=null,le=[],Qe=u,_t=f;
32switch(H){case"l":u+=C.shift(),f+=C.shift(),oe="L",le.push(u,f);break;case"L":u=C.shift(),f=C.shift(),le.push(u,f);break;case"m":var Pt=C.shift(),ct=C.shift();if(u+=Pt,f+=ct,oe="M",h.length>2&&h[h.length-1].command==="z"){for(var qe=h.length-2;qe>=0;qe--)if(h[qe].command==="M"){u=h[qe].points[0]+Pt,f=h[qe].points[1]+ct;break}}le.push(u,f),H="l";break;case"M":u=C.shift(),f=C.shift(),oe="M",le.push(u,f),H="L";break;case"h":u+=C.shift(),oe="L",le.push(u,f);break;case"H":u=C.shift(),oe="L",le.push(u,f);break;case"v":f+=C.shift(),oe="L",le.push(u,f);break;case"V":f=C.shift(),oe="L",le.push(u,f);break;case"C":le.push(C.shift(),C.shift(),C.shift(),C.shift()),u=C.shift(),f=C.shift(),le.push(u,f);break;case"c":le.push(u+C.shift(),f+C.shift(),u+C.shift(),f+C.shift()),u+=C.shift(),f+=C.shift(),oe="C",le.push(u,f);break;case"S":Ce=u,xe=f,(me=h[h.length-1]).command==="C"&&(Ce=u+(u-me.points[2]),xe=f+(f-me.points[3])),le.push(Ce,xe,C.shift(),C.shift()),u=C.shift(),f=C.shift(),oe="C",le.push(u,f);break;case"s":Ce=u,xe=f,(me=h[h.length-1]).command==="C"&&(Ce=u+(u-me.points[2]),xe=f+(f-me.points[3])),le.push(Ce,xe,u+C.shift(),f+C.shift()),u+=C.shift(),f+=C.shift(),oe="C",le.push(u,f);break;case"Q":le.push(C.shift(),C.shift()),u=C.shift(),f=C.shift(),le.push(u,f);break;case"q":le.push(u+C.shift(),f+C.shift()),u+=C.shift(),f+=C.shift(),oe="Q",le.push(u,f);break;case"T":Ce=u,xe=f,(me=h[h.length-1]).command==="Q"&&(Ce=u+(u-me.points[0]),xe=f+(f-me.points[1])),u=C.shift(),f=C.shift(),oe="Q",le.push(Ce,xe,u,f);break;case"t":Ce=u,xe=f,(me=h[h.length-1]).command==="Q"&&(Ce=u+(u-me.points[0]),xe=f+(f-me.points[1])),u+=C.shift(),f+=C.shift(),oe="Q",le.push(Ce,xe,u,f);break;case"A":Me=C.shift(),Ue=C.shift(),De=C.shift(),Le=C.shift(),ke=C.shift(),we=u,re=f,u=C.shift(),f=C.shift(),oe="A",le=this.convertEndpointToCenterParameterization(we,re,u,f,Le,ke,Me,Ue,De);break;case"a":Me=C.shift(),Ue=C.shift(),De=C.shift(),Le=C.shift(),ke=C.shift(),we=u,re=f,u+=C.shift(),f+=C.shift(),oe="A",le=this.convertEndpointToCenterParameterization(we,re,u,f,Le,ke,Me,Ue,De)}h.push({command:oe||H,points:le,start:{x:Qe,y:_t},pathLength:this.calcLength(Qe,_t,oe||H,le)})}H!=="z"&&H!=="Z"||h.push({command:"z",points:[],start:void 0,pathLength:0})}return h}static calcLength(e,t,i,r){var l,o,h,d,u=je;switch(i){case"L":return u.getLineLength(e,t,r[0],r[1]);case"C":for(l=0,o=u.getPointOnCubicBezier(0,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),d=.01;d<=1;d+=.01)h=u.getPointOnCubicBezier(d,e,t,r[0],r[1],r[2],r[3],r[4],r[5]),l+=u.getLineLength(o.x,o.y,h.x,h.y),o=h;return l;case"Q":for(l=0,o=u.getPointOnQuadraticBezier(0,e,t,r[0],r[1],r[2],r[3]),d=.01;d<=1;d+=.01)h=u.getPointOnQuadraticBezier(d,e,t,r[0],r[1],r[2],r[3]),l+=u.getLineLength(o.x,o.y,h.x,h.y),o=h;return l;case"A":l=0;var f=r[4],b=r[5],L=r[4]+b,H=Math.PI/180;if(Math.abs(f-L)<H&&(H=Math.abs(f-L)),o=u.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],f,0),b<0)for(d=f-H;d>L;d-=H)h=u.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],d,0),l+=u.getLineLength(o.x,o.y,h.x,h.y),o=h;else for(d=f+H;d<L;d+=H)h=u.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],d,0),l+=u.getLineLength(o.x,o.y,h.x,h.y),o=h;return h=u.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],L,0),l+u.getLineLength(o.x,o.y,h.x,h.y)}return 0}static convertEndpointToCenterParameterization(e,t,i,r,l,o,h,d,u){var f=u*(Math.PI/180),b=Math.cos(f)*(e-i)/2+Math.sin(f)*(t-r)/2,L=-1*Math.sin(f)*(e-i)/2+Math.cos(f)*(t-r)/2,H=b*b/(h*h)+L*L/(d*d);H>1&&(h*=Math.sqrt(H),d*=Math.sqrt(H));var C=Math.sqrt((h*h*(d*d)-h*h*(L*L)-d*d*(b*b))/(h*h*(L*L)+d*d*(b*b)));l===o&&(C*=-1),isNaN(C)&&(C=0);var K=C*h*L/d,de=C*-d*b/h,Pe=(e+i)/2+Math.cos(f)*K-Math.sin(f)*de,me=(t+r)/2+Math.sin(f)*K+Math.cos(f)*de,Ce=function(we){return Math.sqrt(we[0]*we[0]+we[1]*we[1])},xe=function(we,re){return(we[0]*re[0]+we[1]*re[1])/(Ce(we)*Ce(re))},Me=function(we,re){return(we[0]*re[1]<we[1]*re[0]?-1:1)*Math.acos(xe(we,re))},Ue=Me([1,0],[(b-K)/h,(L-de)/d]),De=[(b-K)/h,(L-de)/d],Le=[(-1*b-K)/h,(-1*L-de)/d],ke=Me(De,Le);return xe(De,Le)<=-1&&(ke=Math.PI),xe(De,Le)>=1&&(ke=0),o===0&&ke>0&&(ke-=2*Math.PI),o===1&&ke<0&&(ke+=2*Math.PI),[Pe,me,h,d,Ue,ke,f,o]}}function Oi(a){return(Oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(a)}function Mi(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),t.push.apply(t,i)}return t}function St(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
32e%2?Mi(Object(t),!0).forEach(function(i){Fi(a,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Mi(Object(t)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(t,i))})}return a}function _r(a,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function Gi(a,e){return(Gi=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t})(a,e)}function Pr(a,e){return!e||Oi(e)!=="object"&&typeof e!="function"?Yt(a):e}function Yt(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Xt(a){return(Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(a)}function Fi(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}je.prototype.className="Path",je.prototype._attrsAffectingSize=["data"],ee(je),p.addGetterSetter(je,"data");var Bi=function(a){(function(h,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(d&&d.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),d&&Gi(h,d)})(o,a);var e,t,i,r,l=(i=o,r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}(),function(){var h,d=Xt(i);if(r){var u=Xt(this).constructor;h=Reflect.construct(d,arguments,u)}else h=d.apply(this,arguments);return Pr(this,h)});function o(h){var d;(function(b,L){if(!(b instanceof L))throw new TypeError("Cannot call a class as a function")})(this,o);var u=(d=l.call(this,h)).generateHash("avatar_container"),f=d.generateHash("avatar_loader");return d.onFileLoad=d.onFileLoad.bind(Yt(d)),d.onCloseClick=d.onCloseClick.bind(Yt(d)),d.state={imgWidth:0,imgHeight:0,scale:1,containerId:u,loaderId:f,lastMouseY:0,showLoader:!(d.props.src||d.props.img)},d}return e=o,(t=[{key:"generateHash",value:function(h){var d=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return h+"-"+d()+"-"+d()+"-"+d()}},{key:"onCloseCallback",value:function(){this.props.onClose()}},{key:"onCropCallback",value:function(h){this.props.onCrop(h)}},{key:"onFileLoadCallback",value:function(h){this.props.onFileLoad(h)}},{key:"onBeforeFileLoadCallback",value:function(h){this.props.onBeforeFileLoad(h)}},{key:"onImageLoadCallback",value:function(h){this.props.onImageLoad(h)}},{key:"componentDidMount",value:function(){var h=this;if(!this.state.showLoader){var d=this.props.img||new Image;d.crossOrigin="Anonymous",!this.props.img&&this.props.src&&(d.src=this.props.src),this.setState({image:d},function(){if(h.image.complete)return h.init();h.image.onload=function(){h.onImageLoadCallback(h.image),h.init()}})}}},{key:"componentDidUpdate",value:function(h,d){h.src!==this.props.src&&(this.image.src=this.props.src)}},{key:"onFileLoad",value:function(h){if(h.preventDefault(),this.onBeforeFileLoadCallback(h),h.target.value){var d=h.target.files[0];this.onFileLoadCallback(d);var u=this;Ri().getData(d,function(){var f=Ri().getTag(this,"Orientation");Sr()(d,function(b,L){u.setState({image:b,file:d,showLoader:!1},function(){u.init()})},{orientation:f,meta:!0})})}}},{key:"onCloseClick",value:function(){var h=this;this.setState({showLoader:!0},function(){return h.onCloseCallback()})}},{key:"init",value:function(){var h,d,u=this.props,f=u.height,b=u.minCropRadius,L=u.cropRadius,H=this.image.width,C=this.image.height,K=C/H,de=this.props,Pe=de.imageWidth,me=de.imageHeight;me&&Pe&&console.warn("The imageWidth and imageHeight properties can not be set together, using only imageWidth."),me&&!Pe?d=(h=me||C)/K:Pe?h=(d=Pe)*K||C:d=(h=f||C)/K;var Ce=h/C,xe=Math.max(b,L||Math.min(d,h)/3);this.setState({imgWidth:d,imgHeight:h,scale:Ce,cropRadius:xe},this.initCanvas)}},{key:"initCanvas",value:function(){var h=this,d=this.initStage(),u=this.initBackgroun
32d(),f=this.initShading(),b=this.initCrop(),L=this.initCropStroke(),H=this.initResize(),C=this.initResizeIcon(),K=new Be.Layer;K.add(u),K.add(f),K.add(L),K.add(b),K.add(H),K.add(C),d.add(K);var de=function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return b.radius()-re},Pe=function(re){return b.x()-de(re)<0},me=function(re){return b.y()-de(re)<0},Ce=function(re){return b.x()+de(re)>d.width()},xe=function(re){return b.y()+de(re)>d.height()},Me=function(re){return de(re)>=h.minCropRadius?re:b.radius()-h.minCropRadius},Ue=function(re){return re+.86*b.radius()},De=function(re){return re-.5*b.radius()},Le=function(re,oe){H.x(Ue(re)-8),H.y(De(oe)-8),C.x(Ue(re)-8),C.y(De(oe)-10)},ke=function(){if(h.props.exportAsSquare){var re=new Be.Image({image:h.image}),oe=re.width()/u.width(),le=re.height()/u.height(),Qe=2*b.radius()*oe,_t=2*b.radius()*le,Pt=h.props.exportSize?h.props.exportSize/Qe:void 0;return re.toDataURL({x:(b.x()-b.radius())*oe,y:(b.y()-b.radius())*le,width:Qe,height:_t,pixelRatio:Pt,mimeType:h.props.exportMimeType,quality:h.props.exportQuality})}var ct=2*b.radius(),qe=2*b.radius(),jr=h.props.exportSize?h.props.exportSize/ct:void 0;return b.toDataURL({x:b.x()-b.radius(),y:b.y()-b.radius(),width:ct,height:qe,pixelRatio:jr,mimeType:h.props.exportMimeType,quality:h.props.exportQuality})},we=function(re){var oe=re>0||function(le){return!(Pe(le)||Ce(le)||xe(le)||me(le))}(re)?re:0;L.radius(L.radius()-Me(oe)),b.radius(b.radius()-Me(oe)),H.fire("resize")};this.onCropCallback(ke()),b.on("dragmove",function(){return b.fire("resize")}),b.on("dragend",function(){return h.onCropCallback(ke())}),b.on("resize",function(){var re=Pe()?b.radius()+1:Ce()?d.width()-b.radius()-1:b.x(),oe=me()?b.radius()+1:xe()?d.height()-b.radius()-1:b.y();Le(re,oe),b.setFillPatternOffset({x:re/h.scale,y:oe/h.scale}),b.x(re),L.x(re),b.y(oe),L.y(oe)}),b.on("mouseenter",function(){return d.container().style.cursor="move"}),b.on("mouseleave",function(){return d.container().style.cursor="default"}),b.on("dragstart",function(){return d.container().style.cursor="move"}),b.on("dragend",function(){return d.container().style.cursor="default"}),H.on("touchstart",function(re){H.on("dragmove",function(oe){if(oe.evt.type==="touchmove"){var le=oe.evt.changedTouches[0].pageY-re.evt.changedTouches[0].pageY||0;we(le*h.mobileScaleSpeed)}})}),H.on("dragmove",function(re){if(re.evt.type!=="touchmove"){var oe=re.evt.y,le=oe?oe-h.state.lastMouseY:void 0,Qe=re.evt.movementY||le||0;h.setState({lastMouseY:oe}),we(Qe)}}),H.on("dragend",function(){return h.onCropCallback(ke())}),H.on("resize",function(){return Le(b.x(),b.y())}),H.on("mouseenter",function(){return d.container().style.cursor="nesw-resize"}),H.on("mouseleave",function(){return d.container().style.cursor="default"}),H.on("dragstart",function(re){h.setState({lastMouseY:re.evt.y}),d.container().style.cursor="nesw-resize"}),H.on("dragend",function(){return d.container().style.cursor="default"})}},{key:"initStage",value:function(){return new Be.Stage({container:this.containerId,width:this.width,height:this.height})}}
32,{key:"initBackground",value:function(){return new Be.Image({x:0,y:0,width:this.width,height:this.height,image:this.image})}},{key:"initShading",value:function(){return new Be.Rect({x:0,y:0,width:this.width,height:this.height,fill:this.shadingColor,strokeWidth:4,opacity:this.shadingOpacity})}},{key:"initCrop",value:function(){return new Be.Circle({x:this.halfWidth,y:this.halfHeight,radius:this.cropRadius,fillPatternImage:this.image,fillPatternOffset:{x:this.halfWidth/this.scale,y:this.halfHeight/this.scale},fillPatternScale:{x:this.scale,y:this.scale},opacity:1,draggable:!0,dashEnabled:!0,dash:[10,5]})}},{key:"initCropStroke",value:function(){return new Be.Circle({x:this.halfWidth,y:this.halfHeight,radius:this.cropRadius,stroke:this.cropColor,strokeWidth:this.lineWidth,strokeScaleEnabled:!0,dashEnabled:!0,dash:[10,5]})}},{key:"initResize",value:function(){return new Be.Rect({x:this.halfWidth+.86*this.cropRadius-8,y:this.halfHeight+-.5*this.cropRadius-8,width:16,height:16,draggable:!0,dragBoundFunc:function(h){return{x:this.getAbsolutePosition().x,y:h.y}}})}},{key:"initResizeIcon",value:function(){return new Be.Path({x:this.halfWidth+.86*this.cropRadius-8,y:this.halfHeight+-.5*this.cropRadius-10,data:"M47.624,0.124l12.021,9.73L44.5,24.5l10,10l14.661-15.161l9.963,12.285v-31.5H47.624z M24.5,44.5   L9.847,59.653L0,47.5V79h31.5l-12.153-9.847L34.5,54.5L24.5,44.5z",fill:this.cropColor,scale:{x:.2,y:.2}})}},{key:"render",value:function(){var h=this,d=this.props,u=d.width,f=d.height,b={display:"flex",justifyContent:"center",backgroundColor:this.backgroundColor,width:u||this.width,position:"relative"},L=this.props.label,H=St(St({},this.props.labelStyle),{lineHeight:(f||200)+"px"}),C=St(St({},this.props.borderStyle),{width:u||200,height:f||200});return B().createElement("div",null,this.state.showLoader?B().createElement("div",{style:C},B().createElement("input",{onChange:function(K){return h.onFileLoad(K)},name:this.loaderId,type:"file",id:this.loaderId,style:{width:.1,height:.1,opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},accept:this.mimeTypes}),B().createElement("label",{htmlFor:this.loaderId,style:H},L)):B().createElement("div",{style:b},B().createElement("svg",{onClick:this.onCloseClick,style:{position:"absolute",zIndex:999,cursor:"pointer",left:"10px",top:"10px"},viewBox:"0 0 475.2 475.2",width:"20px",height:"20px"},B().createElement("g",null,B().createElement("path",{d:"M405.6,69.6C360.7,24.7,301.1,0,237.6,0s-123.1,24.7-168,69.6S0,174.1,0,237.6s24.7,123.1,69.6,168s104.5,69.6,168,69.6    s123.1-24.7,168-69.6s69.6-104.5,69.6-168S450.5,114.5,405.6,69.6z M386.5,386.5c-39.8,39.8-92.7,61.7-148.9,61.7    s-109.1-21.9-148.9-61.7c-82.1-82.1-82.1-215.7,0-297.8C128.5,48.9,181.4,27,237.6,27s109.1,21.9,148.9,61.7    C468.6,170.8,468.6,304.4,386.5,386.5z",fill:this.closeIconColor}),B().createElement("path",{d:"M342.3,132.9c-5.3-5.3-13.8-5.3-19.1,0l-85.6,85.6L152,132.9c-5.3-5.3-13.8-5.3-19.1,0c-5.3,5.3-5.3,13.8,0,19.1    l85.6,85.6l-85.6,85.6c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4l85.6-85.6l85.6,85.6c2.6,2.6,6.1,4,9.5,4    c3.5,0,6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1l-85.4-85.6l85.6-85.6C347.6,146.7,347.6,138.2,342.3,132.9z",fill:this.closeIconColor}))),B().createElement("div",{id:this.containerId})))}},{key:"lineWidth",get:function(){return this.props.lineWidth}},{key:"containerId",get:function(){return this.state.containerId}},{key:"closeIconColor",get:function(){return this.props.closeIconColor}},{key:"cropColor",get:function(){return this.props.cropColor}},{key:"loaderId",get:function(){return this.state.loaderId}},{key:"mimeTypes",get:function(){return this.props.mimeTypes}},{key:"backgroundColor",get:function(){return this.props.backgroundColor}},{key:"shadingColor",get:function(){return this.props.shadingColor}},{key:"shadingOpacity",get:function(){return this.props.shadingOpacity}},{key:"mobileScaleSpeed",get:function(){return this.props.mobileScaleSpeed}},{key:"cropRadius",get:function(){return this.state.cropRadius}},{key:"minCropRadius",get:function(){return this.props.minCropRadius}},{key:"scale",get:function(){return this.state.scale}},{key:"width",get:function(){return this.state.imgWidth}},{key:"halfWidth",get:function(){return this.state.imgWidth/2}},{key:"height",get:function(){return this.state.imgHeight}},{key:"halfHeight",get:function(){return this.state.imgHeight/2}},{key:"image",get:function(){return this.state.image}}])&&_r(e.prototype,t),o}(B().Component);Fi(Bi,"defaultProps",{shadingColor:"grey",shadingOpacity:.6,cropColor:"white",closeIconColor:"white",lineWidth:4,minCropRadius:30,backgroundColor:"grey",mimeTypes:"image/jpeg,image/png",exportAsSquare:!1,exportSize:void 0,exportMimeType:"image/png",exportQuality:1,mobileScaleSpeed:.5,onClose:function(){},onCrop:function(){},onFileLoad:function(){},onImageLoad:function(){},onBeforeFileLoad:function(){}
32,label:"Choose a file",labelStyle:{fontSize:"1.25em",fontWeight:"700",color:"black",display:"inline-block",fontFamily:"sans-serif",cursor:"pointer"},borderStyle:{border:"2px solid #979797",borderStyle:"dashed",borderRadius:"8px",textAlign:"center"}});const kr=Bi})(),ae})()})})(ur);var aa=ur.exports;const sa=Wr(aa),oa="_fadeOut_k3f6z_1",la="_fadeIn_k3f6z_7",Wi={fadeOut:oa,fadeIn:la},Kt=5;function ha({imageUrl:c,firstName:w,lastName:A,handlePhotoSubmit:J,setProfilePicturePreview:q=()=>{}}){const[Q,ae]=Se.useState(!1),[R,B]=Se.useState(!1),[$,N]=Se.useState(c),[E,ee]=Se.useState(""),[he,G]=Se.useState(""),[V,j]=Se.useState(!1),y=zr(),{recordProfileEvent:z}=Ze();let U="";const D=({target:S})=>{S.files!==null&&S.files[0].size>Kt*1048576?(B(!0),S.value=""):B(!1)},g=S=>{U=S},T=async S=>{j(!0);const O=(S.match(/^data:([^;]+);/)||"")[1],v=await(await fetch(S)).blob();if(v){const x=await J({blob:v,type:O});x.ok?(ee("success"),G("Successfully uploaded new picture"),N(S),q(S),y(Xr(S))):(q(""),ee("error"),G(x.errorMessage||"Failed to upload new picture"))}j(!1)},m=()=>{ae(!0),z("Clicked Upload Photo",{category:"Profile-Setup","Clicked from Location":"Profile Editor"})};return s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Xe,{level:4,children:"Profile picture"}),s.jsxs(W,{flexDirection:"column",children:[s.jsxs(W,{gap:"8px",children:[V?s.jsx(ir,{color:Xi,height:"64px",width:"64px"}):s.jsx(si,{size:"64px",profile:{firstName:w,lastName:A,profilePicture:$},backgroundColor:Ki,textColor:qi,fontSize:"16px"}),s.jsxs(W,{justifyContent:"center",flexDirection:"column",gap:"8px",children:[s.jsxs("div",{className:"flex text-sm gap-1 items-center",children:[s.jsxs("span",{children:["Make sure the file is below ",Kt,"MB"]}),s.jsx(Yr,{})]}),s.jsx(W,{children:s.jsx(Ne,{size:"small",onClick:()=>{ae(!0),m()},children:"Upload a photo"})}),E!==""&&s.jsx(un,{fontSize:"14px",type:E,children:he})]})]}),s.jsxs(W,{className:Q?Wi.fadeIn:Wi.fadeOut,overflow:Q?"auto":"hidden",flexDirection:"column",gap:"8px","aria-label":`upload photo input is ${Q?"shown":"hidden"}`,children:[s.jsx(sa,{imageHeight:535,imageWidth:535,width:535,height:200,onCrop:g,onBeforeFileLoad:D}),R&&s.jsxs(hi,{textSize:"xsmall",margin:"0",children:["File too large, must be less than ",Kt,"MB"]}),s.jsxs(W,{gap:"8px",children:[s.jsx(W,{flex:"1",children:s.jsx(Ne,{onClick:()=>{ae(!1)},children:"Exit"})}),s.jsx(W,{flex:"1",justifyContent:"flex-end",children:s.jsx(Ne,{disabled:R,onClick:()=>{U!==""&&T(U),ae(!1)},children:"Save"})})]})]})]})]})}function ca({values:c,setFieldValue:w}){return s.jsx(Vr,{label:"Title",name:"title",id:"title",type:"text",value:c.title,onChange:({currentTarget:A})=>{w("title",A.value)},placeholder:"Dr"})}function da({fieldName:c,label:w,values:A,options:J,errors:q,touched:Q,handleBlur:ae,setFieldValue:R}){const B=J.map(N=>({label:N,value:N})),$=!!q[c]&&!!Q[c];return s.jsxs(W,{flexDirection:"column",gap:"4px",children:[s.jsx(nr,{textAlign:"justify",htmlFor:c,margin:"0",children:w}),s.jsx(ci,{id:c,height:"auto",fontSize:"14px",minHeight:"48px",optionHeight:"36px",isMulti:!0,isClearable:!1,isInvalid:$,options:B,placeholder:"Please select",value:A[c].map(N=>{var E;return{value:N,label:(E=B.find(ee=>ee.value===N))==null?void 0:E.label}}),onBlur:ae,onChange:N=>{R(c,N.map(E=>E==null?void 0:E.value))},"aria-label":`${c} select`}),$&&s.jsx(hi,{textSize:"xsmall",margin:"0",children:q[c]})]})}function ua({name:c,label:w,limit:A,placeholder:J,values:q,height:Q="104px",setFieldValue:ae,handleBlur:R,setFieldTouched:B,errors:$,touched:N}){return s.jsxs(W,{flexDirection:"column",children:[s.jsx(nr,{htmlFor:c,children:w}),s.jsx(gn,{id:c,height:Q,padding:"8px 12px 8px 12px",onBlur:R,value:q[c],onChange:({currentTarget:E})=>{B(c,!0),ae(c,E.value)},placeholder:J,isInvalid:!!$[c]&&!!N[c]}),s.jsxs(W,{marginTop:"2px",width:"100%",children:[$[c]&&N[c]&&s.jsx(hi,{textSize:"small",margin:"0",children:$[c]}),s.jsx(W,{flex:"1",justifyContent:"flex-end",children:s.jsxs(Ae,{textColor:$[c]&&N[c]?ut:Vi,fontSize:"14px",lineHeight:"18px",margin:"0",padding:"0",children:[q[c].length,"/",A]})})]})]})}const gr=300,ga=hn().shape({jobTitle:Hi().required("This is a required field"),otherTopics:cn().min(1,"Required field"),aboutMe:Hi().max(gr,"Maximum character length exceeded").required("About me is a required field")});function pa({isOpen:c,onClose:w,profile:A,handleSubmit:J,handlePhotoSubmit:q,profilePictureUrl:Q,setProfilePicturePreview:ae}){var j;const[R,B]=Se.useState(!1),[$,N]=Se.useState(!1),{data:E}
32=Qr(),ee=()=>{w()},he={title:A.title||"",firstName:A.firstName||"",lastName:A.lastName||"",location:((j=A.location)==null?void 0:j.toLowerCase())||"",pronouns:A.pronouns||"",jobTitle:A.jobTitle||"",otherTopics:A.otherTopics||[],aboutMe:A.aboutMe||""},G=(y,z)=>{const U={...y};qn(U,z,J,y)},V=()=>{$?B(!0):ee()};return s.jsxs(s.Fragment,{children:[s.jsx(Ye,{show:c,onEscapeKeyDown:V,children:s.jsx(qr,{validateOnChange:!0,initialValues:he,validationSchema:ga,onSubmit:G,children:y=>(setTimeout(()=>{N(y.dirty)}),s.jsxs(Kr,{children:[s.jsx(Ye.Header,{onHide:V,children:s.jsx(Xe,{level:3,children:"Edit profile"})}),s.jsx(Ye.Body,{children:s.jsxs("div",{className:"flex flex-col gap-8",children:[s.jsx("div",{children:"Let's get your profile set up so you can start receiving personalised recommendations and connect with the right experts"}),s.jsxs(W,{gap:"32px",flexDirection:"column",children:[s.jsx(ha,{imageUrl:Q||"",firstName:A.firstName,lastName:A.lastName,handlePhotoSubmit:q,setProfilePicturePreview:ae}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Xe,{level:3,children:"Basic info"}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx("div",{className:"basis-1/2",children:s.jsx(ca,{...y})}),s.jsx("div",{className:"basis-1/2",children:s.jsx(na,{...y})})]}),s.jsx(ea,{...y}),s.jsx(ia,{})]}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Xe,{level:3,children:"Specialisms and areas of interest*"}),s.jsx(da,{fieldName:"otherTopics",label:"Which presentations do you treat and support your clients with, or are areas of interest?",options:E||[],...y,handleBlur:()=>{y.handleBlur("otherTopics"),y.setFieldTouched("otherTopics")}})]}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(Xe,{level:3,children:"About me*"}),s.jsx(ua,{limit:gr,name:"aboutMe",placeholder:"Promote yourself by sharing your approach and experience",label:"Share a brief introduction to yourself with the network, including your approach to your work, and any experiences that highlight your expertise and areas of interest.",height:"150px",...y,handleBlur:()=>{y.handleBlur("aboutMe"),y.setFieldTouched("aboutMe")}})]})]})]})}),s.jsx(Ye.Footer,{children:s.jsxs("div",{className:"flex justify-between",children:[s.jsx("div",{className:"h-[42px]",children:s.jsx($n,{isSubmitting:y.isSubmitting,status:y.status})}),s.jsx(Ne,{disabled:!y.dirty,isProcessing:y.isSubmitting,type:"submit",children:"Update"})]})})]}))})}),s.jsxs(Ye,{show:R,children:[s.jsx(Ye.Header,{onHide:()=>B(!1),children:s.jsx(Xe,{level:2,children:"Unsaved changes"})}),s.jsx(Ye.Body,{children:"Are you sure you want to discard the changes you have made?"}),s.jsx(Ye.Footer,{children:s.jsxs("div",{className:"flex justify-between",children:[s.jsx(Ne,{onClick:()=>B(!1),variant:"tertiary",children:"Continue editing"}),s.jsx(Ne,{onClick:()=>{B(!1),ee()},children:"Discard"})]})})]})]})}function fa(c){return Object.keys(c)}function ma(c,w){return w?fa(c).reduce((A,J)=>Jr.isEqual(w[J],c[J])?A:[...A,J],[]):Object.keys(c)}function xa({profile:c,isLoadingProfiles:w}){const A=new URLSearchParams(window.location.search).get("edit"),J=Qi(),[q,Q]=Se.useState(A!==null),[ae,R]=Se.useState(""),{cognitoId:B}=oi(),$=Jt(m=>tr(m,B)),{recordProfileEvent:N}=Ze();let{data:E,error:ee}=Ji(B,{skip:!B,refetchOnMountOrArgChange:!0});const{data:he,isLoading:G}=er(B),[V]=$r(),[j,{error:y}]=Zr(),z=Jt($i),U=z.cognitoId===B,D=async m=>{var S;try{const{userType:O,otherTopics:k,...v}={...c,...m},x={presentations:k,...v};return await j({patch:x}).unwrap(),y?qt(y)?{ok:!1,errorMessage:JSON.stringify(y.data||y.status)}:Qn(y)?{ok:!1,errorMessage:y.message}:(console.error("received an error during putProfile and it wasn't an AmplifyBaseQueryError or a SerializedError ",y),{ok:!1,errorMessage:"Oops, something went wrong. Try again shortly."}):(N("Clicked Update",{category:"Profile-Setup","Clicked from Location":"Profile Editor","Profile Image":!!E,"Professional Title":(c==null?void 0:c.jobTitle)||"Unknown",Pronouns:(c==null?void 0:c.pronouns)||"Unknown",Location:(c==null?void 0:c.location)||"Unknown",Specialisms:((S=c==null?void 0:c.otherTopics)==null?void 0:S.length)||"Unknown",changedValues:ma(m,c)}),{ok:!0})}catch(O){let k=O.message;
32return qt(O)&&typeof O.data=="string"&&(k=O.data),{ok:!1,errorMessage:k}}},g=async m=>{try{const S=m.type;N("Saved Profile Picture",{mimeType:S});const{presignedPutUrl:O}=await V({mimeType:S}).unwrap();if(O){if((await tn.put(O,m.blob,{headers:{"Content-Type":S,"x-amz-meta-cognito-id":z.cognitoId}})).statusText!=="OK")throw new Error("Failed to upload photo")}else throw new Error("No presigned url provided");return{ok:!0}}catch(S){let O=S.message;return qt(S)&&typeof S.data=="string"&&(O=S.data),{ok:!1,errorMessage:O}}},T=m=>{m===!0&&N("Clicked Edit Profile",{category:"Profile-Setup","Clicked from Location":"Profile"}),Q(m)};return ee&&(E=void 0),s.jsxs(W,{minHeight:"100%",backgroundColor:en,justifyContent:"center",children:[s.jsx("div",{className:"fixed -top-20 left-[-20%] right-[-20%] h-[708px] bg-[#0A392C] rounded-b-[100%]"}),s.jsxs(W,{margin:"62px 0px",zIndex:10,flexDirection:"column",width:"920px",gap:"8px",children:[s.jsx(It,{isOwnProfile:U,setIsEditOpen:T}),s.jsxs(W,{gap:"24px",children:[s.jsxs(W,{flexDirection:"column",gap:"16px",width:"330px",children:[s.jsx(lr,{expertId:B,externalId:$==null?void 0:$.externalId,profile:c,profilePictureUrl:E,profilePicturePreview:ae,isLoading:w}),s.jsx(cr,{following:(he==null?void 0:he.following)||[],isLoading:G,isOwnProfile:U})]}),s.jsxs(W,{flexDirection:"column",gap:"16px",width:"566px",children:[s.jsx(or,{aboutMe:c==null?void 0:c.aboutMe,isLoading:w,isOwnProfile:U}),s.jsx(dr,{topSpecialisms:c==null?void 0:c.otherTopics,isLoading:w,isOwnProfile:U})]})]})]}),!!c&&s.jsx(pa,{isOpen:q,profile:c,profilePictureUrl:ae||E,setProfilePicturePreview:R,handleSubmit:D,onClose:()=>{T(!1),N("Clicked Close",{path:J.pathname,category:"Profile-Setup","Clicked from Location":"Profile Editor"})},handlePhotoSubmit:g})]})}const va="data:image/svg+xml,%3csvg%20width='1440'%20height='657'%20viewBox='0%200%201440%20657'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20style='mix-blend-mode:multiply'%20opacity='0.15'%3e%3cpath%20d='M1693.12%20447.437C1670.56%20491.299%201652.82%20537.639%201601.94%20565.412C1471.51%20636.601%201291.35%20584.001%201182.92%20507.323C1117.44%20461.011%201080.42%20403.397%201060.65%20335.164C1044.01%20277.735%201055.66%20209.081%201027.19%20154.492C980.635%2065.2209%20843.146%2034.0023%20746.077%2077.1915C598.155%20143.007%20526.961%20254.624%20430.769%20361.878C348.53%20453.575%20255.944%20510.104%20115.41%20467.668C0.737564%20433.041%20-95.7437%20371.513%20-168.15%20291.332C-197.291%20259.062%20-221.159%20216.379%20-268.249%20199.975'%20stroke='%238EDCFF'%20stroke-width='120'%20stroke-linecap='round'%20/%3e%3c/g%3e%3c/svg%3e";function Ua(){const c={backgroundImage:`url(${va}), linear-gradient(136deg, #E4F1F9 0%, ${nn} 100%)`,backgroundPosition:"0 34px, 0 0"},{cognitoId:w}=oi(),{data:A,isLoading:J,error:q}=rn(w,{skip:!w}),Q=A==null?void 0:A.userType,ae=Q==="expert"?c:void 0;return q?s.jsx(kn,{background:ae}):!A&&!J?s.jsx(Vn,{previewBackground:ae}):s.jsx(Te,{height:"100%",children:Q==="expert"?s.jsx(Xn,{profile:A,isLoadingProfiles:J,background:c}):s.jsx(xa,{profile:A,isLoadingProfiles:J})})}export{Ua as default};
33//# sourceMappingURL=ProfilePageRoute.DtaaUttO.js.map

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